text:
package gelf // import "github.com/docker/docker/daemon/logger/gelf"

import (
	"compress/flate"
	"encoding/json"
	"fmt"
	"net"
	"net/url"
	"strconv"
	"time"

	"github.com/Graylog2/go-gelf/gelf"
	"github.com/docker/docker/daemon/logger"
	"github.com/docker/docker/daemon/logger/loggerutils"
	"github.com/docker/docker/pkg/urlutil"
	"github.com/sirupsen/logrus"
)

const name = "gelf"

type gelfLogger struct {
	writer   gelf.Writer
	info     logger.Info
	hostname string
	rawExtra json.RawMessage
}

func init() {
	if err := logger.RegisterLogDriver(name, New); err != nil {
		logrus.Fatal(err)
	}
	if err := logger.RegisterLogOptValidator(name, ValidateLogOpt); err != nil {
		logrus.Fatal(err)
	}
}

// New creates a gelf logger using the configuration passed in on the
// context. The supported context configuration variable is gelf-address.
func New(info logger.Info) (logger.Logger, error) {
	// parse gelf address
	address, err := parseAddress(info.Config["gelf-address"])
	if err != nil {
		return nil, err
	}

	// collect extra data for GELF message
	hostname, err := info.Hostname()
	if err != nil {
		return nil, fmt.Errorf("gelf: cannot access hostname to set source field")
	}

	// parse log tag
	tag, err := loggerutils.ParseLogTag(info, loggerutils.DefaultTemplate)
	if err != nil {
		return nil, err
	}

	extra := map[string]interface{}{
		"_container_id":   info.ContainerID,
		"_container_name": info.Name(),
		"_image_id":       info.ContainerImageID,
		"_image_name":     info.ContainerImageName,
		"_command":        info.Command(),
		"_tag":            tag,
		"_created":        info.ContainerCreated,
	}

	extraAttrs, err := info.ExtraAttributes(func(key string) string {
		if key[0] == '_' {
			return key
		}
		return "_" + key
	})

	if err != nil {
		return nil, err
	}

	for k, v := range extraAttrs {
		extra[k] = v
	}

	rawExtra, err := json.Marshal(extra)
	if err != nil {
		return nil, err
	}

	var gelfWriter gelf.Writer
	if address.Scheme == "udp" {
		gelfWriter, err = newGELFUDPWriter(address.Host, info)
		if err != nil {
			return nil, err
		}
	} else if address.Scheme == "tcp" {
		gelfWriter, err = newGELFTCPWriter(address.Host, info)
		if err != nil {
			return nil, err
		}
	}

	return &gelfLogger{
		writer:   gelfWriter,
		info:     info,
		hostname: hostname,
		rawExtra: rawExtra,
	}, nil
}

// create new TCP gelfWriter
func newGELFTCPWriter(address string, info logger.Info) (gelf.Writer, error) {
	gelfWriter, err := gelf.NewTCPWriter(address)
	if err != nil {
		return nil, fmt.Errorf("gelf: cannot connect to GELF endpoint: %s %v", address, err)
	}

	if v, ok := info.Config["gelf-tcp-max-reconnect"]; ok {
		i, err := strconv.Atoi(v)
		if err != nil || i < 0 {
			return nil, fmt.Errorf("gelf-tcp-max-reconnect must be a positive integer")
		}
		gelfWriter.MaxReconnect = i
	}

	if v, ok := info.Config["gelf-tcp-reconnect-delay"]; ok {
		i, err := strconv.Atoi(v)
		if err != nil || i < 0 {
			return nil, fmt.Errorf("gelf-tcp-reconnect-delay must be a positive integer")
		}
		gelfWriter.ReconnectDelay = time.Duration(i)
	}

	return gelfWriter, nil
}

// create new UDP gelfWriter
func newGELFUDPWriter(address string, info logger.Info) (gelf.Writer, error) {
	gelfWriter, err := gelf.NewUDPWriter(address)
	if err != nil {
		return nil, fmt.Errorf("gelf: cannot connect to GELF endpoint: %s %v", address, err)
	}

	if v, ok := info.Config["gelf-compression-type"]; ok {
		switch v {
		case "gzip":
			gelfWriter.CompressionType = gelf.CompressGzip
		case "zlib":
			gelfWriter.CompressionType = gelf.CompressZlib
		case "none":
			gelfWriter.CompressionType = gelf.CompressNone
		default:
			return nil, fmt.Errorf("gelf: invalid compression type %q", v)
		}
	}

	if v, ok := info.Config["gelf-compression-level"]; ok {
		val, err := strconv.Atoi(v)
		if err != nil {
			return nil, fmt.Errorf("gelf: invalid compression level %s, err %v", v, err)
		}
		gelfWriter.CompressionLevel = val
	}

	return gelfWriter, nil
}

func (s *gelfLogger) Log(msg *logger.Message) error {
	level := gelf.LOG_INFO
	if msg.Source == "stderr" {
		level = gelf.LOG_ERR
	}

	m := gelf.Message{
		Version:  "1.1",
		Host:     s.hostname,
		Short:    string(msg.Line),
		TimeUnix: float64(msg.Timestamp.UnixNano()/int64(time.Millisecond)) / 1000.0,
		Level:    int32(level),
		RawExtra: s.rawExtra,
	}
	logger.PutMessage(msg)

	if err := s.writer.WriteMessage(&m); err != nil {
		return fmt.Errorf("gelf: cannot send GELF message: %v", err)
	}
	return nil
}

func (s *gelfLogger) Close() error {
	return s.writer.Close()
}

func (s *gelfLogger) Name() string {
	return name
}

// ValidateLogOpt looks for gelf specific log option gelf-address.
func ValidateLogOpt(cfg map[string]string) error {
	address, err := parseAddress(cfg["gelf-address"])
	if err != nil {
		return err
	}

	for key, val := range cfg {
		switch key {
		case "gelf-address":
		case "tag":
		case "labels":
		case "labels-regex":
		case "env":
		case "env-regex":
		case "gelf-compression-level":
			if address.Scheme != "udp" {
				return fmt.Errorf("compression is only supported on UDP")
			}
			i, err := strconv.Atoi(val)
			if err != nil || i < flate.DefaultCompression || i > flate.BestCompression {
				return fmt.Errorf("unknown value %q for log opt %q for gelf log driver", val, key)
			}
		case "gelf-compression-type":
			if address.Scheme != "udp" {
				return fmt.Errorf("compression is only supported on UDP")
			}
			switch val {
			case "gzip", "zlib", "none":
			default:
				return fmt.Errorf("unknown value %q for log opt %q for gelf log driver", val, key)
			}
		case "gelf-tcp-max-reconnect", "gelf-tcp-reconnect-delay":
			if address.Scheme != "tcp" {
				return fmt.Errorf("%q is only valid for TCP", key)
			}
			i, err := strconv.Atoi(val)
			if err != nil || i < 0 {
				return fmt.Errorf("%q must be a positive integer", key)
			}
		default:
			return fmt.Errorf("unknown log opt %q for gelf log driver", key)
		}
	}

	return nil
}

func parseAddress(address string) (*url.URL, error) {
	if address == "" {
		return nil, fmt.Errorf("gelf-address is a required parameter")
	}
	if !urlutil.IsTransportURL(address) {
		return nil, fmt.Errorf("gelf-address should be in form proto://address, got %v", address)
	}
	url, err := url.Parse(address)
	if err != nil {
		return nil, err
	}

	// we support only udp
	if url.Scheme != "udp" && url.Scheme != "tcp" {
		return nil, fmt.Errorf("gelf: endpoint needs to be TCP or UDP")
	}

	// get host and port
	if _, _, err = net.SplitHostPort(url.Host); err != nil {
		return nil, fmt.Errorf("gelf: please provide gelf-address as proto://host:port")
	}

	return url, nil
}


text:
actions :create, :delete
default_action :create

attribute :name, :kind_of => String, :required => true, :name_attribute => true #qtree
attribute :volume, :kind_of => String
attribute :svm, :kind_of => String, :required => true

#optional parameters
attribute :export_policy, :kind_of => String
attribute :mode, :kind_of => String
attribute :oplocks, :kind_of => String, :equal_to => ["enabled", "disabled"]
attribute :security, :kind_of => String, :equal_to => ["unix", "ntfs", "mixed"]
attribute :force, :kind_of => [TrueClass, FalseClass]

redpajama_set_name: RedPajamaGithub


text:
package org.bremersee.pagebuilder.testmodel;

import javax.xml.bind.annotation.XmlRegistry;

/**
 * The xml object factory og the test model.
 *
 * @author Christian Bremer
 */
@SuppressWarnings("unused")
@XmlRegistry
public class ObjectFactory {

  /**
   * Create address.
   *
   * @return the address
   */
  public Address createAddress() {
    return new Address();
  }

  /**
   * Create cat.
   *
   * @return the cat
   */
  public Cat createCat() {
    return new Cat();
  }

  /**
   * Create dog.
   *
   * @return the dog
   */
  public Dog createDog() {
    return new Dog();
  }

  /**
   * Create person.
   *
   * @return the person
   */
  public Person createPerson() {
    return new Person();
  }

  /**
   * Create animal page.
   *
   * @return the animal page
   */
  public AnimalPage createAnimalPage() {
    return new AnimalPage();
  }

}


text:
<?php

namespace HarvestCloud\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * ExpenseAccount Entity
 *
 * @author Tom Haskins-Vaughan <tom@harvestcloud.com>
 * @since  2013-03-21
 *
 * @ORM\Entity
 */
class ExpenseAccount extends Account
{
    /**
     * isExpense()
     *
     * @author Tom Haskins-Vaughan <tom@harvestcloud.com>
     * @since  2013-03-20
     * @see    Account::isExpense()
     */
    public function isExpense()
    {
        return true;
    }
}


text:
layout: page_notitle
author:
  display_name: Steve Gourley
  email: sgourley@utah.gov
tags: []
date: 2017-12-21 15:18:09 -0700
title: PLSS Corner Management
categories:
  - Developer
---

PLSS Corner Management

Tools for visualizing and creating corner points

In partnership with Surveyors?

    external link plss.utah.gov
    github repository link Repository
    download data link Download Application Data

Easy to understand point clusters with contributing factor filters

Why

Section corners in the Public Land Survey System (PLSS) form the foundation for all descriptions of private property and public land boundaries in Utah. All legal property descriptions start from PLSS section corner markers, also known as monuments. If you've ever seen a legal description of a parcel, a subdivision development, or even a service district or municipality, you may have noticed that the description and map always starts with a reference to a PLSS section corner. Keeping the correct, precise location of these corners accessible greatly reduces boundary discrepancies and disputes.

This web application allows surveyors to create an account to submit monument record sheets electronically. A standard form was created to unify the information collected. The application then notifies the county of the submission and the data is reviewed and subsequently incorporated into the PLSS data.

Data Origination

Licensed land surveyors perform the section corner location and monumentation, typically by setting a brass cap. The surveyor also completes a formal monument record sheet (a.k.a. a 'tie sheet') that is submitted to the appropriate county and state entities that preserve the record. Field notes from the survey may also be part of the required record.

Challenges

Each year hundreds of section corners that are used to determine property locations are in danger of being destroyed from land disturbances like new road projects, property development, and even conservation projects that rehabilitate vegetation after wild land and forest fires.

Urban development is expanding into many areas in Utah that have not been surveyed since the early 1900's. Historically, it has been difficult to quickly identify and protect the section corners that may be impacted, while not slowing down the desired pace of development.


text:
"""Defines a dummy MPC planner that always returns the zero action."""
import jax.numpy as jnp
from .mpc import MPC

class Zero(MPC):
  """A dummy MPC planner that always returns the zero action."""

  def init_state(self, a_shape, rng):
    return None

  def update(self, mpc_state, env, env_state, rng, reward_fn=None,
             reward_params=None, reward_rng=None):
    return None

  def get_action(self, mpc_state, a_shape):
    return jnp.zeros(a_shape)


text:
package org.apache.harmony.javax.security.auth;

import java.security.DomainCombiner;
import java.security.Principal;
import java.security.ProtectionDomain;
import java.util.Set;

/**
 * Merges permissions based on code source and code signers with permissions granted to the
 * specified {@link Subject}.
 */
public class SubjectDomainCombiner implements DomainCombiner {
	// subject to be associated
	private Subject subject;
	// permission required to get a subject object
	private static final AuthPermission _GET = new AuthPermission(
			"getSubjectFromDomainCombiner"); //$NON-NLS-1$

	/**
	 * Creates a domain combiner for the entity provided in {@code subject}.
	 * @param subject the entity to which this domain combiner is associated.
	 */
	public SubjectDomainCombiner(Subject subject) {
		super();
		if (subject == null) {
			throw new NullPointerException();
		}
		this.subject = subject;
	}
	/**
	 * Returns the entity to which this domain combiner is associated.
	 * @return the entity to which this domain combiner is associated.
	 */
	public Subject getSubject() {
		SecurityManager sm = System.getSecurityManager();
		if (sm != null) {
			sm.checkPermission(_GET);
		}
		return subject;
	}
	/**
	 * Merges the {@code ProtectionDomain} with the {@code Principal}s associated with the subject
	 * of this {@code SubjectDomainCombiner}.
	 * @param currentDomains the {@code ProtectionDomain}s associated with the context of the
	 *            current thread. The domains must be sorted according to the execution order, the
	 *            most recent residing at the beginning.
	 * @param assignedDomains the {@code ProtectionDomain}s from the parent thread based on code
	 *            source and signers.
	 * @return a single {@code ProtectionDomain} array computed from the two provided arrays, or
	 *         {@code null}.
	 * @see ProtectionDomain
	 */
	@Override
	public ProtectionDomain[] combine(ProtectionDomain[] currentDomains,
			ProtectionDomain[] assignedDomains) {
		// get array length for combining protection domains
		int len = 0;
		if (currentDomains != null) {
			len += currentDomains.length;
		}
		if (assignedDomains != null) {
			len += assignedDomains.length;
		}
		if (len == 0) {
			return null;
		}
		ProtectionDomain[] pd = new ProtectionDomain[len];
		// for each current domain substitute set of principal with subject's
		int cur = 0;
		if (currentDomains != null) {
			Set<Principal> s = subject.getPrincipals();
			Principal[] p = s.toArray(new Principal[s.size()]);
			for (cur = 0; cur < currentDomains.length; cur++) {
				if (currentDomains[cur] != null) {
					ProtectionDomain newPD;
					newPD = new ProtectionDomain(
							currentDomains[cur].getCodeSource(),
							currentDomains[cur].getPermissions(),
							currentDomains[cur].getClassLoader(), p);
					pd[cur] = newPD;
				}
			}
		}
		// copy assigned domains
		if (assignedDomains != null) {
			System.arraycopy(assignedDomains, 0, pd, cur,
					assignedDomains.length);
		}
		return pd;
	}
}


text:
package tests

import (
	"testing"

	"github.com/apache/thrift/lib/go/test/gopath/src/unionbinarytest"
)

// See https://issues.apache.org/jira/browse/THRIFT-4573
func TestUnionBinary(t *testing.T) {
	s := unionbinarytest.NewSample()
	s.U1 = map[string]string{}
	s.U2 = []byte{}
	if n := s.CountSetFieldsSample(); n != 2 {
		t.Errorf("Expected 2 set fields, got %d!", n)
	}
}


text:
classdef CVtrainer < ModelTrainers.Base

    %% --------------------------------------------------------------------
    properties (SetAccess = protected)
        trainer;
        parallelFolds;
        nFolds;
        folds;
        foldsPerformance;
        models;
        recreateFolds;
        lastMaxFoldSize;
    end

    %% --------------------------------------------------------------------
    properties (SetAccess = public)
        abortPerfMin;
    end

    %% --------------------------------------------------------------------
    methods (Static)

        function usePCT = useParallelComputing( newValue )
            persistent usePCT_staticVar;
            if isempty( usePCT_staticVar )
                usePCT_staticVar = false;
            end
            if nargin > 0
                if ~islogical( newValue ), newValue = logical( newValue ); end
                usePCT_staticVar = newValue;
            end
            usePCT = usePCT_staticVar;
        end

        function loadBAs = loadBlockAnnotations( newValue )
            persistent loadBAs_staticVar;
            if isempty( loadBAs_staticVar )
                loadBAs_staticVar = false;
            end
            if nargin > 0
                if ~islogical( newValue ), newValue = logical( newValue ); end
                loadBAs_staticVar = newValue;
            end
            loadBAs = loadBAs_staticVar;
        end

    end

    %% --------------------------------------------------------------------
    methods

        function obj = CVtrainer( trainer )
            if ~isa( trainer, 'ModelTrainers.Base' )
                error( 'trainer must implement ModelTrainers.Base' );
            end
            obj.trainer = trainer;
            obj.nFolds = 5;
            obj.abortPerfMin = -inf;
            obj.performanceMeasure = trainer.performanceMeasure;
            obj.lastMaxFoldSize = 0;
            obj.recreateFolds = true;
        end
        %% ----------------------------------------------------------------

        function setNumberOfFolds( obj, nFolds )
            if ischar( nFolds ) && strcmpi( nFolds, 'preFolded' )
                nFolds = numel( obj.trainSet.folds );
            end
            if nFolds < 2, error( 'CV cannot be executed with less than two folds.' ); end
            if mod( numel( obj.trainSet.folds ), nFolds ) ~= 0
                warning( 'Executing CV with nFolds different from the number of set up disjunct data folds -- data will not be stratified wrt files on sources 2:n!' );
            end
            obj.nFolds = nFolds;
            if nFolds ~= obj.nFolds
                obj.parallelFolds = [];
            end
        end
        %% ----------------------------------------------------------------

        % override of ModelTrainers.Base's method
        function setData( obj, trainSet, testSet )
            if ~exist( 'testSet', 'var' ), testSet = []; end
            obj.recreateFolds = ~isequal( obj.trainSet, trainSet );
            setData@ModelTrainers.Base( obj, trainSet, testSet );
        end
        %% ----------------------------------------------------------------

        function run( obj )
            obj.buildModel();
        end
        %% ----------------------------------------------------------------

        function buildModel( obj, ~, ~, ~ )
            obj.trainer.setPerformanceMeasure( obj.performanceMeasure );
            obj.createFolds();
            obj.foldsPerformance = ones( obj.nFolds, 1 );
            pctInstalled = ~isempty( ver( 'distcomp' ) );
            pctLicensed = license( 'test', 'Distrib_Computing_Toolbox' );
%             freemem = memReport() %#ok<*NOPRT,*NASGU> % for debugging
            if ModelTrainers.CVtrainer.useParallelComputing && pctInstalled && pctLicensed
                obj.buildModel_pct();
            else
                obj.buildModel_standard();
            end
%             freemem = memReport() % for debugging
        end
        %% ----------------------------------------------------------------

        function buildModel_pct( obj, ~, ~, ~ )
            foldsPerformance_tmp = obj.foldsPerformance;
            if isempty( obj.parallelFolds )
                if isempty( gcp( 'nocreate' ) )
                    pc = parcluster();
                    pc_tmpDir = cleanPathFromRelativeRefs( fullfile( ...
                                             pwd, '..', 'parpool_tmps', ...
                                             ['parpool_tmp' buildCurrentTimeString()] ) );
                    mkdir( pc_tmpDir );
                    pc.JobStorageLocation = pc_tmpDir;
                    parpool( pc, min( obj.nFolds, feature( 'numcores' ) ) );
                end
                obj.parallelFolds = parallel.pool.Constant( obj.folds );
            end
            parallelFolds_tmp = obj.parallelFolds;
            trainers_tmp(obj.nFolds) = obj.trainer;
            trainers_tmp(obj.nFolds).setData( [], [] );
            for ff = 1 : obj.nFolds
                trainers_tmp(ff) = copy( trainers_tmp(obj.nFolds) );
            end
            foldsIdx = 1 : obj.nFolds;
            models_tmp = cell( obj.nFolds, 1 );
%             freemem = memReport() % for debugging
            fmask = obj.featureMask;
            parfor ff = foldsIdx
                fprintf( '\nStarting run %d of CV... \n', ff );
%                 freemem = memReport() % for debugging
                foldsIdx_tmp = foldsIdx;
                foldsIdx_tmp(ff) = [];
                fc = cat( 1, parallelFolds_tmp.Value{foldsIdx_tmp} ); %#ok<PFBNS>
                foldCombi = struct( 'x', {cat( 1, fc(:).x )}, ...
                                    'y', {cat( 1, fc(:).y )}, ...
                                    'blockAnnotations', {cat( 1, fc(:).blockAnnotations )} );
                trainer_ff = trainers_tmp(ff);
                ModelTrainers.Base.featureMask( true, fmask ); % persistent variables are not copied to workers
                trainer_ff.setData( foldCombi, parallelFolds_tmp.Value{ff} );
%                 freemem = memReport() % for debugging
                trainer_ff.run();
%                 freemem = memReport() % for debugging
                foldsPerformance_tmp(ff) = double( trainer_ff.getPerformance() );
                fprintf( '\nDone with run %d of CV. Performance = %f\n\n', ...
                                                           ff, foldsPerformance_tmp(ff) );
                models_tmp{ff} = trainer_ff.getModel();
%                 freemem = memReport() % for debugging
            end
            obj.models = models_tmp;
            obj.foldsPerformance = foldsPerformance_tmp;
        end
        %% ----------------------------------------------------------------

        function buildModel_standard( obj, ~, ~, ~ )
            for ff = 1 : obj.nFolds
                foldsIdx = 1 : obj.nFolds;
                foldsIdx(ff) = [];
                fc = cat( 1, obj.folds{foldsIdx} );
                foldsRecombinedData = struct( 'x', {cat( 1, fc(:).x )}, ...
                                              'y', {cat( 1, fc(:).y )}, ...
                                              'blockAnnotations', {cat( 1, fc(:).blockAnnotations )} );
                obj.trainer.setData( foldsRecombinedData, obj.folds{ff} );
                verboseFprintf( obj, 'Starting run %d of CV... \n', ff );
%                 freemem = memReport() % for debugging
                obj.trainer.run();
%                 freemem = memReport() % for debugging
                obj.models{ff} = obj.trainer.getModel();
                obj.foldsPerformance(ff) = double( obj.trainer.getPerformance() );
                verboseFprintf( obj, '\nDone. Performance = %f\n\n', obj.foldsPerformance(ff) );
                maxPossiblePerf = mean( obj.foldsPerformance );
%                 freemem = memReport() % for debugging
                if (ff < obj.nFolds) && (maxPossiblePerf <= obj.abortPerfMin)
                    % assume mean performance so far is about right --
                    % important when using CV to not only judge about the
                    % best model
                    obj.foldsPerformance(ff+1:end) = mean( obj.foldsPerformance(1:ff) );
                    break;
                end
            end
        end
        %% ----------------------------------------------------------------

        function performance = getPerformance( obj )
            performance.avg = mean( obj.foldsPerformance );
            performance.std = std( obj.foldsPerformance );
        end
        %% ----------------------------------------------------------------

    end

    %% --------------------------------------------------------------------
    methods (Access = protected)

        function model = giveTrainedModel( ~ ) %#ok<STOUT>
            error( 'cvtrainer -- which model do you want?' );
        end
        %% ----------------------------------------------------------------

        function createFolds( obj )
            maxFoldDataSize = ceil( max( obj.trainer.maxDataSize / obj.nFolds, ...
                                         obj.trainer.maxTestDataSize ) );
            if ~obj.recreateFolds && (maxFoldDataSize == obj.lastMaxFoldSize), return; end
            obj.folds = obj.trainSet.splitInPermutedStratifiedFolds( obj.nFolds );
            for ff = 1 : obj.nFolds
                fprintf( '\nPreparing fold %d\n', ff );
                [x,y,~,~,ba] = ModelTrainers.Base.getSelectedData( obj.folds{ff}, ...
                                        maxFoldDataSize, obj.trainer.dataSelector, [], ...
                                        true, false, ModelTrainers.CVtrainer.loadBlockAnnotations );
                obj.folds{ff} = struct( 'x', {x}, 'y', {y}, 'blockAnnotations', {ba} );
            end
            obj.recreateFolds = false;
            obj.lastMaxFoldSize = maxFoldDataSize;
            obj.parallelFolds = [];
        end
        %% ----------------------------------------------------------------

        function foldCombi = getAllFoldsButOne( obj, exceptIdx )
            foldsIdx = 1 : obj.nFolds;
            foldsIdx(exceptIdx) = [];
            foldCombi = Core.IdentTrainPipeData.combineData( obj.folds{foldsIdx} );
        end
        %% ----------------------------------------------------------------

    end

end


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

namespace Topics.Radical.Windows.Behaviors
{
	[TypeConverter( typeof( AutoCompleteFilterPathCollectionTypeConverter ) )]
	public class AutoCompleteFilterPathCollection : Collection<string>
	{
		public AutoCompleteFilterPathCollection( IList<string> list )
			: base( list )
		{
		}

		public AutoCompleteFilterPathCollection()
		{
		}

		internal string Join()
		{
			string[] array = new string[ this.Count ];
			this.CopyTo( array, 0 );
			return String.Join( ",", array );
		}
	}

	internal class AutoCompleteFilterPathCollectionTypeConverter : TypeConverter
	{
		public override bool CanConvertFrom( ITypeDescriptorContext context, Type sourceType )
		{
			if( sourceType == typeof( string ) )
				return true;
			return base.CanConvertFrom( context, sourceType );
		}

		public override bool CanConvertTo( ITypeDescriptorContext context, Type destinationType )
		{
			if( destinationType == typeof( string ) )
				return true;
			return base.CanConvertTo( context, destinationType );
		}

		public override object ConvertFrom( ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value )
		{
			if( value is string )
			{
				string[] paths = ( ( string )value ).Split( new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries );
				return new AutoCompleteFilterPathCollection( paths );
			}
			return base.ConvertFrom( context, culture, value );
		}

		public override object ConvertTo( ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType )
		{
			if( destinationType == typeof( string ) )
			{
				AutoCompleteFilterPathCollection c = ( AutoCompleteFilterPathCollection )value;
				return c.Join();
			}
			return base.ConvertTo( context, culture, value, destinationType );
		}
	}
}


text:
package org.apache.druid.segment.incremental;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.cfg.MapperConfig;
import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
import com.fasterxml.jackson.databind.introspect.AnnotatedClassResolver;
import com.fasterxml.jackson.databind.jsontype.NamedType;
import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.io.Closer;

import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * This class handles the incremental-index lifecycle for testing.
 * Any index created using this class during the test will be closed automatically once this class is closed.
 *
 * To allow testing multiple incremental-index implementations, this class can be instantiated with any
 * {@code AppendableIndexSpec} instance.
 * Alternatively, this class can instantiate an {@code AppendableIndexSpec} for you given the appendable-index type as
 * a string.
 * This allows tests' parameterization with the appendable-index types as strings.
 *
 * To further facilitate the tests' parameterization, this class supports listing all the available incremental-index
 * implementations, and produce a cartesian product of many parameter options together with each incremental-index
 * implementation.
 */
public class IncrementalIndexCreator implements Closeable
{
  public static final ObjectMapper JSON_MAPPER = new DefaultObjectMapper();

  /**
   * Allows adding support for testing unregistered indexes.
   * It is used by Druid's extensions for the incremental-index.
   *
   * @param c    an index spec class
   * @param name an index spec name
   */
  public static void addIndexSpec(Class<?> c, String name)
  {
    JSON_MAPPER.registerSubtypes(new NamedType(c, name));
  }

  static {
    // The off-heap incremental-index is not registered for production, but we want to include it in the tests.
    IncrementalIndexCreator.addIndexSpec(OffheapIncrementalIndexTestSpec.class, OffheapIncrementalIndexTestSpec.TYPE);
  }

  /**
   * Fetch all the available incremental-index implementations.
   * It can be used to parametrize the test. If more parameters are needed, use indexTypeCartesianProduct().
   * @see #indexTypeCartesianProduct(Collection[]).
   *
   * @return a list of all the incremental-index implementations types (String)
   */
  public static List<String> getAppendableIndexTypes()
  {
    SubtypeResolver resolver = JSON_MAPPER.getSubtypeResolver();
    MapperConfig<?> config = JSON_MAPPER.getDeserializationConfig();
    AnnotatedClass cls = AnnotatedClassResolver.resolveWithoutSuperTypes(config, AppendableIndexSpec.class);
    Collection<NamedType> types = resolver.collectAndResolveSubtypesByClass(config, cls);
    return types.stream().map(NamedType::getName).filter(Objects::nonNull).distinct().collect(Collectors.toList());
  }

  public interface IndexCreator
  {
    /**
     * Build an index given a builder and args.
     *
     * @param builder an incremental index builder supplied by the framework
     * @param args a list of arguments that are used to configure the builder
     * @return a new instance of an incremental-index
     */
    IncrementalIndex<?> createIndex(AppendableIndexBuilder builder, Object... args);
  }

  private final Closer closer = Closer.create();

  private final AppendableIndexSpec appendableIndexSpec;

  private final IndexCreator indexCreator;

  /**
   * Initialize the creator.
   *
   * @param spec a spec that can generate a incremental-index builder
   * @param indexCreator a function that generate an index given a builder and arguments
   */
  public IncrementalIndexCreator(AppendableIndexSpec spec, IndexCreator indexCreator)
  {
    this.appendableIndexSpec = spec;
    this.indexCreator = indexCreator;
  }

  /**
   * Initialize the creator.
   *
   * @param indexType an index type (name)
   * @param indexCreator a function that generate an index given a builder and arguments
   */
  public IncrementalIndexCreator(String indexType, IndexCreator indexCreator) throws JsonProcessingException
  {
    this(parseIndexType(indexType), indexCreator);
  }

  /**
   * Generate an AppendableIndexSpec from index type.
   *
   * @param indexType an index type
   * @return AppendableIndexSpec instance of this type
   * @throws JsonProcessingException if failed to to parse the index
   */
  public static AppendableIndexSpec parseIndexType(String indexType) throws JsonProcessingException
  {
    return JSON_MAPPER.readValue(
        StringUtils.format("{\"type\": \"%s\"}", indexType),
        AppendableIndexSpec.class
    );
  }

  /**
   * Create an index given the input args.
   *
   * @param args The arguments for the index-generator
   * @return An incremental-index instance
   */
  public final IncrementalIndex<?> createIndex(Object... args)
  {
    return createIndex(indexCreator, args);
  }

  /**
   * Create an index given the input args with a specialized index-creator.
   *
   * @param args The arguments for the index-generator
   * @return An incremental-index instance
   */
  public final IncrementalIndex<?> createIndex(IndexCreator indexCreator, Object... args)
  {
    return closer.register(indexCreator.createIndex(appendableIndexSpec.builder(), args));
  }

  @Override
  public void close() throws IOException
  {
    closer.close();

    if (appendableIndexSpec instanceof Closeable) {
      ((Closeable) appendableIndexSpec).close();
    }
  }

  /**
   * Generates all the permutations of the parameters with each of the registered appendable index types.
   * It is used to parameterize the tests with all the permutations of the parameters
   * together with all the appnedbale index types.
   *
   * For example, for a parameterized test with the following constrctor:
   * {@code
   *   public IncrementalIndexTest(String indexType, String mode, boolean deserializeComplexMetrics)
   *   {
   *     ...
   *   }
   * }
   *
   * we can test all the input combinations as follows:
   * {@code
   *   @Parameterized.Parameters(name = "{index}: {0}, {1}, deserialize={2}")
   *   public static Collection<?> constructorFeeder()
   *   {
   *     return IncrementalIndexCreator.indexTypeCartesianProduct(
   *         ImmutableList.of("rollup", "plain"),
   *         ImmutableList.of(true, false)
   *     );
   *   }
   * }
   *
   * @param c a list of collections of parameters
   * @return the cartesian product of all parameters and appendable index types
   */
  public static List<Object[]> indexTypeCartesianProduct(Collection<?>... c)
  {
    Collection<?>[] args = new Collection<?>[c.length + 1];
    args[0] = getAppendableIndexTypes();
    System.arraycopy(c, 0, args, 1, c.length);
    return cartesianProduct(args);
  }

  /**
   * Generates all the permutations of the parameters.
   *
   * @param c a list of collections of parameters
   * @return the cartesian product of all parameters
   */
  private static List<Object[]> cartesianProduct(Collection<?>... c)
  {
    final ArrayList<Object[]> res = new ArrayList<>();
    final int curLength = c.length;

    if (curLength == 0) {
      res.add(new Object[0]);
      return res;
    }

    final int curItem = curLength - 1;
    for (Object[] objList : cartesianProduct(Arrays.copyOfRange(c, 0, curItem))) {
      for (Object o : c[curItem]) {
        Object[] newObjList = Arrays.copyOf(objList, curLength);
        newObjList[curItem] = o;
        res.add(newObjList);
      }
    }

    return res;
  }
}


text:
export interface ServeTaskOptions {
    port?: number;
    host?: string;
    proxyConfig?: string;
    watcher?: string;
    liveReload?: boolean;
    liveReloadHost?: string;
    liveReloadPort?: number;
    liveReloadBaseUrl?: string;
    liveReloadLiveCss?: boolean;
    target?: string;
    environment?: string;
    ssl?: boolean;
    sslKey?: string;
    sslCert?: string;
    aot?: boolean;
    sourcemap?: boolean;
    open?: boolean;
}
declare const ServeCommand: any;
export default ServeCommand;


text:
"""Injections dependency injection framework

Usage
=====

Declare a class' dependencies::

    @injections.has
    class Hello(object):

        world = injections.depends(World, 'universe')

You must decorate class with ``@injections.has``. All dependencies has a
type(class), which is ``World`` in this case, and a name, which is ``universe``
in this case. This is for having multiple similar dependencies.

.. note::

    Name of dependency is unique among all services in single dependency
    injector and not tied to particular type. This is done to easier support
    subclassing of dependencies (and you can also register subclass with abc
    instead of subclassing directly)

Then at some initialisation code you create dependency injector, and set
apropriate services::

    inj = injections.Container()
    inj['universe'] = World()

Now you can create ``Hello`` instances and inject dependencies to them::

    hello = inj.inject(Hello())
    assert hello.world is inj['universe']

And you can propagate dependencies starting from existing instances::

    h2 = injections.propagate(hello, Hello())
    assert h2.world is hello.world

"""

from .topsort import topologically_sorted

def has(cls):
    """Class decorator that declares dependencies"""
    deps = {}
    for i in dir(cls):
        if i.startswith('__') and i.endswith('__'):
            continue
        val = getattr(cls, i, None)
        if isinstance(val, Dependency):
            deps[i] = val
            if val.name is None:
                val.name = i
    cls.__injections__ = deps
    return cls

class Dependency:
    """Property that represents single dependency"""

    def __init__(self, typ, name=None):
        self.type = typ
        self.name = name

    def __get__(self, inst, owner):
        if inst is None:
            return self
        raise RuntimeError("Dependency {!r} is not configured".format(self))

    def __repr__(self):
        return "<Dependency {!r}:{!r}>".format(self.type, self.name)

depends = Dependency  # nicer declarative name

class MissingDependencyError(KeyError):
    """Required dependency is missed in container"""

    def __str__(self):
        return "Dependency {!r} is missed in container".format(self.args[0])

class Container(object):
    """Container for things that will be dependency-injected

    Set all dependencies with::

        >>> inj = Container()
        >>> inj['name'] = value
        >>> obj = inj.inject(DependentClass())

    Propagate dependencies with::

        >>> injections.propagate(obj, NewObject())
    """

    def __init__(self, *args, **kw):
        self._provides = dict(*args, **kw)

    def inject(self, inst, **renames):
        """Injects dependencies and propagates dependency injector"""
        if renames:
            di = self.clone(**renames)
        else:
            di = self
        pro = di._provides
        inst.__injections_source__ = di
        deps = getattr(inst, '__injections__', None)
        if deps:
            for attr, dep in deps.items():
                val = pro.get(dep.name)
                if val is None:
                    raise MissingDependencyError(dep.name)

                if not isinstance(val, dep.type):
                    raise TypeError("Wrong provider for {!r}".format(val))
                setattr(inst, attr, val)
        meth = getattr(inst, '__injected__', None)
        if meth is not None:
            meth()
        return inst

    def __setitem__(self, name, value):
        if name in self._provides:
            raise RuntimeError("Two providers for {!r}".format(name))
        self._provides[name] = value

    def __getitem__(self, name):
        return self._provides[name]

    def __contains__(self, name):
        return name in self._provides

    def clone(self, **renames):
        di = self.__class__()
        mypro = self._provides
        pro = di._provides
        pro.update(mypro)
        for name, alias in renames.items():
            pro[name] = mypro[alias]
        return di

    def interconnect_all(self):
        """Propagate dependencies for provided instances"""
        for dep in topologically_sorted(self._provides):
            if hasattr(dep, '__injections__') and not hasattr(dep, '__injections_source__'):
                self.inject(dep)

def dependencies(cls):
    """Returns dict of dependencies of a class declared with
    ``@injections.has``
    """
    return getattr(cls, '__injections__', {})

def get_container(obj):
    """Returns dependency injector used to construct class

    This instance is useful to propagate dependencies
    """
    try:
        return obj.__injections_source__
    except AttributeError:
        raise RuntimeError("No dependency injector found")

def propagate(source, target):
    """Propagates dependencies from container used to fill `source` to fill
        target's dependencies

         Equivalent of::

            get_container(source).inject(target)
    """
    return get_container(source).inject(target)


text:
> *Note:* This style guide inherits rules from the [SGML-Based Languages Style Guide](./README.md) and the [Global Style Guide](../README.md). For images, it also assumes compliance with the [Media Files Style Guide](../Media%20Files/README.md). This document supersedes our legacy [Production Standards](../Legacy/Production.Standards.doc?raw=true) and [HTML Style Guide](../Legacy/HTML.StyleGuide.doc?raw=true) documents (Microsoft Word).

## Contents
- [General Principles](#general-principles)
- [Formatting](#formatting)
- [Semantics](#semantics)
- [Encoding](#encoding)
- [Acknowledgments](#acknowledgments)

## General Principles
> "Strive to maintain HTML standards and semantics, but not at the expense of practicality. Use the least amount of markup with the fewest intricacies whenever possible." - [Mark Otto](http://markdotto.com/about/) ([source](http://mdo.github.io/code-guide/#html-practicality))

## Formatting
- It is recommended to use [Mark Otto](http://markdotto.com/about/)'s proposed [attribute order](http://mdo.github.io/code-guide/#html-attribute-order)

## Language Features
- Always begin the document with the doctype (i.e., `<!DOCTYPE html>`)
- Always include optional elements (e.g., `html`, `head`, `body`)
- If setting content type, always use `text/html` (even for XHTML)
- Explicitly close tags where closing tag is optional (e.g., `<p>`, `<li>`)
- Use self-enclosing syntax for "void" elements (e.g., `<br />`, `<hr />`)
- Do not include attribute value for Boolean attributes (e.g., `<input disabled />`)
- Always provide an `alt` element for multimedia content (e.g., `<img>`, `<audio>`, `<video>`)
- Prefer `<svg>` to `<canvas>` unless performance is a key concern (e.g., 100+ elements)
- Omit `type` attribute for `<link>`, `<script>` or `<style>` elements
- Always define `rel` attribute for `<link>` element; define when appropriate for `<a>` element
- Always define a `lang` attribute on the `<html>` element
- Always wrap `<input>` elements with a `<label>` element (no need for the `for` attribute in this usage)
- Elements that must exist no more than one time should be identified using `id`; otherwise `class`

## Semantics
- Always use semantic tags when available (e.g., `<button>` over `<div class="button" />`)
- Every page should have one (and exactly one) `<main>` element identifying the primary content
- Every page should have *at least* one `<header>`, `<footer>`, `<nav>`, and `<article>` element
- For a detail page, the `<main>` element will typically include an `<article>` element, which may include multiple `<section>` elements
- For an index of pages or comments, use an `<article>` element for each item; in this case, the `<article>` elements may be wrapped in a `<section>` element
- Headings (e.g., `h1`-`h6`) should be used to denote outline, not (just) style; use a class modifier to alter a style rather than skipping a heading
- The `<section>`, `<article>`, and `<aside>` effectively encapsulate a node in the outline; headings can optionally be "reset" within them (i.e., start back at `h1`) if preferred (not required)
- At minimum, set ARIA `role` attributes on HTML5 semantic elements (e.g., `<header role="banner">`)
- When no meaningful semantic tags are otherwise available, authors are *strongly encouraged* to decorate markup with [Schema.org](http://schema.org) types
  - Prefer using [RDFa lite](http://rdfa.info/) syntax over [Microdata](http://www.w3.org/TR/microdata/) or [Microformats](http://microformats.org/); RDFa is extensible into other vocabularies, and is no more verbose than Microdata
- Attempt to limit `<div>` elements for presentational requirements (e.g., changing positioning); otherwise, prefer semantic elements
- Use [HTML5 Shim](https://github.com/aFarkas/html5shiv) to ensure backward compatibility with Internet Explorer

## Encoding
- Always set encoding to UTF-8 (i.e., via `<meta charset="utf-8">`)
- Take advantage of UTF-8 encoding; do not use entity-references unless required (e.g., for HTML escaping)

## Acknowledgments
- [Code Guide by @mdo](http://mdo.github.io/code-guide/) by [Mark Otto](http://markdotto.com/about/)
- [Google HTML/CSS Style Guide](http://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml)
- [Front-end Code Standards & Best Practices](http://isobar-idev.github.io/code-standards/) by [isobar](http://www.isobar.com/)


text:
'use strict';
const createRouter = require('@arangodb/foxx/router');
const cluster = require('@arangodb/cluster');
const router = createRouter();
const db = require('@arangodb').db;
const joi = require('joi');

module.context.use(router);

let getMoveableShards = function() {
  let servers = global.ArangoClusterInfo.getDBServers();
  return db._collections().reduce((moveableShards, collection) => {
    let props = collection.properties();
    if (props.distributeShardsLike) {
      return moveableShards;
    }

    // must have at least 3 free servers
    if (props.replicationFactor > servers.length - 3) {
      return moveableShards;
    }
    let shards = collection.shards();
    return shards.reduce((moveableShards, shardName) => {
      let shard = global.ArangoClusterInfo.getCollectionInfoCurrent(db._name(), collection.name(), shardName);
      moveableShards.push({shard: shardName, collection: collection.name(), servers: shard.servers});
      return moveableShards;
    }, moveableShards);
  }, []);
}

let getPossibleServers = function(collection, shard) {
  let shardInfo = global.ArangoClusterInfo.getCollectionInfoCurrent(db._name(), collection, shard);
  let servers = global.ArangoClusterInfo.getDBServers();

  let possibleServers = servers.filter(server => {
    return shardInfo.servers.indexOf(server.serverId) === -1;
  });

  return possibleServers;
}

router.get('/moveable-shards', function (req, res) {
  let moveableShards = getMoveableShards();
  res.json(moveableShards);
})

router.get('/possible-servers', function(req, res) {
  res.json(getPossibleServers(req.queryParams.collection, req.queryParams.shard));
});

router.post('/move-shard', function(req, res) {
  let shard = req.body;
  let moveableShards = getMoveableShards();

  let moveableShard = moveableShards.filter(moveableShard => {
    return moveableShard.shard == shard;
  })[0];

  if (!moveableShard) {
    res.throw(404, 'Not a moveable shard');
    return;
  }

  let possibleServers = getPossibleServers(moveableShard.collection, moveableShard.shard);
  if (possibleServers.length < 3) {
    res.throw(404, 'Not enough possible servers');
    return;
  }

  let toServer = possibleServers[Math.floor(Math.random() * possibleServers.length)].serverId;

  let info = {
    shard,
    database: db._name(),
    collection: moveableShard.collection,
    // ideally take a follower :S - so simply always last
    fromServer: moveableShard.servers[moveableShard.servers.length-1],
    toServer
  };

  let result = cluster.moveShard(info);
  if (result.error) {
    res.throw(500, result);
    return;
  }
  res.json(result.id);
})
.body(joi.string().required());

router.get('/job-state/:id', function(req, res) {
  let id = req.pathParams.id;
  let result = global.ArangoAgency.read([[
    `/arango/Target/ToDo/${id}`,
    `/arango/Target/Pending/${id}`,
    `/arango/Target/Failed/${id}`,
    `/arango/Target/Finished/${id}`,
  ]]);
  if (typeof result == 'undefined'
    || typeof result[0].arango == 'undefined'
    || typeof result[0].arango == 'undefined'
    || typeof result[0].arango.Target == 'undefined'
    || typeof result[0].arango.Target.ToDo == 'undefined'
    || typeof result[0].arango.Target.Pending == 'undefined'
    || typeof result[0].arango.Target.Failed == 'undefined'
    || typeof result[0].arango.Target.Finished == 'undefined'
  ) {
    res.throw(500, 'Invalid agency response');
  }

  result = result[0].arango.Target;

  let job = null;
  let status = null;
  if (result.ToDo[id]) {
    status = 'working';
    job = result.ToDo[id];
  } else if (result.Pending[id]) {
    status = 'working';
    job = result.Pending[id];
  } else if (result.Failed[id]) {
    status = 'failed';
    job = result.Failed[id];
  } else if (result.Finished[id]) {
    job = result.Finished[id];
    status = 'finished';
  } else {
    res.throw(404, 'Job not found');
    return;
  }

  if (!job || job.type != 'moveShard' || !job.toServer) {
    res.throw(400, 'Invalid job');
    return;
  }

  let stateResult = {
    status
  };

  if (status == 'finished') {
    stateResult.toServer = job.toServer;
  }

  res.json(stateResult);
})
.pathParam('id', joi.number().required())


text:
"""
Utilities to implement Single Sign On for Discourse with a Python managed authentication DB

https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045

Thanks to James Potter for the heavy lifting, detailed at https://meta.discourse.org/t/sso-example-for-django/14258

A SSO request handler might look something like

    @login_required
    def discourse_sso_view(request):
        payload = request.GET.get('sso')
        signature = request.GET.get('sig')
        try:
            nonce = sso_validate(payload, signature, SECRET)
        except DiscourseError as e:
            return HTTP400(e.args[0])

        url = sso_redirect_url(nonce, SECRET, request.user.email, request.user.id, request.user.username)
        return redirect('http://discuss.example.com' + url)
"""
import base64
import hmac
import hashlib

try:  # py3
    from urllib.parse import unquote, urlencode, parse_qs
except ImportError:
    from urllib import unquote, urlencode

from .exceptions import DiscourseError

def sso_validate(payload, signature, secret):
    """
        payload: provided by Discourse HTTP call to your SSO endpoint as sso GET param
        signature: provided by Discourse HTTP call to your SSO endpoint as sig GET param
        secret: the secret key you entered into Discourse sso secret

        return value: The nonce used by discourse to validate the redirect URL
    """
    if None in [payload, signature]:
        raise DiscourseError('No SSO payload or signature.')

    if not secret:
        raise DiscourseError('Invalid secret..')

    payload = unquote(payload)
    if not payload:
        raise DiscourseError('Invalid payload..')

    decoded = base64.decodestring(payload.encode()).decode()
    if 'nonce' not in decoded:
        raise DiscourseError('Invalid payload..')

    h = hmac.new(secret.encode(), payload.encode(), digestmod=hashlib.sha256)
    this_signature = h.hexdigest()

    if this_signature != signature:
        raise DiscourseError('Payload does not match signature.')

    nonce = parse_qs(decoded)['nonce'][0]

    return nonce

def sso_redirect_url(nonce, secret, email, external_id, username, name, avatar_url, is_admin , **kwargs):
    """
        nonce: returned by sso_validate()
        secret: the secret key you entered into Discourse sso secret
        user_email: email address of the user who logged in
        user_id: the internal id of the logged in user
        user_username: username of the logged in user

        return value: URL to redirect users back to discourse, now logged in as user_username
    """
    kwargs.update({
        'nonce': nonce,
        'email': email,
        'external_id': external_id,
        'username': username,
        'name' : name,
        'avatar_url' : avatar_url,
        'avatar_force_update' : 'true',
        'admin':is_admin
    })

    uencode = urlencode(kwargs)
    return_payload = base64.encodestring(uencode.encode())
    h = hmac.new(secret.encode(), return_payload, digestmod=hashlib.sha256)
    query_string = urlencode({'sso': return_payload, 'sig': h.hexdigest()})

    return '/session/sso_login?%s' % query_string


text:
	XX(-12400, UNKNOWN, "unknown error") \
	XX(-12401, BLOCKED, "blocked") \
	XX(-12402, NOTFOUND, "not found") \
	XX(-12403, CONNREFUSED, "connection refused") \
	XX(-12404, REDIRECT, "too many redirects") \
	XX(-12405, TRUNCATED, "truncated response") \
	XX(-12406, TIMEDOUT, "connection timed out") \
	\
	XX(-12501, CERT_HAS_EXPIRED, "certificate expired") \
	XX(-12502, UNABLE_TO_VERIFY_LEAF_SIGNATURE, "unable to verify leaf signature") \
	XX(-12503, UNABLE_TO_GET_ISSUER_CERT, "unable to get issuer cert") \
	XX(-12504, UNABLE_TO_GET_CRL, "unable to get certificate revocation list") \
	XX(-12505, UNABLE_TO_DECRYPT_CERT_SIGNATURE, "unable to decrypt certificate signature") \
	XX(-12506, UNABLE_TO_DECRYPT_CRL_SIGNATURE, "unable to decrypt CRL signature") \
	XX(-12507, UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY, "unable to decode issuer public key") \
	XX(-12508, CERT_SIGNATURE_FAILURE, "certificate signature failure") \
	XX(-12509, CRL_SIGNATURE_FAILURE, "CRL signature failure") \
	XX(-12510, CERT_NOT_YET_VALID, "certificate not yet valid") \
	XX(-12511, CRL_NOT_YET_VALID, "CRL not yet valid") \
	XX(-12512, CRL_HAS_EXPIRED, "CRL expired") \
	XX(-12513, ERROR_IN_CERT_NOT_BEFORE_FIELD, "error in certificate not before field") \
	XX(-12514, ERROR_IN_CERT_NOT_AFTER_FIELD, "error in certificate not after field") \
	XX(-12515, ERROR_IN_CRL_LAST_UPDATE_FIELD, "error in CRL last update field") \
	XX(-12516, ERROR_IN_CRL_NEXT_UPDATE_FIELD, "error in CRL next update field") \
	XX(-12517, OUT_OF_MEM, "out of memory") \
	XX(-12518, DEPTH_ZERO_SELF_SIGNED_CERT, "depth zero self-signed certificate") \
	XX(-12519, SELF_SIGNED_CERT_IN_CHAIN, "self-signed certificate in chain") \
	XX(-12520, UNABLE_TO_GET_ISSUER_CERT_LOCALLY, "unable to get issuer certificate locally") \
	XX(-12521, CERT_CHAIN_TOO_LONG, "certificate chain too long") \
	XX(-12522, CERT_REVOKED, "certificate revoked") \
	XX(-12523, INVALID_CA, "invalid certificate authority") \
	XX(-12524, PATH_LENGTH_EXCEEDED, "path length exceeded") \
	XX(-12525, INVALID_PURPOSE, "invalid purpose") \
	XX(-12526, CERT_UNTRUSTED, "certificate untrusted") \
	XX(-12527, CERT_REJECTED, "certificate rejected")

enum {
#define XX(val, name, str) HX_ERR_##name = (val),
	HX_ERRORS(XX)
#undef XX
};

static char const *hx_strerror(int const rc) {
	if(rc >= 0) return "No error";
	switch(rc) {
#define XX(val, name, str) case HX_ERR_##name: return (str);
	HX_ERRORS(XX)
#undef XX
	}
	char const *x = hash_strerror(rc);
	if(x) return x;
	x = kvs_strerror(rc);
	if(x) return x;
	return uv_strerror(rc);
}
static int hx_httperr(int const rc) {
	if(rc >= 0) return 0; // Not expected
	switch(rc) {
	case HASH_EPANIC: return 500;
	case HASH_EPARSE: return 400;
	case HASH_ENOTSUP: return 500;
	case URL_EPARSE: return 400;
	}
	return HTTPError(rc);
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.11.22 at 01:45:09 PM EST
//

package eu.datex2.schema._2_0rc1._2_0;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for PointDestination complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="PointDestination">
 *   <complexContent>
 *     <extension base="{http://datex2.eu/schema/2_0RC1/2_0}Destination">
 *       <sequence>
 *         <element name="point" type="{http://datex2.eu/schema/2_0RC1/2_0}Point"/>
 *         <element name="pointDestinationExtension" type="{http://datex2.eu/schema/2_0RC1/2_0}ExtensionType" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PointDestination", propOrder = {
    "point",
    "pointDestinationExtension"
})
public class PointDestination
    extends Destination
{

    @XmlElement(required = true)
    protected Point point;
    protected ExtensionType pointDestinationExtension;

    /**
     * Gets the value of the point property.
     *
     * @return
     *     possible object is
     *     {@link Point }
     *
     */
    public Point getPoint() {
        return point;
    }

    /**
     * Sets the value of the point property.
     *
     * @param value
     *     allowed object is
     *     {@link Point }
     *
     */
    public void setPoint(Point value) {
        this.point = value;
    }

    /**
     * Gets the value of the pointDestinationExtension property.
     *
     * @return
     *     possible object is
     *     {@link ExtensionType }
     *
     */
    public ExtensionType getPointDestinationExtension() {
        return pointDestinationExtension;
    }

    /**
     * Sets the value of the pointDestinationExtension property.
     *
     * @param value
     *     allowed object is
     *     {@link ExtensionType }
     *
     */
    public void setPointDestinationExtension(ExtensionType value) {
        this.pointDestinationExtension = value;
    }

}


text:
Supply telegram bot - registers supply 'requests'

### How to use:
- create `token` file with bot token (can be obtained from 'Bot father')
- optional - create `admins` file, with admins usernames (each one on different line)
- to use local app exemplar
    - call `./launch.sh`
- to use docker container
    - call `./create_docker_image.sh` to create image using `Dockerfile`,
    and tag it with `katsupplybot`
    - call `./run_docker_container.sh` to create and run docker container named `KatSupplyBot`
        - within that script db file `KatSupplyBot.db` is mapped to host filesystem (in current directory)
            so that the results of the work are accessible outside the container
    - p.s.
        - if `KatSupplyBot` container exists, it can be started again by calling `./start_docker_container.sh`
        - you can watch logs by calling `docker logs KatSupplyBot`

### Current commands:
#### For all users:
- `/add` - Add supply request, for instance "/add купить лимон"
- `/list` - Show all current requests
- `/close` - Close request

#### Admins only:
- `/shutdown` - Shutdown bot instance


text:
package com.amazonaws.services.datapipeline.model;

import java.io.Serializable;

/**
 *

 * Contains the output of PollForTask.
 *

 */
public class PollForTaskResult implements Serializable, Cloneable {

    /**
     *

     * The information needed to complete the task that is being assigned to the
     * task runner. One of the fields returned in this object is
     * taskId, which contains an identifier for the task being
     * assigned. The calling task runner uses taskId in subsequent
     * calls to ReportTaskProgress and SetTaskStatus.
     *

     */
    private TaskObject taskObject;

    /**
     *

     * The information needed to complete the task that is being assigned to the
     * task runner. One of the fields returned in this object is
     * taskId, which contains an identifier for the task being
     * assigned. The calling task runner uses taskId in subsequent
     * calls to ReportTaskProgress and SetTaskStatus.
     *

     *
     * @param taskObject
     *        The information needed to complete the task that is being assigned
     *        to the task runner. One of the fields returned in this object is
     *        taskId, which contains an identifier for the task
     *        being assigned. The calling task runner uses taskId
     *        in subsequent calls to ReportTaskProgress and
     *        SetTaskStatus.
     */
    public void setTaskObject(TaskObject taskObject) {
        this.taskObject = taskObject;
    }

    /**
     *

     * The information needed to complete the task that is being assigned to the
     * task runner. One of the fields returned in this object is
     * taskId, which contains an identifier for the task being
     * assigned. The calling task runner uses taskId in subsequent
     * calls to ReportTaskProgress and SetTaskStatus.
     *

     *
     * @return The information needed to complete the task that is being
     *         assigned to the task runner. One of the fields returned in this
     *         object is taskId, which contains an identifier for
     *         the task being assigned. The calling task runner uses
     *         taskId in subsequent calls to
     *         ReportTaskProgress and SetTaskStatus.
     */
    public TaskObject getTaskObject() {
        return this.taskObject;
    }

    /**
     *

     * The information needed to complete the task that is being assigned to the
     * task runner. One of the fields returned in this object is
     * taskId, which contains an identifier for the task being
     * assigned. The calling task runner uses taskId in subsequent
     * calls to ReportTaskProgress and SetTaskStatus.
     *

     *
     * @param taskObject
     *        The information needed to complete the task that is being assigned
     *        to the task runner. One of the fields returned in this object is
     *        taskId, which contains an identifier for the task
     *        being assigned. The calling task runner uses taskId
     *        in subsequent calls to ReportTaskProgress and
     *        SetTaskStatus.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public PollForTaskResult withTaskObject(TaskObject taskObject) {
        setTaskObject(taskObject);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTaskObject() != null)
            sb.append("TaskObject: " + getTaskObject());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof PollForTaskResult == false)
            return false;
        PollForTaskResult other = (PollForTaskResult) obj;
        if (other.getTaskObject() == null ^ this.getTaskObject() == null)
            return false;
        if (other.getTaskObject() != null
                && other.getTaskObject().equals(this.getTaskObject()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode
                + ((getTaskObject() == null) ? 0 : getTaskObject().hashCode());
        return hashCode;
    }

    @Override
    public PollForTaskResult clone() {
        try {
            return (PollForTaskResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                            + "even though we're Cloneable!", e);
        }
    }
}


text:
<!doctype html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>Can somebody please #BoneTone?</title>

    <link rel="stylesheet" href="stylesheets/flipclock.css">
    <link rel="stylesheet" href="stylesheets/styles.css">
    <link rel="stylesheet" href="stylesheets/github-light.css">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

Will Tony Abbott outlast Kevin07 or Juliar?

 Tony Abbott ran the most negative campaign Australia had ever seen
        against Kevin Rudd and then Julia Gillard. Tony's negativity and
        belligerence led to the downfall of Kevin07 and the compromises made by
        the Gillard minority government. Abbott has opposed nearly every reform
        proposed by Labor and his own policies are a mixture of crony
        capitalism, ideological vengance and the just plain ridiculous. Because
        of this to the he now finds himself in a policy straitjacket unable to
        make any forward progress. Australia is in limbo waiting for some
        'adults' to take charge.

 Actually fixing all of Australia's problems seems like a bit too much to
        ask, but maybe in the meantime we can get some poetic justice?
        Maybe Tony Abbott will fail to outlast either of the Labor leaders whom he
        relentlessly attacked for being incompetent and breaking promises?

Kevin Rudd was PM (the first time) from the 3rd of September 2007 to the 24th
        of June 2010 or 934 days.

        Julia Gillard was PM from 24th of June 2010 to the 27th of June 2013 or 1099
        days.

        There are

until Tony outlasts Kevin.

        and

until Tony outlasts Julia.

        Short of an early election, there is only one realistic way to depose
        him: A leadership challenge!

So Malcom,
        Julie and
        Joe...
        now is your
        time

Malcom, Julie and Joe* Australia needs you!

        What is the internet saying about Tony?

        #tonyabbott Tweets

        * Please God not Scott Morrison. Think of the children! (no really)

Hosted on GitHub Pages.
        Theme by orderedlist.
        Clocks from FlipClock.js.


text:
<?php

class User extends Eloquent
{

  public static $timestamps = true;
  public static $per_page = 5;

  public function posts()
  {
    return $this->has_many('Post');
  }

  // Perhaps make this a role model later
  // constants for now

  const PLAIN_USER = 1;
  const EDITOR     = 2;
  const ADMIN      = 4;

  public static $roles = array(
    self::PLAIN_USER => 'Plain User',
    self::EDITOR     => 'Editor',
    self::ADMIN      => 'Administrator'
  );

  private $errors = array();

  public function errors()
  {
    return $this->errors;
  }

  public function save()
  {
    parent::save();
  }

  public function is_valid_new_user()
  {
    $validator = Validator::make($this->attritbutes, array(
      'username' => array('required', 'alpha_num', 'unique:users'),
      'email'    => array('required', 'email', 'unique:users'),
      'password' => array('required', 'confirmed'),
    ));
    if ($validator->valid())
    {
      $this->errors = array();
      $this->password = Hash::make($this->password);
      unset($this->attributes['password_confirmation']);
      return true;
    }
    else
    {
      $this->errors = $validator->errors->all();
      return false;
    }
  }

  public function is_valid()
  {
    $validator = Validator::make($this->dirty, array(
      'username' => array('alpha_num', 'unique:users'),
      'email'    => array('email', 'unique:users'),
      'roles'    => array('required'),
    ));

    if ($validator->valid())
    {
      $this->errors = array();
      return true;
    }
    else
    {
      $this->errors = $validator->errors->all();
      return false;
    }
  }

  public function has_role($role)
  {
    return ($this->roles & $role) === $role;
  }

  public function is_editor()
  {
    return $this->has_role(self::EDITOR);
  }

  public function is_admin()
  {
    return $this->has_role(self::ADMIN);
  }

}


text:
#ifdef FLAC_MUSIC

#include "SDL_loadso.h"

#include "dynamic_flac.h"

flac_loader flac = {
	0, NULL
};

#ifdef FLAC_DYNAMIC
int Mix_InitFLAC()
{
	if ( flac.loaded == 0 ) {
		flac.handle = SDL_LoadObject(FLAC_DYNAMIC);
		if ( flac.handle == NULL ) {
			return -1;
		}
		flac.FLAC__stream_decoder_new =
			(FLAC__StreamDecoder *(*)())
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_new");
		if ( flac.FLAC__stream_decoder_new == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_delete =
			(void (*)(FLAC__StreamDecoder *))
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_delete");
		if ( flac.FLAC__stream_decoder_delete == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_init_stream =
			(FLAC__StreamDecoderInitStatus (*)(
						FLAC__StreamDecoder *,
						FLAC__StreamDecoderReadCallback,
						FLAC__StreamDecoderSeekCallback,
						FLAC__StreamDecoderTellCallback,
						FLAC__StreamDecoderLengthCallback,
						FLAC__StreamDecoderEofCallback,
						FLAC__StreamDecoderWriteCallback,
						FLAC__StreamDecoderMetadataCallback,
						FLAC__StreamDecoderErrorCallback,
						void *))
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_init_stream");
		if ( flac.FLAC__stream_decoder_init_stream == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_finish =
			(FLAC__bool (*)(FLAC__StreamDecoder *))
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_finish");
		if ( flac.FLAC__stream_decoder_finish == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_flush =
			(FLAC__bool (*)(FLAC__StreamDecoder *))
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_flush");
		if ( flac.FLAC__stream_decoder_flush == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_process_single =
			(FLAC__bool (*)(FLAC__StreamDecoder *))
			SDL_LoadFunction(flac.handle,
						"FLAC__stream_decoder_process_single");
		if ( flac.FLAC__stream_decoder_process_single == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_process_until_end_of_metadata =
			(FLAC__bool (*)(FLAC__StreamDecoder *))
			SDL_LoadFunction(flac.handle,
						"FLAC__stream_decoder_process_until_end_of_metadata");
		if ( flac.FLAC__stream_decoder_process_until_end_of_metadata == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_process_until_end_of_stream =
			(FLAC__bool (*)(FLAC__StreamDecoder *))
			SDL_LoadFunction(flac.handle,
						"FLAC__stream_decoder_process_until_end_of_stream");
		if ( flac.FLAC__stream_decoder_process_until_end_of_stream == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_seek_absolute =
			(FLAC__bool (*)(FLAC__StreamDecoder *, FLAC__uint64))
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_seek_absolute");
		if ( flac.FLAC__stream_decoder_seek_absolute == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
		flac.FLAC__stream_decoder_get_state =
			(FLAC__StreamDecoderState (*)(const FLAC__StreamDecoder *decoder))
			SDL_LoadFunction(flac.handle, "FLAC__stream_decoder_get_state");
		if ( flac.FLAC__stream_decoder_get_state == NULL ) {
			SDL_UnloadObject(flac.handle);
			return -1;
		}
	}
	++flac.loaded;

	return 0;
}
void Mix_QuitFLAC()
{
	if ( flac.loaded == 0 ) {
		return;
	}
	if ( flac.loaded == 1 ) {
		SDL_UnloadObject(flac.handle);
	}
	--flac.loaded;
}
#else
int Mix_InitFLAC()
{
	if ( flac.loaded == 0 ) {
		flac.FLAC__stream_decoder_new = FLAC__stream_decoder_new;
		flac.FLAC__stream_decoder_delete = FLAC__stream_decoder_delete;
		flac.FLAC__stream_decoder_init_stream =
							FLAC__stream_decoder_init_stream;
		flac.FLAC__stream_decoder_finish = FLAC__stream_decoder_finish;
		flac.FLAC__stream_decoder_flush = FLAC__stream_decoder_flush;
		flac.FLAC__stream_decoder_process_single =
							FLAC__stream_decoder_process_single;
		flac.FLAC__stream_decoder_process_until_end_of_metadata =
							FLAC__stream_decoder_process_until_end_of_metadata;
		flac.FLAC__stream_decoder_process_until_end_of_stream =
							FLAC__stream_decoder_process_until_end_of_stream;
		flac.FLAC__stream_decoder_seek_absolute =
							FLAC__stream_decoder_seek_absolute;
		flac.FLAC__stream_decoder_get_state =
							FLAC__stream_decoder_get_state;
	}
	++flac.loaded;

	return 0;
}
void Mix_QuitFLAC()
{
	if ( flac.loaded == 0 ) {
		return;
	}
	if ( flac.loaded == 1 ) {
	}
	--flac.loaded;
}
#endif /* FLAC_DYNAMIC */

#endif /* FLAC_MUSIC */


text:
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace GooglePlayGames.Native.Cwrapper {
internal static class Status {
    internal enum ResponseStatus {
        VALID = 1,
        VALID_BUT_STALE = 2,
        ERROR_LICENSE_CHECK_FAILED = -1,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_VERSION_UPDATE_REQUIRED = -4,
        ERROR_TIMEOUT = -5,
    }

    internal enum FlushStatus {
        FLUSHED = 4,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_VERSION_UPDATE_REQUIRED = -4,
        ERROR_TIMEOUT = -5,
    }

    internal enum AuthStatus {
        VALID = 1,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_VERSION_UPDATE_REQUIRED = -4,
        ERROR_TIMEOUT = -5,
    }

    internal enum UIStatus {
        VALID = 1,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_VERSION_UPDATE_REQUIRED = -4,
        ERROR_TIMEOUT = -5,
        ERROR_CANCELED = -6,
        ERROR_UI_BUSY = -12,
        ERROR_LEFT_ROOM = -18,
    }

    internal enum MultiplayerStatus {
        VALID = 1,
        VALID_BUT_STALE = 2,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_VERSION_UPDATE_REQUIRED = -4,
        ERROR_TIMEOUT = -5,
        ERROR_MATCH_ALREADY_REMATCHED = -7,
        ERROR_INACTIVE_MATCH = -8,
        ERROR_INVALID_RESULTS = -9,
        ERROR_INVALID_MATCH = -10,
        ERROR_MATCH_OUT_OF_DATE = -11,
        ERROR_REAL_TIME_ROOM_NOT_JOINED = -17,
    }

    internal enum QuestAcceptStatus {
        VALID = 1,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_TIMEOUT = -5,
        ERROR_QUEST_NO_LONGER_AVAILABLE = -13,
        ERROR_QUEST_NOT_STARTED = -14,
    }

    internal enum QuestClaimMilestoneStatus {
        VALID = 1,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_TIMEOUT = -5,
        ERROR_MILESTONE_ALREADY_CLAIMED = -15,
        ERROR_MILESTONE_CLAIM_FAILED = -16,
    }

    internal enum CommonErrorStatus {
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_TIMEOUT = -5,
    }

    internal enum SnapshotOpenStatus {
        VALID = 1,
        VALID_WITH_CONFLICT = 3,
        ERROR_INTERNAL = -2,
        ERROR_NOT_AUTHORIZED = -3,
        ERROR_TIMEOUT = -5,
    }
}
}
#endif // (UNITY_ANDROID || UNITY_IPHONE)


text:
import pytest

from busypie import wait, ConditionTimeoutError, MILLISECOND, ONE_SECOND

def test_should_ignore_all_exceptions():
    with pytest.raises(ConditionTimeoutError):
        wait().ignore_exceptions().at_most(300, MILLISECOND).until(raise_zero_division_error)

def test_fail_on_exception_if_not_ignored():
    with pytest.raises(ZeroDivisionError):
        wait().at_most(ONE_SECOND).until(raise_zero_division_error)

def test_fail_on_exception_if_not_specified():
    with pytest.raises(ZeroDivisionError):
        wait().ignore_exceptions(AttributeError).at_most(ONE_SECOND).until(raise_zero_division_error)
    with pytest.raises(ConditionTimeoutError):
        wait(). \
            ignore_exceptions(AttributeError, ZeroDivisionError). \
            at_most(200, MILLISECOND). \
            until(raise_zero_division_error)

def test_retrieve_cause_on_timeout():
    with pytest.raises(ConditionTimeoutError) as e:
        wait().ignore_exceptions().at_most(100, MILLISECOND).until(raise_zero_division_error)

    assert isinstance(e.value.__cause__, ZeroDivisionError)

def raise_zero_division_error():
    raise ZeroDivisionError()


text:
Introduction
============

This is Banana -  the web frontend for a database populated by `the TRAnsients
Pipeline (TRAP) <http://docs.transientskp.org/>`_.

Technically it is a `Django project <https://www.djangoproject.com/>`_.


text:
<?php

/**
 * Class for playing dice 100
 *
 */
class CPlayDice100 {

    /**
     * Private properties
     *
     */
    private $diceplay;
    private $hand;
    private $last;
    private $p;
    private $throwOrSaveMess;
    private $oneOrWinMess;
    private $player;
    private $players;
    private $defaultHumans;
    private $defaultRobots;
    private $throwSeries;
    private $diceround;
    private $nextplayer;
    private $gameover;

    /**
     * Constructor
     *
     */
    public function __construct() {
        $this->players = array();
        $this->defaultHumans = 1;
        $this->defaultRobots = 1;
        $this->diceround = 1;
        $this->last = 0;
        $this->throwSeries = array();
        $this->nextplayer = FALSE;
        $this->gameover = FALSE;
    }

    /**
     * Start or play game
     *
     * @return html page showing setup page or game board
     */
    public function PlayDice100() {
        // Initial setup - setup players or create player objects after setup
        if (!isset($_GET['setup']) && !$this->players) {
            $this->diceplay = $this->SetupPlayers();
            return $this->diceplay;
        } else if (!$this->players) {
            if (is_numeric($_GET['noOfPlayers']) && is_numeric($_GET['noOfRobots'])) {
                $counter = htmlentities($_GET['noOfPlayers']);
                for ($pl = 0; $pl < $_GET['noOfPlayers']; $pl++) {
                    $this->players[] = new CDicePlayer($pl + 1, 0);
                }
                for ($pl = 0; $pl < $_GET['noOfRobots']; $pl++) {
                    $this->players[] = new CDicePlayer($counter + 1, 1);
                    $counter++;
                }
            }
        }

        // Detect button press
        if (isset($_GET['p'])) {
            $this->p = $_GET['p'];
        }

        // Create new CDiceHand object if new game or next player
        if ($this->hand) {
            $this->player = $this->players[$this->diceround - 1];
        } else {
            $this->hand = new CDiceHand(1);
            $this->player = $this->players[$this->diceround - 1];
        }

        $this->RunGame();
        return $this->diceplay;
    }

    /**
     * Run Game
     *
     */
    private function RunGame() {
        // Detect button press and choose appropriate action
        switch ($this->p) {
            case 'Kasta':
                if ($this->last != 1 && !$this->gameover) { // To prevent manual reload cheat
                    $this->ThrowDice();
                }
                break;
            case 'Spara':
                if ($this->last != 1) { // To prevent manual reload cheat
                    $this->SaveRound();
                }
                break;
            case 'Fortsätt':
            if ($this->last != 0 && !$this->gameover) {
                    $this->GotoNextPlayer();
                }
                break;
            case 'Börja om':
                $this->RestartGame();
                break;
            default:
                $this->ShowGameboard();
                break;
        }
    }

    /**
     * Throw dice
     *
     */
    private function ThrowDice() {
        $this->p = null; // Reset to keep state when switching pages
        $this->hand->Roll();
        $this->last = $this->hand->GetSumThrow(); // Set to keep state when switching pages
        if ($this->hand->GetSumThrow() == 1) {
            $this->hand->ResetTotal();
            $this->nextplayer = TRUE;
            $this->oneOrWinMess = '
Spelare ' . $this->player->GetPlayerID() . ' slog en etta och förlorar ackumulerade poäng.
';
        } else {
            $this->hand->SaveTotal();
            $this->nextplayer = FALSE;
        }
        if ($this->player->GetPlayerScore() + $this->hand->GetTotal() >= 100) {
            $this->oneOrWinMess = '
Spelare ' . $this->player->GetPlayerID() . ' har nått 100 poäng och vinner!
';
            $this->gameover = TRUE;
        }
        $this->ShowGameboard();
    }

    /**
     * Save round
     *
     */
    private function SaveRound() {
        $this->player->SetPlayerScore($this->hand->GetTotal() + $this->player->GetPlayerScore());
        $this->throwOrSaveMess = '
Spelare ' . $this->player->GetPlayerID() . ' sparade.
';
        $this->nextplayer = TRUE;
        $this->hand->ResetTotal();
        $this->ShowGameboard();
    }

    /**
     * Go to next player
     *
     */
    private function GotoNextPlayer() {
    	$this->nextplayer = FALSE;
        $this->hand->ResetTotal();
        $this->throwSeries = null;
        $this->p = null; // Reset to keep state when switching pages
        $this->oneOrWinMess = null; // Reset to keep state when switching pages
        $this->last = 0; // Reset to keep state when switching pages
        if ($this->diceround < count($this->players)) {
            $this->diceround++;
        } else {
            $this->diceround = 1;
        }
        $this->player = $this->players[$this->diceround - 1];

        if ($this->player->IsRobot()) {
            $this->PlayRobotGame();
        }
        $this->ShowGameboard();
    }

    /**
     * Restart game - unsets game in $_SESSION variable and reloads page
     *
     */
    private function RestartGame() {
        unset($_SESSION['diceplay']);
        $this->ReloadPage();
    }

    /**
     * Computer plays a round
     *
     */
    private function PlayRobotGame() {
    	// Go for at least 10 points
        while ($this->hand->GetTotal() <= 10 && $this->last != 1 && ($this->hand->GetTotal() + $this->player->GetPlayerScore()) < 100) {
            $this->ThrowDice();
            $this->throwSeries[] = $this->last;
        }

        // With 10 points, decide after each throw whether to stop or throw again
        while (rand(1,2) != 2 && $this->last != 1 && !$this->gameover) {
        	$this->ThrowDice();
        	$this->throwSeries[] = $this->last;
        }
        // Save and reload page
        if ($this->last != 1 && !$this->gameover) {
            $this->SaveRound();
            $this->p = 'Spara';
            $this->ReloadPage();
        }
    }

    /**
     * Print the results
     *
     * @return $html as chunk of html to show current result
     */
    private function PrintResult() {
        $html = $this->hand->GetRollsAsImageList();
        $html .= '
Senaste kastet: ' . $this->last . '
';
        $html .= '
Den ackumulerade poängen är ' . $this->hand->GetTotal() . '
';
        $res = $this->player->GetPlayerScore() + $this->hand->GetTotal();
        if ($res < 100) {
            $html .= '
Spara nu för att säkra ' . $res . ' poäng
';
        } else {
            $html .= '
Total poäng blev ' . $res . '
';
        }
        if ($this->throwSeries) {
        	$html .= '
Datorspelarens kastserie: ';
        	foreach ($this->throwSeries as $value) {
        		$html .= $value . ' ';
        	}
        	$html .= '
';
        }
        return $html;
    }

    /**
     * Show leaderboard
     *
     * @return $html as chunk of html to show the current standing
     */
    private function ShowLeaderboard() {
        $html = <<<EOD

        <form method="get" action="?"><fieldset style="height:300px;"><legend>Resultattavla</legend>
EOD;
        if ($this->oneOrWinMess) {
            $html .= $this->oneOrWinMess;
        } else if ($this->throwOrSaveMess) {
            $html .= $this->throwOrSaveMess;
        } else {
            $html .= '
Spelare ' . $this->diceround . ' kastar.
';
        }
        foreach ($this->players as $value) {
            $html .= '
Spelare ' . $value->GetPlayerID() . ': ' . $value->GetPlayerScore() . ' poäng
';
        }
        $html .= '<input type="submit" name="p" value="Börja om"></fieldset></form>';
        $this->throwOrSaveMess = null; // Reset to keep state when switching pages
        return $html;
    }

    /**
     * Show board
     *
     */
    private function ShowGameboard() {
        $this->diceplay = $this->ShowLeaderboard();
        $this->diceplay .= <<<EOD

<form method="get" action="?">
        <fieldset style="height:300px;"><legend>Spelare
EOD;
        $this->diceplay .= $this->player->GetPlayerID() . '</legend>';

        if (!$this->nextplayer && !$this->gameover) {
            $this->diceplay .= '
<input type="submit" name="p" value="Kasta">';
        } else {
            $this->diceplay .= '
<input type="submit" name="p" value="Kasta" disabled>';
        }

        if ($this->p == 'Spara' || $this->hand->GetSumThrow() <= 1 || $this->gameover) {
            $this->diceplay .= '<input type="submit" name="p" value="Spara" disabled>';
        } else {
            $this->diceplay .= '<input type="submit" name="p" value="Spara" >';
        }

        if ($this->nextplayer && !$this->gameover) {
            $this->diceplay .= '<input type="submit" name="p" value="Fortsätt"/>';
        }
        $this->diceplay .= '
' . $this->PrintResult();

        $this->diceplay .= '</fieldset></form>
';
    }

    /**
     * Setup players
     *
     * @return $html as chunk of html to show a form for setting no of players
     */
    private function SetupPlayers() {

        $humans = array(1 => "1", 2 => "2");
        $robots = array(0 => "0", 1 => "1", 2 => "2");

        $html = <<<EOD

    	<form method="get"><fieldset><legend>Ange antal spelare</legend>

Människa:
<select id="input1" name="noOfPlayers">
EOD;

        foreach ($humans as $key => $value) {
            if ($key == $this->defaultHumans) {
                $html .= '<option selected="selected" value="' . $key . '">' . $value . '</option>';
            } else {
                $html .= '<option value="' . $key . '">' . $value . '</option>';
            }
        }

        $html .= <<<EOD
		</select>

Dator:
<select id="input2" name="noOfRobots">
EOD;

        foreach ($robots as $key => $value) {
            if ($key == $this->defaultRobots) {
                $html .= '<option selected="selected" value="' . $key . '">' . $value . '</option>';
            } else {
                $html .= '<option value="' . $key . '">' . $value . '</option>';
            }
        }

        $html .= <<<EOD
        </select>

<input type="hidden" name="setup">
        <button onclick="form.submit();">Fortsätt</button>

        </fieldset></form>

EOD;
        return $html;
    }

    /**
    * Reload page
    *
    */
	private function ReloadPage() {
		$host = $_SERVER['HTTP_HOST'];
        $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
        $extra = 'diceplay.php?p='. $this->p;
        header("Location: http://$host$uri/$extra");
        exit;
	}
}


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

  <name>Crypto</name>

  <artifactId>underbar.crypto</artifactId>
  <version>0.1.3-SNAPSHOT</version>

  <parent>
    <groupId>com.tailoredshapes</groupId>
    <artifactId>underbar</artifactId>
    <version>0.1.3-SNAPSHOT</version>
  </parent>

  <description>Convenience Methods for javax.security</description>

  <dependencies>
    <dependency>
      <groupId>com.tailoredshapes</groupId>
      <artifactId>underbar.ocho</artifactId>
    </dependency>
    <dependency>
      <groupId>com.tailoredshapes</groupId>
      <artifactId>underbar.io</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>


text:
module Smartguard
  module Logging extend Smartkiosk::Common::Logging
    self.service = 'Smartguard'
  end
end


text:
/* global collapsible */
( function() {

	_.each( collapsible, function( label, setting ) {

		setTimeout( function() {
			var control = jQuery( '#customize-control-' + setting ),
			    controlTitleElement;

			// Collapse field.
			control.addClass( 'kirki-collapsible kirki-collapsed-control' );

			// Add the header before the field.
			control.before( '
 ' + label + '
' );

			// Add an (x) before the field title.
			controlTitleElement = control.find( '.customize-control-title' );
			controlTitleElement.prepend( '' );

			// Show/hide the field when the header is clicked.
			jQuery( '.kirki-collapsible-header-' + setting ).click( function() {
				if ( control.hasClass( 'kirki-collapsed-control' ) ) {
					control.removeClass( 'kirki-collapsed-control' );
					control.addClass( 'kirki-expanded-control' );
					control.show();
					jQuery( '.kirki-collapsible-header-' + setting ).hide();
				} else {
					control.addClass( 'kirki-collapsed-control' );
					control.removeClass( 'kirki-expanded-control' );
					control.hide();
					jQuery( '.kirki-collapsible-header-' + setting ).show();
				}
			});

			controlTitleElement.click( function() {
				if ( control.hasClass( 'kirki-collapsed-control' ) ) {
					control.removeClass( 'kirki-collapsed-control' );
					control.addClass( 'kirki-expanded-control' );
					control.show();
					jQuery( '.kirki-collapsible-header-' + setting ).hide();
				} else {
					control.addClass( 'kirki-collapsed-control' );
					control.removeClass( 'kirki-expanded-control' );
					control.hide();
					jQuery( '.kirki-collapsible-header-' + setting ).show();
				}
			});

		}, 300 );

	});

})( jQuery );


text:
[jvm]
Content
fun [Builder](-builder.md)(defaults: [ControlFlow](../index.md))
fun [Builder](-builder.md)()


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
	<head></head>

	<body bgcolor="white">
		Contains all classes regarding the chart.
	</body>
</html>


text:
[![Build Status](https://travis-ci.org/victorlin/Proj4Swift.svg?branch=master)](https://travis-ci.org/victorlin/Proj4Swift)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/victorlin/Proj4Swift)
[![GitHub license](https://img.shields.io/github/license/victorlin/Proj4Swift.svg)](https://github.com/victorlin/Proj4Swift/blob/master/LICENSE)

[Proj.4](https://trac.osgeo.org/proj/) wrapper in Swift 2 language

## Install with Carthage

To install with [Carthage](https://github.com/Carthage/Carthage), add Proj4Swift to your Cartfile:

```
github "fangpenlin/Proj4Swift"
```

## Usage

Just create `Projection`s with Proj.4 parameters, and create `Point3D`s for the input points, then call `Projection.transform` on the source `Projection` with the `Point3D`s and the destination `Projection`.

```Swift
let projWGS84 = try! Projection(parameters: "+proj=longlat +ellps=WGS84 +no_defs")
let projMerc = try! Projection(parameters: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs")

let points = [
    Point3D(
        x: Double(-122.389349) * Projection.degToRad,
        y: Double(37.778441) * Projection.degToRad,
        z: 0
    )
]
let resultPoints = try! projWGS84.transform(points, toProjection: projMerc)
print(resultPoints)
```

**Remember the lat and long you passed in should be in radian instead of degree**. To convert degree to radian, you can multiply `Projection.degToRad`.


text:
<!DOCTYPE html>

		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<meta charset="utf-8"/>
		<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
		<meta name="viewport" content="width=device-width, initial-scale=1" />

		<meta name="description" content=""/>
		<meta name="author" content="devbinnooh"/>
		<title>Nutrition Facts Calculator</title>

		<link href="./index_files/bootstrap.min.css" rel="stylesheet"/>

		<link href="./index_files/ie10-viewport-bug-workaround.css" rel="stylesheet"/>

		<link href="./index_files/style.css" rel="stylesheet"/>

					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
						Toggle navigation

					</button>Nutrition Facts Calculator

							Home

Nutrition Facts Calculator

Use the interactive tool below to easily calculate nutrition information

				<form action="#">

								Net Weight

									<input type="number" class="form-control" id="netWeight" placeholder="The Total Weight of Food" value="100">
										Grams

									Serving Size

										<input type="number" class="form-control" id="servingSize" placeholder="Serving Size" value="100">
											Grams

										Total Fat

											<input type="number" class="form-control" id="totalFat" placeholder="Total Fat (saturated ,unsaturated, trans)" value="1">
												Grams

											Total Carbohydrate

												<input type="number" class="form-control" id="totalCarbohydrate" placeholder="Total Carboydrate (Dietary Fiber and Sugar)" value="20">
													Grams

												Protein

													<input type="number" class="form-control" id="protein" placeholder="Protein" value="5">
														Grams

										<button type="submit" class="btn btn-default">Calculate</button>
									</form>

Nutrition Fact Calculated per Grams

														#
														Nutrition Name
														Fact Size Per Serving
														Fact Size Per Net Weight

														1
														Total Fat

														2
														Total Carbohydrate

														3
														Protein


text:
<?php

OCP\JSON::checkLoggedIn();
\OC::$server->getSession()->close();
$l = \OC::$server->getL10N('files');

// Load the files
$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : '';
$dir = \OC\Files\Filesystem::normalizePath($dir);

try {
	$dirInfo = \OC\Files\Filesystem::getFileInfo($dir);
	if (!$dirInfo || !$dirInfo->getType() === 'dir') {
		\http_response_code(404);
		exit();
	}

	$data = [];
	$baseUrl = OCP\Util::linkTo('files', 'index.php') . '?dir=';

	$permissions = $dirInfo->getPermissions();

	$sortAttribute = isset($_GET['sort']) ? (string)$_GET['sort'] : 'name';
	$sortDirection = isset($_GET['sortdirection']) ? ($_GET['sortdirection'] === 'desc') : false;
	$mimetypeFilters = isset($_GET['mimetypes']) ? \json_decode($_GET['mimetypes']) : '';

	$files = [];
	// Clean up duplicates from array
	if (\is_array($mimetypeFilters) && \count($mimetypeFilters)) {
		$mimetypeFilters = \array_unique($mimetypeFilters);

		if (!\in_array('httpd/unix-directory', $mimetypeFilters)) {
			// append folder filter to be able to browse folders
			$mimetypeFilters[] = 'httpd/unix-directory';
		}

		// create filelist with mimetype filter - as getFiles only supports on
		// mimetype filter at once we will filter this folder for each
		// mimetypeFilter
		foreach ($mimetypeFilters as $mimetypeFilter) {
			$files = \array_merge($files, \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection, $mimetypeFilter));
		}

		// sort the files accordingly
		$files = \OCA\Files\Helper::sortFiles($files, $sortAttribute, $sortDirection);
	} else {
		// create file list without mimetype filter
		$files = \OCA\Files\Helper::getFiles($dir, $sortAttribute, $sortDirection);
	}

	$data['directory'] = $dir;
	$data['files'] = \OCA\Files\Helper::formatFileInfos($files);
	$data['permissions'] = $permissions;

	OCP\JSON::success(['data' => $data]);
} catch (\OCP\Files\StorageNotAvailableException $e) {
	\OCP\Util::logException('files', $e);
	OCP\JSON::error([
		'data' => [
			'exception' => '\OCP\Files\StorageNotAvailableException',
			'message' => $l->t('Storage is temporarily not available')
		]
	]);
} catch (\OCP\Files\StorageInvalidException $e) {
	\OCP\Util::logException('files', $e);
	OCP\JSON::error([
		'data' => [
			'exception' => '\OCP\Files\StorageInvalidException',
			'message' => $l->t('Storage invalid')
		]
	]);
} catch (\Exception $e) {
	\OCP\Util::logException('files', $e);
	OCP\JSON::error([
		'data' => [
			'exception' => '\Exception',
			'message' => $l->t('Unknown error')
		]
	]);
}


text:
using System.Threading.Tasks;
using Nest;
using Tests.Framework;

namespace Tests.Cluster.TaskManagement.TasksList
{
	public class TasksListUrlTests : IUrlTests
	{
		[U] public async Task Urls()
		{
			await UrlTester.GET("/_tasks")
				.Fluent(c => c.ListTasks())
				.Request(c => c.ListTasks(new ListTasksRequest()))
				.FluentAsync(c => c.ListTasksAsync())
				.RequestAsync(c => c.ListTasksAsync(new ListTasksRequest()))
				;
		}
	}
}


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Sciencia Med. , Rio de Janeiro, 3, 734.

#### Original name
null

### Remarks
null


text:
dowsing
=======

Dowsing plan generator


text:
CREATE DATABASE  IF NOT EXISTS `llmm_main` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `llmm_main`;
-- MySQL dump 10.13  Distrib 5.6.17, for Win32 (x86)
--
-- Host: localhost    Database: llmm_main
-- ------------------------------------------------------
-- Server version	5.6.20

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `btformanswerset`
--

DROP TABLE IF EXISTS `btformanswerset`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `btformanswerset` (
  `asID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `questionSetId` int(10) unsigned DEFAULT '0',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `uID` int(10) unsigned DEFAULT '0',
  PRIMARY KEY (`asID`),
  KEY `questionSetId` (`questionSetId`),
  KEY `uID` (`uID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `btformanswerset`
--

LOCK TABLES `btformanswerset` WRITE;
/*!40000 ALTER TABLE `btformanswerset` DISABLE KEYS */;
/*!40000 ALTER TABLE `btformanswerset` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2016-09-27 17:02:55


text:
import { ObjectSchema } from "realm";
import LocationSchema from "./location-schema";
import NameSchema from "./name-schema";
import PictureSchema from "./picture-schema";

const UserSchema: ObjectSchema = {
    name: "User",
    primaryKey: "username",
    properties: {
        gender: "string",
        name: NameSchema.name,
        location: LocationSchema.name,
        email: "string",
        username: "string",
        password: "string",
        salt: "string",
        md5: "string",
        sha1: "string",
        sha256: "string",
        registered: "int",
        dob: "int",
        phone: "string",
        cell: "string",
        PPS: "string",
        picture: PictureSchema.name
    }
}

export default UserSchema;


text:
FOUNDATION_EXPORT double Pods_ZDPageNavigationController_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ZDPageNavigationController_ExampleVersionString[];