text:
# liftoff [![Build Status](http://img.shields.io/travis/js-cli/js-liftoff.svg?label=travis-ci)](http://travis-ci.org/js-cli/js-liftoff) [![Build status](https://img.shields.io/appveyor/ci/phated/js-liftoff.svg?label=appveyor)](https://ci.appveyor.com/project/phated/js-liftoff)

> Launch your command line tool with ease.

[![NPM](https://nodei.co/npm/liftoff.png)](https://nodei.co/npm/liftoff/)

## What is it?
[See this blog post](http://weblog.bocoup.com/building-command-line-tools-in-node-with-liftoff/), [check out this proof of concept](https://github.com/js-cli/js-hacker), or read on.

Say you're writing a CLI tool.  Let's call it [hacker](https://github.com/js-cli/js-hacker).  You want to configure it using a `Hackerfile`.  This is node, so you install `hacker` locally for each project you use it in.  But, in order to get the `hacker` command in your PATH, you also install it globally.

Now, when you run `hacker`, you want to configure what it does using the `Hackerfile` in your current directory, and you want it to execute using the local installation of your tool.  Also, it'd be nice if the `hacker` command was smart enough to traverse up your folders until it finds a `Hackerfile`—for those times when you're not in the root directory of your project.  Heck, you might even want to launch `hacker` from a folder outside of your project by manually specifying a working directory.  Liftoff manages this for you.

So, everything is working great.  Now you can find your local `hacker` and `Hackerfile` with ease.  Unfortunately, it turns out you've authored your `Hackerfile` in coffee-script, or some other JS variant.  In order to support *that*, you have to load the compiler for it, and then register the extension for it with node.  Good news, Liftoff can do that, and a whole lot more, too.

## API

### constructor(opts)

Create an instance of Liftoff to invoke your application.

An example utilizing all options:
```js
const Hacker = new Liftoff({
  name: 'hacker',
  processTitle: 'hacker',
  moduleName: 'hacker',
  configName: 'hackerfile',
  extensions: {
    '.js': null,
    '.json': null,
    '.coffee': 'coffee-script/register'
  },
  v8flags: ['--harmony'] // or v8flags: require('v8flags')
});
```

#### opts.name

Sugar for setting `processTitle`, `moduleName`, `configName` automatically.

Type: `String`
Default: `null`

These are equivalent:
```js
const Hacker = Liftoff({
  processTitle: 'hacker',
  moduleName: 'hacker',
  configName: 'hackerfile'
});
```
```js
const Hacker = Liftoff({name:'hacker'});
```

#### opts.moduleName

Sets which module your application expects to find locally when being run.

Type: `String`
Default: `null`

#### opts.configName

Sets the name of the configuration file Liftoff will attempt to find.  Case-insensitive.

Type: `String`
Default: `null`

#### opts.extensions

Set extensions to include when searching for a configuration file.  If an external module is needed to load a given extension (e.g. `.coffee`), the module name should be specified as the value for the key.

Type: `Object`
Default: `{".js":null,".json":null}`

**Examples:**

In this example Liftoff will look for `myappfile{.js,.json,.coffee}`.  If a config with the extension `.coffee` is found, Liftoff will try to require `coffee-script/require` from the current working directory.
```js
const MyApp = new Liftoff({
  name: 'myapp',
  extensions: {
    '.js': null,
    '.json': null,
    '.coffee': 'coffee-script/register'
  }
});
```

In this example, Liftoff will look for `.myapp{rc}`.
```js
const MyApp = new Liftoff({
  name: 'myapp',
  configName: '.myapp',
  extensions: {
    'rc': null
  }
});
```

In this example, Liftoff will automatically attempt to load the correct module for any javascript variant supported by [interpret](https://github.com/js-cli/js-interpret) (as long as it does not require a register method).

```js
const MyApp = new Liftoff({
  name: 'myapp',
  extensions: require('interpret').jsVariants
});
```
#### opts.v8flags

Any flag specified here will be applied to node, not your program.  Useful for supporting invocations like `myapp --harmony command`, where `--harmony` should be passed to node, not your program. This functionality is implemented using [flagged-respawn](http://github.com/js-cli/js-flagged-respawn). To support all v8flags, see [v8flags](https://github.com/js-cli/js-v8flags).

Type: `Array|Function`
Default: `null`

If this method is a function, it should take a node-style callback that yields an array of flags.

#### opts.processTitle

Sets what the [process title](http://nodejs.org/api/process.html#process_process_title) will be.

Type: `String`
Default: `null`

#### opts.completions(type)

A method to handle bash/zsh/whatever completions.

Type: `Function`
Default: `null`

#### opts.configFiles

An object of configuration files to find. Each property is keyed by the default basename of the file being found, and the value is an object of [path arguments](#path-arguments) keyed by unique names.

__Note:__ This option is useful if, for example, you want to support an `.apprc` file in addition to an `appfile.js`. If you only need a single configuration file, you probably don't need this. In addition to letting you find multiple files, this option allows more fine-grained control over how configuration files are located.

Type: `Object`
Default: `null`

#### Path arguments

The [`fined`](https://github.com/js-cli/fined) module accepts a string representing the path to search or an object with the following keys:

* `path` __(required)__

  The path to search. Using only a string expands to this property.

  Type: `String`
  Default: `null`

* `name`

  The basename of the file to find. Extensions are appended during lookup.

  Type: `String`
  Default: Top-level key in `configFiles`

* `extensions`

  The extensions to append to `name` during lookup. See also: [`opts.extensions`](#optsextensions).

  Type: `String|Array|Object`
  Default: The value of [`opts.extensions`](#optsextensions)

* `cwd`

  The base directory of `path` (if relative).

  Type: `String`
  Default: The value of [`opts.cwd`](#optscwd)

* `findUp`

  Whether the `path` should be traversed up to find the file.

  Type: `Boolean`
  Default: `false`

**Examples:**

In this example Liftoff will look for the `.hacker.js` file relative to the `cwd` as declared in `configFiles`.
```js
const MyApp = new Liftoff({
  name: 'hacker',
  configFiles: {
    '.hacker': {
      cwd: '.'
    }
  }
});
```

In this example, Liftoff will look for `.hackerrc` in the home directory.
```js
const MyApp = new Liftoff({
  name: 'hacker',
  configFiles: {
    '.hacker': {
      home: {
        path: '~',
        extensions: {
          'rc': null
        }
      }
    }
  }
});
```

In this example, Liftoff will look in the `cwd` and then lookup the tree for the `.hacker.js` file.
```js
const MyApp = new Liftoff({
  name: 'hacker',
  configFiles: {
    '.hacker': {
      up: {
        path: '.',
        findUp: true
      }
    }
  }
});
```

In this example, the `name` is overridden and the key is ignored so Liftoff looks for `.override.js`.
```js
const MyApp = new Liftoff({
  name: 'hacker',
  configFiles: {
    hacker: {
      override: {
        path: '.',
        name: '.override'
      }
    }
  }
});
```

In this example, Liftoff will use the home directory as the `cwd` and looks for `~/.hacker.js`.
```js
const MyApp = new Liftoff({
  name: 'hacker',
  configFiles: {
    '.hacker': {
      home: {
        path: '.',
        cwd: '~'
      }
    }
  }
});
```

### prepare(opts, callback(env))

Prepares the environment for your application with provided options, and invokes your callback with the calculated environment as the first argument.  The environment can be modified before using it as the first argument to `execute`.

**Example Configuration w/ Options Parsing:**

```js
const Liftoff = require('liftoff');
const MyApp = new Liftoff({name:'myapp'});
const argv = require('minimist')(process.argv.slice(2));
const onExecute = function (env, argv) {
  // Do post-execute things
};
const onPrepare = function (env) {
  console.log('my environment is:', env);
  console.log('my liftoff config is:', this);
  MyApp.execute(env, onExecute);
};
MyApp.prepare({
  cwd: argv.cwd,
  configPath: argv.myappfile,
  preload: argv.preload,
  completion: argv.completion
}, onPrepare);
```

**Example w/ modified environment**

```js
const Liftoff = require('liftoff');
const Hacker = new Liftoff({
  name: 'hacker',
  configFiles: {
    '.hacker': {
      home: { path: '.', cwd: '~' }
    }
  }
});
const onExecute = function (env, argv) {
  // Do post-execute things
};
const onPrepare = function (env) {
   env.configProps = ['home', 'cwd'].map(function(dirname) {
    return env.configFiles['.hacker'][dirname]
  }).filter(function(filePath) {
    return Boolean(filePath);
  }).reduce(function(config, filePath) {
    return mergeDeep(config, require(filePath));
  }, {});

  if (env.configProps.hackerfile) {
    env.configPath = path.resolve(env.configProps.hackerfile);
    env.configBase = path.dirname(env.configPath);
  }

  Hacker.execute(env, onExecute);
};
Hacker.prepare({}, onPrepare);
```

#### opts.cwd

Change the current working directory for this launch. Relative paths are calculated against `process.cwd()`.

Type: `String`
Default: `process.cwd()`

**Example Configuration:**
```js
const argv = require('minimist')(process.argv.slice(2));
MyApp.launch({
  cwd: argv.cwd
}, invoke);
```

**Matching CLI Invocation:**
```
myapp --cwd ../
```

#### opts.configPath

Don't search for a config, use the one provided. **Note:** Liftoff will assume the current working directory is the directory containing the config file unless an alternate location is explicitly specified using `cwd`.

Type: `String`
Default: `null`

**Example Configuration:**
```js
var argv = require('minimist')(process.argv.slice(2));
MyApp.launch({
  configPath: argv.myappfile
}, invoke);
```

**Matching CLI Invocation:**
```
myapp --myappfile /var/www/project/Myappfile.js
```

**Examples using `cwd` and `configPath` together:**

These are functionally identical:
```
myapp --myappfile /var/www/project/Myappfile.js
myapp --cwd /var/www/project
```

These can run myapp from a shared directory as though it were located in another project:
```
myapp --myappfile /Users/name/Myappfile.js --cwd /var/www/project1
myapp --myappfile /Users/name/Myappfile.js --cwd /var/www/project2
```

#### opts.preload

A string or array of modules to attempt requiring from the local working directory before invoking the launch callback.

Type: `String|Array`
Default: `null`

**Example Configuration:**
```js
var argv = require('minimist')(process.argv.slice(2));
MyApp.launch({
  preload: argv.preload
}, invoke);
```

**Matching CLI Invocation:**
```js
myapp --preload coffee-script/register
```

#### callback(env)

A function called after your environment is prepared.  A good place to modify the environment before calling `execute`.  When invoked, `this` will be your instance of Liftoff. The `env` param will contain the following keys:

- `cwd`: the current working directory
- `preload`: an array of modules that liftoff tried to pre-load
- `configNameSearch`: the config files searched for
- `configPath`: the full path to your configuration file (if found)
- `configBase`: the base directory of your configuration file (if found)
- `modulePath`: the full path to the local module your project relies on (if found)
- `modulePackage`: the contents of the local module's package.json (if found)
- `configFiles`: an object of filepaths for each found config file (filepath values will be null if not found)

### execute(env, [forcedFlags], callback(env, argv))

A function to start your application, based on the `env` given.  Optionally takes an array of `forcedFlags`, which will force a respawn with those node or V8 flags during startup.  Invokes your callback with the environment and command-line arguments (minus node & v8 flags) after the application has been executed.

**Example:**

```js
const Liftoff = require('liftoff');
const MyApp = new Liftoff({name:'myapp'});
const onExecute = function (env, argv) {
  // Do post-execute things
  console.log('my environment is:', env);
  console.log('my cli options are:', argv);
  console.log('my liftoff config is:', this);
};
const onPrepare = function (env) {
  var forcedFlags = ['--trace-deprecation'];
  MyApp.execute(env, forcedFlags, onExecute);
};
MyApp.prepare({}, onPrepare);
```

#### callback(env, argv)

A function called after your application is executed.  When invoked, `this` will be your instance of Liftoff, `argv` will be all command-line arguments (minus node & v8 flags), and `env` will contain the following keys:

- `cwd`: the current working directory
- `preload`: an array of modules that liftoff tried to pre-load
- `configNameSearch`: the config files searched for
- `configPath`: the full path to your configuration file (if found)
- `configBase`: the base directory of your configuration file (if found)
- `modulePath`: the full path to the local module your project relies on (if found)
- `modulePackage`: the contents of the local module's package.json (if found)
- `configFiles`: an object of filepaths for each found config file (filepath values will be null if not found)

### events

#### `on('preload:before', function(name) {})`

Emitted before a module is pre-load. (But for only a module which is specified by `opts.preload`.)

```js
var Hacker = new Liftoff({name:'hacker', preload:'coffee-script'});
Hacker.on('preload:before', function (name) {
  console.log('Requiring external module: '+name+'...');
});
```

#### `on('preload:success', function(name, module) {})`

Emitted when a module has been pre-loaded.

```js
var Hacker = new Liftoff({name:'hacker'});
Hacker.on('preload:success', function (name, module) {
  console.log('Required external module: '+name+'...');
  // automatically register coffee-script extensions
  if (name === 'coffee-script') {
    module.register();
  }
});
```

#### `on('preload:failure', function(name, err) {})`

Emitted when a requested module cannot be preloaded.

```js
var Hacker = new Liftoff({name:'hacker'});
Hacker.on('preload:failure', function (name, err) {
  console.log('Unable to load:', name, err);
});
```

#### `on('loader:success, function(name, module) {})`

Emitted when a loader that matches an extension has been loaded.

```js
var Hacker = new Liftoff({
  name: 'hacker',
  extensions: {
    '.ts': 'ts-node/register'
  }
});
Hacker.on('loader:success', function (name, module) {
  console.log('Required external module: '+name+'...');
});
```

#### `on('loader:failure', function(name, err) {})`

Emitted when no loader for an extension can be loaded. Emits an error for each failed loader.

```js
var Hacker = new Liftoff({
  name: 'hacker',
  extensions: {
    '.ts': 'ts-node/register'
  }
});
Hacker.on('loader:failure', function (name, err) {
  console.log('Unable to load:', name, err);
});
```

#### `on('respawn', function(flags, child) {})`

Emitted when Liftoff re-spawns your process (when a [`v8flags`](#optsv8flags) is detected).

```js
var Hacker = new Liftoff({
  name: 'hacker',
  v8flags: ['--harmony']
});
Hacker.on('respawn', function (flags, child) {
  console.log('Detected node flags:', flags);
  console.log('Respawned to PID:', child.pid);
});
```

Event will be triggered for this command:
`hacker --harmony commmand`

## Examples

Check out how [gulp](https://github.com/gulpjs/gulp-cli/blob/master/index.js) uses Liftoff.

For a bare-bones example, try [the hacker project](https://github.com/js-cli/js-hacker/blob/master/bin/hacker.js).

To try the example, do the following:

1. Install the sample project `hacker` with `npm install -g hacker`.
2. Make a `Hackerfile.js` with some arbitrary javascript it.
3. Install hacker next to it with `npm install hacker`.
3. Run `hacker` while in the same parent folder.


text:
<?xml version="1.0" encoding="utf-8"?>
<!--Draws a view with a transparent border around the screen and a whole cut out in the middle.  Used-->
<!--for highlighting the tile download area when creating a new tile layer-->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:visibility="gone">

    <!--Shaded borders with a slight transparency-->
    <View
        android:id="@+id/transparent_box"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/trans_border"
        android:layout_marginBottom="144dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <!--Cutout box in the middle of the shaded area-->
    <View
        android:id="@+id/transparent_measurement"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/transparent"
        android:layout_marginBottom="172dp"
        android:layout_marginTop="64dp"
        android:layout_marginRight="64dp"
        android:layout_marginLeft="64dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <!--Button in bottom left corner of transparent box that shows the layers selection view -->
    <ImageView
        android:id="@+id/layersButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="58dp"
        android:layout_marginBottom="53dp"
        android:background="#00BCD4"
        android:src="@drawable/ic_layers"
        android:visibility="invisible"
        app:layout_constraintBottom_toBottomOf="@+id/transparent_box"
        app:layout_constraintStart_toStartOf="@+id/transparent_box" />

    <!--Layout holding the bottom bottons and text-->
    <LinearLayout
        android:orientation="vertical"
        android:id="@+id/shade_button_holder"
        android:layout_width="match_parent"
        android:layout_height="144dp"
        android:background="@color/black87"
        android:paddingHorizontal="16dp"
        android:paddingTop="16dp"
        app:layout_constraintTop_toBottomOf="@+id/transparent_box">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/draw_layer_instruction"
            android:textColor="@color/offwhite"/>

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_margin="16dp">

            <Button
                android:id="@+id/tile_area_select_cancel"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:text="Cancel"
                android:textColor="@color/black87"
                android:backgroundTint="@color/black50"
                />

            <Button
                android:id="@+id/tile_area_select_next"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:text="Next"
                android:textColor="@color/offwhite"
                android:backgroundTint="@color/nga_accent_primary"/>
        </LinearLayout>

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

redpajama_set_name: RedPajamaGithub


text:
#region license
// Sqloogle
// Copyright 2013-2017 Dale Newman
//
// 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.
#endregion
using System;
using NLog;
using Sqloogle.Libs.DBDiff.Schema.Model;
namespace Sqloogle.Libs.DBDiff.Schema.SqlServer2005.Model {
    public class TableType : SQLServerSchemaBase, ITable<TableType> {
        private readonly Logger _logger = LogManager.GetLogger("DbDiff");
        private Columns<TableType> columns;
        private SchemaList<Constraint, TableType> constraints;
        private SchemaList<Index, TableType> indexes;

        public TableType(Database parent)
            : base(parent, Enums.ObjectType.TableType) {
            columns = new Columns<TableType>(this);
            constraints = new SchemaList<Constraint, TableType>(this, parent.AllObjects);
            indexes = new SchemaList<Index, TableType>(this, parent.AllObjects);
        }

        public Columns<TableType> Columns
        {
            get { return columns; }
        }

        public SchemaList<Constraint, TableType> Constraints
        {
            get { return constraints; }
        }

        public SchemaList<Index, TableType> Indexes
        {
            get { return indexes; }
        }

        public override string ToSql() {
            string sql = "";
            if (columns.Count > 0) {
                sql += "CREATE TYPE " + FullName + " AS TABLE\r\n(\r\n";
                sql += columns.ToSql() + "\r\n";
                sql += constraints.ToSql();
                sql += ")";
                sql += "\r\nGO\r\n";
            }
            return sql;
        }

        public override string ToSqlDrop() {
            return "DROP TYPE " + FullName + "\r\nGO\r\n";
        }

        public override string ToSqlAdd() {
            return ToSql();
        }

        public override SQLScript Create() {
            Enums.ScripActionType action = Enums.ScripActionType.AddTableType;
            if (!GetWasInsertInDiffList(action)) {
                SetWasInsertInDiffList(action);
                return new SQLScript(this.ToSqlAdd(), 0, action);
            } else
                return null;
        }

        public override SQLScript Drop() {
            Enums.ScripActionType action = Enums.ScripActionType.DropTableType;
            if (!GetWasInsertInDiffList(action)) {
                SetWasInsertInDiffList(action);
                return new SQLScript(this.ToSqlDrop(), 0, action);
            } else
                return null;
        }

        public override SQLScriptList ToSqlDiff() {
            try {
                SQLScriptList list = new SQLScriptList();
                if (this.Status == Enums.ObjectStatusType.DropStatus) {
                    list.Add(Drop());
                }
                if (this.HasState(Enums.ObjectStatusType.CreateStatus)) {
                    list.Add(Create());
                }
                if (this.Status == Enums.ObjectStatusType.AlterStatus) {
                    list.Add(ToSqlDrop() + ToSql(), 0, Enums.ScripActionType.AddTableType);
                }
                return list;
            } catch (Exception ex) {
                _logger.Error(ex, ex.Message);
                return null;
            }
        }
    }
}


text:
  Douvres est
       un village
       géographiquement positionné dans le département de l'Ain en Rhône-Alpes. Elle comptait 915 habitants en 2008.

Le nombre de logements, à Douvres, se décomposait en 2011 en 31 appartements et 388 maisons soit
 un marché plutôt équilibré.

À proximité de Douvres sont situées les villes de
Saint-Rambert-en-Bugey située à 6 km, 2 166 habitants,
Saint-Jean-le-Vieux localisée à 4 km, 1 533 habitants,
Château-Gaillard localisée à 5 km, 1 668 habitants,
Priay à 6 km, 1 399 habitants,
Nivollet-Montgriffon à 5 km, 127 habitants,
Jujurieux à 6 km, 1 950 habitants,
 entre autres. De plus, Douvres est située à seulement 26 km de Bourg-en-Bresse.

À Douvres, la valeur moyenne à la vente d'un appartement s'évalue à 2 678 € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 749 € du m². À la location la valeur moyenne se situe à 9,1 € du m² mensuel.

Si vous pensez venir habiter à Douvres, vous pourrez facilement trouver une maison à vendre.


text:
/* Test of mini table accessors.
 *
 * Messages are created and mutated using generated code, and then
 * accessed through reflective APIs exposed through mini table accessors.
 */

#include "upb/mini_table_accessors.h"

#include "gtest/gtest.h"
#include "google/protobuf/test_messages_proto2.upb.h"
#include "google/protobuf/test_messages_proto3.upb.h"
#include "upb/array.h"
#include "upb/mini_table.h"
#include "upb/test.upb.h"

namespace {

// Proto2 test messages field numbers used for reflective access.
const uint32_t kFieldOptionalInt32 = 1;
const uint32_t kFieldOptionalUInt32 = 3;
const uint32_t kFieldOptionalBool = 13;
const uint32_t kFieldOptionalString = 14;
const uint32_t kFieldOptionalNestedMessage = 18;
const uint32_t kFieldOptionalRepeatedInt32 = 31;
const uint32_t kFieldOptionalNestedMessageA = 1;
const uint32_t kFieldOptionalOneOfUInt32 = 111;
const uint32_t kFieldOptionalOneOfString = 113;

const uint32_t kFieldProto3OptionalInt64 = 2;
const uint32_t kFieldProto3OptionalUInt64 = 4;

const char kTestStr1[] = "Hello1";
const char kTestStr2[] = "Hello2";
const int32_t kTestInt32 = 567;
const int32_t kTestUInt32 = 0xF1234567;
const uint64_t kTestUInt64 = 0xFEDCBAFF87654321;

const upb_MiniTable_Field* find_proto3_field(int field_number) {
  return upb_MiniTable_FindFieldByNumber(
      &protobuf_test_messages_proto3_TestAllTypesProto3_msginit, field_number);
}

const upb_MiniTable_Field* find_proto2_field(int field_number) {
  return upb_MiniTable_FindFieldByNumber(
      &protobuf_test_messages_proto2_TestAllTypesProto2_msginit, field_number);
}

TEST(GeneratedCode, HazzersProto2) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto2_TestAllTypesProto2* msg =
      protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);

  // Scalar/Boolean.
  const upb_MiniTable_Field* optional_bool_field =
      find_proto2_field(kFieldOptionalBool);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_bool_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_bool(msg, true);
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_bool_field));
  upb_MiniTable_ClearField(msg, optional_bool_field);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_bool_field));
  EXPECT_EQ(
      false,
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_bool(msg));

  // String.
  const upb_MiniTable_Field* optional_string_field =
      find_proto2_field(kFieldOptionalString);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_string(
      msg, upb_StringView_FromString(kTestStr1));
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_string_field));
  EXPECT_EQ(
      strlen(kTestStr1),
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg)
          .size);
  upb_MiniTable_ClearField(msg, optional_string_field);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field));
  EXPECT_EQ(
      0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg)
             .size);

  // Message.
  const upb_MiniTable_Field* optional_message_field =
      find_proto2_field(kFieldOptionalNestedMessage);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_mutable_optional_nested_message(
      msg, arena);
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_message_field));
  upb_MiniTable_ClearField(msg, optional_message_field);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field));
  EXPECT_EQ(
      true,
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message(
          msg) == nullptr);

  // One of.
  const upb_MiniTable_Field* optional_oneof_uint32_field =
      find_proto2_field(kFieldOptionalOneOfUInt32);
  const upb_MiniTable_Field* optional_oneof_string_field =
      find_proto2_field(kFieldOptionalOneOfString);

  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field));
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_string_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_set_oneof_uint32(msg, 123);
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_oneof_uint32_field));
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_string_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_set_oneof_string(
      msg, upb_StringView_FromString(kTestStr1));
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field));
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_oneof_string_field));
  upb_MiniTable_ClearField(msg, optional_oneof_uint32_field);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field));
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_oneof_string_field));
  upb_MiniTable_ClearField(msg, optional_oneof_string_field);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field));
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_string_field));

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, ScalarsProto2) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto2_TestAllTypesProto2* msg =
      protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);

  const upb_MiniTable_Field* optional_int32_field =
      find_proto2_field(kFieldOptionalInt32);

  EXPECT_EQ(
      0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg));

  EXPECT_EQ(0, upb_MiniTable_GetInt32(msg, optional_int32_field));
  upb_MiniTable_SetInt32(msg, optional_int32_field, kTestInt32);
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_int32_field));
  EXPECT_EQ(kTestInt32, upb_MiniTable_GetInt32(msg, optional_int32_field));
  EXPECT_EQ(
      kTestInt32,
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg));

  const upb_MiniTable_Field* optional_uint32_field =
      find_proto2_field(kFieldOptionalUInt32);

  EXPECT_EQ(
      0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg));
  EXPECT_EQ(0, upb_MiniTable_GetUInt32(msg, optional_uint32_field));
  upb_MiniTable_SetUInt32(msg, optional_uint32_field, kTestUInt32);
  EXPECT_EQ(kTestUInt32, upb_MiniTable_GetUInt32(msg, optional_uint32_field));
  EXPECT_EQ(
      kTestUInt32,
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg));

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, ScalarProto3) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto3_TestAllTypesProto3* msg =
      protobuf_test_messages_proto3_TestAllTypesProto3_new(arena);

  const upb_MiniTable_Field* optional_int64_field =
      find_proto3_field(kFieldProto3OptionalInt64);
  const upb_MiniTable_Field* optional_uint64_field =
      find_proto3_field(kFieldProto3OptionalUInt64);

  EXPECT_EQ(
      0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg));
  upb_MiniTable_SetInt64(msg, optional_int64_field, -1);
  EXPECT_EQ(
      -1, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg));
  EXPECT_EQ(-1, upb_MiniTable_GetInt64(msg, optional_int64_field));

  EXPECT_EQ(
      0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg));
  upb_MiniTable_SetUInt64(msg, optional_uint64_field, kTestUInt64);
  EXPECT_EQ(
      kTestUInt64,
      protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg));
  EXPECT_EQ(kTestUInt64, upb_MiniTable_GetUInt64(msg, optional_uint64_field));

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, Strings) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto2_TestAllTypesProto2* msg =
      protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);

  const upb_MiniTable_Field* optional_string_field =
      find_proto2_field(kFieldOptionalString);

  // Test default.
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field));
  // Test read after write using C.
  protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_string(
      msg, upb_StringView_FromString(kTestStr1));
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_string_field));
  upb_StringView value = upb_MiniTable_GetString(msg, optional_string_field);
  std::string read_value = std::string(value.data, value.size);
  EXPECT_EQ(kTestStr1, read_value);
  // Clear.
  upb_MiniTable_ClearField(msg, optional_string_field);
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field));
  EXPECT_EQ(
      false,
      protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string(
          msg));
  upb_MiniTable_SetString(msg, optional_string_field,
                          upb_StringView_FromString(kTestStr2));
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_string_field));
  EXPECT_EQ(
      true,
      protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string(
          msg));
  value = protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg);
  read_value = std::string(value.data, value.size);
  EXPECT_EQ(kTestStr2, read_value);

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, SubMessage) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto2_TestAllTypesProto2* msg =
      protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);

  const upb_MiniTable_Field* optional_message_field =
      find_proto2_field(kFieldOptionalNestedMessage);

  const upb_Message* test_message =
      upb_MiniTable_GetMessage(msg, optional_message_field);
  EXPECT_EQ(NULL, test_message);

  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field));

  // Get mutable using C API.
  protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage* nested_message =
      protobuf_test_messages_proto2_TestAllTypesProto2_mutable_optional_nested_message(
          msg, arena);
  EXPECT_EQ(true, nested_message != nullptr);
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_message_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_set_a(
      nested_message, 5);

  // Read back using mini table API.
  const upb_Message* sub_message =
      upb_MiniTable_GetMessage(msg, optional_message_field);
  EXPECT_EQ(true, sub_message != NULL);

  const upb_MiniTable_Field* nested_message_a_field =
      upb_MiniTable_FindFieldByNumber(
          &protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_msginit,
          kFieldOptionalNestedMessageA);
  EXPECT_EQ(5, upb_MiniTable_GetInt32(sub_message, nested_message_a_field));

  upb_MiniTable_ClearField(msg, optional_message_field);
  EXPECT_EQ(
      NULL,
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message(
          msg));
  EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field));

  upb_Message* new_nested_message =
      protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_new(arena);
  upb_MiniTable_SetInt32(new_nested_message, nested_message_a_field, 123);
  upb_MiniTable_SetMessage(msg, optional_message_field, new_nested_message);

  upb_Message* mutable_message = upb_MiniTable_GetMutableMessage(
      msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msginit,
      optional_message_field, arena);
  EXPECT_EQ(
      true,
      protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message(
          msg) != NULL);
  EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_message_field));
  EXPECT_EQ(123,
            upb_MiniTable_GetInt32(mutable_message, nested_message_a_field));

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, RepeatedScalar) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto2_TestAllTypesProto2* msg =
      protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);

  const upb_MiniTable_Field* repeated_int32_field =
      find_proto2_field(kFieldOptionalRepeatedInt32);

  size_t len;
  const int32_t* arr =
      protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg,
                                                                      &len);
  // Test Get/Set Array values, validate with C API.
  EXPECT_EQ(0, len);
  EXPECT_EQ(NULL, arr);
  EXPECT_EQ(NULL, upb_MiniTable_GetArray(msg, repeated_int32_field));
  protobuf_test_messages_proto2_TestAllTypesProto2_resize_repeated_int32(
      msg, 10, arena);
  int32_t* mutable_values =
      protobuf_test_messages_proto2_TestAllTypesProto2_mutable_repeated_int32(
          msg, &len);
  mutable_values[5] = 123;
  const upb_Array* readonly_arr =
      upb_MiniTable_GetArray(msg, repeated_int32_field);
  EXPECT_EQ(123, upb_Array_Get(readonly_arr, 5).int32_val);

  upb_MessageValue new_value;
  new_value.int32_val = 567;
  upb_Array* mutable_array =
      upb_MiniTable_GetMutableArray(msg, repeated_int32_field);
  upb_Array_Set(mutable_array, 5, new_value);
  EXPECT_EQ(new_value.int32_val,
            protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(
                msg, &len)[5]);

  // Test resize.
  bool result = upb_Array_Resize(mutable_array, 20, arena);
  EXPECT_EQ(true, result);
  upb_Array_Set(mutable_array, 19, new_value);
  EXPECT_EQ(new_value.int32_val,
            protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(
                msg, &len)[19]);
  upb_Array_Resize(mutable_array, 0, arena);
  const int32_t* zero_length_array =
      protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg,
                                                                      &len);
  EXPECT_EQ(0, len);
  EXPECT_EQ(true, zero_length_array != NULL);

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, GetMutableMessage) {
  upb_Arena* arena = upb_Arena_New();
  protobuf_test_messages_proto2_TestAllTypesProto2* msg =
      protobuf_test_messages_proto2_TestAllTypesProto2_new(arena);
  // Message.
  const upb_MiniTable_Field* optional_message_field =
      find_proto2_field(kFieldOptionalNestedMessage);
  upb_Message* msg1 = upb_MiniTable_GetMutableMessage(
      msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msginit,
      optional_message_field, arena);
  upb_Message* msg2 = upb_MiniTable_GetMutableMessage(
      msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msginit,
      optional_message_field, arena);
  // Verify that newly constructed sub message is stored in msg.
  EXPECT_EQ(msg1, msg2);

  upb_Arena_Free(arena);
}

TEST(GeneratedCode, Extensions) {
  upb_Arena* arena = upb_Arena_New();
  upb_test_ModelWithExtensions* msg = upb_test_ModelWithExtensions_new(arena);
  upb_test_ModelWithExtensions_set_random_int32(msg, 10);
  upb_test_ModelWithExtensions_set_random_name(
      msg, upb_StringView_FromString("Hello"));

  upb_test_ModelExtension1* extension1 = upb_test_ModelExtension1_new(arena);
  upb_test_ModelExtension1_set_str(extension1,
                                   upb_StringView_FromString("World"));

  upb_test_ModelExtension2* extension2 = upb_test_ModelExtension2_new(arena);
  upb_test_ModelExtension2_set_i(extension2, 5);

  upb_test_ModelExtension1_set_model_ext(msg, extension1, arena);
  upb_test_ModelExtension2_set_model_ext(msg, extension2, arena);

  size_t serialized_size;
  char* serialized =
      upb_test_ModelWithExtensions_serialize(msg, arena, &serialized_size);

  // Test known GetExtension
  const upb_Message_Extension* upb_ext2;
  upb_GetExtension_Status promote_status = upb_MiniTable_GetOrPromoteExtension(
      msg, &upb_test_ModelExtension2_model_ext_ext, 0, arena, &upb_ext2);

  upb_test_ModelExtension2* ext2 =
      (upb_test_ModelExtension2*)upb_ext2->data.ptr;
  EXPECT_EQ(kUpb_GetExtension_Ok, promote_status);
  EXPECT_EQ(5, upb_test_ModelExtension2_i(ext2));

  upb_test_EmptyMessageWithExtensions* base_msg =
      upb_test_EmptyMessageWithExtensions_parse(serialized, serialized_size,
                                                arena);

  // Get unknown extension bytes before promotion.
  const char* extension_data;
  size_t len;
  upb_GetExtensionAsBytes_Status status = status =
      upb_MiniTable_GetExtensionAsBytes(base_msg,
                                        &upb_test_ModelExtension2_model_ext_ext,
                                        0, arena, &extension_data, &len);
  EXPECT_EQ(kUpb_GetExtensionAsBytes_Ok, status);
  EXPECT_EQ(0x48, extension_data[0]);
  EXPECT_EQ(5, extension_data[1]);

  // Test unknown GetExtension.
  promote_status = upb_MiniTable_GetOrPromoteExtension(
      base_msg, &upb_test_ModelExtension2_model_ext_ext, 0, arena, &upb_ext2);

  ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr;
  EXPECT_EQ(kUpb_GetExtension_Ok, promote_status);
  EXPECT_EQ(5, upb_test_ModelExtension2_i(ext2));

  // Get unknown extension bytes after promotion.
  status = upb_MiniTable_GetExtensionAsBytes(
      base_msg, &upb_test_ModelExtension2_model_ext_ext, 0, arena,
      &extension_data, &len);
  EXPECT_EQ(kUpb_GetExtensionAsBytes_Ok, status);
  EXPECT_EQ(0x48, extension_data[0]);
  EXPECT_EQ(5, extension_data[1]);

  upb_Arena_Free(arena);
}

}  // namespace


text:
// Customize the spinner shown during page loads
Meteor.Spinner.options = {
  lines: 16, // The number of lines to draw
  length: 20, // The length of each line
  width: 2, // The line thickness
  corners: 0.9, // Corner roundness (0..1)
  color: '#000000', // #rgb or #rrggbb
  speed: 2.5, // Rounds per second
  trail: 10 // Afterglow percentage
};

/* Put client javascript here */


text:
<?php

namespace ScaliantretienBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class NiveauType extends AbstractType
{
    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('label');
    }

    /**
     * {@inheritdoc}
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'ScaliantretienBundle\Entity\Niveau'
        ));
    }

    /**
     * {@inheritdoc}
     */
    public function getBlockPrefix()
    {
        return 'scaliantretienbundle_niveau';
    }

}


text:
package com.cartodb.impl;

import com.cartodb.CartoDBClientIF;
import com.cartodb.CartoDBException;

import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;

/**
 * CartoDB client implementation to access protected resources on CartoDB using OAuth.
 * You can perform any SQL queries so please, be careful.
 * @author canadensys
 *
 */
public class ApiKeyCartoDBClient extends CartoDBClientIF {

    private static final String DEFAULT_API_VERSION = "2";
    private static final String ENCODING = "UTF-8";

    private static final String SQL_API_BASE_URL = "https://%s.cartodb.com/api/v%s/sql/";

    private String user;
    private String apiVersion = DEFAULT_API_VERSION;
    private String apiURL = null;

    /**
     * aki key, it can be found in your dashboard
     */
    private String apiKey;

    /**
     * Default constructor
     */
    public ApiKeyCartoDBClient(){}

    /**
     * After this constructor, the object is ready to use.
     * @param user
     * @param apiKey api provided by cartodb to access to secured resources
     * @throws CartoDBException
     */
    public ApiKeyCartoDBClient(String user, String apiKey) throws CartoDBException {
        this.user = user;
        this.apiKey = apiKey;
        if(this.apiKey == null || this.apiKey.length() == 0) {
            throw new CartoDBException("provided API key is not valid");
        }
        init();
    }

    /**
     * Initialization method for a regular CartoDB client.
     * You only need it if you're using the default constructor.
     */
    public void init(){
        apiURL = String.format(SQL_API_BASE_URL, user, apiVersion);
    }

    /**
     * Send a sqlQuery to the CartoDB server.
     * The query will be sent in a URL parameter of a GET so, you should avoid very large query string.
     * @param sqlQuery
     * @throws CartoDBException
     */
    public String executeQuery(String sqlQuery) throws CartoDBException {
        String json = null;

        if(apiURL == null){
            System.out.println("Error : uninitialized " + getClass().getName());
            return null;
        }

        boolean doPost = CartoDBClientIF.isWriteQuery(sqlQuery) || sqlQuery.length() >= MAX_SQL_GET_LENGTH;
        try {
            sqlQuery = URLEncoder.encode(sqlQuery, ENCODING);
            String params = "q=" + sqlQuery + "&api_key=" + this.apiKey;
            if(doPost) {
            	URL url = new URL(apiURL);
            	HttpURLConnection conn = (HttpURLConnection)url.openConnection();
                conn.setDoOutput(true);
                conn.setDoInput(true);
                conn.setRequestMethod("POST");
                OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
                wr.write(params);
                wr.flush();
                wr.close();
                json = IOUtils.toString(conn.getInputStream(), ENCODING);
            } else {
            	json = IOUtils.toString(new URL(apiURL + "?" + params), ENCODING);
            }

        } catch (MalformedURLException e) {
            throw new CartoDBException("Could not get URL " + apiURL + sqlQuery);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }catch (IOException e) {
        	e.printStackTrace();
            throw new CartoDBException("Could not execute " + sqlQuery + " on CartoDB : ");
        }
        return json;
    }

    public void setUser(String user){
        this.user = user;
    }

    /**
     * Set the API version to use.
     * @param apiVersion number part only as String
     */
    public void setApiVersion(String apiVersion){
        this.apiVersion = apiVersion;
    }

}


text:
#ifndef __ASM_ARCH_MSM_IOMAP_SAMARIUM_H
#define __ASM_ARCH_MSM_IOMAP_SAMARIUM_H

/* Physical base address and size of peripherals.
 * Ordered by the virtual base addresses they will be mapped at.
 *
 * If you add or remove entries here, you'll want to edit the
 * io desc array in arch/arm/mach-msm/io.c to reflect your
 * changes.
 *
 */

#define MSMSAMARIUM_SHARED_RAM_PHYS	0x0FA00000

#define MSMSAMARIUM_QGIC_DIST_PHYS	0xF9000000
#define MSMSAMARIUM_QGIC_DIST_SIZE	SZ_4K

#define MSMSAMARIUM_TLMM_PHYS	0xFD510000
#define MSMSAMARIUM_TLMM_SIZE	SZ_16K

#define MSMSAMARIUM_MPM2_PSHOLD_PHYS	0xFC4AB000
#define MSMSAMARIUM_MPM2_PSHOLD_SIZE	SZ_4K

#ifdef CONFIG_DEBUG_MSMSAMARIUM_UART
#define MSM_DEBUG_UART_BASE	IOMEM(0xFA71E000)
#define MSM_DEBUG_UART_PHYS	0xF991E000
#endif

#endif


text:
package main

import (
	"bufio"
	"flag"
	"fmt"
	"io"
	"log"
	"os"
	"strings"
	"time"
)

var (
	layout        = "2006/01/02-15:04:05.000000"
	flagFromStart = flag.Bool("s", false, "calc time from start")
	flagFromLast  = flag.Bool("i", false, "calc time from last line")
	isShowDoc     = flag.Bool("h", false, "show help")
	lastTime      = time.Now()
	T             = map[rune]int64{
		's': 1e9,
		'm': 1e9 * 60,
		'h': 1e9 * 60 * 60,
		'd': 1e9 * 60 * 60 * 24,
	}
)

const doc = `
NAME
       ts - timestamp input

SYNOPSIS
       ts [-i | -s] [format]

DESCRIPTION
       ts adds a timestamp to the beginning of each line of input.

       The optional format parameter controls how the timestamp is formatted, as used by go time format. The default format is "2006/01/02-15:04:05.000000".

       If the -i or -s switch is passed, ts timestamps incrementally instead. In case of -i, every timestamp will be the time elapsed since the last timestamp.
       In case of -s, the time elapsed since start of the program is used.  The default format changes to "{ts}", it will show time used like "1d20h30m40.555555s".`

func calcTime(cost int64) (ret string) {
	for _, r := range "dhm" {
		if t := cost / T[rune(r)]; t > 0 {
			ret += fmt.Sprintf("%d%c", t, r)
			cost -= t * T[rune(r)]
		}
	}
	ret += fmt.Sprintf("%.6fs", float64(cost)/float64(T['s']))
	ret = strings.Replace(layout, "{ts}", ret, 1)
	return
}

func doFormat(line string) {
	var fmtTime string
	if *flagFromStart {
		fmtTime = calcTime(time.Now().Sub(lastTime).Nanoseconds())
	} else if *flagFromLast {
		now := time.Now()
		fmtTime = calcTime(now.Sub(lastTime).Nanoseconds())
		lastTime = now
	} else {
		fmtTime = time.Now().Format(layout)
	}
	fmt.Printf("%s %s", fmtTime, line)
}

func main() {
	flag.Parse()
	if *isShowDoc {
		fmt.Println(doc)
		return
	}
	if *flagFromStart || *flagFromLast {
		layout = "{ts}"
	}
	if flag.NArg() > 0 {
		layout = flag.Arg(0)
	}
	reader := bufio.NewReader(os.Stdin)
	for {
		line, err := reader.ReadString('\n')
		if err != nil {
			if err == io.EOF {
				if line != "" {
					doFormat(line)
				}
				break
			}
			log.Fatal(err)
		}
		doFormat(line)
	}
}


text:
using RabbitMQ.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Qart.FileForwarder
{
    public class RabbitMqPublisher : IDisposable
    {
        private ConnectionFactory _factory;
        private IConnection _connection;
        private IModel _channel;

        private string _exchange;

        public RabbitMqPublisher(string host, int port, string user, string password, string exchange)
        {
            _factory = new ConnectionFactory() { HostName = host, Port = port, UserName = user, Password = password };
            _connection = _factory.CreateConnection();
            _channel = _connection.CreateModel();
            _exchange = exchange;
        }

        public void Publish(string message, string meta)
        {
            var body = Encoding.UTF8.GetBytes(message);
            _channel.BasicPublish(_exchange, meta, null, body);
        }

        public void Dispose()
        {
            _channel.Dispose();
            _connection.Dispose();
        }
    }
}


text:
We have already seen how to declare a variable. How to assign string to it and print it.
```
soup = "tomato soup"
print soup

```

String could be declared using both apostrophe(') or double quote(").

Suppose when you have statement like this "I don't have your book." then this could be declared as follows
```
statement = "I don't have your book."
```

When you are working with apostrophe

```
statement = 'I don't have your book.'
```

Above code would show a syntax error. This is caused because of 't i.e. apostrophe t. This is because interpreter thinks that there is end of string at n, but which is not a case. So during such situation we can use escape sequence.
The statement can be declared as below:
```
statement = 'I don\'t have your book.'
#here \ is a escape sequence
```
##Array
When we declared a string suppose for example name = "Bhavesh", then the actual assignment is done as array. A memory space of the number of character in string is created starting with zero. And all character are stored in it character wise. The variable name would be having array as below
```
name[0]='B'
name[1]='h'
name[2]='a'
name[3]='v'
name[4]='e'
name[5]='s'
name[6]='h'
```
Here in above 0,1,2...6 are called index of an array. At each index only one single variable is present. At index 0 'B', at index 1 'h' and so on
 Working with Array is so awesome. Consider the following code:
 ```
 third_letter = "Bhavesh'[2]
 ```
 The above code would assign a to third_letter.
 ---
##String Manipulation

There are some predefined methods used for manipulating strings or else working with strings. Out of which we are going to see few

1. len()
2. lower()
3. upper()

### len()
len() is used to calculate length of a string. For example suppose you want to find length of "LearnPy", then you can do that by `len("LearnPy")` you would get output as 7. Or else if you have a variable then its length can be calculated as `len(hello)`. That is you can provide string or variable both.
### lower()
lower() is used to convert sting into lower case. for example
```
hello="LearnPy"
hello.lower()
```
The output of above code would be `learnpy`
### upper()
upper() is used to convert sting into upper case. For example
```
hello="LearnPy"
hello.upper()
```
The output of above code would be `LEARNPY`


text:
module Stupidedi
  module Versions
    module FunctionalGroups
      module TwoThousandOne
        module SegmentDefs

          s = Schema
          e = ElementDefs
          r = ElementReqs

          J2X = s::SegmentDef.build(:J2X, "Item Description",
            "To ...",
            e::E349 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
            e::E349 .simple_use(r::Optional,  s::RepeatCount.bounded(1)),
            e::E372 .simple_use(r::Mandatory, s::RepeatCount.bounded(1)))

        end
      end
    end
  end
end


text:
(function () {
    'use strict';

    // 1 2 5 10 25 50 100 250 500 etc
    function quantizedNumber(i) {
        var adjust = [1, 2.5, 5];
        return Math.floor(Math.pow(10, Math.floor(i / 3)) * adjust[i % 3]);
    }

    // the j such that quantizedNumber(j) is closest to i
    function quantizedIndex(i) {
        if (i < 1) {
            return 0;
        }
        var group = Math.floor(Math.log(i) / Math.LN10),
                offset = i / (2.5 * Math.pow(10, group));
        if (offset >= 3) {
            group++;
            offset = 0;
        }
        return 3 * group + Math.round(Math.min(2, offset));
    }

    function quantize(i) {
        if (i === Infinity) {
            return Infinity;
        }
        return quantizedNumber(quantizedIndex(i));
    }

    // don't overwrite default response transforms
    function appendTransform(defaults, transform) {
        defaults = angular.isArray(defaults) ? defaults : [defaults];
        return (transform) ? defaults.concat(transform) : defaults;
    }

    angular.module('mmf.paginateAnything', []).
            directive('mmfPagination', function () {
                var defaultLinkGroupSize = 3, defaultClientLimit = 250, defaultPerPage = 50;

                return {
                    restrict: 'AE',
                    scope: {
                        // required
                        url: '=',
                        collection: '=',
                        navigationParams: '=',
                        // optional
                        urlParams: '=?',
                        headers: '=?',
                        page: '=?',
                        perPage: '=?',
                        perPagePresets: '=?',
                        autoPresets: '=?',
                        clientLimit: '=?',
                        linkGroupSize: '=?',
                        reloadPage: '=?',
                        size: '=?',
                        passive: '@',
                        transformResponse: '=?',
                        // directive -> app communication only
                        numPages: '=?',
                        numItems: '=?',
                        serverLimit: '=?',
                        rangeFrom: '=?',
                        rangeTo: '=?'
                    },
                    templateUrl: function (element, attr) {
                        return attr.templateUrl || 'paginate_basic.html';
                    },
                    replace: true,
                    controller: ['$scope', '$http', function ($scope, $http) {
                            $scope.firstRequest = false;
                            $scope.reloadPage = false;
                            $scope.serverLimit = Infinity; // it's not known yet
                            $scope.Math = window.Math; // Math for the template

                            if (typeof $scope.autoPresets !== 'boolean') {
                                $scope.autoPresets = true;
                            }

                            var lgs = $scope.linkGroupSize, cl = $scope.clientLimit;
                            $scope.linkGroupSize = typeof lgs === 'number' ? lgs : defaultLinkGroupSize;
                            $scope.clientLimit = typeof cl === 'number' ? cl : defaultClientLimit;

                            $scope.updatePresets = function () {
                                if ($scope.autoPresets) {
                                    var presets = [], i;
                                    for (i = Math.min(3, quantizedIndex($scope.navigationParams.perPage || defaultPerPage));
                                            i <= quantizedIndex(Math.min($scope.clientLimit, $scope.serverLimit));
                                            i++) {
                                        presets.push(quantizedNumber(i));
                                    }
                                    $scope.perPagePresets = presets;
                                } else {
                                    $scope.perPagePresets = $scope.perPagePresets.filter(
                                            function (preset) {
                                                return preset <= $scope.serverLimit;
                                            }
                                    ).concat([$scope.serverLimit]);
                                }
                            };

                            $scope.gotoPage = function (i) {
                                if (i < 0 || i * $scope.navigationParams.perPage >= $scope.numItems) {
                                    return;
                                }
                                $scope.navigationParams.page = i;
                            };

                            $scope.linkGroupFirst = function () {
                                var rightDebt = Math.max(0,
                                        $scope.linkGroupSize - ($scope.numPages - 1 - ($scope.navigationParams.page + 2))
                                        );
                                return Math.max(0,
                                        $scope.navigationParams.page - ($scope.linkGroupSize + rightDebt)
                                        );
                            };

                            $scope.linkGroupLast = function () {
                                var leftDebt = Math.max(0,
                                        $scope.linkGroupSize - ($scope.navigationParams.page - 2)
                                        );
                                return Math.min($scope.numPages - 1,
                                        $scope.navigationParams.page + ($scope.linkGroupSize + leftDebt)
                                        );
                            };

                            $scope.isFinite = function () {
                                return $scope.numPages < Infinity;
                            };

                            function getFilterAndRequestVars(request) {
                                var filterVars = {'from': request.from, 'to': request.to};
                                angular.forEach($scope.navigationParams, function (value, key) {
                                    if (key !== 'page' && key !== 'perPage') {
                                        filterVars[key] = value;
                                    }
                                });
                                return filterVars;
                            }

                            function requestRange(request) {
                                $scope.$emit('pagination:loadStart', request);
                                var filterVars = getFilterAndRequestVars(request);
                                $http({
                                    method: 'POST',
                                    url: $scope.url,
                                    data: filterVars,
                                    transformResponse: appendTransform($http.defaults.transformResponse, $scope.transformResponse)
                                }).success(function (data, status, headers, config) {
                                    var response = {'from': data.from, 'to': data.to, 'total': data.total}
                                    if (status === 204 || (response && response.total === 0)) {
                                        $scope.numItems = 0;
                                        $scope.collection = [];
                                    } else {
                                        $scope.numItems = response ? response.total : data.length;
                                        $scope.collection = data || [];
                                    }

                                    if (response) {
                                        $scope.rangeFrom = response.from;
                                        $scope.rangeTo = response.to;
                                        if (length(response) < response.total) {
                                            if (
                                                    (request.to < response.total - 1) ||
                                                    (response.to < response.total - 1 && response.total < request.to)
                                                    ) {
                                                if (!$scope.navigationParams.perPage || length(response) < $scope.navigationParams.perPage) {
                                                    if ($scope.autoPresets) {
                                                        var idx = quantizedIndex(length(response));
                                                        if (quantizedNumber(idx) > length(response)) {
                                                            idx--;
                                                        }
                                                        $scope.serverLimit = quantizedNumber(idx);
                                                    } else {
                                                        $scope.serverLimit = length(response);
                                                    }
                                                    $scope.navigationParams.perPage = $scope.Math.min(
                                                            $scope.serverLimit,
                                                            $scope.clientLimit
                                                            );
                                                }
                                            }
                                        }
                                    }
                                    $scope.numPages = Math.ceil($scope.numItems / ($scope.navigationParams.perPage || defaultPerPage));

                                    $scope.$emit('pagination:loadPage', status, config);
                                }).error(function (data, status, headers, config) {
                                    $scope.$emit('pagination:error', status, config);
                                });
                            }
                            $scope.size = $scope.size || 'md';
                            if ($scope.autoPresets) {
                                $scope.updatePresets();
                            }

                            $scope.$watch('navigationParams', function (navigationParams) {
                                requestRange({
                                    from: $scope.navigationParams.page * $scope.navigationParams.perPage,
                                    to: ($scope.navigationParams.page + 1) * $scope.navigationParams.perPage - 1
                                });
                            }, true);

                            $scope.$watch('url', function (newUrl, oldUrl) {
                                if ($scope.passive === 'true') {
                                    return;
                                }

                                if (newUrl !== oldUrl) {
                                    if ($scope.navigationParams.page === 0) {
                                        $scope.reloadPage = true;
                                    } else {
                                        $scope.navigationParams.page = 0;
                                    }
                                }
                            });

                            var pp = $scope.navigationParams.perPage || defaultPerPage;

                            if ($scope.autoPresets) {
                                pp = quantize(pp);
                            }
                        }]
                };
            }).
            filter('makeRange', function () {
                // http://stackoverflow.com/a/14932395/3102996
                return function (input) {
                    var lowBound, highBound;
                    switch (input.length) {
                        case 1:
                            lowBound = 0;
                            highBound = parseInt(input[0], 10) - 1;
                            break;
                        case 2:
                            lowBound = parseInt(input[0], 10);
                            highBound = parseInt(input[1], 10);
                            break;
                        default:
                            return input;
                    }
                    var result = [];
                    for (var i = lowBound; i <= highBound; i++) {
                        result.push(i);
                    }
                    return result;
                };
            });

    function parseRange(hdr) {
        var m = hdr && hdr.match(/^(?:items )?(\d+)-(\d+)\/(\d+|\*)$/);
        if (m) {
            return {
                from: +m[1],
                to: +m[2],
                total: m[3] === '*' ? Infinity : +m[3]
            };
        } else if (hdr === '*/0') {
            return {total: 0};
        }
        return null;
    }

    function length(range) {
        return range.to - range.from + 1;
    }
}());


text:
import React from "react";
import styled from "styled-components";
import AddButton from "../ui/AddButton";
import DeleteButton from "../ui/DeleteButton";
import Blacklist, { BlacklistItem } from "../../../shared/settings/Blacklist";

const Grid = styled.div``;

const GridHeader = styled.div`
  display: flex;
  font-weight: bold;
`;

const GridRow = styled.div`
  display: flex;
`;

const GridCell = styled.div<{ grow?: number }>`
  &:nth-child(1) {
    flex-grow: 5;
  }

  &:nth-child(2) {
    flex-shrink: 1;
    min-width: 20%;
    max-width: 20%;
  }

  &:nth-child(3) {
    flex-shrink: 1;
  }
`;

const Input = styled.input`
  width: 100%;
  box-sizing: border-box;
`;

interface Props {
  value: Blacklist;
  onChange: (value: Blacklist) => void;
  onBlur: () => void;
}

class PartialBlacklistForm extends React.Component<Props> {
  public static defaultProps: Props = {
    value: new Blacklist([]),
    onChange: () => {},
    onBlur: () => {},
  };

  render() {
    return (
      <>
        <Grid role="list">
          <GridHeader>
            <GridCell>URL</GridCell>
            <GridCell>Keys</GridCell>
          </GridHeader>
          {this.props.value.items.map((item, index) => {
            if (!item.partial) {
              return null;
            }
            return (
              <GridRow key={index} role="listitem">
                <GridCell>
                  <Input
                    data-index={index}
                    type="text"
                    name="url"
                    aria-label="URL"
                    value={item.pattern}
                    placeholder="example.com/mail/*"
                    onChange={this.bindValue.bind(this)}
                    onBlur={this.props.onBlur}
                  />
                </GridCell>
                <GridCell>
                  <Input
                    data-index={index}
                    type="text"
                    name="keys"
                    aria-label="Keys"
                    value={item.keys.join(",")}
                    placeholder="j,k,<C-d>,<C-u>"
                    onChange={this.bindValue.bind(this)}
                    onBlur={this.props.onBlur}
                  />
                </GridCell>
                <GridCell>
                  <DeleteButton
                    data-index={index}
                    name="delete"
                    aria-label="Delete"
                    onClick={this.bindValue.bind(this)}
                    onBlur={this.props.onBlur}
                  />
                </GridCell>
              </GridRow>
            );
          })}
        </Grid>
        <AddButton
          name="add"
          aria-label="Add"
          style={{ float: "right" }}
          onClick={this.bindValue.bind(this)}
        />
      </>
    );
  }

  bindValue(e: any) {
    const name = e.target.name;
    const index = e.target.getAttribute("data-index");
    const items = this.props.value.items;

    if (name === "url") {
      const current = items[index];
      items[index] = new BlacklistItem(e.target.value, true, current.keys);
    } else if (name === "keys") {
      const current = items[index];
      items[index] = new BlacklistItem(
        current.pattern,
        true,
        e.target.value.split(",")
      );
    } else if (name === "add") {
      items.push(new BlacklistItem("", true, []));
    } else if (name === "delete") {
      items.splice(index, 1);
    }

    this.props.onChange(new Blacklist(items));
    if (name === "delete") {
      this.props.onBlur();
    }
  }
}

export default PartialBlacklistForm;


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('djangocms_forms', '0002_alter_model_options'),
    ]

    operations = [
        migrations.AddField(
            model_name='formsubmission',
            name='referrer',
            field=models.CharField(max_length=150, verbose_name='Referrer URL', blank=True),
        ),
    ]


text:
\chapter{Gram\'atica BNF da linguagem de programa\ca o do prot\'otipo}\begin{espacosimples}\begin{scriptsize}\begin{lstlisting}
Grammar

    0 $accept: Goal "end of file"

    1 Goal: /* empty */
      2     | GoalOptionRepeat

    3 GoalOptionRepeat: GoalOption
      4                 | GoalOptionRepeat GoalOption

    5 GoalOption: TypeDeclaration

    6 Literal: "null"
      7        | "integer literal"
      8        | "float literal"
      9        | "char literal"
     10        | "string literal"
     11        | "regex literal"
     12        | BooleanLiteral
     13        | ArrayLiteral
     14        | HashLiteral

   15 BooleanLiteral: "false"
     16               | "true"

   17 ArrayLiteral: "[" "]"
     18             | "[" ExpressionList "]"
     19             | "[" ExpressionList "," "]"

   20 HashLiteral: "{" HashPairListOpt "}"

   21 HashPairListOpt: ":"
     22                | HashPairList

   23 HashPairList: HashPair
     24             | HashPairList "," HashPair

   25 HashPair: "identifier literal" ":" Expression
     26         | "string literal" ":" Expression

   27 TypeName: QualifiedIdentifier

   28 Type: NonArrayType
     29     | ArrayType
     30     | "var"

   31 NonArrayType: SimpleType
     32             | TypeName

   33 SimpleType: PrimitiveType
     34           | ClassType

   35 PrimitiveType: NumericType
     36              | "bool"

   37 NumericType: IntegralType
     38            | FloatingPointType
     39            | "decimal"

   40 IntegralType: "byte"
     41             | "short"
     42             | "unsigned" "short"
     43             | "int"
     44             | "unsigned" "int"
     45             | "long"
     46             | "unsigned" "long"
     47             | "long" "long"
     48             | "char"

   49 FloatingPointType: "float"
     50                  | "double"

   51 ClassType: "string"
     52          | "regex"
     53          | "array"
     54          | "hash"

   55 ArrayType: ArrayType RankSpecifier
     56          | SimpleType RankSpecifier
     57          | QualifiedIdentifier RankSpecifier

   58 RankSpecifier: "[" "]"

   59 ArgumentList: Argument
     60             | ArgumentList "," Argument

   61 Argument: Expression

   62 PrimaryExpression: ParenthesizedExpression
     63                  | PrimaryExpressionNoParentesis

   64 ParenthesizedExpression: "(" Expression ")"

   65 PrimaryExpressionNoParentesis: Literal
     66                              | ArrayCreationExpression
     67                              | MemberAccess
     68                              | InvocationExpression
     69                              | ElementAccess
     70                              | NewExpression
     71                              | TypeofExpression
     72                              | SizeofExpression

   73 ArrayCreationExpression: "new" NonArrayType "[" ExpressionList "]"
     74                        | "new" NonArrayType "[" ExpressionList "]" ArrayInitializer
     75                        | "new" ArrayType
     76                        | "new" ArrayType ArrayInitializer

   77 MemberAccess: PrimaryExpression "." "identifier literal"
     78             | PrimitiveType "." "identifier literal"
     79             | ClassType "." "identifier literal"

   80 InvocationExpression: PrimaryExpressionNoParentesis "(" ArgumentList ")"
     81                     | QualifiedIdentifier "(" ")"
     82                     | QualifiedIdentifier "(" ArgumentList ")"

   83 ElementAccess: PrimaryExpression "[" ExpressionList "]"
     84              | QualifiedIdentifier "[" ExpressionList "]"

   85 ExpressionList: Expression
     86               | ExpressionList "," Expression

   87 PostIncrementExpression: PostfixExpression "++"

   88 PostDecrementExpression: PostfixExpression "--"

   89 NewExpression: ObjectCreationExpression

   90 ObjectCreationExpression: "new" Type "(" ")"
     91                         | "new" Type "(" ArgumentList ")"

   92 TypeofExpression: "typeof" "(" Type ")"
     93                 | "typeof" "(" "void" ")"

   94 SizeofExpression: "sizeof" "(" Type ")"

   95 AddressofExpression: "&" UnaryExpression

   96 PostfixExpression: PrimaryExpression
     97                  | QualifiedIdentifier
     98                  | PostIncrementExpression
     99                  | PostDecrementExpression

  100 UnaryExpressionNotPlusMinus: PostfixExpression
    101                            | "!" UnaryExpression
    102                            | "~" UnaryExpression

  103 PreIncrementExpression: "++" UnaryExpression

  104 PreDecrementExpression: "--" UnaryExpression

  105 UnaryExpression: UnaryExpressionNotPlusMinus
    106                | "+" UnaryExpression
    107                | "-" UnaryExpression
    108                | "*" UnaryExpression
    109                | PreIncrementExpression
    110                | PreDecrementExpression
    111                | AddressofExpression

  112 PowerExpression: UnaryExpression
    113                | PowerExpression "**" UnaryExpression

  114 MultiplicativeExpression: PowerExpression
    115                         | MultiplicativeExpression "*" PowerExpression
    116                         | MultiplicativeExpression "/" PowerExpression
    117                         | MultiplicativeExpression "%" PowerExpression

  118 AdditiveExpression: MultiplicativeExpression
    119                   | AdditiveExpression "+" MultiplicativeExpression
    120                   | AdditiveExpression "-" MultiplicativeExpression

  121 ShiftExpression: AdditiveExpression
    122                | ShiftExpression "<<" AdditiveExpression
    123                | ShiftExpression ">>" AdditiveExpression

  124 RelationalExpression: ShiftExpression
    125                     | RelationalExpression "<" ShiftExpression
    126                     | RelationalExpression ">" ShiftExpression
    127                     | RelationalExpression "<=" ShiftExpression
    128                     | RelationalExpression ">=" ShiftExpression
    129                     | RelationalExpression "=~" ShiftExpression
    130                     | RelationalExpression "!~" ShiftExpression
    131                     | RelationalExpression "is" Type
    132                     | RelationalExpression "as" Type

  133 EqualityExpression: RelationalExpression
    134                   | EqualityExpression "==" RelationalExpression
    135                   | EqualityExpression "!=" RelationalExpression

  136 AndExpression: EqualityExpression
    137              | AndExpression "&" EqualityExpression

  138 ExclusiveOrExpression: AndExpression
    139                      | ExclusiveOrExpression "^" AndExpression

  140 InclusiveOrExpression: ExclusiveOrExpression
    141                      | InclusiveOrExpression "|" ExclusiveOrExpression

  142 ConditionalAndExpression: InclusiveOrExpression
    143                         | ConditionalAndExpression "&&" InclusiveOrExpression

  144 ConditionalOrExpression: ConditionalAndExpression
    145                        | ConditionalOrExpression "||" ConditionalAndExpression

  146 RangeExpression: ConditionalOrExpression
    147                | RangeExpression ".." ConditionalOrExpression
    148                | RangeExpression "..." ConditionalOrExpression

  149 NullCoalescingExpression: RangeExpression
    150                         | NullCoalescingExpression "??" RangeExpression

  151 ConditionalExpression: NullCoalescingExpression
    152                      | ConditionalExpression "?" Expression ":" Expression

  153 AssignmentExpression: UnaryExpression AssignmentOperator Expression

  154 AssignmentOperator: "="
    155                   | "+="
    156                   | "-="
    157                   | "*="
    158                   | "/="
    159                   | "^="

  160 SelectOrGroupClause: GroupByClause
    161                    | SelectClause

  162 GroupByClause: "group" "identifier literal" "by" Expression
    163              | "group" "identifier literal" "by" Expression "into" "identifier literal"

  164 SelectClause: "select" ExpressionList

  165 LetClause: "let" "identifier literal" "=" Expression

  166 RangeClause: "skip" Expression
    167            | "step" Expression
    168            | "take" Expression

  169 OrderExpressionList: OrderExpression
    170                    | OrderExpressionList "," OrderExpression

  171 OrderExpression: Expression OrderOperatorOpt

  172 OrderOperatorOpt: /* empty */
    173                 | "asc"
    174                 | "desc"

  175 JoinClause: "join" QueryOrigin "on" BooleanExpression
    176           | "left" "join" QueryOrigin "on" BooleanExpression
    177           | "right" "join" QueryOrigin "on" BooleanExpression
    178           | "join" QueryOrigin "on" BooleanExpression "into" "identifier literal"
    179           | "left" "join" QueryOrigin "on" BooleanExpression "into" "identifier literal"
    180           | "right" "join" QueryOrigin "on" BooleanExpression "into" "identifier literal"

  181 QueryBodyMemberRepeat: QueryBodyMember
    182                      | QueryBodyMemberRepeat QueryBodyMember

  183 QueryBodyMember: "where" BooleanExpression
    184                | "order" "by" OrderExpressionList
    185                | JoinClause
    186                | RangeClause
    187                | LetClause

  188 QueryBody: QueryBodyMemberRepeat SelectOrGroupClause
    189          | QueryBodyMemberRepeat
    190          | SelectOrGroupClause

  191 QueryOrigin: "identifier literal" "in" Expression

  192 QueryExpression: "from" QueryOrigin
    193                | "from" QueryOrigin QueryBody

  194 LambdaParameter: Type "identifier literal"
    195                | "identifier literal"

  196 LambdaParameterList: LambdaParameter
    197                    | LambdaParameterList "," LambdaParameter

  198 LambdaParameterListOpt: /* empty */
    199                       | LambdaParameterList

  200 LambdaExpressionBody: Expression
    201                     | Block

  202 LambdaExpression: "identifier literal" "=>" LambdaExpressionBody
    203                 | "(" LambdaParameterListOpt ")" "=>" LambdaExpressionBody

  204 TimedExpression: "async" Expression
    205                | "await" Expression

  206 Expression: ConditionalExpression
    207           | AssignmentExpression
    208           | QueryExpression
    209           | LambdaExpression
    210           | TimedExpression

  211 ConstantExpression: Expression

  212 BooleanExpression: Expression

  213 Statement: DeclarationStatement
    214          | NormalStatement

  215 NormalStatement: Block
    216                | EmptyStatement
    217                | ExpressionStatement
    218                | SelectionStatement
    219                | IterationStatement
    220                | JumpStatement
    221                | TryStatement

  222 Block: "{" StatementRepeatOpt "}"

  223 StatementRepeatOpt: /* empty */
    224                   | StatementRepeat

  225 StatementRepeat: Statement
    226                | StatementRepeat Statement

  227 EmptyStatement: ";"

  228 DeclarationStatement: LocalVariableDeclaration ";"
    229                     | LocalConstantDeclaration ";"

  230 LocalVariableDeclaration: Type VariableDeclaratorList

  231 VariableDeclaratorList: VariableDeclarator
    232                       | VariableDeclaratorList "," VariableDeclarator

  233 VariableDeclarator: "identifier literal"
    234                   | "identifier literal" "=" VariableInitializer

  235 VariableInitializer: Expression
    236                    | ArrayInitializer

  237 LocalConstantDeclaration: "const" Type ConstantDeclaratorList

  238 ConstantDeclaratorList: ConstantDeclarator
    239                       | ConstantDeclaratorList "," ConstantDeclarator

  240 ConstantDeclarator: "identifier literal" "=" ConstantExpression

  241 ExpressionStatement: StatementExpression ";"

  242 StatementExpression: InvocationExpression
    243                    | ObjectCreationExpression
    244                    | AssignmentExpression
    245                    | PostIncrementExpression
    246                    | PostDecrementExpression
    247                    | PreIncrementExpression
    248                    | PreDecrementExpression

  249 SelectionStatement: IfStatement
    250                   | UnlessStatement
    251                   | SwitchStatement

  252 IfStatement: "if" "(" Expression ")" NormalStatement
    253            | "if" "(" Expression ")" NormalStatement "else" NormalStatement

  254 UnlessStatement: "unless" "(" Expression ")" NormalStatement
    255                | "unless" "(" Expression ")" NormalStatement "else" NormalStatement

  256 SwitchStatement: "switch" "(" Expression ")" SwitchBlock

  257 SwitchBlock: "{" SwitchSectionRepeat "}"

  258 SwitchSectionRepeat: SwitchSection
    259                    | SwitchSectionRepeat SwitchSection

  260 SwitchSection: SwitchLabelRepeat StatementRepeat

  261 SwitchLabelRepeat: SwitchLabel
    262                  | SwitchLabelRepeat SwitchLabel

  263 SwitchLabel: "case" Expression ":"
    264            | "default" ":"

  265 IterationStatement: WhileStatement
    266                   | DoStatement
    267                   | ForStatement
    268                   | ForeachStatement

  269 WhileStatement: "while" "(" BooleanExpression ")" NormalStatement

  270 DoStatement: "do" NormalStatement "while" "(" BooleanExpression ")" ";"

  271 ForStatement: "for" "(" ForInitializerOpt ";" ForConditionOpt ";" ForIncrementOpt ")" NormalStatement

  272 ForInitializerOpt: /* empty */
    273                  | ForInitializer

  274 ForConditionOpt: /* empty */
    275                | ForCondition

  276 ForIncrementOpt: /* empty */
    277                | ForIncrement

  278 ForInitializer: LocalVariableDeclaration
    279               | StatementExpressionList

  280 ForCondition: BooleanExpression

  281 ForIncrement: StatementExpressionList

  282 StatementExpressionList: StatementExpression
    283                        | StatementExpressionList "," StatementExpression

  284 ForeachStatement: "foreach" "(" Type "identifier literal" "in" Expression ")" NormalStatement

  285 JumpStatement: BreakStatement
    286              | ContinueStatement
    287              | ReturnStatement
    288              | YieldStatement
    289              | ThrowStatement

  290 BreakStatement: "break" ";"

  291 ContinueStatement: "continue" ";"

  292 ReturnStatement: "return" ";"
    293                | "return" Expression ";"

  294 YieldStatement: "yield" ";"
    295               | "yield" Expression ";"

  296 ThrowStatement: "throw" ";"
    297               | "throw" Expression ";"

  298 TryStatement: "try" Block CatchClauseRepeat
    299             | "try" Block FinallyClause
    300             | "try" Block CatchClauseRepeat FinallyClause

  301 CatchClauseRepeat: CatchClause
    302                  | CatchClauseRepeat CatchClause

  303 CatchClause: "catch" "(" Type ")" Block
    304            | "catch" "(" Type "identifier literal" ")" Block
    305            | "catch" Block

  306 FinallyClause: "finally" Block

  307 QualifiedIdentifier: "identifier literal"
    308                    | Qualifier "identifier literal"

  309 Qualifier: "identifier literal" "."
    310          | Qualifier "identifier literal" "."

  311 TypeDeclaration: MethodDeclaration

  312 ArrayInitializer: "{" VariableInitializerListOpt "}"
    313                 | "{" VariableInitializerListOpt "," "}"

  314 VariableInitializerListOpt: /* empty */
    315                           | VariableInitializerList

  316 VariableInitializerList: VariableInitializer
    317                        | VariableInitializerList "," VariableInitializer

  318 MethodDeclaration: MethodHeader MethodBody

  319 MethodHeader: "void" QualifiedIdentifier "(" FormalParameterListOpt ")"
    320             | Type QualifiedIdentifier "(" FormalParameterListOpt ")"
    321             | QualifiedIdentifier "(" FormalParameterListOpt ")"

  322 FormalParameterListOpt: /* empty */
    323                       | FormalParameterList

  324 MethodBody: Block
    325           | ";"

  326 FormalParameterList: FormalParameter
    327                    | FormalParameterList "," FormalParameter

  328 FormalParameter: FixedParameter
    329                | ParameterArray

  330 FixedParameter: Type "identifier literal" ParameterInitializerOpt

  331 ParameterInitializerOpt: /* empty */
    332                        | "=" ConstantExpression

  333 ParameterArray: "params" ArrayType "identifier literal"

\end{lstlisting}\end{scriptsize}\end{espacosimples}


text:
package org.yapp.core.ui.abase;

import android.content.Context;
import android.view.View;

/**
 * Description: Fragment主持层基础接口.

 * Date: 2016/3/31 11:34

 * Author: ysj
 */
public interface BaseFragmentPresenterApi<F> {
    void onBuild(Context context,F fragment);

    F getFragment();

    View getContextView();
}


text:
[![Build Status](https://travis-ci.org/cloudfoundry/java-buildpack-support.svg?branch=master)](https://travis-ci.org/cloudfoundry/java-buildpack-support)

A collection of JARs in support of the [Java Buildpack](https://github.com/cloudfoundry/java-buildpack).

## Tomcat Buildpack Support

This is a JAR which the Java buildpack places in Tomcat's `lib` directory. It contains a listener which,
when configured in Tomcat, ensures that Tomcat shuts down if an application fails to start.

The list of published versions of this JAR can be found at the following location.

| JAR | Location
| --- | ---------
| Tomcat Buildpack Support | <http://download.pivotal.io.s3.amazonaws.com/tomcat-buildpack-support/index.yml>

## Contributing
[Pull requests][] are welcome; see the [contributor guidelines][] for details.

[Pull requests]: http://help.github.com/send-pull-requests
[contributor guidelines]: CONTRIBUTING.md

## License
The Tomcat Builder is released under version 2.0 of the [Apache License][].

[Apache License]: http://www.apache.org/licenses/LICENSE-2.0


text:
namespace blink {

TEST(IDBMojomTraitsTest, IDBKeyBinary) {
  // Generate test data.
  std::mt19937 rng(5);
  size_t test_data_size = 10000;
  Vector<char> test_data(test_data_size);
  std::generate(test_data.begin(), test_data.end(), rng);
  scoped_refptr<SharedBuffer> input_data =
      SharedBuffer::Create(test_data.data(), test_data.size());
  Vector<uint8_t> input_vector = input_data->CopyAs<Vector<uint8_t>>();

  // Verify expectations.
  ASSERT_EQ(input_data->size(), test_data_size);
  ASSERT_EQ(input_vector.size(), test_data_size);

  // Create IDBKey binary key type mojom message.
  std::unique_ptr<IDBKey> input = IDBKey::CreateBinary(input_data);
  mojo::Message mojo_message = mojom::blink::IDBKey::SerializeAsMessage(&input);

  // Deserialize the mojo message.
  std::unique_ptr<IDBKey> output;
  ASSERT_TRUE(mojom::blink::IDBKey::DeserializeFromMessage(
      std::move(mojo_message), &output));
  scoped_refptr<SharedBuffer> output_data = output->Binary();
  Vector<uint8_t> output_vector = output_data->CopyAs<Vector<uint8_t>>();

  // Verify expectations.
  ASSERT_EQ(output_data->size(), test_data_size);
  ASSERT_EQ(output_vector.size(), test_data_size);
  ASSERT_EQ(input_vector, output_vector);
}

TEST(IDBMojomTraitsTest, IDBValue) {
  // Generate test data.
  std::mt19937 rng(5);
  size_t test_data_size = 10000;
  Vector<char> test_data(test_data_size);
  std::generate(test_data.begin(), test_data.end(), rng);
  scoped_refptr<SharedBuffer> input_data =
      SharedBuffer::Create(test_data.data(), test_data.size());
  Vector<uint8_t> input_vector = input_data->CopyAs<Vector<uint8_t>>();

  // Verify expectations.
  ASSERT_EQ(input_data->size(), test_data_size);
  ASSERT_EQ(input_vector.size(), test_data_size);

  // Create IDBValue mojom message.
  auto input =
      std::make_unique<IDBValue>(std::move(input_data), Vector<WebBlobInfo>());
  mojo::Message mojo_message =
      mojom::blink::IDBValue::SerializeAsMessage(&input);

  // Deserialize the mojo message.
  std::unique_ptr<IDBValue> output;
  ASSERT_TRUE(mojom::blink::IDBValue::DeserializeFromMessage(
      std::move(mojo_message), &output));
  scoped_refptr<SharedBuffer> output_data = output->Data();
  Vector<uint8_t> output_vector = output_data->CopyAs<Vector<uint8_t>>();

  // Verify expectations.
  ASSERT_EQ(output_data->size(), test_data_size);
  ASSERT_EQ(output_vector.size(), test_data_size);
  ASSERT_EQ(input_vector, output_vector);
}

}  // namespace blink


text:
import React, { Component } from 'react';
import GraphiQL from 'graphiql';
// import './App.css';
import 'graphiql/graphiql.css';

const defaultURL = "http://127.0.0.1:9130"
const defaultQuery = '# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that starts\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n#     {\n#       field(arg: "value") {\n#         subField\n#       }\n#     }\n#\n# Keyboard shortcuts:\n#\n#  Prettify Query:  Shift-Ctrl-P (or press the prettify button above)\n#\n#       Run Query:  Ctrl-Enter (or press the play button above)\n#\n#   Auto Complete:  Ctrl-Space (or just start typing)\n#\n\nquery {\n  users {\n    id\n    username\n  }\n}\n\n';

class App extends Component {
  fetcher = (graphQLParams) => {
    const { okapi } = this.state;
    return fetch(`${okapi.url}/graphql`, {
      mode: 'cors',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
        'X-Okapi-Tenant': okapi.tenant,
        'X-Okapi-Token': okapi.token,
      },
      body: JSON.stringify(graphQLParams),
    }).then(response => response.json());
  }

  handleForm = (e) => {
    e.preventDefault();
    let okapi = {
      url: this.refs.url.value,
      tenant: this.refs.tenant.value,
    };
    let creds = {
      username: this.refs.name.value,
      password: this.refs.password.value,
    };
    fetch(`${okapi.url}/bl-users/login`, {
      mode: 'cors',
      method: 'post',
      headers: {
        'Content-Type': 'application/json',
        'X-Okapi-Tenant': okapi.tenant,
      },
      body: JSON.stringify(creds),
    }).then(response => {
     if (response.status >= 400) {
       this.setState({ error:true })
     } else {
       okapi.token = response.headers.get('X-Okapi-Token');
       this.setState({ error: false, okapi });
     }
    });
  }

  render() {
    if (this.state && this.state.okapi) {
      return (
        <GraphiQL fetcher={this.fetcher} defaultQuery={defaultQuery} />
      );
    }
    return (

Okapi GraphiQL

            Username
            <input type="text"
                   ref="name"
                   defaultValue="diku_admin" />

            Password
            <input type="password"
                   ref="password" />

            Okapi URL
            <input type="text"
                   ref="url"
                   defaultValue={ defaultURL } />

            Tenant
            <input type="text"
                   ref="tenant"
                   defaultValue="diku" />

          <button onClick={ this.handleForm }>Start GraphiQL!</button>

    );
  }
}

export default App;


text:
var lactate = require('lactate')

var dir = __dirname + '/../files'
var files = lactate.dir(dir, {
    cache:true,
    expires:'two days'
})

var http = require('http')
var server = new http.Server()

server.addListener('request', function(req, res) {
    return files.serve(req, res)
})

server.listen(8080)


text:
require 'spec_helper'

describe Fudge::Tasks::SubProcess do
  let(:output) { StringIO.new }
  let(:formatter) { Fudge::Formatters::Simple.new(output) }

  describe '#run' do
    it "takes a command and runs it" do
      expect(described_class.new(:ls)).to run_command [{}, 'ls', {}]
    end

    it "adds any arguments given" do
      expect(described_class.new(:ls, '-l', '-a')).to run_command [{}, 'ls', '-l', '-a', {}]
    end

    it "returns false for an unsuccessful command" do
      expect(described_class.new(:ls, '--newnre').run).to be_falsey
    end

    it "returns true for a successful command" do
      expect(described_class.new(:ls).run).to be_truthy
    end

    context "when given environment variables" do
      context "when the task is created" do
        it "passes the variables to the sub-process" do
          process = described_class.new(%(ruby -e "puts ENV['PATH'];puts ENV['FOO']"), environment: { 'FOO' => 'bar' })

          process.run(formatter: formatter)

          expect(output.string).to eq "#{ENV['PATH']}\nbar\n"
        end
      end

      context "when the task is run" do
        it "passes the variables to the sub-process" do
          process = described_class.new(%(ruby -e "puts ENV['PATH'];puts ENV['FOO']"))

          process.run(formatter: formatter, environment: { 'FOO' => 'bar' })

          expect(output.string).to eq "#{ENV['PATH']}\nbar\n"
        end
      end

      context "when the task is created and when it is run" do
        it "gives priority to the variables passed in on run" do
          process = described_class.new(%(ruby -e "puts ENV['FOO'];puts ENV['BAZ']"),
                                        environment: { 'FOO' => 'bar', 'BAZ' => 'quux' })

          process.run(formatter: formatter, environment: { 'FOO' => 'codfanglers' })

          expect(output.string).to eq "codfanglers\nquux\n"
        end
      end
    end

    context "when not given an environment variable" do
      it "does not make that variable available to the sub-process" do
        process = described_class.new(%(ruby -e "puts ENV['FOO']"))

        process.run(formatter: formatter)

        expect(output.string).to eq "\n"
      end
    end

    context "when given spawn options" do
      context "when the task is created" do
        it "applies those options to the sub-process" do
          process = described_class.new(%(ruby -e "puts ENV['PATH'];puts ENV['FOO']"),
                                        environment: { 'FOO' => 'bar' },
                                        spawn_options: { unsetenv_others: true }) # Should clear environment variables

          process.run(formatter: formatter)

          expect(output.string).to match /\A(nil)?\nbar\n\z/
        end
      end

      context "when the task is run" do
        it "applies those options to the sub-process" do
          process = described_class.new(%(ruby -e "puts ENV['PATH'];puts ENV['FOO']"),
                                        environment: { 'FOO' => 'bar' })

          process.run(formatter: formatter, spawn_options: { unsetenv_others: true })

          expect(output.string).to match /\A(nil)?\nbar\n\z/
        end
      end

      context "when the task is created and when it is run" do
        it "gives priority to the options passed in on run" do
          process = described_class.new(%(ruby -e "puts ENV['PATH'];puts ENV['FOO']"),
                                        environment: { 'FOO' => 'bar' },
                                        spawn_options: { unsetenv_others: true }) # Clear environment variables

          process.run(formatter: formatter, spawn_options: { unsetenv_others: false }) # Actually, don't!

          expect(output.string).to eq "#{ENV['PATH']}\nbar\n"
        end
      end
    end
  end
end