text:
""" Information for setup.py that we may also want to access in dcmstack. Can
not import dcmstack.
"""
import sys

_version_major = 0
_version_minor = 7
_version_micro = 0
_version_extra = 'dev'
__version__ = "%s.%s.%s%s" % (_version_major,
                              _version_minor,
                              _version_micro,
                              _version_extra)

CLASSIFIERS = ["Development Status :: 3 - Alpha",
               "Environment :: Console",
               "Intended Audience :: Science/Research",
               "License :: OSI Approved :: MIT License",
               "Operating System :: OS Independent",
               "Programming Language :: Python",
               "Topic :: Scientific/Engineering"]

description = 'Stack DICOM images into volumes and convert to Nifti'

# Hard dependencies
install_requires = ['pydicom >= 0.9.7',
                    'nibabel >= 2.0.0',
                   ]
# Add version specific dependencies
if sys.version_info < (2, 6):
    raise Exception("must use python 2.6 or greater")
elif sys.version_info < (2, 7):
    install_requires.append('ordereddict')

# Extra requirements for building documentation and testing
extras_requires = {'doc':  ["sphinx", "numpydoc"],
                   'test': ["nose"],
                  }

NAME                = 'dcmstack'
AUTHOR              = "Brendan Moloney"
AUTHOR_EMAIL        = "moloney@ohsu.edu"
MAINTAINER          = "Brendan Moloney"
MAINTAINER_EMAIL    = "moloney@ohsu.edu"
DESCRIPTION         = description
LICENSE             = "MIT license"
CLASSIFIERS         = CLASSIFIERS
PLATFORMS           = "OS Independent"
ISRELEASE           = _version_extra == ''
VERSION             = __version__
INSTALL_REQUIRES    = install_requires
EXTRAS_REQUIRES      = extras_requires
PROVIDES            = ["dcmstack"]


text:
package com.sun.corba.se.PortableActivationIDL;

/**
* com/sun/corba/se/PortableActivationIDL/_ServerProxyStub.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /HUDSON3/workspace/8-2-build-linux-amd64/jdk8u121/8372/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
* Monday, December 12, 2016 4:37:46 PM PST
*/

/** Server callback interface, passed to Activator in registerServer method.
    */
public class _ServerProxyStub extends org.omg.CORBA.portable.ObjectImpl implements ServerProxy
{

  /** Shutdown this server.  Returns after orb.shutdown() completes.
  	*/
  public void shutdown ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("shutdown", true);
                $in = _invoke ($out);
                return;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                shutdown (        );
            } finally {
                _releaseReply ($in);
            }
  } // shutdown

  /** Install the server.  Returns after the install hook completes
  	* execution in the server.
  	*/
  public void install ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("install", true);
                $in = _invoke ($out);
                return;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                install (        );
            } finally {
                _releaseReply ($in);
            }
  } // install

  /** Uninstall the server.  Returns after the uninstall hook
  	* completes execution.
  	*/
  public void uninstall ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("uninstall", true);
                $in = _invoke ($out);
                return;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                uninstall (        );
            } finally {
                _releaseReply ($in);
            }
  } // uninstall

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:PortableActivationIDL/ServerProxy:1.0"};

  public String[] _ids ()
  {
    return (String[])__ids.clone ();
  }

  private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  {
     String str = s.readUTF ();
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     org.omg.CORBA.Object obj = orb.string_to_object (str);
     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
     _set_delegate (delegate);
   } finally {
     orb.destroy() ;
   }
  }

  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  {
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init (args, props);
   try {
     String str = orb.object_to_string (this);
     s.writeUTF (str);
   } finally {
     orb.destroy() ;
   }
  }
} // class _ServerProxyStub

redpajama_set_name: RedPajamaGithub


text:
<?php
//
// Copyright (c) 2013, Zynga Inc.
// https://github.com/zynga/saigon
// Author: Matt West (https://github.com/mhwest13)
// License: BSD 2-Clause
//

/*
 * Saigon API - NRPE Config Routes
 */

$app->get('/sapi/nrpecfg/:deployment(/:staged)', function ($deployment, $staged = false) use ($app) {
    check_deployment_exists($app, $deployment);
    // Load up Current Config or Staged Config
    if ($staged == 1) {
        $revs = RevDeploy::getDeploymentRevs($deployment);
        if ($revs['currrev'] == $revs['nextrev']) {
            $apiResponse = new APIViewData(1, $deployment, "Unable to detect staged revision to reference");
            $app->halt(404, $apiResponse->returnJson());
        }
        $deployRev = $revs['nextrev'];
    }
    else {
        $deployRev = RevDeploy::getDeploymentRev($deployment);
    }
    if (RevDeploy::existsDeploymentNRPECfg($deployment, $deployRev) !== false) {
        $nrpeCfgInfo = RevDeploy::getDeploymentNRPECfg($deployment, $deployRev);
        $fileContents = NRPECreate::buildNRPEFile($deployment, $deployRev, $nrpeCfgInfo);
        $apiResponse = new APIViewData(0, $deployment, false);
        $apiResponse->setExtraResponseData('md5', md5($fileContents));
        $apiResponse->setExtraResponseData('location', $nrpeCfgInfo['location']);
        $apiResponse->setExtraResponseData('file', base64_encode($fileContents));
        $apiResponse->printJson();
    }
    else {
        $apiResponse = new APIViewData(1, $deployment, "Unable to detect nrpe config file");
        $app->halt(404, $apiResponse->returnJson());
    }
})->name('saigon-api-get-nrpe-cfg');

$app->delete('/sapi/nrpecfg/:deployment', function ($deployment) use ($app) {
    check_deployment_exists($app, $deployment);
    check_auth($app, $deployment);
    check_revision_status($deployment);
    $deployRev = RevDeploy::getDeploymentNextRev($deployment);
    RevDeploy::deleteDeploymentNRPECfg($deployment, $deployRev);
    $apiResponse = new APIViewData(0, $deployment, "Successfully Removed NRPE Config");
    $apiResponse->printJson();
})->name('saigon-api-delete-nrpe-cfg');

$app->post('/sapi/nrpecfg/:deployment', function ($deployment) use ($app) {
    check_deployment_exists($app, $deployment);
    check_auth($app, $deployment);
    $request = $app->request();
    $contentType = $request->headers('Content-Type');
    if ($contentType == 'application/json') {
        $nrpeCfgInfo = $request->getBody();
        $nrpeCfgInfo = json_decode($nrpeCfgInfo,true);
    }
    elseif (preg_match("/form-(data|urlencoded)/", $contentType)) {
        $nrpeCfgInfo['location'] = $request->post('location');
        $nrpeCfgInfo['pid_file'] = $request->post('pid_file');
        $nrpeCfgInfo['server_port'] = $request->post('server_port');
        $nrpeCfgInfo['nrpe_user'] = $request->post('nrpe_user');
        $nrpeCfgInfo['nrpe_group'] = $request->post('nrpe_group');
        $nrpeCfgInfo['dont_blame_nrpe'] = $request->post('dont_blame_nrpe');
        $nrpeCfgInfo['debug'] = $request->post('debug');
        $nrpeCfgInfo['command_timeout'] = $request->post('command_timeout');
        $nrpeCfgInfo['connection_timeout'] = $request->post('connection_timeout');
        $nrpeCfgInfo['allowed_hosts'] = $request->post('allowed_hosts');
        $nrpeCfgInfo['include_dir'] = $request->post('include_dir');
        $nrpeCfgInfo['cmds'] = $request->post('cmds');
        // These two options can be "false" which is really just 0
        if ($nrpeCfgInfo['dont_blame_nrpe'] === false) $nrpeCfgInfo['dont_blame_nrpe'] = '0';
        if ($nrpeCfgInfo['debug'] === false) $nrpeCfgInfo['debug'] = '0';
    }
    // A bit of param validation
    if ((!isset($nrpeCfgInfo['location'])) || (empty($nrpeCfgInfo['location']))) {
        $apiResponse = new APIViewData(1, $deployment, "Unable to detect location parameter (unix path including filename)");
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['pid_file'])) || (empty($nrpeCfgInfo['pid_file']))) {
        $apiResponse = new APIViewData(1, $deployment, 'Unable to detect pid_file parameter (unix path including filename)');
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['server_port'])) || (empty($nrpeCfgInfo['server_port']))) {
        $apiResponse = new APIViewData(1, $deployment, "Unable to detect server_port parameter (service listening port)");
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif (($nrpeCfgInfo['server_port'] < 1024) || ($nrpeCfgInfo['server_port'] > 65536)) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to use server_port parameter specified (port is either protected or nonexistent"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['nrpe_user'])) || (empty($nrpeCfgInfo['nrpe_user']))) {
        $apiResponse = new APIViewData(1, $deployment, "Unable to detect nrpe_user parameter (user to run nrpe service as)");
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['nrpe_group'])) || (empty($nrpeCfgInfo['nrpe_group']))) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to detect nrpe_group parameter (group to run nrpe service as)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['command_timeout'])) || (empty($nrpeCfgInfo['command_timeout']))) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to detect command_timeout parameter (max time to wait for command to finish)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif (($nrpeCfgInfo['command_timeout'] < 10) || ($nrpeCfgInfo['command_timeout'] > 300)) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to use command_timeout value specified (must be between 10 and 300)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['connection_timeout'])) || (empty($nrpeCfgInfo['connection_timeout']))) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to detect connection_timeout parameter (max time to wait for connection to be established before exiting)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif (($nrpeCfgInfo['connection_timeout'] < 60) || ($nrpeCfgInfo['connection_timeout'] > 600)) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to use command_timeout value specified (must be between 60 and 600)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['allowed_hosts'])) || (empty($nrpeCfgInfo['allowed_hosts']))) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to detect allowed_hosts parameter (hosts allowed to connect to service)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    elseif ((!isset($nrpeCfgInfo['cmds'])) || (empty($nrpeCfgInfo['cmds']))) {
        $apiResponse = new APIViewData(1, $deployment,
            "Unable to detect cmds parameter (commands to activate in nrpe config)"
        );
        $app->halt(404, $apiResponse->returnJson());
    }
    // Param manipulation depending on what is detected
    if ((!isset($nrpeCfgInfo['include_dir'])) || (empty($nrpeCfgInfo['include_dir']))) {
        unset($nrpeCfgInfo['include_dir']);
    }
    check_revision_status($deployment);
    $deployRev = RevDeploy::getDeploymentNextRev($deployment);
    if (RevDeploy::existsDeploymentNRPECfg($deployment, $deployRev) === true) {
        RevDeploy::modifyDeploymentNRPECfg($deployment, $nrpeCfgInfo, $deployRev);
        $msg = "Successfully Modified NRPE Config";
    }
    else {
        RevDeploy::createDeploymentNRPECfg($deployment, $nrpeCfgInfo, $deployRev);
        $msg = "Successfully Created NRPE Config";
    }
    unset($nrpeCfgInfo);
    $nrpeCfgInfo = RevDeploy::getDeploymentNRPECfg($deployment, $deployRev);
    $fileContents = NRPECreate::buildNRPEFile($deployment, $deployRev, $nrpeCfgInfo);
    $apiResponse = new APIViewData(0, $deployment, $msg);
    $apiResponse->setExtraResponseData('md5', md5($fileContents));
    $apiResponse->printJson();
})->name('saigon-api-create-nrpe-cfg');


text:
/**
 * @author Yoio<Yoio@3cto.net>
 */
package com.yoiojava.router.builder;


text:
package org.openkilda.server42.control.serverstub;

import org.openkilda.server42.control.messaging.flowrtt.Control.AddFlow;
import org.openkilda.server42.control.messaging.flowrtt.Control.ClearFlowsFilter;
import org.openkilda.server42.control.messaging.flowrtt.Control.CommandPacket;
import org.openkilda.server42.control.messaging.flowrtt.Control.CommandPacketResponse;
import org.openkilda.server42.control.messaging.flowrtt.Control.CommandPacketResponse.Builder;
import org.openkilda.server42.control.messaging.flowrtt.Control.Flow;
import org.openkilda.server42.control.messaging.flowrtt.Control.ListFlowsFilter;
import org.openkilda.server42.control.messaging.flowrtt.Control.PushSettings;
import org.openkilda.server42.control.messaging.flowrtt.Control.RemoveFlow;

import com.google.protobuf.Any;
import com.google.protobuf.InvalidProtocolBufferException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMQ.Socket;

import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;

/**
 * The Server class implements a ZeroMQ server that simply pretends to be the full server42 C++ implementation with
 * DPDK support. Also, they must emulate the network part of flow RTT.
 */
@Service
@Slf4j
public class ControlServer extends Thread {

    private HashMap<FlowKey, Flow> flows = new HashMap<>();

    @Value("${openkilda.server42.control.zeromq.control.server.endpoint}")
    private String bindEndpoint;

    private StatsServer statsServer;

    @Autowired
    public ControlServer(StatsServer statsServer) {
        this.statsServer = statsServer;
    }

    /**
     * We get commands from zmq socket and execute them one by one.
     */
    @Override
    public void run() {
        log.info("started");
        try (ZContext context = new ZContext()) {
            Socket server = context.createSocket(ZMQ.REP);
            server.bind(bindEndpoint);
            while (!isInterrupted()) {
                byte[] request = server.recv();
                try {
                    CommandPacket commandPacket = CommandPacket.parseFrom(request);

                    Builder builder = CommandPacketResponse.newBuilder();
                    builder.setCommunicationId(commandPacket.getCommunicationId());
                    log.info("command type {}", commandPacket.getType().toString());
                    log.info("flow list before {}", flows.keySet().toString());
                    switch (commandPacket.getType()) {
                        case ADD_FLOW:
                            for (Any any : commandPacket.getCommandList()) {
                                AddFlow addFlow = any.unpack(AddFlow.class);
                                flows.put(FlowKey.fromFlow(addFlow.getFlow()), addFlow.getFlow());
                                statsServer.addFlow(addFlow.getFlow());
                            }
                            break;
                        case REMOVE_FLOW:
                            for (Any any : commandPacket.getCommandList()) {
                                RemoveFlow removeFlow = any.unpack(RemoveFlow.class);
                                FlowKey flowKey = FlowKey.fromFlow(removeFlow.getFlow());
                                flows.remove(flowKey);
                                statsServer.removeFlow(flowKey);
                            }
                            break;
                        case CLEAR_FLOWS:
                            if (commandPacket.getCommandCount() > 0) {
                                Any command = commandPacket.getCommand(0);
                                ClearFlowsFilter filter = command.unpack(ClearFlowsFilter.class);
                                List<FlowKey> keys = flows.values()
                                        .stream()
                                        .filter(flow -> flow.getDstMac().equals(filter.getDstMac()))
                                        .map(FlowKey::fromFlow)
                                        .collect(Collectors.toList());

                                flows.keySet().removeAll(keys);
                                keys.forEach(statsServer::removeFlow);
                            } else {
                                flows.clear();
                                statsServer.clearFlows();
                            }
                            break;
                        case LIST_FLOWS:
                            if (commandPacket.getCommandCount() > 0) {
                                Any command = commandPacket.getCommand(0);
                                ListFlowsFilter filter = command.unpack(ListFlowsFilter.class);
                                flows.values()
                                        .stream()
                                        .filter(flow -> flow.getDstMac().equals(filter.getDstMac()))
                                        .forEach(flow -> builder.addResponse(Any.pack(flow)));
                            } else {
                                for (Flow flow : flows.values()) {
                                    builder.addResponse(Any.pack(flow));
                                }
                            }
                            break;
                        case PUSH_SETTINGS:
                            log.warn("will be shipped with stats application");
                            Any command = commandPacket.getCommand(0);
                            PushSettings settings = command.unpack(PushSettings.class);
                            log.info(settings.toString());
                            break;
                        case UNRECOGNIZED:
                        default:
                            log.error("Unknown command type");
                            break;
                    }
                    log.info("flow list after {}", flows.keySet().toString());
                    server.send(builder.build().toByteArray());
                } catch (InvalidProtocolBufferException e) {
                    log.error("marshalling error");
                }
            }
        }
    }

    @PostConstruct
    void init() {
        this.start();
    }
}


text:
package org.spongepowered.api.util.command.dispatcher;

import static com.google.common.base.Preconditions.checkNotNull;
import static org.spongepowered.api.util.SpongeApiTranslationHelper.t;
import static org.spongepowered.api.util.command.CommandMessageFormatting.NEWLINE_TEXT;
import static org.spongepowered.api.util.command.CommandMessageFormatting.SPACE_TEXT;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.TextBuilder;
import org.spongepowered.api.text.Texts;
import org.spongepowered.api.text.action.TextActions;
import org.spongepowered.api.text.format.TextColors;
import org.spongepowered.api.text.format.TextStyles;
import org.spongepowered.api.util.GuavaCollectors;
import org.spongepowered.api.util.StartsWithPredicate;
import org.spongepowered.api.util.command.CommandCallable;
import org.spongepowered.api.util.command.CommandException;
import org.spongepowered.api.util.command.CommandMapping;
import org.spongepowered.api.util.command.CommandMessageFormatting;
import org.spongepowered.api.util.command.CommandNotFoundException;
import org.spongepowered.api.util.command.CommandResult;
import org.spongepowered.api.util.command.CommandSource;
import org.spongepowered.api.util.command.ImmutableCommandMapping;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;

import javax.annotation.Nullable;

/**
 * A simple implementation of a {@link Dispatcher}.
 */
public final class SimpleDispatcher implements Dispatcher {

    /**
     * This is a disambiguator function that returns the first matching command.
     */
    public static final Disambiguator FIRST_DISAMBIGUATOR = (source, aliasUsed, availableOptions) -> {
        for (CommandMapping mapping : availableOptions) {
            if (mapping.getPrimaryAlias().toLowerCase().equals(aliasUsed.toLowerCase())) {
                return Optional.of(mapping);
            }
        }
        return Optional.of(availableOptions.get(0));
    };

    private final Disambiguator disambiguatorFunc;
    private final ListMultimap<String, CommandMapping> commands = ArrayListMultimap.create();

    /**
     * Creates a basic new dispatcher.
     */
    public SimpleDispatcher() {
        this(FIRST_DISAMBIGUATOR);
    }

    /**
     * Creates a new dispatcher with a specific disambiguator.
     *
     * @param disambiguatorFunc Function that returns the preferred command if multiple exist for a given alias
     */
    public SimpleDispatcher(Disambiguator disambiguatorFunc) {
        this.disambiguatorFunc = disambiguatorFunc;
    }

    /**
     * Register a given command using the given list of aliases.
     *
     *
If there is a conflict with one of the aliases (i.e. that alias
     * is already assigned to another command), then the alias will be skipped.
     * It is possible for there to be no alias to be available out of
     * the provided list of aliases, which would mean that the command would not
     * be assigned to any aliases.

     *
     *
The first non-conflicted alias becomes the "primary alias."

     *
     * @param callable The command
     * @param alias An array of aliases
     * @return The registered command mapping, unless no aliases could be registered
     */
    public Optional<CommandMapping> register(CommandCallable callable, String... alias) {
        checkNotNull(alias, "alias");
        return register(callable, Arrays.asList(alias));
    }

    /**
     * Register a given command using the given list of aliases.
     *
     *
If there is a conflict with one of the aliases (i.e. that alias
     * is already assigned to another command), then the alias will be skipped.
     * It is possible for there to be no alias to be available out of
     * the provided list of aliases, which would mean that the command would not
     * be assigned to any aliases.

     *
     *
The first non-conflicted alias becomes the "primary alias."

     *
     * @param callable The command
     * @param aliases A list of aliases
     * @return The registered command mapping, unless no aliases could be registered
     */
    public Optional<CommandMapping> register(CommandCallable callable, List<String> aliases) {
        return register(callable, aliases, Function.identity());
    }

    /**
     * Register a given command using a given list of aliases.
     *
     *
The provided callback function will be called with a list of aliases
     * that are not taken (from the list of aliases that were requested) and
     * it should return a list of aliases to actually register. Aliases may be
     * removed, and if no aliases remain, then the command will not be
     * registered. It may be possible that no aliases are available, and thus
     * the callback would receive an empty list. New aliases should not be added
     * to the list in the callback as this may cause
     * {@link IllegalArgumentException} to be thrown.

     *
     *
The first non-conflicted alias becomes the "primary alias."

     *
     * @param callable The command
     * @param aliases A list of aliases
     * @param callback The callback
     * @return The registered command mapping, unless no aliases could be registered
     */
    public synchronized Optional<CommandMapping> register(CommandCallable callable, List<String> aliases,
            Function<List<String>, List<String>> callback) {
        checkNotNull(aliases, "aliases");
        checkNotNull(callable, "callable");
        checkNotNull(callback, "callback");

        // Invoke the callback with the commands that /can/ be registered
        // noinspection ConstantConditions
        aliases = ImmutableList.copyOf(callback.apply(aliases));
        if (!aliases.isEmpty()) {
            String primary = aliases.get(0);
            List<String> secondary = aliases.subList(1, aliases.size());
            CommandMapping mapping = new ImmutableCommandMapping(callable, primary, secondary);

            for (String alias : aliases) {
                this.commands.put(alias.toLowerCase(), mapping);
            }

            return Optional.of(mapping);
        } else {
            return Optional.empty();
        }
    }

    /**
     * Remove a mapping identified by the given alias.
     *
     * @param alias The alias
     * @return The previous mapping associated with the alias, if one was found
     */
    public synchronized Collection<CommandMapping> remove(String alias) {
        return this.commands.removeAll(alias.toLowerCase());
    }

    /**
     * Remove all mappings identified by the given aliases.
     *
     * @param aliases A collection of aliases
     * @return Whether any were found
     */
    public synchronized boolean removeAll(Collection<?> aliases) {
        checkNotNull(aliases, "aliases");

        boolean found = false;

        for (Object alias : aliases) {
            if (!this.commands.removeAll(alias.toString().toLowerCase()).isEmpty()) {
                found = true;
            }
        }

        return found;
    }

    /**
     * Remove a command identified by the given mapping.
     *
     * @param mapping The mapping
     * @return The previous mapping associated with the alias, if one was found
     */
    public synchronized Optional<CommandMapping> removeMapping(CommandMapping mapping) {
        checkNotNull(mapping, "mapping");

        CommandMapping found = null;

        Iterator<CommandMapping> it = this.commands.values().iterator();
        while (it.hasNext()) {
            CommandMapping current = it.next();
            if (current.equals(mapping)) {
                it.remove();
                found = current;
            }
        }

        return Optional.ofNullable(found);
    }

    /**
     * Remove all mappings contained with the given collection.
     *
     * @param mappings The collection
     * @return Whether the at least one command was removed
     */
    public synchronized boolean removeMappings(Collection<?> mappings) {
        checkNotNull(mappings, "mappings");

        boolean found = false;

        Iterator<CommandMapping> it = this.commands.values().iterator();
        while (it.hasNext()) {
            if (mappings.contains(it.next())) {
                it.remove();
                found = true;
            }
        }

        return found;
    }

    @Override
    public synchronized Set<CommandMapping> getCommands() {
        return ImmutableSet.copyOf(this.commands.values());
    }

    @Override
    public synchronized Set<String> getPrimaryAliases() {
        Set<String> aliases = new HashSet<String>();

        for (CommandMapping mapping : this.commands.values()) {
            aliases.add(mapping.getPrimaryAlias());
        }

        return Collections.unmodifiableSet(aliases);
    }

    @Override
    public synchronized Set<String> getAliases() {
        Set<String> aliases = new HashSet<String>();

        for (CommandMapping mapping : this.commands.values()) {
            aliases.addAll(mapping.getAllAliases());
        }

        return Collections.unmodifiableSet(aliases);
    }

    @Override
    public Optional<CommandMapping> get(String alias) {
        return get(alias, null);
    }

    /**
     * Get a given command in the context of a certain command source.
     *
     * @param alias The alias to look up
     * @param source The source this alias is being looked up for
     * @return the command if exactly one matches
     */
    public synchronized Optional<CommandMapping> get(String alias, @Nullable CommandSource source) {
        List<CommandMapping> results = this.commands.get(alias.toLowerCase());
        if (results.size() == 1) {
            return Optional.of(results.get(0));
        } else if (results.size() == 0 || source == null) {
            return Optional.empty();
        } else {
            return this.disambiguatorFunc.disambiguate(source, alias, results);
        }
    }

    @Override
    public synchronized boolean containsAlias(String alias) {
        return this.commands.containsKey(alias.toLowerCase());
    }

    @Override
    public boolean containsMapping(CommandMapping mapping) {
        checkNotNull(mapping, "mapping");

        for (CommandMapping test : this.commands.values()) {
            if (mapping.equals(test)) {
                return true;
            }
        }

        return false;
    }

    @Override
    public CommandResult process(CommandSource source, String commandLine) throws CommandException {
        final String[] argSplit = commandLine.split(" ", 2);
        Optional<CommandMapping> cmdOptional = get(argSplit[0], source);
        if (!cmdOptional.isPresent()) {
            throw new CommandNotFoundException(t("commands.generic.notFound"), argSplit[0]); // TODO: Fix properly to use a SpongeTranslation??
        }
        final String arguments = argSplit.length > 1 ? argSplit[1] : "";
        final CommandCallable spec = cmdOptional.get().getCallable();
        try {
            return spec.process(source, arguments);
        } catch (CommandNotFoundException e) {
            throw new CommandException(t("No such child command: %s", e.getCommand()));
        }
    }

    @Override
    public List<String> getSuggestions(CommandSource src, final String arguments) throws CommandException {
        final String[] argSplit = arguments.split(" ", 2);
        Optional<CommandMapping> cmdOptional = get(argSplit[0], src);
        if (argSplit.length == 1) {
            return filterCommands(src).stream().filter(new StartsWithPredicate(argSplit[0])).collect(GuavaCollectors.toImmutableList());
        } else if (!cmdOptional.isPresent()) {
            return ImmutableList.of();
        }
        return cmdOptional.get().getCallable().getSuggestions(src, argSplit[1]);
    }

    @Override
    public boolean testPermission(CommandSource source) {
        for (CommandMapping mapping : this.commands.values()) {
            if (mapping.getCallable().testPermission(source)) {
                return true;
            }
        }
        return false;
    }

    @Override
    public Optional<Text> getShortDescription(CommandSource source) {
        return Optional.empty();
    }

    @Override
    public Optional<Text> getHelp(CommandSource source) {
        if (this.commands.isEmpty()) {
            return Optional.empty();
        }
        TextBuilder build = t("Available commands:\n").builder();
        for (Iterator<String> it = filterCommands(source).iterator(); it.hasNext();) {
            final Optional<CommandMapping> mappingOpt = get(it.next(), source);
            if (!mappingOpt.isPresent()) {
                continue;
            }
            CommandMapping mapping = mappingOpt.get();
            @SuppressWarnings("unchecked")
            final Optional<Text> description = (Optional<Text>) mapping.getCallable().getShortDescription(source);
            build.append(Texts.builder(mapping.getPrimaryAlias())
                    .color(TextColors.GREEN)
                    .style(TextStyles.UNDERLINE)
                    .onClick(TextActions.suggestCommand("/" + mapping.getPrimaryAlias())).build(),
                    SPACE_TEXT, description.orElse(mapping.getCallable().getUsage(source)));
            if (it.hasNext()) {
                build.append(NEWLINE_TEXT);
            }
        }
        return Optional.of(build.build());
    }

    private Set<String> filterCommands(final CommandSource src) {
        return Multimaps.filterValues(this.commands, input -> input.getCallable().testPermission(src)).keys().elementSet();
    }

    /**
     * Get the number of registered aliases.
     *
     * @return The number of aliases
     */
    public synchronized int size() {
        return this.commands.size();
    }

    @Override
    public Text getUsage(final CommandSource source) {
        final TextBuilder build = Texts.builder();
        Iterable<String> filteredCommands = filterCommands(source).stream()
            .filter(input -> {
                if (input == null) {
                    return false;
                }
                final Optional<CommandMapping> ret = get(input, source);
                return ret.isPresent() && ret.get().getPrimaryAlias().equals(input);
            })
            .collect(Collectors.toList());

        for (Iterator<String> it = filteredCommands.iterator(); it.hasNext();) {
            build.append(Texts.of(it.next()));
            if (it.hasNext()) {
                build.append(CommandMessageFormatting.PIPE_TEXT);
            }
        }
        return build.build();
    }

    @Override
    public synchronized Set<CommandMapping> getAll(String alias) {
        return ImmutableSet.copyOf(this.commands.get(alias));
    }

    @Override
    public Multimap<String, CommandMapping> getAll() {
        return ImmutableMultimap.copyOf(this.commands);
    }
}


text:
require 'spec_helper'
require 'raq/runner'

describe Raq::Runner do
  def argsv(command,arguments={})
    arguments.inject([command]) do |m, (key,value)|
      m << "--#{key}"
      m << value
    end
  end

  context "options" do
    it "should parse host" do
      runner = described_class.new(%w(start --host 127.0.0.1))

      expect(runner.options[:host]).to eql("127.0.0.1")

      runner = described_class.new(%w(start -H host))

      expect(runner.options[:host]).to eql("host")
    end

    it "should parse port" do
      runner = described_class.new(%w(start --port 8080))

      expect(runner.options[:port]).to eql(8080)

      runner = described_class.new(%w(start -p 888))

      expect(runner.options[:port]).to eql(888)
    end

    it "should parse user" do
      runner = described_class.new(%w(start --user guest))

      expect(runner.options[:user]).to eql("guest")

      runner = described_class.new(%w(start -u gus))

      expect(runner.options[:user]).to eql("gus")
    end

    # pass=>"[filtered]"
    # auth_mechanism=>"PLAIN"
    # vhost=>"/"
    # timeout=>nil
    # logging=>false
    # ssl=>false
    # broker=>nil
    # frame_max=>131072
    # heartbeat=>0}"

    it "should parse config file" do
      expect do
        runner = described_class.new(%w(start --config path/to/file))
      end.to_not raise_error(OptionParser::InvalidOption)
    end
  end

  context "configuration file" do

    # First time used it creates the configuration file.
    # Each time accessed it returns the filename.
    let(:configuration_file) do
      File.open("foobar.yml","w") do |f|
        f.write(YAML::dump({
        "queue" => "queue.name"
        }))
        f.path
      end
    end

    it "should be used to set values" do
      runner = described_class.new(%w(start --config) << configuration_file)
      expect(runner.options[:queue]).to eql("queue.name")
    end
  end

  it "should parse specified command" do
    runner = described_class.new(argsv("start"))

    expect(runner.command).to eql("start")
  end

  it "should parse AMQP Connection options" do
    runner = described_class.new(%w("start --host host.name --queue is.not.a.connection.option"))

    expect(runner.connection_options).to_not include(:queue)
  end

  it "should abort on unknown command"
  it "should exiit on empty command"

  it "should require file" do
    expect do
      Raq::Runner.new(%w(start -r unexisting))
    end.to raise_error(LoadError)
  end

  it "should remember requires"
  it "should remember debug options"
  it "should default debug, silent and trace to false"
end

describe Raq::Runner, "with config file" do
  it "should load options from file"
  it "should change directory after loading config"
end


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Omphalia mauretanicum Maire

### Remarks
null


text:
package bookshop2.supplier.management.bookOrdersManager;

import java.io.Serializable;
import java.rmi.Remote;
import java.rmi.RemoteException;

import org.aries.message.Message;
import org.aries.runtime.BeanContext;
import org.aries.tx.service.rmi.AbstractRMIListener;
import org.aries.util.ExceptionUtil;

public class BookOrdersManagerListenerForRMI extends AbstractRMIListener implements Remote {

	private BookOrdersManagerInterceptor bookOrdersManagerInterceptor;

	public BookOrdersManagerListenerForRMI() throws RemoteException {
		registerAsRMIService();
	}

	@Override
	public void initialize() throws Exception {
		registerAsRMIService();
	}

	@Override
	public String getModuleId() {
		return "bookshop2-supplier-service";
	}

	@Override
	public String getServiceId() {
		return BookOrdersManager.ID;
	}

	@Override
	public Object getDelegate() {
		if (bookOrdersManagerInterceptor == null || resetRequested)
			bookOrdersManagerInterceptor = BeanContext.getFromJNDI(BookOrdersManagerInterceptor.class, "BookOrdersManagerInterceptor");
		return bookOrdersManagerInterceptor;
	}

	@Override
	@SuppressWarnings("unchecked")
	public Serializable invoke(Serializable request, String correlationId, long timeout) throws RemoteException {
			if (!isInitialized())
				return null;

		try {
			if (request instanceof String)
				return processAsText((String) request);
			if (request instanceof Message)
				return processAsBinary((Message) request);
			throw new Exception("Unexpected payload type: "+request.getClass());

		} catch (Throwable e) {
			Throwable cause = ExceptionUtil.getRootCause(e);
			throw new RemoteException(cause.getMessage(), cause);
		}
	}

}


text:
class FileAttachment < Attachment
  extend FriendlyId
  include HasContentId
  friendly_id { |config| config.routes = false }

  delegate :url,
           :content_type,
           :pdf?,
           :csv?,
           :opendocument?,
           :file_extension,
           :file_size,
           :number_of_pages,
           :file,
           :filename,
           :filename_without_extension,
           to: :attachment_data

  accepts_nested_attributes_for :attachment_data, reject_if: ->(attributes) { attributes[:file].blank? && attributes[:file_cache].blank? }

  validate :filename_is_unique

  def file?
    true
  end

  def name_for_link
    filename
  end

  def readable_type
    "file"
  end

  def should_generate_new_friendly_id?
    false
  end

  def publishing_api_details_for_format
    {
      accessible: accessible?,
      alternative_format_contact_email:,
      content_type:,
      file_size:,
      filename:,
      number_of_pages:,
      preview_url:,
    }
  end

private

  def alternative_format_contact_email
    attachable.alternative_format_contact_email
  rescue NoMethodError
    nil
  end

  def preview_url
    if csv? && attachable.is_a?(Edition)
      Whitehall.url_maker.csv_preview_url(
        id: attachment_data.id,
        file: filename_without_extension,
        extension: file_extension,
      )
    end
  end

  def filename_is_unique
    if attachable && attachable.attachments.any? { |a| a.file? && a != self && a.filename.downcase == filename.try(:downcase) }
      errors.add(:base, message: "This #{attachable_model_name} already has a file called \"#{filename}\"")
    end
  end
end


text:
namespace llvm {

class Module;
class JITSymbolResolver;

namespace orc {

/// Global mapping layer.
///
///   This layer overrides the findSymbol method to first search a local symbol
/// table that the client can define. It can be used to inject new symbol
/// mappings into the JIT. Beware, however: symbols within a single IR module or
/// object file will still resolve locally (via RuntimeDyld's symbol table) -
/// such internal references cannot be overriden via this layer.
template <typename BaseLayerT>
class GlobalMappingLayer {
public:

  /// Handle to an added module.
  using ModuleHandleT = typename BaseLayerT::ModuleHandleT;

  /// Construct an GlobalMappingLayer with the given BaseLayer
  GlobalMappingLayer(BaseLayerT &BaseLayer) : BaseLayer(BaseLayer) {}

  /// Add the given module to the JIT.
  /// @return A handle for the added modules.
  Expected<ModuleHandleT>
  addModule(std::shared_ptr<Module> M,
            std::shared_ptr<JITSymbolResolver> Resolver) {
    return BaseLayer.addModule(std::move(M), std::move(Resolver));
  }

  /// Remove the module set associated with the handle H.
  Error removeModule(ModuleHandleT H) { return BaseLayer.removeModule(H); }

  /// Manually set the address to return for the given symbol.
  void setGlobalMapping(const std::string &Name, JITTargetAddress Addr) {
    SymbolTable[Name] = Addr;
  }

  /// Remove the given symbol from the global mapping.
  void eraseGlobalMapping(const std::string &Name) {
    SymbolTable.erase(Name);
  }

  /// Search for the given named symbol.
  ///
  ///          This method will first search the local symbol table, returning
  ///        any symbol found there. If the symbol is not found in the local
  ///        table then this call will be passed through to the base layer.
  ///
  /// @param Name The name of the symbol to search for.
  /// @param ExportedSymbolsOnly If true, search only for exported symbols.
  /// @return A handle for the given named symbol, if it exists.
  JITSymbol findSymbol(const std::string &Name, bool ExportedSymbolsOnly) {
    auto I = SymbolTable.find(Name);
    if (I != SymbolTable.end())
      return JITSymbol(I->second, JITSymbolFlags::Exported);
    return BaseLayer.findSymbol(Name, ExportedSymbolsOnly);
  }

  /// Get the address of the given symbol in the context of the of the
  ///        module represented by the handle H. This call is forwarded to the
  ///        base layer's implementation.
  /// @param H The handle for the module to search in.
  /// @param Name The name of the symbol to search for.
  /// @param ExportedSymbolsOnly If true, search only for exported symbols.
  /// @return A handle for the given named symbol, if it is found in the
  ///         given module.
  JITSymbol findSymbolIn(ModuleHandleT H, const std::string &Name,
                         bool ExportedSymbolsOnly) {
    return BaseLayer.findSymbolIn(H, Name, ExportedSymbolsOnly);
  }

  /// Immediately emit and finalize the module set represented by the
  ///        given handle.
  /// @param H Handle for module set to emit/finalize.
  Error emitAndFinalize(ModuleHandleT H) {
    return BaseLayer.emitAndFinalize(H);
  }

private:
  BaseLayerT &BaseLayer;
  std::map<std::string, JITTargetAddress> SymbolTable;
};

} // end namespace orc
} // end namespace llvm

#endif // LLVM_EXECUTIONENGINE_ORC_GLOBALMAPPINGLAYER_H


text:
namespace base {
class SingleThreadTaskRunner;
}

namespace media {

class AudioTimestampHelper;

class MEDIA_EXPORT MediaCodecAudioDecoder : public AudioDecoder,
                                            public MediaCodecLoop::Client {
 public:
  explicit MediaCodecAudioDecoder(
      scoped_refptr<base::SingleThreadTaskRunner> task_runner);
  ~MediaCodecAudioDecoder() override;

  // AudioDecoder implementation.
  std::string GetDisplayName() const override;
  void Initialize(const AudioDecoderConfig& config,
                  CdmContext* cdm_context,
                  InitCB init_cb,
                  const OutputCB& output_cb,
                  const WaitingCB& waiting_cb) override;
  void Decode(scoped_refptr<DecoderBuffer> buffer,
              const DecodeCB& decode_cb) override;
  void Reset(base::OnceClosure closure) override;
  bool NeedsBitstreamConversion() const override;

  // MediaCodecLoop::Client implementation
  bool IsAnyInputPending() const override;
  MediaCodecLoop::InputData ProvideInputData() override;
  void OnInputDataQueued(bool) override;
  bool OnDecodedEos(const MediaCodecLoop::OutputBuffer& out) override;
  bool OnDecodedFrame(const MediaCodecLoop::OutputBuffer& out) override;
  void OnWaiting(WaitingReason reason) override;
  bool OnOutputFormatChanged() override;
  void OnCodecLoopError() override;

 private:
  // Possible states.
  enum State {
    // A successful call to Initialize() is required.
    STATE_UNINITIALIZED,

    // Codec is initialized, but a call to SetCdm() is required.
    STATE_WAITING_FOR_MEDIA_CRYPTO,

    // Normal state.  May decode, etc.
    STATE_READY,

    // Codec must be reset.
    STATE_ERROR,
  };

  // Allocate a new MediaCodec and MediaCodecLoop, and replace |codec_loop_|.
  // Returns true on success.
  bool CreateMediaCodecLoop();

  // A helper method to start CDM initialization.  This must be called if and
  // only if we were constructed with |is_encrypted| set to true.
  void SetCdm(InitCB init_cb);

  // This callback is called after CDM obtained a MediaCrypto object.
  void OnMediaCryptoReady(InitCB init_cb,
                          JavaObjectPtr media_crypto,
                          bool requires_secure_video_codec);

  // Callback called when a new key is available.
  void OnKeyAdded();

  // Calls DecodeCB with |decode_status| for every frame in |input_queue| and
  // then clears it.
  void ClearInputQueue(DecodeStatus decode_status);

  // Helper method to change the state.
  void SetState(State new_state);

  // Helper method to set sample rate, channel count  and |timestamp_helper_|
  // from |config_|.
  void SetInitialConfiguration();

  void PumpMediaCodecLoop();

  // TODO(timav): refactor the common part out and use it here and in AVDA
  // (http://crbug.com/583082).

  // A helper function for logging.
  static const char* AsString(State state);

  // Used to post tasks. This class is single threaded and every method should
  // run on this task runner.
  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;

  State state_;

  // The queue of encoded (and maybe encrypted) buffers. The MediaCodec might
  // not be able to accept the input at the time of Decode(), thus all
  // DecoderBuffers first go to |input_queue_|.
  using BufferCBPair = std::pair<scoped_refptr<DecoderBuffer>, DecodeCB>;
  using InputQueue = base::circular_deque<BufferCBPair>;
  InputQueue input_queue_;

  // Cached decoder config.
  AudioDecoderConfig config_;

  // Indication to use passthrough decoder or not.
  bool is_passthrough_;

  // The audio sample format of the audio decoder output.
  SampleFormat sample_format_;

  // Actual channel count that comes from decoder may be different than config.
  int channel_count_;
  ChannelLayout channel_layout_;

  // Actual sample rate that comes from the decoder, may be different than
  // config.
  int sample_rate_;

  // Callback that delivers output frames.
  OutputCB output_cb_;

  WaitingCB waiting_cb_;

  std::unique_ptr<MediaCodecLoop> codec_loop_;

  std::unique_ptr<AudioTimestampHelper> timestamp_helper_;

  // CDM related stuff.

  // Owned by CDM which is external to this decoder.
  MediaCryptoContext* media_crypto_context_;

  // MediaDrmBridge requires registration/unregistration of the player, this
  // registration id is used for this.
  int cdm_registration_id_;

  // Pool which helps avoid thrashing memory when returning audio buffers.
  scoped_refptr<AudioBufferMemoryPool> pool_;

  // The MediaCrypto object is used in the MediaCodec.configure() in case of
  // an encrypted stream.
  JavaObjectPtr media_crypto_;

  base::WeakPtrFactory<MediaCodecAudioDecoder> weak_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(MediaCodecAudioDecoder);
};

}  // namespace media

#endif  // MEDIA_FILTERS_ANDROID_MEDIA_CODEC_AUDIO_DECODER_H_


text:
package com.nostra13.universalimageloader.cache.memory.impl;

import android.graphics.Bitmap;
import com.nostra13.universalimageloader.cache.memory.LimitedMemoryCache;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
 * Limited {@link Bitmap bitmap} cache. Provides {@link Bitmap bitmaps} storing. Size of all stored bitmaps will not to
 * exceed size limit. When cache reaches limit size then cache clearing is processed by FIFO principle.

 *

 * NOTE: This cache uses strong and weak references for stored Bitmaps. Strong references - for limited count of
 * Bitmaps (depends on cache size), weak references - for all other cached Bitmaps.
 *
 * @author Sergey Tarasevich (nostra13[at]gmail[dot]com)
 * @since 1.0.0
 */
public class FIFOLimitedMemoryCache extends LimitedMemoryCache {

	private final List<Bitmap> queue = Collections.synchronizedList(new LinkedList<Bitmap>());

	public FIFOLimitedMemoryCache(int sizeLimit) {
		super(sizeLimit);
	}

	@Override
	public boolean put(String key, Bitmap value) {
		if (super.put(key, value)) {
			queue.add(value);
			return true;
		} else {
			return false;
		}
	}

	@Override
	public void remove(String key) {
		Bitmap value = super.get(key);
		if (value != null) {
			queue.remove(value);
		}
		super.remove(key);
	}

	@Override
	public void clear() {
		queue.clear();
		super.clear();
	}

	@Override
	protected int getSize(Bitmap value) {
		return value.getRowBytes() * value.getHeight();
	}

	@Override
	protected Bitmap removeNext() {
		return queue.remove(0);
	}

	@Override
	protected Reference<Bitmap> createReference(Bitmap value) {
		return new WeakReference<Bitmap>(value);
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="b6868238-ba32-4db3-8d2e-62b2c6fbc38e" name="Default" comment="">
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/direction.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/engine.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/figure.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/food.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/main.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/menu.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/renderer.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/snake-piece.js" />
      <change beforePath="" afterPath="$PROJECT_DIR$/js/app/snake.js" />
      <change beforePath="$PROJECT_DIR$/index.html" afterPath="$PROJECT_DIR$/index.html" />
      <change beforePath="$PROJECT_DIR$/styles.css" afterPath="" />
      <change beforePath="$PROJECT_DIR$/styles.min.css" afterPath="" />
    </list>
    <ignored path="$PROJECT_DIR$/.tmp/" />
    <ignored path="$PROJECT_DIR$/temp/" />
    <ignored path="$PROJECT_DIR$/tmp/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="FavoritesManager">
    <favorites_list name="SnakeGame" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="375" />
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="JavaScript File" />
      </list>
    </option>
  </component>
  <component name="FindInProjectRecents">
    <findStrings>
      <find>context</find>
      <find>this._context</find>
      <find>this._gameField</find>
      <find>m</find>
      <find>game</find>
      <find>debugger</find>
      <find>></find>
      <find>hi</find>
      <find>menu</find>
      <find>requ</find>
      <find>menu-button</find>
      <find>onGa</find>
      <find>raise</find>
      <find>_isGameOver</find>
      <find>_generateSnake</find>
      <find>turnedCurrentFrame</find>
      <find>change</find>
      <find>evt</find>
      <find>_onKeyDownChangeDirection</find>
      <find>hadEatenTheFood</find>
      <find>generateF</find>
      <find>this._snake</find>
      <find>render</find>
      <find>delta</find>
      <find>interval</find>
      <find>_isFoodOnSnake</find>
      <find>isSn</find>
      <find>deb</find>
      <find>console</find>
      <find>debug</find>
    </findStrings>
    <replaceStrings>
      <replace>SNAKE_PIECE_SIZE</replace>
      <replace>snake</replace>
    </replaceStrings>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/js/app/figure.js" />
        <option value="$PROJECT_DIR$/Snake/snake-objects.js" />
        <option value="$PROJECT_DIR$/js/app/snake-piece.js" />
        <option value="$PROJECT_DIR$/js/app/direction.js" />
        <option value="$PROJECT_DIR$/Snake/snake-engine.js" />
        <option value="$PROJECT_DIR$/js/bootstrap.js" />
        <option value="$PROJECT_DIR$/js/app/menu.js" />
        <option value="$PROJECT_DIR$/css/styles.css" />
        <option value="$PROJECT_DIR$/js/app/renderer.js" />
        <option value="$PROJECT_DIR$/js/app/main.js" />
        <option value="$PROJECT_DIR$/index.html" />
        <option value="$PROJECT_DIR$/js/app/engine.js" />
        <option value="$PROJECT_DIR$/js/app/food.js" />
        <option value="$PROJECT_DIR$/js/app/snake.js" />
      </list>
    </option>
  </component>
  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER">
    <package-json value="$PROJECT_DIR$/package.json" />
  </component>
  <component name="JsFlowSettings">
    <service-enabled>true</service-enabled>
    <exe-path />
    <other-services-enabled>true</other-services-enabled>
    <auto-save>true</auto-save>
  </component>
  <component name="JsGulpfileManager">
    <detection-done>true</detection-done>
    <sorting>DEFINITION_ORDER</sorting>
  </component>
  <component name="NodeModulesDirectoryManager">
    <handled-path value="$PROJECT_DIR$/node_modules" />
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="x" value="260" />
    <option name="y" value="20" />
    <option name="width" value="1400" />
    <option name="height" value="990" />
  </component>
  <component name="ProjectLevelVcsManager">
    <ConfirmationsSetting value="2" id="Add" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="SnakeGame" type="b2602c69:ProjectViewProjectNode" />
              <item name="SnakeGame" type="462c0819:PsiDirectoryNode" />
            </path>
            <path>
              <item name="SnakeGame" type="b2602c69:ProjectViewProjectNode" />
              <item name="SnakeGame" type="462c0819:PsiDirectoryNode" />
              <item name="js" type="462c0819:PsiDirectoryNode" />
            </path>
            <path>
              <item name="SnakeGame" type="b2602c69:ProjectViewProjectNode" />
              <item name="SnakeGame" type="462c0819:PsiDirectoryNode" />
              <item name="js" type="462c0819:PsiDirectoryNode" />
              <item name="app" type="462c0819:PsiDirectoryNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
      <pane id="Scope" />
      <pane id="Scratches" />
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="HbShouldOpenHtmlAsHb" value="" />
    <property name="settings.editor.selected.configurable" value="Settings.JavaScript" />
    <property name="JavaScriptWeakerCompletionTypeGuess" value="true" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="SvnConfiguration">
    <configuration />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="b6868238-ba32-4db3-8d2e-62b2c6fbc38e" name="Default" comment="" />
      <created>1518352410412</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1518352410412</updated>
      <workItem from="1518352413221" duration="7235000" />
      <workItem from="1518362246180" duration="716000" />
      <workItem from="1518378755630" duration="10999000" />
    </task>
    <servers />
  </component>
  <component name="TimeTrackingManager">
    <option name="totallyTimeSpent" value="18950000" />
  </component>
  <component name="ToolWindowManager">
    <frame x="-9" y="-9" width="1938" height="1048" extended-state="6" />
    <layout>
      <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1796875" sideWeight="0.49548534" order="0" side_tool="false" content_ui="combo" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
      <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.1796875" sideWeight="0.5045147" order="3" side_tool="true" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="TypeScriptGeneratedFilesManager">
    <option name="version" value="1" />
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="3" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/js/app/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/engine.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/renderer.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="21">
          <caret line="1" column="4" lean-forward="false" selection-start-line="1" selection-start-column="4" selection-end-line="1" selection-end-column="4" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/renderer.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/engine.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1071">
          <caret line="51" column="0" lean-forward="true" selection-start-line="51" selection-start-column="0" selection-end-line="51" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/.gitignore">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/package.json">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/LICENSE.md">
      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
        <state split_layout="SPLIT">
          <first_editor relative-caret-position="0">
            <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          </first_editor>
          <second_editor />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/Snake/snake-objects.js" />
    <entry file="file://$PROJECT_DIR$/Snake/snake-engine.js" />
    <entry file="file://$PROJECT_DIR$/Snake/snake.js" />
    <entry file="file://$PROJECT_DIR$/js/bootstrap.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="42">
          <caret line="2" column="15" lean-forward="false" selection-start-line="2" selection-start-column="15" selection-end-line="2" selection-end-column="15" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/css/styles.css">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="199">
          <caret line="23" column="47" lean-forward="false" selection-start-line="23" selection-start-column="47" selection-end-line="23" selection-end-column="47" />
          <folding>
            <element signature="e#1174#1204#0" expanded="false" />
            <element signature="e#1217#1265#0" expanded="false" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/food.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="63">
          <caret line="3" column="34" lean-forward="false" selection-start-line="3" selection-start-column="34" selection-end-line="3" selection-end-column="34" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/figure.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="42">
          <caret line="2" column="12" lean-forward="false" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/engine.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="210">
          <caret line="10" column="23" lean-forward="false" selection-start-line="10" selection-start-column="23" selection-end-line="10" selection-end-column="23" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/main.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="420">
          <caret line="20" column="16" lean-forward="false" selection-start-line="20" selection-start-column="16" selection-end-line="20" selection-end-column="16" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/direction.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="21">
          <caret line="1" column="7" lean-forward="false" selection-start-line="1" selection-start-column="7" selection-end-line="1" selection-end-column="7" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/menu.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="true" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/renderer.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="139">
          <caret line="39" column="21" lean-forward="false" selection-start-line="39" selection-start-column="21" selection-end-line="39" selection-end-column="21" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/snake-piece.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="21">
          <caret line="1" column="30" lean-forward="false" selection-start-line="1" selection-start-column="30" selection-end-line="1" selection-end-column="30" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/index.html">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="147">
          <caret line="7" column="6" lean-forward="false" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/js/app/snake.js">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="328">
          <caret line="88" column="23" lean-forward="false" selection-start-line="88" selection-start-column="23" selection-end-line="88" selection-end-column="23" />
          <folding />
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { FormBuilder, ReactiveFormsModule, FormGroup } from '@angular/forms';

import { MessageModel } from '../app.export.models'
import { MessageDisplayComponent } from '../app.export.components'
import { } from '../app.export.components.services'
import { } from '../app.export.services'
import { } from '../app.export.shared'

describe('MessageDisplayComponent:', () => {
    let comp: MessageDisplayComponent;
    let fixture: ComponentFixture<MessageDisplayComponent>;
    let de: DebugElement;
    let el: HTMLElement;

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            declarations: [MessageDisplayComponent],
            providers: [],
            imports: []
        }).compileComponents();
    }))

    beforeEach(() => {
        fixture = TestBed.createComponent(MessageDisplayComponent);
        comp = fixture.componentInstance;
        de = fixture.debugElement;
        el = de.nativeElement;
    })

    it('Instantiate test', () => {
        expect(fixture).not.toBeNull();
        expect(comp).not.toBeNull();
        expect(de).not.toBeNull();
        expect(el).not.toBeNull();
    })

    let alertSuccess: string = 'div[class~=alert-success]'
    let alertWarn: string = 'div[class~=alert-warning]'
    let alertError: string = 'div[class~=alert-danger]'

    it('when no messages are there should be empty', () => {
        fixture.detectChanges();
        comp.msg = null

        fixture.detectChanges();

        expect(el.querySelector(alertSuccess)).toBeNull();
        expect(el.querySelector(alertWarn)).toBeNull();
        expect(el.querySelector(alertError)).toBeNull();
    })

    it('when only success message is there', () => {
        let msg = 'Test message';
        fixture.detectChanges();
        comp.msg = MessageModel.createSuccess(msg);

        fixture.detectChanges();

        expect(el.querySelector(alertSuccess).innerHTML.trim()).toEqual(msg);
        expect(el.querySelector(alertWarn)).toBeNull();
        expect(el.querySelector(alertError)).toBeNull();
    })

    it('when only warn message is there', () => {
        let msg = 'Test message';
        fixture.detectChanges();
        comp.msg = MessageModel.createWarn(msg);

        fixture.detectChanges();

        expect(el.querySelector(alertSuccess)).toBeNull();
        expect(el.querySelector(alertWarn).innerHTML.trim()).toEqual(msg);
        expect(el.querySelector(alertError)).toBeNull();
    })

    it('when only error message is there', () => {
        let msg = 'Test message';
        fixture.detectChanges();
        comp.msg = MessageModel.createError(msg);

        fixture.detectChanges();

        expect(el.querySelector(alertSuccess)).toBeNull();
        expect(el.querySelector(alertWarn)).toBeNull();
        expect(el.querySelector(alertError).innerHTML.trim()).toEqual(msg);
    })

    it('when all message is there', () => {
        let msg = 'Test message';
        fixture.detectChanges();
        comp.msg = new MessageModel()
        comp.msg.success = msg
        comp.msg.warn = msg
        comp.msg.error = msg

        fixture.detectChanges();

        expect(el.querySelector(alertSuccess).innerHTML.trim()).toEqual(msg);
        expect(el.querySelector(alertWarn).innerHTML.trim()).toEqual(msg);
        expect(el.querySelector(alertError).innerHTML.trim()).toEqual(msg);
    })
})


text:
package com.walker.pattern.behavioral.memento;

/**
 * ${DESCRIPTION}
 *
 * @Author Walker Denial
 * @Email WalkerDenial@gmail.com
 * @Time Created at 2017/3/16 13:31.
 */
public class ChessmanMemento {

    private String label;

    private int x;

    private int y;

    public ChessmanMemento(String label, int x, int y) {
        this.label = label;
        this.x = x;
        this.y = y;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

}


text:
<HTML>
<HEAD>
<TITLE>Code generator information for html\s72c.cgen.html</TITLE>
<LINK rel=stylesheet href="udf_styles.css" type="text/css">
</HEAD>
<BODY>
<frameset rows="15,85"><frame name ="toc" src="toc_s72c.cgen.html" /><frame name ="main" src="main_s72c.cgen.html" /></frameset></HTML>


text:
package dbg

import "fmt"

var Lvl int

func Debug(prior int, message string) {
	/*
		Really simple debugging tool
		one can make a debugging message like this:
		debug(0,"This is a very important debugging message")
		The first argument represents the urgency of the debugging message,
		and can be any number.
		Has the variable debug.lvl which one definds in the script you're debugging in
		if the function is called, it will print the message if the lvl you input is
		smaller or equal than the set debug.lvl
		This way, one can change how verbose
	*/
	if prior <= Lvl {
		fmt.Println(message)
	}
}


text:
namespace TankLib.STU.Types
{
    [STU(0x79F2F73B, 104)]
    public class STUStatescriptEffect : STUInstance
    {
        [STUField(0x4BAAC7A5, 8, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 16
        public STU_E6C53A4E[] m_4BAAC7A5;

        [STUField(0x58D56DD4, 24, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_effect;

        [STUField(0xBD631144, 32, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_BD631144;

        [STUField(0xF87A1262, 40, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_F87A1262;

        [STUField(0x99C32380, 48, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_99C32380;

        [STUField(0x8A406A39, 56, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_8A406A39;

        [STUField(0x8E253789, 64, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_8E253789;

        [STUField(0x2A759A57, 72, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_2A759A57;

        [STUField(0xFA7486F9, 80, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_FA7486F9;

        [STUField(0xF6AB269D, 88, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_F6AB269D;

        [STUField(0x54CA7725, 96, ReaderType = typeof(EmbeddedInstanceFieldReader))] // size: 8
        public STUConfigVar m_54CA7725;
    }
}


text:
class CStockChartOleDoc; // Vorwärtsdeklaration

class CChartProperty : public CDialog
{
// Konstruktion
public:
	CChartProperty(CStockChartOleDoc *pDoc, CWnd* pParent = NULL);   // Standardkonstruktor

   BOOL Create();

   // Dialogfelddaten
	//{{AFX_DATA(CChartProperty)
	enum { IDD = IDD_CHARTPROPERTY };
	BOOL	m_bGrid;
	int		m_nColor;
	BOOL	m_bAverage;
	int		m_nAverageCnt;
	//}}AFX_DATA

// Überschreibungen
	// Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen
	//{{AFX_VIRTUAL(CChartProperty)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV-Unterstützung
	//}}AFX_VIRTUAL

// Implementierung
protected:
   enum {
      sliderRangeMin = 1,
      sliderRangeMax = 20
   };
   CStockChartOleDoc *pDoc;

	// Generierte Nachrichtenzuordnungsfunktionen
	//{{AFX_MSG(CChartProperty)
	afx_msg void OnApplyNow();
	virtual void OnCancel();
	virtual void OnOK();
	virtual BOOL OnInitDialog();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio fügt zusätzliche Deklarationen unmittelbar vor der vorhergehenden Zeile ein.

#endif // AFX_CHARTPROPERTY_H__CFDB317E_0122_11D2_B51C_006097A8F69A__INCLUDED_


text:
__author__ = 'rischan'

import constants
from db_conn import DBConn
from random import randint
from datetime import datetime
import time
from util import setup_api

# constants
consumer_key = constants.consumer_key
consumer_secret = constants.consumer_secret
access_key = constants.access_key
access_secret = constants.access_secret

def main():
    local_tz = time.timezone / (60 * 60)
    #autotweet at the working time (indonesia)
    current_hour = (datetime.now().hour + (7 + local_tz)) % 24  # to GMT +7
    if 0 < current_hour < 5:
        print 'too late to tweet'
        return
    api = setup_api(consumer_key, consumer_secret, access_key, access_secret)

    dbconn = DBConn()
    post_table = 'tw' #name of table
    name_column = 'tweet' #name of column
    q_num_post = 'SELECT COUNT(*) FROM ' + post_table #count the rows of data
    num_post = dbconn.read(q_num_post)
    numb_post =num_post[0][0] #get value from count of rows data
    #print num_post[0][0]

    #query for select tweets
    query = 'SELECT ' + name_column + ' FROM ' + post_table
    a = dbconn.read(query)
    rand_number = randint(0, numb_post)

    api.update_status(str(a[rand_number][0]))

if __name__ == '__main__':
    main()


text:
import { normalizeTagName } from '../utils/dom-utils';
import { filterObject } from '../utils/array-utils';
import { MARKUP_TYPE } from './types';
import assert from '../utils/assert';

export const VALID_MARKUP_TAGNAMES = [
  'b',
  'i',
  'strong',
  'em',
  'a',
  'u',
  'sub', // subscript
  'sup', // superscript
  's'    // strikethrough
].map(normalizeTagName);

export const VALID_ATTRIBUTES = [
  'href',
  'ref'
];

class Markup {
  /*
   * @param {Object} attributes key-values
   */
  constructor(tagName, attributes={}) {
    this.tagName = normalizeTagName(tagName);

    assert('Must use attributes object param (not array) for Markup',
           !Array.isArray(attributes));

    this.attributes = filterObject(attributes, VALID_ATTRIBUTES);
    this.type = MARKUP_TYPE;

    assert(`Cannot create markup of tagName ${tagName}`,
           VALID_MARKUP_TAGNAMES.indexOf(this.tagName) !== -1);
  }

  hasTag(tagName) {
    return this.tagName === normalizeTagName(tagName);
  }

  getAttribute(name) {
    return this.attributes[name];
  }

  static isValidElement(element) {
    const tagName = normalizeTagName(element.tagName);
    return VALID_MARKUP_TAGNAMES.indexOf(tagName) !== -1;
  }
}

export default Markup;


text:
@interface TMDBTestHelper : NSObject

+ (NSDictionary*)jsonDictonaryFromClass:(Class)class;
+ (TMDBClient*)testClient;
@end


text:
/*
 * RadioButtonDialog.java
 *
 * Created on July 1, 2003, 10:03 AM
 */
package org.tolweb.treegrow.main;

import javax.swing.*;

/**
 *
 * @author  twheeler
 */
public class RadioOptionPane {
    /** Shows a dialog box full of radio buttons.
     *
     * @param frame The JFrame this dialog is associated with
     * @param title The title to be given to the dialog
     * @param message The message presented to the user
     * @param options The array of strings that will be used to give the user choices
     * @param selectedIndex The index into the options array of the radio button that should be initially selected
     *
     * @return The index of the selection in the options array if something was selected, -1 otherwise.
     */
    public static int showRadioButtonDialog(JFrame frame, String title, String message, String[] options, int selectedIndex) {
        Object[] displayedOptions = new Object[options.length + 2];
        displayedOptions[0] = message;
        displayedOptions[1] = " ";
        ButtonGroup buttons = new ButtonGroup();
        for (int i = 0; i < options.length; i++) {
            JRadioButton button = new JRadioButton(options[i]);
            button.setActionCommand(options[i]);
            displayedOptions[i + 2] = button;
            buttons.add(button);
        }
        ((JRadioButton) displayedOptions[selectedIndex + 2]).setSelected(true);
        String[] okCancel = new String[] { "OK", "Cancel" };
        JOptionPane optionPane = new JOptionPane(displayedOptions, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, okCancel, null);
        JDialog dialog = optionPane.createDialog(frame, title);

        dialog.show();
        dialog.dispose();
        if (optionPane.getValue() == null || optionPane.getValue().equals("Cancel")) {
            return -1;
        } else {
            ButtonModel selectedButton = buttons.getSelection();
            for (int i = 0; i < buttons.getButtonCount(); i++) {
                if (selectedButton.getActionCommand().equals(options[i])) {
                    return i;
                }
            }
            return -1;
        }
    }

    /** Shows a dialog box full of radio buttons.
     *
     * @param frame The JFrame this dialog is associated with
     * @param title The title to be given to the dialog
     * @param message The message presented to the user
     * @param options The array of strings that will be used to give the user choices
     *
     * @return The index of the selection in the options array if something was selected, -1 otherwise.
     */
    public static int showRadioButtonDialog(JFrame frame, String title, String message, String[] options) {
        return showRadioButtonDialog(frame, title, message, options, 0);
    }
}


text:
//===----------------------------------------------------------------------===//
//
//                         Peloton
//
// order_by_executor.h
//
// Identification: src/include/executor/order_by_executor.h
//
// Copyright (c) 2015-17, Carnegie Mellon University Database Group
//
//===----------------------------------------------------------------------===//

#pragma once

#include "common/internal_types.h"
#include "executor/abstract_executor.h"
#include "storage/tuple.h"

namespace peloton {
namespace executor {

/**
 * @warning This is a pipeline breaker and a materialization point.
 *
 * TODO Currently, we store all input tiles and sort result in memory
 * until this executor is destroyed, which is sometimes necessary.
 * But can we let it release the RAM earlier as long as the executor
 * is not needed any more (e.g., with a LIMIT sitting on top)?
 *
 * 2018-01-07: This is <b>deprecated</b>. Do not modify these classes.
 * The old interpreted engine will be removed.
 * @deprecated
 */
class OrderByExecutor : public AbstractExecutor {
 public:
  OrderByExecutor(const OrderByExecutor &) = delete;
  OrderByExecutor &operator=(const OrderByExecutor &) = delete;
  OrderByExecutor(const OrderByExecutor &&) = delete;
  OrderByExecutor &operator=(const OrderByExecutor &&) = delete;

  explicit OrderByExecutor(const planner::AbstractPlan *node,
                           ExecutorContext *executor_context);

  ~OrderByExecutor();

 protected:
  bool DInit();

  bool DExecute();

 private:
  bool DoSort();

  bool sort_done_ = false;

  /**
   * IMPORTANT This type must be move-constructible and move-assignable
   * in order to be correctly sorted by STL sort
   */
  struct sort_buffer_entry_t {
    ItemPointer item_pointer;
    std::unique_ptr<storage::Tuple> tuple;

    sort_buffer_entry_t(ItemPointer ipt, std::unique_ptr<storage::Tuple> &&tp)
        : item_pointer(ipt), tuple(std::move(tp)) {}

    sort_buffer_entry_t(sort_buffer_entry_t &&rhs) {
      item_pointer = rhs.item_pointer;
      tuple = std::move(rhs.tuple);
    }

    sort_buffer_entry_t &operator=(sort_buffer_entry_t &&rhs) {
      item_pointer = rhs.item_pointer;
      tuple = std::move(rhs.tuple);
      return *this;
    }

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

  /** All tiles returned by child. */
  std::vector<std::unique_ptr<LogicalTile>> input_tiles_;

  /** Physical (not logical) schema of output tiles */
  std::unique_ptr<catalog::Schema> output_schema_;

  /** Projected output column ids corresponding to input schema */
  std::vector<oid_t> output_column_ids_;

  /** All valid tuples in sorted order */
  std::vector<sort_buffer_entry_t> sort_buffer_;

  /** Tuples in sort_buffer only contains the sort keys */
  std::unique_ptr<catalog::Schema> sort_key_tuple_schema_;

  std::vector<bool> descend_flags_;

  /** How many tuples have been returned to parent */
  size_t num_tuples_returned_ = 0;

  /** How many tuples have been get from the child */
  size_t num_tuples_get_ = 0;

  // Copied from plan node
  // Used to show that whether the output is has the same ordering with order by
  // expression. If the so, we can directly used the output result without any
  // additional sorting operation
  bool underling_ordered_ = false;

  // Whether there is limit clause;
  bool limit_ = false;

  // Copied from plan node
  uint64_t limit_number_ = 0;

  // Copied from plan node
  uint64_t limit_offset_ = 0;
};

}  // namespace executor
}  // namespace peloton


text:
<?php

namespace Google\AdsApi\Examples\AdManager\v202205\PublisherQueryLanguageService;

require __DIR__ . '/../../../../vendor/autoload.php';

use DateTime;
use DateTimeZone;
use Google\AdsApi\AdManager\AdManagerSession;
use Google\AdsApi\AdManager\AdManagerSessionBuilder;
use Google\AdsApi\AdManager\Util\v202205\AdManagerDateTimes;
use Google\AdsApi\AdManager\Util\v202205\Pql;
use Google\AdsApi\AdManager\Util\v202205\StatementBuilder;
use Google\AdsApi\AdManager\v202205\ServiceFactory;
use Google\AdsApi\Common\OAuth2TokenBuilder;

/**
 * Gets recent changes in your network using the `Change_History` table and
 * writes them to a file in your system's temp directory. This example may take
 * a while to run.
 *
 * Note: this example loads all results into memory, you may need to raise your
 * PHP memory_limit for this example to work.
 *
 * @see
 *     https://developers.google.com/ad-manager/docs/reference/v202205/PublisherQueryLanguageService#Change_History
 */
class GetRecentChanges
{

    public static function runExample(
        ServiceFactory $serviceFactory,
        AdManagerSession $session
    ) {
        $pqlService = $serviceFactory->createPublisherQueryLanguageService(
            $session
        );

        // Create statement to select recent changes. Change_History only
        // supports ordering by descending ChangeDateTime. Offsets are not
        // supported. IDs are used as continuation tokens for paging. A date
        // time range is required when querying this table.
        $startDateTime = new DateTime(
            '-1 day',
            new DateTimeZone('America/New_York')
        );
        $endDateTime = new DateTime(
            'now',
            new DateTimeZone('America/New_York')
        );
        $statementBuilder = new StatementBuilder();
        $statementBuilder
            ->select('Id, ChangeDateTime, EntityId, EntityType, Operation, '
                . 'UserId')
            ->from('Change_History')
            ->where(
                'ChangeDateTime < :endDateTime AND ChangeDateTime > '
                . ':startDateTime'
            )
            ->orderBy('ChangeDateTime DESC')
            ->withBindVariableValue(
                'startDateTime',
                AdManagerDateTimes::fromDateTime($startDateTime)
            )
            ->withBindVariableValue(
                'endDateTime',
                AdManagerDateTimes::fromDateTime($endDateTime)
            )
            ->limit(StatementBuilder::SUGGESTED_PAGE_LIMIT);

        // Retrieve a small amount of changes at a time, paging through until
        // all changes have been retrieved.
        $combinedResultSet = null;
        $resultSet = null;
        $i = 0;

        do {
            $resultSet = $pqlService->select($statementBuilder->toStatement());

            // Combine result sets with previous ones.
            $combinedResultSet = $combinedResultSet === null
                ? $resultSet
                : Pql::combineResultSets(
                    $combinedResultSet,
                    $resultSet
                );

            $rows = $resultSet->getRows();
            if ($rows !== null && count($rows) > 0) {
                // Get the earliest change ID in the result set.
                $lastRow = $rows[count($rows) - 1];
                $lastId = $lastRow->getValues()[0]->getValue();

                printf(
                    "%d) %d changes prior to ID '%s' were found.%s",
                    $i++,
                    count($rows),
                    $lastId,
                    PHP_EOL
                );

                // Use the earliest change ID in the result set to page.
                $statementBuilder->where(
                    'Id < :id AND ChangeDateTime < :endDateTime AND '
                    . 'ChangeDateTime > :startDateTime'
                )
                    ->withBindVariableValue('id', $lastId);
            }
        } while ($rows !== null && count($rows) > 0);

        // Write to system temp directory by default.
        $filePath = sprintf(
            '%s.csv',
            tempnam(sys_get_temp_dir(), 'change-history-')
        );

        $fp = fopen($filePath, 'w');
        // Write the result set to a CSV.
        fputcsv($fp, Pql::getColumnLabels($combinedResultSet));
        if ($combinedResultSet->getRows() !== null) {
            foreach ($combinedResultSet->getRows() as $row) {
                fputcsv($fp, Pql::getRowStringValues($row));
            }
        }
        fclose($fp);

        printf("Recent changes saved to %s%s", $filePath, PHP_EOL);
    }

    public static function main()
    {
        $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()
            ->build();
        $session = (new AdManagerSessionBuilder())->fromFile()
            ->withOAuth2Credential($oAuth2Credential)
            ->build();
        self::runExample(new ServiceFactory(), $session);
    }
}

GetRecentChanges::main();


text: export default from './Pad';


text:
/*
  This file is licensed to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/
using System.Xml;

namespace net.sf.xmlunit.input {
    /// <summary>
    /// ISource implementation encapsulating a DOM Node.
    /// </summary>
    public class DOMSource : AbstractSource {
        private readonly XmlNode node;
        public DOMSource(XmlNode node)
            : base(new XmlNodeReader(node)) {
            this.node = node;
        }

        /// <summary>
        /// The node this source is wrapping
        /// </summary>
        public XmlNode Node {
            get {
                return node;
            }
        }
    }
}