text:
import healpy as hp
import numpy as np

from .. import timing as timing
from ..map import DistRings, PySMSky, LibSharpSmooth, DistPixels
from ..tod import OpSimScan
from ..mpi import MPI
from ..op import Operator

def extract_local_dets(data):
    """Extracts the local detectors from the TOD objects

    Some detectors could only appear in some observations, so we need
    to loop through all observations and accumulate all detectors in
    a set
    """
    autotimer = timing.auto_timer()
    local_dets = set()
    for obs in data.obs:
        tod = obs['tod']
        local_dets.update(tod.local_dets)
    return local_dets

def assemble_map_on_rank0(comm, local_map, pixel_indices, n_components, npix):
    autotimer = timing.auto_timer()
    full_maps_rank0 = np.zeros((n_components, npix),
                               dtype=np.float64) if comm.rank == 0 else None
    local_map_buffer = np.zeros((n_components, npix),
                                   dtype=np.float64)
    local_map_buffer[:, pixel_indices] = local_map
    comm.Reduce(local_map_buffer, full_maps_rank0, root=0, op=MPI.SUM)
    return full_maps_rank0

def extract_detector_parameters(det, focalplanes):
    autotimer = timing.auto_timer()
    for fp in focalplanes:
        if det in fp:
            if "fwhm" in fp[det]:
                return fp[det]["bandcenter_ghz"], fp[det]["bandwidth_ghz"], \
                    fp[det]["fwhm"] / 60
            else:
                return fp[det]["bandcenter_ghz"], fp[det]["bandwidth_ghz"], -1
    raise RuntimeError("Cannot find detector {} in any focalplane")

class OpSimPySM(Operator):
    """
    Operator which generates sky signal by scanning from a map.

    The signal to use should already be in a distributed pixel structure,
    and local pointing should already exist.

    Args:
        distmap (DistPixels): the distributed map domain data.
        pixels (str): the name of the cache object (<pixels>_<detector>)
            containing the pixel indices to use.
        weights (str): the name of the cache object (<weights>_<detector>)
            containing the pointing weights to use.
        out (str): accumulate data to the cache with name <out>_<detector>.
            If the named cache objects do not exist, then they are created.
        units(str): Output units.
        debug(bool):  Verbose progress reports.
    """

    def __init__(self, comm=None,
                 out='signal', pysm_model='', pysm_precomputed_cmb_K_CMB=None,
                 focalplanes=None, nside=None,
                 subnpix=None, localsm=None, apply_beam=False, nest=True,
                 units='K_CMB', debug=False, coord="G"):
        autotimer = timing.auto_timer(type(self).__name__)
        # We call the parent class constructor, which currently does nothing
        super().__init__()
        self._out = out
        self._nest = nest
        self.comm = comm
        self._debug = debug
        self.pysm_precomputed_cmb_K_CMB = pysm_precomputed_cmb_K_CMB
        self.dist_rings = DistRings(comm,
                                    nside=nside,
                                    nnz=3)
        self.coord = coord

        pysm_sky_components = [
            'synchrotron',
            'dust',
            'freefree',
            'cmb',
            'ame',
        ]
        pysm_sky_config = dict()
        for component_model in pysm_model.split(','):
            full_component_name = [
                each for each in pysm_sky_components
                if each.startswith(component_model[0])][0]
            pysm_sky_config[full_component_name] = component_model
        self.pysm_sky = PySMSky(comm=self.comm,
                                local_pixels=self.dist_rings.local_pixels,
                                nside=nside, pysm_sky_config=pysm_sky_config,
                                pysm_precomputed_cmb_K_CMB=self.pysm_precomputed_cmb_K_CMB,
                                units=units)

        self.nside = nside
        self.focalplanes = focalplanes
        self.npix = hp.nside2npix(nside)
        self.distmap = DistPixels(
            comm=comm, size=self.npix, nnz=3,
            dtype=np.float32, submap=subnpix, local=localsm)
        self.apply_beam = apply_beam

    def __del__(self):
        # Ensure that the PySMSky member is destroyed first because
        # it contains a reference to self.dist_rings.local_pixels
        del self.pysm_sky
        del self.dist_rings
        del self.distmap

    def exec(self, data):
        autotimer = timing.auto_timer(type(self).__name__)
        local_dets = extract_local_dets(data)

        bandpasses = {}
        fwhm_deg = {}
        N_POINTS_BANDPASS = 10  # possibly take as parameter
        for det in local_dets:
            bandcenter, bandwidth, fwhm_deg[det] = \
                    extract_detector_parameters(det, self.focalplanes)
            bandpasses[det] = \
                (np.linspace(bandcenter - bandwidth / 2,
                             bandcenter + bandwidth / 2,
                             N_POINTS_BANDPASS),
                 np.ones(N_POINTS_BANDPASS))

        lmax = 3 * self.nside - 1

        if self.comm.rank == 0 and self._debug:
            print('Collecting, Broadcasting map', flush=True)
        start = MPI.Wtime()
        local_maps = dict()  # FIXME use Cache instead
        for det in local_dets:
            self.comm.Barrier()
            if self.comm.rank == 0 and self._debug:
                print('Running PySM on {}'.format(det), flush=True)
            self.pysm_sky.exec(local_maps, out="sky",
                               bandpasses={"": bandpasses[det]})

            if self.apply_beam:
                if fwhm_deg[det] == -1:
                    raise RuntimeError(
                        "OpSimPySM: apply beam is True but focalplane doesn't "
                        "have fwhm")
                # LibSharp also supports transforming multiple channels
                # together each with own beam
                self.comm.Barrier()
                if self.comm.rank == 0 and self._debug:
                    print('Initializing LibSharpSmooth on {}'.format(det),
                          flush=True)
                smooth = LibSharpSmooth(
                    self.comm, signal_map="sky", out="sky",
                    lmax=lmax, grid=self.dist_rings.libsharp_grid,
                    fwhm_deg=fwhm_deg[det], beam=None)
                self.comm.Barrier()
                if self.comm.rank == 0 and self._debug:
                    print('Executing LibSharpSmooth on {}'.format(det),
                          flush=True)
                smooth.exec(local_maps)
                self.comm.Barrier()
                if self.comm.rank == 0 and self._debug:
                    print('LibSharpSmooth completed on {}'.format(det),
                          flush=True)

            n_components = 3

            self.comm.Barrier()
            if self.comm.rank == 0 and self._debug:
                print('Assemble PySM map on rank0, shape of local map is {}'
                      ''.format(local_maps["sky"].shape), flush=True)
            full_map_rank0 = assemble_map_on_rank0(
                self.comm, local_maps["sky"], self.dist_rings.local_pixels,
                n_components, self.npix)

            self.comm.Barrier()
            if self.comm.rank == 0 and self._debug:
                print('Communication completed', flush=True)
            if self.comm.rank == 0 and self.coord != "G":
                # PySM is always in Galactic, make rotation to Ecliptic or Equatorial
                rot = hp.Rotator(coord = ["G", self.coord])
                # this requires healpy 1.12.8
                try:
                    full_map_rank0 = rot.rotate_map_alms(full_map_rank0, use_pixel_weights=True)
                except AttributeError:
                    print('PySM coordinate conversion from G to another reference frame requires'
                          'healpy.Rotator.rotate_map_alms available since healpy 1.12.8')
                    raise
            if self.comm.rank == 0 and self._nest:
                # PySM is RING, toast is NEST
                full_map_rank0 = hp.reorder(full_map_rank0, r2n=True)
            # full_map_rank0 dict contains on rank 0 the smoothed PySM map

            self.comm.Barrier()
            if self.comm.rank == 0 and self._debug:
                print('PySM map min and max pixel value', hp.ma(full_map_rank0).min(), hp.ma(full_map_rank0).max(), flush=True)
                print('Broadcasting the map to other processes', flush=True)
            self.distmap.broadcast_healpix_map(full_map_rank0)
            self.comm.Barrier()
            if self.comm.rank == 0 and self._debug:
                print('Running OpSimScan', flush=True)
            scansim = OpSimScan(distmap=self.distmap, out=self._out, dets=[det])
            scansim.exec(data)
            if self.comm.rank == 0 and self._debug:
                tod = data.obs[0]["tod"]
                sig = tod.cache.reference(self._out + "_" + det)
                print('Rank 0 timeline min max after smoothing', sig.min(), sig.max(), flush=True)

        stop = MPI.Wtime()
        if self.comm.rank == 0:
            print('PySM Operator completed:  {:.2f} seconds'
                  ''.format(stop - start), flush=True)


text:
'use strict';

module.exports = require('./async').rejectSeries;

redpajama_set_name: RedPajamaGithub


text:
package com.adobe.dp.css;

import java.io.PrintWriter;

public class CSSLength extends CSSValue {

	double value;

	String unit;

	public CSSLength(double value, String unit) {
		this.value = value;
		this.unit = unit;
	}

	public double getValue() {
		return value;
	}

	public String getUnit() {
		return unit;
	}

	public String toString() {
		double sv = Math.round(value * 1000) / 1000.0;
		if (sv == (int) sv)
			return (int) sv + unit;
		return sv + unit;
	}

	public void serialize(PrintWriter out) {
		double sv = Math.round(value * 1000) / 1000.0;
		if (sv == (int) sv)
			out.print((int) sv);
		else
			out.print(sv);
		out.print(unit);
	}

	public int hashCode() {
		return (int) Math.round(value * 1000) + unit.hashCode();
	}

	public boolean equals(Object other) {
		if (other.getClass() == getClass()) {
			CSSLength o = (CSSLength) other;
			return o.value == value && o.unit.equals(unit);
		}
		return false;
	}
}


text:
default['enterprise']['name'] = 'private_chef'
default['pushy']['install_path'] = "/opt/opscode-push-jobs-server"

default['pushy']['bootstrap']['enable'] = true
default['pushy']['chef_base_path'] = "/opt/opscode"

####
# Pushy Server
####
default['pushy']['opscode-pushy-server']['enable'] = true
default['pushy']['opscode-pushy-server']['ha'] = false
default['pushy']['opscode-pushy-server']['dir'] = "/var/opt/opscode-push-jobs-server/opscode-pushy-server"

default['pushy']['opscode-pushy-server']['log_directory'] = "/var/log/opscode/opscode-pushy-server"
default['pushy']['opscode-pushy-server']['log_rotation']['file_maxbytes'] = 104857600
default['pushy']['opscode-pushy-server']['log_rotation']['num_to_keep'] = 10

default['pushy']['opscode-pushy-server']['listen'] = '127.0.0.1'
default['pushy']['opscode-pushy-server']['db_pool_size'] = '20'

default['pushy']['opscode-pushy-server']['ibrowse_max_sessions'] = 256
default['pushy']['opscode-pushy-server']['ibrowse_max_pipeline_size'] = 1

# Sets the rate of heartbeats between server and client (in milliseconds)
default['pushy']['opscode-pushy-server']['heartbeat_interval'] = '10000'

default['pushy']['opscode-pushy-server']['zeromq_listen_address'] = 'tcp://*'
default['pushy']['opscode-pushy-server']['zmq_io_processes'] = '1'

# server_name_advertised is the name the push server provides to clients to use for zeromq connections, and
# must be and address clients can reach. This server may lie on the back end, so in HA configurations it will
# eventually need to route to the backend VIP.  nil defaults to using node['pushy']['opscode-pushy-server']['vip']
default['pushy']['opscode-pushy-server']['server_name_advertised'] = nil
default['pushy']['opscode-pushy-server']['vip'] = '127.0.0.1'
default['pushy']['opscode-pushy-server']['server_heartbeat_port'] = '10000'
default['pushy']['opscode-pushy-server']['command_port'] = '10002'
default['pushy']['opscode-pushy-server']['api_port'] = '10003'
default['pushy']['opscode-pushy-server']['down_threshold'] = '0.6'
default['pushy']['opscode-pushy-server']['decay_window'] = '4'
default['pushy']['opscode-pushy-server']['detect_offline_nodes_interval'] = '4'
default['pushy']['opscode-pushy-server']['validate_client_node_name'] = 'true'
default['pushy']['opscode-pushy-server']['enable_graphite'] = false
default['pushy']['opscode-pushy-server']['graphite_host'] = 'localhost'
default['pushy']['opscode-pushy-server']['graphite_port'] = '2003'
default['pushy']['opscode-pushy-server']['keyring_dir'] = '/etc/opscode-push-jobs-server'

default['pushy']['opscode-pushy-server']['chef_api_version'] = '11.1.0' # API Version used to query Erchef

###
# PostgreSQL
###
default['pushy']['postgresql']['database_name'] = "opscode_pushy"
default['pushy']['postgresql']['username'] = "opscode-pgsql"
default['pushy']['postgresql']['sql_user'] = "opscode_pushy"
default['pushy']['postgresql']['sql_password'] = "snakepliskin"
default['pushy']['postgresql']['sql_ro_user'] = "opscode_pushy_ro"
default['pushy']['postgresql']['sql_ro_password'] = "shmunzeltazzen"
default['pushy']['postgresql']['vip'] = "127.0.0.1"
default['pushy']['postgresql']['port'] = 5432

####
# Chef Pedant
####
default['pushy']['oc-chef-pedant']['dir'] = "/var/opt/opscode/oc-chef-pedant"
default['pushy']['oc-chef-pedant']['log_directory'] = "/var/log/opscode/oc-chef-pedant"
default['pushy']['oc-chef-pedant']['log_http_requests'] = true
default['private_chef']['oc-chef-pedant']['log_rotation']['file_maxbytes'] = 104857600
default['private_chef']['oc-chef-pedant']['log_rotation']['num_to_keep'] = 10
default['private_chef']['oc-chef-pedant']['debug_org_creation'] = false


text:
import { Tag } from './tag.model';

export class HashTag extends Tag {
    url: String;
}


text:
import os
import sys

import glob

from setuptools import setup

import versioneer

# This dynamically loads a module and return it in a variable.
# Will use it for check optional dependencies

def is_module_available(module_name):

    # Fast path: see if the module has already been imported.

    try:

        exec("import %s" % module_name)

    except ImportError:

        return False

    else:

        return True

# Create list of data files
def find_data_files(directory):

    paths = []

    for (path, directories, filenames) in os.walk(directory):

        for filename in filenames:

            paths.append(os.path.join("..", path, filename))

    return paths

extra_files = find_data_files("threeML/data")

# This list will contain the messages to print just before the end of the setup
# so that the user actually note them, instead of loosing them in the tons of
# messages of the build process

setup(
    packages=[
        "threeML",
        "threeML/exceptions",
        "threeML/bayesian",
        "threeML/minimizer",
        "threeML/utils",
        "threeML/utils/OGIP",
        "threeML/utils/spectrum",
        "threeML/utils/polarization",
        "threeML/utils/photometry",
        "threeML/utils/time_series",
        "threeML/utils/data_builders",
        "threeML/utils/data_builders/fermi",
        "threeML/utils/data_download",
        "threeML/utils/data_download/Fermi_LAT",
        "threeML/utils/data_download/Fermi_GBM",
        "threeML/utils/fitted_objects",
        "threeML/utils/statistics",
        "threeML/plugins",
        "threeML/classicMLE",
        "threeML/catalogs",
        "threeML/io",
        "threeML/io/plotting",
        "threeML/io/cern_root_utils",
        "threeML/parallel",
        "threeML/config",
        "threeML/test",
        "threeML/plugins/experimental",
    ],
    cmdclass=versioneer.get_cmdclass(),
    version=versioneer.get_version(),
    license="BSD-3",
    keywords=[
        "Likelihood",
        "Multi-mission",
        "3ML",
        "HAWC",
        "Fermi",
        "HESS",
        "joint",
        "fit",
        "bayesian",
        "multi-wavelength",
    ],
    # NOTE: we use '' as package name because the extra_files already contain the full path from here
    package_data={"": extra_files,},
)  # End of setup()

# Check for optional dependencies

optional_dependencies = {
    "cthreeML": [False, "needed by HAWC plugin"],
    "pymultinest": [False, "provides the Multinest sampler for Bayesian analysis"],
    "ultranest": [False, "procides the UltraNest sampler for Bayesian Analysis"],
    "zeus": [False, "procides the zeus sampler for Bayesian Analysis"],
    "pyOpt": [False, "provides more optimizers"],
    "ROOT": [False, "provides the ROOT optimizer"],
    "ipywidgets": [False, "provides widget for jypyter (like the HTML progress bar)"],
    "chainconsumer": [False, "consumes the chains output from Monte Carlo processes"],
}

for dep_name in optional_dependencies:

    optional_dependencies[dep_name][0] = is_module_available(dep_name)

# Now print the final messages

print("\n\n##################")
print("OPTIONAL FEATURES:")
print("##################\n\n")

for dep_name in optional_dependencies:

    if optional_dependencies[dep_name][0]:

        status = "available"

    else:

        status = "*NOT* available"

    print(" * %s is %s (%s)\n" % (dep_name, status, optional_dependencies[dep_name][1]))


text:
import { CloudFunction, Event } from '../cloud-functions';
export declare function database(database?: string): DatabaseBuilder;
export declare function namespace(namespace: string): NamespaceBuilder;
export declare function document(path: string): DocumentBuilder;
export declare class DatabaseBuilder {
    private resource;
    namespace(namespace: string): NamespaceBuilder;
    document(path: string): DocumentBuilder;
}
export declare class NamespaceBuilder {
    private resource;
    document(path: string): DocumentBuilder;
}
export declare class DocumentBuilder {
    private resource;
    onWrite(handler: (event: Event<any>) => PromiseLike<any> | any): CloudFunction<any>;
}


text:
- Done through the `File` class
- File size is returned in bytes
- `nil` is returned when file size is zero(0)
## Reading from a file
To prevent needing to call close, a block can be passed to `File#open` or `IO#foreach` can be used

```ruby
# All of the following are equivalent
myfile = File.open("textfile.txt", "r")
myfile.each_line {|line| puts line}
myfile.close

File.open("textfile.txt") do |myfile|
  myfile.each_line {|line| puts line}
end

IO.foreach("textfile.txt") {|line| puts line}
```
## Writing to a file
Any data can be written to a file as long as it has a `to_s` method

```ruby
# The following are equivalent
count = 10

# using the write method
File.open("textfile.txt", "w") do |myfile|
  myfile.write("Howdy!\n")
  myfile.write("There are ")
  myfile.write(count)
  myfile.write(" pandas!")
end

# using the << operator
File.open("textfile.txt", "w") do |myfile|
  myfile << "Howdy!\n" << "There are " << count << " pandas!"
end
```
# Threads, Forks, and Processes
## Threads
- To create a thread, just pass a code block to the `Thread` class's constructor

  ```ruby
  mythread = Thread.new() do
    # some awesome thread logic
  end
  ```
- Threads start right after they are created
- Call `mythread.join()` to have your program wait for a thread to complete before exiting. Otherwise, all threads are exited when the main thread exits
### Controlling threads
- `Thread#pass` to pause a thread and let another thread run
- `Thread#stop` to stop a thread until it is restarted
- `Thread#run` to restart a stopped thread
- To exit a thread completely, `Thread#exit` from in a thread or `Thread.kill(threadToKill)` from outside
### Getting information from threads
- Call `#value` on a thread to block and get the value it returns (like a Java Future)
## Processes
- `system` spawns an external application in a subprocess
- `IO#popen` will spawn an application and then give you a stream which you can read from and write to just like any other stream
- Can use `exec` if you need to execute a process and then wait for it to finish using `Process.wait` before continuing
# Environment
- Access environment variables using `ENV['varname']` and `ENV['varname'] = newvalue`
- All changes stay local to the Ruby application
- Access command line args using the global array `ARGV`
- Access config vars by including the `Config` module and using global array `CONFIG`
- There are a bunch of Windows specific libraries. Stupid Windows


text:
Dixi Under the Hood
===================

Dixi is built on top of Sinatra and Git. Instead of using a
traditional database, content is stored as YAML files in a Git
repository.

Why the unconventional system?
------------------------------

* Databases make setup and maintenance more difficult and time
  consuming.

* Not using a database gives Dixi more agility. There are no
  migrations to apply, columns and tables to manage, etc.

* Git provides fast and easy revision control and content backup.
  Off-site data backups are just a "git pull" away.

* It's easy to process or edit the YAML files by hand or by script if
  desired. You can even modify them locally and then merge the changes
  into the production repository when you're done.

Glossary
--------

The following terms are used in this document, and throughout Dixi:

Resource
  : A document that users can read, create, and edit. API entries,
    tutorials, comments, etc.

Parent (resource, class, module, or method)
  : The resource which contains another resource. For example, a
    method's parent is the class or module to which it belongs.

Child (resource, class, module, or method)
  : The inverse of parent. A method is the child of the class or
    module to which it belongs.

Base (resource, class, module, or method)
  : The resource from which this is derived. A resource inherits
    properties from its base resource. For classes, base means the
    superclass. For methods, it means the super method. The definiton is
    more fuzzy for modules, but one example would be a module which is
    intended as a replacement for another module.

    Note that classes and modules also have the separate concept of
    included modules. Properties from included modules are also
    inherited. Use whichever way best describes the relationship
    between resources.

Revision
  : A modification to a resource, stored in the Git repository. Also
    known as a commit, edit, or changeset.

Project
  : The software being documented (e.g. "Rubygame").

Version
  : A specific version of the project (e.g. "2.6").

API data directory structure
----------------------------

API docs are stored in a hierarchical directory structure that mimics
the hierarchy of modules, classes, and methods in the project's code.
In general:

  contents/{project}/{version}/api/{api_path}-{type_suffix}.yaml

For example, the documentation for Rubygame::Surface#blit in Rubygame
2.6.2 would be stored at:

  contents/rubygame/2.6.2/api/Rubygame/Surface/blit-im.yaml

Documentation for the Rubygame::Surface class itself would be at:

  contents/rubygame/2.6.2/api/Rubygame/Surface-c.yaml

The possible type suffixes are:

* m  (module)
* c  (class)
* mm (module method)
* cm (class method)
* im (instance method)

Punctuation in method names is preserved in the filename. So, a class
method "open?" would have the filename "open?-cm.yaml". An instance
method "-" would be "--im.yaml". However some puncuation will be
escaped in URIs. See the section below.

Index
-----

Dixi maintains an "index" for each version of each project. The index
is a list of all the resources in that version of the project, with
certain data about the resource, such as its name, type, and synopsis.

The purpose of the index is to improve performance by reducing the
number of files that need to be accessed when handling each request.
Instead of loading each resource from disk to find its synopsis (for
example), the index can be loaded once to find the synopses of all
resources.

The index is maintained in "index.yaml" within the project version
directory (e.g. ("contents/rubygame/2.6.2/index.yaml"). The index is a
mapping (hash table), with each key being the resource ID, and each
value being a mapping of the resource's relevant data.

The index is updated whenever a resource is changed.

A simple example index:

    ---
    api/Rubygame-m:
      file: rubygame/2.6.2/api/Rubygame-m.yaml
      name: Rubygame
      type: module
      synopsis:
        Top level module for Rubygame.

    api/Rubygame/Surface-c:
      file: rubygame/2.6.2/api/Rubygame/Surface-c.yaml
      name: Rubygame::Surface
      type: class
      synopsis:
        Surface represents an image, a block of colored pixels
        arranged in a 2D grid.

    api/Rubygame/Surface/blit-im:
      file: rubygame/2.6.2/api/Rubygame/Surface/blit-im.yaml
      name: Rubygame::Surface#blit
      type: instance method
      synopsis:
        Blit (copy) all or part of the Surface's image to
        another Surface.

Web Interface
-------------

Resource URIs resembles the "contents" directory structure.

Assuming the root URI of the Dixi site is "http://dixi.foo/", the
URI for the Rubygame::Surface class in Rubygame 2.6.2 would be:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface

Note that it is NOT "Rubygame-m" or "Surface-c". For modules and
classes, the type suffix is omitted from the URI. You can't have have
a module and a class with the same name, so no type is necessary to
unambiguously identify the resource.

For methods, the situation is different, because it's possible to have
multiple methods with the same name, but different types (module,
class, or instance).

The canonical URI for Rubygame::Surface#blit in Rubygame 2.6.2 would
be:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface/blit-im

However, if there is only one method of that name, the following URI
is encouraged, and is used by Dixi when generating links to read the
resource (but not links to edit the resource):

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface/blit

If there are multiple methods with the same name, visiting that URI
will display a disambiguation page, listing the synopses of the
methods and offering links to the URIs with type suffixes.

For editing operations (e.g. creating, updating, and deleting), and
for accessing the resource as YAML, the typed URI should always be
used.

### Punctuation in URIs

The following punctuation characters should be escaped in URIs when
used literally as part of a method name:

* "%" should be "%25"
* "?" should be "%3F"
* "+" should be "%2B"

As a user convenience, Dixi will redirect the user to the correct URI
if it detects that those puncuation marks were probably meant literally.
For example, visiting this URI:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Screen/open?

Will redirect the user to the correct URI:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Screen/open%3F

Dixi does not do this kind of redirection for editing operations or
for acessing the resource as YAML, so the punctuation must be properly
escaped in those cases.

YAML Interface
------------------

### GET (reading a resource)

API resources are also served as YAML files, by adding ".yaml" to the
URI:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface/blit-im.yaml

Punctuation must be properly escaped in the URI, as mentioned above.
For example, the following URI is invalid:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Screen/open?-cm.yaml

It should be:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Screen/open%3F-cm.yaml

The "typed" URI should always be used. However, Dixi may perform
redirection in unambiguous cases. For example:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface.yaml

Will redirect to the correct URI:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface-c.yaml

If an untyped request is ambiguous (such as when there are multiple
methods with the name same), Dixi will serve a YAML-formatted error
message containing proper URIs to the possible resources.

### PUT (creating or updating a specific resource)

In addition to GET (as decribed above), Dixi supports the HTTP PUT,
POST, and DELETE methods for YAML files, to allow creating and
accessing Dixi via many different types of software.

PUT is used to create or update a resource at a specific address. It
is valid for modules, classes, and methods (and other resource types,
when they are implemented). For example, to create or update the
Surface class, you could PUT some YAML data (in the format described
in format.markdown) to this URI:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface-c.yaml

If your YAML data includes a resource type, it is also permissible to
PUT to an untyped URI, such as:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface.yaml

If the YAML data does not include a resource type, or if the type is a
class and there is an existing module by that name (or vice versa),
the PUT will fail and return a YAML-formatted message structure
indicating the error.

If the request succeeds, Dixi will serve a YAML-formatted success
message containing the URI for the created/updated resource.

### POST (creating or updating a child resource)

POST is used to create or update a resource under a parent resource.
The POST request is sent to the parent resource's URI, but results in
creating a child resource.

Note: POST is discouraged for creating API entries; you should use PUT
instead, as described above. But you could create POST the YAML data
for a method to this URI to add that method to the Surface class:

  http://dixi.foo/rubygame/2.6.2/api/Rubygame/Surface.yaml

If the request succeeds, Dixi will serve a YAML-formatted success
message containing the URI for the created/updated resource.

### DELETE (deleting a resource and its children)

If you send a DELETE method to a resource's URI, that resource and all
its children will be deleted.

If the request succeeds, Dixi will serve a YAML-formatted success
message containing the URIs of all the resources (including children)
that were deleted.

Inheritance from earlier versions
---------------------------------

Each version implicitly inherits content from earlier versions, unless
that content is overridden in the new version. For example, consider
three versions of a library with the following content:

* 1.0:
** Foo.yaml
* 2.0:
** Bar.yaml
** Bar/Baz.yaml
* 3.0:
** Foo.yaml

In this setup, version 1.0 has "Foo" docs only. Version 2.0 has "Bar"
and "Bar/Baz" docs, and also inherits version 1.0's "Foo" docs.
Version 3.0 inherits version 2.0's "Bar" and "Bar/Baz" docs, but
overrides version 1.0's "Foo" docs with a new definition.

Auxillary content
---

### Comments

To be written.

### Articles (Tutorials/Guides)

To be written.


text:
Performance Analysis Summary

      This tool is experimental. Please report an issue
      here if the
      analysis result seems off.

<mat-divider></mat-divider>

Summary of All Input Pipelines

<mat-divider></mat-divider>

Input Pipeline Graph

      <category-filter
        [dataTable]="dataTable"
        column="Host"
        (changed)="updateFilters($event)"
      >
      </category-filter>
      <category-filter
        [dataTable]="dataTable"
        column="Input Pipeline"
        (changed)="updateFilters($event)"
      >
      </category-filter>
      <category-filter [dataTable]="dataTable" column="Rank" (changed)="updateFilters($event)">
      </category-filter>

  <org-chart [dataView]="orgChartDataView"></org-chart>


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter 19. Boost.MPI</title>
<link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="libraries.html" title="Part I. The Boost C++ Libraries (BoostBook Subset)">
<link rel="prev" href="boost/forward.html" title="Function template forward">
<link rel="next" href="mpi/getting_started.html" title="Getting started">

Home
Libraries
People
FAQ
More

Chapter 19. Boost.MPI

Douglas Gregor

Matthias Troyer

Copyright © 2005-2007 Douglas Gregor,
      Matthias Troyer, Trustees of Indiana University

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at
        http://www.boost.org/LICENSE_1_0.txt )

Table of Contents

Introduction

Getting started

MPI Implementation

Configure and Build

Installing and Using Boost.MPI

Testing Boost.MPI

Tutorial

Point-to-Point communication

Collective operations

Managing communicators

Separating structure from content

Performance optimizations

Mapping from C MPI to Boost.MPI

Reference

Header <boost/mpi.hpp>

Header <boost/mpi/allocator.hpp>

Header <boost/mpi/collectives.hpp>

Header <boost/mpi/collectives_fwd.hpp>

Header <boost/mpi/communicator.hpp>

Header <boost/mpi/config.hpp>

Header <boost/mpi/datatype.hpp>

Header <boost/mpi/datatype_fwd.hpp>

Header <boost/mpi/environment.hpp>

Header <boost/mpi/exception.hpp>

Header <boost/mpi/graph_communicator.hpp>

Header <boost/mpi/group.hpp>

Header <boost/mpi/intercommunicator.hpp>

Header <boost/mpi/nonblocking.hpp>

Header <boost/mpi/operations.hpp>

Header <boost/mpi/packed_iarchive.hpp>

Header <boost/mpi/packed_oarchive.hpp>

Header <boost/mpi/python.hpp>

Header <boost/mpi/request.hpp>

Header <boost/mpi/skeleton_and_content.hpp>

Header <boost/mpi/skeleton_and_content_fwd.hpp>

Header <boost/mpi/status.hpp>

Header <boost/mpi/timer.hpp>

Python Bindings

Quickstart

Transmitting User-Defined Data

Collectives

Skeleton/Content Mechanism

C++/Python MPI Compatibility

Reference

Design Philosophy

Performance Evaluation

Revision History

Acknowledgments

Introduction

      Boost.MPI is a library for message passing in high-performance parallel applications.
      A Boost.MPI program is one or more processes that can communicate either via
      sending and receiving individual messages (point-to-point communication) or
      by coordinating as a group (collective communication). Unlike communication
      in threaded environments or using a shared-memory library, Boost.MPI processes
      can be spread across many different machines, possibly with different operating
      systems and underlying architectures.

      Boost.MPI is not a completely new parallel programming library. Rather, it
      is a C++-friendly interface to the standard Message Passing Interface (MPI), the most popular library
      interface for high-performance, distributed computing. MPI defines a library
      interface, available from C, Fortran, and C++, for which there are many MPI implementations.
      Although there exist C++ bindings for MPI, they offer little functionality
      over the C bindings. The Boost.MPI library provides an alternative C++ interface
      to MPI that better supports modern C++ development styles, including complete
      support for user-defined data types and C++ Standard Library types, arbitrary
      function objects for collective algorithms, and the use of modern C++ library
      techniques to maintain maximal efficiency.

      At present, Boost.MPI supports the majority of functionality in MPI 1.1. The
      thin abstractions in Boost.MPI allow one to easily combine it with calls to
      the underlying C MPI library. Boost.MPI currently supports:

          Communicators: Boost.MPI supports the creation, destruction, cloning, and
          splitting of MPI communicators, along with manipulation of process groups.

          Point-to-point communication: Boost.MPI supports point-to-point communication
          of primitive and user-defined data types with send and receive operations,
          with blocking and non-blocking interfaces.

          Collective communication: Boost.MPI supports collective operations such
          as reduce
          and gather
          with both built-in and user-defined data types and function objects.

          MPI Datatypes: Boost.MPI can build MPI data types for user-defined types
          using the Boost.Serialization
          library.

          Separating structure from content: Boost.MPI can transfer the shape (or
          "skeleton") of complexc data structures (lists, maps, etc.) and
          then separately transfer their content. This facility optimizes for cases
          where the data within a large, static data structure needs to be transmitted
          many times.

      Boost.MPI can be accessed either through its native C++ bindings, or through
      its alternative, Python interface.

Last revised: January 31, 2013 at 01:30:56 GMT


text:
<!DOCTYPE html>

        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title th:text="#{login.title}">Login</title>
        <meta name="description" content=""/>
        <meta name="author" content="Southwestern Adventist University"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="shortcut icon"                    href="../../../resources/img/favicon.ico" th:href="@{/resources/img/favicon.ico}" type="image/x-icon" />
        <link rel="apple-touch-icon" sizes="144x144" href="../../../resources/img/apple-touch-icon-144x144.png" th:href="@{/resources/img/apple-touch-icon-144x144.png}" />
        <link rel="apple-touch-icon" sizes="114x114" href="../../../resources/img/apple-touch-icon-114x114.png" th:href="@{/resources/img/apple-touch-icon-114x114.png}" />
        <link rel="apple-touch-icon" sizes="72x72"   href="../../../resources/img/apple-touch-icon-72x72.png" th:href="@{/resources/img/apple-touch-icon-72x72.png}" />
        <link rel="apple-touch-icon"                 href="../../../resources/img/apple-touch-icon.png" th:href="@{/resources/img/apple-touch-icon.png}" />

        <link rel="stylesheet" href="../../../resources/css/jquery-ui.min.css" th:href="@{/resources/css/jquery-ui.min.css}" />
        <link rel="stylesheet" href="../../../resources/css/bootstrap.min.css" th:href="@{/resources/css/bootstrap.min.css}" />
        <link rel="stylesheet" href="../../../resources/css/bootstrap-theme.min.css" th:href="@{/resources/css/bootstrap-theme.min.css}" />
        <link rel="stylesheet" href="../../../resources/css/font-awesome.min.css" th:href="@{/resources/css/font-awesome.min.css}" />
        <link rel="stylesheet" href="../../../resources/css/main.css" th:href="@{/resources/css/main.css}" />

Home


text:
from __future__ import absolute_import

from django.db import models

from ckeditor_uploader.fields import RichTextUploadingField
from ckeditor.fields import RichTextField

class ExampleModel(models.Model):
    content = RichTextUploadingField()

class ExampleNonUploadModel(models.Model):
    content = RichTextField()


text:
/** @jsx React.DOM */

var React = require("react");
var Promise = require('es6-promise').Promise;
var AsyncState = require('react-router').AsyncState;

var SurveyTable = require('./survey_table');

var ListSurveys = React.createClass({
  mixins:[AsyncState],

  statics:{
    getInitialAsyncState: function(path, query, setState){
      return new Promise(function(resolve, reject){
        setTimeout(function () {
          setState({
            surveys:[
              {
                id: 'asd123',
                uri: 'asd123',
                editUri: 'ad123',
                title: 'Superhero mashup',
                publishedDate: new Date(),
                modifiedDate: new Date(),
                activity: [121,32,54,12,546]
              }
            ]
          })
          resolve();
        }, 100);
      });
    }
  },

  render: function(){
    if(!this.state.surveys){
      return
Loading ...

    }

    return (

Active Surveys

        <SurveyTable surveys={this.state.surveys}/>

    );
  }
});

module.exports = ListSurveys;


text:
title: "What Makes a Good iOS App?"
description: "Tech Rapport's Blog - What makes a good iOS App?"
category: [iOS Development]
published: true
comments: true
tags: [ios development, software, swift, iPhone apps, XCode 7.0, programming]
permalink: /ios%20dev/2015/10/13/what-makes-good-ios-apps.html
redirect_from: what-makes-good-ios-apps/
image:
  feature: app-store.jpg
---

Think about some of your favorite iPhone applications.  What do they do better than others?  What is different about them?  What makes them so great?

I think it is the combination of several key factors.

+  User Interface/User Experience
+  Delivers on Features
+  Bug free!
+  Frequent Updates

Let's first look into the User Interface/User Experience area, then we'll touch on each of these areas separately and provide examples where some apps excel and others fail.

###User Interface/User Experience
How many times have you read the description of an app and decided that it was worth a look, only to find that it was unusable, confusing, ugly and just down right annoying to use?  What do you do when you are faced with this scenario?  I know what I do.  I delete the app and download another that does the same thing.

You could write the best code, but without a good UI, you might as well stop!

Apple is a company that is built on the idea that design is as important, if not more so, than performance when it comes to personal computing.  This is what has kept them relevant and what has made them excel to become the most profitable company of our generation.

Apple has done an incredible job at designing built-in design elements and implementing them into their frameworks and the iOS SDK.  They have also written a brilliant guide about how to design your iOS apps using familiar design paradigms and elements.  I suggest that every iOS developer read this [article](https://developer.apple.com/design/).  Apple is so keen on design, that they showcase the best app designs each year and give out [Apple Design Awards](https://en.wikipedia.org/wiki/Apple_Design_Awards) to the developers.

####Here are a few links to other websites that have written about Apple's design:

+  [Designshack.com's 15 design tips to learn from apple](http://designshack.net/articles/inspiration/15-design-tips-to-learn-from-apple)
+  [MEMET Circus' article on iOS UX](http://memetcircus.com/?p=87)
+  [Design Leadership Principles of Steve Jobs and the Apple ...](http://www.girvin.com/blog/?p=5202)
+  [The 6 Pillars Of Steve Jobs's Design Philosophy | Co.Design](http://www.fastcodesign.com/1665375/the-6-pillars-of-steve-jobss-design-philosophy)

My favorite apps that showcase great UI/UX and great design are:

+  [1Password](https://agilebits.com/onepassword) by AgileBits
+  [Paper](http://www.fiftythree.com/paper) by FiftyThree
+  [Workflow](https://my.workflow.is/) by DeskConnect

####Here is a short video showcasing the User Interface of Paper:
<figure class="one center">
	<iframe width="560" height="315" src="https://fiftythree.github.io/assets.fiftythree.com/videos/paper/paper-web-1080.mp4" frameborder="0"> </iframe>
	<figcaption>Paper by FiftyThree</figcaption>
</figure>

###Delivers on Features

An application is only as good as the service(s) that it provides. It's important to keep in mind that applications are used by iOS users in order for them to expand on their mobile experience. Apps are what makes the iOS platform so amazing.  You can turn the computer in your pocket into almost anything!  You can use it as a flashlight, a level, a ruler, a notebook, or for productivity tasks, such as word processing or as an audio production tool.

Developers and their apps are the bread and butter of the iOS ecosystem.  The best apps go above and beyond to pack in as much functionality as possible to conquer the tasks that they are built to do.

###Bug free!

While bug free software is a myth, a developer can definitely do a lot of things to avoid fatal errors and to track down bugs and squash them when they arise.  Implementing proper error catching techniques, offering solutions when an API isn't available for the user and accepting feedback and statistics from end users really gives the user trust in the software they buy.  If I buy an app, and it crashes the first time I open it up, I already have lost trust in that developer and will stay away from their products.  Also, I will sometimes give negative reviews when they truly are deserved and I tend to stay away from apps with low reviews.

###Frequent Updates

The best apps stay relevant over time by frequently updating their code to fix bugs, enhance performance and to implement new features when they are available.  They also test their apps on new versions of software and make sure that their apps work on all of the platforms and versions of iOS.  I can't stand when I buy an app, only to find that it crashes because the developers abandoned it.  I also like it when I get a new device with new features, such as 3D touch on the iPhone 6S Plus, and my favorite apps have already implemented the new features in innovative ways.  Developers help to shape how functionality is used and often think of new ways to use the hardware & software jam-packed into our iOS devices.  For example, the most exciting games and apps that were available when the iPhone 3G came out were the ones that used the built-in accelerometer.


text:
namespace Question_14_07_GradesDb
{
    using System;
    using System.Collections.Generic;

    public partial class Professor
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public Professor()
        {
            this.Courses = new HashSet<Course>();
        }

        public int Id { get; set; }
        public string Name { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<Course> Courses { get; set; }
    }
}


text:
package net.debasishg.sw15.algebra
package domain.trade
package model

import scalaz._
import Scalaz._
import scalaz.concurrent.Task
import Task._
import Free._

import TradeModel._

trait TradeLifecycleInterpreter {
  def apply[A](action: TradeLifecycle[A]): Task[A]
}

/**
 * Basic interpreter that uses a global mutable Map to store the state
 * of computation
 */
case class SimpleTradeLifecycleInterpreter() extends TradeLifecycleInterpreter {

  def today = java.util.Calendar.getInstance.getTime

  def step[A](action: TradeLifecycleF[TradeLifecycle[A]]): Task[TradeLifecycle[A]] = action match {

    case Valuation(trade, onResult) =>
      now(onResult(enrich(trade)))

    case Confirmation(trade, mode, next) =>
      now(generateConfirmation(trade, mode)).map(_ => next)

    case AccruedInterestCalculation(trade, onResult) =>
      now(onResult(computeAccruedInterest(trade)))

    case ContractNoteGeneration(trade, next) =>
      now(generateContractNote(trade)).map(_ => next)
  }

  /**
   * Turns the AccountRepo script into a `Task` that executes it in a mutable setting
   */
  def apply[A](action: TradeLifecycle[A]): Task[A] = action.runM(step)
}

case class BasicTradeLifecycleInterpreter() {
  def interpret[A](script: TradeLifecycle[A], t: Trade): Trade = script.fold(_ => t, {

    case Valuation(trade, onResult) =>
      val trd = enrich(trade)
      interpret(onResult(trd), trd)

    case Confirmation(trade, mode, next) =>
      generateConfirmation(trade, mode)
      interpret(next, trade)

    case AccruedInterestCalculation(trade, onResult) =>
      interpret(onResult(computeAccruedInterest(trade)), trade)

    case ContractNoteGeneration(trade, next) =>
      generateContractNote(trade)
      interpret(next, trade)

    case Finalization(trade) =>
      finalizeTrade(trade)
  })
}


text:
package alluxio.client.file.options;

import alluxio.CommonTestUtils;

import org.junit.Assert;
import org.junit.Test;

import java.util.Random;

/**
 * Tests for the {@link FreeOptions} class.
 */
public class FreeOptionsTest {
  /**
   * Tests that building a {@link FreeOptions} with the defaults works.
   */
  @Test
  public void defaults() {
    FreeOptions options = FreeOptions.defaults();

    Assert.assertFalse(options.isRecursive());
  }

  /**
   * Tests getting and setting fields.
   */
  @Test
  public void fields() {
    Random random = new Random();
    boolean recursive = random.nextBoolean();

    FreeOptions options = FreeOptions.defaults();
    options.setRecursive(recursive);

    Assert.assertEquals(recursive, options.isRecursive());
  }

  @Test
  public void equalsTest() throws Exception {
    CommonTestUtils.testEquals(FreeOptions.class);
  }
}


text:
FROM golang:1.7.1-alpine

ENV NAME=disposable
ENV DIR=/go/src/github.com/0x19/$NAME

RUN apk update && apk add --no-cache git

ADD . $DIR
WORKDIR $DIR

ENV GRPC_ADDR ":7290"
ENV HTTP_ADDR ":6290"

EXPOSE $GRPC_ADDR
EXPOSE $HTTP_ADDR

RUN go get
RUN go build && go install

ENTRYPOINT $NAME


text:
A simple HTML validator that checks that tags are balanced. Use the two available static methods:

```php
$isBalanced = BalancedHtmlTags::tagsBalanced('<div>one<p></div>'); //false
$balanced = BalancedHtmlTags::balanceTags('<div>one<p></div>'); //<div>one<p></p></div>
```
### Version
1.0.0

License
----

MIT


text:
<!doctype html>

  <title>Network | Selections</title>

  <link href="../../dist/vis.css" rel="stylesheet" type="text/css" />


text:
<stix:STIX_Package
	xmlns:cyboxCommon="http://cybox.mitre.org/common-2"
	xmlns:cybox="http://cybox.mitre.org/cybox-2"
	xmlns:cyboxVocabs="http://cybox.mitre.org/default_vocabularies-2"
	xmlns:example="http://example.com"
	xmlns:incident="http://stix.mitre.org/Incident-1"
	xmlns:ta="http://stix.mitre.org/ThreatActor-1"
	xmlns:stixCommon="http://stix.mitre.org/common-1"
	xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
	xmlns:stix-ciqidentity="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1"
	xmlns:stix="http://stix.mitre.org/stix-1"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xal="urn:oasis:names:tc:ciq:xal:3"
	xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3"
	xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3"
	xsi:schemaLocation="
	http://cybox.mitre.org/common-2 http://cybox.mitre.org/XMLSchema/common/2.1/cybox_common.xsd
	http://cybox.mitre.org/cybox-2 http://cybox.mitre.org/XMLSchema/core/2.1/cybox_core.xsd
	http://cybox.mitre.org/default_vocabularies-2 http://cybox.mitre.org/XMLSchema/default_vocabularies/2.1/cybox_default_vocabularies.xsd
	http://stix.mitre.org/Incident-1 http://stix.mitre.org/XMLSchema/incident/1.1.1/incident.xsd
	http://stix.mitre.org/ThreatActor-1 http://stix.mitre.org/XMLSchema/threat_actor/1.1.1/threat_actor.xsd
	http://stix.mitre.org/common-1 http://stix.mitre.org/XMLSchema/common/1.1.1/stix_common.xsd
	http://stix.mitre.org/default_vocabularies-1 http://stix.mitre.org/XMLSchema/default_vocabularies/1.1.1/stix_default_vocabularies.xsd
	http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1 http://stix.mitre.org/XMLSchema/extensions/identity/ciq_3.0/1.1.1/ciq_3.0_identity.xsd
	http://stix.mitre.org/stix-1 http://stix.mitre.org/XMLSchema/core/1.1.1/stix_core.xsd
	urn:oasis:names:tc:ciq:xal:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xAL.xsd
	urn:oasis:names:tc:ciq:xnl:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xNL.xsd
	urn:oasis:names:tc:ciq:xpil:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xPIL.xsd" id="example:Package-6ad3ad7f-f6b8-4050-b4f0-3ddcedcaf494" version="1.1.1" timestamp="2013-02-19T03:46:01+00:00">
    <stix:Incidents>
        <stix:Incident id="example:incident-5dabe8a8-8e8d-40ca-b1b6-ffbaf116b095" timestamp="2014-05-10T00:58:19+00:00" xsi:type='incident:IncidentType'>
            <incident:Title>Stolen laptop results in potentially exposed PII for 600 former students</incident:Title>
            <incident:External_ID source="VERIS">311179EA-D06F-4AC8-B9E7-7E5FE7B2A2D5</incident:External_ID>
            <incident:Time>
                <incident:Initial_Compromise precision="day">2012-02-12T00:00:00</incident:Initial_Compromise>
            </incident:Time>
            <incident:Reporter>
                <stixCommon:Identity xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                    <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xnl:NameLine xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">blackfist</xnl:NameLine>
  </xpil:PartyName>
</ExtSch:Specification>
                </stixCommon:Identity>
            </incident:Reporter>
            <incident:Victim xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xnl:NameLine xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">Case Western Reserve University</xnl:NameLine>
  </xpil:PartyName>
  <xpil:Addresses xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xpil:Address>
      <xal:Country xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>US</xal:NameElement>
      </xal:Country>
      <xal:AdministrativeArea xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>OH</xal:NameElement>
      </xal:AdministrativeArea>
    </xpil:Address>
  </xpil:Addresses>
</ExtSch:Specification>
            </incident:Victim>
            <incident:Affected_Assets>
                <incident:Affected_Asset>
                    <incident:Type>Laptop</incident:Type>
                    <incident:Nature_Of_Security_Effect>
                        <incident:Property_Affected>
                            <incident:Property xsi:type="stixVocabs:LossPropertyVocab-1.0">Confidentiality</incident:Property>
                            <incident:Description_Of_Effect>Personal: 600</incident:Description_Of_Effect>
                        </incident:Property_Affected>
                        <incident:Property_Affected>
                            <incident:Property xsi:type="stixVocabs:LossPropertyVocab-1.0">Availability</incident:Property>
                            <incident:Type_Of_Availability_Loss xsi:type="stixVocabs:AvailabilityLossTypeVocab-1.1.1">Loss</incident:Type_Of_Availability_Loss>
                        </incident:Property_Affected>
                    </incident:Nature_Of_Security_Effect>
                </incident:Affected_Asset>
            </incident:Affected_Assets>
            <incident:Impact_Assessment>
                <incident:Impact_Qualification xsi:type="stixVocabs:ImpactQualificationVocab-1.0">Unknown</incident:Impact_Qualification>
            </incident:Impact_Assessment>
            <incident:Attributed_Threat_Actors>
                <incident:Threat_Actor>
                    <stixCommon:Threat_Actor idref="example:threatactor-1b80ed86-8e74-4dbc-ad9e-15384573b61a" xsi:type='ta:ThreatActorType'/>
                </incident:Threat_Actor>
            </incident:Attributed_Threat_Actors>
            <incident:Security_Compromise xsi:type="stixVocabs:SecurityCompromiseVocab-1.0">Yes</incident:Security_Compromise>
            <incident:Discovery_Method>Int - reported by employee</incident:Discovery_Method>
            <incident:Information_Source>
                <stixCommon:Identity>
                    <stixCommon:Name>vcdb</stixCommon:Name>
                </stixCommon:Identity>
                <stixCommon:Tools>
                    <cyboxCommon:Tool>
                        <cyboxCommon:Name>veris2stix</cyboxCommon:Name>
                        <cyboxCommon:Vendor>MITRE</cyboxCommon:Vendor>
                        <cyboxCommon:Version>0.1</cyboxCommon:Version>
                    </cyboxCommon:Tool>
                    <cyboxCommon:Tool>
                        <cyboxCommon:Name>VERIS schema</cyboxCommon:Name>
                        <cyboxCommon:Vendor>Verizon</cyboxCommon:Vendor>
                        <cyboxCommon:Version>1.3.0</cyboxCommon:Version>
                    </cyboxCommon:Tool>
                </stixCommon:Tools>
                <stixCommon:References>
                    <stixCommon:Reference>http://www.cleveland.com/metro/index.ssf/2012/04/case_western_reserve_notifies.html (20130218) https://www.attevo.com/blog/600-alumni-of-case-western-reserve-university-involved-in-data-b/ (20130218)</stixCommon:Reference>
                </stixCommon:References>
            </incident:Information_Source>
        </stix:Incident>
    </stix:Incidents>
    <stix:Threat_Actors>
        <stix:Threat_Actor id="example:threatactor-1b80ed86-8e74-4dbc-ad9e-15384573b61a" timestamp="2014-12-22T16:24:19.644000+00:00" xsi:type='ta:ThreatActorType'>
            <ta:Identity xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:Addresses xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xpil:Address>
      <xal:Country xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>Unknown</xal:NameElement>
      </xal:Country>
    </xpil:Address>
  </xpil:Addresses>
</ExtSch:Specification>
            </ta:Identity>
            <ta:Type timestamp="2014-12-22T16:24:19.644000+00:00">
                <stixCommon:Value>Unaffiliated</stixCommon:Value>
            </ta:Type>
            <ta:Motivation timestamp="2014-12-22T16:24:19.644000+00:00">
                <stixCommon:Value xsi:type="stixVocabs:MotivationVocab-1.1">Financial or Economic</stixCommon:Value>
            </ta:Motivation>
        </stix:Threat_Actor>
    </stix:Threat_Actors>
</stix:STIX_Package>


text:
extern "C" {
#endif

UINT AddStyle(HWND hwnd, UINT style);
UINT AddDlgItemStyle(HWND hwnd, UINT nCtrlId, UINT style);
UINT DelStyle(HWND hwnd, UINT style);
UINT DelDlgItemStyle(HWND hwnd, UINT nCtrlId, UINT style);
BOOL EnableDlgItem(HWND hwnd, UINT nCtrlId, BOOL fEnabled);
BOOL ShowDlgItem(HWND hwnd, UINT nCtrlId, DWORD dwShowCmd);

int WINAPI GetRectHeight(RECT *rect);
int WINAPI GetRectWidth(RECT *rect);

DWORD GetDlgItemBaseInt(HWND hwnd, UINT ctrlid, int base);
UINT _tstrtoib16(TCHAR *szHexStr);
BOOL EnableDialogTheme(HWND hwnd);

BOOL EnableDebugPrivilege();

TCHAR *GetVersionString(TCHAR *szFileName, TCHAR *szValue, TCHAR *szBuffer, ULONG nLength);

#ifdef __cplusplus
}
#endif

#endif


text:
using System;
using System.Linq;
using System.Reflection;

namespace EntityFramework.BulkInsert.Extensions
{
    internal static class TypeExtensions
    {
        /// <summary>
        /// Returns a private Property Value from a given Object. Uses Reflection.
        /// Throws a ArgumentOutOfRangeException if the Property is not found.
        /// </summary>
        /// <param name="obj">Object from where the Property Value is returned</param>
        /// <param name="propName">Propertyname as string.</param>
        /// <returns>PropertyValue</returns>
        public static object GetPrivateFieldValue(this object obj, string propName)
        {
            if (obj == null) throw new ArgumentNullException("obj");
            Type t = obj.GetType();
            FieldInfo fieldInfo = null;
            PropertyInfo propertyInfo = null;
            while (fieldInfo == null && propertyInfo == null && t != null)
            {
                fieldInfo = t.GetField(propName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
                if (fieldInfo == null)
                {
                    propertyInfo = t.GetProperty(propName,
                        BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
                }

                t = t.BaseType;
            }

            if (fieldInfo == null && propertyInfo == null)
                throw new ArgumentOutOfRangeException("propName",
                    $"Field {propName} was not found in Type {obj.GetType().FullName}");

            if (fieldInfo != null)
                return fieldInfo.GetValue(obj);

            return propertyInfo.GetValue(obj, null);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="propertyName"></param>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static object GetPropertyValue(this object obj, string propertyName, char separator = '.')
        {
            var segments = propertyName.Split(separator);
            object value = null;
            for (int i = 0; i < segments.Length; ++i)
            {
                object tmp = value ?? obj;
#if NET40
                value = tmp.GetType().GetProperty(segments[i]).GetValue(tmp, null);
#else
                value = tmp.GetType().GetProperty(segments[i]).GetValue(tmp);
#endif
            }

            return value;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <param name="propertyName"></param>
        /// <param name="separator"></param>
        /// <returns></returns>
        public static PropertyInfo GetProperty(this Type type, string propertyName, char separator)
        {
            var segments = propertyName.Split(separator);

            PropertyInfo propertyInfo = null;
            for (int i = 0; i < segments.Length; ++i)
            {
                propertyInfo = type.GetProperty(segments[i], BindingFlags.Public | BindingFlags.Instance);
                if (propertyInfo == null)
                    return null;
                type = propertyInfo.PropertyType;
            }

            return propertyInfo;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <param name="argumentType"></param>
        /// <returns></returns>
        public static bool IsNullable(this Type type, out Type argumentType)
        {
            argumentType = null;
            var isNullable = type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>);
            if (isNullable)
            {
                argumentType = type.GetGenericArguments()[0];
            }

            return isNullable;
        }

        /// <summary>
        /// Find all derived types from assembly.
        /// If assembly is not given, given type assembly is used.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="assembly"></param>
        /// <returns></returns>
        public static Type[] GetDerivedTypes(this Type type, Assembly assembly = null)
        {
            return type.GetDerivedTypes(false);
        }

        /// <summary>
        /// Find all derived types from assembly.
        /// If assembly is not given, given type assembly is used.
        /// </summary>
        /// <param name="type"></param>
        /// <param name="includeItself"></param>
        /// <param name="assembly"></param>
        /// <returns></returns>
        public static Type[] GetDerivedTypes(this Type type, bool includeItself, Assembly assembly = null)
        {
            if (assembly == null)
            {
                assembly = type.Assembly;
            }

            return assembly
                .GetTypes()
                .Where(t => (includeItself || t != type) && type.IsAssignableFrom(t))
                .ToArray();
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>StringCleaning</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.deeplearning4j.text.tokenization.tokenizer.preprocessor

Class StringCleaning

java.lang.Object

org.deeplearning4j.text.tokenization.tokenizer.preprocessor.StringCleaning

public class StringCleaning
extends java.lang.Object

Various string cleaning utils

Method Summary

All Methods Static Methods Concrete Methods

Modifier and Type
Method and Description

static java.lang.String
stripPunct(java.lang.String base)

Strip punctuation

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail

stripPunct

public static java.lang.String stripPunct(java.lang.String base)

Strip punctuation

Parameters:

base - the base string

Returns:

the cleaned string

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
<?php

namespace Gedmo\Tree\Traits;

/**
 * NestedSet Trait, usable with PHP >= 5.4
 *
 * @author Renaat De Muynck <renaat.demuynck@gmail.com>
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
trait NestedSet
{

    /**
     * @var integer
     */
    private $root;

    /**
     * @var integer
     */
    private $level;

    /**
     * @var integer
     */
    private $left;

    /**
     * @var integer
     */
    private $right;

}


text:
package ru.stqa.pft.addressbook.tests;

import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactEmailTests extends TestBase {

  @Test
  public void testContactEmail() {
    app.goTo().homePage();
    ContactData contact = app.contact().all().iterator().next();
    ContactData contactInfoFromEditForm = app.contact().infoFromEditForm(contact);

    assertThat(contact.getEmail(), equalTo(contactInfoFromEditForm.getEmail()));
  }
}


text:
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = ON;
SET check_function_bodies = FALSE;
SET client_min_messages = WARNING;

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';

SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = FALSE;

CREATE TABLE categories (
  id   INTEGER                NOT NULL,
  name CHARACTER VARYING(255) NOT NULL
);

CREATE SEQUENCE categories_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE categories_id_seq OWNED BY categories.id;

CREATE TABLE dishes (
  id            INTEGER                NOT NULL,
  name          CHARACTER VARYING(255) NOT NULL,
  image         CHARACTER VARYING(255),
  price         INTEGER                NOT NULL,
  description   TEXT,
  categories_id INTEGER
);

CREATE SEQUENCE dishes_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE dishes_id_seq OWNED BY dishes.id;

CREATE TABLE orderitems (
  id        INTEGER NOT NULL,
  orders_id INTEGER NOT NULL,
  dishes_id INTEGER NOT NULL
);

CREATE SEQUENCE orderitems_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE orderitems_id_seq OWNED BY orderitems.id3;

CREATE TABLE orders (
  id               INTEGER                     NOT NULL,
  tablenumber      INTEGER                     NOT NULL,
  ordertimestamp   TIMESTAMP WITHOUT TIME ZONE NOT NULL,
  servingtimestamp TIMESTAMP WITHOUT TIME ZONE,
  notes            TEXT
);

CREATE SEQUENCE orders_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE orders_id_seq OWNED BY orders.id;

CREATE TABLE users (
  id       INTEGER                NOT NULL,
  username CHARACTER VARYING(255) NOT NULL,
  password CHARACTER VARYING(255) NOT NULL,
  role     CHARACTER VARYING(255) NOT NULL,
  email    CHARACTER VARYING(255) NOT NULL
);

CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE users_id_seq OWNED BY users.id;

ALTER TABLE ONLY categories ALTER COLUMN id SET DEFAULT nextval('categories_id_seq' :: REGCLASS);
ALTER TABLE ONLY dishes ALTER COLUMN id SET DEFAULT nextval('dishes_id_seq' :: REGCLASS);
ALTER TABLE ONLY orderitems ALTER COLUMN id3 SET DEFAULT nextval('orderitems_id_seq' :: REGCLASS);
ALTER TABLE ONLY orders ALTER COLUMN id SET DEFAULT nextval('orders_id_seq' :: REGCLASS);
ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq' :: REGCLASS);

ALTER TABLE ONLY categories
ADD CONSTRAINT categories_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dishes
ADD CONSTRAINT dishes_pkey PRIMARY KEY (id);

ALTER TABLE ONLY orderitems
ADD CONSTRAINT orderitems_pkey PRIMARY KEY (id3);

ALTER TABLE ONLY orders
ADD CONSTRAINT orders_pkey PRIMARY KEY (id);

ALTER TABLE ONLY categories
ADD CONSTRAINT unique_id UNIQUE (id);

ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);

ALTER TABLE ONLY dishes
ADD CONSTRAINT id FOREIGN KEY (categories_id) REFERENCES categories (id);

ALTER TABLE ONLY orderitems
ADD CONSTRAINT orderitems_dishes_id_fkey FOREIGN KEY (dishes_id) REFERENCES dishes (id);

ALTER TABLE ONLY orderitems
ADD CONSTRAINT orderitems_orders_id_fkey FOREIGN KEY (orders_id) REFERENCES orders (id);

REVOKE ALL ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


text:
package co.cask.cdap.api.worker;

import co.cask.cdap.api.ProgramLifecycle;
import co.cask.cdap.api.TxRunnable;
import co.cask.cdap.api.annotation.TransactionControl;
import co.cask.cdap.api.annotation.TransactionPolicy;

/**
 * Defines a Worker.
 */
public interface Worker extends Runnable, ProgramLifecycle<WorkerContext> {

  /**
   * Configure a Worker.
   */
  void configure(WorkerConfigurer configurer);

  /**
   * Initialize the Worker.
   *
   * Note that unlike most program types, this method is not called within an implicit transaction,
   * but instead it can start its own transactions using {@link WorkerContext#execute(TxRunnable)}.
   * methods.
   */
  @TransactionPolicy(TransactionControl.EXPLICIT)
  void initialize(WorkerContext context) throws Exception;

  /**
   * Destroy the Worker.
   *
   * Note that unlike most program types, this method is not called within an implicit transaction,
   * but instead it can start its own transactions using {@link WorkerContext#execute(TxRunnable)}.
   */
  @TransactionPolicy(TransactionControl.EXPLICIT)
  void destroy();

  /**
   * Request to stop the running worker.
   * This method will be invoked from a different thread than the one calling the {@link #run()} method.
   */
  void stop();
}