text:
/// <reference path="API.ts" />

namespace bws.packer
{
	/**
	 * @brief Packer, a solver of 3d bin packing with multiple wrappers.
	 *
	 * @details
	 *
 Packer is a facade class supporting packing operations in user side. You can solve a packing problem
	 * by constructing Packer class with {@link WrapperArray wrappers} and {@link InstanceArray instances} to
	 * pack and executing {@link optimize Packer.optimize()} method.

	 *
	 *
 In background side, deducting packing solution, those algorithms are used.

	 *

	 *

	 *		Airforce Bin Packing; 3D pallet packing problem: A human intelligence-based heuristic approach
	 *

	 *
 Genetic Algorithm

	 *
 Greedy and Back-tracking algorithm

	 *

	 *
	 * @author Jeongho Nam <http://samchon.org>
	 */
	export class Packer
		extends protocol.Entity
	{
		/**
		 * Candidate wrappers who can contain instances.
		 */
		protected wrapperArray: WrapperArray;

		/**
		 * Instances trying to pack into the wrapper.
		 */
		protected instanceArray: InstanceArray;

		/* -----------------------------------------------------------
			CONSTRUCTORS
		----------------------------------------------------------- */
		/**
		 * Default Constructor.
		 */
		public constructor();

		/**
		 * Construct from members.
		 *
		 * @param wrapperArray Candidate wrappers who can contain instances.
		 * @param instanceArray Instances to be packed into some wrappers.
		 */
		public constructor(wrapperArray: WrapperArray, instanceArray: InstanceArray);

		public constructor(wrapperArray: WrapperArray = null, instanceArray: InstanceArray = null)
		{
			super();

			if (wrapperArray == null && instanceArray == null)
			{
				this.wrapperArray = new WrapperArray();
				this.instanceArray = new InstanceArray();
			}
			else
			{
				this.wrapperArray = wrapperArray;
				this.instanceArray = instanceArray;
			}
		}

		/**
		 * @inheritdoc
		 */
		public construct(xml: library.XML): void
		{
			this.wrapperArray.construct(xml.get(this.wrapperArray.TAG()).at(0));
			this.instanceArray.construct(xml.get(this.instanceArray.TAG()).at(0));
		}

		/* -----------------------------------------------------------
			GETTERS
		----------------------------------------------------------- */
		/**
		 * Get wrapperArray.
		 */
		public getWrapperArray(): WrapperArray
		{
			return this.wrapperArray;
		}

		/**
		 * Get instanceArray.
		 */
		public getInstanceArray(): InstanceArray
		{
			return this.instanceArray;
		}

		/* -----------------------------------------------------------
			OPTIMIZERS
		----------------------------------------------------------- */
		/**
		 *
 Deduct
		 *
		 */
		public optimize(): WrapperArray
		{
			if (this.instanceArray.empty() || this.wrapperArray.empty())
				throw new std.InvalidArgument("Any instance or wrapper is not constructed.");

			let wrappers: WrapperArray = new WrapperArray(); // TO BE RETURNED

			if (this.wrapperArray.size() == 1)
			{
				// ONLY A TYPE OF WRAPPER EXISTS,
				// OPTMIZE IN LEVEL OF WRAPPER_GROUP AND TERMINATE THE OPTIMIZATION
				let wrapperGroup: WrapperGroup = new WrapperGroup(this.wrapperArray.front());

				for (let i: number = 0; i < this.instanceArray.size(); i++)
					if (wrapperGroup.allocate(this.instanceArray.at(i)) == false)
						throw new std.LogicError("All instances are greater than the wrapper.");

				// OPTIMIZE
				wrapperGroup.optimize();

				// ASSIGN WRAPPERS
				wrappers.assign(wrapperGroup.begin(), wrapperGroup.end());
			}
			else
			{
				////////////////////////////////////////
				// WITH GENETIC_ALGORITHM
				////////////////////////////////////////
				// CONSTRUCT INITIAL SET
				let geneArray: GAWrapperArray = this.initGenes();

				// EVOLVE
				// IN JAVA_SCRIPT VERSION, GENETIC_ALGORITHM IS NOT IMPLEMENTED YET.
				// HOWEVER, IN C++ VERSION, IT IS FULLY SUPPORTED
				//	http://samchon.github.io/framework/api/cpp/d5/d28/classsamchon_1_1library_1_1GeneticAlgorithm.html
				// IT WILL BE SUPPORTED SOON

				// FETCH RESULT
				let result: std.HashMap<string, WrapperGroup> = geneArray.getResult();
				for (let it = result.begin(); !it.equals(result.end()); it = it.next())
					wrappers.insert(wrappers.end(), it.second.begin(), it.second.end());

				// TRY TO REPACK
				wrappers = this.repack(wrappers);
			}

			// SORT THE WRAPPERS BY ITEMS' POSITION
			for (let i: number = 0; i < wrappers.size(); i++)
			{
				let wrapper: Wrapper = wrappers.at(i);

				std.sort(wrapper.begin(), wrapper.end(),
					function (left: Wrap, right: Wrap): boolean
					{
						if (left.getZ() != right.getZ())
							return left.getZ() < right.getZ();
						else if (left.getY() != right.getY())
							return left.getY() < right.getY();
						else
							return left.getX() < right.getX();
					}
				);
			}

			if (wrappers.empty() == true)
				throw new std.LogicError("All instances are greater than the wrapper.");

			return wrappers;
		}

		/**
		 * @brief Initialize sequence list (gene_array).
		 *
		 * @details
		 *
 Deducts initial sequence list by such assumption:

		 *
		 *

		 *
 Cost of larger wrapper is less than smaller one, within framework of price per volume unit.

		 *

		 *
 Wrapper Larger: (price: $1,000, volume: 100cm^3 -> price per volume unit: $10 / cm^3)

		 *
 Wrapper Smaller: (price: $700, volume: 50cm^3 -> price per volume unit: $14 / cm^3)

		 *
 Larger's cost is less than Smaller, within framework of price per volume unit

		 *

		 *

		 *
		 *
 Method {@link initGenes initGenes()} constructs {@link WrapperGroup WrapperGroups} corresponding
		 * with the {@link wrapperArray} and allocates {@link instanceArray instances} to a {@link WrapperGroup},
		 * has the smallest cost between containbles.

		 *
		 *
 After executing packing solution by {@link WrapperGroup.optimize WrapperGroup.optimize()}, trying to
		 * {@link repack re-pack} each {@link WrapperGroup} to another type of {@link Wrapper}, deducts the best
		 * solution between them. It's the initial sequence list of genetic algorithm.

		 *
		 * @return Initial sequence list.
		 */
		protected initGenes(): GAWrapperArray
		{
			////////////////////////////////////////////////////
			// LINEAR OPTIMIZATION
			////////////////////////////////////////////////////
			// CONSTRUCT WRAPPER_GROUPS
			let wrapperGroups: std.Vector<WrapperGroup> = new std.Vector<WrapperGroup>();

			for (let i: number = 0; i < this.wrapperArray.size(); i++)
			{
				let wrapper: Wrapper = this.wrapperArray.at(i);

				wrapperGroups.push_back(new WrapperGroup(wrapper));
			}

			// ALLOCATE INSTNACES BY AUTHORITY
			for (let i: number = 0; i < this.instanceArray.size(); i++)
			{
				let instance: Instance = this.instanceArray.at(i);
				let minCost: number = Number.MAX_VALUE;
				let minIndex: number = 0;

				for (let j: number = 0; j < this.wrapperArray.size(); j++)
				{
					let wrapper: Wrapper = this.wrapperArray.at(j);
					if (wrapper.containable(instance) == false)
						continue; // CANNOT CONTAIN BY ITS GREATER SIZE

					let cost = wrapper.getPrice() / wrapper.getContainableVolume();
					if (cost < minCost)
					{
						// CURRENT WRAPPER'S PRICE PER UNIT VOLUME IS CHEAPER
						minCost = cost;
						minIndex = j;
					}
				}

				// ALLOCATE TO A GROUP WHICH HAS THE MOST CHEAPER PRICE PER UNIT VOLUME
				let wrapperGroup: WrapperGroup = wrapperGroups.at(minIndex);
				wrapperGroup.allocate(instance);
			}

			////////////////////////////////////////////////////
			// ADDICTIONAL OPTIMIZATION BY POST-PROCESS
			////////////////////////////////////////////////////0
			// OPTIMIZE WRAPPER_GROUP
			let wrappers: WrapperArray = new WrapperArray();

			for (let i: number = 0; i < wrapperGroups.size(); i++)
			{
				let wrapperGroup: WrapperGroup = wrapperGroups.at(i);

				wrapperGroup.optimize();
				wrappers.insert(wrappers.end(), wrapperGroup.begin(), wrapperGroup.end());
			}

			// DO EARLY POST-PROCESS
			wrappers = this.repack(wrappers);

			////////////////////////////////////////////////////
			// CONSTRUCT GENE_ARRAY
			////////////////////////////////////////////////////
			// INSTANCES AND GENES
			let ga_instances: InstanceArray = new InstanceArray();
			let genes: WrapperArray = new WrapperArray();

			for (let i: number = 0; i < wrappers.size(); i++)
			{
				let wrapper: Wrapper = wrappers.at(i);

				for (let j: number = 0; j < wrapper.size(); j++)
				{
					ga_instances.push_back(wrapper.at(j).getInstance());
					genes.push_back(wrapper);
				}
			}

			// GENE_ARRAY
			let geneArray: GAWrapperArray = new GAWrapperArray(ga_instances);
			geneArray.assign(genes.begin(), genes.end());

			return geneArray;
		}

		/**
		 * Try to repack each wrappers to another type.
		 *
		 * @param $wrappers Wrappers to repack.
		 * @return Re-packed wrappers.
		 */
		protected repack($wrappers: WrapperArray): WrapperArray
		{
			let result: WrapperArray = new WrapperArray();

			for (let i: number = 0; i < $wrappers.size(); i++)
			{
				let wrapper: Wrapper = $wrappers.at(i);
				let minGroup: WrapperGroup = new WrapperGroup(wrapper);

				minGroup.push_back(wrapper);

				for (let j: number = 0; j < this.wrapperArray.size(); j++)
				{
					let myWrapper: Wrapper = this.wrapperArray.at(j);
					if (wrapper.equals(myWrapper))
						continue;

					let valid: boolean = true;

					// CONSTRUCT GROUP OF TARGET
					let myGroup: WrapperGroup = new WrapperGroup(myWrapper);

					for (let k: number = 0; k < wrapper.size(); k++)
						if (myGroup.allocate(wrapper.at(k).getInstance()) == false)
						{
							// IF THERE'S AN INSTANCE CANNOT CONTAIN BY ITS GREATER SIZE
							valid = false;
							break;
						}

					// SKIP
					if (valid == false)
						continue;

					// OPTIMIZATION IN LEVEL OF GROUP
					myGroup.optimize();

					// CURRENT GROUP IS CHEAPER, THEN REPLACE
					if (myGroup.getPrice() < minGroup.getPrice())
						minGroup = myGroup;
				}

				result.insert(result.end(), minGroup.begin(), minGroup.end());
			}
			return result;
		}

		/* -----------------------------------------------------------
			EXPORTERS
		----------------------------------------------------------- */
		/**
		 * @inheritdoc
		 */
		public TAG(): string
		{
			return "packer";
		}

		/**
		 * @inheritdoc
		 */
		public toXML(): library.XML
		{
			let xml: library.XML = super.toXML();
			xml.push(this.wrapperArray.toXML());
			xml.push(this.instanceArray.toXML());

			return xml;
		}
	}
}


text:
<?php

$id = $id_element_definition;

?>

<li class="sortme nohover element_definition" id="element_definition_<?php echo $id ;?>" rel="<?php echo $id ;?>">

        <a class="icon delete right" rel="<?php echo $id ;?>">

        <?php if ($name == '') :?>

			<input id="elementName<?php echo $id ;?>" type="text" class="inputtext w120 left" />

			<button id="elementDefinitionSave<?php echo $id ;?>" type="button" class="light-button left ml10" value="Save"><?php echo lang('ionize_label_element_set_name') ;?></button>

        <?php else :?>

        	<a class="edit name left" rel="<?php echo $id ;?>"><?php echo $name ;?>

		<?php endif ;?>

    <?php if ($name != '') :?>

			<div id="elementDefinitonTab<?php echo $id ;?>" class="mainTabs transparent">

					<?php foreach(Settings::get_languages() as $language) :?>
						<li <?php if($language['def'] == '1') :?> class="dl"<?php endif ;?>><?php echo ucfirst($language['name']) ;?>

					<?php endforeach ;?>

			<div id="elementDefinitionTabContent<?php echo $id ;?>" class="ml20 mr20 mb10">

				<?php foreach(Settings::get_languages() as $language) :?>

					<?php

					$lang = $language['lang'];
					$aTitle = lang('ionize_label_change').' '.lang('ionize_label_title');

					?>

						<a class="edit title left" rel="<?php echo $id ;?>.<?php echo $lang ;?>" title="<?php echo $aTitle ;?>"><?php echo ${$lang}['title'] ;?>

				<?php endforeach ;?>

				<div class="pt5" id="def_<?php echo $id ;?>">

					<?php if ($id != 0) :?>
						<input type="button" class="light-button plus mb5 ml5 add_field" value="Add field" rel="<?php echo $id ;?>" />
					<?php endif ;?>

					<ul class="fields" id="fields<?php echo $id ;?>" rel="<?php echo $id ;?>">

						<?php foreach($fields as $field) :?>
							<li class="sortme element_field" rel="<?php echo $field['id_extend_field'] ;?>" id="element_field<?php echo $field['id_extend_field'] ;?>">

								<a class="icon delete right" rel="<?php echo $field['id_extend_field'] ;?>">

								<span class="lite right mr10" rel="<?php echo $field['id_extend_field'] ;?>">
									<?php echo $field['type_name'] ;?>
									<?php if($field['translated'] == '1') :?>
									/ <?php echo lang('ionize_label_multilingual') ;?>
									<?php endif ;?>

								<a class="left ml10 edit_field" rel="<?php echo $field['id_extend_field'] ;?>"><?php echo $field['name'] ;?>

						<?php endforeach ;;?>

			<?php

			/*
			 * @TODO : 	Define the ordering when adding one element
			 * 			Planned for 1.0
			 *

			<? echo lang('ionize_next_element_will_be') ?>
			<select class="inputtext" name="order_by">
				<option value="-1" label="Descroissant"><?php echo lang('ionize_label_first') ;?></option>
				<option value="1" label="Croissant"><?php echo lang('ionize_label_last') ;?></option>
			</select>
			*/
			?>

    <?php endif ;?>

redpajama_set_name: RedPajamaGithub


text:
/*global angular*/
angular.module('app', ['ng', 'ngComputed'])
    .config(function($computedProvider) {
        $computedProvider.useDebug(true);
    })
    .run(['$rootScope', '$trackedEval', '$computed', '$batchedWatch', function($rootScope, $trackedEval, $computed, $batchedWatch) {
        angular.extend($rootScope.constructor.prototype, {
            $eval: $trackedEval,
            $computed: $computed,
            $watch: $batchedWatch
        });
    }])
    .directive('computingDirective', function() {
        return {
            restrict: "E",
            scope: {
                value: "="
            },
            template: "|| value: {{ computedValue }} ||",
            controller: ['$scope', function($scope) {
                $scope.$computed('computedValue', function() {
                    return 10
                        + $scope.$eval('value')
                        + $scope.$parent.$eval('readByDirective');
                    // using $scope.$parent is bad form, but will still work
                    // the watch will be registered on the $parent scope,
                    // but will trigger an update of this computed value
                });
            }]
        };
    })
    .controller('ExampleCtrl', ['$scope', function($scope) {
        $scope.inputValue = 10;
        $scope.readByDirective = 100;
    }]);


text:
package org.shaolin.bmdp.runtime.cache;

public class UnlimitedCache<K, V> extends AbstractCache<K, V> {

	private static final long serialVersionUID = -8456115678990044172L;

	public UnlimitedCache(String name, boolean needSynchronize) {
		super(name, needSynchronize);
	}

	public int getMaxSize() {
		return -1;
	}

	public void setMaxSize(int maxSize) {
	}

	protected V getValue(V value) {
		return value;
	}

}


text:
Update Job <?php echo $model->NAME; ?>

<?php echo $this->renderPartial('_form', array(
	'id'=>'job-form-update',
	'model'=>$model,
	'customerList'=>$customerList,
	'newCustomer'=>$newCustomer,
	'leaders'=>$leaders,
	'printers'=>$printers,
	'colors'=>$colors,
	'sizes'=>$sizes,
	'print'=>$print,
	'passes'=>$passes,
	'lineData'=>$lineData,
	'fileTypes'=>$fileTypes,
	'formatter'=>new Formatter
)); ?>


text:
package com.follew.config;

import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by liangbicong
 * Created Date 20/01/2016
 * Created Time 14:07
 * Created Version 1.1
 * 功能描述:druid 监控
 */
@Configuration
public class DruidConfiguration {
    @Bean
    public ServletRegistrationBean druidServlet() {
        return new ServletRegistrationBean(new StatViewServlet(), "/druid/*");
    }
    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
        filterRegistrationBean.setFilter(new WebStatFilter());
        filterRegistrationBean.addUrlPatterns("/*");
        filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
        return filterRegistrationBean;
    }

}


text:
Contributing Code to `express-yui`
----------------------------------

This components follows the same contribution model used by [Mojito][], you can
review the [Contributing-Code-to-Mojito file][] for more details.

Please be sure to sign our [CLA][] before you submit pull requests or otherwise contribute to `express-yui`. This protects `express-yui` developers, who rely on [express-yui's BSD license][].

[express-yui's BSD license]: https://github.com/yahoo/express-yui/blob/master/LICENSE.md
[CLA]: http://developer.yahoo.com/cocktails/mojito/cla/
[Mojito]: https://github.com/yahoo/mojito
[Contributing-Code-to-Mojito file]: https://github.com/yahoo/mojito/wiki/Contributing-Code-to-Mojito

Dev mode installation
---------------------

- The main source files are located under `lib/`.
- Unit tests are located under `tests/units/*`.
- Examples are located under `examples/`.

To install the dependencies:

    npm install

To run the unit tests (with coverage by default):

    npm test

To generate the API docs under `apidocs/index.html`:

    npm run docs

To lint the app lib folder:

    npm run lint

Release checklist
-----------------

* verify that [HISTORY.md] is updated
* verify that [README.md] is updated
* bump the version in [package.json]
* commit to master
* push to npm using `npm publish`
* create a [new release] entry including the tag for the new version, being sure to document any deprecations

If is also important to verify that whatever we pushed to npm is working as expected, to do that, do this:

```
cd examples/locator-express
rm -rf build node_modules
npm install
node app.js
```

then navigate to [http://localhost:3000/foo](http://localhost:3000/foo) to do some sanity checks on the release.

[HISTORY.md]: https://github.com/yahoo/express-yui/blob/master/HISTORY.md
[README.md]: https://github.com/yahoo/express-yui/blob/master/README.md
[package.json]: https://github.com/yahoo/express-yui/blob/master/package.json
[new release]: https://github.com/yahoo/express-yui/releases/new


text:
require 'log_monitor'

class LogMonitorRunner
  def self.execute
    Thread.new do
      config = YAML.load_file('config/log-monitor.yml')['development']
      alerter = LogMonitor::Factory.get(config)
      alerter.monitor
    end
    sleep
  end
end


text:
package org.cugos.wkg;

import org.junit.jupiter.api.Test;
import java.util.Arrays;
import static org.junit.jupiter.api.Assertions.*;

public class LinearRingTest {

    @Test
    public void create() {
        LinearRing ring = new LinearRing(
            Arrays.asList(
                Coordinate.create2D(1,1),
                Coordinate.create2D(10,1),
                Coordinate.create2D(10,10),
                Coordinate.create2D(1,1)
            ),
            Dimension.Two
        );
        assertFalse(ring.isEmpty());
        assertEquals(4, ring.getNumberOfCoordinates());
        assertEquals("LINESTRING (1.0 1.0, 10.0 1.0, 10.0 10.0, 1.0 1.0)", ring.toString());
    }

    @Test
    public void createEmpty() {
        LinearRing ring = LinearRing.createEmpty();
        assertTrue(ring.isEmpty());
        assertEquals("LINESTRING EMPTY", ring.toString());
    }

}


text:
Geocode your entity data.

## Adding the behavior

For a quick start see [this](https://github.com/dereuromark/cakephp-geo/blob/master/docs/Install.md#optional-packages) composer install tip.

Either in your Table class or at runtime:
```php
$this->addBehavior('Geo.Geocoder', $config);
```

Possible config options are:
- apiKey (mandatory for some providers)
- locale (for example DE)
- region (for some providers
- ssl (for some providers)
- address: (array|string, optional) set to the field name that contains the string from where to generate the slug, or a set of field names to concatenate for generating the slug.
- overwrite: lat/lng overwrite existing coordinates, defaults to true
- update: what fields to update (key=>value array pairs)
- on: beforeMarshal/afterMarshal/beforeSave (defaults to beforeSave) - Set to false if you only want to use the validation rules etc
- unit: defaults to km
- allowInconclusive: False to throw exception
- minAccuracy: `Geocoder::TYPE_*` constants
- expect: (array)postal_code, locality, sublocality, ...
- addressFormat: Defaults to `'%S %n, %z %L'`
- lat/lng: to customize these field names

Note that it is usually better to set global configs in your `app.php` using the `Geocoder` key.

## Configure your own Geocoder
By default it will use the GoogleMaps provider.

Please see [geocoder-php/Geocoder](https://github.com/geocoder-php/Geocoder) library on what other providers you can use out of the box.
You can chose from
- 12+ address-based Geocoder providers
- 10+ IP-based Geocoder providers

You could easily switch to an IP based provider like this:
```php
// in your app.php config
'Geocoder' => [
    'provider' => '\Geocoder\Provider\FreeGeoIp',
],
```

Let's say you want to switch to OpenStreetMap and also use a different HTTP adapter:
```php
// in your app.php config
'Geocoder' => [
    'provider' => function () {
        return \Geocoder\Provider\Nominatim\Nominatim::withOpenStreetMapServer(
            new \Http\Adapter\Cake\Client(), 'User-Agent'
        );
    }
],
```

Note: Don't forget that most providers need an apiKey to work.

## Saving geocodable data

Storing lat/lng on save() is automatically done when the `address` field is defined and found when saving.
```php
// $address contains address with value `Berlin`
$this->Addresses->save($address);

// These should be both set now
$lat = $address->lat;
$lng = $address->lng;
```

You can always manually call `geocode()` as well, of course:
```php
$address = $this->Addresses->get($id);
// $address contains address with value `Berlin`
$this->Addresses->geocode($address);

// These should be both set now
$lat = $address->lat;
$lng = $address->lng;
```

## Pagination and distance

We want to find all addresses within a distance of 200 km of the given lat/lng:
```php
// In a controller action
$options = ['lat' => 13.3, 'lng' => 19.2, 'distance' => 200];

$query = $this->Addresses->find('distance', $options);
$query->orderAsc('distance');

$addresses = $this->paginate($query);
```
They will be ordered by `['distance' => 'ASC']`, so all records with the smallest distances first.

Note that you need to first geocode all your data. On the fly geocoding is not an option for pagination and larger data-sets.

### Using coordinates value object
You can also use `coordinates` as `Geocoder\Model\Coordinates` instead.
```php
$coordinates = new Coordinates(13.3, 19.2);
$options = ['coordinates' => $coordinates, 'distance' => 200];

$query = $this->Addresses->find('distance', $options);
```

## Batch geocoding

You can look into the [Tools.Reset behavior](https://github.com/dereuromark/cakephp-tools/blob/master/src/Model/Behavior/ResetBehavior.php) and wrap the following in a CakePHP Shell command:
```php
// Geocoder behavior must already be added to the Table class object
$addressTable->addBehavior('Tools.Reset', $config);
$addressTable->resetRecords();
```
This will loop over all records as a batch script and update all lat/lng values.
You should set a scope for performance reasons. Maybe update only every record older than x months, or those that have lat/lng values of `null` to avoid
re-geocoding. And of course you should timeout your batch runs, most providers only allow y requests per minute. Better don't over-request to avoid penalties.

## Validate lat/lng

The methods `validateLatitude()` and `validateLongitude()` can be used to validate the range of those input values in your validation rules.
Don't forget to set `'provider' => 'table'` in this case.

## Backend
If you include the routes, you have an admin backend for the geocoding as well as the stored geocoded addresses (cache):

    /admin/geo

You can test the geocoding and also remove cache data where needed.

## Providers
Full list of existing providers [here](https://github.com/geocoder-php/Geocoder#providers).


text:
'''
MongoSession 0.1
Copyright (c) 2015, Jason Steve Nguyen (conghauit@outlook.com)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

'''

import hashlib
from uuid import uuid4
from datetime import datetime, timedelta

from flask.sessions import SessionInterface, SessionMixin
from flask import request
from werkzeug.datastructures import CallbackDict

__is_openShift = False
def getRemoteIP():
    if __is_openShift == False :
        return request.remote_addr
    return request.headers['x-forwarded-for']

class MongoSession(CallbackDict, SessionMixin):
    def __init__(self, initial = None, on_update = None, sid=None):
        super().__init__(initial, on_update)
        self.sid = sid
        self.modified = False

class MongoSessionInterface(SessionInterface):
    def __init__(self, DBClient, timeout=1):
        client  = DBClient
        self.store = client.db.Sess
        self.timeout = timeout

    def __checkSessIDValid(self, stored_session, remoteIP, remoteAgent):
        sessObj = MongoSession(initial=stored_session['data'],
                                sid=stored_session['_id'])
        if remoteIP!=sessObj.get('ip'):
            return None

        if remoteAgent!=sessObj.get('agent'):
            return None

        if stored_session.get('expiration') \
                <= datetime.utcnow():
            return None

        return sessObj

    def open_session(self, app, request):
        remoteIP =  getRemoteIP()
        remoteAgent = request.headers['User-Agent']
        sid = request.cookies.get(app.session_cookie_name)
        sessObj = None

        if sid :
            stored_session = self.store.find_one({'_id': sid})
            if stored_session != None:
                sessObj = self.__checkSessIDValid(stored_session, remoteIP, remoteAgent)

        if sessObj != None:
            return sessObj

        preID = str( datetime.timestamp(datetime.now()) ) + ";" \
                + getRemoteIP() + ";" + request.headers['User-Agent']\
                + str(uuid4())
        hash = hashlib.md5(preID.encode())
        sid = hash.hexdigest()
        sessObj = MongoSession(sid=sid)
        sessObj['start'] = "ok"
        sessObj['ip'] = remoteIP
        sessObj['agent'] = remoteAgent
        return sessObj

    def save_session(self, app, session, response):
        domain = self.get_cookie_domain(app)
        if not session:
            response.delete_cookie(app.session_cookie_name, domain=domain)
            return
        if self.get_expiration_time(app, session):
            expiration = self.get_expiration_time(app, session)
        else:
            expiration = datetime.utcnow() + timedelta(hours=self.timeout)
        sess = self.store.find_one({'_id': session.sid})
        if sess==None :
            response.delete_cookie(app.session_cookie_name, domain=domain)
            self.store.insert(
                              {'_id': session.sid,
                               'data': session,
                               'expiration': expiration})
        else :
            self.store.update({'_id': session.sid},
                                { "$set": {
                               'data': session,
                               'expiration': expiration} })

        response.set_cookie(app.session_cookie_name, session.sid,
                            expires=self.get_expiration_time(app, session),
                            httponly=True, domain=domain)


text:
<!doctype html>

        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

        <meta name="keywords" content="DinnerPlanner, Kristiansand, maps, stores, tourism, tourists"></meta>
        <meta name="description" content="DinnerPlanner - Easily plan the dinners of the week"></meta>
        <meta name="author" content="Group7"></meta>

        <title>DinnerPlanner</title>
        <link rel="stylesheet" href="css/normalize.css" />
        <link rel="stylesheet" href="css/foundation.css" />
        <link ref="stylesheet" href="css/main.css" />

DinnerPlanner

Menu

Right Sidebar


text:
module.exports = {
  VERSION:          '1.2.4',

  BAYEUX_VERSION:   '1.0',
  ID_LENGTH:        160,
  JSONP_CALLBACK:   'jsonpcallback',
  CONNECTION_TYPES: ['long-polling', 'cross-origin-long-polling', 'callback-polling', 'websocket', 'eventsource', 'in-process'],

  MANDATORY_CONNECTION_TYPES: ['long-polling', 'callback-polling', 'in-process']
};


text:
package org.jclouds.azureblob.predicates.validators;

import javax.inject.Inject;

import org.jclouds.predicates.validators.DnsNameValidator;

import com.google.inject.Singleton;

/**
 * Validates name for Azure container. The complete requirements are listed at:
 * http://weblogs.asp.net
 * /vblasberg/archive/2009/02/17/azure-details-and-limitations-blobs-tables-and-queues.aspx
 *
 * @see org.jclouds.rest.InputParamValidator
 * @see org.jclouds.predicates.Validator
 */
@Singleton
public class ContainerNameValidator extends DnsNameValidator {

   @Inject
   ContainerNameValidator() {
      super(3, 63);
   }

   public void validate(String containerName) {
      super.validate(containerName);
      if (containerName.contains("--"))
         throw exception(containerName, "Every dash must be followed by letter or number");
      if (containerName.endsWith("-"))
         throw exception(containerName, "Shouldn't end with a dash");
   }

   @Override
   protected IllegalArgumentException exception(String containerName, String reason) {
      return new IllegalArgumentException(
               String
                        .format(
                                 "Object '%s' doesn't match Azure container naming convention. "
                                          + "Reason: %s. For more info, please refer to http://weblogs.asp.net/vblasberg/archive/2009/02/17/"
                                          + "azure-details-and-limitations-blobs-tables-and-queues.aspx.",
                                 containerName, reason));
   }

}


text:
#include "productA2.h"

void productA2::use()
{
    /*do something*/
}


text:
function X = metoffice_remove_bins(X,maskfile)

X(~metoffice_get_mask(maskfile),:) = [];


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.alakazam</groupId>
        <artifactId>alakazam-parent</artifactId>
        <version>0.2.1</version>
    </parent>

    <artifactId>alakazam-validation</artifactId>
    <name>Alakazam Validation Support</name>

    <dependencies>
        <dependency>
            <groupId>io.alakazam</groupId>
            <artifactId>alakazam-util</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>5.0.2.Final</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>javax.el</artifactId>
            <version>2.2.6</version>
        </dependency>
    </dependencies>
</project>


text:
using System;
using Moq;
using NUnit.Framework;
using ReMi.BusinessEntities.ExecPoll;
using ReMi.BusinessLogic.ExecPoll;
using ReMi.CommandHandlers.ExecPoll;
using ReMi.TestUtils.UnitTests;

namespace ReMi.CommandHandlers.Tests
{
    [TestFixture]
    public class TrackCommandHandlerTests : TestClassFor<CommandTrackerHandler>
    {
        private Mock<ICommandPollBusinessLogic> _commandPollBusinessLogicMock;

        protected override CommandTrackerHandler ConstructSystemUnderTest()
        {
            return new CommandTrackerHandler(_commandPollBusinessLogicMock.Object);
        }

        protected override void TestInitialize()
        {
            _commandPollBusinessLogicMock = new Mock<ICommandPollBusinessLogic>();

            base.TestInitialize();
        }

        [Test]
        public void CreateCommand_ShouldCallStartCommandState_WhenInvoked()
        {
            var commandId = Guid.NewGuid();
            var description = RandomData.RandomString(RandomData.RandomInt(1, 100));

            Sut.CreateTracker(commandId, description);

            _commandPollBusinessLogicMock.Verify(o => o.StartCommandExecution(It.Is<Guid>(x => x == commandId), It.Is<string>(x => x == description)));
        }

        [Test]
        public void StartCommand_ShouldCallSetCommandState_WhenInvoked()
        {
            var commandId = Guid.NewGuid();

            Sut.Started(commandId);

            _commandPollBusinessLogicMock.Verify(o => o.SetCommandExecutionState(It.Is<Guid>(x => x == commandId), It.Is<CommandStateType>(x => x == CommandStateType.Running), null));
        }

        [Test]
        public void EndCommand_ShouldSetFailedState_WhenInvokedWithFailure()
        {
            var commandId = Guid.NewGuid();

            Sut.Finished(commandId, "error");

            _commandPollBusinessLogicMock.Verify(o => o.SetCommandExecutionState(It.Is<Guid>(x => x == commandId), It.Is<CommandStateType>(x => x == CommandStateType.Failed), "error"));
        }

        [Test]
        public void EndCommand_ShouldSetFailedState_WhenInvokedWithSuccess()
        {
            var commandId = Guid.NewGuid();

            Sut.Finished(commandId);

            _commandPollBusinessLogicMock.Verify(o => o.SetCommandExecutionState(It.Is<Guid>(x => x == commandId), It.Is<CommandStateType>(x => x == CommandStateType.Success), null));
        }

    }
}


text:
var assert = require('assert');
var spawn = require('child_process').spawn;
var exec = require('child_process').exec;
var fs = require('fs');

function run(params, assertFn, cb) {
	var prettierme = spawn('./prettierme', params);
	if (assertFn) {
		prettierme.stdout.on('data', assertFn);
		prettierme.stderr.on('data', assertFn);
	}
	cb && prettierme.on('close', cb);
}

function testSuccessLint() {
	console.log('> Fixed output on success linting');
	run(['test/fixtures/success.js'], function (data) {
		assert.equal(
			fs.readFileSync('test/fixtures/success.js').toString(),
			data.toString()
		);
	}, testErrorLint);
}

function testErrorLint() {
	console.log('> Correctly modifies issues on files');
	run(['test/fixtures/error.js'], function (data) {
		assert.equal(
			fs.readFileSync('test/fixtures/error.js').toString(),
			fs.readFileSync('test/fixtures/success.js').toString()
		);
	}, revertErrorFile);
}

function revertErrorFile() {
	exec('git checkout test/fixture/error.js', testStopprettierd);
}

function testStopprettierd() {
	console.log('> Successfully stops prettierd server');
	run(['stop'], function (data) {
		assert.equal(
			'',
			data.toString()
		);
	}, testStoppedStatus);
}

function testStoppedStatus() {
	console.log('> Status should indicate not running server');
	run(['status'], function (data) {
		assert.equal(
			'Not running\n',
			data.toString()
		);
	}, testStartprettierd);
}

function testStartprettierd() {
	console.log('> Should be able to start prettierd');
	run(['start'], function (data) {
		assert.equal(
			'',
			data.toString()
		);
	}, testStartedStatus);
}

function testStartedStatus() {
	console.log('> Status should be running');
	run(['status'], function (data) {
		assert.equal(
			'Running',
			data.toString()
		);
	}, testRestartprettierd);
}

function testRestartprettierd() {
	console.log('> Should be able to restart prettierd');
	run(['restart'], function (data) {
		assert.equal(
			'',
			data.toString()
		);
	}, finishTests);
}

function finishTests() {
	run(['stop']);
}

testSuccessLint();


text:
<?php

namespace SocioChat\Cron;

use Core\BaseException;
use Core\Enum\Enum;

class CronEnum extends Enum
{

    protected static $names = [
        'sessionCleaner' => ServiceSessionCleaner::class,
        'activationsCleaner' => ServiceActivationsCleaner::class,
	    'avatarCleaner' => ServiceAvatarCleaner::class,
	    'mailer' => ServiceMailer::class,
	    'onlineMonitor' => ServiceOnlineMonitor::class,
        'reminder' => ServiceReminder::class,
    ];

    public function getServiceInstance()
    {
        $className = $this->getName();
        $service = new $className;

        if (!$service instanceof CronService) {
            throw new BaseException("Expects {$this->getName()} implements CronService interface");
        }
        return $service;
    }
}


text:
using System;
using System.Collections.Generic;

namespace Microsoft.SourceBrowser.HtmlGenerator
{
    public class Folder<T>
    {
        public string Name { get; set; }
        public SortedList<string, Folder<T>> Folders { get; set; }
        public List<T> Items { get; set; }

        public void Add(T item)
        {
            if (Items == null)
            {
                Items = new List<T>();
            }

            Items.Add(item);
        }

        public void Sort(Comparison<T> comparison)
        {
            if (Items != null)
            {
                Items.Sort((l, r) => comparison(l, r));
            }

            if (Folders != null)
            {
                foreach (var subfolder in Folders.Values)
                {
                    subfolder.Sort(comparison);
                }
            }
        }

        public Folder<T> GetOrCreateFolder(string folderName)
        {
            if (Folders == null)
            {
                Folders = new SortedList<string, Folder<T>>(StringComparer.OrdinalIgnoreCase);
            }

            Folder<T> result = null;
            if (!Folders.TryGetValue(folderName, out result))
            {
                result = new Folder<T> { Name = folderName };
                Folders.Add(folderName, result);
            }

            return result;
        }
    }
}


text:
Imports System.Runtime.CompilerServices
Imports System.ComponentModel

<Extension()>
Public Module StringEx

#Region "转换16进制"

    ''' <summary>
    ''' 将字符串转换为16进制字符串。该方法使用System.Text.Encoding.Default进行处理
    ''' 每个16进制字符之前使用\标记
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()>
    Public Function ToHexString(ByVal str As String) As String

        Return str.ToHexString(System.Text.Encoding.Default)

    End Function

    ''' <summary>
    ''' 使用指定的编码格式将字符串转换为16进制。每个16进制字符之前使用\标记
    ''' </summary>
    ''' <param name="str"></param>
    ''' <param name="encoding"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()>
    Public Function ToHexString(ByVal str As String, ByVal encoding As System.Text.Encoding) As String

        If (str.Length = 0) Then
            Return String.Empty
        End If

        Dim bytes As Byte() = encoding.GetBytes(str)
        Dim arrString As String() = New String(bytes.Length) {}

        For i As Int32 = 0 To bytes.Length - 1
            arrString(i) = bytes(i).ToString("x")
        Next

        Dim strResult As String = String.Empty
        For i As Int32 = 0 To arrString.Length - 1
            If (Not arrString(i) Is Nothing AndAlso arrString(i).Length > 0) Then
                strResult &= "\" & arrString(i).ToUpper()
            Else
                strResult &= " "
            End If
        Next
        Return strResult

    End Function

#End Region

#Region "数字验证/转换"

    ''' <summary>
    ''' 验证字符串是否为Int32类型
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    <Extension()>
    Public Function IsInt32(ByVal str As String) As Boolean
        If (String.IsNullOrEmpty(str)) Then Return False
        Dim r As Int32 = 0
        If (Int32.TryParse(str, r)) Then
            Return True
        End If
        Return False
    End Function

    ''' <summary>
    ''' 将字符串转换为Int32数字
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    <Extension>
    Public Function ToInt32(ByVal str As String) As Int32
        If (String.IsNullOrEmpty(str)) Then Throw New ArgumentNullException("空字符串无法转换为数字")
        Dim r As Int32 = 0
        If (Int32.TryParse(str, r)) Then
            Return r
        Else
            Throw New ApplicationException("[" & str & "]为无效的数字。")
        End If

    End Function

#End Region

#Region "格式验证"

    ''' <summary>
    ''' 验证该地址是否为一个有效的IPv4地址
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()>
    Public Function IsIPv4Address(ByVal str As String) As Boolean
        Return System.Text.RegularExpressions.Regex.IsMatch(str, "^(([1-9]{1}[0-9]{0,1}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([1-9]{1}[0-9]{0,1}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$")
    End Function

    ''' <summary>
    ''' 验证该地址是否为一个有效的IPv6地址
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()>
    Public Function IsIPv6Address(ByVal str As String) As Boolean
        Throw New ApplicationException("未实现的方法")
    End Function

    ''' <summary>
    ''' 验证该字符串是否为一个有效的mac地址。支持如下格式:74-27-EA-F7-F6-B5或者74:27:EA:F7:F6:B5或者无分隔符7427EAF7F6B5
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()>
    Public Function IsMacAddress(ByVal str As String) As Boolean
        If (str Is Nothing) OrElse (str.Length = 0) Then Return False
        str = str.Replace(":", "-")
        If Not System.Text.RegularExpressions.Regex.IsMatch(str, "^([\da-fA-F]{2})(([-:]{0,1}[\da-fA-F]{2}){5})$") Then
            Return False
        End If

        Return True
    End Function

    ''' <summary>
    ''' 验证该字符串是否为一个有效的手机号码
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    <Extension()>
    Public Function IsMobilePhoneNumber(ByVal str As String) As Boolean
        Return System.Text.RegularExpressions.Regex.IsMatch(str, "^[1]{1}[0-9]{2}[0-9]{8}$")
    End Function

#End Region

#Region "MD5"

    ''' <summary>
    ''' 获取该字符串的MD5
    ''' </summary>
    ''' <param name="str"></param>
    ''' <returns></returns>
    <Extension>
    Public Function ToMD5(ByVal str As String) As String
        Dim provider As System.Security.Cryptography.MD5CryptoServiceProvider
        provider = New Security.Cryptography.MD5CryptoServiceProvider()
        Dim bytes As Byte() = System.Text.Encoding.Default.GetBytes(str)
        Dim sb As System.Text.StringBuilder = New Text.StringBuilder()

        bytes = provider.ComputeHash(bytes)

        For Each b As Byte In bytes
            sb.Append(b.ToString("x2").ToUpper)
        Next

        Return sb.ToString()
    End Function

    ''' <summary>
    ''' 获取该字符串的MD5
    ''' </summary>
    ''' <param name="str"></param>
    ''' <param name="encoded">编码格式。</param>
    ''' <returns></returns>
    Public Function ToMD5(ByVal str As String, ByVal encoded As System.Text.Encoding)
        If (encoded Is Nothing) Then
            Throw New ArgumentNullException("encoded")
        End If

        Dim provider As System.Security.Cryptography.MD5CryptoServiceProvider
        provider = New Security.Cryptography.MD5CryptoServiceProvider()
        Dim bytes As Byte() = encoded.GetBytes(str)
        Dim sb As System.Text.StringBuilder = New Text.StringBuilder()

        bytes = provider.ComputeHash(bytes)

        For Each b As Byte In bytes
            sb.Append(b.ToString("x2").ToUpper)
        Next

        Return sb.ToString()

    End Function

#End Region

#Region "List转换"

    ''' <summary>
    ''' 将字符串按照指定的分隔符转换为泛型集合
    ''' </summary>
    ''' <param name="str"></param>
    ''' <param name="separator">跟个符号</param>
    ''' <param name="IsRemoveEmptyEntires">是否移除空内容的项目。默认为是,既如果分隔符号之间的内容为空,不添加到集合中</param>
    ''' <returns></returns>
    <Extension()>
    Public Function ToListOfString(ByVal str As String, ByVal separator As String, Optional ByVal IsRemoveEmptyEntires As StringSplitOptions = StringSplitOptions.RemoveEmptyEntries) As List(Of String)

        If str Is Nothing OrElse str.Length = 0 Then
            Return Nothing
        End If

        Dim arrTarget As Array
        Dim listString As New List(Of String)
        Dim i As Int32
        arrTarget = str.Split(New String() {separator}, IsRemoveEmptyEntires)
        For i = 0 To arrTarget.Length - 1
            listString.Add(arrTarget(i))
        Next
        Return listString

    End Function

    ''' <summary>
    ''' 将字符串按照指定的分隔符转换为Int类型的泛型集合
    ''' </summary>
    ''' <param name="str">要转换的字符串</param>
    ''' <param name="separaotr">分隔符</param>
    ''' <param name="IsDropEmpty">是否跳过空内容。默认为True。如果不跳过空内容,遇到空内容时引发异常。</param>
    ''' <returns></returns>
    <Extension>
    Public Function ToListOfInt32(ByVal str As String, ByVal separaotr As String, Optional ByVal IsDropEmpty As Boolean = True) As List(Of Int32)
        If (String.IsNullOrEmpty(str)) Then
            Return Nothing
        End If

        Dim arr As String() = str.Split(separaotr)
        If (arr.Length > 0) Then
            Dim result As New List(Of Int32)
            For Each s In arr
                If Not s.IsInt32 Then
                    Throw New ApplicationException("[" & s & "]不是有效地数字")
                End If
                result.Add(s.ToInt32())
            Next
            Return result
        End If
        Return Nothing
    End Function

#End Region

End Module


text:
This problem was asked by Dropbox.

Given the root to a binary search tree, find the second largest node in the tree.


text:
from gui.widgets.frames import OptionsFrame
from gui.widgets import Buttons
import DisableDeleteNotebookTab

import constants as c

class PlotTab(DisableDeleteNotebookTab.DisableDeleteNotebookTab):
    def __init__(self, parent, deleteTab, **kwargs):
        DisableDeleteNotebookTab.DisableDeleteNotebookTab.__init__(self, parent, c.PLOT_TAB_TAB, **kwargs)
        self.addChildWidgets((
            OptionsFrame.SensorsFrame(self.widget, 0, 0),
            PlotTabButtonFrame(self.widget, 1, 0),
            OptionsFrame.OptionsFrame(self.widget, 2, 0),
            self.getDisableDeleteFrame(3, 0, deleteTab)
        ))

class PlotTabButtonFrame(OptionsFrame.OptionsFrameFrame):
    def __init__(self, parent, row, column, **kwargs):
        OptionsFrame.OptionsFrameFrame.__init__(self, parent, c.METHODS_FRAME, row, column, **kwargs)
        self.addChildWidgets((
            Buttons.SunkenButton(self.widget, c.SIGNAL,         0, 0, default_value=1),
            Buttons.SunkenButton(self.widget, c.SUM_SIGNAL,     0, 1),
            Buttons.SunkenButton(self.widget, c.AVG_SIGNAL,     0, 2),
            Buttons.SunkenButton(self.widget, c.SUM_AVG_SIGNAL, 0, 3),
            Buttons.SunkenButton(self.widget, c.POWER,          1, 0),
            Buttons.SunkenButton(self.widget, c.SUM_POWER,      1, 1),
            Buttons.SunkenButton(self.widget, c.AVG_POWER,      1, 2),
            Buttons.SunkenButton(self.widget, c.SUM_AVG_POWER,  1, 3)
        ))


text:
import re
import sys

#Description: Checks a string against the Sandpit naming conventions.
#Author: Robert A. Marshall
#Date: 27/10/17
#Authorised by:
#Last Modified: 27/10/17
#Audit Log:
#Notes: Returns error messages as a string or an empty string if no errors.
#--------------------------------------------------------------------#

inputString = sys.argv[1]

#Does not contain underscores
searchObj = re.search('_', inputString)
if searchObj:
        print 'ERROR: >>>', inputString, '<<< should not contain underscores.'

#Is a directory path
searchObj = re.search('^[/]', inputString)
if not searchObj:
        print 'ERROR: >>>', inputString, '<<< does not begin with a slash.'

sys.exit(0)


text:
package chroot

import (
	"github.com/mitchellh/multistep"
	"github.com/mitchellh/packer/packer"
	"log"
)

// StepChrootProvision provisions the instance within a chroot.
type StepChrootProvision struct {
	mounts []string
}

func (s *StepChrootProvision) Run(state multistep.StateBag) multistep.StepAction {
	hook := state.Get("hook").(packer.Hook)
	mountPath := state.Get("mount_path").(string)
	ui := state.Get("ui").(packer.Ui)
	wrappedCommand := state.Get("wrappedCommand").(CommandWrapper)

	// Create our communicator
	comm := &Communicator{
		Chroot:     mountPath,
		CmdWrapper: wrappedCommand,
	}

	// Provision
	log.Println("Running the provision hook")
	if err := hook.Run(packer.HookProvision, ui, comm, nil); err != nil {
		state.Put("error", err)
		return multistep.ActionHalt
	}

	return multistep.ActionContinue
}

func (s *StepChrootProvision) Cleanup(state multistep.StateBag) {}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>Material Design Login Form</title>

      <link rel="stylesheet" href="css/login.css">

  <hgroup>

Material Design Form

By Josh Adamous

</hgroup>
<form>

    <input type="text">
    Name

    <input type="email">
    Email

  <button type="button" class="button buttonBlue">Subscribe

  </button>
</form>

You Gotta Love Google


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM e:/builds/moz2_slave/rel-2.0-xr-w32-bld/build/content/base/public/nsIScriptEventHandler.idl
 */

#ifndef __gen_nsIScriptEventHandler_h__
#define __gen_nsIScriptEventHandler_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    nsIScriptEventHandler */
#define NS_ISCRIPTEVENTHANDLER_IID_STR "375f787f-8d3a-4344-b540-293d5645c22c"

#define NS_ISCRIPTEVENTHANDLER_IID \
  {0x375f787f, 0x8d3a, 0x4344, \
    { 0xb5, 0x40, 0x29, 0x3d, 0x56, 0x45, 0xc2, 0x2c }}

class NS_NO_VTABLE nsIScriptEventHandler : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTEVENTHANDLER_IID)

  /**
  * IsSameEvent:
  *
  * Determines if this script event handler is bound to the given
  * object and event name.
  *
  * @param aObjectName  Name of the object raising the event.
  *
  * @param aEventName   Name of the event being raised.
  *
  * @param aArgCount    Number of arguments expected by the event handler.
  *
  */
  /* boolean IsSameEvent (in AString aObjectName, in AString aEventName, in unsigned long aArgCount); */
  NS_IMETHOD IsSameEvent(const nsAString & aObjectName, const nsAString & aEventName, PRUint32 aArgCount, PRBool *_retval NS_OUTPARAM) = 0;

  /**
  * Invoke:
  *
  * Executes this script handler.
  *
  * @param aTargetObject  Object to which the script handler is bound.
  *
  * @param aArgs          Array of arguments passed to the script handler.
  *                       This is an array of jsvals.
  *
  * @param aArgCount      Number of elements in the aArgs array.
  *
  */
  /* void Invoke (in nsISupports aTargetObject, in voidPtr aArgs, in unsigned long aArgCount); */
  NS_IMETHOD Invoke(nsISupports *aTargetObject, void *aArgs, PRUint32 aArgCount) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptEventHandler, NS_ISCRIPTEVENTHANDLER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISCRIPTEVENTHANDLER \
  NS_IMETHOD IsSameEvent(const nsAString & aObjectName, const nsAString & aEventName, PRUint32 aArgCount, PRBool *_retval NS_OUTPARAM); \
  NS_IMETHOD Invoke(nsISupports *aTargetObject, void *aArgs, PRUint32 aArgCount);

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISCRIPTEVENTHANDLER(_to) \
  NS_IMETHOD IsSameEvent(const nsAString & aObjectName, const nsAString & aEventName, PRUint32 aArgCount, PRBool *_retval NS_OUTPARAM) { return _to IsSameEvent(aObjectName, aEventName, aArgCount, _retval); } \
  NS_IMETHOD Invoke(nsISupports *aTargetObject, void *aArgs, PRUint32 aArgCount) { return _to Invoke(aTargetObject, aArgs, aArgCount); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISCRIPTEVENTHANDLER(_to) \
  NS_IMETHOD IsSameEvent(const nsAString & aObjectName, const nsAString & aEventName, PRUint32 aArgCount, PRBool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsSameEvent(aObjectName, aEventName, aArgCount, _retval); } \
  NS_IMETHOD Invoke(nsISupports *aTargetObject, void *aArgs, PRUint32 aArgCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->Invoke(aTargetObject, aArgs, aArgCount); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsScriptEventHandler : public nsIScriptEventHandler
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISCRIPTEVENTHANDLER

  nsScriptEventHandler();

private:
  ~nsScriptEventHandler();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsScriptEventHandler, nsIScriptEventHandler)

nsScriptEventHandler::nsScriptEventHandler()
{
  /* member initializers and constructor code */
}

nsScriptEventHandler::~nsScriptEventHandler()
{
  /* destructor code */
}

/* boolean IsSameEvent (in AString aObjectName, in AString aEventName, in unsigned long aArgCount); */
NS_IMETHODIMP nsScriptEventHandler::IsSameEvent(const nsAString & aObjectName, const nsAString & aEventName, PRUint32 aArgCount, PRBool *_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void Invoke (in nsISupports aTargetObject, in voidPtr aArgs, in unsigned long aArgCount); */
NS_IMETHODIMP nsScriptEventHandler::Invoke(nsISupports *aTargetObject, void *aArgs, PRUint32 aArgCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIScriptEventHandler_h__ */


text:
@interface CCBDictionaryMigrator_Tests : XCTestCase

@end

@implementation CCBDictionaryMigrator_Tests

- (void)testMigrateCCBWithoutVersion
{
    CCBDictionaryMigrator *migrator = [[CCBDictionaryMigrator alloc] initWithCCB:@{}];

    NSError *error;
    NSDictionary *migratedCCB = [migrator migrate:&error];

    XCTAssertNil(migratedCCB);
    XCTAssertNotNil(error);
    XCTAssertEqual(error.code, SBCCBMigrationNoVersionFoundError);
};

- (void)testMigrateCCBWithEmptyMigrationStepClassPrefixError
{
    CCBDictionaryMigrator *migrator = [[CCBDictionaryMigrator alloc] initWithCCB:@{}];
    migrator.migrationStepClassPrefix = nil;

    NSError *error;
    NSDictionary *migratedCCB = [migrator migrate:&error];

    XCTAssertNil(migratedCCB);
    XCTAssertNotNil(error);
    XCTAssertEqual(error.code, SBCCBMigrationNoMigrationStepClassPrefixError);
};

- (void)testMigrateUpdatingVersionOnly
{
    NSDictionary *ccb = @{
        CCB_DICTIONARY_KEY_FILEVERSION : @2
    };

    CCBDictionaryMigrator *migrator = [[CCBDictionaryMigrator alloc] initWithCCB:ccb];
    migrator.migrationStepClassPrefix = @"SurelyNotExistingButThatsOk";
    migrator.ccbMigrationVersionTarget = 5;

    NSError *error;
    NSDictionary *migratedCCB = [migrator migrate:&error];

    XCTAssertNotNil(migratedCCB);
    XCTAssertEqualObjects(migratedCCB[CCB_DICTIONARY_KEY_FILEVERSION], @5);
    XCTAssertNil(error);
}

- (void)testMigrate
{
    NSDictionary *ccb = @{
        CCB_DICTIONARY_KEY_FILEVERSION : @1,
        @"payload" : @{
            @"foo" : @"baa"
        }
    };

    CCBDictionaryMigrator *migrator = [[CCBDictionaryMigrator alloc] initWithCCB:ccb];
    // See below for class stub
    migrator.migrationStepClassPrefix = @"CCBTestMigrationStep";
    migrator.ccbMigrationVersionTarget = 3;

    NSError *error;
    NSDictionary *migratedCCB = [migrator migrate:&error];

    XCTAssertNotNil(migratedCCB);
    XCTAssertEqualObjects(migratedCCB[CCB_DICTIONARY_KEY_FILEVERSION], @3);
    XCTAssertEqualObjects(migratedCCB[@"payload"], @"done!");
    XCTAssertNil(error);
};

- (void)testMigrateFailingWithUnderlyingError
{
    NSDictionary *ccb = @{
        CCB_DICTIONARY_KEY_FILEVERSION : @4
    };

    CCBDictionaryMigrator *migrator = [[CCBDictionaryMigrator alloc] initWithCCB:ccb];
    // See below for class stub
    migrator.migrationStepClassPrefix = @"CCBTestMigrationFailingStep";
    migrator.ccbMigrationVersionTarget = 5;

    NSError *error;
    NSDictionary *migratedCCB = [migrator migrate:&error];

    XCTAssertNil(migratedCCB);
    XCTAssertNotNil(error);
    XCTAssertEqual(error.code, SBCCBMigrationError);

    NSLog(@"%@", error);

    NSError *underlyingError = error.userInfo[NSUnderlyingErrorKey];
    XCTAssertNotNil(underlyingError);
    XCTAssertEqual(underlyingError.code, 1234567);
}

@end

#pragma mark - migration step classes

@interface CCBTestMigrationStep2 : NSObject <CCBDictionaryMigrationProtocol>

@end

@implementation CCBTestMigrationStep2

- (NSDictionary *)migrate:(NSDictionary *)ccb error:(NSError **)error
{
    NSMutableDictionary *mutableCCB = CFBridgingRelease(CFPropertyListCreateDeepCopy(NULL, (__bridge CFPropertyListRef)(ccb), kCFPropertyListMutableContainersAndLeaves));
    mutableCCB[@"payload"] = @"done!";

    return mutableCCB;
}

@end

@interface CCBTestMigrationFailingStep4 : NSObject <CCBDictionaryMigrationProtocol>

@end

@implementation CCBTestMigrationFailingStep4

- (NSDictionary *)migrate:(NSDictionary *)ccb error:(NSError **)error
{
    [NSError setNewErrorWithErrorPointer:error code:1234567 message:@"Some arbitrary error"];

    return nil;
}

@end


text:
db=${1-'catarse_api_test'}
user=`whoami`
port=8888
exit_code=0

postgrest_bin='unknown'
unamestr=`uname`
ver='0.3.0.3'
dir='postgrest'

schema_log='logs/schema_load.log'
data_log='logs/data_load.log'

if [[ "$unamestr" == 'Linux' ]]; then
  postgrest_bin="postgrest-$ver-linux"
elif [[ "$unamestr" == 'Darwin' ]]; then
  postgrest_bin="postgrest-$ver-osx"
fi

if [[ "$postgrest_bin" == "unknown" ]]; then
  echo "Platform $unamestr is not supported by the postgrest binaries."
fi

echo "Initiating database users..."
createuser --no-login web_user > /dev/null 2>&1
createuser --no-login admin > /dev/null 2>&1
createuser --no-login anonymous > /dev/null 2>&1
createuser catarse -s > /dev/null 2>&1
createuser postgrest -g admin -g web_user -g anonymous > /dev/null 2>&1

echo "Initiating database schema..."
dropdb --if-exists $db
createdb $db
psql --set ON_ERROR_STOP=1 $db < ./database/schema.sql > $schema_log 2>&1
if [[ $? -ne 0 ]]; then
    echo "Error restoring test schema. Take a look at ${schema_log}:"
    tail -n 5 $schema_log
    exit 1
fi

echo "Populating database..."
psql --set ON_ERROR_STOP=1 -v db=$db $db < ./database/data.sql > $data_log 2>&1
if [[ $? -ne 0 ]]; then
    echo "Error restoring test data. Take a look at ${data_log}:"
    tail -n 5 $data_log
    exit 1
fi

echo "Initiating PostgREST server ./$dir/$postgrest_bin ..."
./$dir/$postgrest_bin "postgres://postgrest@localhost/$db" --schema "1" -a anonymous -p $port --jwt-secret gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr9C > logs/postgrest.log 2>&1 &

echo "Running tests..."
sleep 2
for f in test/*.yml
do
    echo ""
    echo "$f..."
    pyresttest http://localhost:$port $f
    if [[ $? -ne 0 ]]; then
        exit_code=1
    fi
done
echo ""

echo "Terminating PostgREST server..."
killall $postgrest_bin
echo "Done."
exit $exit_code


text:
function result = kyu_BN_ParamLearnPredict_submit(data,MCMCresult,whichinput,clustername,validation,disc,EnsembleSizes,index,result)

% Learn parameters of MCMC sampled graphs and
% obtain class probability under a bootstrap/CV validation setting
% computation will be distributed to a cluster specified at 'whichcluster'
% a single core will be assigned to param learning/testing for a single
% data fold
% due to current the maximum number of job restriction at the cluster,
% the task is serialized into a sequence of smaller jobs of size =
% FoldsPerJob cores

% inputs:
% data: the bootstrapped/CVed dataset (see kyu_BN_GeneratePartition.m)
% MCMCresult: a struct from MCMC (see kyu_BN_GraphLearning_collect.m)
% whichinput:
% -'missing': inference with original dataset containing missing values
% -'nointra': make inference without biomkr 'intra' or 'ratio' (so, only the baseline data)
% clustername: name of the cluster
% validation:
% -'bootstrap'
% -'cv': cross validation
% -'fitting': parameters are learned from an original training dataset
% -'external': parameters are learned in a training dataset and inference
% is made in a validation set
% disc: discretization method to choose
% EnsembleSizes: a list of ensemble sizes to test performance
% (should be in an increasing order ex: [1 50 100])
% max(EnsembleSizes) should be < size(gs_top,2) (number of high posterior models
% obtained)
% index: required to specify which bootstrap replicates to send to a
% cluster ex) 1:100 (should be left [] for validation='cv')
% result: a cell storing the results from a previous run. first time run,
% set it []
%
% outputs:
% result: cell array of results passed from batch runs of kyu_BN_BMA.m
% one element saves the results from one batch run
% needs to be converted by kyu_BN_ParamLearnPredict_collect.m to be used
% for the next step

switch disc
    case 'KM'
        data_in = data.KM; % k-means discretized data for graph learning
    case 'MI'
        data_in = data.MI; % MMI based discretized data for graph learning
end
data_o = data_in.data_orig;
patno_train = data_in.patients_train;
patno_test = data_in.patients_test;
trainmat_m = data_in.train_missing;
if strcmp(whichinput,'missing')
    testmat_m = data_in.test_missing;
elseif strcmp(whichinput,'nointra')
    testmat_m = data_in.test_nointra;
end
alpha_d = 2; % equivalent sample size for dirichlet prior
labels = data_in.Labels;
npat = size(data_o,2);
nvar = size(data_o,1);
gs_top = MCMCresult.gs_top;
post = MCMCresult.posterior;
ClassRate = numel(find(data_o(nvar,:)==2))/npat;
Nrand = numel(index);
switch validation
    case 'bootstrap' % boostrap
        FoldsPerJob = 10; % number of workers requested per job

    case 'cv' % cross validation (valid when sample size < 100)
        FoldsPerJob = Nrand;
    case 'fitting' % evaluate fitting performance (train data=test data)
        FoldsPerJob = 1;
        trainmat_m = {};
        trainmat_m{1} = data_in.data_orig_missing;
        testmat_m = {};
        testmat_m{1} = data_in.data_orig_missing;
        if trcmp(whichinput,'nointra')
            testmat_m{1} = remove_intra(testmat_m{1},labels);
        end
        patno_train = {};
        patno_train{1} = 1:npat;
        patno_test = {};
        patno_test{1} = 1:npat;
    case 'external'
        FoldsPerJob = 1;
        trainmat_m = {};
        trainmat_m{1} = data_in.train_missing;
        testmat_m = {};
        testmat_m{1} = data_in.test_missing;
        if strcmp(whichinput,'nointra')
            testmat_m{1} = remove_intra(testmat_m{1},labels);
        end
        npat_train = size(data_in.train_missing,2);
        patno_train = {};
        patno_train{1} = 1:npat_train;
        npat_test = size(data_in.test_missing,2);
        patno_test = {};
        patno_test{1} = 1:npat_test;

end
st = 1:FoldsPerJob:Nrand;
Njobs = numel(st);
NoWorkerstoReq = FoldsPerJob+1;
if isempty(result)
	result = cell(Njobs,1);
end

for p = 1:Njobs
    start = st(p);
    finish = min(st(p)+FoldsPerJob-1,numel(index));
    saveindex = floor(index(start)/FoldsPerJob)+1;
    graphs = gs_top(index(start:finish),:);
    posts = post(index(start:finish),:);
    data_tr = trainmat_m(index(start:finish));
    data_test = testmat_m(index(start:finish));
    pts_tr = patno_train(index(start:finish));
    pts_test = patno_test(index(start:finish));
    inputs = {graphs,posts,data_tr,data_test,FoldsPerJob,pts_tr,pts_test,ClassRate,EnsembleSizes,alpha_d};
    if strcmp(clustername,'serial')
        [Pr,Mt] = kyu_BN_BMA_serial(inputs{:});
        result{saveindex}{1} = Pr;
        result{saveindex}{2} = Mt;
    else
        cluster = parcluster(clustername);
        j = batch(cluster,'kyu_BN_BMA',2,inputs,'matlabpool',NoWorkerstoReq,'CurrentDirectory', '.')
        ok = wait(j,'finished',100000); % wait 27 hrs maximum
        if ok
           result{saveindex} = fetchOutputs(j);
        else
           disp(['Jobs for folds',num2str([index(start) index(finish)]),'crashed']);
           result{saveindex} = [];
        end
    end
end


text:
package com.google.cloud.logging;

/* Adds tracing support for logging with thread-local trace ID tracking. */
public class TraceLoggingEnhancer implements LoggingEnhancer {

  private static final String TRACE_ID = "trace_id";
  private final String traceIdLabel;

  public TraceLoggingEnhancer() {
    traceIdLabel = TRACE_ID;
  }

  public TraceLoggingEnhancer(String prefix) {
    traceIdLabel = (prefix != null) ? prefix + TRACE_ID : TRACE_ID;
  }

  private static final ThreadLocal<String> traceId = new ThreadLocal<>();

  /**
   * Set the Trace ID associated with any logging done by the current thread.
   *
   * @param id The traceID, in the form projects/[PROJECT_ID]/traces/[TRACE_ID]
   */
  public static void setCurrentTraceId(String id) {
    if (id == null) {
      traceId.remove();
    } else {
      traceId.set(id);
    }
  }

  /**
   * Get the Trace ID associated with any logging done by the current thread.
   *
   * @return id The traceID
   */
  public static String getCurrentTraceId() {
    return traceId.get();
  }

  @Override
  public void enhanceLogEntry(com.google.cloud.logging.LogEntry.Builder builder) {
    String traceId = getCurrentTraceId();
    if (traceId != null) {
      builder.setTrace(traceId);
    }
  }
}


text:
nio-http
========

A hybrid non-blocking / threaded HTTP server library for Java 7+.

* HTTP/1.1 Server
* Will handle tens of thousands of connections
* Easily deployed in a project with custom response handlers
* Integrated file system server (to enable use as a traditional web server)
* Automatic chunked transfer encoding for streaming responses
* Integrated GZIP compression support

### How To Use

To build the library, either checkout into Eclipse / IDEA and package your own JAR file (or use the code as-is in your project), or build from the command line using [Apache Ant](http://ant.apache.org):

	# ant package
	# file nio-http.jar
	nio-http.jar: Java archive data (JAR)

The server library is designed to be very easy to integrate with your project. At the simplest level, simply create an instance of a RequestHandler class (in this case, a StringRequestHandler to return simple String answers):

	public class MyHandler extends StringRequestHandler {

		@Override
		public String getContentType() {
			return "text/html";
		}

		@Override
		public String handleRequest(Request request) {
			return "Thanks for connecting from " + request.getRemoteAddr() + "!";
		}

	};

Then, pass the Class to the server library:

	public class MyServer {

	    public static void main (String args[]) {
            try {
                Server server = new Server();
                server.addRequestHandler("/", MyHandler.class);
                server.run();
            }
            catch (Exception e) {
                e.printStackTrace();
             }
        }

    }

### Performance

For basic file serving performance, serving the same file (the Apache index.html file included in Ubuntu), NIO-HTTP compares favourably with major HTTP server implementations.

On Ubuntu 14.04, out of the box, serving 1M requests to 10,000 connections:

* Apache (event): 9,275 requests per second.
* Nginx: 11,733 requests per second.
* NIO-HTTP: 18,150 requests per second.

Nginx can, of course, scale to very high levels when fine tuned but these numbers should show that NIO-HTTP performance is already very good. Additionally, other benchmarking suites show Nginx on the same hardware scoring much better benchmarking scores. These numbers aren't intended to show that NIO-HTTP is faster than Nginx; they are simply intended to demonstrate that using NIO-HTTP in your project will not automatically create performance problems.

### Architecture

NIO-HTTP uses a hybrid design architecture to process requests:

##### Core Service
Client sockets are all registered against a master selector service. The master service load balances the connections onto a connection engine. Each connection engine runs in it's own thread.

##### Engine Service
The engine service is responsible for managing client connections. An engine service is responsible for reading client requests and relaying these requests to connection handlers, where responses are generated.

##### Handler Services
Once the engine service reads client requests, handler services generate the responses. Handler services operate in their own threads and can be crafted to meet the needs of the implementing code. Each handler communicates with the engine service via a non-blocking channel, allowing handler input and output to integrate with the engine service directly.

At present, the following handler services are working/planned:

* String (return textual response data)
* File System Server (serves files from a folder like a traditional web server)
* FastCGI (send data to a FastCGI server for further processing by PHP, Ruby, etc)
* HTTP Proxy (proxy requests onto another HTTP server)

Any combination of handlers can be used and assigned to URIs. Multiple handlers assigned to the same URI are automatically load balanced in round-robin.

By combining file system server, fast CGI and proxy handlers a full production deployable web service can be quickly created with minimal additional code.

##### Hybrid Channel / Queue
Core, Engine and Handler services interact using a hybrid channel / queue system. Channels are used between the service threads to notify of connection and/or data arrival. This way threads can receive notifications using standard non-blocking I/O calls, bundling notification messages with normal server load. Once a notification message is receive, a thread-safe queue is used to transfer actual data between threads. This avoids the traditional select(delay) behaviour of similar systems, allowing for pure event based / non-polling operation.

The end result is a server that can scale on multiple processors / cores in an almost linear fashion (tested up to 16 CPU cores).

### Requirements

* Java 7+
* Apache Ant for command line building
* Eclipse or IDEA (or the IDE of your choice) for development

### Can I help?

Sure! Please place any pull requests against the devel branch.

### Current Status

* Functional for basic text requests via a StringRequestHandler (see example below) - using GET and HEAD requests over HTTP/1.0 and HTTP/1.1. GET/HEAD/POST requests working, as do parameter value and header value passing via GET/POST (GET and POST via x-www-form-urlencoded only; presently form/multipart requests are received but not decoded into values).

* Full file server functionality (directory index support still unimplemented) via the FileSystemRequestHandler object. This is a non-blocking I/O file service handler and in it's current (mostly unoptimized) form is capable of pushing ~10Gbps to thousands of requests from a single SSD (backed by OS level file-system caching).

* Currently in the process of implementing HTTP Proxy load balancing and FastCGI client support.

### Issues

There are lots of enhancements underway. See [the issues page](https://github.com/simplepanda/nio-http/issues) for specifics.


text:
"""Ce package contient toutes les perturbations météorologiques existantes,
héritées de la perturbation basique (voir base.py).

"""

from abstraits.obase import MetaBaseObj

perturbations = []

class MetaPertu(MetaBaseObj):

    """Métaclasse des perturbations météorologiques.

    Elle ajoute la perturbations dans le dictionnaire ci-dessus.

    """

    def __init__(cls, nom, bases, contenu):
        """Constructeur de la métaclasse"""
        MetaBaseObj.__init__(cls, nom, bases, contenu)
        if cls.nom_pertu:
            perturbations.append(cls)

from .grele import Grele
from .pluie import Pluie
from .neige import Neige
from .nuages import Nuages
from .nuages_fins import NuagesFins
from .nuages_neige import NuagesNeige
from .orage import Orage
from .tempete_neige import TempeteNeige


text:
'use strict';

var mocha = require('mocha'),
    sinon = require('sinon'),
    expect = require('chai').expect,
    rewire = require('rewire'),
    cache = rewire('../lib/cache');

describe('Cache', function() {
    var redisTransporterMock,
        deferMock;

    beforeEach(function() {
        redisTransporterMock = {
            set: sinon.stub(),
            get: sinon.stub(),
            purge: sinon.stub()
        };
        deferMock = {
            resolve: sinon.stub(),
            reject: sinon.stub()
        };

        cache.__set__('redis', redisTransporterMock);
        cache.__set__('Q', {
            defer: function() {
                return deferMock;
            }
        });
    });

    afterEach(function() {
        cache.__set__('redis', {});
        cache.__set__('Q', {});
    });

    describe('#isTransportAvailable()', function() {
        it('should initially return true, as now inMemory caching is enabled by default', function() {
            expect(cache.isTransportAvailable()).to.equal(true);
        });

        it('should return true, transport was set', function() {
            cache.setCacheTransporter(redisTransporterMock);

            expect(cache.isTransportAvailable()).to.equal(true);
        });
    });

    describe('#purge()', function() {
        it('should call purge with the cached full url as key', function() {
            cache.setCacheTransporter(redisTransporterMock);

            var url = 'http://www.google.com';
            cache.get(url);

            expect(redisTransporterMock.get.calledWith(url)).to.equal(true);
        });

    });

    describe('#get()', function() {
        it('should call get with the cached full url as key', function() {
            cache.setCacheTransporter(redisTransporterMock);

            var url = 'http://www.google.com';
            cache.get(url);

            expect(redisTransporterMock.get.calledWith(url)).to.equal(true);
        });
    });

    describe('#set()', function() {
        it('should call set with the cached full url as key', function() {
            cache.setCacheTransporter(redisTransporterMock);

            var url = 'http://www.google.com',
                data = { code: 200 };

            cache.set(url, data);

            expect(redisTransporterMock.set.calledWith(url, data)).to.equal(true);
        });
    });
});


text:
package Kvasir::TypeDecl;

use strict;
use warnings;

use Carp qw(croak);
use Scalar::Util qw(blessed);

sub new {
    my ($pkg, $type, $defaults, @args) = @_;
    $defaults = [] if !defined $defaults;
    $defaults = [$defaults] if ref $defaults ne 'ARRAY';
    my $self = bless [$type, $defaults, \@args], $pkg;
    return $self;
}

sub instantiate {
    my ($self, $engine) = @_;
    my $instance;

    if (blessed $self->_pkg) {
        $instance = $self->_pkg;
    }
    else {
        my %defaults = map { %{$engine->get_defaults($_)} } @{$self->_defaults};
        $instance = $self->_pkg->new(%defaults, @{$self->_args});
    }

    return $instance;
}

sub _pkg {
    my $self = shift;
    return $self->[0];
}

sub _defaults {
    my $self = shift;
    return $self->[1];
}

sub _args {
    my $self = shift;
    return $self->[2];
}

1;
__END__

=head1 NAME

Kvasir::TypeDecl - Helper class for maintaining types used in engines

=head1 SYNOPSIS

  use Kvasir::TypeDecl;

  # Will create a Foo::Bar instance by calling new in Foo::Bar
  my $type1 = Kvasir::TypeDecl->new("Foo::Bar");
  my $obj1 = $type1->instantiate($engine);

  # Will keep around an already existing reference to an object
  # and return that when instantiating.
  my $existing_obj = get_some_object();
  my $type2 = Kvasir::TypeDecl->new($existing_obj);
  my $obj2 = $type2->instantiate($engine);

=head1 INTERFACE

=head2 CLASS METHODS

=over 4

=item new ( TARGET, DEFAULTS [, ARGS ... ])

Wraps a type. If I<TARGET> is an object it will be returned when instantiating the type. If not
C<new> will be called on I<TARGET> with any I<ARGS> passed as a list. DEFAULTS should be a
reference to an array containg the names of default arguments sets in the engine in which
we instanciate the type or a single defaults name. If no defaults are requested undef should be
passed.

=back

=head2 INSTANCE METHODS

=over 4

=item instantiate ( ENGINE )

Instantiates the type in the engine I<ENGINE>. See C<new> above for semantics.

=back

=cut


text:
typedef NS_ENUM(NSInteger, HorizontalWaterFullLayoutStyle) {
    HorizontalWaterFullLayoutStyleLeft,
    HorizontalWaterFullLayoutStyleRight
};

@protocol HorizontalWaterFullModelProtocol <NSObject>

- (CGFloat)widthForModel;

@end

@interface MTHorizontalWaterFullLayout : UICollectionViewLayout

@property (nonatomic, readonly) CGFloat maxWidth;

@property (nonatomic, readonly) NSMutableArray<id<HorizontalWaterFullModelProtocol>> *dataes;

- (instancetype)initWithDataes:(NSArray <id<HorizontalWaterFullModelProtocol>>*)dates maxWidth:(CGFloat)maxWidth itemHeight:(CGFloat)itemHeight style:(HorizontalWaterFullLayoutStyle)style;

- (instancetype)initWithDataes:(NSArray <id<HorizontalWaterFullModelProtocol>>*)dates maxWidth:(CGFloat)maxWidth itemHeight:(CGFloat)itemHeight;

- (void)setColumnSpacing:(CGFloat)columnSpacing rowSpacing:(CGFloat)rowSpacing edgeInsets:(UIEdgeInsets)edgeInsets;

@end


text:
[?php

/**
 * Plugin<?php echo $this->table->getOption('name') ?> form.
 *
 * @package    ##PROJECT_NAME##
 * @subpackage form
 * @author     ##AUTHOR_NAME##
 * @version    SVN: $Id$
 * @generator  <?php echo 'Diem ', constant('DIEM_VERSION'), "\n"?>
 * @gen-file   <?php echo __FILE__?>
 */
abstract class Plugin<?php echo $this->table->getOption('name') ?>Form extends Base<?php echo $this->table->getOption('name') ?>Form
{
  public function setup()
  {
    parent::setup();
    /*
     * Here, the plugin form code
     */
  }
}


text:
package de.lessvoid.nifty.effects;

import java.util.List;

import de.lessvoid.nifty.EndNotify;
import de.lessvoid.nifty.render.NiftyRenderEngine;

public class EffectProcessorNull implements EffectProcessor {
  @Override
  public void registerEffect(Effect e) {
  }

  @Override
  public void getRenderStatesToSave(NiftyRenderDeviceProxy renderDeviceProxy) {
  }

  @Override
  public void renderPre(NiftyRenderEngine renderDevice) {
  }

  @Override
  public void renderPost(NiftyRenderEngine renderDevice) {
  }

  @Override
  public void renderOverlay(NiftyRenderEngine renderDevice) {
  }

  @Override
  public boolean isActive() {
    return false;
  }

  @Override
  public void saveActiveNeverStopRenderingEffects() {
  }

  @Override
  public void restoreNeverStopRenderingEffects() {
  }

  @Override
  public void reset() {
  }

  @Override
  public void reset(String customKey) {
  }

  @Override
  public void activate(EndNotify newListener, String alternate, String customKey) {
  }

  @Override
  public String getStateString() {
    return null;
  }

  @Override
  public void setActive(boolean newActive) {
  }

  @Override
  public void processHover(int x, int y) {
  }

  @Override
  public void processStartHover(int x, int y) {
  }

  @Override
  public void processEndHover(int x, int y) {
  }

  @Override
  public void processHoverDeactivate(int x, int y) {
  }

  @Override
  public void removeAllEffects() {
  }

  @Override
  public <T extends EffectImpl> List<Effect> getEffects(Class<T> requestedClass) {
    return null;
  }
}


text:
package org.study.springboot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.study.springboot.entity.QLScript;
import org.study.springboot.mapper.QLScriptMapper;

@Controller
@RequestMapping("/page")
public class PageTestController {

    @Autowired
    private QLScriptMapper qlScriptMapper;

    @GetMapping("/00")
    public String freemarker() {
        QLScript qlScript = qlScriptMapper.getByName("org.cleverframe.core.dao.ConfigDao.findByPage");

        qlScript = qlScriptMapper.selectByPrimaryKey(1L);
//        qlScriptMapper.selectOne()
        return "index";
    }
}


text:
#if !defined(AFX_DOCKABLEBrowser_H__715A43B1_2677_11D2_AEFD_00A0C9B71DC4__INCLUDED_)
#define AFX_DOCKABLEBrowser_H__715A43B1_2677_11D2_AEFD_00A0C9B71DC4__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// DockableBrowser.h : header file
//

#include <afxtempl.h>

#include "sash.h"
#ifndef __PROJECTTREE__
   #define __PROJECTTREE__
   #include "projecttree.h"
#endif

#ifndef __CATEGORIESCOMBO__
   #define __CATEGORIESCOMBO__
   #include "categoriescombo.h"
#endif

#ifndef __QUERIESCOMBO__
   #define __QUERIESCOMBO__
   #include "queriescombo.h"
#endif

#ifndef __GROUPSCOMBO__
   #define __GROUPSCOMBO__
   #include "groupscombo.h"
#endif

#ifndef __DATASOURCE_H
   #define __DATASOURCE_H
   #include "datasource.h"
#endif

#ifndef __QUERYRESULTS_H
   #define __QUERYRESULTS_H
   #include "queryresults.h"
#endif

#include "CMCommand.h"

#define DOCK_LEFT   0
#define DOCK_RIGHT  1
#define DOCK_TOP    2
#define DOCK_BOTTOM 3
#define DOCK_FLOAT  4
/////////////////////////////////////////////////////////////////////////////
// CDockableBrowser window

//----------------------------------------------------------------------------------------
// This class designed to represent query results on the client. We will use it to
// support history and history buttons.
//----------------------------------------------------------------------------------------
class CHistoryEntry {
public:
	int    m_Mode;		    // Current browser mode;

	CString m_ServerVariable;   // Contains the server variable name in wich results
				    // are stored.
	CString m_ProjectName;	    // The project value for this results;
	CString m_CategoryName;     // The category value for this results
	CString m_QueryName;	    // The query name for this results
	CString m_GroupName;
	CString m_Command;

	CHistoryEntry& operator = (CHistoryEntry& other) {
		m_ServerVariable=other.m_ServerVariable;
		m_ProjectName=other.m_ProjectName;
		m_CategoryName=other.m_CategoryName;
		m_QueryName=other.m_QueryName;
		m_Command = other.m_Command;
		return *this;
	};
};
//----------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------
// This class designed to contain links between queries and command ID's. The browser
// contains the query map which will help to determine which query must be called when
// query popup menu item selected (this menu is build dynamically)
//----------------------------------------------------------------------------------------
class CMenuMapEntry {
public:
	int	m_ID;		   // command ID;
	CString m_Query;	   // Query string
	CMenuMapEntry& operator = (CMenuMapEntry& other) {
		m_ID=other.m_ID;
		m_Query=other.m_Query;
		return *this;
	};
};

//----------------------------------------------------------------------------------------

class CDockableBrowser : public CDialogBar
{
// Construction
public:
	CDockableBrowser();

// Attributes
public:
	BOOL m_OnSize;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDockableBrowser)
	//}}AFX_VIRTUAL

// Implementation
public:
	CString GetEditor();
	void SetEditor(CString& szName);
	CString GetCM();
	BOOL SetCM(CString& szName);
	void ViewFile(CString& params);
	void ViewTextFile(CString& filename);
	void PdfChanged();
	void BrowseGivenSet(CString& name, int col=0);
	CString ExecuteCommand(CString& command);
	BOOL SelectionHasKind(CString kind);
	void PositionSashBars(void);
	void CalculateFixedSize(void);
	void CalculateVariableSize(void);
	void LayoutControls(void);
	void UpdateSashes(BOOL initialize=FALSE);
	virtual ~CDockableBrowser();
	void OnEditorSetup();
	void CreateCMMenu(CMenu** pMenu);
	afx_msg void OnCMAction(int id);
	afx_msg void OnCMSetup();
	afx_msg void OnUpdateCMSetup(CCmdUI* pCmdUI);

	// Generated message map functions
protected:
	CSash m_BottomSash;
	CSash m_TopSash;
	CSash m_LeftSash;
	CSash m_RightSash;
	CSash m_ProjectDividerSash;
	CSash m_QueryDividerSash;

	int GetDockSide(void);
	//{{AFX_MSG(CDockableBrowser)
	afx_msg void OnSize(UINT nType, int cx, int cy);
    afx_msg void OnQueryModeChanged(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg LRESULT OnSashMoved(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnProjectSplitMoved(WPARAM wparam, LPARAM lparam);
    afx_msg LRESULT OnRefreshFileList(WPARAM wparam, LPARAM lparam);
	afx_msg void OnPaint();
    afx_msg void OnNodeChanged(LPCTSTR projectName);
    afx_msg void OnCMEvent(LPCTSTR lfile);
    afx_msg void IntegratorCtrlClick(LPCTSTR lfile, long line,long col, long size);
    afx_msg void IntegratorQuery(LPCTSTR lfile, long line,long col, long size);
    afx_msg void IntegratorDefinition(LPCTSTR lfile, long line,long col, long size);
    afx_msg void IntegratorActivate(void);
	afx_msg LRESULT OnServiceDisconnect(WPARAM wparam, LPARAM lparam);
    afx_msg void OnServiceChanged(void);
    afx_msg void OnServerNotification(LPCTSTR str);
	afx_msg void OnQueriesEnable(void);
    afx_msg void OnUpdateQueriesBtn(CCmdUI* pCmdUI);
    afx_msg void OnCategoryChanged(LPCTSTR categoriesList);
    afx_msg void OnQueryChanged(LPCTSTR queriesList);
    afx_msg void OnSelectionChanged(LPCTSTR pstrParams);
	afx_msg void OnElementDoubleclicked(LPCTSTR parmsList);
    afx_msg void OnRButtonEvent(short x,short y);
	afx_msg void PrevHistory(void);
	afx_msg void NextHistory(void);
    afx_msg void OnUpdatePrev(CCmdUI* pCmdUI);
    afx_msg void OnUpdateNext(CCmdUI* pCmdUI);
	afx_msg void OnUpdateFilter(CCmdUI* pCmdUI);
	afx_msg void OnSelectSort(void);
	afx_msg void OnSetAttributes(void);
	afx_msg void OnSetFilter(void);
	afx_msg void OnResetFilter(void);
    afx_msg void OnAddElements(void);
    afx_msg void OnSaveElements(void);
    afx_msg void OnGroupChanged(LPCSTR catList);
    afx_msg void OnGroupCreated(LPCSTR name);
    afx_msg void OnGroupRemoved(short amount);
    afx_msg void OnGroupInsSel(void);
    afx_msg void OnGroupDelSel(void);
	afx_msg void OnUpdateEditorSetup(CCmdUI* pCmdUI);
	DECLARE_EVENTSINK_MAP()
	//}}AFX_MSG
	afx_msg void OnClosure(void);
    afx_msg void OnUpdateClosure(CCmdUI* pCmdUI);
	afx_msg void OnShortNames(void);
    afx_msg void OnUpdateShortNames(CCmdUI* pCmdUI);
	afx_msg void OnMenuQuery(int id);
    afx_msg void SetBrowserVariable(void);
    LRESULT OnQuerySplitMoved(WPARAM wparam, LPARAM lparam);
    void OnFileDoubleclicked(LPCTSTR element);

	DECLARE_MESSAGE_MAP()
private:
	// CM Integration stuff
	CMenu* m_pCMMenu;
	CCMCommandsList* m_pCMCommands;
	CCMAttributes* m_pCMAttributes;

	BOOL m_Closure;
	CImageList m_ModeImages;
	CBitmap m_NextBmp;
	CBitmap m_PrevBmp;
	CBitmap m_SplitBmp;
	BOOL m_ResultWasEmpty;
	CString m_CurrentGroup;
	CString m_CurrentQuery;
	CString m_CurrentCategory;
	int m_CurrentMode;

	// History related members
	int				    m_InHistory;
	POSITION			    m_CurrentHistoryEntry;
	CList<CHistoryEntry,CHistoryEntry&> m_History;
	void SaveHistory(CString command = "");
    void ClearHistory(void);
	int m_VarIndex;

	// Menu map
	CList<CMenuMapEntry,CMenuMapEntry&> m_MenuMap;
	void MakeMenuMap();

	// Set information string as a filter button title
    void DisplayInfoString(void);

	// Kind list can be used to determine the kinds in the current selection
	CList<CString,CString&> m_KindList;
	void FillKindList(void);

	CString m_QueryRequest;
    void FormCategoryRequest(CString& categoriesList);
    void FormQueryRequest(CString& queriesList);
	CString m_CategoryRequest;
	CString m_CurrentProject;
	void SetSplitteredWindowsPos(void);
	int m_ProjectSplitterX;
	int m_QuerySplitterX;
	int m_DockSide;
	BOOL m_QueriesEnabled;
	BOOL m_Updated;

	// For executing CM commands
	void DoCMAction(CString &cmdKey, CStringList &filesList);
	void DoCMAction(CString &cmdKey, int argNum, CString *argVal);

	// Data access stuff
	CString DataSourceAccessSync(CDataSource* DataSource, BSTR* command);
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DOCKABLEBrowser_H__715A43B1_2677_11D2_AEFD_00A0C9B71DC4__INCLUDED_)


text:
namespace WpfAnalyzers.Test.WPF0030BackingFieldShouldBeStaticReadonlyTests;

using Gu.Roslyn.Asserts;
using NUnit.Framework;

public static class Valid
{
    private static readonly DependencyPropertyBackingFieldOrPropertyAnalyzer Analyzer = new();

    [Test]
    public static void DependencyProperty()
    {
        var code = @"
namespace N
{
    using System.Windows;
    using System.Windows.Controls;

    public class FooControl : Control
    {
        /// Identifies the <see cref=""Bar""/> dependency property.
        public static readonly DependencyProperty BarProperty = DependencyProperty.Register(
            ""Bar"", typeof(int), typeof(FooControl), new PropertyMetadata(default(int)));

        public int Bar
        {
            get { return (int)GetValue(BarProperty); }
            set { SetValue(BarProperty, value); }
        }
    }
}";

        RoslynAssert.Valid(Analyzer, code);
    }

    [Test]
    public static void DependencyPropertyFullyQualified()
    {
        var code = @"
namespace N
{
    public class FooControl : System.Windows.Controls.Control
    {
        /// Identifies the <see cref=""Bar""/> dependency property.
        public static readonly System.Windows.DependencyProperty BarProperty = System.Windows.DependencyProperty.Register(
            ""Bar"", typeof(int), typeof(FooControl), new System.Windows.PropertyMetadata(default(int)));

        public int Bar
        {
            get { return (int)GetValue(BarProperty); }
            set { SetValue(BarProperty, value); }
        }
    }
}";

        RoslynAssert.Valid(Analyzer, code);
    }

    [TestCase("FooControl")]
    [TestCase("FooControl<T>")]
    public static void DependencyPropertyAddOwner(string typeName)
    {
        var fooCode = @"
namespace N
{
    using System.Windows;

    public static class Foo
    {
        /// Identifies the <see cref=""Bar""/> dependency property.
        public static readonly DependencyProperty BarProperty = DependencyProperty.RegisterAttached(
            ""Bar"",
            typeof(int),
            typeof(Foo),
            new PropertyMetadata(default(int)));

        public static void SetBar(DependencyObject element, int value)
        {
            element.SetValue(BarProperty, value);
        }

        [AttachedPropertyBrowsableForChildren(IncludeDescendants = false)]
        [AttachedPropertyBrowsableForType(typeof(DependencyObject))]
        public static int GetBar(DependencyObject element)
        {
            return (int)element.GetValue(BarProperty);
        }
    }
}";

        var code = @"
namespace N
{
    using System.Windows;
    using System.Windows.Controls;

    public class FooControl : Control
    {
        /// Identifies the <see cref=""Bar""/> dependency property.
        public static readonly DependencyProperty BarProperty = Foo.BarProperty.AddOwner(typeof(FooControl));

        public double Bar
        {
            get { return (double)this.GetValue(BarProperty); }
            set { this.SetValue(BarProperty, value); }
        }
    }
}".AssertReplace("FooControl", typeName);

        RoslynAssert.Valid(Analyzer, fooCode, code);
    }

    [Test]
    public static void ReadOnlyDependencyProperty()
    {
        var code = @"
namespace N
{
    using System.Windows;
    using System.Windows.Controls;

    public class FooControl : Control
    {
        private static readonly DependencyPropertyKey BarPropertyKey = DependencyProperty.RegisterReadOnly(
            ""Bar"",
            typeof(int),
            typeof(FooControl),
            new PropertyMetadata(default(int)));

        /// Identifies the <see cref=""Bar""/> dependency property.
        public static readonly DependencyProperty BarProperty = BarPropertyKey.DependencyProperty;

        public int Bar
        {
            get { return (int)GetValue(BarProperty); }
            set { SetValue(BarPropertyKey, value); }
        }
    }
}";

        RoslynAssert.Valid(Analyzer, code);
    }

    [Test]
    public static void DependencyPropertyRegisterAttached()
    {
        var code = @"
namespace N
{
    using System.Windows;

    public static class Foo
    {
        private static readonly DependencyPropertyKey BarPropertyKey = DependencyProperty.RegisterAttachedReadOnly(
            ""Bar"",
            typeof(int),
            typeof(Foo),
            new PropertyMetadata(default(int)));

        public static readonly DependencyProperty BarProperty = BarPropertyKey.DependencyProperty;

        public static void SetBar(DependencyObject element, int value)
        {
            element.SetValue(BarPropertyKey, value);
        }

        public static int GetBar(DependencyObject element)
        {
            return (int)element.GetValue(BarProperty);
        }
    }
}";
        RoslynAssert.Valid(Analyzer, code);
    }
}


text:
namespace bond
{
namespace detail
{

template <typename Reader>
auto ReadBlob(Reader& reader)
#if defined(_MSC_VER) && _MSC_VER < 1900
    -> typename std::remove_reference<typename Reader::Buffer>::type::range_type
#elif defined(BOND_NO_CXX14_RETURN_TYPE_DEDUCTION)
    -> decltype(GetBufferRange(GetCurrentBuffer(reader.GetBuffer()), GetCurrentBuffer(reader.GetBuffer())))
#endif
{
    uint32_t size;
    reader.Read(size);

    auto before = GetCurrentBuffer(reader.GetBuffer());
    reader.GetBuffer().Skip(size);
    auto after = GetCurrentBuffer(reader.GetBuffer());

    return GetBufferRange(before, after);
}

template <typename Protocols, typename T, typename Writer>
void MarshalToBlob(const T& obj, Writer& writer)
{
    auto output = CreateOutputBuffer(writer.GetBuffer());
    CompactBinaryWriter<decltype(output)> cbw(output);

    Marshal<Protocols>(obj, cbw);
    auto data = std::move(output).GetBuffer();

    writer.Write(static_cast<uint32_t>(data.size()));
    writer.GetBuffer().Write(data);
}

} // namespace detail
} // namespace bond


text:
@extends('liddleforum::layout')

@section('liddleforum_content_inner')

    @include('liddleforum::admin.partials.tabs')

Admins

Manage your admins here. Note that if you create other admin accounts, they can remove you as an admin

    @include('liddleforum::flashed.form_errors')

Admins

                        User ID
                        Name
                        Actions

                    @foreach($admins as $admin)

                            {{ $admin->user->getKey() }}
                            {{ $admin->user->{config('liddleforum.user.name_column')} }}

                                @if(\Auth::user()->getKey() !== $admin->user_id)
                                    <form method="POST" action="{{ route('liddleforum.admin.admins.delete', ['id' => $admin->id]) }}">
                                        {!! csrf_field() !!}
                                        {!! method_field('DELETE') !!}
                                        <button class="btn btn-danger btn-sm">Remove</button>
                                    </form>
                                @endif

                    @endforeach

                    <form method="POST" action="{{ route('liddleforum.admin.admins.create') }}">
                        {!! csrf_field() !!}

                            User ID
                            <input type="text" class="form-control" id="user_id" name="user_id" placeholder="User ID" value="{{ old('user_id', Request::get('user_id')) }}" />

                        <button class="btn btn-sm btn-success">Add Admin</button>
                    </form>

@endsection


text:
mello mongodb
=====