text:
package ru.job4j.chess.figures;

import ru.job4j.chess.Cell;
import ru.job4j.chess.Exceptions.ImpossibleMoveException;

import java.util.Arrays;

/**
 * Main class.
 *
 * @author Yury Chuksin (chuksin.yury@gmail.com)
 * @since 05.05.2017.
 */
public class Rook extends AbstractFigure {

    /**
     * Constructor of Rook.
     *
     * @param name     name of the figure
     * @param position position of the figure
     * @param isWhite  color of the figure
     */
    public Rook(String name, Cell position, boolean isWhite) {
        super(name, position, isWhite);
    }

    /**
     * Calculates path that figure must pass.
     *
     * @param dist destination point.
     * @return cells array
     */
    @Override
    public Cell[] way(Cell dist) {

        Cell origin = this.getFigurePosition(); // origin original position of figure.
        Cell[] result = new Cell[7];
        int count = 0;
        int deltaX = Math.abs(this.getFigurePosition().getX() - dist.getX());
        int deltaY = Math.abs(this.getFigurePosition().getY() - dist.getY());

        if (this.getFigurePosition().getX() == dist.getX()) {
            for (int i = 0; i < deltaY; i++) {
                if (this.getFigurePosition().getY() < dist.getY()) {
                    result[count++] = this.oneStepUp(this.getFigurePosition());
                    this.setFigurePosition(result[i]); // setting new position of figure
                } else {
                    result[count++] = this.oneStepDown(this.getFigurePosition());
                    this.setFigurePosition(result[i]);
                }
            }
        }
        if (this.getFigurePosition().getY() == dist.getY()) {
            for (int i = 0; i < deltaX; i++) {
                if (this.getFigurePosition().getX() < dist.getX()) {
                    result[count++] = this.oneStepRight(this.getFigurePosition());
                    this.setFigurePosition(result[i]);
                } else {
                    result[count++] = this.oneStepLeft(this.getFigurePosition());
                    this.setFigurePosition(result[i]);
                }
            }
        }
        this.setFigurePosition(origin); // get back original position to moving figure
        return Arrays.copyOf(result, count);
    }

    /**
     * Checking is the destination point correct.
     *
     * @param cell destination point
     * @return boolean
     * @throws ImpossibleMoveException wrong destination point
     */
    @Override
    public boolean isCorrectWay(Cell cell) throws ImpossibleMoveException {
        if ((this.getFigurePosition().getX() == cell.getX()
                || this.getFigurePosition().getY() == cell.getY())
                && (0 < cell.getX() && cell.getX() < 9) && (0 < cell.getY() && cell.getY() < 9)) {
            return true;
        } else {
            throw new ImpossibleMoveException("Destination cell can`t be touched.");
        }
    }
}


text:
require 'spec_helper'

class FooReport; include RubyReportable; end

describe RubyReportable::Report do

  before do
    @report = FooReport
    @report.clear
  end

  context "#_source" do
    before do
      @report.source do
        logic do
          Object.methods
        end
      end
    end

    it "should contruct a sandbox to build up source data" do
      sandbox = @report._source

      sandbox.source.should == Object.methods
    end
  end

  context "#_data" do
    before do
      @report.source do
        logic do
          Object.methods
        end
      end
    end

    it "should be able to filter on source data" do
      @report.filter('G Methods') do
        logic do
          source.select {|element| element.to_s.include?('g')}
        end
      end

      @report._data(@report._source).source.should == Object.methods.select {|method| method.to_s.include?('g')}
    end

    it "should use available input when filtering data" do
      @report.filter('Filter Methods') do
        key :letter

        logic do
          source.select {|element| element.to_s.include?(input)}
        end
      end

      source_sandbox = @report._source
      options = {:input => {:letter => 'g'}}
      @report._data(source_sandbox, options).source.should == Object.methods.select {|method| method.to_s.include?('g')}

      source_sandbox = @report._source
      options = {:input => {:letter => 'r'}}
      @report._data(source_sandbox, options).source.should == Object.methods.select {|method| method.to_s.include?('r')}
    end

    it "should handle multiple filters" do
      @report.filter('G Methods') do
        priority 0

        logic do
          source.select {|element| element.to_s.include?('g')}
        end
      end

      @report.filter('R Methods') do
        priority 1

        logic do
          source.select {|element| element.to_s.include?('r')}
        end
      end

      source_sandbox = @report._source

      @report._data(source_sandbox).source.should == Object.methods.select {|method| method.to_s.include?('g') && method.to_s.include?('r')}
    end

    it "should handle multiple filters in the right priority" do
      @report.source do
        logic do
          Object.methods
        end
      end

      @report.filter('G Methods') do
        priority 0

        logic do
          source.map(&:to_s).select {|element| element.include?('g')}
        end
      end

      @report.filter('R Methods') do
        priority 1

        logic do
          source.select {|element| element.include?('r')}.map(&:to_sym)
        end
      end

      source_sandbox = @report._source

      # G Methods has to run first because otherwise Object.methods
      # returns symbols and R Methods is trying to do a include? on a symbol
      @report._data(source_sandbox).source.should == Object.methods.select {|method| method.to_s.include?('g') && method.to_s.include?('r')}
    end
  end

  context "#_group" do
    it "should group results" do
      @report.source do
        logic do
          [:method]
        end
      end

      @report.output('name') do
        element
      end

      @report.output('letter') do
        element.to_s[0]
      end

      source_data = @report._data(@report._source).source

      @report._group('letter', @report._output(source_data)).should == {"m" => [{'name' => :method, 'letter' => 'm'}]}
    end

    it "should handle multiple groupings" do

      raw = []
      raw[0] = ['test1', 29201, 'road']
      raw[1] = ['test2', 29201, 'road']
      raw[2] = ['test3', 29201, 'drive']
      raw[3] = ['test4', 29204, 'road']

      output = []
      [0, 1, 2, 3].map do |index|
        output[index] = {
          'name' => raw[index][0],
          'zip' => raw[index][1],
          'path' => raw[index][2]
        }
      end

      result = {
        29201 => {
          'road' => [output[0], output[1]],
          'drive' => [output[2]]
        },
        29204 => {
          'road' => [output[3]]
        }
      }

      @report.source do
        logic do
          [
           raw[0],
           raw[1],
           raw[2],
           raw[3]
          ]
        end
      end

      @report.output('name') do
        element[0]
      end

      @report.output('zip') do
        element[1]
      end

      @report.output('path') do
        element[2]
      end

      source_data = @report._data(@report._source).source

      @report._group(['zip', 'path'], @report._output(source_data)).should == result
    end
  end

  context "#_sort" do
    it "should sort results" do
      @report.source do
        logic do
          [
           '!',
           '==',
           'const_missing',
           'try',
           'to_s',
           'zebra',
           'const_get',
           '_output'
          ]
        end
      end

      @report.output('name') do
        element
      end

      source_data = @report._data(@report._source).source
      final = @report._sort('name', @report._output(source_data))

      final.should == [
                       '!',
                       '==',
                       '_output',
                       'const_get',
                       'const_missing',
                       'to_s',
                       'try',
                       'zebra'
                      ].map {|e| {'name' => e}}
    end

    it "should handle multiple sorts" do
      @report.source do
        logic do
          [
           {'country' => 'USA',    'name' => 'Tinker'},
           {'country' => 'Sweden', 'name' => 'Charmander'},
           {'country' => 'USA',    'name' => 'Pikachu'},
           {'country' => 'Norway', 'name' => 'Slink'},
           {'country' => 'Sweden', 'name' => 'Katarina'},
           {'country' => nil,      'name' => 'Slyfox'}
          ]
        end
      end

      @report.output('country') do
        element['country']
      end

      @report.output('name') do
        element['name']
      end

      source_data = @report._data(@report._source).source
      final = @report._sort(['country', 'name'], @report._output(source_data))

      final.should == [
                       {'country' => nil,      'name' => 'Slyfox'},
                       {'country' => 'Norway', 'name' => 'Slink'},
                       {'country' => 'Sweden', 'name' => 'Charmander'},
                       {'country' => 'Sweden', 'name' => 'Katarina'},
                       {'country' => 'USA',    'name' => 'Pikachu'},
                       {'country' => 'USA',    'name' => 'Tinker'},
                      ]
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package org.elasticsearch.geometry;

import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.elasticsearch.test.ESTestCase;

public class LinearRingTests extends ESTestCase {

    public void testBasicSerialization() {
        UnsupportedOperationException ex = expectThrows(UnsupportedOperationException.class,
            () -> new WellKnownText(true, new GeographyValidator(true))
                .toWKT(new LinearRing(new double[]{3, 4, 5, 3}, new double[]{1, 2, 3, 1})));
        assertEquals("line ring cannot be serialized using WKT", ex.getMessage());
    }

    public void testInitValidation() {
        GeometryValidator validator = new GeographyValidator(true);
        IllegalArgumentException ex = expectThrows(IllegalArgumentException.class,
            () -> validator.validate(new LinearRing(new double[]{3, 4, 5}, new double[]{1, 2, 3})));
        assertEquals("first and last points of the linear ring must be the same (it must close itself): x[0]=3.0 x[2]=5.0 y[0]=1.0 " +
                "y[2]=3.0",
            ex.getMessage());

        ex = expectThrows(IllegalArgumentException.class,
            () -> validator.validate(new LinearRing(new double[]{3, 4, 3}, new double[]{1, 2, 1}, new double[]{1, 2, 3})));
        assertEquals("first and last points of the linear ring must be the same (it must close itself): x[0]=3.0 x[2]=3.0 y[0]=1.0 " +
                "y[2]=1.0 z[0]=1.0 z[2]=3.0",
            ex.getMessage());

        ex = expectThrows(IllegalArgumentException.class,
            () -> validator.validate(new LinearRing(new double[]{3}, new double[]{1})));
        assertEquals("at least two points in the line is required", ex.getMessage());

        ex = expectThrows(IllegalArgumentException.class,
            () -> validator.validate(new LinearRing(new double[]{3, 4, 500, 3}, new double[]{1, 2, 3, 1})));
        assertEquals("invalid longitude 500.0; must be between -180.0 and 180.0", ex.getMessage());

        ex = expectThrows(IllegalArgumentException.class,
            () -> validator.validate(new LinearRing(new double[]{3, 4, 5, 3}, new double[]{1, 100, 3, 1})));
        assertEquals("invalid latitude 100.0; must be between -90.0 and 90.0", ex.getMessage());

        ex = expectThrows(IllegalArgumentException.class, () -> new StandardValidator(false).validate(
            new LinearRing(new double[]{3, 4, 5, 3}, new double[]{1, 2, 3, 1}, new double[]{1, 1, 1, 1})));
        assertEquals("found Z value [1.0] but [ignore_z_value] parameter is [false]", ex.getMessage());

        new StandardValidator(true).validate(new LinearRing(new double[]{3, 4, 5, 3}, new double[]{1, 2, 3, 1}, new double[]{1, 1, 1, 1}));
    }

    public void testVisitor() {
        BaseGeometryTestCase.testVisitor(new LinearRing(new double[]{3, 4, 5, 3}, new double[]{1, 2, 3, 1}));
    }
}


text:
package com.azure.resourcemanager.webpubsub.generated;

import com.azure.core.credential.AccessToken;
import com.azure.core.http.HttpClient;
import com.azure.core.http.HttpHeaders;
import com.azure.core.http.HttpRequest;
import com.azure.core.http.HttpResponse;
import com.azure.core.management.AzureEnvironment;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Context;
import com.azure.resourcemanager.webpubsub.WebPubSubManager;
import com.azure.resourcemanager.webpubsub.models.CustomDomain;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public final class WebPubSubCustomDomainsGetWithResponseMockTests {
    @Test
    public void testGetWithResponse() throws Exception {
        HttpClient httpClient = Mockito.mock(HttpClient.class);
        HttpResponse httpResponse = Mockito.mock(HttpResponse.class);
        ArgumentCaptor<HttpRequest> httpRequest = ArgumentCaptor.forClass(HttpRequest.class);

        String responseStr =
            "{\"properties\":{\"provisioningState\":\"Creating\",\"domainName\":\"mwutwbdsre\",\"customCertificate\":{\"id\":\"drhneuyow\"}},\"id\":\"kdw\",\"name\":\"t\",\"type\":\"sibircgpi\"}";

        Mockito.when(httpResponse.getStatusCode()).thenReturn(200);
        Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders());
        Mockito
            .when(httpResponse.getBody())
            .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8))));
        Mockito
            .when(httpResponse.getBodyAsByteArray())
            .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8)));
        Mockito
            .when(httpClient.send(httpRequest.capture(), Mockito.any()))
            .thenReturn(
                Mono
                    .defer(
                        () -> {
                            Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue());
                            return Mono.just(httpResponse);
                        }));

        WebPubSubManager manager =
            WebPubSubManager
                .configure()
                .withHttpClient(httpClient)
                .authenticate(
                    tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
                    new AzureProfile("", "", AzureEnvironment.AZURE));

        CustomDomain response =
            manager.webPubSubCustomDomains().getWithResponse("wrv", "ldgmfpgvmpip", "slthaq", Context.NONE).getValue();

        Assertions.assertEquals("mwutwbdsre", response.domainName());
        Assertions.assertEquals("drhneuyow", response.customCertificate().id());
    }
}


text:
@implementation UILabel(UIDataBinding)

- (id)bindedData
{
    return self.text ? self.text : self.attributedText;
}

- (void)bindData:(id)data
{
	if ( nil == data )
	{
		self.text = nil;
		return;
	}

	if ( [data isKindOfClass:[NSNumber class]] )
	{
		self.text = [NSString stringWithFormat:@"%@", data];
	}
	else if ( [data isKindOfClass:[NSString class]] )
	{
		self.text = data;
	}
	else if ( [data isKindOfClass:[NSDate class]] )
	{
		self.text = [data description];
	}
    else if ( [data isKindOfClass:[NSAttributedString class]] )
    {
        self.attributedText = data;
    }
}

- (void)unbindData
{
	self.text = nil;
    self.attributedText = nil;
}

@end

#endif	// #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

var utils = require('utils');
var SubtleCrypto = require('enterprise.platformKeys.SubtleCrypto').SubtleCrypto;

/**
 * Implementation of enterprise.platformKeys.Token.
 * @param {string} id The id of the new Token.
 * @constructor
 */
var TokenImpl = function(id) {
  this.id = id;
  this.subtleCrypto = new SubtleCrypto(id);
};

exports.Token =
    utils.expose('Token', TokenImpl, {readonly:['id', 'subtleCrypto']});


text:
This is my take on the off-canvas layout, additionally made responsive. It's originally for my Web Programming project, but decided to make it a generic layout for future projects since some are bound to be on mobile.

##How to get it

To get a copy, install GIT and run:

    git clone https://github.com/fskreuz/responsive-off-canvas.git

This should create a folder named `responsive-off-canvas` in the current folder. The clone should have an `src` folder, where I do most of the tinkering and a `dist` folder, which contains a pre-built example.

##I did't GIT it, how does it look?

The layout is pretty intuitive and has an iPhone-ish menu layout, with a Facebook-ish off-canvas menu. Currently colored grey since neutral colors fit just about anywhere.

##Ok, ok, how do I get it?

So, suppose you didn't get it via GIT. Just browse over to the `dist` folder, and you'll see 3 files. The `index.html` is the template for your page. The 2 CSS files are basically the same, one just minified. Copy them over to your project, add in the CSS (usually after more important libraries) and you're good to go!

##Problems with the code?

Feel free to browse the code, modify it etc. It's also my first take on LESS and responsive layouts, so it might be messy and counter-convention. Feel free to fork, modify, send a pull request, whatever. :)


text:
/**
 ***********************************************************************************************************************
 * @file  palShaderLibrary.h
 * @brief Defines the Platform Abstraction Library (PAL) IShaderLibrary interface and related types.
 ***********************************************************************************************************************
 */

#pragma once

#include "pal.h"
#include "palDestroyable.h"

namespace Pal
{

struct GpuMemSubAllocInfo;

/// Common flags controlling creation of shader libraries.
union LibraryCreateFlags
{
    struct
    {
        uint32 clientInternal  : 1;  ///< Internal library not created by the application.
        uint32 reserved        : 31; ///< Reserved for future use.
    };
    uint32 u32All;                  ///< Flags packed as 32-bit uint.
};

/// Specifies properties about an indirect function belonging to a @ref IShaderLibrary object.  Part of the input
/// structure to IDevice::CreateShaderLibrary().
struct ShaderLibraryFunctionInfo
{
    const char*   pSymbolName; ///< ELF Symbol name for the associated function.  Must not be null.
    gpusize       gpuVirtAddr; ///< [out] GPU virtual address of the function.  This is computed by PAL during
                              ///  library creation.
};

/// Specifies a shader sub type / ShaderKind.
enum class ShaderSubType : uint32
{
    Unknown = 0,
    Traversal,
    RayGeneration,
    Intersection,
    AnyHit,
    ClosestHit,
    Miss,
    Callable,
    Count
};

/// Specifies properties for creation of a compute @ref IShaderLibrary object.  Input structure to
/// IDevice::CreateShaderLibrary().
struct ShaderLibraryCreateInfo
{
    LibraryCreateFlags  flags;      ///< Library creation flags

    const void*  pCodeObject;       ///< Pointer to code-object ELF binary implementing the Pipeline ABI interface.
                                    ///  The code-object ELF contains pre-compiled shaders, register values, and
                                    ///  additional metadata.
    size_t       codeObjectSize;    ///< Size of code object in bytes.

    /// List of functions for PAL to compute virtual addresses for during library creation.  These GPU addresses can
    /// then be passed as shader arguments to a later dispatch operation to allow a compute pipeline's shaders to jump
    /// to the corresponding function(s).  This behaves similarly to a function pointer, but on the GPU.  PAL will
    /// guarantee that these GPU virtual addresses remain valid for the lifetime of the @ref IShaderLibrary object and
    /// that the backing GPU memory will remain resident.
    ShaderLibraryFunctionInfo*  pFuncList;
    uint32                      funcCount;  ///< Number of entries in the pFuncList array.  Must be zero if pFuncList
                                            ///  is nullptr.
};

/// Reports properties of a compiled library.
struct LibraryInfo
{
    PipelineHash internalLibraryHash;  ///< 128-bit identifier extracted from this library's ELF binary, composed of
                                       ///  the state the compiler decided was appropriate to identify the compiled
                                       ///  library.  The lower 64 bits are "stable"; the upper 64 bits are "unique".
};

/// Reports shader stats. Multiple bits set in the shader stage mask indicates that multiple shaders have been combined
/// due to HW support. The same information will be repeated for both the constituent shaders in this case.
struct ShaderLibStats
{
    ShaderHash         shaderHash;             ///< Shader hash.
    CommonShaderStats  common;                 ///< The shader compilation parameters for this shader.
    /// Maximum number of VGPRs the compiler was allowed to use for this shader.  This limit will be the minimum
    /// of any architectural restriction and any client-requested limit intended to increase the number of waves in
    /// flight.
    uint32             numAvailableVgprs;
    /// Maximum number of SGPRs the compiler was allowed to use for this shader.  This limit will be the minimum
    /// of any architectural restriction and any client-requested limit intended to increase the number of waves in
    /// flight.
    uint32             numAvailableSgprs;
    size_t             isaSizeInBytes;          ///< Size of the shader ISA disassembly for this shader.
    PipelineHash       palInternalLibraryHash;  ///< Internal hash of the shader compilation data used by PAL.
    uint32             stackFrameSizeInBytes;   ///< Shader function stack frame size
    ShaderSubType      shaderSubType;           ///< ShaderSubType / Shader Kind
};

/**
 ***********************************************************************************************************************
 * @interface IShaderLibrary
 * @brief     Object containing one or more shader functions stored in GPU memory.  These shader functions are callable
 *            from the shaders contained within IPipeline objects.
 *
 * Before a pipeline which calls into this library is bound to a command buffer (using @ref ICmdBuffer::BindPipeline),
 * the client must call @ref IPipeline::LinkWithLibraries() and specify this library in the list of linked libraries.
 * Failure to comply with this requirement is an error and will result in undefined behavior.
 *
 * @see IDevice::CreateShaderLibrary()
 * @see IPipeline::LinkWithLibraries()
 ***********************************************************************************************************************
 */
class IShaderLibrary : public IDestroyable
{
public:
    /// Returns properties of this library and its corresponding shader functions.
    ///
    /// @returns Property structure describing this library.
    virtual const LibraryInfo& GetInfo() const = 0;

    /// Returns a list of GPU memory allocations used by this library.
    ///
    /// @param [in,out] pNumEntries    Input value specifies the available size in pAllocInfoList; output value
    ///                                reports the number of GPU memory allocations.
    /// @param [out]    pAllocInfoList If pAllocInfoList=nullptr, then pNumEntries is ignored on input.  On output it
    ///                                will reflect the number of allocations that make up this pipeline.  If
    ///                                pAllocInfoList!=nullptr, then on input pNumEntries is assumed to be the number
    ///                                of entries in the pAllocInfoList array.  On output, pNumEntries reflects the
    ///                                number of entries in pAllocInfoList that are valid.
    /// @returns Success if the allocation info was successfully written to the buffer.
    ///          + ErrorInvalidValue if the caller provides a buffer size that is different from the size needed.
    ///          + ErrorInvalidPointer if pNumEntries is nullptr.
    virtual Result QueryAllocationInfo(
        size_t*                    pNumEntries,
        GpuMemSubAllocInfo* const  pAllocInfoList) const = 0;

    /// Obtains the binary code object for this library.
    ///
    /// @param [in, out] pSize  Represents the size of the shader ISA code.
    ///
    /// @param [out] pBuffer    If non-null, the library ELF is written in the buffer. If null, the size required
    ///                         for the library ELF is given out in the location pSize.
    ///
    /// @returns Success if the library binary was fetched successfully.
    ///          +ErrorUnavailable if the library binary was not fetched successfully.
    virtual Result GetCodeObject(
        uint32*  pSize,
        void*    pBuffer) const = 0;

    /// Returns the value of the associated arbitrary client data pointer.
    /// Can be used to associate arbitrary data with a particular PAL object.
    ///
    /// @returns Pointer to client data.
    void* GetClientData() const { return m_pClientData; }

    /// Sets the value of the associated arbitrary client data pointer.
    /// Can be used to associate arbitrary data with a particular PAL object.
    ///
    /// @param  [in]    pClientData     A pointer to arbitrary client data.
    void SetClientData(
        void* pClientData)
    {
        m_pClientData = pClientData;
    }

    /// Obtains the compiled shader ISA code for the shader function specified.
    ///
    /// @param [in]  pShaderExportName The shader exported name
    ///
    /// @param [in, out] pSize  Represents the size of the shader ISA code.
    ///
    /// @param [out] pBuffer    If non-null, the shader ISA code is written in the buffer. If null, the size required
    ///                         for the shader ISA is given out in the location pSize.
    ///
    /// @returns Success if the shader ISA code was fetched successfully.
    ///          +ErrorUnavailable if the shader ISA code was not fetched successfully.
    virtual Result GetShaderFunctionCode(
        const char*  pShaderExportName,
        size_t*      pSize,
        void*        pBuffer) const = 0;

    /// Obtains the shader pre and post compilation stats/params for the specified shader.
    ///
    /// @param [in]  pShaderExportName The shader exported name
    ///
    /// @param [out] pShaderStats Pointer to the ShaderStats structure which will be filled with the shader stats for
    ///                           the shader stage mentioned in shaderType. This cannot be nullptr.
    /// @param [in]  getDisassemblySize If set to true performs disassembly on the shader binary code and reports the
    ///                                 size of the disassembly string in ShaderStats::isaSizeInBytes. Else reports 0.
    /// @returns Success if the stats were successfully obtained for this shader, including the shader disassembly size.
    ///          +ErrorUnavailable if a wrong shader stage for this pipeline was specified, or if some internal error
    ///                           occured.
    virtual Result GetShaderFunctionStats(
        const char*      pShaderExportName,
        ShaderLibStats*  pShaderStats) const = 0;

    /// Returns the function list owned by this shader library
    ///
    /// @returns A list of ShaderLibraryFunctionInfo if number of functions is not zero.
    ///          Null is number of functions is zero.
    virtual const ShaderLibraryFunctionInfo* GetShaderLibFunctionList() const = 0;

    /// Returns the function count owned by this shader library
    ///
    /// @returns function count
    virtual uint32 GetShaderLibFunctionCount() const = 0;

protected:
    /// @internal Constructor. Prevent use of new operator on this interface. Client must create objects by explicitly
    /// called the proper create method.
    IShaderLibrary() : m_pClientData(nullptr) { }

    /// @internal Destructor.  Prevent use of delete operator on this interface.  Client must destroy objects by
    /// explicitly calling IDestroyable::Destroy() and is responsible for freeing the system memory allocated for the
    /// object on their own.
    virtual ~IShaderLibrary() { }

private:
    /// @internal Client data pointer. This can have an arbitrary value and can be returned by calling GetClientData()
    /// and set via SetClientData().
    /// For non-top-layer objects, this will point to the layer above the current object.
    void*  m_pClientData;

    IShaderLibrary(const IShaderLibrary&) = delete;
    IShaderLibrary& operator=(const IShaderLibrary&) = delete;
};

} // Pal


text:
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Latest Stable Version](https://img.shields.io/packagist/v/krombox/flarum-ext-auth-wordpress.svg)](https://packagist.org/packages/krombox/flarum-ext-auth-wordpress)
[![Total Downloads](https://img.shields.io/packagist/dt/krombox/flarum-ext-auth-wordpress.svg)](https://packagist.org/packages/krombox/flarum-ext-auth-wordpress)

An extension that adds ability to login forum via your wordpress site account.

## Installation

To install, use composer:

```
composer require krombox/flarum-ext-auth-wordpress
```

## Prerequirements

1) [WP OAuth Server](https://wordpress.org/plugins/oauth2-provider/) plugin installed and [configured](https://wordpress.org/plugins/oauth2-provider/#faq)

## Config

Enable an extension in the extensions list and fill settings form in the popup.

## Donate

If you find this extension useful you can make a [donate](https://www.skrill.com/skrillit/?locale=en) by sending funds to ``ikrombox@gmail.com``

## Credits

- [Roman Kapustian](https://github.com/krombox)

## License

The MIT License (MIT). Please see [License File](https://github.com/krombox/flarum-ext-auth-wordpress/blob/master/LICENSE) for more information.


text:
package com.sshtools.forker.client;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

import com.sshtools.forker.client.impl.nonblocking.NonBlockingLinuxProcess;
import com.sshtools.forker.client.impl.nonblocking.NonBlockingOsxProcess;
import com.sshtools.forker.client.impl.nonblocking.NonBlockingWindowsProcess;
import com.sshtools.forker.common.IO;
import com.sun.jna.Platform;

/**
 * Creates {@link NonBlockingProcess}.
 */
public class NonBlockingProcessFactory implements ForkerProcessFactory {
	private int numberOfIOThreads;
	private boolean shutdownHook = true;
	private boolean softExitDetection = true;
	private boolean firstRun;
	private Object lock = new Object();
	private boolean allocateDirect;
	private int lingerTimeMs = 2500;
	private int deadPoolPollMs = 250;
	private List<IEventProcessor<? extends NonBlockingProcess>> processors = null;
	{
		numberOfIOThreads = Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
	}

	/**
	 * Get linger time in milliseconds
	 *
	 * @return linger ms
	 */
	public int getLingerTimeMs() {
		return lingerTimeMs;
	}

	/**
	 * Set linger time in ms
	 *
	 * @param lingerTimeMs linger ms
	 */
	public void setLingerTimeMs(int lingerTimeMs) {
		this.lingerTimeMs = lingerTimeMs;
	}

	/**
	 * Get dead pool poll milliseconds
	 *
	 * @return dead pool poll milliseconds
	 */
	public int getDeadPoolPollMs() {
		return deadPoolPollMs;
	}

	/**
	 * Set dead pool poll milliseconds
	 *
	 * @param deadPoolPollMs dead pool poll milliseconds
	 */
	public void setDeadPoolPollMs(int deadPoolPollMs) {
		this.deadPoolPollMs = deadPoolPollMs;
	}

	/**
	 * Get whether to use {@link ByteBuffer#allocateDirect(int)} where possible
	 * when creating internal byte buffers.
	 *
	 * @return allocate direct
	 */
	public boolean isAllocateDirect() {
		return allocateDirect;
	}

	/**
	 * Set whether to use {@link ByteBuffer#allocateDirect(int)} where possible
	 * when creating internal byte buffers.
	 *
	 * @param allocateDirect allocate direct
	 */
	public void setAllocateDirect(boolean allocateDirect) {
		this.allocateDirect = allocateDirect;
	}

	/**
	 * Get the processors.
	 *
	 * @param process
	 * @return processors
	 */
	public List<IEventProcessor<? extends NonBlockingProcess>> getProcessors(NonBlockingProcess process) {
		synchronized (lock) {
			if (processors == null) {
				processors = new ArrayList<IEventProcessor<? extends NonBlockingProcess>>(numberOfIOThreads);
				for (int i = 0; i < numberOfIOThreads; i++)
					processors.add(process.createProcessor());
			}
			return processors;
		}
	}

	/**
	 * Get whether the shutdown hook will run when the JVM exits. This closes
	 * down any current process handlers and is on by default.
	 *
	 * @return shutdown hook
	 */
	public boolean isShutdownHook() {
		return shutdownHook;
	}

	/**
	 * Set whether the shutdown hook will run when the JVM exits. This closes
	 * down any current process handlers and is on by default. This must be used
	 * before the first process is created or an exception will be thrown.
	 *
	 *
	 * @param shutdownHook
	 * @throws IllegalStateException if first process has already been created.
	 */
	public void setShutdownHook(boolean shutdownHook) {
		if (firstRun)
			throw new IllegalStateException("First process has been created, cannot change whether shutdown hook will be used.");
		synchronized (lock) {
			this.shutdownHook = shutdownHook;
		}
	}

	/**
	 * Get the number of I/O threads to use. By default, this will use half of
	 * the number of cores available.
	 *
	 * @return number of IO threads
	 */
	public int getNumberOfIOThreads() {
		return numberOfIOThreads;
	}

	/**
	 * Set the number of I/O threads to use. Cannot be used after the first I/O
	 * thread has been started, i.e. after the first process is created.
	 *
	 * @param numberOfIOThreads number of I/O threads
	 */
	public synchronized void setNumberOfIOThreads(int numberOfIOThreads) {
		if (firstRun)
			throw new IllegalStateException("Cannot set number of threads after processors have been created.");
		synchronized (lock) {
			this.numberOfIOThreads = numberOfIOThreads;
		}
	}

	/**
	 * Get if to use to use soft exit detection.
	 *
	 * @return soft exit detection
	 */
	public boolean isSoftExitDetection() {
		return softExitDetection;
	}

	/**
	 * Set if to use to use soft exit detection.
	 *
	 * @param softExitDetection soft exit detection
	 */
	public void setSoftExitDetection(boolean softExitDetection) {
		this.softExitDetection = softExitDetection;
	}

	@Override
	public ForkerProcess createProcess(ForkerBuilder builder, ForkerProcessListener listener) throws IOException {
		synchronized (lock) {
			if (!firstRun) {
				firstRun = true;
				if (shutdownHook) {
					Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
						@Override
						public void run() {
							if (processors != null) {
								for (IEventProcessor<? extends NonBlockingProcess> processor : processors) {
									if (processor != null) {
										processor.shutdown();
									}
								}
							}
						}
					}));
				}
			}
		}
		NonBlockingProcess process;
		try {
			if (Platform.isLinux() && (builder.io() == IO.NON_BLOCKING))
				process = new NonBlockingLinuxProcess(builder, this, (NonBlockingProcessListener) listener);
			else if (Platform.isMac() && (builder.io() == IO.NON_BLOCKING))
				process = new NonBlockingOsxProcess(builder, this, (NonBlockingProcessListener) listener);
			else if (Platform.isWindows() && (builder.io() == IO.NON_BLOCKING))
				process = new NonBlockingWindowsProcess(builder, this, (NonBlockingProcessListener) listener);
			else
				return null;
			if (listener != null) {
				((NonBlockingProcessListener) listener).onStart(process);
			}
		} catch (ClassCastException cce) {
			throw new IllegalArgumentException(
					String.format("For a %s, the listener supplied must be a %s.", getClass(), NonBlockingProcess.class), cce);
		}
		return process;
	}

	/**
	 * Get linger iterations
	 *
	 * @return linger iterations
	 */
	public int getLingerIterations() {
		return (int) (lingerTimeMs / deadPoolPollMs);
	}
}


text:
#import "BSTableViewFactory.h"
#import "BSBaseTableViewCell.h"
#import "BSRuntimeHelper.h"

@interface BSTableViewFactory ()

@property (nonatomic,strong) NSMutableDictionary* cellMappingsDictionary;

@end

@implementation BSTableViewFactory

- (NSMutableDictionary *)cellMappingsDictionary
{
    if (!_cellMappingsDictionary)
    {
        _cellMappingsDictionary = [NSMutableDictionary new];
    }
    return _cellMappingsDictionary;
}

- (void)registerCellClass:(Class)cellClass forModelClass:(Class)modelClass
{
    NSParameterAssert([cellClass isSubclassOfClass:[UITableViewCell class]]);
    NSParameterAssert([cellClass conformsToProtocol:@protocol(BSModelTransfer)]);
    NSParameterAssert(modelClass);

    NSString * reuseIdentifier = [BSRuntimeHelper classStringForClass:cellClass];

    NSParameterAssert(reuseIdentifier);
    reuseIdentifier = reuseIdentifier ? : @"";

    [[self.delegate tableView] registerClass:cellClass
                      forCellReuseIdentifier:reuseIdentifier];

    [self.cellMappingsDictionary setObject:[BSRuntimeHelper classStringForClass:cellClass]
                                    forKey:[BSRuntimeHelper modelStringForClass:modelClass]];
}

- (UITableViewCell *)cellForModel:(id)model atIndexPath:(NSIndexPath *)indexPath
{
    NSString * reuseIdentifier = [self _cellReuseIdentifierForModel:model];
    NSParameterAssert(reuseIdentifier);
    reuseIdentifier = reuseIdentifier ? : @"";

    UITableViewCell <BSModelTransfer> * cell;
    if (reuseIdentifier)
    {
        cell = [[self.delegate tableView] dequeueReusableCellWithIdentifier:reuseIdentifier
                                                               forIndexPath:indexPath];
        [cell updateWithModel:model];
    }
    else
    {
        cell = [BSBaseTableViewCell new];
    }
    return cell;
}

- (NSString *)_cellReuseIdentifierForModel:(id)model
{
    NSString* modelClassName = [BSRuntimeHelper modelStringForClass:[model class]];
    NSString* cellClassString = [self.cellMappingsDictionary objectForKey:modelClassName];
    NSAssert(cellClassString, @"%@ does not have cell mapping for model class: %@",[self class], [model class]);

    return cellClassString;
}

@end


text:
jQuery(function(){

    initContentHeight();
    window.onresize = function(event){
        initContentHeight();
    };
});

// content height init
function initContentHeight(){
    var win = $(window);
    var header = $('.header');
    var contentframe = $('.content-frame');
    var footer = $('.footer');
    var out_height = win.height() - header.outerHeight(true) - footer.outerHeight(true) - 106;
    contentframe.css('min-height', out_height);
}
initContentHeight();

// page init
jQuery(function(){
    initFixLayout();
});
function initFixLayout(){
    $('table tr:nth-child(2n)').addClass('even');
    $('table td:nth-child(1)').addClass('first-child');
    $('table td:nth-child(odd)').addClass('last-child');
    $('table th:nth-child(1)').addClass('first-child');
    $('div.levels div.tr:nth-child(2n)').addClass('even');
    $('div.pop-up-calendar table.ui-datepicker-calendar td:nth-child(2n)').addClass('last-child');
};

jQuery(function(){
    initContentHeight();
    window.onresize = function(event){
        initContentHeight();
    };
});

// content height init
function initContentHeight(){
    var win = $(window);
    var header = $('.header');
    var contentframe = $('.content-center');
    var footer = $('.footer');
    var out_height = win.height() - header.outerHeight(true) - footer.outerHeight(true) - 130;
    contentframe.css('height', out_height);
}
initContentHeight();

$(function () {
    function divresize(block, headerHeight, footerHeight) {
        var windowHeight = $(".wrapper").height(); //определяем высоту окна браузера
        $(block).css('height', windowHeight - headerHeight - footerHeight); //устанавливаем высоту блока(равно высоте окна за вычетом шапки и подвала)
    }
    divresize('.goal', 125, 118); //вызываем функцию изменения размера блока
    $(window).bind("resize", function(){ //при изменении размера окна вызываем функцию
        divresize('.goal', 125, 118);
    });
});
//
//$(function () {
//    function divresize(block, headerHeight, footerHeight) {
//        var windowHeight = $("body").height(); //определяем высоту окна браузера
//        $(block).css('height', windowHeight - headerHeight - footerHeight); //устанавливаем высоту блока(равно высоте окна за вычетом шапки и подвала)
//    }
//    //divresize('.landing-container', 50, 0); //вызываем функцию изменения размера блока
//    $(window).bind("resize", function(){ //при изменении размера окна вызываем функцию
//        divresize('.landing-container', 50, 0);
//    });
//});

$(document).ready(function(){

	$('#p-code').change(function(){
		if ($('#promo').hasClass('hidden')) {
			$('#promo').removeClass('hidden');
		}
		else {
			$('#promo').addClass('hidden');
		}
	});

	$(".fancybox").fancybox({
		'padding': 0,
		'autoScale': false,
		'transitionIn': 'none',
		'transitionOut': 'none',
		'overlayColor': '#000',
		'overlayOpacity': 0.6
	});

    var anim_int = 250;

    $('.btn-close').click(function(){
        $(this).parent().parent().animate({
            top: "300px"
        }, anim_int);
        return false;
    });

    $('.see').click(function(){
        if ($(this).hasClass('icon-nosee')) {
            $(this).removeClass('icon-nosee')
        }
        else {
            $(this).addClass('icon-nosee')
        }
        return false;
    });

    $('.open').click(function(){
        $(this).parent().parent().parent().parent().parent().parent().find('.job').animate({
            top: "0"
        }, anim_int);
        return false;
    });

    $('.open-statistic').click(function(){
    	$(this).parent().parent().parent().parent().parent().find('.box-tool-slider-statistics').animate({
    		right: "0"
    	}, anim_int);
    	return false;
    });
    $('.btn-close-statistic').click(function(){
    	$(this).parent().parent().parent().animate({
    		right: "-234px"
    	}, anim_int);
    	return false;
    });

    $('.btn-sent-statistic').click(function(){
    	$(this).parent().parent().parent().parent().parent().parent().find('.box-tool-slider').animate({
    		bottom: "0"
    	}, 0);
    	return false;
    });
    $('.btn-close-sent').click(function(){
    	$(this).parent().parent().animate({
    		bottom: "-234px"
    	}, 0);
    	return false;
    });

    $('.progresbar').click(function(){
        $(this).parent().parent().parent().find('.statistics-runtime').css('top','-100').animate({
            top: "0"
        }, anim_int);
        return false;
    });

    $('.btn-close-statistics-runtime').click(function(){
        $(this).parent().parent().animate({
            top: "-300px"
        }, anim_int);
        return false;
    });

    $('.note').click(function(){
        $(this).parent().parent().parent().parent().parent().parent().find('.notes-case').animate({
            top: "0"
        }, anim_int);
        return false;
    });

    $('.btn-minus').click(function(){
        var obj = $(this).parent().find('input');
        var v = parseInt(obj.val());
        if (v > 1) {
            obj.val(v - 1)
        }
        return false;
    });

    $('.btn-plus').click(function(){
        var obj = $(this).parent().find('input');
        var v = parseInt(obj.val());
        obj.val(v + 1);
        return false;
    });

    $('#nestable3').nestable();

    $('.planned-business').shapeshift({
    	handle: ".btn-move",
    	gutterY: 45,
    	gutterX: 16,
    	paddingX: 0,
    	paddingY: 0,
    	animationSpeed: 600,
    	align: "left"
    });

    $('.lk-holder').shapeshift({
    	handle: ".btn-move",
    	selector: "*",
    	enableDrag: true,
    	enableCrossDrop: true,
    	enableResize: true,
    	enableTrash: false,
    	colWidth: null,
    	columns: null,
    	minColumns: 3,
    	autoHeight: true,
    	maxHeight: null,
    	minHeight: 100,
    	gutterX: 28,
    	gutterY: 35,
    	paddingX: 10,
    	paddingY: 10,
    	animated: true,
    	animateOnInit: false,
    	animationSpeed: 225,
    	animationThreshold: 100,
    	dragClone: false,
    	deleteClone: true,
    });

    $('.payment-history-holder').shapeshift({
    	selector: "*",
    	enableDrag: false,
    	minColumns: 3,
    	autoHeight: true,
    	maxHeight: null,
    	minHeight: 100,
    	gutterX: 28,
    	gutterY: 35,
    	paddingX: 10,
    	paddingY: 10
    });

    $('.question-answer-wrapper').shapeshift({
    	selector: "*",
    	enableDrag: false,
    	minColumns: 3,
    	autoHeight: true,
    	maxHeight: null,
    	minHeight: 100,
    	gutterX: 34,
    	gutterY: 46,
    	paddingX: 10,
    	paddingY: 10
    });

    $(document).mouseup(function(e){

    	if ($(e.target).attr('type') != 'search' && $(e.target).attr('type') != 'submit') {
    		$("input[type=search]").fadeOut(100);
    	}
    	e.preventDefault();
    });
    $('.form-search input[type=search]').hide();
    $('.form-search button[type=submit]').mouseover(function(){
    	$('.form-search input[type=search]').fadeIn(600).focus();
    });

    $('.add-case').click(function(){
    	var box_obj = $(this).parent().parent().find('.box-new-daily-deal');
    	box_obj.animate({
    		top: "0"
    	}, 500);
    	box_obj.find('.row button[type=reset]').click(function(){
    		box_obj.animate({
    			top: "-234"
    		}, 500);
    		return false;
    	});
    	return false;
    });

    $('.icon-play').each(function(){

       var parent_holder = $(this).parent().parent();
       var parent_sp = $(this).parent();
       var stop_btn = parent_holder.find('.icon-stop');
       var pause_btn = parent_sp.find('.icon-pause');
       var play_btn = $(this);

	  play_btn.click(function(){
	  	play_btn.css('z-index', '0');
	  	pause_btn.css('z-index', '10');
	  	play_btn.animate({
	  		opacity: 0
	  	}, {
	  		duration: 200,
	  		step: function(now, fx){
	  			pause_btn.css("opacity", 100 - now).css('z-index', '10');
	  		}
	  	}).css('z-index', '0');

	  	stop_btn.show(30);
	  	return false;
	  });

	  pause_btn.click(function(){
	  	pause_btn.animate({
	  		opacity: 0
	  	}, {
	  		duration: 30,
	  		step: function(now, fx){
	  			play_btn.css("opacity", 100 - now).css('z-index', '10');
	  		}
	  	}).css('z-index', '0');
	  	return false;
	  });

       stop_btn.click(function(){ pause_btn.click(); stop_btn.hide(100); return false;});

    });

	$('.btn-chat').click(function(){

    	if($(this).hasClass('open'))
    	{
    		$(this).removeClass('open');
    		$(this).parent().animate({marginRight: "0"}, { duration: 200, queue: false });
    		$('#pop-up-chat').animate({marginRight: "0"}, { duration: 200, queue: false });
    		$(this).parent().find('#pop-up-chat').hide(50);

    	}
    	else
    	{
    		$(this).addClass('open');
    		$('#pop-up-chat').show();
    		$(this).parent().animate({marginRight: "176"}, { duration: 200, queue: false });
    		$('#pop-up-chat').animate({marginRight: "176"}, { duration: 200, queue: false });

    		$('.list-friends').css('height', $(window).height() - 282);
    		$(window).resize(function(){
        		$('.list-friends').css('height', $(window).height() - 282);
    		});

    	}
    	return false;

    });

    $('.logo a').hover(function(){
    	$(this).find("span").animate({
    		top: "0"
    	}, 250);
    }, function(){
    	$(this).find("span").animate({
    		top: "-31"
    	}, 250);
    });

    $('.tools-content').hover(function(){
    	$(this).find(".text").stop().animate({
    		bottom: "0"
    	}, 250);
    }, function(){
    	$(this).find(".text").stop().animate({
    		bottom: "-235"
    	}, 250);
    });

    $('.ava').hover(function(){
    	$(this).parent().addClass('hover');
    }, function(){
    	$(this).parent().removeClass('hover');
    });

	var padding_main = $(".header").height() + 50;
	$(".main").css('padding-top', padding_main);

	function scrollToId(id){
		$('html, body').animate({
			scrollTop: $(id).offset().top
		}, 1000);
	}

	$('#landing-menu li a').click(function(){
		$('#landing-menu li').removeClass('active');
		$(this).parent().addClass('active');
		scrollToId($(this).attr('href'))
		return false;
	});

	// Cache selectors
	var topMenu = $("#landing-menu"), topMenuHeight = topMenu.outerHeight() + 15, menuItems = topMenu.find("a"), scrollItems = menuItems.map(function(){
		var item = $($(this).attr("href"));
		if (item.length) {
			return item;
		}
	});

    // Bind to scroll
    $(window).scroll(function(){
    	// Get container scroll position
    	var fromTop = $(this).scrollTop() + topMenuHeight;

    	// Get id of current scroll item
    	var cur = scrollItems.map(function(){
    		if ($(this).offset().top < fromTop)
    			return this;
    	});
    	// Get the id of the current element
    	cur = cur[cur.length - 1];
    	var id = cur && cur.length ? cur[0].id : "";
    	// Set/remove active class
    	menuItems.parent().removeClass("active").end().filter("[href=#" + id + "]").parent().addClass("active");
    });
});

$(document).ready(function(){
	jQuery('.collaboration-scroll').jScrollPane({
		autoReinitialise: true,
		autoReinitialiseDelay: 100
	});

	jQuery('.scroll-pane').jScrollPane({
		autoReinitialise: true,
		autoReinitialiseDelay: 100
	});

	jQuery('.goal-text-scroll').jScrollPane({
		autoReinitialise: true,
		autoReinitialiseDelay: 100
	});

	jQuery('.ng-scope-chat-holder').jScrollPane({
		autoReinitialise: true,
		autoReinitialiseDelay: 100
	});

	$('.btn-setting-goals li:first').click(function(){
		$('.btn-setting-goals li').removeClass('active');
		$(this).addClass('active');
		$('#pop-up-setting-goals').addClass('briefly');
		return false;
	});

	$('.btn-setting-goals li:last').click(function(){
		$('.btn-setting-goals li').removeClass('active');
		$(this).addClass('active');
		$('#pop-up-setting-goals').removeClass('briefly');
		return false;
	});

	$('.count-number-of-executions li span').click(function(){
		$('.count-number-of-executions li').removeClass('active');
		$('#count-number-input').val($(this).html());
		$(this).parent().addClass('active');
	});

	if ($('.selectpicker').length) {
		$('.selectpicker').selectpicker('');
	}

	if ($('.tools-slider').length) {

	    function get_tools_variant(v)
		{
			switch (v) {
				case 1: return 'Хуже быть не может';
				case 2: return 'Очень плохо';
				case 3: return 'Плохо';
				case 4: return 'Так себе';
				case 5: return 'Средне';
				case 6: return 'Нормально';
				case 7: return 'Хорошо';
				case 8: return 'Очень хорошо';
				case 9: return 'Отлично';
				case 10: return 'Безумно хорошо';
			}
		}

/*
		$('.tools-slider').each(function(){
                var select = $(this).find('.tools-slider-variant');
				var slider = $(this).find('.tools-slider-scroller');

                slider.slider({
					min: 1,
					max: 10,
					range: "min",
					value: select[ 0 ].selectedIndex + 1,
					slide: function( event, ui ) {select[0].selectedIndex = ui.value - 1;}
				});
		});

*/

		$('.tools-slider').each(function(){
                var div = $(this).find('.tools-slider-variant');
				var slider = $(this).find('.tools-slider-scroller');

                slider.slider({
					min: 1,
					max: 10,
					range: "min",
					slide: function( event, ui ) {div.html(get_tools_variant(ui.value));}

				});
		});
	}

});

$(function(){
	$.datepicker.regional['ru'] = {
        closeText: 'Закрыть',
        prevText: '<Пред',
        nextText: 'След>',
        currentText: 'Сегодня',
        monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
        'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
        monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
        'Июл','Авг','Сен','Окт','Ноя','Дек'],
        dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
        dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
        dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
        weekHeader: 'Нед',
        dateFormat: 'dd.mm.yy',
        firstDay: 1,
        isRTL: false,
        showMonthAfterYear: false,
        yearSuffix: ''};
	$("#datepicker").datepicker($.datepicker.regional["ru"]);

	 $( "#main-calendar" ).datepicker({
		closeText: 'Закрыть',
        prevText: '<Пред',
        nextText: 'След>',
        currentText: 'Сегодня',
        monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
        'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
        monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
        'Июл','Авг','Сен','Окт','Ноя','Дек'],
        dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
        dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
        dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
        weekHeader: 'Нед',
        dateFormat: 'dd.mm.yy',
        firstDay: 1,
        showMonthAfterYear: false,
        yearSuffix: '',
		numberOfMonths: 2,
		altField: "#main-calendar-day",
		altFormat: "d MM <i>(DD)</i>"

	 });

     $('#main-calendar-gotocurrent').click(function(){
    	   $( "#main-calendar" ).datepicker( "setDate", "now");
     	   return false;
     });

     $('#main-calendar-next').click(function(){
     	   var currentDate = $( "#main-calendar" ).datepicker( 'getDate', '+1d' );
     	   currentDate.setDate(currentDate.getDate()+1);
     	   $( "#main-calendar" ).datepicker( "setDate", currentDate);
     	   return false;
     });
     $('#main-calendar-prev').click(function(){
     	   var currentDate = $( "#main-calendar" ).datepicker( 'getDate', '-1d' );
     	   currentDate.setDate(currentDate.getDate()-1);
     	   $( "#main-calendar" ).datepicker( "setDate", currentDate);
     	   return false;
     });
});

$(function() {
    $('body').tooltip({
        selector: "[rel=tooltip]", // можете использовать любой селектор
        placement: "top"
    });
});


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

package cmd

import (
	"encoding/json"
	"fmt"
	"sort"
)

// StringSet - uses map as set of strings.
type StringSet map[string]struct{}

// keys - returns StringSet keys.
func (set StringSet) keys() []string {
	keys := make([]string, 0, len(set))
	for k := range set {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	return keys
}

// IsEmpty - returns whether the set is empty or not.
func (set StringSet) IsEmpty() bool {
	return len(set) == 0
}

// Add - adds string to the set.
func (set StringSet) Add(s string) {
	set[s] = struct{}{}
}

// Remove - removes string in the set.  It does nothing if string does not exist in the set.
func (set StringSet) Remove(s string) {
	delete(set, s)
}

// Contains - checks if string is in the set.
func (set StringSet) Contains(s string) bool {
	_, ok := set[s]
	return ok
}

// FuncMatch - returns new set containing each value who passes match function.
// A 'matchFn' should accept element in a set as first argument and
// 'matchString' as second argument.  The function can do any logic to
// compare both the arguments and should return true to accept element in
// a set to include in output set else the element is ignored.
func (set StringSet) FuncMatch(matchFn func(string, string) bool, matchString string) StringSet {
	nset := NewStringSet()
	for k := range set {
		if matchFn(k, matchString) {
			nset.Add(k)
		}
	}
	return nset
}

// ApplyFunc - returns new set containing each value processed by 'applyFn'.
// A 'applyFn' should accept element in a set as a argument and return
// a processed string.  The function can do any logic to return a processed
// string.
func (set StringSet) ApplyFunc(applyFn func(string) string) StringSet {
	nset := NewStringSet()
	for k := range set {
		nset.Add(applyFn(k))
	}
	return nset
}

// Equals - checks whether given set is equal to current set or not.
func (set StringSet) Equals(sset StringSet) bool {
	// If length of set is not equal to length of given set, the
	// set is not equal to given set.
	if len(set) != len(sset) {
		return false
	}

	// As both sets are equal in length, check each elements are equal.
	for k := range set {
		if _, ok := sset[k]; !ok {
			return false
		}
	}

	return true
}

// Intersection - returns the intersection with given set as new set.
func (set StringSet) Intersection(sset StringSet) StringSet {
	nset := NewStringSet()
	for k := range set {
		if _, ok := sset[k]; ok {
			nset.Add(k)
		}
	}

	return nset
}

// Difference - returns the difference with given set as new set.
func (set StringSet) Difference(sset StringSet) StringSet {
	nset := NewStringSet()
	for k := range set {
		if _, ok := sset[k]; !ok {
			nset.Add(k)
		}
	}

	return nset
}

// Union - returns the union with given set as new set.
func (set StringSet) Union(sset StringSet) StringSet {
	nset := NewStringSet()
	for k := range set {
		nset.Add(k)
	}

	for k := range sset {
		nset.Add(k)
	}

	return nset
}

// MarshalJSON - converts to JSON data.
func (set StringSet) MarshalJSON() ([]byte, error) {
	return json.Marshal(set.keys())
}

// UnmarshalJSON - parses JSON data and creates new set with it.
// If 'data' contains JSON string array, the set contains each string.
// If 'data' contains JSON string, the set contains the string as one element.
// If 'data' contains Other JSON types, JSON parse error is returned.
func (set *StringSet) UnmarshalJSON(data []byte) error {
	sl := []string{}
	var err error
	if err = json.Unmarshal(data, &sl); err == nil {
		*set = make(StringSet)
		for _, s := range sl {
			set.Add(s)
		}
	} else {
		var s string
		if err = json.Unmarshal(data, &s); err == nil {
			*set = make(StringSet)
			set.Add(s)
		}
	}

	return err
}

// String - returns printable string of the set.
func (set StringSet) String() string {
	return fmt.Sprintf("%s", set.keys())
}

// NewStringSet - creates new string set.
func NewStringSet() StringSet {
	return make(StringSet)
}

// CreateStringSet - creates new string set with given string values.
func CreateStringSet(sl ...string) StringSet {
	set := make(StringSet)
	for _, k := range sl {
		set.Add(k)
	}
	return set
}

// CopyStringSet - returns copy of given set.
func CopyStringSet(set StringSet) StringSet {
	nset := NewStringSet()
	for k, v := range set {
		nset[k] = v
	}
	return nset
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Schizothyrium australe Speg.

### Remarks
null


text:
import { withRouter } from 'react-router';
import Component from './emission-pathways-table-menu-component';

export default withRouter(Component);


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="white">#ffffffff</color>
    <color name="black">#ff000000</color>
    <color name="clear">#00000000</color>
</resources>


text:
import matplotlib.pyplot as plt
import numpy as np

def plot():
    labels = ["lab1", "label 2", "another super label"]
    n = len(labels)
    x = np.arange(n)
    y = 1 / (x + 1)

    ax = plt.gca()
    ax.bar(x, y, 0.5)

    ax.set_xticks(x)
    ax.set_xticklabels(labels)
    plt.xticks(rotation=45, ha="right")

def test():
    from .helpers import assert_equality

    assert_equality(plot, "test_horizontal_alignment_reference.tex")


text:
using NodaTime.Testing.TimeZones;
using NodaTime.Text;
using NodaTime.TimeZones;
using NUnit.Framework;

namespace NodaTime.Test
{
    /// <summary>
    /// Tests for aspects of DateTimeZone to do with converting from LocalDateTime and
    /// LocalDate to ZonedDateTime.
    /// </summary>
    // TODO: Fix all tests to use SingleTransitionZone.
    public partial class DateTimeZoneTest
    {
        // Sample time zones for DateTimeZone.AtStartOfDay etc. I didn't want to only test midnight transitions.
        private static readonly DateTimeZone LosAngeles = DateTimeZoneProviders.Tzdb["America/Los_Angeles"];
        private static readonly DateTimeZone NewZealand = DateTimeZoneProviders.Tzdb["Pacific/Auckland"];
        private static readonly DateTimeZone Paris = DateTimeZoneProviders.Tzdb["Europe/Paris"];
        private static readonly DateTimeZone NewYork = DateTimeZoneProviders.Tzdb["America/New_York"];
        private static readonly DateTimeZone Pacific = DateTimeZoneProviders.Tzdb["America/Los_Angeles"];

        /// <summary>
        /// Local midnight at the start of the transition (June 1st) becomes 1am.
        /// </summary>
        private static readonly DateTimeZone TransitionForwardAtMidnightZone =
            new SingleTransitionDateTimeZone(Instant.FromUtc(2000, 6, 1, 2, 0), Offset.FromHours(-2), Offset.FromHours(-1));

        /// <summary>
        /// Local 1am at the start of the transition (June 1st) becomes midnight.
        /// </summary>
        private static readonly DateTimeZone TransitionBackwardToMidnightZone =
            new SingleTransitionDateTimeZone(Instant.FromUtc(2000, 6, 1, 3, 0), Offset.FromHours(-2), Offset.FromHours(-3));

        /// <summary>
        /// Local 11.20pm at the start of the transition (May 30th) becomes 12.20am of June 1st.
        /// </summary>
        private static readonly DateTimeZone TransitionForwardBeforeMidnightZone =
            new SingleTransitionDateTimeZone(Instant.FromUtc(2000, 6, 1, 1, 20), Offset.FromHours(-2), Offset.FromHours(-1));

        /// <summary>
        /// Local 12.20am at the start of the transition (June 1st) becomes 11.20pm of the previous day.
        /// </summary>
        private static readonly DateTimeZone TransitionBackwardAfterMidnightZone =
            new SingleTransitionDateTimeZone(Instant.FromUtc(2000, 6, 1, 2, 20), Offset.FromHours(-2), Offset.FromHours(-3));

        private static readonly LocalDate TransitionDate = new LocalDate(2000, 6, 1);

        [Test]
        public void AmbiguousStartOfDay_TransitionAtMidnight()
        {
            // Occurrence before transition
            var expected = new ZonedDateTime(new LocalDateTime(2000, 6, 1, 0, 0).WithOffset(Offset.FromHours(-2)),
                TransitionBackwardToMidnightZone);
            var actual = TransitionBackwardToMidnightZone.AtStartOfDay(TransitionDate);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void AmbiguousStartOfDay_TransitionAfterMidnight()
        {
            // Occurrence before transition
            var expected = new ZonedDateTime(new LocalDateTime(2000, 6, 1, 0, 0).WithOffset(Offset.FromHours(-2)),
                TransitionBackwardAfterMidnightZone);
            var actual = TransitionBackwardAfterMidnightZone.AtStartOfDay(TransitionDate);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void SkippedStartOfDay_TransitionAtMidnight()
        {
            // 1am because of the skip
            var expected = new ZonedDateTime(new LocalDateTime(2000, 6, 1, 1, 0).WithOffset(Offset.FromHours(-1)),
                TransitionForwardAtMidnightZone);
            var actual = TransitionForwardAtMidnightZone.AtStartOfDay(TransitionDate);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void SkippedStartOfDay_TransitionBeforeMidnight()
        {
            // 12.20am because of the skip
            var expected = new ZonedDateTime(new LocalDateTime(2000, 6, 1, 0, 20).WithOffset(Offset.FromHours(-1)),
                TransitionForwardBeforeMidnightZone);
            var actual = TransitionForwardBeforeMidnightZone.AtStartOfDay(TransitionDate);
            Assert.AreEqual(expected, actual);
        }

        [Test]
        public void UnambiguousStartOfDay()
        {
            // Just a simple midnight in March.
            var expected = new ZonedDateTime(new LocalDateTime(2000, 3, 1, 0, 0).WithOffset(Offset.FromHours(-2)),
                TransitionForwardAtMidnightZone);
            var actual = TransitionForwardAtMidnightZone.AtStartOfDay(new LocalDate(2000, 3, 1));
            Assert.AreEqual(expected, actual);
        }

        private static void AssertImpossible(LocalDateTime localTime, DateTimeZone zone)
        {
            try
            {
                zone.MapLocal(localTime).Single();
                Assert.Fail("Expected exception");
            }
            catch (SkippedTimeException e)
            {
                Assert.AreEqual(localTime, e.LocalDateTime);
                Assert.AreEqual(zone, e.Zone);
            }
        }

        private static void AssertAmbiguous(LocalDateTime localTime, DateTimeZone zone)
        {
            ZonedDateTime earlier = zone.MapLocal(localTime).First();
            ZonedDateTime later = zone.MapLocal(localTime).Last();
            Assert.AreEqual(localTime, earlier.LocalDateTime);
            Assert.AreEqual(localTime, later.LocalDateTime);
            Assert.That(earlier.ToInstant(), Is.LessThan(later.ToInstant()));

            try
            {
                zone.MapLocal(localTime).Single();
                Assert.Fail("Expected exception");
            }
            catch (AmbiguousTimeException e)
            {
                Assert.AreEqual(localTime, e.LocalDateTime);
                Assert.AreEqual(zone, e.Zone);
                Assert.AreEqual(earlier, e.EarlierMapping);
                Assert.AreEqual(later, e.LaterMapping);
            }
        }

        private static void AssertOffset(int expectedHours, LocalDateTime localTime, DateTimeZone zone)
        {
            var zoned = zone.MapLocal(localTime).Single();
            int actualHours = zoned.Offset.Milliseconds / NodaConstants.MillisecondsPerHour;
            Assert.AreEqual(expectedHours, actualHours);
        }

        // Los Angeles goes from -7 to -8 on November 7th 2010 at 2am wall time
        [Test]
        public void GetOffsetFromLocal_LosAngelesFallTransition()
        {
            var before = new LocalDateTime(2010, 11, 7, 0, 30);
            var atTransition = new LocalDateTime(2010, 11, 7, 1, 0);
            var ambiguous = new LocalDateTime(2010, 11, 7, 1, 30);
            var after = new LocalDateTime(2010, 11, 7, 2, 30);
            AssertOffset(-7, before, LosAngeles);
            AssertAmbiguous(atTransition, LosAngeles);
            AssertAmbiguous(ambiguous, LosAngeles);
            AssertOffset(-8, after, LosAngeles);
        }

        [Test]
        public void GetOffsetFromLocal_LosAngelesSpringTransition()
        {
            var before = new LocalDateTime(2010, 3, 14, 1, 30);
            var impossible = new LocalDateTime(2010, 3, 14, 2, 30);
            var atTransition = new LocalDateTime(2010, 3, 14, 3, 0);
            var after = new LocalDateTime(2010, 3, 14, 3, 30);
            AssertOffset(-8, before, LosAngeles);
            AssertImpossible(impossible, LosAngeles);
            AssertOffset(-7, atTransition, LosAngeles);
            AssertOffset(-7, after, LosAngeles);
        }

        // New Zealand goes from +13 to +12 on April 4th 2010 at 3am wall time
        [Test]
        public void GetOffsetFromLocal_NewZealandFallTransition()
        {
            var before = new LocalDateTime(2010, 4, 4, 1, 30);
            var atTransition = new LocalDateTime(2010, 4, 4, 2, 0);
            var ambiguous = new LocalDateTime(2010, 4, 4, 2, 30);
            var after = new LocalDateTime(2010, 4, 4, 3, 30);
            AssertOffset(+13, before, NewZealand);
            AssertAmbiguous(atTransition, NewZealand);
            AssertAmbiguous(ambiguous, NewZealand);
            AssertOffset(+12, after, NewZealand);
        }

        // New Zealand goes from +12 to +13 on September 26th 2010 at 2am wall time
        [Test]
        public void GetOffsetFromLocal_NewZealandSpringTransition()
        {
            var before = new LocalDateTime(2010, 9, 26, 1, 30);
            var impossible = new LocalDateTime(2010, 9, 26, 2, 30);
            var atTransition = new LocalDateTime(2010, 9, 26, 3, 0);
            var after = new LocalDateTime(2010, 9, 26, 3, 30);
            AssertOffset(+12, before, NewZealand);
            AssertImpossible(impossible, NewZealand);
            AssertOffset(+13, atTransition, NewZealand);
            AssertOffset(+13, after, NewZealand);
        }

        // Paris goes from +1 to +2 on March 28th 2010 at 2am wall time
        [Test]
        public void GetOffsetFromLocal_ParisFallTransition()
        {
            var before = new LocalDateTime(2010, 10, 31, 1, 30);
            var atTransition = new LocalDateTime(2010, 10, 31, 2, 0);
            var ambiguous = new LocalDateTime(2010, 10, 31, 2, 30);
            var after = new LocalDateTime(2010, 10, 31, 3, 30);
            AssertOffset(2, before, Paris);
            AssertAmbiguous(ambiguous, Paris);
            AssertAmbiguous(atTransition, Paris);
            AssertOffset(1, after, Paris);
        }

        [Test]
        public void GetOffsetFromLocal_ParisSpringTransition()
        {
            var before = new LocalDateTime(2010, 3, 28, 1, 30);
            var impossible = new LocalDateTime(2010, 3, 28, 2, 30);
            var atTransition = new LocalDateTime(2010, 3, 28, 3, 0);
            var after = new LocalDateTime(2010, 3, 28, 3, 30);
            AssertOffset(1, before, Paris);
            AssertImpossible(impossible, Paris);
            AssertOffset(2, atTransition, Paris);
            AssertOffset(2, after, Paris);
        }

        [Test]
        public void MapLocalDateTime_UnambiguousDateReturnsUnambiguousMapping()
        {
            //2011-11-09 01:30:00 - not ambiguous in America/New York timezone
            var unambigiousTime = new LocalDateTime(2011, 11, 9, 1, 30);
            var mapping = NewYork.MapLocal(unambigiousTime);
            Assert.AreEqual(1, mapping.Count);
        }

        [Test]
        public void MapLocalDateTime_AmbiguousDateReturnsAmbigousMapping()
        {
            //2011-11-06 01:30:00 - falls during DST - EST conversion in America/New York timezone
            var ambiguousTime = new LocalDateTime(2011, 11, 6, 1, 30);
            var mapping = NewYork.MapLocal(ambiguousTime);
            Assert.AreEqual(2, mapping.Count);
        }

        [Test]
        public void MapLocalDateTime_SkippedDateReturnsSkippedMapping()
        {
            //2011-03-13 02:30:00 - falls during EST - DST conversion in America/New York timezone
            var skippedTime = new LocalDateTime(2011, 3, 13, 2, 30);
            var mapping = NewYork.MapLocal(skippedTime);
            Assert.AreEqual(0, mapping.Count);
        }

        // Some zones skipped dates by changing from UTC-lots to UTC+lots. For example, Samoa (Pacific/Apia)
        // skipped December 30th 2011, going from  23:59:59 December 29th local time UTC-10
        // to 00:00:00 December 31st local time UTC+14
        [Test]
        [TestCase("Pacific/Apia", "2011-12-30")]
        [TestCase("Pacific/Enderbury", "1995-01-01")]
        [TestCase("Pacific/Kiritimati", "1995-01-01")]
        [TestCase("Pacific/Kwajalein", "1993-08-20")]
        public void AtStartOfDay_DayDoesntExist(string zoneId, string localDate)
        {
            LocalDate badDate = LocalDatePattern.IsoPattern.Parse(localDate).Value;
            DateTimeZone zone = DateTimeZoneProviders.Tzdb[zoneId];
            var exception = Assert.Throws<SkippedTimeException>(() => zone.AtStartOfDay(badDate));
            Assert.AreEqual(badDate + LocalTime.Midnight, exception.LocalDateTime);
        }

        [Test]
        public void AtStrictly_InWinter()
        {
            var when = Pacific.AtStrictly(new LocalDateTime(2009, 12, 22, 21, 39, 30));

            Assert.AreEqual(2009, when.Year);
            Assert.AreEqual(12, when.Month);
            Assert.AreEqual(22, when.Day);
            Assert.AreEqual(2, when.DayOfWeek);
            Assert.AreEqual(21, when.Hour);
            Assert.AreEqual(39, when.Minute);
            Assert.AreEqual(30, when.Second);
            Assert.AreEqual(Offset.FromHours(-8), when.Offset);
        }

        [Test]
        public void AtStrictly_InSummer()
        {
            var when = Pacific.AtStrictly(new LocalDateTime(2009, 6, 22, 21, 39, 30));

            Assert.AreEqual(2009, when.Year);
            Assert.AreEqual(6, when.Month);
            Assert.AreEqual(22, when.Day);
            Assert.AreEqual(21, when.Hour);
            Assert.AreEqual(39, when.Minute);
            Assert.AreEqual(30, when.Second);
            Assert.AreEqual(Offset.FromHours(-7), when.Offset);
        }

        /// <summary>
        /// Pacific time changed from -7 to -8 at 2am wall time on November 2nd 2009,
        /// so 2am became 1am.
        /// </summary>
        [Test]
        public void AtStrictly_ThrowsWhenAmbiguous()
        {
            Assert.Throws<AmbiguousTimeException>(() => Pacific.AtStrictly(new LocalDateTime(2009, 11, 1, 1, 30, 0)));
        }

        /// <summary>
        /// Pacific time changed from -8 to -7 at 2am wall time on March 8th 2009,
        /// so 2am became 3am. This means that 2.30am doesn't exist on that day.
        /// </summary>
        [Test]
        public void AtStrictly_ThrowsWhenSkipped()
        {
            Assert.Throws<SkippedTimeException>(() => Pacific.AtStrictly(new LocalDateTime(2009, 3, 8, 2, 30, 0)));
        }

        /// <summary>
        /// Pacific time changed from -7 to -8 at 2am wall time on November 2nd 2009,
        /// so 2am became 1am. We'll return the earlier result, i.e. with the offset of -7
        /// </summary>
        [Test]
        public void AtLeniently_AmbiguousTime_ReturnsEarlierMapping()
        {
            var local = new LocalDateTime(2009, 11, 1, 1, 30, 0);
            var zoned = Pacific.AtLeniently(local);
            Assert.AreEqual(local, zoned.LocalDateTime);
            Assert.AreEqual(Offset.FromHours(-7), zoned.Offset);
        }

        /// <summary>
        /// Pacific time changed from -8 to -7 at 2am wall time on March 8th 2009,
        /// so 2am became 3am. This means that 2:30am doesn't exist on that day.
        /// We'll return 3:30am, the forward-shifted value.
        /// </summary>
        [Test]
        public void AtLeniently_ReturnsForwardShiftedValue()
        {
            var local = new LocalDateTime(2009, 3, 8, 2, 30, 0);
            var zoned = Pacific.AtLeniently(local);
            Assert.AreEqual(new LocalDateTime(2009, 3, 8, 3, 30, 0), zoned.LocalDateTime);
            Assert.AreEqual(Offset.FromHours(-7), zoned.Offset);
        }

        [Test]
        public void ResolveLocal()
        {
            // Don't need much for this - it only delegates.
            var ambiguous = new LocalDateTime(2009, 11, 1, 1, 30, 0);
            var skipped = new LocalDateTime(2009, 3, 8, 2, 30, 0);
            Assert.AreEqual(Pacific.AtLeniently(ambiguous), Pacific.ResolveLocal(ambiguous, Resolvers.LenientResolver));
            Assert.AreEqual(Pacific.AtLeniently(skipped), Pacific.ResolveLocal(skipped, Resolvers.LenientResolver));
        }
    }
}


text:
var mongoose = require('mongoose');

// define Test model
// module.exports allows us to pass this to other files when it is called
module.exports = mongoose.model('Message', {
  text: String,
  name: String,
  email: String,
  phone: String,
  date: Date
});


text:
"""\
"""

import select
import socket
import sys
import errno
import random
import time
import os
import logging

import guild
from guild.actor import *

debug = False

for actor_class_name in ["Selector", "TCPServer", "RawConnectionHandler","EchoServer"]:
    logger = logging.getLogger(__name__ +"." + actor_class_name)
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    logger.addHandler(ch)

def Print(*args):
    if debug:
        sys.stderr.write(" ".join([str(x) for x in args]))
        sys.stderr.write("\n")
        sys.stderr.flush()

#NOTE: Initially the aim here is convenience. Things could be improved.
class Selector(Actor):
    """
    Purpose:
        Handle notifications regarding activity on non-blocking sockets.

    Constructor call:
        Selector()          # No arguments

    Primary Thread behaviour:
        * Wait for activity on any of the sockets
            * Notify socket handler via appropriate callback
            * Remove caller - (Prevents mutiple notifications for same event)

    Shutdown Behaviour:
        Just exits.
        Does not attempt to shutdown anything else, or notify anything else

    Actor methods:
        selector.add_reader(sock, read_ready_notification_callback)
        selector.add_writer(sock, write_ready_notification_callback)
        selector.add_exceptional(sock, exceptional_notification_callback)

    Actor Functions:
        These are actor functions to prevent a race hazard.

        selector.remove_reader(sock)
        selector.remove_writer(sock)
        selector.remove_exceptional(sock)

        You may want to do these when your protocol shuts down.
        These are safe to call if the selector is not managing your socket

    Config options:
        Selector.SELECT_TIMEOUT = 0.05 (Effectively responsiveness to actor
                                        methods/functions is dictated by this)
    """
    SELECT_TIMEOUT = 0.05
    def __init__(self):
        super(Selector,self).__init__()
        self.readers = {}
        self.writers = {}
        self.exceptionals = {}

    @actor_function
    def remove_reader(self, sock):
        try:
            del self.readers[sock]
        except KeyError:
            Print("WARNING - attempt to remove same socket twice", sock)

    @actor_function
    def remove_writer(self, sock):
        try:
            del self.writers[sock]
        except KeyError:
            Print("WARNING - attempt to remove same socket twice", sock)

    @actor_function
    def remove_exceptional(self, sock):
        try:
            del self.exceptionals[sock]
        except KeyError:
            Print("WARNING - attempt to remove same socket twice", sock)

    @actor_method
    def add_reader(self, sock, callback):
        self.readers[sock] = callback

    @actor_method
    def add_writer(self, sock, callback):
        self.writers[sock] = callback

    @actor_method
    def add_exceptional(self, sock, callback):
        self.exceptionals[sock] = callback

    def main(self):
        self.readers_busy = {}

        while True:
            yield 1
            # NOTE: This could be improved.
            readers = self.readers.keys()
            writers = self.writers.keys()
            exceptionals = self.exceptionals.keys()
            readers_ready, writers_ready, exceptionals_ready = select.select(readers, writers, exceptionals, self.SELECT_TIMEOUT)
            for sock in readers_ready:
                callback = self.readers[sock]
                del self.readers[sock]  # Always delete after notifying - means this no longer requires an actor function
                callback()
                yield 1
            for sock in writers_ready:
                callback = self.writers[sock]
                del self.writers[sock]  # Always delete after notifying - means this no longer requires an actor function
                callback()
                yield 1
            for sock in exceptionals_ready :
                callback = self.exceptionals[sock]
                del self.exceptionals[sock]  # Always delete after notifying - means this no longer requires an actor function
                callback()
                yield 1
            yield 1

    def onStop(self):
        # Print("Selector STOPPING")
        pass

# FIXME: This should really be a service

selector = None

def get_selector():
    global selector
    if selector:
        return selector
    selector = Selector()
    start(selector)
    return selector

def stop_selector():
    stop(selector)

def waitfor_selector():
    wait_for(selector)

#
# Kinda similar to the old Kamaelia.Internet.ConnectedSocketAdapter
#
class RawConnectionHandler(Actor):
    """
    Purpose:

        Directly manage talking an active socket

    Constructor call:

        RawConnectionHandler(client_sock, addr, on_exit_cb [, selector] )

        client_sock - a socket that has "someone" connected to the other end.
        addr - address connection info
        on_exit_cb - callback to call when this handler stops
        selector - selector to use [optional]

        Note for a server:

            client_sock, addr = server_socket.accept()

    Primary Thread behaviour:

        At start up, asks the selector to notify it if there's data on
        the input, and is then event driven by actor methods and the
        public bindable API

    Shutdown Behaviour:

        Notifies the server (our creator) that the raw connection has exitted.
        It does this as follows:

            self.on_exit_cb(self)

    Actor methods:

        raw_connection_handler.read_from_socket()
        raw_connection_handler.handle_socket_read_ready()

            NOTE: Perhaps should be called "read_from_socket"
            NOTE: Perhaps should be called "handle_socket_read_ready"

            NOTE: This is really about the socket being ready for reading

                - Or perhaps split into two names?
                - One that handles the message, one that does the work
                - That would be nice, and probably make most sense

            Triggered by the selector when there is data on the socket for
            us to handle. Effectively does this:

                data = self.client_sock.recv(SIZE)
                if success:
                    # Emit via "from_connection" :
                    self.from_connection(data)
                    Add ourselves to the selector again
                if retryable failure:
                    Add ourselves to the selector again
                if fatal failure:
                    Shutdown / Stop

        raw_connection_handler.write_to_socket()
        raw_connection_handler.handle_socket_write_ready()

            NOTE: The reason the client doesn't bind to this is because this
            is really about the socket being ready to send.

                - Or perhaps split into two names?
                - One that handles the message, one that does the work
                - That would be nice, and probably make most sense

            Triggered whenever there is data to send, specifically::
                - when there's an external API call for "to_connection"
                - when we've tried sending but could not empty the buffer

            Logic:  (NOTE: isn't actually this but probably should be(!))
                If outbuffer is empty:
                    return

                while chunks in self.outbuffer:
                    length_sent = self.client_sock.send(chunk)
                    if fatal error:
                        shutdown/stop
                    if retryable error:
                        requeue (at start) the chunk (or part of chunk) to send
                        break out of Loop

                if outbuffer is not empty: # This should be the case
                    Add ourselves to the selector again to resend

    Other methods:

        self.add_reader_to_selector()
            Used internally to ask the selector to nofify the RCH when there is data to
            be read

        self.add_writer_to_selector()
            selector.add_writer(self.client_sock, self.data_to_client)

    External BINDable API:

        raw_connection_handler.from_connection(chunk)  [ intended to late bound FROM ]

            Called whenever there is any data from the connection.
            If unbound, then the data is lost.

        raw_connection_handler.to_connection(chunk)    [ intended to late bound TO ]

            When called, data is buffer in an outbuffer
            The selector is then asked to notify us when the socket is ready to write to

        given rch ISA RawConnectionHandler (from somewhere)
              ph  ISA protocol_handler

        Bind data from the connection to our protocol handler

            rch.bind("from_connection", ph, "from_connection")

        Bind data from the protocol handler to our connection

            ph.bind("to_connection", rch, "to_connection")

    """
    def __init__(self, client_sock, addr, on_exit_cb, selector=None):
        super(RawConnectionHandler, self).__init__()
        self.client_sock = client_sock
        self.addr = addr
        self.selector = selector
        self.buffer = []            # FIXME: TO BE DELETED
        self.outbuffer = []
        self.on_exit_cb = on_exit_cb
        self.send_open = True
        self.recv_open = True

    def onStop(self):
        # Print("Notify the Server that Raw Connection has exitted.")
        cb = self.on_exit_cb
        cb(self)

    @actor_method
    def handle_socket_read_ready(self):
        self.read_from_socket()

    def read_from_socket(self):
        try:
            data = self.client_sock.recv(100)
            while len(data) != 0:              # while data
                # Otherwise OK - pass data on
                self.from_connection(data)
                data = self.client_sock.recv(100)
        except socket.error as e:
            if e.errno == errno.EAGAIN:
                # FAIL, wait again
                self.add_reader_to_selector()
                return
            if e.errno == errno.EWOULDBLOCK:
                # FAIL, wait again
                self.add_reader_to_selector()
                return

        if len(data) == 0:
            Print("CLIENT HAS GONE AWAY")
            Print("Exitting")
            self.client_sock.close()
            self.client_sock = None
            self.stop()
            return

        # All data passed on, or error, or disconnect, so done
        # Re-add self to selector to say we've read all the data

        self.add_reader_to_selector()

    def add_reader_to_selector(self):
        selector.add_reader(self.client_sock, self.handle_socket_read_ready)

    def add_writer_to_selector(self):
        selector.add_writer(self.client_sock, self.handle_socket_write_ready)

    def process_start(self):
        if self.selector is None:
            self.selector = get_selector()
        self.add_reader_to_selector()

    @actor_method
    def handle_socket_write_ready(self):
        self.write_to_socket()

    def write_to_socket(self):
        if len(self.outbuffer) == 0: # Shouldn't be able to get here, but there are odd edge cases
            return

        while len(self.outbuffer) > 0:
            chunk = self.outbuffer.pop(0)
            Print("Chunk to send", len(chunk))
            try:
                bytes_sent = self.client_sock.send(chunk)
            except socket.error as e:   # e.errno ; e.errmsg:
                if e.errno == errno.EAGAIN:
                    # FAIL, wait again
                    x.insert(0, chunk)
                    self.add_writer_to_selector()
                    return

                if e.errno == errno.EWOULDBLOCK:
                    # FAIL, wait again
                    x.insert(0, chunk)
                    self.add_writer_to_selector()
                    return
                Print("Unexpected error sending. Disconnect client")
                self.stop()

            if len(chunk) == bytes_sent:
                Print("Chunk send success")
                # if len(self.outbuffer) > 0:  # Guaranteed by the loop we're in
                #     self.add_writer_to_selector()
                # return
            else:
                Print("Chunk send almost success, actually sent", bytes_sent, "vs",  len(chunk))
                # Did not manage to send all the data from this chunk. Try again in a moment with the rest
                still_to_send = chunk[bytes_sent:]
                x.insert(0, chunk)
                self.add_writer_to_selector()

        Print("All chunks sent")

    # Public Interface
    @late_bind_safe
    def from_connection(self, chunk):
        pass

    # Public Interface
    @actor_method
    def to_connection(self, chunk):
        Print("Data to connection", repr(chunk))
        self.outbuffer.append(chunk)
        self.add_writer_to_selector()

# Kinda similar to Kamaelia.Internet.TCPServer
class TCPServer(Actor):

    maxlisten = 5
    socketOptions = [socket.SOL_SOCKET, socket.SO_REUSEADDR, 1]
    HOST=''
    PORT = 54321

    def __init__(self, selector=None, nonblocking=False,
                       host=None, port=None, socketOptions=None, maxlisten=None):
        super(TCPServer, self).__init__()
        self.handlers = []
        self.nonblocking = nonblocking
        self.selector = selector
        self.server_socket = None

        # Local overrides
        if host:
            self.HOST = host
        if port:
            self.PORT = port
        if socketOptions:
            self.socketOptions = socketOptions
        if maxlisten:
            self.maxlisten = maxlisten

    def add_reader_to_selector(self):
        selector.add_reader(self.server_socket, self.new_connection)

    def process_start(self):
        if self.selector is None:
            self.selector = get_selector()

        self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        if self.socketOptions:
            self.server_socket.setsockopt(*self.socketOptions)

        if self.nonblocking:
            self.server_socket.setblocking(0)   # For the moment, do blocking

        self.server_socket.bind( (self.HOST, self.PORT) )
        self.server_socket.listen(self.maxlisten)

        self.add_reader_to_selector()
        Print("TCP LISTENING", (self.HOST, self.PORT))

    def server_stats(self):
        Print("Number of active connections", len(self.handlers))

    # NOTE: This is an actor function because otherwise the selector implementation needs to be more complex.
    #       in particular, the select call will repeatedly exit until we accept the connection
    @actor_method
    def new_connection(self):
        client_sock, addr = self.server_socket.accept()                         # Could fail

        client_sock.setblocking(0)   # For the moment, do blocking
        c = RawConnectionHandler(client_sock, addr, self.on_client_disconnect)
        self.handlers.append(c)
        self.add_reader_to_selector()  # Handled connection, so re-add us

        #

        self.wire_up_new_connection(c)

        self.server_stats()

    @actor_method
    def on_client_disconnect(self, handler):
        self.notify_protocol_on_client_disconnect(handler)
        if handler in self.handlers:
            i = self.handlers.index(handler)
            del self.handlers[i]
        self.server_stats()

    def onStop(self):
        self.server_stats()
        stop(*self.handlers)
        wait_for(*self.handlers)

    # Public Interface
    @late_bind_safe
    def wire_up_new_connection(self, connection):
        Print("Wire up new connection", connection)
        pass

    @late_bind_safe
    def notify_protocol_on_client_disconnect(self, connection):
        Print("Notify protocol on client disconnect", connection)
        pass

class ServerCore(Actor):
    server_options = { "host" : None,
                       "port" : None,
                       "socketOptions" : None,
                       "maxlisten" : None }
    base_server = TCPServer
    protocol_class = None
    def __init__(self, server_options=None, protocol_class=None, base_server=None):
        super(ServerCore, self).__init__()
        self.active_connections = {}
        self.tcpserver = None
        if server_options is not None:
            options = {}
            options.update(self.server_options)
            options.update(server_options)
            self.server_options = options

        if protocol_class is not None:
            self.protocol_class = protocol_class
        if base_server is not None:
            self.base_server = base_server

    @actor_method
    def new_connection(self, raw_connection_handler):

        rch = raw_connection_handler
        protocol_handler = (self.protocol_class)()

        rch.bind("from_connection", protocol_handler , "input")
        protocol_handler.bind("output", rch, "to_connection")

        self.active_connections[rch] = protocol_handler

        protocol_handler.start()
        rch.start()

    @actor_method
    def disconnection(self, raw_connection_handler):

        rch = raw_connection_handler

        rch.stop()
        protocol_handler = self.active_connections[rch]
        del self.active_connections[rch]

        protocol_handler.stop()

    def process_start(self):
        self.tcpserver = (self.base_server)(**self.server_options)

        self.tcpserver.bind("wire_up_new_connection",               self, "new_connection")
        self.tcpserver.bind("notify_protocol_on_client_disconnect", self, "disconnection")

        start(self.tcpserver)

    def onStop(self):
        Print("Next: STOP TCP SERVER", self.tcpserver)
        stop(self.tcpserver)

        Print("Next: WAITFOR TCP SERVER", self.tcpserver)
        wait_for(self.tcpserver)

class MulticastTransceiver(Actor):
    def __init__(self):
        # Multicast address and port we join
        self.local_addr = "224.0.0.123"
        self.local_port = 5040

        # Multicast address and port we send to (may be same)
        self.remote_addr = "224.0.0.123"
        self.remote_port = 5040

        self.tosend = []  # Not Yet...
        self.sock = None
        super(MulticastTransceiver, self).__init__()

    def process_start(self):
        sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM,
                                             socket.IPPROTO_UDP)
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

        # Receive from server on this port
        sock.bind((self.local_addr, self.local_port))

        sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 255)

        status = sock.setsockopt(socket.IPPROTO_IP,
                                 socket.IP_ADD_MEMBERSHIP,
                                 socket.inet_aton(self.remote_addr) + socket.inet_aton("0.0.0.0"))

        sock.setblocking(0)

        self.sock = sock   # Now effectively signifes ready...

    @process_method
    def process(self):
        try:
            data, addr = self.sock.recvfrom(16384)
        except socket.error:
            e = sys.exc_info()[1]
        else:
            message = (addr, data)
            self.output(message, time.time())

        remote_socket_spec = (self.remote_addr, self.remote_port)
        while len(self.tosend) > 0:
            try:
                l = self.sock.sendto(self.tosend[0], remote_socket_spec)
                del self.tosend[0]
            except socket.error:
                # show
                # break out the loop, since we can't send right now
                e = sys.exc_info()[1]
                break

    @actor_method
    def input(self, data):
        self.tosend.append(data)

    @late_bind
    def output(self, data, timestamp):
        pass

if __name__ == "__main__":
    # No demo code at present
    pass


text:
using System;

public static class Program
{
	public const int other = 98;

    [Flags]
    enum ColorsFlag {Red = 2, Blue = 4, Green = Red|Blue, Purple = 16};

    enum Colors {Red = 2, Blue = 4, Green = Red|Blue, Purple = 16};

    public enum SimpleEnum : ushort
    {
        Value1 = 1,
        Value2 = (ushort)(Value1 + 6 * other),
        Value3 = 3,
    }

    public static void Method1(SimpleEnum e)
    {
        System.Console.WriteLine((int)e);
    }

    public static void PrintEnum(SimpleEnum e)
    {

        switch (e)
        {
            case SimpleEnum.Value1:
                Console.Write("Value 1 = ");

                break;
            case SimpleEnum.Value2:
                Console.Write("Value 2 = ");
                break;

            case SimpleEnum.Value3:
                Console.Write("Value 3 = ");
                break;

            default:
                Console.Write("Unknown =");
                break;

        }
        Method1(e);
    }
    public static void Main()
    {
        var e = SimpleEnum.Value1;

        PrintEnum(e);

        e = SimpleEnum.Value2;

        PrintEnum(e);

        e = SimpleEnum.Value3;

        PrintEnum(e);

        Colors myColors = Colors.Red | Colors.Blue | Colors.Purple;
        Console.WriteLine("The value of this instance is '{0}'",
           myColors.ToString());

        ColorsFlag myColors2 = ColorsFlag.Red | ColorsFlag.Blue | ColorsFlag.Purple;
        Console.WriteLine("The value of this instance is '{0}'",
           myColors2.ToString());

       // Console.WriteLine(Enum.Parse(typeof(SimpleEnum),"Value3"));
		//TODO: Partially working
		/*foreach(var anenum in Enum.GetNames(typeof(SimpleEnum)))
		{
			Console.WriteLine(anenum);
		}*/
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">RC Car Controller</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_wait_for_connection">Waiting for Receiver</string>
    <string name="title_activity_welcome">RC Car Controller</string>
    <string name="title_activity_connect_to_proxy">Connect to RC Proxy</string>

</resources>