text:
var pd_dfp = new function(){
	this.globals = {};
	this.ads = {};
	this.ord = Math.floor(Math.random()*10e12);
	this.tile = 0;
	this.gtags = [];
	this.async = false;
	this.init = function(){
		if (this.async)
			googletag.cmd.push(this.dfp_init());
		else
			this.dfp_init();
	};
	this.merge_globals = function(params){ // merge widget params with global params
		var ad = JSON.parse(JSON.stringify(this.globals)); // clone globals object (instead of creating a reference)
		for (var key in params){
			if (key == 'keyvalues') // append keyvalues
				ad[key] = (ad[key] + ';' + params[key] + ';').replace(/;+/g, ';');
			else if (params[key] !== '') // overwrite if not empty
				ad[key] = params[key];
		}
		return ad;
	};
	this.dfp_init = function(){ // will initialize dfp ad slots
		tile = 0;
		for (var ad_id in this.ads){
			if (this.is_valid_size(this.ads[ad_id]['min_width'], this.ads[ad_id]['max_width'])){ // ad min and max widths are within screen size
				tile++; // only count tile numbers for ads that will be shown
				if (this.ads[ad_id]['system'] == 'dfp'){
					ad = this.merge_globals(this.ads[ad_id]);

					ad['network_id'] = '7010'; // hardcode network and site id for mobile
					ad['site_id'] = 'ws.m';
					if (ad['zone'] == '')
						var ad_unit = ('/' + ad['network_id'] + '/' + ad['site_id'] + '/' + ad['category'] + '/' + ad['subcategories'].replace(/,/gi, '/') + '/' + ad['page']).replace(/\/+/gi,'/');
					else // zone override
						var ad_unit = ('/' + ad['network_id'] + '/' + ad['site_id'] + '/' + ad['zone']).replace(/\/+/gi,'/');

					var size = [];
					var sizes = ad['size'].split(',');
					for (var i = 0; i < sizes.length; i++){
						pair = sizes[i].split('x');
						size.push([parseInt(pair[0]) || 0, parseInt(pair[1]) || 0]);
					}
					var gtag = googletag.defineSlot(ad_unit, size, ad_id);
					gtag.addService(googletag.pubads());
					var locs = ad['location'].split(',');
					for (var i = 0; i < locs.length; i++)
						gtag.setTargeting('loc', locs[i]);

					if (ad['category'] == '') // if no category, then assign to index
						ad['category'] = 'index';
					gtag.setTargeting('cnt', ad['category']);
					gtag.setTargeting('ck', ad['category']);

					var scks = ad['subcategories'].split(',');
					for (var i = 0; i < scks.length; i++)
						if (scks[i] != '')
							gtag.setTargeting('sck', scks[i]);

					gtag.setTargeting('imp', (ad['subcategories'] != '' ? ad['subcategories'].split(',')[0] : ad['category'])); // use first sck if possible

					if (ad['page'] != '')
						gtag.setTargeting('page', ad['page']);

					var tags = ad['tags'].split(',');
					for (var i = 0; i < tags.length; i++)
						if (tags[i] != '')
							gtag.setTargeting('tag', tags[i]);

					if (ad['aid'] != '')
						gtag.setTargeting('aid', ad['aid']);

					if (ad['author'] != '')
						gtag.setTargeting('author', ad['author']);

					if (ad['blog'] != '')
						gtag.setTargeting('blog', ad['blog']);

					var kv_arr = ad['keyvalues'].split(';');
					for (var i = 0; i < kv_arr.length; i++){
						if (kv_arr[i].indexOf('=') !== -1){ // kv pair found
							pair = kv_arr[i].split('=');
							gtag.setTargeting(pair[0], pair[1]);
						}
					}

					if (this.tile == 1)
						gtag.setTargeting('dcopt', 'ist');

					gtag.setTargeting('tile', tile);
					gtag.setTargeting('ord', this.ord);

					this.gtags.push(gtag);
				}
			}
		}
		if (this.gtags.length > 0){ // dfp googletags have been defined
			googletag.pubads().enableSingleRequest();
			if (!this.async)
				googletag.pubads().enableSyncRendering();
			googletag.enableServices();
		}
	};
	this.dart_url = function(params){ // will return a dart url
		var ad = this.merge_globals(params);

		var dart = [];
		if (ad['zone'] == '')
			dart.push(ad['network_id'] + '/' + ad['type'] + '/' + ad['site_id'] + '/' + ad['category'] + '/' + ad['subcategories'].replace(/,/gi, '/') + '/' + ad['page']);
		else // zone override
			dart.push(ad['network_id'] + '/' + ad['type'] + '/' + ad['zone']);
		if (ad['category'] == '') // if no category, then assign to index
			ad['category'] = 'index';
		dart.push('loc=' + ad['location'].replace(/,/gi, ';loc='));
		dart.push('sz=' + ad['size']);
		dart.push('cnt=' + ad['category']);
		dart.push('ck=' + ad['category']);
		dart.push('sck=' + ad['subcategories'].replace(/,/gi, ';sck='));
		dart.push('imp=' + (ad['subcategories'] != '' ? ad['subcategories'].split(',')[0] : ad['category']));
		dart.push('page=' + ad['page']);
		dart.push('tag=' + ad['tags'].replace(/,/gi, ';tag='));
		dart.push('aid=' + ad['aid']);
		dart.push('author=' + ad['author']);
		dart.push('blog=' + ad['blog']);
		dart.push(ad['keyvalues']);
		dart.push(this.tile == 1 ? 'dcopt=ist' : '');
		dart.push('tile=' + this.tile);
		dart.push('ord=' + this.ord + '?');
		var url = 'http://ad.ca.doubleclick.net/' + dart.join(';').replace(/\/+/gi,'/'); // remove repeating slashes
		return url.replace(/;+/ig, ';').replace(/[^;]*=;/ig, ''); // remove repeating semicolons, remove empty values
	};
	this.writescript = function(url){
		document.write( '<scr' + 'ipt src="' + url + '"></scr' + 'ipt>' );
	};
	this.dart_display = function(ad_id){
		this.writescript(this.dart_url(this.ads[ad_id]));
	};
	this.google_display = function(ad_id){
		if (this.async)
			googletag.cmd.push(googletag.display(ad_id));
		else
			googletag.display(ad_id);
	}
	this.is_valid_size = function(min_width, max_width){
		min_width = parseInt(min_width) || 0;
		max_width = parseInt(max_width) || 0;
		window_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || screen.width || 0;
		if (window_width >= min_width && (window_width <= max_width || max_width == 0))
			return true;
		else
			return false;
	};
	this.display = function(ad_id){
		if (ad_id in this.ads){ // ad id is defined in global var
			if (this.is_valid_size(this.ads[ad_id]['min_width'], this.ads[ad_id]['max_width'])){ // ad min and max widths are within screen size
				this.tile++;
				if (this.ads[ad_id]['system'] == 'dfp')
					this.google_display(ad_id);
				else
					this.dart_display(ad_id);
			}
		}
	};
	this.querystring = function(name){
		var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
		return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
	};
};
pd_dfp.globals = pd_dfp_local_globals;
pd_dfp.ads = pd_dfp_local_ads;
pd_dfp.init();


text:
<?php

namespace AppBundle\Form\Type\Field\State;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

use Symfony\Component\Form\Extension\Core\Type\TextType;

final class RequiredType extends AbstractType
{
    /**
     * @return string
     */
    public function getBlockPrefix()
    {
        return 'app_field_state_required';
    }

    /**
     * @param OptionsResolver $resolver
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'csui_group' => 'two'
        ]);
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('assigned', TextType::class, [ 'csui_field' => 'required' ]);
        $builder->add('guessed', TextType::class, [ 'required' => true ]);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.ops5.push.core.TestCase;

import org.ops5.push.core.ObjectPair;

public class FloatRegTestCases2 extends TestCaseGenerator
{

  private static int _testCaseCount = 200;
  private float[] _testCasesX = null;
  private float[] _testCasesY = null;

  private static float _firstSample = -3;
  private static float _lastSample = 3;

  @Override
  public int TestCaseCount()
  {
    return _testCaseCount;
  }

  @Override
  public ObjectPair TestCase(int inIndex)
  {
    if (_testCasesX == null)
    {
      _testCasesX = new float[_testCaseCount];
      _testCasesY = new float[_testCaseCount];

      for (int i = 0; i < _testCaseCount; i++)
      {
        _testCasesX[i] = XValue(i);
        _testCasesY[i] = TestCaseFunction(_testCasesX[i]);
      }
    }

    return new ObjectPair(_testCasesX[inIndex], _testCasesY[inIndex]);
  }

  private float XValue(float i)
  {
    return (float) _firstSample + (((_lastSample - _firstSample) / (_testCaseCount - 1)) * i);
  }

  private float TestCaseFunction(float x)
  {
    return (float) (Math.exp(Math.abs(x)) * Math.sin(2.0 * Math.PI * x));
  }
}


text:
<!doctype html>

  <meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1, user-scalable=0">
  <meta charset="utf-8">

  <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">

  <title>BackendUI login page</title>
  <link href="../assets/css/bootstrap.css" rel="stylesheet">
  <link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">

          BackendUI

                        登录

                        <form class="separate-sections" action="/">

                                <input type="text" placeholder="username">

                                <input type="password" placeholder="password">

                                <input type="text" class="span2" placeholder="请输入验证码">
                                 换一张

                                强悍的四核之王! 搭载高通骁龙600

                                <button type="submit" class="btn btn-blue btn-block">登录 </button>

                        </form>

                            还没有帐号?立即注册


text:
// SPDX-License-Identifier: Apache-2.0

#include "ODWriterHelper.h"

#include "BitMatrix.h"

#include <algorithm>

namespace ZXing::OneD {

/**
* @return a byte array of horizontal pixels (0 = white, 1 = black)
*/
BitMatrix
WriterHelper::RenderResult(const std::vector<bool>& code, int width, int height, int sidesMargin)
{
	int inputWidth = Size(code);
	// Add quiet zone on both sides.
	int fullWidth = inputWidth + sidesMargin;
	int outputWidth = std::max(width, fullWidth);
	int outputHeight = std::max(1, height);

	int multiple = outputWidth / fullWidth;
	int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;

	BitMatrix result(outputWidth, outputHeight);
	for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
		if (code[inputX]) {
			result.setRegion(outputX, 0, multiple, outputHeight);
		}
	}
	return result;
}

/**
* @param target encode black/white pattern into this array
* @param pos position to start encoding at in {@code target}
* @param pattern lengths of black/white runs to encode
* @param startColor starting color - false for white, true for black
* @return the number of elements added to target.
*/
int
WriterHelper::AppendPattern(std::vector<bool>& target, int pos, const int* pattern, size_t patternCount, bool startColor)
{
	bool color = startColor;
	int numAdded = 0;
	for (size_t i = 0; i < patternCount; ++i) {
		int s = pattern[i];
		for (int j = 0; j < s; j++) {
			target[pos++] = color;
		}
		numAdded += s;
		color = !color; // flip color after each segment
	}
	return numAdded;
}

} // namespace ZXing::OneD


text:
import math
import operator

import netaddr
from neutron_lib import constants
from neutron_lib.db import api as db_api
from neutron_lib import exceptions
from oslo_db import exception as db_exc
from oslo_utils import uuidutils

from neutron._i18n import _
from neutron.db import models_v2
from neutron.ipam import driver
from neutron.ipam import exceptions as ipam_exc
from neutron.ipam import requests as ipam_req
from neutron.ipam import utils as ipam_utils

class SubnetAllocator(driver.Pool):
    """Class for handling allocation of subnet prefixes from a subnet pool.

       This class leverages the pluggable IPAM interface where possible to
       make merging into IPAM framework easier in future cycles.
    """

    def __init__(self, subnetpool, context):
        super(SubnetAllocator, self).__init__(subnetpool, context)
        self._sp_helper = SubnetPoolHelper()

    def _lock_subnetpool(self):
        """Lock subnetpool associated row.

        This method disallows to allocate concurrently 2 subnets in the same
        subnetpool, it's required to ensure non-overlapping cidrs in the same
        subnetpool.
        """
        with db_api.CONTEXT_READER.using(self._context):
            current_hash = (
                self._context.session.query(models_v2.SubnetPool.hash)
                .filter_by(id=self._subnetpool['id']).scalar())
        if current_hash is None:
            # NOTE(cbrandily): subnetpool has been deleted
            raise exceptions.SubnetPoolNotFound(
                subnetpool_id=self._subnetpool['id'])
        new_hash = uuidutils.generate_uuid()

        # NOTE(cbrandily): the update disallows 2 concurrent subnet allocation
        # to succeed: at most 1 transaction will succeed, others will be
        # rolled back and be caught in neutron.db.v2.base
        with db_api.CONTEXT_WRITER.using(self._context):
            query = (
                self._context.session.query(models_v2.SubnetPool).filter_by(
                    id=self._subnetpool['id'], hash=current_hash))

            count = query.update({'hash': new_hash})
        if not count:
            raise db_exc.RetryRequest(exceptions.SubnetPoolInUse(
                subnet_pool_id=self._subnetpool['id']))

    def _get_allocated_cidrs(self):
        with db_api.CONTEXT_READER.using(self._context):
            query = self._context.session.query(models_v2.Subnet.cidr)
            subnets = query.filter_by(subnetpool_id=self._subnetpool['id'])
            return (x.cidr for x in subnets)

    def _get_available_prefix_list(self):
        prefixes = (x.cidr for x in self._subnetpool.prefixes)
        allocations = self._get_allocated_cidrs()
        prefix_set = netaddr.IPSet(iterable=prefixes)
        allocation_set = netaddr.IPSet(iterable=allocations)
        available_set = prefix_set.difference(allocation_set)
        available_set.compact()
        return sorted(available_set.iter_cidrs(),
                      key=operator.attrgetter('prefixlen'),
                      reverse=True)

    def _num_quota_units_in_prefixlen(self, prefixlen, quota_unit):
        return math.pow(2, quota_unit - prefixlen)

    def _allocations_used_by_tenant(self, quota_unit):
        subnetpool_id = self._subnetpool['id']
        tenant_id = self._subnetpool['tenant_id']
        with db_api.CONTEXT_READER.using(self._context):
            qry = self._context.session.query(models_v2.Subnet.cidr)
            allocations = qry.filter_by(subnetpool_id=subnetpool_id,
                                        tenant_id=tenant_id)
            value = 0
            for allocation in allocations:
                prefixlen = netaddr.IPNetwork(allocation.cidr).prefixlen
                value += self._num_quota_units_in_prefixlen(prefixlen,
                                                            quota_unit)
            return value

    def _check_subnetpool_tenant_quota(self, tenant_id, prefixlen):
        quota_unit = self._sp_helper.ip_version_subnetpool_quota_unit(
            self._subnetpool['ip_version'])
        quota = self._subnetpool.get('default_quota')

        if quota:
            used = self._allocations_used_by_tenant(quota_unit)
            requested_units = self._num_quota_units_in_prefixlen(prefixlen,
                                                                 quota_unit)

            if used + requested_units > quota:
                raise exceptions.SubnetPoolQuotaExceeded()

    def _allocate_any_subnet(self, request):
        with db_api.CONTEXT_WRITER.using(self._context):
            self._lock_subnetpool()
            self._check_subnetpool_tenant_quota(request.tenant_id,
                                                request.prefixlen)
            prefix_pool = self._get_available_prefix_list()
            for prefix in prefix_pool:
                if request.prefixlen >= prefix.prefixlen:
                    subnet = next(prefix.subnet(request.prefixlen))
                    gateway_ip = request.gateway_ip
                    if not gateway_ip:
                        gateway_ip = subnet.network + 1
                    pools = ipam_utils.generate_pools(subnet.cidr,
                                                      gateway_ip)

                    return IpamSubnet(request.tenant_id,
                                      request.subnet_id,
                                      subnet.cidr,
                                      gateway_ip=gateway_ip,
                                      allocation_pools=pools)
            msg = _("Insufficient prefix space to allocate subnet size /%s")
            raise exceptions.SubnetAllocationError(
                reason=msg % str(request.prefixlen))

    def _allocate_specific_subnet(self, request):
        with db_api.CONTEXT_WRITER.using(self._context):
            self._lock_subnetpool()
            self._check_subnetpool_tenant_quota(request.tenant_id,
                                                request.prefixlen)
            cidr = request.subnet_cidr
            available = self._get_available_prefix_list()
            matched = netaddr.all_matching_cidrs(cidr, available)
            if len(matched) == 1 and matched[0].prefixlen <= cidr.prefixlen:
                return IpamSubnet(request.tenant_id,
                                  request.subnet_id,
                                  cidr,
                                  gateway_ip=request.gateway_ip,
                                  allocation_pools=request.allocation_pools)
            msg = _("Cannot allocate requested subnet from the available "
                    "set of prefixes")
            raise exceptions.SubnetAllocationError(reason=msg)

    def allocate_subnet(self, request):
        max_prefixlen = int(self._subnetpool['max_prefixlen'])
        min_prefixlen = int(self._subnetpool['min_prefixlen'])
        if request.prefixlen > max_prefixlen:
            raise exceptions.MaxPrefixSubnetAllocationError(
                prefixlen=request.prefixlen,
                max_prefixlen=max_prefixlen)
        if request.prefixlen < min_prefixlen:
            raise exceptions.MinPrefixSubnetAllocationError(
                prefixlen=request.prefixlen,
                min_prefixlen=min_prefixlen)

        if isinstance(request, ipam_req.AnySubnetRequest):
            return self._allocate_any_subnet(request)
        elif isinstance(request, ipam_req.SpecificSubnetRequest):
            return self._allocate_specific_subnet(request)
        else:
            msg = _("Unsupported request type")
            raise exceptions.SubnetAllocationError(reason=msg)

    def get_subnet(self, subnet_id):
        raise NotImplementedError()

    def update_subnet(self, request):
        raise NotImplementedError()

    def remove_subnet(self, subnet_id):
        raise NotImplementedError()

    def get_allocator(self, subnet_ids):
        return IpamSubnetGroup(self, subnet_ids)

class IpamSubnet(driver.Subnet):

    def __init__(self,
                 tenant_id,
                 subnet_id,
                 cidr,
                 gateway_ip=None,
                 allocation_pools=None):
        self._req = ipam_req.SpecificSubnetRequest(
            tenant_id,
            subnet_id,
            cidr,
            gateway_ip=gateway_ip,
            allocation_pools=allocation_pools)

    def allocate(self, address_request):
        raise NotImplementedError()

    def deallocate(self, address):
        raise NotImplementedError()

    def get_details(self):
        return self._req

class IpamSubnetGroup(driver.SubnetGroup):
    def __init__(self, driver, subnet_ids):
        self._driver = driver
        self._subnet_ids = subnet_ids

    def allocate(self, address_request):
        '''Originally, the Neutron pluggable IPAM backend would ask the driver
           to try to allocate an IP from each subnet in turn, one by one.  This
           implementation preserves that behavior so that existing drivers work
           as they did before while giving them the opportunity to optimize it
           by overriding the implementation.
        '''
        for subnet_id in self._subnet_ids:
            try:
                ipam_subnet = self._driver.get_subnet(subnet_id)
                return ipam_subnet.allocate(address_request), subnet_id
            except ipam_exc.IpAddressGenerationFailure:
                continue
        raise ipam_exc.IpAddressGenerationFailureAllSubnets()

class SubnetPoolReader(object):
    '''Class to assist with reading a subnetpool, loading defaults, and
       inferring IP version from prefix list. Provides a common way of
       reading a stored model or a create request with default table
       attributes.
    '''
    MIN_PREFIX_TYPE = 'min'
    MAX_PREFIX_TYPE = 'max'
    DEFAULT_PREFIX_TYPE = 'default'

    _sp_helper = None

    def __init__(self, subnetpool):
        self._read_prefix_info(subnetpool)
        self._sp_helper = SubnetPoolHelper()
        self._read_id(subnetpool)
        self._read_prefix_bounds(subnetpool)
        self._read_attrs(subnetpool,
                         ['tenant_id', 'name', 'is_default', 'shared'])
        self.description = subnetpool.get('description')
        self._read_address_scope(subnetpool)
        self.subnetpool = {'id': self.id,
                           'name': self.name,
                           'project_id': self.tenant_id,
                           'prefixes': self.prefixes,
                           'min_prefix': self.min_prefix,
                           'min_prefixlen': self.min_prefixlen,
                           'max_prefix': self.max_prefix,
                           'max_prefixlen': self.max_prefixlen,
                           'default_prefix': self.default_prefix,
                           'default_prefixlen': self.default_prefixlen,
                           'default_quota': self.default_quota,
                           'address_scope_id': self.address_scope_id,
                           'is_default': self.is_default,
                           'shared': self.shared,
                           'description': self.description}

    def _read_attrs(self, subnetpool, keys):
        for key in keys:
            setattr(self, key, subnetpool[key])

    def _ip_version_from_cidr(self, cidr):
        return netaddr.IPNetwork(cidr).version

    def _prefixlen_from_cidr(self, cidr):
        return netaddr.IPNetwork(cidr).prefixlen

    def _read_id(self, subnetpool):
        id = subnetpool.get('id', constants.ATTR_NOT_SPECIFIED)
        if id is constants.ATTR_NOT_SPECIFIED:
            id = uuidutils.generate_uuid()
        self.id = id

    def _read_prefix_bounds(self, subnetpool):
        ip_version = self.ip_version
        default_min = self._sp_helper.default_min_prefixlen(ip_version)
        default_max = self._sp_helper.default_max_prefixlen(ip_version)

        self._read_prefix_bound(self.MIN_PREFIX_TYPE,
                                subnetpool,
                                default_min)
        self._read_prefix_bound(self.MAX_PREFIX_TYPE,
                                subnetpool,
                                default_max)
        self._read_prefix_bound(self.DEFAULT_PREFIX_TYPE,
                                subnetpool,
                                self.min_prefixlen)

        self._sp_helper.validate_min_prefixlen(self.min_prefixlen,
                                               self.max_prefixlen)
        self._sp_helper.validate_max_prefixlen(self.max_prefixlen,
                                               ip_version)
        self._sp_helper.validate_default_prefixlen(self.min_prefixlen,
                                                   self.max_prefixlen,
                                                   self.default_prefixlen)

    def _read_prefix_bound(self, type, subnetpool, default_bound=None):
        prefixlen_attr = type + '_prefixlen'
        prefix_attr = type + '_prefix'
        prefixlen = subnetpool.get(prefixlen_attr,
                                   constants.ATTR_NOT_SPECIFIED)
        wildcard = self._sp_helper.wildcard(self.ip_version)

        if prefixlen is constants.ATTR_NOT_SPECIFIED and default_bound:
            prefixlen = default_bound

        if prefixlen is not constants.ATTR_NOT_SPECIFIED:
            prefix_cidr = '/'.join((wildcard,
                                    str(prefixlen)))
            setattr(self, prefix_attr, prefix_cidr)
            setattr(self, prefixlen_attr, prefixlen)

    def _read_prefix_info(self, subnetpool):
        prefix_list = subnetpool['prefixes']
        if not prefix_list:
            raise exceptions.EmptySubnetPoolPrefixList()

        ip_version = None
        for prefix in prefix_list:
            if not ip_version:
                ip_version = netaddr.IPNetwork(prefix).version
            elif netaddr.IPNetwork(prefix).version != ip_version:
                raise exceptions.PrefixVersionMismatch()
        self.default_quota = subnetpool.get('default_quota')

        if self.default_quota is constants.ATTR_NOT_SPECIFIED:
            self.default_quota = None

        self.ip_version = ip_version
        self.prefixes = self._compact_subnetpool_prefix_list(prefix_list)

    def _read_address_scope(self, subnetpool):
        address_scope_id = subnetpool.get('address_scope_id',
                                          constants.ATTR_NOT_SPECIFIED)
        if address_scope_id is constants.ATTR_NOT_SPECIFIED:
            address_scope_id = None
        self.address_scope_id = address_scope_id

    def _compact_subnetpool_prefix_list(self, prefix_list):
        """Compact any overlapping prefixes in prefix_list and return the
           result
        """
        ip_set = netaddr.IPSet()
        for prefix in prefix_list:
            ip_set.add(netaddr.IPNetwork(prefix))
        ip_set.compact()
        return [x.cidr for x in ip_set.iter_cidrs()]

class SubnetPoolHelper(object):

    _PREFIX_VERSION_INFO = {4: {'max_prefixlen': constants.IPv4_BITS,
                                'wildcard': '0.0.0.0',
                                'default_min_prefixlen': 8,
                                # IPv4 quota measured in units of /32
                                'quota_units': 32},
                            6: {'max_prefixlen': constants.IPv6_BITS,
                                'wildcard': '::',
                                'default_min_prefixlen': 64,
                                # IPv6 quota measured in units of /64
                                'quota_units': 64}}

    def validate_min_prefixlen(self, min_prefixlen, max_prefixlen):
        if min_prefixlen < 0:
            raise exceptions.UnsupportedMinSubnetPoolPrefix(
                prefix=min_prefixlen, version=4)
        if min_prefixlen > max_prefixlen:
            raise exceptions.IllegalSubnetPoolPrefixBounds(
                prefix_type='min_prefixlen',
                prefixlen=min_prefixlen,
                base_prefix_type='max_prefixlen',
                base_prefixlen=max_prefixlen)

    def validate_max_prefixlen(self, prefixlen, ip_version):
        max = self._PREFIX_VERSION_INFO[ip_version]['max_prefixlen']
        if prefixlen > max:
            raise exceptions.IllegalSubnetPoolPrefixBounds(
                prefix_type='max_prefixlen',
                prefixlen=prefixlen,
                base_prefix_type='ip_version_max',
                base_prefixlen=max)

    def validate_default_prefixlen(self,
                                   min_prefixlen,
                                   max_prefixlen,
                                   default_prefixlen):
        if default_prefixlen < min_prefixlen:
            raise exceptions.IllegalSubnetPoolPrefixBounds(
                prefix_type='default_prefixlen',
                prefixlen=default_prefixlen,
                base_prefix_type='min_prefixlen',
                base_prefixlen=min_prefixlen)
        if default_prefixlen > max_prefixlen:
            raise exceptions.IllegalSubnetPoolPrefixBounds(
                prefix_type='default_prefixlen',
                prefixlen=default_prefixlen,
                base_prefix_type='max_prefixlen',
                base_prefixlen=max_prefixlen)

    def wildcard(self, ip_version):
        return self._PREFIX_VERSION_INFO[ip_version]['wildcard']

    def default_max_prefixlen(self, ip_version):
        return self._PREFIX_VERSION_INFO[ip_version]['max_prefixlen']

    def default_min_prefixlen(self, ip_version):
        return self._PREFIX_VERSION_INFO[ip_version]['default_min_prefixlen']

    def ip_version_subnetpool_quota_unit(self, ip_version):
        return self._PREFIX_VERSION_INFO[ip_version]['quota_units']


text:
<?php
namespace Concrete\Core\Geolocator;

use Concrete\Core\Error\ErrorList\ErrorList;
use IPLib\Address\AddressInterface;
use Symfony\Component\HttpFoundation\ParameterBag;

interface GeolocatorControllerInterface
{
    /**
     * Does this geolocator library has a configuration form?
     *
     * @return bool
     */
    public function hasConfigurationForm();

    /**
     * Render the configuration form.
     */
    public function renderConfigurationForm();

    /**
     * Save the configuration form.
     *
     * @param array $configuration The initial geolocator configuration
     * @param ParameterBag $data The data received
     * @param ErrorList $error Add errors to this instance
     *
     * @return array The final geolocator configuration
     */
    public function saveConfigurationForm(array $configuration, ParameterBag $data, ErrorList $error);

    /**
     * Geolocate an IP address.
     *
     * @param AddressInterface $address
     *
     * @return GeolocationResult
     */
    public function geolocateIPAddress(AddressInterface $address);
}


text:
from __future__ import division
import os
import re
import gzip
import math
import time
import random
import argparse

from bs4 import BeautifulSoup

from config import mysql_config
from lib.base import color_term
from lib.base import execute_cmd
from lib.spider import AsyncSpider
from lib.database_connector import MysqlConnector

def stats_fastq(options='showoutput', level=range(10, 150, 10)):
    def open_fastq():
        if re.search('\.gz$', args.fastq.lower()):
            with gzip.GzipFile(args.fastq, 'rb') as f:
                for l in f:
                    yield l
        elif re.search('\.fastq$', args.fastq.lower()):
            with open(args.fastq, 'rb') as f:
                for l in f:
                    yield l
        else:
            raise Exception("Unknown file type: %s" % args.fastq)

    def output_rl():
        with open(rl_path, 'wb') as o_s:
            o_s.write("%s\t%s\n" % ("Total", total))
            for k, v in len_stats_sorted:
                o_s.write("%s\t%s\n" % (k, v))

    if not re.search('sampling', options):
        print color_term("<< stats FASTQ >>", 'cyan')
    len_stats = {}
    total = 0

    len_stats_level = dict(map(lambda x: (x, 0), level))
    step = level[1] - level[0]

    if re.search('sampling', options):
        short_seq = dict(map(lambda x: (x, []), level))
        range_start = int(args.sampling_range.split(',')[0])
        range_end = int(args.sampling_range.split(',')[1])
        sampling_seq = {}

    for i, line in enumerate(open_fastq()):
        line = line.strip()
        if i % 4 == 0:
            qname = line
        elif i % 4 == 1:
            if len(line) not in len_stats:
                len_stats[len(line)] = 1
            else:
                len_stats[len(line)] += 1
                if re.search('sampling', options):
                    if range_start <= len(line) < range_end:
                        for level in len_stats_level:
                            if level <= len(line) < level + step:
                                short_seq[level].append({'qname': qname, 'seq': line, 'len': len(line)})
            total += 1

    len_stats_sorted = sorted(len_stats.iteritems(), key=lambda d: d[0])
    for k, v in len_stats_sorted:
        for level in len_stats_level:
            if level <= k < level + step:
                len_stats_level[level] += v
                break

    if re.search('show', options):
        len_stats_level_sorted = sorted(len_stats_level.iteritems(), key=lambda d: d[0])
        print '------------------'
        print '\t'.join(['Total'] + [str(x[0]) for x in len_stats_level_sorted])
        print '\t'.join([str(total)] + [str(x[1]) for x in len_stats_level_sorted])
        print '------------------'

    if re.search('output', options):
        fastq_dir = os.path.dirname(args.fastq)
        fastq_fn = re.match('(.+)\.fastq(:?\.gz)$', os.path.basename(args.fastq), re.I).group(1)
        rl_path = os.path.join(fastq_dir, "%s.rl" % fastq_fn)
        print color_term("• output stats of reads length ..."),
        output_rl()
        print color_term("OK!", 'green')

    if re.search('sampling', options):
        for l in short_seq:
            if len(short_seq[l]) == 0:
                continue
            elif len(short_seq[l]) < args.sampling_freq**-1:
                sampling_seq[l] = (random.sample(short_seq[l], 1))
            else:
                sampling_seq[l] = (random.sample(short_seq[l], int(math.ceil(len(short_seq[l]) * args.sampling_freq))))
        return sampling_seq

def main():
    def output_fasta():
        print color_term("<< Output FASTA >>", 'cyan')
        print color_term("• sampling seq from FASTQ... Freq: %s Range: %s" % (args.sampling_freq, args.sampling_range))
        s_range = range(*[int(x) for x in args.sampling_range.split(',')])
        s_seq_sorted = sorted(stats_fastq(options='showsampling', level=s_range).iteritems(), key=lambda d: d[0])
        print color_term("OK!", 'green')

        print color_term("• output FASTA..."),
        with open(fasta_path, 'wb') as fa:
            for l in s_seq_sorted:
                for s in l[1]:
                    if not re.search('N', s['seq']):
                        fa.write(">[%s]-%s\n" % (l[0], s['qname']))
                        fa.write("%s\n\n" % s['seq'])
        print color_term("OK!", 'green')

    def blastn():
        print color_term("<< BLASTn >>", 'cyan')
        print color_term("• BLASTn with nt..."),
        start = time.time()
        execute_cmd("blastn -query %s -db nt -outfmt 7 -out %s" % (fasta_path, bls_path))
        print color_term("OK!", 'green')
        print '------------------'
        print color_term("Done in %d seconds' % (time.time() - start), 'green")

    def stats_bls():
        print color_term("<< stats blastn results >>", 'cyan')
        with open(bls_path, 'rb') as bls:
            for line in bls:
                line = line.strip()
                if re.match("# Query:", line):
                    qname = re.match("# Query: (.+)$", line).group(1)
                    query_seq.append({'qname': qname, 'match': []})
                elif re.match("#", line):
                    continue
                else:
                    bls_content = line.split('\t')
                    if float(bls_content[2]) == 100 and float(bls_content[11]) > 69 and bls_content[1] not in query_seq[-1]['match']:
                        query_seq[-1]['match'].append(bls_content[1])
        print color_term("Total Query: %d" % len(query_seq))
        nt_match = 0
        for q in query_seq:
            if len(q['match']) > 0:
                nt_match += 1
        print color_term("nt ident=100%% score>69 match: %d/%d - %s%%" % (nt_match, len(query_seq), round(nt_match / len(query_seq) * 100, 2)))

    def stats_report():
        def count_sn(q, s, d):
            if not d:
                d = {'seq': [], 'sn': {}}
            if q not in d['seq']:
                d['seq'].append(q)
                if s not in d['sn']:
                    d['sn'][s] = 0
                d['sn'][s] += 1
            return d

        def print_sn_stats(d):
            for x in sorted(d['sn'].iteritems(), key=lambda d: d[1], reverse=True):
                print "%s: %d - %s%%" % (x[0], x[1], round(x[1] / len(d['seq']) * 100, 2))

        print color_term("<< stats track report >>", 'cyan')
        sn_stats = {}
        sn_stats_level = {}
        with open(track_report_path, 'rb') as report:
            for i, line in enumerate(report):
                if i == 0:
                    continue
                line_cont = line.strip().split('\t')
                qname = line_cont[1]
                level = int(re.search('\[(.+?)\]', qname).group(1))
                division = line_cont[3]
                sn = line_cont[4]
                sn_stats = count_sn(qname, "[%s]%s" % (division, sn), sn_stats)
                if level not in sn_stats_level:
                    sn_stats_level[level] = {}
                sn_stats_level[level] = count_sn(qname, "[%s]%s" % (division, sn), sn_stats_level[level])
        print color_term("Total source:")
        print_sn_stats(sn_stats)
        for l in sorted(sn_stats_level.iteritems(), key=lambda d: d[0]):
            print '------------------'
            print color_term("%s source:" % l[0])
            print_sn_stats(l[1])

    def track_source():
        def query_esum(acc):
            caption = re.match('(.+?)\.', acc).group(1)
            cursor_ns = m_con.query("SELECT TaxId, Title FROM nuccore_summary "
                                    "WHERE Caption=%s ", [caption])
            if cursor_ns.rowcount == 1:
                (taxid, title) = cursor_ns.fetchone()
                cursor_t = m_con.query("SELECT ScientificName, Division FROM taxonomy "
                                       "WHERE TaxId=%s ", [taxid])
                (sn, division) = cursor_t.fetchone()
                if cursor_t.rowcount == 1:
                    return {'code': 2, 'taxid': taxid, 'title': title, 'sn': sn, 'division': division}
                elif cursor_t.rowcount == 0:
                    return {'code': 1, 'taxid': taxid, 'title': title, 'sn': None}
                else:
                    raise Exception("[QUERY_SCIENTIFIC_NAME] %d matches in taxonomy: %s" % (cursor_t.rowcount, taxid))
            elif cursor_ns.rowcount == 0:
                return {'code': 0, 'taxid': None, 'title': None, 'sn': None}
            else:
                raise Exception("[QUERY_TaxId] %d matches in nuccore_summary: %s" % (cursor_ns.rowcount, caption))

        def query_tax(taxid):
            cursor_t = m_con.query("SELECT ScientificName, Division FROM taxonomy "
                                   "WHERE TaxId=%s ", [taxid])
            if cursor_t.rowcount == 1:
                return 0
            elif cursor_t.rowcount == 0:
                return 1
            else:
                raise Exception("[QUERY_TAX] %d matches in taxonomy: %s" % (cursor_t.rowcount, taxid))

        def get_url():
            urls = []
            for s in query_seq:
                for a in s['match']:
                    r = query_esum(a)
                    if r['code'] == 2:
                        print color_term("PASS ", 'grey') + color_term("%s - [%s]%s" % (a, r['division'], r['sn']), 'green')
                    else:
                        if r['code'] == 0:
                            url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=nuccore&id=%s&retmode=xml" % a
                        elif r['code'] == 1:
                            url = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=taxonomy&id=%s&retmode=xml" % r['taxid']
                        if url not in urls:
                            urls.append(url)
            return urls

        def import_nuccore_sum(data):
            insert_g = ("INSERT INTO nuccore_summary "
                        "(Caption, ACC, Gi, Title, TaxId, Status, CreateDate, UpdateDate) "
                        "VALUES (%s, %s, %s, %s, %s, %s, %s, %s)")
            cursor_ns = m_con.query("SELECT id FROM nuccore_summary "
                                    "WHERE Caption=%s ", [data[0]])
            if cursor_ns.rowcount == 1:
                print color_term("[IMPORT_NUCCORE_SUM] Already got Caption: %s" % data[0], 'yellow')
            elif cursor_ns.rowcount == 0:
                m_con.insert(insert_g, data)
                print color_term("Inserted", 'green')
            else:
                raise Exception("[IMPORT_NUCCORE_SUM] %d matches in nuccore_summary: %s" % (cursor_ns.rowcount, data[0]))

        def import_taxonomy(data):
            insert_g = ("INSERT INTO taxonomy "
                        "(TaxId, Status, Rank, Division, ScientificName, CommonName, Genus, Species, ModDate) "
                        "VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)")
            cursor_t = m_con.query("SELECT id FROM taxonomy "
                                   "WHERE TaxId=%s ", [data[0]])
            if cursor_t.rowcount == 1:
                print color_term("[IMPORT_TAXONOMY] Already got TaxId: %s" % data[0], 'yellow')
            elif cursor_t.rowcount == 0:
                m_con.insert(insert_g, data)
                print color_term("Inserted", 'green')
            else:
                raise Exception("[IMPORT_TAXONOMY] %d matches in taxonomy: %s" % (cursor_t.rowcount, data[0]))

        class AsyncSpiderESum(AsyncSpider):
            def get_label(self, url):
                return re.search('&id=(.+?)&retmode', url).group(1)

            def handle_resp(self, resp, url, acc):
                soup = BeautifulSoup(resp.body, "xml")
                if re.search('db=nuccore', url):
                    nuc_sum_data = []
                    nuc_sum_data.append(str(soup.find(Name="Caption").string)) # Caption
                    nuc_sum_data.append(str(soup.find(Name="AccessionVersion").string)) # ACC
                    nuc_sum_data.append(int(soup.find(Name="Gi").string)) # Gi
                    nuc_sum_data.append(str(soup.find(Name="Title").string)) # Title
                    nuc_sum_data.append(int(soup.find(Name="TaxId").string)) # TaxId
                    nuc_sum_data.append(str(soup.find(Name="Status").string)) # Status
                    nuc_sum_data.append(str(soup.find(Name="CreateDate").string)) # CreateDate
                    nuc_sum_data.append(str(soup.find(Name="UpdateDate").string)) # UpdateDate
                    print "Caption: %s - Title: %s" % (nuc_sum_data[0], nuc_sum_data[3]),
                    import_nuccore_sum(nuc_sum_data)
                    url_t = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=taxonomy&id=%s&retmode=xml" % nuc_sum_data[4]
                    if query_tax(nuc_sum_data[4]):
                        if url_t not in self.unfetched:
                            print color_term("Put TaxId to queue: %s" % nuc_sum_data[4], 'yellow')
                            self.unfetched.append(url_t)
                            self.q.put(url_t)
                        else:
                            print color_term("TaxId: %s Already in unfetched" % nuc_sum_data[4], 'grey')
                    else:
                        print color_term("TaxId: %s Already in database" % nuc_sum_data[4], 'grey')
                elif re.search('db=taxonomy', url):
                    tax_data = []
                    tax_data.append(str(soup.find(Name="TaxId").string)) # TaxId
                    tax_data.append(str(soup.find(Name="Status").string)) # Status
                    tax_data.append(str(soup.find(Name="Rank").string)) # Rank
                    tax_data.append(str(soup.find(Name="Division").string)) # Division
                    tax_data.append(str(soup.find(Name="ScientificName").string)) # ScientificName
                    tax_data.append(str(soup.find(Name="CommonName").string)) # CommonName
                    tax_data.append(str(soup.find(Name="Genus").string)) # Genus
                    tax_data.append(str(soup.find(Name="Species").string)) # Species
                    tax_data.append(str(soup.find(Name="ModificationDate").string)) # ModDate
                    print "TaxId: %s - [%s]%s" % (acc, tax_data[3], tax_data[4]),
                    import_taxonomy(tax_data)

        def output_report():
            print color_term("• output track report..."),
            with open(track_report_path, 'wb') as o_t:
                o_t.write("No.\tQNAME\tACC\tDivision\tScientificName\tSource\n")
                for i, s in enumerate(query_seq):
                    if s['match']:
                        for a in s['match']:
                            r = query_esum(a)
                            o_t.write("%d\t%s\t%s\t%s\t%s\t%s\n" % (i + 1, s['qname'], a, r['division'], r['sn'], r['title']))
                    else:
                        o_t.write("%d\t%s\t%s\t%s\t%s\t%s\n" % (i + 1, s['qname'], "None", "None", "None", "None"))
            print color_term("OK!", 'green')

        print color_term("<< track >>", 'cyan')
        m_con = MysqlConnector(mysql_config, 'NCBI')
        AsyncSpiderESum(get_url(), concurrency=args.concurrency)
        output_report()
        m_con.done()

    fastq_dir = os.path.dirname(args.fastq)
    fastq_fn = re.match('(.+)\.fastq(:?\.gz)$', os.path.basename(args.fastq), re.I).group(1)
    suffix_name = "trackSeq_Freq-%s_Range_-%s" % (args.sampling_freq, args.sampling_range)
    fasta_path = os.path.join(fastq_dir, "%s_%s.fa" % (fastq_fn, suffix_name))
    bls_path = os.path.join(fastq_dir, "%s_%s.bls" % (fastq_fn, suffix_name))
    track_report_path = os.path.join(fastq_dir, "%s_%s_report.xls" % (fastq_fn, suffix_name))
    query_seq = []

    if re.search('fasta', args.options):
        output_fasta()

    if re.search('blast', args.options):
        blastn()

    if re.search('track', args.options):
        stats_bls()
        track_source()

    if re.search('stats', args.options):
        # stats_fastq(options='show')
        stats_bls()
        stats_report()

if __name__ == '__main__':
    # parse args
    parser = argparse.ArgumentParser(prog='trackShortSeq', formatter_class=argparse.RawTextHelpFormatter,
                                     description="• track short sequence's source by random sampling.\n"
                                                 "• stats sequence length distribution, query match percentage, source percentage.\n")

    parser.add_argument('fastq', type=str, help="Specify path of .fastq/.fastq.zip file")
    parser.add_argument('-f', '--sampling_freq', type=float, default=float(1 / 50), help="Specify sampling frequency")
    parser.add_argument('-r', '--sampling_range', metavar='START,END,STEP', type=str, default='110,150,10', help="Specify sampling step")
    parser.add_argument('--options', type=str, default='fastablasttrackstats', help="Specify analysis options\n"
                                                                                "--------------------\n"
                                                                                "supported key words:\n"
                                                                                "--------------------\n"
                                                                                "fasta : output fasta\n"
                                                                                "blast : perform BLASTn\n"
                                                                                "track : track source\n"
                                                                                "stats : stats on sequence and source\n"
                                                                                "--------------------\n")
    parser.add_argument('-c', '--concurrency', metavar='N', type=int, default=3, help="set concurrency for E-utility query")

    args = parser.parse_args()

    main()


text:
public class ComplexNumber {
    public ComplexNumber(double i, double j);
    public double getRealPart();
    public double getImaginaryPart();
    public ComplexNumber add(ComplexNumber i);
}


text:
Ext.define('Rally.apps.board.CollectionColumn', {
    extend: 'Rally.ui.cardboard.Column',
    alias: 'widget.collectioncolumn',

    getStoreFilter: function() {
        if (this._isCollectionField()) {
            return [
                {
                    property: this.attribute,
                    operator: 'contains',
                    value: this.value
                }
            ];
        } else {
            return this.callParent(arguments);
        }
    },

    isMatchingRecord: function(record) {
        if (this._isCollectionField()) {
            var value = record.get(this.attribute),
            values = (value && value._tagsNameArray) || [];

            return (!this.value && !values.length) ||
            _.contains(_.pluck(values, 'Name'), this.value);
        } else {
            return this.callParent(arguments);
        }
    },

    _isCollectionField: function() {
        return !!this.store.model.getField(this.attribute).isMultiValueCustom();
    }
});


text:
{{game.getTitle()}}

                    Hello, chosen one! This is serious matter and we need to discuss it immediately. The Universe is in
                    The Great Danger and, most definitely, only You can save us from this terrible threat.

                    To defeat The Evil You must gather Your army of pixels. You can do it by pressing The Great Pixel
                    and also by purchasing pixel generating equipment in our shop. Of course You will receive generous
                    discount when You defeat The Evil.

Great Pixel

                            Pixels
                            {{game.getNumberOfClicks() | number:1}}

    <tabset type="navType">
        <tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disabled="tab.disabled">

        </tab>
    </tabset>


text:
class Mailer < ActionMailer::Base

  def feedback(user, topic, details, send_anonymously)
    @anon = send_anonymously
    @anon = true if user.try(:person).nil?

    @details = details
    @topic = topic
    @person = user.try(:person)
    reply_to = user.person.email_with_name unless @anon
    mail(from: Seek::Config.noreply_sender,
         to: admin_emails,
         subject: "#{Seek::Config.application_name} Feedback provided - #{topic}",
         reply_to: reply_to)
  end

  def file_uploaded(uploader, receiver, file)
    @uploader = uploader.person
    @receiver = receiver
    @data_file = file
    mail(from: Seek::Config.noreply_sender,
         to: [uploader.person.email_with_name, receiver.email_with_name],
         subject: "#{Seek::Config.application_name} - File Upload",
         reply_to: uploader.person.email_with_name)
  end

  def request_publishing(owner, publisher, resources)
    @owner = owner
    publish_notification owner, publisher, resources, "A #{Seek::Config.application_name} member requests you make some items public"
  end

  def request_publish_approval(gatekeeper, publisher, resources)
    @gatekeeper = gatekeeper
    publish_notification gatekeeper, publisher, resources, "A #{Seek::Config.application_name} member requested your approval to publish some items."
  end

  def gatekeeper_approval_feedback(requester, gatekeeper, items_and_comments)
    gatekeeper_response 'approved', requester, gatekeeper, items_and_comments
  end

  def gatekeeper_reject_feedback(requester, gatekeeper, items_and_comments)
    gatekeeper_response 'rejected', requester, gatekeeper, items_and_comments
  end

  def request_resource(user, resource, details)
    @owners = resource.managers
    @requester = user.person
    @resource = resource
    @details = details
    mail(from: Seek::Config.noreply_sender,
         to: resource.managers.collect(&:email_with_name),
         reply_to: user.person.email_with_name,
         subject: "A #{Seek::Config.application_name} member requested a protected file: #{resource.title}")
  end

  def signup(user)
    @username = user.login
    @name = user.person.name
    @admins = admins
    @activation_code = user.activation_code
    mail(from: Seek::Config.noreply_sender,
         to: user.person.email_with_name,
         subject: "#{Seek::Config.application_name} account activation")
  end

  def forgot_password(user)
    @username = user.login
    @name = user.person.name
    @reset_code = user.reset_password_code
    mail(from: Seek::Config.noreply_sender,
         to: user.person.email_with_name,
         subject: "#{Seek::Config.application_name} - Password reset")
  end

  def welcome(user)
    @name = user.person.name
    @person = user.person
    mail(from: Seek::Config.noreply_sender,
         to: user.person.email_with_name,
         subject: "Welcome to #{Seek::Config.application_name}")
  end

  def welcome_no_projects(user)
    welcome(user) # the only difference is the view template, which is picked from the method name
  end

  def contact_admin_new_user(params, user)
    @details = Seek::Mail::NewMemberAffiliationDetails.new(params).message
    @person = user.person
    @user = user
    mail(from: Seek::Config.noreply_sender,
         to: admin_emails,
         reply_to: user.person.email_with_name,
         subject: "#{Seek::Config.application_name} member signed up")
  end

  def project_changed(project)
    @project = project
    recipients = admin_emails | @project.project_administrators.collect{|m| m.email_with_name}
    subject = "The #{Seek::Config.application_name} #{t('project')} #{@project.title} information has been changed"

    mail(:from=>Seek::Config.noreply_sender,
         :to=>recipients,
         :subject=>subject
    )
  end

  def contact_project_administrator_new_user(project_administrator, params, user)
    @details = Seek::Mail::NewMemberAffiliationDetails.new(params).message
    @person = user.person
    @user = user
    mail(from: Seek::Config.noreply_sender,
         to: project_administrator_email(project_administrator),
         reply_to: user.person.email_with_name,
         subject: "#{Seek::Config.application_name} member signed up, please assign this person to the #{I18n.t('project').pluralize.downcase} of which you are #{I18n.t('project')} Administrator")
  end

  def resources_harvested(harvester_responses, user)
    @resources = harvester_resources
    @person = user.person
    subject_text = (harvester_responses.size > 1) ? 'New resources registered with SEEK' : 'New resource registered with SEEK'
    mail(from: Seek::Config.noreply_sender,
         to: user.person.email_with_name,
         subject: subject_text)
  end

  def announcement_notification(site_announcement, notifiee_info)
    # FIXME: this should really be part of the site_announcements plugin
    @site_announcement  = site_announcement
    @notifiee_info = notifiee_info
    mail(from: Seek::Config.noreply_sender,
         to: notifiee_info.notifiee.email_with_name,
         subject: "#{Seek::Config.application_name} Announcement: #{site_announcement.title}")
  end

  def test_email(testing_email)
    mail(from: Seek::Config.noreply_sender,
         to: testing_email,
         subject: 'SEEK Configuration Email Test')
  end

  def notify_user_projects_assigned(person)
    @name = person.name
    @projects = person.projects

    mail(from: Seek::Config.noreply_sender,
         to: person.email_with_name,
         subject: "You have been assigned to a #{Seek::Config.application_name} project")
  end

  def programme_activation_required(programme, creator)
    @programme = programme
    @creator = creator

    mail(from: Seek::Config.noreply_sender,
         to: admin_emails,
         subject: "The #{Seek::Config.application_name} #{t('programme')} #{programme.title} was created and needs activating"
    )
  end

  def programme_activated(programme)
    @programme = programme

    mail(from: Seek::Config.noreply_sender,
         to: programme.programme_administrators.map(&:email_with_name),
         subject: "The #{Seek::Config.application_name} #{t('programme')} #{programme.title} has been activated"
    )
  end

  def programme_rejected(programme, reason)
    @programme = programme
    @reason = reason
    mail(from: Seek::Config.noreply_sender,
         to: programme.programme_administrators.map(&:email_with_name),
         subject: "The #{Seek::Config.application_name} #{t('programme')} #{programme.title} has been rejected"
    )
  end

  def report_run_problem(person, run)
    @person = person
    @run = run
    @error_outputs = run.outputs.select { |o| o.value_is_error? }

    attachments['taverna_server_log.txt'] = File.read(run.log.path) unless run.log.path.nil?
    attachments['portal_log.txt'] = run.failure_message unless run.failure_message.nil?

    mail(:from=>Seek::Config.noreply_sender,
         :to=>Seek::Config.support_email_address,
         :subject=>"#{Seek::Config.application_name} user has reported a problem with a workflow run")
  end

  private

  def admin_emails
    admins.map(&:email_with_name)
  rescue
    Rails.logger.error('Error determining admin email addresses')
    ['sowen@cs.man.ac.uk']
  end

  def project_administrator_email(project_administrator)
    project_administrator.email_with_name
  rescue
    Rails.logger.error("Error determining #{I18n.t('project')} manager #{project_madministrator.name} email addresses")
    ['sowen@cs.man.ac.uk']
  end

  # response will be 'rejected' or 'approved'
  def gatekeeper_response(response, requester, gatekeeper, items_and_comments)
    @gatekeeper = gatekeeper
    @requester = requester
    @items_and_comments = items_and_comments

    mail(from: Seek::Config.noreply_sender,
         to: requester.email_with_name,
         subject: "A #{Seek::Config.application_name} gatekeeper #{response} your publishing requests.",
         reply_to: gatekeeper.email_with_name)
  end

  def publish_notification(recipient, publisher, resources, subject)
    @publisher = publisher
    @resources = resources
    mail(from: Seek::Config.noreply_sender,
         to: recipient.email_with_name,
         reply_to: publisher.email_with_name,
         subject: subject)
  end

  def admins
    Person.admins
  end
end


text:
/*global s9e*/

import Post from 'flarum/components/Post';
import classList from 'flarum/utils/classList';
import PostUser from 'flarum/components/PostUser';
import PostMeta from 'flarum/components/PostMeta';
import PostEdited from 'flarum/components/PostEdited';
import EditPostComposer from 'flarum/components/EditPostComposer';
import Composer from 'flarum/components/Composer';
import ItemList from 'flarum/utils/ItemList';
import listItems from 'flarum/helpers/listItems';
import Button from 'flarum/components/Button';

/**
 * The `CommentPost` component displays a standard `comment`-typed post. This
 * includes a number of item lists (controls, header, and footer) surrounding
 * the post's HTML content.
 *
 * ### Props
 *
 * - `post`
 */
export default class CommentPost extends Post {
  constructor(...args) {
    super(...args);

    /**
     * If the post has been hidden, then this flag determines whether or not its
     * content has been expanded.
     *
     * @type {Boolean}
     */
    this.revealContent = false;

    // Create an instance of the component that displays the post's author so
    // that we can force the post to rerender when the user card is shown.
    this.postUser = new PostUser({post: this.props.post});
    this.subtree.check(
      () => this.postUser.cardVisible,
      () => this.isEditing()
    );
  }

  content() {
    return [

{listItems(this.headerItems().toArray())}
,

        {this.isEditing()
          ?

          : m.trust(this.props.post.contentHtml())}

,

{listItems(this.footerItems().toArray())}
,

{listItems(this.actionItems().toArray())}

    ];
  }

  isEditing() {
    return app.composer.component instanceof EditPostComposer &&
      app.composer.component.props.post === this.props.post &&
      app.composer.position !== Composer.PositionEnum.MINIMIZED;
  }

  attrs() {
    const post = this.props.post;

    return {
      className: classList({
        'CommentPost': true,
        'hidden': post.isHidden(),
        'edited': post.isEdited(),
        'revealContent': this.revealContent,
        'editing': this.isEditing()
      })
    };
  }

  configPreview(element, isInitialized, context) {
    if (isInitialized) return;

    // Every 50ms, if the composer content has changed, then update the post's
    // body with a preview.
    let preview;
    const updatePreview = () => {
      const content = app.composer.component.content();

      if (preview === content) return;

      preview = content;

      s9e.TextFormatter.preview(preview || '', element);
    };
    updatePreview();

    const updateInterval = setInterval(updatePreview, 50);
    context.onunload = () => clearInterval(updateInterval);
  }

  /**
   * Toggle the visibility of a hidden post's content.
   */
  toggleContent() {
    this.revealContent = !this.revealContent;
  }

  /**
   * Build an item list for the post's header.
   *
   * @return {ItemList}
   */
  headerItems() {
    const items = new ItemList();
    const post = this.props.post;
    const props = {post};

    items.add('user', this.postUser.render(), 100);
    items.add('meta', PostMeta.component(props));

    if (post.isEdited() && !post.isHidden()) {
      items.add('edited', PostEdited.component(props));
    }

    // If the post is hidden, add a button that allows toggling the visibility
    // of the post's content.
    if (post.isHidden()) {
      items.add('toggle', (
        Button.component({
          className: 'Button Button--default Button--more',
          icon: 'ellipsis-h',
          onclick: this.toggleContent.bind(this)
        })
      ));
    }

    return items;
  }

  /**
   * Build an item list for the post's footer.
   *
   * @return {ItemList}
   */
  footerItems() {
    return new ItemList();
  }

  /**
   * Build an item list for the post's actions.
   *
   * @return {ItemList}
   */
  actionItems() {
    return new ItemList();
  }
}


text:
package org.rapidpm.microservice.optionals.metrics.jvm.model.jvm;

import java.io.Serializable;
import java.lang.management.MemoryUsage;
import java.util.Objects;

public class MemoryInfos implements Serializable {
  private long freeMem;
  private long maxMem;
  private long totalMem;
  private int objectPendingFinalizationCount;
  private MemoryUsage heapMemoryUsage;
  private MemoryUsage nonHeapMemoryUsage;

  @Override
  public int hashCode() {
    return Objects.hash(freeMem, maxMem, objectPendingFinalizationCount, totalMem, heapMemoryUsage, nonHeapMemoryUsage);
  }

  @Override
  public boolean equals(final Object o) {
    if (this == o) return true;
    if (!(o instanceof MemoryInfos)) return false;
    final MemoryInfos that = (MemoryInfos) o;
    return freeMem == that.freeMem &&
        maxMem == that.maxMem &&
        totalMem == that.totalMem &&
        Objects.equals(heapMemoryUsage, that.heapMemoryUsage) &&
        Objects.equals(nonHeapMemoryUsage, that.nonHeapMemoryUsage);
  }

  @Override
  public String toString() {
    return "MemoryInfos{" +
        "freeMem=" + freeMem + System.lineSeparator() +
        ", heapMemoryUsage=" + heapMemoryUsage + System.lineSeparator() +
        ", maxMem=" + maxMem + System.lineSeparator() +
        ", objectPendingFinalizationCount=" + objectPendingFinalizationCount + System.lineSeparator() +
        ", nonHeapMemoryUsage=" + nonHeapMemoryUsage + System.lineSeparator() +
        ", totalMem=" + totalMem + System.lineSeparator() +
        '}';
  }

  public MemoryInfos freeMemory(final long freeMemory) {
    this.freeMem = freeMemory;
    return this;
  }

  public MemoryInfos maxMemory(final long maxMemory) {
    this.maxMem = maxMemory;
    return this;
  }

  public MemoryInfos totalMemory(final long totalMemory) {
    this.totalMem = totalMemory;
    return this;
  }

  public long getFreeMemory() {
    return freeMem;
  }

  public long getMaxMemory() {
    return maxMem;
  }

  public long getTotalMemory() {
    return totalMem;
  }

  public MemoryUsage getHeapMemoryUsage() {
    return heapMemoryUsage;
  }

  public MemoryUsage getNonHeapMemoryUsage() {
    return nonHeapMemoryUsage;
  }

  public MemoryInfos heapMemoryUsage(final MemoryUsage heapMemoryUsage) {
    this.heapMemoryUsage = heapMemoryUsage;
    return this;
  }

  public MemoryInfos nonHeapMemoryUsage(final MemoryUsage nonHeapMemoryUsage) {
    this.nonHeapMemoryUsage = nonHeapMemoryUsage;
    return this;
  }

  public MemoryInfos objectPendingFinalizationCount(final int objectPendingFinalizationCount) {
    this.objectPendingFinalizationCount = objectPendingFinalizationCount;
    return this;
  }
}


text:
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';

import {
    Dropdown,
    DropdownMenu,
    DropdownMenuItem,
    DropdownButton
} from '../../src'

import IoIosMore from 'react-icons/lib/io/ios-more'

storiesOf('Button', module)
    .add('Simple menu', () => (
        <Dropdown opened>
            <DropdownMenu>
                <DropdownMenuItem>Click me</DropdownMenuItem>
                <DropdownMenuItem>Two</DropdownMenuItem>
                <DropdownMenuItem>Check it out</DropdownMenuItem>
                <DropdownMenuItem>Log out</DropdownMenuItem>
            </DropdownMenu>
        </Dropdown>
    ))
    .add('Button dropdown menu', () => (
        <DropdownButton title='Click me' center>
            <DropdownMenu>
                <DropdownMenuItem onClick={(e) => console.log(e)} closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )).add('Arrow left', () => (
        <DropdownButton title='Arrow left' arrowLeft>
            <DropdownMenu>
                <DropdownMenuItem closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )).add('Pull right arrow left', () => (
        <DropdownButton title='Pull right arrow left' pullRight arrowLeft>
            <DropdownMenu>
                <DropdownMenuItem closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )).add('Align right arrow right', () => (
        <DropdownButton title='Align right arrow right' alignRight arrowRight>
            <DropdownMenu>
                <DropdownMenuItem closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )).add('No arrow', () => (
        <DropdownButton title='No arrow alignRight' alignRight noArrow>
            <DropdownMenu>
                <DropdownMenuItem closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )).add('No arrow pull right', () => (
        <DropdownButton title='No arrow pull right' pullRight noArrow>
            <DropdownMenu>
                <DropdownMenuItem closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem>won't close on click</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    )).add('Icon button no caret', () => (
        <DropdownButton title={<IoIosMore size={15} color='#888' />} center noCaret>
            <DropdownMenu>
                <DropdownMenuItem closeOnClick>Click me</DropdownMenuItem>
                <DropdownMenuItem>won't close on click</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Check it out</DropdownMenuItem>
                <DropdownMenuItem closeOnClick>Log out</DropdownMenuItem>
            </DropdownMenu>
        </DropdownButton>
    ))


text:
package mapper

import "github.com/cevian/go-stream/stream"

/* there is 3 types of state:
1. operator state
2. worker state (per parrallel execution)
3. map callback state (per-tuple state)

Simple generators supports 1 and 3 but not 2
Closure generator supprts 1,2,3
*/

type Generator interface {
	GetWorker() Worker
}

func NewGenerator(mapCallback func(obj stream.Object, out Outputer) error, tn string) *SimpleGenerator {
	return &SimpleGenerator{MapCallback: mapCallback, typename: tn}
}

/* The simple generator can have state shared across workers of an op or state
that is unique to each tuple processed but not state that is unique to a worker */

type SimpleGenerator struct {
	MapCallback        func(obj stream.Object, out Outputer) error
	CloseCallback      func(out Outputer) error
	StopCallback       func()
	WorkerExitCallback func() //called once per worker
	SingleExitCallback func() //called once per op
	typename           string
}

func (g *SimpleGenerator) GetWorker() Worker {
	w := NewWorker(g.MapCallback, g.typename)
	w.CloseCallback = g.CloseCallback
	w.StopCallback = g.StopCallback
	w.ExitCallback = g.WorkerExitCallback
	return w
}

func (w *SimpleGenerator) Exit() {
	if w.SingleExitCallback != nil {
		w.SingleExitCallback()
	}
}

/* Allow creation of new state per worker. Shared across map callbacks but
unique to the worker instead of the operator */

type ClosureGenerator struct {
	createWorker       func() Worker
	singleExitCallback func()
	typename           string
}

func (w *ClosureGenerator) GetWorker() Worker {
	return w.createWorker()
}

func (w *ClosureGenerator) Exit() {
	if w.singleExitCallback != nil {
		w.singleExitCallback()
	}
}


text:
   <profile>
   </profile>

      <input type="text" placeholder="search" ng-model="vm.search"  ng-keydown="vm.searchListsAction($event)"id = "searchBar"/>

[add List]

    <tab  ng-repeat ="tab in vm.tabs">{{tab.name}}</tab>

    <input id ="mainInput" name="mainInput" placeholder="enter To Do Item Text Here (press enter to save)" type="text"ng-model="vm.inputData" ng-keydown="vm.addItemAction($event)"/>
    <List-Item class = 'item' ng-repeat = 'item in vm.displayList' ></List-Item>

0)"> <--

      <div ng-click="vm.flipPage(1)" ng-show="((vm.pageIndex+1)*(vm.pageSize)<vm.list.length)"> -->

  <list-Creation ng-if="vm.listCreation == true">
  </list-Creation>

<cover ng-if="vm.profileMode == 'signIn'"></cover>


text:
/*
	This file is owned by Murtaza Alexandru and may not be distributed, edited or used without written permission of the owner
	When using this work you accept to keep this header
	E-mails from murtaza_alexandru73@yahoo.com with permissions can be seen as valid.
*/

#ifndef MPACK_MATRIX3_HPP
#define MPACK_MATRIX3_HPP

#include "Matrix4.hpp"

namespace MPACK
{
	namespace Math
	{
		template<class T> class Matrix3
		{
		public:
			T m_matrix[3][3];

			static void CalculateNormalMatrix(Matrix3<T> &matrix, Matrix4<T> &modelviewMatrix);
		};
	}
}

#include "Matrix3Implementation.hpp"

#endif


text:
"""Test serializer."""

from __future__ import absolute_import, print_function

from collections import namedtuple

from marshmallow import fields

from invenio_rest.serializer import BaseSchema, result_wrapper

def test_serialize_pretty(app):
    """Test pretty JSON."""

    class TestSchema(BaseSchema):
        title = fields.Str(attribute="title")

    data = {"title": "test"}
    assert (TestSchema().dump(data)).data == {"title": "test"}

def test_marshmallow_compatibility():
    """Test wrapper class for marshmallow schema compatibility."""
    dict_result = {"test": 1}
    list_result = [{"test": 1}, {"test": 2}]
    old_marshal = namedtuple("MarshalResult", ["data", "errors"])
    tuple_result = old_marshal({"test": 1}, [{"field": 5}])

    wrapped = result_wrapper(dict_result)

    assert wrapped == dict_result
    assert wrapped.data == dict_result

    wrapped = result_wrapper(list_result)
    assert wrapped == list_result
    assert wrapped.data == list_result

    wrapped = result_wrapper(tuple_result)
    assert wrapped == tuple_result
    assert isinstance(wrapped, tuple)
    assert tuple_result.data == dict_result


text:
package org.apache.syncope.client.console.rest;

import java.util.List;
import org.apache.syncope.common.lib.to.AbstractAttributableTO;
import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.ConnObjectTO;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;

public abstract class AbstractSubjectRestClient extends BaseRestClient {

    private static final long serialVersionUID = 1962529678091410544L;

    public abstract int count();

    public abstract List<? extends AbstractAttributableTO> list(int page, int size, final SortParam<String> sort);

    public abstract int searchCount(String fiql);

    public abstract List<? extends AbstractAttributableTO> search(String fiql,
            int page, int size, final SortParam<String> sort);

    public abstract ConnObjectTO getConnectorObject(String resourceName, Long id);

    public abstract AbstractAttributableTO delete(String etag, Long id);

    public abstract BulkActionResult bulkAction(BulkAction action);
}


text:
Coma
====

    @project coma
    @status in development
    @version 0.0.1-pre-pre-pre-alpha

The project is a context free grammar parser.

Algorithm
=========

 1. With the lexer break the input stream into tokens.
 2. Are building parsing rules in the order of the smallest particles.
 3. Consistently apply the rules to the entire input stream forming a collection of non-terminals and non-terminals.
 4. When finished successfully with the processing of the next rules start applying all the rules from the beginning, until there will be no rules that we can do.
 5. On the way out we get a parse tree AST

Grammar constructor example
===========================

```sh
# Grammar file example for JSON file
# Multi comments

lexer: # Lexer tokinizer

  digit = "0123456789".
  name = "abcdefghijklmnopqrstuvwxyz0123456789".

parser: # Parser rules

  digit           = '-'digit ; ^[0-9]+$.
  string          = '\'' %* '\'' ; '"' %* '"'.
  key             = name ; string.
  value           = key ; 'false' ; 'true' ; array.

  object          = '{' [objectKeyvalue [',' objectKeyvalue]*] '}'.
  objectKeyvalue  = key ':' value.
  array           = '[' [value [',' value]*] ']'.
```

Project tools
=============

https://github.com/demdxx/goproj

License MIT
===========

Copyright (C) <2013> Dmitry Ponomarev <demdxx@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>clucene</artifactId>
    <groupId>com.lahab.clucene</groupId>
    <version>1.0</version>
  </parent>
  <licenses>
    <license>
        <name>The Apache Software License, Version 2.0</name>
        <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        <distribution>repo</distribution>
    </license>
  </licenses>
  <artifactId>siteConstructor</artifactId>
  <name>siteConstructor</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
	<dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>utils</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>edu.uci.ics</groupId>
        <artifactId>crawler4j</artifactId>
        <version>3.3</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
			<groupId>net.htmlparser.jericho</groupId>
			<artifactId>jericho-html</artifactId>
		</dependency>
  </dependencies>
  <build>
	  <plugins>
	    <plugin>
	      <artifactId>maven-assembly-plugin</artifactId>
	      <configuration>
	        <descriptorRefs>
	          <descriptorRef>jar-with-dependencies</descriptorRef>
	        </descriptorRefs>
	        <archive>
	          <manifest>
	            <mainClass>org.lahab.clucene.siteConstructor.Main</mainClass>
	          </manifest>
	        </archive>
	      </configuration>
	    </plugin>
	  </plugins>
	</build>
</project>


text:
using Sniper.Common;
using Sniper.Http;
using Sniper.TargetProcess.Routes;
using Xunit;

namespace Sniper.Tests.CRUD.Update.Common.Programs
{
    public class UpdateProgramTests
    {
        [Fact]
        public void ProgramThrowsError()
        {
            var client = new TargetProcessClient
            {
                ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Programs)
            };
            var program = new Program
            {
            };
        }
    }
}


text:
<!DOCTYPE html>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% if page.title %}{{ page.title }} — {{ site.inc.title }}{% else %}{{ site.inc.title }} — {{ site.inc.subtitle }}{% endif %}</title>
    {% stylesheet main %}
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="apple-touch-icon" href="/images/{{ site.inc.logo }}"/>
    <link href="{{ site_url }}/feed.xml" rel="alternate" type="application/rss+xml" title="{{ site.inc.title }}" />
    <meta name="title" content="{% if page.title %}{{ page.title }} {% else %}{{ site.inc.title }}{% endif %}">
    <link rel="canonical" href="{{ site.url }}{{ page.url }}">
    <meta property="og:title" content="{% if page.title %}{{ page.title }} {% else %}{{ site.inc.title }}{% endif %}"/>
    <meta property="og:url" content="{{ site.url }}{{ page.url }}"/>
    {% if page.cover_image %}
    <meta property="og:image" content="{{ site.url }}/images/{{ page.cover_image }}"/>
    {% if page.main_image %}
    <meta property="og:image" content="{{ site.url }}/images/{{ page.main_image }}"/>
    {% endif %}
    <meta property="og:image" content="{{ site.url }}/images/{{ site.inc.logo }}"/>
    {% endif %}
    {% if page.excerpt %}
    <meta property="og:description" content="{{ page.excerpt }}"/>
    <meta name="description" content="{{ page.excerpt }}"/>
    {% endif %}
    <meta property="og:site_name" content="{{ site.inc.title }}">

            Blog
            {% if site.inc.product_link %}Product{% endif %}
            {% if site.inc.about_link %}About{% endif %}

        {% if site.inc.tagline or site.inc.product_url %}
            {% if site.inc.tagline %}{{ site.inc.tagline }}{% endif %}
            {% if site.inc.product_link %}Learn More{% endif %}
        {% endif %}

{{ content }}

        © {{ site.time | date: "%Y" }}

            {{ site.inc.company }} ·
            Blog ·
            {% if site.inc.product_link %}Product · {% endif %}
            {% if site.inc.about_link %}About{% endif %}

            {% if site.inc.twitter %}

            {% endif %}
            {% if site.inc.facebook %}

            {% endif %}

Incorporated theme by Inc

{% include _scripts.html %}


text:
class Matcher

      attr_accessor :attribute

        def initialize(method_sym)
          #pattern for method find_
          if method_sym.to_s =~ /^find_(.*)$/
            @attribute = $1.to_sym
          end
        end

        def match?
          @attribute != nil
        end
end


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

namespace DbGhost.Build.Extensions
{
    public static class AssemblyExtensions
    {
        public static Stream FindManifestResourceStream(this Assembly assembly, string name)
        {
            var names = assembly.GetManifestResourceNames();
            if (name != null && names.Length > 0)
            {
                var resourceName = names.OrderByDescending(n => n.Length).
                    FirstOrDefault(n => n.EndsWith(name));
                if (!string.IsNullOrEmpty(resourceName))
                    return assembly.GetManifestResourceStream(resourceName);
            }
            return null;
        }
    }
}


text:
namespace physx
{
	class PxGeometry;
}

namespace Lumix
{

class PhysicsSystem;

class LUMIX_PHYSICS_API PhysicsGeometryManager : public ResourceManagerBase
{
	public:
		PhysicsGeometryManager(PhysicsSystem& system, IAllocator& allocator)
			: ResourceManagerBase(allocator)
			, m_allocator(allocator)
			, m_system(system)
		{}
		~PhysicsGeometryManager() {}
		IAllocator& getAllocator() { return m_allocator; }
		PhysicsSystem& getSystem() { return m_system; }

	protected:
		virtual Resource* createResource(const Path& path) override;
		virtual void destroyResource(Resource& resource) override;

	private:
		IAllocator& m_allocator;
		PhysicsSystem& m_system;
};

class LUMIX_PHYSICS_API PhysicsGeometry : public Resource
{
	public:
		static const uint32_t HEADER_MAGIC = 0x5f4c5046; // '_LPF'
		struct Header
		{
			uint32_t m_magic;
			uint32_t m_version;
			uint32_t m_convex;
		};

		enum class Versions : uint32_t
		{
			FIRST,

			LAST
		};

	public:
		PhysicsGeometry(const Path& path, ResourceManager& resource_manager, IAllocator& allocator);
		~PhysicsGeometry();

		physx::PxGeometry* getGeometry() { return m_geometry; }

	private:
		IAllocator& getAllocator();

		virtual void doUnload(void) override;
		virtual void loaded(FS::IFile& file, bool success, FS::FileSystem& fs) override;

	private:
		physx::PxGeometry* m_geometry;
		bool m_is_convex;
};

} // namespace Lumix


text:
package com.virtualcoinclub.common;

import java.util.Enumeration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletRequest;

/**
 *
Common Utilities for front and back end

 *
 * Created for convenience but more specifically to utilize the same
 * member provided string cleanup on the fron and back ends.  This is
 * mainly to make sure that already-used member names are not reused,
 * but the functions themselves are to prevent SQL injection or other
 * abuse of the database.
 *

 *
 * @author  Eric Peterson
 * @version 1.0
 * @since   2014-08-22
 */
public class Utility {

    private static Logger logger = LoggerFactory.getLogger("Utility.class");

    /**
     * Strips all special characters from the input.  Prevents SQL
     * injection and keeps junk characters out of the database.
     * Prevent member from using unprintable or other characters that
     * could cause confusion when comparaing user names.
     * @param input String to be cleaned
     * @return String Cleaned string
     */
    public static String stripSpecial(String input) {
	String cleaned = input.replaceAll("[^a-zA-Z0-9_ ]", "");
	return cleaned;
    }

    /**
     * Turns all instances of more than one space into a single space.
     * This prevents members from creating names that are identical to
     * other names except for the number of spaces.
     * @param input String to be condensed
     * @return String Condensed string
     */
    public static String condenseSpaces(String input) {
	String cleaned = input.replaceAll(" +", " ");
	return cleaned;
    }

    /**
     * Utility function to log HTTP requests
     * @param input String to be condensed
     * @return none
     */
    public static void printRequest(String method, HttpServletRequest request)
    {
	Enumeration e = request.getParameterNames();

	logger.info( "=== start === " + method + " request: " + request.getRequestURI());
	while (e.hasMoreElements())
	    {
		String name = (String) e.nextElement();
		String[] values = request.getParameterValues(name);
		if (values.length == 1) {
		    logger.info( name + " : " + values[0]);
		}
		else {
		    StringBuffer sb = new StringBuffer();
		    sb.append(name);
		    sb.append(" : [");
		    for (String value: values) {
			sb.append(value + ",");
		    }
		    sb.append("]");
		    logger.info(sb.toString());
		}
	    }
	logger.info("=== end ===");
    }

}


text:
<?php

namespace Nervo\DoctrineEntitySerializer\Normalizer;

interface DoctrineEntityDenormalizableInterface
{
    public function denormalize(DoctrineEntityDenormalizerInterface $denormalizer, $data, $format = null);
}