text:
package com.stc.pattysmorestuff.init;

import com.stc.pattysmorestuff.blocks.furnaces.*;
import com.stc.pattysmorestuff.lib.Strings;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.registries.IForgeRegistry;

/**
 * Created by StuffTheChicken on 21/07/2017.
 */
public class ModFurnaces {

    public static BlockIronFurnace iron_furnace = new BlockIronFurnace("iron_furnace", false);
    public static BlockIronFurnace iron_furnace_active = new BlockIronFurnace("iron_furnace_active", true);

    public static BlockGoldFurnace gold_furnace = new BlockGoldFurnace("gold_furnace", false);
    public static BlockGoldFurnace gold_furnace_active = new BlockGoldFurnace("gold_furnace_active", true);

    public static BlockDiamondFurnace diamond_furnace = new BlockDiamondFurnace("diamond_furnace", false);
    public static BlockDiamondFurnace diamond_furnace_active = new BlockDiamondFurnace("diamond_furnace_active", true);

    public static BlockEmeraldFurnace emerald_furnace = new BlockEmeraldFurnace("emerald_furnace", false);
    public static BlockEmeraldFurnace emerald_furnace_active = new BlockEmeraldFurnace("emerald_furnace_active", true);

    public static BlockObsidianFurnace obsidian_furnace = new BlockObsidianFurnace("obsidian_furnace", false);
    public static BlockObsidianFurnace obsidian_furnace_active = new BlockObsidianFurnace("obsidian_furnace_active", true);

    public static BlockUltimateFurnace ultimate_furnace = new BlockUltimateFurnace("ultimate_furnace", false);
    public static BlockUltimateFurnace ultimate_furnace_active = new BlockUltimateFurnace("ultimate_furnace_active", true);

    public static void registerBlocks(final IForgeRegistry<Block> event) {
        final Block[] blocks = {
                iron_furnace.setCreativeTab(ModTabs.tabPattysDecoration),
                iron_furnace_active,
                gold_furnace.setCreativeTab(ModTabs.tabPattysDecoration),
                gold_furnace_active,
                diamond_furnace.setCreativeTab(ModTabs.tabPattysDecoration),
                diamond_furnace_active,
                emerald_furnace.setCreativeTab(ModTabs.tabPattysDecoration),
                emerald_furnace_active,
                obsidian_furnace.setCreativeTab(ModTabs.tabPattysDecoration),
                obsidian_furnace_active,
                ultimate_furnace.setCreativeTab(ModTabs.tabPattysDecoration),
                ultimate_furnace_active
        };

        event.registerAll(blocks);
    }

    public static void registerItemBlocks(IForgeRegistry<Item> registry) {
        registry.registerAll(
                iron_furnace.createItemBlock(),
                iron_furnace_active.createItemBlock(),
                gold_furnace.createItemBlock(),
                gold_furnace_active.createItemBlock(),
                diamond_furnace.createItemBlock(),
                diamond_furnace_active.createItemBlock(),
                emerald_furnace.createItemBlock(),
                emerald_furnace_active.createItemBlock(),
                obsidian_furnace.createItemBlock(),
                obsidian_furnace_active.createItemBlock(),
                ultimate_furnace.createItemBlock(),
                ultimate_furnace_active.createItemBlock()
        );
    }

    public static void registerModels() {

        registerBlockRender(iron_furnace);
        registerBlockRender(iron_furnace_active);
        registerBlockRender(gold_furnace);
        registerBlockRender(gold_furnace_active);
        registerBlockRender(diamond_furnace);
        registerBlockRender(diamond_furnace_active);
        registerBlockRender(emerald_furnace);
        registerBlockRender(emerald_furnace_active);
        registerBlockRender(obsidian_furnace);
        registerBlockRender(obsidian_furnace_active);
        registerBlockRender(ultimate_furnace);
        registerBlockRender(ultimate_furnace_active);
    }

    public static void registerBlockRender(Block block) {
        Item item = Item.getItemFromBlock(block);
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Strings.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
    }

    public static void registerRender(Block block, int meta, String fileName) {
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(new ResourceLocation(Strings.MODID, fileName), "inventory"));
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.IO;
using System.Threading.Tasks;
using Roslyn.Test.Utilities;
using Xunit;
using Microsoft.CodeAnalysis.Test.Utilities;
using System.Linq;

namespace Microsoft.CodeAnalysis.CompilerServer.UnitTests
{
    public class EndToEndDeterminismTest : TestBase
    {
        private readonly string _flags = "/deterministic+ /nologo /t:library /pdb:none";

        /// <summary>
        /// Compiles some source code and returns the bytes that were contained in the compiled DLL file.
        ///
        /// Each time that this function is called, it will be compiled in a different directory.
        ///
        /// The default flags are "/shared /deterministic+ /nologo /t:library".
        /// </summary>
        /// <param name="source"> The source code for the program that will be compiled </param>
        /// <returns> An array of bytes that were read from the compiled DLL</returns>
        private async Task<(byte[] assemblyBytes, string finalFlags)> CompileAndGetBytes(string source)
        {
            // Setup
            var tempDir = Temp.CreateDirectory();
            var srcFile = tempDir.CreateFile("test.cs").WriteAllText(source).Path;
            var outFile = srcFile.Replace("test.cs", "test.dll");

            try
            {
                string finalFlags = null;
                using (var serverData = await ServerUtil.CreateServer())
                {
                    finalFlags = $"{ _flags } /shared:{ serverData.PipeName } /pathmap:{tempDir.Path}=/ /out:{ outFile } { srcFile }";
                    var result = CompilerServerUnitTests.RunCommandLineCompiler(
                        CompilerServerUnitTests.CSharpCompilerClientExecutable,
                        finalFlags,
                        currentDirectory: tempDir);
                    if (result.ExitCode != 0)
                    {
                        AssertEx.Fail($"Deterministic compile failed \n stdout:  { result.Output }");
                    }
                    var listener = await serverData.Complete().ConfigureAwait(false);
                    Assert.Equal(CompletionData.RequestCompleted, listener.CompletionDataList.Single());
                }
                var bytes = File.ReadAllBytes(outFile);
                AssertEx.NotNull(bytes);

                return (bytes, finalFlags);
            }
            finally
            {
                File.Delete(srcFile);
                File.Delete(outFile);
            }
        }

        /// <summary>
        /// Runs CompileAndGetBytes twice and compares the output.
        /// </summary>
        /// <param name="source"> The source of the program that will be compiled </param>
        private async Task RunDeterministicTest(string source)
        {
            var (first, finalFlags1) = await CompileAndGetBytes(source);
            var (second, finalFlags2) = await CompileAndGetBytes(source);
            Assert.Equal(first.Length, second.Length);
            for (int i = 0; i < first.Length; i++)
            {
                if (first[i] != second[i])
                {
                    AssertEx.Fail($"Bytes were different at position { i } ({ first[i] } vs { second[i] }).  Flags used were (\"{ finalFlags1 }\" vs \"{ finalFlags2 }\")");
                }
            }
        }

        [Fact]
        public async Task HelloWorld()
        {
            var source = @"using System;
class Hello
{
    static void Main()
    {
        Console.WriteLine(""Hello, world."");
    }
}";

            await RunDeterministicTest(source);
        }

        [Fact]
        public async Task CallerInfo()
        {
            var source = @"using System;
class CallerInfo {
    public static void DoProcessing()
    {
        TraceMessage(""Something happened."");
    }
    public static void TraceMessage(string message,
            [System.Runtime.CompilerServices.CallerMemberName] string memberName = """",
            [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = """",
            [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0)
    {
        System.Diagnostics.Trace.WriteLine(""message: "" + message);
        System.Diagnostics.Trace.WriteLine(""member name: "" + memberName);
        System.Diagnostics.Trace.WriteLine(""source file path: "" + sourceFilePath);
        System.Diagnostics.Trace.WriteLine(""source line number: "" + sourceLineNumber);
    }
    static void Main() {
        DoProcessing();
    }
}";
            await RunDeterministicTest(source);
        }

        [Fact]
        public async Task AnonType()
        {
            var source = @"using System;
class AnonType {
    public static void Main() {
        var person = new { firstName = ""john"", lastName = ""Smith"" };
        var date = new { year = 2015, month = ""jan"", day = 5 };
        var color = new { red = 255, green = 125, blue = 0 };

        Console.WriteLine(person);
        Console.WriteLine(date);
        Console.WriteLine(color);
    }
}";
            await RunDeterministicTest(source);
        }

        [Fact]
        public async Task LineDirective()
        {
            var source = @"using System;
class CallerInfo {
    public static void TraceMessage(string message,
            [System.Runtime.CompilerServices.CallerMemberName] string memberName = """",
            [System.Runtime.CompilerServices.CallerFilePath] string sourceFilePath = """",
            [System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = 0)
    {
        System.Diagnostics.Trace.WriteLine(""message: "" + message);
        System.Diagnostics.Trace.WriteLine(""member name: "" + memberName);
        System.Diagnostics.Trace.WriteLine(""source file path: "" + sourceFilePath);
        System.Diagnostics.Trace.WriteLine(""source line number: "" + sourceLineNumber);
    }
    static void Main() {
        TraceMessage(""from main"");
#line 10 ""coolFile.cs""
        TraceMessage(""from the cool file"");
#line default
        TraceMessage(""back in main"");
    }
}";
            await RunDeterministicTest(source);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
/***************************************************//**
 * @file    OpticalBenchProtocolInterface.h
 * @date    Janaure 2015
 * @author  Ocean Optics, Inc., Kirk Clendinning, Heliospectra
 *
 * This is a simple interface for any protocol to implement
 * that provides a protocol-agnostic mechanism for accessing
 * Optical Bench Parameters on an Ocean Optics device.
 *
 * This does not extend Protocol or otherwise read involved
 * in that hierarchy because it might interfere with the
 * lookup process for readting a Protocol object to delegate
 * these methods to.  Worse, it could end up inheriting
 * twice from the same base class, which is just messy.
 *
 * LICENSE:
 *
 * SeaBreeze Copyright (C) 2015, Ocean Optics Inc
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *******************************************************/

#ifndef OPTICALBENCHPROTOCOLINTERFACE_H
#define OPTICALBENCHPROTOCOLINTERFACE_H

#include "common/SeaBreeze.h"
#include "common/buses/Bus.h"
#include <vector>
#include "common/exceptions/ProtocolException.h"
#include "common/protocols/ProtocolHelper.h"

namespace seabreeze {

    class OpticalBenchProtocolInterface : public ProtocolHelper {
    public:
        OpticalBenchProtocolInterface(Protocol *protocol);
        virtual ~OpticalBenchProtocolInterface();
        virtual std::string *readOpticalBenchID(const Bus &bus) = 0;
        virtual std::string *readOpticalBenchSerialNumber(const Bus &bus) = 0;
        virtual unsigned short int readOpticalBenchSlitWidthMicrons(const Bus &bus) = 0;
        virtual unsigned short int readOpticalBenchFiberDiameterMicrons(const Bus &bus) = 0;
    	virtual std::string *readOpticalBenchGrating(const Bus &bus) = 0;
        virtual std::string *readOpticalBenchFilter(const Bus &bus) = 0;
        virtual std::string *readOpticalBenchCoating(const Bus &bus) = 0;
    };

}

#endif /* OPTICALBENCHPROTOCOLINTERFACE_H */


text:
"""
PlugNPlay module

Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>,
      Brian Vinter <vinter@nbi.dk>, Rune M. Friborg <rune.m.friborg@gmail.com>.
See LICENSE.txt for licensing details (MIT License).
"""
import pycsp.current

@pycsp.current.process
def Identity(cin, cout):
    """Copies its input stream to its output stream, adding a one-place buffer
    to the stream."""
    while True:
        t = cin()
        cout(t)

@pycsp.current.process
def Prefix(cin, cout, prefix=None):
    t = prefix
    while True:
        cout(t)
        t = cin()

@pycsp.current.process
def Successor(cin, cout):
    """Adds 1 to the value read on the input channel and outputs it on the output channel.
    Infinite loop.
    """
    while True:
        cout(cin()+1)

@pycsp.current.process
def Delta2(cin, cout1, cout2):
    while True:
        msg = cin()
        pycsp.current.Alternation([{
            (cout1,msg):'cout2(msg)',
            (cout2,msg):'cout1(msg)'
            }]).execute()

@pycsp.current.process
def Plus(cin1, cin2, cout):
    while True:
        cout(cin1() + cin2())

@pycsp.current.process
def Tail(cin, cout):
    dispose = cin()
    while True:
        cout(cin())

@pycsp.current.process
def Pairs(cin, cout):
    pA, pB, pC = pycsp.current.Channel('pA'), pycsp.current.Channel('pB'), pycsp.current.Channel('pC')
    pycsp.current.Parallel(
        Delta2(cin, -pA, -pB),
        Plus(+pA, +pC, cout),
        Tail(+pB, -pC)
    )

@pycsp.current.process
def SkipProcess():
    pass

@pycsp.current.process
def Mux2(cin1, cin2, cout):
    alt = pycsp.current.Alternation([{cin1:None, cin2:None}])
    while True:
        guard, msg = alt.select()
        cout(msg)


text:
using RabbitMQ.Client;
using RestBus.Common.Amqp;
using RestBus.RabbitMQ.ChannelPooling;
using System;
using System.Collections.Generic;
using System.Threading;

namespace RestBus.RabbitMQ.Client
{
    internal class ConnectionManager : IDisposable
    {
        volatile AmqpChannelPooler _clientPool;
        volatile bool _disposed;
        readonly ConnectionFactory connectionFactory;
        readonly object connectionSync = new object();

        public ConnectionManager(IList<AmqpConnectionInfo> serverUris)
        {
            //Map request to RabbitMQ Host and exchange,
            this.connectionFactory = new ConnectionFactory();
            connectionFactory.Uri = serverUris[0].Uri;
            connectionFactory.RequestedHeartbeat = RPCStrategyHelpers.HEART_BEAT;
        }

        public AmqpChannelPooler GetConnectedPool()
        {
            return ConnectIfUnconnected();
        }

        private AmqpChannelPooler ConnectIfUnconnected()
        {
            var pool = _clientPool;
            if (pool == null || pool.Connection  == null || !pool.Connection.IsOpen || pool.GetRecycle())
            {
                lock (connectionSync)
                {
                    if (_disposed) throw new ObjectDisposedException(GetType().FullName);

                    if (_clientPool == null || _clientPool.Connection == null || !_clientPool.Connection.IsOpen || _clientPool.GetRecycle())
                    {
                        return CreateNewChannelPool();
                    }
                    else
                    {
                        return _clientPool;
                    }
                }
            }

            return pool;
        }

        private AmqpChannelPooler CreateNewChannelPool()
        {
            //NOTE: This is the only place where connections are created in the client
            //NOTE: CreateConnection() can always throw RabbitMQ.Client.Exceptions.BrokerUnreachableException
            var newConn = connectionFactory.CreateConnection();

            //Swap out client connection and pooler, so other threads can use the new objects:

            //swap out old pool with new pool
            var newPool = new AmqpChannelPooler(newConn);
            var oldpool = Interlocked.Exchange(ref _clientPool, newPool);

            //Dispose old pool
            if (oldpool != null)
            {
                oldpool.Dispose();
            }

            return newPool;
        }

        public void Dispose()
        {
            _disposed = true;
            lock(connectionSync)
            {
                if(_clientPool != null)
                {
                    _clientPool.Dispose();
                }
            }
        }
    }
}


text:
ping=`host $instance_name.tater.io 8.8.8.8 | grep -o "not found"`
while [ "$ping" ]
do
  echo $ping
  sleep 60
  ping=`host $instance_name.tater.io 8.8.8.8 | grep -o "not found"`
done

phantomjs --ssl-protocol=any --web-security=false --ignore-ssl-errors=true jenkins/seedDatabase.js "http://$instance_name.tater.io/seed?fullName=$full_name&emailAddress=$email_address&orgName=$organization_name&tenantName=$instance_name&stripeCustomerId=$stripe_customer_id"


text:
var isNative = require('lodash._isnative');

/** Used to detect functions containing a `this` reference */
var reThis = /\bthis\b/;

/**
 * An object used to flag environments features.
 *
 * @static
 * @memberOf _
 * @type Object
 */
var support = {};

/**
 * Detect if functions can be decompiled by `Function#toString`
 * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps).
 *
 * @memberOf _.support
 * @type boolean
 */
support.funcDecomp = !isNative(global.WinRTError) && reThis.test(function() { return this; });

/**
 * Detect if `Function#name` is supported (all but IE).
 *
 * @memberOf _.support
 * @type boolean
 */
support.funcNames = typeof Function.name == 'string';

module.exports = support;


text:
/**
 * A class which encapsulates a range of columns defining a selection in a grid.
 * @since 5.1.0
 */
Ext.define('Ext.grid.selection.Columns', {
    extend: 'Ext.grid.selection.Selection',

    type: 'columns',

    /**
     * @property {Boolean} isColumns
     * This property indicates the this selection represents selected columns.
     * @readonly
     */
    isColumns: true,

    //-------------------------------------------------------------------------
    // Base Selection API

    clone: function() {
        var me = this,
            result = new me.self(me.view),
            columns = me.selectedColumns;

        if (columns) {
            result.selectedColumns = Ext.Array.slice(columns);
        }
        return result;
    },

    eachRow: function (fn, scope) {
        var columns = this.selectedColumns;

        if (columns && columns.length) {
            this.view.dataSource.each(fn, scope || this);
        }
    },

    eachColumn: function (fn, scope) {
        var me = this,
            view = me.view,
            columns = me.selectedColumns,
            len,
            i,
            context = new Ext.grid.CellContext(view);

        if (columns) {
            len = columns.length;
            for (i = 0; i < len; i++) {
                context.setColumn(columns[i]);
                if (fn.call(scope || me, context.column, context.colIdx) === false) {
                    return false;
                }
            }
        }
    },

    eachCell: function (fn, scope) {
        var me = this,
            view = me.view,
            columns = me.selectedColumns,
            len,
            i,
            context = new Ext.grid.CellContext(view);

        if (columns) {
            len = columns.length;

            // Use Store#each instead of copying the entire dataset into an array and iterating that.
            view.dataSource.each(function(record) {
                context.setRow(record);
                for (i = 0; i < len; i++) {
                    context.setColumn(columns[i]);
                    if (fn.call(scope || me, context, context.colIdx, context.rowIdx) === false) {
                        return false;
                    }
                }
            });
        }
    },

    //-------------------------------------------------------------------------
    // Methods unique to this type of Selection

    /**
     * Returns `true` if the passed {@link Ext.grid.column.Column column} is selected.
     * @param {Ext.grid.column.Column} column The column to test.
     * @return {Boolean} `true` if the passed {@link Ext.grid.column.Column column} is selected.
     */
    contains: function(column) {
        var selectedColumns = this.selectedColumns;

        if (column && column.isColumn && selectedColumns && selectedColumns.length) {
            return Ext.Array.contains(selectedColumns, column);
        }

        return false;
    },

    /**
     * Returns the number of columns selected.
     * @return {Number} The number of columns selected.
     */
    getCount: function() {
        var selectedColumns = this.selectedColumns;
        return selectedColumns ? selectedColumns.length : 0;
    },

    /**
     * Returns the columns selected.
     * @return {Ext.grid.column.Column[]} The columns selected.
     */
    getColumns: function() {
        return this.selectedColumns || [];
    },

    //-------------------------------------------------------------------------

    privates: {
        /**
         * Adds the passed Column to the selection.
         * @param {Ext.grid.column.Column} column
         * @private
         */
        add: function(column) {
            //<debug>
            if (!column.isColumn) {
                Ext.Error.raise('Column selection must be passed a grid Column header object');
            }
            //</debug>

            Ext.Array.include((this.selectedColumns || (this.selectedColumns = [])), column);
            this.refreshColumns(column);
        },

        /**
         * @private
         */
        clear: function() {
            var me = this,
                prevSelection = me.selectedColumns;

            if (prevSelection && prevSelection.length) {
                me.selectedColumns = [];
                me.refreshColumns.apply(me, prevSelection);
            }
        },

        /**
         * @return {Boolean}
         * @private
         */
        isAllSelected: function() {
            var selectedColumns = this.selectedColumns;

            // All selected means all columns, across both views if we are in a locking assembly.
            return selectedColumns && selectedColumns.length === this.view.ownerGrid.getVisibleColumnManager().getColumns().length;
        },

        /**
         * @private
         */
        refreshColumns: function(column) {
            var me = this,
                view = me.view,
                rows = view.all,
                rowIdx,
                columns = arguments,
                len = columns.length,
                colIdx,
                cellContext = new Ext.grid.CellContext(view),
                selected = [];

            if (view.rendered) {
                for (colIdx = 0; colIdx < len; colIdx++) {
                    selected[colIdx] = me.contains(columns[colIdx]);
                }

                for (rowIdx = rows.startIndex; rowIdx <= rows.endIndex; rowIdx++) {
                    cellContext.setRow(rowIdx);
                    for (colIdx = 0; colIdx < len; colIdx++) {
                        // Note colIdx is not the column's visible index. setColumn must be passed the column object
                        cellContext.setColumn(columns[colIdx]);
                        if (selected[colIdx]) {
                            view.onCellSelect(cellContext);
                        } else {
                            view.onCellDeselect(cellContext);
                        }
                    }
                }
            }
        },

        /**
         * Removes the passed Column from the selection.
         * @param {Ext.grid.column.Column} column
         * @private
         */
        remove: function(column) {
            //<debug>
            if (!column.isColumn) {
                Ext.Error.raise('Column selection must be passed a grid Column header object');
            }
            //</debug>

            if (this.selectedColumns) {
                Ext.Array.remove(this.selectedColumns, column);
                this.refreshColumns(column);
            }
        },

        /**
         * @private
         */
        selectAll: function () {
            var me = this;

            me.clear();
            me.selectedColumns = me.view.getVisibleColumnManager().getColumns();
            me.refreshColumns.apply(me, me.selectedColumns);
        }
    }
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Take.Elephant.Memory;
using Xunit;

namespace Take.Elephant.Tests.Memory
{
    [Trait("Category", nameof(Memory))]
    public class MemoryGuidItemKeyValueSetMapQueryableStorageFacts : QueryableStorageFacts<KeyValuePair<Guid, Item>>
    {
        public override async Task<IQueryableStorage<KeyValuePair<Guid, Item>>> CreateAsync(params KeyValuePair<Guid, Item>[] values)
        {
            var setMap = new SetMap<Guid, Item>();

            foreach (var keyValuePair in values)
            {
                await setMap.AddItemAsync(keyValuePair.Key, keyValuePair.Value);
            }

            return setMap;
        }

        public override Expression<Func<KeyValuePair<Guid, Item>, bool>> CreateFilter(KeyValuePair<Guid, Item> value)
        {
            var randomGuid = Guid.NewGuid();

            return
                i =>
                    i.Key != randomGuid &&
                    i.Key.Equals(value.Key) &&
                    i.Value.GuidProperty == value.Value.GuidProperty &&
                    i.Value.IntegerProperty.Equals(value.Value.IntegerProperty) &&
                    i.Value.IntegerProperty != -11241213 &&
                    i.Value.StringProperty.Equals(value.Value.StringProperty);
        }
    }
}


text:
package com.htmlhifive.pitalium.core.selenium;

import java.net.URL;

import org.openqa.selenium.remote.CommandExecutor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.htmlhifive.pitalium.common.exception.TestRuntimeException;

/**
 * iPadのSafariで利用する{@link org.openqa.selenium.WebDriver}
 */
class PtlIPadDriver extends PtlIPhoneDriver {

	private static final Logger LOG = LoggerFactory.getLogger(PtlIPadDriver.class);

	private final int headerHeight;

	/**
	 * コンストラクタ
	 *
	 * @param remoteAddress RemoteWebDriverServerのアドレス
	 * @param capabilities Capability
	 */
	PtlIPadDriver(URL remoteAddress, PtlCapabilities capabilities) {
		super(remoteAddress, capabilities);

		Object headerHeightCapability = capabilities.getCapability("headerHeight");
		if (headerHeightCapability == null) {
			throw new TestRuntimeException("Capability \"headerHeight\" is required");
		} else {
			if (headerHeightCapability instanceof Number) {
				headerHeight = ((Number) headerHeightCapability).intValue();
			} else {
				headerHeight = Integer.parseInt(headerHeightCapability.toString());
			}
		}
	}

	/**
	 * コンストラクタ
	 *
	 * @param executor CommandExecutor
	 * @param capabilities Capability
	 */
	PtlIPadDriver(CommandExecutor executor, PtlCapabilities capabilities) {
		super(executor, capabilities);

		Object headerHeightCapability = capabilities.getCapability("headerHeight");
		if (headerHeightCapability == null) {
			throw new TestRuntimeException("Capability \"headerHeight\" is required");
		} else {
			if (headerHeightCapability instanceof Number) {
				headerHeight = ((Number) headerHeightCapability).intValue();
			} else {
				headerHeight = Integer.parseInt(headerHeightCapability.toString());
			}
		}
	}

	@Override
	protected int getHeaderHeight(long scrollTop) {

		int currentHeaderHeight = headerHeight;
		if (getWindowHandles().size() > 1) {
			// 複数タブが開かれている場合はタブバーも含めた高さ
			final long tabHeight = 66;
			currentHeaderHeight += tabHeight;
		} else if (scrollTop > 0) {
			// 最上部以外はヘッダを影ごと切り取る
			currentHeaderHeight += 2;
		}
		LOG.trace("(GetHeaderHeight) [{}] ({})", currentHeaderHeight, this);
		return currentHeaderHeight;
	}

	@Override
	protected int getFooterHeight(long scrollTop, double captureTop) {
		return 0;
	}

	@Override
	protected PtlWebElement newPtlWebElement() {
		return new PtlIPadWebElement();
	}

	@Override
	protected double calcVerticalScrollIncrementWithHeader(int imageHeight, double scale) {
		double scrollIncrement = super.calcVerticalScrollIncrementWithHeader(imageHeight, scale);
		// タブがないときはヘッダの影が1px写りこむため、スクロール幅を1px少なくする
		if (getWindowHandles().size() <= 1) {
			scrollIncrement -= 1;
		}
		LOG.trace("(CalcVerticalScrollIncrementWithHeader) (imageHeight: {}, scale: {}) => {}", imageHeight, scale,
				scrollIncrement);
		return scrollIncrement;
	}

	@Override
	protected int adjustTrimTop(int trimTop, double scale) {
		int trimHeight = 0;

		// スクロール幅をずらした分、切り取り位置を調整する
		if (getWindowHandles().size() <= 1) {
			trimHeight = (int) Math.round(1 * scale);
		}
		return trimTop - trimHeight;
	}
}


text:
app\controllers

ProgramController
=================

Сигнатура
---------

- **class**.
- Является подклассом класса `app\classes\Controller`.

Методы
-------

Методы класса class:

- [`getForm()`](#getForm) — Шаблон формы добавления/изменения объекта
- [`actionEdit()`](#actionEdit) — Форма редактирования программы
- [`actionGetInfo()`](#actionGetInfo) — Получить описание программы
- [`actionPut()`](#actionPut) — Создать новую программу
- [`actionGetList()`](#actionGetList) — Страница списка программ
- [`actionGetLaconicList()`](#actionGetLaconicList) — Список программ
- [`actionGetFullInfo()`](#actionGetFullInfo) — Страница программы для слушателей и админов

### `getForm()`

Шаблон формы добавления/изменения объекта

#### Сигнатура

- **protected** method.
- Может принимать следующий параметр(ы):
    - `$type` (`string`) — - тип формы ('put' - добавление или 'update' - изменение)
- Возвращает `app\controllers\QooizForm` value.
- Выбрасывает одно из следующих исключений:
    - `app\classes\ModelException`
    - `avtomon\FieldException`
    - `avtomon\SectionException`

### `actionEdit()`

Форма редактирования программы

#### Сигнатура

- **protected** method.
- Может принимать следующий параметр(ы):
    - `$id` (`int`) — - идентификатор модели
    - `$group_id` (`int`) — - идентификатор группы
- Возвращает `app\controllers\HTMLResultItem` value.
- Выбрасывает одно из следующих исключений:
    - [`Exception`](http://php.net/class.Exception)

### `actionGetInfo()`

Получить описание программы

#### Сигнатура

- **public** method.
- Может принимать следующий параметр(ы):
    - `$id` (`int`) — - идентификатор программы
    - `$account_id` (`int`) — - идентификатор учебного центра
- Возвращает `app\controllers\HTMLResultItem` value.
- Выбрасывает одно из следующих исключений:
    - [`app\controllers\ProgramControllerException`](../../app/controllers/ProgramControllerException.md)
    - [`Exception`](http://php.net/class.Exception)
    - `avtomon\AclessException`
    - `avtomon\PQSkaTplException`

### `actionPut()`

Создать новую программу

#### Сигнатура

- **private** method.
- Может принимать следующий параметр(ы):
    - `$args` (`array`) — - данные для создания программы
- Возвращает `string` value.
- Выбрасывает одно из следующих исключений:
    - [`Exception`](http://php.net/class.Exception)
    - `app\classes\ControllerException`
    - `app\classes\HelperException`

### `actionGetList()`

Страница списка программ

#### Сигнатура

- **public** method.
- Может принимать следующий параметр(ы):
    - `$search` (`string`) — - поисковая строка
    - `$searchModel` (`string`) — - систаксисом какого поисковика будем пользоваться
    - `$order` (`string`) — - сортировка вывода
    - `$orderDirection` (`string`) — - направление сортировки
    - `$limit` (`int`) — - количество выводимых программ
    - `$offset` (`int`) — - оффсет от начала списка
    - `$account_id` (`int`) — - идентификатор учебного центра
- Возвращает `app\controllers\AbstractResult` value.
- Выбрасывает одно из следующих исключений:
    - `app\controllers\ProgramException`
    - `app\classes\ModelException`
    - `avtomon\AbstractCacheItemException`
    - `avtomon\AclessException`
    - `avtomon\DbResultItemException`
    - `avtomon\PQSkaTplException`
    - `avtomon\searchSyntax2PgException`

### `actionGetLaconicList()`

Список программ

#### Сигнатура

- **public** method.
- Может принимать следующий параметр(ы):
    - `$limit` (`int`) — - количество выводимых программ
    - `$offset` (`int`) — - оффсет от начала списка
- Возвращает `app\controllers\DbResultItem` value.
- Выбрасывает одно из следующих исключений:
    - `app\controllers\ProgramException`
    - `app\classes\ModelException`
    - `avtomon\AbstractCacheItemException`
    - `avtomon\DbResultItemException`
    - `avtomon\searchSyntax2PgException`

### `actionGetFullInfo()`

Страница программы для слушателей и админов

#### Сигнатура

- **private** method.
- Может принимать следующий параметр(ы):
    - `$id` (`int`) — - идентификатор программы
    - `$group_id` (`int`) — - идентификатор группы
- Возвращает `app\controllers\HTMLResultItem` value.
- Выбрасывает одно из следующих исключений:
    - [`app\controllers\ProgramControllerException`](../../app/controllers/ProgramControllerException.md)
    - [`Exception`](http://php.net/class.Exception)
    - `app\classes\HelperException`
    - `avtomon\PQSkaTplException`


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Manual ident. rot fungi 44 (1956)

#### Original name
null

### Remarks
null


text:
'use strict';

var format = require('util').format;

module.exports = hookupPeerScoreObs;

function hookupPeerScoreObs(log, client, servers) {
    client.peerScoredEvent.on(onPeerScored);
    client.peerChosenEvent.on(onPeerChosen);

    function onPeerScored(info) {
        var peerDesc = describeServerPeer(servers, info.peer);
        var mess = format('%s scored peer %s', info.reason, peerDesc);
        if (info.scores) {
            var changes = info.scores.map(function each(score, i) {
                var change = score.hi / info.oldScores[i].hi - 1;
                var sign = change > 0 ? '+' : '';
                var str = sign + (100 * change).toFixed(1);
                return pad(5, ' ', str) + '%';
            });
            mess += ' by ' + changes.join(', ');
        } else {
            mess += ' score=' + info.score;
        }
        log(mess);
    }

    function onPeerChosen(info) {
        var peerDesc = describeServerPeer(servers, info.peer);
        var mess = format('%s chose server %s', info.mode, peerDesc);
        log(mess);
    }
}

function describeServerPeer(servers, peer) {
    for (var i = 0; i < servers.length; i++) {
        if (peer.hostPort === servers[i].hostPort) {
            return '' + (i + 1);
        }
    }
    return 'unknown(' + peer.hostPort + ')';
}

function pad(n, c, s) {
    while (s.length < n) {
        s = c + s;
    }
    return s;
}


text:
"""Contains logic for retrieving special methods.

This implementation does not rely on the dot attribute access
logic, found in ``.getattr()``. The difference between these two
is that the dunder methods are looked with the type slots
(you can find more about these here
http://lucumr.pocoo.org/2014/8/16/the-python-i-would-like-to-see/)
As such, the lookup for the special methods is actually simpler than
the dot attribute access.
"""
import itertools

import astroid
from astroid import exceptions

def _lookup_in_mro(node, name):
    attrs = node.locals.get(name, [])

    nodes = itertools.chain.from_iterable(
        ancestor.locals.get(name, []) for ancestor in node.ancestors(recurs=True)
    )
    values = list(itertools.chain(attrs, nodes))
    if not values:
        raise exceptions.AttributeInferenceError(attribute=name, target=node)

    return values

def lookup(node, name):
    """Lookup the given special method name in the given *node*

    If the special method was found, then a list of attributes
    will be returned. Otherwise, `astroid.AttributeInferenceError`
    is going to be raised.
    """
    if isinstance(
        node, (astroid.List, astroid.Tuple, astroid.Const, astroid.Dict, astroid.Set)
    ):
        return _builtin_lookup(node, name)
    if isinstance(node, astroid.Instance):
        return _lookup_in_mro(node, name)
    if isinstance(node, astroid.ClassDef):
        return _class_lookup(node, name)

    raise exceptions.AttributeInferenceError(attribute=name, target=node)

def _class_lookup(node, name):
    metaclass = node.metaclass()
    if metaclass is None:
        raise exceptions.AttributeInferenceError(attribute=name, target=node)

    return _lookup_in_mro(metaclass, name)

def _builtin_lookup(node, name):
    values = node.locals.get(name, [])
    if not values:
        raise exceptions.AttributeInferenceError(attribute=name, target=node)

    return values


text:
package uk.gov.hmrc.ct.computations

import uk.gov.hmrc.ct.box.{CtBoxIdentifier, CtOptionalInteger, Input}

case class CP33(value: Option[Int]) extends CtBoxIdentifier(name = "Profit/Losses on disposal of assets") with CtOptionalInteger with Input

object CP33 {

  def apply(int: Int): CP33 = CP33(Some(int))

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/Users/android/workspace/jenkins/workspace/fabric-android-deploy-to-staging/sdk/twitter/tweet-ui/src/main/res/values-ro/plurals.xml -->
    <eat-comment/>
    <plurals name="tw__time_hours">
        <item quantity="one">1 h</item>
        <item quantity="other">%d h</item>
    </plurals>
    <plurals name="tw__time_mins">
        <item quantity="one">1 m</item>
        <item quantity="other">%d m</item>
    </plurals>
    <plurals name="tw__time_secs">
        <item quantity="one">1 s</item>
        <item quantity="other">%d s</item>
    </plurals>
    <!-- From: file:/Users/android/workspace/jenkins/workspace/fabric-android-deploy-to-staging/sdk/twitter/tweet-ui/src/main/res/values-ro/strings.xml -->
    <eat-comment/>
    <string name="tw__loading_tweet">Se încarcă Tweetul</string>
    <string name="tw__retweeted_by_format">Redistribuit de %1$s</string>
    <string name="tw__share_content_format">Vezi Tweetul lui \@%1$s: https://twitter.com/%1$s/status/%2$s</string>
    <string name="tw__share_subject_format">Tweet de la %1$s (\@%2$s)</string>
    <string name="tw__share_tweet">Distribuie Tweetul</string>
    <string name="tw__tweet_content_description">%1$s. %2$s. %3$s.</string>
</resources>


text:
// Local Dependencies
import { isArray, isJson, isString, isUndefined } from './utils/is';
import { parseJson, stringify } from './utils/object';

// Configuration
import { $session } from './config';

export default (req, res, next) => {
  // Global vars
  const cookiePrefix = $session().cookiePrefix;
  const sessionData = parseSession();

  const options = {
    domain: $session().cookieDomain,
    path: $session().path,
    maxAge: new Date(Date.now() + $session().maxAge),
    httpOnly: $session().httpOnly
  };

  const deleteOptions = {
    domain: $session().cookieDomain,
    path: $session().path,
    httpOnly: $session().httpOnly
  };

  // Methods
  res.session = session;
  res.clearSession = clearSession;
  res.destroySessions = destroySessions;

  return next();

  /**
   * Parses the session and returns a JSon Object
   *
   * @returns {array} Sessions data
   */
  function parseSession() {
    const rVal = {};

    if (req.cookies) {
      Object.keys(req.cookies).forEach(key => {
        const sessionPrefix = new RegExp(`^${cookiePrefix}`);
        const isSessionCookie = key.search(sessionPrefix) !== -1;
        let value = req.cookies[key];

        if (isSessionCookie) {
          key = key.replace(sessionPrefix, '');

          if (isJson(value)) {
            value = parseJson(value);
          }

          rVal[key] = value;
        }
      });
    }

    return rVal;
  }

  /**
   * Get/set session data
   *
   * @param {string} key Key
   * @param {mixed} value Value
   * @returns {mixed} Session data if is a get
   */
  function session(key, value) {
    // required params missing
    if (!key && isUndefined(value)) {
      return sessionData;
    }

    // retrieve value
    if (!value) {
      return sessionData[key];
    }

    // set value
    sessionData[key] = value;

    // set cookie
    const cookieKey = cookiePrefix + key;
    const cookieValue = isString(value) ? value : stringify(value);

    return res.cookie(cookieKey, cookieValue, options);
  }

  /**
   * Clears session data
   *
   * @param {array} keys Keys
   * @returns {mixed} Session data if is a get
   */
  function clearSession(keys) {
    let cookieKey;
    const key = keys;

    if (isArray(keys)) {
      keys.forEach(key => {
        delete sessionData[key];

        cookieKey = `${cookiePrefix}${key}`;
        res.clearCookie(cookieKey, deleteOptions);
      });
    } else {
      delete sessionData[key];

      cookieKey = `${cookiePrefix}${key}`;
      res.clearCookie(cookieKey, deleteOptions);
    }
  }

  /**
   * Destroys all sessions
   *
   * @returns {object} null
   */
  function destroySessions() {
    let cookieKey;

    if (sessionData) {
      Object.keys(sessionData).forEach(key => {
        delete sessionData[key];

        cookieKey = `${cookiePrefix}${key}`;
        res.clearCookie(cookieKey, deleteOptions);
      });
    }

    return null;
  }
};


text:
#ifndef CNN_CUDA_H
#define CNN_CUDA_H
#if HAVE_CUDA

#include <cassert>
#include <utility>
#include <stdexcept>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cublas_v2.h>
#include <cudnn.h>
#include "cnn/except.h"
#include <curand.h>

#define CUDA_CHECK(stmt) do {                              \
    cudaError_t err = stmt;                                \
    if (err != cudaSuccess) {                              \
      std::cerr << "CUDA failure in " << #stmt << std::endl\
                << cudaGetErrorString(err) << std::endl;   \
      throw cnn::cuda_exception(#stmt);                    \
    }                                                      \
  } while(0)

#define CUBLAS_CHECK(stmt) do {                            \
    cublasStatus_t stat = stmt;                            \
    if (stat != CUBLAS_STATUS_SUCCESS) {                   \
      std::cerr << "CUBLAS failure in " << #stmt           \
                << std::endl << stat << std::endl;         \
      throw cnn::cuda_exception(#stmt);                    \
    }                                                      \
  } while(0)

namespace cnn {

inline std::pair<int,int> SizeToBlockThreadPair(int n) {
  assert(n);
/*
the following commented out for windows. need to figure out support for both windows and linux
-  int logn;
-  asm("\tbsr %1, %0\n"
-      : "=r"(logn)
-      : "r" (n-1));
 */
  int logn = (int) log(n);
  logn = logn > 9 ? 9 : (logn < 4 ? 4 : logn);
  ++logn;
  int threads = 1 << logn;
  int blocks = (n + threads - 1) >> logn;
  blocks = blocks > 128 ? 128 : blocks;
  return std::make_pair(blocks, threads);
}

void Free_GPU();
void Initialize_GPU(int& argc, char**& argv, unsigned random_seed, int device_id);

#define CHECK_CUDNN(status) if (status != CUDNN_STATUS_SUCCESS) { cuda_exception("status = " + status); }
#define CHECK_CURND(status) if (status != CURAND_STATUS_SUCCESS) { cuda_exception("status = " + status); }

extern cudnnDataType_t cudnnDataType;
extern cublasHandle_t cublas_handle;
extern cudnnHandle_t cudnn_handle;
extern curandGenerator_t curndGeneratorHandle;

} // namespace cnn

#endif
#endif


text:
package aima.core.agent.impl;

import aima.core.agent.Percept;

/**
 * @author Ravi Mohan
 * @author Ciaran O'Reilly
 * @author Mike Stampone
 */
public class DynamicPercept extends ObjectWithDynamicAttributes implements
		Percept {
	public DynamicPercept() {

	}

	@Override
	public String describeType() {
		return Percept.class.getSimpleName();
	}

	/**
	 * Constructs a DynamicPercept with one attribute
	 *
	 * @param key1
	 *            the attribute key
	 * @param value1
	 *            the attribute value
	 */
	public DynamicPercept(Object key1, Object value1) {
		setAttribute(key1, value1);
	}

	/**
	 * Constructs a DynamicPercept with two attributes
	 *
	 * @param key1
	 *            the first attribute key
	 * @param value1
	 *            the first attribute value
	 * @param key2
	 *            the second attribute key
	 * @param value2
	 *            the second attribute value
	 */
	public DynamicPercept(Object key1, Object value1, Object key2, Object value2) {
		setAttribute(key1, value1);
		setAttribute(key2, value2);
	}

	/**
	 * Constructs a DynamicPercept with an array of attributes
	 *
	 * @param keys
	 *            the array of attribute keys
	 * @param values
	 *            the array of attribute values
	 */
	public DynamicPercept(Object[] keys, Object[] values) {
		assert (keys.length == values.length);

		for (int i = 0; i < keys.length; i++) {
			setAttribute(keys[i], values[i]);
		}
	}
}


text:
import { isEmpty } from 'lodash-es';
import React, { EventHandler, SyntheticEvent } from 'react';
import { AutocompleteExposed, SearchState } from 'react-instantsearch-core';
import {
  Highlight,
  connectStateResults,
  connectAutoComplete
} from 'react-instantsearch-dom';
import EmptySearch from './empty-search';
import NoResults from './no-results';

import './search-page-hits.css';

type AllHitsProps = {
  handleClick?: EventHandler<SyntheticEvent>;
};

const AllHits: React.ComponentClass<AutocompleteExposed & AllHitsProps> =
  connectAutoComplete(({ hits, currentRefinement }) => {
    const isHitsEmpty = !hits.length;

    return currentRefinement && !isHitsEmpty ? (

          {hits.map(result => (

                  <Highlight attribute='title' hit={result} />

          ))}

    ) : (
      <NoResults query={currentRefinement} />
    );
  });

AllHits.displayName = 'AllHits';

const SearchHits = connectStateResults(
  ({
    handleClick,
    searchState
  }: {
    handleClick: EventHandler<SyntheticEvent>;
    searchState: SearchState;
  }) => {
    const isSearchEmpty = isEmpty(searchState) || isEmpty(searchState.query);

    return isSearchEmpty ? (
      <EmptySearch />
    ) : (
      <AllHits handleClick={handleClick} />
    );
  }
);

SearchHits.displayName = 'SearchHits';

export default SearchHits;


text:
package importer

import (
	"cmd/compile/internal/syntax"
	"cmd/compile/internal/typecheck"
	"cmd/compile/internal/types2"
	"encoding/binary"
	"fmt"
	"go/constant"
	"go/token"
	"io"
	"math/big"
	"sort"
	"strings"
)

type intReader struct {
	*strings.Reader
	path string
}

func (r *intReader) int64() int64 {
	i, err := binary.ReadVarint(r.Reader)
	if err != nil {
		errorf("import %q: read varint error: %v", r.path, err)
	}
	return i
}

func (r *intReader) uint64() uint64 {
	i, err := binary.ReadUvarint(r.Reader)
	if err != nil {
		errorf("import %q: read varint error: %v", r.path, err)
	}
	return i
}

// Keep this in sync with constants in iexport.go.
const (
	iexportVersionGo1_11   = 0
	iexportVersionPosCol   = 1
	iexportVersionGenerics = 2
	iexportVersionGo1_18   = 2

	iexportVersionCurrent = 2
)

type ident struct {
	pkg  *types2.Package
	name string
}

const predeclReserved = 32

type itag uint64

const (
	// Types
	definedType itag = iota
	pointerType
	sliceType
	arrayType
	chanType
	mapType
	signatureType
	structType
	interfaceType
	typeParamType
	instanceType
	unionType
)

const io_SeekCurrent = 1 // io.SeekCurrent (not defined in Go 1.4)

// iImportData imports a package from the serialized package data
// and returns the number of bytes consumed and a reference to the package.
// If the export data version is not recognized or the format is otherwise
// compromised, an error is returned.
func ImportData(imports map[string]*types2.Package, data, path string) (pkg *types2.Package, err error) {
	const currentVersion = iexportVersionCurrent
	version := int64(-1)
	defer func() {
		if e := recover(); e != nil {
			if version > currentVersion {
				err = fmt.Errorf("cannot import %q (%v), export data is newer version - update tool", path, e)
			} else {
				err = fmt.Errorf("cannot import %q (%v), possibly version skew - reinstall package", path, e)
			}
		}
	}()

	r := &intReader{strings.NewReader(data), path}

	version = int64(r.uint64())
	switch version {
	case iexportVersionGo1_18, iexportVersionPosCol, iexportVersionGo1_11:
	default:
		errorf("unknown iexport format version %d", version)
	}

	sLen := int64(r.uint64())
	dLen := int64(r.uint64())

	whence, _ := r.Seek(0, io_SeekCurrent)
	stringData := data[whence : whence+sLen]
	declData := data[whence+sLen : whence+sLen+dLen]
	r.Seek(sLen+dLen, io_SeekCurrent)

	p := iimporter{
		exportVersion: version,
		ipath:         path,
		version:       int(version),

		stringData:   stringData,
		pkgCache:     make(map[uint64]*types2.Package),
		posBaseCache: make(map[uint64]*syntax.PosBase),

		declData: declData,
		pkgIndex: make(map[*types2.Package]map[string]uint64),
		typCache: make(map[uint64]types2.Type),
		// Separate map for typeparams, keyed by their package and unique
		// name (name with subscript).
		tparamIndex: make(map[ident]*types2.TypeParam),
	}

	for i, pt := range predeclared {
		p.typCache[uint64(i)] = pt
	}

	pkgList := make([]*types2.Package, r.uint64())
	for i := range pkgList {
		pkgPathOff := r.uint64()
		pkgPath := p.stringAt(pkgPathOff)
		pkgName := p.stringAt(r.uint64())
		pkgHeight := int(r.uint64())

		if pkgPath == "" {
			pkgPath = path
		}
		pkg := imports[pkgPath]
		if pkg == nil {
			pkg = types2.NewPackageHeight(pkgPath, pkgName, pkgHeight)
			imports[pkgPath] = pkg
		} else {
			if pkg.Name() != pkgName {
				errorf("conflicting names %s and %s for package %q", pkg.Name(), pkgName, path)
			}
			if pkg.Height() != pkgHeight {
				errorf("conflicting heights %v and %v for package %q", pkg.Height(), pkgHeight, path)
			}
		}

		p.pkgCache[pkgPathOff] = pkg

		nameIndex := make(map[string]uint64)
		for nSyms := r.uint64(); nSyms > 0; nSyms-- {
			name := p.stringAt(r.uint64())
			nameIndex[name] = r.uint64()
		}

		p.pkgIndex[pkg] = nameIndex
		pkgList[i] = pkg
	}

	localpkg := pkgList[0]

	names := make([]string, 0, len(p.pkgIndex[localpkg]))
	for name := range p.pkgIndex[localpkg] {
		names = append(names, name)
	}
	sort.Strings(names)
	for _, name := range names {
		p.doDecl(localpkg, name)
	}

	// SetConstraint can't be called if the constraint type is not yet complete.
	// When type params are created in the 'P' case of (*importReader).obj(),
	// the associated constraint type may not be complete due to recursion.
	// Therefore, we defer calling SetConstraint there, and call it here instead
	// after all types are complete.
	for _, d := range p.later {
		d.t.SetConstraint(d.constraint)
	}
	// record all referenced packages as imports
	list := append(([]*types2.Package)(nil), pkgList[1:]...)
	sort.Sort(byPath(list))
	localpkg.SetImports(list)

	// package was imported completely and without errors
	localpkg.MarkComplete()

	return localpkg, nil
}

type setConstraintArgs struct {
	t          *types2.TypeParam
	constraint types2.Type
}

type iimporter struct {
	exportVersion int64
	ipath         string
	version       int

	stringData   string
	pkgCache     map[uint64]*types2.Package
	posBaseCache map[uint64]*syntax.PosBase

	declData    string
	pkgIndex    map[*types2.Package]map[string]uint64
	typCache    map[uint64]types2.Type
	tparamIndex map[ident]*types2.TypeParam

	interfaceList []*types2.Interface

	// Arguments for calls to SetConstraint that are deferred due to recursive types
	later []setConstraintArgs
}

func (p *iimporter) doDecl(pkg *types2.Package, name string) {
	// See if we've already imported this declaration.
	if obj := pkg.Scope().Lookup(name); obj != nil {
		return
	}

	off, ok := p.pkgIndex[pkg][name]
	if !ok {
		errorf("%v.%v not in index", pkg, name)
	}

	r := &importReader{p: p, currPkg: pkg}
	// Reader.Reset is not available in Go 1.4.
	// Use bytes.NewReader for now.
	// r.declReader.Reset(p.declData[off:])
	r.declReader = *strings.NewReader(p.declData[off:])

	r.obj(name)
}

func (p *iimporter) stringAt(off uint64) string {
	var x [binary.MaxVarintLen64]byte
	n := copy(x[:], p.stringData[off:])

	slen, n := binary.Uvarint(x[:n])
	if n <= 0 {
		errorf("varint failed")
	}
	spos := off + uint64(n)
	return p.stringData[spos : spos+slen]
}

func (p *iimporter) pkgAt(off uint64) *types2.Package {
	if pkg, ok := p.pkgCache[off]; ok {
		return pkg
	}
	path := p.stringAt(off)
	errorf("missing package %q in %q", path, p.ipath)
	return nil
}

func (p *iimporter) posBaseAt(off uint64) *syntax.PosBase {
	if posBase, ok := p.posBaseCache[off]; ok {
		return posBase
	}
	filename := p.stringAt(off)
	posBase := syntax.NewTrimmedFileBase(filename, true)
	p.posBaseCache[off] = posBase
	return posBase
}

func (p *iimporter) typAt(off uint64, base *types2.Named) types2.Type {
	if t, ok := p.typCache[off]; ok && canReuse(base, t) {
		return t
	}

	if off < predeclReserved {
		errorf("predeclared type missing from cache: %v", off)
	}

	r := &importReader{p: p}
	// Reader.Reset is not available in Go 1.4.
	// Use bytes.NewReader for now.
	// r.declReader.Reset(p.declData[off-predeclReserved:])
	r.declReader = *strings.NewReader(p.declData[off-predeclReserved:])
	t := r.doType(base)

	if canReuse(base, t) {
		p.typCache[off] = t
	}
	return t
}

// canReuse reports whether the type rhs on the RHS of the declaration for def
// may be re-used.
//
// Specifically, if def is non-nil and rhs is an interface type with methods, it
// may not be re-used because we have a convention of setting the receiver type
// for interface methods to def.
func canReuse(def *types2.Named, rhs types2.Type) bool {
	if def == nil {
		return true
	}
	iface, _ := rhs.(*types2.Interface)
	if iface == nil {
		return true
	}
	// Don't use iface.Empty() here as iface may not be complete.
	return iface.NumEmbeddeds() == 0 && iface.NumExplicitMethods() == 0
}

type importReader struct {
	p           *iimporter
	declReader  strings.Reader
	currPkg     *types2.Package
	prevPosBase *syntax.PosBase
	prevLine    int64
	prevColumn  int64
}

func (r *importReader) obj(name string) {
	tag := r.byte()
	pos := r.pos()

	switch tag {
	case 'A':
		typ := r.typ()

		r.declare(types2.NewTypeName(pos, r.currPkg, name, typ))

	case 'C':
		typ, val := r.value()

		r.declare(types2.NewConst(pos, r.currPkg, name, typ, val))

	case 'F', 'G':
		var tparams []*types2.TypeParam
		if tag == 'G' {
			tparams = r.tparamList()
		}
		sig := r.signature(nil, nil, tparams)
		r.declare(types2.NewFunc(pos, r.currPkg, name, sig))

	case 'T', 'U':
		// Types can be recursive. We need to setup a stub
		// declaration before recursing.
		obj := types2.NewTypeName(pos, r.currPkg, name, nil)
		named := types2.NewNamed(obj, nil, nil)
		// Declare obj before calling r.tparamList, so the new type name is recognized
		// if used in the constraint of one of its own typeparams (see #48280).
		r.declare(obj)
		if tag == 'U' {
			tparams := r.tparamList()
			named.SetTypeParams(tparams)
		}

		underlying := r.p.typAt(r.uint64(), named).Underlying()
		named.SetUnderlying(underlying)

		if !isInterface(underlying) {
			for n := r.uint64(); n > 0; n-- {
				mpos := r.pos()
				mname := r.ident()
				recv := r.param()

				// If the receiver has any targs, set those as the
				// rparams of the method (since those are the
				// typeparams being used in the method sig/body).
				targs := baseType(recv.Type()).TypeArgs()
				var rparams []*types2.TypeParam
				if targs.Len() > 0 {
					rparams = make([]*types2.TypeParam, targs.Len())
					for i := range rparams {
						rparams[i], _ = targs.At(i).(*types2.TypeParam)
					}
				}
				msig := r.signature(recv, rparams, nil)

				named.AddMethod(types2.NewFunc(mpos, r.currPkg, mname, msig))
			}
		}

	case 'P':
		// We need to "declare" a typeparam in order to have a name that
		// can be referenced recursively (if needed) in the type param's
		// bound.
		if r.p.exportVersion < iexportVersionGenerics {
			errorf("unexpected type param type")
		}
		name0 := typecheck.TparamName(name)
		if name0 == "" {
			errorf("malformed type parameter export name %s: missing prefix", name)
		}

		tn := types2.NewTypeName(pos, r.currPkg, name0, nil)
		t := types2.NewTypeParam(tn, nil)
		// To handle recursive references to the typeparam within its
		// bound, save the partial type in tparamIndex before reading the bounds.
		id := ident{r.currPkg, name}
		r.p.tparamIndex[id] = t

		var implicit bool
		if r.p.exportVersion >= iexportVersionGo1_18 {
			implicit = r.bool()
		}
		constraint := r.typ()
		if implicit {
			iface, _ := constraint.(*types2.Interface)
			if iface == nil {
				errorf("non-interface constraint marked implicit")
			}
			iface.MarkImplicit()
		}
		// The constraint type may not be complete, if we
		// are in the middle of a type recursion involving type
		// constraints. So, we defer SetConstraint until we have
		// completely set up all types in ImportData.
		r.p.later = append(r.p.later, setConstraintArgs{t: t, constraint: constraint})

	case 'V':
		typ := r.typ()

		r.declare(types2.NewVar(pos, r.currPkg, name, typ))

	default:
		errorf("unexpected tag: %v", tag)
	}
}

func (r *importReader) declare(obj types2.Object) {
	obj.Pkg().Scope().Insert(obj)
}

func (r *importReader) value() (typ types2.Type, val constant.Value) {
	typ = r.typ()
	if r.p.exportVersion >= iexportVersionGo1_18 {
		// TODO: add support for using the kind
		_ = constant.Kind(r.int64())
	}

	switch b := typ.Underlying().(*types2.Basic); b.Info() & types2.IsConstType {
	case types2.IsBoolean:
		val = constant.MakeBool(r.bool())

	case types2.IsString:
		val = constant.MakeString(r.string())

	case types2.IsInteger:
		var x big.Int
		r.mpint(&x, b)
		val = constant.Make(&x)

	case types2.IsFloat:
		val = r.mpfloat(b)

	case types2.IsComplex:
		re := r.mpfloat(b)
		im := r.mpfloat(b)
		val = constant.BinaryOp(re, token.ADD, constant.MakeImag(im))

	default:
		errorf("unexpected type %v", typ) // panics
		panic("unreachable")
	}

	return
}

func intSize(b *types2.Basic) (signed bool, maxBytes uint) {
	if (b.Info() & types2.IsUntyped) != 0 {
		return true, 64
	}

	switch b.Kind() {
	case types2.Float32, types2.Complex64:
		return true, 3
	case types2.Float64, types2.Complex128:
		return true, 7
	}

	signed = (b.Info() & types2.IsUnsigned) == 0
	switch b.Kind() {
	case types2.Int8, types2.Uint8:
		maxBytes = 1
	case types2.Int16, types2.Uint16:
		maxBytes = 2
	case types2.Int32, types2.Uint32:
		maxBytes = 4
	default:
		maxBytes = 8
	}

	return
}

func (r *importReader) mpint(x *big.Int, typ *types2.Basic) {
	signed, maxBytes := intSize(typ)

	maxSmall := 256 - maxBytes
	if signed {
		maxSmall = 256 - 2*maxBytes
	}
	if maxBytes == 1 {
		maxSmall = 256
	}

	n, _ := r.declReader.ReadByte()
	if uint(n) < maxSmall {
		v := int64(n)
		if signed {
			v >>= 1
			if n&1 != 0 {
				v = ^v
			}
		}
		x.SetInt64(v)
		return
	}

	v := -n
	if signed {
		v = -(n &^ 1) >> 1
	}
	if v < 1 || uint(v) > maxBytes {
		errorf("weird decoding: %v, %v => %v", n, signed, v)
	}
	b := make([]byte, v)
	io.ReadFull(&r.declReader, b)
	x.SetBytes(b)
	if signed && n&1 != 0 {
		x.Neg(x)
	}
}

func (r *importReader) mpfloat(typ *types2.Basic) constant.Value {
	var mant big.Int
	r.mpint(&mant, typ)
	var f big.Float
	f.SetInt(&mant)
	if f.Sign() != 0 {
		f.SetMantExp(&f, int(r.int64()))
	}
	return constant.Make(&f)
}

func (r *importReader) ident() string {
	return r.string()
}

func (r *importReader) qualifiedIdent() (*types2.Package, string) {
	name := r.string()
	pkg := r.pkg()
	return pkg, name
}

func (r *importReader) pos() syntax.Pos {
	if r.p.version >= 1 {
		r.posv1()
	} else {
		r.posv0()
	}

	if (r.prevPosBase == nil || r.prevPosBase.Filename() == "") && r.prevLine == 0 && r.prevColumn == 0 {
		return syntax.Pos{}
	}

	return syntax.MakePos(r.prevPosBase, uint(r.prevLine), uint(r.prevColumn))
}

func (r *importReader) posv0() {
	delta := r.int64()
	if delta != deltaNewFile {
		r.prevLine += delta
	} else if l := r.int64(); l == -1 {
		r.prevLine += deltaNewFile
	} else {
		r.prevPosBase = r.posBase()
		r.prevLine = l
	}
}

func (r *importReader) posv1() {
	delta := r.int64()
	r.prevColumn += delta >> 1
	if delta&1 != 0 {
		delta = r.int64()
		r.prevLine += delta >> 1
		if delta&1 != 0 {
			r.prevPosBase = r.posBase()
		}
	}
}

func (r *importReader) typ() types2.Type {
	return r.p.typAt(r.uint64(), nil)
}

func isInterface(t types2.Type) bool {
	_, ok := t.(*types2.Interface)
	return ok
}

func (r *importReader) pkg() *types2.Package     { return r.p.pkgAt(r.uint64()) }
func (r *importReader) string() string           { return r.p.stringAt(r.uint64()) }
func (r *importReader) posBase() *syntax.PosBase { return r.p.posBaseAt(r.uint64()) }

func (r *importReader) doType(base *types2.Named) types2.Type {
	switch k := r.kind(); k {
	default:
		errorf("unexpected kind tag in %q: %v", r.p.ipath, k)
		return nil

	case definedType:
		pkg, name := r.qualifiedIdent()
		r.p.doDecl(pkg, name)
		return pkg.Scope().Lookup(name).(*types2.TypeName).Type()
	case pointerType:
		return types2.NewPointer(r.typ())
	case sliceType:
		return types2.NewSlice(r.typ())
	case arrayType:
		n := r.uint64()
		return types2.NewArray(r.typ(), int64(n))
	case chanType:
		dir := chanDir(int(r.uint64()))
		return types2.NewChan(dir, r.typ())
	case mapType:
		return types2.NewMap(r.typ(), r.typ())
	case signatureType:
		r.currPkg = r.pkg()
		return r.signature(nil, nil, nil)

	case structType:
		r.currPkg = r.pkg()

		fields := make([]*types2.Var, r.uint64())
		tags := make([]string, len(fields))
		for i := range fields {
			fpos := r.pos()
			fname := r.ident()
			ftyp := r.typ()
			emb := r.bool()
			tag := r.string()

			fields[i] = types2.NewField(fpos, r.currPkg, fname, ftyp, emb)
			tags[i] = tag
		}
		return types2.NewStruct(fields, tags)

	case interfaceType:
		r.currPkg = r.pkg()

		embeddeds := make([]types2.Type, r.uint64())
		for i := range embeddeds {
			_ = r.pos()
			embeddeds[i] = r.typ()
		}

		methods := make([]*types2.Func, r.uint64())
		for i := range methods {
			mpos := r.pos()
			mname := r.ident()

			// TODO(mdempsky): Matches bimport.go, but I
			// don't agree with this.
			var recv *types2.Var
			if base != nil {
				recv = types2.NewVar(syntax.Pos{}, r.currPkg, "", base)
			}

			msig := r.signature(recv, nil, nil)
			methods[i] = types2.NewFunc(mpos, r.currPkg, mname, msig)
		}

		typ := types2.NewInterfaceType(methods, embeddeds)
		r.p.interfaceList = append(r.p.interfaceList, typ)
		return typ

	case typeParamType:
		if r.p.exportVersion < iexportVersionGenerics {
			errorf("unexpected type param type")
		}
		pkg, name := r.qualifiedIdent()
		id := ident{pkg, name}
		if t, ok := r.p.tparamIndex[id]; ok {
			// We're already in the process of importing this typeparam.
			return t
		}
		// Otherwise, import the definition of the typeparam now.
		r.p.doDecl(pkg, name)
		return r.p.tparamIndex[id]

	case instanceType:
		if r.p.exportVersion < iexportVersionGenerics {
			errorf("unexpected instantiation type")
		}
		// pos does not matter for instances: they are positioned on the original
		// type.
		_ = r.pos()
		len := r.uint64()
		targs := make([]types2.Type, len)
		for i := range targs {
			targs[i] = r.typ()
		}
		baseType := r.typ()
		// The imported instantiated type doesn't include any methods, so
		// we must always use the methods of the base (orig) type.
		// TODO provide a non-nil *Context
		t, _ := types2.Instantiate(nil, baseType, targs, false)
		return t

	case unionType:
		if r.p.exportVersion < iexportVersionGenerics {
			errorf("unexpected instantiation type")
		}
		terms := make([]*types2.Term, r.uint64())
		for i := range terms {
			terms[i] = types2.NewTerm(r.bool(), r.typ())
		}
		return types2.NewUnion(terms)
	}
}

func (r *importReader) kind() itag {
	return itag(r.uint64())
}

func (r *importReader) signature(recv *types2.Var, rparams, tparams []*types2.TypeParam) *types2.Signature {
	params := r.paramList()
	results := r.paramList()
	variadic := params.Len() > 0 && r.bool()
	return types2.NewSignatureType(recv, rparams, tparams, params, results, variadic)
}

func (r *importReader) tparamList() []*types2.TypeParam {
	n := r.uint64()
	if n == 0 {
		return nil
	}
	xs := make([]*types2.TypeParam, n)
	for i := range xs {
		xs[i] = r.typ().(*types2.TypeParam)
	}
	return xs
}

func (r *importReader) paramList() *types2.Tuple {
	xs := make([]*types2.Var, r.uint64())
	for i := range xs {
		xs[i] = r.param()
	}
	return types2.NewTuple(xs...)
}

func (r *importReader) param() *types2.Var {
	pos := r.pos()
	name := r.ident()
	typ := r.typ()
	return types2.NewParam(pos, r.currPkg, name, typ)
}

func (r *importReader) bool() bool {
	return r.uint64() != 0
}

func (r *importReader) int64() int64 {
	n, err := binary.ReadVarint(&r.declReader)
	if err != nil {
		errorf("readVarint: %v", err)
	}
	return n
}

func (r *importReader) uint64() uint64 {
	n, err := binary.ReadUvarint(&r.declReader)
	if err != nil {
		errorf("readUvarint: %v", err)
	}
	return n
}

func (r *importReader) byte() byte {
	x, err := r.declReader.ReadByte()
	if err != nil {
		errorf("declReader.ReadByte: %v", err)
	}
	return x
}

func baseType(typ types2.Type) *types2.Named {
	// pointer receivers are never types2.Named types
	if p, _ := typ.(*types2.Pointer); p != nil {
		typ = p.Elem()
	}
	// receiver base types are always (possibly generic) types2.Named types
	n, _ := typ.(*types2.Named)
	return n
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="definitions"
  xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:activiti="http://activiti.org/bpmn"
  targetNamespace="Examples">

  <process id="mockSupportTest">

    <startEvent id="start" />
    <sequenceFlow id="flow1" sourceRef="start" targetRef="serviceTask1" />

    <serviceTask id="serviceTask1" activiti:class="com.yourcompany.delegate1"/>
    <sequenceFlow id="flow2" sourceRef="serviceTask1" targetRef="serviceTask2" />

    <serviceTask id="serviceTask2" activiti:class="com.yourcompany.delegate2"/>
    <sequenceFlow id="flow3" sourceRef="serviceTask2" targetRef="serviceTask3" />

    <serviceTask id="serviceTask3" activiti:class="com.yourcompany.delegate3"/>
    <sequenceFlow id="flow4" sourceRef="serviceTask3" targetRef="serviceTask4" />

    <serviceTask id="serviceTask4" activiti:class="com.yourcompany.delegate4"/>
    <sequenceFlow id="flow5" sourceRef="serviceTask4" targetRef="serviceTask5" />

    <serviceTask id="serviceTask5" activiti:class="com.yourcompany.delegate5"/>
    <sequenceFlow id="flow6" sourceRef="serviceTask5" targetRef="theEnd" />

    <endEvent id="theEnd" />

  </process>

</definitions>


text:
File System for Dropbox provides you an ability to access to your Dropbox storage directly from the Files app.

  Go to File System for Dropbox page on Chrome WebStore

## How to build

```
$ git clone https://github.com/yoichiro/chromeos-filesystem-dropbox.git
$ cd chromeos-filesystem-dropbox
$ npm install
$ grunt
```

## Dependent libraries

* [Polymer](https://www.polymer-project.org/)
* [jQuery](http://jquery.com/)

## License

All files are licensed under the BSD license. See the LICENSE file for details.
All original source code is Copyright 2015 Yoichiro Tanaka.


text:
module Shell
  module Commands
    # Reassign tables of specified namespaces
    # from one RegionServer group to another.
    class MoveNamespacesRsgroup < Command
      def help
        <<-CMD

  Example:
  hbase> move_namespaces_rsgroup 'dest',['ns1','ns2']

CMD
      end

      def command(dest, namespaces)
        rsgroup_admin.move_namespaces(dest, namespaces)
      end
    end
  end
end


text:
var BaseItemsAssistant = Class.create(BaseAssistant, {
  initialize: function($super) {
    $super();
    this.instapaper = new Instapaper();
    this.items = {items: []};
    this.allowItemDelete = true;
    this.commandMenuItems = [{}, {}, {label: "Refresh", icon: "refresh", command: "refresh"}];
  },

  setup: function($super) {
    $super();
    this.controller.setupWidget("items", {itemTemplate: 'items/item', onItemRendered: this.itemRendered.bind(this), swipeToDelete: this.allowItemDelete}, this.items);
    this.controller.setupWidget(Mojo.Menu.commandMenu, {}, {items: this.commandMenuItems});
    this.controller.listen("items", Mojo.Event.listTap, this.itemTapped = this.itemTapped.bind(this));
    this.controller.listen("items", Mojo.Event.listDelete, this.itemDeleted = this.itemDeleted.bind(this));
    this.controller.listen("switch", Mojo.Event.tap, this.swapScene = this.swapScene.bind(this));
    this.controller.listen(document, SpareTime.Event.articleSaveStarting, this.itemSaveStarted = this.itemSaveStarted.bind(this));
    this.controller.listen(document, SpareTime.Event.articleSaveComplete, this.itemSaveComplete = this.itemSaveComplete.bind(this));
    this.controller.listen(document, SpareTime.Event.articleSaveFailed, this.itemSaveFailure = this.itemSaveFailure.bind(this));
  },

  cleanup: function($super) {
    $super();
    this.controller.stopListening("items", Mojo.Event.listTap, this.itemTapped);
    this.controller.stopListening("switch", Mojo.Event.tap, this.swapScene);
    this.controller.stopListening(document, SpareTime.Event.articleSaveStarting, this.itemSaveStarted);
    this.controller.stopListening(document, SpareTime.Event.articleSaveComplete, this.itemSaveComplete);
    this.controller.stopListening(document, SpareTime.Event.articleSaveFailed, this.itemSaveFailure);
  },

  ready: function($super) {
    $super();
    this.refresh();
  },

  activate: function($super, itemToRemove) {
    $super();

    if(itemToRemove) {
      for(var i = 0; i < this.items.items.length; i++) {
        if(this.items.items[i] == itemToRemove) {
          this.items.items.splice(i, 1);
          this.controller.modelChanged(this.items);
        }
      }
    }
  },

  itemsRetrieved: function(items, folders) {
    this.items.items.clear();
    this.items.items.push.apply(this.items.items, items);
    this.controller.modelChanged(this.items);
    this.spinnerOff();

    if(folders) {
      folders.each(function(folder) {
        this.otherScenes.push(folder);
      }.bind(this));
    }
  },

  retrieveFailure: function() {
    this.spinnerOff();
    this.controller.stageController.pushScene("bail", "Unable to retrieve items");
  },

  itemTapped: function(event) {
    if(event.originalEvent.target.hasClassName('star')) {
      event.originalEvent.target.toggleClassName('on');
      var req = new Ajax.Request(event.item.starUrl, {method: 'get'});
    }
    else if(event.item.textUrl) {
      this.controller.stageController.pushScene("text", event.item);
    }
  },

  itemDeleted: function(event) {
    if(event.item.deleteUrl) {
      var req = new Ajax.Request(event.item.deleteUrl, {method: "post"});
    }
  },

  handleCommand: function($super, event) {
    if("refresh" == event.command) {
      this.refresh();
    }
    else {
      $super(event);
    }
  },

  swapScene: function() {
    scenes = this.otherScenes;
    items = [];

    scenes.each(function(scene) {
      items.push({label: scene.name, command: scene.name});
    });

    this.controller.popupSubmenu({
      placeNear: $("switch"),
      items: items,

      onChoose: function(command) {
        scenes.each(function(scene) {
          if(scene.name == command) {
            if(scene.url) {
              this.controller.stageController.swapScene("folder", scene.name, scene.url);
            }
            else {
              this.controller.stageController.swapScene(command.toLowerCase());
            }
          }
        }.bind(this));
      }.bind(this)
    });
  },

  refresh: function() {
    this.firstTime = false;
    this.spinnerOn("retrieving articles...");
    this.setOtherScenes();
    this.retrieveItems(this.itemsRetrieved.bind(this), this.retrieveFailure.bind(this));
  },

  itemRendered: function(listWidget, item, node) {
    ArticleSaver.isSaved(item.id, function() {
      node.down(".saved").show();
    });
  },

  itemSaveStarted: function() {
    this.controller.sceneElement.querySelector("#item" + event.model.id + " .saving").show();
  },

  itemSaveComplete: function() {
    this.controller.sceneElement.querySelector("#item" + event.model.id + " .saving").hide();
    this.controller.sceneElement.querySelector("#item" + event.model.id + " .saved").show();
  },

  itemSaveFailure: function() {
    this.controller.sceneElement.querySelector("#item" + event.model.id + " .saving").hide();
  }
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="GoodType">
	<resultMap class="com.usst.app.good.goodType.model.GoodType" id="GoodTypeInfoResult">
		<result column="id" property="id" jdbcType="varchar"/>
		<result column="parent_id" property="parentId" jdbcType="varchar"/>
		<result column="code" property="code" jdbcType="varchar"/>
		<result column="name" property="name" jdbcType="varchar"/>
		<result column="level" property="level" jdbcType="int"/>
		<result column="remark" property="remark" jdbcType="varchar"/>
		<result column="sort" property="sort" jdbcType="int"/>
		<result column="creator_id" property="creatorId" jdbcType="varchar"/>
		<result column="creator_name" property="creatorName" jdbcType="varchar"/>
		<result column="create_time" property="createTime" jdbcType="datetime"/>
		<result column="modifier_id" property="modifierId" jdbcType="varchar"/>
		<result column="modifier_name" property="modifierName" jdbcType="varchar"/>
		<result column="modify_time" property="modifyTime" jdbcType="datetime"/>
		<result column="state" property="state" jdbcType="varchar"/>
		<result column="pic_id" property="picId" jdbcType="varchar"/>
		<result column="pic" property="pic" jdbcType="varchar"/>
		<result column="listShow" property="listShow" jdbcType="varchar"/>
		<result column="is_inventory" property="isInventories" jdbcType="varchar"/>
		<result column="isParent" property="isParent" jdbcType="varchar"/>

		<result column="payment_id" property="paymentId" jdbcType="varchar"/>
		<result column="payment_name" property="paymentName" jdbcType="varchar"/>
		<result column="delivery_id" property="deliveryId" jdbcType="varchar"/>
		<result column="delivery_name" property="deliveryName" jdbcType="varchar"/>
	</resultMap>

	<!-- 缓存模型 -->
	<cacheModel id="GoodType_cache" type="LRU" readOnly="false" serialize="true">
		<flushInterval hours="24"/>
		<flushOnExecute statement="GoodType.GoodType_insert"/>
		<flushOnExecute statement="GoodType.GoodType_update"/>
		<flushOnExecute statement="GoodType.GoodType_delete"/>
		<property name="size" value="1000"/>
	</cacheModel>

  	<!-- 模糊查询 -->
	<sql id="GoodType_query_select_where_clause">
		<dynamic prepend="where">
			<isNotEmpty prepend="and" property="id">
				id = #id#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="name">
				name like '%$name$%'
			</isNotEmpty>
			<isNotEmpty prepend="and" property="code">
				code like '%$code$%'
			</isNotEmpty>
			<isNotEmpty prepend="and" property="level">
				level = #level#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="parentId">
				parent_id = #parentId#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="listShow">
				listShow = #listShow#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="isParent">
				isParent = #isParent#
			</isNotEmpty>

		</dynamic>
	</sql>
	<select id="GoodType_count_query_select" resultClass="java.lang.Integer" cacheModel="GoodType_cache">
		select count(*) from good_type
			<include refid="GoodType_query_select_where_clause"/>
		order by level,sort
	</select>

	<select id="GoodType_query_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from good_type
		<include refid="GoodType_query_select_where_clause"/>
		order by level,sort
	</select>

	<select id="GoodType_query_select1_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from good_type where `level`=1
		order by modify_time desc,level,sort
	</select>

	<select id="GoodType_query_select2_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from (
		select * from good_type where `level`=1
		UNION
		select * from good_type
		<include refid="GoodType_query_select_where_clause"/>
		) a
		order by modify_time desc,level,sort
	</select>

	<select id="GoodType_query_select3_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from (
		select * from good_type where `level`=1
		UNION
		select * from  good_type where parent_id=(select parent_id from good_type where id in (select parent_id from good_type <include refid="GoodType_query_select_where_clause"/>))
		UNION
		select * from good_type
		<include refid="GoodType_query_select_where_clause"/>
		) a
		order by modify_time desc,level,sort
	</select>

	<!-- 结算取资料配送方式 -->
	<select id="GoodType_jiesuan_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from good_type where id in(select good_type_id from good where id in(
			select good_id from ware where id in
				<iterate open="(" close=")" conjunction="," property="wareIdArr">
					#wareIdArr[]#
				</iterate>
			))
		UNION
		select * from good_type where id in (
			select parent_id from good_type where id in(select good_type_id from good where id in(
				select good_id from ware where id in
					<iterate open="(" close=")" conjunction="," property="wareIdArr">
						#wareIdArr[]#
					</iterate>
				)))
		UNION
		select * from good_type where id in (
			select parent_id from good_type where id in (
				select parent_id from good_type where id in(select good_type_id from good where id in(
					select good_id from ware where id in
						<iterate open="(" close=")" conjunction="," property="wareIdArr">
							#wareIdArr[]#
						</iterate>
					))))
	</select>

  	<!-- 精确查询 -->
	<sql id="GoodType_select_where_clause">
		<dynamic prepend="where">
			<isNotEmpty prepend="and" property="id">
				id = #id#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="parentId">
				parent_id = #parentId#
			</isNotEmpty>
			<isNotEmpty prepend="and" property="code">
				code = #code#
			</isNotEmpty>
			<isNotNull prepend="and" property="level">
			 	level = #level#
			</isNotNull>
			<isNotEmpty prepend="and" property="listShow">
				listShow = #listShow#
			</isNotEmpty>
			<!--
				<isNotEmpty prepend="and" property="wareIdArr">
					id in(
						select good_type_id from good where id in(
							select good_id from ware where id in
							<iterate open="(" close=")" conjunction="," property="wareIdArr">
								#wareIdArr[]#
							</iterate>
					))
				</isNotEmpty>
			 -->
			<isNotEmpty prepend="and" property="isInventories">
				is_inventory = #isInventories#
			</isNotEmpty>

		</dynamic>
	</sql>
	<select id="GoodType_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from good_type
		<include refid="GoodType_select_where_clause"/>
		order by modify_time desc,level,sort
	</select>

	<!-- 精确查询 -->
	<sql id="GoodType_level_select_where_clause">
		<dynamic prepend="where">
			<isEqual property="level" compareValue="2">
				id =(select parent_id from good_type where id=#id#)
			</isEqual>
			<isEqual property="level" compareValue="3">
				id =(select parent_id from good_type where id =(
						select parent_id from good_type where id=#id#))
			</isEqual>
		</dynamic>
	</sql>

	<!--  根据类别Id和类别等级查询其所属父类或祖父类的类别信息 -->
	<select id="GoodType_level_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from good_type
		<include refid="GoodType_level_select_where_clause"/>
		order by level,sort
	</select>

	<!-- 查询广告页面选择广告类型 -->
	<select id="GoodType_adver_select" resultMap="GoodTypeInfoResult" cacheModel="GoodType_cache">
		select * from good_type where `level`=1 order by level,sort LIMIT 0,9
	</select>

	<!-- 查询资料类别数目 -->
	<select id="GoodType_count_select" resultClass="java.lang.Integer" cacheModel="GoodType_cache">
		select max(sort) from good_type
	</select>

	<insert id="GoodType_insert">
		insert into good_type
		 	(id,parent_id,code,name,level,remark,sort,creator_id,creator_name,create_time,state,pic_id,pic,listShow,
		 	payment_id,payment_name,delivery_id,delivery_name,modify_time,is_inventory,isParent)
		   values(#id#,#parentId#,#code#,#name#,#level#,#remark#,#sort#,#creatorId#,#creatorName#,#createTime#,#state#,#picId#,#pic#,
		   #listShow#,#paymentId#,#paymentName#,#deliveryId#,#deliveryName#,#modifyTime#,#isInventories#,#isParent#)
	</insert>

	<update id="GoodType_update">
		update good_type set code=#code#,name=#name#,remark=#remark#,modifier_id=#modifierId#,
		 modifier_name=#modifierName#,modify_time=#modifyTime#,state=#state#,pic_id = #picId#,pic = #pic#,listShow = #listShow#,
		 payment_id=#paymentId#,payment_name=#paymentName#,delivery_id=#deliveryId#,delivery_name=#deliveryName#,is_inventory=#isInventories#,isParent=#isParent#
		  where id = #id#
	</update>

	<delete id="GoodType_delete">
		delete from good_type
		<dynamic prepend="where">
			<isNotEmpty property="id" prepend="and">
				id=#id#
			</isNotEmpty>
			<isNotEmpty property="parentId" prepend="and">
				parent_id=#parentId#
			</isNotEmpty>
		</dynamic>
	</delete>
</sqlMap>


text:
namespace ExcelDataReader.Core.BinaryFormat
{
    /// <summary>
    /// Represents BIFF BOF record
    /// </summary>
    internal class XlsBiffBOF : XlsBiffRecord
    {
        internal XlsBiffBOF(byte[] bytes, uint offset)
            : base(bytes, offset)
        {
        }

        /// <summary>
        /// Gets the version.
        /// </summary>
        public ushort Version => ReadUInt16(0x0);

        /// <summary>
        /// Gets the type of the BIFF block
        /// </summary>
        public BIFFTYPE Type => (BIFFTYPE)ReadUInt16(0x2);

        /// <summary>
        /// Gets the creation Id.
        /// </summary>
        /// <remarks>Not used before BIFF5</remarks>
        public ushort CreationId
        {
            get
            {
                if (RecordSize < 6)
                    return 0;
                return ReadUInt16(0x4);
            }
        }

        /// <summary>
        /// Gets the creation year.
        /// </summary>
        /// <remarks>Not used before BIFF5</remarks>
        public ushort CreationYear
        {
            get
            {
                if (RecordSize < 8)
                    return 0;
                return ReadUInt16(0x6);
            }
        }

        /// <summary>
        /// Gets the file history flag.
        /// </summary>
        /// <remarks>Not used before BIFF8</remarks>
        public uint HistoryFlag
        {
            get
            {
                if (RecordSize < 12)
                    return 0;
                return ReadUInt32(0x8);
            }
        }

        /// <summary>
        /// Gets the minimum Excel version to open this file.
        /// </summary>
        /// <remarks>Not used before BIFF8</remarks>
        public uint MinVersionToOpen
        {
            get
            {
                if (RecordSize < 16)
                    return 0;
                return ReadUInt32(0xC);
            }
        }
    }
}


text:
from setuptools import setup

setup(
    name='phantom-requests',
    version='0.0.1',
    description='Use PhantomJS As You Are Using Requests.',
    author='Tomer Zait (RealGame)',
    author_email='realgam3@gmail.com',
    packages=['phantom_requests'],
    package_data={
        'phantom_requests': [
            'ghostdriver/VERSION',
            'ghostdriver/*.*',
            'ghostdriver/src/*.*',
            'ghostdriver/src/request_handlers/*.*',
            'ghostdriver/src/third_party/*.*',
            'ghostdriver/src/third_party/webdriver-atoms/*.*',
        ]
    },
    install_requires=[
        'selenium >= 3.0.1',
        'requests >= 2.11.1',
    ],
    platforms='any',
)


text:
<?php
include( dirname(__FILE__) . '/../bootstrap/doctrine.php' );

// Initialize the test object
$t = new lime_test( 17, new lime_output_color() );

$playlist_table = Doctrine_Core::getTable('Playlist');
$playlist_files_table = Doctrine_Core::getTable('PlaylistFiles');
Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures/70_PlaylistTable');

if(Doctrine_Manager::getInstance()->getCurrentConnection()->getDriverName() === 'Pgsql')
{
    $dbh = Doctrine_Manager::getInstance()->getCurrentConnection()->getDbh();
    $query = 'SELECT setval(\'playlist_id_seq\', 4)';
    $dbh->query( $query );
}

$t->comment( '->addPlaylist' );
$t->comment('Adding a streeme Playlist');
$first_insert_id = $playlist_table->addPlaylist('A Playlist');
$t->is( $first_insert_id, 5, 'Successfully added a playlist entry.' );
$t->comment('Adding a playlist from a service like itunes');
$result = $playlist_table->find(5);
$t->is($result->name, 'A Playlist', 'Correct Name');
$t->is($result->scan_id, 0, 'Correct Scan ID');
$t->is($result->service_name, null, 'Correct Service Name');
$t->is($result->service_unique_id, null, 'correct service id' );

$second_insert_id  = $playlist_table->addPlaylist('Nineties Rock', 2, 'itunes', 'B16E9C5DFFC4695D');
$t->is( $second_insert_id, 6, 'Successfully added a playlist entry.' );
$result = $playlist_table->find(6);
$t->is($result->name, 'Nineties Rock', 'Correct Name');
$t->is($result->scan_id, 2, 'Correct Scan ID');
$t->is($result->service_name, 'itunes', 'Correct Service Name');
$t->is($result->service_unique_id, 'B16E9C5DFFC4695D', 'correct service id' );

$t->comment( '->deletePlaylist' );
$deleted_row_count = $playlist_table->deletePlaylist( PlaylistFilesTable::getInstance(), $first_insert_id );
$t->is( $deleted_row_count, 1, 'Successfully deleted a playlist entry' );

$t->comment( '->getList' );
$list  = $playlist_table->getList();
$count = count( $list );
$t->is( $count, 3, 'Correct list size' );

$t->comment( '->updateScanId' );
$playlist_table->updateScanId('itunes', 'Itunes 90\'s Playlist', 'B16E9C5DFFC4695D', 2);
$updated_record = $playlist_table->find(2);
$t->is($updated_record->scan_id, 2, 'Record updated to correct scan id');
$id = $playlist_table->updateScanId('itunes', 'Itunes Don\'t Exist', 'AC29CC9100DF56F', 2);
$t->is(id, 0, 'Correct Id for missing playlist');
$playlist_table->updateScanId('wjukebox', 'WJukebox Retro Playlist', null, 3);
$updated_record = $playlist_table->find(4);
$t->is($updated_record->scan_id, 3, 'Record updated to correct scan id');

$t->comment( '->finalizeScan' );
$removed_count = $playlist_table->finalizeScan($playlist_files_table, 3, 'itunes');
$t->is($removed_count, 2, 'successfully cleaned old playlist entries');
$q = $playlist_files_table->createQuery();
$result = $q->execute();
$count = count($result);
$t->is($count, 1, "successfully removed playlist files");


text:
__author__ = 'Alex Starov'

from django import forms
from django.utils.translation import ugettext_lazy as _

class DeliveryCreateEditForm(forms.ModelForm, ):

    def __init__(self, *args, **kwargs):
        super(DeliveryCreateEditForm, self).__init__(*args, **kwargs)

    class Meta:
        from applications.delivery.models import Delivery
        model = Delivery
        fields = '__all__'


text:
var IssueEditorIndexRoute = Ember.Route.extend({
    beforeModel: function () {
        this.transitionTo('issue_editor.new');
    }
});

export default IssueEditorIndexRoute;