text:
package eu.bcvsolutions.idm.ic.api.operation;

import eu.bcvsolutions.idm.ic.api.IcSchema;

/**
 * Connector witch implements this interface supports generate schema operation.
 * @author svandav
 *
 */
public interface IcCanGenSchema {

	/**
	 * Generate schema for this connector
	 * @return
	 */
	public IcSchema schema();
}

redpajama_set_name: RedPajamaGithub


text:
require 'oauth2'

# OAuth 2.0 Client implementation for Ruby.
class OAuthApplicationClient
  attr_accessor :token, :user_agent

  # Connect to the PokitDok API with the specified Client ID and Client
  # Authentication logic located within this class.
  #
  # +client_id+     your client ID, provided by PokitDok
  # +client_secret+ your client secret, provided by PokitDok
  # +token_url+ token url to be appended for authentication. Defaults to '/oauth2/token'
  # +redirect_uri+ the Redirect URI set for the PokitDok Platform Application.
  #   This value is managed at https://platform.pokitdok.com in the App Settings
  # +scope+ a list of scope names that should be used when requesting authorization
  # +code+ code value received from an authorization code grant
  # +token+ The current API access token for your PokitDok Platform Application. If not provided a new token is generated.
  # +user_agent+ user agent to be used as a header in HTTP requests
  def initialize(client_id, client_secret, token_url, redirect_uri, scope, code, token, user_agent)
    @client_id = client_id
    @client_secret = client_secret
    @token_url = token_url
    @redirect_uri = redirect_uri
    @scope = scope
    @code = code
    @user_agent = user_agent
    @token  = token

    @api_client = OAuth2::Client.new(@client_id, @client_secret, site: @api_url, token_url: @token_url, raise_errors: false)
    if @token.nil?
      fetch_access_token(@code)
    end
  end

  # Perform a GET request given the http request path and optional params
  #
  # +path+ request path
  # +params+ an optional hash of parameters that will be sent in the request
  def get_request(path, params, &block)
    if isAccessTokenExpired?
      fetch_access_token()
    end
    @token.get(path, params: params, headers: headers, &block)
  end

  # Perform a PUT request given the http request path and optional params
  #
  # +path+ request path
  # +params+ an optional hash of parameters that will be sent in the request
  def put_request(path, params = {}, &block)
    if isAccessTokenExpired?
      fetch_access_token()
    end
    headers.merge({ headers: { :'Content-Type' => 'application/json'}})
    @token.put(path, body: params.to_json, headers: headers({:'Content-Type' => 'application/json'}), &block)
  end

  # Perform a POST request given the http request path and optional params
  #
  # +path+ request path
  # +params+ an optional hash of parameters that will be sent in the request
  def post_request(path, params = {}, &block)
    if isAccessTokenExpired?
      fetch_access_token()
    end
    headers.merge({ headers: { :'Content-Type' => 'application/json'}})
    @token.post(path, body: params.to_json, headers: headers({:'Content-Type' => 'application/json'}), &block)
  end

  # Perform a POST request given the http request path, a file and optional params
  #
  # +path+ request path
  # +file+ the file to be sent with the request
  # +params+ an optional hash of parameters that will be sent in the request
  def post_file(endpoint, file=nil, params={})
    if isAccessTokenExpired?
      fetch_access_token()
    end
    url = URI.parse(@api_url + endpoint)
    File.open(file) do |f|
      additional_params = params.merge({'file' => UploadIO.new(f, 'application/EDI-X12', file)})
      req = Net::HTTP::Post::Multipart.new(url.path, additional_params)
      req['Authorization'] = "Bearer #{self.token.token}"
      req['User-Agent'] = @user_agent

      @response = Net::HTTP.start(url.host, url.port, :use_ssl => true) do |http|
        http.request(req)
      end
      @status_code = @response.code.to_i
      JSON.parse(@response.body)
    end
  end

  # Perform a DELETE request given the http request path and optional params
  #
  # +path+ request path
  # +params+ an optional hash of parameters that will be sent in the request
  def delete_request(path, params = {}, &block)
    if isAccessTokenExpired?
      fetch_access_token()
    end
    @token.delete(path, body: params.to_json, headers: headers({:'Content-Type' => 'application/json'}), &block)
  end

  # Construct OAuth2 Authorization Grant URL
  def authorization_url()
    if @redirect_uri.nil? || @scope.nil?
      raise 'A redirect_uri and scope must be specified when the client is instantiated in order to get a working authorization URL'
    end
    @api_client.auth_code.authorize_url(redirect_uri: @redirect_uri, scope: @scope)
  end

  ### PRIVATE METHODS ###

  # Retrieves an OAuth2 access token.  If `code` is not specified, the client_credentials
  # grant type will be used based on the client_id and client_secret.  If `code` is not None,
  # an authorization_code grant type will be used.
  #
  # +code+ optional authorization code used for scope purposes
  def fetch_access_token(code = nil)
    if code
      # Currently non functioning as our OAuth2 authorization_code grant type is not implemented on the server
      params =  {
          scope: @scope,
          redirect_uri: @redirect_uri
      }
      @token = @api_client.auth_code.get_token(code, params)
    else
      @token = @api_client.client_credentials.get_token()
    end
  end

  # Returns a standard set of headers to be passed along with all requests
  def headers(additional_headers = {})
    { 'User-Agent' => @user_agent }.merge(additional_headers)
  end

  # Check if the access token is expired
  def isAccessTokenExpired?
    if !@token.is_a?(OAuth2::AccessToken)
      return true
    end
    @token.expired?
  end

  private :headers, :isAccessTokenExpired?, :fetch_access_token
end


text:
package org.apache.beam.sdk.testing;

import org.apache.beam.sdk.annotations.Internal;

/**
 * Category tag for tests that use {@link TestStream}, which is not a part of the Beam model but a
 * special feature currently only implemented by the direct runner and the Flink Runner (streaming).
 */
@Internal
public interface UsesTestStream extends UsesUnboundedPCollections {}


text:
description: Deploy Azure Data Explorer db with Event Hub connection.
page_type: sample
products:
- azure
- azure-resource-manager
urlFragment: kusto-event-hub
languages:
- json
- bicep
---
# Deploy Azure Data Explorer db with Event Hub connection.

![Azure Public Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/PublicLastTestDate.svg)
![Azure Public Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/PublicDeployment.svg)

![Azure US Gov Last Test Date](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/FairfaxLastTestDate.svg)
![Azure US Gov Last Test Result](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/FairfaxDeployment.svg)

![Best Practice Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/BestPracticeResult.svg)
![Cred Scan Check](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/CredScanResult.svg)
![Bicep Version](https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/BicepVersion.svg)

[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.kusto%2Fkusto-event-hub%2Fazuredeploy.json)
[![Deploy To Azure US Gov](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazuregov.svg?sanitize=true)](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.kusto%2Fkusto-event-hub%2Fazuredeploy.json)
[![Visualize](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/visualizebutton.svg?sanitize=true)](http://armviz.io/#/?load=https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.kusto%2Fkusto-event-hub%2Fazuredeploy.json)

https://azurequickstartsservice.blob.core.windows.net/badges/quickstarts/microsoft.kusto/kusto-event-hub/BicepVersion.svg

This template allows you deploy a cluster with System Assigned Identity, a database, an Azure Event Hub and a data connection between the Event Hub and the database (using the system assigned identity).

This template was authored in bicep (see [bicep template](main.bicep)), referring a [KQL script](script.kql) and then transpiled into [JSON template](azuredeploy.json).

`Tags: Microsoft.EventHub/namespaces/eventhubs/consumergroups, Microsoft.EventHub/namespaces/eventhubs, Microsoft.Kusto/clusters/databases/scripts, Microsoft.Kusto/clusters/databases/dataConnections, Microsoft.Kusto/clusters/databases, Microsoft.EventHub/namespaces, Microsoft.Kusto/clusters, SystemAssigned, Microsoft.Authorization/roleAssignments`


text:
import sys
import pickle

class Paciente:

    def __init__(self, cedula, nombre, telefono, edad):
        self.cedula = cedula
        self.nombre = nombre
        self.telefono = telefono
        self.edad = edad

    def get_cedula(self):
        return self.cedula

    def get_nombre(self):
        return self.nombre

    def get_telefono(self):
        return self.telefono

    def get_edad(self):
        return self.edad

    def __str__(self):
        return "cedula: " + self.cedula + \
               " nombre: " + self.nombre + \
               " telefono: " + self.telefono + \
               " edad: " + str(self.edad)

class Enfermedad:

    def __init__(self, nombre, sintomas, tratamientos):
        self.nombre = nombre
        self.sintomas = sintomas
        self.tratamientos = tratamientos

    def get_nombre(self):
        return self.nombre

    def get_sintomas(self):
        return self.sintomas

    def get_tratamientos(self):
        return self.tratamientos

    def __str__(self):
        return "Nombre: " + self.nombre + " sintomas: " + self.sintomas + " tratamientos: " + tratamientos

class Expediente:

    def __init__(self, paciente, enfermedades):
        self.paciente = paciente
        self.enfermedades = enfermedades

    def get_paciente(self):
        return self.paciente

    def get_enfermedades(self):
        return self.enfermedades

    def imprimir(self):
        paciente = expediente.get_paciente()
        print("*"*11+"Expediente"+"*"*11)
        print("Nombre:", paciente.get_nombre())
        print("Edad:",paciente.get_edad(),"\tTelefono:",paciente.get_telefono())
        print("*"*10+"Enfermedades"+"*"*10)
        for enfermedad in expediente.get_enfermedades():
            print("Nombre      :",enfermdad.get_nombre())
            print("Sintomas    :",enfermdad.get_sintomas())
            print("Tratamientos:",enfermdad.get_tratamientos())
            print("*"*11)
        print("-"*32)

    def __str__(self):
        return "Paciente: " + str(self.paciente) + " enfermedades: " + self.enfermedades

expediente = None
opcion = None
opciones = ["1", "2", "3", "4", "5", "S"]

def start():
    while not opcion or opcion != "S":
        menu()
        if opcion == "1":
            crear_expediente()
        elif opcion == "2":
            cargar_expediente()
        elif opcion == "3":
            modificar_expediente()
        elif opcion == "4":
            salvar_expediente()
        elif opcion == "5":
            imprimir_expediente()
        elif opcion == "S":
            sys.exit()

def crear_expediente():
    global expediente
    cedula = ""
    nombre = ""
    telefono = ""
    edad = 0
    while not cedula:
        cedula = input("Introduce la cedula del paciente:\n").strip()
    while not nombre:
        nombre = input("Introduce el nombre del paciente:\n").strip()
    telefono = input("Introduce el telefono del paciente:\n")
    edad = input("Introduce la edad del paciente:\n")
    expediente = Expediente(Paciente(cedula, nombre, telefono, edad), [])

def cargar_expediente():
    global expediente
    try:
        with open(input("Introduce el numero del expediente: ") + ".dat", "rb") as f:
            expediente = pickle.load(f)
            expediente.imprimir()
    except IOError:
        print("No se puede abrir el archivo:", filename)
        start()

def salvar_expediente():
    if expediente:
        filename = expediente.get_paciente().get_cedula() + ".dat"
        try:
            with open(filename, "wb+") as f:
                pickle.dump(expediente, f)
        except IOError:
            print("No se puede salvar el archivo:", filename)
            start()

def imprimir_expediente():
    if expediente:
        expediente.imprimir()
    else:
        print("No hay un expediente seleccionado para imprimir")
        start()

def menu():
    global opcion
    while True:
        opcion = input("\n\
           Selecciona una opción\n\
           1. Crear Expediente\n\
           2. Cargar Expediente\n\
           3. Modificar Expediente\n\
           4. Salvar Expediente\n\
           5. Imprimir Expediente\n\
           S. Salir\n").upper()
        if any(x == opcion for x in opciones):
            break
        else:
            print("Opcion no valida. Intentalo nuevamente")

start()


text:
<?xml version="1.0" ?>
<scpd xmlns="urn:schemas-upnp-org:service-1-0">
	<specVersion>
		<major>1</major>
		<minor>0</minor>
	</specVersion>
	<actionList>
		<action>
			<name>GetGenericEntry</name>
			<argumentList>
				<argument>
					<name>Index</name>
					<direction>in</direction>
					<relatedStateVariable>NumberOfEntries</relatedStateVariable>
				</argument>
				<argument>
					<name>Identifier</name>
					<direction>out</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>Secret</name>
					<direction>out</direction>
					<relatedStateVariable>Secret</relatedStateVariable>
				</argument>
				<argument>
					<name>SecretType</name>
					<direction>out</direction>
					<relatedStateVariable>SecretType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthType</name>
					<direction>out</direction>
					<relatedStateVariable>AuthType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthState</name>
					<direction>out</direction>
					<relatedStateVariable>AuthState</relatedStateVariable>
				</argument>
				<argument>
					<name>Description</name>
					<direction>out</direction>
					<relatedStateVariable>Description</relatedStateVariable>
				</argument>
				<argument>
					<name>MAC_Address</name>
					<direction>out</direction>
					<relatedStateVariable>MAC_Address</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>GetSpecificEntry</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>Identifier</name>
					<direction>out</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>Secret</name>
					<direction>out</direction>
					<relatedStateVariable>Secret</relatedStateVariable>
				</argument>
				<argument>
					<name>SecretType</name>
					<direction>out</direction>
					<relatedStateVariable>SecretType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthType</name>
					<direction>out</direction>
					<relatedStateVariable>AuthType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthState</name>
					<direction>out</direction>
					<relatedStateVariable>AuthState</relatedStateVariable>
				</argument>
				<argument>
					<name>Description</name>
					<direction>out</direction>
					<relatedStateVariable>Description</relatedStateVariable>
				</argument>
				<argument>
					<name>MAC_Address</name>
					<direction>out</direction>
					<relatedStateVariable>MAC_Address</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>AddEntry</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>Secret</name>
					<direction>in</direction>
					<relatedStateVariable>Secret</relatedStateVariable>
				</argument>
				<argument>
					<name>SecretType</name>
					<direction>in</direction>
					<relatedStateVariable>SecretType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthType</name>
					<direction>in</direction>
					<relatedStateVariable>AuthType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthState</name>
					<direction>in</direction>
					<relatedStateVariable>AuthState</relatedStateVariable>
				</argument>
				<argument>
					<name>Description</name>
					<direction>in</direction>
					<relatedStateVariable>Description</relatedStateVariable>
				</argument>
				<argument>
					<name>MAC_Address</name>
					<direction>in</direction>
					<relatedStateVariable>MAC_Address</relatedStateVariable>
				</argument>
				<argument>
					<name>NumberOfEntries</name>
					<direction>out</direction>
					<relatedStateVariable>NumberOfEntries</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>UpdateEntry</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>Secret</name>
					<direction>in</direction>
					<relatedStateVariable>Secret</relatedStateVariable>
				</argument>
				<argument>
					<name>SecretType</name>
					<direction>in</direction>
					<relatedStateVariable>SecretType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthType</name>
					<direction>in</direction>
					<relatedStateVariable>AuthType</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthState</name>
					<direction>in</direction>
					<relatedStateVariable>AuthState</relatedStateVariable>
				</argument>
				<argument>
					<name>Description</name>
					<direction>in</direction>
					<relatedStateVariable>Description</relatedStateVariable>
				</argument>
				<argument>
					<name>MAC_Address</name>
					<direction>in</direction>
					<relatedStateVariable>MAC_Address</relatedStateVariable>
				</argument>
				<argument>
					<name>NumberOfEntries</name>
					<direction>out</direction>
					<relatedStateVariable>NumberOfEntries</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>DeleteEntry</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>NumberOfEntries</relatedStateVariable>
				</argument>
				<argument>
					<name>NumberOfEntries</name>
					<direction>out</direction>
					<relatedStateVariable>NumberOfEntries</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>GetNumberOfEntries</name>
			<argumentList>
				<argument>
					<name>NumberOfEntries</name>
					<direction>out</direction>
					<relatedStateVariable>NumberOfEntries</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>GetSucceededCounter</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthSucceededCounter</name>
					<direction>out</direction>
					<relatedStateVariable>AuthSucceededCounter</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>ClearSucceededCounter</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>AuthSucceededCounter</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>GetFailedCounter</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>Identifier</relatedStateVariable>
				</argument>
				<argument>
					<name>AuthFailedCounter</name>
					<direction>out</direction>
					<relatedStateVariable>AuthFailedCounter</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
		<action>
			<name>ClearFailedCounter</name>
			<argumentList>
				<argument>
					<name>Identifier</name>
					<direction>in</direction>
					<relatedStateVariable>AuthFailedCounter</relatedStateVariable>
				</argument>
			</argumentList>
		</action>
	</actionList>
	<serviceStateTable>
		<stateVariable sendEvents="yes">
			<name>NumberOfEntries</name>
			<dataType>ui2</dataType>
			<defaultValue>0</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="yes">
			<name>LastChange</name>
			<dataType>string</dataType>
			<defaultValue>""</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>Identifier</name>
			<dataType>string</dataType>
			<defaultValue>""</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>Secret</name>
			<dataType>string</dataType>
			<defaultValue>""</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>SecretType</name>
			<dataType>string</dataType>
			<allowedValueList>
				<allowedValue>TextPassword</allowedValue>
				<allowedValue>X509Certificate</allowedValue>
				<allowedValue>PublicKey</allowedValue>
				<allowedValue>PublicKeyHash160</allowedValue>
			</allowedValueList>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>AuthType</name>
			<dataType>string</dataType>
			<allowedValueList>
				<allowedValue>SharedSecret</allowedValue>
				<allowedValue>ValidCredentials</allowedValue>
			</allowedValueList>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>AuthState</name>
			<dataType>string</dataType>
			<allowedValueList>
				<allowedValue>Unconfigured</allowedValue>
				<allowedValue>Pending</allowedValue>
				<allowedValue>Authenticating</allowedValue>
				<allowedValue>AuthenticationFailed</allowedValue>
				<allowedValue>Authenticated</allowedValue>
				<allowedValue>Denied</allowedValue>
				<allowedValue>Expired</allowedValue>
			</allowedValueList>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>Description</name>
			<dataType>string</dataType>
			<defaultValue>""</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>MAC_Address</name>
			<dataType>string</dataType>
			<defaultValue>""</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>AuthFailedCounter</name>
			<dataType>ui4</dataType>
			<defaultValue>0</defaultValue>
		</stateVariable>
		<stateVariable sendEvents="no">
			<name>AuthSucceededCounter</name>
			<dataType>ui4</dataType>
			<defaultValue>0</defaultValue>
		</stateVariable>
	</serviceStateTable>
</scpd>


text:
void atomic_fixnum_mark(void *value) {
  rb_gc_mark_maybe((VALUE) value);
}

VALUE atomic_fixnum_allocate(VALUE klass) {
  return rb_data_object_alloc(klass, (void *) Qnil, atomic_fixnum_mark, NULL);
}

VALUE method_atomic_fixnum_initialize(int argc, VALUE* argv, VALUE self) {
  VALUE value = LL2NUM(0);
  rb_check_arity(argc, 0, 1);
  if (argc == 1) {
    Check_Type(argv[0], T_FIXNUM);
    value = argv[0];
  }
  DATA_PTR(self) = (void *) value;
  return(self);
}

VALUE method_atomic_fixnum_value(VALUE self) {
  return (VALUE) DATA_PTR(self);
}

VALUE method_atomic_fixnum_value_set(VALUE self, VALUE value) {
  Check_Type(value, T_FIXNUM);
  DATA_PTR(self) = (void *) value;
  return(value);
}

VALUE method_atomic_fixnum_increment(int argc, VALUE* argv, VALUE self) {
  long long value = NUM2LL((VALUE) DATA_PTR(self));
  long long delta = 1;
  rb_check_arity(argc, 0, 1);
  if (argc == 1) {
    Check_Type(argv[0], T_FIXNUM);
    delta = NUM2LL(argv[0]);
  }
  return method_atomic_fixnum_value_set(self, LL2NUM(value + delta));
}

VALUE method_atomic_fixnum_decrement(int argc, VALUE* argv, VALUE self) {
  long long value = NUM2LL((VALUE) DATA_PTR(self));
  long long delta = 1;
  rb_check_arity(argc, 0, 1);
  if (argc == 1) {
    Check_Type(argv[0], T_FIXNUM);
    delta = NUM2LL(argv[0]);
  }
  return method_atomic_fixnum_value_set(self, LL2NUM(value - delta));
}

VALUE method_atomic_fixnum_compare_and_set(VALUE self, VALUE rb_expect, VALUE rb_update) {
  Check_Type(rb_expect, T_FIXNUM);
  Check_Type(rb_update, T_FIXNUM);
  return ir_compare_and_set(self, rb_expect, rb_update);
}

VALUE method_atomic_fixnum_update(VALUE self) {
  VALUE old_value, new_value;
  for (;;) {
    old_value = method_atomic_fixnum_value(self);
    new_value = rb_yield(old_value);
    if (ir_compare_and_set(self, old_value, new_value) == Qtrue) {
      return new_value;
    }
  }
}


text:
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad

# Enable color in grep
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='3;33'

# History: don't store duplicates
export HISTCONTROL=erasedups
# History: 10,000 entries
export HISTSIZE=10000


text:
import re
from copy import copy
from datetime import datetime

from django.conf import settings
from django.contrib.sites.models import Site
from django.core import mail
from django.core.cache import cache

import bleach
import mock
import waffle
from nose.tools import eq_
from test_utils import RequestFactory

from kitsune.sumo.tests import TestCase
from kitsune.users.tests import add_permission, user
from kitsune.wiki.models import Revision, Document
from kitsune.wiki.tasks import (
    send_reviewed_notification, rebuild_kb, schedule_rebuild_kb,
    _rebuild_kb_chunk, render_document_cascade)
from kitsune.wiki.tests import TestCaseBase, revision
from kitsune.wiki.tests.test_parser import doc_rev_parser

REVIEWED_EMAIL_CONTENT = """Your revision has been reviewed.

%s has approved your revision to the document %s.

Message from the reviewer:

%s

To view the history of this document, click the following link, or paste \
it into your browser's location bar:

https://testserver/en-US/kb/%s/history
"""

class RebuildTestCase(TestCase):
    rf = RequestFactory()
    ALWAYS_EAGER = settings.CELERY_ALWAYS_EAGER

    def setUp(self):
        # create some random revisions.

        revision(save=True)
        revision(is_approved=True, save=True)
        revision(is_approved=True, save=True)
        revision(is_approved=True, save=True)
        revision(is_approved=True, save=True)

        # TODO: fix this crap
        self.old_settings = copy(settings._wrapped.__dict__)
        settings.CELERY_ALWAYS_EAGER = True

    def tearDown(self):
        cache.delete(settings.WIKI_REBUILD_TOKEN)
        settings._wrapped.__dict__ = self.old_settings
        settings.CELERY_ALWAYS_EAGER = self.ALWAYS_EAGER

    @mock.patch.object(rebuild_kb, 'delay')
    @mock.patch.object(waffle, 'switch_is_active')
    def test_eager_queue(self, switch_is_active, delay):
        switch_is_active.return_value = True
        schedule_rebuild_kb()
        assert not cache.get(settings.WIKI_REBUILD_TOKEN)
        assert not delay.called

    @mock.patch.object(rebuild_kb, 'delay')
    @mock.patch.object(waffle, 'switch_is_active')
    def test_task_queue(self, switch_is_active, delay):
        switch_is_active.return_value = True
        settings.CELERY_ALWAYS_EAGER = False
        schedule_rebuild_kb()
        assert cache.get(settings.WIKI_REBUILD_TOKEN)
        assert delay.called

    @mock.patch.object(rebuild_kb, 'delay')
    @mock.patch.object(waffle, 'switch_is_active')
    def test_already_queued(self, switch_is_active, delay):
        switch_is_active.return_value = True
        cache.set(settings.WIKI_REBUILD_TOKEN, True)
        schedule_rebuild_kb()
        assert cache.get(settings.WIKI_REBUILD_TOKEN)
        assert not delay.called

    @mock.patch.object(rebuild_kb, 'delay')
    @mock.patch.object(cache, 'get')
    @mock.patch.object(waffle, 'switch_is_active')
    def test_dont_queue(self, switch_is_active, get, delay):
        switch_is_active.return_value = False
        schedule_rebuild_kb()
        assert not get.called
        assert not delay.called

    @mock.patch.object(_rebuild_kb_chunk, 'apply_async')
    def test_rebuild_chunk(self, apply_async):
        cache.set(settings.WIKI_REBUILD_TOKEN, True)
        rebuild_kb()
        assert not cache.get(settings.WIKI_REBUILD_TOKEN)
        assert 'args' in apply_async.call_args[1]
        # There should be 4 documents with an approved revision
        eq_(4, len(apply_async.call_args[1]['args'][0]))

class ReviewMailTestCase(TestCaseBase):
    """Test that the review mail gets sent."""

    def setUp(self):
        self.user = user(save=True)
        add_permission(self.user, Revision, 'review_revision')

    def _approve_and_send(self, revision, reviewer, message):
        revision.reviewer = reviewer
        revision.reviewed = datetime.now()
        revision.is_approved = True
        revision.save()
        send_reviewed_notification(revision, revision.document, message)

    @mock.patch.object(Site.objects, 'get_current')
    def test_reviewed_notification(self, get_current):
        get_current.return_value.domain = 'testserver'

        rev = revision()
        doc = rev.document
        msg = 'great work!'
        self._approve_and_send(rev, self.user, msg)

        # Two emails will be sent, one each for the reviewer and the reviewed.
        eq_(2, len(mail.outbox))
        eq_('Your revision has been approved: %s' % doc.title,
            mail.outbox[0].subject)
        eq_([rev.creator.email], mail.outbox[0].to)
        eq_(REVIEWED_EMAIL_CONTENT % (
            self.user.username, doc.title, msg, doc.slug), mail.outbox[0].body)

    @mock.patch.object(Site.objects, 'get_current')
    def test_reviewed_by_creator_no_notification(self, get_current):
        get_current.return_value.domain = 'testserver'

        rev = revision()
        msg = "great work!"
        self._approve_and_send(rev, rev.creator, msg)

        # Verify no email was sent
        eq_(0, len(mail.outbox))

    @mock.patch.object(Site.objects, 'get_current')
    def test_unicode_notifications(self, get_current):
        get_current.return_value.domain = 'testserver'

        rev = revision()
        doc = rev.document
        doc.title = u'Foo \xe8 incode'
        msg = 'foo'
        self._approve_and_send(rev, self.user, msg)

        # Two emails will be sent, one each for the reviewer and the reviewed.
        eq_(2, len(mail.outbox))
        eq_('Your revision has been approved: %s' % doc.title,
            mail.outbox[0].subject)

    @mock.patch.object(Site.objects, 'get_current')
    def test_escaping(self, get_current):
        get_current.return_value.domain = 'testserver'

        rev = revision()
        doc = rev.document
        doc.title = '"All about quotes"'
        msg = 'foo & "bar"'
        self._approve_and_send(rev, self.user, msg)

        # Two emails will be sent, one each for the reviewer and the reviewed.
        eq_(2, len(mail.outbox))
        eq_('Your revision has been approved: %s' % doc.title,
            mail.outbox[0].subject)
        assert '"' not in mail.outbox[0].body
        assert '"All about quotes"' in mail.outbox[0].body
        assert 'foo & "bar"' in mail.outbox[0].body

class TestDocumentRenderCascades(TestCaseBase):

    def _clean(self, d):
        """
        Get a clean and normalized version of a documents html.

        This grabs uncached copies from the DB, because the in memory
        objects used in the test don't get updated during the cascade.
        """
        html = Document.uncached.get(slug=d.slug).html
        return re.sub(r'\s+', ' ', bleach.clean(html, strip=True)).strip()

    def test_cascade(self):
        d1, _, _ = doc_rev_parser('one ', title='Template:D1')
        d2, _, _ = doc_rev_parser('[[T:D1]] two', title='Template:D2')
        d3, _, _ = doc_rev_parser('[[T:D1]] [[T:D2]] three', title='D3')

        eq_(self._clean(d3), u'one one two three')

        revision(document=d1, content='ONE', is_approved=True, save=True)
        render_document_cascade(d1)

        eq_(self._clean(d1), u'ONE')
        eq_(self._clean(d2), u'ONE two')
        eq_(self._clean(d3), u'ONE ONE two three')


text:
Array: Empty
--DESCRIPTION--
Generated by scripts/convert-bson-corpus-tests.php

DO NOT EDIT THIS FILE
--FILE--
<?php

require_once __DIR__ . '/../utils/tools.php';

$canonicalBson = hex2bin('0D000000046100050000000000');
$canonicalExtJson = '{"a" : []}';

// Canonical BSON -> Native -> Canonical BSON
echo bin2hex(fromPHP(toPHP($canonicalBson))), "\n";

// Canonical BSON -> Canonical extJSON
echo json_canonicalize(toCanonicalExtendedJSON($canonicalBson)), "\n";

// Canonical extJSON -> Canonical BSON
echo bin2hex(fromJSON($canonicalExtJson)), "\n";

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
0d000000046100050000000000
{"a":[]}
0d000000046100050000000000
===DONE===


text:
#pragma once

#include <CL/sycl.hpp>
#include <memory>
#include <mutex>
#include <string>
#include <vector>

#ifndef AF_ONEAPI_MEM_DEBUG
#define AF_ONEAPI_MEM_DEBUG 0
#endif

namespace spdlog {
class logger;
}

namespace graphics {
class ForgeManager;
}

namespace common {
namespace memory {
class MemoryManagerBase;
}
}  // namespace common

using common::memory::MemoryManagerBase;

namespace oneapi {

// opencl namespace forward declarations
class GraphicsResourceManager;
struct kc_entry_t;  // kernel cache entry

class DeviceManager {
    friend MemoryManagerBase& memoryManager();

    friend void setMemoryManager(std::unique_ptr<MemoryManagerBase> mgr);

    void setMemoryManager(std::unique_ptr<MemoryManagerBase> mgr);

    friend void resetMemoryManager();

    void resetMemoryManager();

    friend MemoryManagerBase& pinnedMemoryManager();

    friend void setMemoryManagerPinned(std::unique_ptr<MemoryManagerBase> mgr);

    void setMemoryManagerPinned(std::unique_ptr<MemoryManagerBase> mgr);

    friend void resetMemoryManagerPinned();

    void resetMemoryManagerPinned();

    friend graphics::ForgeManager& forgeManager();

    friend GraphicsResourceManager& interopManager();

    friend void addKernelToCache(int device, const std::string& key,
                                 const kc_entry_t entry);

    friend void removeKernelFromCache(int device, const std::string& key);

    friend kc_entry_t kernelCache(int device, const std::string& key);

    friend std::string getDeviceInfo() noexcept;

    friend int getDeviceCount() noexcept;

    // friend int getDeviceIdFromNativeId(cl_device_id id);

    friend const sycl::context& getContext();

    friend sycl::queue& getQueue();

    friend const sycl::device& getDevice(int id);

    friend size_t getDeviceMemorySize(int device);

    friend bool isGLSharingSupported();

    friend bool isDoubleSupported(unsigned device);

    friend bool isHalfSupported(unsigned device);

    friend void devprop(char* d_name, char* d_platform, char* d_toolkit,
                        char* d_compute);

    friend int setDevice(int device);

    friend void addDeviceContext(sycl::device dev, sycl::context ctx,
                                 sycl::queue que);

    friend void setDeviceContext(sycl::device dev, sycl::context ctx);

    friend void removeDeviceContext(sycl::device dev, sycl::context ctx);

    friend int getActiveDeviceType();

    friend int getActivePlatform();

   public:
    static const int MAX_DEVICES = 32;

    static DeviceManager& getInstance();

    ~DeviceManager();

    spdlog::logger* getLogger();

   protected:
    DeviceManager();

    // Following two declarations are required to
    // avoid copying accidental copy/assignment
    // of instance returned by getInstance to other
    // variables
    DeviceManager(DeviceManager const&);
    void operator=(DeviceManager const&);
    void markDeviceForInterop(const int device, const void* wHandle);

   private:
    // Attributes
    std::shared_ptr<spdlog::logger> logger;
    std::mutex deviceMutex;
    std::vector<std::unique_ptr<sycl::device>> mDevices;
    std::vector<std::unique_ptr<sycl::context>> mContexts;
    std::vector<std::unique_ptr<sycl::queue>> mQueues;
    std::vector<bool> mIsGLSharingOn;
    std::vector<int> mDeviceTypes;
    std::vector<int> mPlatforms;
    unsigned mUserDeviceOffset;

    std::unique_ptr<graphics::ForgeManager> fgMngr;
    std::unique_ptr<MemoryManagerBase> memManager;
    std::unique_ptr<MemoryManagerBase> pinnedMemManager;
    std::unique_ptr<GraphicsResourceManager> gfxManagers[MAX_DEVICES];
    std::mutex mutex;

    // using BoostProgCache = boost::shared_ptr<boost::compute::program_cache>;
    // std::vector<BoostProgCache*> mBoostProgCacheVector;
};

}  // namespace oneapi


text: - Fixed an unnecessary error that was raised while searching indicators.


text:
<?php

namespace PH7;

defined('PH7') or exit('Restricted access');

use PH7\Framework\Date\CDateTime;
use PH7\Framework\Http\Http;
use PH7\Framework\Mvc\Model\DbConfig;
use PH7\Framework\Mvc\Request\Http as HttpRequest;
use PH7\Framework\Security\Spam\Captcha\Captcha;
use PH7\Framework\Security\Validate\Validate;
use PH7\Framework\Str\Str;
use PH7\JustHttp\StatusCode;

class ValidateCoreAjax
{
    /** @var Str */
    private $oStr;

    /** @var Validate */
    private $oValidate;

    /** @var ExistsCoreModel */
    private $oExistsModel;

    /** @var string Default message value */
    private $sMsg = ' ';

    /** @var int By default the status is in "failure" (0 = fail, 1 = OK) */
    private $iStatus = 0; //

    public function __construct()
    {
        $this->oStr = new Str;
        $this->oValidate = new Validate;
        $this->oExistsModel = new ExistsCoreModel;
    }

    /**
     * Support for AJAX validation, checking the values.
     *
     * @param string $sInputVal
     * @param string $sFieldId
     * @param string $sParam1
     * @param string $sParam2
     *
     * @return void
     */
    public function form($sInputVal, $sFieldId, $sParam1, $sParam2)
    {
        $sInputVal = $this->oStr->escape($sInputVal, true);

        // Determine the field to validate and perform validation.
        if (strstr($sFieldId, 'str_')) {   // Check Text
            $this->txt($sInputVal, $sParam1, $sParam2);
        } elseif (strstr($sFieldId, 'name_')) {
            $this->name($sInputVal);
        } elseif (strstr($sFieldId, 'email')) {   // Check email address.
            $this->email($sInputVal, $sParam1, $sParam2);
        } elseif (strstr($sFieldId, 'url')) {  // Check the url address.
            $this->url($sInputVal);
        } elseif (strstr($sFieldId, 'phone')) {
            // Check the phone number
            $this->phone($sInputVal);
        } else {
            switch ($sFieldId) {
                // Check that the username is valid.
                case 'username':
                    $this->username($sInputVal, $sParam1);
                    break;

                // Check Password.
                case 'password':
                    $this->password($sInputVal);
                    break;

                // Check of the date of birth
                case 'birth_date':
                    $this->birthDate($sInputVal);
                    break;

                // Check the captcha.
                case 'ccaptcha':
                    $this->captcha($sInputVal);
                    break;

                // Check acceptance of the terms of use.
                case 'terms-0':
                    $this->terms($sInputVal);
                    break;

                // If we receive another invalid value, we display a message with a HTTP header.
                default:
                    Http::setHeadersByCode(StatusCode::BAD_REQUEST);
                    exit('Bad Request Error!');
            }
        }

        echo json_encode(['status' => $this->iStatus, 'msg' => $this->sMsg, 'fieldId' => $sFieldId]);
    }

    /**
     * Validate the username (must not be empty or already known).
     *
     * @param string $sValue
     * @param string $sTable
     *
     * @return void
     */
    protected function username($sValue, $sTable)
    {
        if (!$this->isDbTableValid($sTable)) {
            $sTable = DbTableName::MEMBER;
        }

        $iMin = DbConfig::getSetting('minUsernameLength');
        $iMax = DbConfig::getSetting('maxUsernameLength');

        $this->iStatus = $this->oValidate->username($sValue, $iMin, $iMax, $sTable) ? 1 : 0;
        $this->sMsg = $this->iStatus ? t('This Username is available!') : t('Sorry, but this Username is not available.');
    }

    /**
     * Validate the email address.
     *
     * @param string $sValue
     * @param string $sParam
     * @param string $sTable
     *
     * @return void
     */
    protected function email($sValue, $sParam, $sTable)
    {
        if (!$this->isDbTableValid($sTable)) {
            $sTable = DbTableName::MEMBER;
        }

        if (!$this->oValidate->email($sValue)) {
            $this->sMsg = t('Invalid Email Address!');
        } elseif ($sParam === 'guest' && $this->oExistsModel->email($sValue, $sTable)) {
            $this->sMsg = t('This email already used by another member.');
        } elseif ($sParam === 'user' && !$this->oExistsModel->email($sValue, $sTable)) {
            $this->sMsg = t('Oops! "%0%" is not associated with any %site_name% accounts.', substr($sValue, 0, 50));
        } else {
            $this->iStatus = 1;
            $this->sMsg = t('Valid Email!');
        }
    }

    /**
     * Validation of the password.
     *
     * @param string $sValue
     *
     * @return void
     */
    protected function password($sValue)
    {
        $iMin = DbConfig::getSetting('minPasswordLength');
        $iMax = DbConfig::getSetting('maxPasswordLength');

        if (!$this->oValidate->password($sValue, $iMin, $iMax)) {
            $this->sMsg = t('Your Password has to contain from %0% to %1% characters.', $iMin, $iMax);
        } else {
            $this->iStatus = 1;
            $this->sMsg = t('Correct Password!');
        }
    }

    /**
     * Validation of the date and birthday.
     *
     * @param string $sValue
     *
     * @return void
     */
    protected function birthDate($sValue)
    {
        $iMin = DbConfig::getSetting('minAgeRegistration');
        $iMax = DbConfig::getSetting('maxAgeRegistration');

        // Format the date to the needed format
        $sValue = (new CDateTime)->get($sValue)->date('m/d/Y');

        if (!$this->oValidate->date($sValue)) {
            $this->sMsg = t('Your must enter a valid date (Month-Day-Year).');
        } elseif (!$this->oValidate->birthDate($sValue, $iMin, $iMax)) {
            $this->sMsg = t('You must be %0% to %1% years to register on the site.', $iMin, $iMax);
        } else {
            $this->iStatus = 1;
            $this->sMsg = t('OK!');
        }
    }

    /**
     * Check whether the type of a variable is string.
     *
     * @param string $sValue
     * @param int $iMin
     * @param int $iMax
     *
     * @return void
     */
    protected function txt($sValue, $iMin = null, $iMax = null)
    {
        $sValue = trim($sValue);
        if (!empty($sValue)) {
            if (!empty($iMin) && $this->oStr->length($sValue) < $iMin) {
                $this->sMsg = t('Please, enter %0% character(s) or more.', $iMin);
            } elseif (!empty($iMax) && $this->oStr->length($sValue) > $iMax) {
                $this->sMsg = t('Please, enter %0% character(s) or less.', $iMax);
            } elseif (!is_string($sValue)) {
                $this->sMsg = t('Please enter a string.');
            } else {
                $this->iStatus = 1;
                $this->sMsg = t('OK!');
            }
        } else {
            $this->sMsg = t('This field is required!');
        }
    }

    /**
     * Validation of names.
     *
     * @param string $sValue
     *
     * @return void
     */
    protected function name($sValue)
    {
        if (!$this->oValidate->name($sValue)) {
            $this->sMsg = t("Your name doesn't seem to be correct.");
        } else {
            $this->iStatus = 1;
            $this->sMsg = t('OK!');
        }
    }

    /**
     * Validation of the url.
     *
     * @param string $sValue
     *
     * @return void
     */
    protected function url($sValue)
    {
        if (!$this->oValidate->url($sValue)) {
            $this->sMsg = t('Your must enter a valid url (e.g. http://ph7builder.com).');
        } else {
            $this->iStatus = 1;
            $this->sMsg = t('OK!');
        }
    }

    /**
     * Validate Captcha.
     *
     * @return string $sValue
     *
     * @return void
     */
    protected function captcha($sValue)
    {
        $bIsCaseSensitive = (bool)DbConfig::getSetting('captchaCaseSensitive');

        if ((new Captcha)->check($sValue, $bIsCaseSensitive)) {
            $this->iStatus = 1;
            $this->sMsg = t('OK!');
        } else {
            $this->sMsg = t('Captcha check failed!');
        }
    }

    /**
     * Validate international phone numbers in EPP format.
     *
     * @return string $sValue
     *
     * @return void
     */
    protected function phone($sValue)
    {
        if (!$this->oValidate->phone($sValue)) {
            $this->sMsg = t('Please enter a correct phone number with area code!');
        } else {
            $this->iStatus = 1;
            $this->sMsg = t('OK!');
        }
    }

    /**
     * Validation of the acceptance of the terms of use.
     *
     * @param string $sValue
     *
     * @return void
     */
    protected function terms($sValue)
    {
        if ($sValue !== 'true') {
            $this->sMsg = t('You need to read and accept the terms of use.');
        } else {
            $this->iStatus = 1;
        }
    }

    /**
     * @param string $sTable The table name.
     *
     * @return bool
     */
    private function isDbTableValid($sTable)
    {
        return in_array($sTable, DbTableName::USER_TABLES, true);
    }
}

$oHttpRequest = new HttpRequest;
if ($oHttpRequest->postExists('fieldId')) {
    (new ValidateCoreAjax)->form(
        $oHttpRequest->post('inputVal'),
        $oHttpRequest->post('fieldId'),
        $oHttpRequest->post('param1'),
        $oHttpRequest->post('param2')
    );
}
unset($oHttpRequest);


text:
package org.apache.commons.collections.functors;

import java.io.Serializable;

import org.apache.commons.collections.Closure;
import org.apache.commons.collections.Transformer;

/**
 * Transformer implementation that calls a Closure using the input object
 * and then returns the input.
 *
 * @since Commons Collections 3.0
 * @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
 *
 * @author Stephen Colebourne
 */
public class ClosureTransformer implements Transformer, Serializable {

    /** Serial version UID */
    private static final long serialVersionUID = 478466901448617286L;

    /** The closure to wrap */
    private final Closure iClosure;

    /**
     * Factory method that performs validation.
     *
     * @param closure  the closure to call, not null
     * @return the closure transformer
     * @throws IllegalArgumentException if the closure is null
     */
    public static Transformer getInstance(Closure closure) {
        if (closure == null) {
            throw new IllegalArgumentException("Closure must not be null");
        }
        return new ClosureTransformer(closure);
    }

    /**
     * Constructor that performs no validation.
     * Use getInstance if you want that.
     *
     * @param closure  the closure to call, not null
     */
    public ClosureTransformer(Closure closure) {
        super();
        iClosure = closure;
    }

    /**
     * Transforms the input to result by executing a closure.
     *
     * @param input  the input object to transform
     * @return the transformed result
     */
    public Object transform(Object input) {
        iClosure.execute(input);
        return input;
    }

    /**
     * Gets the closure.
     *
     * @return the closure
     * @since Commons Collections 3.1
     */
    public Closure getClosure() {
        return iClosure;
    }

}


text:
function New-IsoFile
{
  <#
   .Synopsis
    Creates a new .iso file
   .Description
    The New-IsoFile cmdlet creates a new .iso file containing content from chosen folders
   .Example
    New-IsoFile "c:\tools","c:\Downloads\utils"
    Description
    -----------
    This command creates a .iso file in $env:temp folder (default location) that contains c:\tools and c:\downloads\utils folders. The folders themselves are added in the root of the .iso image.
   .Example
    dir c:\WinPE | New-IsoFile -Path c:\temp\WinPE.iso -BootFile etfsboot.com -Media DVDPLUSR -Title "WinPE"
    Description
    -----------
    This command creates a bootable .iso file containing the content from c:\WinPE folder, but the folder itself isn't included. Boot file etfsboot.com can be found in Windows AIK. Refer to IMAPI_MEDIA_PHYSICAL_TYPE enumeration for possible media types:

      http://msdn.microsoft.com/en-us/library/windows/desktop/aa366217(v=vs.85).aspx
   .Notes
    NAME:  New-IsoFile
    AUTHOR: Chris Wu
    LASTEDIT: 03/06/2012 14:06:16
 #>

  Param (
    [parameter(Position=0,Mandatory=$true,ValueFromPipeline=$true)]$Source,
    [parameter(Position=1)][string]$Path = "$($env:temp)\" + (Get-Date).ToString("yyyyMMdd-HHmmss.ffff") + ".iso",
    [string] $BootFile = $null,
    [string] $Media = "Disk",
    [string] $Title = (Get-Date).ToString("yyyyMMdd-HHmmss.ffff"),
    [switch] $Force
  )#End Param

  Begin {
    ($cp = new-object System.CodeDom.Compiler.CompilerParameters).CompilerOptions = "/unsafe"
    if (!("ISOFile" -as [type])) {
      Add-Type -IgnoreWarnings -CompilerParameters $cp -TypeDefinition @"
public class ISOFile
{
    public unsafe static void Create(string Path, object Stream, int BlockSize, int TotalBlocks)
    {
        int bytes = 0;
        byte[] buf = new byte[BlockSize];
        System.IntPtr ptr = (System.IntPtr)(&bytes);
        System.IO.FileStream o = System.IO.File.OpenWrite(Path);
        System.Runtime.InteropServices.ComTypes.IStream i = Stream as System.Runtime.InteropServices.ComTypes.IStream;

        if (o == null) { return; }
        while (TotalBlocks-- > 0) {
            i.Read(buf, BlockSize, ptr); o.Write(buf, 0, bytes);
        }
        o.Flush(); o.Close();
    }
}
"@
    }#End If

    if ($BootFile -and (Test-Path $BootFile)) {
      ($Stream = New-Object -ComObject ADODB.Stream).Open()
      $Stream.Type = 1  # adFileTypeBinary
      $Stream.LoadFromFile((Get-Item $BootFile).Fullname)
      ($Boot = New-Object -ComObject IMAPI2FS.BootOptions).AssignBootImage($Stream)
    }#End If

    $MediaType = @{CDR=2; CDRW=3; DVDRAM=5; DVDPLUSR=6; DVDPLUSRW=7; DVDPLUSR_DUALLAYER=8; DVDDASHR=9; DVDDASHRW=10; DVDDASHR_DUALLAYER=11; DISK=12; DVDPLUSRW_DUALLAYER=13; BDR=18; BDRE=19 }

    if ($MediaType[$Media] -eq $null) { write-debug "Unsupported Media Type: $Media"; write-debug ("Choose one from: " + $MediaType.Keys); break }
    ($Image = new-object -com IMAPI2FS.MsftFileSystemImage -Property @{VolumeName=$Title}).ChooseImageDefaultsForMediaType($MediaType[$Media])

    if ((Test-Path $Path) -and (!$Force)) { "File Exists $Path"; break }
    if (!($Target = New-Item -Path $Path -ItemType File -Force)) { "Cannot create file $Path"; break }
  }

  Process {
    switch ($Source) {
      { $_ -is [string] } { $Image.Root.AddTree((Get-Item $_).FullName, $true); continue }
      { $_ -is [IO.FileInfo] } { $Image.Root.AddTree($_.FullName, $true); continue }
      { $_ -is [IO.DirectoryInfo] } { $Image.Root.AddTree($_.FullName, $true); continue }
    }#End switch
  }#End Process

  End {
    if ($Boot) { $Image.BootImageOptions=$Boot }
    $Result = $Image.CreateResultImage()
    [ISOFile]::Create($Target.FullName,$Result.ImageStream,$Result.BlockSize,$Result.TotalBlocks)
    $Target
  }#End End
}#End function New-IsoFile


text:
package io.proleap.cobol.asg.metamodel.procedure.sort.impl;

import io.proleap.cobol.CobolParser.SortCollatingAlphanumericContext;
import io.proleap.cobol.asg.metamodel.ProgramUnit;
import io.proleap.cobol.asg.metamodel.call.Call;
import io.proleap.cobol.asg.metamodel.impl.CobolDivisionElementImpl;
import io.proleap.cobol.asg.metamodel.procedure.sort.Alphanumeric;

public class AlphanumericImpl extends CobolDivisionElementImpl implements Alphanumeric {

	protected Call alphabetCall;

	protected final SortCollatingAlphanumericContext ctx;

	public AlphanumericImpl(final ProgramUnit programUnit, final SortCollatingAlphanumericContext ctx) {
		super(programUnit, ctx);

		this.ctx = ctx;
	}

	@Override
	public Call getAlphabetCall() {
		return alphabetCall;
	}

	@Override
	public void setAlphabetCall(final Call alphabetCall) {
		this.alphabetCall = alphabetCall;
	}
}


text:
package se.sitic.megatron.rss;

/**
 * Thrown if parsing of RSS fails.
 */
public class RssParseException extends RssException {
    private static final long serialVersionUID = 1L;

    public RssParseException(String msg) {
        super(msg);
    }

    public RssParseException(String msg, Throwable cause) {
        super(msg, cause);
    }

}


text:
require 'puppet'
Facter.add(:asterisk_version) do
  setcode do
    version = Facter::Util::Resolution.exec("asterisk -rx \"core show version\"")
    if version
      version.match(/\d+\.\d+\.\d+/).to_s
    else
      nil
    end
  end
end


text:
SOURCE = truncated-normal-distribution-density-function
DELAY = 80
DENSITY = 300
WIDTH = 512

make:
	pdflatex --shell-escape $(SOURCE).tex -output-format=pdf
	make clean

clean:
	rm -rf  $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.table

gif:
	pdfcrop $(SOURCE).pdf
	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
	make clean

png:
	make
	make svg
	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png

transparentGif:
	convert $(SOURCE).pdf -transparent white result.gif
	make clean

svg:
	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
	pdf2svg $(SOURCE).pdf $(SOURCE).svg
	# Necessary, as pdf2svg does not always create valid svgs:
	inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
	rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
	rm $(SOURCE)1.svg


text:
package min_stack

// https://leetcode.com/problems/min-stack/description/

type MinStack struct {
	data     []Item
	min_data int
}

type Item struct {
	data     int
	min_data int
}

/** initialize your data structure here. */
func Constructor() MinStack {
	return MinStack{
		data: []Item{},
	}
}

func (this *MinStack) Push(x int) {
	if x < this.min_data || 0 == len(this.data) {
		this.min_data = x
	}

	this.data = append(this.data, Item{data: x, min_data: this.min_data})
}

func (this *MinStack) Pop() {
	if 0 == len(this.data) {
		return
	}

	this.data = append(this.data[:len(this.data)-1])

	if 0 == len(this.data) {
		return
	}

	this.min_data = this.data[len(this.data)-1].min_data
}

func (this *MinStack) Top() int {
	return this.data[len(this.data)-1].data
}

func (this *MinStack) GetMin() int {
	return this.min_data
}


text:
#include "kernel_lion_encode.h"

DENSITY_FORCE_INLINE DENSITY_KERNEL_ENCODE_STATE density_lion_encode_exit_process(density_lion_encode_state *state, DENSITY_LION_ENCODE_PROCESS process, DENSITY_KERNEL_ENCODE_STATE kernelEncodeState) {
    state->process = process;
    return kernelEncodeState;
}

DENSITY_FORCE_INLINE void density_lion_encode_prepare_new_signature(density_memory_location *restrict out, density_lion_encode_state *restrict state) {
    state->signature = (density_lion_signature *) (out->pointer);
    state->proximitySignature = 0;

    out->pointer += sizeof(density_lion_signature);
}

DENSITY_FORCE_INLINE DENSITY_KERNEL_ENCODE_STATE density_lion_encode_check_block_state(density_lion_encode_state *restrict state) {
    if(density_unlikely(!(state->chunksCount & (DENSITY_LION_CHUNKS_PER_PROCESS_UNIT_BIG - 1)))) {
        if (density_unlikely((state->chunksCount >= DENSITY_LION_PREFERRED_EFFICIENCY_CHECK_CHUNKS) && (!state->efficiencyChecked))) {
            state->efficiencyChecked = true;
            return DENSITY_KERNEL_ENCODE_STATE_INFO_EFFICIENCY_CHECK;
        } else if (density_unlikely(state->chunksCount >= DENSITY_LION_PREFERRED_BLOCK_CHUNKS)) {
            state->chunksCount = 0;
            state->efficiencyChecked = false;

#if DENSITY_ENABLE_PARALLELIZABLE_DECOMPRESSIBLE_OUTPUT == DENSITY_YES
            if (state->resetCycle)
                state->resetCycle--;
            else {
                density_lion_dictionary_reset(&state->dictionary);
                state->resetCycle = DENSITY_DICTIONARY_PREFERRED_RESET_CYCLE - 1;
            }
#endif

            return DENSITY_KERNEL_ENCODE_STATE_INFO_NEW_BLOCK;
        }
    }

    return DENSITY_KERNEL_ENCODE_STATE_READY;
}

DENSITY_FORCE_INLINE void density_lion_encode_push_to_proximity_signature(density_lion_encode_state *restrict state, const uint64_t content, const uint_fast8_t bits) {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
    state->proximitySignature |= (content << state->shift);
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
    state->proximitySignature |= (content << ((56 - (state->shift & ~0x7)) + (state->shift & 0x7)));
#else
#error Unknow endianness
#endif

    state->shift += bits;
}

DENSITY_FORCE_INLINE void density_lion_encode_push_to_signature(density_memory_location *restrict out, density_lion_encode_state *restrict state, const uint64_t content, const uint_fast8_t bits) {
    if (density_likely(state->shift)) {
        density_lion_encode_push_to_proximity_signature(state, content, bits);

        if (density_unlikely(state->shift >= density_bitsizeof(density_lion_signature))) {
            DENSITY_MEMCPY(state->signature, &state->proximitySignature, sizeof(density_lion_signature));

            const uint_fast8_t remainder = (uint_fast8_t)(state->shift & 0x3f);
            state->shift = 0;
            if (remainder) {
                density_lion_encode_prepare_new_signature(out, state);
                density_lion_encode_push_to_proximity_signature(state, content >> (bits - remainder), remainder);
            }
        }
    } else {
        density_lion_encode_prepare_new_signature(out, state);
        density_lion_encode_push_to_proximity_signature(state, content, bits);
    }
}

DENSITY_FORCE_INLINE void density_lion_encode_push_zero_to_signature(density_memory_location *restrict out, density_lion_encode_state *restrict state, const uint_fast8_t bits) {
    if (density_likely(state->shift)) {
        state->shift += bits;

        if (density_unlikely(state->shift >= density_bitsizeof(density_lion_signature))) {
            DENSITY_MEMCPY(state->signature, &state->proximitySignature, sizeof(density_lion_signature));

            const uint_fast8_t remainder = (uint_fast8_t)(state->shift & 0x3f);
            if (remainder) {
                density_lion_encode_prepare_new_signature(out, state);
                state->shift = remainder;
            } else
                state->shift = 0;
        }
    } else {
        density_lion_encode_prepare_new_signature(out, state);
        state->shift = bits;
    }
}

DENSITY_FORCE_INLINE void density_lion_encode_push_code_to_signature(density_memory_location *restrict out, density_lion_encode_state *restrict state, const density_lion_entropy_code code) {
    density_lion_encode_push_to_signature(out, state, code.value, code.bitLength);
}

DENSITY_FORCE_INLINE void density_lion_encode_kernel(density_memory_location *restrict out, const uint16_t hash, const uint32_t chunk, density_lion_encode_state *restrict state) {
    density_lion_dictionary *const dictionary = &state->dictionary;
    density_lion_dictionary_chunk_prediction_entry *const predictions = &dictionary->predictions[state->lastHash];
    __builtin_prefetch(&dictionary->predictions[hash]);

    if (*(uint32_t *) predictions ^ chunk) {
        if (*((uint32_t *) predictions + 1) ^ chunk) {
            if (*((uint32_t *) predictions + 2) ^ chunk) {
                density_lion_dictionary_chunk_entry *const in_dictionary = &dictionary->chunks[hash];
                if (*(uint32_t *) in_dictionary ^ chunk) {
                    if (*((uint32_t *) in_dictionary + 1) ^ chunk) {
                        if (*((uint32_t *) in_dictionary + 2) ^ chunk) {
                            if (*((uint32_t *) in_dictionary + 3) ^ chunk) {
                                density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_PLAIN));
                                DENSITY_MEMCPY(out->pointer, &chunk, sizeof(uint32_t));
                                out->pointer += sizeof(uint32_t);
                            } else {
                                density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_DICTIONARY_D));
                                DENSITY_MEMCPY(out->pointer, &hash, sizeof(uint16_t));
                                out->pointer += sizeof(uint16_t);
                            }
                        } else {
                            density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_DICTIONARY_C));
                            DENSITY_MEMCPY(out->pointer, &hash, sizeof(uint16_t));
                            out->pointer += sizeof(uint16_t);
                        }
                    } else {
                        density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_DICTIONARY_B));
                        DENSITY_MEMCPY(out->pointer, &hash, sizeof(uint16_t));
                        out->pointer += sizeof(uint16_t);
                    }
                    DENSITY_MEMMOVE((uint32_t*)in_dictionary + 1, in_dictionary, 3 * sizeof(uint32_t));
                    *(uint32_t *) in_dictionary = chunk;
                } else {
                    density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_DICTIONARY_A));
                    DENSITY_MEMCPY(out->pointer, &hash, sizeof(uint16_t));
                    out->pointer += sizeof(uint16_t);
                }
            } else {
                density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_PREDICTIONS_C));
            }
        } else {
            density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_PREDICTIONS_B));
        }
        DENSITY_MEMMOVE((uint32_t*)predictions + 1, predictions, 2 * sizeof(uint32_t));
        *(uint32_t *) predictions = chunk;
    } else
        density_lion_encode_push_code_to_signature(out, state, density_lion_form_model_get_encoding(&state->formData, DENSITY_LION_FORM_PREDICTIONS_A));
    state->lastHash = hash;
}

DENSITY_FORCE_INLINE void density_lion_encode_process_unit_generic(const uint_fast8_t chunks_per_process_unit, const uint_fast16_t process_unit_size, density_memory_location *restrict in, density_memory_location *restrict out, density_lion_encode_state *restrict state) {
    uint32_t chunk;

#ifdef __clang__
    for (uint_fast8_t count = 0; count < (chunks_per_process_unit >> 2); count++) {
        DENSITY_UNROLL_4(\
            DENSITY_MEMCPY(&chunk, in->pointer, sizeof(uint32_t));\
            density_lion_encode_kernel(out, DENSITY_LION_HASH_ALGORITHM(chunk), chunk, state);\
            in->pointer += sizeof(uint32_t));
    }
#else
    for (uint_fast8_t count = 0; count < (chunks_per_process_unit >> 1); count++) {
        DENSITY_UNROLL_2(\
            DENSITY_MEMCPY(&chunk, in->pointer, sizeof(uint32_t));\
            density_lion_encode_kernel(out, DENSITY_LION_HASH_ALGORITHM(chunk), chunk, state);\
            in->pointer += sizeof(uint32_t));
    }
#endif

    state->chunksCount += chunks_per_process_unit;
    in->available_bytes -= process_unit_size;
}

DENSITY_FORCE_INLINE void density_lion_encode_process_unit_small(density_memory_location *restrict in, density_memory_location *restrict out, density_lion_encode_state *restrict state) {
    density_lion_encode_process_unit_generic(DENSITY_LION_CHUNKS_PER_PROCESS_UNIT_SMALL, DENSITY_LION_PROCESS_UNIT_SIZE_SMALL, in, out, state);
}

DENSITY_FORCE_INLINE void density_lion_encode_process_unit_big(density_memory_location *restrict in, density_memory_location *restrict out, density_lion_encode_state *restrict state) {
    density_lion_encode_process_unit_generic(DENSITY_LION_CHUNKS_PER_PROCESS_UNIT_BIG, DENSITY_LION_PROCESS_UNIT_SIZE_BIG, in, out, state);
}

DENSITY_FORCE_INLINE void density_lion_encode_process_step_unit(density_memory_location *restrict in, density_memory_location *restrict out, density_lion_encode_state *restrict state) {
    uint32_t chunk;
    DENSITY_MEMCPY(&chunk, in->pointer, sizeof(uint32_t));
    density_lion_encode_kernel(out, DENSITY_LION_HASH_ALGORITHM(DENSITY_LITTLE_ENDIAN_32(chunk)), chunk, state);
    state->chunksCount++;

    in->pointer += sizeof(uint32_t);
    in->available_bytes -= sizeof(uint32_t);
}

DENSITY_WINDOWS_EXPORT DENSITY_FORCE_INLINE DENSITY_KERNEL_ENCODE_STATE density_lion_encode_init(density_lion_encode_state *state) {
    state->chunksCount = 0;
    state->efficiencyChecked = false;
    state->signature = NULL;
    state->shift = 0;
    density_lion_dictionary_reset(&state->dictionary);

#if DENSITY_ENABLE_PARALLELIZABLE_DECOMPRESSIBLE_OUTPUT == DENSITY_YES
    state->resetCycle = DENSITY_DICTIONARY_PREFERRED_RESET_CYCLE - 1;
#endif

    density_lion_form_model_init(&state->formData);

    state->lastHash = 0;
    state->lastChunk = 0;

    state->signatureInterceptMode = false;
    state->endMarker = false;

    return density_lion_encode_exit_process(state, DENSITY_LION_ENCODE_PROCESS_CHECK_BLOCK_STATE, DENSITY_KERNEL_ENCODE_STATE_READY);
}

#include "kernel_lion_encode_template.h"

#define DENSITY_LION_ENCODE_FINISH

#include "kernel_lion_encode_template.h"


text:
package org.glowroot.agent.weaving.targets;

public class GenericMiscImpl implements GenericMisc<String> {

    @Override
    public void execute1(String str) {}

    @Override
    public void execute2(String obj) {}

    @Override
    public void execute2(Number obj) {}

    @Override
    public <S> S getObject(Class<S> clazz) {
        return null;
    }
}


text:
"""Statistics module
"""
from db_queries import query_stats_module, query_get_nature
from experience import Experience

class Statistics(Experience):
    """The Statistics Class.

    Parameters
    ----------
    dex_no : integer, required
        The national dex number for the pokemon you are calculating stats for.

    form : string, optional (default=None)
        The form you want to calculate for, default is the most base form.
        In unique cases like with Meowstic and Basculin, the default form is
        just whichever one I decided to list first.

    nature : string, optional (default='serious')
        The nature you want to have an effect on the stats. Default is serious
        because that one doesn't do anything.

    evs : list, optional (default=(0, 0, 0, 0, 0, 0))
        The list of EVs in the standard order.

    ivs : list, optional (default=(0, 0, 0, 0, 0, 0))
        The list of IVs in the standard order.

    current_exp : integer, optional (default=None)
        The current exp, is used to calculate level if level is not given

    level : integer, optional (default=None)
        The level for the pokemon. If both exp and level are entered, exp
        is prioritized.

    """

    def __init__(self, dex_no, form=None, nature='serious', evs=(0, 0, 0, 0, 0, 0),
                 ivs=(0, 0, 0, 0, 0, 0), current_exp=None, level=100):

        self.__pull_data(dex_no, form)

        super().__init__(exp_group=self.exp_group, current_exp=current_exp, level=level)

        self.evs = evs
        self.ivs = ivs
        self.nature = query_get_nature(nature)
        self.get_stats()

    def get_stats(self):
        """
        Sets self.stats based on base, ivs, evs, and nature.

        Parameters
        ----------
        Nothing.

        Returns
        -------
        self : object
            Returns self.

        """
        stats = [0, 0, 0, 0, 0, 0]

        for stat in range(6):
            if stat == 0:
                stats[stat] = int((((2 * self.base[stat] + self.ivs[stat] + (self.evs[stat]//4)) * \
                    self.current_level) / 100)+ self.current_level + 10)
            else:
                stats[stat] = int((((((2 * self.base[stat] + self.ivs[stat] + \
                    (self.evs[stat] // 4)) * self.current_level) / 100) + 5) * self.nature[stat]))
        self.stats = stats
        return self

    def set_evs(self, evs):
        """
        Sets evs to the new list

        Parameters
        ----------
        evs : list, required
            The list of evs you want to set.

        Returns
        -------
        self : object
            Returns self.

        """
        self.evs = evs
        self.get_stats()
        return self

    def set_ivs(self, ivs):
        """
        Sets ivs to the new list

        Parameters
        ----------
        ivs : list, required
            The list of ivs you want to set.

        Returns
        -------
        self : object
            Returns self.

        """
        self.ivs = ivs
        self.get_stats()
        return self

    def set_nature(self, nature):
        """
        Sets nature to the new nature list

        Parameters
        ----------
        nature : list, required
            The nature you want to set.

        Returns
        -------
        self : object
            Returns self.

        """
        self.nature = query_get_nature(nature)
        self.get_stats()
        return self

    def change_form(self, new_form):
        """
        Sets form to the new form and recalculates stats

        Parameters
        ----------
        new_form : string, required
            The new form.

        Returns
        -------
        self : object
            Returns self.

        """
        self.__pull_data(self.dex_no, new_form)
        self.get_stats()
        return self

    def change_pokemon(self, dex_no, form=None):
        """
        Changes the pokemon this instance of the object refers to.

        Parameters
        ----------
        dex_no : integer, required
            The national dex number for the pokemon you are calculating stats for.

        form : string, optional (default=None)
            The form you want to calculate for.

        Returns
        -------
        self : object
            Returns self.

        """
        self.__pull_data(dex_no, form)
        self.get_stats()
        super().__init__(exp_group=self.exp_group, current_exp=int(self.current_exp),
                         level=self.current_level)
        return self

    def __pull_data(self, dex_no, form):
        """
        Private Method

        Pulls data from the database and cuts it up into the relevant pieces.

        Parameters
        ----------
        dex_no : integer, required
            The national dex number for the pokemon you are calculating stats for.

        form : string, optional (default=None)
            The form you want to calculate for.

        Returns
        -------
        self : object
            Returns self.

        """
        pull = query_stats_module(dex_no, form)
        self.dex_no = dex_no
        self.base = pull[:6]
        self.exp_group = pull[6]
        self.form = pull[7]
        self.name = pull[8]
        return self

if __name__ == '__main__':
    a = Statistics(dex_no=3, nature='timid', evs=[252, 0, 0, 252, 0, 252],
                   ivs=[31, 31, 31, 31, 31, 31])
    print(a.current_level)
    print(a.stats)
    a.set_nature('modest')
    print(a.stats)
    a.change_form('mega')
    print(a.stats)
    a.change_pokemon(25)
    print(a.stats)
    print(a.name)


text:
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Devdog.General
{
    [System.Serializable]
    public struct FMinMaxRange
    {
        public float min;
        public float max;

        public float Generate()
        {
            return Random.Range(min, max);
        }
    }
}


text:
include (AppendProperty)

## We have set up RSTM so that it can be configured to independently build 32
## and 64-bit libraries and executables. The user can configure a build
## directory for neither, either, or both. We have a list, rstm_archs, that
## contains the compiler architecture we want to build for (32;64). We use that
## list in order to register multiple versions of executables (foreack
## arch). This file provides some macros that simplify this "multiarch"
## executable generation.

## Add a multiarch executable.
macro (add_multiarch_executable exec name arch)
  set(${exec} "${name}${arch}")
  add_executable(${${exec}} ${ARGN})
  append_property(TARGET ${${exec}} LINK_FLAGS -m${arch})
  append_property(TARGET ${${exec}} COMPILE_FLAGS -m${arch})
endmacro ()

## Add a multiarch executable for which some of the source files are compiled
## with the CXX-tm compiler.
macro (add_cxxtm_executable exec name arch)
  add_multiarch_executable(${exec} ${name} ${arch} ${ARGN})

  # Add the CXX-tm implicit libraries (the EXTRA_LIBS are detected at language
  # configuration time, and are _not_ a standard thing... usually the
  # IMPLICIT_LIBRARIES are used, but we choose not to remember them because
  # they're pretty cluttered). EXTRA_LIBS is hard-coded for the Intel compiler
  # (currently rstm/cmake/modules/cxx-tm/Platform/Linux-Intel-CXX-tm.cmake).
  target_link_libraries(${${exec}} ${CMAKE_CXX-tm_EXTRA_LIBS})

  # Add the CXX-tm paths as -L paths
  foreach (path ${CMAKE_CXX-tm_LINK_DIRS${arch}})
    append_property(TARGET ${${exec}} LINK_FLAGS ${CMAKE_LIBRARY_PATH_FLAG}${path})
  endforeach ()

  # Finally, add an rpath to get to the correct CXX-tm directories.
  set_target_properties(${${exec}} PROPERTIES
    INSTALL_RPATH "${CMAKE_CXX-tm_LINK_DIRS${arch}}"
    BUILD_WITH_INSTALL_RPATH YES)
endmacro ()

## Add a multiarch executable that depends on the stm target library.
macro (add_stm_executable exec name arch)
  add_multiarch_executable(${exec} ${name} ${arch} ${ARGN})
  target_link_libraries(${${exec}} stm${arch})
endmacro ()

## Add a multiarch executable that uses Intel's itm library.
macro (add_itm_executable exec name arch)
  add_cxxtm_executable(${exec} ${name} ${arch} ${ARGN})
  target_link_libraries(${${exec}} ${CMAKE_CXX-tm_STM_LIBS})
endmacro ()

## Add a multiarch executable that uses the itm2stm shim (by definition this
## means that the executable is actually a cxxtm executable).
macro (add_itm2stm_executable exec name arch)
  add_cxxtm_executable(${exec} ${name} ${arch} ${ARGN})
  target_link_libraries(${${exec}} itm2stm${arch})
endmacro ()


text:
#include "CCDefines.h"

CCSceneAppUI::CCSceneAppUI()
{
}

void CCSceneAppUI::setup()
{
}

void CCSceneAppUI::destruct()
{
    super::destruct();
}

// CCSceneBase
void CCSceneAppUI::updateScene(const CCTime &gameTime)
{
    super::updateScene( gameTime );
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
    class My_model extends CI_Model{
        public function getlistCommand(){
            $sql="SELECT * FROM Command ";
            return $this->db->query($sql);
        }
        public function getlistCommand2(){
            $sql="SELECT * FROM Command ORDER BY Command_id desc";
            return $this->db->query($sql);
        }
        public function getCommand($id){
            $sql="SELECT * FROM Command WHERE Command_id like ?";
            $data=array($id);
            return $this->db->query($sql,$data);
        }
        public function getDataPage($page){
            $sql="SELECT * FROM Command GROUP BY Command_id desc LIMIT $page,10";

            return $this->db->query($sql);
        }
        public function getNumRow(){
            $this->db->from('Command');
            $query = $this->db->get();
            return $query->num_rows();
        }
        public function getNumRowMember(){
            $this->db->from('Member');
            $query = $this->db->get();
            return $query->num_rows();
        }
        public function getOneCommand($id){
            $sql="SELECT * FROM Command WHERE Command_id like ?";
            $data=array($id);
            return $this->db->query($sql,$data);
        }
        public function getMemberInCommand($id){
            $sql="SELECT * FROM `Command` NATURAL JOIN Member_in_Command NATURAL JOIN Member WHERE Command_id LIKE ?";
             $data=array($id);
            return $this->db->query($sql,$data);
        }
        public function changeStatus($id,$s){
            $sql="UPDATE `Command` SET `Command_status`=? WHERE Command_id like ?";
            $data=array($s,$id);
            $this->db->query($sql,$data);
        }
        public function addCommand($genid,$name,$startdate,$donedate,$status,$link){
            $sql="INSERT INTO `Command`(`Command_genid`, `Command_name`, `Command_startdate`, `Command_donedate`, `Command_status`,`Command_link`)
            VALUES (?,?,?,?,?,?)";
            $data=array($genid,$name,$startdate,$donedate,$status,$link);
            if($this->db->query($sql,$data)){
                return true;
            }else{
                return false;
            }
        }
        public function addmember($name,$position){
            $sql="INSERT INTO `Member`(`Member_name`, `Member_Position`) VALUES (?,?)";
            $data=array($name,$position);
            if($this->db->query($sql,$data)){
                return true;
            }else{
                return false;
            }
        }
        public function addmember_in_command($mid,$cid){
             $sql="INSERT INTO `Member_in_Command` (`Member_id`, `Command_id`) VALUES (?,?)";
             $data=array($mid,$cid);
             if($this->db->query($sql,$data)){
                return true;
            }else{
                return false;
            }
        }
        public function getidcommand($genid,$name,$start,$done,$status){
            $sql="SELECT * FROM `Command` WHERE
            `Command_genid`like ? and `Command_name` like ? and `Command_status` like ?";
            $data=array($genid,$name,$status);
            $result=$this->db->query($sql,$data);
               foreach($result->result() as $r){
                    return $r->Command_id;
               }
        }
        public function checkmemberid($name,$position){
            $sql="SELECT * FROM `Member` WHERE `Member_name` like ? ";
            $data=array($name);
            $result=$this->db->query($sql,$data);
            foreach($result->result() as $r){
                    return $r->Member_id;
               }
        }
        public function getallmember(){
            $sql="SELECT * FROM Member";
            return $this->db->query($sql);
        }
        public function deleteCommmand($cid){
            $sql="DELETE FROM `Member_in_Command` WHERE `Command_id` like ?";
            $data=array($cid);
            $this->db->query($sql,$data);
            $sql="DELETE FROM `Command` WHERE `Command_id` like ?";
             $this->db->query($sql,$data);
        }
        public function updatecommand($cgid,$cname,$cstart,$cstop,$cstatus,$cid,$link){
            $sql="UPDATE `Command`
            SET `Command_genid`=?,`Command_name`=?,`Command_startdate`=?,`Command_donedate`=?,`Command_status`=? ,`Command_link`=? WHERE `Command_id` like ?";
            $data=array($cgid,$cname,$cstart,$cstop,$cstatus,$link,$cid);
            $this->db->query($sql,$data);
        }
        public function deleteMemberInCommand($cid){
            $sql="DELETE FROM `Member_in_Command` WHERE `Command_id` like ?";
            $data=array($cid);
            $this->db->query($sql,$data);
        }
        public function getnatural($cid){
            $sql="SELECT * FROM Member_in_Command NATURAL JOIN Member WHERE Command_id like ? ORDER BY Command_id desc";
            $data=array($cid);
            return $this->db->query($sql,$data);
        }
        public function getminyear(){
            $sql="SELECT Min(Command_startdate) AS miny FROM Command";
            $result=$this->db->query($sql);
             foreach($result->result() as $r){
                return $r->miny;
            }//css

        }
        public function getmaxyear(){
            $sql="SELECT Max(Command_startdate) AS maxy FROM Command";
            $result=$this->db->query($sql);
            foreach($result->result() as $r){
                return $r->maxy;
            }

        }
        public function getlistforyear($min,$max){
            $sql="SELECT * FROM Command WHERE Command_startdate BETWEEN '$min-00-00' AND '$max-00-00';";

             return $this->db->query($sql);
        }

    }

?>


text:
import sys, os, os.path, tempfile

if len(sys.argv) != 3:
    print >> sys.stderr, "Usage: python test.py <scripts dir> <bin dir>"
    sys.exit(1)

scriptsdir = sys.argv[1]
bindir = sys.argv[2]
sys.path.append(scriptsdir)

from phyltr import *

def create_and_write_random_input(s_size, g_size, s_file, g_file, sigma_file):
    (s, g, sigma) = create_random_input(s_size, g_size)
    s_file.truncate(0)
    s_file.seek(0)
    g_file.truncate(0)
    g_file.seek(0)
    sigma_file.truncate(0)
    sigma_file.seek(0)

    print >> s_file, s + ";"
    print >> g_file, g + ";"
    for m in sigma:
        print >> sigma_file, m[0], m[1]

    s_file.flush()
    g_file.flush()
    sigma_file.flush()

    return (s, g, sigma)

s_file = tempfile.NamedTemporaryFile()
g_file = tempfile.NamedTemporaryFile()
sigma_file = tempfile.NamedTemporaryFile()
res_dp_file = tempfile.NamedTemporaryFile()
res_fpt_file = tempfile.NamedTemporaryFile()

file_names = ' '.join([s_file.name, g_file.name, sigma_file.name])

print " Test: phyltr-event-combinations with small random tree ".center(80, '=')
for s_size in range(2, 15):
    for g_size in range(s_size, 20):
        for i in range(10):
            (s, g, sigma) = create_and_write_random_input(s_size, g_size,
                                                          s_file, g_file, sigma_file)

            infile = os.popen(os.path.join(bindir, 'phyltr-event-combinations ') + file_names, 'r')
            combo_lines = infile.readlines()
            infile.close();

            combo_lines = [l.split() for l in combo_lines]
            plus_lines = [l for l in combo_lines if l[0] == '+']

            # For each event pair that is optimal for more than one
            # value, test a cost in the middle of the range to ensure
            # that that is the only event pair that is optimal there.
            for l in plus_lines:
                dups = int(l[1])
                transfers = int(l[2])
                lower_numer = int(l[3].split('/')[0])
                upper_numer = int(l[4].split('/')[0])
                denominator = int(l[3].split('/')[1])
                # set the cost of duplication and transfer as integers
                cost_dup = lower_numer + upper_numer
                cost_transfer = denominator - lower_numer + denominator - upper_numer

                infile = os.popen(os.path.join(bindir, 'phyltr-dp') + ' -d ' + str(cost_dup)
                                  + ' -t ' + str(cost_transfer) + ' '
                                  + file_names, 'r')
                dp_lines = [l.split() for l in infile if len(l.strip()) != 0]
                infile.close()

                transfer_lines = [l for l in dp_lines if l[0] == 'Transfer']
                dup_lines = [l for l in dp_lines if l[0] == 'Duplications:']
                for i in range(len(dup_lines)):
                    if len(transfer_lines[i]) - 2 != transfers or len(dup_lines[i]) - 1 != dups:
                        print s
                        print g
                        for a in sigma:
                            print a[0], a[1]
                        print 'dup cost:\t', cost_dup
                        print 'transfer cost:\t', cost_transfer
                        print
                        raise RuntimeError, "Test Failed"

            # For each lower and upper limit of a cost range, check
            # that exactly the right event pairs are optimal

            # events[r], where r is a rational number, is a set that
            # contains all event pairs optimal when D = r and T = 1-r
            # according to phyltr-event-combinations
            events = {}
            for l in combo_lines:
                if l[0] == '-':
                    continue
                (numerator, denominator) = l[3].split('/')
                if numerator != denominator and numerator != 0:
                    lower = Rational(int(numerator), int(denominator))
                    a_set = events.get(lower, set())
                    a_set.add( (int(l[1]), int(l[2])) )
                    events[lower] = a_set

                (numerator, denominator) = l[4].split('/')
                if numerator != denominator and numerator != 0:
                    upper = Rational(int(numerator), int(denominator))
                    a_set = events.get(upper, set())
                    a_set.add( (int(l[1]), int(l[2])) )
                    events[upper] = a_set

            # For each cost, test if phyltr-dp agrees with
            # phyltr-event-combinations
            for (key, events_set) in events.iteritems():
                cost_dup = key.numerator
                cost_transfer = key.denominator - key.numerator
                infile = os.popen(os.path.join(bindir, 'phyltr-dp') + ' -d ' + str(cost_dup)
                                  + ' -t ' + str(cost_transfer) + ' '
                                  + file_names, 'r')

                dp_lines = [l.split() for l in infile if len(l.strip()) != 0]
                infile.close()

                transfer_lines = [l for l in dp_lines if l[0] == 'Transfer']
                dup_lines = [l for l in dp_lines if l[0] == 'Duplications:']
                dp_set = set()
                for i in range(len(dup_lines)):
                    dp_set.add( (len(dup_lines[i]) - 1, len(transfer_lines[i]) - 2) )

                if events_set != dp_set:
                    print s
                    print g
                    for a in sigma:
                        print a[0], a[1]
                    print 'dup cost:\t', cost_dup
                    print 'transfer cost:\t', cost_transfer
                    print 'events:\t', events_set
                    print 'dp:\t', dp_set
                    print
                    raise RuntimeError, "Test Failed"

    sys.stderr.write('.')
print
print " PASSED ".center(80, '=')

print " Test: small random trees with phyltr-dp and phyltr-fpt ".center(80, '=')
for s_size in range(2, 15):
    for g_size in range(s_size, 15):
        for i in range(10):
            (s, g, sigma) = create_and_write_random_input(s_size, g_size,
                                                          s_file, g_file, sigma_file)

            infile = os.popen(os.path.join(bindir, 'phyltr-dp ') + '-c ' + file_names, 'r')
            opt_cost = int(infile.read())
            infile.close()

            infile = os.popen(os.path.join(bindir, "phyltr-dp ") + file_names)
            res_dp_file.writelines(infile.readlines())
            infile.close()
            res_dp_file.flush()

            infile = os.popen(os.path.join(bindir, "phyltr-fpt ") + file_names + " " +
                              str(opt_cost) + " " + str(opt_cost))
            res_fpt_file.writelines(infile.readlines())
            infile.close()
            res_fpt_file.flush()

            diff = os.system("diff " +
                             res_dp_file.name + " " +
                             res_fpt_file.name)
            if diff != 0:
                print s
                print g
                for a in sigma:
                    print a[0], a[1],
                print
                raise RuntimeError, "Test Failed"
    sys.stderr.write('.')
print
print " PASSED ".center(80, '=')


text:
package com.taobao.tddl.optimizer.parse.cobar.visitor;

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

import com.alibaba.cobar.parser.ast.expression.Expression;
import com.alibaba.cobar.parser.ast.expression.primary.ParamMarker;
import com.alibaba.cobar.parser.ast.fragment.GroupBy;
import com.alibaba.cobar.parser.ast.fragment.Limit;
import com.alibaba.cobar.parser.ast.fragment.OrderBy;
import com.alibaba.cobar.parser.ast.fragment.SortOrder;
import com.alibaba.cobar.parser.ast.fragment.tableref.TableReference;
import com.alibaba.cobar.parser.ast.fragment.tableref.TableReferences;
import com.alibaba.cobar.parser.ast.stmt.dml.DMLSelectStatement;
import com.alibaba.cobar.parser.ast.stmt.dml.DMLSelectStatement.SelectDuplicationStrategy;
import com.alibaba.cobar.parser.ast.stmt.dml.DMLSelectStatement.SelectOption;
import com.alibaba.cobar.parser.ast.stmt.dml.DMLSelectUnionStatement;
import com.alibaba.cobar.parser.util.Pair;
import com.alibaba.cobar.parser.visitor.EmptySQLASTVisitor;
import com.taobao.tddl.common.exception.NotSupportException;
import com.taobao.tddl.optimizer.core.ASTNodeFactory;
import com.taobao.tddl.optimizer.core.ast.QueryTreeNode;
import com.taobao.tddl.optimizer.core.ast.query.QueryNode;
import com.taobao.tddl.optimizer.core.expression.IFilter;
import com.taobao.tddl.optimizer.core.expression.ISelectable;

/**
 * select表达式的解析
 *
 * @since 5.0.0
 */
public class MySqlSelectVisitor extends EmptySQLASTVisitor {

    private QueryTreeNode tableNode;

    public QueryTreeNode getTableNode() {
        return tableNode;
    }

    @Override
    public void visit(DMLSelectStatement node) {
        TableReferences tables = node.getTables();
        if (tables != null) {
            handleFrom(tables);
        }

        List<Pair<Expression, String>> items = node.getSelectExprList();
        if (items != null) {
            List<ISelectable> selectItems = handleSelectItems(items);
            handleSelectOption(node.getOption(), selectItems);

            if (selectItems != null) {
                tableNode.select(selectItems);
            }
        }

        Expression whereExpr = node.getWhere();
        if (whereExpr != null) {
            handleWhereCondition(whereExpr);
        }

        OrderBy orderBy = node.getOrder();
        if (orderBy != null) {
            handleOrderBy(orderBy);
        }

        GroupBy groupBy = node.getGroup();
        if (groupBy != null) {
            handleGroupBy(groupBy);
        }

        Expression havingExpr = node.getHaving();
        if (havingExpr != null) {
            handleHavingCondition(havingExpr);
        }

        Limit limit = node.getLimit();
        if (limit != null) {
            handleLimit(limit);
        }
    }

    @Override
    public void visit(DMLSelectUnionStatement node) {
        throw new NotSupportException();
    }

    // ===================== helper =======================

    private void handleFrom(TableReferences tables) {
        List<TableReference> trs = tables.getTableReferenceList();
        for (int i = 0; i < trs.size(); i++) {
            TableReference tr = trs.get(i);
            MySqlExprVisitor mtv = new MySqlExprVisitor();
            tr.accept(mtv);
            if (this.tableNode == null) {
                this.tableNode = mtv.getTableNode();
                // 如果是第一个table,并且是唯一的一个,才做queryNode,因为如果多于两个可以通过joinNode来代替
                if (this.tableNode.isSubQuery() && i == trs.size() - 1) {
                    this.tableNode = new QueryNode(this.tableNode);
                }
            } else {
                this.tableNode = this.tableNode.join(mtv.getTableNode());
            }
        }
    }

    private List<ISelectable> handleSelectItems(List<Pair<Expression, String>> items) {
        List<ISelectable> selectItems = new ArrayList<ISelectable>();
        for (Pair<Expression, String> item : items) {
            Expression expr = item.getKey();

            MySqlExprVisitor ev = new MySqlExprVisitor();
            expr.accept(ev);
            Comparable obj = ev.getColumnOrValue();
            if (!(obj instanceof ISelectable)) { // 常量先转成booleanFilter
                obj = ev.buildConstanctFilter(obj);
            }

            ((ISelectable) obj).setAlias(item.getValue());
            selectItems.add((ISelectable) obj);
        }

        return selectItems;
    }

    private void handleSelectOption(SelectOption option, List<ISelectable> selectItems) {
        if (option.resultDup == SelectDuplicationStrategy.DISTINCT) {
            for (ISelectable obj : selectItems) {
                obj.setDistinct(true);
            }
        }
    }

    private void handleWhereCondition(Expression whereExpr) {
        MySqlExprVisitor mev = new MySqlExprVisitor();
        whereExpr.accept(mev);
        if (this.tableNode != null) {
            IFilter whereFilter = null;
            if (mev.getFilter() != null) {
                whereFilter = mev.getFilter();
            } else if (mev.getColumnOrValue() != null) {
                whereFilter = mev.buildConstanctFilter(mev.getColumnOrValue());
            }

            tableNode.query(whereFilter);
            this.tableNode.setAllWhereFilter(tableNode.getWhereFilter());
        } else {
            throw new IllegalArgumentException("from expression is null,check the sql!");
        }
    }

    private void handleOrderBy(OrderBy orderBy) {
        List<Pair<Expression, SortOrder>> olist = orderBy.getOrderByList();
        for (Pair<Expression, SortOrder> p : olist) {
            Expression expr = p.getKey();
            MySqlExprVisitor v = new MySqlExprVisitor();
            expr.accept(v);
            SortOrder sorder = p.getValue();
            this.tableNode = tableNode.orderBy((ISelectable) v.getColumnOrValue(),
                sorder == SortOrder.ASC ? true : false);
        }
    }

    private void handleGroupBy(GroupBy groupBy) {
        List<Pair<Expression, SortOrder>> glist = groupBy.getOrderByList();
        for (Pair<Expression, SortOrder> p : glist) {
            Expression expr = p.getKey();
            MySqlExprVisitor v = new MySqlExprVisitor();
            expr.accept(v);
            SortOrder sorder = p.getValue();
            this.tableNode = tableNode.groupBy((ISelectable) v.getColumnOrValue(),
                sorder == SortOrder.ASC ? true : false);
        }

        if (groupBy.isWithRollup()) {
            throw new NotSupportException("with rollup is not supported yet!");
        }
    }

    private void handleHavingCondition(Expression havingExpr) {
        MySqlExprVisitor mev = new MySqlExprVisitor();
        havingExpr.accept(mev);
        IFilter havingFilter = mev.getFilter();
        if (this.tableNode == null) {
            throw new IllegalArgumentException("from expression is null,check the sql!");
        }

        if (havingFilter != null) {
            this.tableNode = this.tableNode.having(havingFilter);
        } else if (mev.getColumnOrValue() != null) {
            this.tableNode = this.tableNode.having(mev.buildConstanctFilter(mev.getColumnOrValue()));
        }

    }

    private void handleLimit(Limit limit) {
        if (limit.getOffset() instanceof ParamMarker) {
            tableNode.setLimitFrom(ASTNodeFactory.getInstance()
                .createBindValue(((ParamMarker) limit.getOffset()).getParamIndex()));
        } else {
            tableNode.setLimitFrom(Long.valueOf(String.valueOf(limit.getOffset())));
        }

        if (limit.getSize() instanceof ParamMarker) {
            tableNode.setLimitTo(ASTNodeFactory.getInstance()
                .createBindValue(((ParamMarker) limit.getSize()).getParamIndex()));
        } else {
            tableNode.setLimitTo(Long.valueOf(String.valueOf(limit.getSize())));
        }
    }

}


text:
$(document).ready(function () {
	$("#auto-complete").autocomplete(djime.autocomplete_usernames);
});