text:
package christophedelory.xml;

import java.io.Serializable;

/**
 * A generic version information, composed of a version number, a revision number and a step number.
 * @version $Revision: 92 $
 * @author Christophe Delory
 * @castor.class xml="version" verify-constructable="false"
 */
public class Version implements Cloneable, Serializable
{
    /**
     * The serialization runtime associates with each serializable class a version number, called a serialVersionUID,
     * which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object
     * that are compatible with respect to serialization.
     */
    private static final long serialVersionUID = 0L;

    /**
     * The current version of this project.
     * Defaults to "0.0.0".
     */
    public static Version CURRENT = new Version();

    /**
     * Builds a version information from the specified string.
     * @param name the version string.
     * @see #toString
     * @throws NullPointerException if the version string is null.
     * @throws IllegalArgumentException if the version string is malformed.
     * @throws IndexOutOfBoundsException if one of the numbers is strictly negative.
     * @throws NumberFormatException if the version string contains a non-parsable integer.
     */
    public static Version valueOf(final String name)
    {
        final int k = name.indexOf('.'); // May throw NullPointerException.

        if (k < 0)
        {
            throw new IllegalArgumentException("The format of a version string is <version.revision.step>");
        }

        if (k == 0)
        {
            throw new IllegalArgumentException("No version part in version string '" + name + '\'');
        }

        if ((k + 1) >= name.length())
        {
            throw new IllegalArgumentException("No revision/step part in version string '" + name + '\'');
        }

        final int l = name.indexOf('.', k + 1);

        if (l < 0)
        {
            throw new IllegalArgumentException("The format of a version string is <version.revision.step>");
        }

        if (l == (k + 1))
        {
            throw new IllegalArgumentException("No revision part in version string '" + name + '\'');
        }

        if ((l + 1) >= name.length())
        {
            throw new IllegalArgumentException("No step part in version string '" + name + '\'');
        }

        final String versionString = name.substring(0, k); // Should not throw IndexOutOfBoundsException.
        final String revisionString = name.substring(k + 1, l); // Should not throw IndexOutOfBoundsException.
        final String stepString = name.substring(l + 1); // Should not throw IndexOutOfBoundsException.

        final int version = Integer.parseInt(versionString); // May throw NumberFormatException.
        final int revision = Integer.parseInt(revisionString); // May throw NumberFormatException.
        final int step = Integer.parseInt(stepString); // May throw NumberFormatException.

        return new Version(version, revision, step); // May throw IndexOutOfBoundsException.
    }

    /**
     * The version number.
     */
    private int _version;

    /**
     * The revision number.
     */
    private int _revision;

    /**
     * The step number.
     */
    private int _step;

    /**
     * Builds a default version information.
     * All fields are set to '0'.
     */
    private Version()
    {
        _version = 0;
        _revision = 0;
        _step = 0;
    }

    /**
     * Builds a new Version instance which should keep a specific version, revision and step numbers.
     * @param version the version number.
     * @param revision the revision number.
     * @param step the step number.
     * @throws IndexOutOfBoundsException if one of the numbers is strictly negative.
     */
    public Version(final int version, final int revision, final int step)
    {
        setVersion(version); // May throw IndexOutOfBoundsException.
        setRevision(revision); // May throw IndexOutOfBoundsException.
        setStep(step); // May throw IndexOutOfBoundsException.
    }

    /**
     * Initializes the version number.
     * @param version the version number.
     * @throws IndexOutOfBoundsException if the number is strictly negative.
     * @see #getVersion
     */
    private void setVersion(final int version)
    {
        if (version < 0)
        {
            throw new IndexOutOfBoundsException("Version number is negative");
        }

        _version = version;
    }

    /**
     * Returns the version number kept by this instance.
     * @return a version number.
     */
    public int getVersion()
    {
        return _version;
    }

    /**
     * Initializes the revision number.
     * @param revision the revision number.
     * @throws IndexOutOfBoundsException if the number is strictly negative.
     * @see #getRevision
     */
    private void setRevision(final int revision)
    {
        if (revision < 0)
        {
            throw new IndexOutOfBoundsException("Revision number is negative");
        }

        _revision = revision;
    }

    /**
     * Returns the revision number kept by this instance.
     * @return a revision number.
     */
    public int getRevision()
    {
        return _revision;
    }

    /**
     * Initializes the step number.
     * @param step the step number.
     * @throws IndexOutOfBoundsException if the number is strictly negative.
     * @see #getStep
     */
    private void setStep(final int step)
    {
        if (step < 0)
        {
            throw new IndexOutOfBoundsException("Step number is negative");
        }

        _step = step;
    }

    /**
     * Returns the step number kept by this instance.
     * @return a step number.
     */
    public int getStep()
    {
        return _step;
    }

    public int compareTo(final Object o)
    {
        return hashCode() - ((Version) o).hashCode(); // May throw NullPointerException, ClassCastException.
    }

    /**
     * Indicates whether some other object is "equal to" this one.
     * Two version information are the same if their version and revision and step numbers are the same.
     * @param obj the reference object with which to compare. A Version instance is expected.
     * @return true if this object is the same as the obj argument; false otherwise.
     */
    @Override
    public boolean equals(final Object obj)
    {
        boolean ret = false;

        if ((obj != null) && (obj instanceof Version))
        {
            ret = (hashCode() == obj.hashCode());
        }

        return ret;
    }

    @Override
    public int hashCode()
    {
        return ((_version & 0x000003ff) << 20) | ((_revision & 0x000003ff) << 10) | (_step & 0x000003ff);
    }

    /**
     * Creates and returns a "shallow" copy of this object.
     * @return a clone of this instance.
     * @throws CloneNotSupportedException shall not be thrown, because this class is cloneable.
     * @see Object#clone
     */
    @Override
    public Object clone() throws CloneNotSupportedException
    {
        return super.clone(); // Should not throw CloneNotSupportedException.
    }

    /**
     * Returns a string representation of this version information.
     * It takes the following form: "<version>.<revision>.<step>".
     * @return a string representing this version information.
     */
    @Override
    public String toString()
    {
        final StringBuilder sb = new StringBuilder();

        sb.append(_version);
        sb.append('.');
        sb.append(_revision);
        sb.append('.');
        sb.append(_step);

        return sb.toString();
    }
}


text:
<?php

declare(strict_types=1);

namespace Nelmio\Alice\Generator\Instantiator\Chainable;

use Nelmio\Alice\Definition\MethodCall\NoMethodCall;
use Nelmio\Alice\FixtureInterface;
use Nelmio\Alice\Throwable\Exception\Generator\Instantiator\InstantiationExceptionFactory;

final class NoMethodCallInstantiator extends AbstractChainableInstantiator
{
    /**
     * @inheritDoc
     */
    public function canInstantiate(FixtureInterface $fixture): bool
    {
        return $fixture->getSpecs()->getConstructor() instanceof NoMethodCall;
    }

    /**
     * @inheritdoc
     */
    protected function createInstance(FixtureInterface $fixture)
    {
        try {
            return (new \ReflectionClass($fixture->getClassName()))->newInstanceWithoutConstructor();
        } catch (\ReflectionException $exception) {
            throw InstantiationExceptionFactory::create($fixture, 0, $exception);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
class CPHShellSimpleCreator: public IPhysicShellCreator
{
public:
	virtual void CreatePhysicsShell();
protected:
private:
};
#endif


text:
package com.bindstone.graphbank.service.impl;

import com.bindstone.graphbank.domain.Account;
import com.bindstone.graphbank.domain.Client;
import com.bindstone.graphbank.domain.Currency;
import com.bindstone.graphbank.repository.AccountMapper;
import com.bindstone.graphbank.repository.CrudMapper;
import com.bindstone.graphbank.service.AccountService;
import com.bindstone.graphbank.service.ClientService;
import com.bindstone.graphbank.service.CurrencyService;
import com.bindstone.graphbank.utils.except.ValidationExcept;
import org.apache.commons.lang3.exception.ContextedException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.UUID;

@Service
@Transactional
public class AccountServiceImpl extends CrudServiceImpl<Account> implements AccountService {

    @Autowired
    private CurrencyService currencyService;

    @Autowired
    private ClientService clientService;

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public Account insert(final Account account) throws ContextedException {
        validate(account);
        account.setCreated(LocalDateTime.now());
        account.setModified(LocalDateTime.now());
        account.setId(UUID.randomUUID().toString());
        getMapper().insert(account);
        return linkCurrency(account, true);
    }

    @Override
    public Account update(final Account account) throws ContextedException {
        validate(account);
        account.setModified(LocalDateTime.now());
        getMapper().update(account);
        return linkCurrency(account, false);
    }

    private Account linkCurrency(Account account, boolean isNew) throws ContextedException {
        if (Objects.isNull(account) || Objects.isNull(account.getCurrency()))
            throw new ValidationExcept()
                    .addContextValue("Account", account)
                    .addContextValue("isNew", isNew);

        Currency currency = currencyService.findByIso(account.getCurrency().getIso());
        if (Objects.isNull(currency)) {
            currency = currencyService.save(account.getCurrency());
        }

        if (isNew) {
            accountMapper.linkWithHasCurrency(account, currency);
            account.setCurrency(currency);
        } else {
            Account oldAccount = findById(account.getId());
            if (!oldAccount.getCurrency().equals(account.getCurrency())) {
                accountMapper.unlinkWithHasCurrency(account, oldAccount.getCurrency());
                accountMapper.linkWithHasCurrency(account, currency);
            }

        }
        return account;
    }

    @Override
    public CrudMapper getMapper() {
        return accountMapper;
    }

    @Override
    public void linkClient(Account account, Client client) {
        accountMapper.linkWithOwnClient(account, client);
    }

    @Override
    public void unlinkClient(Account account, Client client) {
        accountMapper.unlinkWithOwnClient(account, client);
    }

    @Override
    public List<Account> findByClientId(final String clientId) {
        return accountMapper.findByClientId(clientId);
    }

    @Override
    public Account createAccountForClient(Account account, String clientId) throws ContextedException {
        Client client = clientService.findById(clientId);
        Account saved = save(account);
        linkClient(saved, client);
        return saved;
    }
}


text:
'use strict';

/**
* @ngdoc directive
* @name chartjsLineWidget
* @restrict A
* @scope
*
* @description
*
* Adds chartjs line chart data to widget
*
* @usage
* ```html
* <widget chartjs-line-widget>
* ```
*/
angular.module('c-3po')
.directive('chartjsLineWidget', ['$window', '$timeout', function ($window, $timeout, $interval) {
    return {
        require: 'widget',
        restrict: 'A',
        link: function ($scope, $element, attrs, widgetCtrl) {
            widgetCtrl.setLoading(true);

            $timeout(function() {
                widgetCtrl.setLoading(false);
                randomData();
            }, 1500);

            widgetCtrl.setMenu({
                icon: 'icon-more-vert',
                items: [{
                    icon: 'icon-refresh',
                    title: 'DASHBOARDS.WIDGETS.MENU.REFRESH',
                    click: function($event) {
                        $interval.cancel($scope.intervalPromise);
                        widgetCtrl.setLoading(true);
                        $timeout(function() {
                            widgetCtrl.setLoading(false);
                            randomData();
                        }, 1500);
                    }
                },{
                    icon: 'icon-share',
                    title: 'DASHBOARDS.WIDGETS.MENU.SHARE',
                },{
                    icon: 'icon-print',
                    title: 'DASHBOARDS.WIDGETS.MENU.PRINT',
                }]
            });

            $scope.lineChart = {
                labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
                series: ['Pageviews', 'Visits', 'Sign ups'],
                options: {
                    datasetFill: false
                },
                data: []
            };

            function randomData() {
                $scope.lineChart.data = [];
                for(var series = 0; series < $scope.lineChart.series.length; series++) {
                    var row = [];
                    for(var label = 0; label < $scope.lineChart.labels.length; label++) {
                        row.push(Math.floor((Math.random() * 100) + 1));
                    }
                    $scope.lineChart.data.push(row);
                }
            }

            // Simulate async data update
            $scope.intervalPromise = $interval(randomData, 5000);
        }
    };
}]);


text:
package org.apache.geronimo.farm.deployment;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import org.apache.geronimo.farm.config.ClusterInfo;
import org.apache.geronimo.farm.config.NodeInfo;
import org.apache.geronimo.gbean.AbstractName;
import org.apache.geronimo.gbean.GBeanData;
import org.apache.geronimo.gbean.annotation.GBean;
import org.apache.geronimo.gbean.annotation.ParamAttribute;
import org.apache.geronimo.gbean.annotation.ParamReference;
import org.apache.geronimo.gbean.annotation.ParamSpecial;
import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
import org.apache.geronimo.kernel.config.ConfigurationData;
import org.apache.geronimo.kernel.config.ConfigurationInfo;
import org.apache.geronimo.kernel.config.ConfigurationModuleType;
import org.apache.geronimo.kernel.config.ConfigurationStore;
import org.apache.geronimo.kernel.config.InvalidConfigException;
import org.apache.geronimo.kernel.config.NoSuchConfigException;
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.geronimo.kernel.repository.WritableListableRepository;
import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @version $Rev:$ $Date:$
 */
@GBean(j2eeType=MasterConfigurationStore.GBEAN_J2EE_TYPE)
public class MasterConfigurationStore implements ConfigurationStore {
    private static final Logger log = LoggerFactory.getLogger(MasterConfigurationStore.class);

    private final ConfigurationStore delegate;
    private final Environment defaultEnvironment;
    private final ClusterInfo clusterInfo;
    private final AbstractName clusterInfoName;
    private final ClusterConfigurationStoreClient storeDelegate;
    private final ConfigurationNameBuilder configNameBuilder;

    public MasterConfigurationStore(@ParamSpecial(type=SpecialAttributeType.kernel) Kernel kernel,
            @ParamSpecial(type=SpecialAttributeType.objectName) String objectName,
            @ParamSpecial(type=SpecialAttributeType.abstractName) AbstractName abstractName,
            @ParamReference(name=GBEAN_REF_REPOSITORY, namingType="Repository") WritableListableRepository repository,
            @ParamAttribute(name=GBEAN_ATTR_DEFAULT_ENV) Environment defaultEnvironment,
            @ParamReference(name=GBEAN_REF_CLUSTER_INFO) ClusterInfo clusterInfo,
            @ParamReference(name=GBEAN_REF_CLUSTER_CONF_STORE_CLIENT) ClusterConfigurationStoreClient storeDelegate) {
        if (null == kernel) {
            throw new IllegalArgumentException("kernel is required");
        } else if (null == objectName) {
            throw new IllegalArgumentException("objectName is required");
        } else if (null == repository) {
            throw new IllegalArgumentException("repository is required");
        } else if (null == defaultEnvironment) {
            throw new IllegalArgumentException("defaultEnvironment is required");
        } else if (null == clusterInfo) {
            throw new IllegalArgumentException("clusterInfo is required");
        } else if (null == storeDelegate) {
            throw new IllegalArgumentException("storeDelegate is required");
        }
        this.defaultEnvironment = defaultEnvironment;
        this.clusterInfo = clusterInfo;
        this.storeDelegate = storeDelegate;

        configNameBuilder = newMasterConfigurationNameBuilder();
        clusterInfoName = kernel.getAbstractNameFor(clusterInfo);
        delegate = newConfigurationStore(kernel, objectName, abstractName, repository);
    }

    public boolean containsConfiguration(Artifact configId) {
        if (!configNameBuilder.isMasterConfigurationName(configId)) {
            return false;
        }
        return delegate.containsConfiguration(configId);
    }

    public File createNewConfigurationDir(Artifact configId) throws ConfigurationAlreadyExistsException {
        return delegate.createNewConfigurationDir(configId);
    }

    public void exportConfiguration(Artifact configId, OutputStream output) throws IOException, NoSuchConfigException {
        ensureArtifactForMasterConfiguration(configId);
        delegate.exportConfiguration(configId, output);
    }

    public AbstractName getAbstractName() {
        return delegate.getAbstractName();
    }

    public String getObjectName() {
        return delegate.getObjectName();
    }

    public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
        storeDelegate.install(clusterInfo, configurationData);

        installSlaveConfiguration(configurationData);

        Environment environment = configurationData.getEnvironment();
        Artifact slaveConfigId = environment.getConfigId();
        Artifact masterConfigId = configNameBuilder.buildMasterConfigurationName(slaveConfigId);
        environment.setConfigId(masterConfigId);
        installMasterConfiguration(configurationData, slaveConfigId);
    }

    public boolean isInPlaceConfiguration(Artifact configId) throws NoSuchConfigException, IOException {
        ensureArtifactForMasterConfiguration(configId);
        return false;
    }

    public List<ConfigurationInfo> listConfigurations() {
        List<ConfigurationInfo> configurationInfos = delegate.listConfigurations();

        List<ConfigurationInfo> filteredConfigurationInfos = new ArrayList<ConfigurationInfo>();
        for (ConfigurationInfo configurationInfo : configurationInfos) {
            if (configNameBuilder.isMasterConfigurationName(configurationInfo.getConfigID())) {
                filteredConfigurationInfos.add(configurationInfo);
            }
        }

        return filteredConfigurationInfos;
    }

    public ConfigurationData loadConfiguration(Artifact configId)
            throws NoSuchConfigException, IOException, InvalidConfigException {
        ensureArtifactForMasterConfiguration(configId);
        return delegate.loadConfiguration(configId);
    }

    public Set<URL> resolve(Artifact configId, String moduleName, String path)
            throws NoSuchConfigException, MalformedURLException {
        ensureArtifactForMasterConfiguration(configId);
        return delegate.resolve(configId, moduleName, path);
    }

    public void uninstall(Artifact configId) throws NoSuchConfigException, IOException {
        ensureArtifactForMasterConfiguration(configId);

        Artifact slaveConfigId = configNameBuilder.buildSlaveConfigurationName(configId);
        storeDelegate.uninstall(clusterInfo, slaveConfigId);

        try {
            delegate.uninstall(slaveConfigId);
        } catch (Exception e) {
            log.warn("Exception when uninstalling [" + slaveConfigId + "]", e);
        }
        delegate.uninstall(configId);
    }

    protected void ensureArtifactForMasterConfiguration(Artifact configId) throws NoSuchConfigException {
        if (!configNameBuilder.isMasterConfigurationName(configId)) {
            throw new NoSuchConfigException(configId);
        }
    }

    protected ConfigurationStore newConfigurationStore(Kernel kernel,
        String objectName,
        AbstractName abstractName,
        WritableListableRepository repository) {
        //TODO OSGI is anything missing?
        return new RepositoryConfigurationStore(repository);
    }

    protected ConfigurationNameBuilder newMasterConfigurationNameBuilder() {
        return new BasicConfigurationNameBuilder();
    }

    protected void installMasterConfiguration(ConfigurationData configurationData, Artifact slaveConfigId)
            throws IOException, InvalidConfigException {
        ConfigurationData masterConfigurationData = buildMasterConfigurationData(configurationData, slaveConfigId);
        try {
            delegate.install(masterConfigurationData);
        } catch (Exception e) {
            storeDelegate.uninstall(clusterInfo, slaveConfigId);
            try {
                delegate.uninstall(slaveConfigId);
            } catch (NoSuchConfigException nestedE) {
            }
            if (e instanceof IOException) {
                throw (IOException) e;
            } else if (e instanceof InvalidConfigException) {
                throw (InvalidConfigException) e;
            }
            throw (IOException) new IOException("See nested").initCause(e);
        }
    }

    protected void installSlaveConfiguration(ConfigurationData configurationData)
            throws IOException, InvalidConfigException {
        try {
            delegate.install(configurationData);
        } catch (Exception e) {
            storeDelegate.uninstall(clusterInfo, configurationData.getId());
            if (e instanceof IOException) {
                throw (IOException) e;
            } else if (e instanceof InvalidConfigException) {
                throw (InvalidConfigException) e;
            }
            throw (IOException) new IOException("See nested").initCause(e);
        }
    }

    protected ConfigurationData buildMasterConfigurationData(ConfigurationData configurationData,
        Artifact slaveConfigId) {
        Environment environment = buildEnvironment(configurationData);

        Artifact configId = environment.getConfigId();

        List<GBeanData> gbeans = buildControllerGBeans(configId, slaveConfigId);

        File configurationDir = delegate.createNewConfigurationDir(configId);

        return new ConfigurationData(ConfigurationModuleType.CAR,
            gbeans,
            Collections.EMPTY_MAP,
            environment,
            configurationDir,
            null,
            configurationData.getNaming());
    }

    protected Environment buildEnvironment(ConfigurationData configurationData) {
        Environment environment = new Environment(defaultEnvironment);
        environment.setConfigId(configurationData.getId());
        return environment;
    }

    protected List<GBeanData> buildControllerGBeans(Artifact configId, Artifact slaveConfigId) {
        List<GBeanData> gbeans = new ArrayList<GBeanData>();
        for (NodeInfo nodeInfo : clusterInfo.getNodeInfos()) {
            GBeanData gbean = buildControllerGBean(configId, nodeInfo, slaveConfigId);
            gbeans.add(gbean);
        }
        return gbeans;
    }

    protected GBeanData buildControllerGBean(Artifact configId, NodeInfo nodeInfo, Artifact slaveConfigId) {
        AbstractName controllerName = buildControllerName(configId, nodeInfo);

        GBeanData gbean = new GBeanData(controllerName, BasicClusterConfigurationController.class);
        gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_ARTIFACT, slaveConfigId);
        gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_IGNORE_START_CONF_FAIL_UPON_START,
            Boolean.TRUE);
        gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_NODE_NAME, nodeInfo.getName());
        gbean.setAttribute(BasicClusterConfigurationController.GBEAN_ATTR_START_CONF_UPON_START, Boolean.TRUE);
        gbean.setReferencePattern(BasicClusterConfigurationController.GBEAN_REF_CLUSTER_INFO, clusterInfoName);
        return gbean;
    }

    protected AbstractName buildControllerName(Artifact configId,
            NodeInfo nodeInfo) {
        return new AbstractName(configId, Collections.singletonMap("nodeName", nodeInfo.getName()));
    }

    public static final String GBEAN_J2EE_TYPE = "ConfigurationStore";
    public static final String GBEAN_ATTR_DEFAULT_ENV = "defaultEnvironment";
    public static final String GBEAN_REF_REPOSITORY = "Repository";
    public static final String GBEAN_REF_CLUSTER_INFO = "ClusterInfo";
    public static final String GBEAN_REF_CLUSTER_CONF_STORE_CLIENT = "ClusterConfigurationStoreClient";
}


text:
package org.apache.camel.component.file.remote;

import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

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

/**
 *
 */
public class FromFtpNotDownloadTest extends FtpServerTestSupport {

    protected String getFtpUrl() {
        return "ftp://admin@localhost:" + getPort() + "/download?password=admin&noop=true&download=false";
    }

    @Override
    @BeforeEach
    public void setUp() throws Exception {
        super.setUp();
        prepareFtpServer();
    }

    @Test
    public void testNotDownload() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.message(0).body().isNull();
        mock.message(0).header(Exchange.FILE_NAME).isEqualTo("hello.txt");

        mock.assertIsSatisfied();
    }

    private void prepareFtpServer() throws Exception {
        Endpoint endpoint = context.getEndpoint(getFtpUrl());
        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World this file will not be downloaded");
        exchange.getIn().setHeader(Exchange.FILE_NAME, "hello.txt");
        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                from(getFtpUrl()).process(new Processor() {
                    public void process(Exchange exchange) throws Exception {
                        assertNull(exchange.getIn().getBody(), "Should not download the file");
                        assertEquals("hello.txt", exchange.getIn().getHeader(Exchange.FILE_NAME));
                    }
                }).to("mock:result");
            }
        };
    }

}


text:
streamhub-gallery is a [StreamHub App](http://apps.livefyre.com) that displays social content in a horizontal CoverFlow-like gallery.

Classic Gallery
![Gallery View](http://i.imgur.com/9VoyWji.png)

## Getting Started

The quickest way to use streamhub-gallery is to use the built version hosted on Livefyre's CDN.

### Dependencies

streamhub-gallery depends on [streamhub-sdk](https://github.com/livefyre/streamhub-sdk). Ensure it's been included in your page.

	<script src="http://cdn.livefyre.com/libs/sdk/v2.0.0/streamhub-sdk.min.gz.js"></script>

Include streamhub-gallery too.

	<script src="http://livefyre-cdn-dev.s3.amazonaws.com/libs/apps/cheung31/streamhub-gallery/v1.0.0/streamhub-gallery.min.js"></script>

Optionally, include some reasonable default CSS rules for StreamHub Content. This stylesheet is provided by the StreamHub SDK.

    <link rel="stylesheet" href="http://cdn.livefyre.com/libs/sdk/v2.0.0/streamhub-sdk.gz.css" />

### Usage

1. Require streamhub-sdk and streamhub-gallery

        var GalleryView = Livefyre.require('streamhub-gallery');

1. Now let's provide a Livefyre Collection to the ```GalleryView```. This is the source of the social content we want to display

		var Collection = Livefyre.require('streamhub-sdk/collection');
        var collection = new Collection({
            network: "labs.fyre.co",
            siteId: 315833,
            articleId: 'example'
        });

1. Create a GalleryView, passing the DOMElement to render it in (```el``` option).

        var view = new GalleryView({
        	el: document.getElementById("myGallery")
    	});

1. Pipe the collection's content into the ```GalleryView```

        collection.pipe(view);

### Changing Themes

The ```GalleryView``` constructor accepts the ```animator``` option. By passing in an instance of a ```Animator```, the Gallery view can be customized to visualize a stream to your liking. There are two animators included, ```streamhub-gallery/animators/coverflow-animator``` and ```streamhub-gallery/animators/carousel-animator```.

        var CoverflowAnimator = Livefyre.require('streamhub-gallery/animators/coverflow-animator');
        var view = new GalleryView({
        	el: document.getElementById("myGallery"),
        	animator: new CoverflowAnimator()
    	});

Coverflow
![Coverflow Gallery View](http://i.imgur.com/AC8dxxW.png)

### Number of Visible Content Slides

By default, 3 content items will appear to before/after the focused content item. If you wish to adjust the number of visible adjacent items, specifiy the ```numVisible``` option for the ```GalleryView``` constructor.

    var view = new GalleryView({
        el: document.getElementById("myGallery"),
        numVisible: 8 // Eight visible items before/after the active content view
    });


text:
//
//  LoginViewController.m
//  MVCTest
//
//  Created by zhanglei on 15/7/1.
//  Copyright (c) 2015年 zhanglei. All rights reserved.
//

#import "LoginViewController.h"

@interface LoginViewController ()

@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)login:(UIButton *)sender {

    [APPDelegate gotoMainViewController];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
"""ExampleWeightMap."""

from typing import FrozenSet, Mapping, Optional

from tensorflow_data_validation import types

# Implementation notes:
# For now this map is essentially as a defaultdict, but in the future we may
# want to implement more semantics for nested structures (for example, if
# an override for path ["x", "y"] if specified, then any children of that path
# should share the same override).
class ExampleWeightMap(object):
  """Maps a feature path to its weight feature.

  This map can be created with a "global" weight feature and path-specific
  overrides. For any given FeaturePath, its weight column is the override, if
  specified, or the "global" one.
  """

  def __init__(
      self,
      weight_feature: Optional[types.FeatureName] = None,
      per_feature_override: Optional[Mapping[types.FeaturePath,
                                             types.FeatureName]] = None):
    self._weight_feature = weight_feature
    self._per_feature_override = per_feature_override
    all_weight_features = []
    if self._per_feature_override is not None:
      all_weight_features.extend(self._per_feature_override.values())
    if self._weight_feature is not None:
      all_weight_features.append(self._weight_feature)
    self._all_weight_features = frozenset(all_weight_features)

  def get(self, feature_path: types.FeaturePath) -> Optional[types.FeatureName]:
    if self._per_feature_override is None:
      return self._weight_feature
    override = self._per_feature_override.get(feature_path)
    return self._weight_feature if override is None else override

  def all_weight_features(self) -> FrozenSet[types.FeatureName]:
    return self._all_weight_features


text:
require 'rubygems'
require 'tmpdir'
require 'optparse'
require 'rexml/document'
require 'fileutils'
require 'builder'

# given an array of texts, return a hash of the number of times each
# word appears
def concordance(texts)
  count = Hash.new(0)
  texts.each do |text|
    text.split.each do |word|
      count[word] = count[word] + 1
    end
  end
  return count
end

# boil a tweet down to its least common words
def summarize(text, concordances)
  words = text.split
  text_concordances = words.map{|word| concordances[word]}
  # Include words with the least common count
  include_words_with_count = text_concordances.sort.first
  title = words.select {|word| include_words_with_count == concordances[word]}.join(' ')
  return title
end

$options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: timeline.rb -u USERNAME"

  opts.on("-u", "--user USERNAME", String, "Username") { |u| $options[:user] = u}
end.parse!

if [:user].map {|opt| $options[opt].nil?}.include?(nil)
  puts "Usage: timeline.rb -u USERNAME"
  exit
end

statuses_xml = File.join(Dir::tmpdir, "#{$options[:user]}.xml")

system("SCREEN_NAME=#{$options[:user]} ./cat_statuses.sh > #{statuses_xml}")

xml = File.new(statuses_xml)
doc = REXML::Document.new(xml)

texts = []

REXML::XPath.each(doc, "//text") {|element| texts << element.text}

xml.close

concordances = concordance(texts)

# make timeline data for SIMILE
FileUtils.mkdir_p('timelines')

timeline_file = File.join('timelines', "#{$options[:user]}_events.xml")

File.open(timeline_file, "w") do |timeline|
  xml = File.new(statuses_xml)
  doc = REXML::Document.new(xml)
  builder = Builder::XmlMarkup.new(:indent => 1)
  builder.instruct!
  data = builder.data do |b|
    REXML::XPath.each(doc, "statuses/status") do |status|
      text = status.elements['text'].text
      builder.event( text,
                    :start => status.elements['created_at'].text,
                    :title => summarize(text, concordances))
    end
  end
  timeline.write(data)
end


text:
require_relative 'unary-element' # Load the superclass

#module Attila # Module used as a namespace

# Module containing all classes implementing the simple template engine
# used internally in Attila.
#module Templating

# Mix-in module implementing the behaviour of parent element.
# Assumption:
# Host class has a method called 'children that
#   returns the children elements.
module Composite

  public

  def composite?() true; end

  def visitable?(aContext) true; end

  # Add one child element as member of the section
  def add_child(aChild)
    children << aChild
  end

  # Add an enumerable collection of children as member of the section
  def add_children(theChildren)
    theChildren.each { |a_child| self.add_child(a_child) }
  end

  # Purpose: to render the template itself.
  # @return [String]
  def sub_render(aTransformer, aContextObject, aLevel)
    return aTransformer.transform(self, aContextObject, aLevel)
  end

  def before_children(aTransformer, aContextObject, aLevel, aCount)
    return aTransformer.prepare(self, aContextObject, aLevel, aCount)
  end

  def after_children(aTransformer, aContextObject, aLevel)
    return aTransformer.complete(self, aContextObject, aLevel)
  end

end # module

#end # module

#end # module

# End of file


text:
package cc.mallet.regression.tui;

import java.io.*;
import java.util.*;
import java.util.regex.*;

import cc.mallet.pipe.*;
import cc.mallet.pipe.iterator.*;
import cc.mallet.types.*;
import cc.mallet.util.*;

/** Load data suitable for linear and Poisson regression */

public class RegressionImporter {

	static CommandOption.File inputFile =   new CommandOption.File
		(RegressionImporter.class, "input", "FILE", true, null,
		 "The file containing data to be classified, one instance per line", null);

    static CommandOption.File outputFile = new CommandOption.File
        (RegressionImporter.class, "output", "FILE", true, new File("text.vectors"),
         "Write the instance list to this file; Using - indicates stdout.", null);

    static CommandOption.String lineRegex = new CommandOption.String
        (RegressionImporter.class, "line-regex", "REGEX", true, "^\\s*(\\S*)[\\s,]*(.*)$",
         "Regular expression containing regex-groups for response, variables and name fields.\n" +
		 "Default is response followed by explanatory variables, with no instance name.", null);

    static CommandOption.Integer labelOption = new CommandOption.Integer
        (RegressionImporter.class, "response", "INTEGER", true, 1,
         "The index of the group containing the response variables.\n" +
         "   Use 0 to indicate that the label field is not used.", null);

    static CommandOption.Integer nameOption = new CommandOption.Integer
        (RegressionImporter.class, "name", "INTEGER", true, 0,
         "The index of the group containing the instance name.\n" +
         "   Use 0 to indicate that the name field is not used.", null);

    static CommandOption.Integer dataOption = new CommandOption.Integer
        (RegressionImporter.class, "data", "INTEGER", true, 2,
         "The index of the group containing the explanatory variables.", null);

	static CommandOption.Boolean integerResponse = new CommandOption.Boolean
        (RegressionImporter.class, "integer-response", "[TRUE|FALSE]", false, false,
         "If true, interpret the response variable as an integer rather\n" +
         "   than a double precision real number. Use for Poisson regression.", null);

	static CommandOption.Boolean useFeatureValuePairs = new CommandOption.Boolean
		(RegressionImporter.class, "use-feature-value-pairs", "[TRUE|FALSE]", false, false,
         "If true, process the data field as a series of \"feature=value\" pairs rather\n" +
         "   than an ordered sequence of variables. Useful when most variables are 0.", null);

	static CommandOption.SpacedStrings fieldNames = new CommandOption.SpacedStrings
		(RegressionImporter.class, "field-names", "[A B C ...]", false, null,
		 "Use this option to specify names for the explanatory variables\n" +
		 "   when you are not using feature name/value pairs", null);

	public static void main (String[] args) throws IOException {

		// Process the command-line options
		CommandOption.setSummary (RegressionImporter.class,
                                  "A tool for importing data suitable for linear and Poisson regression");
        CommandOption.process (RegressionImporter.class, args);

		ArrayList<Pipe> pipeList = new ArrayList<Pipe>();

		if (useFeatureValuePairs.value) {
			// Break data string into tokens
			pipeList.add(new FeatureValueString2FeatureVector());
		}
		else if (fieldNames.value != null) {
			// Break the data into an array on whitespace and then convert
			//  that to a feature vector, using user-specified names.
			pipeList.add(new ValueString2FeatureVector(fieldNames.value));
		}
		else {
			// Break the data into an array on whitespace and then convert
			//  that to a feature vector.
			pipeList.add(new ValueString2FeatureVector());
		}

		// Convert the target to a numeric value,
		//  which should be an integer for Poisson regression.
		if (integerResponse.value) {
			pipeList.add(new Target2Integer());
		}
		else {
			pipeList.add(new Target2Double());
		}

		// Create an iterator that will create an instance from
		//  each line in a file by breaking the line into
		//   [NAME]  [LABEL]  [feature=value feature=value ...]
		CsvIterator reader =
			new CsvIterator(new FileReader(inputFile.value),
							lineRegex.value,
							dataOption.value, labelOption.value, nameOption.value);

		// Construct a new instance list, passing it the pipe
		//  we want to use to process instances.
		InstanceList instances = new InstanceList( new SerialPipes(pipeList) );

		// Now process each instance provided by the iterator.
		instances.addThruPipe(reader);

		System.out.println(instances.getDataAlphabet());

		instances.save(outputFile.value);

	}

}


text:
require 'spec_helper'

describe Spree::ShipmentMailer do
  let(:shipment) { FactoryGirl.create(:shipment, order: FactoryGirl.create(:completed_order_with_totals)) }

  context "shipped email" do
    let(:email) { Spree::ShipmentMailer.shipped_email(shipment) }

    specify { email.content_type.should match("text/html") }
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>RichardYang - The Blog</title>

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

    <link href="css/clean-blog.min.css" rel="stylesheet">

    <link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation
                    Menu
                </button>
                Richard Yang - The Blog

                        Home

                        About

                        Contact

About Me

                        This is what I do.

Hi! This is Li-Chia (Richard) Yang, I'm currently working as a research assistant in Music and Audio Computing Lab, Academia Sinica, Taiwan. My research covers the field of Music Information Retrieval and Machine Learning.

I focus on developing neural networks in the application of music related research, specialized in model combination, such as CNN based joint-training model and generative adversarial networks.

To know more about me, please check out my personal page.

Copyright © RichardYang-TheBlog 2017


text:
package router

import (
	"net/http"
	"strings"
)

type RetrieveTree struct {
	*Branch
}

type Branch struct {
	Static   map[string]*Branch
	Name     string
	Path     string
	Dynamic  *Branch
	Fallback http.Handler
	Leaves   []Leaf
}

func NewTree() *RetrieveTree {
	return &RetrieveTree{&Branch{}}
}

func (rt *RetrieveTree) Insert(path string, item Leaf) *Branch {
	if rt.Branch == nil {
		rt.Branch = &Branch{}
	}

	return rt.Branch.Insert(path, item)
}

type Matches struct {
	Primary   []Leaf
	Secondary []Leaf
	Fallback  http.Handler
	ID        map[string]string
}

func (rt RetrieveTree) Retrieve(path string) Matches {
	r := Matches{
		ID: map[string]string{},
	}
	if rt.Branch == nil {
		return r
	}

	splits := strings.Split(path, "/")
	current := rt.Branch
	for _, split := range splits {
		if split == "" {
			continue
		}

		if current.Fallback != nil {
			r.Fallback = current.Fallback
		}
		if current.Static == nil && current.Dynamic == nil {
			return r
		}

		if br, ok := current.Static[split]; ok {
			current = br
		} else if current.Dynamic != nil {
			current = current.Dynamic
			r.ID[current.Name] = split
		} else {
			return r
		}
	}
	r.Primary = current.Leaves
	return r
}

func (rt RetrieveTree) RetrieveWithFallback(path string) Matches {
	r := Matches{
		ID: map[string]string{},
	}
	if rt.Branch == nil {
		return r
	}

	splits := strings.Split(path, "/")
	current := rt.Branch
	backtrack := current.Dynamic

	for _, split := range splits {
		if split == "" {
			continue
		}
		if current.Static == nil && current.Dynamic == nil && backtrack == nil {
			return r
		}

		if current.Fallback != nil {
			r.Fallback = current.Fallback
		}
		if br, ok := current.Static[split]; ok {
			current = br
			if current.Dynamic != nil {
				backtrack = current.Dynamic
				r.ID["backtrack_value"] = split
			}
		} else if current.Dynamic != nil {
			current = current.Dynamic
			r.ID[current.Name] = split
			backtrack = nil
			delete(r.ID, "backtrack_value")

		} else if backtrack != nil {
			r.ID[backtrack.Name] = r.ID["backtrack_value"]
			delete(r.ID, "backtrack_value")

			if br, ok := backtrack.Static[split]; ok {
				current = br
				if backtrack.Dynamic != nil {
					backtrack = backtrack.Dynamic
					r.ID["backtrack_value"] = split
				} else {
					backtrack = nil
				}
			} else if backtrack.Dynamic != nil {
				current = backtrack.Dynamic
				backtrack = nil
				delete(r.ID, "backtrack_value")
			} else {
				return r
			}
		} else {
			return r
		}
	}
	r.Primary = current.Leaves
	if backtrack != nil {
		r.Secondary = backtrack.Leaves
	}
	return r
}
func (b *Branch) InsertPath(path string) *Branch {
	splits := strings.Split(path, "/")
	current := b
	if path == "" {
		return b
	}
	for _, split := range splits {
		if split == "" {
			continue
		}
		switch {
		// Dynamic Option
		case split[0] == ':' && current.Dynamic == nil:
			current.Dynamic = &Branch{Name: split[1:], Path: current.Path + "/" + split}
			fallthrough
		case split[0] == ':':
			current = current.Dynamic

		// Static Option
		case current.Static == nil:
			current.Static = make(map[string]*Branch)
			fallthrough
		case current.Static[split] == nil:
			current.Static[split] = &Branch{Path: current.Path + "/" + split}
			fallthrough
		default:
			current = current.Static[split]
		}
	}
	return current
}

type contexter interface {
	SetContext(map[string]interface{})
}

type prefilter interface {
	PreFilter() Result
}

type preitem interface {
	PreItem() Result
}

func (b *Branch) Insert(path string, item Leaf) *Branch {
	br := b.InsertPath(path)
	if item.Ctrl != nil {
		dc := item.Ctrl.Dupe()
		_, scok := dc.(contexter)
		item.SetContext = scok
		_, pfok := dc.(prefilter)
		item.PreFilter = pfok
		_, piok := dc.(preitem)
		item.PreItem = piok
	}

	item.Path = br.Path
	br.Leaves = append(br.Leaves, item)
	return br
}

func (rt RetrieveTree) ListLeaves() []Leaf {
	br := []*Branch{rt.Branch}
	lf := []Leaf{}
	for len(br) > 0 {
		brz := br[0]
		br = br[1:]
		lf = append(lf, brz.Leaves...)
		for _, branch := range brz.Static {
			br = append(br, branch)
		}
		if brz.Dynamic != nil {
			br = append(br, brz.Dynamic)
		}
	}
	return lf
}

type Leaf struct {
	Method               string
	Scheme               string
	Name                 string
	Item                 bool
	Action               string
	Path                 string
	Ctrl                 DupableController
	Callable             func(Controller) Result
	SetContext, SetCache bool
	PreFilter, PreItem   bool
}


text:
import { usePromise } from './promise';
import { combineResolvers, and, or } from './helper';
import { createExpressContext } from './context';
import { createResolver, Resolver, CreateResolverFunction } from './resolver';

export {
  usePromise,
  combineResolvers,
  createExpressContext,
  createResolver,
  and,
  or,
  Resolver,
  CreateResolverFunction,
};


text: <title>Koding Teamwork!</title>


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

public enum FingerState
{
    RESET = 0,
    TAP = 1,
    HOLD = 2,
    TRANSITION = 3,
    SLIDE = 4
}

public class Finger {

    private Player player;
    private Slider slider = null;

    // public Touch touch;
    public int FingerID;
    private Vector3 initialPosition;

    public NoteBase ActiveNote; // The note this finger is currently tapping/holding
    public NoteType ActiveNoteType;
    private FingerState fingerState;

    // Where is the finger on the hitboard
    private int previousNotePathID;
    private int notePathID;
    public bool isMovingSlider = false;
    public bool enableHoldNote = false; // Finger must tuch the screen before activating a hold note (as opposed to dragging from a different section of the screen)

    public Finger(int FingerID)
    {
        this.FingerID = FingerID;
        fingerState = FingerState.TAP;
        player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();

        // Set Position Based on Dev Environment
#if UNITY_EDITOR
        this.initialPosition = Input.mousePosition;
#elif UNITY_ANDROID
        this.initialPosition = Input.GetTouch(this.FingerID).position;
#endif
        // Initial Finger Tap
        FingerTap();
    }

    private void FingerTap()
    {
        Ray ray = Camera.main.ScreenPointToRay(this.initialPosition);
        Debug.Log("Init Position: " + initialPosition);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 100f, player.layermask))
        {
            // If we hit a Notepath...
            if (hit.collider.tag == "NotePath")
            {
                NotePath hitPath = hit.collider.gameObject.GetComponent<NotePath>();
                notePathID = hitPath.NotePathID;
                previousNotePathID = notePathID;
                NoteType noteType = hitPath.CheckIfValidHit();

                if (noteType != NoteType.NULL)
                {
                    ActiveNote = hitPath.ActiveNotes[0];
                }

                hitPath.Tapped();

                player.hitNotePathWithFinger = true;
            }

            // Edit this code to match what we want for new drag notes.
            else if (hit.collider.tag == "Hitbar")
            {
                // To be replaced with setting finger position to the hitbar.
                // slider = player.Slider.GetComponent<Slider>();
                // slider.SetSliderRelativeToFinger(FingerID, hit.point);
                fingerState = FingerState.SLIDE;
            }
        }
    }

    public void ResetFinger()
    {
        ActiveNote = null;
        fingerState = FingerState.HOLD;
    }

    public void UpdateFinger()
    {

        // Update fingerState to check for transitions.
        bool cancelUpdate = UpdateFingerState();

        if (cancelUpdate)
        {
            return;
        }

        if (fingerState == FingerState.SLIDE)
        {
            if (slider != null)
            {
                slider.Move(Input.GetTouch(FingerID).position);
                return;
            }
        }

        else if (fingerState == FingerState.HOLD)
        {
            NotePath.NotePaths[notePathID].Held();
        }

        else if (fingerState == FingerState.TRANSITION)
        {
            NotePath.NotePaths[previousNotePathID].Transitioned(notePathID);
            previousNotePathID = notePathID;
        }
    }

    // Returns a cancellation request to the Update Finger function
    public bool UpdateFingerState()
    {
        // Tap -> Hold
        if (fingerState == FingerState.TAP || fingerState == FingerState.TRANSITION || fingerState == FingerState.RESET)
        {
            fingerState = FingerState.HOLD;
            return true;
        }

        // Check Hold -> Transition
#if UNITY_EDITOR
        Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
#elif UNITY_ANDROID
        Ray ray = Camera.main.ScreenPointToRay(Input.GetTouch(FingerID).position);
#endif
        RaycastHit hit;

        NotePath np = null;

        if (Physics.Raycast(ray, out hit, 100f, player.layermask))
        {
            if (hit.collider.tag == "NotePath")
            {
                np = hit.collider.gameObject.GetComponent<NotePath>();
                notePathID = np.NotePathID;
                // Debug.Log("Android Debug: Currently Holding on Note Path: " + hitObjects[i].collider.gameObject.GetComponent<NotePath>() + ", previous Note Path was :);
            }
        }

        if (np = null)
        {
            return true;
        }

        if (previousNotePathID != notePathID)
        {
            fingerState = FingerState.TRANSITION;
            return false;
        }

        return false;
    }

    public void LiftFinger()
    {
        NotePath.NotePaths[notePathID].Lifted();
    }
}


text:
class CouponsController < ApplicationController

  get '/' do

  @coupons = Coupons.all
  erb :coupons

end

end


text:
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Xunit;

namespace System.Linq.Parallel.Tests
{
    [OuterLoop]
    public static partial class ParallelQueryCombinationTests
    {
        private const int DefaultStart = 8;
        private const int DefaultSize = 16;

        private const int CountFactor = 8;
        private const int GroupFactor = 8;

        private static readonly Operation DefaultSource = (start, count, ignore) => ParallelEnumerable.Range(start, count);
        private static readonly Labeled<Operation> LabeledDefaultSource = Label("Default", DefaultSource);

        private static readonly Labeled<Operation> Failing = Label("ThrowOnFirstEnumeration", (start, count, source) => Enumerables<int>.ThrowOnEnumeration().AsParallel());

        private static IEnumerable<Labeled<Operation>> UnorderedRangeSources()
        {
            // The difference between this and the existing sources is more control is needed over the range creation.
            // Specifically, start/count won't be known until the nesting level is resolved at runtime.
            yield return Label("ParallelEnumerable.Range", (start, count, ignore) => ParallelEnumerable.Range(start, count));
            yield return Label("Enumerable.Range", (start, count, ignore) => Enumerable.Range(start, count).AsParallel());
            yield return Label("Array", (start, count, ignore) => Enumerable.Range(start, count).ToArray().AsParallel());
            yield return Label("Partitioner", (start, count, ignore) => Partitioner.Create(Enumerable.Range(start, count).ToArray()).AsParallel());
            yield return Label("List", (start, count, ignore) => Enumerable.Range(start, count).ToList().AsParallel());
            yield return Label("ReadOnlyCollection", (start, count, ignore) => new ReadOnlyCollection<int>(Enumerable.Range(start, count).ToList()).AsParallel());
        }

        private static IEnumerable<Labeled<Operation>> RangeSources()
        {
            foreach (Labeled<Operation> source in UnorderedRangeSources())
            {
                yield return source.AsOrdered();
                foreach (Labeled<Operation> ordering in OrderOperators())
                {
                    yield return source.Append(ordering);
                }
            }
        }

        private static IEnumerable<Labeled<Operation>> OrderOperators()
        {
            yield return Label("OrderBy", (start, count, source) => source(start, count).OrderBy(x => x));
            yield return Label("OrderByDescending", (start, count, source) => source(start, count).OrderByDescending(x => -x));
            yield return Label("ThenBy", (start, count, source) => source(start, count).OrderBy(x => 0).ThenBy(x => x));
            yield return Label("ThenByDescending", (start, count, source) => source(start, count).OrderBy(x => 0).ThenByDescending(x => -x));
        }

        private static IEnumerable<Labeled<Operation>> ReverseOrderOperators()
        {
            yield return Label("OrderBy-Reversed", (start, count, source) => source(start, count).OrderBy(x => x, ReverseComparer.Instance));
            yield return Label("OrderByDescending-Reversed", (start, count, source) => source(start, count).OrderByDescending(x => -x, ReverseComparer.Instance));
            yield return Label("ThenBy-Reversed", (start, count, source) => source(start, count).OrderBy(x => 0).ThenBy(x => x, ReverseComparer.Instance));
            yield return Label("ThenByDescending-Reversed", (start, count, source) => source(start, count).OrderBy(x => 0).ThenByDescending(x => -x, ReverseComparer.Instance));
        }

        public static IEnumerable<object[]> OrderFailingOperators()
        {
            foreach (Labeled<Operation> operation in new[] {
                    Label("OrderBy", (start, count, s) => s(start, count).OrderBy<int, int>(x => {throw new DeliberateTestException(); })),
                    Label("OrderBy-Comparer", (start, count, s) => s(start, count).OrderBy(x => x, new FailingComparer())),
                    Label("OrderByDescending", (start, count, s) => s(start, count).OrderByDescending<int, int>(x => {throw new DeliberateTestException(); })),
                    Label("OrderByDescending-Comparer", (start, count, s) => s(start, count).OrderByDescending(x => x, new FailingComparer())),
                    Label("ThenBy", (start, count, s) => s(start, count).OrderBy(x => 0).ThenBy<int, int>(x => {throw new DeliberateTestException(); })),
                    Label("ThenBy-Comparer", (start, count, s) => s(start, count).OrderBy(x => 0).ThenBy(x => x, new FailingComparer())),
                    Label("ThenByDescending", (start, count, s) => s(start, count).OrderBy(x => 0).ThenByDescending<int, int>(x => {throw new DeliberateTestException(); })),
                    Label("ThenByDescending-Comparer", (start, count, s) => s(start, count).OrderBy(x => 0).ThenByDescending(x => x, new FailingComparer())),
                })
            {
                yield return new object[] { LabeledDefaultSource, operation };
            }

            foreach (Labeled<Operation> operation in OrderOperators())
            {
                yield return new object[] { Failing, operation };
            }
        }

        public static IEnumerable<object[]> OrderCancelingOperators()
        {
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("OrderBy-Comparer", (source, cancel) => source.OrderBy(x => x, new CancelingComparer(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("OrderByDescending-Comparer", (source, cancel) => source.OrderByDescending(x => x, new CancelingComparer(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("ThenBy-Comparer", (source, cancel) => source.OrderBy(x => 0).ThenBy(x => x, new CancelingComparer(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("ThenByDescending-Comparer", (source, cancel) => source.OrderBy(x => 0).ThenByDescending(x => x, new CancelingComparer(cancel))) };
        }

        public static IEnumerable<object[]> UnaryOperations()
        {
            yield return new object[] { Label("Cast", (start, count, source) => source(start, count).Cast<int>()) };
            yield return new object[] { Label("DefaultIfEmpty", (start, count, source) => source(start, count).DefaultIfEmpty()) };
            yield return new object[] { Label("Distinct", (start, count, source) => source(start * 2, count * 2).Select(x => x / 2).Distinct(new ModularCongruenceComparer(count))) };
            yield return new object[] { Label("OfType", (start, count, source) => source(start, count).OfType<int>()) };
            yield return new object[] { Label("Reverse", (start, count, source) => source(start, count).Reverse()) };

            yield return new object[] { Label("GroupBy", (start, count, source) => source(start, count * CountFactor).GroupBy(x => (x - start) % count, new ModularCongruenceComparer(count)).Select(g => g.Key + start)) };
            yield return new object[] { Label("GroupBy-ElementSelector", (start, count, source) => source(start, count * CountFactor).GroupBy(x => x % count, y => y + 1, new ModularCongruenceComparer(count)).Select(g => g.Min() - 1)) };
            yield return new object[] { Label("GroupBy-ResultSelector", (start, count, source) => source(start, count * CountFactor).GroupBy(x => (x - start) % count, (key, g) => key + start, new ModularCongruenceComparer(count))) };
            yield return new object[] { Label("GroupBy-ElementSelector-ResultSelector", (start, count, source) => source(start, count * CountFactor).GroupBy(x => x % count, y => y + 1, (key, g) => g.Min() - 1, new ModularCongruenceComparer(count))) };

            yield return new object[] { Label("Select", (start, count, source) => source(start - count, count).Select(x => x + count)) };
            yield return new object[] { Label("Select-Index", (start, count, source) => source(start - count, count).Select((x, index) => x + count)) };

            yield return new object[] { Label("SelectMany", (start, count, source) => source(0, (count - 1) / CountFactor + 1).SelectMany(x => Enumerable.Range(start + x * CountFactor, Math.Min(CountFactor, count - x * CountFactor)))) };
            yield return new object[] { Label("SelectMany-Index", (start, count, source) => source(0, (count - 1) / CountFactor + 1).SelectMany((x, index) => Enumerable.Range(start + x * CountFactor, Math.Min(CountFactor, count - x * CountFactor)))) };
            yield return new object[] { Label("SelectMany-ResultSelector", (start, count, source) => source(0, (count - 1) / CountFactor + 1).SelectMany(x => Enumerable.Range(0, Math.Min(CountFactor, count - x * CountFactor)), (group, element) => start + group * CountFactor + element)) };
            yield return new object[] { Label("SelectMany-Index-ResultSelector", (start, count, source) => source(0, (count - 1) / CountFactor + 1).SelectMany((x, index) => Enumerable.Range(0, Math.Min(CountFactor, count - x * CountFactor)), (group, element) => start + group * CountFactor + element)) };

            yield return new object[] { Label("Where", (start, count, source) => source(start - count / 2, count * 2).Where(x => x >= start && x < start + count)) };
            yield return new object[] { Label("Where-Index", (start, count, source) => source(start - count / 2, count * 2).Where((x, index) => x >= start && x < start + count)) };
        }

        public static IEnumerable<object[]> UnaryUnorderedOperators()
        {
            foreach (Labeled<Operation> source in UnorderedRangeSources())
            {
                foreach (Labeled<Operation> operation in UnaryOperations().Select(i => i[0]))
                {
                    yield return new object[] { source, operation };
                }
            }
        }

        private static IEnumerable<Labeled<Operation>> SkipTakeOperations()
        {
            // Take/Skip-based operations require ordered input, or will disobey
            // the [start, start + count) convention expected in tests.
            yield return Label("Skip", (start, count, source) => source(start - count, count * 2).Skip(count));
            yield return Label("SkipWhile", (start, count, source) => source(start - count, count * 2).SkipWhile(x => x < start));
            yield return Label("SkipWhile-Index", (start, count, source) => source(start - count, count * 2).SkipWhile((x, index) => x < start));
            yield return Label("Take", (start, count, source) => source(start, count * 2).Take(count));
            yield return Label("TakeWhile", (start, count, source) => source(start, count * 2).TakeWhile(x => x < start + count));
            yield return Label("TakeWhile-Index", (start, count, source) => source(start, count * 2).TakeWhile((x, index) => x < start + count));
        }

        public static IEnumerable<object[]> SkipTakeOperators()
        {
            foreach (Labeled<Operation> source in RangeSources())
            {
                foreach (Labeled<Operation> operation in SkipTakeOperations())
                {
                    yield return new object[] { source, operation };
                }
            }
        }

        public static IEnumerable<object[]> UnaryOperators()
        {
            // Apply an ordered source to each operation
            foreach (Labeled<Operation> source in RangeSources())
            {
                foreach (Labeled<Operation> operation in UnaryOperations().Select(i => i[0]).Where(op => !op.ToString().Contains("Reverse")))
                {
                    yield return new object[] { source, operation };
                }
            }

            Labeled<Operation> reverse = UnaryOperations().Select(i => (Labeled<Operation>)i[0]).Where(op => op.ToString().Contains("Reverse")).Single();
            foreach (Labeled<Operation> source in UnorderedRangeSources())
            {
                foreach (Labeled<Operation> ordering in ReverseOrderOperators())
                {
                    yield return new object[] { source.Append(ordering), reverse };
                }
            }

            // Apply ordering to the output of each operation
            foreach (Labeled<Operation> source in UnorderedRangeSources())
            {
                foreach (Labeled<Operation> operation in UnaryOperations().Select(i => i[0]))
                {
                    foreach (Labeled<Operation> ordering in OrderOperators())
                    {
                        yield return new object[] { source, operation.Append(ordering) };
                    }
                }
            }

            foreach (object[] parms in SkipTakeOperators())
            {
                yield return parms;
            }
        }

        public static IEnumerable<object[]> UnaryFailingOperators()
        {
            foreach (Labeled<Operation> operation in new[] {
                    Label("Distinct", (start, count, s) => s(start, count).Distinct(new FailingEqualityComparer<int>())),
                    Label("GroupBy", (start, count, s) => s(start, count).GroupBy<int, int>(x => {throw new DeliberateTestException(); }).Select(g => g.Key)),
                    Label("GroupBy-Comparer", (start, count, s) => s(start, count).GroupBy(x => x, new FailingEqualityComparer<int>()).Select(g => g.Key)),
                    Label("GroupBy-ElementSelector", (start, count, s) => s(start, count).GroupBy<int, int, int>(x => x, x => { throw new DeliberateTestException(); }).Select(g => g.Key)),
                    Label("GroupBy-ResultSelector", (start, count, s) => s(start, count).GroupBy<int, int, int, int>(x => x, x => x, (x, g) => { throw new DeliberateTestException(); })),
                    Label("Select", (start, count, s) => s(start, count).Select<int, int>(x => {throw new DeliberateTestException(); })),
                    Label("Select-Index", (start, count, s) => s(start, count).Select<int, int>((x, index) => {throw new DeliberateTestException(); })),
                    Label("SelectMany", (start, count, s) => s(start, count).SelectMany<int, int>(x => {throw new DeliberateTestException(); })),
                    Label("SelectMany-Index", (start, count, s) => s(start, count).SelectMany<int, int>((x, index) => {throw new DeliberateTestException(); })),
                    Label("SelectMany-ResultSelector", (start, count, s) => s(start, count).SelectMany<int, int, int>(x => Enumerable.Range(x, 2), (group, elem) => { throw new DeliberateTestException(); })),
                    Label("SelectMany-Index-ResultSelector", (start, count, s) => s(start, count).SelectMany<int, int, int>((x, index) => Enumerable.Range(x, 2), (group, elem) => { throw new DeliberateTestException(); })),
                    Label("SkipWhile", (start, count, s) => s(start, count).SkipWhile(x => {throw new DeliberateTestException(); })),
                    Label("SkipWhile-Index", (start, count, s) => s(start, count).SkipWhile((x, index) => {throw new DeliberateTestException(); })),
                    Label("TakeWhile", (start, count, s) => s(start, count).TakeWhile(x => {throw new DeliberateTestException(); })),
                    Label("TakeWhile-Index", (start, count, s) => s(start, count).SkipWhile((x, index) => {throw new DeliberateTestException(); })),
                    Label("Where", (start, count, s) => s(start, count).Where(x => {throw new DeliberateTestException(); })),
                    Label("Where-Index", (start, count, s) => s(start, count).Where((x, index) => {throw new DeliberateTestException(); })),
                    })
            {
                yield return new object[] { LabeledDefaultSource, operation };
            }

            foreach (Labeled<Operation> operation in UnaryOperations().Select(i => i[0]).Cast<Labeled<Operation>>().Concat(SkipTakeOperations()))
            {
                yield return new object[] { Failing, operation };
            }
        }

        public static IEnumerable<object[]> UnaryCancelingOperators()
        {
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Distinct", (source, cancel) => source.Distinct(new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("GroupBy-Comparer", (source, cancel) => source.GroupBy(x => x, new CancelingEqualityComparer<int>(cancel)).Select(g => g.Key)) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("SelectMany", (source, cancel) => source.SelectMany(x => { cancel(); return new[] { x }; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("SelectMany-Index", (source, cancel) => source.SelectMany((x, index) => { cancel(); return new[] { x }; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("SelectMany-ResultSelector", (source, cancel) => source.SelectMany(x => new[] { x }, (group, elem) => { cancel(); return elem; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("SelectMany-Index-ResultSelector", (source, cancel) => source.SelectMany((x, index) => new[] { x }, (group, elem) => { cancel(); return elem; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("SkipWhile", (source, cancel) => source.SkipWhile(x => { cancel(); return true; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("SkipWhile-Index", (source, cancel) => source.SkipWhile((x, index) => { cancel(); return true; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("TakeWhile", (source, cancel) => source.TakeWhile(x => { cancel(); return true; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("TakeWhile-Index", (source, cancel) => source.TakeWhile((x, index) => { cancel(); return true; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Where", (source, cancel) => source.Where(x => { cancel(); return true; })) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Where-Index", (source, cancel) => source.Where((x, index) => { cancel(); return true; })) };
        }

        private static IEnumerable<Labeled<Operation>> BinaryOperations(Labeled<Operation> otherSource)
        {
            string label = otherSource.ToString();
            Operation other = otherSource.Item;

            yield return Label("Concat-Right:" + label, (start, count, source) => source(start, count / 2).Concat(other(start + count / 2, count / 2 + count % 2)));
            yield return Label("Concat-Left:" + label, (start, count, source) => other(start, count / 2).Concat(source(start + count / 2, count / 2 + count % 2)));

            // Comparator needs to cover _source_ size, as which of two "equal" items is returned is undefined for unordered collections.
            yield return Label("Except-Right:" + label, (start, count, source) => source(start, count + count / 2).Except(other(start + count, count), new ModularCongruenceComparer(count * 2)));
            yield return Label("Except-Left:" + label, (start, count, source) => other(start, count + count / 2).Except(source(start + count, count), new ModularCongruenceComparer(count * 2)));

            yield return Label("GroupJoin-Right:" + label, (start, count, source) => source(start, count).GroupJoin(other(start, count * CountFactor), x => x, y => y % count, (x, g) => g.Min(), new ModularCongruenceComparer(count)));
            yield return Label("GroupJoin-Left:" + label, (start, count, source) => other(start, count).GroupJoin(source(start, count * CountFactor), x => x, y => y % count, (x, g) => g.Min(), new ModularCongruenceComparer(count)));

            // Comparator needs to cover _source_ size, as which of two "equal" items is returned is undefined.
            yield return Label("Intersect-Right:" + label, (start, count, source) => source(start, count + count / 2).Intersect(other(start - count / 2, count + count / 2), new ModularCongruenceComparer(count * 2)));
            yield return Label("Intersect-Left:" + label, (start, count, source) => other(start, count + count / 2).Intersect(source(start - count / 2, count + count / 2), new ModularCongruenceComparer(count * 2)));

            yield return Label("Join-Right:" + label, (start, count, source) => source(0, count).Join(other(start, count), x => x, y => y - start, (x, y) => x + start, new ModularCongruenceComparer(count)));
            yield return Label("Join-Left:" + label, (start, count, source) => other(0, count).Join(source(start, count), x => x, y => y - start, (x, y) => x + start, new ModularCongruenceComparer(count)));

            yield return Label("Union-Right:" + label, (start, count, source) => source(start, count * 3 / 4).Union(other(start + count / 2, count / 2 + count % 2), new ModularCongruenceComparer(count)));
            yield return Label("Union-Left:" + label, (start, count, source) => other(start, count * 3 / 4).Union(source(start + count / 2, count / 2 + count % 2), new ModularCongruenceComparer(count)));

            // When both sources are unordered any element can be matched to any other, so a different check is required.
            yield return Label("Zip-Unordered-Right:" + label, (start, count, source) => source(0, count).Zip(other(start * 2, count), (x, y) => x + start));
            yield return Label("Zip-Unordered-Left:" + label, (start, count, source) => other(start * 2, count).Zip(source(0, count), (x, y) => y + start));
        }

        public static IEnumerable<object[]> BinaryOperations()
        {
            return BinaryOperations(LabeledDefaultSource).Select(op => new object[] { op });
        }

        public static IEnumerable<object[]> BinaryUnorderedOperators()
        {
            foreach (Labeled<Operation> source in UnorderedRangeSources())
            {
                // Operations having multiple paths to check.
                foreach (Labeled<Operation> operation in BinaryOperations(LabeledDefaultSource))
                {
                    yield return new object[] { source, operation };
                }
            }
        }

        public static IEnumerable<object[]> BinaryOperators()
        {
            foreach (Labeled<Operation> source in RangeSources())
            {
                // Each binary can work differently, depending on which of the two source queries (or both) is ordered.

                // For most, only the ordering of the first query is important
                foreach (Labeled<Operation> operation in BinaryOperations(LabeledDefaultSource).Where(op => !(op.ToString().StartsWith("Union") || op.ToString().StartsWith("Zip") || op.ToString().StartsWith("Concat")) && op.ToString().Contains("Right")))
                {
                    yield return new object[] { source, operation };
                }

                // For Concat and Union, both sources must be ordered
                foreach (var operation in BinaryOperations(RangeSources().First()).Where(op => op.ToString().StartsWith("Concat") || op.ToString().StartsWith("Union")))
                {
                    yield return new object[] { source, operation };
                }

                // Zip is the same as Concat, but has a special check for matching indices (as compared to unordered)
                foreach (Labeled<Operation> operation in new[] {
                    Label("Zip-Ordered-Right", (start, count, s) => s(0, count).Zip(DefaultSource(start * 2, count).AsOrdered(), (x, y) => (x + y) / 2)),
                    Label("Zip-Ordered-Left", (start, count, s) => DefaultSource(start * 2, count).AsOrdered().Zip(s(0, count), (x, y) => (x + y) / 2))
                })
                {
                    yield return new object[] { source, operation };
                }
            }

            // Ordering the output should always be safe
            foreach (object[] parameters in BinaryUnorderedOperators())
            {
                foreach (Labeled<Operation> ordering in OrderOperators())
                {
                    yield return new[] { parameters[0], ((Labeled<Operation>)parameters[1]).Append(ordering) };
                }
            }
        }

        public static IEnumerable<object[]> BinaryFailingOperators()
        {
            Labeled<Operation> failing = Label("Failing", (start, count, s) => s(start, count).Select<int, int>(x => { throw new DeliberateTestException(); }));

            foreach (Labeled<Operation> operation in BinaryOperations(LabeledDefaultSource))
            {
                yield return new object[] { LabeledDefaultSource.Append(failing), operation };
                yield return new object[] { Failing, operation };
            }

            foreach (Labeled<Operation> operation in new[]
                {
                     Label("Except-Fail", (start, count, s) => s(start, count).Except(DefaultSource(start, count), new FailingEqualityComparer<int>())),
                     Label("GroupJoin-Fail", (start, count, s) => s(start, count).GroupJoin(DefaultSource(start, count), x => x, y => y, (x, g) => x, new FailingEqualityComparer<int>())),
                     Label("Intersect-Fail", (start, count, s) => s(start, count).Intersect(DefaultSource(start, count), new FailingEqualityComparer<int>())),
                     Label("Join-Fail", (start, count, s) => s(start, count).Join(DefaultSource(start, count), x => x, y => y, (x, y) => x, new FailingEqualityComparer<int>())),
                     Label("Union-Fail", (start, count, s) => s(start, count).Union(DefaultSource(start, count), new FailingEqualityComparer<int>())),
                     Label("Zip-Fail", (start, count, s) => s(start, count).Zip<int, int, int>(DefaultSource(start, count), (x, y) => { throw new DeliberateTestException(); })),
                })
            {
                yield return new object[] { LabeledDefaultSource, operation };
            }
        }

        public static IEnumerable<object[]> BinaryCancelingOperators()
        {
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Except", (source, cancel) => source.Except(ParallelEnumerable.Range(DefaultStart, EventualCancellationSize), new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Except-Right", (source, cancel) => ParallelEnumerable.Range(DefaultStart, EventualCancellationSize).Except(source, new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("GroupJoin", (source, cancel) => source.GroupJoin(ParallelEnumerable.Range(DefaultStart, EventualCancellationSize), x => x, y => y, (x, g) => x, new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("GroupJoin-Right", (source, cancel) => ParallelEnumerable.Range(DefaultStart, EventualCancellationSize).GroupJoin(source, x => x, y => y, (x, g) => x, new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Intersect", (source, cancel) => source.Intersect(ParallelEnumerable.Range(DefaultStart, EventualCancellationSize), new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Intersect-Right", (source, cancel) => ParallelEnumerable.Range(DefaultStart, EventualCancellationSize).Intersect(source, new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Join", (source, cancel) => source.Join(ParallelEnumerable.Range(DefaultStart, EventualCancellationSize), x => x, y => y, (x, y) => x, new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Join-Right", (source, cancel) => ParallelEnumerable.Range(DefaultStart, EventualCancellationSize).Join(source, x => x, y => y, (x, y) => x, new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Union", (source, cancel) => source.Union(ParallelEnumerable.Range(DefaultStart, EventualCancellationSize), new CancelingEqualityComparer<int>(cancel))) };
            yield return new object[] { Labeled.Label<Func<ParallelQuery<int>, Action, ParallelQuery<int>>>("Union-Right", (source, cancel) => ParallelEnumerable.Range(DefaultStart, EventualCancellationSize).Union(source, new CancelingEqualityComparer<int>(cancel))) };
        }

        public delegate ParallelQuery<int> Operation(int start, int count, Operation source = null);

        public static Labeled<Operation> Label(string label, Operation item)
        {
            return Labeled.Label(label, item);
        }

        public static Labeled<Operation> Append(this Labeled<Operation> item, Labeled<Operation> next)
        {
            Operation op = item.Item;
            Operation nxt = next.Item;
            return Label(item.ToString() + "|" + next.ToString(), (start, count, source) => nxt(start, count, (s, c, ignore) => op(s, c, source)));
        }

        public static Labeled<Operation> AsOrdered(this Labeled<Operation> query)
        {
            return query.Append(Label("AsOrdered", (start, count, source) => source(start, count).AsOrdered()));
        }
    }
}


text:
couch4j
=======

Couch4j is a Java library that integrates with [Apache CouchDB](http://couchdb.apache.org/).

Contents :

+ Getting started
+ Database Operations
+ Document Operations
+ Design Document Operations
+ Status Operations

#### Getting started

First, initialize a Session object with the right values.

```java
final Session session = new Session();
session.setHost("http://127.0.0.1:5984");
session.setDatabase("mydb");
session.setUsername("admin");
session.setPassword("p@$$w0RD");
session.setPort(5984); // this is optionnal, the default value for the port is 5984
```
_No configuration manager is provided thus allowing you to load and initialize the Session objects in accordance with how you want to work and how your project is set up._

Then, initialize the right operations object, for example, the StatusOperations object :

```java
final StatusOperations status = new StatusOperations(session);
```

You're all set, you can now issue a call to your CouchDB server :

```java
final Welcome welcome = statusOperations.getWelcome();
// print values in the Welcome instance.
```

You're now ready to move on to more complex and useful features.

#### DatabaseOperations

DatabaseOperaions get initialized the same way StatusOperations do. You can do basic database specific operations, like create a database, list the databases, etc..


text:
<?php

namespace Oro\Bundle\EntityBundle\Provider;

use Doctrine\Common\Inflector\Inflector;

use Oro\Bundle\EntityBundle\Model\EntityAlias;

class EntityAliasProvider implements EntityAliasProviderInterface
{
    /** @var EntityAliasConfigBag */
    protected $config;

    /**
     * @param EntityAliasConfigBag $config
     */
    public function __construct(EntityAliasConfigBag $config)
    {
        $this->config = $config;
    }

    /**
     * {@inheritdoc}
     */
    public function getEntityAlias($entityClass)
    {
        // check for the exclusion list
        if ($this->config->isEntityAliasExclusionExist($entityClass)) {
            return false;
        }

        // check for explicitly configured aliases
        if ($this->config->hasEntityAlias($entityClass)) {
            return $this->config->getEntityAlias($entityClass);
        }

        // check Gedmo translatable entities
        if (is_a($entityClass, 'Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation', true)) {
            return false;
        }
        if (is_a($entityClass, 'Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation', true)) {
            return false;
        }

        // generate default aliases
        $name = $this->getEntityName($entityClass);

        return new EntityAlias(
            strtolower($name),
            strtolower(Inflector::pluralize($name))
        );
    }

    /**
     * @param string $entityClass
     *
     * @return string
     */
    protected function getEntityName($entityClass)
    {
        return $this->isOroEntity($entityClass)
            ? $this->getOroName($entityClass)
            : $this->getExternalName($entityClass);
    }

    /**
     * Determines whether the given entity is from one of Oro bundles.
     *
     * @param string $entityClass
     *
     * @return bool
     */
    protected function isOroEntity($entityClass)
    {
        return $this->startsWith($entityClass, 'Oro');
    }

    /**
     * Returns a string which is used to build entity aliases for entities from Oro bundles
     *
     * @param string $entityClass
     *
     * @return string
     */
    protected function getOroName($entityClass)
    {
        return str_replace('_', '', $this->getShortClassName($entityClass));
    }

    /**
     * Returns a string which is used to build entity aliases for entities from 3-td party bundles
     *
     * @param string $entityClass
     *
     * @return string
     */
    protected function getExternalName($entityClass)
    {
        $name      = null;
        $parts     = explode('\\', $entityClass);
        $partCount = count($parts);
        if ($partCount > 3) {
            $bundlePart = $parts[$partCount - 3];
            if ($this->endsWith($bundlePart, 'Bundle')) {
                $bundleName = substr($bundlePart, 0, strlen($bundlePart) - 6);
                if (!$this->startsWith($parts[$partCount - 1], $bundleName)) {
                    $name = $bundleName . $parts[$partCount - 1];
                }

            }
        }
        if (!$name) {
            $name = $parts[$partCount - 1];
        }

        return str_replace('_', '', $name);
    }

    /**
     * Gets the short name of the class, the part without the namespace.
     *
     * @param string $className The full name of a class
     *
     * @return string
     */
    protected function getShortClassName($className)
    {
        $lastDelimiter = strrpos($className, '\\');

        return false === $lastDelimiter
            ? $className
            : substr($className, $lastDelimiter + 1);
    }

    /**
     * Determines whether the beginning of $haystack matches $needle.
     *
     * @param string $haystack The string to check
     * @param string $needle   The string to compare
     *
     * @return bool
     */
    protected function startsWith($haystack, $needle)
    {
        return strpos($haystack, $needle) === 0;
    }

    /**
     * Determines whether the ending of $haystack matches $needle.
     *
     * @param string $haystack The string to check
     * @param string $needle   The string to compare
     *
     * @return bool
     */
    protected function endsWith($haystack, $needle)
    {
        return substr($haystack, -strlen($needle)) === $needle;
    }
}


text:
import pkg

pkg.unresolved
#    <ref>


text:
import Ember from 'ember';
import App from '../../app';
import InfinityRoute from "ember-infinity/mixins/route";

export default Ember.Route.extend(InfinityRoute, {
  perPageParam: 'page[size]',
  pageParam: 'page[number]',
  totalPagesParam: 'meta.record-count',
  queryObject: {},
  storedParams: {},
  parsedQueryForServer: "",
  queryParams: {
    number: {
      refreshModel: true
    },
    year_compl: { refreshModel: true },
    tothu: { refreshModel: true },
    commsf: { refreshModel: true },
    name: { refreshModel: true },
    address: { refreshModel: true },
    municipality: { refreshModel: true },
    redevelopment: { refreshModel: true },

    asofright: { refreshModel: true },
    age_restricted: { refreshModel: true },
    clusteros: { refreshModel: true },
    cancelled: { refreshModel: true },
    'private': { refreshModel: true },
    saved: { refreshModel: true },
    // status: { refreshModel: true },
    place_id: { refreshModel: true }
  },

  filters: ["year_compl","tothu","commsf","name","address","municipality","redevelopment",
                  "status", "asofright", "age_restricted", "clusteros",
                  "phased", "cancelled", "private","saved","status", "place_id"],
  model(params) {
    this.set("storedParams", params);
    var queryObject = { filter: {} };
    var filters = this.filters;

    this.getSearchLimits();

    filters.forEach(function(property){
      if(params[property] !== null) {
        queryObject.filter[property] = params[property];
      }
    });

    // queryObject.page = {};
    // queryObject.startingPage = 1;
    queryObject.perPage = 20;
    queryObject['fields[developments]'] = "name,status,commsf,tothu,year-compl"
    // queryObject.sort = '-start-time';
    this.set('queryObject', queryObject);

    return this.infinityModel("development", queryObject)
  },

  actions: {
    search() {
      this.refresh();
    },
    reset() {
      this.resetController();
    }
  },

  setupController(controller, model, transition) {
    this._super(controller, model);

    this.controllerFor("developments.search").computeRanges();
    if(transition.queryParams.year_compl !== undefined) {
      var year = JSON.parse(transition.queryParams.year_compl);
      this.controllerFor('developments.search').setProperties({ "yearFrom": year[0], "yearTo": year[1] });
    }

    if(transition.queryParams.commsf !== undefined) {
      var commsf = JSON.parse(transition.queryParams.commsf);
      this.controllerFor('developments.search').setProperties({ "sqftFrom": commsf[0], "sqftTo": commsf[1] });
    }

    if(transition.queryParams.tothu !== undefined) {
      var tothu = JSON.parse(transition.queryParams.tothu);
      this.controllerFor('developments.search').setProperties({ "tothuFrom": tothu[0], "tothuTo": tothu[1] });
    }
    this.controllerFor('developments.search').set('queryObject', this.get('queryObject'));
  },

  resetController: function () {
    var controller = this.controllerFor("developments.search");
    this.filters.forEach((param) => {
      controller.set(param, null);
    });
    controller.rangedProperties.forEach(function(property) {
      controller.set(property.min, null);
      controller.set(property.max, null);
    });
    controller.computeRanges();
    controller.set('neighborhood_ids', null);
  },

  getSearchLimits: function() {
    http://api.lvh.me:5000/searches/limits
    var host = this.store.adapterFor('application').get('host'),
    endpoint = 'searches/limits';

    Ember.$.ajax({
        url: `${host}/${endpoint}`,
        // your other details...
    }).then((resolve) => {
        // self.set('name', resolve.doc.name);
        this.controllerFor('developments.search').set("limits", resolve);
        // process the result...
    });
  },

  getExportFilters: function() {
    var queryObject = this.get('queryObject');
    console.log(queryObject);
    this.controllerFor('developments.search').set("queryObject", queryObject);
  }.property('queryObject.filter.{year_compl,tothu,commsf,name,address,municipality,redevelopment,status,asofright,age_restricted,clusteros,phased,cancelled,private,saved,status}'),

  _canLoadMore: Ember.computed('currentPage', function() {
    var currentPage = this.get('currentPage');
    var perPage = this.get('_perPage');
    var totalRecords = this.get('_totalPages');
    if ((currentPage * perPage) > totalRecords + perPage) {
      return false;
    } else {
      return true;
    }
  })
});


text:
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Linq;
using osu.Framework.Input;
using osu.Game.Beatmaps;
using osu.Game.Input.Handlers;
using osu.Game.Replays;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Configuration;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Rulesets.Osu.Scoring;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.UI;

namespace osu.Game.Rulesets.Osu.UI
{
    public class DrawableOsuRuleset : DrawableRuleset<OsuHitObject>
    {
        protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;

        public DrawableOsuRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
            : base(ruleset, beatmap)
        {
        }

        public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);

        protected override Playfield CreatePlayfield() => new OsuPlayfield();

        protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);

        protected override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();

        public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h)
        {
            switch (h)
            {
                case HitCircle circle:
                    return new DrawableHitCircle(circle);
                case Slider slider:
                    return new DrawableSlider(slider);
                case Spinner spinner:
                    return new DrawableSpinner(spinner);
            }

            return null;
        }

        protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuFramedReplayInputHandler(replay);

        public override double GameplayStartTime
        {
            get
            {
                var first = (OsuHitObject)Objects.First();
                return first.StartTime - first.TimePreempt;
            }
        }
    }
}


text:
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=4 sw=4 et tw=99 ft=cpp:
 */

#ifndef _ejs_require_h
#define _ejs_require_h

#include "ejs.h"
#include "ejs-function.h"
#include "ejs-module.h"

EJS_BEGIN_DECLS

extern ejsval _ejs_require;

extern void _ejs_require_init(ejsval global);

void _ejs_module_resolve(EJSModule* mod);
extern ejsval _ejs_module_get (ejsval name);

EJS_END_DECLS

#endif /* _ejs_require_h */