text:
<?php

namespace CrEOF\Spatial\Tests\ORM\Query\AST\Functions\MySql;

use CrEOF\Spatial\PHP\Types\Geometry\LineString;
use CrEOF\Spatial\PHP\Types\Geometry\Point;
use CrEOF\Spatial\PHP\Types\Geometry\Polygon;
use CrEOF\Spatial\Tests\Fixtures\PolygonEntity;
use CrEOF\Spatial\Tests\OrmTestCase;
use Doctrine\ORM\Query;

/**
 * MBRContains DQL function tests
 *
 * @author  Derek J. Lambert <dlambert@dereklambert.com>
 * @license http://dlambert.mit-license.org MIT
 *
 * @group dql
 */
class MBRContainsTest extends OrmTestCase
{
    protected function setUp()
    {
        $this->usesEntity(self::POLYGON_ENTITY);
        $this->usesType('point');
        $this->supportsPlatform('mysql');

        parent::setUp();
    }

    /**
     * @group geometry
     */
    public function testSelectMBRContains()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),
            new Point(10, 10),
            new Point(0, 10),
            new Point(0, 0)
        ));
        $lineString2 = new LineString(array(
            new Point(5, 5),
            new Point(7, 5),
            new Point(7, 7),
            new Point(5, 7),
            new Point(5, 5)
        ));
        $entity1 = new PolygonEntity();

        $entity1->setPolygon(new Polygon(array($lineString1)));
        $this->getEntityManager()->persist($entity1);

        $entity2 = new PolygonEntity();

        $entity2->setPolygon(new Polygon(array($lineString2)));
        $this->getEntityManager()->persist($entity2);
        $this->getEntityManager()->flush();
        $this->getEntityManager()->clear();

        $query  = $this->getEntityManager()->createQuery('SELECT p, MBRContains(p.polygon, GeomFromText(:p1)) FROM CrEOF\Spatial\Tests\Fixtures\PolygonEntity p');

        $query->setParameter('p1', 'POINT(2 2)', 'string');

        $result = $query->getResult();

        $this->assertCount(2, $result);
        $this->assertEquals($entity1, $result[0][0]);
        $this->assertEquals(1, $result[0][1]);
        $this->assertEquals($entity2, $result[1][0]);
        $this->assertEquals(0, $result[1][1]);
    }

    /**
     * @group geometry
     */
    public function testMBRContainsWhereParameter()
    {
        $lineString1 = new LineString(array(
            new Point(0, 0),
            new Point(10, 0),
            new Point(10, 10),
            new Point(0, 10),
            new Point(0, 0)
        ));
        $lineString2 = new LineString(array(
            new Point(5, 5),
            new Point(7, 5),
            new Point(7, 7),
            new Point(5, 7),
            new Point(5, 5)
        ));
        $entity1 = new PolygonEntity();

        $entity1->setPolygon(new Polygon(array($lineString1)));
        $this->getEntityManager()->persist($entity1);

        $entity2 = new PolygonEntity();

        $entity2->setPolygon(new Polygon(array($lineString1, $lineString2)));
        $this->getEntityManager()->persist($entity2);
        $this->getEntityManager()->flush();
        $this->getEntityManager()->clear();

        $query  = $this->getEntityManager()->createQuery('SELECT p FROM CrEOF\Spatial\Tests\Fixtures\PolygonEntity p WHERE MBRContains(p.polygon, GeomFromText(:p1)) = 1');

        $query->setParameter('p1', 'POINT(6 6)', 'string');

        $result = $query->getResult();

        $this->assertCount(2, $result);
        $this->assertEquals($entity1, $result[0]);
        $this->assertEquals($entity2, $result[1]);
        $this->getEntityManager()->clear();

        $query  = $this->getEntityManager()->createQuery('SELECT p FROM CrEOF\Spatial\Tests\Fixtures\PolygonEntity p WHERE MBRContains(p.polygon, GeomFromText(:p1)) = 1');

        $query->setParameter('p1', 'POINT(2 2)', 'string');

        $result = $query->getResult();

        $this->assertCount(2, $result);
        $this->assertEquals($entity1, $result[0]);
        $this->assertEquals($entity2, $result[1]);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lobaria sachalinensis var. sachalinensis Asahina

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
<?php
abstract class TestCase extends Orchestra\Testbench\TestCase
{
    protected $consoleOutput;

    protected function getPackageProviders($app)
    {
        return [\pierresilva\LaravelGenerator\LaravelGeneratorServiceProvider::class];
    }

    protected function getEnvironmentSetUp($app)
    {
        $app['config']->set('view.paths', [__DIR__ . '/temp/views']);

        $app['config']->set('laravelgenerator', [
            'custom_template' => false,
            'path' => base_path('resources/laravel-generator/'),
            'view_columns_number' => 3,
        ]);
    }

    public function setUp()
    {
        parent::setUp();

        exec('rm -rf ' . __DIR__ . '/temp/*');
        exec('rm -rf ' . app_path() . '/*');
        exec('rm -rf ' . database_path('migrations') . '/*');
    }

    public function tearDown()
    {
        parent::tearDown();

        $this->consoleOutput = '';
    }

    public function resolveApplicationConsoleKernel($app)
    {
        $app->singleton('artisan', function ($app) {
            return new \Illuminate\Console\Application($app, $app['events'], $app->version());
        });

        $app->singleton('\Illuminate\Contracts\Console\Kernel', Kernel::class);
    }

    public function consoleOutput()
    {
        return $this->consoleOutput ?: $this->consoleOutput = $this->app[Kernel::class]->output();
    }
}


text:
namespace app {
namespace Uno {
namespace Collections {

::uInterfaceType* ICollection__Uno_Data_Xml_XmlNodeHandle__typeof();

struct ICollection__Uno_Data_Xml_XmlNodeHandle
{
    int(*__fp_get_Count)(void*);

    static int Count(::uObject* __this) { return ((ICollection__Uno_Data_Xml_XmlNodeHandle*)uGetInterfacePtr(__this, ICollection__Uno_Data_Xml_XmlNodeHandle__typeof()))->__fp_get_Count((::uByte*)__this + (__this->__obj_type->TypeType == uTypeTypeStruct ? sizeof(::uObject) : 0)); }
};

}}}

#endif


text:
package test.spawntest;

import ibis.constellation.ActivityIdentifier;
import ibis.constellation.Constellation;
import ibis.constellation.Event;
import ibis.constellation.Context;
import ibis.constellation.util.SimpleActivity;

public class Dummy extends SimpleActivity {

    private static final long serialVersionUID = 5970093414747228592L;

    public Dummy(ActivityIdentifier parent) {
        super(parent, new Context("TEST", 1, 1));
    }

    @Override
    public void simpleActivity(Constellation c) {

        double tmp = 0.33333333;

        long time = System.nanoTime();

        do {
            tmp = Math.cos(tmp);
        } while (System.nanoTime() - time < 100000);

        c.send(new Event(identifier(), getParent(), null));
    }

}


text:
var angulair = angular.module('angulair', ['signalrModule']);
signalrModule.value('signalrServer', '');
angulair.controller('questionController', [
    'signalrGenericHubProxy', '$scope', '$http',
    function (hubProxy, $scope,$http) {
        $scope.question = "//do you like angular?";
        var total = function() {
            return $scope.question.voteUp + $scope.question.voteDown;
        };

        $scope.yes = function() {
            return ($scope.question.voteUp * 100) /total();
        };
        $scope.no = function() {
            return ($scope.question.voteDown * 100) / total();
        };

        $http({ method: 'GET', url: '/api/question/default' })
            .success(function (data) {
                $scope.question = data;
            });

        $scope.results = {
            total: $scope.total,
            yes: $scope.yes,
            no: $scope.no
        };
    var voteHub = hubProxy(hubProxy.defaultServer, 'votes', { logging: true });

    voteHub.on('updateQuestionText', function (content) {
        $scope.question.content = content;
    });
    voteHub.on('updateQuestionVoteUp', function (id,current) {
        $scope.question.voteUp = current;

    });

    voteHub.on('updateQuestionVoteDown', function (id, current) {
        $scope.question.voteDown = current;
    });

        $scope.up = function() {
            voteHub.call('VoteUp', ['default'], function (err) {
                console.log(err);
            });
        };
        $scope.down = function () {
            voteHub.call('VoteDown', ['default'], function (err) {
                console.log(err);
            });
        };
    }]);


text:
using System;
using StriderMqtt;

namespace EmptyPublishing
{
	public class MqttClient
	{
		readonly TimeSpan PollLimit = TimeSpan.FromMilliseconds(50);

		MqttQos Qos;

		string ClientId;
		string TopicToPublish;
		string TopicToSubscribe;

		// last number to deliver (inclusive)
		int publishCount;
		int published = 0;
		int received = 0;

		IMqttPersistence persistence;

		public bool Finished
		{
			get
			{
				return this.published >= this.publishCount && this.received >= this.publishCount;
			}
		}

		public MqttClient(string topic, string clientId, MqttQos qos, int publishCount, IMqttPersistence persistence)
		{
			ClientId = clientId;
			TopicToPublish = topic;
			TopicToSubscribe = topic;
			Qos = qos;

			this.publishCount = publishCount;
			this.persistence = persistence;
		}

		public void Run()
		{
			var connArgs = new MqttConnectionArgs()
			{
				ClientId = this.ClientId,
				Hostname = "localhost",
				Port = 1883,
				Secure = true,
				CleanSession = false
			};

			using (var conn = new MqttConnection(connArgs, persistence))
			{
				conn.Connect();
				Console.WriteLine("{0} connected", ClientId);

				try
				{
					BindEvents(conn);

					if (!conn.IsSessionPresent)
					{
						Subscribe(conn);
					}

					while (conn.Loop(PollLimit) && !Finished)
					{
						if (!conn.IsPublishing)
						{
							PublishNext(conn);
						}
					}
				}
				finally
				{
					UnbindEvents(conn);
				}
			}
		}

		void Subscribe(MqttConnection conn)
		{
			conn.Subscribe(TopicToSubscribe, Qos);
		}

		void PublishNext(MqttConnection conn)
		{
			byte[] bytes = new byte[0];

			if (Qos == MqttQos.AtMostOnce)
			{
				// if is qos 0, assume the packet will be delivered
				this.published += 1;
			}

			ushort packetId = conn.Publish(TopicToPublish, bytes, Qos);

			Console.WriteLine("{0} >> broker : Delivering {1} : PUBLISH packet_id:{2}",
				ClientId, this.published, packetId);
		}

		// EVENTS
		// ==========

		void BindEvents(MqttConnection conn)
		{
			conn.PublishReceived += HandlePublishReceived;
			conn.PublishSent += HandlePublishSent;
		}

		void UnbindEvents(MqttConnection conn)
		{
			conn.PublishReceived -= HandlePublishReceived;
			conn.PublishSent -= HandlePublishSent;
		}

		// incoming publish events
		// =======================

		void HandlePublishReceived (object sender, PublishReceivedEventArgs e)
		{
			// do something with the received message
			received += 1;
			Console.WriteLine("{0} << broker : Received {1} (topic:{2}, mid:{3})", ClientId, received, e.Topic, e.PacketId);
			if (e.Message.Length > 0)
			{
				Console.WriteLine("    received message is not empty");
			}
		}

		// outgoing publish events
		// =======================

		void HandlePublishSent (object sender, IdentifiedPacketEventArgs e)
		{
			// a publish was sent to the broker
			this.published += 1;
            (sender as MqttConnection).InterruptLoop();
		}
	}
}


text:
package cmd

import (
	"fmt"

	"github.com/google/go-tpm-tools/client"
	"github.com/google/go-tpm/tpm2"
	"github.com/spf13/cobra"
)

var handleNames = map[string][]tpm2.HandleType{
	"all":        {tpm2.HandleTypeLoadedSession, tpm2.HandleTypeSavedSession, tpm2.HandleTypeTransient},
	"loaded":     {tpm2.HandleTypeLoadedSession},
	"saved":      {tpm2.HandleTypeSavedSession},
	"transient":  {tpm2.HandleTypeTransient},
	"persistent": {tpm2.HandleTypePersistent},
}

var flushCmd = &cobra.Command{
	Use:   "flush <all | loaded | saved | transient | persistent>",
	Short: "Close active handles on the TPM",
	Long: `Close some or all currently active handles on the TPM

Most TPM operations require an active handle, representing some object within
the TPM. However, most TPMs also limit the number of simultaneous active handles
(usually a max of 3). This command allows for "leaked" handles (handles that
have not been properly closed) to be flushed, freeing up memory for new handles
to be used with future TPM operations.

The TPM can also take an active handle and "persist" it to NVRAM. This frees up
memory for more transient handles. It can also allow for caching the creation of
slow keys (such as the RSA-based EK or SRK). These handles can be evicted from
NVRAM using the "persistent" argument, but are not flushed with "all", as this
can result in data loss (if the persisted key cannot be regenerated).

Which handles are flushed depends on the argument passed:
	loaded     - only flush the loaded session handles
	saved      - only flush the saved session handles
	transient  - only flush the transient handles
	all        - flush all loaded, saved, and transient handles
	persistent - only evict the persistent handles`,
	ValidArgs: func() []string {
		// The keys from the handleNames map are our valid arguments
		keys := make([]string, len(handleNames))
		for k := range handleNames {
			keys = append(keys, k)
		}
		return keys
	}(),
	Args: cobra.ExactValidArgs(1),
	RunE: func(cmd *cobra.Command, args []string) error {
		rwc, err := openTpm()
		if err != nil {
			return err
		}
		defer rwc.Close()

		totalHandles := 0
		for _, handleType := range handleNames[args[0]] {
			handles, err := client.Handles(rwc, handleType)
			if err != nil {
				return fmt.Errorf("getting handles: %w", err)
			}
			for _, handle := range handles {
				if handleType == tpm2.HandleTypePersistent {
					if err = tpm2.EvictControl(rwc, "", tpm2.HandleOwner, handle, handle); err != nil {
						return fmt.Errorf("evicting handle 0x%x: %w", handle, err)
					}
					fmt.Fprintf(debugOutput(), "Handle 0x%x evicted\n", handle)
				} else {
					if err = tpm2.FlushContext(rwc, handle); err != nil {
						return fmt.Errorf("flushing handle 0x%x: %w", handle, err)
					}
					fmt.Fprintf(debugOutput(), "Handle 0x%x flushed\n", handle)
				}
				totalHandles++
			}
		}

		fmt.Fprintf(messageOutput(), "%d handles flushed\n", totalHandles)
		return nil
	},
}

func init() {
	RootCmd.AddCommand(flushCmd)
}


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-styles/typography.html">

<dom-module id="my-logout">
  <template>
    <style>
      :host {
        display: block;
      }

      span {
        @apply(--paper-font-body1);
      }
    </style>

    <paper-button raised on-click="logoutHandler">Klik hier als je zeker weet dat je echt wilt uitloggen</paper-button>

  </template>

  <script>
    (function() {
      'use strict';

      Polymer({
        is: 'my-logout',

        properties: {
          rol: {
            type: String,
            value: "undefined",
            notify: true,
          },
        },

        logoutHandler: function() {
          console.log("logoutHandler");
          this.rol = "undefined";
          app.route='home';
        },
      });
    })();
  </script>
</dom-module>


text:
package org.ihtsdo.buildcloud.core.service.build.database.hsql;

import mockit.Expectations;
import mockit.Mocked;
import mockit.integration.junit4.JMockit;
import org.ihtsdo.buildcloud.core.service.build.database.hsql.RF2TableDAOHsqlImpl;
import org.ihtsdo.snomed.util.rf2.schema.ComponentType;
import org.ihtsdo.snomed.util.rf2.schema.DataType;
import org.ihtsdo.snomed.util.rf2.schema.TableSchema;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.StringReader;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.ParseException;

@RunWith(JMockit.class)
public class RF2TableDAOHsqlImplTest {

	@Mocked
	PreparedStatement insertStatement;

	@Test
	@Ignore
	public void testFullColumns() throws IOException, SQLException, ParseException {
		String testData = "one\ttwo\tthree\tfour\n" + "one\ttwo\tthree\tfour\n";
		runTest(testData);
	}

	@Test
	@Ignore
	public void testBlankLastColumn() throws IOException, SQLException, ParseException {
		String testData = "one\ttwo\tthree\tfour\n" + "one\ttwo\tthree\t\n";
		runTest(testData);
	}

	private void runTest(String testData) throws SQLException, IOException, ParseException {

		RF2TableDAOHsqlImpl testDAO = new RF2TableDAOHsqlImpl();

		String extension = ".N/A";
		final TableSchema testSchema = new TableSchema(ComponentType.CONCEPT, extension);
		testSchema.field("first", DataType.STRING).field("second", DataType.STRING).field("third", DataType.STRING)
				.field("fourth", DataType.STRING);

		// Test data will have first row correct and second row with a blank final column.
		// We expect the same amount of fields to be picked up for both lines

		StringReader testDataSR = new StringReader(testData);
		BufferedReader bufferedTestData = new BufferedReader(testDataSR);

		final int columnCount = testSchema.getFields().size();

		// And announce our expectations for our mocked objects
		new Expectations() {
			{
				insertStatement.setObject(anyInt, anyString);
				times = columnCount;

				insertStatement.addBatch();

				insertStatement.setObject(anyInt, anyString);
				times = columnCount;

				insertStatement.addBatch();

				insertStatement.executeBatch();
			}
		};

		testDAO.insertData(bufferedTestData, testSchema, insertStatement);
	}
}


text:
cron Cookbook CHANGELOG
=======================
This file is used to list changes made in each version of the cron cookbook.

v1.2.8
------
### Bug
- **[COOK-3452](https://tickets.opscode.com/browse/COOK-3452)** - Add support for raspbian platform

v1.2.6
------
### Improvement
- **[COOK-3005](https://tickets.opscode.com/browse/COOK-3005)** - Remove blankline in template

v1.2.4
------
- [COOK-3058]: simplify conditionals in cron recipe

v1.2.2
------
- [COOK1829] - `cron_d` LWRPtemplate should imply cron cookbook by default

v1.2.0
------
- [COOK-938] - don't default to upgrading cron and fix rhel6 package name
- [COOK-1622] - add LWRP for cron.d files

v1.0.4
------
- [COOK-1514] - Cron cookbook manages wrong service name on SuSE

v1.0.0
------
- [COOK-1124] - add RHEL platform support


text:
package org.basecamp4j.model;

import java.io.Serializable;

import org.basecamp4j.utils.ToStringBuilder;

public class ProjectCounts implements Serializable {

	private Integer active;
	private Integer onHold;
	private Integer archived;

	public Integer getActive() {
		return active;
	}

	public void setActive(Integer active) {
		this.active = active;
	}

	public Integer getOnHold() {
		return onHold;
	}

	public void setOnHold(Integer onHold) {
		this.onHold = onHold;
	}

	public Integer getArchived() {
		return archived;
	}

	public void setArchived(Integer archived) {
		this.archived = archived;
	}

	public String toString() {
		return new ToStringBuilder(this)
			.append("active",getActive())
			.append("onHold",getOnHold())
			.append("archived",getArchived())
			.toString();
	}

}


text:
package com.epam.schulze;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import com.epam.schulze.config.AdvancedConfiguration;
import com.epam.schulze.config.Configuration;

/**
 * Voting system which uses Schulze algorithm. Check details of it at <a
 * href="http://en.wikipedia.org/wiki/Schulze_method">Wikipedia</a>
 *
 * @author Yurii_Shylov
 *
 * @param <T>
 *          class of candidates to vote for
 */
public class Schulze<T> {

	/**
	 * Represents internal phase of voting
	 */
	private enum Phase {
		REGISTERING_CANDIDATES, VOTING, VOTING_CLOSED;
	}

	/**
	 * Stores configuration values. Can't be changed from outside of the class.
	 */
	private final AdvancedConfiguration configuration;

	/**
	 * List of preregistered candidates for voting. Depending on the configuration
	 * the voting system may omit any votes for candidates not present in this
	 * list
	 */
	private final List<T> registerdCandidates;

	/**
	 * Processes new ballots.
	 */
	private final BallotProcessor<T> processor;

	/**
	 * Current phase of voting
	 */
	private Phase phase;

	/**
	 * Short title or question describing the survey.
	 */
	private String title;

	/**
	 * Long description of the survey.
	 */
	private String description;

	/**
	 * Creates voting system with default configuration (see
	 * {@link com.epam.schulze.config.Configuration})
	 */
	public Schulze() {
		this(new AdvancedConfiguration());
	}

	/**
	 * Creates voting system with given configuration. Note that configuration
	 * values are copied, i.e. any changes to it won't affect the system behavior
	 *
	 * @param configuration
	 *          {@link com.epam.schulze.config.Configuration} or
	 *          {@link com.epam.schulze.config.AdvancedConfiguration}
	 */
	public Schulze(Configuration configuration) {
		if (configuration instanceof AdvancedConfiguration) {
			this.configuration = (AdvancedConfiguration) configuration;
		} else {
			this.configuration = new AdvancedConfiguration(configuration);
		}
		registerdCandidates = new ArrayList<T>();
		processor = new BallotProcessor<T>(this.configuration, registerdCandidates);
		phase = Phase.REGISTERING_CANDIDATES;
	}

	/**
	 * Registers candidate to be voted for. Does nothing if the phase is not
	 * {@link com.epam.schulze.Schulze.Phase.REGISTERING_CANDIDATES}
	 *
	 * @param candidate
	 * @return registered candidate
	 */
	public T addCandidate(T candidate) {
		if (phase == Phase.REGISTERING_CANDIDATES) {
			registerdCandidates.add(candidate);
		}
		return candidate;
	}

	/**
	 * Registers candidates to be voted for. Does nothing if the phase is not
	 * {@link com.epam.schulze.Schulze.Phase.REGISTERING_CANDIDATES}
	 *
	 * @param candidates
	 */
	public void addAllCandidates(List<T> candidates) {
		for (T candidate : candidates) {
			addCandidate(candidate);
		}
	}

	/**
	 * Passes ballot to ballot processor
	 *
	 * @param ballot
	 * @return false if ballot was not processed
	 */
	public boolean registerBallot(Ballot<T> ballot) {
		if (phase != Phase.VOTING_CLOSED) {
			phase = Phase.VOTING;
			return processor.process(ballot);
		} else {
			return false;
		}
	}

	/**
	 * Unregisters ballot, i.e. its values won't influence the results
	 *
	 * @param ballot
	 * @return false if unregistering failed
	 */
	public boolean unregisterBallot(Ballot<T> ballot) {
		return processor.cancel(ballot);
	}

	/**
	 * Stops accepting any new ballots
	 */
	public void stopVoting() {
		phase = Phase.VOTING_CLOSED;
	}

	/**
	 * Calculates and returns top candidate
	 *
	 * @return
	 */
	public T getWinner() {
		return processor.calculateWinners().iterator().next();
	}

	/**
	 * Calculates and returns all candidate in ranked order
	 *
	 * @return
	 */
	public Set<T> getWinners() {
		return processor.calculateWinners();
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitle() {
		return title;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDescription() {
		return description;
	}
}


text:
package com.github.j5ik2o.reactive.redis.feature

import com.github.j5ik2o.reactive.redis.RedisClient

trait PubSubFeature {
  this: RedisClient =>
  /**
  * PSUBSCRIBE
  * PUBLISH
  * PUBSUB
  * PUNSUBSCRIBE
  * SUBSCRIBE
  * UNSUBSCRIBE
  */
}


text:
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtk

IMAGE_DATA = 0
POLY_DATA = 1

class StreamerVTK(NoConfigModuleMixin, ModuleBase):
    def __init__(self, module_manager):
        ModuleBase.__init__(self, module_manager)

        self._image_data_streamer = vtk.vtkImageDataStreamer()
        self._poly_data_streamer = vtk.vtkPolyDataStreamer()

        NoConfigModuleMixin.__init__(self,
                {'module (self)' : self,
                 'vtkImageDataStreamer' : self._image_data_streamer,
                 'vtkPolyDataStreamer' : self._poly_data_streamer})

        module_utils.setup_vtk_object_progress(self,
                self._image_data_streamer, 'Streaming image data')

        self._current_mode = None

        self.sync_module_logic_with_config()

    def close(self):
        NoConfigModuleMixin.close(self)
        del self._image_data_streamer
        del self._poly_data_streamer

    def get_input_descriptions(self):
        return ('VTK image or poly data',)

    def set_input(self, idx, input_stream):
        if hasattr(input_stream, 'IsA'):
            if input_stream.IsA('vtkImageData'):
                self._image_data_streamer.SetInput(input_stream)
                self._current_mode = IMAGE_DATA
            elif input_stream.IsA('vtkPolyData'):
                self._poly_data_streamer.SetInput(input_stream)
                self._current_mode = POLY_DATA

    def get_output_descriptions(self):
        return('VTK image or poly data',)

    def get_output(self, idx):
        if self._current_mode == IMAGE_DATA:
            return self._image_data_streamer.GetOutput()

        elif self._current_mode == POLY_DATA:
            return self._poly_data_streamer.GetOutput()

        else:
            return None

    def execute_module(self):
        pass

    def streaming_execute_module(self):
        sp = self._module_manager.get_app_main_config().streaming_pieces
        if self._current_mode == IMAGE_DATA:
            self._image_data_streamer.SetNumberOfStreamDivisions(sp)
            self._image_data_streamer.Update()
        elif self._current_mode == POLY_DATA:
            self._poly_data_streamer.SetNumberOfStreamDivisions(sp)
            self._poly_data_streamer.Update()


text:
namespace Snippets3.Logging.Log4Net
{
    using log4net.Appender;
    using log4net.Config;
    using log4net.Core;
    using log4net.Filter;
    using log4net.Layout;
    using NServiceBus;

    public class Log4NetFiltering
    {

        public Log4NetFiltering()
        {
            #region Log4NetFiltering

            ColoredConsoleAppender appender = new ColoredConsoleAppender
            {
                Threshold = Level.Debug,
                Layout = new SimpleLayout(),
            };

            appender.AddFilter(new LoggerMatchFilter
            {
                LoggerToMatch = "MyNamespace"
            });
            appender.AddFilter(new DenyAllFilter());
            appender.ActivateOptions();

            BasicConfigurator.Configure(appender);

            SetLoggingLibrary.Log4Net();

            #endregion
        }
    }
}


text:
package keyutils

import (
	"crypto"
	cryptorand "crypto/rand"
	"crypto/x509"
	"encoding/pem"
	"errors"

	"github.com/cloudflare/cfssl/helpers"
	"github.com/docker/swarmkit/ca/pkcs8"
	"github.com/docker/swarmkit/fips"
)

var errFIPSUnsupportedKeyFormat = errors.New("unsupported key format due to FIPS compliance")

// IsPKCS8 returns true if the provided der bytes is encrypted/unencrypted PKCS#8 key
func IsPKCS8(derBytes []byte) bool {
	if _, err := x509.ParsePKCS8PrivateKey(derBytes); err == nil {
		return true
	}

	return pkcs8.IsEncryptedPEMBlock(&pem.Block{
		Type:    "PRIVATE KEY",
		Headers: nil,
		Bytes:   derBytes,
	})
}

// ParsePrivateKeyPEMWithPassword parses an encrypted or a decrypted PKCS#1 or PKCS#8 PEM to crypto.Signer.
// It returns an error in FIPS mode if PKCS#1 PEM bytes are passed.
func ParsePrivateKeyPEMWithPassword(pemBytes, password []byte) (crypto.Signer, error) {
	block, _ := pem.Decode(pemBytes)
	if block == nil {
		return nil, errors.New("Could not parse PEM")
	}

	if IsPKCS8(block.Bytes) {
		return pkcs8.ParsePrivateKeyPEMWithPassword(pemBytes, password)
	} else if fips.Enabled() {
		return nil, errFIPSUnsupportedKeyFormat
	}

	return helpers.ParsePrivateKeyPEMWithPassword(pemBytes, password)
}

// IsEncryptedPEMBlock checks if a PKCS#1 or PKCS#8 PEM-block is encrypted or not
// It returns false in FIPS mode even if PKCS#1 is encrypted
func IsEncryptedPEMBlock(block *pem.Block) bool {
	return pkcs8.IsEncryptedPEMBlock(block) || (!fips.Enabled() && x509.IsEncryptedPEMBlock(block))
}

// DecryptPEMBlock requires PKCS#1 or PKCS#8 PEM Block and password to decrypt and return unencrypted der []byte
// It returns an error in FIPS mode when PKCS#1 PEM Block is passed.
func DecryptPEMBlock(block *pem.Block, password []byte) ([]byte, error) {
	if IsPKCS8(block.Bytes) {
		return pkcs8.DecryptPEMBlock(block, password)
	} else if fips.Enabled() {
		return nil, errFIPSUnsupportedKeyFormat
	}

	return x509.DecryptPEMBlock(block, password)
}

// EncryptPEMBlock takes DER-format bytes and password to return an encrypted PKCS#1 or PKCS#8 PEM-block
// It returns an error in FIPS mode when PKCS#1 PEM bytes are passed.
func EncryptPEMBlock(data, password []byte) (*pem.Block, error) {
	if IsPKCS8(data) {
		return pkcs8.EncryptPEMBlock(data, password)
	} else if fips.Enabled() {
		return nil, errFIPSUnsupportedKeyFormat
	}

	cipherType := x509.PEMCipherAES256
	return x509.EncryptPEMBlock(cryptorand.Reader,
		"EC PRIVATE KEY",
		data,
		password,
		cipherType)
}


text:
<?xml-stylesheet type="text/xsl" href="/style/testcase.xsl"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite"
        xmlns:p="http://www.w3.org/ns/xproc"
        xmlns:c="http://www.w3.org/ns/xproc-step"
        xmlns:err="http://www.w3.org/ns/xproc-error">

  <t:title>Test p:add-attribute #001</t:title>

  <t:input port='source'>
    <document>
      <title>Some Title</title>
      <para>Some paragraph.</para>
    </document>
  </t:input>

  <t:pipeline>
    <p:pipeline version='1.0' name="pipeline">
      <p:add-attribute match="title" attribute-name="foo" attribute-value="bar"/>
    </p:pipeline>
  </t:pipeline>

  <t:output port="result">
    <document>
      <title foo="bar">Some Title</title>
      <para>Some paragraph.</para>
    </document>
  </t:output>

</t:test>


text:
module OrderPurchasingConcern
  extend ActiveSupport::Concern
  # Updates the quantities of multiple items.
  #
  # @params Hash updates
  #
  # @return Array<ActiveRecord::Base>
  #
  # @todo This currently encodes Skus. Will have to be polymorphic in the
  # future.
  def update_quantities(updates)
    updates.map {|id, n| set_quantity(Sku.find(id), n.to_i)}
  end

  # Sets the quantity for an item, overwriting any existing quantities.
  #
  # @param ActiveRecord::Base item
  # @param Integer quantity
  #
  # @return ActiveRecord::Base
  def set_quantity(purchase, quantity)
    for_purchase(purchase, :set_quantity, true, quantity)
  end

  # Sets the quantity and price for an item. This bypasses the bracketed
  # pricing entirely i.e. the item will not have any volume discounts.
  #
  # @param ActiveRecord::Base purchase
  # @param Integer n
  # @param SpookAndPuff::Money price
  # @param Hash opts
  # @option opts [true, false] :retotal
  #
  # @return ActiveRecord::Base
  def set_quantity_and_price(purchase, n, price, opts = {})
    _opts = {:retotal => true}.merge(opts)
    for_purchase(purchase, :set_quantity_and_price, _opts[:retotal], n, price)
  end

  # Increments the quantity for an item.
  #
  # @param ActiveRecord::Base item
  # @param Integer quantity
  #
  # @return ActiveRecord::Base
  def increment_quantity(purchase, quantity)
    for_purchase(purchase, :increment_quantity, true, quantity)
  end

  # Decrements the quantity of an item. If it is decremented to zero or less
  # then the item is removed
  #
  # @param ActiveRecord::Base item
  # @param Integer quantity
  #
  # @return ActiveRecord::Base
  def decrement_quantity(purchase, quantity)
    for_purchase(purchase, :decrement_quantity, true, quantity)
  end

  # Removes an item from the order.
  #
  # @param ActiveRecord::Base item
  #
  # @return ActiveRecord::Base
  def remove(purchase)
    for_purchase(purchase, :remove, true)
  end

  # Finds an item against the order.
  #
  # @param ActiveRecord::Base
  #
  # @return ActiveRecord::Base
  def find_item(purchase)
    item_association_for_purchase(purchase).find_item(purchase)
  end

  private

  # Finds the item association for a purchasable e.g. sku_items for a Sku.
  #
  # @param ActiveRecord::Base
  #
  # @return ActiveRecord::Relation
  def item_association_for_purchase(purchase)
    send(:"#{purchase.class.to_s.underscore}_items")
  end

  # A helper which will run a particular action against a relation/assocation
  # based on the purchasable provided e.g. passing in a Sku will run the action
  # against sku_items.
  #
  # @param ActiveRecord::Base purchase
  # @param Symbol action
  # @param [true, false] recalculate
  #
  # @return ActiveRecord::Base
  #
  # @todo Currently fixed to the sku_items association.
  def for_purchase(purchase, action, recalculate, *args)
    result = if !args.empty?
      item_association_for_purchase(purchase).send(action, purchase, *args)
    else
      item_association_for_purchase(purchase).send(action, purchase)
    end

    calculate_totals if recalculate

    result
  end
end


text:
namespace Spek.Compiler.Syntax
{
    /// <summary>
    /// for <ident> = <expr> to <expr> do <stmt> end
    /// </summary>
    public class ForLoop : Stmt
    {
        public string Ident;
        public Expr From;
        public Expr To;
        public Stmt Body;
    }
}


text:
package client

import (
	"github.com/opsgenie/opsgenie-go-sdk/userv2"
)

// OpsGenieUserV2Client is the data type to make User API requests.
type OpsGenieUserV2Client struct {
	RestClient
}

// SetOpsGenieClient sets the embedded OpsGenieClient type of the OpsGenieUserV2Client.
func (cli *OpsGenieUserV2Client) SetOpsGenieClient(ogCli OpsGenieClient) {
	cli.OpsGenieClient = ogCli
}

// List method retrieves the list of users from OpsGenie.
func (cli *OpsGenieUserV2Client) List(req userv2.ListUsersRequest) (*userv2.ListUsersResponse, error) {
	var response userv2.ListUsersResponse
	err := cli.sendGetRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// Create method creates new user in OpsGenie.
func (cli *OpsGenieUserV2Client) Create(req userv2.CreateUserRequest) (*userv2.CreateUserResponse, error) {
	var response userv2.CreateUserResponse
	err := cli.sendPostRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// Get method returns user.
func (cli *OpsGenieUserV2Client) Get(req userv2.GetUserRequest) (*userv2.GetUserResponse, error) {
	var response userv2.GetUserResponse
	err := cli.sendGetRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// Update method updates data of user
func (cli *OpsGenieUserV2Client) Update(req userv2.UpdateUserRequest) (*userv2.UpdateUserResponse, error) {
	var response userv2.UpdateUserResponse
	err := cli.sendPatchRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// Delete method deletes user.
func (cli *OpsGenieUserV2Client) Delete(req userv2.DeleteUserRequest) (*userv2.DeleteUserResponse, error) {
	var response userv2.DeleteUserResponse
	err := cli.sendDeleteRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// ListEscalations method returns list of user escalations.
func (cli *OpsGenieUserV2Client) ListEscalations(req userv2.ListUserEscalationsRequest) (*userv2.ListUserEscalationsResponse, error) {
	var response userv2.ListUserEscalationsResponse
	err := cli.sendGetRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// ListTeams method returns list of user teams.
func (cli *OpsGenieUserV2Client) ListTeams(req userv2.ListUserTeamsRequest) (*userv2.ListUserTeamsResponse, error) {
	var response userv2.ListUserTeamsResponse
	err := cli.sendGetRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// ListForwardingRules method returns list of user forwarding rules.
func (cli *OpsGenieUserV2Client) ListForwardingRules(req userv2.ListUserForwardingRulesRequest) (*userv2.ListUserForwardingRulesResponse, error) {
	var response userv2.ListUserForwardingRulesResponse
	err := cli.sendGetRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}

// ListSchedules method returns list of user schedules.
func (cli *OpsGenieUserV2Client) ListSchedules(req userv2.ListUserSchedulesRequest) (*userv2.ListUserSchedulesResponse, error) {
	var response userv2.ListUserSchedulesResponse
	err := cli.sendGetRequest(&req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}


text:
This directory contains a driver (a nodejs script) which runs the end-to-end
library against the
[OpenPGP interoperability tests](https://github.com/google/openpgp-interop).

The easiest way to run these tests is to use the [do.sh](../../../../../do.sh)
script as
```
$ do.sh test_compat_e2e
```

This will fetch the interoperability test cases if needed, build the library and
run the driver against the test cases.


text:
contacts.create
===============

Returns a new Contact object.

    var contact = navigator.service.contacts.create(properties);

Description
-----------

contacts.create is a synchronous function that returns a new `Contact` object.

This method does not persist the Contact object to the device contacts database.  To persist the Contact object to the device, invoke the `Contact.save` method.

Supported Platforms
-------------------

- Android
- BlackBerry WebWorks (OS 5.0 and higher)
- iOS

Quick Example
-------------

    var myContact = navigator.service.contacts.create({"displayName": "Test User"});

Full Example
------------

    <!DOCTYPE html>

        <title>Contact Example</title>

Example

Create Contact


text:
[[only-vue]]
|## Cell Renderer Component Lifecycle
|
|The lifecycle of the cell renderer is as follows:
|
|- The component will be instantiated.
|- The component's GUI will be inserted into the grid 0 or 1 times (the component could get destroyed first, i.e. when scrolling quickly).
|- `refresh()` is called 0...n times (i.e. it may never be called, or called multiple times).
|- The component is destroyed once.
|
|In other words, component instantiation and destruction are always called exactly once. The component's GUI will
|typically get rendered once unless the component is destroyed first. `refresh()` is optionally called multiple times.


text:
class CreateEmployeeDepartments < ActiveRecord::Migration
  def self.up
    create_table :employee_departments do |t|
      t.string  :code
      t.string  :name
      t.boolean :status
    end

  end

  def self.down
    drop_table :employee_departments
  end
end


text:
'use strict';

var path = require('path');
var gulp = require('gulp');

var $ = require('gulp-load-plugins')({
  pattern: ['gulp-*', 'karma', 'run-sequence']
});

gulp.task('inject-deps', function () {
  var injectFiles = gulp.src(require('wiredep')({devDependencies: true}).js, { read: false });
  var injectOptions = {
    transform: function (filePath) {
      return '\'' + filePath.slice(filePath.indexOf('bower_components')) + '\',';
    },
    starttag: '/* inject:bower */',
    endtag: '/* endinject */',
    addRootSlash: false
  };
  return gulp.src([
    path.join(__dirname, '/../karma.conf.js'),
    path.join(__dirname, '/../karma-min.conf.js')
  ])
    .pipe($.inject(injectFiles, injectOptions))
    .pipe(gulp.dest(path.join(__dirname, '/..')));
});

gulp.task('unit-tests', function (done) {
  $.karma.server.start({
    configFile: path.join(__dirname, '/../karma.conf.js'),
    singleRun: true
  }, done);
  $.util.log($.util.colors.yellow('[ STARTING UNIT TESTS ]'));
});

gulp.task('unit-tests-min', function (done) {
  $.karma.server.start({
    configFile: path.join(__dirname, '/../karma-min.conf.js'),
    singleRun: true
  }, done);
  $.util.log($.util.colors.yellow('[ STARTING UNIT TESTS ON MINIFIED FILES ]'));
});

gulp.task('test', function (cb) {
  $.runSequence('inject-deps', ['unit-tests', 'unit-tests-min'], cb);
});


text:
'use strict';
/* Directive tells jshint that suite and test are globals defined by mocha */
/* global suite */
/* global test */

var assert = require('assert');
var fs = require('fs');
var nock = require('nock');

var util = require('./util/util');
var cp = util.commonParameters;
var testRequire = util.testRequire;

var Mex = testRequire('mex');

/**
 * Tests the Mex class which does Mex retrieval and parsing.
 */
suite('MEX', function() {
  this.slow(200);  // Tell mocha not to consider any of these tests
                   // slow until after 200ms.  XML parsing takes time! :(

  function setupExpectedMexResponse(filename) {
    var mexDoc = fs.readFileSync(__dirname + '/mex/' + filename, 'utf8');
    var mexRequest = nock(cp.adfsUrlNoPath).get(cp.adfsMexPath).reply('200', mexDoc);

    util.matchStandardRequestHeaders(mexRequest);

    return mexRequest;
  }

  function happyPathTest(testFile, expectedUrl, done) {
    var mexRequest = setupExpectedMexResponse(testFile);

    var mex = new Mex(cp.callContext, cp.adfsMex);
    mex.discover(function(err) {
      if (!err) {
        assert(mex.usernamePasswordUrl === expectedUrl,
          'returned url did not match: ' + expectedUrl + ': ' + mex.usernamePasswordUrl);
        mexRequest.done();
      }
      done(err);
    });
  }

  test('happy-path-1', function(done) {
    happyPathTest('microsoft.mex.xml', 'https://corp.sts.microsoft.com/adfs/services/trust/13/usernamemixed', done);
  });

  test('happy-path-2', function(done) {
    happyPathTest('arupela.mex.xml', 'https://fs.arupela.com/adfs/services/trust/13/usernamemixed', done);
  });

  test('happy-path-3', function(done) {
    happyPathTest('archan.us.mex.xml', 'https://arvmserver2012.archan.us/adfs/services/trust/13/usernamemixed', done);
  });

  function badMexDocTest(testFile, done) {
    var mexRequest = setupExpectedMexResponse(testFile);

    var mex = new Mex(cp.callContext, cp.adfsMex);
    mex.discover(function(err) {
      mexRequest.done();
      assert(err, 'badMexDocTest expected parsing error');
      done();
    });
  }

  test('malformed-xml-1', function(done) {
    badMexDocTest('syntax.related.mex.xml', done);
  });

  test('malformed-xml-2', function(done) {
    badMexDocTest('syntax.notrelated.mex.xml', done);
  });

  test('logically-invalid-no-ssl', function(done) {
    badMexDocTest('address.insecure.xml', done);
  });

  test('logically-invalid-no-address', function(done) {
    badMexDocTest('noaddress.xml', done);
  });

  test('logically-invalid-no-binding-port', function(done) {
    badMexDocTest('nobinding.port.xml', done);
  });

  test('logically-invalid-no-binding-port', function(done) {
    badMexDocTest('noname.binding.xml', done);
  });

  test('logically-invalid-no-soap-action', function(done) {
    badMexDocTest('nosoapaction.xml', done);
  });

  test('logically-invalid-no-soap-transport', function(done) {
    badMexDocTest('nosoaptransport.xml', done);
  });

  test('logically-invalid-no-uri-ref', function(done) {
    badMexDocTest('nouri.ref.xml', done);
  });

  test('failed-request', function(done) {
    var mexRequest = util.setupExpectedFailedMexCommon();

    var mex = new Mex(cp.callContext, cp.adfsMex);
    mex.discover(function(err) {
      assert(err, 'Did not recieve error as expected');
      mexRequest.done();
      done();
    });
  });
});


text:
<html>

  <head>
    <meta name="viewport" content="width=800, initial-scale=1">
    <title>I'LL DO THE HOT VOICE!!!</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/main.min.css') }}"></link>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/fonts.css') }}"></link>
  </head>

  <body>
  </body>

  <script type=text/javascript>
    $STATIC_ROOT = {{ url_for('static', filename='')|tojson|safe }};
    $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
  </script>
  <script type="text/javascript" src="{{ url_for('static', filename='js/elm.min.js') }}"></script>
  <script type="text/javascript" src="{{ url_for('static', filename='js/saveSvgAsPng.js') }}"></script>
  <script type="text/javascript" src="{{ url_for('static', filename='js/undertale.min.js') }}"></script>

</html>


text:
typedef struct TCP_KEEPALIVE1
{
	unsigned long onoff;
	unsigned long keepalivetime;
	unsigned long keepaliveinterval;
}
TCP_KEEPALIVE1,*PTCP_KEEPALIVE;

//»Øµ÷º¯ÊýÖ¸Õë

typedef void tcp_receive_send_callback_fuc(SOCKET client,char* buf,unsigned long data_len);
typedef tcp_receive_send_callback_fuc* pTcpReceiveCallbackFun;
typedef tcp_receive_send_callback_fuc* pTcpSendCallbackFun;
typedef tcp_receive_send_callback_fuc* pTcpAcceptCallbackFun;

typedef unsigned long udp_receive_send_callback_fuc(char* remote_ip,unsigned short remote_port,char* buf,unsigned long data_len,SOCKET socket);
typedef udp_receive_send_callback_fuc* pUdpReceiveCallbackFun;
typedef udp_receive_send_callback_fuc* pUdpSendCallbackFun;

enum IO_OPERATION_TYPE //IO ²Ù×÷ÀàÐÍ
{
	IO_EXIT=0,
	IO_TCP_ACCEPT=1,
	IO_TCP_RECEIVE=2,
	IO_TCP_SEND=3,
	IO_UDP_RECEIVE=4,
	IO_UDP_SEND=5,
};

#pragma pack(1)
typedef struct IO_PER_HANDLE_STRUCT
{
	WSAOVERLAPPED operate_overlapped;//peer handle overlapped struct
	int operate_type ;//current context operation mode
}IO_PER_HANDLE_STRUCT;
#pragma pack()

const int ADDRESS_LENGTH = ((sizeof( struct sockaddr_in) + 16));

#pragma pack(1)
typedef struct TCP_ACCEPT_CONTEXT
{
	WSAOVERLAPPED operate_overlapped;//peer handle overlapped struct
	int operate_type ;        //current context operation mode
	SOCKET listen_socket;
	SOCKET accept_socket;
	char remoteAddressBuffer[ADDRESS_LENGTH*2];//´æ·ÅÔ¶¶ËµØÖ·ÐÅÏ¢µÄ»º³åÇø

}TCP_ACCEPT_CONTEXT;
#pragma pack()

const int DEFAULT_TCP_RECEIVE_BUFFER_SIZE = 8192;
#pragma pack(1)
typedef struct TCP_RECEIVE_CONTEXT
{
	WSAOVERLAPPED operate_overlapped;//peer handle overlapped struct
	int operate_type ;//current context operation mode
	SOCKET socket;
	WSABUF operate_buffer;   //ÿ´ÎµÄ²Ù×÷»º³åÇø
	char receive_buffer[DEFAULT_TCP_RECEIVE_BUFFER_SIZE];

}TCP_RECEIVE_CONTEXT;
#pragma pack()

const int DEFAULT_TCP_SEND_BUFFER_SIZE = 4096;
#pragma pack(1)
typedef struct TCP_SEND_CONTEXT
{
	WSAOVERLAPPED operate_overlapped;//peer handle overlapped struct
	int operate_type ;//current context operation mode
	SOCKET socket;
	WSABUF operate_buffer;   //ÿ´ÎµÄ²Ù×÷»º³åÇø
	char send_buffer[DEFAULT_TCP_SEND_BUFFER_SIZE];

}TCP_SEND_CONTEXT;
#pragma pack()

//udpµÄ·¢ËͺͽÓÊÕ¹«ÓÃÒ»¸öÀàÐ͵Äcontext
const int DEFAULT_UDP_BUFFER_SIZE = 4096;
#pragma pack(1)
typedef struct UDP_CONTEXT
{
	WSAOVERLAPPED operate_overlapped;
	int operate_type ;
	SOCKET socket;
	WSABUF operate_buffer;
	char data_buffer[DEFAULT_UDP_BUFFER_SIZE];
	struct sockaddr_in remote_address;
	int remote_address_len;  //´ËÖµ¹Ì¶¨ÎªADDRESS_LENGTH

}UDP_CONTEXT;
#pragma pack()


text:
package org.apache.harmony.xnet.provider.jsse;

public class KeyManagerFactoryImpl
  extends javax.net.ssl.KeyManagerFactorySpi{
  // Constructors

  public KeyManagerFactoryImpl(){
    super();
  }
  // Methods

  public void engineInit(java.security.KeyStore arg1, char [] arg2) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException{
  }
  public void engineInit(javax.net.ssl.ManagerFactoryParameters arg1) throws java.security.InvalidAlgorithmParameterException{
  }
  public javax.net.ssl.KeyManager [] engineGetKeyManagers(){
    return (javax.net.ssl.KeyManager []) null;
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="invoice_supplier_form" model="ir.ui.view">
            <field name="name">account.invoice.supplier.form.inherit</field>
            <field name="model">account.invoice</field>
            <field name="inherit_id" ref="account.invoice_supplier_form"/>
            <field name="arch" type="xml">
                <field name="partner_bank_id" position="before">
                    <field name="amount_to_pay"/>
                </field>
            </field>
        </record>
    </data>
</openerp>


text:
package ru.sbt.drtmn.lab.webapp.action;

import com.opensymphony.xwork2.Preparable;
import org.apache.log4j.Logger;
import ru.sbt.drtmn.lab.dao.SearchException;
import ru.sbt.drtmn.lab.model.Section;
import ru.sbt.drtmn.lab.service.SectionManager;

import java.util.ArrayList;
import java.util.List;

/**
 * Created: 13.07.2016.
 *
 * @author Razuvaev Sergey
 *         Action class for sections.
 */
public class SectionAction extends GenericAction implements Preparable {
    private static transient Logger logger = Logger.getLogger(GenericAction.class);

    private SectionManager sectionManager;
    private List sections;
    private Section currentSection;
    private Long sectionId;
    private List<Long> sectionSelectedBox;
    private String query;
    // Variable for paginator
    private Integer pageSize;

    /**
     * Grab the entity from the database before populating with request parameters
     */
    public void prepare() {
        if (getRequest().getMethod().equalsIgnoreCase("post")) {
            // prevent failures on new
            String sectionId = getRequest().getParameter("section.id");
            if (sectionId != null && !sectionId.equals("")) {
                currentSection = (Section)sectionManager.get(new Long(sectionId));
            }
        }
        if (getSession().getAttribute("pageSize") == null) {
            this.pageSize = 20;
            getSession().setAttribute("pageSize", this.pageSize);
        } else {
            this.pageSize = (Integer)getSession().getAttribute("pageSize");
        }
    }

    public String listSections() {
        try {
            sections = sectionManager.getAllDistinct();
        } catch (SearchException se) {
            addActionError(se.getMessage());
        }
        return SUCCESS;
    }

    public String deleteSelected() {
        try {
            Integer count = sectionManager.deleteSections(sectionSelectedBox);
            logger.debug("Deleted: " + count + " section(s)");
        } catch (SearchException se) {
            addActionError(se.getMessage());
            sections = sectionManager.getAllDistinct();
        }
        return SUCCESS;
    }

    public String delete() {
        sectionManager.remove(currentSection.getId());
        saveMessage(getText("Section [" + currentSection.getName() + "] deleted"));
        return SUCCESS;
    }

    public String edit() {
        if (sectionId != null) {
            currentSection = (Section)sectionManager.get(sectionId);
        } else {
            currentSection = new Section();
        }
        return SUCCESS;
    }

    public String save() throws Exception {
        if (cancel != null) { return "cancel"; }
        if (delete != null) { return delete(); }
        boolean isNew = (currentSection.getId() == null);
        String key = (isNew) ? "Section " + currentSection.getName() + " added" : "Section " + currentSection.getName() + " updated";
        saveMessage(getText(key));
        if (!isNew) {
            sectionManager.update(currentSection);
            return SUCCESS;
        } else {
            sectionManager.save(currentSection);
            return SUCCESS;
        }
    }

    @Override
    public void validate(){
        if (currentSection.getId() == null) {
            try {
                Section sectionByName = sectionManager.getSectionsByName(currentSection.getName()).get(0);
                addFieldError("currentSection.name", " Каталог с именем " + sectionByName.getName() + " существует в БД");
            } catch (Exception e) {
                logger.debug("Name check success");
            }
        }
    }

    // Getters and Setters

    public Section getCurrentSection() {
        return currentSection;
    }

    public void setCurrentSection(Section currentSection) {
        this.currentSection = currentSection;
    }

    public List getSections() {
        return sections;
    }

    public void setSections(List sections) {
        this.sections = sections;
    }

    public Long getSectionId() {
        return sectionId;
    }

    public void setSectionId(Long sectionId) {
        this.sectionId = sectionId;
    }

    public List<Long> getSectionSelectedBox() {
        if (sectionSelectedBox == null) {
            sectionSelectedBox = new ArrayList<Long>();
        }
        return sectionSelectedBox;
    }

    public void setSectionSelectedBox(List<Long> sectionSelectedBox) {
        this.sectionSelectedBox = sectionSelectedBox;
    }

    public SectionManager getSectionManager() {
        return sectionManager;
    }

    public void setSectionManager(SectionManager sectionManager) {
        this.sectionManager = sectionManager;
    }

    public String getQuery() {
        return query;
    }

    public void setQuery(String query) {
        this.query = query;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
        getSession().setAttribute("pageSize", this.pageSize);
    }
}


text:
package com.google.common.primitives;

import static java.lang.Long.MAX_VALUE;
import static java.lang.Long.MIN_VALUE;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Converter;
import com.google.common.collect.testing.Helpers;
import com.google.common.testing.NullPointerTester;
import com.google.common.testing.SerializableTester;

import junit.framework.TestCase;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Random;

/**
 * Unit test for {@link Longs}.
 *
 * @author Kevin Bourrillion
 */
@GwtCompatible(emulated = true)
@SuppressWarnings("cast") // redundant casts are intentional and harmless
public class LongsTest extends TestCase {
  private static final long[] EMPTY = {};
  private static final long[] ARRAY1 = {(long) 1};
  private static final long[] ARRAY234
      = {(long) 2, (long) 3, (long) 4};

  private static final long[] VALUES =
      { MIN_VALUE, (long) -1, (long) 0, (long) 1, MAX_VALUE };

  @GwtIncompatible("Long.hashCode returns different values in GWT.")
  public void testHashCode() {
    for (long value : VALUES) {
      assertEquals("hashCode for " + value,
          ((Long) value).hashCode(), Longs.hashCode(value));
    }
  }

  public void testCompare() {
    for (long x : VALUES) {
      for (long y : VALUES) {
        // note: spec requires only that the sign is the same
        assertEquals(x + ", " + y,
                     Long.valueOf(x).compareTo(y),
                     Longs.compare(x, y));
      }
    }
  }

  public void testContains() {
    assertFalse(Longs.contains(EMPTY, (long) 1));
    assertFalse(Longs.contains(ARRAY1, (long) 2));
    assertFalse(Longs.contains(ARRAY234, (long) 1));
    assertTrue(Longs.contains(new long[] {(long) -1}, (long) -1));
    assertTrue(Longs.contains(ARRAY234, (long) 2));
    assertTrue(Longs.contains(ARRAY234, (long) 3));
    assertTrue(Longs.contains(ARRAY234, (long) 4));
  }

  public void testIndexOf() {
    assertEquals(-1, Longs.indexOf(EMPTY, (long) 1));
    assertEquals(-1, Longs.indexOf(ARRAY1, (long) 2));
    assertEquals(-1, Longs.indexOf(ARRAY234, (long) 1));
    assertEquals(0, Longs.indexOf(
        new long[] {(long) -1}, (long) -1));
    assertEquals(0, Longs.indexOf(ARRAY234, (long) 2));
    assertEquals(1, Longs.indexOf(ARRAY234, (long) 3));
    assertEquals(2, Longs.indexOf(ARRAY234, (long) 4));
    assertEquals(1, Longs.indexOf(
        new long[] { (long) 2, (long) 3, (long) 2, (long) 3 },
        (long) 3));
  }

  public void testIndexOf_arrayTarget() {
    assertEquals(0, Longs.indexOf(EMPTY, EMPTY));
    assertEquals(0, Longs.indexOf(ARRAY234, EMPTY));
    assertEquals(-1, Longs.indexOf(EMPTY, ARRAY234));
    assertEquals(-1, Longs.indexOf(ARRAY234, ARRAY1));
    assertEquals(-1, Longs.indexOf(ARRAY1, ARRAY234));
    assertEquals(0, Longs.indexOf(ARRAY1, ARRAY1));
    assertEquals(0, Longs.indexOf(ARRAY234, ARRAY234));
    assertEquals(0, Longs.indexOf(
        ARRAY234, new long[] { (long) 2, (long) 3 }));
    assertEquals(1, Longs.indexOf(
        ARRAY234, new long[] { (long) 3, (long) 4 }));
    assertEquals(1, Longs.indexOf(ARRAY234, new long[] { (long) 3 }));
    assertEquals(2, Longs.indexOf(ARRAY234, new long[] { (long) 4 }));
    assertEquals(1, Longs.indexOf(new long[] { (long) 2, (long) 3,
        (long) 3, (long) 3, (long) 3 },
        new long[] { (long) 3 }
    ));
    assertEquals(2, Longs.indexOf(
        new long[] { (long) 2, (long) 3, (long) 2,
            (long) 3, (long) 4, (long) 2, (long) 3},
        new long[] { (long) 2, (long) 3, (long) 4}
    ));
    assertEquals(1, Longs.indexOf(
        new long[] { (long) 2, (long) 2, (long) 3,
            (long) 4, (long) 2, (long) 3, (long) 4},
        new long[] { (long) 2, (long) 3, (long) 4}
    ));
    assertEquals(-1, Longs.indexOf(
        new long[] { (long) 4, (long) 3, (long) 2},
        new long[] { (long) 2, (long) 3, (long) 4}
    ));
  }

  public void testLastIndexOf() {
    assertEquals(-1, Longs.lastIndexOf(EMPTY, (long) 1));
    assertEquals(-1, Longs.lastIndexOf(ARRAY1, (long) 2));
    assertEquals(-1, Longs.lastIndexOf(ARRAY234, (long) 1));
    assertEquals(0, Longs.lastIndexOf(
        new long[] {(long) -1}, (long) -1));
    assertEquals(0, Longs.lastIndexOf(ARRAY234, (long) 2));
    assertEquals(1, Longs.lastIndexOf(ARRAY234, (long) 3));
    assertEquals(2, Longs.lastIndexOf(ARRAY234, (long) 4));
    assertEquals(3, Longs.lastIndexOf(
        new long[] { (long) 2, (long) 3, (long) 2, (long) 3 },
        (long) 3));
  }

  public void testMax_noArgs() {
    try {
      Longs.max();
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testMax() {
    assertEquals(MIN_VALUE, Longs.max(MIN_VALUE));
    assertEquals(MAX_VALUE, Longs.max(MAX_VALUE));
    assertEquals((long) 9, Longs.max(
        (long) 8, (long) 6, (long) 7,
        (long) 5, (long) 3, (long) 0, (long) 9));
  }

  public void testMin_noArgs() {
    try {
      Longs.min();
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testMin() {
    assertEquals(MIN_VALUE, Longs.min(MIN_VALUE));
    assertEquals(MAX_VALUE, Longs.min(MAX_VALUE));
    assertEquals((long) 0, Longs.min(
        (long) 8, (long) 6, (long) 7,
        (long) 5, (long) 3, (long) 0, (long) 9));
  }

  public void testConcat() {
    assertTrue(Arrays.equals(EMPTY, Longs.concat()));
    assertTrue(Arrays.equals(EMPTY, Longs.concat(EMPTY)));
    assertTrue(Arrays.equals(EMPTY, Longs.concat(EMPTY, EMPTY, EMPTY)));
    assertTrue(Arrays.equals(ARRAY1, Longs.concat(ARRAY1)));
    assertNotSame(ARRAY1, Longs.concat(ARRAY1));
    assertTrue(Arrays.equals(ARRAY1, Longs.concat(EMPTY, ARRAY1, EMPTY)));
    assertTrue(Arrays.equals(
        new long[] {(long) 1, (long) 1, (long) 1},
        Longs.concat(ARRAY1, ARRAY1, ARRAY1)));
    assertTrue(Arrays.equals(
        new long[] {(long) 1, (long) 2, (long) 3, (long) 4},
        Longs.concat(ARRAY1, ARRAY234)));
  }

  private static void assertByteArrayEquals(byte[] expected, byte[] actual) {
    assertTrue(
        "Expected: " + Arrays.toString(expected) + ", but got: " + Arrays.toString(actual),
        Arrays.equals(expected, actual));
  }

  public void testToByteArray() {
    assertByteArrayEquals(
        new byte[] {0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19},
        Longs.toByteArray(0x1213141516171819L));
    assertByteArrayEquals(
        new byte[] {
            (byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC,
            (byte) 0xBB, (byte) 0xAA, (byte) 0x99, (byte) 0x88},
        Longs.toByteArray(0xFFEEDDCCBBAA9988L));
  }

  public void testFromByteArray() {
    assertEquals(0x1213141516171819L, Longs.fromByteArray(
        new byte[] {0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x33}));
    assertEquals(0xFFEEDDCCBBAA9988L, Longs.fromByteArray(
        new byte[] {
            (byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC,
            (byte) 0xBB, (byte) 0xAA, (byte) 0x99, (byte) 0x88}));

    try {
      Longs.fromByteArray(new byte[Longs.BYTES - 1]);
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testFromBytes() {
    assertEquals(0x1213141516171819L, Longs.fromBytes(
        (byte) 0x12, (byte) 0x13, (byte) 0x14, (byte) 0x15,
        (byte) 0x16, (byte) 0x17, (byte) 0x18, (byte) 0x19));
    assertEquals(0xFFEEDDCCBBAA9988L, Longs.fromBytes(
        (byte) 0xFF, (byte) 0xEE, (byte) 0xDD, (byte) 0xCC,
        (byte) 0xBB, (byte) 0xAA, (byte) 0x99, (byte) 0x88));
  }

  public void testByteArrayRoundTrips() {
    Random r = new Random(5);
    byte[] b = new byte[Longs.BYTES];

    // total overkill, but, it takes 0.1 sec so why not...
    for (int i = 0; i < 10000; i++) {
      long num = r.nextLong();
      assertEquals(num, Longs.fromByteArray(Longs.toByteArray(num)));

      r.nextBytes(b);
      long value = Longs.fromByteArray(b);
      assertTrue("" + value, Arrays.equals(b, Longs.toByteArray(value)));
    }
  }

  public void testEnsureCapacity() {
    assertSame(EMPTY, Longs.ensureCapacity(EMPTY, 0, 1));
    assertSame(ARRAY1, Longs.ensureCapacity(ARRAY1, 0, 1));
    assertSame(ARRAY1, Longs.ensureCapacity(ARRAY1, 1, 1));
    assertTrue(Arrays.equals(
        new long[] {(long) 1, (long) 0, (long) 0},
        Longs.ensureCapacity(ARRAY1, 2, 1)));
  }

  public void testEnsureCapacity_fail() {
    try {
      Longs.ensureCapacity(ARRAY1, -1, 1);
      fail();
    } catch (IllegalArgumentException expected) {
    }
    try {
      // notice that this should even fail when no growth was needed
      Longs.ensureCapacity(ARRAY1, 1, -1);
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testJoin() {
    assertEquals("", Longs.join(",", EMPTY));
    assertEquals("1", Longs.join(",", ARRAY1));
    assertEquals("1,2", Longs.join(",", (long) 1, (long) 2));
    assertEquals("123",
        Longs.join("", (long) 1, (long) 2, (long) 3));
  }

  public void testLexicographicalComparator() {
    List<long[]> ordered = Arrays.asList(
        new long[] {},
        new long[] {MIN_VALUE},
        new long[] {MIN_VALUE, MIN_VALUE},
        new long[] {MIN_VALUE, (long) 1},
        new long[] {(long) 1},
        new long[] {(long) 1, MIN_VALUE},
        new long[] {MAX_VALUE, MAX_VALUE - (long) 1},
        new long[] {MAX_VALUE, MAX_VALUE},
        new long[] {MAX_VALUE, MAX_VALUE, MAX_VALUE});

    Comparator<long[]> comparator = Longs.lexicographicalComparator();
    Helpers.testComparator(comparator, ordered);
  }

  @GwtIncompatible("SerializableTester")
  public void testLexicographicalComparatorSerializable() {
    Comparator<long[]> comparator = Longs.lexicographicalComparator();
    assertSame(comparator, SerializableTester.reserialize(comparator));
  }

  @GwtIncompatible("SerializableTester")
  public void testStringConverterSerialization() {
    SerializableTester.reserializeAndAssert(Longs.stringConverter());
  }

  public void testToArray() {
    // need explicit type parameter to avoid javac warning!?
    List<Long> none = Arrays.<Long>asList();
    assertTrue(Arrays.equals(EMPTY, Longs.toArray(none)));

    List<Long> one = Arrays.asList((long) 1);
    assertTrue(Arrays.equals(ARRAY1, Longs.toArray(one)));

    long[] array = {(long) 0, (long) 1, 0x0FF1C1AL};

    List<Long> three = Arrays.asList((long) 0, (long) 1, 0x0FF1C1AL);
    assertTrue(Arrays.equals(array, Longs.toArray(three)));

    assertTrue(Arrays.equals(array, Longs.toArray(Longs.asList(array))));
  }

  public void testToArray_threadSafe() {
    for (int delta : new int[] { +1, 0, -1 }) {
      for (int i = 0; i < VALUES.length; i++) {
        List<Long> list = Longs.asList(VALUES).subList(0, i);
        Collection<Long> misleadingSize =
            Helpers.misleadingSizeCollection(delta);
        misleadingSize.addAll(list);
        long[] arr = Longs.toArray(misleadingSize);
        assertEquals(i, arr.length);
        for (int j = 0; j < i; j++) {
          assertEquals(VALUES[j], arr[j]);
        }
      }
    }
  }

  public void testToArray_withNull() {
    List<Long> list = Arrays.asList((long) 0, (long) 1, null);
    try {
      Longs.toArray(list);
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testToArray_withConversion() {
    long[] array = {(long) 0, (long) 1, (long) 2};

    List<Byte> bytes = Arrays.asList((byte) 0, (byte) 1, (byte) 2);
    List<Short> shorts = Arrays.asList((short) 0, (short) 1, (short) 2);
    List<Integer> ints = Arrays.asList(0, 1, 2);
    List<Float> floats = Arrays.asList((float) 0, (float) 1, (float) 2);
    List<Long> longs = Arrays.asList((long) 0, (long) 1, (long) 2);
    List<Double> doubles = Arrays.asList((double) 0, (double) 1, (double) 2);

    assertTrue(Arrays.equals(array, Longs.toArray(bytes)));
    assertTrue(Arrays.equals(array, Longs.toArray(shorts)));
    assertTrue(Arrays.equals(array, Longs.toArray(ints)));
    assertTrue(Arrays.equals(array, Longs.toArray(floats)));
    assertTrue(Arrays.equals(array, Longs.toArray(longs)));
    assertTrue(Arrays.equals(array, Longs.toArray(doubles)));
  }

  public void testAsList_isAView() {
    long[] array = {(long) 0, (long) 1};
    List<Long> list = Longs.asList(array);
    list.set(0, (long) 2);
    assertTrue(Arrays.equals(new long[] {(long) 2, (long) 1}, array));
    array[1] = (long) 3;
    assertEquals(Arrays.asList((long) 2, (long) 3), list);
  }

  public void testAsList_toArray_roundTrip() {
    long[] array = { (long) 0, (long) 1, (long) 2 };
    List<Long> list = Longs.asList(array);
    long[] newArray = Longs.toArray(list);

    // Make sure it returned a copy
    list.set(0, (long) 4);
    assertTrue(Arrays.equals(
        new long[] { (long) 0, (long) 1, (long) 2 }, newArray));
    newArray[1] = (long) 5;
    assertEquals((long) 1, (long) list.get(1));
  }

  // This test stems from a real bug found by andrewk
  public void testAsList_subList_toArray_roundTrip() {
    long[] array = { (long) 0, (long) 1, (long) 2, (long) 3 };
    List<Long> list = Longs.asList(array);
    assertTrue(Arrays.equals(new long[] { (long) 1, (long) 2 },
        Longs.toArray(list.subList(1, 3))));
    assertTrue(Arrays.equals(new long[] {},
        Longs.toArray(list.subList(2, 2))));
  }

  public void testAsListEmpty() {
    assertSame(Collections.emptyList(), Longs.asList(EMPTY));
  }

  @GwtIncompatible("NullPointerTester")
  public void testNulls() {
    new NullPointerTester().testAllPublicStaticMethods(Longs.class);
  }

  public void testStringConverter_convert() {
    Converter<String, Long> converter = Longs.stringConverter();
    assertEquals((Long) 1L, converter.convert("1"));
    assertEquals((Long) 0L, converter.convert("0"));
    assertEquals((Long) (-1L), converter.convert("-1"));
    assertEquals((Long) 255L, converter.convert("0xff"));
    assertEquals((Long) 255L, converter.convert("0xFF"));
    assertEquals((Long) (-255L), converter.convert("-0xFF"));
    assertEquals((Long) 255L, converter.convert("#0000FF"));
    assertEquals((Long) 438L, converter.convert("0666"));
  }

  public void testStringConverter_convertError() {
    try {
      Longs.stringConverter().convert("notanumber");
      fail();
    } catch (NumberFormatException expected) {
    }
  }

  public void testStringConverter_nullConversions() {
    assertNull(Longs.stringConverter().convert(null));
    assertNull(Longs.stringConverter().reverse().convert(null));
  }

  public void testStringConverter_reverse() {
    Converter<String, Long> converter = Longs.stringConverter();
    assertEquals("1", converter.reverse().convert(1L));
    assertEquals("0", converter.reverse().convert(0L));
    assertEquals("-1", converter.reverse().convert(-1L));
    assertEquals("255", converter.reverse().convert(0xffL));
    assertEquals("255", converter.reverse().convert(0xFFL));
    assertEquals("-255", converter.reverse().convert(-0xFFL));
    assertEquals("438", converter.reverse().convert(0666L));
  }

  @GwtIncompatible("NullPointerTester")
  public void testStringConverter_nullPointerTester() throws Exception {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicInstanceMethods(Longs.stringConverter());
  }

  @GwtIncompatible("AndroidInteger")
  public void testTryParse() {
    tryParseAndAssertEquals(0L, "0");
    tryParseAndAssertEquals(0L, "-0");
    tryParseAndAssertEquals(1L, "1");
    tryParseAndAssertEquals(-1L, "-1");
    tryParseAndAssertEquals(8900L, "8900");
    tryParseAndAssertEquals(-8900L, "-8900");
    tryParseAndAssertEquals(MAX_VALUE, Long.toString(MAX_VALUE));
    tryParseAndAssertEquals(MIN_VALUE, Long.toString(MIN_VALUE));
    assertNull(Longs.tryParse(""));
    assertNull(Longs.tryParse("-"));
    assertNull(Longs.tryParse("+1"));
    assertNull(Longs.tryParse("999999999999999999999999"));
    assertNull("Max integer + 1",
        Longs.tryParse(BigInteger.valueOf(MAX_VALUE).add(BigInteger.ONE).toString()));
    assertNull("Min integer - 1",
        Longs.tryParse(BigInteger.valueOf(MIN_VALUE).subtract(BigInteger.ONE).toString()));
    assertNull(Longs.tryParse("\u0662\u06f3"));
  }

  /**
   * Applies {@link Longs#tryParse(String)} to the given string and asserts that
   * the result is as expected.
   */
  private static void tryParseAndAssertEquals(Long expected, String value) {
    assertEquals(expected, Longs.tryParse(value));
  }
}