text:
module Vines
  class Stream
    class Client
      # A Session tracks the state of a client stream over its lifetime from
      # negotiation to processing stanzas to shutdown. By disconnecting the
      # stream's state from the stream, we can allow multiple TCP connections
      # to access one logical session (e.g. HTTP streams).
      class Session
        include Comparable

        attr_accessor :domain, :user
        attr_reader   :id, :last_broadcast_presence, :state

        def initialize(stream)
          @stream = stream
          @id = Kit.uuid
          @config = stream.config
          @state = Client::Start.new(stream)
          @available = false
          @domain = nil
          @last_broadcast_presence = nil
          @requested_roster = false
          @unbound = false
          @user = nil
        end

        def <=>(session)
          session.is_a?(Session) ? self.id <=> session.id : nil
        end

        alias :eql? :==

        def hash
          @id.hash
        end

        def advance(state)
          @state = state
        end

        # Returns true if this client has properly authenticated with
        # the server.
        def authenticated?
          !@user.nil?
        end

        # Notify the session that the client has sent an initial presence
        # broadcast and is now considered to be an "available" resource.
        # Available resources are sent presence subscription stanzas.
        def available!
          @available = true
          save_to_cluster
        end

        # An available resource has sent initial presence and can
        # receive presence subscription requests.
        def available?
          @available && connected?
        end

        # Complete resource binding with the given resource name, provided by the
        # client or generated by the server. Once resource binding is completed,
        # the stream is considered to be "connected" and ready for traffic.
        def bind!(resource)
          @user.jid.resource = resource
          router << self
          save_to_cluster
        end

        # A connected resource has authenticated and bound a resource
        # identifier.
        def connected?
          !@unbound && authenticated? && !@user.jid.bare?
        end

        # An interested resource has requested its roster and can
        # receive roster pushes.
        def interested?
          @requested_roster && connected?
        end

        def last_broadcast_presence=(node)
          @last_broadcast_presence = node
          save_to_cluster
        end

        def ready?
          @state.class == Client::Ready
        end

        # Notify the session that the client has requested its roster and is now
        # considered to be an "interested" resource. Interested resources are sent
        # roster pushes when changes are made to their contacts.
        def requested_roster!
          @requested_roster = true
          save_to_cluster
        end

        def stream_type
          :client
        end

        def write(data)
          @stream.write(data)
        end

        # Called by the stream when it's disconnected from the client. The stream
        # passes itself to this method in case multiple streams are accessing this
        # session (e.g. BOSH/HTTP).
        def unbind!(stream)
          router.delete(self)
          delete_from_cluster
          unsubscribe_pubsub
          @unbound = true
          @available = false
          broadcast_unavailable
        end

        # Returns streams for available resources to which this user
        # has successfully subscribed.
        def available_subscribed_to_resources
          subscribed = @user.subscribed_to_contacts.map {|c| c.jid }
          router.available_resources(subscribed, @user.jid)
        end

        # Returns streams for available resources that are subscribed
        # to this user's presence updates.
        def available_subscribers
          subscribed = @user.subscribed_from_contacts.map {|c| c.jid }
          router.available_resources(subscribed, @user.jid)
        end

        # Returns contacts hosted at remote servers to which this user has
        # successfully subscribed.
        def remote_subscribed_to_contacts
          @user.subscribed_to_contacts.reject do |c|
            @config.local_jid?(c.jid)
          end
        end

        # Returns contacts hosted at remote servers that are subscribed
        # to this user's presence updates.
        def remote_subscribers(to=nil)
          jid = (to.nil? || to.empty?) ? nil : JID.new(to).bare
          @user.subscribed_from_contacts.reject do |c|
            @config.local_jid?(c.jid) || (jid && c.jid.bare != jid)
          end
        end

        private

        def broadcast_unavailable
          return unless authenticated?
          Fiber.new do
            broadcast(unavailable, available_subscribers)
            broadcast(unavailable, router.available_resources(@user.jid, @user.jid))
            remote_subscribers.each do |contact|
              node = unavailable
              node['to'] = contact.jid.bare.to_s
              router.route(node) rescue nil # ignore RemoteServerNotFound
            end
          end.resume
        end

        def unavailable
          doc = Nokogiri::XML::Document.new
          doc.create_element('presence',
            'from' => @user.jid.to_s,
            'type' => 'unavailable')
        end

        def broadcast(stanza, recipients)
          recipients.each do |recipient|
            stanza['to'] = recipient.user.jid.to_s
            recipient.write(stanza)
          end
        end

        def router
          @config.router
        end

        def save_to_cluster
          if @config.cluster?
            @config.cluster.save_session(@user.jid, to_hash)
          end
        end

        def delete_from_cluster
          if connected? && @config.cluster?
            @config.cluster.delete_session(@user.jid)
          end
        end

        def unsubscribe_pubsub
          if connected?
            @config.vhost(@user.jid.domain).unsubscribe_pubsub(@user.jid)
          end
        end

        def to_hash
          presence = @last_broadcast_presence ? @last_broadcast_presence.to_s : nil
          {available: @available, interested: @requested_roster, presence: presence.to_s}
        end
      end
    end
  end
end


text:
<?php

class RoleEnum
{
	const ADMIN = 0;
	const ACCT_PAY = 1;
	const ACCT_RCV = 2;
	const EMP_BENEFITS = 3;
	const GEN_LEDGER = 4;
	const PAYROLL = 5;
	const INVENTORY = 6;
	const PRODUCTION = 7;
	const QUALITY_CTL = 8;
	const SALES = 9;
	const ORDERS = 10;
	const CUSTOMERS = 11;
	const SHIPPING = 12;
	const RETURNS = 13;

	private static $list = array
	(
		RoleEnum::ADMIN => 'Administrator',
		RoleEnum::ACCT_PAY => 'Accounts Payable',
		RoleEnum::ACCT_RCV => 'Accounts Receivable',
		RoleEnum::EMP_BENEFITS => 'Employee Benefits',
		RoleEnum::GEN_LEDGER => 'General Ledger',
		RoleEnum::PAYROLL => 'Payroll',
		RoleEnum::INVENTORY => 'Inventory',
		RoleEnum::PRODUCTION => 'Production',
		RoleEnum::QUALITY_CTL => 'Quality Control',
		RoleEnum::SALES => 'Sales',
		RoleEnum::ORDERS => 'Orders',
		RoleEnum::CUSTOMERS => 'Customers',
		RoleEnum::SHIPPING => 'Shipping',
		RoleEnum::RETURNS => 'Returns'
	);

	public static function getList ()
	{
		return self::$list;
	}

	public static function getValue ($enum)
	{
		return self::$list [$enum];
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php
global $lang;

$lang['es_ES']['Donationpage']['AMOUNT']='Cantidad:';

$lang['es_ES']['DonatePage']['BUTTON_CARD']   ='Donar con tarjeta de crédito';
$lang['es_ES']['DonatePage']['BUTTON_PAYPAL'] ='Donar con PayPal';
$lang['es_ES']['DonatePage']['CHOICE_DEFAULT']='Seleccione uno de los valores predefinidos';
$lang['es_ES']['DonatePage']['CUSTOM_CHOICE'] ='O ingrese una cantidad y moneda
(Solamente aquellas marcadas con * estan también disponibles via PayPal)';
$lang['es_ES']['DonatePage']['CUSTOM_AMOUNT_VALUE'] ='25';
$lang['es_ES']['DonatePage']['DEFAULT_AMOUNT_EUR05']= '5';
$lang['es_ES']['DonatePage']['DEFAULT_AMOUNT_EUR10']='10';
$lang['es_ES']['DonatePage']['DEFAULT_AMOUNT_EUR20']='20';
$lang['es_ES']['DonatePage']['DEFAULT_AMOUNT_EUR50']='50';
$lang['es_ES']['DonatePage']['DEFAULT_CURRENCY']    ='EUR';
/* %s is a regular downloadlink, with the filename as label */
$lang['es_ES']['DonatePage']['DLRefreshMsg']= 'La descarga de %s comenzará pronto. Si no lo hace, pulse en el enlace.';
/* supplemental downloads for that version, i.e. Helppack and/or Languagepack */
$lang['es_ES']['DonatePage']['DLOptional']  = 'Encontrará las descargas opcionales en el lado izquierdo.';

$lang['es_ES']['Downloadpage']['BITTORRENT']='Descargar usando BitTorrent';
$lang['es_ES']['Downloadpage']['DETAILLINK']='Obtener detalles (md5sum,…)';
$lang['es_ES']['Downloadpage']['DLSDK']     ='Descargar el SDK para desarrollar extensiones y herramientas externas';
$lang['es_ES']['Downloadpage']['DLSOURCE']  ='Descargar el código fuente para construir su propio instalador';
$lang['es_ES']['Downloadpage']['DLSUITE']   ='Otras maneras de descargar LibreOffice, la suite de productividad';
$lang['es_ES']['Downloadpage']['NOTESTBUILDS']='En este momento no hay compilaciones de prueba disponibles.';

/* Localizers: this string HAS to be enclosed in either single or double ASCII quotes! It is a title attribute of a link. */
$lang['es_ES']['Navigation']['GOTOPAGE']  ='"Ir a la página %s"';
$lang['es_ES']['Navigation']['TOTOPTITLE']='desplazarse al inicio de la página';
$lang['es_ES']['Navigation']['TOTOP']     ='⬆ hacia arriba';

$lang['es_ES']['DownloadSimplePage.ss']['DownloadNeededFiles'] = 'Necesita descargar e instalar estos archivos en orden:';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsDevelopersHeader'] = 'Desarrolladores';
/* %s will be replaced with OS/arch, version, language */
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsHeader']= 'Seleccionó: LibreOffice %s';
$lang['es_ES']['DownloadSimplePage.ss']['NotWanted']      = '¿No es la versión que quería?';
/* will be displayed instead of the dl-buttons */
$lang['es_ES']['DownloadSimplePage.ss']['NoRegularDL']    = 'No hay archivos de instalación regulares disponibles.
Modifique su selección o elija una descarga opcional a continuación.';
/* watch out for proper quoting */
$lang['es_ES']['DownloadSimplePage.ss']['ViewDLArchive']  = 'Si está buscando versiones antiguas, visite nuestra colección de descargas anteriores.';
/* will be formatted as link */
$lang['es_ES']['DownloadSimplePage.ss']['ChangeLanguage'] = 'Cambiar el idioma';
$lang['es_ES']['DownloadSimplePage.ss']['ChangeVersion']  = 'Cambiar la versión:';
/* watch out to escape quotes if necessary - no need to use the abbreviation if it doesn't apply to your language */
$lang['es_ES']['DownloadSimplePage.ss']['ChangeOS']       = 'Cambiar el SO:';
$lang['es_ES']['DownloadButton.ss']['DownloadsInfoLink'] = 'Info.';
$lang['es_ES']['DownloadButton.ss']['DownloadsInfoTitle'] = 'Véase la suma MD5 y la lista de espejos de descarga para el archivo';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsInstallTypeFull'] = 'Instalador principal';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsInstallTypeHelppack'] = 'Ayuda incorporada de LibreOffice';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsInstallTypeLanguagepack'] = 'Interfaz de usuario traducida';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsIsoHeader'] = 'Imagen %s';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsIsoText'] = 'Descargar un archivo ISO para crear un medio de instalación';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsAppStoreHeader'] = 'Instalación %s';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsAppStoreText'] = 'Instalar LibreOffice %s mediante Intel AppUp Center.';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsPackagesHeader'] = 'Paquetes';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsPortableHeader'] = 'PortableApps';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsPortableText'] = 'Una versión portable de LibreOffice empaquetada en el formato de PortableApps.com, para que pueda llevar sus documentos y todo lo que necesita para trabajar en ellos en una USB, disco local o la nube. Consulte PortableApps.com para más información.';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsPrereleaseWarning'] = 'Esta es una versión de prelanzamiento y no está destinada para su uso general.';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsRelatedRessources'] = 'Recursos útiles';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsSdkHeader'] = 'Kit de desarrollo de software (SDK)';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsSdkText'] = 'Descargar el SDK para desarrollar extensiones y herramientas externas.';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsSrcHeader'] = 'Código fuente';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsSrcText'] = 'LibreOffice es un proyecto de código abierto y, por lo tanto, puede descargar el código fuente para crear su propio instalador.';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsTorrentLink'] = 'Torrent';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsTorrentTitle'] = 'Descargar los archivos con BitTorrent';
$lang['es_ES']['DownloadSimplePage.ss']['DownloadsVersion'] = 'versión %s';
$lang['es_ES']['DownloadSimplePage.ss']['LanguagesPleaseSelect'] = 'Seleccione su idioma';
$lang['es_ES']['DownloadSimplePage.ss']['TypeOr'] = 'o descargar';
$lang['es_ES']['DownloadSimplePage.ss']['VersionsPrereleaseHeader'] = 'Prelanzamientos:';
$lang['es_ES']['DownloadSimplePage.ss']['VersionsRecommended'] = 'Recomendado';

$lang['es_ES']['FancyPage.ss']['NOSCRIPT'] = 'JavaScript está desactivado en el navegador web.';
$lang['es_ES']['FancyPage.ss']['FANCYLABEL'] = 'LibreOffice 4';
$lang['es_ES']['FancyPage.ss']['DISCOVER'] = 'Descúbrelo';
$lang['es_ES']['FancyPage.ss']['DONATE']   = 'Donar';
$lang['es_ES']['FancyPage.ss']['MAINSITE'] = 'Sitio principal';
$lang['es_ES']['FancyPage.ss']['DLBADGE']  = '¡Descarga
LibreOffice
ya!';
$lang['es_ES']['FancyPage.ss']['SUITE_H']  = 'Paquete de oficina libre';
$lang['es_ES']['FancyPage.ss']['SUITE']    = 'LibreOffice 4: el paquete de oficina libre que la comunidad ha estado soñando durante doce años.';
$lang['es_ES']['FancyPage.ss']['FUN_H']    = 'Un proyecto inclusivo';
$lang['es_ES']['FancyPage.ss']['FUN']      = 'LibreOffice es uno de los proyectos de software libre y de código abierto de mayor crecimiento. Estamos comprometidos a dar lo mejor y producir un software de gran calidad.
Conoce los valores que nos mueven';
$lang['es_ES']['FancyPage.ss']['PEOPLE_H'] = 'Gente extraordinaria';
$lang['es_ES']['FancyPage.ss']['PEOPLE']   = 'LibreOffice es más que un software: se trata de gente, de cultura, de creación, de colaboración.
Existimos y crecemos gracias a los voluntarios que participan en el proyecto LibreOffice. Hay muchas formas en que puedes participar, desde tareas de ingeniería hasta labores de asistencia al usuario y diseño.
¡Súmate!';

$lang['es_ES']['LocaleName']['af'] = 'afrikáans';
$lang['es_ES']['LocaleName']['ar'] = 'árabe';
$lang['es_ES']['LocaleName']['as'] = 'asamés';
$lang['es_ES']['LocaleName']['ast'] = 'asturiano';
$lang['es_ES']['LocaleName']['be'] = 'bielorruso';
$lang['es_ES']['LocaleName']['bg'] = 'búlgaro';
$lang['es_ES']['LocaleName']['bn'] = 'bengalí';
$lang['es_ES']['LocaleName']['bo'] = 'tibetano';
$lang['es_ES']['LocaleName']['br'] = 'Bretón';
$lang['es_ES']['LocaleName']['brx'] = 'Bodo (India)';
$lang['es_ES']['LocaleName']['bs'] = 'bosnio';
$lang['es_ES']['LocaleName']['ca'] = 'catalán';
$lang['es_ES']['LocaleName']['ca-XV'] = 'valenciano';
$lang['es_ES']['LocaleName']['cs'] = 'checo';
$lang['es_ES']['LocaleName']['cy'] = 'galés';
$lang['es_ES']['LocaleName']['da'] = 'danés';
$lang['es_ES']['LocaleName']['de'] = 'alemán';
$lang['es_ES']['LocaleName']['dgo'] = 'Dogri';
$lang['es_ES']['LocaleName']['dz'] = 'Dzongkha';
$lang['es_ES']['LocaleName']['el'] = 'Griego';
$lang['es_ES']['LocaleName']['en-GB'] = 'Inglés (británico)';
$lang['es_ES']['LocaleName']['en-US'] = 'Inglés (estadounidense)';
$lang['es_ES']['LocaleName']['en-ZA'] = 'Inglés (neozelandés)';
$lang['es_ES']['LocaleName']['eo'] = 'Esperanto';
$lang['es_ES']['LocaleName']['es'] = 'Español';
$lang['es_ES']['LocaleName']['et'] = 'Estonio';
$lang['es_ES']['LocaleName']['eu'] = 'Vasco';
$lang['es_ES']['LocaleName']['fa'] = 'Persa';
$lang['es_ES']['LocaleName']['fi'] = 'Finés';
$lang['es_ES']['LocaleName']['fr'] = 'Francés';
$lang['es_ES']['LocaleName']['ga'] = 'Irlandés';
$lang['es_ES']['LocaleName']['gd'] = 'Gaélico escocés';
$lang['es_ES']['LocaleName']['gl'] = 'Gallego';
$lang['es_ES']['LocaleName']['gu'] = 'Gujarati';
$lang['es_ES']['LocaleName']['he'] = 'Hebreo';
$lang['es_ES']['LocaleName']['hi'] = 'Hindú';
$lang['es_ES']['LocaleName']['hr'] = 'Croata';
$lang['es_ES']['LocaleName']['hu'] = 'Húngaro';
$lang['es_ES']['LocaleName']['id'] = 'Indonesio';
$lang['es_ES']['LocaleName']['is'] = 'Islandés';
$lang['es_ES']['LocaleName']['it'] = 'Italiano';
$lang['es_ES']['LocaleName']['ja'] = 'Japonés';
$lang['es_ES']['LocaleName']['ka'] = 'Georgiano';
$lang['es_ES']['LocaleName']['kk'] = 'Kazajo';
$lang['es_ES']['LocaleName']['km'] = 'Jemer';
$lang['es_ES']['LocaleName']['kn'] = 'Canarés';
$lang['es_ES']['LocaleName']['ko'] = 'Coreano';
$lang['es_ES']['LocaleName']['kok'] = 'Konkani';
$lang['es_ES']['LocaleName']['ks'] = 'Cachemirés';
$lang['es_ES']['LocaleName']['ku'] = 'Kurdo';
$lang['es_ES']['LocaleName']['lb'] = 'Luxemburgués';
$lang['es_ES']['LocaleName']['lo'] = 'Lao';
$lang['es_ES']['LocaleName']['lt'] = 'Lituano';
$lang['es_ES']['LocaleName']['lv'] = 'Letón';
$lang['es_ES']['LocaleName']['mai'] = 'Maithili';
$lang['es_ES']['LocaleName']['mk'] = 'Macedonio';
$lang['es_ES']['LocaleName']['ml'] = 'Malayalam';
$lang['es_ES']['LocaleName']['mn'] = 'Mongol';
$lang['es_ES']['LocaleName']['mni'] = 'Manipur';
$lang['es_ES']['LocaleName']['mr'] = 'Maratí';
$lang['es_ES']['LocaleName']['my'] = 'Burmés';
$lang['es_ES']['LocaleName']['nb'] = 'Noruego Bokmål';
$lang['es_ES']['LocaleName']['ne'] = 'Nepalí';
$lang['es_ES']['LocaleName']['nl'] = 'Holandés';
$lang['es_ES']['LocaleName']['nn'] = 'Noruego Nynorsk';
$lang['es_ES']['LocaleName']['nr'] = 'Ndebele (Sur)';
$lang['es_ES']['LocaleName']['ns'] = 'Sotho del norte';
$lang['es_ES']['LocaleName']['nso'] = 'Sotho del norte';
$lang['es_ES']['LocaleName']['oc'] = 'Occitano';
$lang['es_ES']['LocaleName']['om'] = 'Oromo';
$lang['es_ES']['LocaleName']['or'] = 'Oriya';
$lang['es_ES']['LocaleName']['pa-IN'] = 'Panjabí';
$lang['es_ES']['LocaleName']['pl'] = 'Polaco';
$lang['es_ES']['LocaleName']['pt'] = 'Portugués';
$lang['es_ES']['LocaleName']['pt-BR'] = 'Portugués (brasileiro)';
$lang['es_ES']['LocaleName']['ro'] = 'Rumano';
$lang['es_ES']['LocaleName']['ru'] = 'Ruso';
$lang['es_ES']['LocaleName']['rw'] = 'Kinyarwanda';
$lang['es_ES']['LocaleName']['sa-IN'] = 'Sánscrito';
$lang['es_ES']['LocaleName']['sat'] = 'Santalí';
$lang['es_ES']['LocaleName']['sd'] = 'Sindhi';
$lang['es_ES']['LocaleName']['sh'] = 'Serbio (Latin)';
$lang['es_ES']['LocaleName']['si'] = 'Singalés';
$lang['es_ES']['LocaleName']['sk'] = 'Eslovaco';
$lang['es_ES']['LocaleName']['sl'] = 'Esloveno';
$lang['es_ES']['LocaleName']['sq'] = 'Albanés';
$lang['es_ES']['LocaleName']['sr'] = 'Serbio (Cirílico)';
$lang['es_ES']['LocaleName']['ss'] = 'Swazi';
$lang['es_ES']['LocaleName']['st'] = 'Sotho del sur';
$lang['es_ES']['LocaleName']['sv'] = 'Sueco';
$lang['es_ES']['LocaleName']['sw-TZ'] = 'Suajili';
$lang['es_ES']['LocaleName']['ta'] = 'Tamil';
$lang['es_ES']['LocaleName']['te'] = 'Telugu';
$lang['es_ES']['LocaleName']['tg'] = 'Tajik';
$lang['es_ES']['LocaleName']['th'] = 'Tailandés';
$lang['es_ES']['LocaleName']['tn'] = 'Tswana';
$lang['es_ES']['LocaleName']['tr'] = 'Turco';
$lang['es_ES']['LocaleName']['ts'] = 'Tsonga';
$lang['es_ES']['LocaleName']['tt'] = 'Tatar';
$lang['es_ES']['LocaleName']['ug'] = 'Uighur';
$lang['es_ES']['LocaleName']['uk'] = 'Ucraniano';
$lang['es_ES']['LocaleName']['uz'] = 'Uzbeco';
$lang['es_ES']['LocaleName']['ve'] = 'Venda';
$lang['es_ES']['LocaleName']['vi'] = 'Vietnamita';
$lang['es_ES']['LocaleName']['xh'] = 'Xhosa';
$lang['es_ES']['LocaleName']['zh-CN'] = 'Chino (simplificado)';
$lang['es_ES']['LocaleName']['zh-TW'] = 'Chino (tradicional)';
$lang['es_ES']['LocaleName']['zu'] = 'Zulú';


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sujan.lms.action;

import com.sujan.lms.entity.transaction.Transaction;

/**
 *
 * @author Suzn
 */
public interface TransactionListener {

    void onBookBorrowed(Transaction transaction);

    void onBookReturned(Transaction transaction);

}


text:
package boofcv.factory.transform.pyramid;

import boofcv.alg.interpolate.InterpolatePixelS;
import boofcv.alg.transform.pyramid.PyramidDiscreteSampleBlur;
import boofcv.alg.transform.pyramid.PyramidFloatGaussianScale;
import boofcv.core.image.border.BorderType;
import boofcv.factory.filter.kernel.FactoryKernel;
import boofcv.factory.filter.kernel.FactoryKernelGaussian;
import boofcv.factory.interpolate.FactoryInterpolation;
import boofcv.struct.convolve.Kernel1D;
import boofcv.struct.image.ImageSingleBand;
import boofcv.struct.pyramid.PyramidDiscrete;
import boofcv.struct.pyramid.PyramidFloat;

/**
 * Factory for creating classes related to image pyramids.
 *
 * @author Peter Abeles
 */
public class FactoryPyramid {

	/**
	 * Creates an updater for discrete pyramids where a Gaussian is convolved across the input
	 * prior to sub-sampling.
	 *
	 * @param imageType Type of input image.
	 * @param sigma Gaussian sigma.  If < 0 then a sigma is selected using the radius.  Try -1.
	 * @param radius Radius of the Gaussian kernel.  If < 0 then the radius is selected using sigma. Try 2.
	 * @return PyramidDiscrete
	 */
	public static <T extends ImageSingleBand>
	PyramidDiscrete<T> discreteGaussian( int[] scaleFactors , double sigma , int radius ,
										 boolean saveOriginalReference, Class<T> imageType )
	{
		Class<Kernel1D> kernelType = FactoryKernel.getKernelType(imageType,1);

		Kernel1D kernel = FactoryKernelGaussian.gaussian(kernelType,sigma,radius);

		return new PyramidDiscreteSampleBlur<T>(kernel,sigma,imageType,saveOriginalReference,scaleFactors);
	}

	/**
	 * Creates a float pyramid where each layer is blurred using a Gaussian with the specified
	 * sigma.  Bilinear interpolation is used when sub-sampling.
	 *
	 * @param scaleFactors The scale factor of each layer relative to the previous layer.
	 *                     Layer 0 is relative to the input image.
	 * @param sigmas Gaussian blur magnitude for each layer.
	 * @param imageType Type of image in the pyramid.
	 * @return PyramidFloat
	 */
	public static <T extends ImageSingleBand>
	PyramidFloat<T> floatGaussian( double scaleFactors[], double []sigmas , Class<T> imageType ) {

		InterpolatePixelS<T> interp = FactoryInterpolation.bilinearPixelS(imageType, BorderType.EXTENDED);

		return new PyramidFloatGaussianScale<T>(interp,scaleFactors,sigmas,imageType);
	}

	/**
	 * Constructs an image pyramid which is designed to mimic a {@link boofcv.struct.gss.GaussianScaleSpace}.  Each layer in the pyramid
	 * should have the equivalent amount of blur that a space-space constructed with the same parameters would have.
	 *
	 * @param scaleSpace The scale of each layer and the desired amount of blur relative to the original image
	 * @param imageType Type of image
	 * @return PyramidFloat
	 */
	public static <T extends ImageSingleBand>
	PyramidFloat<T> scaleSpacePyramid( double scaleSpace[], Class<T> imageType ) {

		double[] sigmas = new double[ scaleSpace.length ];

		sigmas[0] = scaleSpace[0];
		for( int i = 1; i < scaleSpace.length; i++ ) {
			// the desired amount of blur
			double c = scaleSpace[i];
			// the effective amount of blur applied to the last level
			double b = scaleSpace[i-1];
			// the amount of additional blur which is needed
			sigmas[i] = Math.sqrt(c*c-b*b);
			// take in account the change in image scale
			sigmas[i] /= scaleSpace[i-1];
		}

		return floatGaussian(scaleSpace,sigmas,imageType);
	}

	/**
	 * Constructs a scale-space image pyramid.  Each layer in the pyramid is the same size as the input image but
	 * has a different amount of blur applied to it.
	 *
	 * @param scaleSpace Amount of blur applied to each layer in the pyramid relative to the input image.
	 * @param imageType Type of image
	 * @param <T> Type of image
	 * @return Scale-space image pyramid
	 */
	public static <T extends ImageSingleBand>
	PyramidFloat<T> scaleSpace( double scaleSpace[], Class<T> imageType ) {

		double[] scaleFactors = new double[ scaleSpace.length ];

		for( int i = 0; i < scaleSpace.length; i++ ) {
			scaleFactors[i] = 1;
		}

		// find the amount of blue that it needs to apply at each layer
		double[] sigmas = new double[ scaleSpace.length ];

		sigmas[0] = scaleSpace[0];
		for( int i = 1; i < scaleSpace.length; i++ ) {
			// the desired amount of blur
			double c = scaleSpace[i];
			// the effective amount of blur applied to the last level
			double b = scaleSpace[i-1];
			// the amount of additional blur which is needed
			sigmas[i] = Math.sqrt(c*c-b*b);
		}

		return floatGaussian(scaleFactors,sigmas,imageType);
	}
}


text:
from __future__ import unicode_literals

import swapper

from accelerator_abstract.models import BaseNewsletterReceipt

class NewsletterReceipt(BaseNewsletterReceipt):
    class Meta(BaseNewsletterReceipt.Meta):
        swappable = swapper.swappable_setting(
            BaseNewsletterReceipt.Meta.app_label, "NewsletterReceipt")


text:
[![Circle CI](https://circleci.com/gh/lpil/exfmt.svg?style=shield)](https://circleci.com/gh/lpil/exfmt)
[![Hex version](https://img.shields.io/hexpm/v/exfmt.svg "Hex version")](https://hex.pm/packages/exfmt)
[![API Docs](https://img.shields.io/badge/api-docs-green.svg?style=flat)](https://hexdocs.pm/exfmt/)
[![Licence](https://img.shields.io/github/license/lpil/exfmt.svg)](https://www.apache.org/licenses/LICENSE-2.0)

# exfmt 🌸

## This tool has been deprecated

With the new [formatter](https://hexdocs.pm/mix/master/Mix.Tasks.Format.html)
in Elixir v1.6 there is no need for this formatter any more. Thanks for
checking out exfmt, it's been fun. :)

## Intro

> `exfmt` is in alpha.  If you run into any problems, please
> [report them][issues].
>
> **The format produced by exfmt will change significantly before the 1.0.0
> release.**  If this will cause problems for you, please refrain from using
> exfmt during the alpha- and beta-test periods.

[issues]: https://github.com/lpil/exfmt/issues

`exfmt` is inspired by Aaron VonderHaar's [elm-format][elm-format], and aims
to format [Elixir][elixir] source code largely according to the standards
defined in Aleksei Magusev's [Elixir Style Guide][style-guide].

```elixir
# exfmt takes any Elixir code...

defmodule MyApp, do: (
    use( SomeLib )
    def run( data ), do: {
      :ok,
      data
   }
)

# and rewrites it in a clean and idiomatic style:

defmodule MyApp do
  use SomeLib

  def run(data) do
    {:ok, data}
  end
end
```

The benefits of `exfmt`:

 - It makes code **easier to write**, because you never have to worry about
   minor formatting concerns while powering out new code.
 - It makes code **easier to read**, because there are no longer distracting
   minor stylistic differences between different code bases. As such, your
   brain can map more efficiently from source to mental model.
 - It makes code **easier to maintain**, because you can no longer have diffs
   related only to formatting; every diff necessarily involves a material
   change.
 - It **saves your team time** debating how to format things, because there is
   a standard tool that formats everything the same way.
 - It **saves you time** because you don't have to nitpick over formatting
   details of your code.

[elixir]: https://elixir-lang.org/
[elm-format]: https://github.com/avh4/elm-format
[style-guide]: https://github.com/lexmag/elixir-style-guide

## Contents

- [Usage](#usage)
- [Installation](#editor-integration)
- [Editor Integration](#editor-integration)
  - [Atom](#atom)
  - [Vim](#vim)
  - [VS Code](#visual-studio-code)
- [Development](#development)

## Usage

```sh
mix exfmt path/to/file.ex
```

### Command line options

* `--check` - Check if file is formatted, sets exit status
  to 1 if false.
* `--stdin` - Read from STDIN instead of a file.
* `--unsafe` - Disable the semantics check that verifies
  that `exmft` has not altered the semantic meaning of
  the input file.

## Installation

`exfmt` makes use of Elixir compiler features coming in Elixir v1.6.0 and as a
result can only be run with Elixir v1.6-dev off the Elixir master branch,
which you will need to download and compile yourself. Use with earlier
versions may work without crashing, but the output format will be incorrect.

An easier method of installation will be available when Elixir v1.6.0 is
released. Or sooner, perhaps!

## Editor integration

### Atom

Atom users can install Ron Green's [exfmt-atom][exfmt-atom] package.

[exfmt-atom]: https://atom.io/packages/exfmt-atom

### Vim

Vim users can use exfmt with Steve Dignam's [Neoformat][neoformat].

[neoformat]: https://github.com/sbdchd/neoformat

Once installed the following config will enable formatting of the current
Elixir buffer using `:Neoformat`. For further instructions, please reference
the Neoformat documentation.

```viml
let g:neoformat_elixir_exfmt = {
  \ 'exe': 'mix',
  \ 'args': ['exfmt', '--stdin'],
  \ 'stdin': 1
  \ }

let g:neoformat_enabled_elixir = ['exfmt']
```

### Visual Studio Code

VSCode users can use exfmt with James Hrisho's [vscode-exfmt][vscode-exfmt] package.

[vscode-exfmt]: https://github.com/securingsincity/vscode-exfmt


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgaModule } from '../../theme/nga.module';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';

import { DataTableModule, SharedModule, DialogModule, PanelModule, CalendarModule, AutoCompleteModule, InputTextModule, FileUploadModule } from 'primeng/primeng';

import { DrawingVersion } from './drawingVersion.component';
import { DrawingVersionTable } from './components/drawingVersionTable/drawingVersionTable.component';
import { DrawingVersionForm } from './components/drawingVersionForm/drawingVersionForm.component';

import { routing } from './drawingVersion.routing';
import { DrawingVersionService } from './drawingVersion.service';
import { ItemService } from '../item/item.service';
import { DrawingChangeRequestService } from '../drawingChangeRequest/drawingChangeRequest.service';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule } from '@angular/common/http';

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    NgaModule,
    DataTableModule,
    DialogModule,
    CalendarModule,
    SharedModule,
    PanelModule,
    AutoCompleteModule,
    InputTextModule,
    FileUploadModule,

    // BrowserModule,
    // HttpClientModule,
    routing
  ],
  declarations: [
    DrawingVersion,
    DrawingVersionTable,
    DrawingVersionForm
  ],
  providers: [DrawingVersionService, ItemService,DrawingChangeRequestService]
})
export class DrawingVersionModule { }


text:
var test = require('../');

var concat = require('concat-stream');
var tap = require('tap');

tap.test('test abort onStart', function (assert) {
    assert.plan(1);

    var verify = function (output) {
        assert.equal(output.toString('utf8'), [
            'TAP version 13',
            '',
            '1..0',
            '# tests 0',
            '# pass  0',
            '',
            'Bail out! Invalid test environment',
            ''
        ].join('\n'));
    };

    var tapeTest = test.createHarness();
    tapeTest.onStart(function (tests) {
        tapeTest.abort('Invalid test environment');
    });

    tapeTest.createStream().pipe(concat(verify));

    tapeTest('first test', function (t) {
        t.pass("assertion 1");
        t.end();
    });

    tapeTest('second test', function (t) {
        t.pass("assertion 2");
        t.end();
    });
});

tap.test('test abort from test', function (assert) {
    assert.plan(1);

    var verify = function (output) {
        assert.equal(output.toString('utf8'), [
            'TAP version 13',
            '# first test',
            'ok 1 assertion 1',
            '# second test',
            'ok 2 assertion 2',
            '',
            '1..2',
            '# tests 2',
            '# pass  2',
            '',
           'Bail out! Aborted by test suite',
            ''
        ].join('\n'));
    };

    var tapeTest = test.createHarness();
    tapeTest.createStream().pipe(concat(verify));

    tapeTest('first test', function (t) {
        t.pass("assertion 1");
        t.end();
    });

    tapeTest('second test', function (t) {
        tapeTest.abort(); // use default message
        t.pass("assertion 2");
        t.end();
    });

    tapeTest('third test', function (t) {
        t.pass("assertion 3");
        t.end();
    });
});

// the test of aborting from onTest() is in onTest.js


text:
namespace engine {

class ShotgunWeaponSubSystem : public SubSystem, public SubSystemHolder
{
public:
    DEFINE_SUB_SYSTEM_BASE( ShotgunWeaponSubSystem )

    ShotgunWeaponSubSystem();
    virtual void Init();
    virtual void Update( Actor& actor, double DeltaTime );
private:
    Scene& mScene;
    Opt<WeaponItemSubSystem> mWeaponItemSubSystem;
    ActorFactory& mActorFactory;
    int32_t mShotId;
    int32_t mShotAltId;
};

} // namespace engine

#endif//INCLUDED_ENGINE_ITEMS_SHOTGUN_WEAPON_SUB_SYSTEM_H


text:
require 'simple_command'

module Api
  module AppName
    module V1
      class TestCommand
        prepend SimpleCommand

        def initialize(params = {})
          @param1 = params[:param1]
          @param2 = params[:param2]
          @param3 = params[:param3]
        end

        def call
          execute
        end

        private

        attr_accessor :param1, :param2, :param3

        def execute
          return true if param1 == :param1 && param2 == :param2 && param3 == :param3

          errors.add :invalid_parameters, 'Parameters are invalid'

          nil
        end
      end
    end
  end
end


text:
<?php

    // Read the HTML, search for all CSS and JS files then minify them and put the contents into a single js file and a single css file
    // actions
    add_action( "before_draw", "compress", "compress" );

    class CompressPlugin extends Plugin {

        static function compress(){
            $html = self::$context['html'];
            $html = self::compress_all_css( $html );
            $html = self::compress_all_js( $html );
            $html = self::compress_html( $html );

            self::$context['html'] = $html;

        }

        static function compress_html( $html ){
            return preg_replace( array('/\n|\r|\t/','/ {2,}/'), array('', ' '), $html );
        }

        static function compress_all_css( $html ) {

            // search for all stylesheet
            if (!preg_match_all("/<link.*href=\"(.*?\.css)\".*>/", $html, $matches))
                return $html; // return the HTML if doesn't find any

            // prepare the variables
            $external_url = array();
            $css = $css_name = "";
            $url_array = array();

            // read all the CSS found
            foreach ($matches[1] as $url) {

                // if a CSS is repeat it takes only the first
                if( empty( $url_array[$url] ) ){
                    $url_array[ $url ] = 1;

                    // parse the URL
                    $parse = parse_url($url);

                    // read file
                    $stylesheet_file = file_get_contents($url);

                    if (preg_match_all("/url\({0,1}(.*?)\)/", $stylesheet_file, $matches)) {
                        foreach ($matches[1] as $image_url) {
                            $image_url = preg_replace("/'|\"/", "", $image_url);
                            dirname($url) . "/" . $image_url;
                            $real_path = reduce_path("../../../" . dirname($url) . "/" . $image_url);

                            $stylesheet_file = str_replace($image_url, $real_path, $stylesheet_file);
                        }
                    }

                    // minify the CSS
                    $stylesheet_file = preg_replace("/\n|\r|\t|\s{4}/", "", $stylesheet_file);

                    $css .= "\n\n/*---\n CSS compressed in Rain \n {$url} \n---*/\n\n" . $stylesheet_file;

                    // get the filename
                    $css_name .= basename($url);
                }
            }

            // create the filename
            $name = md5($css_name);

            // css cache folder
            $css_cache_folder = PUBLIC_CACHE_DIR . "css/";

            if( !is_dir($css_cache_folder) )
                mkdir($css_cache_folder,0755,$recursive=true);

            // create the complete filepath
            $css_filepath = $css_cache_folder . $name . ".css";

            // save the stylesheet
            file_put_contents($css_filepath, $css);

            // remove all the old stylesheet from the page
            $html = preg_replace("/<link.*href=\"(.*?\.css)\".*>/", "", $html);

            // create the tag for the stylesheet
            $stylesheet_tag = '<link href="' . $css_filepath . '" rel="stylesheet" type="text/css">';

            // add the tag to the end of the  tag
            $html = str_replace("", $stylesheet_tag . "\n", $html);

            // return the stylesheet
            return $html;
        }

        static function compress_all_js($html) {

            $html_to_check = preg_replace("", "", $html);

            preg_match_all("/';
            $html = preg_replace("/<\/body>/", $script_tag . "", $html);
            return $html;
        }

    }

// -- end


text:
default: build

start:
	docker-compose up -d
	docker-compose ps

stop:
	docker-compose stop

status:
	docker-compose ps

restart: stop start

top:
	docker-compose top

stats:
	docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}" --no-stream

stats-stream:
	docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.MemPerc}}\t{{.NetIO}}\t{{.BlockIO}}"

clean: stop
	docker-compose rm

build:
	docker-compose build

pull:
	docker-compose pull

push:
	docker-compose push

tail:
	docker-compose logs -f

.PHONY: start stop status restart top stats stats-stream clean build pull push tail


text:
module Vim
  module Tree
    module Model
      class Dir < Node
        include Enumerable

        attr_accessor :state

        def initialize(path, parent = nil, state = :closed)
          @state = state
          super(path, parent)
        end

        def move_out
          close(:recursive => true)
          reset(dirname)
          open
        end

        def move_in(node)
          reset(node) if node.directory?
        end

        def [](ix)
          flatten[ix]
        end

        def find(path)
          flatten.detect { |node| node.to_s == path }
        end

        def index(node)
          node = find(node) unless node.is_a?(Node)
          flatten.index(node)
        end

        def each(&block)
          open? ? children.each(&block) : []
        end

        def children
          @children ||= Pathname.glob(join('*')).map do |path|
            Node.build(path, self)
          end.sort
        end

        def dirs
          children.select { |child| child.directory? }
        end

        def flatten
          [self] + map { |node| node.respond_to?(:flatten) ? node.flatten : node }.compact.flatten
        end

        def toggle
          open? ? close : open
        end

        def open(options = {})
          self.state = :open
          each { |node| node.open(options) if node.directory? } if options[:recursive]
        end

        def close(options = {})
          each { |node| node.close(options) if node.directory? } if options[:recursive]
          @state = :closed
        end

        def open?
          state == :open
        end

        def reset(*args)
          options = args.last.is_a?(Hash) ? args.pop : {}
          root = args.first || self
          reset = lambda do
            @path = root.to_s if root
            @children = nil
          end
          options[:maintain_status] ? maintain_status(&reset) : reset.call
        end

        def maintain_status(&block)
          paths = flatten.select { |node| node.directory? && node.open? }.map(&:to_s)
          paths.unshift(to_s) if open?
          yield
          paths.each { |path| node = find(path) and node.open }
        end
      end
    end
  end
end


text:
function [cls, inst, categories]=load_gt(sbd_dir, imid)
x=load(fullfile(sbd_dir, 'cls', [imid '.mat']));
cls=x.GTcls.Segmentation;
x=load(fullfile(sbd_dir, 'inst', [imid '.mat']));
inst=x.GTinst.Segmentation;
instbdry=x.GTinst.Boundaries;
categories=x.GTinst.Categories;


text:
import numpy as np
import itertools
from sklearn.linear_model import SGDRegressor

from utils import plotting

class Estimator():
    """
    Value Function approximator.
    """

    def __init__(self, env, scaler, featurizer):
        self.env = env
        self.scaler = scaler
        self.featurizer = featurizer
        # We create a separate model for each action in the environment's
        # action space. Alternatively we could somehow encode the action
        # into the features, but this way it's easier to code up.
        self.models = []
        for _ in range(self.env.action_space.n):
            model = SGDRegressor(learning_rate="constant")
            # We need to call partial_fit once to initialize the model
            # or we get a NotFittedError when trying to make a prediction
            # This is quite hacky.
            initial_feature = self.featurize_state(env.reset()).reshape(1, -1)
            model.partial_fit(initial_feature, [0])
            self.models.append(model)

    def featurize_state(self, state):
        """
        Returns the featurized representation for a state.
        """
        scaled = self.scaler.transform([state])
        featurized = self.featurizer.transform(scaled)
        return featurized[0]

    def predict(self, s, a=None):
        """
        Makes value function predictions.

        Args:
            s: state to make a prediction for
            a: (Optional) action to make a prediction for

        Returns
            If an action a is given this returns a single number as the prediction.
            If no action is given this returns a vector or predictions for all actions
            in the environment where pred[i] is the prediction for action i.

        """
        models = self.models
        feature = self.featurize_state(s).reshape(1, -1)

        if a is not None:
            return models[a].predict(feature)[0]
        else:
            return [model.predict(feature) for model in models]

    def update(self, s, a, y):
        """
        Updates the estimator parameters for a given state and action towards
        the target y.
        """
        feature = self.featurize_state(s).reshape(1, -1)
        model = self.models[a]
        model.partial_fit(feature, [y])

def make_epsilon_greedy_policy(estimator, epsilon, nA):
    """
    Creates an epsilon-greedy policy based on a given Q-function approximator and epsilon.

    Args:
        estimator: An estimator that returns q values for a given state
        epsilon: The probability to select a random action . float between 0 and 1.
        nA: Number of actions in the environment.

    Returns:
        A function that takes the observation as an argument and returns
        the probabilities for each action in the form of a numpy array of length nA.

    """
    def policy_fn(observation):
        A = np.ones(nA, dtype=float) * epsilon / nA
        q_values = estimator.predict(observation)
        best_action = np.argmax(q_values)
        A[best_action] += (1.0 - epsilon)
        return A
    return policy_fn

def q_learning_fa(env, estimator, num_episodes, discount_factor=1.0, epsilon=0.1, epsilon_decay=1.0):
    """
    Q-Learning algorithm for fff-policy TD control using Function Approximation.
    Finds the optimal greedy policy while following an epsilon-greedy policy.

    Args:
        env: OpenAI environment.
        estimator: Action-Value function estimator
        num_episodes: Number of episodes to run for.
        discount_factor: Lambda time discount factor.
        epsilon: Chance the sample a random action. Float betwen 0 and 1.
        epsilon_decay: Each episode, epsilon is decayed by this factor

    Returns:
        An EpisodeStats object with two numpy arrays for episode_lengths and episode_rewards.
    """

    # keeps track of useful statistics
    stats = plotting.EpisodeStats(
        episode_lengths=np.zeros(num_episodes),
        episode_rewards=np.zeros(num_episodes))

    for i_episode in range(num_episodes):
        policy = make_epsilon_greedy_policy(
            estimator, epsilon * epsilon_decay**i_episode, env.action_space.n)

        current_state = env.reset()
        # keep track number of time-step per episode only for plotting
        for t in itertools.count():
            # choose the action based on epsilon greedy policy
            action_probs = policy(current_state)
            action = np.random.choice(np.arange(len(action_probs)), p=action_probs)
            next_state, reward, done, _ = env.step(action)

            # use the greedy action to evaluate Q, not the one we actually follow
            greedy_next_action = np.argmax(estimator.predict(next_state))
            # evaluate Q using estimated action value of (next_state, greedy_next_action)
            td_target = reward + discount_factor * estimator.predict(next_state, greedy_next_action)
            # update weights
            estimator.update(current_state, action, td_target)

            # update statistics
            stats.episode_rewards[i_episode] += reward
            stats.episode_lengths[i_episode] = t

            if done:
                break
            else:
                current_state = next_state

    return stats


text:
_[www.codever.land/bookmarks/t/developer-conference](https://www.codever.land/bookmarks/t/developer-conference)_
---
#### [Google I/O 2009 - The Myth of the Genius Programmer - 55min](https://www.youtube.com/watch?v=0SARbwvhupQ)
_https://www.youtube.com/watch?v=0SARbwvhupQ_

Google I/O 2009 - The Myth of the Genius Programmer

Brian Fitzpatrick, Ben Collins-Sussman

A pervasive elitism hovers in the background of collaborative software development:  everyone secretly want...
* :calendar: **published on**: 2009-06-02
* **tags**: [google](../tagged/google.md), [developer-conference](../tagged/developer-conference.md), [open-source](../tagged/open-source.md)
---


text:
<?php

namespace Google\Service;

use Google\Client;

/**
 * Service definition for GamesConfiguration (v1configuration).
 *
 *

 * The Google Play Game Services Publishing API allows developers to configure
 * their games in Game Services.

 *
 *

 * For more information about this service, see the API
 * Documentation
 *

 *
 * @author Google, Inc.
 */
class GamesConfiguration extends \Google\Service
{
  /** View and manage your Google Play Developer account. */
  const ANDROIDPUBLISHER =
      "https://www.googleapis.com/auth/androidpublisher";

  public $achievementConfigurations;
  public $imageConfigurations;
  public $leaderboardConfigurations;

  /**
   * Constructs the internal representation of the GamesConfiguration service.
   *
   * @param Client|array $clientOrConfig The client used to deliver requests, or a
   *                                     config array to pass to a new Client instance.
   * @param string $rootUrl The root URL used for requests to the service.
   */
  public function __construct($clientOrConfig = [], $rootUrl = null)
  {
    parent::__construct($clientOrConfig);
    $this->rootUrl = $rootUrl ?: 'https://gamesconfiguration.googleapis.com/';
    $this->servicePath = '';
    $this->batchPath = 'batch';
    $this->version = 'v1configuration';
    $this->serviceName = 'gamesConfiguration';

    $this->achievementConfigurations = new GamesConfiguration\Resource\AchievementConfigurations(
        $this,
        $this->serviceName,
        'achievementConfigurations',
        [
          'methods' => [
            'delete' => [
              'path' => 'games/v1configuration/achievements/{achievementId}',
              'httpMethod' => 'DELETE',
              'parameters' => [
                'achievementId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'get' => [
              'path' => 'games/v1configuration/achievements/{achievementId}',
              'httpMethod' => 'GET',
              'parameters' => [
                'achievementId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'insert' => [
              'path' => 'games/v1configuration/applications/{applicationId}/achievements',
              'httpMethod' => 'POST',
              'parameters' => [
                'applicationId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'list' => [
              'path' => 'games/v1configuration/applications/{applicationId}/achievements',
              'httpMethod' => 'GET',
              'parameters' => [
                'applicationId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
                'maxResults' => [
                  'location' => 'query',
                  'type' => 'integer',
                ],
                'pageToken' => [
                  'location' => 'query',
                  'type' => 'string',
                ],
              ],
            ],'update' => [
              'path' => 'games/v1configuration/achievements/{achievementId}',
              'httpMethod' => 'PUT',
              'parameters' => [
                'achievementId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],
          ]
        ]
    );
    $this->imageConfigurations = new GamesConfiguration\Resource\ImageConfigurations(
        $this,
        $this->serviceName,
        'imageConfigurations',
        [
          'methods' => [
            'upload' => [
              'path' => 'games/v1configuration/images/{resourceId}/imageType/{imageType}',
              'httpMethod' => 'POST',
              'parameters' => [
                'resourceId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
                'imageType' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],
          ]
        ]
    );
    $this->leaderboardConfigurations = new GamesConfiguration\Resource\LeaderboardConfigurations(
        $this,
        $this->serviceName,
        'leaderboardConfigurations',
        [
          'methods' => [
            'delete' => [
              'path' => 'games/v1configuration/leaderboards/{leaderboardId}',
              'httpMethod' => 'DELETE',
              'parameters' => [
                'leaderboardId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'get' => [
              'path' => 'games/v1configuration/leaderboards/{leaderboardId}',
              'httpMethod' => 'GET',
              'parameters' => [
                'leaderboardId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'insert' => [
              'path' => 'games/v1configuration/applications/{applicationId}/leaderboards',
              'httpMethod' => 'POST',
              'parameters' => [
                'applicationId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],'list' => [
              'path' => 'games/v1configuration/applications/{applicationId}/leaderboards',
              'httpMethod' => 'GET',
              'parameters' => [
                'applicationId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
                'maxResults' => [
                  'location' => 'query',
                  'type' => 'integer',
                ],
                'pageToken' => [
                  'location' => 'query',
                  'type' => 'string',
                ],
              ],
            ],'update' => [
              'path' => 'games/v1configuration/leaderboards/{leaderboardId}',
              'httpMethod' => 'PUT',
              'parameters' => [
                'leaderboardId' => [
                  'location' => 'path',
                  'type' => 'string',
                  'required' => true,
                ],
              ],
            ],
          ]
        ]
    );
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GamesConfiguration::class, 'Google_Service_GamesConfiguration');


text:
/**
 * @author Anton V. Karnachuk
 */

/**
 * Created on 11.02.2005
 */
package org.apache.harmony.jpda.tests.jdwp.ClassType;

import org.apache.harmony.jpda.tests.framework.jdwp.CommandPacket;
import org.apache.harmony.jpda.tests.framework.jdwp.JDWPCommands;
import org.apache.harmony.jpda.tests.framework.jdwp.JDWPConstants;
import org.apache.harmony.jpda.tests.framework.jdwp.ReplyPacket;
import org.apache.harmony.jpda.tests.jdwp.share.JDWPSyncTestCase;

/**
 * Super class of some JDWP unit tests for JDWP ClassType command set.
 */
public class JDWPClassTypeTestCase extends JDWPSyncTestCase {

    /**
     * Returns full name of debuggee class which is used by
     * testcases in this test.
     * @return full name of debuggee class.
     */
    protected String getDebuggeeClassName() {
        return "org.apache.harmony.jpda.tests.jdwp.ClassType.ClassTypeDebuggee";
    }

    /**
     * Returns signature of debuggee class which is used by
     * testcases in this test.
     * @return signature of debuggee class.
     */
    protected String getDebuggeeSignature() {
      return "Lorg/apache/harmony/jpda/tests/jdwp/ClassType/ClassTypeDebuggee;";
    }

    class FieldInfo {
        private long fieldID;
        private String name;
        private String signature;
        private int modBits;

        /**
         * @return Returns the fieldID.
         */
        public long getFieldID() {
            return fieldID;
        }

        /**
         * @return Returns the modBits.
         */
        public int getModBits() {
            return modBits;
        }

        /**
         * @return Returns the name.
         */
        public String getName() {
            return name;
        }

        /**
         * @return Returns the signature.
         */
        public String getSignature() {
            return signature;
        }

        public FieldInfo(long fieldID, String name, String signature,
                int modBits) {
            super();
            this.fieldID = fieldID;
            this.name = name;
            this.signature = signature;
            this.modBits = modBits;
        }

        public String toString() {
            return "fieldID=" + fieldID + "; name='" + name + "'; signature='" + signature
            + "'; modbits=" + modBits;
        }

    }

    /**
     * Returns for specified class array with information about fields of this class.
     *
Each element of array contains:
     *
Field ID, Field name, Field signature, Field modifier bit flags;
     * @param refType - ReferenceTypeID, defining class.
     * @return array with information about fields.
     */
    protected FieldInfo[] jdwpGetFields(long refType) {
        CommandPacket packet = new CommandPacket(
                JDWPCommands.ReferenceTypeCommandSet.CommandSetID,
                JDWPCommands.ReferenceTypeCommandSet.FieldsCommand);
        packet.setNextValueAsReferenceTypeID(refType);

        ReplyPacket reply = debuggeeWrapper.vmMirror.performCommand(packet);
        assertTrue(reply.getErrorCode() == JDWPConstants.Error.NONE);

        int declared = reply.getNextValueAsInt();
        FieldInfo[] fields = new FieldInfo[declared];
        for (int i = 0; i < declared; i++) {
            fields[i] =
                new FieldInfo(reply.getNextValueAsFieldID(),
                              reply.getNextValueAsString(),
                              reply.getNextValueAsString(),
                              reply.getNextValueAsInt());
        }
        return fields;
    }

}


text:
package org.apache.flink.changelog.fs;

import org.apache.flink.configuration.ReadableConfig;
import org.apache.flink.core.fs.Path;
import org.apache.flink.runtime.io.AvailabilityProvider;
import org.apache.flink.runtime.state.changelog.SequenceNumber;

import javax.annotation.concurrent.ThreadSafe;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

import static java.util.Collections.singletonList;
import static java.util.stream.Collectors.toList;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.BASE_PATH;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.COMPRESSION_ENABLED;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.IN_FLIGHT_DATA_LIMIT;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.NUM_UPLOAD_THREADS;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.PERSIST_DELAY;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.PERSIST_SIZE_THRESHOLD;
import static org.apache.flink.changelog.fs.FsStateChangelogOptions.UPLOAD_BUFFER_SIZE;
import static org.apache.flink.util.Preconditions.checkArgument;

// todo: consider using CheckpointStreamFactory / CheckpointStorageWorkerView
//     Considerations:
//     0. need for checkpointId in the current API to resolve the location
//       option a: pass checkpointId (race condition?)
//       option b: pass location (race condition?)
//       option c: add FsCheckpointStorageAccess.createSharedStateStream
//     1. different settings for materialized/changelog (e.g. timeouts)
//     2. re-use closeAndGetHandle
//     3. re-use in-memory handles (.metadata)
//     4. handle in-memory handles duplication

/**
 * Schedules {@link UploadTask upload tasks} on a {@link StateChangeUploader}. In the simplest form,
 * directly calls {@link StateChangeUploader#upload(Collection)}. Other implementations might batch
 * the tasks for efficiency.
 */
interface StateChangeUploadScheduler extends AutoCloseable {

    /**
     * Schedule the upload and {@link UploadTask#complete(List) complete} or {@link
     * UploadTask#fail(Throwable) fail} the corresponding tasks.
     */
    void upload(UploadTask uploadTask) throws IOException;

    static StateChangeUploadScheduler directScheduler(StateChangeUploader uploader) {
        return new StateChangeUploadScheduler() {
            @Override
            public void upload(UploadTask uploadTask) throws IOException {
                uploader.upload(singletonList(uploadTask)).complete();
            }

            @Override
            public void close() throws Exception {
                uploader.close();
            }
        };
    }

    static StateChangeUploadScheduler fromConfig(
            ReadableConfig config, ChangelogStorageMetricGroup metricGroup) throws IOException {
        Path basePath = new Path(config.get(BASE_PATH));
        long bytes = config.get(UPLOAD_BUFFER_SIZE).getBytes();
        checkArgument(bytes <= Integer.MAX_VALUE);
        int bufferSize = (int) bytes;
        StateChangeFsUploader store =
                new StateChangeFsUploader(
                        basePath,
                        basePath.getFileSystem(),
                        config.get(COMPRESSION_ENABLED),
                        bufferSize,
                        metricGroup);
        BatchingStateChangeUploadScheduler batchingStore =
                new BatchingStateChangeUploadScheduler(
                        config.get(PERSIST_DELAY).toMillis(),
                        config.get(PERSIST_SIZE_THRESHOLD).getBytes(),
                        RetryPolicy.fromConfig(config),
                        store,
                        config.get(NUM_UPLOAD_THREADS),
                        config.get(IN_FLIGHT_DATA_LIMIT).getBytes(),
                        metricGroup);
        return batchingStore;
    }

    default AvailabilityProvider getAvailabilityProvider() {
        return () -> AvailabilityProvider.AVAILABLE;
    }

    @ThreadSafe
    final class UploadTask {
        final Collection<StateChangeSet> changeSets;
        final Consumer<List<UploadResult>> successCallback;
        final BiConsumer<List<SequenceNumber>, Throwable> failureCallback;
        final AtomicBoolean finished = new AtomicBoolean();

        public UploadTask(
                Collection<StateChangeSet> changeSets,
                Consumer<List<UploadResult>> successCallback,
                BiConsumer<List<SequenceNumber>, Throwable> failureCallback) {
            this.changeSets = new ArrayList<>(changeSets);
            this.successCallback = successCallback;
            this.failureCallback = failureCallback;
        }

        public void complete(List<UploadResult> results) {
            if (finished.compareAndSet(false, true)) {
                successCallback.accept(results);
            }
        }

        public void fail(Throwable error) {
            if (finished.compareAndSet(false, true)) {
                failureCallback.accept(
                        changeSets.stream()
                                .map(StateChangeSet::getSequenceNumber)
                                .collect(toList()),
                        error);
            }
        }

        public long getSize() {
            long size = 0;
            for (StateChangeSet set : changeSets) {
                size += set.getSize();
            }
            return size;
        }

        @Override
        public String toString() {
            return "changeSets=" + changeSets;
        }
    }
}


text:
<!DOCTYPE html>

  <title>404 - Page Not Found</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <link rel="stylesheet" type="text/css" href="error_pages.css">

Page Not Found - 404

      Sorry. A page with that URL doesn't exist. Perhaps a page with that URL was moved or deleted.


text:
<?php

namespace zikmont\GestionDocumentalBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class zikmontGestionDocumentalBundle extends Bundle
{
}


text:
var test = require('tape');
var shot = require('shot');
var Server = require('../server.js');
var RedisMeow = require('../redis.js');

test("check back end test set-up, 1 equals 1", function(t) {
    t.equal(1, 1, "success!");
    t.end();
});
test("Testing request for frontend.js file", function(t) {
    shot.inject(Server.handler, {
        method: "GET",
        url: '/js/frontend.js'
    }, function(res) {
        t.equal(res.statusCode, 200, "...");
        t.end();
    });
});
test("Testing request for non existant file", function(t) {
    shot.inject(Server.handler, {
        method: "GET",
        url: '/js/kat4writesthebesttests13374204lyfe.js'
    }, function(res) {
        t.equal(res.statusCode, 404, "...");
        t.end();
    });
});
test("Testing endpoint /meows for a reponse of type array", function(t) {
    shot.inject(Server.handler, {
        method: "GET",
        url: '/meows'
    }, function(res) {
        t.equal(Array.isArray(JSON.parse(res.payload)), true, "success!");
        t.end();
    });
});
test("Testing endpoint / for response", function(t) {
    shot.inject(Server.handler, {
        method: "GET",
        url: '/'
    }, function(res) {
        console.log(res.payload.substring(0, 15));
        t.equal(res.payload.substring(0, 15), '<!DOCTYPE html>', "...");
        t.end();
    });
});
test("Testing POST request at /", function(t) {
    shot.inject(Server.handler, {
        method: "POST",
        url: '/',
        payload: JSON.stringify({
            cookie: '101021038',
            date: '2015-10-08',
            body: 'five'
        })
    }, function(res) {
        t.equal(res.statusCode, 200, "...");
        t.end();
        RedisMeow.client.quit();
    });
});


text:
var test = require('tap').test
var path = require('path')
var spawn = require('child_process').spawn
var concat = require('concat-stream')
var mkdirp = require('mkdirp')

var tmp = path.join(require('os').tmpdir(), 'dotc-' + Math.random())
mkdirp.sync(tmp)

var bin = path.join(__dirname, '../bin/dotc')

test('class', function (t) {
  t.plan(3)
  var outfile = path.join(tmp, Math.random() + '.out')
  var ps = spawn(bin, [ path.join(__dirname, 'class/main.c'), '-o', outfile ])

  ps.stderr.pipe(process.stderr)
  ps.stdout.pipe(process.stdout)
  ps.on('exit', function (code) {
    t.equal(code, 0)
    var p = spawn(outfile, [])
    p.stdout.pipe(concat(function (body) {
      t.equal(body + '', '5\n')
    }))
    p.on('exit', function (code) {
      t.equal(code, 0)
    })
  })
})


text:
package org.jabref.model.entry;

import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class BibEntryEqualityTest {
    @Test
    public void identicObjectsareEqual() throws Exception {
        BibEntry e1 = new BibEntry();
        BibEntry e2 = e1;
        assertTrue(e1.equals(e2));
    }

    @Test
    public void compareToNullObjectIsFalse() throws Exception {
        BibEntry e1 = new BibEntry();
        assertFalse(e1.equals(null));
    }

    @Test
    public void compareToDifferentClassIsFalse() throws Exception {
        BibEntry e1 = new BibEntry();
        Object e2 = new Object();
        assertFalse(e1.equals(e2));
    }

    @Test
    public void compareIsTrueWhenIdAndFieldsAreEqual() throws Exception {
        BibEntry e1 = new BibEntry();
        e1.setId("1");
        e1.setField("key", "value");
        BibEntry e2 = new BibEntry();
        e2.setId("1");
        assertFalse(e1.equals(e2));
        e2.setField("key", "value");
        assertTrue(e1.equals(e2));
    }
}


text: Alcas Office Partition Wall Systems - http://www.blendswap.com/user/exedesign


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.wildfly.swarm.topology.webapp (Public javadocs 2017.5.0 API)</title>
<meta name="date" content="2017-05-01">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.wildfly.swarm.topology.webapp

Interfaces

TopologyProperties

Classes

TopologyWebAppFraction


text:
function f () { return g() * 2; } // eslint-disable-line no-unused-vars
function g () { return 43; }


text:
/* eslint-disable */
// Auto-generated by generate-enums script on Thu Feb 24 2022 03:38:38 GMT-0500 (Eastern Standard Time)

/**
 * @enum
 * @readonly
 */
const ELobbyStatus = {
	"Invalid": 0,
	"Exists": 1,
	"DoesNotExist": 2,
	"NotAMember": 3,

	// Value-to-name mapping for convenience
	"0": "Invalid",
	"1": "Exists",
	"2": "DoesNotExist",
	"3": "NotAMember",
};

module.exports = ELobbyStatus;


text:
@**
* Yobi, Project Hosting SW
*
* Copyright 2014 NAVER Corp.
* http://yobi.io
*
* @Author Keesun
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title:String, form: Form[Organization])

@siteLayout("app.name", utils.MenuType.NONE) {

            <form action="@routes.OrganizationApp.newOrganization()" method="post" name="new-org" class="frm-wrap">
                <legend>
                    @Messages("title.newOrganization")
                </legend>

                                @if(flash.get("warning") != null) { @Messages(flash.get("warning")) }

                        @Messages("organization.name.placeholder")

                        <input id="name" type="text" name="name" class="text" placeholder="" maxlength="250" value="@form.field("name").value()" />

                        @Messages("organization.description.placeholder")

                        <textarea id="descr" name="descr" class="text textarea.span4" style="resize: vertical;" >@form.field("descr").value()</textarea>

                    <button class="ybtn ybtn-success">
                         @Messages("organization.create")
                    </button>
                    @Messages("button.cancel")

            </form>

}


text:
package com.eldoraludo.tripexpense.util;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

public class DateHelper {
	private static final String FORMAT_DATE_DB = "yyyy-MM-dd HH:mm:ss.sss";

	public static String convertirDateToString(DateTime dateAConvertir) {
		DateFormat df = new SimpleDateFormat(FORMAT_DATE_DB);
		return df.format(dateAConvertir.toDate());
	}

	public static DateTime convertirIntsToDate(int jour, int mois, int annee) {
		DateTimeFormatter format = DateTimeFormat.forPattern("dd/MM/yyyy");
		return format.parseDateTime(jour + "/" + mois + "/" + annee);
	}

	public static DateTime convertirStringToDate(String date) {
		DateTimeFormatter format = DateTimeFormat.forPattern(FORMAT_DATE_DB);
		return format.parseDateTime(date);
	}

	public static String prettyDate(DateTime dateAConvertir) {
		DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
		return df.format(dateAConvertir.toDate());
	}
}


text:
package org.springframework.cloud.stream.converter;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Arrays;

import com.fasterxml.jackson.databind.ObjectMapper;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.converter.AbstractMessageConverter;
import org.springframework.tuple.Tuple;
import org.springframework.tuple.TupleBuilder;
import org.springframework.util.MimeTypeUtils;

/**
 * A {@link org.springframework.messaging.converter.MessageConverter}
 * to convert a {@link Tuple} to a JSON String
 * @author David Turanski
 * @author Ilayaperumal Gopinathan
 * @author Marius Bogoevici
 */
public class TupleJsonMessageConverter extends AbstractMessageConverter {

	@Value("${typeconversion.json.prettyPrint:false}")
	private volatile boolean prettyPrint;

	private final ObjectMapper objectMapper;

	public void setPrettyPrint(boolean prettyPrint) {
		this.prettyPrint = prettyPrint;
	}

	public TupleJsonMessageConverter(ObjectMapper objectMapper) {
		super(Arrays.asList(MessageConverterUtils.X_SPRING_TUPLE, MimeTypeUtils.APPLICATION_JSON));
		this.objectMapper = (objectMapper != null) ? objectMapper : new ObjectMapper();
	}

	@Override
	protected boolean supports(Class<?> clazz) {
		return Tuple.class.isAssignableFrom(clazz);
	}

	@Override
	protected Object convertToInternal(Object payload, MessageHeaders headers, Object conversionHint) {
		Tuple t = (Tuple) payload;
		String json;
		if (this.prettyPrint) {
			try {
				Object tmp = this.objectMapper.readValue(t.toString(), Object.class);
				json = this.objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(tmp);
			}
			catch (IOException e) {
				this.logger.error(e.getMessage(), e);
				return null;
			}
		}
		else {
			json = t.toString();
		}
		return json;
	}

	@Override
	public Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) {
		String source;
		if (message.getPayload() instanceof byte[]) {
			source = new String((byte[]) message.getPayload(), Charset.forName("UTF-8"));
		}
		else {
			source = message.getPayload().toString();
		}
		return TupleBuilder.fromString(source);
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.batch">
  <properties>
    <property name="jboss.api" value="private" />
  </properties>
  <resources>
    <artifact name="${org.springframework.batch:spring-batch-core}" />
    <artifact name="${org.springframework.batch:spring-batch-infrastructure}" />
  </resources>
  <dependencies>
    <module name="javax.api" />
    <module name="javax.batch.api" />
    <module name="org.apache.commons.logging" />
    <module name="org.springframework.aop" />
    <module name="com.fasterxml.jackson.core.jackson-databind" />
    <module name="org.codehaus.jettison" />
    <module name="org.springframework.beans" />
    <module name="org.springframework.context" />
    <module name="org.springframework.core" />
    <module name="org.springframework.retry" />
    <module name="org.springframework.tx" />
  </dependencies>
</module>


text:
ver="1"

./create-json-generic.sh logic $ver


text:
//----------------------------------------------------------------------------//
//|
//|             MachOKit - A Lightweight Mach-O Parsing Library
//|             MKMachO+Bindings.m
//|
//|             D.V.
//|             Copyright (c) 2014-2015 D.V. All rights reserved.
//|
//| Permission is hereby granted, free of charge, to any person obtaining a
//| copy of this software and associated documentation files (the "Software"),
//| to deal in the Software without restriction, including without limitation
//| the rights to use, copy, modify, merge, publish, distribute, sublicense,
//| and/or sell copies of the Software, and to permit persons to whom the
//| Software is furnished to do so, subject to the following conditions:
//|
//| The above copyright notice and this permission notice shall be included
//| in all copies or substantial portions of the Software.
//|
//| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
//| OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
//| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
//| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
//| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
//| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
//| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//----------------------------------------------------------------------------//

#import "MKMachO+Bindings.h"
#import "MKInternal.h"

#import "MKBindingsInfo.h"
#import "MKWeakBindingsInfo.h"
#import "MKLazyBindingsInfo.h"

//----------------------------------------------------------------------------//
@implementation MKMachOImage (Bindings)

//◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦//
#pragma mark -  Bindings Information
//◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦//

//|++++++++++++++++++++++++++++++++++++|//
- (MKResult*)bindingsInfo
{
    if (_bindingsInfo == nil)
    {
        NSError *bindingsInfoError = nil;

        MKBindingsInfo *bindingsInfo = [[MKBindingsInfo alloc] initWithParent:self error:&bindingsInfoError];
        if (bindingsInfo)
            _bindingsInfo = [[MKResult alloc] initWithValue:bindingsInfo];
        else if (bindingsInfoError /* Only failed if we have an error */)
            _bindingsInfo = [[MKResult alloc] initWithError:bindingsInfoError];
        else
            _bindingsInfo = [MKResult new];

        [bindingsInfo release];
    }

    return _bindingsInfo;
}

//|++++++++++++++++++++++++++++++++++++|//
- (MKResult*)weakBindingsInfo
{
    if (_weakBindingsInfo == nil)
    {
        NSError *bindingsInfoError = nil;

        MKWeakBindingsInfo *bindingsInfo = [[MKWeakBindingsInfo alloc] initWithParent:self error:&bindingsInfoError];
        if (bindingsInfo)
            _weakBindingsInfo = [[MKResult alloc] initWithValue:bindingsInfo];
        else if (bindingsInfoError /* Only failed if we have an error */)
            _weakBindingsInfo = [[MKResult alloc] initWithError:bindingsInfoError];
        else
            _weakBindingsInfo = [MKResult new];

        [bindingsInfo release];
    }

    return _weakBindingsInfo;
}

//|++++++++++++++++++++++++++++++++++++|//
- (MKResult*)lazyBindingsInfo
{
    if (_lazyBindingsInfo == nil)
    {
        NSError *bindingsInfoError = nil;

        MKLazyBindingsInfo *bindingsInfo = [[MKLazyBindingsInfo alloc] initWithParent:self error:&bindingsInfoError];
        if (bindingsInfo)
            _lazyBindingsInfo = [[MKResult alloc] initWithValue:bindingsInfo];
        else if (bindingsInfoError /* Only failed if we have an error */)
            _lazyBindingsInfo = [[MKResult alloc] initWithError:bindingsInfoError];
        else
            _lazyBindingsInfo = [MKResult new];

        [bindingsInfo release];
    }

    return _lazyBindingsInfo;
}

//◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦//
#pragma mark -  MKNode
//◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦◦//

//|++++++++++++++++++++++++++++++++++++|//
+ (MKNodeFieldBuilder*)_bindingsInfoFieldBuilder
{
    MKNodeFieldBuilder *bindingsInfo = [MKNodeFieldBuilder
        builderWithProperty:MK_PROPERTY(bindingsInfo)
        type:[MKNodeFieldTypeNode typeWithNodeType:MKBindingsInfo.class]
    ];
    bindingsInfo.description = @"Binding Info";
    bindingsInfo.options = MKNodeFieldOptionDisplayAsChild;

    return bindingsInfo;
}

//|++++++++++++++++++++++++++++++++++++|//
+ (MKNodeFieldBuilder*)_weakBindingsInfoFieldBuilder
{
    MKNodeFieldBuilder *weakBindingsInfo = [MKNodeFieldBuilder
        builderWithProperty:MK_PROPERTY(weakBindingsInfo)
        type:[MKNodeFieldTypeNode typeWithNodeType:MKWeakBindingsInfo.class]
    ];
    weakBindingsInfo.description = @"Weak Binding Info";
    weakBindingsInfo.options = MKNodeFieldOptionDisplayAsChild;

    return weakBindingsInfo;
}

//|++++++++++++++++++++++++++++++++++++|//
+ (MKNodeFieldBuilder*)_lazyBindingsInfoFieldBuilder
{
    MKNodeFieldBuilder *lazyBindingsInfo = [MKNodeFieldBuilder
        builderWithProperty:MK_PROPERTY(lazyBindingsInfo)
        type:[MKNodeFieldTypeNode typeWithNodeType:MKLazyBindingsInfo.class]
    ];
    lazyBindingsInfo.description = @"Lazy Binding Info";
    lazyBindingsInfo.options = MKNodeFieldOptionDisplayAsChild;

    return lazyBindingsInfo;
}

@end


text:
import { Feature } from 'toolkit/extension/features/feature';

export class BottomNotificationBar extends Feature {
  injectCSS() {
    // Position the account notification bar at the bottom
    return require('./index.css');
  }
}


text:
@interface AboutMeViewController ()

@end

@implementation AboutMeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"关于喵";
    self.view.backgroundColor = [UIColor colorWithHue:170/255.0 saturation:5/255.0 brightness:244/255.0 alpha:255/255.0];
    UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];
    back.frame = CGRectMake(0, 0, 20, 20);
    [back addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [back setImage:[UIImage imageNamed:@"back_1"] forState:UIControlStateNormal];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:back];

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 50, 150, 100, 100)];
    imageView.layer.cornerRadius = 10;
    imageView.layer.masksToBounds = YES;
    imageView.image = [UIImage imageNamed:@"miao_log"];
    [self.view addSubview:imageView];

    UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 50, 300, 100, 40)];
    nameLabel.font = [UIFont fontWithName:@"Marker Felt" size:18];
    nameLabel.text = @"喵漫画";
    nameLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:nameLabel];

    UILabel *nameLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(ScreenWidth / 2 - 75, 360, 150, 20)];
    nameLabel1.font = [UIFont systemFontOfSize:14];
    nameLabel1.text = @"喵漫画 v1.0.0(10000)";
    nameLabel1.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:nameLabel1];

}

-(void)back{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end


text:
var FunctionUtils = {};

FunctionUtils.objectPublicFunctions = function(object) {
	function objFunctions(object) {
		var functionNames = [];
		for(var attribute in object) {
			if(typeof object[attribute] === 'function')
				functionNames.push(attribute);
		}
		return functionNames;
	}

	return objFunctions(object).filter(function(attribute) {
		return (attribute[0] !== '_' && attribute !== 'globalFunctions');
	});
};

FunctionUtils.objectReplicateFunctions = function(sourceObject, targetObject, excludeFunctions) {
	if(!Array.isArray(excludeFunctions))
		excludeFunctions = [];

	var functions = FunctionUtils.objectPublicFunctions(sourceObject); // get collection's public functions
	functions.forEach(function(functionName) {
		if(typeof targetObject[functionName] == 'undefined' && excludeFunctions.indexOf(functionName) < 0) { // safety check, don't override own functions
			// set own public function to match collection's function
			targetObject[functionName] = function () {
				sourceObject[functionName].apply(sourceObject, Array.prototype.slice.call(arguments));
			}
		}
	});
};

module.exports = FunctionUtils;


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.gbif.checklistbank.neo;

import org.gbif.api.model.checklistbank.NameUsage;
import org.gbif.api.model.checklistbank.NameUsageContainer;
import org.gbif.api.model.checklistbank.VerbatimNameUsage;
import org.gbif.api.vocabulary.NameType;
import org.gbif.api.vocabulary.Rank;
import org.gbif.checklistbank.cli.normalizer.IgnoreNameUsageException;
import org.gbif.checklistbank.cli.normalizer.NormalizationFailedException;
import org.gbif.dwc.ArchiveField;
import org.gbif.dwc.record.RecordImpl;
import org.gbif.dwc.record.StarRecordImpl;
import org.gbif.dwc.terms.DcTerm;
import org.gbif.dwc.terms.DwcTerm;
import org.gbif.dwc.terms.Term;

import java.net.URI;
import java.util.List;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.helpers.collection.Iterators;

import com.google.common.collect.Lists;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class NeoInserterTest {
  NeoInserter ins;
  List<String> values;
  List<ArchiveField> fields;
  UsageDao dao;

  @BeforeEach
  public void init() throws Exception {
    values = Lists.newArrayList();
    fields = Lists.newArrayList();
    dao = UsageDao.temporaryDao(10);
    ins = dao.createBatchInserter(100);
  }

  private void addColumn(Term term, String value) {
    ArchiveField f = new ArchiveField(fields.size(), term, null, ArchiveField.DataType.string);
    fields.add(f);
    values.add(value);
  }

  @Test
  public void testNonDwcProperties() throws Exception {

    addColumn(DwcTerm.taxonID, "1");
    addColumn(DwcTerm.scientificName, "Abies alba Mill., 1982");
    addColumn(DwcTerm.scientificNameAuthorship, "Mill.");
    addColumn(DwcTerm.namePublishedIn, "Führ. Pilzk. (Zwickau) 136 (1871)");
    addColumn(DwcTerm.namePublishedInID, "12345678");
    addColumn(DwcTerm.namePublishedInYear, "1871");
    addColumn(DwcTerm.nameAccordingTo, "Miller");
    addColumn(DwcTerm.nameAccordingToID, "123456");
    addColumn(DwcTerm.taxonRemarks, "bugger off");
    addColumn(DcTerm.references, "http://gbif.org");

    StarRecordImpl star = new StarRecordImpl(Lists.<Term>newArrayList());
    RecordImpl rec = new RecordImpl(fields.get(0), fields, DwcTerm.Taxon, true, true);
    rec.setRow(values.toArray(new String[]{}));
    star.newCoreRecord(rec);
    ins.insertStarRecord(star);
    ins.close();

    try (Transaction tx = dao.beginTx()) {
      Node n = dao.getNeo().getNodeById(0);
      assertEquals("1", n.getProperty(NeoProperties.TAXON_ID));

      VerbatimNameUsage v = dao.readVerbatim(n.getId());
      assertEquals("1", v.getCoreField(DwcTerm.taxonID));
      assertEquals("Abies alba Mill., 1982", v.getCoreField(DwcTerm.scientificName));
      assertEquals("Mill.", v.getCoreField(DwcTerm.scientificNameAuthorship));
      assertEquals("Führ. Pilzk. (Zwickau) 136 (1871)", v.getCoreField(DwcTerm.namePublishedIn));
      assertEquals("12345678", v.getCoreField(DwcTerm.namePublishedInID));
      assertEquals("1871", v.getCoreField(DwcTerm.namePublishedInYear));
      assertEquals("Miller", v.getCoreField(DwcTerm.nameAccordingTo));
      assertEquals("123456", v.getCoreField(DwcTerm.nameAccordingToID));
      assertEquals("bugger off", v.getCoreField(DwcTerm.taxonRemarks));
      assertEquals("http://gbif.org", v.getCoreField(DcTerm.references));

      NameUsage u = dao.readUsage(n, true);
      assertEquals("1", u.getTaxonID());
      assertEquals("Abies alba Mill., 1982", u.getScientificName());
      assertEquals("Mill.", u.getAuthorship());
      assertEquals("Führ. Pilzk. (Zwickau) 136 (1871)", u.getPublishedIn());
      assertEquals("Miller", u.getAccordingTo());
      assertEquals("bugger off", u.getRemarks());
      assertEquals(URI.create("http://gbif.org"), u.getReferences());
    }
  }

  @Test
  public void testTaxonIDUnique() throws Exception {

    addColumn(DwcTerm.taxonID, "1");
    addColumn(DwcTerm.scientificName, "Abies alba Mill., 1982");
    StarRecordImpl star = new StarRecordImpl(Lists.<Term>newArrayList());
    RecordImpl rec = new RecordImpl(fields.get(0), fields, DwcTerm.Taxon, true, true);
    rec.setRow(values.toArray(new String[]{}));
    star.newCoreRecord(rec);
    ins.insertStarRecord(star);

    values = Lists.newArrayList();
    fields = Lists.newArrayList();
    addColumn(DwcTerm.taxonID, "2");
    addColumn(DwcTerm.scientificName, "Picea alba");
    rec = new RecordImpl(fields.get(0), fields, DwcTerm.Taxon, true, true);
    rec.setRow(values.toArray(new String[]{}));
    star.newCoreRecord(rec);
    ins.insertStarRecord(star);

    ins.close();

    try (Transaction tx = dao.beginTx()) {
      assertNotNull(Iterators.singleOrNull(dao.getNeo().findNodes(Labels.TAXON, NeoProperties.TAXON_ID, "1")));
    }
  }

  @Test
  public void testTaxonIDNotUnique() throws Exception {
    assertThrows(
        NormalizationFailedException.class,
        () -> {
          final String ID = "1";
          addColumn(DwcTerm.taxonID, ID);
          addColumn(DwcTerm.scientificName, "Abies alba Mill., 1982");
          StarRecordImpl star = new StarRecordImpl(Lists.<Term>newArrayList());
          RecordImpl rec = new RecordImpl(fields.get(0), fields, DwcTerm.Taxon, true, true);
          rec.setRow(values.toArray(new String[] {}));
          star.newCoreRecord(rec);
          ins.insertStarRecord(star);

          values = Lists.newArrayList();
          fields = Lists.newArrayList();
          addColumn(DwcTerm.taxonID, ID);
          addColumn(DwcTerm.scientificName, "Picea alba");
          rec = new RecordImpl(fields.get(0), fields, DwcTerm.Taxon, true, true);
          rec.setRow(values.toArray(new String[] {}));
          star.newCoreRecord(rec);
          ins.insertStarRecord(star);

          ins.close();
        });
  }

  @Test
  public void testParseName() throws Exception {

    VerbatimNameUsage v = new VerbatimNameUsage();
    v.setCoreField(DwcTerm.scientificName, "Abies alba Mill., 1982");
    assertName(v, Rank.SPECIES, "Abies alba Mill., 1982", "Abies alba", NameType.SCIENTIFIC);

    v = new VerbatimNameUsage();
    v.setCoreField(DwcTerm.scientificName, "Abies alba");
    assertName(v, Rank.SPECIES, "Abies alba", "Abies alba", NameType.SCIENTIFIC);

    v = new VerbatimNameUsage();
    v.setCoreField(DwcTerm.scientificName, "? alba");
    assertName(v, Rank.SPECIES, "? alba", "? alba", NameType.PLACEHOLDER);

    v = new VerbatimNameUsage();
    v.setCoreField(DwcTerm.genus, "Abies");
    v.setCoreField(DwcTerm.specificEpithet, "alba");
    assertName(v, Rank.SPECIES, "Abies alba", "Abies alba", NameType.SCIENTIFIC);

    v = new VerbatimNameUsage();
    v.setCoreField(DwcTerm.genus, "Abies");
    v.setCoreField(DwcTerm.infraspecificEpithet, "alpina");
    assertName(v, Rank.SUBSPECIES, "Abies subsp.", "Abies subsp.", NameType.SCIENTIFIC);

    v = new VerbatimNameUsage();
    v.setCoreField(DwcTerm.genus, "Abies");
    v.setCoreField(DwcTerm.specificEpithet, "alba");
    v.setCoreField(DwcTerm.infraspecificEpithet, "alpina");
    assertName(v, Rank.SUBSPECIES, "Abies alba subsp. alpina", "Abies alba alpina", NameType.SCIENTIFIC);

    v.setCoreField(DwcTerm.scientificNameAuthorship, "Duméril & Bibron");
    assertName(v, Rank.SUBSPECIES, "Abies alba subsp. alpina Duméril & Bibron", "Abies alba alpina", NameType.SCIENTIFIC);

    v.setCoreField(DwcTerm.namePublishedInYear, "1937");
    assertName(v, Rank.SUBSPECIES, "Abies alba subsp. alpina Duméril & Bibron, 1937", "Abies alba alpina", NameType.SCIENTIFIC);

    v.setCoreField(DwcTerm.scientificNameAuthorship, "Duméril & Bibron 1937");
    assertName(v, Rank.SUBSPECIES, "Abies alba subsp. alpina Duméril & Bibron, 1937", "Abies alba alpina", NameType.SCIENTIFIC);
  }

  @Test
  public void testParseNameExc() throws Exception {
    assertThrows(
        IgnoreNameUsageException.class,
        () -> {
          VerbatimNameUsage v = new VerbatimNameUsage();
          assertName(v, Rank.SPECIES, null, null, NameType.NO_NAME);
        });
  }

  private NameUsageContainer assertName(VerbatimNameUsage v, Rank rank, String sciname, String canonical, NameType ntype)
      throws IgnoreNameUsageException {
    NameUsageContainer u = new NameUsageContainer();
    ins.parseName(u, v, rank);
    if (sciname != null) {
      assertEquals(sciname, u.getScientificName());
    } else {
      assertNull(u.getScientificName());
    }
    if (canonical != null) {
      assertEquals(canonical, u.getCanonicalName());
    } else {
      assertNull(u.getCanonicalName());
    }
    if (ntype != null) {
      assertEquals(ntype, u.getNameType());
    } else {
      assertNull(u.getNameType());
    }
    return u;
  }

  @Test
  public void testClean() throws Exception {
    assertNull(NeoInserter.clean(null));
    assertNull(NeoInserter.clean(" "));
    assertNull(NeoInserter.clean("   "));
    assertNull(NeoInserter.clean("\\N"));
    assertNull(NeoInserter.clean("NULL"));
    assertNull(NeoInserter.clean("\t "));
    assertNull(NeoInserter.clean("\u0000"));
    assertNull(NeoInserter.clean("\u0001"));
    assertNull(NeoInserter.clean("\u0002"));

    assertEquals("Abies", NeoInserter.clean("Abies"));
    assertEquals("öAbies", NeoInserter.clean("öAbies"));
    assertEquals("Abies  mille", NeoInserter.clean(" Abies  mille"));
    assertEquals("Abies x", NeoInserter.clean("Abies\u0000x"));
    assertEquals("Abies x", NeoInserter.clean("Abies\u0000\u0000\u0000x"));
    assertEquals("Abies x", NeoInserter.clean("Abies\u0000\u0001x"));
  }

}