text:
<?php

// Start of libxml v.7.0.0-dev

class LibXMLError  {
}

/**
 * Set the streams context for the next libxml document load or write
 * @link http://www.php.net/manual/en/function.libxml-set-streams-context.php
 * @param resource $streams_context

 * The stream context resource (created with
 * stream_context_create)
 *

 * @return void
 */
function libxml_set_streams_context ($streams_context) {}

/**
 * Disable libxml errors and allow user to fetch error information as needed
 * @link http://www.php.net/manual/en/function.libxml-use-internal-errors.php
 * @param bool $use_errors [optional]

 * Enable (true) user error handling or disable (false) user error handling. Disabling will also clear any existing libxml errors.
 *

 * @return bool This function returns the previous value of
 * use_errors.
 */
function libxml_use_internal_errors ($use_errors = null) {}

/**
 * Retrieve last error from libxml
 * @link http://www.php.net/manual/en/function.libxml-get-last-error.php
 * @return LibXMLError a LibXMLError object if there is any error in the
 * buffer, false otherwise.
 */
function libxml_get_last_error () {}

/**
 * Clear libxml error buffer
 * @link http://www.php.net/manual/en/function.libxml-clear-errors.php
 * @return void
 */
function libxml_clear_errors () {}

/**
 * Retrieve array of errors
 * @link http://www.php.net/manual/en/function.libxml-get-errors.php
 * @return array an array with LibXMLError objects if there are any
 * errors in the buffer, or an empty array otherwise.
 */
function libxml_get_errors () {}

/**
 * Disable the ability to load external entities
 * @link http://www.php.net/manual/en/function.libxml-disable-entity-loader.php
 * @param bool $disable [optional]

 * Disable (true) or enable (false) libxml extensions (such as
 * ,
 * and ) to load external entities.
 *

 * @return bool the previous value.
 */
function libxml_disable_entity_loader ($disable = null) {}

/**
 * Changes the default external entity loader
 * @link http://www.php.net/manual/en/function.libxml-set-external-entity-loader.php
 * @param callable $resolver_function

 * A callable that takes three arguments. Two strings, a public id
 * and system id, and a context (an array with four keys) as the third argument.
 * This callback should return a resource, a string from which a resource can be
 * opened, or &null;.
 *

 * @return void
 */
function libxml_set_external_entity_loader ($resolver_function) {}

define ('LIBXML_VERSION', 20901);
define ('LIBXML_DOTTED_VERSION', "2.9.1");
define ('LIBXML_LOADED_VERSION', 20902);
define ('LIBXML_NOENT', 2);
define ('LIBXML_DTDLOAD', 4);
define ('LIBXML_DTDATTR', 8);
define ('LIBXML_DTDVALID', 16);
define ('LIBXML_NOERROR', 32);
define ('LIBXML_NOWARNING', 64);
define ('LIBXML_NOBLANKS', 256);
define ('LIBXML_XINCLUDE', 1024);
define ('LIBXML_NSCLEAN', 8192);
define ('LIBXML_NOCDATA', 16384);
define ('LIBXML_NONET', 2048);
define ('LIBXML_PEDANTIC', 128);
define ('LIBXML_COMPACT', 65536);
define ('LIBXML_NOXMLDECL', 2);
define ('LIBXML_PARSEHUGE', 524288);
define ('LIBXML_BIGLINES', 4194304);
define ('LIBXML_NOEMPTYTAG', 4);
define ('LIBXML_SCHEMA_CREATE', 1);
define ('LIBXML_HTML_NOIMPLIED', 8192);
define ('LIBXML_HTML_NODEFDTD', 4);
define ('LIBXML_ERR_NONE', 0);
define ('LIBXML_ERR_WARNING', 1);
define ('LIBXML_ERR_ERROR', 2);
define ('LIBXML_ERR_FATAL', 3);

// End of libxml v.7.0.0-dev


text:
function ChangeActiveItem(input) {
    input.className = "active item"
}

redpajama_set_name: RedPajamaGithub


text:
package com.lookout.jenkins;

import java.util.Map;

import hudson.EnvVars;
import hudson.model.EnvironmentContributingAction;
import hudson.model.AbstractBuild;

public class EnvironmentPluginAction implements EnvironmentContributingAction {

    private transient Map<String, String> envAdditions;
    private transient Map<String, String> envOverrides;

    public EnvironmentPluginAction(Map<String, String> envAdditions, Map<String, String> envOverrides) {
        this.envAdditions = envAdditions;
        this.envOverrides = envOverrides;
    }

    public String getIconFileName() {
        return null;
    }

    public String getDisplayName() {
        return null;
    }

    public String getUrlName() {
        return "EnvironmentPluginAction";
    }

    public void buildEnvVars(AbstractBuild<?, ?> build, EnvVars env) {

        if (env == null) {
            return;
        }

        if (envAdditions != null) {
            env.putAll(envAdditions);
        }

        if (envOverrides != null) {
            env.overrideAll(envOverrides);
        }

    }

}


text:
"use strict";

const { addErrorContext, filterTokens } = require("../helpers");

module.exports = {
  "names": [ "MD040", "fenced-code-language" ],
  "description": "Fenced code blocks should have a language specified",
  "tags": [ "code", "language" ],
  "function": function MD040(params, onError) {
    filterTokens(params, "fence", function forToken(token) {
      if (!token.info.trim()) {
        addErrorContext(onError, token.lineNumber, token.line);
      }
    });
  }
};


text:
package com.yl.retrofitdemo.manager;

import com.yl.retrofitdemo.Constant;
import com.yl.retrofitdemo.bean.PostInfo;
import com.yl.retrofitdemo.impl.RetrofitService;
import com.yl.retrofitdemo.net.HttpChannel;

import io.reactivex.Observable;

/**
 * 消息发送管理
 * Created by yangle on 2017/6/19.
 */

public class SendMessageManager {

    private static SendMessageManager manager;
    private HttpChannel httpChannel;
    private RetrofitService retrofitService;

    public static SendMessageManager getInstance() {
        return manager == null ? manager = new SendMessageManager() : manager;
    }

    private SendMessageManager() {
        httpChannel = HttpChannel.getInstance();
        retrofitService = httpChannel.getRetrofitService();
    }

    /**
     * 获取快递信息
     *
     * @param type   快递类型
     * @param postid 快递单号
     */
    public void getPostInfo(String type, String postid) {
        Observable<PostInfo> observable = retrofitService.getPostInfoRx(type, postid);
        httpChannel.sendMessage(observable, Constant.UrlOrigin.get_post_info);
    }
}


text:
var isnumber = require('lodash.isnumber')
var allclose = require('allclose')

module.exports = function close (t) {
  return function (a, b, atol, rtol) {
    var msg = 'should all be close'
    if (isnumber(atol)) msg += ' (up to ' + atol + ')'
    var result = allclose(a, b, atol, rtol)
    if (result) return t.ok(true, msg)
    return t.equal(a, b, msg)
  }
}


text:
package com.twolattes.json.nativetypes;

import static com.twolattes.json.Json.FALSE;
import static com.twolattes.json.Json.NULL;
import static com.twolattes.json.Json.TRUE;
import static com.twolattes.json.Json.array;
import static com.twolattes.json.Json.number;
import static com.twolattes.json.Json.object;
import static com.twolattes.json.Json.string;
import static com.twolattes.json.TwoLattes.createMarshaller;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonMap;
import static org.junit.Assert.assertEquals;

import java.math.BigDecimal;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import com.twolattes.json.Marshaller;

public class JavaTypeMarshallingTest {

  Marshaller<Byte> byteMarshaller = createMarshaller(Byte.class);
  Marshaller<Short> shortMarshaller = createMarshaller(Short.class);
  Marshaller<Integer> integerMarshaller = createMarshaller(Integer.class);
  Marshaller<Long> longMarshaller = createMarshaller(Long.class);
  Marshaller<BigDecimal> bdMarshaller = createMarshaller(BigDecimal.class);
  Marshaller<Float> floatMarshaller = createMarshaller(Float.class);
  Marshaller<Double> doubleMarshaller = createMarshaller(Double.class);
  Marshaller<String> stringMarshaller = createMarshaller(String.class);
  Marshaller<Character> characterMarshaller = createMarshaller(Character.class);
  Marshaller<Boolean> booleanMarshaller = createMarshaller(Boolean.class);

  @Test
  public void literalTypes() {
    assertEquals(number(3), createMarshaller(Byte.TYPE).marshall((byte) 3));
    assertEquals(number(3), createMarshaller(Short.TYPE).marshall((short) 3));
    assertEquals(number(3), createMarshaller(Integer.TYPE).marshall(3));
    assertEquals(number(3), createMarshaller(Long.TYPE).marshall(3L));
    assertEquals(number(3.1), createMarshaller(Float.TYPE).marshall(3.1f));
    assertEquals(number(3.1), createMarshaller(Double.TYPE).marshall(3.1));
    assertEquals(string("c"), createMarshaller(Character.TYPE).marshall('c'));
    assertEquals(FALSE, createMarshaller(Boolean.TYPE).marshall(false));
  }

  @Test
  public void bytes() {
    assertEquals(
        NULL,
        byteMarshaller.marshall(null));
    assertEquals(
        number(23),
        byteMarshaller.marshall((byte) 23));
    assertEquals(
        array(number(Byte.MIN_VALUE), number(0), number(Byte.MAX_VALUE)),
        byteMarshaller.marshallList(asList(Byte.MIN_VALUE, (byte) 0, Byte.MAX_VALUE)));
    assertEquals(
        object(string("a"), number(2), string("-a"), number(-2)),
        byteMarshaller.marshallMap(map("a", (byte) 2, "-a", (byte) -2)));
  }

  @Test
  public void shorts() {
    assertEquals(
        number(Short.MIN_VALUE),
        shortMarshaller.marshall(Short.MIN_VALUE));
    assertEquals(
        array(),
        shortMarshaller.marshallList(Collections.<Short>emptyList()));
    assertEquals(
        object(string(";"), NULL),
        shortMarshaller.marshallMap(singletonMap(";", (Short) null)));
  }

  @Test
  public void integers() {
    assertEquals(
        number(Integer.MIN_VALUE),
        integerMarshaller.marshall(Integer.MIN_VALUE));
    assertEquals(
        array(number(1), NULL, number(1), number(0), number(1)),
        integerMarshaller.marshallList(asList(1, null, 1, 0, 1)));
    assertEquals(
        object(string("ii"), number(Integer.MAX_VALUE)),
        integerMarshaller.marshallMap(singletonMap("ii", Integer.MAX_VALUE)));
  }

  @Test
  public void longs() {
    assertEquals(
        number(-1234567890),
        longMarshaller.marshall(-1234567890L));
    assertEquals(
        array(number(-2), number(99999999999L)),
        longMarshaller.marshallList(asList(-2L, 99999999999L), "foo"));
    assertEquals(
        object(string("1"), number(2)),
        longMarshaller.marshallMap(singletonMap("1", 2L)));
  }

  @Test
  public void bigDecimals() {
    assertEquals(
        number(new BigDecimal("-12345678901234567890.12345")),
        bdMarshaller.marshall(new BigDecimal("-12345678901234567890.12345")));
    assertEquals(
        array(number(0)),
        bdMarshaller.marshallList(asList(BigDecimal.ZERO), null));
    assertEquals(
        object(string("B D"), number(1)),
        bdMarshaller.marshallMap(singletonMap("B D", BigDecimal.ONE)));
  }

  @Test
  public void floats() {
    assertEquals(
        number(new BigDecimal(".0000000000000000000000000000000000000117549435")),
        floatMarshaller.marshall(Float.MIN_NORMAL, null));
    assertEquals(
        array(number(Float.MIN_VALUE), number(Float.MAX_VALUE)),
        floatMarshaller.marshallList(asList(Float.MIN_VALUE, Float.MAX_VALUE)));
    assertEquals(
        object(),
        floatMarshaller.marshallMap(Collections.<String, Float>emptyMap()));
  }

  @Test(expected = NumberFormatException.class)
  public void floatNaN() {
    floatMarshaller.marshall(Float.NaN);
  }

  @Test(expected = NumberFormatException.class)
  public void floatPositiveInfinity() {
    floatMarshaller.marshall(Float.POSITIVE_INFINITY);
  }

  @Test(expected = NumberFormatException.class)
  public void floatNegativeInfinity() {
    floatMarshaller.marshall(Float.NEGATIVE_INFINITY);
  }

  @Test
  public void doubles() {
    assertEquals(
        number(new BigDecimal("3.141592653589793")),
        doubleMarshaller.marshall(Math.PI, null));
    assertEquals(
        array(number(Double.MAX_VALUE)),
        doubleMarshaller.marshallList(asList(Double.MAX_VALUE)));
    assertEquals(
        object(string("b"), number(1.0 / 3.0)),
        doubleMarshaller.marshallMap(singletonMap("b", 1.0 / 3.0)));
  }

  @Test(expected = NumberFormatException.class)
  public void doubleNaN() {
    doubleMarshaller.marshall(Double.NaN);
  }

  @Test(expected = NumberFormatException.class)
  public void doublePositiveInfinity() {
    doubleMarshaller.marshall(Double.POSITIVE_INFINITY);
  }

  @Test(expected = NumberFormatException.class)
  public void doubleNegativeInfinity() {
    doubleMarshaller.marshall(Double.NEGATIVE_INFINITY);
  }

  @Test
  public void strings() {
    assertEquals(
        string(""),
        stringMarshaller.marshall("", null));
    assertEquals(
        array(string(" \t \n '\"\"' ")),
        stringMarshaller.marshallList(asList(" \t \n '\"\"' ")));
    assertEquals(
        object(string("b"), NULL),
        stringMarshaller.marshallMap(singletonMap("b", (String) null)));
  }

  @Test
  public void characters() {
    assertEquals(
        string(String.valueOf(Character.MAX_VALUE)),
        characterMarshaller.marshall(Character.MAX_VALUE, "view"));
    assertEquals(
        array(string(" "), NULL, string("\n"), string("\u230C")),
        characterMarshaller.marshallList(asList(' ', null, '\n', '\u230C')));
    assertEquals(
        object(string("b"), string("c")),
        characterMarshaller.marshallMap(singletonMap("b", 'c')));
  }

  @Test
  public void booleans() {
    assertEquals(
        FALSE,
        booleanMarshaller.marshall(false));
    assertEquals(
        array(TRUE, TRUE, FALSE, NULL),
        booleanMarshaller.marshallList(asList(true, true, false, null)));
    assertEquals(
        object(string(""), FALSE, string(" "), TRUE),
        booleanMarshaller.marshallMap(map("", false, " ", true)));
  }

  private static <K, V> Map<K, V> map(K k1, V v1, K k2, V v2) {
    Map<K, V> map = new HashMap<K, V>(2);
    map.put(k1, v1);
    map.put(k2, v2);
    return map;
  }

}


text:
/* Desc: A basic gimbal controller
 * Author: John Hsu
 */

#ifndef _GAZEBO_GIMBAL_CONTROLLER_PLUGIN_HH_
#define _GAZEBO_GIMBAL_CONTROLLER_PLUGIN_HH_

#include <string>
#include <vector>

#include <gazebo/common/PID.hh>
#include <gazebo/common/Plugin.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/transport/transport.hh>
#include <gazebo/util/system.hh>
#include <gazebo/sensors/sensors.hh>

namespace gazebo
{
  class GAZEBO_VISIBLE GimbalControllerPlugin : public ModelPlugin
  {
    /// \brief Constructor
    public: GimbalControllerPlugin();

    public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);

    public: virtual void Init();

    private: void OnUpdate();

#if GAZEBO_MAJOR_VERSION >= 7 && GAZEBO_MINOR_VERSION >= 4
    /// only gazebo 7.4 and above support Any
    private: void OnPitchStringMsg(ConstAnyPtr &_msg);
    private: void OnRollStringMsg(ConstAnyPtr &_msg);
    private: void OnYawStringMsg(ConstAnyPtr &_msg);
#else
    private: void OnPitchStringMsg(ConstGzStringPtr &_msg);
    private: void OnRollStringMsg(ConstGzStringPtr &_msg);
    private: void OnYawStringMsg(ConstGzStringPtr &_msg);
#endif

    /// \TODO something to move into Angle class
    /// \brief returns _angle1 normalized about
    /// (_reference - M_PI, _reference + M_PI]
    /// \param[in] _angle1 input angle
    /// \param[in] _reference reference input angle for normalization
    /// \return normalized _angle1 about _reference
    private: double NormalizeAbout(double _angle, double _reference);

    /// \TODO something to move into Angle class
    /// \brief returns shortest angular distance from _from to _to
    /// \param[in] _from starting anglular position
    /// \param[in] _to end angular position
    /// \return distance traveled from starting to end angular positions
    private: double ShortestAngularDistance(double _from, double _to);

    private: sdf::ElementPtr sdf;

    private: std::vector<event::ConnectionPtr> connections;

    private: transport::SubscriberPtr pitchSub;
    private: transport::SubscriberPtr rollSub;
    private: transport::SubscriberPtr yawSub;

    private: transport::PublisherPtr pitchPub;
    private: transport::PublisherPtr rollPub;
    private: transport::PublisherPtr yawPub;

    private: physics::ModelPtr model;

    /// \brief yaw camera
    private: physics::JointPtr yawJoint;

    /// \brief camera roll joint
    private: physics::JointPtr rollJoint;

    /// \brief camera pitch joint
    private: physics::JointPtr pitchJoint;

    private: sensors::ImuSensorPtr imuSensor;

    private: std::string status;

    private: double pitchCommand;
    private: double yawCommand;
    private: double rollCommand;

    private: transport::NodePtr node;

    private: common::PID pitchPid;
    private: common::PID rollPid;
    private: common::PID yawPid;
    private: common::Time lastUpdateTime;

    private: ignition::math::Vector3d ThreeAxisRot(
      double r11, double r12, double r21, double r31, double r32);
    private: ignition::math::Vector3d QtoZXY(
      const ignition::math::Quaterniond &_q);
  };
}
#endif


text:
<?php

namespace Integrated\Common\Bulk\Tests\DependencyInjection;

use Integrated\Common\Bulk\DependencyInjection\FactoryRegistryBuilderPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

/**
 * @author Jan Sanne Mulder <jansanne@e-active.nl>
 */
class FactoryRegistryBuilderPassTest extends \PHPUnit\Framework\TestCase
{
    public function testProcess()
    {
        $service1 = $this->createMock(Definition::class);
        $service2 = $this->createMock(Definition::class);

        $definition = $this->createMock(Definition::class);
        $definition->expects($this->exactly(3))
            ->method('addMethodCall')
            ->withConsecutive(
                ['addFactory', $this->identicalTo(['class1', $service1])],
                ['addFactory', $this->identicalTo(['class2', $service1])],
                ['addFactory', $this->identicalTo(['class1', $service2])]
            );

        $container = $this->getContainer();
        $container->expects($this->once())
            ->method('hasDefinition')
            ->with('service')
            ->willReturn(true);

        $container->expects($this->exactly(3))
            ->method('getDefinition')
            ->withConsecutive(['service'], ['tagged.service.1'], ['tagged.service.2'])
            ->willReturnOnConsecutiveCalls($definition, $service1, $service2);

        $container->expects($this->once())
            ->method('findTaggedServiceIds')
            ->with('tag')
            ->willReturn([
                'tagged.service.1' => [['class' => 'class1'], ['class' => 'class2']],
                'tagged.service.2' => [['class' => 'class1']],
            ]);

        $this->getInstance()->process($container);
    }

    public function testProcessServiceNotFound()
    {
        $container = $this->getContainer();
        $container->expects($this->once())
            ->method('hasDefinition')
            ->with('service')
            ->willReturn(false);

        $container->expects($this->never())
            ->method('getDefinition');

        $container->expects($this->never())
            ->method('findTaggedServiceIds');

        $this->getInstance()->process($container);
    }

    /**
     * @return FactoryRegistryBuilderPass
     */
    protected function getInstance()
    {
        return new FactoryRegistryBuilderPass('service', 'tag');
    }

    /**
     * @return ContainerBuilder|\PHPUnit_Framework_MockObject_MockObject
     */
    protected function getContainer()
    {
        return $this->createMock(ContainerBuilder::class);
    }
}


text:
<?php
namespace Payum\Core\Request;

class Sync extends Generic
{
}


text:
package com.beng.anytopic;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.slf4j.LoggerFactory;

import lombok.extern.slf4j.Slf4j;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;

import com.beng.anytopic.a.MqttActor;
import com.beng.anytopic.c.Initializer;

import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.util.AttributeKey;
import io.netty.util.concurrent.GlobalEventExecutor;

/**
 * AnyTopic
 * @author torbjorncla
 *
 */
@Slf4j
public class App {

	private final static int PORT = 1884;
	public final static String MQTT_HOST = "tcp://m2m.eclipse.org:1883";
	public static final AttributeKey<String> CHANNEL_PATH = AttributeKey.valueOf("channelPath");

	//Move to Actor?
	private static final Map<String, ChannelGroup> clients = new ConcurrentHashMap<String, ChannelGroup>();

	public static ChannelGroup clientsCreateIfAbsent(final String topic) {
		if(clients.containsKey(topic)) {
			return clients.get(topic);
		}
		final ChannelGroup channelGroup = new DefaultChannelGroup(topic, GlobalEventExecutor.INSTANCE);
		clients.put(topic, channelGroup);
		return channelGroup;
	}

	public static ChannelGroup clients(final String topic) {
		if(clients.containsKey(topic)) {
			return clients.get(topic);
		}
		return null;
	}

	static {
		Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
		rootLogger.setLevel(Level.INFO);
	}

	public void run(final ActorRef actor) throws InterruptedException {
		EventLoopGroup boss = new NioEventLoopGroup();
		EventLoopGroup worker = new NioEventLoopGroup();

		try {
			ServerBootstrap b = new ServerBootstrap();
			b.group(boss, worker)
			.channel(NioServerSocketChannel.class)
			.childHandler(new Initializer(actor))
			.bind(PORT).sync().channel().closeFuture().sync();
		} finally {
			boss.shutdownGracefully();
			worker.shutdownGracefully();
		}
	}

	public static void main(String... x) throws Exception {
		log.info("----- Starting anyTopic -----");

		final ActorSystem system = ActorSystem.create("anyTopic");
		final ActorRef mqttActor = system.actorOf(Props.create(MqttActor.class), "mqttActor");

		new App().run(mqttActor);
	}
}


text:
.. rapidsms-twilio documentation master file, created by
   sphinx-quickstart on Fri Jun 21 08:47:24 2013.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

.. include:: ../README.rst

Contents
========

.. toctree::
   :maxdepth: 2

   quick-start
   features
   releases

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
/**
* @file XabslOption.h
*
* Definition of class Option and Helper classes
*
* @author Martin Loetzsch
* @author Max Risler
*/

#ifndef __XabslOption_h_
#define __XabslOption_h_

#include "XabslState.h"
#include "XabslBehavior.h"

namespace xabsl
{

/**
* @class OptionParameters
*
* Represents the current set of parameters of an option or basic behavior
*
* @author Martin Loetzsch
* @author Max Risler
*/
class OptionParameters : public Parameters
{
public:
  /**
  * Constructor.
  * @param input An input source for the intermediate code. It must be opened and read until
  *              A position where an option starts.
  * @param errorHandler A reference to a ErrorHandler instance
  * @param symbols All available symbols
  */
  OptionParameters(InputSource& input,
                        ErrorHandler& errorHandler,
                        Symbols& symbols);

  /** Destructor */
  ~OptionParameters();
};

/**
* @class Option
*
* Represents a single option written in
*
* @author Martin Loetzsch
* @author Max Risler
*/
class Option : public Behavior
{
public:
  /**
  * Constructor. Does not create the option.
  * @param name The name of the option. For debugging purposes.
  * @param input An input source for the intermediate code. It must be opened and read until
  *              A position where an option starts.
  * @param errorHandler A reference to a ErrorHandler instance
  * @param symbols All available symbols
  * @param pTimeFunction a pointer to a function that returns the system time in ms.
  * @param Index of the option in array options in corresponding engine
  */
  Option(const char* name, InputSource& input,
    ErrorHandler& errorHandler,
    Symbols& symbols,
    unsigned (*pTimeFunction)(),
    int index);

  /** Destructor. Deletes the states */
  ~Option();

  /**
  * Creates the option and it's states from the intermediate code.
  * @param input An input source for the intermediate code. It must be opened and read until
  *              A position where an option starts.
  * @param options All other options
  * @param basicBehaviors All basic behaviors
  * @param symbols All available symbols
  * @param agentPriority Priority value of the agent, used for solving conflicts in cooperative state assignment
  * @param synchronizationTicks Number of execution cycles that is required for synchonization with other agents, i.e time from sending a message until answer is received
  */
  void create(InputSource& input,
    NamedArray<Option*>& options,
    NamedArray<BasicBehavior*>& basicBehaviors,
    Symbols& symbols,
    const int& agentPriority,
    const int& synchronizationTicks);

  /**
  * Executes the option. The state machine is carried out to determine the subsequent
  * option or the subsequent basic behavior. Output symbols are set.
  */
  virtual void execute();

  /** The states of the option */
  NamedArray<State*> states;

  /** A pointer to the active state. If 0, then no state is active */
  State* activeState;

  /** Returns wheter the option reached a target state */
  bool getOptionReachedATargetState() const;

  /** Index of the option in array options in corresponding engine */
  int index;

private:

  /** A pointer to the initial state */
  State* initialState;

  /** Used for error handling */
  ErrorHandler& errorHandler;

  /** A pointer to a function that returns the system time in ms. */
  unsigned (*pTimeFunction)();
};

} // namespace

#endif //__XabslOption_h_


text:
PLIST=/Library/LaunchDaemons/com.github.timsutton.osx-vm-templates.detectnewhardware.plist
cat <<EOF > "${PLIST}"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.github.timsutton.osx-vm-templates.detectnewhardware</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/sbin/networksetup</string>
        <string>-detectnewhardware</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>
EOF

# These should be already set as follows, but since they're required
# in order to load properly, we set them explicitly.
/bin/chmod 644 "${PLIST}"
/usr/sbin/chown root:wheel "${PLIST}"


text:
import { expect } from 'chai';
import util from './util';

describe('Vouchers API', () => {
  describe('fetch', () => {

    it('should throw an error when no token', () => {
      const fsapi = util.getFullSlate({
        key: util.getKey()
      });

      expect(() => fsapi.vouchers()).to.throw('FullSlate token missing');
    });

    it('should get all vouchers', (done) => {
      const fsapi = util.getFullSlate();

      fsapi.vouchers()
        .then((vouchers) => {
          expect(vouchers).to.be.an('array');

          done();
        })
        .catch(done);
    });

    it.skip('should get an individual voucher', (done) => {
      const fsapi = util.getFullSlate();

      fsapi.vouchers()
        .then((vouchers) => {
          const { id } = vouchers[0];
          return fsapi.vouchers(id);
        })
        .then((voucher) => {
          expect(voucher).to.be.an('object');
          done();
        })
        .catch(done);
    });

    it('should reject request with invalid query parameter', (done) => {
      const fsapi = util.getFullSlate();

      fsapi.vouchers(-1)
        .then(done)
        .catch((result) => {
          expect(result.failure).to.be.true;
          expect(result.errorMessage).to.equal('Invalid redemption code, please check the value and try again.');
          done();
        })
        .catch(done);
    });

  });
});


text:
using namespace aff3ct;
using namespace aff3ct::tools;

template<typename R>
Event_probability<R>
::Event_probability(R value)
: Noise<R>(value)
{
	this->check();
}

template <typename R>
void Event_probability<R>
::check()
{
	auto n = this->get_value();
	if (n < (R)-0.00001 || n > (R)1.00001)
	{
		std::stringstream message;
		message << "The EP noise '_n' has to be between [0,1] ('_n' = " << n << ").";
		throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());
	}
}

template<typename R>
Noise_type Event_probability<R>
::get_type() const
{
	return Noise_type::EP;
}

template<typename R>
std::string Event_probability<R>
::get_unity() const
{
	return "";
}

// ==================================================================================== explicit template instantiation
template class aff3ct::tools::Event_probability<float>;
template class aff3ct::tools::Event_probability<double>;
// ==================================================================================== explicit template instantiation


text:
package io.reactivex.internal.operators.flowable;

import static org.junit.Assert.*;

import java.util.*;

import org.junit.Test;

import io.reactivex.Flowable;
import io.reactivex.exceptions.*;
import io.reactivex.functions.Function;
import io.reactivex.processors.PublishProcessor;
import io.reactivex.subscribers.TestSubscriber;

public class FlowableConcatDelayErrorTest {

    @Test
    public void mainCompletes() {
        PublishProcessor<Integer> source = PublishProcessor.create();

        TestSubscriber<Integer> ts = TestSubscriber.create();

        source.concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return Flowable.range(v, 2);
            }
        }).subscribe(ts);

        source.onNext(1);
        source.onNext(2);
        source.onComplete();

        ts.assertValues(1, 2, 2, 3);
        ts.assertNoErrors();
        ts.assertComplete();
    }

    @Test
    public void mainErrors() {
        PublishProcessor<Integer> source = PublishProcessor.create();

        TestSubscriber<Integer> ts = TestSubscriber.create();

        source.concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return Flowable.range(v, 2);
            }
        }).subscribe(ts);

        source.onNext(1);
        source.onNext(2);
        source.onError(new TestException());

        ts.assertValues(1, 2, 2, 3);
        ts.assertError(TestException.class);
        ts.assertNotComplete();
    }

    @Test
    public void innerErrors() {
        final Flowable<Integer> inner = Flowable.range(1, 2)
                .concatWith(Flowable.<Integer>error(new TestException()));

        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.range(1, 3).concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return inner;
            }
        }).subscribe(ts);

        ts.assertValues(1, 2, 1, 2, 1, 2);
        ts.assertError(CompositeException.class);
        ts.assertNotComplete();
    }

    @Test
    public void singleInnerErrors() {
        final Flowable<Integer> inner = Flowable.range(1, 2).concatWith(Flowable.<Integer>error(new TestException()));

        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.just(1)
        .hide() // prevent scalar optimization
        .concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return inner;
            }
        }).subscribe(ts);

        ts.assertValues(1, 2);
        ts.assertError(TestException.class);
        ts.assertNotComplete();
    }

    @Test
    public void innerNull() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.just(1)
        .hide() // prevent scalar optimization
        .concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return null;
            }
        }).subscribe(ts);

        ts.assertNoValues();
        ts.assertError(NullPointerException.class);
        ts.assertNotComplete();
    }

    @Test
    public void innerThrows() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.just(1)
        .hide() // prevent scalar optimization
        .concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                throw new TestException();
            }
        }).subscribe(ts);

        ts.assertNoValues();
        ts.assertError(TestException.class);
        ts.assertNotComplete();
    }

    @Test
    public void innerWithEmpty() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.range(1, 3)
        .concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return v == 2 ? Flowable.<Integer>empty() : Flowable.range(1, 2);
            }
        }).subscribe(ts);

        ts.assertValues(1, 2, 1, 2);
        ts.assertNoErrors();
        ts.assertComplete();
    }

    @Test
    public void innerWithScalar() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.range(1, 3)
        .concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return v == 2 ? Flowable.just(3) : Flowable.range(1, 2);
            }
        }).subscribe(ts);

        ts.assertValues(1, 2, 3, 1, 2);
        ts.assertNoErrors();
        ts.assertComplete();
    }

    @Test
    public void backpressure() {
        TestSubscriber<Integer> ts = TestSubscriber.create(0);

        Flowable.range(1, 3).concatMapDelayError(new Function<Integer, Flowable<Integer>>() {
            @Override
            public Flowable<Integer> apply(Integer v) {
                return Flowable.range(v, 2);
            }
        }).subscribe(ts);

        ts.assertNoValues();
        ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(1);
        ts.assertValues(1);
        ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(3);
        ts.assertValues(1, 2, 2, 3);
        ts.assertNoErrors();
        ts.assertNotComplete();

        ts.request(2);

        ts.assertValues(1, 2, 2, 3, 3, 4);
        ts.assertNoErrors();
        ts.assertComplete();
    }

    static <T> Flowable<T> withError(Flowable<T> source) {
        return source.concatWith(Flowable.<T>error(new TestException()));
    }

    @Test
    public void concatDelayErrorFlowable() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.concatDelayError(
                Flowable.just(Flowable.just(1), Flowable.just(2)))
        .subscribe(ts);

        ts.assertValues(1, 2);
        ts.assertNoErrors();
        ts.assertComplete();
    }

    @Test
    public void concatDelayErrorFlowableError() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.concatDelayError(
                withError(Flowable.just(withError(Flowable.just(1)), withError(Flowable.just(2)))))
        .subscribe(ts);

        ts.assertValues(1, 2);
        ts.assertError(CompositeException.class);
        ts.assertNotComplete();

        CompositeException ce = (CompositeException)ts.errors().get(0);
        List<Throwable> cex = ce.getExceptions();

        assertEquals(3, cex.size());

        assertTrue(cex.get(0).toString(), cex.get(0) instanceof TestException);
        assertTrue(cex.get(1).toString(), cex.get(1) instanceof TestException);
        assertTrue(cex.get(2).toString(), cex.get(2) instanceof TestException);
    }

    @SuppressWarnings("unchecked")
    @Test
    public void concatDelayErrorIterable() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.concatDelayError(
                Arrays.asList(Flowable.just(1), Flowable.just(2)))
        .subscribe(ts);

        ts.assertValues(1, 2);
        ts.assertNoErrors();
        ts.assertComplete();
    }

    @SuppressWarnings("unchecked")
    @Test
    public void concatDelayErrorIterableError() {
        TestSubscriber<Integer> ts = TestSubscriber.create();

        Flowable.concatDelayError(
                Arrays.asList(withError(Flowable.just(1)), withError(Flowable.just(2))))
        .subscribe(ts);

        ts.assertValues(1, 2);
        ts.assertError(CompositeException.class);
        ts.assertNotComplete();

        assertEquals(2, ((CompositeException)ts.errors().get(0)).getExceptions().size());
    }

}


text:
package org.languagetool.rules.uk;

import org.junit.Test;
import org.languagetool.JLanguageTool;
import org.languagetool.TestTools;
import org.languagetool.language.Ukrainian;
import org.languagetool.rules.RuleMatch;

import java.io.IOException;
import java.util.Arrays;

import static org.junit.Assert.assertEquals;

public class TypographyRuleTest {

  @Test
  public void testRule() throws IOException {
    TypographyRule rule = new TypographyRule(TestTools.getMessages("uk"));
    JLanguageTool langTool = new JLanguageTool(new Ukrainian());

    // correct sentences:
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("як-небудь")).length);

    assertEquals(0, rule.match(langTool.getAnalyzedSentence("А\u2013Т")).length);

    assertEquals(0, rule.match(langTool.getAnalyzedSentence("ХХ\u2013ХХІ")).length);

    //incorrect sentences:
    // TODO: does not work when word is the last in the sentence: "яскраво\u2013рожевий"
    RuleMatch[] matches = rule.match(langTool.getAnalyzedSentence("яскраво\u2013рожевий."));
    assertEquals(1, matches.length);
    assertEquals(Arrays.asList("яскраво-рожевий", "яскраво \u2014 рожевий"), matches[0].getSuggestedReplacements());

    // test unknown word
    matches = rule.match(langTool.getAnalyzedSentence("яскраво\u2013шуруровий."));
    assertEquals(1, matches.length);
    assertEquals(Arrays.asList("яскраво-шуруровий", "яскраво \u2014 шуруровий"), matches[0].getSuggestedReplacements());

    matches = rule.match(langTool.getAnalyzedSentence("Вовка\u2014Волкова."));
    assertEquals(1, matches.length);
    assertEquals(Arrays.asList("Вовка-Волкова", "Вовка \u2014 Волкова"), matches[0].getSuggestedReplacements());
  }

}


text:
package com.tl.sunshine.utils.helper;

import javax.microedition.khronos.opengles.GL10;

/**
 * Created by tlnacl on 22/12/14.
 */
public class MatrixGrabber {
    public MatrixGrabber() {
        mModelView = new float[16];
        mProjection = new float[16];
    }

    /**
     * Record the current modelView and projection matrix state.
     * Has the side effect of setting the current matrix state to GL_MODELVIEW
     *
     * @param gl
     */
    public void getCurrentState(GL10 gl) {
        getCurrentProjection(gl);
        getCurrentModelView(gl);
    }

    /**
     * Record the current modelView matrix state. Has the side effect of
     * setting the current matrix state to GL_MODELVIEW
     *
     * @param gl
     */
    public void getCurrentModelView(GL10 gl) {
        getMatrix(gl, GL10.GL_MODELVIEW, mModelView);
    }

    /**
     * Record the current projection matrix state. Has the side effect of
     * setting the current matrix state to GL_PROJECTION
     *
     * @param gl
     */
    public void getCurrentProjection(GL10 gl) {
        getMatrix(gl, GL10.GL_PROJECTION, mProjection);
    }

    private void getMatrix(GL10 gl, int mode, float[] mat) {
        MatrixTrackingGL gl2 = (MatrixTrackingGL) gl;
        gl2.glMatrixMode(mode);
        gl2.getMatrix(mat, 0);
    }

    public void setViewPort(int width, int height) {
        mViewPort = new int[]{
                0, 0, width, height
        };
    }

    public float[] mModelView;
    public float[] mProjection;
    public int[] mViewPort;
}


text:
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
namespace System.Management.Automation
{
    public enum ReturnContainers
    {
        ReturnMatchingContainers = 0,
        ReturnAllContainers = 1,
    }
}


text:
package org.apache.syncope.core.provisioning.api.cache;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Cache entry key.
 */
public class VirAttrCacheKey {

    /**
     * Any type name.
     */
    private final String type;

    /**
     * Any object key.
     */
    private final transient String key;

    /**
     * Virtual attribute schema name.
     */
    private final transient String virSchema;

    public VirAttrCacheKey(final String type, final String key, final String virSchema) {
        this.type = type;
        this.key = key;
        this.virSchema = virSchema;
    }

    public String getKind() {
        return type;
    }

    public String getKey() {
        return key;
    }

    public String getVirSchema() {
        return virSchema;
    }

    @Override
    public boolean equals(final Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj, true);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this, true);
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE, true);
    }
}


text:
"""
    多进程方式生成crawler
    """
import sys
import os
#免去环境变量配置
app_dir = os.path.abspath("../")
sys.path.append(app_dir)

reload(sys)
sys.setdefaultencoding( "utf-8" )

import time, yaml, json, re
from scrapy import log
from scrapy import signals
from scrapy.crawler import Crawler
from twisted.internet import reactor
from scrapy.utils.project import get_project_settings
#MYSQL
import pymysql
#MONGO
import pymongo
from bson.objectid import ObjectId
from gjqyxyxxcxxt.database.my_mongo import Mongo
#redis
from spiders.parser.repeat_handle import RepeatHandle

from spiders.parser.tyc_dispatcher import run
from spiders.gsj_phone_spider import GsjPhoneSpider

from gjqyxyxxcxxt import settings
from util.my_encode import Encoder
from util._time import *
from filed_conf import *
"""
    初始化所有站点
    @采集时间控制来至:队列
    @采集配置控制来至:配置文件
    """

def sys_exit(s):
    time.sleep(s)
    print '%s秒后系统退出!!!' % s
    exit()

def forever_run():
    """ 不断启动进程、查询队列、初始化站点
        """
    mongo_db = Mongo().get_db()
    mysql_db = pymysql.connect(host="172.16.16.15",port=3306,user="root",passwd="A1s1n0@zxyc#3",db="ixinnuo_sjcj",charset="utf8")
    redis_db = RepeatHandle()
    results = list(mongo_db.ic_data.find({"status" : 1}).sort([('last_crawl_time', pymongo.ASCENDING)]).limit(1))

    if not results:
        print '无需要采集的数据源!!!'
        sys_exit(5)

    time.sleep(2)

    spiders = []
    a = 0
    for data in results:
        #json_data = init_handle()
        print data
        res = {}
        json_data = data['json_data']
        print json_data
        if json_data and 'company_url' in json_data:
            tyc_id = re.findall('company/(\d+$)', json_data['company_url'])
            print tyc_id
            if tyc_id:
                res = run(tyc_id[0])

        if not json_data:
            mongo_db.ic_data.update({'_id': ObjectId(data['_id'])}, {'$set': {'status': -1}})
            sys_exit(3)

        json_data['crawl_time'] = get_current_date()
        if res:
            json_data['CHGINFO'] = res.get('CHGINFO', [])
            json_data['LEGINFO'] = res.get('LEGINFO', [])
            json_data['PERINFO'] = res.get('PERINFO', [])
            json_data['BRANINFO'] = res.get('BRANINFO', [])
            json_data['MORTINFO'] = res.get('MORTINFO', [])
            json_data['EXCEINFO'] = res.get('EXCEINFO', [])
            json_data['PUNINFO'] = res.get('PUNINFO', [])
            add_base_info_to_mysql(mysql_db, json_data)
            print json_data['ENTNAME']
            if json_data['PERINFO']:
                add_ryxx_to_mysql(mysql_db, json_data)
            if json_data['CHGINFO']:
                add_bgxx_to_mysql(mysql_db, json_data)
            if json_data['LEGINFO']:
                add_czxx_to_mysql(mysql_db, json_data)
            item = {}
            item['retData'] = json_data
            item['errNum'] = 0
            item['abstract'] = ""
            item['userID'] = ""
            item['timeStamps'] = int(time.time())
            item['errMsg'] = "success"
            json_data_str = json.dumps(item, cls=Encoder)
            redis_db.set_value(data['company_md5'], json_data_str)
            mongo_db.ic_data.update({'_id': ObjectId(data['_id'])}, {'$set': {'status': 3, 'json_data': json_data_str, 'part_tyc': True, 'last_crawl_time': int(time.time() * 1000)}})

if __name__ == '__main__':
    forever_run()


text:
// Copyright (c) Luka Kunic, 2016.

#include "Virtusonic.h"
#include "SongNote.h"

/*
 * Initializes the note structure. Used instead of the constructor when instantiating the note.
 */
void USongNote::Init(int32 startTick, int32 endTick, int32 pitch, int32 velocity)
{
	StartTick = startTick;
	mEndTick = endTick;
	mPitch = pitch;
	mVelocity = velocity;
}

/*
 * Returns the note start tick.
 */
int32 USongNote::GetStartTick()
{
	return StartTick;
}

/*
* Returns the note end tick.
*/
int32 USongNote::GetEndTick()
{
	return mEndTick;
}

/*
* Returns the note pitch.
*/
int32 USongNote::GetPitch()
{
	return mPitch;
}

/*
* Returns the note velocity.
*/
int32 USongNote::GetVelocity()
{
	return mVelocity;
}

/*
 * Returns the actual note frequency calculated using the pitch identifier.
 * Assumes A4 note on 440Hz.
 */
double USongNote::GetFrequency()
{
	return 440.0f * pow(NOTE_FREQUENCY_FACTOR, mPitch - 0x45);
}

/*
* Sets the note end tick.
*/
void USongNote::SetEndTick(int32 endTick)
{
	mEndTick = endTick;
}


text:
package org.apache.fineract.portfolio.client.handler;

import org.apache.fineract.commands.annotation.CommandType;
import org.apache.fineract.commands.handler.NewCommandSourceHandler;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
import org.apache.fineract.portfolio.client.api.ClientApiConstants;
import org.apache.fineract.portfolio.client.service.ClientTransactionWritePlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@CommandType(entity = ClientApiConstants.CLIENT_RESOURCE_NAME, action = ClientApiConstants.CLIENT_TRANSACTION_ACTION_UNDO)
public class UndoClientTransactionCommandHandler implements NewCommandSourceHandler {

    private final ClientTransactionWritePlatformService writePlatformService;

    @Autowired
    public UndoClientTransactionCommandHandler(final ClientTransactionWritePlatformService writePlatformService) {
        this.writePlatformService = writePlatformService;
    }

    @Transactional
    @Override
    public CommandProcessingResult processCommand(final JsonCommand command) {
        return this.writePlatformService.undo(command.getClientId(), command.entityId());
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using GSoft.Dynamite.Common.Contracts.Configuration;
using GSoft.Dynamite.Publishing.Contracts.Configuration;
using GSoft.Dynamite.Publishing.Contracts.Constants;
using GSoft.Dynamite.Search;

namespace GSoft.Dynamite.Publishing.Core.Configuration
{
    /// <summary>
    /// Configuration for the creation of the Result Types
    /// </summary>
    public class PublishingResultTypeInfoConfig : IPublishingResultTypeInfoConfig
    {
        private readonly IPublishingDisplayTemplateInfoConfig publishingDisplayTemplateInfoConfig;
        private readonly IPublishingResultSourceInfoConfig publishingResultSourceInfoConfig;
        private readonly IConsolidatedManagedPropertyConfig consolidatedManagedPropertyConfig;

        /// <summary>
        /// Initializes a new instance of the <see cref="PublishingResultTypeInfoConfig"/> class.
        /// </summary>
        /// <param name="publishingDisplayTemplateInfoConfig">The publishing display template information configuration.</param>
        /// <param name="publishingResultSourceInfoConfig">The publishing result source information configuration.</param>
        /// <param name="consolidatedManagedPropertyConfig">The publishing managed property information configuration.</param>
        public PublishingResultTypeInfoConfig(
            IPublishingDisplayTemplateInfoConfig publishingDisplayTemplateInfoConfig,
            IPublishingResultSourceInfoConfig publishingResultSourceInfoConfig,
            IConsolidatedManagedPropertyConfig consolidatedManagedPropertyConfig)
        {
            this.publishingDisplayTemplateInfoConfig = publishingDisplayTemplateInfoConfig;
            this.publishingResultSourceInfoConfig = publishingResultSourceInfoConfig;
            this.consolidatedManagedPropertyConfig = consolidatedManagedPropertyConfig;
        }

        /// <summary>
        /// Property that return all the result types to create in the publishing module
        /// </summary>
        public IList<ResultTypeInfo> ResultTypes
        {
            get
            {
                var resultTypes = new List<ResultTypeInfo>()
                {
                    this.NewsPageResultType,
                    this.ContentPageResultType,
                    this.CategoryItemResultType
                };

                return resultTypes;
            }
        }

        private ResultTypeInfo NewsPageResultType
        {
            get
            {
                var resultType = PublishingResultTypeInfos.NewsPageResultType;
                resultType.DisplayTemplate = this.publishingDisplayTemplateInfoConfig.GetDisplayTemplateInfoByName(PublishingDisplayTemplateInfos.ItemSingleNewsItemContent.Name);
                resultType.ResultSource = this.publishingResultSourceInfoConfig.GetResultSourceInfoByName(PublishingResultSourceInfos.SingleCatalogItem.Name);

                return resultType;
            }
        }

        private ResultTypeInfo ContentPageResultType
        {
            get
            {
                var resultType = PublishingResultTypeInfos.ContentPageResultType;
                resultType.DisplayTemplate = this.publishingDisplayTemplateInfoConfig.GetDisplayTemplateInfoByName(PublishingDisplayTemplateInfos.ItemSingleContentItem.Name);
                resultType.ResultSource = this.publishingResultSourceInfoConfig.GetResultSourceInfoByName(PublishingResultSourceInfos.SingleTargetItem.Name);

                return resultType;
            }
        }

        private ResultTypeInfo CategoryItemResultType
        {
            get
            {
                var resultType = PublishingResultTypeInfos.ContentPageResultType;
                resultType.DisplayTemplate = this.publishingDisplayTemplateInfoConfig.GetDisplayTemplateInfoByName(PublishingDisplayTemplateInfos.ItemNewsCategoryItem.Name);
                resultType.ResultSource = this.publishingResultSourceInfoConfig.GetResultSourceInfoByName(PublishingResultSourceInfos.CatalogCategoryItems.Name);
                resultType.DisplayProperties.Add(this.consolidatedManagedPropertyConfig.GetManagedPropertyInfoByName(PublishingManagedPropertyInfos.Summary.Name));

                return resultType;
            }
        }

        /// <summary>
        /// Gets the result type information by name from this configuration.
        /// </summary>
        /// <param name="name">The name of the Result Type.</param>
        /// <returns>
        /// The result type information
        /// </returns>
        public ResultTypeInfo GetResultTypeInfoByName(string name)
        {
            return this.ResultTypes.Single(r => r.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
        }
    }
}


text:
package org.springframework.boot.autoconfigure.hazelcast;

import javax.persistence.EntityManagerFactory;

import com.hazelcast.core.HazelcastInstance;

import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.AllNestedConditions;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.data.jpa.EntityManagerFactoryDependsOnPostProcessor;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.jpa.AbstractEntityManagerFactoryBean;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;

/**
 * Additional configuration to ensure that {@link EntityManagerFactory} beans depend on
 * the {@code hazelcastInstance} bean.
 *
 * @author Stephane Nicoll
 * @since 1.3.2
 */
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ HazelcastInstance.class,
		LocalContainerEntityManagerFactoryBean.class })
@AutoConfigureAfter({ HazelcastAutoConfiguration.class,
		HibernateJpaAutoConfiguration.class })
public class HazelcastJpaDependencyAutoConfiguration {

	@Bean
	@Conditional(OnHazelcastAndJpaCondition.class)
	public static HazelcastInstanceJpaDependencyPostProcessor hazelcastInstanceJpaDependencyPostProcessor() {
		return new HazelcastInstanceJpaDependencyPostProcessor();
	}

	private static class HazelcastInstanceJpaDependencyPostProcessor
			extends EntityManagerFactoryDependsOnPostProcessor {

		HazelcastInstanceJpaDependencyPostProcessor() {
			super("hazelcastInstance");
		}

	}

	static class OnHazelcastAndJpaCondition extends AllNestedConditions {

		OnHazelcastAndJpaCondition() {
			super(ConfigurationPhase.REGISTER_BEAN);
		}

		@ConditionalOnBean(name = "hazelcastInstance")
		static class HasHazelcastInstance {

		}

		@ConditionalOnBean(AbstractEntityManagerFactoryBean.class)
		static class HasJpa {

		}

	}

}


text:
#ifndef LLGL_INPUT_H
#define LLGL_INPUT_H

#include <LLGL/Window.h>
#include <LLGL/Types.h>
#include <string>

namespace LLGL
{

/**
\brief Default window event listener to receive user input.
\remarks This class stores all received user input for a simple evaluation.
However, for efficient evaluation, write your own sub class and only respond to user input when the appropriate callback is invoked.
Here is an example usage:
\code
auto myInput = std::make_shared<LLGL::Input>();
myWindow->AddEventListener(myInput);
while (myWindow->ProcessEvents()) {
    // Quit main loop when user hit the escape key.
    if (myInput->KeyDown(LLGL::Key::Escape))
        break;

    // Rendering goes here ...
}
\endcode
\todo Make Window::EventListener a member of Input instead of extending it. Also add a member of Canvas::EventListener and add touch event functions.
*/
class LLGL_EXPORT Input : public Interface
{

        LLGL_DECLARE_INTERFACE( InterfaceID::Input );

    public:

        //! Default initializes the input handler without assigning to any surface.
        Input();

        //! Assigns an event listener for this input handler to the specified surface.
        Input(Surface& surface);

        //! Adds an event listener for this input handler to the specified surface.
        void Listen(Surface& surface);

        //! Removes the event listener for this input handler from the specified surface.
        void Drop(Surface& surface);

        //! Returns true if the specified key is currently being pressed down.
        bool KeyPressed(Key keyCode) const;

        //! Returns true if the specified key was pressed down in the previous event processing.
        bool KeyDown(Key keyCode) const;

        //! Returns true if the specified key was pressed down in the previous event processing (this event will be repeated, depending on the paltform settings).
        bool KeyDownRepeated(Key keyCode) const;

        //! Returns true if the specified key was released in the previous event processing.
        bool KeyUp(Key keyCode) const;

        /**
        \brief Returns true if the specified key was double clicked.
        \remarks This can only be true for the key codes: Key::LButton, Key::RButton, and Key::MButton.
        */
        bool KeyDoubleClick(Key keyCode) const;

        //! Returns the local mouse position.
        inline const Offset2D& GetMousePosition() const
        {
            return mousePosition_;
        }

        //! Returns the global mouse motion.
        inline const Offset2D& GetMouseMotion() const
        {
            return mouseMotion_;
        }

        //! Returns the mouse wheel motion.
        inline int GetWheelMotion() const
        {
            return wheelMotion_;
        }

        //! Returns the entered characters.
        inline const std::wstring& GetEnteredChars() const
        {
            return chars_;
        }

        //! Returns the number of any keys being pressed.
        inline std::size_t GetAnyKeyCount() const
        {
            return anyKeyCount_;
        }

    private:

        using KeyStateArray = bool[256];

        struct KeyTracker
        {
            static const size_t maxCount    = 10;
            Key                 keys[maxCount];
            size_t              resetCount  = 0;

            void Add(Key keyCode);
            void Reset(KeyStateArray& keyStates);
        };

    private:

        static void InitArray(KeyStateArray& keyStates);

    private:

        class WindowEventListener;
        class CanvasEventListener;

        friend WindowEventListener;
        friend CanvasEventListener;

        KeyStateArray   keyPressed_;
        KeyStateArray   keyDown_;
        KeyStateArray   keyDownRepeated_;
        KeyStateArray   keyUp_;

        Offset2D        mousePosition_;
        Offset2D        mouseMotion_;

        int             wheelMotion_    = 0;

        KeyTracker      keyDownTracker_;
        KeyTracker      keyDownRepeatedTracker_;
        KeyTracker      keyUpTracker_;

        bool            doubleClick_[3];

        std::wstring    chars_;

        std::size_t     anyKeyCount_    = 0;

        std::vector<std::pair<std::shared_ptr<WindowEventListener>, const Surface*>> windowEventListeners_;
        std::vector<std::pair<std::shared_ptr<CanvasEventListener>, const Surface*>> canvasEventListeners_;

};

} // /namespace LLGL

#endif

// ================================================================================


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

using System.Text;

namespace LibNVim.Motions
{
    class MotionMoveToStartOfDocument : AbstractVimMotion
    {
        public MotionMoveToStartOfDocument(Interfaces.IVimHost host, int repeat)
            : base(host, repeat)
        {
        }

        public override VimPoint Move(Interfaces.IVimHost host)
        {
            host.MoveToStartOfDocument();
            return host.CurrentPosition;
        }
    }
}


text:
var cookie = require('../index');

chai.should();

describe('cookie monster', function() {

  it('sets a cookie', function (){
    cookie.setItem('cookieKey', 'cookieVal');
    document.cookie.should.contain('cookieKey=cookieVal');
  });

  it('gets a cookie', function (){
    document.cookie = 'dumby=mcdumberson;';
    cookie.getItem('dumby').should.equal('mcdumberson');
  });

  it('sets and gets cookie with `=` in value', function (){
    cookie.setItem('key', 'val=ue');
    cookie.getItem('key').should.equal('val=ue');
  });

  it('removes a cookie', function (){
    document.cookie = 'dumby=mcdumberson;';
    document.cookie.should.contain('dumby=mcdumberson');
    cookie.removeItem('dumby');
    document.cookie.should.not.contain('dumby=mcdumberson');
  });

  it('sets 30 cookies and clears all of them', function (){
    for (var i = 0; i++; i < 30){ cookie.setItem('key' + i, 'value' + i); }
    for (var i = 0; i++; i < 30){ cookie.getItem('key' + i).should.equal('value' + i); }
    cookie.clear();
    document.cookie.should.equal('');
  });
});


text:
var big_array = new Float64Array([0.523565555, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 333333232134.1]);
big_array.constructor = Float32Array;

var result_float32_array = big_array.filter(x => x % 2 == 0);
assert(result_float32_array instanceof Float32Array);
assert(result_float32_array.length === 5);

// Create an even smaller result TypedArray.
big_array.constructor = Uint8Array;
var result_uint8_array = big_array.filter(x => x % 3 == 0);
assert(result_uint8_array instanceof Uint8Array);
assert(result_uint8_array.length === 3);

// Trigger a filter error when at the last element
try {
  big_array.filter(function(x, idx) {
    if (idx > 10) {
        throw new Error("Error test magic");
    }
    return x % 4 == 0;
  });
} catch (ex) {
  assert(ex instanceof Error);
  assert(ex.message === "Error test magic");
}


text:
<?
 Include("Includes/global.inc.php");
 checkPermissions(1, 900);

  $strSQL = "SELECT firstName, middleInit, lastName, email FROM tblSecurity WHERE
    id=" . $_SESSION['userID'] . " AND accountID=" . $_SESSION['accountID'] . "";
  $result = dbquery($strSQL);
  $row = mysql_fetch_row($result);
  $strFromName = buildName($row[0], $row[1], $row[2], 1);
  $strFromEmail = $row[3];
  mysql_free_result($result);

  If (getOrPost('btnSubmit')) {
      $strSubject         = validateText($progText800, getOrPost('txtSubject'), 2, 100, TRUE, FALSE);
	  $strBody            = validateText($progText801, getOrPost('txtBody'), 2, 4000, TRUE, FALSE);
      if ($_SESSION['stuckAtLocation']) {
          $cboLocationID = $_SESSION['locationStatus'];
      } else {
          $cboLocationID      = cleanFormInput(getOrPost('cboLocationID'));
      }
	  $cboSoftwareType    = cleanFormInput(getOrPost('cboSoftwareType'));
	  $cboSystemType      = cleanFormInput(getOrPost('cboSystemType'));
	  $cboPeripheralType  = cleanFormInput(getOrPost('cboPeripheralType'));

      If (!$strError) {

          $strSelect          = " SELECT DISTINCT u.firstName, u.lastName, u.email ";
          $strFrom            = " FROM tblSecurity AS u ";
          $strJoin            = "";
          $strWhere           = " WHERE ";
          $strFixedCondition  = " u.email!='' AND u.email IS NOT NULL AND u.hidden='0' AND u.accountID=" . $_SESSION['accountID'] . " ";

          If (is_numeric(getOrPost('cboUser')) AND getOrPost('radUser')) {
              $strError = $progText802; # select either user or group
        # } ElseIf (is_numeric(getOrPost('cboUser'))) {
        #    $strCondition = "AND u.id=$cboUser";
          } ElseIf (getOrPost('radUser') == "withRights") {
              $strCondition = "AND u.securityLevel<3";
          } ElseIf (getOrPost('radUser') == "location" && is_numeric($cboLocationID)) {
              $strCondition = "AND u.userLocationID=$cboLocationID";
          } ElseIf (getOrPost('radUser') == "softwareType" && is_numeric($cboSoftwareType)) {
			  $strJoin = " INNER JOIN hardware AS h ON u.id=h.userID INNER JOIN software AS s ON h.hardwareID=s.hardwareID ";
			  $strWhere = " WHERE h.accountID=u.accountID AND s.hidden='0' AND ";
              $strCondition = " AND s.softwareTraitID=$cboSoftwareType";
          } ElseIf (getOrPost('radUser') == "systemType" && is_numeric($cboSystemType)) {
			  $strJoin = " INNER JOIN hardware AS h ON u.id=h.userID ";
			  $strWhere = " WHERE h.accountID=u.accountID AND ";
              $strCondition = " AND h.hardwareTypeID=$cboSystemType";
          } ElseIf (getOrPost('radUser') == "peripheralType" && is_numeric($cboPeripheralType)) {
			  $strJoin = " INNER JOIN hardware AS h ON u.id=h.userID INNER JOIN peripherals AS p ON h.hardwareID=p.hardwareID ";
			  $strWhere = " WHERE p.accountID=u.accountID AND p.hidden='0' AND ";
              $strCondition = " AND p.peripheralTraitID=$cboPeripheralType";
          } ElseIf (getOrPost('radUser') != "all") {
              $strError = $progText803; # select a target
          }
      }
      If (!$strError) {

		  $strSQL = $strSelect . $strFrom  . $strJoin . $strWhere . $strFixedCondition . $strCondition;

          $mailCount = 0;
          $result = dbquery($strSQL);
          While ($row = mysql_fetch_array($result)) {
              $strFirstName  = $row["firstName"];
              $strLastName   = $row["lastName"];
              $strEmail      = $row["email"];

              $strSalutation = $progText804." ".$strFirstName." ".$strLastName.",\n\n";

        	  $strMessage = $strSalutation.$strBody;

              If ($strEmail) {
                  mail($strEmail, $strSubject, stripslashes($strMessage), "From: $strFromName <$strFromEmail>\r\nReply-To: $strFromEmail\r\n");
                  $mailCount++;
              }
          }
          If ($mailCount > 1) {
              $sentText = $progText805; # emails sent
          } Else {
              $sentText = $progText806; # email sent
          }
          $strError = $mailCount." ".$sentText.".";
      }

  }

  writeHeader($progText807);
  declareError(TRUE);
?>

<form name="formXYZ" method="POST" action="emailUsers.php">

      * <?=$progText808;?>:

    <? if (!$_SESSION['stuckAtLocation']) { ?>

      <?=$progText810A;?>:
      <input type='radio' name='radUser' value='location' <?=writeChecked(getOrPost('radUser'), "location");?> onClick="formXYZ.cboSystemType.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboPeripheralType.value='';">
          <select SIZE="1" NAME="cboLocationID" onChange="formXYZ.radUser[0].checked=true; formXYZ.cboSystemType.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboPeripheralType.value='';">
          <?
          // Get all location types for the drop down menu
          $strSQL = "SELECT * FROM locations WHERE accountID=" . $_SESSION['accountID'] . " ORDER BY locationName ASC";
          $result = dbquery($strSQL);
          echo "   <OPTION VALUE=\"\"> </OPTION>\n";
          while ($row = mysql_fetch_array($result)) {
              echo "   <OPTION VALUE=\"".$row['locationID']."\" ";
              echo writeSelected($cboLocationID, $row['locationID']);
              echo ">".$row['locationName']."</OPTION>\n";
           }
          ?>
          </select>

    <? } ?>

      <?=$progText810C;?>:
      <input type='radio' name='radUser' value='systemType' <?=writeChecked(getOrPost('radUser'), "systemType");?> onClick="formXYZ.cboLocationID.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboPeripheralType.value='';">
        <select size="1" name="cboSystemType" onChange="formXYZ.radUser[1].checked=true; formXYZ.cboLocationID.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboPeripheralType.value='';">
          <option value=''> </option>
			<?
			// Get all hardware types for the drop down menu
			$strSQLx = "SELECT hardwareTypeID, visDescription, visManufacturer FROM hardware_types WHERE
			  accountID=" . $_SESSION['accountID'] . " ORDER BY visDescription ASC";
			$resultx = dbquery($strSQLx);
			while ($rowx = mysql_fetch_array($resultx)) {
			  echo "   <option value=\"".$rowx['hardwareTypeID']."\" ";
			  echo writeSelected($cboSystemType, $rowx['hardwareTypeID']);
			  echo ">".writePrettySystemName($rowx['visDescription'], $rowx['visManufacturer'])."</option>\n";
			}
			?>
         </select>

      <?=$progText810B;?>:
      <input type='radio' name='radUser' value='softwareType' <?=writeChecked(getOrPost('radUser'), "softwareType");?> onClick="formXYZ.cboSystemType.value=''; formXYZ.cboLocationID.value=''; formXYZ.cboPeripheralType.value='';">
        <select size="1" name="cboSoftwareType" onChange="formXYZ.radUser[2].checked=true; formXYZ.cboSystemType.value=''; formXYZ.cboLocationID.value=''; formXYZ.cboPeripheralType.value='';">
			<option value=''> </option>
			 <?
			 // Get all software types for the drop down menu
			 $strSQLx = "SELECT * FROM software_traits WHERE accountID=" . $_SESSION['accountID'] . " AND hidden='0'
			   ORDER BY visName ASC";
			 $resultx = dbquery($strSQLx);
			 while ($rowx = mysql_fetch_array($resultx)) {
			   echo "   <option value=\"".$rowx['softwareTraitID']."\" ";
			   echo writeSelected($cboSoftwareType, $rowx['softwareTraitID']).">";
			   echo writePrettySoftwareName($rowx['visName'], $rowx['visVersion'], $rowx['visMaker']);
			   echo "</option>\n";
			 }
			 ?>
     </select>

      <?=$progText810D;?>:
      <input type='radio' name='radUser' value='peripheralType' <?=writeChecked(getOrPost('radUser'), "peripheralType");?> onClick="formXYZ.cboSystemType.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboLocationID.value='';">
        <select size="1" name="cboPeripheralType" onChange="formXYZ.radUser[3].checked=true; formXYZ.cboSystemType.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboLocationID.value='';">
		  <option value=''> </option>
			<?
			// Get all peripheral types for the drop down menu
			$strSQLx = "SELECT * FROM peripheral_traits WHERE accountID=" . $_SESSION['accountID'] . " AND hidden='0'
			  ORDER BY visDescription ASC";
			$resultx = dbquery($strSQLx);
			while ($rowx = mysql_fetch_array($resultx)) {
			  echo "   <option value=\"".$rowx['peripheralTraitID']."\" ";
			  echo writeSelected($cboPeripheralType, $rowx['peripheralTraitID']).">";
			  echo writePrettyPeripheralName($rowx['visDescription'], $rowx['visModel'], $rowx['visManufacturer']);
			  echo "</option>\n";
			}
			?>
        </select>

      <?=$progText810;?>:
      <input type='radio' name='radUser' value='withRights' <?=writeChecked(getOrPost('radUser'), "withRights");?> onClick="formXYZ.cboLocationID.value=''; formXYZ.cboSystemType.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboPeripheralType.value='';">

      <?=$progText811;?>:
      <input type='radio' name='radUser' value='all' <?=writeChecked(getOrPost('radUser'), "all");?> onClick="formXYZ.cboLocationID.value=''; formXYZ.cboSystemType.value=''; formXYZ.cboSoftwareType.value=''; formXYZ.cboPeripheralType.value='';">

      <?=$progText812;?>:
      <?=$strFromName;?>

      <?=$progText813;?>:
      <?=$strFromEmail;?>

      * <?=$progText800;?>:
      <input type="text" name="txtSubject" value="<?echo antiSlash($strSubject);?>" size="40" maxlength="100">

      * <?=$progText801;?>:
      <textarea name="txtBody" rows="9" cols="65" wrap="virtual"><?echo antiSlash($strBody);?></textarea>

  <input type="submit" value="Submit" name="btnSubmit" onClick="return warn_on_submit('<?=$progText814;?>');">
    <input type="reset" name="btnReset" value="<?=$progText815;?>">

</form>

<?
  writeFooter();
?>


text:
build: draw.py server.py
	rm -rf build dist *.spec || :;
	cxfreeze -OO draw.py --target-dir=dist/draw
	cxfreeze -OO server.py --target-dir=dist/serve
	echo 'MATHDRAW=$$1 ./draw' > dist/draw/mathdraw.sh
	chmod +x dist/draw/mathdraw.sh

run: build
	./dist/draw/draw

serve: build
	./dist/serve/server

deps:
	pip3 install -r requirements.txt


text:
package org.datavec.api.writable;

import org.datavec.api.io.WritableComparable;
import org.datavec.api.util.ndarray.DataInputWrapperStream;
import org.datavec.api.util.ndarray.DataOutputWrapperStream;
import org.nd4j.linalg.api.iter.NdIndexIterator;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.factory.Nd4j;

import org.jetbrains.annotations.NotNull;
import org.nd4j.linalg.util.MathUtils;

import java.io.*;
import java.util.Arrays;

/**
 * A Writable that basically wraps an INDArray.
 *
 * @author saudet
 */
public class NDArrayWritable extends ArrayWritable implements WritableComparable {
    public static final byte NDARRAY_SER_VERSION_HEADER_NULL = 0;
    public static final byte NDARRAY_SER_VERSION_HEADER = 1;

    private INDArray array = null;
    private Integer hash = null;

    public NDArrayWritable() {}

    public NDArrayWritable(INDArray array) {
        set(array);
    }

    /**
     * Deserialize into a row vector of default type.
     */
    public void readFields(DataInput in) throws IOException {
        DataInputStream dis = new DataInputStream(new DataInputWrapperStream(in));
        byte header = dis.readByte();
        if (header != NDARRAY_SER_VERSION_HEADER && header != NDARRAY_SER_VERSION_HEADER_NULL) {
            throw new IllegalStateException("Unexpected NDArrayWritable version header - stream corrupt?");
        }

        if (header == NDARRAY_SER_VERSION_HEADER_NULL) {
            array = null;
            return;
        }

        array = Nd4j.read(dis);
        hash = null;
    }

    @Override
    public void writeType(DataOutput out) throws IOException {
        out.writeShort(WritableType.NDArray.typeIdx());
    }

    @Override
    public WritableType getType() {
        return WritableType.NDArray;
    }

    /**
     * Serialize array data linearly.
     */
    public void write(DataOutput out) throws IOException {
        if (array == null) {
            out.write(NDARRAY_SER_VERSION_HEADER_NULL);
            return;
        }

        INDArray toWrite;
        if (array.isView()) {
            toWrite = array.dup();
        } else {
            toWrite = array;
        }

        //Write version header: this allows us to maintain backward compatibility in the future,
        // with features such as compression, sparse arrays or changes on the DataVec side
        out.write(NDARRAY_SER_VERSION_HEADER);
        Nd4j.write(toWrite, new DataOutputStream(new DataOutputWrapperStream(out)));
    }

    public void set(INDArray array) {
        this.array = array;
        this.hash = null;
    }

    public INDArray get() {
        return array;
    }

    /**
     * Returns true iff o is a ArrayWritable with the same value.
     */
    public boolean equals(Object o) {
        if (!(o instanceof NDArrayWritable)) {
            return false;
        }
        INDArray io = ((NDArrayWritable) o).get();

        if (this.array == null && io != null || this.array != null && io == null) {
            return false;
        }

        if (this.array == null) {
            //Both are null
            return true;
        }

        //For NDArrayWritable: we use strict equality. Otherwise, we can have a.equals(b) but a.hashCode() != b.hashCode()
        return this.array.equalsWithEps(io, 0.0);
    }

    @Override
    public int hashCode() {
        if (hash != null) {
            return hash;
        }

        //Hashcode needs to be invariant to array order - otherwise, equal arrays can have different hash codes
        // for example, C vs. F order arrays with otherwise identical contents

        if (array == null) {
            hash = 0;
            return hash;
        }

        int hash = Arrays.hashCode(array.shape());
        long length = array.length();
        NdIndexIterator iter = new NdIndexIterator('c', array.shape());
        for (int i = 0; i < length; i++) {
            hash ^= MathUtils.hashCode(array.getDouble(iter.next()));
        }

        this.hash = hash;
        return hash;
    }

    @Override
    public int compareTo(@NotNull Object o) {
        NDArrayWritable other = (NDArrayWritable) o;

        //Conventions used here for ordering NDArrays: x.compareTo(y): -ve if x < y, 0 if x == y, +ve if x > y
        //Null first
        //Then smallest rank first
        //Then smallest length first
        //Then sort by shape
        //Then sort by contents
        //The idea: avoid comparing contents for as long as possible

        if (this.array == null) {
            if (other.array == null) {
                return 0;
            }
            return -1;
        }
        if (other.array == null) {
            return 1;
        }

        if (this.array.rank() != other.array.rank()) {
            return Integer.compare(array.rank(), other.array.rank());
        }

        if (array.length() != other.array.length()) {
            return Long.compare(array.length(), other.array.length());
        }

        for (int i = 0; i < array.rank(); i++) {
            if (Long.compare(array.size(i), other.array.size(i)) != 0) {
                return Long.compare(array.size(i), other.array.size(i));
            }
        }

        //At this point: same rank, length, shape
        NdIndexIterator iter = new NdIndexIterator('c', array.shape());
        while (iter.hasNext()) {
            long[] nextPos = iter.next();
            double d1 = array.getDouble(nextPos);
            double d2 = other.array.getDouble(nextPos);

            if (Double.compare(d1, d2) != 0) {
                return Double.compare(d1, d2);
            }
        }

        //Same rank, length, shape and contents: must be equal
        return 0;
    }

    public String toString() {
        return array.toString();
    }

    @Override
    public long length() {
        return array.data().length();
    }

    @Override
    public double getDouble(long i) {
        return array.data().getDouble(i);
    }

    @Override
    public float getFloat(long i) {
        return array.data().getFloat(i);
    }

    @Override
    public int getInt(long i) {
        return array.data().getInt(i);
    }

    @Override
    public long getLong(long i) {
        return (long) array.data().getDouble(i);
    }
}


text:
[docs](./README.md) -
[API](./API.md) -
[CLI](./CLI.md) -
[REPL](./REPL.md) -
[logging](./logging.md) -
[arguments](./arguments.md)

# Task arguments

Any of the task runners ([`gulp.start`](./API.md#gulpstart), [`gulp.series`](./API.md#gulpseries), [`gulp.parallel`](./API.md#gulpparallel) and [`gulp.stack`](./API.md#gulpstack)) can be used to pass arguments down.

```js
var gulp = require('gulp-runtime').create();
var args = [1, 2, 3];

gulp.task(':name', function (done, one, two, three) {
  console.log(one, two, three);
  done(null, one + two + three);
});

// with gulp.stack
gulp.stack('taskNameHere')(1, 2, 3, function (error, result) {
  if (error) {
    console.log('ups, who farted?');
    console.log(error.stack);
  } else {
    console.log('all right, we are done at', result, 'pm today');
  }
});

// with gulp.start
gulp.task('default', function (done) {
  gulp.start(['taskNameHere'], 1, 2, 3, {
    onStackEnd: function (error, result) {
      if (error) {
        console.log('ups, who farted?');
        console.log(error.stack);
      } else {
        console.log('all right, we are done at', result, 'pm today');
      }
      done();
    }
  })
});
```

---
[Back to top ↑](#)


text:
#import "TiColor.h"
#import "TiDimension.h"
#import "WebFont.h"
#import "TiFile.h"
#import "TiBuffer.h"

typedef enum {
    BAD_DEST_OFFSET = -1,
    BAD_SRC_OFFSET = -2,
    BAD_ENCODING = -4,
    BAD_TYPE = -8,
    BAD_ENDIAN = -16,
    TOO_SMALL = -32,
} EncodingError;

@interface TiUtils : NSObject {

}

+(NSString *)UTCDateForDate:(NSDate*)data;
+(NSDate *)dateForUTCDate:(NSString*)date;

+(NSString *)UTCDate;

+(NSString*)createUUID;

+(TiFile*)createTempFile:(NSString*)extension;

+(NSData *)loadAppResource:(NSURL*)url;

+(NSString *)encodeQueryPart:(NSString *)unencodedString;

+(NSString *)encodeURIParameters:(NSString *)unencodedString;

+(UIImage*)toImage:(id)object proxy:(TiProxy*)proxy size:(CGSize)imageSize;
+(UIImage*)toImage:(id)object proxy:(TiProxy*)proxy;

+(NSURL*)toURL:(NSString *)relativeString relativeToURL:(NSURL *)rootPath;
+(NSURL*)toURL:(NSString *)object proxy:(TiProxy*)proxy;
//+(NSURL*)toURL:(id)object proxy:(TiProxy*)proxy;

+(UIImage *)image:(id)object proxy:(TiProxy*)proxy;

+(UIImage *)stretchableImage:(id)object proxy:(TiProxy*)proxy;

+(NSString*)stringValue:(id)value;
+(NSString*)replaceString:(NSString *)string characters:(NSCharacterSet *)characterSet withString:(NSString *)replacementString;

+(NSNumber *) numberFromObject:(id) obj;

+(BOOL)boolValue:(id)value;

+(BOOL)boolValue:(id)value def:(BOOL)def;

+(CGPoint)pointValue:(id)value;
+(CGPoint)pointValue:(id)value valid:(BOOL*)isValid;
+(CGPoint)pointValue:(id)value bounds:(CGRect)bounds defaultOffset:(CGPoint)defaultOffset;

+(CGRect)rectValue:(id)value;

+(CGFloat)floatValue:(id)value;

+(CGFloat)floatValue:(id)value def:(CGFloat) def;

+(CGFloat)floatValue:(id)value def:(CGFloat) def valid:(BOOL *) isValid;

+(double)doubleValue:(id)value;

+(double)doubleValue:(id)value def:(double) def;

+(double)doubleValue:(id)value def:(double) def valid:(BOOL *) isValid;

+(int)intValue:(id)value;

+(int)intValue:(id)value def:(int)def;

+(int)intValue:(id)value def:(int)def valid:(BOOL*)isValid;

+(TiColor*)colorValue:(id)value;

+(TiDimension)dimensionValue:(id)value;

+(id)valueFromDimension:(TiDimension)dimension;

+(int)intValue:(NSString*)name properties:(NSDictionary*)props def:(int)def exists:(BOOL*) exists;

+(double)doubleValue:(NSString*)name properties:(NSDictionary*)props def:(double)def exists:(BOOL*) exists;

+(float)floatValue:(NSString*)name properties:(NSDictionary*)props def:(float)def exists:(BOOL*) exists;

+(BOOL)boolValue:(NSString*)name properties:(NSDictionary*)props def:(BOOL)def exists:(BOOL*) exists;

+(NSString*)stringValue:(NSString*)name properties:(NSDictionary*)properties def:(NSString*)def exists:(BOOL*) exists;

+(CGPoint)pointValue:(NSString*)name properties:(NSDictionary*)properties def:(CGPoint)def exists:(BOOL*) exists;

+(TiColor*)colorValue:(NSString*)name properties:(NSDictionary*)properties def:(TiColor*)def exists:(BOOL*) exists;

+(TiDimension)dimensionValue:(NSString*)name properties:(NSDictionary*)properties def:(TiDimension)def exists:(BOOL*) exists;

+(int)intValue:(NSString*)name properties:(NSDictionary*)props def:(int)def;

+(double)doubleValue:(NSString*)name properties:(NSDictionary*)props def:(double)def;

+(float)floatValue:(NSString*)name properties:(NSDictionary*)props def:(float)def;

+(BOOL)boolValue:(NSString*)name properties:(NSDictionary*)props def:(BOOL)def;

+(NSString*)stringValue:(NSString*)name properties:(NSDictionary*)properties def:(NSString*)def;

+(CGPoint)pointValue:(NSString*)name properties:(NSDictionary*)properties def:(CGPoint)def;

+(TiColor*)colorValue:(NSString*)name properties:(NSDictionary*)properties def:(TiColor*)def;

+(TiDimension)dimensionValue:(NSString*)name properties:(NSDictionary*)properties def:(TiDimension)def;

+(WebFont*)fontValue:(NSDictionary*)properties def:(WebFont*)def;

+(int)intValue:(id)value def:(int)def;

+(UIDeviceOrientation)orientationValue:(id)value def:(UIDeviceOrientation)def;

+(int)intValue:(NSString*)name properties:(NSDictionary*)props;

+(double)doubleValue:(NSString*)name properties:(NSDictionary*)props;

+(float)floatValue:(NSString*)name properties:(NSDictionary*)props;

+(BOOL)boolValue:(NSString*)name properties:(NSDictionary*)props;

+(NSString*)stringValue:(NSString*)name properties:(NSDictionary*)properties;

+(CGPoint)pointValue:(NSString*)name properties:(NSDictionary*)properties;

+(TiColor*)colorValue:(NSString*)name properties:(NSDictionary*)properties;

+(TiDimension)dimensionValue:(NSString*)name properties:(NSDictionary*)properties;

+(NSDictionary*)pointToDictionary:(CGPoint)point;

+(NSDictionary*)rectToDictionary:(CGRect)rect;

+(NSDictionary*)sizeToDictionary:(CGSize)size;

+(UIEdgeInsets)contentInsets:(id)value;

+(CGRect)contentFrame:(BOOL)window;

+(CGFloat)sizeValue:(id)value;

+(WebFont*)fontValue:(id)value;

+(UITextAlignment)textAlignmentValue:(id)alignment;

+(NSString*)exceptionMessage:(id)arg;

+(BOOL)isOrientationPortait;

+(BOOL)isOrientationLandscape;

+(UIInterfaceOrientation)orientation;

+(CGRect)navBarRect;

+(CGSize)navBarTitleViewSize;

+(CGRect)navBarTitleViewRect;

+(CGRect)screenRect;

+(CGPoint)centerSize:(CGSize)smallerSize inRect:(CGRect)largerRect;

+(CGRect)centerRect:(CGRect)smallerRect inRect:(CGRect)largerRect;

+(void)setView:(UIView *)view positionRect:(CGRect)frameRect;

+(CGRect)viewPositionRect:(UIView *)view;

+(BOOL)barTranslucencyForColor:(TiColor *)color;
+(UIColor *)barColorForColor:(TiColor *)color;
+(UIBarStyle)barStyleForColor:(TiColor *)color;

+(void)applyColor:(TiColor *)color toNavigationController:(UINavigationController *)navController;

+(void)queueAnalytics:(NSString*)type name:(NSString*)name data:(NSDictionary*)data;

+(BOOL)isIPad;

+(BOOL)isIOS4_2OrGreater;

+(BOOL)isIOS5OrGreater;

+(BOOL)isIPhone4;

+(BOOL)isRetinaDisplay;

+(NSStringEncoding)charsetToEncoding:(NSString*)charset;

+(TiDataType)constantToType:(NSString*)typeStr;

+(size_t)dataSize:(TiDataType)type;

+(int)encodeString:(NSString*)string toBuffer:(TiBuffer*)dest charset:(NSString*)charset offset:(int)destPosition sourceOffset:(int)srcPosition length:(int)srcLength;

+(int)encodeNumber:(NSNumber*)data toBuffer:(TiBuffer*)dest offset:(int)position type:(NSString*)type endianness:(CFByteOrder)byteOrder;

+(NSString*)md5:(NSData*)data;

+(NSString*)convertToHex:(unsigned char*)result length:(size_t)length;

+(NSString*)uniqueIdentifier;

+(NSString*)getResponseHeader:(NSString*)header fromHeaders:(NSDictionary*)responseHeaders;

+(UIImage*)loadBackgroundImage:(id)image forProxy:(TiProxy*)proxy;
@end


text:
require 'test/unit'
require File.dirname(__FILE__) + '/../../../../test/test_helper'

class PopularSidebarTest < Test::Unit::TestCase
  def test_popular_is_available
    assert Sidebar.available_sidebars.include?(PopularSidebar)
  end
end


text:
ACCEPTED

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

#### Published in
J. Wash. Acad. Sci. 30: 251 (1940)

#### Original name
Meristacrum asterospermum Drechsler, 1940

### Remarks
null


text:
mimo_pageDescription: Incomplete
mimo_pageTitle: Typescript Module Resolution
mimo_pageID: typescript-module-resolution
mimo_date: Apr 7, 2018

mimo_includeInSal: false
mimo_includeInSearchIndex: false
---

# What is a module?
A file with a certain syntax that marks it as logic to execute in its own context
https://www.typescriptlang.org/docs/handbook/modules.html
https://docs.npmjs.com/getting-started/packages

# What are typings?
Static typing metadata. Could be located:
- In a folder located in node_modules/@types. These are for libraries that do not ship with typings,
  and so rely on third party type definitions.
- In a package. A package can ship with typings, the "typings" field in package.json can be used to
  point to such files.
- In a project. d.ts files can be created to augment libraries or to declare variables that aren't
  available at compile time.

# What do typings have to do with modules?
When tsc resolved modules, it doesn't care about .js files, instead, it looks for ts files or d.ts
files for each module.

# How can tsc's module resolution be logged?
- tsc --traceResolution, or traceResolution in compilerOptions.

# What is baseUrl?
- Path that non-relative module strings are resolved relative to.

# What is typeRoots?
- Directories that typings are resolved from (for modules that don't ship with typings)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ColorMapper (Apache Ant API)</title>
<meta name="date" content="2015-06-29">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.tools.ant.types.optional.image

Class ColorMapper

java.lang.Object

org.apache.tools.ant.types.optional.image.ColorMapper

public final class ColorMapper
extends java.lang.Object

See Also:

Image

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
COLOR_BLACK

black string

static java.lang.String
COLOR_BLUE

blue string

static java.lang.String
COLOR_CYAN

cyan string

static java.lang.String
COLOR_DARKGRAY

black string

static java.lang.String
COLOR_DARKGREY

darkgrey string

static java.lang.String
COLOR_GRAY

gray string

static java.lang.String
COLOR_GREEN

green string

static java.lang.String
COLOR_GREY

grey string

static java.lang.String
COLOR_LIGHTGRAY

lightgray string

static java.lang.String
COLOR_LIGHTGREY

lightgrey string

static java.lang.String
COLOR_MAGENTA

magenta string

static java.lang.String
COLOR_ORANGE

orange string

static java.lang.String
COLOR_PINK

pink string

static java.lang.String
COLOR_RED

reg string

static java.lang.String
COLOR_WHITE

white string

static java.lang.String
COLOR_YELLOW

yellow string

Method Summary

Methods

Modifier and Type
Method and Description

static java.awt.Color
getColorByName(java.lang.String colorName)

Convert a color name to a color value.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

COLOR_BLACK

public static final java.lang.String COLOR_BLACK

black string

See Also:

Constant Field Values

COLOR_BLUE

public static final java.lang.String COLOR_BLUE

blue string

See Also:

Constant Field Values

COLOR_CYAN

public static final java.lang.String COLOR_CYAN

cyan string

See Also:

Constant Field Values

COLOR_DARKGRAY

public static final java.lang.String COLOR_DARKGRAY

black string

See Also:

Constant Field Values

COLOR_GRAY

public static final java.lang.String COLOR_GRAY

gray string

See Also:

Constant Field Values

COLOR_LIGHTGRAY

public static final java.lang.String COLOR_LIGHTGRAY

lightgray string

See Also:

Constant Field Values

COLOR_DARKGREY

public static final java.lang.String COLOR_DARKGREY

darkgrey string

See Also:

Constant Field Values

COLOR_GREY

public static final java.lang.String COLOR_GREY

grey string

See Also:

Constant Field Values

COLOR_LIGHTGREY

public static final java.lang.String COLOR_LIGHTGREY

lightgrey string

See Also:

Constant Field Values

COLOR_GREEN

public static final java.lang.String COLOR_GREEN

green string

See Also:

Constant Field Values

COLOR_MAGENTA

public static final java.lang.String COLOR_MAGENTA

magenta string

See Also:

Constant Field Values

COLOR_ORANGE

public static final java.lang.String COLOR_ORANGE

orange string

See Also:

Constant Field Values

COLOR_PINK

public static final java.lang.String COLOR_PINK

pink string

See Also:

Constant Field Values

COLOR_RED

public static final java.lang.String COLOR_RED

reg string

See Also:

Constant Field Values

COLOR_WHITE

public static final java.lang.String COLOR_WHITE

white string

See Also:

Constant Field Values

COLOR_YELLOW

public static final java.lang.String COLOR_YELLOW

yellow string

See Also:

Constant Field Values

Method Detail

getColorByName

public static java.awt.Color getColorByName(java.lang.String colorName)

Convert a color name to a color value.

Parameters:

colorName - a string repr of the color.

Returns:

the color value.

To do:

refactor to use an EnumeratedAttribute (maybe?)

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
function hideshow(which){
  if (!document.getElementById) {
      return;
  }

  if (which.style.display=="block") {
      which.style.display="none";
  } else {
      which.style.display="block";
  }
}

	function showprevy() {
		if (document.getElementById("PrevIncidentY").checked=true)
			document.getElementById("previncidentdescriptiondiv").style.display="block"
		else
			document.getElementById("previncidentdescriptiondiv").style.display="none"
	}

	function showprevn() {
		if (document.getElementById("PrevIncidentN").checked=true)
			document.getElementById("previncidentdescriptiondiv").style.display="none"
		else
			document.getElementById("previncidentdescriptiondiv").style.display="block"
	}

/*	function hideshowotherdiv(which) {
		if (which=="show")
			document.getElementById("otherexplaindiv").style.display="inline"
		else
			document.getElementById("otherexplaindiv").style.display="none"
	} */

	function enabledisableother(which) {
		if (which=="show")
			document.getElementById("personotherexplain").disabled=false
		else
			document.getElementById("personotherexplain").disabled=true
			document.getElementById("personotherexplain").value=""
	}

	function fullreset() {
		document.getElementById("instructions").style.display="none"
		/* document.getElementById("descriptiondiv2").style.display="block" */
		document.getElementById("previncidentdescriptiondiv").style.display="none"
		document.getElementById("personotherexplain").disabled=true
		document.getElementById("witnessdiv2").style.display="none"
		document.getElementById("witnessdiv3").style.display="none"
	}


text:
sudo yum -y update
sudo yum -y install wget git
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | sh
source $HOME/.nvm/nvm.sh
vm install stable
nvm use stable

git clone https://github.com/jsdoc3/jsdoc.git
cd jsdoc
npm install -g gulp
npm install
./jsdoc.js -T


text:
layout: post
date: 2016-09-17
title: "Lis Simon GEMMA 2015 Sleeveless Sweep/Brush Train Ballgown"
category: Lis Simon
tags: [Lis Simon ,Lis Simon,Ballgown,Illusion,Jewel,Sweep/Brush Train,Sleeveless,2015]
---
### Lis Simon GEMMA
Just **$299.99**
### 2015  Sleeveless Sweep/Brush Train Ballgown

BRANDS	Lis Simon

Silhouette	Ballgown

Neckline	Illusion,Jewel

Hemline/Train	Sweep/Brush Train

Sleeve	Sleeveless

Years	2015

Buy it: [https://www.readybrides.com/en/lis-simon-/44504-lis-simon-gemma.html](https://www.readybrides.com/en/lis-simon-/44504-lis-simon-gemma.html)


text:
<?php

require_once(dirname(__FILE__).'/../../includes/global.inc.php');

header('Content-Type: text/html');
echo $raw_content . '<script type="text/javascript">window.print();</script>';

?>