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

<TITLE>
Rand (Functional Java 3.0)
</TITLE>

<META NAME="date" CONTENT="2010-06-25">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../javadoc-style.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg
This software is released under an open source BSD licence.

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

fj.test

Class Rand

java.lang.Object
  fj.test.Rand

public final class Rand
extends java.lang.Object

A random number generator.

Field Summary

static Rand
standard

          A standard random generator that uses Random.

Method Summary

 double
choose(double from,
       double to)

          Randomly chooses a value between the given range (inclusive).

 int
choose(int from,
       int to)

          Randomly chooses a value between the given range (inclusive).

 double
choose(long seed,
       double from,
       double to)

          Randomly chooses a value between the given range (inclusive).

 int
choose(long seed,
       int from,
       int to)

          Randomly chooses a value between the given range (inclusive).

static Rand
rand(F<Option<java.lang.Long>,F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>> f,
     F<Option<java.lang.Long>,F<java.lang.Double,F<java.lang.Double,java.lang.Double>>> g)

          Constructs a random generator from the given functions that supply a range to produce a
 result.

 Rand
reseed(long seed)

          Gives this random generator a new seed.

Methods inherited from class java.lang.Object

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

Field Detail

standard

public static final Rand standard

A standard random generator that uses Random.

Method Detail

choose

public int choose(long seed,
                  int from,
                  int to)

Randomly chooses a value between the given range (inclusive).

Parameters:
seed - The seed to use for random generation.
from - The minimum value to choose.
to - The maximum value to choose.

Returns:
A random value in the given range.

choose

public int choose(int from,
                  int to)

Randomly chooses a value between the given range (inclusive).

Parameters:
from - The minimum value to choose.
to - The maximum value to choose.

Returns:
A random value in the given range.

choose

public double choose(long seed,
                     double from,
                     double to)

Randomly chooses a value between the given range (inclusive).

Parameters:
seed - The seed to use for random generation.
from - The minimum value to choose.
to - The maximum value to choose.

Returns:
A random value in the given range.

choose

public double choose(double from,
                     double to)

Randomly chooses a value between the given range (inclusive).

Parameters:
from - The minimum value to choose.
to - The maximum value to choose.

Returns:
A random value in the given range.

reseed

public Rand reseed(long seed)

Gives this random generator a new seed.

Parameters:
seed - The seed of the new random generator.

Returns:
A random generator with the given seed.

rand

public static Rand rand(F<Option<java.lang.Long>,F<java.lang.Integer,F<java.lang.Integer,java.lang.Integer>>> f,
                        F<Option<java.lang.Long>,F<java.lang.Double,F<java.lang.Double,java.lang.Double>>> g)

Constructs a random generator from the given functions that supply a range to produce a
 result.

Parameters:
f - The integer random generator.
g - The floating-point random generator.

Returns:
A random generator from the given functions that supply a range to produce a result.

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg
This software is released under an open source BSD licence.

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('openstack_tenant', '0001_squashed_0046'),
    ]

    operations = [
        migrations.AddField(
            model_name='volumetype',
            name='is_default',
            field=models.BooleanField(default=False),
        ),
    ]

redpajama_set_name: RedPajamaGithub


text:
package sso

import (
	"context"
	"fmt"
	smithy "github.com/aws/smithy-go"
	"github.com/aws/smithy-go/encoding/httpbinding"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

type awsRestjson1_serializeOpGetRoleCredentials struct {
}

func (*awsRestjson1_serializeOpGetRoleCredentials) ID() string {
	return "OperationSerializer"
}

func (m *awsRestjson1_serializeOpGetRoleCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
	request, ok := in.Request.(*smithyhttp.Request)
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
	}

	input, ok := in.Parameters.(*GetRoleCredentialsInput)
	_ = input
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
	}

	opPath, opQuery := httpbinding.SplitURI("/federation/credentials")
	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
	request.Method = "GET"
	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
	if err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if err := awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(input, restEncoder); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}
	in.Request = request

	return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetRoleCredentialsInput(v *GetRoleCredentialsInput, encoder *httpbinding.Encoder) error {
	if v == nil {
		return fmt.Errorf("unsupported serialization of nil %T", v)
	}

	if v.AccessToken != nil && len(*v.AccessToken) > 0 {
		locationName := "X-Amz-Sso_bearer_token"
		encoder.SetHeader(locationName).String(*v.AccessToken)
	}

	if v.AccountId != nil {
		encoder.SetQuery("account_id").String(*v.AccountId)
	}

	if v.RoleName != nil {
		encoder.SetQuery("role_name").String(*v.RoleName)
	}

	return nil
}

type awsRestjson1_serializeOpListAccountRoles struct {
}

func (*awsRestjson1_serializeOpListAccountRoles) ID() string {
	return "OperationSerializer"
}

func (m *awsRestjson1_serializeOpListAccountRoles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
	request, ok := in.Request.(*smithyhttp.Request)
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
	}

	input, ok := in.Parameters.(*ListAccountRolesInput)
	_ = input
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
	}

	opPath, opQuery := httpbinding.SplitURI("/assignment/roles")
	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
	request.Method = "GET"
	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
	if err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if err := awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(input, restEncoder); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}
	in.Request = request

	return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAccountRolesInput(v *ListAccountRolesInput, encoder *httpbinding.Encoder) error {
	if v == nil {
		return fmt.Errorf("unsupported serialization of nil %T", v)
	}

	if v.AccessToken != nil && len(*v.AccessToken) > 0 {
		locationName := "X-Amz-Sso_bearer_token"
		encoder.SetHeader(locationName).String(*v.AccessToken)
	}

	if v.AccountId != nil {
		encoder.SetQuery("account_id").String(*v.AccountId)
	}

	if v.MaxResults != nil {
		encoder.SetQuery("max_result").Integer(*v.MaxResults)
	}

	if v.NextToken != nil {
		encoder.SetQuery("next_token").String(*v.NextToken)
	}

	return nil
}

type awsRestjson1_serializeOpListAccounts struct {
}

func (*awsRestjson1_serializeOpListAccounts) ID() string {
	return "OperationSerializer"
}

func (m *awsRestjson1_serializeOpListAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
	request, ok := in.Request.(*smithyhttp.Request)
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
	}

	input, ok := in.Parameters.(*ListAccountsInput)
	_ = input
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
	}

	opPath, opQuery := httpbinding.SplitURI("/assignment/accounts")
	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
	request.Method = "GET"
	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
	if err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if err := awsRestjson1_serializeOpHttpBindingsListAccountsInput(input, restEncoder); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}
	in.Request = request

	return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAccountsInput(v *ListAccountsInput, encoder *httpbinding.Encoder) error {
	if v == nil {
		return fmt.Errorf("unsupported serialization of nil %T", v)
	}

	if v.AccessToken != nil && len(*v.AccessToken) > 0 {
		locationName := "X-Amz-Sso_bearer_token"
		encoder.SetHeader(locationName).String(*v.AccessToken)
	}

	if v.MaxResults != nil {
		encoder.SetQuery("max_result").Integer(*v.MaxResults)
	}

	if v.NextToken != nil {
		encoder.SetQuery("next_token").String(*v.NextToken)
	}

	return nil
}

type awsRestjson1_serializeOpLogout struct {
}

func (*awsRestjson1_serializeOpLogout) ID() string {
	return "OperationSerializer"
}

func (m *awsRestjson1_serializeOpLogout) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
	request, ok := in.Request.(*smithyhttp.Request)
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
	}

	input, ok := in.Parameters.(*LogoutInput)
	_ = input
	if !ok {
		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
	}

	opPath, opQuery := httpbinding.SplitURI("/logout")
	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
	request.Method = "POST"
	restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
	if err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if err := awsRestjson1_serializeOpHttpBindingsLogoutInput(input, restEncoder); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}

	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
		return out, metadata, &smithy.SerializationError{Err: err}
	}
	in.Request = request

	return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsLogoutInput(v *LogoutInput, encoder *httpbinding.Encoder) error {
	if v == nil {
		return fmt.Errorf("unsupported serialization of nil %T", v)
	}

	if v.AccessToken != nil && len(*v.AccessToken) > 0 {
		locationName := "X-Amz-Sso_bearer_token"
		encoder.SetHeader(locationName).String(*v.AccessToken)
	}

	return nil
}


text:
<?php

namespace PHPTv;

use ClanCats\Container\Container;
use League\Climate\Climate;

abstract class BaseCommand
{
    /**
     * The container
     */
    protected $container;

    /**
     * The command line interface
     */
    protected $cli;

    /**
     * Construct every command with the container and command line interface
     *
     * @param Container             $container
     * @param Climate               $cli
     */
    public function __construct(Container $container, Climate $cli)
    {
        $this->container = $container;
        $this->cli = $cli;
    }

    /**
     * Shortcut to laod a repo
     *
     * @return Repository
     */
    protected function repo(string $name)
    {
        return $this->container->get('repo.' . $name);
    }

    /**
     * Execute the command
     *
     * @return void
     */
    abstract public function execute(array $args = []);
}


text:
class PhotoUploader < FileUploader

  # Add a white list of extensions which are allowed to be uploaded.
  # For images you might use something like this:
  def extension_white_list
    %w(jpg jpeg gif png)
  end

end


text:
<!DOCTYPE html>

    <meta charset='utf-8' />
    <title></title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />

    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.37.0/mapbox-gl.css' rel='stylesheet' />

    <input id='ktbasic' type='radio' name='rtoggle' value='ktbasic' checked='checked'>
    basic (klokantech)
    <input id='osmliberty' type='radio' name='rtoggle' value='osmliberty'>
    OSM liberty
    <input id='osmbright' type='radio' name='rtoggle' value='osmbright'>
    OSM bright
    <input id='positron' type='radio' name='rtoggle' value='positron' checked>
    positron
    <input id='positroncolor' type='radio' name='rtoggle' value='positroncolor'>
    positroncolor
    <input id='darkmatter' type='radio' name='rtoggle' value='darkmatter'>
    dark matter
    <input id='dark' type='radio' name='rtoggle' value='dark'>
    dark
    <input id='klokantech3d' type='radio' name='rtoggle' value='klokantech3d'>
    klokantech 3D

MapBox Vector Tiles

Intro

    De kaart links is door de browser getekend. De kaart is gekanteld, maar veel labels staan horizontaal.

    Je kunt de kaart in- en uitzoomen met twee vingers of het muiswieltje.

De kaart roteren kan met je vingers of houd de CTRL toets ingedrukt terwijl je met de muis aan de kaart trekt. Punt-labels blijven horizontaal staan.

    Scroll deze tekst omlaag voor de volgende kaart.

Stijlen

        Omdat de kaart door de browser getekend wordt, kun je dezelfde data op verschillende manieren weergeven.
        De vectordata van deze kaart staat op een server van Geodan en heeft de volgende kaartlagen:

water (vlakken)

waterway (lijnen)

landcover (vlakken)

landuse (vlakken)

park (vlakken)

boundary (lijnen)

aeroway (lijnen)

transportation (lijnen)

building (vlakken)

water_name (punten)

transportation_name (punten)

place (punten)

housenumber (punten)

poi (punten)

        Kies één van stijlen bovenaan de kaart voor een andere weergave. Bij sommige stijlen is bepaalde data helemaal weggelaten.
        Huisnummers zijn hier bijvoorbeeld alleen zichtbaar in de 'basic' stijl.

Data, attributen en stijllagen

        Omdat de vectordata niet op de server, maar in de browser aanwezig is, kun je de gegevens ook direct
        alfanumeriek weergeven. Als je met de muis over de kaart beweegt, wordt onder de kaart de informatie getoond van kaartgegevens onder de muispointer.

        Deze kaart is gemaakt met MapBox-gl. In MapBox-gl is een layer een combinatie van een source en een stijlinstelling.
        De source is de vectordata met bijbehorende data-attributen. Als de source bijvoorbeeld een kaartlaag 'transportation' bevat met attributen waarin de verschillende wegtypen worden aangeduid, dan kunnen daarvan meerderdere stijllagen worden gemaakt, bijvoorbeeld aparte stijllagen voor snelwegen, doorgaande wegen, straten, tunnels, trein- en tramrails enz.

VectorTiles uit PostGIS

        De vector tiles voor de kaarten uit de vorige paragrafen zijn kant en klaar gedownload,
        maar je kunt ook direct vector tiles uit bijvoorbeeld een PostGIS database genereren. Deze kaart toont alle rails uit de Geodan OSM PostGIS database die met behulp van de PostGIS (2.4 beta) functies 'ST_AsMVT()' en 'ST_AsMVTGeom()' uit de database worden gehaald.
        Het uitvoeren van de database queries kan soms wel even duren, vooral bij grote datasets zoals de OSM. Er is daarom een NGINX cache voor PostGIS gezet zodat dezelfde tiles maar één keer hoeven te worden gegenereerd.

        Deze PostGIS database heeft spoorwegen voor de hele wereld. Zo te zien zijn er nog heel wat spoorbeheerders die nog niet tot de Geodan klantenkring behoren.

VectorTiles en Nederlandse data

        Geodan heeft o.a. de dataset adressen en gebouwen (agn) gemaakt op basis van de BAG van het kadaster. Verder kun je via het PDOK de kadastrale percelenkaart
        downloaden. In deze kaart zijn de adrespunten ingekleurd op basis van het BAG gebruiksdoel. Omdat de
        vector data in de browser aanwezig is, kan dit worden gebruikt om bijvoorbeeld de gebouwen op te lichten op het moment dat je er met de muis overheen gaat.
        De plaatsing van woonplaatslabels wordt door de kaartsoftware (mapbox-gl) berekend op basis van de woonplaatsvlakken. In sommige gevallen kun je daarbij zien dat de achterliggende data in tiles is ingedeeld.


text:
;(function() {

function getDrawer(opener, attr) {
  var element = $(opener),
      drawerName = attr && element.attr(attr),
      drawer = drawerName ? $('[data-drawer="'+drawerName+'"]') : element.closest('[data-drawer]');
  return drawer;
}

function getDrawerTriggers(drawer) {
  var drawerName = drawer.attr('data-drawer'),
      triggers = [];
  if ( drawerName ) {
    triggers = triggers.concat($(
      '[data-drawer-open="'+drawerName+'"]'+
      ',[data-drawer-close="'+drawerName+'"]'+
      ',[data-drawer-toggle="'+drawerName+'"]'
    ).toArray());
  }
  triggers = triggers.concat(
    drawer.find('[data-drawer=""]')
    .filter(function(trigger) {
      return getDrawer(trigger)[0] === drawer[0];
    })
    .toArray()
  );
  return $(triggers);
}

function openDrawer(drawer) {
  drawer.addClass('is-open');
  getDrawerTriggers(drawer).addClass('is-open');

  var drawerKey = drawer.attr('data-drawer-key');
  if ( drawerKey ) {
    $('[data-drawer][data-drawer-key="'+drawerKey+'"].is-open')
      .not(drawer)
      .each(function(i, drawer) {
        closeDrawer($(drawer));
      });
  }
}

function closeDrawer(drawer) {
  drawer.removeClass('is-open');
  getDrawerTriggers(drawer).removeClass('is-open');
}

function toggleDrawer(drawer) {
  if ( drawer.hasClass('is-open') ) {
    closeDrawer(drawer);
  } else {
    openDrawer(drawer);
  }
}

$(document)
  .on('click', '[data-drawer-open]', function(e) {
    openDrawer(getDrawer(this, 'data-drawer-open'));
  })
  .on('click', '[data-drawer-close]', function(e) {
    closeDrawer(getDrawer(this, 'data-drawer-close'));
  })
  .on('click', '[data-drawer-toggle]', function(e) {
    toggleDrawer(getDrawer(this, 'data-drawer-toggle'));
  })
  .on('click focusin', function(e) {
    $('[data-drawer][data-drawer--auto-close].is-open')
      .filter(function() {
        if ( $(e.target).parent(this).length ) {
          return false;
        }
        return true;
      })
      .each(function() {
        closeDrawer($(this));
      });
  });

var drawerjs = window.drawerjs = {};
drawerjs.init = function() {
  var seen = {};
  $('[data-drawer-key]').each(function() {
    var drawer = $(this),
        key = drawer.attr('data-drawer-key');
    if ( key ) {
      if ( !seen[key] ) {
        seen[key] = true;
        openDrawer(drawer);
      }
    }
  });
};
drawerjs.init();

})();


text:
package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"encoding/json"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// Status status
// swagger:model Status
type Status struct {

	// message
	Message string `json:"message,omitempty"`

	// status
	// Required: true
	Status *string `json:"status"`
}

// Validate validates this status
func (m *Status) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateStatus(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

var statusTypeStatusPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["okay","problem","slow"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		statusTypeStatusPropEnum = append(statusTypeStatusPropEnum, v)
	}
}

const (
	// StatusStatusOkay captures enum value "okay"
	StatusStatusOkay string = "okay"
	// StatusStatusProblem captures enum value "problem"
	StatusStatusProblem string = "problem"
	// StatusStatusSlow captures enum value "slow"
	StatusStatusSlow string = "slow"
)

// prop value enum
func (m *Status) validateStatusEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, statusTypeStatusPropEnum); err != nil {
		return err
	}
	return nil
}

func (m *Status) validateStatus(formats strfmt.Registry) error {

	if err := validate.Required("status", "body", m.Status); err != nil {
		return err
	}

	// value enum
	if err := m.validateStatusEnum("status", "body", *m.Status); err != nil {
		return err
	}

	return nil
}

// MarshalBinary interface implementation
func (m *Status) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *Status) UnmarshalBinary(b []byte) error {
	var res Status
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <predicate lemma="denominate">

        <roleset framnet="-" id="denominate.01" name="give a name, assign a designation to" vncls="-">
            <roles>
                <role descr="assigner of name/value, agent" f="" n="0"/>
                <role descr="entity named" f="" n="1"/>
                <role descr="name, attribute" f="" n="2"/>
                <note/>
            </roles>

            <example name="passive" src="" type="">
                <inflection aspect="ns" form="participle" person="ns" tense="present" voice="passive"/>
                <text>Because [the funds ' investments]-1 are denominated [*-1] in foreign currencies , their value expressed [*] in dollars goes up when those currencies rise against the dollar [*T*-2] .</text>
                <rel f="">denominated</rel>
                <arg f="" n="1">[*-1]</arg>
                <arg f="" n="2">in foreign currencies</arg>
                <note/>
            </example>

            <note>No VNcls.</note>
            <example name="Red Pants. Did I mention I love ULA corpus?" src="ULA" type="-">
                <inflection aspect="ns" form="infinitive" person="other" tense="present" voice="active"/>
                <text>From a lifetime of undisciplined reading with innocent pencil in hand and malice prepense in mind , I have gleaned a harvest of what-2 I-1 am pleased *PRO*-1 to denominate *trace*-2 Red Pants items , a sampling of which follows .</text>
                <note/>
                <arg f="" n="0">*PRO*-1</arg>
                <rel f="">denominate</rel>
                <arg f="" n="1">*trace*-2</arg>
                <arg f="" n="2">Red Pants items, a sampling of which follows</arg>
            </example>
        </roleset>
        <note>Frames file for 'denominate' based on survey of sentences in the WSJ
            corpus.
        </note>
    </predicate>

    <note>frames created by Olga</note>
</frameset>


text:
package org.apache.sentry.provider.cache;

import org.apache.sentry.core.common.ActiveRoleSet;

import java.util.HashSet;
import java.util.Set;

/*
 * The class is used for saving and getting user's privileges when do the hive command like "show tables".
 * This will enhance the performance for the hive metadata filter.
 */
public class SimplePrivilegeCache implements PrivilegeCache {

  private Set<String> cachedPrivileges;

  public SimplePrivilegeCache(Set<String> cachedPrivileges) {
    this.cachedPrivileges = cachedPrivileges;
  }

  // return the cached privileges
  @Override
  public Set<String> listPrivileges(Set<String> groups, ActiveRoleSet roleSet) {
    if (cachedPrivileges == null) {
      cachedPrivileges = new HashSet<String>();
    }
    return cachedPrivileges;
  }

  @Override
  public void close() {
    if (cachedPrivileges != null) {
      cachedPrivileges.clear();
    }
  }
}


text:
package com.example.ric.mydiary.HelperClasses;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class DateTimeSetter {
    public static SimpleDateFormat sdfSqlite = new SimpleDateFormat(
            "yyyy-MM-dd HH:mm:ss", Locale.getDefault());
    static SimpleDateFormat sdfDisplayDatetime = new SimpleDateFormat(
            "dd.MM.yyyy HH:mm", Locale.getDefault());
    static SimpleDateFormat sdfDisplayTime = new SimpleDateFormat(
            "HH:mm", Locale.getDefault());
    static SimpleDateFormat sdfDisplayDate = new SimpleDateFormat(
            "dd.MM.yyyy", Locale.getDefault());
    static String defaultTime = "00:00";

    public static String setDateToSqlite(Date date) {

        return sdfSqlite.format(date);
    }

    public static Date getDateFromSqlite(String date) {

        Date returnDate = new Date();
        try {
            returnDate = sdfSqlite.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return returnDate;
    }

    public static String setDateTimeToDisplayString(Date date) {

        return sdfDisplayDatetime.format(date);
    }

    public static String setDateToDisplayString(Date date) {

        return sdfDisplayDate.format(date);
    }

    public static String setTimeToDisplayString(Date date) {

        return sdfDisplayTime.format(date);
    }

    public static Date getDateFromDisplayString(String date, String time) {
        if (time.isEmpty()) {
            time = defaultTime;
        }

        String datetime = date + " " + time;
        Date dateForDb = new Date();

        try {
            dateForDb = sdfDisplayDatetime.parse(datetime.trim());
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return dateForDb;
    }
}


text:
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>First Steps</title>
    <script src="//cdn.jsdelivr.net/phaser/2.2.2/phaser.min.js"></script>
    <style type="text/css">
        body {
            margin: 0;
            background:#000;
        }
    </style>
</head>
<body>

<script type="text/javascript">

var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
var left;
var right;
var bg1;
var button1;

WebFontConfig = {

    //  'active' means all requested fonts have finished loading
    //  We set a 1 second delay before calling 'createText'.
    //  For some reason if we don't the browser cannot render the text the first time it's created.
    active: function() { game.time.events.add(Phaser.Timer.SECOND, createText, this); },

    //  The Google Fonts we want to load (specify as many as you like in the array)
    google: {
      families: ['VT323']
    }

};

function gofull() {

    if (game.scale.isFullScreen)
    {
        game.scale.stopFullScreen();
    }
    else
    {
        game.scale.startFullScreen(false);
    }

}

function preload(){

	game.load.script('webfont', '//ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js');

	game.load.image('background', 'assets/desert.png', 1611, 640);
	game.load.spritesheet('guy', 'assets/firststeps.png', 24, 32);

	game.scale.pageAlignHorizontally = true;
	game.scale.pageAlignVertically = true;
	game.scale.refresh();
}

var guy;
var cursors;
var text = null;
var buttonText = null;
var grd;

function create(){
	bg1 = game.add.tileSprite(0, 0, 1611, 640, 'background');
	bg2 = game.add.sprite(bg1.width, 0, 'background');

	game.physics.startSystem(Phaser.Physics.ARCADE);
	guy = game.add.sprite(game.world.width/3, game.world.height/2-40, 'guy');
	guy.animations.add('left', [0, 1, 2, 3], 4, true);
	guy.animations.add('right', [5, 6, 7, 8], 4, true);
	guy.scale.setTo(2,2);
	game.physics.arcade.enable(guy);

	guy.animations.play('right', 10, true);

	cursors = game.input.keyboard.createCursorKeys();

	for (var i = 0; i <= 3; i++) {
		button = new Phaser.Rectangle(i*200+20, 20, 160, 50);
		game.debug.geom(button, '#666');
	}

	game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;
	game.input.onDown.add(gofull, this);
	//button = new Phaser.Rectangle(20, 20, 200, 50);
	//game.debug.geom(button, '#0fffff');
}

function createText(){
	text = game.add.text(game.world.centerX, game.world.centerY, "the endless march of\nINFLUENCE...");
    text.anchor.setTo(0.5);
    text.y = 500;
    text.x = 200;

    text.font = 'VT323';
    text.fontSize = 40;

    //  x0, y0 - x1, y1
    grd = text.context.createLinearGradient(0, 0, 0, text.canvas.height);
    grd.addColorStop(0, '#fff');
    grd.addColorStop(1, '#999');
    text.fill = grd;

    text.align = 'center';
    text.stroke = '#666';
    text.strokeThickness = 3;
    text.setShadow(3, 3, 'rgba(0,0,0,0.3)', 5);

    var style = { font: "22px VT323", fill: "#ff0044", wordWrap: true, wordWrapWidth: button.width, align: "center" };

	buttonText = game.add.text(0, 0, "humor", style);
	buttonText.anchor.set(0.5, 0.5);
	buttonText.x = 10;
	buttonText.y = 10;
}

function update(){

	guy.body.velocity.x = 0;
	bg1.tilePosition.x -= 1;

	/*if (cursors.left.isDown)
	{
		// Move to the LEFT
		guy.body.velocity.x = -150;
		guy.animations.play('left');
	}

	else if (cursors.right.isDown)
	{
		// Move to the RIGHT
		guy.body.velocity.x = 150;
		guy.animations.play('right');
	}

	else
	{
		// Stand still
		guy.animations.stop();
		guy.frame = 4;
	}*/

}

</script>
</body>
</html>


text:
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Linq;
using System;

namespace Cinemachine.Editor
{
    public class ScriptableObjectUtility : ScriptableObject
    {
        public static string CinemachineInstallPath
        {
            get { return Path.GetFullPath(CinemachineInstallAssetPath); }
        }

        public static string CinemachineInstallAssetPath
        {
            get
            {
                ScriptableObject dummy = ScriptableObject.CreateInstance<ScriptableObjectUtility>();
                string path = AssetDatabase.GetAssetPath(MonoScript.FromScriptableObject(dummy));
                DestroyImmediate(dummy);
                path = path.Substring(0, path.LastIndexOf("/Base"));
                return path;
            }
        }

        public static bool CinemachineIsPackage
        {
            get { return CinemachineInstallAssetPath.StartsWith("Packages"); }
        }

        public static bool AddDefineForAllBuildTargets(string k_Define)
        {
            bool added = false;
            var targets = Enum.GetValues(typeof(BuildTargetGroup))
                .Cast<BuildTargetGroup>()
                .Where(x => x != BuildTargetGroup.Unknown)
                .Where(x => !BuildTargetIsObsolete(x));

            foreach (var target in targets)
            {
                var defines = PlayerSettings.GetScriptingDefineSymbolsForGroup(target).Trim();

                var list = defines.Split(';', ' ')
                    .Where(x => !string.IsNullOrEmpty(x))
                    .ToList();

                if (!list.Contains(k_Define))
                {
                    list.Add(k_Define);
                    defines = list.Aggregate((a, b) => a + ";" + b);

                    PlayerSettings.SetScriptingDefineSymbolsForGroup(target, defines);
                    added = true;
                }
            }
            return added;
        }

        static bool BuildTargetIsObsolete(BuildTargetGroup group)
        {
            var attrs = typeof(BuildTargetGroup)
                .GetField(group.ToString())
                .GetCustomAttributes(typeof(ObsoleteAttribute), false);

            return attrs != null && attrs.Length > 0;
        }

        public static void Create<T>(bool prependFolderName = false, bool trimName = true) where T : ScriptableObject
        {
            string className = typeof(T).Name;
            string assetName = className;
            string folder = GetSelectedAssetFolder();

            if (trimName)
            {
                string[] standardNames = new string[] { "Asset", "Attributes", "Container" };
                foreach (string standardName in standardNames)
                {
                    assetName = assetName.Replace(standardName, "");
                }
            }

            if (prependFolderName)
            {
                string folderName = Path.GetFileName(folder);
                assetName = (string.IsNullOrEmpty(assetName) ? folderName : string.Format("{0}_{1}", folderName, assetName));
            }

            Create(className, assetName, folder);
        }

        public static T CreateAt<T>(string assetPath) where T : ScriptableObject
        {
            T asset = ScriptableObject.CreateInstance<T>();
            if (asset == null)
            {
                Debug.LogError("failed to create instance of " + typeof(T).Name);
                return null;
            }

            AssetDatabase.CreateAsset(asset, assetPath);

            return asset;
        }

        private static ScriptableObject Create(string className, string assetName, string folder)
        {
            ScriptableObject asset = ScriptableObject.CreateInstance(className);
            if (asset == null)
            {
                Debug.LogError("failed to create instance of " + className);
                return null;
            }

            asset.name = assetName ?? className;

            string assetPath = GetUnusedAssetPath(folder, asset.name);
            AssetDatabase.CreateAsset(asset, assetPath);

            return asset;
        }

        private static string GetSelectedAssetFolder()
        {
            if ((Selection.activeObject != null) && AssetDatabase.Contains(Selection.activeObject))
            {
                string assetPath = AssetDatabase.GetAssetPath(Selection.activeObject);
                string assetPathAbsolute = string.Format("{0}/{1}", Path.GetDirectoryName(Application.dataPath), assetPath);

                if (Directory.Exists(assetPathAbsolute))
                {
                    return assetPath;
                }
                else
                {
                    return Path.GetDirectoryName(assetPath);
                }
            }

            return "Assets";
        }

        private static string GetUnusedAssetPath(string folder, string assetName)
        {
            for (int n = 0; n < 9999; n++)
            {
                string assetPath = string.Format("{0}/{1}{2}.asset", folder, assetName, (n == 0 ? "" : n.ToString()));
                string existingGUID = AssetDatabase.AssetPathToGUID(assetPath);
                if (string.IsNullOrEmpty(existingGUID))
                {
                    return assetPath;
                }
            }

            return null;
        }
    }
}


text:
using System;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Threading;

namespace Rxx.Parsers
{
  internal sealed class ParserTraceExecutionContext : IDisposable
  {
    #region Public Properties
    #endregion

    #region Private / Protected
    private static long lastTracedExecutionId;

    private readonly long id;
    private readonly string name;
    private readonly IParserCursorState cursor;
    private readonly Stopwatch stopwatch;
    private int iteration;
    #endregion

    #region Constructors
    /// <summary>
    /// Constructs a new instance of the <see cref="ParserTraceExecutionContext" /> class.
    /// </summary>
    /// <param name="name">Name of the parser to be traced.</param>
    /// <param name="cursor">The parser's cursor.</param>
    public ParserTraceExecutionContext(string name, IParserCursorState cursor)
    {
      Contract.Requires(name == null || name.Length > 0);
      Contract.Requires(cursor != null);

      if (ParserTraceSources.Execution.Switch.ShouldTrace(TraceEventType.Verbose)
        || ParserTraceSources.Execution.Switch.ShouldTrace(TraceEventType.Start))
      {
        this.id = Interlocked.Increment(ref lastTracedExecutionId);
        this.name = ParserTraceSources.FormatName(name);
        this.cursor = cursor;

        stopwatch = new Stopwatch();
      }
    }
    #endregion

    #region Methods
    [ContractInvariantMethod]
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Required for code contracts.")]
    private void ObjectInvariant()
    {
      Contract.Invariant(name == null || name.Length > 0);
      Contract.Invariant(iteration >= 0);
      Contract.Invariant(stopwatch == null || cursor != null);
    }

    [Conditional("TRACE")]
    [DebuggerStepThrough]
    public void TraceBeginIteration()
    {
      if (stopwatch != null)
      {
        TraceEndIteration();

        ParserTraceSources.Execution.TraceEvent(
          TraceEventType.Start,
          0,
          "Parser {0}{1} begin iteration {2} at index {3}",
          id,
          name,
          ++iteration,
          cursor.CurrentIndex);

        stopwatch.Restart();
      }
    }

    private void TraceEndIteration()
    {
      if (iteration > 0)
      {
        Contract.Assume(stopwatch != null);

        ParserTraceSources.Execution.TraceEvent(
          TraceEventType.Stop,
          0,
          "Parser {0}{1} end iteration {2} at index {3} in {4}",
          id,
          name,
          iteration,
          cursor.CurrentIndex,
          stopwatch.Elapsed);
      }
    }

    [Conditional("TRACE")]
    [DebuggerStepThrough]
    public void TraceResult<TResult>(IParseResult<TResult> result)
    {
      Contract.Requires(result != null);

      if (stopwatch != null)
      {
        int endIndex = cursor.CurrentIndex + result.Length - 1;

        string end =
          endIndex > cursor.CurrentIndex
          ? "-" + endIndex
          : endIndex < cursor.CurrentIndex
            ? " (Non-Greedy)"
            : string.Empty;

        ParserTraceSources.Execution.TraceEvent(
          TraceEventType.Verbose,
          0,
          "Parser {0}{1} iteration {2} in {3} at index {4}{5} = {6}",
          id,
          name,
          iteration,
          stopwatch.Elapsed,
          cursor.CurrentIndex,
          end,
          result.Value);
      }
    }

    [DebuggerStepThrough]
    public void Dispose()
    {
      if (stopwatch != null)
      {
        TraceEndIteration();
      }
    }
    #endregion
  }
}


text:
void hello()
{
    std::cout<<"Hello world, I'm a thread!"<<std::endl;
    sleep(5);
    std::cout<<"Hello world, I'm a thread!"<<std::endl;
}

void test_thread()
{
	boost::thread thrd(&hello);
    thrd.join();
}

void server_cmdget(zmq::socket_t* socket, const std::string& id, const std::string& request)
{
}

//////////////////////// REQ/DEALER->ROUTER ///////////////////////////////////

void server()
{
	//  Prepare our context and sockets
    zmq::context_t context (10);
    zmq::socket_t* clients_socket_  = new zmq::socket_t(context, ZMQ_ROUTER);
    clients_socket_->bind ("tcp://*:5555");

    zmq::pollitem_t items[] = { { *clients_socket_, 0, ZMQ_POLLIN, 0 } };
    while (true)
	{
	    int rc = zmq_poll (&items[0], 1, 1000);
	    if (-1 != rc)
	    {
		    //  If we got a reply, process it
		    if (items[0].revents & ZMQ_POLLIN)
		    {
		    	zmq::message_t idmsg;
	        	clients_socket_->recv(&idmsg);
	        	std::string id((char*)idmsg.data(), idmsg.size());

	        	// SYNC
	        	zmq::message_t empty;
	        	if (id[0] != 'a')
	        		clients_socket_->recv(&empty);

			    zmq::message_t request;
			    clients_socket_->recv (&request);

			    std::string req((char*)request.data(), request.size());

			    std::cout << id << ":" << req << std::endl;

			    clients_socket_->send(idmsg, ZMQ_SNDMORE);
			    //SYNC
			    if (id[0] != 'a')
			    	clients_socket_->send(empty, ZMQ_SNDMORE);
			    clients_socket_->send(request);

			}
		}

		std::cout << "timer..." << std::endl;
	}
}

///////////////////////// REQ CLIENT //////////////////////////

zmq::context_t context (1);

void client(int i)
{
	    //  Prepare our context and socket
    try {
	    zmq::socket_t socket (context, ZMQ_REQ);
	    std::ostringstream id;
	    id << "client" << i;
		socket.setsockopt (ZMQ_IDENTITY, id.str().data(), id.str().size());

	    std::cout << "Connecting to hello world server..." << std::endl;
	    socket.connect ("tcp://localhost:5555");

	    //  Do 10 requests, waiting each time for a response
	    for (int request_nbr = 0; request_nbr != 10; request_nbr++) {
	        zmq::message_t request (6);
	        memcpy ((void *) request.data (), "Hello", 5);
	        //std::cout << "Sending Hello " << request_nbr << "..." << std::endl;
	        socket.send (request);

	        //  Get the reply.
	        zmq::message_t reply;
	        socket.recv (&reply);

	        std::string ret((char*)reply.data(), reply.size());

	        std::cout << "Received World " << request_nbr  << ":" << ret << std::endl;
	    }
	}
	catch (std::exception& err)
	{
		std::cout << "!!!!" << err.what() << std::endl;
	}
}

void test_client(int num)
{
	boost::thread_group threads;

	for (int i = 0; i < num; i++)
	{
		threads.create_thread(boost::bind(client, i));
	}

	threads.join_all();
}

////////////////////// Load Balance Server ///////////////////

void worker(int i)
{
	zmq::context_t context(1);
    zmq::socket_t worker(context, ZMQ_REQ);

	std::ostringstream id;
	id << "worker" << i;
	worker.setsockopt (ZMQ_IDENTITY, id.str().data(), id.str().size());

	worker.connect("ipc://backend.ipc");

    //  Tell backend we're ready for work
    worker.send("READY", 5);

    while (1)
    {
        //  Read and save all frames until we get an empty frame
        //  In this example there is only 1 but it could be more
       	zmq::message_t client_addr_msg;
       	worker.recv(&client_addr_msg);

       	zmq::message_t empty;
       	worker.recv(&empty);

        //  Get request, send reply
        zmq::message_t request;
        worker.recv(&request);

        std::cout << "Worker: " << (char*)request.data() << std::endl;

        sleep(1);
        std::string reply;
        reply = "OK";

        worker.send(client_addr_msg, ZMQ_SNDMORE);
        worker.send(empty, ZMQ_SNDMORE);
        worker.send(reply.data(), reply.size());
    }
}

void server2()
{
	   //  Prepare our context and sockets
    zmq::context_t context(1);
    zmq::socket_t frontend(context, ZMQ_ROUTER);
    zmq::socket_t backend(context, ZMQ_ROUTER);

    boost::thread_group worker_threads;

    frontend.bind("tcp://*:5555"); // frontend
    backend.bind("ipc://backend.ipc");

    for (int worker_nbr = 0; worker_nbr < 3; worker_nbr++)
    {
    	worker_threads.create_thread(boost::bind(worker, worker_nbr));
    }

    //  Logic of LRU loop
    //  - Poll backend always, frontend only if 1+ worker ready
    //  - If worker replies, queue worker as ready and forward reply
    //    to client if necessary
    //  - If client requests, pop next worker and send request to it
    //
    //  A very simple queue structure with known max size
    std::queue<std::string> worker_queue;

    while (1) {

        //  Initialize poll set
        zmq::pollitem_t items[] = {
            //  Always poll for worker activity on backend
                { backend, 0, ZMQ_POLLIN, 0 },
                //  Poll front-end only if we have available workers
                { frontend, 0, ZMQ_POLLIN, 0 }
        };
        if (worker_queue.size())
            zmq::poll(&items[0], 2, 1000);
        else
            zmq::poll(&items[0], 1, 1000);

        //  Handle worker activity on backend
        if (items[0].revents & ZMQ_POLLIN) {

            //  Queue worker address for LRU routing
            zmq::message_t worker_addr;
            backend.recv(&worker_addr);
            worker_queue.push(std::string((char*)worker_addr.data(), worker_addr.size()));

            //  Second frame is empty
            zmq::message_t empty;
            backend.recv(&empty);

            //  Third frame is READY or else a client reply address
            zmq::message_t client_addr_msg;
            backend.recv(&client_addr_msg);
            std::string client_addr((char*)client_addr_msg.data(), client_addr_msg.size());

            //  If client reply, send rest back to frontend
            if (client_addr.compare("READY") != 0)
            {
            	backend.recv(&empty);

            	zmq::message_t reply;
            	backend.recv(&reply);

            	std::string ret((char*)reply.data(), reply.size());

            	std::cout << "frontend->client:" << ret << std::endl;

            	frontend.send(client_addr_msg, ZMQ_SNDMORE);
            	// SYNC
            	if (client_addr[0] != 'a')
            		frontend.send(empty, ZMQ_SNDMORE);
            	frontend.send(reply);
            }
        }
        if (items[1].revents & ZMQ_POLLIN) {

            //  Now get next client request, route to LRU worker
            //  Client request is [address][empty][request]
            zmq::message_t client_addr_msg;
            frontend.recv(&client_addr_msg);
            std::string id((char*)client_addr_msg.data(), client_addr_msg.size());

            zmq::message_t empty;
            // SYNC
            if (id[0] != 'a')
            	frontend.recv(&empty);

            zmq::message_t request;
            frontend.recv(&request);

            std::string worker_addr = worker_queue.front();//worker_queue [0];
            worker_queue.pop();

            std::cout << (char*)client_addr_msg.data() << " : "
                      << (char*)request.data()
                      << " -> " << worker_addr
                      << std::endl;

            backend.send(worker_addr.data(), worker_addr.size(), ZMQ_SNDMORE);
            backend.send(empty, ZMQ_SNDMORE);
            backend.send(client_addr_msg, ZMQ_SNDMORE);
            backend.send(empty, ZMQ_SNDMORE);
            backend.send(request);
        }
    }
}

////////////////////// DEALER CLIENT ////////////////////////

void asyncclient(int i)
{
	    //  Prepare our context and socket
    try {
	    zmq::socket_t socket (context, ZMQ_DEALER);
	    std::ostringstream id;
	    id << "aclient" << i;
		socket.setsockopt (ZMQ_IDENTITY, id.str().data(), id.str().size());

	    std::cout << "Connecting to hello world server..." << std::endl;
	    socket.connect ("tcp://localhost:5555");

		#if 0
	    //  Do 10 requests, waiting each time for a response
	    for (int request_nbr = 0; request_nbr != 10; request_nbr++) {
	        zmq::message_t request (6);
	        memcpy ((void *) request.data (), "Hello", 5);
	        //std::cout << "Sending Hello " << request_nbr << "..." << std::endl;
	        socket.send (request);

			#if 0
	        //  Get the reply.
	        zmq::message_t reply;
	        socket.recv (&reply);

	        std::cout << "Received World " << request_nbr  << ":" << (char*)reply.data() << std::endl;
	        #endif
	    }
	    #endif

	    zmq::pollitem_t items[] = { { socket, 0, ZMQ_POLLIN, 0 } };
	    while (true)
		{
		    int rc = zmq_poll (&items[0], 1, 100);
		    if (-1 != rc)
		    {
			    //  If we got a reply, process it
			    if (items[0].revents & ZMQ_POLLIN)
			    {
			    	zmq::message_t idmsg;
		        	//socket.recv(&idmsg);

		        	zmq::message_t empty;
		        	//clients_socket_->recv(&empty);

				    zmq::message_t request;
				    socket.recv (&request);

				    std::string id((char*)idmsg.data(), idmsg.size());
				    std::string req((char*)request.data(), request.size());

				    std::cout << id << ":" << req << std::endl;

				    //clients_socket_->send(idmsg, ZMQ_SNDMORE);
				    //clients_socket_->send(empty, ZMQ_SNDMORE);
				    //clients_socket_->send(request);
				}
			}

			zmq::message_t request (6);
	        memcpy ((void *) request.data (), "Hello", 5);
	        //std::cout << "Sending Hello " << request_nbr << "..." << std::endl;
	        socket.send (request);
		}
	}
	catch (std::exception& err)
	{
		std::cout << "!!!!" << err.what() << std::endl;
	}
}

void test_async_client(int num)
{
	boost::thread_group threads;

	for (int i = 0; i < num; i++)
	{
		threads.create_thread(boost::bind(asyncclient, i));
	}

	threads.join_all();
}

//////////////////////////////// MAIN ///////////////////////

int main(int argc, const char* argv[])
{
	if (argc > 1)
	{
		int num = 1;
		if (argc > 2)
			num = atol(argv[2]);

		std::string arg1 = argv[1];
		if ("client" == arg1)
		{
			test_client(num);
		}
		else if ("aclient" == arg1)
		{
			test_async_client(num);
		}
		else if ("server" == arg1)
		{
			server();
		}
		else if ("server2" == arg1)
		{
			server2();
		}
		else if ("thread" == arg1)
		{
			test_thread();
		}
	}

}


text:
typedef int(*GetByteFn)(void *);
typedef int(*PutByteFn)(int, void *);

typedef struct _BitBuffer
{
    uint8_t Buffer, BitOffset;
} BitBuffer;

typedef struct _IoBufferConfig
{
    GetByteFn GetByte;
    void *GetContext;

    PutByteFn PutByte;
    void *PutContext;
} IoBufferConfig;

typedef struct _IoBuffer
{
    BitBuffer In;
    BitBuffer Out;

    // XXX Should this encompass both in and out?
    bool Eof;

    IoBufferConfig Config;
} IoBuffer;

int
IoBufferInit(
    IoBuffer *IoBuf,
    IoBufferConfig *Config
    );

int
IoBufferGetBit(
    IoBuffer *IoBuf,
    void *In
    );

int
IoBufferPutBit(
    IoBuffer *IoBuf,
    int Out
    );


text:
package smile

/** A wavelet is a wave-like oscillation with an amplitude that starts out at
  * zero, increases, and then decreases back to zero. Like the fast Fourier
  * transform (FFT), the discrete wavelet transform (DWT) is a fast, linear
  * operation that operates on a data vector whose length is an integer power
  * of 2, transforming it into a numerically different vector of the same length.
  * The wavelet transform is invertible and in fact orthogonal. Both FFT and DWT
  * can be viewed as a rotation in function space.
  *
  * @author Haifeng Li
  */
package object wavelet extends Operators {

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Fusicladium aplectri Ellis & Everh.

### Remarks
null


text:
import json
from maxwellbloch import t_funcs

class Field(object):
    """ Field object to address the OBAtom object, describing the atomic levels
    coupled, detuning and Rabi frequency function.

    Attributes:
        label (string): a name for the field e.g. "probe".
        index (int): index of the field, to reference within an OBAtom.
        coupled_levels (list): pairs of levels coupled by the field.
            e.g. [[0,1], [0,2]]
        factors (list): List of strength factors for each pair in coupled
            levels.
        detuning (float): detuning of the fields from resonance with the
            coupled_levels transitions.
        detuning_positive (bool): is the detuning positive?
        rabi_freq (float): Rabi frequency of the field on the transition.
        rabi_freq_t_func (func): Time-dependency of rabi_freq as function of
            time f(t, args)
        rabi_freq_t_args (dict): arguments to be passed to rabi_freq_t_func.
    """

    def __init__(self, label="", index=0, coupled_levels=[], factors=[],
        detuning=0.0, detuning_positive=True, rabi_freq=1.0,
        rabi_freq_t_func=None, rabi_freq_t_args={}):

        self.label = label
        self.index = index

        self.coupled_levels = coupled_levels # TODO should I convert to array?

        self.build_factors(factors)

        self.detuning = detuning
        self.detuning_positive = detuning_positive

        self.rabi_freq = rabi_freq
        self.rabi_freq_t_args = rabi_freq_t_args

        self.build_rabi_freq_t_func(rabi_freq_t_func, index)
        self.build_rabi_freq_t_args(rabi_freq_t_args, index)

    def __repr__(self):

        return ("Field(label={0}, " +
                "index={1}, " +
                "coupled_levels={2}, " +
                "factors={3}, " +
                "detuning={4}, " +
                "detuning_positive={5}, "
                "rabi_freq={6}, " +
                "rabi_freq_t_func={7}, " +
                "rabi_freq_t_args={8})").format(self.label,
                                                self.index,
                                                self.coupled_levels,
                                                self.factors,
                                                self.detuning,
                                                self.detuning_positive,
                                                self.rabi_freq,
                                                self.rabi_freq_t_func,
                                                self.rabi_freq_t_args)

    def build_factors(self, factors):
        """ Builds the factors list.

            Args:
                factors (list). List of strength factors for each pair in
                coupled levels.
            Returns:
                self.factors (list)
            Notes:
                - There are no checks on what these factors are, or if they
                    make any sense.
        """
        if not factors:
            factors = [1.0]*len(self.coupled_levels)
        if (len(factors) != len(self.coupled_levels)):
            raise ValueError('The length of factors must be the same as the '
                             'length of coupled_levels.')
        else:
            self.factors = factors
        return self.factors

    def build_rabi_freq_t_func(self, rabi_freq_t_func, index=0):

        if rabi_freq_t_func:

            t_func = getattr(t_funcs, rabi_freq_t_func)
            self.rabi_freq_t_func = t_func(index)

        else:
            t_func = t_funcs.square
            self.rabi_freq_t_func = t_func(index)

        return self.rabi_freq_t_func

    def build_rabi_freq_t_args(self, rabi_freq_t_args, index=0):

        self.rabi_freq_t_args = {}

        if rabi_freq_t_args:
            for key, value in rabi_freq_t_args.items():
                self.rabi_freq_t_args[key + '_' + str(index)] = value

        else:
            self.rabi_freq_t_args = {'on_' + str(index): 0.0,
                                     'off_' + str(index): 1.0,
                                     'ampl_' + str(index): 1.0}

        return self.rabi_freq_t_args

    def get_json_dict(self):
        """ Return a dict representation of the Field object to be dumped to
            JSON.

            Note:
                For the rabi_freq_t_func attribute generated with
                build_rabi_freq_t_func, a suffix for the index will have been
                added. We remove that. e.g. e.g. ramp_onoff_0 -> ramp_onoff
        """

        json_dict = {"label": self.label,
                     "index": self.index,
                     "coupled_levels": self.coupled_levels,
                     "factors": self.factors,
                     "detuning": self.detuning,
                     "detuning_positive": self.detuning_positive,
                     "rabi_freq": self.rabi_freq,
                     "rabi_freq_t_args": self.rabi_freq_t_args}

        if self.rabi_freq_t_func:
            t_func_name = self.rabi_freq_t_func.__name__
            t_func_name = '_'.join(t_func_name.split('_')[:-1])  # remove index
            json_dict.update({"rabi_freq_t_func": t_func_name})
        else:
            json_dict.update({"rabi_freq_t_func": None})

        if self.rabi_freq_t_args:
            rabi_freq_t_args = {}
            for key, value in self.rabi_freq_t_args.items():
                k = '_'.join(key.split('_')[:-1])  # remove index
                rabi_freq_t_args[k] = value
            json_dict.update({"rabi_freq_t_args": rabi_freq_t_args})
        else:
            json_dict.update({"rabi_freq_t_args": {}})

        return json_dict

    def to_json_str(self):
        """ Return a JSON string representation of the Field object.

        Returns:
            (string) JSON representation of the Field object.
        """

        return json.dumps(self.get_json_dict(), indent=2, separators=None,
                          sort_keys=True)

    def to_json(self, file_path):

        with open(file_path, 'w') as fp:
            json.dump(self.get_json_dict(), fp=fp, indent=2, separators=None,
                      sort_keys=True)

    @classmethod
    def from_json_str(cls, json_str):
        json_dict = json.loads(json_str)
        return cls(**json_dict)

    @classmethod
    def from_json(cls, file_path):
        with open(file_path) as json_file:
            json_dict = json.load(json_file)
        return cls(**json_dict)


text:
<?php

namespace spec\Sylius\Bundle\PricingBundle\Form\Type;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Sylius\Bundle\PricingBundle\Form\Type\VolumePriceConfigurationType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

final class VolumePriceConfigurationTypeSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType(VolumePriceConfigurationType::class);
    }

    function it_is_a_form()
    {
        $this->shouldHaveType(AbstractType::class);
    }

    function it_builds_form(FormBuilderInterface $builder)
    {
        $builder->add('min', 'number', Argument::type('array'))->shouldBeCalled()->willReturn($builder);
        $builder->add('max', 'number', Argument::type('array'))->shouldBeCalled()->willReturn($builder);
        $builder->add('price', 'sylius_money', Argument::type('array'))->shouldBeCalled();

        $this->buildForm($builder);
    }

    function it_has_a_name()
    {
        $this->getName()->shouldReturn('sylius_price_calculator_volume_based_configuration');
    }
}