text:
[![Latest Stable Version](https://poser.pugx.org/synergy/scout-elasticsearch-driver/v/stable)](https://packagist.org/packages/synergy/scout-elasticsearch-driver)
[![Total Downloads](https://poser.pugx.org/synergy/scout-elasticsearch-driver/downloads)](https://packagist.org/packages/synergy/scout-elasticsearch-driver)
[![composer.lock](https://poser.pugx.org/synergy/scout-elasticsearch-driver/composerlock)](https://packagist.org/packages/synergy/scout-elasticsearch-driver)
[![Build Status](https://travis-ci.org/odiaseo/scout-elasticsearch-driver.svg?branch=master)](https://travis-ci.org/odiaseo/scout-elasticsearch-driver)
[![Coverage Status](https://coveralls.io/repos/github/odiaseo/scout-elasticsearch-driver/badge.svg?branch=master)](https://coveralls.io/github/odiaseo/scout-elasticsearch-driver?branch=master)

This package offers advanced functionality for searching and filtering data in Elasticsearch.
Check out its [features](#features)!

## Contents

* [Tutorial](#tutorial)
* [Features](#features)
* [Requirements](#requirements)
* [Installation](#installation)
* [Configuration](#configuration)
* [Index configurator](#index-configurator)
* [Searchable model](#searchable-model)
* [Usage](#usage)
* [Console commands](#console-commands)
* [Search rules](#search-rules)
* [Available filters](#available-filters)
* [Debug](#debug)

## Features

* An easy way to [configure](#index-configurator) and [create](#console-commands) an Elasticsearch index.
* A fully configurable mapping for each [model](#searchable-model).
* A possibility to add a new field to an existing mapping [automatically](#configuration) or using [the artisan command](#console-commands).
* Lots of different ways to implement your search algorithm: using [search rules](#search-rules) or a [raw search](#usage).
* [Various filter types](#available-filters) to make a search query more specific.

## Requirements

The package has been tested in the following configuration:

* PHP version >= 7.0
* Laravel Framework version >= 5.5
* Elasticsearch version >= 5.5

## Installation

Use composer to install the package:

```
composer require synergy/scout-elasticsearch-driver
```

## Configuration

To configure the package you need to publish settings first:

```
php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
php artisan vendor:publish --provider="SynergyScoutElastic\providers\SynergyScoutElasticServiceProvider"
```

Then, set the driver setting to `elastic` in the `config/scout.php` file and configure the driver itself in the `config/synergy-scout-elastic.php` file.
There are two available options:

Option | Description
--- | ---
client | A setting hash to build Elasticsearch client. More information you can find [here](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_configuration.html#_building_the_client_from_a_configuration_hash). By default the host is set to `localhost:9200`.
update_mapping | The option that specifies whether to update a mapping automatically or not. By default it is set to `true`.

## Index configurator

An index configurator class is used to set up settings for an Elasticsearch index.
To create a new index configurator use the following artisan command:

```
php artisan make:index-configurator MyIndexConfigurator
```

It'll create the file `MyIndexConfigurator.php` in the `app` folder of your project.
You can specify index name, settings and default mapping like in the following example:

```php
<?php

namespace App;

use SynergyScoutElastic\IndexConfigurator;

class MyIndexConfigurator extends IndexConfigurator
{
    // It's not obligatory to determine name. By default it'll be a snaked class name without `IndexConfigurator` part.
    protected $name = 'my_index';

    // You can specify any settings you want, for example, analyzers.
    protected $settings = [
        'analysis' => [
            'analyzer' => [
                'es_std' => [
                    'type' => 'standard',
                    'stopwords' => '_spanish_'
                ]
            ]
        ]
    ];

    // Common mapping for all types.
    protected $defaultMapping = [
        '_all' => [
            'enabled' => true
        ],
        'dynamic_templates' => [
            [
                'es' => [
                    'match' => '*_es',
                    'match_mapping_type' => 'string',
                    'mapping' => [
                        'type' => 'string',
                        'analyzer' => 'es_std'
                    ]
                ]
            ]
        ]
    ];
}
```

More about index settings and default mapping you can find in the [index management section](https://www.elastic.co/guide/en/elasticsearch/guide/current/index-management.html) of Elasticsearch documentation.

To create an index just run the artisan command:

```
php artisan elastic:create-index App\\MyIndexConfigurator
```

## Searchable model

To create a model with the ability to perform search requests in an Elasticsearch index use the command:

```
php artisan make:searchable-model MyModel --index-configurator=MyIndexConfigurator
```

After executing the command you'll find the file `MyModel.php` in you `app` folder:

```php
<?php

namespace App;

use SynergyScoutElastic\Models\Searchable;
use Illuminate\Database\Eloquent\Model;
use SynergyScoutElastic\Models\SearchableInterface;

class MyModel extends Model implements SearchableInterface
{
    use Searchable;

    protected $indexConfigurator = MyIndexConfigurator::class;

    protected $searchRules = [
        //
    ];

    // Here you can specify a mapping for a model fields.
    protected $mapping = [
        'properties' => [
            'text' => [
                'type' => 'string',
                'fields' => [
                    'raw' => [
                        'type' => 'string',
                        'index' => 'not_analyzed',
                    ]
                ]
            ],
        ]
    ];
}
```

Each searchable model represents an Elasticsearch type.
By default a type name is the same as a table name, but you can set any type name you want through the `searchableAs` method.
You can also specify fields which will be indexed by the driver through the `toSearchableArray` method.
More information about these options you will find in [the scout official documentation](https://laravel.com/docs/5.4/scout#configuration).

The last important option you can set in the `MyModel` class is the `$searchRules` property.
It allows you to set different search algorithms for a model.
We'll take a closer look at it in [the search rules section](#search-rules).

After setting up a mapping in your model you can update an Elasticsearch type mapping:

```
php artisan elastic:update-mapping App\\MyModel
```

## Usage

Once you've created an index configurator, an Elasticsearch index itself and a searchable model, you are ready to go.
Now you can [index](https://laravel.com/docs/5.4/scout#indexing) and [search](https://laravel.com/docs/5.4/scout#searching) data according to the documentation.

In addition to standard functionality the package offers you the possibility to filter data in Elasticsearch without specifying query string:

```php
App\MyModel::search('*')
    ->where('id', 1)
    ->get();
```

Also you can override model [search rules](#search-rules):

```php
App\MyModel::search('Brazil')
    ->rule(App\MySearchRule::class)
    ->get();
```

And use [variety](#available-filters) of `where` conditions:

```php
App\MyModel::search('*')
    ->whereRegexp('name.raw', 'A.+')
    ->where('age', '>=', 30)
    ->whereExists('unemployed')
    ->get();
```

At last, if you want to send a custom request, you can use the `searchRaw` method:

```php
App\MyModel::searchRaw([
    'query' => [
        'bool' => [
            'must' => [
                'match' => [
                    '_all' => 'Brazil'
                ]
            ]
        ]
    ]
]);
```

This query will return raw response.

## Console commands

Available artisan commands are listed below:

Command | Arguments | Description
--- | --- | ---
make:index-configurator | `name` - The name of the class | Creates a new Elasticsearch index configurator.
make:searchable-model | `name` - The name of the class | Creates a new searchable model.
make:search-rule | `name` - The name of the class | Creates a new search rule.
elastic:create-index | `index-configurator` - The index configurator class | Creates an Elasticsearch index.
elastic:update-index | `index-configurator` - The index configurator class | Updates settings and mappings of an Elasticsearch index.
elastic:drop-index | `index-configurator` - The index configurator class | Drops an Elasticsearch index.
elastic:update-mapping | `model` - The model class | Updates a model mapping.

For detailed description and all available options run `php artisan help [command]` in the command line.

## Search rules

A search rule is a class that describes how a search query will be executed.
To create a search rule use the command:

```
php artisan make:search-rule MySearchRule
```

In the file `app/MySearchRule.php` you will find a class definition:

```php
<?php

namespace App;

use SynergyScoutElastic\SearchRule;

class MySearch extends SearchRule
{
    // This method returns an array that represents a content of bool query.
    public function buildQueryPayload()
    {
        return [
            'must' => [
                'match' => [
                    'name' => $this->builder->query
                ]
            ]
        ];
    }
}
```

You can read more about bool queries [here](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-bool-query.html).

The default search rule returns the following payload:

```php
return [
   'must' => [
       'match' => [
           '_all' => $this->builder->query
       ]
   ]
];
```

This means that by default when you call `search` method on a model it tries to find the query string in any field.

To determine default search rules for a model just add a property:

```php
<?php

namespace App;

use SynergyScoutElastic\Models\Searchable;
use Illuminate\Database\Eloquent\Model;
use SynergyScoutElastic\Models\SearchableInterface;

class MyModel extends Model implements SearchableInterface
{
    use Searchable;

    // You can set several rules for one model. In this case, the first not empty result will be returned.
    protected $searchRules = [
        MySearchRule::class
    ];
}
```

You can also set a search rule in a query builder:

```php
// You can set either a SearchRule class
App\MyModel::search('Brazil')
    ->rule(App\MySearchRule::class)
    ->get();

// or a callable
App\MyModel::search('Brazil')
    ->rule(function($builder) {
        return [
            'must' => [
                'match' => [
                    'Country' => $builder->query
                ]
            ]
        ];
    })
    ->get();
```

## Available filters

You can use different types of filters:

Method | Example | Description
--- | --- | ---
where($field, $value) | where('id', 1) | Checks equality to a simple value.
where($field, $operator, $value) | where('id', '>=', 1) | Filters records according to a given rule. Available operators are: =, <, >, <=, >=, <>.
whereIn($field, $value) | where('id', [1, 2, 3]) | Checks if a value is in a set of values.
whereNotIn($field, $value) | whereNotIn('id', [1, 2, 3]) | Checks if a value isn't in a set of values.
whereBetween($field, $value) | whereBetween('price', [100, 200]) | Checks if a value is in a range.
whereNotBetween($field, $value) | whereNotBetween('price', [100, 200]) | Checks if a value isn't in a range.
whereExists($field) | whereExists('unemployed') | Checks if a value is defined.
whereNotExists($field) | whereNotExists('unemployed') | Checks if a value isn't defined.
whereRegexp($field, $value, $flags = 'ALL') | whereRegexp('name.raw', 'A.+') | Filters records according to a given regular expression. [Here](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-regexp-query.html#regexp-syntax) you can find more about syntax.

In most cases it's better to use raw fields to filter records, i.e. not analyzed fields.

## Debug

There are two methods that can help you to analyze results of a search query:

* [explain](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html)

    ```php
    App\MyModel::search('Brazil')
        ->first()
        ->explain();
    ```

* [profile](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-profile.html)

    ```php
    App\MyModel::search('Brazil')
        ->first()
        ->profile();
    ```

Both methods return raw data from ES.

Besides, you can get a query payload that will be sent to ES, by calling the `buildPayload` method.

```php
App\MyModel::search('Brazil')
    ->buildPayload();
```

Note, that this method returns a collection of payloads, because of possibility of using multiple search rules in one query.


text:
<?xml version="1.0" encoding="utf-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd">
<record type="Bibliographic">
<leader>     cam a2200229Ia 4500</leader>
<controlfield tag="001">DUKE000527715</controlfield>
<controlfield tag="005">19860813112904.0</controlfield>
<controlfield tag="008">830210s1982^^^^xx^^^^^^^b^^^^000^0^eng^d</controlfield>
<datafield tag="035" ind1=" " ind2=" ">
 <subfield code="a">09209891</subfield>
</datafield>
<datafield tag="040" ind1=" " ind2=" ">
 <subfield code="a">NDD</subfield>
 <subfield code="c">NDD</subfield>
</datafield>
<datafield tag="100" ind1="1" ind2=" ">
 <subfield code="a">Hoff, Jean Louise.</subfield>
</datafield>
<datafield tag="245" ind1="1" ind2="4">
 <subfield code="a">The petrography of the Blowing Rock gneiss, Grandfather Mountain window, North Carolina /</subfield>
 <subfield code="c">by Jean Louise Hoff.</subfield>
</datafield>
<datafield tag="260" ind1=" " ind2=" ">
 <subfield code="c">1982.</subfield>
</datafield>
<datafield tag="300" ind1=" " ind2=" ">
 <subfield code="a">ix, 196 leaves ;</subfield>
 <subfield code="c">29 cm.</subfield>
</datafield>
<datafield tag="500" ind1=" " ind2=" ">
 <subfield code="a">Typescript.</subfield>
</datafield>
<datafield tag="502" ind1=" " ind2=" ">
 <subfield code="a">Thesis (M.S.)--Duke University, 1982.</subfield>
</datafield>
<datafield tag="504" ind1=" " ind2=" ">
 <subfield code="a">Bibliography: leaves 161-168.</subfield>
</datafield>
<datafield tag="650" ind1=" " ind2="0">
 <subfield code="a">Gneiss</subfield>
 <subfield code="z">North Carolina</subfield>
 <subfield code="z">Grandfather Mountain.</subfield>
</datafield>
<datafield tag="650" ind1=" " ind2="0">
 <subfield code="a">Gneiss</subfield>
 <subfield code="z">North Carolina</subfield>
 <subfield code="z">Blowing Rock Region.</subfield>
</datafield>
<datafield tag="650" ind1=" " ind2="0">
 <subfield code="a">Petrology</subfield>
 <subfield code="z">North Carolina</subfield>
 <subfield code="z">Grandfather Mountain.</subfield>
</datafield>
<datafield tag="650" ind1=" " ind2="0">
 <subfield code="a">Petrology</subfield>
 <subfield code="z">North Carolina</subfield>
 <subfield code="z">Blowing Rock Region.</subfield>
</datafield>
<datafield tag="710" ind1="2" ind2=" ">
 <subfield code="a">Duke University.</subfield>
 <subfield code="b">Department of Geology.</subfield>
</datafield>
<datafield tag="942" ind1=" " ind2=" ">
 <subfield code="a">DT</subfield>
 <subfield code="b">Duke Theses</subfield>
</datafield>
<datafield tag="942" ind1=" " ind2=" ">
 <subfield code="a">AM</subfield>
 <subfield code="b">Book</subfield>
</datafield>
<datafield tag="852" ind1="8" ind2=" ">
 <subfield code="b">LSC</subfield>
 <subfield code="c">PSK</subfield>
 <subfield code="h">M.S.</subfield>
 <subfield code="i">H698P</subfield>
 <subfield code="i">1982</subfield>
 <subfield code="D">x</subfield>
</datafield>
<datafield tag="852" ind1="8" ind2=" ">
 <subfield code="b">ARCH</subfield>
 <subfield code="c">PSAT</subfield>
 <subfield code="h">M.S.</subfield>
 <subfield code="i">H698P</subfield>
 <subfield code="i">1982</subfield>
 <subfield code="D">x</subfield>
</datafield>
<datafield tag="940" ind1=" " ind2=" ">
 <subfield code="b">ARCH</subfield>
 <subfield code="c">PSAT</subfield>
 <subfield code="d">8</subfield>
 <subfield code="h">M.S. H698P 1982</subfield>
 <subfield code="n">c.1</subfield>
 <subfield code="o">08</subfield>
 <subfield code="q">DP</subfield>
 <subfield code="r">BOOK</subfield>
 <subfield code="p">D02123526L </subfield>
 <subfield code="s">20010613</subfield>
 <subfield code="u">20070820</subfield>
 <subfield code="v">20011214</subfield>
 <subfield code="w">0</subfield>
 <subfield code="k">000527715</subfield>
</datafield>
<datafield tag="940" ind1=" " ind2=" ">
 <subfield code="b">LSC</subfield>
 <subfield code="c">PSK</subfield>
 <subfield code="d">8</subfield>
 <subfield code="h">M.S. H698P 1982</subfield>
 <subfield code="n">c.1</subfield>
 <subfield code="o">01</subfield>
 <subfield code="q">DP</subfield>
 <subfield code="r">BOOK</subfield>
 <subfield code="p">D01479950Z </subfield>
 <subfield code="s">19930808</subfield>
 <subfield code="u">20070211</subfield>
 <subfield code="v">20180818</subfield>
 <subfield code="w">7</subfield>
 <subfield code="k">000527715</subfield>
</datafield>
</record>
</collection>

redpajama_set_name: RedPajamaGithub


text:
using OctoAwesome.Client.Components;
using OctoAwesome.Runtime;
using System;
using engenious.UI;
using EventArgs = System.EventArgs;
using engenious;
using engenious.Input;
using System.Collections.Generic;
using System.Diagnostics;
using OctoAwesome.Notifications;
using OctoAwesome.Common;
using OctoAwesome.Definitions;
using OctoAwesome.Client.UI.Components;
using OctoAwesome.UI.Components;
using OctoAwesome.Extension;
using OctoAwesome.Crafting;
using engenious.Graphics;
using OctoAwesome.Client.Controls;

namespace OctoAwesome.Client
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    internal class OctoGame : Game
    {
        public const int DefaultResolutionWidth = 1680;
        public const int DefaultResolutionHeight = 1050;

        public const int DefaultViewRange = 4;

        private readonly ITypeContainer typeContainer;

        //GraphicsDeviceManager graphics;

        public CameraComponent Camera { get; }

        public PlayerComponent Player { get; }

        public SimulationComponent Simulation { get; }

        public GameService Service { get; }

        public ScreenComponent Screen { get; }

        public KeyMapper KeyMapper { get; }

        public AssetComponent Assets { get; }

        public Settings Settings { get; }

        public IDefinitionManager DefinitionManager { get; }

        public IResourceManager ResourceManager { get; }

        public ExtensionService ExtensionService { get; private set; }

        public EntityGameComponent Entity { get; private set; }
        public ExtensionLoader ExtensionLoader { get; }

        /// <summary>
        /// Initializes a new instance of the<see cref="OctoGame" /> class
        /// </summary>
        public OctoGame() : base()
        {
            Title = "OctoAwesome";
            IsMouseVisible = true;

            typeContainer = TypeContainer.Get<ITypeContainer>();

            Register(typeContainer);

            ExtensionLoader = typeContainer.Get<ExtensionLoader>();
            ExtensionLoader.LoadExtensions();

            ExtensionService = typeContainer.Get<ExtensionService>();

            DefinitionManager = typeContainer.Get<DefinitionManager>();

            ResourceManager = typeContainer.Get<ContainerResourceManager>();

            Settings = typeContainer.Get<Settings>();

            Screen = new ScreenComponent(this, ExtensionService);
            KeyMapper = new KeyMapper(Screen, Settings);
            Assets = new AssetComponent(Screen, Settings);

            engenious.UI.Control.SetScreenManager(Screen);

            typeContainer.Register<BaseScreenComponent>(Screen);
            typeContainer.Register<ScreenComponent>(Screen);

            typeContainer.Register(Assets);

            Screen.UpdateOrder = 1;
            Screen.DrawOrder = 1;

            typeContainer.Get<RecipeService>().Load("Recipes");

            Service = typeContainer.Get<GameService>();
            //TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 15);

            int width = Settings.Get("Width", DefaultResolutionWidth);
            int height = Settings.Get("Height", DefaultResolutionHeight);
            Window.ClientSize = new Size(width, height);

            Window.Fullscreen = Settings.Get("EnableFullscreen", false);

            if (Settings.KeyExists("Viewrange"))
            {
                var viewrange = Settings.Get<int>("Viewrange");

                if (viewrange < 1)
                    throw new NotSupportedException("Viewrange in app.config darf nicht kleiner 1 sein");

                SceneControl.VIEWRANGE = viewrange;
            }

            Components.Add(Assets);
            Components.Add(Screen);

            #region GameComponents

            Player = new PlayerComponent(this, ResourceManager);
            Player.UpdateOrder = 2;
            Components.Add(Player);

            Simulation = new Components.SimulationComponent(this,
              ExtensionService, ResourceManager);

            Entity = new Components.EntityGameComponent(this, Simulation);
            Entity.UpdateOrder = 2;
            Components.Add(Entity);

            Simulation.UpdateOrder = 3;
            Components.Add(Simulation);

            Camera = new CameraComponent(this);
            Camera.UpdateOrder = 4;
            Components.Add(Camera);

            #endregion GameComponents

            /*Resize += (s, e) =>
            {
                //if (Window.ClientBounds.Height == graphics.PreferredBackBufferHeight &&
                //   Window.ClientBounds.Width == graphics.PreferredBackBufferWidth)
                //    return;

                //graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
                //graphics.PreferredBackBufferWidth = Window.ClientBounds.Width;
                //graphics.ApplyChanges();
            };*/
            //OctoAwesome.PoC.Program.Main();
            SetKeyBindings();

        }

        public override void LoadContent()
        {
            base.LoadContent();

            Skin.Current.BoldFont = NullabilityHelper.NotNullAssert(Screen.Content.Load<SpriteFont>("Fonts/BoldFont"),
                                                                    "Could not load bold font content!");
            Skin.Current.TextFont = NullabilityHelper.NotNullAssert(Screen.Content.Load<SpriteFont>("Fonts/GameFont"),
                                                                    "Could not load bold font content!");
            Skin.Current.HeadlineFont = NullabilityHelper.NotNullAssert(Screen.Content.Load<SpriteFont>("Fonts/HeadlineFont"),
                                                                    "Could not load bold font content!");
        }

        private static void Register(ITypeContainer typeContainer)
        {
            typeContainer.Register<Settings>(InstanceBehavior.Singleton);
            typeContainer.Register<ISettings, Settings>(InstanceBehavior.Singleton);
            typeContainer.Register<SerializationIdTypeProvider>(InstanceBehavior.Singleton);
            typeContainer.Register<ExtensionService>(InstanceBehavior.Singleton);
            typeContainer.Register<ExtensionLoader>(InstanceBehavior.Singleton);
            typeContainer.Register<DefinitionManager>(InstanceBehavior.Singleton);
            typeContainer.Register<IDefinitionManager, DefinitionManager>(InstanceBehavior.Singleton);
            typeContainer.Register<ContainerResourceManager>(InstanceBehavior.Singleton);
            typeContainer.Register<IResourceManager, ContainerResourceManager>(InstanceBehavior.Singleton);
            typeContainer.Register<GameService>(InstanceBehavior.Singleton);
            typeContainer.Register<IGameService, GameService>(InstanceBehavior.Singleton);
            typeContainer.Register<UpdateHub>(InstanceBehavior.Singleton);
            typeContainer.Register<IUpdateHub, UpdateHub>(InstanceBehavior.Singleton);
            typeContainer.Register<RecipeService, RecipeService>(InstanceBehavior.Singleton);
        }

        private void SetKeyBindings()
        {
            KeyMapper.RegisterBinding("octoawesome:forward", UI.Languages.OctoKeys.forward);
            KeyMapper.RegisterBinding("octoawesome:left", UI.Languages.OctoKeys.left);
            KeyMapper.RegisterBinding("octoawesome:backward", UI.Languages.OctoKeys.backward);
            KeyMapper.RegisterBinding("octoawesome:right", UI.Languages.OctoKeys.right);
            KeyMapper.RegisterBinding("octoawesome:headup", UI.Languages.OctoKeys.headup);
            KeyMapper.RegisterBinding("octoawesome:headdown", UI.Languages.OctoKeys.headdown);
            KeyMapper.RegisterBinding("octoawesome:headleft", UI.Languages.OctoKeys.headleft);
            KeyMapper.RegisterBinding("octoawesome:headright", UI.Languages.OctoKeys.headright);
            KeyMapper.RegisterBinding("octoawesome:interact", UI.Languages.OctoKeys.interact);
            KeyMapper.RegisterBinding("octoawesome:apply", UI.Languages.OctoKeys.apply);
            KeyMapper.RegisterBinding("octoawesome:flymode", UI.Languages.OctoKeys.flymode);
            KeyMapper.RegisterBinding("octoawesome:jump", UI.Languages.OctoKeys.jump);
            for (int i = 0; i < 10; i++)
            {
                var slotName = UI.Languages.OctoKeys.ResourceManager.GetString("slot" + i);
                Debug.Assert(slotName != null, nameof(slotName) + " != null");
                KeyMapper.RegisterBinding("octoawesome:slot" + i, slotName);
            }

            KeyMapper.RegisterBinding("octoawesome:debug.allblocks", UI.Languages.OctoKeys.debug_allblocks);
            KeyMapper.RegisterBinding("octoawesome:debug.allfoods", UI.Languages.OctoKeys.debug_allfoods);
            KeyMapper.RegisterBinding("octoawesome:debug.allitems", UI.Languages.OctoKeys.debug_allitems);
            KeyMapper.RegisterBinding("octoawesome:debug.control", UI.Languages.OctoKeys.debug_control);
            KeyMapper.RegisterBinding("octoawesome:inventory", UI.Languages.OctoKeys.inventory);
            KeyMapper.RegisterBinding("octoawesome:hidecontrols", UI.Languages.OctoKeys.hidecontrols);
            KeyMapper.RegisterBinding("octoawesome:exit", UI.Languages.OctoKeys.exit);
            KeyMapper.RegisterBinding("octoawesome:freemouse", UI.Languages.OctoKeys.freemouse);
            KeyMapper.RegisterBinding("octoawesome:fullscreen", UI.Languages.OctoKeys.fullscreen);
            KeyMapper.RegisterBinding("octoawesome:teleport", UI.Languages.OctoKeys.teleport);
            KeyMapper.RegisterBinding("octoawesome:toggleAmbientOcclusion", UI.Languages.OctoKeys.toggleAmbientOcclusion);
            KeyMapper.RegisterBinding("octoawesome:toggleWireFrame", UI.Languages.OctoKeys.toggleWireFrame);

            Dictionary<string, Keys> standardKeys = new Dictionary<string, Keys>()
            {
                { "octoawesome:forward", Keys.W },
                { "octoawesome:left", Keys.A },
                { "octoawesome:backward", Keys.S },
                { "octoawesome:right", Keys.D },
                { "octoawesome:headup", Keys.Up },
                { "octoawesome:headdown", Keys.Down },
                { "octoawesome:headleft", Keys.Left },
                { "octoawesome:headright", Keys.Right },
                { "octoawesome:interact", Keys.E },
                { "octoawesome:apply", Keys.Q },
                { "octoawesome:flymode", Keys.ScrollLock },
                { "octoawesome:jump", Keys.Space },
                { "octoawesome:slot0", Keys.D1 },
                { "octoawesome:slot1", Keys.D2 },
                { "octoawesome:slot2", Keys.D3 },
                { "octoawesome:slot3", Keys.D4 },
                { "octoawesome:slot4", Keys.D5 },
                { "octoawesome:slot5", Keys.D6 },
                { "octoawesome:slot6", Keys.D7 },
                { "octoawesome:slot7", Keys.D8 },
                { "octoawesome:slot8", Keys.D9 },
                { "octoawesome:slot9", Keys.D0 },
                { "octoawesome:debug.allblocks", Keys.Keypad1 },
                { "octoawesome:debug.allitems", Keys.Keypad2 },
                { "octoawesome:debug.allfoods", Keys.Keypad3 },
                { "octoawesome:debug.control", Keys.F10 },
                { "octoawesome:inventory", Keys.I },
                { "octoawesome:hidecontrols", Keys.F9 },
                { "octoawesome:exit", Keys.Escape },
                { "octoawesome:freemouse", Keys.F12 },
                { "octoawesome:fullscreen", Keys.F11 },
                { "octoawesome:teleport", Keys.T },
                { "octoawesome:toggleAmbientOcclusion", Keys.O },
                { "octoawesome:toggleWireFrame", Keys.J }
            };

            KeyMapper.LoadFromConfig(standardKeys);

            KeyMapper.AddAction("octoawesome:fullscreen", type =>
            {
                if (type == KeyMapper.KeyType.Down)
                {
                    Window.Fullscreen = !Window.Fullscreen;
                }
            });
        }

        protected override void OnExiting(EventArgs args)
        {
            Player.Unload();
            Simulation.ExitGame();
        }
    }
}


text:
I'm delighted that you're helping make this open source project better. Here are a few quick guidelines to make this an easier and better process for everyone.

## Reporting a bug

First, **make sure the bug hasn't already been reported** by searching GitHub's issues section.

If no existing issue exists, go ahead and create one. **Please be sure to include all of the following:**

1. A clear, descriptive title (ie. "A bug" is *not* a good title).
2. [A reduced test case.](https://css-tricks.com/reduced-test-cases/) In order to debug code issues, I need to see actual code in a browser.
3. The browser and OS that you're using.

## Asking a question

Before asking, please **make sure the question hasn't already been asked** by searching GitHub's issues section.

## Submitting a Pull Request

Please make sure your code meets the following code standards:

- Camel case for JavaScript variables.
- [Object-Oriented CSS](http://www.slideshare.net/stubbornella/object-oriented-css) for CSS selectors.
- Favor readable code over brevity. The build process will reduce size, so opt for readability. (ex. `var navigation` is better than `var n`)
- Order CSS properties alphabetically.
- Hard tabs.

Before submitting, make sure that you've:

- Updated the version number using semantic versioning.


text:
#import "TWTRTweetImageViewPill.h"
#import <TwitterCore/TWTRColorUtil.h>
#import "TWTRMediaEntityDisplayConfiguration.h"
#import "TWTRViewUtil.h"

static const CGFloat TWTRImagePillLabelHeight = 20.0;
static const CGFloat TWTRImagePillLabelFontSize = 14.0;
static const CGFloat TWTRImagePillLabelAlpha = 0.3;
static const CGFloat TWTRImagePillCornerRadius = 4.0;

@interface TWTRTweetImageViewPill ()

@property (nonatomic, readonly) UILabel *label;
@property (nonatomic, readonly) UIImageView *imageView;

@end

@implementation TWTRTweetImageViewPill

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [[TWTRColorUtil textColor] colorWithAlphaComponent:TWTRImagePillLabelAlpha];
        self.layer.cornerRadius = TWTRImagePillCornerRadius;
        self.clipsToBounds = YES;

        _label = [[UILabel alloc] init];
        _label.translatesAutoresizingMaskIntoConstraints = NO;
        _label.font = [UIFont boldSystemFontOfSize:TWTRImagePillLabelFontSize];
        _label.textColor = [TWTRColorUtil whiteColor];
        [self addSubview:_label];

        _imageView = [[UIImageView alloc] init];
        _imageView.translatesAutoresizingMaskIntoConstraints = NO;
        [self addSubview:_imageView];

        [TWTRViewUtil constraintForAttribute:NSLayoutAttributeHeight onView:_label value:TWTRImagePillLabelHeight].active = YES;
        [TWTRViewUtil centerViewInSuperview:_label];
        [TWTRViewUtil centerViewInSuperview:_imageView];
    }
    return self;
}

- (CGSize)intrinsicContentSize
{
    if (self.imageView.image) {
        return [self.imageView intrinsicContentSize];
    }

    CGFloat singleSpaceWidth = [@" " sizeWithAttributes:@{NSFontAttributeName: self.label.font}].width;
    return CGSizeMake([self.label intrinsicContentSize].width + (singleSpaceWidth * 2), TWTRImagePillLabelHeight);
}

- (void)configureWithMediaEntityConfiguration:(TWTRMediaEntityDisplayConfiguration *)mediaEntityConfig
{
    if (mediaEntityConfig.pillImage) {
        self.label.text = @"";
        self.imageView.image = mediaEntityConfig.pillImage;
        self.label.hidden = YES;
        self.imageView.hidden = NO;
    } else {
        self.label.text = mediaEntityConfig.pillText;
        ;
        self.imageView.image = nil;
        self.label.hidden = NO;
        self.imageView.hidden = YES;
    }

    [self invalidateIntrinsicContentSize];
}

@end


text:
package com.vaadin.tests.fonticon;

import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.server.FontAwesome;
import com.vaadin.server.FontIcon;
import com.vaadin.server.Page;
import com.vaadin.server.Resource;
import com.vaadin.server.ThemeResource;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.Position;
import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.AbstractReindeerTestUI;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.Slider;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Upload;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.v7.ui.AbstractSelect;
import com.vaadin.v7.ui.ComboBox;
import com.vaadin.v7.ui.ListSelect;
import com.vaadin.v7.ui.NativeSelect;
import com.vaadin.v7.ui.OptionGroup;
import com.vaadin.v7.ui.PopupDateField;
import com.vaadin.v7.ui.Table;
import com.vaadin.v7.ui.Table.Align;
import com.vaadin.v7.ui.Table.RowHeaderMode;
import com.vaadin.v7.ui.TextArea;
import com.vaadin.v7.ui.Tree;
import com.vaadin.v7.ui.TwinColSelect;

/**
 * This is a legacy test ui for using font icons (font awesome).
 * <p>
 * {@link VaadinIconSet} is the newer one for testing valo+vaadin icons.
 */
public class FontIcons extends AbstractReindeerTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        buildUI(FontAwesome.ANDROID);
    }

    private void buildUI(final Resource icon) {
        VerticalLayout layout = new VerticalLayout();
        setContent(layout);
        layout.setSpacing(false);

        layout.setIcon(icon);

        layout.addComponent(
                new Button("Switch icon type", new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        buildUI(icon instanceof FontIcon
                                ? new ThemeResource("../runo/icons/16/user.png")
                                : FontAwesome.ANDROID);
                    }
                }));

        Handler actionHandler = new Handler() {
            Action[] actions = { new Action("Do it!", icon) };

            @Override
            public void handleAction(Action action, Object sender,
                    Object target) {

            }

            @Override
            public Action[] getActions(Object target, Object sender) {
                return actions;
            }
        };

        // Notification
        Notification n = new Notification("Hey there!");
        n.setIcon(icon);
        n.setPosition(Position.BOTTOM_CENTER);
        n.setDelayMsec(300000);
        n.show(Page.getCurrent());

        // grid of compoents
        GridLayout gl = new GridLayout(4, 5);
        gl.setSpacing(true);
        layout.addComponent(gl);

        // Basic components, caption icon only
        Class<?>[] components = { Button.class, CheckBox.class,
                PopupDateField.class, NativeButton.class, Link.class,
                Label.class, Panel.class, Slider.class, TextArea.class,
                TextField.class, Upload.class };
        for (Class<?> clazz : components) {
            Component c;
            try {
                c = (Component) clazz.newInstance();
            } catch (Exception e) {
                e.printStackTrace();
                continue;
            }
            if (c instanceof Upload) {
                ((Upload) c).setImmediateMode(false);
            }
            c.setCaption(clazz.getSimpleName());
            c.setIcon(icon);
            gl.addComponent(c);
        }

        // TabSheet, caption + tab icons
        TabSheet tabs = new TabSheet();
        tabs.setCaption("TabSheet");
        tabs.setIcon(icon);
        tabs.addStyleName("myTabs");
        tabs.addTab(createLabel("Content 1"), "Tab 1", icon);
        tabs.addTab(createLabel("Content 2"), "Tab 2", icon);
        tabs.setWidth("150px");
        gl.addComponent(tabs);

        // Accordion, caption + tab icons
        Accordion acc = new Accordion();
        acc.setCaption("Accordion");
        acc.setIcon(icon);
        acc.addTab(createLabel(""), "Section 1", icon);
        acc.addTab(createLabel(""), "Section 2", icon);
        gl.addComponent(acc);

        // Table, caption + column + row + action icons
        Table tbl = new Table("Table");
        tbl.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
        tbl.setIcon(icon);
        tbl.addContainerProperty("Column 1", String.class, "Row", "Column 1",
                icon, Align.LEFT);
        tbl.addContainerProperty("Column 2", String.class, "Row", "Column 2",
                icon, Align.LEFT);
        tbl.setItemIcon(tbl.addItem(), icon);
        tbl.setItemIcon(tbl.addItem(), icon);
        tbl.setItemIcon(tbl.addItem(), icon);
        tbl.setPageLength(3);
        gl.addComponent(tbl);
        tbl.addActionHandler(actionHandler);

        // Selects, caption + item icons
        Class<?>[] selects = { ComboBox.class, NativeSelect.class,
                ListSelect.class, TwinColSelect.class, OptionGroup.class };
        for (Class<?> clazz : selects) {
            AbstractSelect sel;
            try {
                sel = (AbstractSelect) clazz.newInstance();
            } catch (Exception e) {
                e.printStackTrace();
                continue;
            }
            sel.setCaption(clazz.getSimpleName());
            sel.setIcon(icon);
            sel.addItem("One");
            sel.setItemIcon("One", icon);
            sel.addItem("Two");
            sel.setItemIcon("Two", icon);
            gl.addComponent(sel);
        }

        // MenuBar, caption + item + sub-item icons
        MenuBar menu = new MenuBar();
        menu.setIcon(icon);
        menu.setCaption("MenuBar");
        MenuItem mi = menu.addItem("File", icon, null);
        MenuItem smi = mi.addItem("Item", icon, null);
        smi = mi.addItem("Item", icon, null);
        smi = smi.addItem("Item", icon, null);
        gl.addComponent(menu);

        // Tree, caption + item + subitem + action icons
        Tree tree = new Tree("Tree");
        tree.addItem("Root");
        tree.setItemIcon("Root", icon);
        tree.addItem("Leaf");
        tree.setItemIcon("Leaf", icon);
        tree.setParent("Leaf", "Root");
        tree.expandItemsRecursively("Root");
        tree.addActionHandler(actionHandler);
        gl.addComponent(tree);

        // All of FontAwesome
        String allIcons = "";
        for (FontIcon ic : FontAwesome.values()) {
            allIcons += ic.getHtml() + " ";
        }
        Label label = new Label(allIcons, ContentMode.HTML);
        label.setWidth("100%");
        layout.addComponent(label);
    }

    private Label createLabel(String caption) {
        Label label = new Label(caption);
        label.setWidth("100%");
        return label;
    }

    @Override
    protected String getTestDescription() {
        return "Font icons should show up in all the right places";
    }

    @Override
    protected Integer getTicketNumber() {
        return 13152;
    }

}


text:
@interface ZXCConversionViewController : UITableViewController

@end


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.skife.jdbi.v2.sqlobject;

import org.h2.jdbcx.JdbcDataSource;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import org.skife.jdbi.v2.Something;
import org.skife.jdbi.v2.TransactionCallback;
import org.skife.jdbi.v2.TransactionStatus;
import org.skife.jdbi.v2.exceptions.UnableToCreateStatementException;
import org.skife.jdbi.v2.sqlobject.mixins.GetHandle;
import org.skife.jdbi.v2.tweak.HandleCallback;

import java.util.List;
import java.util.UUID;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

public class TestReentrancy
{
    private DBI    dbi;
    private Handle handle;

    interface TheBasics extends GetHandle
    {
        @SqlUpdate("insert into something (id, name) values (:id, :name)")
        int insert(@BindBean Something something);
    }

    @Test
    public void testGetHandleProvidesSeperateHandle() throws Exception
    {
        final TheBasics dao = dbi.onDemand(TheBasics.class);
        Handle h = dao.getHandle();

        try {
            h.execute("insert into something (id, name) values (1, 'Stephen')");
            fail("should have raised exception, connection will be closed at this point");
        }
        catch (UnableToCreateStatementException e) {
            // happy path
        }
    }

    @Test
    public void testHandleReentrant() throws Exception
    {
        final TheBasics dao = dbi.onDemand(TheBasics.class);

        dao.withHandle(new HandleCallback<Void>()
        {
            @Override
            public Void withHandle(Handle handle) throws Exception
            {
                dao.insert(new Something(7, "Martin"));

                handle.createQuery("SELECT 1").list();

                return null;
            }
        });
    }

    @Test
    public void testTxnReentrant() throws Exception
    {
        final TheBasics dao = dbi.onDemand(TheBasics.class);

        dao.withHandle(new HandleCallback<Void>()
        {
            @Override
            public Void withHandle(Handle handle) throws Exception
            {
                handle.inTransaction(new TransactionCallback<Void>()
                {
                    @Override
                    public Void inTransaction(Handle conn, TransactionStatus status) throws Exception
                    {
                        dao.insert(new Something(1, "x"));

                        List<String> rs = conn.createQuery("select name from something where id = 1")
                                              .mapTo(String.class)
                                              .list();
                        assertThat(rs.size(), equalTo(1));

                        conn.createQuery("SELECT 1").list();
                        return null;
                    }
                });

                return null;
            }
        });
    }

    @Before
    public void setUp() throws Exception
    {
        JdbcDataSource ds = new JdbcDataSource();
        // in MVCC mode h2 doesn't shut down immediately on all connections closed, so need random db name
        ds.setURL(String.format("jdbc:h2:mem:%s;MVCC=TRUE", UUID.randomUUID()));

        dbi = new DBI(ds);

        dbi.registerMapper(new SomethingMapper());

        handle = dbi.open();

        handle.execute("create table something (id int primary key, name varchar(100))");
    }

    @After
    public void tearDown() throws Exception
    {
        handle.execute("drop table something");
        handle.close();
    }
}


text:
package ws.rocket.sqlstore.script.sql;

import ws.rocket.sqlstore.execute.QueryContext;
import ws.rocket.sqlstore.script.QueryParam;

import static java.util.Objects.requireNonNull;

/**
 * A condition for SqlPart where the provided query parameter must equal to
 * Boolean.TRUE to be included in the actually executed query.
 *

 * This condition is expressed in SQLS file as
 * !(true(var.props)){...}.
 */
public final class ParamValueTrue implements SqlPartCondition {

  private final QueryParam param;

  /**
   * Initializes condition with the parameter of which value needs to be checked.
   *
   * @param param The query parameter (value) to check.
   */
  public ParamValueTrue(QueryParam param) {
    this.param = requireNonNull(param, "The query parameter is undefined.");
  }

  @Override
  public boolean isApplicable(QueryContext ctx) {
    return Boolean.TRUE.equals(this.param.getValue(ctx));
  }

  @Override
  public String toString() {
    return param + " == true";
  }

}


text:
package org.apache.accumulo.tserver;

import java.util.AbstractMap;

/**
 * Encapsulation of a task and the time it began execution.
 */
public class RunnableStartedAt extends AbstractMap.SimpleEntry<ActiveAssignmentRunnable,Long> {

  private static final long serialVersionUID = 1L;

  public RunnableStartedAt(ActiveAssignmentRunnable task, Long startedAtMillis) {
    super(task, startedAtMillis);
  }

  /**
   * @return The task being executed
   */
  public ActiveAssignmentRunnable getTask() {
    return getKey();
  }

  /**
   * @return The time, in millis, that the runnable was submitted at
   */
  public Long getStartTime() {
    return getValue();
  }

}


text:
using Orchard.Mvc.Routes;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;

namespace CloudBust.ContactForm
{
    public class RoutesContactForm : IRouteProvider
    {
        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            const string areaName = "CloudBust.ContactForm";
            const string controllerName = "Admin";
            return new[] {
                            new RouteDescriptor {
                                Route = new Route(
                                    "dashboard/contactform",
                                    new RouteValueDictionary {
                                                                {"area", areaName},
                                                                {"controller", controllerName},
                                                                {"action", "Index"}
                                                            },
                                    new RouteValueDictionary(),
                                    new RouteValueDictionary {
                                                                {"area", areaName}
                                                            },
                                    new MvcRouteHandler())
                                },
                            new RouteDescriptor {
                                Route = new Route(
                                    "dashboard/contactform/add",
                                    new RouteValueDictionary {
                                                                {"area", areaName},
                                                                {"controller", controllerName},
                                                                {"action", "Add"}
                                                            },
                                    new RouteValueDictionary(),
                                    new RouteValueDictionary {
                                                                {"area", areaName}
                                                            },
                                    new MvcRouteHandler())
                                },
                            new RouteDescriptor {
                                Route = new Route(
                                    "forms/contactform/add",
                                    new RouteValueDictionary {
                                        {"area", areaName},
                                        {"controller", "ContactForms"},
                                        {"action", "Add"}
                                    },
                                    new RouteValueDictionary(),
                                    new RouteValueDictionary {
                                        {"area", areaName}
                                    },
                                    new MvcRouteHandler())
                            },
                            new RouteDescriptor {
                                Route = new Route(
                                    "dashboard/contactform/edit/{id}",
                                    new RouteValueDictionary {
                                                                {"area", areaName},
                                                                {"controller", controllerName},
                                                                {"action", "Edit"}
                                                            },
                                    new RouteValueDictionary {
                                                                {"id", ".+"}
                                                            },
                                    new RouteValueDictionary {
                                                                {"area", areaName}
                                                            },
                                    new MvcRouteHandler())
                                },
                            new RouteDescriptor {
                                Route = new Route(
                                    "dashboard/contactform/delete/{id}",
                                    new RouteValueDictionary {
                                                                {"area", areaName},
                                                                {"controller", controllerName},
                                                                {"action", "Delete"}
                                                            },
                                    new RouteValueDictionary {
                                                                {"id", ".+"}
                                                            },
                                    new RouteValueDictionary {
                                                                {"area", areaName}
                                                            },
                                    new MvcRouteHandler())
                                },
            };
        }

        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (RouteDescriptor routeDescriptor in GetRoutes())
            {
                routes.Add(routeDescriptor);
            }
        }
    }
}


text:
import HistoryManager from './HistoryManager';

class HTML5HistoryManager implements HistoryManager {
    private navigateHistory: (e: PopStateEvent) => void = null;
    private applicationPath: string = '';
    disabled: boolean = (typeof window === 'undefined') || !(window.history && window.history.pushState);

    constructor(applicationPath: string = '') {
        this.applicationPath = HTML5HistoryManager.prependSlash(applicationPath);
    }

    init(navigateHistory: (url?: string) => void) {
        if (!this.disabled && !this.navigateHistory) {
            this.navigateHistory = e => navigateHistory((e.state && e.state.navigationLink) || undefined);
            window.addEventListener('popstate', this.navigateHistory);
        }
    }

    addHistory(url: string, replace: boolean) {
        if (!this.disabled && (window.history.state?.navigationLink || this.getUrl(window.location)) !== url) {
            if (!replace)
                window.history.pushState({navigationLink: url}, null, this.getHref(url));
            else
                window.history.replaceState({navigationLink: url}, null, this.getHref(url));
        }
    }

    getCurrentUrl(): string {
        return this.getUrl(window.location);
    }

    getHref(url: string): string {
        if (url == null)
            throw new Error('The Url is invalid');
        return this.applicationPath + HTML5HistoryManager.prependSlash(url);
    }

    getUrl(hrefElement: HTMLAnchorElement | Location) {
        return hrefElement.pathname.substring(this.applicationPath.length) + hrefElement.search + hrefElement.hash;
    }

    stop() {
        if (this.navigateHistory)
            window.removeEventListener('popstate', this.navigateHistory);
        this.navigateHistory = null;
    }

    private static prependSlash(url: string): string {
        return (url && url.substring(0, 1) !== '/') ? '/' + url : url;
    }
}
export default HTML5HistoryManager;


text:
using System;

namespace Llvm.NET
{
    /// LLVM pointer type
    public class PointerType
        : SequenceType
    {
        /// Address space the pointer refers to
        public uint AddressSpace => LLVMNative.GetPointerAddressSpace( TypeHandle );

        internal PointerType( LLVMTypeRef typeRef )
            : base( typeRef )
        {
            if( LLVMNative.GetTypeKind( typeRef ) != LLVMTypeKind.LLVMPointerTypeKind )
                throw new ArgumentException( "Pointer type reference expected", nameof( typeRef ) );
        }

        [System.Diagnostics.CodeAnalysis.SuppressMessage( "Language", "CSE0003:Use expression-bodied members", Justification = "Readability" )]
        internal new static PointerType FromHandle( LLVMTypeRef typeRef )
        {
            return ( PointerType )Context.CurrentContext.GetTypeFor( typeRef, ( h ) => new PointerType( h ) );
        }
    }
}


text:
package config

import (
	"context"

	"go.uber.org/zap"
	"knative.dev/pkg/tracing"
	tracingconfig "knative.dev/pkg/tracing/config"
)

var tracer tracing.Tracer

func SetupTracing() {
	config, err := tracingconfig.JSONToTracingConfig(Instance.TracingConfig)
	if err != nil {
		Log.Warn("Tracing configuration is invalid, using the no-op default", zap.Error(err))
	}
	if tracer, err = tracing.SetupPublishingWithStaticConfig(Log, "", config); err != nil {
		Log.Fatal("Error setting up trace publishing", zap.Error(err))
	}
}

func ShutdownTracing() {
	if tracer != nil {
		if err := tracer.Shutdown(context.Background()); err != nil {
			Log.Warn("Failed to shutdown tracing")
		}
	}
}


text:
<ruleset name="Anyproz">

	<target host="anonyproz.com" />
	<target host="www.anonyproz.com" />

	<securecookie host="^www\.anonyproz\.com$" name=".*" />

	<rule from="^http:" to="https:" />

</ruleset>


text:
namespace Weather.Service.Core
{
    public interface IContainer
    {
        TType Get<TType>();
        void Register<TInterface, TImplementation>() where TImplementation : TInterface;
        void RegisterInstance<TInstance>(TInstance instance);
        void Dispose();
    }
}


text:
import * as React from 'react';
import { IconBaseProps } from 'react-icon-base';
export default class IoAndroidWatch extends React.Component<IconBaseProps> { }


text:
using namespace std;
using namespace vw;

namespace pathfinder {

	void World::fromDem ( string filename ) {

		info("Converting DEM to World xyz:");

		if ( filename.substr(filename.find_last_of(".") + 1) != "dem" ) {

			error("Input file is not format [dem] and cannot be processed.");
			return;
		}

		_name = filename.substr(0, filename.rfind("."));

		//
		// parse header
		//

		cartography::GeoReference dem_georef;
		cartography::read_georeference( dem_georef, filename );

		DiskImageView<float> dem( filename );

		ImageViewRef<Vector3> geo_ref =
			geodetic_to_cartesian( dem_to_geodetic( dem, dem_georef ), dem_georef.datum() );

		for ( size_t i = 0; i < geo_ref.rows(); i++ ) {
			for ( size_t j = 0; j < geo_ref.cols(); j++ ) {

				Vector3 copy = subvector(geo_ref(i,j),0,3);
				if ( copy != Vector3() && copy == copy ) {

					_point_cloud.push_back( pcl::PointXYZ (copy[0], copy[1], copy[2]) );
				}
			}
		}

		_point_cloud.width = geo_ref.rows();
		_point_cloud.height = geo_ref.cols();

		reorient();
		rebuildBounds();

		triangulate();
		rebuildIndices();
	}

	void World::fromDem ( vector<string> filenames ) {

		for ( size_t i = 0; i < filenames.size(); i++ ) {
			if ( (filenames[i].substr(filenames[i].find_last_of(".") + 1) != "dem") ) {

				error("Input files are not format [dem] and cannot be processed.");
				return;
			}
		}

		cartography::GeoReference 	dem_geo_ref;
		ImageViewRef<Vector3>		geo_ref;

		for ( size_t i = 0; i < filenames.size(); i++ ) {

			info("Converting DEM to World xyz: " + filenames[i]);

			cartography::read_georeference( dem_geo_ref, filenames[i] );
			DiskImageView<float> dem( filenames[i] );

			geo_ref = geodetic_to_cartesian( dem_to_geodetic( dem, dem_geo_ref ), dem_geo_ref.datum() );

			for ( size_t i = 0; i < geo_ref.rows(); i++ ) {
				for ( size_t j = 0; j < geo_ref.cols(); j++ ) {

					Vector3 copy = subvector(geo_ref(i,j),0,3);
					if ( copy != Vector3() && copy == copy ) {

						_point_cloud.push_back( pcl::PointXYZ (copy[0], copy[1], copy[2]) );
					}
				}
			}
		}

		//
		// calculate layout
		//

		// _point_cloud.height += geo_ref.cols();
		// _point_cloud.width = geo_ref.rows();

		reorient();
		rebuildBounds();

		triangulate();
		rebuildIndices();
	}

	void World::fromPly ( string filename ) {

		info("Converting PLY to World xyz:");

		if ( filename.substr(filename.find_last_of(".") + 1) != "ply" ) {

			error("Input file is not format [ply] and cannot be processed.");
			return;
		}

		_name = filename.substr(0, filename.rfind("."));

		pcl::io::loadPolygonFile(filename, _poly_mesh);
		pcl::fromPCLPointCloud2(_poly_mesh.cloud, _point_cloud);

		//
		// check height
		//
	}

	void World::generateOctreeMesh ( ) {

		info("Generating OctreeMesh nodes:");

		pcl::PointCloud<pcl::PointXYZ>	poly_centers;

 		for ( size_t i = 0; i < _poly_mesh.polygons.size(); i++ ) {

				poly_centers.push_back( pcl::PointXYZ(	(	_point_cloud.points[_poly_mesh.polygons[i].vertices[0]].x +
															_point_cloud.points[_poly_mesh.polygons[i].vertices[1]].x +
															_point_cloud.points[_poly_mesh.polygons[i].vertices[2]].x) / 3.0f,
														(	_point_cloud.points[_poly_mesh.polygons[i].vertices[0]].y +
															_point_cloud.points[_poly_mesh.polygons[i].vertices[1]].y +
															_point_cloud.points[_poly_mesh.polygons[i].vertices[2]].y) / 3.0f,
														(	_point_cloud.points[_poly_mesh.polygons[i].vertices[0]].z +
															_point_cloud.points[_poly_mesh.polygons[i].vertices[1]].z +
															_point_cloud.points[_poly_mesh.polygons[i].vertices[2]].z) / 3.0f) );
		}

		pcl::octree::OctreePointCloudPointVector<pcl::PointXYZ> octree(1024.0f);
		octree.setInputCloud(poly_centers.makeShared());
		octree.defineBoundingBox();
		octree.addPointsFromInputCloud();

		pcl::octree::OctreePointCloudPointVector<pcl::PointXYZ>::LeafNodeIterator it_leaf;
		pcl::octree::OctreePointCloudPointVector<pcl::PointXYZ>::LeafNodeIterator it_leaf_end = octree.leaf_end();

		Eigen::Vector3f min_pt, max_pt;
		std::vector<int> oct_leaf_indices;

		int leaf_id = 0;

		for ( it_leaf = octree.leaf_begin(); it_leaf != it_leaf_end; ++it_leaf, ++leaf_id ) {

			octree.getVoxelBounds(it_leaf, min_pt, max_pt);
			pathfinder::OctreeMesh oct_mesh = OctreeMesh(min_pt, max_pt);

			pcl::octree::OctreeContainerPointIndices& container = it_leaf.getLeafContainer();
			container.getPointIndices(oct_leaf_indices);

			for ( size_t i = 0; i < container.getSize(); i++ ) {
				for ( size_t j = 0; j < _poly_mesh.polygons[oct_leaf_indices[i]].vertices.size(); j++ ) {

					oct_mesh.addVertex(_poly_mesh.polygons[oct_leaf_indices[i]].vertices[j]);
				}
			}
			oct_leaf_indices.clear();

			oct_mesh.setId(boost::lexical_cast<string>(leaf_id));
			oct_mesh.rebuildIndices();

			_oct_meshes.push_back(oct_mesh);
		}
	}

	void World::generateMeshLods ( ) {

	}

	void World::generateTriStrips ( ) {

	}

	string World::generateHeader ( ) {

		stringstream sstream;

		pcl::PCDWriter writer;
		sstream << writer.generateHeader(_point_cloud, _point_cloud.points.size());

		sstream << "OCTLEAVES " << _oct_meshes.size() << "\n";

		sstream << "OCTINDICES";

		for ( size_t i = 0; i < _oct_meshes.size(); i++ ) {

			sstream << " " << _oct_meshes[i].getTriangleCount();
		}
		sstream << "\n";

		sstream << "OCTVERTICES";

		for ( size_t i = 0; i < _oct_meshes.size(); i++ ) {

			sstream << " " << _oct_meshes[i].getVertexCount();
		}
		sstream << "\n";

		return sstream.str();
	}

	void World::denoise ( ) {

	}

	void World::reorient ( ) {

		info("Reorienting point cloud data:");

		pcl::PCA<pcl::PointXYZ> pca;
		pca.setInputCloud(_point_cloud.makeShared());

		Eigen::Vector4f centroid;
		pcl::compute3DCentroid(_point_cloud, centroid);

		Eigen::Matrix3f covariance;
		computeCovarianceMatrixNormalized(_point_cloud, centroid, covariance);

		cout << "World: reorient: centroid: " << centroid << endl;

		Eigen::SelfAdjointEigenSolver<Eigen::Matrix3f> eigen_solver(covariance, Eigen::ComputeEigenvectors);
		Eigen::Matrix3f eigen_vectors = eigen_solver.eigenvectors();

		Eigen::Matrix3f orientation;
		orientation.col(0) = eigen_vectors.col(1);
		orientation.col(1) = eigen_vectors.col(1).cross(eigen_vectors.col(0));
		orientation.col(2) = eigen_vectors.col(0);

		_xform.block<3,3>(0,0) = orientation.transpose();
		_xform.block<3,1>(0,3) = -1.0f * (_xform.block<3,3>(0,0) * centroid.head<3>());

		//pcl::transformPointCloud(_point_cloud, _point_cloud, _xform);
	}

	void World::triangulate ( ) {

		info("Estimating point normals:");

		if ( !(_point_cloud.isOrganized()) )
			debug("triangulate: _point_cloud is not organized.");

		pcl::PointCloud<pcl::Normal>::Ptr normal_ptr ( new pcl::PointCloud<pcl::Normal> );
		pcl::search::KdTree<pcl::PointXYZ>::Ptr normal_tree_ptr ( new pcl::search::KdTree<pcl::PointXYZ> );
		normal_tree_ptr->setInputCloud(_point_cloud.makeShared());

		std::vector<int> indices;
		indices.resize (_point_cloud.points.size());
		boost::shared_ptr<vector<int> > indices_ptr (new vector<int> (indices));

		pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;
		ne.setInputCloud(_point_cloud.makeShared());
		ne.setSearchMethod(normal_tree_ptr);
		ne.setIndices(indices_ptr);
		ne.setKSearch(128);
		ne.compute(*normal_ptr);

		pcl::PointCloud<pcl::PointNormal>::Ptr cloud_with_normals_ptr ( new pcl::PointCloud<pcl::PointNormal> );
		pcl::concatenateFields(_point_cloud, *normal_ptr, *cloud_with_normals_ptr);

		pcl::io::savePLYFile(_name+"_debug_normals.ply", *cloud_with_normals_ptr, false);

		pcl::search::KdTree<pcl::PointNormal>::Ptr tri_tree_ptr ( new pcl::search::KdTree<pcl::PointNormal> );
		tri_tree_ptr->setInputCloud(cloud_with_normals_ptr);

		info("Solving triangle projection:");

		pcl::Poisson<pcl::PointNormal> poisson;
		poisson.setInputCloud(cloud_with_normals_ptr);
		poisson.setSearchMethod(tri_tree_ptr);
		poisson.setDepth(10);
		poisson.setIsoDivide(10);
		poisson.setManifold(true);
		poisson.setScale(1.25);
		poisson.setSamplesPerNode(1.0);
		poisson.setOutputPolygons(false);
		poisson.reconstruct(_poly_mesh);
	}

	void World::partition ( ) {

		info("Creating octree for mesh partitioning:");

		//
		// build octree
		//
	}

	void World::rebuildBounds ( ) {

		info("Computing transformed bounding box:");

	    pcl::PointXYZ min_pt, max_pt;
	    pcl::getMinMax3D(_point_cloud, min_pt, max_pt);

		_bbox = Eigen::AlignedBox3f(min_pt.getVector3fMap(), max_pt.getVector3fMap());

	}

	void World::rebuildIndices ( ) {

		info("Rebuilding poly mesh indices:");

		pcl::PolygonMesh pmesh;
		pmesh.cloud = _poly_mesh.cloud; // check copy

		pcl::PointCloud<pcl::PointXYZ> pmesh_points;
		pcl::fromPCLPointCloud2(_poly_mesh.cloud, pmesh_points);

		std::vector<int> indices;
		pcl::getApproximateIndices<pcl::PointXYZ>(_point_cloud.makeShared(), pmesh_points.makeShared(), indices);

		//
		// thread on this
		//

		for ( size_t i = 0; i < _poly_mesh.polygons.size(); i++ ) {

			bool add_poly = true;

			for ( size_t j = 0; j < _poly_mesh.polygons[i].vertices.size(); j++ ) {

				if ( std::find(indices.begin(), indices.end(), _poly_mesh.polygons[i].vertices[j]) == indices.end() ) {

					add_poly = false;
				}
			}

			if ( add_poly ) {

				pmesh.polygons.push_back(pcl::Vertices(_poly_mesh.polygons[i]));
			}
		}

		debug("rebuildIndices: pmesh face count: ", pmesh.polygons.size());

		pcl::surface::SimplificationRemoveUnusedVertices cleaner;
		cleaner.simplify(_poly_mesh, _poly_mesh);

		_poly_mesh = pmesh;

		pcl::fromPCLPointCloud2(_poly_mesh.cloud, _point_cloud);
	}

	void World::read ( string filename ) {

		info("Reading Octree Mesh Extents file:");
	}

	void World::write ( ) {

		info("Writing Octree Mesh Extents file:");

		if ( _debug ) {

			debug("Writing debug format: [.pcd]");
			pcl::io::savePCDFile(_name+".pcd", _point_cloud, true);

			debug("Writing debug format: [.ply]");
			pcl::io::savePLYFile(_name+".ply", _poly_mesh);
		}

		ofstream outfile((_name+".ome").c_str(), std::ios_base::out);

		outfile << generateHeader();

		// bounds
		for ( size_t i = 0; i < _oct_meshes.size(); i++ ) {

			Eigen::Vector3f bbc = _oct_meshes[i].getBBoxCenter();
			Eigen::Vector3f bbs = _oct_meshes[i].getBBoxSize();

			outfile.write(reinterpret_cast<char*>(&bbc), 12);
			outfile.write(reinterpret_cast<char*>(&bbs), 12);
		}

		// triangles
		for ( size_t i = 0; i < _oct_meshes.size(); i++ ) {
			for ( size_t j = 0; j < _oct_meshes[i].getTriangleCount(); j++ ) {

				int tri = _oct_meshes[i].getTriangle(j);

				outfile.write(reinterpret_cast<const char*>(&tri), sizeof(uint));
			}
		}

		// vertices
		for ( size_t i = 0; i < _oct_meshes.size(); i++ ) {
			for ( size_t j = 0; j < _oct_meshes[i].getVertexCount(); j++ ) {

				int vert = _oct_meshes[i].getVertex(j);

				outfile.write(reinterpret_cast<const char*>(&vert), sizeof(uint));
			}
		}

		// points
		for ( size_t i = 0; i < _point_cloud.points.size(); i++ ) {

			outfile.write(reinterpret_cast<char*>(&_point_cloud.points[i]), 12);
		}

		outfile.close();
	}
};


text:
'use strict';

const RelayMutationType = {
  FIELDS_CHANGE: 'FIELDS_CHANGE',
  NODE_DELETE: 'NODE_DELETE',
  RANGE_ADD: 'RANGE_ADD',
  RANGE_DELETE: 'RANGE_DELETE',
  REQUIRED_CHILDREN: 'REQUIRED_CHILDREN',
};

module.exports = RelayMutationType;


text:
class InsertionSort: public ISort
{
public:
    InsertionSort();
    ~InsertionSort();
    void Sort(int *array, int length);
    SortStats *Statistics();

private:
    SortStats *stats_;
};

#endif // INSERTION_SORT_H_


text:
[![CI Status](http://img.shields.io/travis/Creatiwity/VisualAnchors.svg?style=flat)](https://travis-ci.org/Creatiwity/VisualAnchors)
![Language](https://img.shields.io/badge/languages-Swift-orange.svg)
[![Version](https://img.shields.io/cocoapods/v/VisualAnchors.svg?style=flat)](http://cocoapods.org/pods/VisualAnchors)
[![License](https://img.shields.io/cocoapods/l/VisualAnchors.svg?style=flat)](http://cocoapods.org/pods/VisualAnchors)
[![Platform](https://img.shields.io/cocoapods/p/VisualAnchors.svg?style=flat)](http://cocoapods.org/pods/VisualAnchors)

## Usage

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

- iOS 8+
- Swift 4.0

## Installation

### CocoaPods

VisualAnchors is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "VisualAnchors"
```

### Swift Package Manager

You can use [The Swift Package Manager](https://swift.org/package-manager) to install `VisualAnchors` by adding the proper description to your `Package.swift` file:

```swift
import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    targets: [],
    dependencies: [
        .Package(url: "https://github.com/Creatiwity/VisualAnchors.git", majorVersion: 3)
    ]
)
```

Note that the [Swift Package Manager](https://swift.org/package-manager) is still in early design and development, for more infomation checkout its [GitHub Page](https://github.com/apple/swift-package-manager)

## Author

Creatiwity, contact@creatiwity.net

## License

VisualAnchors is available under the MIT license. See the LICENSE file for more info.


text:
package com.rcl.urbismobile.model.places;

import com.rcl.urbismobile.model.Place;
import com.rcl.urbismobile.model.PlaceType;

/**
 * Created by rcl2 on 18/09/2015.
 */
public class Teatro extends Place {

    public Teatro() {
    }

    @Override
    public PlaceType getPlaceType() {
        return PlaceType.TEATRO;
    }
}


text:
<?php

/** Enable W3 Total Cache */
define('WP_CACHE', true);

/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', getenv("DATABASE_NAME"));

/** MySQL database username */
define('DB_USER', getenv("DATABASE_USER"));

/** MySQL database password */
define('DB_PASSWORD', getenv("DATABASE_PASSWORD"));

/** MySQL hostname */
define('DB_HOST', getenv(strtoupper(getenv("DATABASE_SERVICE_NAME"))."_SERVICE_HOST"). ':' . getenv(strtoupper(getenv("DATABASE_SERVICE_NAME"))."_SERVICE_PORT"));

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
// This is where we define the OpenShift specific secure variable functions
require_once(getenv('HOME') . '/wp-includes/openshift.inc');

// Set the default keys to use
$_default_keys = array(
  'AUTH_KEY'          => 'GNUMqyq8Vy*mcwA5e_6^hNI4CrEK~$HU2CzGw65%C(l`;E|Dcu90!/hdVlm4E_bd',
  'SECURE_AUTH_KEY'   => '?EqRtd^`gG`Z|&x[ @ZR0udGQn~/]+%/fjsuPC?Np9B[Td7Cn6x^(b&CQ])--.fN',
  'LOGGED_IN_KEY'     => '-pa|qa7URoK 4mgViU%rNb3dg)4x?eV=yYf?uUhg/u8=B|Aj3wcA=PCW(.QxM#1O',
  'NONCE_KEY'         => '=vU!} E*#wSeq}iJC+N8HY3lXvg+xe.q-Ty|2lWPsETdPI&yGkZ2VXKnN?g)NTF%',
  'AUTH_SALT'         => ']!1Ue@m`%m#XD>o>%V0PNFS=r<fLj-|*+HB@8/Et>jATSL{{;sp,T1KVYQNzxWpr',
  'SECURE_AUTH_SALT'  => '4^|D+|kS!8H@Mf%vG#r)47Q|mA1-AG&:J}EWYIgx]7vu7Fk!+#-oL;=i$2y#]BPS',
  'LOGGED_IN_SALT'    => 'f,n}AR:%.|?{(zhoM9l,y`FP,:/:+dt*qsof(Nt4,Py$qXsSaY=?9b*,_3*C1/#@',
  'NONCE_SALT'        => 'X|1R9MPaCR2n7 +DWl*:UP5OR-1IG|Ws3* zYFm9?Xsbuwf#GfF]^br-t)98@8=8'
);

// This function gets called by openshift_secure and passes an array
function make_secure_key($args) {
  $hash = $args['hash'];
  $key  = $args['variable'];
  $original = $args['original'];

  $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  $chars .= '!@#$%^&*()';
  $chars .= '-_ []{}<>~`+=,.;:/?|';

  // Convert the hash to an int to seed the RNG
  srand(hexdec(substr($hash,0,8)));
  // Create a random string the same length as the default
  $val = '';
  for($i = 1; $i <= strlen($original); $i++){
    $val .= substr( $chars, rand(0,strlen($chars))-1, 1);
  }
  // Reset the RNG
  srand();
  // Set the value
  return $val;
}

// Generate OpenShift secure keys (or return defaults if not on OpenShift)
$array = openshift_secure($_default_keys,'make_secure_key');

// Loop through returned values and define them
foreach ($array as $key => $value) {
  define($key,$value);
}

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
	define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

/** Set wordpress to save everything on disk */
define('FS_METHOD', getenv("FS_METHOD"));


text:
package org.apache.commons.collections4.set;

import java.util.Iterator;
import java.util.NavigableSet;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.set.PredicatedSortedSet;

public class PredicatedNavigableSet<E> extends PredicatedSortedSet<E> implements NavigableSet<E>
{
    protected PredicatedNavigableSet() {}
    protected NavigableSet<E> decorated(){ return null; }
    protected PredicatedNavigableSet(NavigableSet<E> p0, Predicate<? super E> p1){}
    public E ceiling(E p0){ return null; }
    public E floor(E p0){ return null; }
    public E higher(E p0){ return null; }
    public E lower(E p0){ return null; }
    public E pollFirst(){ return null; }
    public E pollLast(){ return null; }
    public Iterator<E> descendingIterator(){ return null; }
    public NavigableSet<E> descendingSet(){ return null; }
    public NavigableSet<E> headSet(E p0, boolean p1){ return null; }
    public NavigableSet<E> subSet(E p0, boolean p1, E p2, boolean p3){ return null; }
    public NavigableSet<E> tailSet(E p0, boolean p1){ return null; }
    public static <E> PredicatedNavigableSet<E> predicatedNavigableSet(NavigableSet<E> p0, Predicate<? super E> p1){ return null; }
}


text:
package org.gradle.internal.snapshot.impl;

import com.google.common.collect.ImmutableList;
import org.gradle.internal.isolation.Isolatable;

import javax.annotation.Nullable;
import java.util.LinkedHashMap;
import java.util.Map;

public class IsolatedMap extends AbstractIsolatedMap<Map<Object, Object>> {
    public IsolatedMap(ImmutableList<MapEntrySnapshot<Isolatable<?>>> entries) {
        super(entries);
    }

    @Nullable
    @Override
    public Map<Object, Object> create() {
        return new LinkedHashMap<>(getEntries().size());
    }
}


text:
EONIL_PLATFORM_APPLE_CORE_GRAPHICS_NAMESPACE_BEGIN

DataProvider::DataProvider(CGDataProviderRef o) : Type(o)
{
}

DataProvider::operator CGDataProviderRef() const
{
	return	(CGDataProviderRef)operator CFTypeRef();
}

DataProvider::DataProvider(CoreFoundation::Data o) : Type(CGDataProviderCreateWithCFData(o))
{
}

auto
DataProvider::copyData() const -> CoreFoundation::Data
{
	return	CGDataProviderCopyData(*this);
}

EONIL_PLATFORM_APPLE_CORE_GRAPHICS_NAMESPACE_END


text:
const Promise = require("bluebird")
const tracker = require('../src/pitneybowesTracker')
require('./config') // global test config

const getInfo = Promise.promisify(tracker.getInfo)

test('extract info with success', () => {
    const id = 'UPAAA000000218364455'
    return getInfo(id).then(info => {
        expect(info.id).toBe(id)
        expect(info.destiny).toBe('PT - Seixal - Pinhal de Frades')
        expect(info.origin).toBe('GB - Hampshire - Portsmouth')
        expect(info.states.length).toBeGreaterThanOrEqual(3)

        let firstState = info.states[info.states.length - 1]
        expect(firstState.date).toBe("2017-04-05T08:42:26+00:00")
        expect(firstState.state).toContain("Tracking Details Uploaded")
    })
})

test('id not found', () => {
    const id = 'UPAAA000000'
    return expect(getInfo(id)).rejects.toBeDefined()
})


text:
module HtmlBuilder
  def markup(tag_name = nil, options = {})
    root = Nokogiri::HTML::DocumentFragment.parse('')
    Nokogiri::HTML::Builder.with(root) do |doc|
      if tag_name
        doc.send(tag_name, options) do
          yield(doc)
        end
      else
        yield(doc)
      end
    end
    root.to_html
  end
end


text:
<?php

namespace Pyrus\Installer\Role;

/**
 * Script role
 *
 * @category  Pyrus
 * @package   Pyrus
 * @author    Greg Beaver <cellog@php.net>
 * @copyright 2010 The PEAR Group
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @link      https://github.com/pyrus/Pyrus
 */
class Script extends \Pyrus\Installer\Role\Common {}
?>


text:
![lemon](http://postfiles15.naver.net/MjAxNzExMTdfODcg/MDAxNTEwOTI0NTIyNTcy.SCqfr7ib9Wk2oIbo_j-cezpB3IisLLNRhG9axzA-boEg.4rQHlt6V-TJEbTOfoVkush8oAUzLKIPa_tIrdfa8f80g.PNG.ninanung/%EB%A0%88%EB%AA%AC.png?type=w773)

I make this with Nodvel! Yeah!

## what is Nodvel?

Nodvel is compound word of node.js + novel, like name of "Renpy".

Sometimes, i want to make my own visual novel. And i know some guys want it too. But problem is, we don't know how to use tools. For using tools, we need to learn program language. Well, we can learn, but actually there's someone who don't want to learn. "I just want to make visual novel, not program!" and i think it is right.

So, simply, this project is visual novel making web service. I think this service must have some function.
1. People can sign in and log in.
2. People can make visual novel that has background, charactor and text. If i can do, plus BGM.
3. Making page must be comfortable and easy to make.
3. People can see other person's visual novel and write comment.
4. Also can give a 'Like' to novels.
5. People can see what novel has many 'Like'.

I make this for study. So i can't tell when this project end.

## How can i use this?

Here is a [manual](https://nodvel.herokuapp.com/help).

## I want to make Nodvel!

[Here!](https://nodvel.herokuapp.com)
https://nodvel.herokuapp.com
If you have 'CodeWatch' ID, don't have to sign in. You can just login with same ID and Password!

## Nodvel version 1.0.0 Example
![demon](http://postfiles3.naver.net/MjAxNzExMTdfNzQg/MDAxNTEwOTI0NTIyNTI0.vO_cd3tx-2N3UcEGOyRzRCIPp7wn46S6vLddu30fOZ4g.SHgtDjNdOJgGVmzxDhPiREMM6pcfOkBcX2QKzkcNExYg.PNG.ninanung/demon.png?type=w773)

Simple text page

![demon_choice](http://postfiles16.naver.net/MjAxNzExMTdfOTMg/MDAxNTEwOTI0NTIyNTc3.cOvT7bMMiI-UTSg8ZQW2FwqQWNK2PTlW9rjvUfapkvsg.Kh-HSRLVcniq4JSipZrTjXWMNP0UGvVQQNhECwg4z5Yg.PNG.ninanung/select.png?type=w773)

Use choice like this

Thanks to 'RM' for demon character!

## Used projects

### Platforms

- node.js
- mongoDB

## License

[MIT](LICENSE)


text:
<?xml version='1.0' encoding='UTF-8'?>
<resources>
  <string-array name="otr_options">
    <item>Tving / Krev</item>
    <item>Automatisk forsøk</item>
    <item>Som forespurt</item>
    <item>Deaktivert / Aldri</item>
  </string-array>
  <string-array name="otr_options_values">
    <item>tvinge</item>
    <item>automatisk</item>
    <item>på forespørsel</item>
    <item>deaktivert</item>
  </string-array>
</resources>


text:
TODO´s:
* cache-buster
* detail-page
* server-side-rendering
* user can change their passwords / email
* optimize navigation (dynamic-categories)
* unit-test-coverage
* better 404-page
* better error-handling
* http/2
* styled-components vs aphrodite


text:
	<title>Stephen Merchant's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Stephen Merchant's panel show appearances

Stephen Merchant (born 1974-11-24[ref]) has appeared in 2 episodes between 2013-2015.  Stephen Merchant on IMDB. Stephen Merchant on Wikipedia. Stephen Merchant on Chortle.

2013

2014

2015

2015-06-26 / The Last Leg

2013-10-18 / Have I Got News For You