text:
<?php
namespace Craft;

class DateInterval extends \DateInterval
{
	// Constants
	// =========================================================================

	/**
	 * Number of seconds in a minute.
	 *
	 * @var integer
	 */
	const SECONDS_MINUTE = 60;

	/**
	 * Number of seconds in an hour.
	 *
	 * @var integer
	 */
	const SECONDS_HOUR = 3600;

	/**
	 * Number of seconds in a day.
	 *
	 * @var integer
	 */
	const SECONDS_DAY = 86400;

	/**
	 * The number of seconds in a month.
	 *
	 * Based on a 30.4368 day month, with the product rounded.
	 *
	 * @var integer
	 */
	const SECONDS_MONTH = 2629740;

	/**
	 * The number of seconds in a year.
	 *
	 * Based on a 365.2416 day year, with the product rounded.
	 *
	 * @var integer
	 */
	const SECONDS_YEAR = 31556874;

	// Properties
	// =========================================================================

	/**
	 * The date properties.
	 *
	 * @var array
	 */
	private static $_date = array('y' => 'Y', 'm' => 'M', 'd' => 'D');

	/**
	 * The time properties.
	 *
	 * @var array
	 */
	private static $_time = array('h' => 'H', 'i' => 'M', 's' => 'S');

	// Public Methods
	// =========================================================================

	/**
	 * Returns the interval specification.
	 *
	 * @return string The interval specification.
	 */
	public function __toString()
	{
		return self::toSpec($this);
	}

	/**
	 * Returns the DateInterval instance for the number of seconds.
	 *
	 * @param int|string $seconds The number of seconds.
	 *
	 * @return DateInterval The date interval.
	 */
	public static function fromSeconds($seconds)
	{
		$interval = new static('PT0S');
		$seconds = (int)$seconds;

		foreach (array('y' => self::SECONDS_YEAR, 'm' => self::SECONDS_MONTH, 'd' => self::SECONDS_DAY, 'h' => self::SECONDS_HOUR, 'i' => self::SECONDS_MINUTE) as $property => $increment)
		{
			$increment = (int)$increment;

			if ($seconds === $increment || $seconds > $increment)
			{
				$count = (int)floor($seconds / $increment);
				$interval->$property = $count;
				$seconds = $seconds - ($count * $increment);
			}
		}

		$interval->s = (int)$seconds;

		return $interval;
	}

	/**
	 * Returns the total number of seconds in the interval.
	 *
	 * @param \DateInterval $interval The date interval.
	 *
	 * @return string The number of seconds.
	 */
	public function toSeconds(\DateInterval $interval = null)
	{
		if (($interval === null) && isset($this))
		{
			$interval = $this;
		}

		$seconds = (int)$interval->s;

		if ($interval->i)
		{
			$seconds = $seconds + ((int)$interval->i * self::SECONDS_MINUTE);
		}

		if ($interval->h)
		{
			$seconds = $seconds + ((int)$interval->h * self::SECONDS_HOUR);
		}

		if ($interval->d)
		{
			$seconds = $seconds + ((int)$interval->d * self::SECONDS_DAY);
		}

		if ($interval->m)
		{
			$seconds = $seconds + ((int)$interval->m * self::SECONDS_MONTH);
		}

		if ($interval->y)
		{
			$seconds = $seconds + ((int)$interval->y * self::SECONDS_YEAR);
		}

		return (string)$seconds;
	}

	/**
	 * Returns the interval specification.
	 *
	 * @param \DateInterval $interval The date interval.
	 *
	 * @return string The interval specification.
	 */
	public function toSpec(\DateInterval $interval = null)
	{
		if (($interval === null) && isset($this))
		{
			$interval = $this;
		}

		$string = 'P';

		foreach (self::$_date as $property => $suffix)
		{
			if ($interval->{$property})
			{
				$string .= $interval->{$property}.$suffix;
			}
		}

		if ($interval->h || $interval->i || $interval->s)
		{
			$string .= 'T';

			foreach (self::$_time as $property => $suffix)
			{
				if ($interval->{$property})
				{
					$string .= $interval->{$property}.$suffix;
				}
			}
		}

		return $string;
	}

	/**
	 * Returns the interval in a human-friendly string.
	 *
	 * @param bool $showSeconds
	 *
	 * @return string
	 */
	public function humanDuration($showSeconds = true)
	{
		$timeComponents = array();

		if ($this->y)
		{
			$timeComponents[] = $this->y.' '.($this->y > 1 ? Craft::t('years') : Craft::t('year'));
		}

		if ($this->m)
		{
			$timeComponents[] = $this->m.' '.($this->m > 1 ? Craft::t('months') : Craft::t('month'));
		}

		if ($this->d)
		{
			$timeComponents[] = $this->d.' '.($this->d > 1 ? Craft::t('days') : Craft::t('day'));
		}

		if ($this->h)
		{
			$timeComponents[] = $this->h.' '.($this->h > 1 ? Craft::t('hours') : Craft::t('hour'));
		}

		$minutes = $this->i;

		if (!$showSeconds)
		{
			if ($minutes && round($this->s / 60))
			{
				$minutes++;
			}
			else if (!$this->y && !$this->m && !$this->d && !$this->h && !$minutes)
			{
				return Craft::t('less than a minute');
			}
		}

		if ($minutes)
		{
			$timeComponents[] = $minutes.' '.($minutes > 1 ? Craft::t('minutes') : Craft::t('minute'));
		}

		if ($showSeconds && $this->s)
		{
			$timeComponents[] = $this->s.' '.($this->s > 1 ? Craft::t('seconds') : Craft::t('second'));
		}

		return implode(', ', $timeComponents);
	}
}


text:
"""
    utils.responder_helpers
    ~~~~~~~~~~~~~~~~~~~~~~~

    Common helpers for our resource responders

    These can be used on any resource responders that need
    common funtionality when interacting with models in a
    RESTFUL like fashion.

    Things like URL validations, some store method wrapping,
    routine over-the-wire (de)serialization helpers, etc.
"""

import goldman
import goldman.exceptions as exceptions

from goldman.utils.error_helpers import abort, mod_fail
from schematics.types import IntType

__all__ = ['find', 'from_rest', 'to_rest_model', 'to_rest_models']

def validate_rid(model, rid):
    """ Ensure the resource id is proper """

    rid_field = getattr(model, model.rid_field)

    if isinstance(rid_field, IntType):
        try:
            int(rid)
        except (TypeError, ValueError):
            abort(exceptions.InvalidURL(**{
                'detail': 'The resource id {} in your request is not '
                          'syntactically correct. Only numeric type '
                          'resource id\'s are allowed'.format(rid)
            }))

def find(model, rid):
    """ Find a model from the store by resource id """

    validate_rid(model, rid)

    rid_field = model.rid_field
    model = goldman.sess.store.find(model.RTYPE, rid_field, rid)

    if not model:
        abort(exceptions.DocumentNotFound)

    return model

def _from_rest_blank(model, props):
    """ Set empty strings to None where allowed

    This is done on fields with `allow_blank=True` which takes
    an incoming empty string & sets it to None so validations
    are skipped. This is useful on fields that aren't required
    with format validations like URLType, EmailType, etc.
    """

    blank = model.get_fields_by_prop('allow_blank', True)

    for field in blank:
        try:
            if props[field] == '':
                props[field] = None
        except KeyError:
            continue

def _from_rest_hide(model, props):
    """ Purge fields not allowed during a REST deserialization

    This is done on fields with `from_rest=False`.
    """

    hide = model.get_fields_by_prop('from_rest', False)

    for field in hide:
        try:
            del props[field]
        except KeyError:
            continue

def _from_rest_ignore(model, props):
    """ Purge fields that are completely unknown """

    fields = model.all_fields

    for prop in props.keys():
        if prop not in fields:
            del props[prop]

def _from_rest_lower(model, props):
    """ Lowercase fields requesting it during a REST deserialization """

    for field in model.to_lower:
        try:
            props[field] = props[field].lower()
        except (AttributeError, KeyError):
            continue

def _from_rest_on_create(model, props):
    """ Assign the default values when creating a model

    This is done on fields with `on_create=<value>`.
    """

    fields = model.get_fields_with_prop('on_create')

    for field in fields:
        props[field[0]] = field[1]

def _from_rest_on_update(model, props):
    """ Assign the default values when updating a model

    This is done on fields with `on_update=<value>`.
    """

    fields = model.get_fields_with_prop('on_update')

    for field in fields:
        props[field[0]] = field[1]

def _from_rest_reject_update(model):
    """ Reject any field updates not allowed on POST

    This is done on fields with `reject_update=True`.
    """

    dirty = model.dirty_fields
    fields = model.get_fields_by_prop('reject_update', True)
    reject = []

    for field in fields:
        if field in dirty:
            reject.append(field)

    if reject:
        mod_fail('These fields cannot be updated: %s' % ', '.join(reject))

def from_rest(model, props):
    """ Map the REST data onto the model

    Additionally, perform the following tasks:

        * set all blank strings to None where needed
        * purge all fields not allowed as incoming data
        * purge all unknown fields from the incoming data
        * lowercase certain fields that need it
        * merge new data with existing & validate
            * mutate the existing model
            * abort on validation errors
            * coerce all the values
    """

    req = goldman.sess.req

    _from_rest_blank(model, props)
    _from_rest_hide(model, props)
    _from_rest_ignore(model, props)
    _from_rest_lower(model, props)

    if req.is_posting:
        _from_rest_on_create(model, props)
    elif req.is_patching:
        _from_rest_on_update(model, props)

    model.merge(props, validate=True)

    if req.is_patching:
        _from_rest_reject_update(model)

def _to_rest_hide(model, props):
    """ Purge fields not allowed during a REST serialization

    This is done on fields with `to_rest=False`.
    """

    hide = model.get_fields_by_prop('to_rest', False)

    for field in hide:
        try:
            del props[field]
        except KeyError:
            continue

def _to_rest_includes(models, includes):
    """ Fetch the models to be included

    The includes should follow a few basic rules:

        * the include MUST not already be an array member
          of the included array (no dupes)

        * the include MUST not be the same as the primary
          data if the primary data is a single resource
          object (no dupes)

        * the include MUST not be an array member of the
          primary data if the primary data an array of
          resource objects (no dupes)

    Basically, each included array member should be the only
    instance of that resource object in the entire restified
    data.
    """

    included = []
    includes = includes or []

    if not isinstance(models, list):
        models = [models]

    for include in includes:
        for model in models:
            rel = getattr(model, include)

            if hasattr(rel, 'model') and rel.model:
                rel_models = [rel.model]
            elif hasattr(rel, 'models') and rel.models:
                rel_models = rel.models

            for rel_model in rel_models:
                if rel_model in models or rel_model in included:
                    continue
                else:
                    included.append(rel_model)

    for idx, val in enumerate(included):
        included[idx] = _to_rest(val)

    return included

def _to_rest_rels(model, props):
    """ Move the relationships to appropriate location in the props

    All to_ones should be in a to_one key while all to_manys
    should be in a to_many key.
    """

    props['to_many'] = {}
    props['to_one'] = {}

    for key in model.to_one:
        try:
            props['to_one'][key] = props.pop(key)
        except KeyError:
            continue

    for key in model.to_many:
        try:
            props['to_many'][key] = props.pop(key)
        except KeyError:
            continue

def _to_rest(model, includes=None):
    """ Convert the model into a dict for serialization

    Notify schematics of the sparse fields requested while
    also forcing the resource id & resource type fields to always
    be present no matter the request. Additionally, any includes
    are implicitly added as well & automatically loaded.

    Then normalize the includes, hide private fields, & munge
    the relationships into a format the serializers are
    expecting.
    """

    includes = includes or []
    sparse = goldman.sess.req.fields.get(model.rtype, [])

    if sparse:
        sparse += [model.rid_field, model.rtype_field]
        sparse += includes

    props = model.to_primitive(
        load_rels=includes,
        sparse_fields=sparse,
    )

    props['rid'] = props.pop(model.rid_field)
    props['rtype'] = props.pop(model.rtype_field)

    _to_rest_hide(model, props)
    _to_rest_rels(model, props)

    return props

def to_rest_model(model, includes=None):
    """ Convert the single model into a dict for serialization

    :return: dict
    """

    props = {}
    props['data'] = _to_rest(model, includes=includes)
    props['included'] = _to_rest_includes(model, includes=includes)

    return props

def to_rest_models(models, includes=None):
    """ Convert the models into a dict for serialization

    models should be an array of single model objects that
    will each be serialized.

    :return: dict
    """

    props = {}
    props['data'] = []

    for model in models:
        props['data'].append(_to_rest(model, includes=includes))

    props['included'] = _to_rest_includes(models, includes=includes)

    return props

redpajama_set_name: RedPajamaGithub


text:
package com.template.bigdata.kafka;

import java.util.Date;
import java.util.Properties;

import kafka.javaapi.producer.Producer;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;

/*
 * Author : Arunmozhi,
 * Date: July, 9th 2016
 */
public class KafkaTopicProducer {
	private static Producer<String, String> producer;

	public void configureProducerProperties(String zookeeperhost) {
		Properties props = new Properties();
		props.put("metadata.broker.list", zookeeperhost);
		props.put("serializer.class", "kafka.serializer.StringEncoder");
		props.put("request.required.acks", "1");

		ProducerConfig config = new ProducerConfig(props);
		producer = new Producer<String, String>(config);
	}

	private void publishMessage(String topic, int messageCount) {
		for (int mCount = 0; mCount < messageCount; mCount++) {
			String runtime = new Date().toString();
			String msg = "Message Publishing Time - " + runtime;
			System.out.println(msg);
			KeyedMessage<String, String> data = new KeyedMessage<String, String>(topic, msg);
			producer.send(data);
		}
		producer.close();
	}

	public static void main(String[] args) {
		int argsCount = args.length;
		if (argsCount == 0 || argsCount == 1)
			throw new IllegalArgumentException("Please provide topic name and Message count as arguments");
		String zookeeperhost = (String) args[0];
		String topic = (String) args[1];
		String count = (String) args[2];
		int messageCount = Integer.parseInt(count);
		System.out.println("Topic Name - " + topic);
		System.out.println("Message Count - " + messageCount);

		KafkaTopicProducer simpleProducer = new KafkaTopicProducer();
		simpleProducer.configureProducerProperties(zookeeperhost);
		simpleProducer.publishMessage(topic, messageCount);
	}
}


text:
Install bower
=============
	sudo npm install -g bower
	bower install
Using bootstrap from bower
==========================
Add the following line in NeosBox.scss
	@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap";

Overwrite variable bootstrap
============================
Add following lines before import
	$screen-xs:                  501px;
	$screen-sm:                  701px;
	$screen-md:                  901px;
	$screen-lg:                  1200px;
	@import "../bower_components/bootstrap-sass/assets/stylesheets/bootstrap";


text:
class ShaderRenderDataD3D12;

struct IDXGISwapChain3;

class Direct3D12Render : public Render
{
public:
	Direct3D12Render();
	~Direct3D12Render();

	bool Init(OSWindow& mainWindow) override;
	void UpdateRenderWindow(OSWindow& window) override;
	void Kill() override;

	void AppendShaderFilenameWithPath(WritableString& outString, const String& shaderFilename) const override;

	void EndFrame() override;

	void Clear(const Color& clearColor, float depth, uint8_t stencil) override;
	void SetScissor(uint16_t x, uint16_t y, uint16_t width, uint16_t height) override;
	void SetWorldMatrix(const Matrix4& matrix) override;
	void SetViewProjectionMatrices(const Matrix4& viewMatrix, const Matrix4& projMatrix) override;

private:
	RenderData* CreateRenderableRenderData(const Renderable& renderable) override;
	RenderData* CreateIndexBufferRenderData(const IndexBuffer& indexBuffer) override;
	RenderData* CreateVertexBufferRenderData(const VertexBuffer& vertexBuffer) override;
	RenderData* CreateShaderRenderData(const Shader& shader) override;
	RenderData* CreateTextureRenderData(const Texture& texture) override;
	RenderData* CreateRenderTargetRenderData(const RenderTarget& renderTarget) override;

	void DestroyRenderableRenderData(RenderData* pRenderData) override;

	void SetIndexBuffer(IndexBuffer& indexBuffer) override;
	void SetVertexBuffer(VertexBuffer& vertexBuffer) override;
	void SetRenderTarget(RenderTarget* pRenderTarget) override;
	void UpdateDeviceBuffer(DeviceBuffer& deviceBuffer) override;
	void UpdateShaderParams(const Material& material) override;
	void UpdateShaderParams(const Material& material, ShaderRenderDataD3D12* pShaderRenderData);

	void DoRender(Renderable& renderable, uint32_t indexOffset, uint32_t vertexOffset, uint32_t numIndices, uint32_t numVertices) override;

	bool CreateFrameBuffers(uint32_t width, uint32_t height);
	void UpdateD3D12Resource(ID3D12Resource* pResource, const void* pData, size_t size);
	void WaitForPreviousFrame();

	struct FrameBuffer
	{
		ID3D12Resource* m_pRenderTarget = nullptr;
		D3D12_CPU_DESCRIPTOR_HANDLE m_RTV = {};
		ID3D12CommandAllocator* m_pCommandAllocator = nullptr;
		ID3D12Fence* m_pFence = nullptr;
		uint64_t m_fenceValue = 0;
	};

	static constexpr uint32_t kFrameBufferCount = 3;

	ID3D12Device3* m_pDevice = nullptr;
	ID3D12CommandQueue* m_pCommandQueue = nullptr;
	IDXGISwapChain3* m_pSwapChain = nullptr;

	// Frame buffers
	ID3D12DescriptorHeap* m_pHeapForFrameBufferRTVs = nullptr;
	FrameBuffer m_frameBuffers[kFrameBufferCount];
	uint32_t m_activeFrameBufferIdx = 0;
	HANDLE m_fenceEvent;

	ID3D12DescriptorHeap* m_pHeapForDSV = nullptr;
	ID3D12Resource* m_pDepthStencilResource = nullptr;

	ID3D12GraphicsCommandList* m_pCmdList = nullptr;

	ID3D12RootSignature* m_pRootSignature = nullptr;

	ID3D12PipelineState* m_pActivePipelineState = nullptr;

	float m_blendFactor[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
	DirectX::XMMATRIX m_matWorld;
	DirectX::XMMATRIX m_matView;
	DirectX::XMMATRIX m_matProj;

	std::unique_ptr<Shader> m_spErrorVertexShader;
	std::unique_ptr<Shader> m_spErrorPixelShader;
};


text:
from MusicRoll import *
import TensionModule
import PPMBasis
import numpy as np
import pickle
import pprint

from tkinter import Tk, Button, Frame, Canvas, Scrollbar
import tkinter.constants as Tkconstants

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import AxesGrid
# from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg

__verbose = False
__block = True
__report_interval = 100
__hard_limit = 1000

# parameters:

attn_decay = 0.3 # decay by this much from note onsets
n_smoothing = 0.0 # forward smoothing on notes

# candidates must be above b_ambiguous * most_likely_likelihood
# if there are multiple candidates, it is an ambiguous section
# lesser cuts more; higher makes ambiguous sections more likely
# thus, higher is actually more stringent
b_ambiguous = 0.4
max_gap = 4
thresh_conf = 0.25
# lower bound for continuation of current hypothesis
persistence = 0.25

def debug_print(*args):
	if __verbose:
		print(args)

def ema(seq, inertia):
	# mutating operation: exponential moving average applied over an array
	for i in np.r_[1:np.size(seq, 0)]:
		seq[i] = inertia * seq[i-1] + (1 - inertia) * seq[i]
	return seq

def apply_with_window(origin, target, vfunction, width, wdirection = 'backwards'):
	# wdirection must either be 'forwards' or 'backwards'
	assert np.size(origin, 0) == np.size(target, 0)

	# branching for efficiency? save calculations in loop?
	if wdirection == 'backwards':
		for i in np.r_[0:width]:
			target[i] = vfunction(origin[ 0 : i ])
		for i in np.r_[width:np.size(origin, 0)]:
			target[i] = vfunction(origin[ i - width : i ])

def trim(vector, factor):
	return 1.0 * (vector > ((1 - factor) * np.max(vector)))

def matches(belief, actual):
	# How much does the observed value match the hypothesis
	return 1 - np.linalg.norm(belief - actual)

def do_basis_label(filename, metric = TensionModule.metric.dissonance):
	pp = pprint.PrettyPrinter(indent=4)
	roll = pickle.load(open(filename, 'rb'))
	pp.pprint(vars(roll))

	tens_mod = TensionModule.TensionModule(metric)

	for tempo, group in roll.get_tape_groups().items():
		max_gap = 2 * max([tape.min_common for tape in group])

		note_data = MusicRoll.combine_notes(group)

		# Array - newness matters - simulate attentional decay
		# @newness = 0 -> 1-k
		# @newness = 1 -> 1
		# factor = (1-k) + n * k
		# 		 = 1 - k + nk = 1 - k * (n - 1)
		orig_notes = note_data[...,0] * (1 - attn_decay * (note_data[...,1] - 1) )

		duration = min(np.size(orig_notes, 0), __hard_limit)
		notes = ema(np.tile(orig_notes, 1), n_smoothing)[:duration]

		# smoothing?
		keys = np.r_[:np.size(notes, 1)]

		fig1 = plt.figure(1, figsize = (5, 5))

		grid = AxesGrid(fig1, 111,
			nrows_ncols = (4, 1),
			axes_pad = 0.05,
			label_mode = "1",
			)

		Plot_Bases = grid[3]

		basis_prob = np.zeros((duration, 12)) 	  # likelihoods
		basis_label = np.zeros((duration, 1)) - 1 # labels
		tension = np.zeros(duration)

		def axis_basis(quanta):
			actives = keys[quanta > 0.0001] + 3 # due to midi pitch nonsense - 0 is C
			weights = quanta[quanta > 0.0001]
			return tens_mod.basis_likelihood(np.vstack((actives, weights)).T)

		def label(base, start, end):
			if start == 0:
				start -= 1
			Plot_Bases.broken_barh([(start + 1, end - start - 1)], (base + 0.25 , 0.5), facecolors = 'red', alpha = 0.3, linewidth = 0)
			basis_label[start + 1:end] = base

		def bar(time):
			Plot_Bases.broken_barh([(time, 0.1)], (0, 12), facecolors = 'red', alpha = 0.7, linewidth = 0)

		def block(base, start, end, color):
			if __block:
				Plot_Bases.broken_barh([(start + 1, end - start)], (base + 0.25, 0.5), facecolors = color, alpha = 1.0, linewidth = 0)

		# go through the time slices...
		left = 0
		right = 0
		reach = 0
		candidate = None
		confidence = 0 # SHOULD BE USED

		def notes_in_time(start, end):
			return np.sum(note_data[start:end,:,1])

		def label_basis():
			if candidate == None:
				for base in TensionModule.v_basis[b_curr == np.max(b_curr)]:
					label(base, left - 1, right + 1)
			else:
				label(candidate, left - 1, right + 1)

		def get_cand(notes):
			# return (candidate, confidence)
			return (trim(b_curr, b_ambiguous), np.max(b_curr))

		while right < duration and right < __hard_limit:
			# report
			if right % __report_interval == 0:
				print('{0}/{1}...'.format(right, duration))

			# If we didn't have a candidate, try to check for one
			if candidate == None:
				# get current hypothesis from accumulated notes
				confidence_factor = 1 - 1/(notes_in_time(left, right + 1) + 1)
				section = np.sum(notes[left:right+1], 0)

				b_curr = axis_basis(section) * confidence_factor

				basis_prob[right] = b_curr
				tension[right] = tens_mod.selfTension(section)

				(try_cand, try_conf) = get_cand(b_curr)

				# make sure there is only one candidate, and that it is confident enough
				if np.sum(try_cand) == 1 and try_conf > thresh_conf:
					# found a candidate
					debug_print('got', right, try_cand, try_conf)
					block(-0.5, right - 1, right, 'purple')
					candidate = TensionModule.v_basis[try_cand > b_ambiguous][0]
					confidence = try_conf
				else:
					# no candidate / still ambiguous
					if np.sum(try_cand) > 1:
						debug_print('non', right, 'multiple')
					else:
						debug_print('non', right, try_conf, '<', thresh_conf)
					block(-0.5, right - 1, right, 'blue')
			# If there is a candidate, check to see if the next observed slice follows
			else:
				reach = 0
				similarity = -1

				# attempt to bridge gap if dissimilarity is seen
				while reach < max_gap and right + reach < duration and similarity < persistence:
					# check if the following slice fits the hypothesis
					# section = np.vstack((notes[left:right+1], notes[right + reach]))
					# b_next = axis_basis(np.sum(section, 0))
					b_next = axis_basis(notes[right + reach])
					(try_cand, try_conf) = get_cand(b_next)

					# similarity = matches(trim(b_curr, b_ambiguous, 1), b_next)
					similarity = b_next[candidate]
					debug_print('chk', right, right + reach, 'cnd', candidate, similarity)
					reach += 1

				# exited due to similarity - can extend
				if similarity >= persistence or right + reach >= duration:
					block(-0.5, right - 1, right, 'green')

					debug_print('ext', right, similarity)
					# all's right - we can aggregate this slice
					section = np.sum(notes[left:right+1], 0)
					# basis_prob[right] = b_curr = axis_basis(section)
					basis_prob[right] = b_curr = axis_basis(notes[right])
					tension[right] = tens_mod.selfTension(section)
				# a gap was found and was too large
				elif similarity < persistence and reach >= max_gap:
					block(0, right - 1, right, 'yellow')
					debug_print('rev', right, similarity, list(b_next))
					bar(right)
					right -= 1
					label_basis()
					candidate = None
					left = right + 1

			right += 1

			# back-label

		# label when hitting end
		label_basis()

		# basis_prob = np.apply_along_axis(axis_basis, 1, notes)
		# ema(basis_prob, 0.2)

		grid[0].set_title("{0} group {1}".format(roll.filepath, tempo))

		Plot_Bases.locator_params(axis='y', nbins = 12)

		min_note = min([tape.min_note for tape in group])
		max_note = max([tape.max_note for tape in group])

		grid[0].plot(np.r_[:duration] + 0.5, 2 * tension / np.max(tension), 'k')
		grid[1].imshow(notes.T[min_note:max_note + 1],
			interpolation = 'none',
			cmap = plt.cm.Oranges,
			origin = 'lower',
			extent=[0, duration, 0, 12],
			aspect = 0.5 * duration / 24)
		Plot_Bases.imshow(basis_prob.T,
			interpolation = 'none',
			cmap = plt.cm.Greys,
			origin = 'lower',
			extent=[0, duration, 0, 12],
			aspect = 0.5 * duration / 24)
		grid[2].imshow(basis_label.T,
			interpolation = 'none',
			cmap = plt.cm.jet,
			origin = 'lower',
			extent=[0, duration, 0, 12],
			aspect = 0.5 * duration / (24 * 3))

		# print(basis_label)

		plt.show()

		# TODO label afterwards, and re-pickle

	# This is really a classification problem that ought to be addressed with the proper tools

	# get it to mark what actions it took - exploring, backlabelling
	# prevent "consecutive self-labelling" for example
	# and also smooth away hiccups

# from pycallgraph import PyCallGraph
# from pycallgraph.output import GraphvizOutput
if __name__ == '__main__':
	# with PyCallGraph(output=GraphvizOutput(output_file = "BASIS.png")):

	# do_basis_label('./mid/bach/aof/can1.mrl', dissonance_metric)
	do_basis_label('./mid/moldau_single.mrl', TensionModule.metric.western)
	do_basis_label('./mid/moldau_accomp.mrl', TensionModule.metric.western)
	# do_basis_label('./mid/bach/aof/can1.mrl', TensionModule.metric.western)
	# do_basis_label('./mid/oldyuanxian2.mrl', TensionModule.metric.western)
	# do_basis_label('./mid/mary.mrl')
	# do_basis_label('./mid/ambigious_test.mrl', TensionModule.metric.western) # lowsim 0.3 - 0.35
	# do_basis_label('./mid/ivivi.mrl', TensionModule.metric.western) # lowsim 0.5

"""
TODO: Confidence in labelling - should be used
TODO: Make sure no OTHER candidate surpasses the first before extending
"""

"""
Entirely hopeless; needs restart.

ON NEXT TRY:
	1: Interleave note activation times in MusicRoll instead of producing the actual timeseries.
	(Timeseries for use with neural model)
	2: Bias towards "sensible" shifts from previous basis (circle of fifths distance)
"""


text:
<?php

namespace Reddin2\UserBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use FOS\UserBundle\Model\UserManagerInterface;
class ImportController extends Controller
{
    public function importAction($file)
    {
        $userManager = $container->get('fos_user.user_manager');
		$user = $userManager->createUser();

		return $this->render('Reddin2UserBundle:Default:index.html.twig');
    }
}


text:
function WaitingOpen(texto) {
    if (texto == '' || texto == null) {
        $('#waitingText').html('Cargando ...');
    } else {
        $('#waitingText').html(texto);
    }
    $('#waiting').fadeIn('slow');
}

function WaitingClose() {
    $('#waiting').fadeOut('slow');
}

function LoadIconAction(idTag, action) {
    var icon = "";
    var actt = "";

    switch (action) {
        case 'Add':
            icon = '';
            actt = 'Agregar ';
            break;
        case 'Edit':
            icon = '';
            actt = 'Editar ';
            break;
        case 'Del':
            icon = '';
            actt = 'Eliminar ';
            break;
        case 'View':
            icon = '';
            actt = 'Consultar ';
            break;
        case 'Search':
            icon = '';
            actt = 'Buscar ';
            break;
        case 'Program':
            icon = '';
            actt = 'Programar ';
            break;
        case 'ReProgram':
            icon = '';
            actt = 'Re-Programar ';
            break;
        case 'Close':
            icon = '';
            actt = 'Cerrar ';
            break;

        case 'Disc':
            icon = '';
            actt = 'Descartar ';
            break;

        case 'Conf':
            icon = '';
            actt = 'Confirmar ';
            break;

        case 'Print':
            icon = '';
            actt = 'Imprimir ';
            break;
        case 'Ent':
            icon = '';
            actt = 'Entregar ';
            break;
        case 'Dep':
            icon = '';
            actt = 'Depositar ';
            break;
    }

    $('#' + idTag).html(icon + actt);
}

function ActiveCamera() {

    $("#botonDetener").removeAttr("disabled", "disabled");
    $("#botonFoto").removeAttr("disabled", "disabled");
    $("#botonIniciar").attr("disabled", "disabled");
    init();

    function init() {
        var video = document.querySelector('#camara'),
            canvas = document.querySelector('#foto'),
            btn = document.querySelector('#botonFoto'),
            img = document.querySelector('#imgCamera');

        navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUSerMedia || navigator.msGetUserMedia);

        if (navigator.getUserMedia) {
            navigator.getUserMedia({ video: true }, function(stream) {
                video.src = window.URL.createObjectURL(stream);
                video.play();
            }, function(e) { console.log(e) });

            video.addEventListener('loadedmetadata', function() { canvas.width = video.videoWidth, canvas.height = video.videoHeight; }, false);
            btn.addEventListener('click', function() {
                $('#updatePicture').val('1');
                canvas.getContext('2d').drawImage(video, 0, 0);
                var imgData = canvas.toDataURL('image/png');
                img.setAttribute('src', imgData);

            });

        } else {
            alert("Actualiza tu nvegador");
        }
    }
}

function StopCamera() {
    $("#botonDetener").attr("disabled", "disabled");
    $("#botonFoto").attr("disabled", "disabled");
    $("#botonIniciar").removeAttr("disabled", "disabled");

    var video = document.querySelector('#camara');
    navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUSerMedia || navigator.msGetUserMedia);

    if (navigator.getUserMedia) {
        navigator.getUserMedia({ video: true }, function(stream) {
            video.pause();
        }, function(e) { console.log(e) });
    }
}

function ActiveCameraArt() {

    $("#botonDetener").removeAttr("disabled", "disabled");
    $("#botonFoto1").removeAttr("disabled", "disabled");
    $("#botonFoto2").removeAttr("disabled", "disabled");
    $("#botonFoto3").removeAttr("disabled", "disabled");
    $("#botonFoto4").removeAttr("disabled", "disabled");
    $("#botonIniciar").attr("disabled", "disabled");
    init();

    function init() {
        var video = document.querySelector('#camara'),
            canvas = document.querySelector('#foto'),
            btn1 = document.querySelector('#botonFoto1'),
            btn2 = document.querySelector('#botonFoto2'),
            btn3 = document.querySelector('#botonFoto3'),
            btn4 = document.querySelector('#botonFoto4'),
            img1 = document.querySelector('#imgCamera1'),
            img2 = document.querySelector('#imgCamera2'),
            img3 = document.querySelector('#imgCamera3'),
            img4 = document.querySelector('#imgCamera4');

        navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUSerMedia || navigator.msGetUserMedia);

        if (navigator.getUserMedia) {
            navigator.getUserMedia({ video: true }, function(stream) {
                video.src = window.URL.createObjectURL(stream);
                video.play();
            }, function(e) { console.log(e) });

            video.addEventListener('loadedmetadata', function() { canvas.width = video.videoWidth, canvas.height = video.videoHeight; }, false);
            btn1.addEventListener('click', function() {
                $('#updatePicture1').val('1');
                canvas.getContext('2d').drawImage(video, 0, 0);
                var imgData = canvas.toDataURL('image/png');
                img1.setAttribute('src', imgData);

            });
            btn2.addEventListener('click', function() {
                $('#updatePicture2').val('1');
                canvas.getContext('2d').drawImage(video, 0, 0);
                var imgData = canvas.toDataURL('image/png');
                img2.setAttribute('src', imgData);

            });
            btn3.addEventListener('click', function() {
                $('#updatePicture3').val('1');
                canvas.getContext('2d').drawImage(video, 0, 0);
                var imgData = canvas.toDataURL('image/png');
                img3.setAttribute('src', imgData);

            });
            btn4.addEventListener('click', function() {
                $('#updatePicture4').val('1');
                canvas.getContext('2d').drawImage(video, 0, 0);
                var imgData = canvas.toDataURL('image/png');
                img4.setAttribute('src', imgData);

            });

        } else {
            alert("Actualiza tu nvegador");
        }
    }
}

var divCerrado = '';

function ProcesarError(outHtml, div) {
    divCerrado = '#' + div;
    $(divCerrado).modal('hide');
    var html_ = outHtml.split('');

    if (html_[1] !== undefined) {
        html_ = html_[1].split('');
        $('#error_db_msj').html(html_[0].replace('
A Database Error Occurred
', ''));
    } else {
        html_ = outHtml;
        $('#error_db_msj').html('
 Error!
La sesión ha expirado, por favor vuelva a iniciar sesión.');
    }

    $('#modalError').modal({ backdrop: 'static', keyboard: false });
    $('#modalError').modal('show');
}

function cerrarError() {
    $(divCerrado).modal('show');
}


text:
	</div>
</div>
<script type='text/javascript' src="<?php echo base_url(); ?>js/custom.js"></script>
</body>
</html>


text:
<?php declare(strict_types=1);

namespace DrdPlus\Races\Exceptions;

interface Runtime extends Exception
{

}


text:
package org.bpel4chor.splitprocess.test.fragmentation;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.xml.bind.JAXBException;

import org.bpel4chor.splitprocess.RuntimeData;
import org.bpel4chor.splitprocess.dataflowanalysis.AnalysisResultParser;
import org.bpel4chor.splitprocess.dataflowanalysis.DataFlowAnalyzer;
import org.bpel4chor.splitprocess.dataflowanalysis.QueryWriterSet;
import org.bpel4chor.splitprocess.exceptions.DataFlowAnalysisException;
import org.bpel4chor.splitprocess.exceptions.PWDGException;
import org.bpel4chor.splitprocess.exceptions.PartitionSpecificationException;
import org.bpel4chor.splitprocess.exceptions.WDGException;
import org.bpel4chor.splitprocess.fragmentation.DataDependencyFragmenter;
import org.bpel4chor.splitprocess.partition.model.PartitionSpecification;
import org.bpel4chor.splitprocess.partition.representation.PartitionSpecReader;
import org.bpel4chor.splitprocess.pwdg.model.PWDG;
import org.bpel4chor.splitprocess.pwdg.model.PWDGNode;
import org.bpel4chor.splitprocess.pwdg.model.WDG;
import org.bpel4chor.splitprocess.pwdg.util.PWDGFactory;
import org.bpel4chor.splitprocess.pwdg.util.WDGFactory;
import org.bpel4chor.utils.BPEL4ChorModelConstants;
import org.bpel4chor.utils.BPEL4ChorReader;
import org.eclipse.bpel.model.Activity;
import org.eclipse.bpel.model.BPELFactory;
import org.eclipse.bpel.model.BPELPlugin;
import org.eclipse.bpel.model.Process;
import org.eclipse.bpel.model.Variable;
import org.eclipse.bpel.model.resource.BPELResourceFactoryImpl;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.internal.util.WSDLResourceFactoryImpl;
import org.eclipse.xsd.util.XSDResourceFactoryImpl;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import de.uni_stuttgart.iaas.bpel.model.utilities.MyBPELUtils;
import de.uni_stuttgart.iaas.bpel.model.utilities.MyWSDLUtil;
import de.uni_stuttgart.iaas.bpel_d.algorithm.analysis.AnalysisResult;

public class DataDependencyFragmenterTest {

	static File testFileDir = null;

	static Process process = null;

	static Definition definition = null;

	static PartitionSpecification partitionSpec1 = null;
	static PartitionSpecification partitionSpec2 = null;

	static AnalysisResult analysis = null;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		//
		// use the process "OrderingProcess" in Project OrderInfo
		//

		File projectDir = new File("");
		testFileDir = new File(projectDir.getAbsolutePath(), "files");

		// init
		BPELPlugin bpelPlugin = new BPELPlugin();
		Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bpel", new BPELResourceFactoryImpl());
		Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("wsdl", new WSDLResourceFactoryImpl());
		Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl());

		// load bpel resource
		String bpelURI = testFileDir.getAbsolutePath() + "\\OrderInfo\\bpelContent\\OrderingProcess.bpel";
		process = loadBPEL(bpelURI);

		// load wsdl
		definition = MyWSDLUtil.readWSDL(testFileDir.getAbsolutePath()
				+ "\\OrderInfo\\bpelContent\\OrderingProcess.wsdl");

		// partition specification
		String partition1URI = testFileDir.getAbsolutePath() + "\\OrderInfo\\bpelContent\\Partition1.xml";
		partitionSpec1 = loadPartitionSpec(partition1URI, process);
		String partition2URI = testFileDir.getAbsolutePath() + "\\OrderInfo\\bpelContent\\Partition2.xml";
		partitionSpec2 = loadPartitionSpec(partition2URI, process);

		// analyse process
		analysis = DataFlowAnalyzer.analyze(process);
	}

	protected static Process loadBPEL(String strURI) {
		ResourceSet resourceSet = new ResourceSetImpl();
		URI uri = URI.createFileURI(strURI);
		Resource resource = resourceSet.getResource(uri, true);
		return (Process) resource.getContents().get(0);
	}

	protected static PartitionSpecification loadPartitionSpec(String strURI, Process process) throws JAXBException,
			FileNotFoundException, PartitionSpecificationException {
		FileInputStream inputStream = new FileInputStream(new File(strURI));
		PartitionSpecReader reader = new PartitionSpecReader();
		return reader.readSpecification(inputStream, process);
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testInitNode2NameMap() throws DataFlowAnalysisException, WDGException, PWDGException {
		// prepare pwdg for test
		Activity act = MyBPELUtils.resolveActivity("E", process);
		Variable var = MyBPELUtils.resolveVariable("paymentInfo", process);
		QueryWriterSet qwSet = AnalysisResultParser.parse(act, var, analysis);
		WDG wdg = WDGFactory.createWDG(qwSet.getAllWriters());

		// we have the pwdg {n1=(x,{B}), n2=(y,{C}), n3=(z,{D})}, e1=(n1,n2),
		// e2=(n1,n3)
		PWDG pwdg = PWDGFactory.createPWDG(wdg, process, partitionSpec1);
		assertTrue(pwdg.vertexSet().size() == 3);

		// create dataDependencyFragmenter
		RuntimeData data = new RuntimeData(process, partitionSpec1, definition,
				BPEL4ChorModelConstants.DEFAULT_SPLITTING_OUTPUT_DIR);
		MyDataDependencyFragmenter fragmenter = new MyDataDependencyFragmenter(data);

		// init node2NameMap
		fragmenter.initNode2NameMap(pwdg);

		// test whether the id associated to the node is unique
		Set<String> ids = new HashSet<String>();
		for (PWDGNode node : pwdg.vertexSet()) {
			String id = fragmenter.getNode2NameMap().get(node);
			assertNotNull(id);
			assertFalse(ids.contains(id));
			ids.add(id);
		}

	}

	@Test
	public void testInitQuerySet2nameMap() throws DataFlowAnalysisException, WDGException, PWDGException {
		// prepare pwdg for test
		Activity act = MyBPELUtils.resolveActivity("E", process);
		Variable var = MyBPELUtils.resolveVariable("paymentInfo", process);

		// we have a key set for variable "paymentInfo" { {.actNum}:{B},
		// {.amt}:{C, D, B} }
		QueryWriterSet qwSet = AnalysisResultParser.parse(act, var, analysis);
		assertTrue(qwSet.size() == 2);

		// create dataDependencyFragmenter
		RuntimeData data = new RuntimeData(process, partitionSpec1, definition,
				BPEL4ChorModelConstants.DEFAULT_SPLITTING_OUTPUT_DIR);
		MyDataDependencyFragmenter fragmenter = new MyDataDependencyFragmenter(data);

		// init querySet2nameMap
		fragmenter.initQuerySet2nameMap(var.getName(), qwSet.querySets());

		// test the querySet:id
		Set<String> qs1 = new HashSet<String>();
		Set<String> qs2 = new HashSet<String>();
		qs1.add(".actNum");
		qs2.add(".amt");
		String id1 = fragmenter.getQuerySet2NameMap().get(qs1);
		String id2 = fragmenter.getQuerySet2NameMap().get(qs2);
		assertNotNull(id1);
		assertNotNull(id2);
		assertFalse(id1.equals(id2));

	}

	@Test
	public void testGetIdQuerySet() {
		// prepare pwdg for test
		Activity act = MyBPELUtils.resolveActivity("E", process);
		Variable var = MyBPELUtils.resolveVariable("paymentInfo", process);

		// we have a key set for variable "paymentInfo" { {.actNum}:{B},
		// {.amt}:{C, D, B} }
		QueryWriterSet qwSet = AnalysisResultParser.parse(act, var, analysis);
		assertTrue(qwSet.size() == 2);

		// create dataDependencyFragmenter
		RuntimeData data = new RuntimeData(process, partitionSpec1, definition);
		MyDataDependencyFragmenter fragmenter = new MyDataDependencyFragmenter(data);

		// init querySet2nameMap
		fragmenter.initQuerySet2nameMap(var.getName(), qwSet.querySets());

		Set<String> qs1 = new HashSet<String>();
		Set<String> qs2 = new HashSet<String>();
		Set<String> qs3 = new HashSet<String>();

		qs1.add(".actNum");
		qs2.addAll(qs1);
		qs3.add(".amt");

		// id1 and id2 should be equal , they have the same query set
		String id1 = fragmenter.id(qs1);
		String id2 = fragmenter.id(qs2);
		assertNotNull(id1);
		assertNotNull(id2);
		assertEquals(id1, id2);

		// id1 and id3 are not equal, they have differnt query set
		String id3 = fragmenter.id(qs3);
		assertNotNull(id3);
		assertFalse(id3.equals(id1));
	}

	@Test
	public void testGetIdNode() throws PWDGException, WDGException {
		// prepare pwdg for test
		Activity act = MyBPELUtils.resolveActivity("E", process);
		Variable var = MyBPELUtils.resolveVariable("paymentInfo", process);
		QueryWriterSet qwSet = AnalysisResultParser.parse(act, var, analysis);
		WDG wdg = WDGFactory.createWDG(qwSet.getAllWriters());

		// we have the pwdg {n1=(x,{B}), n2=(y,{C}), n3=(z,{D})}, e1=(n1,n2),
		// e2=(n1,n3)
		PWDG pwdg = PWDGFactory.createPWDG(wdg, process, partitionSpec1);
		assertTrue(pwdg.vertexSet().size() == 3);

		RuntimeData data = new RuntimeData(process, partitionSpec1, definition);
		MyDataDependencyFragmenter fragmenter = new MyDataDependencyFragmenter(data);

		fragmenter.initNode2NameMap(pwdg);

		Set<String> ids = new HashSet<String>();
		for (PWDGNode node : pwdg.vertexSet()) {
			String id = fragmenter.getNode2NameMap().get(node);
			assertNotNull(id);
			assertFalse(ids.contains(id));
			ids.add(id);
		}
	}

	@Test
	public void testGetSortedActivities() {
		RuntimeData data = new RuntimeData(process, partitionSpec1, definition);
		MyDataDependencyFragmenter fragmenter = new MyDataDependencyFragmenter(data);

		// create unsorted array
		List<Activity> acts = new ArrayList<Activity>();
		Activity act1 = BPELFactory.eINSTANCE.createActivity();
		Activity act2 = BPELFactory.eINSTANCE.createActivity();
		act1.setName("kActivity");
		act2.setName("iActi");
		acts.add(act1);
		acts.add(act2);
		// sort them
		fragmenter.sortActivities(acts);
		// assert they are sorted
		assertActivitiesIsSorted(acts);

	}

	private void assertActivitiesIsSorted(List<Activity> acts) {
		String last = null;
		for (int i = 0; i < acts.size(); i++) {
			String current = acts.get(i).getName();
			assertNotNull(current);
			if (last != null)
				assertTrue(last.compareTo(current) < 0);
			last = current;
		}
	}

	@Test
	public void testSortVariables() {
		RuntimeData data = new RuntimeData(process, partitionSpec1, definition);
		MyDataDependencyFragmenter fragmenter = new MyDataDependencyFragmenter(data);

		// create unsorted array
		List<Variable> vars = new ArrayList<Variable>();
		Variable var1 = BPELFactory.eINSTANCE.createVariable();
		Variable var2 = BPELFactory.eINSTANCE.createVariable();
		var1.setName("BVriable");
		var2.setName("AVriable");
		vars.add(var1);
		vars.add(var2);
		// sort them
		fragmenter.sortVariables(vars);
		// assert they are sorted
		assertVariablesIsSorted(vars);

	}

	private void assertVariablesIsSorted(List<Variable> vars) {
		String last = null;
		for (int i = 0; i < vars.size(); i++) {
			String current = vars.get(i).getName();
			assertNotNull(current);
			if (last != null) {
				assertTrue(last.compareTo(current) < 0);
			}
			last = current;
		}

	}

	@Test
	public void testDataDependencyFragmenter() {

		try {
			@SuppressWarnings("unused")
			DataDependencyFragmenter frag = new DataDependencyFragmenter(null);
			fail();
		} catch (NullPointerException e) {
			// catch the NPE is good.
		}
	}

//	@Test
//	public void createLocalResolver() {
//
//	}
//
//	@Test
//	public void createReceivingFlow() {
//
//	}
//
//	@Test
//	public void testSplitDataDependency() {
//		fail("Not yet implemented"); // TODO
//	}

}

class MyDataDependencyFragmenter extends DataDependencyFragmenter {

	public MyDataDependencyFragmenter(RuntimeData data) {
		super(data);
	}

	public String id(Set<String> queryset) {
		return super.id(queryset);
	}

	public String id(PWDGNode node) {
		return super.id(node);
	}

	public void sortActivities(List<Activity> activities) {
		super.sortActivities(activities);
	}

	public void sortVariables(List<Variable> variables) {
		super.sortVariables(variables);
	}

	public void initNode2NameMap(PWDG pwdg) {
		super.initNode2NameMap(pwdg);
	}

	public void initQuerySet2nameMap(String varName, Set<Set<String>> keySet) {
		super.initQuerySet2nameMap(varName, keySet);
	}

	public Map<Set<String>, String> getQuerySet2NameMap() {
		return super.querySet2NameMap;
	}

	public Map<PWDGNode, String> getNode2NameMap() {
		return super.node2NameMap;
	}
}


text:
using System;
using System.Runtime.InteropServices;

namespace Godot
{
    [StructLayout(LayoutKind.Sequential)]
    public struct Rect2 : IEquatable<Rect2>
    {
        private Vector2 position;
        private Vector2 size;

        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }

        public Vector2 Size
        {
            get { return size; }
            set { size = value; }
        }

        public Vector2 End
        {
            get { return position + size; }
        }

        public float Area
        {
            get { return get_area(); }
        }

        public Rect2 clip(Rect2 b)
        {
            Rect2 newRect = b;

            if (!intersects(newRect))
                return new Rect2();

            newRect.position.x = Mathf.max(b.position.x, position.x);
            newRect.position.y = Mathf.max(b.position.y, position.y);

            Vector2 bEnd = b.position + b.size;
            Vector2 end = position + size;

            newRect.size.x = Mathf.min(bEnd.x, end.x) - newRect.position.x;
            newRect.size.y = Mathf.min(bEnd.y, end.y) - newRect.position.y;

            return newRect;
        }

        public bool encloses(Rect2 b)
        {
            return (b.position.x >= position.x) && (b.position.y >= position.y) &&
               ((b.position.x + b.size.x) < (position.x + size.x)) &&
               ((b.position.y + b.size.y) < (position.y + size.y));
        }

        public Rect2 expand(Vector2 to)
        {
            Rect2 expanded = this;

            Vector2 begin = expanded.position;
            Vector2 end = expanded.position + expanded.size;

            if (to.x < begin.x)
                begin.x = to.x;
            if (to.y < begin.y)
                begin.y = to.y;

            if (to.x > end.x)
                end.x = to.x;
            if (to.y > end.y)
                end.y = to.y;

            expanded.position = begin;
            expanded.size = end - begin;

            return expanded;
        }

        public float get_area()
        {
            return size.x * size.y;
        }

        public Rect2 grow(float by)
        {
            Rect2 g = this;

            g.position.x -= by;
            g.position.y -= by;
            g.size.x += by * 2;
            g.size.y += by * 2;

            return g;
        }

        public Rect2 grow_individual(float left, float top, float right, float bottom)
        {
            Rect2 g = this;

            g.position.x -= left;
            g.position.y -= top;
            g.size.x += left + right;
            g.size.y += top + bottom;

            return g;
        }

        public Rect2 grow_margin(int margin, float by)
        {
            Rect2 g = this;

            g.grow_individual((GD.MARGIN_LEFT == margin) ? by : 0,
                    (GD.MARGIN_TOP == margin) ? by : 0,
                    (GD.MARGIN_RIGHT == margin) ? by : 0,
                    (GD.MARGIN_BOTTOM == margin) ? by : 0);

            return g;
        }

        public bool has_no_area()
        {
            return size.x <= 0 || size.y <= 0;
        }

        public bool has_point(Vector2 point)
        {
            if (point.x < position.x)
                return false;
            if (point.y < position.y)
                return false;

            if (point.x >= (position.x + size.x))
                return false;
            if (point.y >= (position.y + size.y))
                return false;

            return true;
        }

        public bool intersects(Rect2 b)
        {
            if (position.x > (b.position.x + b.size.x))
                return false;
            if ((position.x + size.x) < b.position.x)
                return false;
            if (position.y > (b.position.y + b.size.y))
                return false;
            if ((position.y + size.y) < b.position.y)
                return false;

            return true;
        }

        public Rect2 merge(Rect2 b)
        {
            Rect2 newRect;

            newRect.position.x = Mathf.min(b.position.x, position.x);
            newRect.position.y = Mathf.min(b.position.y, position.y);

            newRect.size.x = Mathf.max(b.position.x + b.size.x, position.x + size.x);
            newRect.size.y = Mathf.max(b.position.y + b.size.y, position.y + size.y);

            newRect.size = newRect.size - newRect.position; // Make relative again

            return newRect;
        }

        public Rect2(Vector2 position, Vector2 size)
        {
            this.position = position;
            this.size = size;
        }

        public Rect2(float x, float y, float width, float height)
        {
            this.position = new Vector2(x, y);
            this.size = new Vector2(width, height);
        }

        public static bool operator ==(Rect2 left, Rect2 right)
        {
            return left.Equals(right);
        }

        public static bool operator !=(Rect2 left, Rect2 right)
        {
            return !left.Equals(right);
        }

        public override bool Equals(object obj)
        {
            if (obj is Rect2)
            {
                return Equals((Rect2)obj);
            }

            return false;
        }

        public bool Equals(Rect2 other)
        {
            return position.Equals(other.position) && size.Equals(other.size);
        }

        public override int GetHashCode()
        {
            return position.GetHashCode() ^ size.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format("({0}, {1})", new object[]
            {
                this.position.ToString(),
                this.size.ToString()
            });
        }

        public string ToString(string format)
        {
            return String.Format("({0}, {1})", new object[]
            {
                this.position.ToString(format),
                this.size.ToString(format)
            });
        }
    }
}


text:
package ru.job4j.algorithms.binary;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.*;

public class BinarySearchTest {
    @Test
    public void whenEvaluateUnsortedListThenResultIsFalse() {
        List<Integer> original = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 7, 6));
        assertFalse(new BinarySearch<Integer>().isSort(original));
    }

    @Test
    public void whenTryToSearchInUnsortedListWhenResultIsMinusOne() {
        List<Integer> original = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 7, 6));
        assertTrue(new BinarySearch<Integer>().findIndex(4, original) == -1);
    }

    @Test
    public void whenSeachThroughSortedListThenGetValueIndex() {
        List<Integer> original = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8));
        assertTrue(new BinarySearch<Integer>().findIndex(8, original) == 7);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/baseLayoutParam"
    android:orientation="vertical">

    <include layout="@layout/toolbar" />

    <FrameLayout
        android:id="@+id/fragment_frame"
        style="@style/baseLayoutParam" />

</LinearLayout>


text:
package org.bbsync.webservice.client.course;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import java.util.Calendar;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class TestBbTerm {
	private BbTerm bb_term = null;

	@BeforeClass
	public static void testUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void testUp() throws Exception {
		bb_term = new BbTerm();
	}

	@After
	public void tearDown() throws Exception {
		bb_term = null;
	}

	@Test
	public void testId(){
		assertNull(bb_term.getId());
    	bb_term.setId("id");
    	assertNotNull(bb_term.getId());
        assertEquals("id", bb_term.getId());
	}

	@Test
	public void testName(){
		assertNull(bb_term.getName());
    	bb_term.setName("name");
    	assertNotNull(bb_term.getName());
        assertEquals("name", bb_term.getName());
	}

	@Test
	public void testDescription(){
		assertNull(bb_term.getDescription());
    	bb_term.setDescription("description");
    	assertNotNull(bb_term.getDescription());
        assertEquals("description", bb_term.getDescription());
	}

	@Test
	public void testDescriptionType(){
		assertNull(bb_term.getDescriptionType());
    	bb_term.setDescriptionType(BbTerm.TEXT_TYPE_HTML);
    	assertNotNull(bb_term.getDescriptionType());
        assertEquals(BbTerm.TEXT_TYPE_HTML, bb_term.getDescriptionType());
	}

	@Test
	public void testSourcedidSource(){
		assertNull(bb_term.getSourcedidSource());
    	bb_term.setSourcedidSource("sourcedid_source");
    	assertNotNull(bb_term.getSourcedidSource());
        assertEquals("sourcedid_source", bb_term.getSourcedidSource());
	}

	@Test
	public void testSourcedidId(){
		assertNull(bb_term.getSourcedidId());
    	bb_term.setSourcedidId("sourcedid_id");
    	assertNotNull(bb_term.getSourcedidId());
        assertEquals("sourcedid_id", bb_term.getSourcedidId());
	}

	@Test
	public void testDataSrcId(){
		assertNull(bb_term.getDataSrcId());
    	bb_term.setDataSrcId("data_source_id");
    	assertNotNull(bb_term.getDataSrcId());
        assertEquals("data_source_id", bb_term.getDataSrcId());
	}

	@Test
	public void testDuration(){
		assertNull(bb_term.getDuration());
		bb_term.setDuration(BbTerm.DURATION_CONTINUOUS);
		assertNotNull(bb_term.getDuration());
		assertEquals(BbTerm.DURATION_CONTINUOUS, bb_term.getDuration());
	}

	@Test
	public void testStartDate(){
		long now = Calendar.getInstance().getTimeInMillis();
    	long now_no_millis = Long.parseLong(String.valueOf(now).substring(0, 10) + "000");
    	assertEquals(0, bb_term.getStartDate());
    	bb_term.setStartDate(now);
        assertEquals(now_no_millis, bb_term.getStartDate());
	}

	@Test
	public void testEndDate(){
		long now = Calendar.getInstance().getTimeInMillis();
    	long now_no_millis = Long.parseLong(String.valueOf(now).substring(0, 10) + "000");
    	assertEquals(0, bb_term.getEndDate());
    	bb_term.setEndDate(now);
        assertEquals(now_no_millis, bb_term.getEndDate());
	}

	@Test
	public void testDaysOfUse(){
		assertEquals(0, bb_term.getDaysOfUse());
    	bb_term.setDaysOfUse(111);
        assertEquals(111, bb_term.getDaysOfUse());
	}

	@Test
	public void testAvailable(){
		assertFalse(bb_term.isAvailable());
		bb_term.setAvailable(true);
		assertTrue(bb_term.isAvailable());
	}

	@Test
	public void testExpansionData(){
		bb_term.setExpansionData(new String[]{"org.bbsync.BbCourse.ExpansionData=expansion_data"});
		assertEquals("org.bbsync.BbCourse.ExpansionData=expansion_data", bb_term.getExpansionData()[0]);
	}
}


text:
module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular/cli'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-phantomjs-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular/cli/plugins/karma')
    ],
    client:{
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    files: [
      { pattern: './src/test.ts', watched: false }
    ],
    preprocessors: {
      './src/test.ts': ['@angular/cli']
    },
    mime: {
      'text/x-typescript': ['ts','tsx']
    },
    coverageIstanbulReporter: {
      reports: [ 'html', 'lcovonly' ],
      fixWebpackSourcePaths: true
    },
    angularCli: {
      environment: 'dev'
    },
    reporters: config.angularCli && config.angularCli.codeCoverage
              ? ['progress', 'coverage-istanbul']
              : ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome','PhantomJS'],
    singleRun: false,

    phantomjsLauncher: {
      // Have phantomjs exit if a ResourceError is encountered (useful if karma exits without killing phantom)
      exitOnResourceError: true
    },

    customLaunchers: {
      Chrome_travis_ci: {
        base: 'Chrome',
        flags: ['--no-sandbox']
      }
    }
  });
  if (process.env.TRAVIS || process.env.CIRCLECI) {
    config.browsers = ['Chrome_travis_ci'];
    config.singleRun = true;
  }
};


text:
package org.ovirt.engine.core.bll;

import org.ovirt.engine.core.compat.*;
import org.ovirt.engine.core.dal.dbbroker.*;
import org.ovirt.engine.core.common.queries.*;

public class GetAllNetworksByClusterIdQuery<P extends VdsGroupQueryParamenters> extends QueriesCommandBase<P> {
    public GetAllNetworksByClusterIdQuery(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeQueryCommand() {
        Guid vdsgroupid = getParameters().getVdsGroupId();
        getQueryReturnValue().setReturnValue(DbFacade.getInstance().getNetworkDAO().getAllForCluster(vdsgroupid));
    }
}


text:
package com.zoe.wechat.message.resp;

import java.util.List;

public class NewsMessage extends BaseMessage {

	  // 图文消息个数,限制为10条以内
	  private int ArticleCount;
	  // 多条图文消息信息,默认第一个item为大图
	  private List<Article> Articles;

	  public int getArticleCount() {
	    return ArticleCount;
	  }
	  public void setArticleCount(int articleCount) {
	    ArticleCount = articleCount;
	  }
	  public List<Article> getArticles() {
	    return Articles;
	  }
	  public void setArticles(List<Article> articles) {
	    Articles = articles;
	  }
	}


text:
<?php
namespace Amazon\Region\US;

/**
 * Generated by PHPUnit_SkeletonGenerator on 2012-05-09 at 16:47:39.
 */
class East1Test extends \PHPUnit_Framework_TestCase
{
    /**
     * @var East1
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new East1;
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    public function testIsSESEnabled()
    {
        $this->assertTrue($this->object->isSESEnabled());
    }

    public function testGetSESHost()
    {
        $this->assertSame('email.us-east-1.amazonaws.com', $this->object->getSESHost());
    }
}


text:
from datetime import datetime
from json import loads
from sys import stderr
from time import mktime

from django.core.management.base import BaseCommand, CommandError
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.geos import GEOSGeometry
from django.db import IntegrityError
from parsedatetime import Calendar

from bpz.models import Case

'''
Import BPZ case data
'''

def parse_datetime(value):
    calendar = Calendar()
    raw_date = loads('"%s"' % value)
    timestamp = mktime(calendar.parseDateText(raw_date))
    return datetime.fromtimestamp(timestamp).date()

def parse_feature_raw_value(feature, field_name):
    raw_value = feature[field_name].value
    value = raw_value
    if '\r\n' in raw_value:
        value = raw_value.split('\r\n', 1)[0]
        stderr.write('Invalid %s: "%s". Using first line: "%s"\n' %
                     (field_name, repr(raw_value), value))
    return loads('"%s"' % value)

# http://stackoverflow.com/a/19357056/571420
def update_or_create(command, model, filter_kwargs, update_kwargs):
    if not model.objects.filter(**filter_kwargs).update(**update_kwargs):
        kwargs = filter_kwargs.copy()
        kwargs.update(update_kwargs)
        try:
            model.objects.create(**kwargs)
            print('New case "%s"' % kwargs['case_id'])
            command.new += 1
        except IntegrityError:
            if not (model.objects.filter(**filter_kwargs)
                    .update(**update_kwargs)):
                raise
    else:
        print('Updated case "%s"' % update_kwargs['case_id'])
        command.updated += 1

class Command(BaseCommand):
    args = '<cases.json>'
    help = 'Imports case GeoJSON'
    new, updated = 0, 0

    def handle(self, *args, **options):
        if len(args) != 1:
            raise CommandError('Pass one json file to import')

        # Load data
        datasource = DataSource(args[0], encoding='iso-8859-1')
        layer = datasource[0]
        for feature in layer:
            # Get the common attributes' values
            attr = {
                'object_id': feature['OBJECTID'].value,
                'case_id': loads('"%s"' % feature['Case_'].value),
                'status': feature['Status'].value,
                'link': loads('"%s"' % feature['Link'].value),
            }
            attr['location'] = parse_feature_raw_value(feature, 'Location')
            attr['hearing_date'] = parse_datetime(feature['Date_'].value)
            attr['geom'] = GEOSGeometry(feature.geom.wkt)

            # Get the custom attribute values: case_type & domain
            domain = Case.DOMAIN_TMAPC
            case_type = None
            if 'BOA' in attr['case_id']:
                domain = Case.DOMAIN_BOA
                case_type = Case.NAME_BOA
            else:
                case_type = parse_feature_raw_value(feature, 'Type')
            attr['case_type'] = case_type

            filter_kwargs = {'object_id': attr['object_id'],
                             'domain': domain}
            update_or_create(self, Case, filter_kwargs, attr)

        self.stdout.write(
            'Imported %d %s cases (%d new, %d updated)' %
            (self.new + self.updated, Case.DOMAIN_CHOICES[domain],
             self.new, self.updated)
        )


text:
package org.md2k.utilities;

import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;

import com.squareup.leakcanary.LeakCanary;

/**
 * Provides methods that implement LeakCanary in this application.
 * More information about LeakCanary can be found here.
 */
public class ApplicationWithLeakCanary extends Application {
    private static Context context;

    /**
     * Sets the context of this object as the application context and calls setupLeakCanary().
     */
    @Override
    public void onCreate() {
        super.onCreate();
        ApplicationWithLeakCanary.context = getApplicationContext();
        setupLeakCanary();
    }

    /**
     * Returns the context of this object.
     * @return The context of this object.
     */
    public static Context getAppContext() {
        return ApplicationWithLeakCanary.context;
    }

    /**
     * Sets LeakCanary up for heap analysis.
     */
    void setupLeakCanary(){
        if (LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);
    }

    /**
     * Called by the system when the device configuration changes while your component is running.
     * @param newConfig New device configuration.
     */
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }

    /**
     * Called when the overall system is running low on memory.
     */
    @Override
    public void onLowMemory() {
        super.onLowMemory();
    }
}


text:
node-binary
---------

[![npm version](https://badge.fury.io/js/node-binary.svg)](http://badge.fury.io/js/node-binary)
[![dependencies](https://david-dm.org/resin-io/node-binary.png)](https://david-dm.org/resin-io/node-binary.png)
[![Build Status](https://travis-ci.org/resin-io/node-binary.svg?branch=master)](https://travis-ci.org/resin-io/node-binary)

Download node binaries for various platforms and architectures, easily.

**THIS MODULE IS DEPRECATED AND IT'S NOT BEING MAINTAINED ANYMORE**

```javascript
var binary = require('node-binary');

binary.download({
	os: 'darwin',
	arch: 'x64',
	version: 'v0.12.0'
}, '/opt/node', function(error, binaryPath) {
	if(error) throw error;

	console.log('The node binary for OS X x64 was downloaded to ' + binaryPath);
});
```

Installation
------------

Install `node-binary` by running:

```sh
$ npm install --save node-binary
```

CLI
---

`node-binary` provides a CLI version as well. Install it by running:

```sh
$ npm install -g node-binary
```

You can now download node binaries like this:

```sh
$ node-binary download v0.12.0 ~/Downloads --arch x64 --os darwin
```

Documentation
-------------

### binary.download(Object options, String dest, Function callback)

Download a nodejs binary to a certain location.

#### options

- `os` is the operating system to download node for.

This module curently supports `darwin`, `win32`, `linux` and `sunos`.

- `arch` is the architecture to download node for.

This module curently supports `x64` and `x86`.

- `version` is the node version to download.

It can be a string such as `v0.12.0` or simply `0.12.0`.

#### dest

The directory to download the binary to.

The binary will automatically be renamed to `node-<version>-<os>-<arch>[.exe]`.

#### callback(error, binaryPath)

The callback will be called with a possible error, or with the absolute path to the downloaded binary.

Tests
-----

Run the test suite by doing:

```sh
$ gulp test
```

TODO
----

- [  ] Implement a way to get the state of the download, to make use of a progress bar, etc.

Contribute
----------

- Issue Tracker: [github.com/resin-io/node-binary/issues](https://github.com/resin-io/node-binary/issues)
- Source Code: [github.com/resin-io/node-binary](https://github.com/resin-io/node-binary)

Before submitting a PR, please make sure that you include tests, and that [coffeelint](http://www.coffeelint.org/) runs without any warning:

```sh
$ gulp lint
```

ChangeLog
---------

### v1.1.0

- Improve error messages.
- Prevent temporary directory from being undefined.

### v1.0.1

Set mode to 755 for the downloaded binary.

Support
-------

If you're having any problem, please [raise an issue](https://github.com/resin-io/node-binary/issues/new) on GitHub.

License
-------

The project is licensed under the MIT license.


text:
package org.jasig.portlet.images.mvc.portlet;

import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.jasig.portlet.images.mvc.IViewSelector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.portlet.bind.annotation.ActionMapping;
import org.springframework.web.portlet.bind.annotation.RenderMapping;
import org.springframework.web.portlet.ModelAndView;

/**
 * EditController renders the editing interface and persists user selections
 * to the portlet's preferences.
 */
@Controller
@RequestMapping("EDIT")
public class EditController {

    protected final Log logger = LogFactory.getLog(getClass());

    private IViewSelector viewSelector;

    @Autowired(required = true)
    public void setViewSelector(IViewSelector viewSelector) {
        this.viewSelector = viewSelector;
    }

    @RenderMapping
    public ModelAndView showMainView(
            final RenderRequest request, final RenderResponse response) {

        // determine if the request represents a mobile browser and set the
        // view name accordingly
        final boolean isMobile = viewSelector.isMobile(request);
        final String viewName = isMobile ? "edit-jQM" : "edit";
        final ModelAndView mav = new ModelAndView(viewName);

        if(logger.isDebugEnabled()) {
            logger.debug("Using view name " + viewName + " for edit view");
        }

        return mav;

    }

    @ActionMapping
    public void editPreferences() {
    }

}


text:
RewardBot
=========

Rewards people for rising post with DogeCoin


text:
/* Custom Menu
-------------------------- */
#menuwrap {
	height: 36px;
	width: 100%;
	padding: 0px;
}

#custommenu {
    padding: 0;
    clear:both;
    height: 100%;
    margin: 0px;
    white-space: nowrap;
    float: right;
}

#custommenu ul li {
    border-right: 1px solid #777;
    border-left: 1px solid #999;
}
/*
Dropdown Menu - CSS from DeCaf Theme by Lei Zhang
-------------------------------------------------*/
ul.dropdown span.customitem {
    padding:0;
    border:0;
    width: 100%;
}
ul.dropdown span.customitem {
    padding:0;
    width: 100%;
}
ul.dropdown li a,
ul.dropdown span.customitem a {
    padding:10px 20px;
}
ul.dropdown span.customitem a:hover {
    border: 0;
}
#custommenu ul.dropdown ul {
    padding:0;
    width:auto;
}
#custommenu ul.dropdown ul a {
    padding:8px 18px;
}
#custommenu ul.dropdown > li span a {
    height:16px;
}
ul.dropdown,
ul.dropdown li,
ul.dropdown ul {
    list-style:none;
    margin:0;
    padding:0;
}
ul.dropdown {
    position:relative;
    top:0px;
    z-index:597;
    float:left;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 1.4em;
}
ul.dropdown li {
    float:left;
    line-height:1.3em;
    vertical-align:middle;
    background-color:transparent;
    color:#fff;
}
ul.dropdown li.hover,
ul.dropdown li:hover {
    position:relative;
    z-index:599;
    cursor:default;
}
ul.dropdown ul {
    visibility:hidden;
    position:absolute;
    top:100%;z-index:598;
    left:auto;
    right:0;
    margin-top: 0px;
    font:100% "Trebuchet MS",Arial,Helvetica,sans-serif;
}
ul.dropdown ul li {
    float:none;
    border-width: 1px;
    border-style: solid;
    padding:0;
    font-size: 12px;
    text-transform: none;
}

ul.dropdown ul ul {
    top:0;
    right:auto;
    left:100%;
    margin-top:0;
    border-top:none;
    border-left:none;
    font-weight:400;
}
ul.dropdown li:hover > ul {
    visibility:visible;
}
ul.dropdown span,
ul.dropdown span a,
ul.dropdown li.clickable-with-children > a {
    width:auto;
    padding:2px 6px 4px 20px;
    color: #fff;
}
ul.dropdown ul span,
ul.dropdown ul span a,
ul.dropdown ul li.clickable-with-children > a {
    background-position:100% 50%;
    background-repeat:no-repeat;
    color: #fff;
}
ul.dropdown ul ul span,
ul.dropdown ul ul span a,
ul.dropdown ul ul li.clickable-with-children > a {
    background-position:100% 50%;
    background-repeat:no-repeat;
    color: #fff;
}
ul.dropdown a:link, ul.dropdown a:visited {
    color: white;
    text-decoration: none;
}
ul.dropdown a:hover {
    border:0;
    color: #fff;
}

ul.dropdown li a,
ul.dropdown span,
ul.dropdown span a {
    border: none;
    background-color: transparent;
}

ul.dropdown ul li a,
ul.dropdown ul span,
ul.dropdown ul span a {
    border: 0;
}

ul.dropdown ul ul li a,
ul.dropdown ul ul span,
ul.dropdown ul ul span a {
    border:0
}

ul.dropdown ul ul ul li a,
ul.dropdown ul ul ul span,
ul.dropdown ul ul ul span a {
    border:0;
}

ul.dropdown a,ul.dropdown span{
    display:block;
}

ul.dropdown ul a {
    width:190px;
    padding:2px 0 4px 5px;
}

ul.dropdown ul a.open:hover {
    color:#fff;
}

ul.dropdown ul li:hover > span,
ul.dropdown ul li:hover > span a {
    color: #fff;
}

ul.dropdown *.open,
ul.dropdown li:hover > span,
ul.dropdown li:hover > span a {
    color: #fff;
}
ul.dropdown ul ul *.open,
ul.dropdown ul ul li:hover > span,
ul.dropdown ul ul li:hover > span a {
    color:#fff;
}


text:
require "integration/support/int_helper"
require "pakyow/support/silenceable"

RSpec.describe "connecting a websocket" do
  include Pakyow::Support::Silenceable

  before do
    start_server
  end

  let :client do
    silence_warnings do
      @client = WebSocketClient.create
      # wait for it to connect
      sleep 0.05
    end

    @client
  end

  context "and the connection is a websocket" do
    context "and the handshake is valid" do
      it "creates a connection" do
        expect(client).not_to be(nil)
      end

      it "registers the created connection" do
        expect(Pakyow::Realtime::Delegate.instance).to receive(:register).at_least(:once)
        client
      end

      context "when a `join` callback is defined" do
        before do
          joined = -> (context) { @context = context }
          Pakyow::Realtime::Connection.on :join do
            joined.call(self)
          end

          client
        end

        it "invokes the callback" do
          expect(@context).not_to be_nil
        end

        describe "the callback context" do
          it "is a `Pakyow::CallContext` instance" do
            expect(@context).to be_instance_of(Pakyow::CallContext)
          end
        end
      end
    end

    context "and the handshake is invalid" do
      it "responds as a bad request" do
        skip 'figure out how to create an invalid handshake'
      end
    end
  end
end


text:
            Sandra Bougaret, Co-fondatrice Dune-investissement

                    sandra.bougaret@neghome.com

                    www.dune-investissement.fr

                    @dune-investissement

                    Sur facebook

            Téléphone: 06-19-57-53-81


text:
<?php

/* @var $this yii\web\View */
/* @var $name string */
/** @var $error string */
/* @var $message string */
/* @var $exception Exception */

use yii\helpers\Html;
use yii\helpers\Url;

$this->title = $name;
?>

<?= Html::encode($this->title) ?>

<?= nl2br(Html::encode($error)) ?>

<?= nl2br(Html::encode($message)) ?>

            <?= Html::a('Regresar a la página principal', Url::to(['/site/index'])) ?>


text:
package org.apache.spark.sql.execution.joins

import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions._
import org.apache.spark.sql.catalyst.plans._
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.execution.metric.LongSQLMetric
import org.apache.spark.util.collection.CompactBuffer

trait HashOuterJoin {
  self: SparkPlan =>

  val leftKeys: Seq[Expression]
  val rightKeys: Seq[Expression]
  val joinType: JoinType
  val condition: Option[Expression]
  val left: SparkPlan
  val right: SparkPlan

  override def output: Seq[Attribute] = {
    joinType match {
      case LeftOuter =>
        left.output ++ right.output.map(_.withNullability(true))
      case RightOuter =>
        left.output.map(_.withNullability(true)) ++ right.output
      case FullOuter =>
        left.output.map(_.withNullability(true)) ++ right.output.map(_.withNullability(true))
      case x =>
        throw new IllegalArgumentException(s"HashOuterJoin should not take $x as the JoinType")
    }
  }

  protected[this] lazy val (buildPlan, streamedPlan) = joinType match {
    case RightOuter => (left, right)
    case LeftOuter => (right, left)
    case x =>
      throw new IllegalArgumentException(
        s"HashOuterJoin should not take $x as the JoinType")
  }

  protected[this] lazy val (buildKeys, streamedKeys) = joinType match {
    case RightOuter => (leftKeys, rightKeys)
    case LeftOuter => (rightKeys, leftKeys)
    case x =>
      throw new IllegalArgumentException(
        s"HashOuterJoin should not take $x as the JoinType")
  }

  override def outputsUnsafeRows: Boolean = true
  override def canProcessUnsafeRows: Boolean = true
  override def canProcessSafeRows: Boolean = false

  protected def buildKeyGenerator: Projection =
    UnsafeProjection.create(buildKeys, buildPlan.output)

  protected[this] def streamedKeyGenerator: Projection =
    UnsafeProjection.create(streamedKeys, streamedPlan.output)

  protected[this] def resultProjection: InternalRow => InternalRow =
    UnsafeProjection.create(self.schema)

  @transient private[this] lazy val DUMMY_LIST = CompactBuffer[InternalRow](null)
  @transient protected[this] lazy val EMPTY_LIST = CompactBuffer[InternalRow]()

  @transient private[this] lazy val leftNullRow = new GenericInternalRow(left.output.length)
  @transient private[this] lazy val rightNullRow = new GenericInternalRow(right.output.length)
  @transient private[this] lazy val boundCondition =
    newPredicate(condition.getOrElse(Literal(true)), left.output ++ right.output)

  // TODO we need to rewrite all of the iterators with our own implementation instead of the Scala
  // iterator for performance purpose.

  protected[this] def leftOuterIterator(
      key: InternalRow,
      joinedRow: JoinedRow,
      rightIter: Iterable[InternalRow],
      resultProjection: InternalRow => InternalRow,
      numOutputRows: LongSQLMetric): Iterator[InternalRow] = {
    val ret: Iterable[InternalRow] = {
      if (!key.anyNull) {
        val temp = if (rightIter != null) {
          rightIter.collect {
            case r if boundCondition(joinedRow.withRight(r)) => {
              numOutputRows += 1
              resultProjection(joinedRow).copy()
            }
          }
        } else {
          List.empty
        }
        if (temp.isEmpty) {
          numOutputRows += 1
          resultProjection(joinedRow.withRight(rightNullRow)) :: Nil
        } else {
          temp
        }
      } else {
        numOutputRows += 1
        resultProjection(joinedRow.withRight(rightNullRow)) :: Nil
      }
    }
    ret.iterator
  }

  protected[this] def rightOuterIterator(
      key: InternalRow,
      leftIter: Iterable[InternalRow],
      joinedRow: JoinedRow,
      resultProjection: InternalRow => InternalRow,
      numOutputRows: LongSQLMetric): Iterator[InternalRow] = {
    val ret: Iterable[InternalRow] = {
      if (!key.anyNull) {
        val temp = if (leftIter != null) {
          leftIter.collect {
            case l if boundCondition(joinedRow.withLeft(l)) => {
              numOutputRows += 1
              resultProjection(joinedRow).copy()
            }
          }
        } else {
          List.empty
        }
        if (temp.isEmpty) {
          numOutputRows += 1
          resultProjection(joinedRow.withLeft(leftNullRow)) :: Nil
        } else {
          temp
        }
      } else {
        numOutputRows += 1
        resultProjection(joinedRow.withLeft(leftNullRow)) :: Nil
      }
    }
    ret.iterator
  }

  protected[this] def fullOuterIterator(
      key: InternalRow,
      leftIter: Iterable[InternalRow],
      rightIter: Iterable[InternalRow],
      joinedRow: JoinedRow,
      resultProjection: InternalRow => InternalRow,
      numOutputRows: LongSQLMetric): Iterator[InternalRow] = {
    if (!key.anyNull) {
      // Store the positions of records in right, if one of its associated row satisfy
      // the join condition.
      val rightMatchedSet = scala.collection.mutable.Set[Int]()
      leftIter.iterator.flatMap[InternalRow] { l =>
        joinedRow.withLeft(l)
        var matched = false
        rightIter.zipWithIndex.collect {
          // 1. For those matched (satisfy the join condition) records with both sides filled,
          //    append them directly

          case (r, idx) if boundCondition(joinedRow.withRight(r)) =>
            numOutputRows += 1
            matched = true
            // if the row satisfy the join condition, add its index into the matched set
            rightMatchedSet.add(idx)
            resultProjection(joinedRow)

        } ++ DUMMY_LIST.filter(_ => !matched).map( _ => {
          // 2. For those unmatched records in left, append additional records with empty right.

          // DUMMY_LIST.filter(_ => !matched) is a tricky way to add additional row,
          // as we don't know whether we need to append it until finish iterating all
          // of the records in right side.
          // If we didn't get any proper row, then append a single row with empty right.
          numOutputRows += 1
          resultProjection(joinedRow.withRight(rightNullRow))
        })
      } ++ rightIter.zipWithIndex.collect {
        // 3. For those unmatched records in right, append additional records with empty left.

        // Re-visiting the records in right, and append additional row with empty left, if its not
        // in the matched set.
        case (r, idx) if !rightMatchedSet.contains(idx) =>
          numOutputRows += 1
          resultProjection(joinedRow(leftNullRow, r))
      }
    } else {
      leftIter.iterator.map[InternalRow] { l =>
        numOutputRows += 1
        resultProjection(joinedRow(l, rightNullRow))
      } ++ rightIter.iterator.map[InternalRow] { r =>
        numOutputRows += 1
        resultProjection(joinedRow(leftNullRow, r))
      }
    }
  }

  // This is only used by FullOuter
  protected[this] def buildHashTable(
      iter: Iterator[InternalRow],
      numIterRows: LongSQLMetric,
      keyGenerator: Projection): java.util.HashMap[InternalRow, CompactBuffer[InternalRow]] = {
    val hashTable = new java.util.HashMap[InternalRow, CompactBuffer[InternalRow]]()
    while (iter.hasNext) {
      val currentRow = iter.next()
      numIterRows += 1
      val rowKey = keyGenerator(currentRow)

      var existingMatchList = hashTable.get(rowKey)
      if (existingMatchList == null) {
        existingMatchList = new CompactBuffer[InternalRow]()
        hashTable.put(rowKey.copy(), existingMatchList)
      }

      existingMatchList += currentRow.copy()
    }

    hashTable
  }
}


text:
package exports.example

trait Decoder/*<-exports::example::Decoder#*/[+T/*<-exports::example::Decoder#[T]*/] {
  def decode/*<-exports::example::Decoder#decode().*/(a/*<-exports::example::Decoder#decode().(a)*/: Array/*->scala::Array#*/[Byte/*->scala::Byte#*/]): T/*->exports::example::Decoder#[T]*/
}

trait Encoder/*<-exports::example::Encoder#*/[-T/*<-exports::example::Encoder#[T]*/] {
  def encode/*<-exports::example::Encoder#encode().*/(t/*<-exports::example::Encoder#encode().(t)*/: T/*->exports::example::Encoder#[T]*/): Array/*->scala::Array#*/[Byte/*->scala::Byte#*/]
}

trait Codec/*<-exports::example::Codec#*/[T/*<-exports::example::Codec#[T]*/](decode/*<-exports::example::Codec#decode.*/: Decoder/*->exports::example::Decoder#*/[T/*->exports::example::Codec#[T]*/], encode/*<-exports::example::Codec#encode.*/: Encoder/*->exports::example::Encoder#*/[T/*->exports::example::Codec#[T]*/])
  extends Decoder/*->exports::example::Decoder#*/[T/*->exports::example::Codec#[T]*/] with Encoder/*->exports::example::Encoder#*/[T/*->exports::example::Codec#[T]*/] {
  export decode/*->exports::example::Codec#decode.*/._
  export encode/*->exports::example::Codec#encode.*/._
}


text:
import conf
from models import HTypegroup, HType
import operator

def get_typegroup(page, page_row=conf.ROWS, **kv):
    """
    获取字典分类
    :param page:
    :param page_row:
    :param kv:
    :return:
    """
    and_conditions = None
    where_params = []

    keyword = kv["keyword"]
    if keyword:
        where_params.append(HTypegroup.group_name.contains(keyword))
        where_params.append(HTypegroup.group_value.contains(keyword))

    if where_params:
        and_conditions = reduce(operator.or_, where_params)

    result = HTypegroup.select(HTypegroup.pid, HTypegroup.group_name, HTypegroup.group_value)
    if and_conditions:
        result = result.where(and_conditions)
    result = result.order_by(-HTypegroup.create_time)

    result_page = result.paginate(page, paginate_by=page_row)
    return [f for f in result_page.dicts()], result.count()

def get_type(group_id):
    """
    根据分类id查询数据
    :param group_id:
    :return:
    """
    sql = HType.select().where(HType.group == group_id)
    result = [r for r in sql.dicts()]
    return result


text:
if [ "$#" -ne 1 ]; then
    echo "Error: too few arguments!"
    echo "Usage: $0 FILE"
    exit 1
fi

set -ex

git ls-files tests \
    | awk '/\.(hs|lhs|c|sh|cabal|hsc|err|out|in|project)$|ghc/ { print } { next }' \
    | awk '/Check.hs$|UnitTests|PackageTester|autogen|register.sh|PackageTests.hs|IntegrationTests.hs|CreatePipe|^tests\/Test/ { next } { print }' \
    | LC_ALL=C sort \
    | sed -e 's/^/  /' \
    > source-file-list

lead='^  -- BEGIN gen-extra-source-files'
tail='^  -- END gen-extra-source-files'
# cribbed off of http://superuser.com/questions/440013/how-to-replace-part-of-a-text-file-between-markers-with-another-text-file
sed -i.bak -e "/$lead/,/$tail/{ /$lead/{p; r source-file-list
              }; /$tail/p; d }" $1


text:
<?php

namespace App\Http\Controllers;

use App\Transformers\Transformer;
use Illuminate\Contracts\Pagination\Paginator;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Response;

class PrepareResponse
{
	const CODE_WRONG_ARGS = 'GEN-FUBARGS';
    const CODE_NOT_FOUND = 'GEN-LIKETHEWIND';
    const CODE_INTERNAL_ERROR = 'GEN-AAAGGH';
    const CODE_UNAUTHORIZED = 'GEN-MAYBGTFO';
    const CODE_FORBIDDEN = 'GEN-GTFO';
    const CODE_INVALID_MIME_TYPE = 'GEN-IVMITYP';

	protected $statusCode = 200;

	/**
	 * @return int
	 */
	public function getStatusCode()
	{
		return $this->statusCode;
	}

	/**
	 * @param $statusCode
	 *
	 * @return $this
	 */
	public function setStatusCode($statusCode)
	{
		$this->statusCode = $statusCode;
		return $this;
	}

	/**
	 * @param Model $item
	 * @param Transformer $transformer
	 *
	 * @return array
	 */
	public function respondWithItem(Model $item, Transformer $transformer)
	{
		$resource = $transformer->item($item);
		return $this->respondWithArray(array('data' => $resource));
	}

	/**
	 * @param string $model_type
	 * @param string $message
	 *
	 * @return array
	 */
	public function respondWithoutItem($model_type = "", $message = "The element of this MODEL type was successfully deleted")
	{
		if ( $model_type !== "" ) {
			$message = str_replace("MODEL", $model_type, $message);
		}

		return $this->respondWithArray([
			'data' => [
				'http_code' => $this->statusCode,
				'message' => $message,
			]
		]);
	}

	/**
	 * @param Paginator $paginator
	 * @param Transformer $callback
	 *
	 * @return array
	 */
	public function respondWithCollection(Paginator $paginator, Transformer $callback)
	{
		$resource = $this->respondWithPagination(
			$paginator,
			['data' => $callback->collection($paginator)]
		);

		return $this->respondWithArray($resource);
	}

	/**
	 * @param Paginator $paginator
	 * @param $data
	 *
	 * @return array
	 */
	private function respondWithPagination(Paginator $paginator, $data)
	{
		return array_merge($data, [
			'pagination' => [
				'total_count' => $paginator->total(),
				'total_pages' => ceil($paginator->total() / $paginator->perPage()),
				'current_page' => $paginator->currentPage(),
				'limit' => (int) $paginator->perPage(),
				'previous_page' => $paginator->previousPageUrl() ? : (bool) $paginator->previousPageUrl(),
				'next_page' => $paginator->nextPageUrl() ? : (bool) $paginator->nextPageUrl(),
			]
		]);
	}

	/**
	 * @param array $array
	 *
	 * @return array
	 */
	protected function respondWithArray(array $array)
	{
		return [$array, $this->statusCode];
	}

	/** ---------ERROR SECTION--------- **/

	/**
	 *
	 * @param $message
	 * @param $errorCode
	 *
	 * @return array
	 */
	protected function respondWithError($message, $errorCode)
	{
		if ($this->statusCode === 200) {
			trigger_error(
				"You better have a really good reason for erroring on a 200...",
				E_USER_WARNING
			);
		}

		return $this->respondWithArray([
			'error' => [
				'code' => $errorCode,
				'http_code' => $this->statusCode,
				'message' => $message,
			]
		]);
	}

	/**
	 * Generates a Response with a 403 HTTP header and a given message.
	 *
	 * @param string $message
	 *
	 * @return array
	 */
	public function errorForbidden($message = 'Forbidden')
	{
	    return $this->setStatusCode(Response::HTTP_FORBIDDEN)
	                ->respondWithError($message, self::CODE_FORBIDDEN);
	}

	/**
	 * Generates a Response with a 500 HTTP header and a given message.
	 *
	 * @param string $message
	 *
	 * @return array
	 */
	public function errorInternalError($message = 'Internal Error')
	{
		return $this->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR)
		            ->respondWithError($message, self::CODE_INTERNAL_ERROR);
	}

	/**
	 * Generates a Response with a 404 HTTP header and a given message.
	 *
	 * @param string $message
	 *
	 * @return array
	 */
	public function errorNotFound($message = 'Resource Not Found')
	{
	    return $this->setStatusCode(Response::HTTP_NOT_FOUND)
	                ->respondWithError($message, self::CODE_NOT_FOUND);
	}

	/**
	 * Generates a Response with a 401 HTTP header and a given message.
	 *
	 * @param string $message
	 *
	 * @return array
	 */
	public function errorUnauthorized($message = 'Unauthorized')
	{
	    return $this->setStatusCode(Response::HTTP_UNAUTHORIZED)
	                ->respondWithError($message, self::CODE_UNAUTHORIZED);
	}

	/**
	 * Generates a Response with a 400 HTTP header and a given message.
	 *
	 * @param string $message
	 *
	 * @return array
	 */
	public function errorWrongArgs($message = 'Wrong Arguments')
	{
	    return $this->setStatusCode(Response::HTTP_UNPROCESSABLE_ENTITY)
	                ->respondWithError($message, self::CODE_WRONG_ARGS);
	}

	/**
	 * @param Model $item
	 * @param Transformer $transformer
	 *
	 * @return array
	 */
	public function responseCreated(Model $item, Transformer $transformer)
	{
		return $this->setStatusCode(Response::HTTP_CREATED)
		            ->respondWithItem($item, $transformer);
	}
}


text:
@interface R2RWalkDriveHopCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UILabel *hopLabel;
@property (weak, nonatomic) IBOutlet UILabel *hopPrice;
@property (weak, nonatomic) IBOutlet UILabel *hopDistance;
@property (strong, nonatomic) UIImageView *icon;
@property (strong, nonatomic) UIImageView *connectTop;
@property (strong, nonatomic) UIImageView *connectBottom;

@end


text:
dtkMeshPartitionMap::~dtkMeshPartitionMap(void)
{
    m_partition_count = 0;
}

bool dtkMeshPartitionMap::read(const QString& filename)
{
    QFile file(filename);

    if (filename.isEmpty() || (!file.exists())) {
        dtkError() << "dtkMeshPartitionMap::read() : input file is empty/does not exist" << filename << "Current dir is" << QDir::currentPath();
        return false;
    }

    QIODevice::OpenMode mode = QIODevice::ReadOnly | QIODevice::Text;

    if (!file.open(mode)) {
        dtkError() << "dtkMeshPartitionMap::read() : input file" << filename << "cannot be opened.";
        return false;
    }

    QRegExp re = QRegExp("\\s+");
    QString line;

    // Skip comments
    do {
        line = file.readLine();
    } while (line.isEmpty() || line.startsWith("%") || line.startsWith("#"));

    // Reads header
    QStringList header = line.split(re);

    m_partition_count         = header[0].toULong();
    std::size_t element_count = header[1].toULong();
    std::size_t vertex_count  = header[2].toULong();

    m_elmt_parts.reserve(element_count);
    m_vert_parts.reserve(vertex_count);

    // Reads partition owner for each element
    for (std::size_t i = 0; i < element_count; ++i) {
        do {
            line = file.readLine().trimmed();
        } while (line.isEmpty() || line.startsWith("%") || line.startsWith("#"));

        m_elmt_parts.push_back(line.toLong());
    }

    // Reads partition owner for each vertex
    for (std::size_t i = 0; i < vertex_count; ++i) {
        do {
            line = file.readLine().trimmed();
        } while (line.isEmpty() || line.startsWith("%") || line.startsWith("#"));

        m_vert_parts.push_back(line.toLong());
    }

    file.close();

    return true;
}

bool dtkMeshPartitionMap::write(const QString& filename) const
{
    if (filename.isEmpty()) {
        dtkError() << "dtkMeshPartitionMap::write() : output filename is empty. Nothing is done.";
        return false;
    }

    QFile file(filename);

    QIODevice::OpenMode mode = QIODevice::WriteOnly | QIODevice::Text;

    if (!file.open(mode)) {
        dtkError() << "dtkMeshPartitionMap::write() : output file" << filename << "cannot be opened.";
        return false;
    }

    QString header = QString("%1 %2 %3\n\n")
        .arg(QString::number(m_partition_count))
        .arg(QString::number(m_elmt_parts.size()))
        .arg(QString::number(m_vert_parts.size()));

    file.write(qPrintable(header), header.size());

    QString line;

    for (long int id : m_elmt_parts) {
        line = QString::number(id) + "\n";
        file.write(qPrintable(line), line.size());
    }
    file.write("\n", 1);

    for (long int id : m_vert_parts) {
        line = QString::number(id) + "\n";
        file.write(qPrintable(line), line.size());
    }

    file.close();

    return true;
}

//
// dtkMeshPartitionMap.cpp ends here


text:
using System;
using System.Threading.Tasks;
using Csla.Configuration;
using ProjectTracker.Library;
using Xamarin.Forms;

namespace ProjectTracker.Ui.Xamarin
{
  public partial class App : Application
  {
    public static Page RootPage { get; private set; }

    public App()
    {
      InitializeComponent();
      Csla.DataPortalClient.HttpProxy.UseTextSerialization = true;
      CslaConfiguration.Configure()
        .DataPortal()
          .DefaultProxy(typeof(Csla.DataPortalClient.HttpProxy),
                        "https://ptrackerserver.azurewebsites.net/api/dataportaltext");

      Library.Security.PTPrincipal.Logout();

      MainPage = new NavigationPage(new XamarinFormsUi.Views.Dashboard());
      RootPage = MainPage;
    }

    protected override async void OnStart()
    {
      await Library.Security.PTPrincipal.LoginAsync("manager", "manager");

      await RoleList.CacheListAsync();
    }

    protected override void OnSleep()
    {
      // Handle when your app sleeps
    }

    protected override void OnResume()
    {
      // Handle when your app resumes
    }

    public static async Task NavigateTo(Type page)
    {
      var target = (Page)Activator.CreateInstance(page);
      await NavigateTo(target);
    }

    public static async Task NavigateTo(Type page, object parameter)
    {
      var target = (Page)Activator.CreateInstance(page, parameter);
      await NavigateTo(target);
    }

    private static async Task NavigateTo(Page page)
    {
      await RootPage.Navigation.PushAsync(page);
    }
  }
}


text:
@interface PodsDummy_Pods_PKHUD : NSObject
@end
@implementation PodsDummy_Pods_PKHUD
@end


text:
import {PropertyBinder} from './PropertyBinder';
import {ExpressionsHelper} from '../ExpressionsHelper';
import {ObserverEngine} from '../../Observer/Observer';

export class VisibleBinder extends PropertyBinder {

    protected BINDING_ATTRIBUTE = "visible.bind";

    elementBind(element: HTMLElement, viewModel: any, expression: string): void {

        ObserverEngine.observeExpression(expression, viewModel, (value: any, oldValue: any) => {

          (<HTMLInputElement>element).hidden  = !value;

        });

    }

}