text:
/*global describe, it, beforeEach, expect, spyOn*/

const Game = require('../../../server/game/game.js');
const Player = require('../../../server/game/player.js');
const Spectator = require('../../../server/game/spectator.js');

describe('the Game', function() {
    var game = {};
    var player1 = {};
    var spectator = {};

    beforeEach(function() {
        game = new Game('1', 'Test Game');

        player1 = new Player('1', { username: 'Player 1' }, true, game);
        spectator = new Spectator('3', { username: 'Spectator 1' }, game);

        game.players[player1.id] = player1;
        game.players[spectator.id] = spectator;

        game.initialise();

        player1.setPower = undefined;
    });

    describe('the getNumberOrDefault() function', function() {
        describe('with no arguments', function() {
            it('should return the default', function () {
                expect(game.getNumberOrDefault('', 1)).toBe(1);
            });
        });

        describe('with a string argument', function() {
            it('should return the default', function () {
                expect(game.getNumberOrDefault('test', 1)).toBe(1);
            });
        });

        describe('with a negative argument', function() {
            it('should return the default', function () {
                expect(game.getNumberOrDefault('-1', 1)).toBe(1);
            });
        });

        describe('with a valid argument', function() {
            it('should return the parsed value', function () {
                expect(game.getNumberOrDefault('3', 1)).toBe(3);
            });
        });
    });

    describe('the chat() function', function() {
        describe('when called by a player not in the game', function() {
            it('should not add any chat messages', function() {
                game.chat('notinthegame', 'Test Message');

                expect(game.messages.length).toBe(0);
            });
        });

        describe('when called by a player in the game', function() {
            describe('with no slashes', function() {
                it('should add their chat message', function() {
                    game.chat(player1.name, 'Test Message');

                    expect(game.messages.length).toBe(1);
                    expect(game.messages[0].message[1].name).toBe(player1.name);
                    expect(game.messages[0].message.join('')).toContain('Test Message');
                });
            });

            describe('with a /draw command', function() {
                beforeEach(function() {
                    spyOn(player1, 'drawCardsToHand');
                });

                describe('with no arguments', function() {
                    it('should draw 1 card', function () {
                        game.chat(player1.name, '/draw');

                        expect(game.messages.length).toBe(1);
                        expect(player1.drawCardsToHand).toHaveBeenCalledWith(1);
                    });
                });

                describe('with a string argument', function() {
                    it('should draw 1 card', function () {
                        game.chat(player1.name, '/draw test');

                        expect(game.messages.length).toBe(1);
                        expect(player1.drawCardsToHand).toHaveBeenCalledWith(1);
                    });
                });

                describe('with a negative argument', function() {
                    it('should draw 1 card', function () {
                        game.chat(player1.name, '/draw -1');

                        expect(game.messages.length).toBe(1);
                        expect(player1.drawCardsToHand).toHaveBeenCalledWith(1);
                    });
                });

                describe('with a valid argument', function() {
                    it('should draw 4 cards', function () {
                        game.chat(player1.name, '/draw 4');

                        expect(game.messages.length).toBe(1);
                        expect(player1.drawCardsToHand).toHaveBeenCalledWith(4);
                    });
                });

                describe('half way through a message', function() {
                    it('should not trigger the /draw command', function() {
                        game.chat(player1.name, 'test test /draw test');

                        expect(player1.drawCardsToHand).not.toHaveBeenCalled();
                    });
                });
            });

            describe('with a /discard command', function() {
                beforeEach(function() {
                    spyOn(player1, 'discardAtRandom');
                });

                describe('with no arguments', function() {
                    it('should discard 1 card', function () {
                        game.chat(player1.name, '/discard');

                        expect(game.messages.length).toBe(1);
                        expect(player1.discardAtRandom).toHaveBeenCalledWith(1);
                    });
                });

                describe('with a string argument', function() {
                    it('should discard 1 card', function () {
                        game.chat(player1.name, '/discard test');

                        expect(game.messages.length).toBe(1);
                        expect(player1.discardAtRandom).toHaveBeenCalledWith(1);
                    });
                });

                describe('with a negative argument', function() {
                    it('should discard 1 card', function () {
                        game.chat(player1.name, '/discard -1');

                        expect(game.messages.length).toBe(1);
                        expect(player1.discardAtRandom).toHaveBeenCalledWith(1);
                    });
                });

                describe('with a valid argument', function() {
                    it('should discard 3 cards', function () {
                        game.chat(player1.name, '/discard 3');

                        expect(game.messages.length).toBe(1);
                        expect(player1.discardAtRandom).toHaveBeenCalledWith(3);
                    });
                });
            });

            describe('with a /pillage command', function() {
                beforeEach(function() {
                    spyOn(player1, 'discardFromDraw');
                });

                describe('with no arguments', function() {
                    it('should discard 1 card', function () {
                        game.chat(player1.name, '/pillage');

                        expect(game.messages.length).toBe(1);
                        expect(player1.discardFromDraw).toHaveBeenCalledWith(1);
                    });
                });
            });

        });

        describe('when called by a spectator in the game', function() {
            describe('with no slashes', function () {
                it('should add their chat message', function() {
                    game.chat(spectator.name, 'Test Message');

                    expect(game.messages.length).toBe(1);
                    expect(game.messages[0].message[1].name).toBe(spectator.name);
                    expect(game.messages[0].message.join('')).toContain('Test Message');
                });
            });

            describe('with a /power command', function() {
                it('should add the message to the messages', function() {
                    game.chat(spectator.name, '/power');

                    expect(game.messages.length).toBe(1);
                    expect(player1.setPower).toBe(undefined);
                });
            });
        });
    });
});


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>B-Index</title>
<meta name="date" content="2017-04-11">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I L M N O P R S T U V W

B

black - Static variable in class com.github.pocmo.sensordashboard.R.color

blue - Static variable in class com.github.pocmo.sensordashboard.R.color

bottom - Static variable in class com.github.pocmo.sensordashboard.R.id

BoxInsetLayout_Layout - Static variable in class com.github.pocmo.sensordashboard.R.styleable

Attributes that can be used with a BoxInsetLayout_Layout.

BoxInsetLayout_Layout_layout_box - Static variable in class com.github.pocmo.sensordashboard.R.styleable

This symbol is the offset where the R.attr.layout_box
          attribute's value can be found in the R.styleable.BoxInsetLayout_Layout array.

BUILD_TYPE - Static variable in class com.github.pocmo.sensordashboard.BuildConfig

BuildConfig - Class in com.github.pocmo.sensordashboard

BuildConfig() - Constructor for class com.github.pocmo.sensordashboard.BuildConfig

A B C D E F G H I L M N O P R S T U V W

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace App\Controller\Api;

use App\Doctrine\ReloadableEntityManagerInterface;
use App\Entity\Interfaces\IdentifiableEntityInterface;
use App\Exception\ValidationException;
use App\Http\Response;
use App\Http\ServerRequest;
use App\Paginator;
use App\Utilities;
use Doctrine\ORM\Query;
use InvalidArgumentException;
use Psr\Http\Message\ResponseInterface;
use Stringable;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Validator\Validator\ValidatorInterface;

/**
 * @template TEntity as object
 */
abstract class AbstractApiCrudController
{
    /** @var class-string<TEntity> The fully-qualified (::class) class name of the entity being managed. */
    protected string $entityClass;

    /** @var string The route name used to generate the "self" links for each record. */
    protected string $resourceRouteName;

    public function __construct(
        protected ReloadableEntityManagerInterface $em,
        protected Serializer $serializer,
        protected ValidatorInterface $validator
    ) {
    }

    protected function listPaginatedFromQuery(
        ServerRequest $request,
        Response $response,
        Query $query,
        callable $postProcessor = null
    ): ResponseInterface {
        $paginator = Paginator::fromQuery($query, $request);

        $isBootgrid = $paginator->isFromBootgrid();
        $isInternal = ('true' === $request->getParam('internal', 'false'));

        $postProcessor ??= function ($row) use ($isBootgrid, $isInternal, $request) {
            $return = $this->viewRecord($row, $request);

            // Older jQuery Bootgrid requests should be "flattened".
            if ($isBootgrid && !$isInternal) {
                return Utilities\Arrays::flattenArray($return, '_');
            }

            return $return;
        };
        $paginator->setPostprocessor($postProcessor);

        return $paginator->write($response);
    }

    /**
     * @param TEntity $record
     * @param ServerRequest $request
     *
     */
    protected function viewRecord(object $record, ServerRequest $request): mixed
    {
        if (!($record instanceof $this->entityClass)) {
            throw new InvalidArgumentException(sprintf('Record must be an instance of %s.', $this->entityClass));
        }

        $return = $this->toArray($record);

        $isInternal = ('true' === $request->getParam('internal', 'false'));
        $router = $request->getRouter();

        if ($record instanceof IdentifiableEntityInterface) {
            $return['links'] = [
                'self' => (string)$router->fromHere(
                    route_name: $this->resourceRouteName,
                    route_params: ['id' => $record->getIdRequired()],
                    absolute: !$isInternal
                ),
            ];
        }

        return $return;
    }

    /**
     * @param TEntity $record
     * @param array<string, mixed> $context
     *
     * @return array<mixed>
     */
    protected function toArray(object $record, array $context = []): array
    {
        return (array)$this->serializer->normalize(
            $record,
            null,
            array_merge(
                $context,
                [
                    AbstractObjectNormalizer::ENABLE_MAX_DEPTH   => true,
                    AbstractObjectNormalizer::MAX_DEPTH_HANDLER    => function (
                        $innerObject,
                        $outerObject,
                        string $attributeName,
                        string $format = null,
                        array $context = []
                    ) {
                        return $this->displayShortenedObject($innerObject);
                    },
                    AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => function (
                        $object,
                        string $format = null,
                        array $context = []
                    ) {
                        return $this->displayShortenedObject($object);
                    },
                ]
            )
        );
    }

    /**
     * @param object $object
     *
     */
    protected function displayShortenedObject(object $object): mixed
    {
        if (method_exists($object, 'getName')) {
            return $object->getName();
        }

        if ($object instanceof IdentifiableEntityInterface) {
            return $object->getIdRequired();
        }

        if ($object instanceof Stringable) {
            return (string)$object;
        }

        return get_class($object) . ': ' . spl_object_hash($object);
    }

    /**
     * @param array<mixed>|null $data
     * @param TEntity|null $record
     * @param array<string, mixed> $context
     *
     * @return TEntity
     */
    protected function editRecord(?array $data, ?object $record = null, array $context = []): object
    {
        if (null === $data) {
            throw new InvalidArgumentException('Could not parse input data.');
        }

        $record = $this->fromArray($data, $record, $context);

        $errors = $this->validator->validate($record);
        if (count($errors) > 0) {
            throw ValidationException::fromValidationErrors($errors);
        }

        $this->em->persist($record);
        $this->em->flush();

        return $record;
    }

    /**
     * @param array<mixed> $data
     * @param TEntity|null $record
     * @param array<string, mixed> $context
     *
     * @return TEntity
     */
    protected function fromArray(array $data, ?object $record = null, array $context = []): object
    {
        if (null !== $record) {
            $context[AbstractNormalizer::OBJECT_TO_POPULATE] = $record;
        }

        return $this->serializer->denormalize($data, $this->entityClass, null, $context);
    }

    /**
     * @param TEntity $record
     */
    protected function deleteRecord(object $record): void
    {
        if (!($record instanceof $this->entityClass)) {
            throw new InvalidArgumentException(sprintf('Record must be an instance of %s.', $this->entityClass));
        }

        $this->em->remove($record);
        $this->em->flush();
    }
}


text:
namespace floating_temple {

class MethodContext;
class ObjectReference;

namespace toy_lang {

class Function : public LocalObjectImpl {
 public:
  void InvokeMethod(MethodContext* method_context,
                    ObjectReference* self_object_reference,
                    const std::string& method_name,
                    const std::vector<Value>& parameters,
                    Value* return_value) override;

 protected:
  virtual ObjectReference* Call(
      MethodContext* method_context,
      const std::vector<ObjectReference*>& parameters) const = 0;
};

}  // namespace toy_lang
}  // namespace floating_temple

#endif  // TOY_LANG_ZOO_FUNCTION_H_


text:
var PixelData = require('../pixeldata.js');

module.exports = {
  id: "time_default",
  name: "Default Time Plugin"

}


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

<TITLE>
Uses of Interface org.apache.fop.datatypes.Numeric (Apache FOP 1.1 API)
</TITLE>

<META NAME="date" CONTENT="2012-10-16">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

fop 1.1

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
org.apache.fop.datatypes.Numeric

Packages that use Numeric

org.apache.fop.datatypes
XSL Datatypes.

org.apache.fop.fo.expr
Classes for XSL expressions and functions.

org.apache.fop.fo.flow
All the block- and inline-level flow formatting objects.

org.apache.fop.fo.flow.table

org.apache.fop.fo.pagination
All the pagination and declaration formatting objects.

org.apache.fop.fo.properties
Classes representing the various property types as well as supporting data structures for the FO tree.

org.apache.fop.layoutmgr
FOP's layout engine.

Uses of Numeric in org.apache.fop.datatypes

Subinterfaces of Numeric in org.apache.fop.datatypes

 interface
Length

          A length quantity in XSL

Uses of Numeric in org.apache.fop.fo.expr

Classes in org.apache.fop.fo.expr that implement Numeric

 class
NumericProperty

          A numeric property which hold the final absolute result of an expression
 calculations.

 class
RelativeNumericProperty

          This class represent a node in a property expression tree.

Methods in org.apache.fop.fo.expr that return Numeric

static Numeric
NumericOp.abs(Numeric op)

          Return the absolute value of a Numeric.

static Numeric
NumericOp.abs2(Numeric op,
     PercentBaseContext context)

          Return the absolute value of a Numeric.

static Numeric
NumericOp.addition(Numeric op1,
         Numeric op2)

          Add the two operands and return a new Numeric representing the result.

static Numeric
NumericOp.addition2(Numeric op1,
          Numeric op2,
          PercentBaseContext context)

          Add the two operands with a percentage context
 and return a new Numeric representing the result.

static Numeric
NumericOp.divide(Numeric op1,
       Numeric op2)

          Divide the second operand into the first and return a new
 Numeric representing the
 result.

static Numeric
NumericOp.divide2(Numeric op1,
        Numeric op2,
        PercentBaseContext context)

          Divide the two operands with a percentage context
 and return a new Numeric representing the result.

 Numeric
RelativeNumericProperty.getNumeric()

 Numeric
NumericProperty.getNumeric()

          This method expects to be overridden by subclasses

static Numeric
NumericOp.max(Numeric op1,
    Numeric op2)

          Return the larger of the two Numerics.

static Numeric
NumericOp.max2(Numeric op1,
     Numeric op2,
     PercentBaseContext context)

          Return the larger of the two Numerics.

static Numeric
NumericOp.min(Numeric op1,
    Numeric op2)

          Return the smaller of two Numerics.

static Numeric
NumericOp.min2(Numeric op1,
     Numeric op2,
     PercentBaseContext context)

          Return the smaller of the two Numerics.

static Numeric
NumericOp.modulo(Numeric op1,
       Numeric op2)

          Return the remainder of a division of the two operand Numeric.

static Numeric
NumericOp.modulo2(Numeric op1,
        Numeric op2,
        PercentBaseContext context)

          Return the remainder of a division of the two operand Numeric.

static Numeric
NumericOp.multiply(Numeric op1,
         Numeric op2)

          Multiply the two operands and return a new Numeric representing the
 result.

static Numeric
NumericOp.multiply2(Numeric op1,
          Numeric op2,
          PercentBaseContext context)

          Multiply the two operands with a percentage context
 and return a new Numeric representing the result.

static Numeric
NumericOp.negate(Numeric op)

          Return the negation of a Numeric.

static Numeric
NumericOp.negate2(Numeric op,
        PercentBaseContext context)

          Return the negation of a Numeric.

static Numeric
NumericOp.subtraction(Numeric op1,
            Numeric op2)

          Add the second operand from the first and return a new Numeric
 representing the result.

static Numeric
NumericOp.subtraction2(Numeric op1,
             Numeric op2,
             PercentBaseContext context)

          Subtract the two operands with a percentage context
 and return a new Numeric representing the result.

Methods in org.apache.fop.fo.expr with parameters of type Numeric

static Numeric
NumericOp.abs(Numeric op)

          Return the absolute value of a Numeric.

static Numeric
NumericOp.abs2(Numeric op,
     PercentBaseContext context)

          Return the absolute value of a Numeric.

static Numeric
NumericOp.addition(Numeric op1,
         Numeric op2)

          Add the two operands and return a new Numeric representing the result.

static Numeric
NumericOp.addition2(Numeric op1,
          Numeric op2,
          PercentBaseContext context)

          Add the two operands with a percentage context
 and return a new Numeric representing the result.

static Numeric
NumericOp.divide(Numeric op1,
       Numeric op2)

          Divide the second operand into the first and return a new
 Numeric representing the
 result.

static Numeric
NumericOp.divide2(Numeric op1,
        Numeric op2,
        PercentBaseContext context)

          Divide the two operands with a percentage context
 and return a new Numeric representing the result.

static Numeric
NumericOp.max(Numeric op1,
    Numeric op2)

          Return the larger of the two Numerics.

static Numeric
NumericOp.max2(Numeric op1,
     Numeric op2,
     PercentBaseContext context)

          Return the larger of the two Numerics.

static Numeric
NumericOp.min(Numeric op1,
    Numeric op2)

          Return the smaller of two Numerics.

static Numeric
NumericOp.min2(Numeric op1,
     Numeric op2,
     PercentBaseContext context)

          Return the smaller of the two Numerics.

static Numeric
NumericOp.modulo(Numeric op1,
       Numeric op2)

          Return the remainder of a division of the two operand Numeric.

static Numeric
NumericOp.modulo2(Numeric op1,
        Numeric op2,
        PercentBaseContext context)

          Return the remainder of a division of the two operand Numeric.

static Numeric
NumericOp.multiply(Numeric op1,
         Numeric op2)

          Multiply the two operands and return a new Numeric representing the
 result.

static Numeric
NumericOp.multiply2(Numeric op1,
          Numeric op2,
          PercentBaseContext context)

          Multiply the two operands with a percentage context
 and return a new Numeric representing the result.

static Numeric
NumericOp.negate(Numeric op)

          Return the negation of a Numeric.

static Numeric
NumericOp.negate2(Numeric op,
        PercentBaseContext context)

          Return the negation of a Numeric.

static Numeric
NumericOp.subtraction(Numeric op1,
            Numeric op2)

          Add the second operand from the first and return a new Numeric
 representing the result.

static Numeric
NumericOp.subtraction2(Numeric op1,
             Numeric op2,
             PercentBaseContext context)

          Subtract the two operands with a percentage context
 and return a new Numeric representing the result.

Constructors in org.apache.fop.fo.expr with parameters of type Numeric

RelativeNumericProperty(int operation,
                        Numeric op)

          Constructor for a one argument operation.

RelativeNumericProperty(int operation,
                        Numeric op1,
                        Numeric op2)

          Constructor for a two argument operation.

Uses of Numeric in org.apache.fop.fo.flow

Methods in org.apache.fop.fo.flow that return Numeric

 Numeric
Block.getHyphenationLadderCount()

Uses of Numeric in org.apache.fop.fo.flow.table

Methods in org.apache.fop.fo.flow.table that return Numeric

 Numeric
TableFObj.getBorderPrecedence(int side)

          Return the value for the "border-precedence" property
 for the given side.

Uses of Numeric in org.apache.fop.fo.pagination

Fields in org.apache.fop.fo.pagination declared as Numeric

protected  Numeric
AbstractPageSequence.initialPageNumber

          initial page number

Methods in org.apache.fop.fo.pagination that return Numeric

 Numeric
AbstractPageSequence.getInitialPageNumber()

          Get the value of the initial-page-number property.

Uses of Numeric in org.apache.fop.fo.properties

Classes in org.apache.fop.fo.properties that implement Numeric

 class
EnumLength

          A length quantity in XSL which is specified as an enum, such as "auto"

 class
EnumNumber

          A number quantity in XSL which is specified as an enum, such as "no-limit".

 class
FixedLength

          An absolute length quantity in XSL

 class
LengthProperty

          Superclass for properties wrapping a Length value.

 class
NumberProperty

          Class for handling numeric properties

 class
PercentLength

          a percent specified length quantity in XSL

 class
TableColLength

          A table-column width specification, possibly including some
 number of proportional "column-units".

Fields in org.apache.fop.fo.properties declared as Numeric

 Numeric
CommonFont.fontSizeAdjust

          The "font-size-adjust" property.

Methods in org.apache.fop.fo.properties that return Numeric

 Numeric
CommonFont.getFontSizeAdjust()

 Numeric
Property.getNumeric()

          This method expects to be overridden by subclasses

 Numeric
NumberProperty.getNumeric()

          Convert NumberProperty to Numeric object

 Numeric
LengthProperty.getNumeric()

 Numeric
EnumNumber.getNumeric()

          This method expects to be overridden by subclasses

Uses of Numeric in org.apache.fop.layoutmgr

Methods in org.apache.fop.layoutmgr with parameters of type Numeric

 void
TopLevelLayoutManager.doForcePageCount(Numeric nextPageSeqInitialPageNumber)

          Act upon the force-page-count trait,
 in relation to the initial-page-number trait of the following page-sequence.

 void
AbstractPageSequenceLayoutManager.doForcePageCount(Numeric nextPageSeqInitialPageNumber)

          Act upon the force-page-count trait,
 in relation to the initial-page-number trait of the following page-sequence.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

fop 1.1

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.


text:
using namespace std;

//#define DEVELOP

// Path to Urho3D's root folder (CMAKE_SOURCE_DIR). There must be no slash at the end
string _sourceDir;

namespace SourceData
{
    void LoadAllXmls(const string& dir);
}

namespace ASBindingGenerator
{
    void ProcessAllEnums();
    void ProcessAllClasses();
    void ProcessAllGlobalVariables();
    void ProcessAllGlobalFunctions();
    void SaveResult();

    void GenerateTemplates();

    void GenerateBindings()
    {
        ProcessAllEnums();
        ProcessAllClasses();
        ProcessAllGlobalVariables();
        ProcessAllGlobalFunctions();
        SaveResult();

        GenerateTemplates();
    }
}

namespace LuaBindingGenerator
{
    void GenerateBindings()
    {
    }
}

namespace JSBindingGenerator
{
    void GenerateBindings()
    {
    }
}

namespace CSBindingGenerator
{
    void GenerateBindings()
    {
    }
}

int main(int argc, char* argv[])
{
#ifdef DEVELOP
    string inputDir = R"(G:/MyGames/Urho3DFork/Build/Source/Tools/BindingGenerator/generated/xml)";
    _sourceDir = R"(G:/MyGames/Urho3DFork/Urho3D)";
#else
    if (argc != 3)
        return -1;

    string inputDir = argv[1];
    _sourceDir = argv[2];
#endif

    auto start = chrono::high_resolution_clock::now();
    SourceData::LoadAllXmls(inputDir);
    auto end = chrono::high_resolution_clock::now();
    cout << "Loaded in " << chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << " ms\n";

    start = chrono::high_resolution_clock::now();
    ASBindingGenerator::GenerateBindings();
    end = chrono::high_resolution_clock::now();
    cout << "Generated in " << chrono::duration_cast<std::chrono::milliseconds>(end - start).count() << " ms\n";

    LuaBindingGenerator::GenerateBindings();
    JSBindingGenerator::GenerateBindings();
    CSBindingGenerator::GenerateBindings();

    return 0;
}


text:
package org.codehaus.modello;

import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.util.Optional;
import java.util.Properties;

import org.codehaus.plexus.PlexusTestCase;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.ReaderFactory;

/**
 * Abstract class for Modello plugins unit-tests that check output generated by the plugin.
 *
 * @author Trygve Laugstøl
 */
public abstract class AbstractModelloGeneratorTest
    extends PlexusTestCase
{
    private String name;

    protected AbstractModelloGeneratorTest( String name )
    {
        this.name = name;
    }

    protected void setUp()
        throws Exception
    {
        super.setUp();

        FileUtils.deleteDirectory( getOutputDirectory() );

        assertTrue( getOutputDirectory().mkdirs() );
    }

    protected File getOutputDirectory()
    {
        return getTestFile( "target/generator-results/" + getName() );
    }

    public String getName()
    {
        return name;
    }

    protected Properties getModelloParameters()
    {
        Properties parameters = new Properties();

        parameters.setProperty( "modello.output.directory", getOutputDirectory().getAbsolutePath() );

        return parameters;
    }

    protected Properties getModelloParameters( String version )
    {
        Properties parameters = getModelloParameters( version, null );

        return parameters;
    }

    protected Properties getModelloParameters( String version, Integer javaSource )
    {
        Properties parameters = getModelloParameters();

        parameters.setProperty( "modello.package.with.version", Boolean.toString( false ) );
        parameters.setProperty( "modello.version", version );
        Optional.ofNullable( javaSource ).ifPresent( a -> parameters.setProperty( "modello.output.java.source",
                                                                                Integer.toString( a ) ) );

        return parameters;
    }

    protected Reader getXmlResourceReader( String name )
        throws IOException
    {
        return ReaderFactory.newXmlReader( getClass().getResourceAsStream( name ) );
    }
}


text:
package com.google.common.collect;

import com.google.common.base.Predicate;
import com.google.common.collect.BoundType;
import com.google.common.collect.DiscreteDomain;
import com.google.common.collect.RangeGwtSerializationDependencies;
import java.io.Serializable;

public class Range<C extends Comparable> extends RangeGwtSerializationDependencies implements Predicate<C>, Serializable
{
    protected Range() {}
    public BoundType lowerBoundType(){ return null; }
    public BoundType upperBoundType(){ return null; }
    public C lowerEndpoint(){ return null; }
    public C upperEndpoint(){ return null; }
    public Range<C> canonical(DiscreteDomain<C> p0){ return null; }
    public Range<C> gap(Range<C> p0){ return null; }
    public Range<C> intersection(Range<C> p0){ return null; }
    public Range<C> span(Range<C> p0){ return null; }
    public String toString(){ return null; }
    public boolean apply(C p0){ return false; }
    public boolean contains(C p0){ return false; }
    public boolean containsAll(Iterable<? extends C> p0){ return false; }
    public boolean encloses(Range<C> p0){ return false; }
    public boolean equals(Object p0){ return false; }
    public boolean hasLowerBound(){ return false; }
    public boolean hasUpperBound(){ return false; }
    public boolean isConnected(Range<C> p0){ return false; }
    public boolean isEmpty(){ return false; }
    public int hashCode(){ return 0; }
    public static <C extends Comparable<? extends Object>> Range<C> all(){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> atLeast(C p0){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> atMost(C p0){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> closed(C p0, C p1){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> closedOpen(C p0, C p1){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> downTo(C p0, BoundType p1){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> encloseAll(Iterable<C> p0){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> greaterThan(C p0){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> lessThan(C p0){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> open(C p0, C p1){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> openClosed(C p0, C p1){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> range(C p0, BoundType p1, C p2, BoundType p3){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> singleton(C p0){ return null; }
    public static <C extends Comparable<? extends Object>> Range<C> upTo(C p0, BoundType p1){ return null; }
}


text:
/*================================================================================
  code generated by: java2cpp
  author: Zoran Angelov, mailto://baldzar@gmail.com
  class: android.test.ProviderTestCase
================================================================================*/

#ifndef J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_ANDROID_TEST_PROVIDERTESTCASE_HPP_DECL
#define J2CPP_ANDROID_TEST_PROVIDERTESTCASE_HPP_DECL

namespace j2cpp { namespace java { namespace lang { class Class; } } }
namespace j2cpp { namespace java { namespace lang { class String; } } }
namespace j2cpp { namespace android { namespace content { class ContentResolver; } } }
namespace j2cpp { namespace android { namespace content { class Context; } } }
namespace j2cpp { namespace android { namespace content { class ContentProvider; } } }
namespace j2cpp { namespace android { namespace test { class IsolatedContext; } } }
namespace j2cpp { namespace android { namespace test { class InstrumentationTestCase; } } }
namespace j2cpp { namespace android { namespace test { namespace mock { class MockContentResolver; } } } }

#include <android/content/ContentProvider.hpp>
#include <android/content/ContentResolver.hpp>
#include <android/content/Context.hpp>
#include <android/test/InstrumentationTestCase.hpp>
#include <android/test/IsolatedContext.hpp>
#include <android/test/mock/MockContentResolver.hpp>
#include <java/lang/Class.hpp>
#include <java/lang/String.hpp>

namespace j2cpp {

namespace android { namespace test {

	class ProviderTestCase;
	class ProviderTestCase
		: public object<ProviderTestCase>
	{
	public:

		J2CPP_DECLARE_CLASS

		J2CPP_DECLARE_METHOD(0)
		J2CPP_DECLARE_METHOD(1)
		J2CPP_DECLARE_METHOD(2)
		J2CPP_DECLARE_METHOD(3)
		J2CPP_DECLARE_METHOD(4)
		J2CPP_DECLARE_METHOD(5)

		explicit ProviderTestCase(jobject jobj)
		: object<ProviderTestCase>(jobj)
		{
		}

		operator local_ref<android::test::InstrumentationTestCase>() const;

		ProviderTestCase(local_ref< java::lang::Class > const&, local_ref< java::lang::String > const&);
		local_ref< android::content::ContentProvider > getProvider();
		local_ref< android::test::mock::MockContentResolver > getMockContentResolver();
		local_ref< android::test::IsolatedContext > getMockContext();
		static local_ref< android::content::ContentResolver > newResolverWithContentProviderFromSql(local_ref< android::content::Context >  const&, local_ref< java::lang::Class >  const&, local_ref< java::lang::String >  const&, local_ref< java::lang::String >  const&, jint, local_ref< java::lang::String >  const&);
	}; //class ProviderTestCase

} //namespace test
} //namespace android

} //namespace j2cpp

#endif //J2CPP_ANDROID_TEST_PROVIDERTESTCASE_HPP_DECL

#else //J2CPP_INCLUDE_IMPLEMENTATION

#ifndef J2CPP_ANDROID_TEST_PROVIDERTESTCASE_HPP_IMPL
#define J2CPP_ANDROID_TEST_PROVIDERTESTCASE_HPP_IMPL

namespace j2cpp {

android::test::ProviderTestCase::operator local_ref<android::test::InstrumentationTestCase>() const
{
	return local_ref<android::test::InstrumentationTestCase>(get_jobject());
}

android::test::ProviderTestCase::ProviderTestCase(local_ref< java::lang::Class > const &a0, local_ref< java::lang::String > const &a1)
: object<android::test::ProviderTestCase>(
	call_new_object<
		android::test::ProviderTestCase::J2CPP_CLASS_NAME,
		android::test::ProviderTestCase::J2CPP_METHOD_NAME(0),
		android::test::ProviderTestCase::J2CPP_METHOD_SIGNATURE(0)
	>(a0, a1)
)
{
}

local_ref< android::content::ContentProvider > android::test::ProviderTestCase::getProvider()
{
	return call_method<
		android::test::ProviderTestCase::J2CPP_CLASS_NAME,
		android::test::ProviderTestCase::J2CPP_METHOD_NAME(1),
		android::test::ProviderTestCase::J2CPP_METHOD_SIGNATURE(1),
		local_ref< android::content::ContentProvider >
	>(get_jobject());
}

local_ref< android::test::mock::MockContentResolver > android::test::ProviderTestCase::getMockContentResolver()
{
	return call_method<
		android::test::ProviderTestCase::J2CPP_CLASS_NAME,
		android::test::ProviderTestCase::J2CPP_METHOD_NAME(3),
		android::test::ProviderTestCase::J2CPP_METHOD_SIGNATURE(3),
		local_ref< android::test::mock::MockContentResolver >
	>(get_jobject());
}

local_ref< android::test::IsolatedContext > android::test::ProviderTestCase::getMockContext()
{
	return call_method<
		android::test::ProviderTestCase::J2CPP_CLASS_NAME,
		android::test::ProviderTestCase::J2CPP_METHOD_NAME(4),
		android::test::ProviderTestCase::J2CPP_METHOD_SIGNATURE(4),
		local_ref< android::test::IsolatedContext >
	>(get_jobject());
}

local_ref< android::content::ContentResolver > android::test::ProviderTestCase::newResolverWithContentProviderFromSql(local_ref< android::content::Context > const &a0, local_ref< java::lang::Class > const &a1, local_ref< java::lang::String > const &a2, local_ref< java::lang::String > const &a3, jint a4, local_ref< java::lang::String > const &a5)
{
	return call_static_method<
		android::test::ProviderTestCase::J2CPP_CLASS_NAME,
		android::test::ProviderTestCase::J2CPP_METHOD_NAME(5),
		android::test::ProviderTestCase::J2CPP_METHOD_SIGNATURE(5),
		local_ref< android::content::ContentResolver >
	>(a0, a1, a2, a3, a4, a5);
}

J2CPP_DEFINE_CLASS(android::test::ProviderTestCase,"android/test/ProviderTestCase")
J2CPP_DEFINE_METHOD(android::test::ProviderTestCase,0,"<init>","(Ljava/lang/Class;Ljava/lang/String;)V")
J2CPP_DEFINE_METHOD(android::test::ProviderTestCase,1,"getProvider","()Landroid/content/ContentProvider;")
J2CPP_DEFINE_METHOD(android::test::ProviderTestCase,2,"setUp","()V")
J2CPP_DEFINE_METHOD(android::test::ProviderTestCase,3,"getMockContentResolver","()Landroid/test/mock/MockContentResolver;")
J2CPP_DEFINE_METHOD(android::test::ProviderTestCase,4,"getMockContext","()Landroid/test/IsolatedContext;")
J2CPP_DEFINE_METHOD(android::test::ProviderTestCase,5,"newResolverWithContentProviderFromSql","(Landroid/content/Context;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)Landroid/content/ContentResolver;")

} //namespace j2cpp

#endif //J2CPP_ANDROID_TEST_PROVIDERTESTCASE_HPP_IMPL

#endif //J2CPP_INCLUDE_IMPLEMENTATION


text:
Man pages
=========

Documentation of the command line interface.

.. toctree::
   :maxdepth: 3

   segno


text:
package com.google.bitcoin.bouncycastle.asn1.pkcs;

import java.math.BigInteger;

import com.google.bitcoin.bouncycastle.asn1.ASN1Encodable;
import com.google.bitcoin.bouncycastle.asn1.ASN1EncodableVector;
import com.google.bitcoin.bouncycastle.asn1.ASN1OctetString;
import com.google.bitcoin.bouncycastle.asn1.ASN1Sequence;
import com.google.bitcoin.bouncycastle.asn1.DERInteger;
import com.google.bitcoin.bouncycastle.asn1.DERObject;
import com.google.bitcoin.bouncycastle.asn1.DEROctetString;
import com.google.bitcoin.bouncycastle.asn1.DERSequence;
import com.google.bitcoin.bouncycastle.asn1.x509.DigestInfo;

public class MacData
    extends ASN1Encodable
{
    private static final BigInteger ONE = BigInteger.valueOf(1);

    DigestInfo                  digInfo;
    byte[]                      salt;
    BigInteger                  iterationCount;

    public static MacData getInstance(
        Object  obj)
    {
        if (obj instanceof MacData)
        {
            return (MacData)obj;
        }
        else if (obj instanceof ASN1Sequence)
        {
            return new MacData((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory: " + obj.getClass().getName());
    }

    public MacData(
        ASN1Sequence seq)
    {
        this.digInfo = DigestInfo.getInstance(seq.getObjectAt(0));

        this.salt = ((ASN1OctetString)seq.getObjectAt(1)).getOctets();

        if (seq.size() == 3)
        {
            this.iterationCount = ((DERInteger)seq.getObjectAt(2)).getValue();
        }
        else
        {
            this.iterationCount = ONE;
        }
    }

    public MacData(
        DigestInfo  digInfo,
        byte[]      salt,
        int         iterationCount)
    {
        this.digInfo = digInfo;
        this.salt = salt;
        this.iterationCount = BigInteger.valueOf(iterationCount);
    }

    public DigestInfo getMac()
    {
        return digInfo;
    }

    public byte[] getSalt()
    {
        return salt;
    }

    public BigInteger getIterationCount()
    {
        return iterationCount;
    }

    /**
     * <pre>
     * MacData ::= SEQUENCE {
     *     mac      DigestInfo,
     *     macSalt  OCTET STRING,
     *     iterations INTEGER DEFAULT 1
     *     -- Note: The default is for historic reasons and its use is deprecated. A
     *     -- higher value, like 1024 is recommended.
     * </pre>
     * @return the basic DERObject construction.
     */
    public DERObject toASN1Object()
    {
        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(digInfo);
        v.add(new DEROctetString(salt));

        if (!iterationCount.equals(ONE))
        {
            v.add(new DERInteger(iterationCount));
        }

        return new DERSequence(v);
    }
}


text:
package uk.gov.nationalarchives.droid.core;

/**
 * @author Matt Palmer
 *
 */
public class SignatureParseException extends Exception {

    private static final long serialVersionUID = -6562570951231636750L;

    /**
     * Construct a SignatureParseException.
     * @param message The message for the exception.
     */
    public SignatureParseException(String message) {
        super(message);
    }

    /**
     * Construct a SignatureParseException.
     * @param message The message for the exception.
     * @param cause The cause of throwing this exception.
     */
    public SignatureParseException(String message, Throwable cause) {
        super(message, cause);
    }

    /**
     * Construct a SignatureParseException.
     * @param cause The cause of throwing this exception.
     */
    public SignatureParseException(Throwable cause) {
        super(cause);
    }
}


text:
import Typography from "typography";
import "typeface-yanone-kaffeesatz";

import { strongOrange } from "./colors";

const typography = new Typography({
  baseFontSize: "18px",
  baseLineHeight: 1.45,
  headerFontFamily: ["Yanone Kaffeesatz", "Helvetica", "sans-serif"],
  headerWeight: 400,
  bodyFontFamily: ["Palatino Linotype", "Book Antiqua", "Palatino", "serif"],
  overrideStyles: ({ adjustFontSizeTo, scale, rhythm }, options) => {
    const styles = {
      a: {
        color: strongOrange
      },
      body: {
        MozFontFeatureSettings: "normal",
        msFontFeatureSettings: "normal",
        WebkitFontFeatureSettings: "normal",
        fontFeatureSettings: "normal"
      }
    };
    return styles;
  }
});

// Hot reload typography in development.
if (process.env.NODE_ENV !== "production") {
  typography.injectStyles();
}
typography.headerFontFamily = '"Yanone Kaffeesatz", "Helvetica", sans-serif';
export default typography;


text:
<?php
/**
 * User API: WP_Role class
 *
 * @package WordPress
 * @subpackage Users
 * @since 4.4.0
 */

/**
 * Core class used to extend the user roles API.
 *
 * @since 2.0.0
 */
class WP_Role {
	/**
	 * Role name.
	 *
	 * @since 2.0.0
	 * @var string
	 */
	public $name;

	/**
	 * List of capabilities the role contains.
	 *
	 * @since 2.0.0
	 * @var array
	 */
	public $capabilities;

	/**
	 * Constructor - Set up object properties.
	 *
	 * The list of capabilities, must have the key as the name of the capability
	 * and the value a boolean of whether it is granted to the role.
	 *
	 * @since 2.0.0
	 *
	 * @param string $role         Role name.
	 * @param bool[] $capabilities List of capabilities keyed by the capability name,
	 *                             e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
	 */
	public function __construct( $role, $capabilities ) {
		$this->name         = $role;
		$this->capabilities = $capabilities;
	}

	/**
	 * Assign role a capability.
	 *
	 * @since 2.0.0
	 *
	 * @param string $cap Capability name.
	 * @param bool $grant Whether role has capability privilege.
	 */
	public function add_cap( $cap, $grant = true ) {
		$this->capabilities[ $cap ] = $grant;
		wp_roles()->add_cap( $this->name, $cap, $grant );
	}

	/**
	 * Removes a capability from a role.
	 *
	 * This is a container for WP_Roles::remove_cap() to remove the
	 * capability from the role. That is to say, that WP_Roles::remove_cap()
	 * implements the functionality, but it also makes sense to use this class,
	 * because you don't need to enter the role name.
	 *
	 * @since 2.0.0
	 *
	 * @param string $cap Capability name.
	 */
	public function remove_cap( $cap ) {
		unset( $this->capabilities[ $cap ] );
		wp_roles()->remove_cap( $this->name, $cap );
	}

	/**
	 * Determines whether the role has the given capability.
	 *
	 * The capabilities is passed through the {@see 'role_has_cap'} filter.
	 * The first parameter for the hook is the list of capabilities the class
	 * has assigned. The second parameter is the capability name to look for.
	 * The third and final parameter for the hook is the role name.
	 *
	 * @since 2.0.0
	 *
	 * @param string $cap Capability name.
	 * @return bool True if the role has the given capability. False otherwise.
	 */
	public function has_cap( $cap ) {
		/**
		 * Filters which capabilities a role has.
		 *
		 * @since 2.0.0
		 *
		 * @param bool[] $capabilities Associative array of capabilities for the role.
		 * @param string $cap          Capability name.
		 * @param string $name         Role name.
		 */
		$capabilities = apply_filters( 'role_has_cap', $this->capabilities, $cap, $this->name );

		if ( ! empty( $capabilities[ $cap ] ) ) {
			return $capabilities[ $cap ];
		} else {
			return false;
		}
	}

}


text:
/**
 * Adds custom behavior for left/right keyboard navigation for use with a tree.
 * Depends on the view having an expand and collapse method which accepts a
 * record. This selection model is created by default for {@link Ext.tree.Panel}.
 */
Ext.define('Ext.selection.TreeModel', {
    extend: 'Ext.selection.RowModel',
    alias: 'selection.treemodel',

    /**
     * @cfg {Boolean} pruneRemoved @hide
     */

    constructor: function(config) {
        this.callParent(arguments);

        // If pruneRemoved is required, we must listen to the *TreeStore* to know when nodes
        // are added and removed
        if (this.pruneRemoved) {
            this.pruneRemoved = false;
            this.pruneRemovedNodes = true;
        }
    },

    // binds the store to the selModel.
    bindStore: function(store, initial) {
        var me = this;
        me.callParent(arguments);

        // TreePanel should have injected a reference to the TreeStore so that we can
        // listen for node removal.
        if (me.pruneRemovedNodes) {
            me.view.mon(me.treeStore, {
                remove: me.onNodeRemove,
                scope: me
            });
        }
    },

    onNodeRemove: function(parent, node, isMove) {
        // deselection of deleted records done in base Model class
        if (!isMove) {
            this.deselectDeletedRecords([node]);
        }
    },

    onKeyRight: function(e, t) {
        this.navExpand(e, t);
    },

    navExpand: function(e, t) {
        var focused = this.getLastFocused(),
            view    = this.view;

        if (focused) {
            // tree node is already expanded, go down instead
            // this handles both the case where we navigate to firstChild and if
            // there are no children to the nextSibling
            if (focused.isExpanded()) {
                this.onKeyDown(e, t);
            // if its not a leaf node, expand it
            } else if (focused.isExpandable()) {
                // If we are the normal side of a locking pair, only the tree view can do expanding
                if (!view.isTreeView) {
                    view = view.lockingPartner;
                }

                view.expand(focused);
            }
        }
    },

    onKeyLeft: function(e, t) {
        this.navCollapse(e, t);
    },

    navCollapse: function(e, t) {
        var me = this,
            focused = this.getLastFocused(),
            view    = this.view,
            parentNode;

        if (focused) {
            parentNode = focused.parentNode;
            // if focused node is already expanded, collapse it
            if (focused.isExpanded()) {
                // If we are the normal side of a locking pair, only the tree view can do collapsing
                if (!view.isTreeView) {
                    view = view.lockingPartner;
                }

                view.collapse(focused);
            // has a parentNode and its not root
            // TODO: this needs to cover the case where the root isVisible
            } else if (parentNode && !parentNode.isRoot()) {
                // Select a range of records when doing multiple selection.
                if (e.shiftKey) {
                    me.selectRange(parentNode, focused, e.ctrlKey, 'up');
                    me.setLastFocused(parentNode);
                // just move focus, not selection
                } else if (e.ctrlKey) {
                    me.setLastFocused(parentNode);
                // select it
                } else {
                    me.select(parentNode);
                }
            }
        }
    },

    onKeySpace: function(e, t) {
        if (e.record.data.checked != null) {
            this.toggleCheck(e);
        } else {
            this.callParent(arguments);
        }
    },

    onKeyEnter: function(e, t) {
        if (e.record.data.checked != null) {
            this.toggleCheck(e);
        } else {
            this.callParent(arguments);
        }
    },

    toggleCheck: function(e) {
        var view = this.view,
            selected = this.getLastSelected();

        e.stopEvent();
        if (selected) {
            // If we are the normal side of a locking pair, only the tree view can do on heckChange
            if (!view.isTreeView) {
                view = view.lockingPartner;
            }

            view.onCheckChange(selected);
        }
    }
});


text:
@interface InputController : NSObject <UIAlertViewDelegate, UITextFieldDelegate>

- (UIAlertController *)alertControllerWithTitle:(NSString *)title maxCharacters:(int)max defaultString:(NSString *)def keyboard:(int)keyboard secure:(BOOL)secure;
- (NSString *)askString;
- (UIAlertView *)alertViewWithTitle:(NSString *)title maxCharacters:(int)max defaultString:(NSString *)def keyboard:(int)keyboard secure:(BOOL)secure;

@end


text:
=========================
NumPy 1.4.0 Release Notes
=========================

This minor includes numerous bug fixes, as well as a few new features. It
is backward compatible with 1.3.0 release.

Highlights
==========

* New datetime dtype support to deal with dates in arrays

* Faster import time

* Extended array wrapping mechanism for ufuncs

* New Neighborhood iterator (C-level only)

* C99-like complex functions in npymath

New features
============

Extended array wrapping mechanism for ufuncs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

An __array_prepare__ method has been added to ndarray to provide subclasses
greater flexibility to interact with ufuncs and ufunc-like functions. ndarray
already provided __array_wrap__, which allowed subclasses to set the array type
for the result and populate metadata on the way out of the ufunc (as seen in
the implementation of MaskedArray). For some applications it is necessary to
provide checks and populate metadata *on the way in*. __array_prepare__ is
therefore called just after the ufunc has initialized the output array but
before computing the results and populating it. This way, checks can be made
and errors raised before operations which may modify data in place.

Automatic detection of forward incompatibilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Previously, if an extension was built against a version N of NumPy, and used on
a system with NumPy M < N, the import_array was successfull, which could cause
crashes because the version M does not have a function in N. Starting from
NumPy 1.4.0, this will cause a failure in import_array, so the error will be
catched early on.

New iterators
~~~~~~~~~~~~~

A new neighborhood iterator has been added to the C API. It can be used to
iterate over the items in a neighborhood of an array, and can handle boundaries
conditions automatically. Zero and one padding are available, as well as
arbitrary constant value, mirror and circular padding.

New C API
~~~~~~~~~

The following C functions have been added to the C API:

    #. PyArray_GetNDArrayCFeatureVersion: return the *API* version of the
       loaded numpy.
    #. PyArray_Correlate2 - like PyArray_Correlate, but implements the usual
       definition of correlation. Inputs are not swapped, and conjugate is
       taken for complex arrays.
    #. PyArray_NeighborhoodIterNew - a new iterator to iterate over a
       neighborhood of a point, with automatic boundaries handling.

New ufuncs
~~~~~~~~~~

The following ufuncs have been added to the C API:

    #. copysign - return the value of the first argument with the sign copied
       from the second argument.
    #. nextafter - return the next representable floating point value of the
       first argument toward the second argument.

New defines
~~~~~~~~~~~

The alpha processor is now defined and available in numpy/npy_cpu.h. The
failed detection of the PARISC processor has been fixed. The defines are:

    #. NPY_CPU_HPPA: PARISC
    #. NPY_CPU_ALPHA: Alpha

Testing
~~~~~~~

    #. deprecated decorator: this decorator may be used to avoid cluttering
       testing output while testing DeprecationWarning is effectively raised by
       the decorated test.
    #. assert_array_almost_equal_nulps: new method to compare two arrays of
       floating point values. With this function, two values are considered
       close if there are not many representable floating point values in
       between, thus being more robust than assert_array_almost_equal when the
       values fluctuate a lot.
    #. assert_array_max_ulp: raise an assertion if there are more than N
       representable numbers between two floating point values.

Reusing npymath
~~~~~~~~~~~~~~~

In 1.3.0, we started putting portable C math routines in npymath library, so
that people can use those to write portable extensions. Unfortunately, it was
not possible to easily link against this library: in 1.4.0, support has been
added to numpy.distutils so that 3rd party can reuse this library. See coremath
documentation for more information.

Improved set operations
~~~~~~~~~~~~~~~~~~~~~~~

In previous versions of NumPy some set functions (intersect1d,
setxor1d, setdiff1d and setmember1d) could return incorrect results if
the input arrays contained duplicate items. These now work correctly
for input arrays with duplicates. setmember1d has been renamed to
in1d, as with the change to accept arrays with duplicates it is
no longer a set operation, and is conceptually similar to an
elementwise version of the Python operator 'in'.  All of these
functions now accept the boolean keyword assume_unique. This is False
by default, but can be set True if the input arrays are known not
to contain duplicates, which can increase the functions' execution
speed.

Improvements
============

    #. numpy import is noticeably faster (from 20 to 30 % depending on the
       platform and computer)

    #. The sort functions now sort nans to the end.

        * Real sort order is [R, nan]
        * Complex sort order is [R + Rj, R + nanj, nan + Rj, nan + nanj]

       Complex numbers with the same nan placements are sorted according to
       the non-nan part if it exists.
    #. The type comparison functions have been made consistent with the new
       sort order of nans. Searchsorted now works with sorted arrays
       containing nan values.
    #. Complex division has been made more resistent to overflow.
    #. Complex floor division has been made more resistent to overflow.

Deprecations
============

The following functions are deprecated:

    #. correlate: it takes a new keyword argument old_behavior. When True (the
       default), it returns the same result as before. When False, compute the
       conventional correlation, and take the conjugate for complex arrays. The
       old behavior will be removed in NumPy 1.5, and raises a
       DeprecationWarning in 1.4.

    #. unique1d: use unique instead. unique1d raises a deprecation
       warning in 1.4, and will be removed in 1.5.

    #. intersect1d_nu: use intersect1d instead. intersect1d_nu raises
       a deprecation warning in 1.4, and will be removed in 1.5.

    #. setmember1d: use in1d instead. setmember1d raises a deprecation
       warning in 1.4, and will be removed in 1.5.

The following raise errors:

    #. When operating on 0-d arrays, ``numpy.max`` and other functions accept
       only ``axis=0``, ``axis=-1`` and ``axis=None``. Using an out-of-bounds
       axes is an indication of a bug, so Numpy raises an error for these cases
       now.

    #. Specifying ``axis > MAX_DIMS`` is no longer allowed; Numpy raises now an
       error instead of behaving similarly as for ``axis=None``.

Internal changes
================

Use C99 complex functions when available
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The numpy complex types are now guaranteed to be ABI compatible with C99
complex type, if availble on the platform. Moreoever, the complex ufunc now use
the platform C99 functions intead of our own.

split multiarray and umath source code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The source code of multiarray and umath has been split into separate logic
compilation units. This should make the source code more amenable for
newcomers.

Separate compilation
~~~~~~~~~~~~~~~~~~~~

By default, every file of multiarray (and umath) is merged into one for
compilation as was the case before, but if NPY_SEPARATE_COMPILATION env
variable is set to a non-negative value, experimental individual compilation of
each file is enabled. This makes the compile/debug cycle much faster when
working on core numpy.

Separate core math library
~~~~~~~~~~~~~~~~~~~~~~~~~~

New functions which have been added:

	* npy_copysign
        * npy_nextafter
        * npy_cpack
        * npy_creal
        * npy_cimag
        * npy_cabs
        * npy_cexp
        * npy_clog
        * npy_cpow
        * npy_csqr
        * npy_ccos
        * npy_csin


text:
package br.com.correios.webservice.calculador;

import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;

/**
 *
Classe Java de cResultado complex type.
 *

 *
O seguinte fragmento do esquema especifica o conteúdo esperado contido dentro desta classe.
 *

 *

 * <complexType name="cResultado">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Servicos" type="{http://tempuri.org/}ArrayOfCServico" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "cResultado", propOrder = {
        "servicos"
})
public class CResultado {

    @XmlElement(name = "Servicos")
    protected ArrayOfCServico servicos;

    /**
     * Obtém o valor da propriedade servicos.
     *
     * @return possible object is
     * {@link ArrayOfCServico }
     */
    public ArrayOfCServico getServicos() {
        return servicos;
    }

    /**
     * Define o valor da propriedade servicos.
     *
     * @param value allowed object is
     *              {@link ArrayOfCServico }
     */
    public void setServicos(ArrayOfCServico value) {
        this.servicos = value;
    }

}


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit5995dfa4d7db52cc14b5c933664d2f22::getLoader();


text:
package org.mifos.accounts.savings.interest;

import org.joda.time.LocalDate;

public class CalendarPeriod {

    private final LocalDate startDate;
    private final LocalDate endDate;

    public CalendarPeriod(LocalDate startDate, LocalDate endDate) {
        this.startDate = startDate;
        this.endDate = endDate;
        if (startDate.isAfter(endDate)) {
            throw new IllegalArgumentException("startDate cannot be after endDate of period. startDate:" + startDate + " endDate:" + endDate);
        }
    }

    /**
     * checks that date occurs within the {@link CalendarPeriod} with startDate and endDate inclusive.
     */
    public boolean contains(LocalDate date) {
        return (date.isEqual(this.startDate) || date.isAfter(this.startDate)) && (date.isEqual(this.endDate) || date.isBefore(endDate));
    }

    public LocalDate getStartDate() {
        return this.startDate;
    }

    public LocalDate getEndDate() {
        return this.endDate;
    }

    @Override
    public String toString() {
        return new StringBuilder().append('[').append(this.startDate).append(" - ")
                .append(this.endDate).append(']').toString();
    }
}


text:
/*
stereoscope.js

Adam Schuster, 2015, askatom.net

A tool to display vintage stereoviews on modern platforms

The original stereoviews are loaded as JPS files and drawn on offscreen canvases.
Canvas data is then Barrel Distorted to compensate for a VR viewer
(specifially DODOcase / google cardboard and iPhone 6)
Left and Right canvases are then drawn on a main stereovew canvas
*/

// Initilize size variables
var wW = window.innerWidth;
var wH = window.innerHeight;
var cW = Math.round(wW * 0.5);
var cH = Math.round(0.88 * wH);
var canvasAspectRatio = cH / cW;
var imageAspectRatio = Number();
var cW2 = Number();
var cH2 = Number();
var offsetX = Number();

// Initialize canvases
var cL = document.createElement('canvas');
var cR = document.createElement('canvas');
var sV = document.getElementById('stereoview');

// Initialize canvas contexts
var cxL = cL.getContext('2d');
var cxR = cR.getContext('2d');
var cxV = sV.getContext('2d');

// Initialize R & L card origin points
var leftCardOriginX = 0;
var leftCardOriginY = 0;
var rightCardOriginX = cW;
var rightCardOriginY = 0;

// Get text objects from DOM
var backgroundText = document.getElementById('pageInfo');
var textLeft = document.getElementById('textLeft');
var textRight = document.getElementById('textRight');
var capStageBox = document.getElementById('captionBox');

// Declare additional variables
var curimg = 0;
var card = new Image();
var click;
var caption = "";
var iW;
var iH;
var leftData;
var rightData;

// Calculate view screen dimensions

function getWindowSize() {
    "use strict";
    wW = window.innerWidth;
    wH = window.innerHeight;
}

// Initialize canvas elements
cL.setAttribute('width', cW);
cL.setAttribute('height', cH);

cR.setAttribute('width', cW);
cR.setAttribute('height', cH);

// Set main stereoview canvas size
function setSVSize() {
    "use strict";
    sV.setAttribute('width', wW);
    sV.setAttribute('height', cH);
}
setSVSize();

// Set canvas sizes

function setCanvasSizes() {
    "use strict";

    cW = Math.round(wW * 0.5);
    cH = Math.round(0.88 * wH);

    sV.setAttribute('width', wW);
    sV.setAttribute('height', cH);
}

function onDocumentMouseDown(event) {
    "use strict";
    event.preventDefault();

    setCanvasSizes();

    showCap();
    blankCanvas();
    shutterSound();
    loadImage();

    curimg = (curimg < galleryarray.length - 1) ? curimg + 1 : 0;
}

card.onload = function() {
    "use strict";
    drawCanvas();
};

function shutterSound() {
    "use strict";
    click = document.getElementById("click");
    click.pause();
    click.currentTime = 0;
    click.play();
}

// Draw stereo content to canvases

function drawCanvas() {
    "use strict";

    getImageSize();

    if (card.height === 0) {

        cxV.clearRect(0, 0, wW, wH);
        sV.setAttribute('class', 'hiddenCanvas');

    } else {

        // newWidth = Math.round(cH * iW / iH);
        // diff = Math.abs(Math.round((cW - newWidth) / 4));
        //
        // cxL.clearRect(0, 0, newWidth, cH);
        // cxR.clearRect(0, 0, newWidth, cH);

        cxL.drawImage(card, 0, 0, iW, iH, 0, 0, cL.width, cL.height);
        cxR.drawImage(card, iW, 0, iW, iH, 0, 0, cR.width, cR.height);

        leftData = cxL.getImageData(0, 0, cL.width, cL.height);
        rightData = cxR.getImageData(0, 0, cR.width, cR.height);

        leftData = barrelDistortion(leftData);
        rightData = barrelDistortion(rightData);

        cxL.putImageData(leftData, 0, 0);
        cxR.putImageData(rightData, 0, 0);

        leftCardOriginX = offsetX;
        rightCardOriginX = cW + offsetX;

        cxV.drawImage(cL, leftCardOriginX, 0);
        cxV.drawImage(cR, rightCardOriginX, 0);

        sV.setAttribute('class', 'visibleCanvas');
    }

    /* debug
        console.log("diff " + diff);
        console.log("lx " + leftCardOriginX);
        console.log("rx " + rightCardOriginX);
        console.log("device pixel rato " + dpr);
        console.log("card height " + cH);
        console.log("card width " + cW);
        console.log("window width " + wW);
        console.log("image full width " + card.width);
        console.log("image half width " + iW);
        console.log("image height " + iH);
        console.log("image ratio " + ratioWH);
        console.log("new width " + newWidth);
    */
}

// Get size of image

function getImageSize() {
    "use strict";

    cxL.clearRect(0,0, cL.width, cL.height);
    cxR.clearRect(0,0, cR.width, cR.height);

    if (card.height === 0) {
        iW = 1;
        iH = 1;

    } else {

        iW = Math.round(card.width * 0.5);
        iH = card.height;
        imageAspectRatio = iH / iW;
        cH2 = Math.round(cW * imageAspectRatio);
        cW2 = Math.round(cH / imageAspectRatio);

        if (imageAspectRatio > canvasAspectRatio) {
            cL.setAttribute('height', cH);
            cL.setAttribute('width', cW2);
            cR.setAttribute('height', cH);
            cR.setAttribute('width', cW2);
            offsetX = Math.round((cW - cW2)/2);
            cxL = cL.getContext('2d');
            cxR = cR.getContext('2d');

        } else {
            cL.setAttribute('height', cH2);
            cL.setAttribute('width', cW);
            cR.setAttribute('height', cH2);
            cR.setAttribute('width', cW);
            offsetX = 0;
            cxL = cL.getContext('2d');
            cxR = cR.getContext('2d');
        }

        leftData = cxL.createImageData(iW, iH);
        rightData = cxR.createImageData(iW, iH);
    }

}

// Blank canvas

function blankCanvas() {
    "use strict";
    cxV.clearRect(0, 0, wW, wH);
    sV.setAttribute('class', 'hiddenCanvas');
    backgroundText.setAttribute('class', 'hiddenCanvas');
}

// reveal rendered stereo views

function loadImage() {
    "use strict";
    card.src = "cards/" + galleryarray[curimg];
}

// Show captions

function showCap() {
    "use strict";
    caption = textarray[curimg];
    textLeft.innerHTML = caption;
    textRight.innerHTML = caption;
}

document.addEventListener('mousedown', onDocumentMouseDown, false);
document.addEventListener('touchstart', onDocumentMouseDown, false);

// Handle window resizes

function onWindowResize() {
    "use strict";
    getWindowSize();
    setSVSize();
    setCanvasSizes();
    drawCanvas();
}

window.addEventListener('resize', onWindowResize, false);


text:
var dynamo = require(__dirname+'/aws.js'),
    jwt = require('jsonwebtoken'),
    getIp = require('ipware')().get_ip,
    md5 = require('md5'),
    JWTsecret = require(__dirname+'/JWTsecret.js'),
    _ = require('lodash');

//if we want RS256. Async also works on this apparently
//Needs good certs
/*var fs = require('fs');
var cert = fs.readFileSync('key.pem');
methods.sign = function () {
    return jwt.sign(credentials, cert, { algorithm: 'RS256'});
}*/

var methods = {};
//Success/fail methods

methods.authFail = function (res, message, callback) {
  //Log. Schema {error:message, ip:}
  if (typeof message === 'undefined') {
    message = "Error, cannot auth."
  }
  res.end(JSON.stringify({error:message}));
  //if needed
  if (typeof callback === "function")
    return callback(res);
}
methods.success = function (res, token, message) {
//send back token as per spec
  res.send(JSON.stringify({token:token}));
  //Juuuust incase I want later
  if (typeof callback === "function")
    return callback(res);
}
//generate token
methods.getToken = function generateAndStoreToken(req, opts) {
  var UID = getUID();
  var token = generateToken(req, UID, opts);
  var record = {
    "valid": true,
    "created": new Date().getTime(),
    "ip": getIp(req)
  };
  //Deposit UID
  dynamo.putUID({
    uid: UID,
    log: JSON.stringify(record)
  }, function (err) {
  });
  return token;
}

methods.validate = function validate(req, res, callback) {
  var token = req.headers.authorization;
  //verify token
  verify(token, function (decoded) {

    if (!decoded || !decoded.auth) {
      methods.authFail(res, 'Could not decode token.')
      return callback(false);
    } else {

      dynamo.getUID(decoded.auth, function (err, record) {
        if (record.length == 0 || decoded.exp < (Date.now() / 1000)) {
          return callback(false);
        } else {
          methods.success(res, token, 'Speak friend, and enter. <br> FRIEND!');
          return callback(true);
        }
      });//db get
    }//else
  });//Verify
}//Validate

module.exports = methods;

//Background Cast
function verify(token, cb) {
  var decoded = false;
  //Verify attempt
  try {
    decoded = jwt.verify(token, JWTsecret);
  } catch (e) {
    decoded = false; // still false
  }
  //Check if callback for Async
  if (typeof cb === 'function') {
    return cb(decoded);
  }
  else {
    return decoded;
  }
}

function getUID() {
  return _.shuffle(md5(new Date().getTime()));
}
function generateToken(req, UID, opts) {
  opts = opts || {};
  // expire the token after 7 days.
  var expiresDefault = Math.floor(new Date().getTime() / 1000) + 7 * 24 * 60 * 60;

  var token = jwt.sign({
    auth: UID,
    agent: req.headers['user-agent'],
    exp: opts.expires || expiresDefault
  }, JWTsecret);
  return token;
}


text:
<?php namespace Rikki\Heroeslounge\Updates;

use Schema;
use October\Rain\Database\Updates\Migration;

class BuilderTableUpdateRikkiHeroesloungeMatchCaster extends Migration
{
    public function up()
    {
        Schema::table('rikki_heroeslounge_match_caster', function($table)
        {
            $table->smallInteger('approved')->nullable(false)->unsigned()->default(0)->change();
        });
    }

    public function down()
    {
        Schema::table('rikki_heroeslounge_match_caster', function($table)
        {
            $table->boolean('approved')->nullable(false)->unsigned(false)->default(0)->change();
        });
    }
}


text:
namespace lml
{
  //|---------------------- Line --------------------------------------------
  //|------------------------------------------------------------------------

  class Line
  {
    public:
      Line() = default;
      constexpr Line(Vec3 const &a, Vec3 const &b);

      Vec3 a;
      Vec3 b;
  };

  ///////////////////////// Line::Constructor ///////////////////////////////
  constexpr Line::Line(Vec3 const &a, Vec3 const &b)
    : a(a),
      b(b)
  {
  }

  //////////////////////// Line operator == /////////////////////////////////
  inline bool operator ==(Line const &lhs, Line const &rhs)
  {
    return (lhs.a == rhs.a) && (lhs.b == rhs.b);
  }

  //////////////////////// Line operator != /////////////////////////////////
  inline bool operator !=(Line const &lhs, Line const &rhs)
  {
    return !(lhs == rhs);
  }

  //////////////////////// Line stream << /////////////////////////////////
  inline std::ostream &operator <<(std::ostream &os, Line const &line)
  {
    os << "[Line:" << line.a << "," << line.b << "]";

    return os;
  }

  //////////////////////// distsqr //////////////////////////////////////////
  /// distance between line and point squared
  inline float distsqr(Line const &line, Vec3 const &pt)
  {
    return normsqr(cross(pt - line.a, pt - line.b)) / normsqr(line.b - line.a);
  }

  //////////////////////// dist /////////////////////////////////////////////
  /// distance between line and point
  inline float dist(Line const &line, Vec3 const &pt)
  {
    return std::sqrt(distsqr(line, pt));
  }

  //////////////////////// nearest_on_line //////////////////////////////////
  /// nearest point on line
  inline Vec3 nearest_on_line(Line const &line, Vec3 const &pt)
  {
    return nearest_on_line(line.a, line.b, pt);
  }

  //////////////////////// nearest_on_segment ///////////////////////////////
  /// nearest point on line segment
  inline Vec3 nearest_on_segment(Line const &line, Vec3 const &pt)
  {
    return nearest_on_segment(line.a, line.b, pt);
  }

  //////////////////////// transform ////////////////////////////////////////
  /// transform line
  inline Line operator *(Transform const &transform, Line const &line)
  {
    return Line(transform * line.a, transform * line.b);
  }
}


text:
package com.alibaba.jstorm.daemon.nimbus.metric.uploader;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

public class TopologyMetricDataInfo implements Serializable {
    private static final long serialVersionUID = 1303262512351757610L;

    public String topologyId;
    public String type;      // "tp" for tp/comp metrics OR "task" for task/stream/worker/netty metrics
    public long   timestamp; // metrics report time

    public Map<String, Object> toMap() {
        Map<String, Object> ret = new HashMap<String, Object>();
        ret.put(MetricUploader.METRIC_TIME, timestamp);
        ret.put(MetricUploader.METRIC_TYPE, type);

        return ret;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
}