text:
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):

        # Adding field 'Project.coordinator'
        db.add_column('cms_project', 'coordinator', self.gf('django.db.models.fields.related.ForeignKey')(default=1, related_name='coordinator', to=orm['cms.Member']), keep_default=False)

    def backwards(self, orm):

        # Deleting field 'Project.coordinator'
        db.delete_column('cms_project', 'coordinator_id')

    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'cms.blogpost': {
            'Meta': {'object_name': 'BlogPost'},
            'author': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Member']"}),
            'date': ('django.db.models.fields.DateTimeField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'post': ('django.db.models.fields.TextField', [], {}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        },
        'cms.member': {
            'Meta': {'object_name': 'Member'},
            'blurb': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'city': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'classification': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'group': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
            'interests': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
            'state': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'profile'", 'to': "orm['auth.User']"})
        },
        'cms.news': {
            'Meta': {'object_name': 'News'},
            'content': ('django.db.models.fields.TextField', [], {}),
            'date': ('django.db.models.fields.DateTimeField', [], {}),
            'description': ('django.db.models.fields.TextField', [], {'max_length': '200'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'db_index': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        },
        'cms.page': {
            'Meta': {'object_name': 'Page'},
            'content': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'pub_front_page': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'pub_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'db_index': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        },
        'cms.project': {
            'Meta': {'object_name': 'Project'},
            'coordinator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'coordinator'", 'to': "orm['cms.Member']"}),
            'description': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
            'members': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'+'", 'symmetrical': 'False', 'to': "orm['cms.Member']"}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'})
        }
    }

    complete_apps = ['cms']


text:
<!doctype html>

        <title>Rust Log Viewer</title>
        <meta charset="utf-8">
        <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
        <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="./style.css">

Hey there! This tool parses log data generated
        by Rust programs
        (RUST_LOG=foo), and makes them colorable and easy to search. Just drop
        your log in the big 'ole text area right under this paragraph.

        <textarea class="form-control" rows="3" ng-model="input"></textarea>

            <form class="form-inline" role="form">

                    Module Filter
                    <input ng-model="module_filter" type="text" class="form-control" id="moduleFilter">

                    Content Filter
                    <input ng-model="content_filter" type="text" class="form-control" id="contentFilter">

            </form>

                    module
                    content

                    {{line.module}}
                    {{line.text}}

redpajama_set_name: RedPajamaGithub


text:
package com.yaconfig.core.util;

import com.yaconfig.core.Constants;

public class ConnStrKeyUtil {
	public static String getKeyNameFromStr(String str){
		String remoteKey = str.substring(str.indexOf(Constants.CONNECTION_KEY_SEPERATOR) + 1);
		return remoteKey;
	}

	public static String getConnStrFromStr(String str){
		String connStr = str.substring(0,str.indexOf(Constants.CONNECTION_KEY_SEPERATOR));
		return connStr;
	}

	public static String makeLocation(String connStr,String key){
		return connStr + Constants.CONNECTION_KEY_SEPERATOR + key;
	}
}


text:
<?php

namespace Kanboard\Formatter;

use Kanboard\Core\Filter\FormatterInterface;
use Kanboard\Model\ProjectModel;
use Kanboard\Model\TaskModel;

/**
 * Class TaskSuggestMenuFormatter
 *
 * @package Kanboard\Formatter
 * @author  Frederic Guillot
 */
class TaskSuggestMenuFormatter extends BaseFormatter implements FormatterInterface
{
    protected $limit = 25;

    /**
     * Limit number of results
     *
     * @param  $limit
     * @return $this
     */
    public function withLimit($limit)
    {
        $this->limit = $limit;
        return $this;
    }

    /**
     * Apply formatter
     *
     * @access public
     * @return mixed
     */
    public function format()
    {
        $result = array();
        $tasks = $this->query
            ->columns(
                TaskModel::TABLE.'.id',
                TaskModel::TABLE.'.title',
                ProjectModel::TABLE.'.name AS project_name'
            )
            ->asc(TaskModel::TABLE.'.id')
            ->limit($this->limit)
            ->findAll();

        foreach ($tasks as $task) {
            $html = '#'.$task['id'].' ';
            $html .= $this->helper->text->e($task['title']).' ';
            $html .= '<small>'.$this->helper->text->e($task['project_name']).'</small>';

            $result[] = array(
                'value' => (string) $task['id'],
                'html' => $html,
            );
        }

        return $result;
    }
}


text:
package main

import (
	"math/rand"
	"net/http"
	"time"

	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promauto"
	"github.com/prometheus/client_golang/prometheus/promhttp"
)

var histogram = promauto.NewHistogram(prometheus.HistogramOpts{
	Name:    "random_numbers",
	Help:    "A histogram of normally distributed random numbers.",
	Buckets: prometheus.LinearBuckets(-3, .1, 61),
})

func Random() {
	for {
		histogram.Observe(rand.NormFloat64())
		time.Sleep(100 * time.Millisecond)
	}
}

func main() {

	inFlightGauge := prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "in_flight_requests",
		Help: "A gauge of requests currently being served by the wrapped handler.",
	})

	counter := prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "api_requests_total",
			Help: "A counter for requests to the wrapped handler.",
		},
		[]string{"code", "method"},
	)

	// duration is partitioned by the HTTP method and handler. It uses custom
	// buckets based on the expected request duration.
	duration := prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "request_duration_seconds",
			Help:    "A histogram of latencies for requests.",
			Buckets: []float64{.25, .5, 1, 2.5, 5, 10},
		},
		[]string{"handler", "method"},
	)

	// responseSize has no labels, making it a zero-dimensional
	// ObserverVec.
	responseSize := prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "response_size_bytes",
			Help:    "A histogram of response sizes for requests.",
			Buckets: []float64{200, 500, 900, 1500},
		},
		[]string{},
	)

	// Create the handlers that will be wrapped by the middleware.
	pushHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("Push"))
	})
	pullHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte("Pull"))
	})

	// Register all of the metrics in the standard registry.
	prometheus.MustRegister(inFlightGauge, counter, duration, responseSize)

	// Instrument the handlers with all the metrics, injecting the "handler"
	// label by currying.
	pushChain := promhttp.InstrumentHandlerInFlight(inFlightGauge,
		promhttp.InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "push"}),
			promhttp.InstrumentHandlerCounter(counter,
				promhttp.InstrumentHandlerResponseSize(responseSize, pushHandler),
			),
		),
	)
	pullChain := promhttp.InstrumentHandlerInFlight(inFlightGauge,
		promhttp.InstrumentHandlerDuration(duration.MustCurryWith(prometheus.Labels{"handler": "pull"}),
			promhttp.InstrumentHandlerCounter(counter,
				promhttp.InstrumentHandlerResponseSize(responseSize, pullHandler),
			),
		),
	)

	go Random()
	http.Handle("/metrics", promhttp.Handler())
	http.Handle("/push", pushChain)
	http.Handle("/pull", pullChain)
	http.ListenAndServe(":8080", nil)
}


text: ALTER TABLE person RENAME TO employee;


text:
<?php declare(strict_types=1);

namespace SebastianBergmann\GlobalState;

use function array_diff;
use function array_key_exists;
use function array_keys;
use function array_merge;
use function function_exists;
use function get_defined_functions;
use function in_array;
use function is_array;
use ReflectionClass;
use ReflectionProperty;

/**
 * Restorer of snapshots of global state.
 */
class Restorer
{
    /**
     * Deletes function definitions that are not defined in a snapshot.
     *
     * @throws RuntimeException when the uopz_delete() function is not available
     *
     * @see https://github.com/krakjoe/uopz
     */
    public function restoreFunctions(Snapshot $snapshot): void
    {
        if (!function_exists('uopz_delete')) {
            throw new RuntimeException('The uopz_delete() function is required for this operation');
        }

        $functions = get_defined_functions();

        foreach (array_diff($functions['user'], $snapshot->functions()) as $function) {
            uopz_delete($function);
        }
    }

    /**
     * Restores all global and super-global variables from a snapshot.
     */
    public function restoreGlobalVariables(Snapshot $snapshot): void
    {
        $superGlobalArrays = $snapshot->superGlobalArrays();

        foreach ($superGlobalArrays as $superGlobalArray) {
            $this->restoreSuperGlobalArray($snapshot, $superGlobalArray);
        }

        $globalVariables = $snapshot->globalVariables();

        foreach (array_keys($GLOBALS) as $key) {
            if ($key !== 'GLOBALS' &&
                !in_array($key, $superGlobalArrays, true) &&
                !$snapshot->excludeList()->isGlobalVariableExcluded($key)) {
                if (array_key_exists($key, $globalVariables)) {
                    $GLOBALS[$key] = $globalVariables[$key];
                } else {
                    unset($GLOBALS[$key]);
                }
            }
        }
    }

    /**
     * Restores all static attributes in user-defined classes from this snapshot.
     */
    public function restoreStaticAttributes(Snapshot $snapshot): void
    {
        $current    = new Snapshot($snapshot->excludeList(), false, false, false, false, true, false, false, false, false);
        $newClasses = array_diff($current->classes(), $snapshot->classes());

        unset($current);

        foreach ($snapshot->staticAttributes() as $className => $staticAttributes) {
            foreach ($staticAttributes as $name => $value) {
                $reflector = new ReflectionProperty($className, $name);
                $reflector->setAccessible(true);
                $reflector->setValue($value);
            }
        }

        foreach ($newClasses as $className) {
            $class    = new ReflectionClass($className);
            $defaults = $class->getDefaultProperties();

            foreach ($class->getProperties() as $attribute) {
                if (!$attribute->isStatic()) {
                    continue;
                }

                $name = $attribute->getName();

                if ($snapshot->excludeList()->isStaticAttributeExcluded($className, $name)) {
                    continue;
                }

                if (!isset($defaults[$name])) {
                    continue;
                }

                $attribute->setAccessible(true);
                $attribute->setValue($defaults[$name]);
            }
        }
    }

    /**
     * Restores a super-global variable array from this snapshot.
     */
    private function restoreSuperGlobalArray(Snapshot $snapshot, string $superGlobalArray): void
    {
        $superGlobalVariables = $snapshot->superGlobalVariables();

        if (isset($GLOBALS[$superGlobalArray]) &&
            is_array($GLOBALS[$superGlobalArray]) &&
            isset($superGlobalVariables[$superGlobalArray])) {
            $keys = array_keys(
                array_merge(
                    $GLOBALS[$superGlobalArray],
                    $superGlobalVariables[$superGlobalArray]
                )
            );

            foreach ($keys as $key) {
                if (isset($superGlobalVariables[$superGlobalArray][$key])) {
                    $GLOBALS[$superGlobalArray][$key] = $superGlobalVariables[$superGlobalArray][$key];
                } else {
                    unset($GLOBALS[$superGlobalArray][$key]);
                }
            }
        }
    }
}


text:
No changes yet.

## 0.14.0 — Feb 23rd, 2015

### Configurable Socket Timeouts

Socket read and write timeouts are now configurable using
the `read_timeout` and `write_timeout` options, respectively.

Contributed by Chris Barton.

### Logged Messages as Serialised as JSON

...as opposed to Ruby object printing.

Contributed by Andrew Morton.

### Configurable Heartbeat

Config now supports a new option: `:heartbeat`, which is passed
on to Bunny.

Contributed by Simon Taranto.

### HoneyBadger Error Handler

Contributed by Daniel Farrell.

### Hutch.connected? Now Returns Up-to-Date Value

`Hutch.connected?` no longer relies on an ivar and always returns
an up-to-date value.

Contributed by Pierre-Louis Gottfrois.

## 0.13.0 — Dec 5th, 2014

### HTTP API Can Be Disabled for Consumers

HTTP API use can be disabled for consumers using the `:enable_http_api_use` config
option (defaults to true).

## 0.12.0 — Nov 25th, 2014

### Explicit Requires

Hutch no longer relies on `Kernel#autoload` to load its key
modules and classes.

Contributed by Pierre-Louis Gottfrois.

### hutch --version No Longer Fails

```
hutch --version
```

no longer fails with an exception.

Contributed by Olle Jonsson.

### Base Class for All Hutch Exceptions

All Hutch exceptions now inherit from `Hutch::Exception`.

Contributed by Pierre-Louis Gottfrois.

## 0.11.0 — Nov 14th, 2014

### Publisher Confirms Support

`:force_publisher_confirms` is a new configuration option that forces `Hutch.publish` to wait
for a confirm for every message published. Note that this **will cause a significant drop in throughput**:

``` ruby
Hutch::Config.set(:force_publisher_confirms, true)
```

`Hutch::Broker#confirm_select` and `Hutch::Broker#wait_for_confirms` are new public API methods
that delegate to their respective `Bunny::Channel` counterparts. `Hutch::Broker#confirm_select`
can be used to handle confirms with a callback instead of waiting:

``` ruby
broker.confirm_select do |delivery_tag, multiple, nack|
  # ...
end
```

### Bunny Update

Bunny is updated to [1.6.0](http://blog.rubyrabbitmq.info/blog/2014/10/31/bunny-1-dot-6-0-is-released/).

## 0.10.0 — Oct 22, 2014

### Configuration via URI

Hutch now supports a new configuration key, `:uri`, which allows
connection configuration via a URI.

Note that since the URI has to include credentials, this option
is not available on the command line.

### Bunny Update

Bunny is updated to `1.5.1`, which mitigates the POODLE attack
by disabling SSL 3.0 where possible.

### Payload in Error Handlers

Error handlers will now have access to message payload.

Contributed by Daniel Farrell.

### Exceptions in Error Handlers Don't Prevent Nacks

Exceptions in error handlers no longer prevent messages from being
`basic.nack`-ed.

### Pid File Support

`:pidfile` is a new configuration option that stores Hutch process
PID in a file at provided path.

Contributed by Rustam Sharshenov.

### More Info on Message

Bunny's `delivery_info`, `properties` and payload are now accessible on `Hutch::Message`.

Contributed by gregory.

### Optional Config Parameters

`Hutch::Config` constructor now accepts an extra hash of optional
configuration parameters.

Contributed by Ignazio Mostallino.

## 0.9.0 — May 13, 2014

### Platform-aware Signal Registration

Hutch will no longer attempt to register signal traps
for signals not supported by the environment (e.g. on by certain OSes).

Contributed by Tobias Matthies.

### TLS Fixes

Hutch now properly passes client TLS key and certificate to
Bunny.

Contributed by Eric Nelson.

### Bunny Update

Bunny is updated to 1.2.x which should offer
[much better latency](https://github.com/ruby-amqp/bunny/pull/187) for
workloads with lots of small messages published frequently.

### More Unit Testing Friendly CLI/Runner

`Hutch::CLI#run` now accepts a parameter and is easier to use
in automated tests.

## 0.8.0 — February 13, 2014

### Uncaught Exceptions Result in Rejected Messages

Uncaught exceptions in consumers now result in Hutch rejecting
messages (deliveries) using `basic.nack`. This way they are [dead lettered](http://www.rabbitmq.com/dlx.html).

Contributed by Garrett Johnson.

### Missing Require

`hutch/consumer.rb` no longer fails to load with the
apps that do not `require "set"`.

Contributed by Garrett Johnson.

### Relaxed Queue Namespace Validation

Namespaces now can include any characters that are valid in RabbitMQ
queue names.

Contributed by Garrett Johnson.

### basic.qos Configuration

It is now possible to configure `basic.qos` (aka channel prefetch) setting
used by Hutch using the `:channel_prefetch` config key.

### Passwords No Longer Logged

Hutch now elides passwords from logs.

## 0.7.0 — January 14, 2014

### Optional HTTP API Use

It is now possible to make Hutch [not use RabbitMQ HTTP
API](https://github.com/gocardless/hutch/pull/69) (e.g. when the
RabbitMQ management plugin that provides it is not available).

### Extra Arguments for Hutch::Broker#publish

Extra options [passed to `Hutch::Broker#publish` will now be propagated](https://github.com/gocardless/hutch/pull/61).

### Content-Type for Messages

Messages published with Hutch now have content type set
to `application/json`.

### Greater Heartbeat Interval

Hutch now uses heartbeat interval of 30, so heartbeats won't interfere with transfers
of large messages over high latency networks (e.g. between AWS availability regions).

### Custom Queue Names

It is now possible to [specify an optional queue name](https://github.com/gocardless/hutch/pull/49):

``` ruby
class FailedPaymentConsumer
  include Hutch::Consumer
  consume 'gc.ps.payment.failed'
  queue_name 'failed_payments'

  def process(message)
    mark_payment_as_failed(message[:id])
  end
end
```

### Global Properties for Publishers

[Global properties can now be specified](https://github.com/gocardless/hutch/pull/62) for publishing:

``` ruby
Hutch.global_properties = proc {
  { app_id: 'api', headers: { request_id: RequestId.request_id } }
}
```

## 0.6.0 - November 4, 2013

- Metadata can now be passed in to `#publish`

## 0.5.1 - October 17, 2013

- Raise an exception when publishing fails

## 0.5.0 - October 17, 2013

- Support for the `--mq-tls-key` and `--mq-tls-cert` configuration options.

## 0.4.5 - October 15, 2013

- No exception raised when hutch is run with no consumers. Instead, a warning
  is logged.
- Internal refactoring: use Bunny's shiny `ConsumerWorkPool#threads`
  attr_reader.

## 0.4.4 - October 12, 2013

- Friendlier Message#inspect, doesn't spew out detailed bunny info.

## 0.4.3 - October 11, 2013

- More autoloading tweaks, all internal modules are now autoloaded.

## 0.4.2 - October 11, 2013

- Autoload the Broker module, which was missed in the previous release.

## 0.4.1 - October 11, 2013

- Autoload internal modules. Fixes regression where the `Config` module was
  not available by simply `require`ing `hutch`.

## 0.4.0 - October 9, 2013

- Support for loading configuration from a file, specified with the `--config`
  command line option.

## 0.3.0 - September 24, 2013

- Add `--[no-]autoload-rails` flag to optionally disable the autoloading of
  Rails apps in the current directory

## 0.2.1 - September 17, 2013

- Fix inconsistency with `mq-tls` option

## 0.2.0 - September 16, 2013

- Support for connecting to RabbitMQ with TLS/SSL. There are two new
  configuration options : `mq-tls` and `mq-api-ssl`.
- JSON message parsing errors are now handled properly.

## 0.1.1 - September 9, 2013

- Relax Bunny dependency specification

## 0.1.0 - September 9, 2013

- Initial release


text:
basic modes:

Normal
Insert
Command-line

### Some Simple Vim Navigation
------------------------------

Normal mode

*Note:* Navigation for left down up right.  Must be in Normal mode press continuously to repeat.

* h left
* j down
* k up
* l right

* H high ( top of terminal window )
* M middle ( mid of window )
* L low ( bottom of window )

### Editing
------------------------------

Normal mode

*Note:* Navigation for left down up right.  Must be in command mode press continuously to repeat.

Returns to Normal mode

* x delete one character under the cursor and stays in command mode
* r replace one character under the cursor with another character
* R replace from command mode to escape

## Composed Commands
------------------------------

Remains in Normal mode

Action + Modifier + Noun

Examples:

* diw Delete + Inside + Word
* ci{ Change + Inside + {
* cip Change + Inside + Paragraph
* dt{ Delete + Till + {
* ciw change in word
* diw delete in word
* dip delete in paragraph
* dt{ delete until {

the paragraph block starts below this line paragraphs are separated by a blank line

```
{hello} // try ci{ here on any part of the expression
	this is a paragraph // navigate to any word and try ciw and diw
	a paragraph is this // move to any part of this entire block and try dip
hello
```

this won't get deleted if you use dip


text:
Exploration Library
=======

The exploration library addresses the 'gathering the data' aspect of machine learning rather than the 'using the data' aspect we are most familiar with. The primary goal here is to enable individuals (i.e. you) to gather the right data for using machine learning for interventions in a live system based on user feedback (click, dwell, correction, etc…). Empirically, gathering the right data has often made a substantial difference. Theoretically, we know it is required to disentangle causation from correlation effectively in general.

First version of client-side exploration library that includes the following exploration algorithms:
- Epsilon Greedy
- Tau First
- Softmax
- Bootstrap
- Generic (users can specify custom weight for every action)

This release supports C++ and C#.

For sample usage, see:

C++: https://github.com/multiworldtesting/explore/blob/master/explore_sample.cpp

C#: https://github.com/multiworldtesting/explore/blob/master/ExploreSample/ExploreOnlySample.cs


text:
//
// Created by Mark van der Broek on 13/03/2017.
//

/**
 * @brief Create the list of forbidden vehicles and customers. A forbidden vehicle for a customer is defined as
 *        the list of vehicles where it's in. The forbidden customers are the customers situated in one of these
 *        vehicles.
 *
 * @param [in] s    Solution
 *
 * @return Pair of vectors that consists of sets. Each set is a set of forbidden vehicles and customers.
 */

#include "solver.ih"

pair<vector<set<int>>, vector<set<int>>> Solver::createForbiddenVehiclesAndCustomers(Solution &s)
{
    vector<set<int>> forbiddenVehicles(s.getCustomers().size());
    vector<set<int>> forbiddenCustomers(s.getCustomers().size());
    for (size_t customerIdx = 0; customerIdx != s.getCustomers().size(); ++customerIdx)
    {
        for (pair<int, int> vehiclePair: s.getCustomers()[customerIdx].getVehicles())
        {
            Vehicle const &vehicle = s.getDepots()[vehiclePair.first].getVehicle(vehiclePair.second);
            forbiddenVehicles[customerIdx].insert(vehicle.getID());
            vector<int> customersToAdd = vehicle.getCustomerList();
            copy(customersToAdd.begin(), customersToAdd.end(), inserter(forbiddenCustomers[customerIdx],
                                                                        end(forbiddenCustomers[customerIdx])));
            int hoi = 1;
        }
    }

    return make_pair(forbiddenVehicles, forbiddenCustomers);
}


text:
<title>ToonTalk - A mente do Robô</title>
<link rel="stylesheet" type="text/css" href="../toontalk.css">

início •
busca •
compra •
manual •
novidades •
dúvidas •
suporte •
download •
imprensa •
contato

A mente do Robô

Depois que você treinou um robô, a mente dele contém uma cópia da caixa em que ele foi treinado para trabalhar. Quando se dá uma caixa para o robô, ele verificará se ela se ajusta à caixa em sua mente. Se houver alguma coisa na caixa na mente do robô que seja diferente da caixa que foi dada a ele, ele a rejeitará. Se ele for parte de uma equipe, ele deixará o robô que vem depois dele verificar a caixa. Se não houver um robô atrás dele, ele apenas parará de trabalhar. Ele não terá problema em trabalhar em uma caixa que tenha mais coisas que aquela em sua mente. Se houver alguma coisa na caixa em sua mente, e no mesmo lugar, na caixa que lhe foi dada, houver um ninho, ou ela estiver vazia, então ele apenas aguardará. Ele começará novamente se o pássaro cobrir seu ninho ou se você colocar alguma coisa na abertura.

Dica. Os robôs podem ser bastante exigentes. Você pode utilizar Asper para remover coisas de suas mentes, assim eles aceitarão mais tipos de caixas. Se você remover muitas coisas, eles poderão tentar trabalhar em caixas com as quais eles realmente não sabem o que fazer.

Dica Avançada. Se você utilizar Asper para remover apenas as coisas na superfície de um grupo de números em sua mente, então o robô ainda esperará até que um bloco de números esteja no mesmo lugar na caixa que você lhe dá, mas ele não se importará com o número que está no bloco. O mesmo acontece  com blocos de texto vazios  e caixas.

início •
busca •
compra •
manual •
novidades •
dúvidas •
suporte •
download •
imprensa •
contato


text:
package net.bingyan.common.constant;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * Created by 2bab on 15/5/15.
 * 日期、时间相关的辅助类
 */
public class DateUtil {

    private static SimpleDateFormat standardFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);

    public static String getStandardTime() {
        return standardFormatter.format(new Date());
    }
}


text:
import jwt
import httplib as http

import mock
from django.db.models import Q
from nose.tools import *  # noqa

from tests.base import OsfTestCase
from osf_tests import factories
from tests.utils import mock_auth

from framework.exceptions import HTTPError

from website import settings
from osf.models import AbstractNode, Embargo, RegistrationApproval, Retraction, Sanction
from website.tokens import decode, encode, TokenHandler
from website.tokens.exceptions import TokenHandlerNotFound

NO_SANCTION_MSG = 'There is no {0} associated with this token.'
APPROVED_MSG = "This registration is not pending {0}."
REJECTED_MSG = "This registration {0} has been rejected."

class TestTokenHandler(OsfTestCase):

    def setUp(self, *args, **kwargs):
        super(TestTokenHandler, self).setUp(*args, **kwargs)

        self.payload = {
            'user_id': 'abc123',
            'field_x': 'xyzert'
        }
        self.secret = settings.JWT_SECRET
        self.encoded_token = jwt.encode(
            self.payload,
            self.secret,
            algorithm=settings.JWT_ALGORITHM)

    def test_encode(self):
        assert_equal(encode(self.payload), self.encoded_token)

    def test_decode(self):
        assert_equal(decode(self.encoded_token), self.payload)

    def test_from_string(self):
        token = TokenHandler.from_string(self.encoded_token)
        assert_equal(token.encoded_token, self.encoded_token)
        assert_equal(token.payload, self.payload)

    def test_from_payload(self):
        token = TokenHandler.from_payload(self.payload)
        assert_equal(token.encoded_token, self.encoded_token)
        assert_equal(token.payload, self.payload)

    def test_token_process_for_invalid_action_raises_TokenHandlerNotFound(self):
        self.payload['action'] = 'not a handler'
        token = TokenHandler.from_payload(self.payload)
        with assert_raises(TokenHandlerNotFound):
            token.to_response()

    @mock.patch('website.tokens.handlers.sanction_handler')
    def test_token_process_with_valid_action(self, mock_handler):
        self.payload['action'] = 'approve_registration_approval'
        token = TokenHandler.from_payload(self.payload)
        token.to_response()
        assert_true(
            mock_handler.called_with(
                'registration',
                'approve',
                self.payload,
                self.encoded_token
            )
        )

class SanctionTokenHandlerBase(OsfTestCase):

    kind = None
    Model = None
    Factory = None

    def setUp(self, *args, **kwargs):
        OsfTestCase.setUp(self, *args, **kwargs)
        if not self.kind:
            return
        self.sanction = self.Factory()
        self.reg = AbstractNode.objects.get(Q(**{self.Model.SHORT_NAME: self.sanction}))
        self.user = self.reg.creator

    def test_sanction_handler(self):
        if not self.kind:
            return
        approval_token = self.sanction.approval_state[self.user._id]['approval_token']
        handler = TokenHandler.from_string(approval_token)
        with mock_auth(self.user):
            with mock.patch('website.tokens.handlers.{0}_handler'.format(self.kind)) as mock_handler:
                handler.to_response()
                mock_handler.assert_called_with('approve', self.reg, self.reg.registered_from)

    def test_sanction_handler_no_sanction(self):
        if not self.kind:
            return
        approval_token = self.sanction.approval_state[self.user._id]['approval_token']
        handler = TokenHandler.from_string(approval_token)
        self.Model.delete(self.sanction)
        with mock_auth(self.user):
            try:
                handler.to_response()
            except HTTPError as e:
                assert_equal(e.code, http.BAD_REQUEST)
                assert_equal(e.data['message_long'], NO_SANCTION_MSG.format(self.Model.DISPLAY_NAME))

    def test_sanction_handler_sanction_approved(self):
        if not self.kind:
            return
        approval_token = self.sanction.approval_state[self.user._id]['approval_token']
        handler = TokenHandler.from_string(approval_token)
        self.sanction.state = Sanction.APPROVED
        self.sanction.save()
        with mock_auth(self.user):
            try:
                handler.to_response()
            except HTTPError as e:
                assert_equal(e.code, http.BAD_REQUEST if self.kind in ['embargo', 'registration_approval'] else http.GONE)
                assert_equal(e.data['message_long'], APPROVED_MSG.format(self.sanction.DISPLAY_NAME))

    def test_sanction_handler_sanction_rejected(self):
        if not self.kind:
            return
        approval_token = self.sanction.approval_state[self.user._id]['approval_token']
        handler = TokenHandler.from_string(approval_token)
        self.sanction.state = Sanction.REJECTED
        self.sanction.save()
        with mock_auth(self.user):
            try:
                handler.to_response()
            except HTTPError as e:
                assert_equal(e.code, http.GONE if self.kind in ['embargo', 'registration_approval'] else http.BAD_REQUEST)
                assert_equal(e.data['message_long'], REJECTED_MSG.format(self.sanction.DISPLAY_NAME))

class TestEmbargoTokenHandler(SanctionTokenHandlerBase):

    kind = 'embargo'
    Model = Embargo
    Factory = factories.EmbargoFactory

class TestRegistrationApprovalTokenHandler(SanctionTokenHandlerBase):

    kind = 'registration_approval'
    Model = RegistrationApproval
    Factory = factories.RegistrationApprovalFactory

class TestRetractionTokenHandler(SanctionTokenHandlerBase):

    kind = 'retraction'
    Model = Retraction
    Factory = factories.RetractionFactory


text:
//
//  JMApplicationDelegate.h
//  CoreLib
//
//  Created by CoreCode on 05.05.15.

#import "CoreLib.h"

CC_ENUM(uint8_t, purchaseActivationType)
{
    kPurchaseActivationFree = 0,
    kPurchaseActivationPaid = 1,
    kPurchaseActivationPro = 2
};

#ifdef USE_SPARKLE
#if __has_feature(modules)
@import Sparkle;
#else
#import <Sparkle/Sparkle.h>
#endif
#endif

@interface JMApplicationDelegate : NSObject
#ifdef USE_SPARKLE
#if USE_SPARKLE == 2
    <SPUStandardUserDriverDelegate, SPUUpdaterDelegate>
#elif USE_SPARKLE == 1
    <SUUpdaterDelegate>
#endif
#endif
{

#ifdef USE_SPARKLE
#if USE_SPARKLE == 2
    SPUUpdater *updater;
    SPUStandardUserDriver *userDriver;
#else
    SUUpdater *updater;
#endif
#endif
}

- (IBAction)openWindow:(__strong NSWindow **)window nibName:(NSString *)nibName;
- (IBAction)openURL:(NSObject *)sender;

@property (readonly, nonatomic) BOOL isRateable;

- (void)increaseUsagesBy:(int)usageIncrease
        allowRatingsWith:(int)allowReviewLimit
     requestFeedbackWith:(int)requestReviewLimit
            feedbackText:(NSString *)feedbackText
        allowFeedbackNow:(BOOL)allowNow
        forceFeedbackNow:(BOOL)forceAppearance;

- (void)welcomeOrExpireDemo:(int)demoLimit welcomeText:(NSString *)welcomeText expiryText:(NSString *)expiryText;
- (void)checkBetaExpiryForDate:(const char *)preprocessorDateString days:(uint8_t)expiryDays;
- (void)checkMASReceipt;
#ifndef SANDBOX
- (void)checkAndReportCrashesContaining:(NSArray <NSString *>*)neccessarySubstringsOrNil to:(NSString *)destinationMail;
- (void)checkAndReportCrashesContaining:(NSArray <NSString *> *)neccessarySubstringsOrNil blacklistedStrings:(NSArray <NSString *> *)blacklistedStringsOrNil to:(NSString *)destinationMail;
#endif

#ifdef USE_SPARKLE
- (IBAction)initUpdateCheck;
- (IBAction)setUpdateCheck:(NSObject *)sender;
- (IBAction)checkForUpdatesAction:(id)sender;
- (void)selectCurrentUpdateIntervalMenuItem:(NSMenu *)menu;
#endif

// PURCHASE
- (IBAction)purchaseDeactivateClicked:(id)sender;
- (IBAction)purchaseDetailsClicked:(id)sender;
- (IBAction)purchaseActivateClicked:(id)sender;
- (IBAction)purchaseRecoverClicked:(id)sender;
@property (assign, nonatomic) BOOL purchaseEnabled;
@property (assign, nonatomic) purchaseActivationType purchaseActivated;
@property (strong, nonatomic) NSString *purchaseEmail;
@property (strong, nonatomic) NSString *purchaseLicense;

@end

#define kUsagesThisVersionKey makeString(@"corelib_%@_usages", cc.appVersionString)
#define kUsagesAllVersionKey @"corelib_usages"
CONST_KEY_DECLARATION(UpdatecheckMenuindex)


text:
<!DOCTYPE html>

    <title>Sample Express Application 001 : Static Files</title>
    <link rel="stylesheet" type="text/css" href="/css/default.css" />

Sample Express Application 001 : Static Files

      Welcome to the resource page for example application 001. You are currently
      viewing a HTML page served up using the
      static middleware
      from connect.js. (Express.js is layered
      on top of a previous package called "connect.js")

Looking at the Logs

      Now that you've requested this page, you may want to visit the log file for the 001_static.js
      application. You should see a line that looks like this:

192.168.56.1 - - [Wed, 15 Feb 2012 00:41:52 GMT] "GET /001_static.html HTTP/1.1" 200 833 "http://helium.l.nodify.us:10100/" "blah... blah... blah..."

      If you click on a link to a resource that doesn't exist, you should see something like this in the log:

192.168.56.1 - - [Wed, 15 Feb 2012 00:44:39 GMT] "GET /foo.html HTTP/1.1" 404 - "-" "blah... blah... blah..."

      The main difference here is the 404 return code. This is just to show you that node + express can be setup to behave very similarly to apache.
      Visit the logger middleware page for more info.

Favicons

      Another topic covered in this example is the favicon middleware.
      Click here to see the favicon this app is serving up.

Directory Listing

      Express can be configured to provide directory listings if you like. Look what happens when you point your browser at the /css
      directory (that doesn't have an index.html file in it.)


text:
import React, { Component } from 'react';

import { BrowserRouter, Route } from 'react-router-dom';

import Header from './Header';

import Friends from './friends/Friends.entry';
import FriendDetail from './friend-detail/FriendDetail.entry';

import styles from './App.css';

class App extends Component {
  render() {
    return (
      <BrowserRouter>

            <Route path="/" exact component={Friends} />
            <Route path="/friends/:id" component={FriendDetail} />

      </BrowserRouter>
    );
  }
}

export default App;


text:
'use strict'

const merge = require('merge-recursive').recursive
const ZeroNet = require('zeronet-node')
const MEM = require('zeronet-storage-memory')
const clone = require('clone')
const crypto = require('zeronet-crypto')

const Id = require('peer-id')

module.exports = function ZeroNetBundler (opt) {
  const bname = opt.name || 'ZeroNetBundle'
  let r = {}
  const strict = {
    modules: opt.modules
  }

  const defaults = merge(opt.override, {
    swarm: {
      zero: {
        listen: [],
        crypto: [
          crypto.secio
        ]
      },
      libp2p: {
        relay: {
          enabled: true,
          hop: {
            enabled: true,
            active: false // passive
          }
        }
      }
    },
    modules: {},
    storage: MEM
  })
  r[bname] = function (opt, cb) { // hack to set function name
    if (!cb) cb = () => {}
    if (!opt) opt = {}
    let config = merge(merge(clone(defaults), clone(strict)), merge(opt, clone(strict)))
    const Storage = defaults.storage
    if (!opt.storage) config.storage = new Storage()
    let node
    const liftoff = (err, id) => {
      if (err) return cb(err)
      if (id) config.id = id
      node = new ZeroNet(config)
      cb(null, node)
      return node
    }

    if (!opt.id) {
      Id.create({
        bits: 2048
      }, liftoff)
    } else return liftoff(null, opt.id)
  }
  return r[bname]
}


text:
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.2.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/

#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H

#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QStatusBar>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QWidget>

QT_BEGIN_NAMESPACE

class Ui_MainWindow
{
public:
    QAction *actionConnect;
    QAction *actionExit;
    QWidget *centralWidget;
    QGroupBox *groupBoxRelay1;
    QPushButton *pushButtonRelayStatus1;
    QToolButton *toolButtonSettingsRelay1;
    QGroupBox *groupBoxRelay1_2;
    QPushButton *pushButtonRelayStatus1_2;
    QToolButton *toolButtonSettingsRelay1_2;
    QGroupBox *groupBoxRelay1_3;
    QPushButton *pushButtonRelayStatus1_3;
    QToolButton *toolButtonSettingsRelay1_3;
    QGroupBox *groupBoxRelay1_4;
    QPushButton *pushButtonRelayStatus1_4;
    QToolButton *toolButtonSettingsRelay1_4;
    QGroupBox *groupBoxRelay1_6;
    QPushButton *pushButtonRelayStatus1_6;
    QToolButton *toolButtonSettingsRelay1_6;
    QGroupBox *groupBoxRelay1_7;
    QPushButton *pushButtonRelayStatus1_7;
    QToolButton *toolButtonSettingsRelay1_7;
    QGroupBox *groupBoxRelay1_8;
    QPushButton *pushButtonRelayStatus1_8;
    QToolButton *toolButtonSettingsRelay1_8;
    QLabel *labelConnectionState;
    QMenuBar *menuBar;
    QMenu *menuParis_Relay_Test;
    QToolBar *mainToolBar;
    QStatusBar *statusBar;

    void setupUi(QMainWindow *MainWindow)
    {
        if (MainWindow->objectName().isEmpty())
            MainWindow->setObjectName(QStringLiteral("MainWindow"));
        MainWindow->resize(532, 195);
        actionConnect = new QAction(MainWindow);
        actionConnect->setObjectName(QStringLiteral("actionConnect"));
        actionExit = new QAction(MainWindow);
        actionExit->setObjectName(QStringLiteral("actionExit"));
        centralWidget = new QWidget(MainWindow);
        centralWidget->setObjectName(QStringLiteral("centralWidget"));
        groupBoxRelay1 = new QGroupBox(centralWidget);
        groupBoxRelay1->setObjectName(QStringLiteral("groupBoxRelay1"));
        groupBoxRelay1->setGeometry(QRect(10, 10, 121, 61));
        pushButtonRelayStatus1 = new QPushButton(groupBoxRelay1);
        pushButtonRelayStatus1->setObjectName(QStringLiteral("pushButtonRelayStatus1"));
        pushButtonRelayStatus1->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1->setCheckable(true);
        pushButtonRelayStatus1->setFlat(false);
        toolButtonSettingsRelay1 = new QToolButton(groupBoxRelay1);
        toolButtonSettingsRelay1->setObjectName(QStringLiteral("toolButtonSettingsRelay1"));
        toolButtonSettingsRelay1->setGeometry(QRect(90, 20, 25, 21));
        groupBoxRelay1_2 = new QGroupBox(centralWidget);
        groupBoxRelay1_2->setObjectName(QStringLiteral("groupBoxRelay1_2"));
        groupBoxRelay1_2->setGeometry(QRect(140, 10, 121, 61));
        pushButtonRelayStatus1_2 = new QPushButton(groupBoxRelay1_2);
        pushButtonRelayStatus1_2->setObjectName(QStringLiteral("pushButtonRelayStatus1_2"));
        pushButtonRelayStatus1_2->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1_2->setCheckable(true);
        pushButtonRelayStatus1_2->setFlat(false);
        toolButtonSettingsRelay1_2 = new QToolButton(groupBoxRelay1_2);
        toolButtonSettingsRelay1_2->setObjectName(QStringLiteral("toolButtonSettingsRelay1_2"));
        toolButtonSettingsRelay1_2->setGeometry(QRect(90, 20, 25, 21));
        groupBoxRelay1_3 = new QGroupBox(centralWidget);
        groupBoxRelay1_3->setObjectName(QStringLiteral("groupBoxRelay1_3"));
        groupBoxRelay1_3->setGeometry(QRect(270, 10, 121, 61));
        pushButtonRelayStatus1_3 = new QPushButton(groupBoxRelay1_3);
        pushButtonRelayStatus1_3->setObjectName(QStringLiteral("pushButtonRelayStatus1_3"));
        pushButtonRelayStatus1_3->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1_3->setCheckable(true);
        pushButtonRelayStatus1_3->setFlat(false);
        toolButtonSettingsRelay1_3 = new QToolButton(groupBoxRelay1_3);
        toolButtonSettingsRelay1_3->setObjectName(QStringLiteral("toolButtonSettingsRelay1_3"));
        toolButtonSettingsRelay1_3->setGeometry(QRect(90, 20, 25, 21));
        groupBoxRelay1_4 = new QGroupBox(centralWidget);
        groupBoxRelay1_4->setObjectName(QStringLiteral("groupBoxRelay1_4"));
        groupBoxRelay1_4->setGeometry(QRect(400, 10, 121, 61));
        pushButtonRelayStatus1_4 = new QPushButton(groupBoxRelay1_4);
        pushButtonRelayStatus1_4->setObjectName(QStringLiteral("pushButtonRelayStatus1_4"));
        pushButtonRelayStatus1_4->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1_4->setCheckable(true);
        pushButtonRelayStatus1_4->setFlat(false);
        toolButtonSettingsRelay1_4 = new QToolButton(groupBoxRelay1_4);
        toolButtonSettingsRelay1_4->setObjectName(QStringLiteral("toolButtonSettingsRelay1_4"));
        toolButtonSettingsRelay1_4->setGeometry(QRect(90, 20, 25, 21));
        groupBoxRelay1_6 = new QGroupBox(centralWidget);
        groupBoxRelay1_6->setObjectName(QStringLiteral("groupBoxRelay1_6"));
        groupBoxRelay1_6->setGeometry(QRect(10, 80, 121, 61));
        pushButtonRelayStatus1_6 = new QPushButton(groupBoxRelay1_6);
        pushButtonRelayStatus1_6->setObjectName(QStringLiteral("pushButtonRelayStatus1_6"));
        pushButtonRelayStatus1_6->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1_6->setCheckable(true);
        pushButtonRelayStatus1_6->setFlat(false);
        toolButtonSettingsRelay1_6 = new QToolButton(groupBoxRelay1_6);
        toolButtonSettingsRelay1_6->setObjectName(QStringLiteral("toolButtonSettingsRelay1_6"));
        toolButtonSettingsRelay1_6->setGeometry(QRect(90, 20, 25, 21));
        groupBoxRelay1_7 = new QGroupBox(centralWidget);
        groupBoxRelay1_7->setObjectName(QStringLiteral("groupBoxRelay1_7"));
        groupBoxRelay1_7->setGeometry(QRect(140, 80, 121, 61));
        pushButtonRelayStatus1_7 = new QPushButton(groupBoxRelay1_7);
        pushButtonRelayStatus1_7->setObjectName(QStringLiteral("pushButtonRelayStatus1_7"));
        pushButtonRelayStatus1_7->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1_7->setCheckable(true);
        pushButtonRelayStatus1_7->setFlat(false);
        toolButtonSettingsRelay1_7 = new QToolButton(groupBoxRelay1_7);
        toolButtonSettingsRelay1_7->setObjectName(QStringLiteral("toolButtonSettingsRelay1_7"));
        toolButtonSettingsRelay1_7->setGeometry(QRect(90, 20, 25, 21));
        groupBoxRelay1_8 = new QGroupBox(centralWidget);
        groupBoxRelay1_8->setObjectName(QStringLiteral("groupBoxRelay1_8"));
        groupBoxRelay1_8->setGeometry(QRect(270, 80, 121, 61));
        pushButtonRelayStatus1_8 = new QPushButton(groupBoxRelay1_8);
        pushButtonRelayStatus1_8->setObjectName(QStringLiteral("pushButtonRelayStatus1_8"));
        pushButtonRelayStatus1_8->setGeometry(QRect(10, 20, 75, 23));
        pushButtonRelayStatus1_8->setCheckable(true);
        pushButtonRelayStatus1_8->setFlat(false);
        toolButtonSettingsRelay1_8 = new QToolButton(groupBoxRelay1_8);
        toolButtonSettingsRelay1_8->setObjectName(QStringLiteral("toolButtonSettingsRelay1_8"));
        toolButtonSettingsRelay1_8->setGeometry(QRect(90, 20, 25, 21));
        labelConnectionState = new QLabel(centralWidget);
        labelConnectionState->setObjectName(QStringLiteral("labelConnectionState"));
        labelConnectionState->setGeometry(QRect(470, 80, 46, 51));
        labelConnectionState->setPixmap(QPixmap(QString::fromUtf8(":/icons/network-disconnected")));
        MainWindow->setCentralWidget(centralWidget);
        menuBar = new QMenuBar(MainWindow);
        menuBar->setObjectName(QStringLiteral("menuBar"));
        menuBar->setGeometry(QRect(0, 0, 532, 21));
        menuParis_Relay_Test = new QMenu(menuBar);
        menuParis_Relay_Test->setObjectName(QStringLiteral("menuParis_Relay_Test"));
        MainWindow->setMenuBar(menuBar);
        mainToolBar = new QToolBar(MainWindow);
        mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
        MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
        statusBar = new QStatusBar(MainWindow);
        statusBar->setObjectName(QStringLiteral("statusBar"));
        MainWindow->setStatusBar(statusBar);

        menuBar->addAction(menuParis_Relay_Test->menuAction());
        menuParis_Relay_Test->addAction(actionConnect);
        menuParis_Relay_Test->addSeparator();
        menuParis_Relay_Test->addAction(actionExit);

        retranslateUi(MainWindow);

        QMetaObject::connectSlotsByName(MainWindow);
    } // setupUi

    void retranslateUi(QMainWindow *MainWindow)
    {
        MainWindow->setWindowTitle(QApplication::translate("MainWindow", "Paris Relay Module Test", 0));
        actionConnect->setText(QApplication::translate("MainWindow", "Connect...", 0));
        actionExit->setText(QApplication::translate("MainWindow", "Exit", 0));
        groupBoxRelay1->setTitle(QApplication::translate("MainWindow", "Relay 1", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1->setText(QApplication::translate("MainWindow", "...", 0));
        groupBoxRelay1_2->setTitle(QApplication::translate("MainWindow", "Relay 2", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1_2->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1_2->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1_2->setText(QApplication::translate("MainWindow", "...", 0));
        groupBoxRelay1_3->setTitle(QApplication::translate("MainWindow", "Relay 3", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1_3->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1_3->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1_3->setText(QApplication::translate("MainWindow", "...", 0));
        groupBoxRelay1_4->setTitle(QApplication::translate("MainWindow", "Relay 4", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1_4->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1_4->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1_4->setText(QApplication::translate("MainWindow", "...", 0));
        groupBoxRelay1_6->setTitle(QApplication::translate("MainWindow", "Relay 5", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1_6->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1_6->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1_6->setText(QApplication::translate("MainWindow", "...", 0));
        groupBoxRelay1_7->setTitle(QApplication::translate("MainWindow", "Relay 6", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1_7->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1_7->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1_7->setText(QApplication::translate("MainWindow", "...", 0));
        groupBoxRelay1_8->setTitle(QApplication::translate("MainWindow", "Relay 7", 0));
#ifndef QT_NO_STATUSTIP
        pushButtonRelayStatus1_8->setStatusTip(QApplication::translate("MainWindow", "Status for relay", 0));
#endif // QT_NO_STATUSTIP
        pushButtonRelayStatus1_8->setText(QApplication::translate("MainWindow", "On", 0));
        toolButtonSettingsRelay1_8->setText(QApplication::translate("MainWindow", "...", 0));
        labelConnectionState->setText(QString());
        menuParis_Relay_Test->setTitle(QApplication::translate("MainWindow", "Paris Relay Test", 0));
        mainToolBar->setWindowTitle(QString());
    } // retranslateUi

};

namespace Ui {
    class MainWindow: public Ui_MainWindow {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MAINWINDOW_H


text:
<!DOCTYPE html>

	Your Sandbox request has been updated by an admin:

	Review Request


text:
It is not allowed to use or capture an uninitialized variable.

Erroneous code example:

```compile_fail,E0381
fn main() {
    let x: i32;
    let y = x; // error, use of possibly-uninitialized variable
}
```

To fix this, ensure that any declared variables are initialized before being
used. Example:

```
fn main() {
    let x: i32 = 0;
    let y = x; // ok!
}
```


text:
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import object

from grako.parsing import graken, Parser
from grako.util import re, RE_FLAGS

__version__ = (2015, 12, 13, 14, 46, 59, 6)

__all__ = [
    'yepParser',
    'yepSemantics',
    'main'
]

class yepParser(Parser):
    def __init__(self,
                 whitespace=None,
                 nameguard=None,
                 comments_re=None,
                 eol_comments_re=None,
                 ignorecase=None,
                 left_recursion=True,
                 **kwargs):
        super(yepParser, self).__init__(
            whitespace=whitespace,
            nameguard=nameguard,
            comments_re=comments_re,
            eol_comments_re=eol_comments_re,
            ignorecase=ignorecase,
            left_recursion=left_recursion,
            **kwargs
        )

    @graken()
    def _yep_(self):
        self._expression_()
        self._check_eof()

    @graken()
    def _expression_(self):
        self._conditional_expression_()

    @graken()
    def _conditional_expression_(self):
        self._logical_or_expression_()
        self.ast['cond'] = self.last_node
        with self._optional():
            with self._group():
                self._token('?')
                self._expression_()
                self.ast['yes'] = self.last_node
                self._token(':')
                self._conditional_expression_()
                self.ast['no'] = self.last_node
            self.ast['val'] = self.last_node

        self.ast._define(
            ['cond', 'val', 'yes', 'no'],
            []
        )

    @graken()
    def _logical_or_expression_(self):
        self._logical_and_expression_()
        self.ast['l'] = self.last_node

        def block1():
            with self._group():
                self._OP_OR_()
                self._logical_and_expression_()
            self.ast.setlist('op_and_r', self.last_node)
        self._closure(block1)

        self.ast._define(
            ['l'],
            ['op_and_r']
        )

    @graken()
    def _logical_and_expression_(self):
        self._equality_expression_()
        self.ast['l'] = self.last_node

        def block1():
            with self._group():
                self._OP_AND_()
                self._equality_expression_()
            self.ast.setlist('op_and_r', self.last_node)
        self._closure(block1)

        self.ast._define(
            ['l'],
            ['op_and_r']
        )

    @graken()
    def _equality_expression_(self):
        self._relational_expression_()
        self.ast['l'] = self.last_node

        def block1():
            with self._group():
                self._OP_EQ_()
                self._relational_expression_()
            self.ast.setlist('op_and_r', self.last_node)
        self._closure(block1)

        self.ast._define(
            ['l'],
            ['op_and_r']
        )

    @graken()
    def _relational_expression_(self):
        self._unary_expression_()
        self.ast['l'] = self.last_node

        def block1():
            with self._group():
                self._OP_BINARY_()
                self._unary_expression_()
            self.ast.setlist('op_and_r', self.last_node)
        self._closure(block1)

        self.ast._define(
            ['l'],
            ['op_and_r']
        )

    @graken()
    def _unary_expression_(self):
        with self._choice():
            with self._option():
                self._OP_UNARY_()
                self.ast['op'] = self.last_node
                self._unary_expression_()
                self.ast['op_exp'] = self.last_node
            with self._option():
                self._primary_expression_()
                self.ast['exp'] = self.last_node
            self._error('no available options')

        self.ast._define(
            ['op', 'op_exp', 'exp'],
            []
        )

    @graken()
    def _primary_expression_(self):
        with self._choice():
            with self._option():
                self._constant_()
            with self._option():
                self._token('(')
                self._expression_()
                self.ast['@'] = self.last_node
                self._token(')')
            self._error('no available options')

    @graken()
    def _constant_(self):
        with self._choice():
            with self._option():
                self._number_()
            with self._option():
                self._string_()
            self._error('no available options')

    @graken()
    def _number_(self):
        self._pattern(r'\d+')

    @graken()
    def _string_(self):
        with self._choice():
            with self._option():
                self._simple_string_()
            with self._option():
                self._quoted_string_()
            self._error('no available options')

    @graken()
    def _simple_string_(self):
        with self._ifnot():
            self._KW_()
        self._pattern(r'[A-Za-z_](?:[A-Za-z_0-9.-]*[A-Za-z_])?')
        self.ast['@'] = self.last_node

    @graken()
    def _quoted_string_(self):
        with self._choice():
            with self._option():
                self._pattern(r'"')
                self._pattern(r'[^"\\]*(?:\\.[^"\\]*)*')
                self.ast['@'] = self.last_node
                self._pattern(r'"')
            with self._option():
                self._pattern(r"'")
                self._pattern(r"[^'\\]*(?:\\.[^'\\]*)*")
                self.ast['@'] = self.last_node
                self._pattern(r"'")
            self._error('expecting one of: " \'')

    @graken()
    def _OP_UNARY_(self):
        with self._choice():
            with self._option():
                self._token('!')
            with self._option():
                self._token('not')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('+')
            with self._option():
                self._token('-')
            with self._option():
                self._token('#')
            self._error('expecting one of: ! # + - not')

    @graken()
    def _OP_OR_(self):
        with self._choice():
            with self._option():
                self._token('or')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('||')
            self._error('expecting one of: or ||')

    @graken()
    def _OP_AND_(self):
        with self._choice():
            with self._option():
                self._token('and')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('&&')
            self._error('expecting one of: && and')

    @graken()
    def _OP_BINARY_(self):
        with self._choice():
            with self._option():
                self._token('<=')
            with self._option():
                self._token('le')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('<')
            with self._option():
                self._token('lt')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('>=')
            with self._option():
                self._token('ge')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('>')
            with self._option():
                self._token('gt')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('in')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                with self._group():
                    self._token('not')
                    self._pattern(r' +')
                    self._token('in')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            self._error('expecting one of: < <= > >= ge gt in le lt not')

    @graken()
    def _OP_ASGN_(self):
        self._token(':=')

    @graken()
    def _OP_EQ_(self):
        with self._choice():
            with self._option():
                self._token('==')
            with self._option():
                self._token('eq')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('!=')
            with self._option():
                self._token('ne')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('=~')
            with self._option():
                self._token('!~')
            with self._option():
                self._token('isa')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                with self._group():
                    self._token('is')
                    self._pattern(r' +')
                    self._token('not')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            with self._option():
                self._token('is')
                self.ast['@'] = self.last_node
                self._pattern(r'\b')
            self._error('expecting one of: != !~ == =~ eq is isa ne')

    @graken()
    def _KW_(self):
        with self._group():
            with self._choice():
                with self._option():
                    self._token('return')
                with self._option():
                    self._token('def')
                with self._option():
                    self._token('sub')
                with self._option():
                    self._token('func')
                with self._option():
                    self._token('do')
                with self._option():
                    self._token('end')
                with self._option():
                    self._token('if')
                with self._option():
                    self._token('elif')
                with self._option():
                    self._token('else')
                with self._option():
                    self._token('for')
                with self._option():
                    self._token('while')
                with self._option():
                    self._token('repeat')
                with self._option():
                    self._token('until')
                with self._option():
                    self._token('next')
                with self._option():
                    self._token('break')
                with self._option():
                    self._token('continue')
                with self._option():
                    self._token('var')
                with self._option():
                    self._token('goto')
                with self._option():
                    self._token('with')
                with self._option():
                    self._token('true')
                with self._option():
                    self._token('false')
                with self._option():
                    self._token('nil')
                with self._option():
                    self._token('null')
                with self._option():
                    self._token('undef')
                with self._option():
                    self._token('not')
                with self._option():
                    self._token('and')
                with self._option():
                    self._token('or')
                with self._option():
                    self._token('isa')
                with self._option():
                    self._token('is')
                with self._option():
                    self._token('in')
                with self._option():
                    self._token('eq')
                with self._option():
                    self._token('ne')
                with self._option():
                    self._token('gt')
                with self._option():
                    self._token('ge')
                with self._option():
                    self._token('lt')
                with self._option():
                    self._token('le')
                self._error('expecting one of: and break continue def do elif else end eq false for func ge goto gt if in is isa le lt ne next nil not null or repeat return sub true undef until var while with')
        self._pattern(r'\b')

    @graken()
    def _WS_(self):
        self._pattern(r'\s+')

class yepSemantics(object):
    def yep(self, ast):
        return ast

    def expression(self, ast):
        return ast

    def conditional_expression(self, ast):
        return ast

    def logical_or_expression(self, ast):
        return ast

    def logical_and_expression(self, ast):
        return ast

    def equality_expression(self, ast):
        return ast

    def relational_expression(self, ast):
        return ast

    def unary_expression(self, ast):
        return ast

    def primary_expression(self, ast):
        return ast

    def constant(self, ast):
        return ast

    def number(self, ast):
        return ast

    def string(self, ast):
        return ast

    def simple_string(self, ast):
        return ast

    def quoted_string(self, ast):
        return ast

    def OP_UNARY(self, ast):
        return ast

    def OP_OR(self, ast):
        return ast

    def OP_AND(self, ast):
        return ast

    def OP_BINARY(self, ast):
        return ast

    def OP_ASGN(self, ast):
        return ast

    def OP_EQ(self, ast):
        return ast

    def KW(self, ast):
        return ast

    def WS(self, ast):
        return ast

def main(filename, startrule, trace=False, whitespace=None, nameguard=None):
    import json
    with open(filename) as f:
        text = f.read()
    parser = yepParser(parseinfo=False)
    ast = parser.parse(
        text,
        startrule,
        filename=filename,
        trace=trace,
        whitespace=whitespace,
        nameguard=nameguard)
    print('AST:')
    print(ast)
    print()
    print('JSON:')
    print(json.dumps(ast, indent=2))
    print()

if __name__ == '__main__':
    import argparse
    import string
    import sys

    class ListRules(argparse.Action):
        def __call__(self, parser, namespace, values, option_string):
            print('Rules:')
            for r in yepParser.rule_list():
                print(r)
            print()
            sys.exit(0)

    parser = argparse.ArgumentParser(description="Simple parser for yep.")
    parser.add_argument('-l', '--list', action=ListRules, nargs=0,
                        help="list all rules and exit")
    parser.add_argument('-n', '--no-nameguard', action='store_true',
                        dest='no_nameguard',
                        help="disable the 'nameguard' feature")
    parser.add_argument('-t', '--trace', action='store_true',
                        help="output trace information")
    parser.add_argument('-w', '--whitespace', type=str, default=string.whitespace,
                        help="whitespace specification")
    parser.add_argument('file', metavar="FILE", help="the input file to parse")
    parser.add_argument('startrule', metavar="STARTRULE",
                        help="the start rule for parsing")
    args = parser.parse_args()

    main(
        args.file,
        args.startrule,
        trace=args.trace,
        whitespace=args.whitespace,
        nameguard=not args.no_nameguard
    )


text:
package tcpcall

import (
	"log"
	"os"
	"strconv"
	"time"
)

// Global configurations
var (
	// Enable tracing for client or not
	gTraceClient bool
	// Enable tracing for clients pool or not
	gTracePool bool
	// Enable tracing for server or not
	gTraceServer bool
	// For client and clients pool - max simultaneous
	// requests per one connection
	gConcurrency = 100
	// Max write buffer size for connection
	gWriteBufferSize = 0xffff
	// Min flush period for connection write buffer.
	// 0 means data will be written to the socket
	// immediately.
	gMinFlushPeriod time.Duration
)

func init() {
	if s := os.Getenv("TCPCALL_CONCURRENCY"); s != "" {
		i, err := strconv.ParseUint(s, 10, 64)
		if err != nil {
			log.Fatalf("bad value %#v for"+
				" write buffer size: %s", s, err)
		}
		gConcurrency = int(i)
	}
	s := os.Getenv("TCPCALL_CLIENT_TRACE")
	gTraceClient = 0 < len(s)
	s = os.Getenv("TCPCALL_POOL_TRACE")
	gTracePool = 0 < len(s)
	s = os.Getenv("TCPCALL_SERVER_TRACE")
	gTraceServer = 0 < len(s)
	if s := os.Getenv("TCPCALL_W_BUF_SIZE"); 0 < len(s) {
		i, err := strconv.ParseUint(s, 10, 64)
		if err != nil {
			log.Fatalf("bad value %#v for"+
				" write buffer size: %s", s, err)
		}
		gWriteBufferSize = int(i)
	}
	if s := os.Getenv("TCPCALL_W_BUF_MIN_FLUSH_PERIOD"); 0 < len(s) {
		d, err := time.ParseDuration(s)
		if err != nil {
			log.Fatalf("bad value %#v for write"+
				" buffer min flush period: %s", s, err)
		}
		gMinFlushPeriod = d
	}
}


text:
<form class="form-inline" ng-submit="setProperty(property)" name="form">

                {{property.meta.name}}
                <input type="password"
                       class="form-control user-edit-regular"
                       id="{{property.meta.type}}"
                       name="data"
                       placeholder="{{property.meta.name}}"
                       required
                       ng-model="property.data">

                <input type="password"
                       class="form-control user-edit-regular"
                       id="confirm_{{property.meta.type}}"
                       name="confirm"
                       placeholder="Confirm {{property.meta.name}}"
                       required
                       ng-model="confirm"
                       tt-match="property.data">

            <button type="submit" class="btn btn-primary" ng-disabled="form.$invalid">Set</button>
            {{property.meta.name}} is required
            Confirm is required
            Confirm must match

                    {{property.meta.name}}
                    <input type="checkbox"
                           class="user-edit-regular"
                           id="{{property.meta.type}}"
                           name="data"
                           ng-model="property.data"
                           ng-change="setProperty(property)">

                {{property.meta.name}}
                <input type="number"
                       class="form-control user-edit-wide"
                       id="{{property.meta.type}}"
                       name="data"
                       placeholder="{{property.meta.name}}"
                       ng-model="property.data"
                       ng-required="property.meta.required">

            <button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || form.$pristine">Set</button>
            {{property.meta.name}} is required
            {{property.meta.name}} must be a number

                {{property.meta.name}}
                <input type="email"
                       class="form-control user-edit-wide"
                       id="{{property.meta.type}}"
                       name="data"
                       placeholder="{{property.meta.name}}"
                       ng-model="property.data"
                       ng-required="property.meta.required">

            <button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || form.$pristine">Set</button>
            {{property.meta.name}} is required
            {{property.meta.name}} must be a valid email

                {{property.meta.name}}
                <input type="url"
                       class="form-control user-edit-wide"
                       id="{{property.meta.type}}"
                       name="data"
                       placeholder="{{property.meta.name}}"
                       ng-model="property.data"
                       ng-required="property.meta.required">

            <button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || form.$pristine">Set</button>
            {{property.meta.name}} is required
            {{property.meta.name}} must be a valid URL

                {{property.meta.name}}
                <input type="text"
                       class="form-control user-edit-wide"
                       id="{{property.meta.type}}"
                       name="data"
                       placeholder="{{property.meta.name}}"
                       ng-model="property.data"
                       ng-required="property.meta.required">

            <button type="submit" class="btn btn-primary" ng-disabled="form.$invalid || form.$pristine">Set</button>
            {{property.meta.name}} is required

</form>


text:
package gcscleaner

func (r Cleaner) ExtractTimestampSuffix(name string) *string {
	return r.extractTimestampSuffix(name)
}

func (r Cleaner) ShouldDeleteBucket(name string, now int64) bool {
	return r.shouldDeleteBucket(name, now)
}


text:
package org.apache.archiva.metadata.repository.jcr;

import org.apache.archiva.metadata.model.MetadataFacetFactory;
import org.apache.archiva.metadata.repository.AbstractRepositorySessionFactory;
import org.apache.archiva.metadata.repository.MetadataRepository;
import org.apache.archiva.metadata.repository.MetadataRepositoryException;
import org.apache.archiva.metadata.repository.MetadataResolver;
import org.apache.archiva.metadata.repository.RepositorySession;
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
import org.apache.archiva.metadata.repository.RepositorySessionFactoryBean;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.StopWatch;
import org.apache.jackrabbit.oak.segment.file.InvalidFileStoreVersionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import javax.annotation.PreDestroy;
import javax.inject.Inject;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

/**
 *
 */
@Service( "repositorySessionFactory#jcr" )
public class JcrRepositorySessionFactory extends AbstractRepositorySessionFactory
    implements RepositorySessionFactory
{

    private Logger logger = LoggerFactory.getLogger( getClass() );

    @Inject
    private ApplicationContext applicationContext;

    private Map<String, MetadataFacetFactory> metadataFacetFactories;

    private Repository repository;

    // Lazy evaluation to avoid problems with circular dependencies during initialization
    private MetadataResolver metadataResolver;

    @Inject
    private RepositorySessionFactoryBean repositorySessionFactoryBean;

    private RepositoryFactory repositoryFactory;

    @Override
    public RepositorySession createSession()
    {
        try
        {
            // FIXME: is this the right separation? or should a JCR session object contain the JCR session information?
            //  such a change might allow us to avoid creating two objects for each request. It would also clear up
            //  the ambiguities in the API where session & repository are the inverse of JCR; and the resolver is
            //  retrieved from the session but must have it passed in. These should be reviewed before finalising the
            //  API.
            MetadataRepository metadataRepository = new JcrMetadataRepository( metadataFacetFactories, repository );

            return new RepositorySession( metadataRepository, getMetadataResolver() );
        }
        catch ( RepositoryException e )
        {
            // FIXME: a custom exception requires refactoring for callers to handle it
            throw new RuntimeException( e );
        }
    }

    // Lazy evaluation to avoid problems with circular dependencies during initialization
    private MetadataResolver getMetadataResolver()
    {
        if ( this.metadataResolver == null )
        {
            this.metadataResolver = applicationContext.getBean( MetadataResolver.class );
        }
        return this.metadataResolver;
    }

    public void initialize()
    {

        // skip initialisation if not jcr
        if ( repositorySessionFactoryBean!=null && !StringUtils.equals( repositorySessionFactoryBean.getId(), "jcr" ) )
        {
            return;
        }

        StopWatch stopWatch = new StopWatch();
        stopWatch.start();

        metadataFacetFactories = applicationContext.getBeansOfType( MetadataFacetFactory.class );
        // olamy with spring the "id" is now "metadataFacetFactory#hint"
        // whereas was only hint with plexus so let remove  metadataFacetFactory#
        Map<String, MetadataFacetFactory> cleanedMetadataFacetFactories =
            new HashMap<>( metadataFacetFactories.size() );

        for ( Map.Entry<String, MetadataFacetFactory> entry : metadataFacetFactories.entrySet() )
        {
            cleanedMetadataFacetFactories.put( StringUtils.substringAfterLast( entry.getKey(), "#" ),
                                               entry.getValue() );
        }

        metadataFacetFactories = cleanedMetadataFacetFactories;

        JcrMetadataRepository metadataRepository = null;
        try
        {

            repositoryFactory = new RepositoryFactory();
            // FIXME this need to be configurable
            Path directoryPath = Paths.get( System.getProperty( "appserver.base" ), "data/jcr" );
            repositoryFactory.setRepositoryPath( directoryPath );
            try {
                repository = repositoryFactory.createRepository();
            } catch (InvalidFileStoreVersionException | IOException e) {
                logger.error("Repository creation failed {}", e.getMessage());
                throw new RuntimeException("Fatal error. Could not create metadata repository.");
            }
            metadataRepository = new JcrMetadataRepository( metadataFacetFactories, repository );
            JcrMetadataRepository.initialize( metadataRepository.getJcrSession() );
        }
        catch ( RepositoryException e )
        {
            throw new RuntimeException( e.getMessage(), e );
        }
        finally
        {
            if ( metadataRepository != null )
            {
                try {
                    metadataRepository.close();
                } catch (MetadataRepositoryException e) {
                    logger.error("Close of metadata repository failed {}", e.getMessage());
                }
            }
        }

        stopWatch.stop();
        logger.info( "time to initialize JcrRepositorySessionFactory: {}", stopWatch.getTime() );
    }

    @Override
    protected void shutdown() {
        repositoryFactory.close();
    }

    @PreDestroy
    public void close()
    {
        super.close();
    }
}


text:
/*------------------------------------------------------------------
[Master Stylesheet]

- FONTS
- PLUGIN CSS
- MAIN CSS

Author:     Andrey Sokoltsov
Profile:    http://themeforest.net/user/andreysokoltsov
-------------------------------------------------------------------*/

/* FONTS */
@import url('https://fonts.googleapis.com/css?family=Lato:300,400,700,900,700italic,300italic');
@import url('https://fonts.googleapis.com/css?family=Open+Sans');

@import url('font-awesome.min.css');

/* PLUGIN CSS */
@import url('../assets/bxslider/jquery.bxslider.css');
@import url('../assets/owl-carousel/owl.carousel.css');
@import url('../assets/owl-carousel/owl.theme.css');
@import url('../assets/fancybox/jquery.fancybox.css');

/* MAIN CSS */
@import url('bootstrap.css');
@import url('theme.css');
@import url('blog.css');
@import url('page.css');
@import url('shop.css');
@import url('responsive.css');
@import url('animate.css');
@import url('colors.css');
@import url('custom.css');


text:
/* SPDX-License-Identifier: BSD-2-Clause */
/*
 * Copyright (c) 2014, STMicroelectronics International N.V.
 * Copyright (c) 2017, Linaro Limited
 */

#ifndef TEE_TA_MANAGER_H
#define TEE_TA_MANAGER_H

#include <types_ext.h>
#include <sys/queue.h>
#include <tee_api_types.h>
#include <utee_types.h>
#include <kernel/tee_common.h>
#include <kernel/mutex.h>
#include <tee_api_types.h>
#include <user_ta_header.h>

/* Magic TEE identity pointer: set when teecore requests a TA close */
#define KERN_IDENTITY	((TEE_Identity *)-1)
/* Operation is initiated by a client (non-secure) app */
#define NSAPP_IDENTITY	(NULL)

TAILQ_HEAD(tee_ta_session_head, tee_ta_session);
TAILQ_HEAD(tee_ta_ctx_head, tee_ta_ctx);

struct mobj;

struct param_val {
	uint32_t a;
	uint32_t b;
};

struct param_mem {
	struct mobj *mobj;
	size_t size;
	size_t offs;
};

struct tee_ta_param {
	uint32_t types;
	union {
		struct param_val val;
		struct param_mem mem;
	} u[TEE_NUM_PARAMS];
};

struct tee_ta_ctx;
struct user_ta_ctx;
struct pseudo_ta_ctx;

struct tee_ta_ops {
	TEE_Result (*enter_open_session)(struct tee_ta_session *s,
			struct tee_ta_param *param, TEE_ErrorOrigin *eo);
	TEE_Result (*enter_invoke_cmd)(struct tee_ta_session *s, uint32_t cmd,
			struct tee_ta_param *param, TEE_ErrorOrigin *eo);
	void (*enter_close_session)(struct tee_ta_session *s);
	void (*dump_state)(struct tee_ta_ctx *ctx);
	void (*destroy)(struct tee_ta_ctx *ctx);
	uint32_t (*get_instance_id)(struct tee_ta_ctx *ctx);
};

#if defined(CFG_TA_GPROF_SUPPORT)
struct sample_buf {
	uint32_t nsamples;	/* Size of @samples array in uint16_t */
	uint32_t offset;	/* Passed from user mode */
	uint32_t scale;		/* Passed from user mode */
	uint32_t count;		/* Number of samples taken */
	bool enabled;		/* Sampling enabled? */
	uint16_t *samples;
	uint64_t usr;		/* Total user CPU time for this session */
	uint64_t usr_entered;	/* When this session last entered user mode */
	uint32_t freq;		/* @usr divided by @freq is in seconds */
};
#endif

/* Context of a loaded TA */
struct tee_ta_ctx {
	TEE_UUID uuid;
	const struct tee_ta_ops *ops;
	uint32_t flags;		/* TA_FLAGS from TA header */
	TAILQ_ENTRY(tee_ta_ctx) link;
	uint32_t panicked;	/* True if TA has panicked, written from asm */
	uint32_t panic_code;	/* Code supplied for panic */
	uint32_t ref_count;	/* Reference counter for multi session TA */
	bool busy;		/* context is busy and cannot be entered */
	struct condvar busy_cv;	/* CV used when context is busy */
};

struct tee_ta_session {
	TAILQ_ENTRY(tee_ta_session) link;
	TAILQ_ENTRY(tee_ta_session) link_tsd;
	uint32_t id;		/* Session handle (0 is invalid) */
	struct tee_ta_ctx *ctx;	/* TA context */
	TEE_Identity clnt_id;	/* Identify of client */
	bool cancel;		/* True if TA invocation is cancelled */
	bool cancel_mask;	/* True if cancel is masked */
	TEE_Time cancel_time;	/* Time when to cancel the TA invocation */
	void *user_ctx;		/* Opaque session handle assigned by PTA */
	uint32_t ref_count;	/* reference counter */
	struct condvar refc_cv;	/* CV used to wait for ref_count to be 0 */
	struct condvar lock_cv;	/* CV used to wait for lock */
	int lock_thread;	/* Id of thread holding the lock */
	bool unlink;		/* True if session is to be unlinked */
#if defined(CFG_TA_GPROF_SUPPORT)
	struct sample_buf *sbuf; /* Profiling data (PC sampling) */
#endif
};

/* Registered contexts */
extern struct tee_ta_ctx_head tee_ctxes;

extern struct mutex tee_ta_mutex;

TEE_Result tee_ta_open_session(TEE_ErrorOrigin *err,
			       struct tee_ta_session **sess,
			       struct tee_ta_session_head *open_sessions,
			       const TEE_UUID *uuid,
			       const TEE_Identity *clnt_id,
			       uint32_t cancel_req_to,
			       struct tee_ta_param *param);

TEE_Result tee_ta_invoke_command(TEE_ErrorOrigin *err,
				 struct tee_ta_session *sess,
				 const TEE_Identity *clnt_id,
				 uint32_t cancel_req_to, uint32_t cmd,
				 struct tee_ta_param *param);

TEE_Result tee_ta_cancel_command(TEE_ErrorOrigin *err,
				 struct tee_ta_session *sess,
				 const TEE_Identity *clnt_id);

bool tee_ta_session_is_cancelled(struct tee_ta_session *s, TEE_Time *curr_time);

/*-----------------------------------------------------------------------------
 * Function called to close a TA.
 * Parameters:
 * id   - The session id (in)
 * Returns:
 *        TEE_Result
 *---------------------------------------------------------------------------*/
TEE_Result tee_ta_close_session(struct tee_ta_session *sess,
				struct tee_ta_session_head *open_sessions,
				const TEE_Identity *clnt_id);

TEE_Result tee_ta_get_current_session(struct tee_ta_session **sess);

void tee_ta_push_current_session(struct tee_ta_session *sess);
struct tee_ta_session *tee_ta_pop_current_session(void);

struct tee_ta_session *tee_ta_get_calling_session(void);

struct tee_ta_session *tee_ta_find_session(uint32_t id,
			struct tee_ta_session_head *open_sessions);

struct tee_ta_session *tee_ta_get_session(uint32_t id, bool exclusive,
			struct tee_ta_session_head *open_sessions);

void tee_ta_put_session(struct tee_ta_session *sess);

void tee_ta_dump_current(void);

#if defined(CFG_TA_GPROF_SUPPORT)
void tee_ta_gprof_sample_pc(vaddr_t pc);
void tee_ta_update_session_utime_suspend(void);
void tee_ta_update_session_utime_resume(void);
#else
static inline void tee_ta_gprof_sample_pc(vaddr_t pc __unused) {}
static inline void tee_ta_update_session_utime_suspend(void) {}
static inline void tee_ta_update_session_utime_resume(void) {}
#endif

#endif


text:
package vgrechka.phizdetsidea.phizdets.refactoring.classes.membersManager.vp;

import com.google.common.base.Preconditions;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.refactoring.BaseRefactoringProcessor;
import com.intellij.refactoring.ui.RefactoringDialog;
import com.intellij.util.containers.MultiMap;
import vgrechka.phizdetsidea.phizdets.psi.PyClass;
import vgrechka.phizdetsidea.phizdets.psi.PyElement;
import vgrechka.phizdetsidea.phizdets.refactoring.classes.membersManager.MembersConflictDialog;
import vgrechka.phizdetsidea.phizdets.refactoring.classes.membersManager.PyMemberInfo;
import vgrechka.phizdetsidea.phizdets.refactoring.classes.ui.PyMemberSelectionPanel;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
import java.util.Collection;

/**
 * {@link vgrechka.phizdetsidea.phizdets.refactoring.classes.membersManager.vp.MembersBasedView} implementation on swing.
 * Consists of {@link #myTopPanel} and {@link #myCenterPanel}. Children must fill them in constructor.
 * Presenter is stored in {@link #myPresenter}.
 * Panel with members in {@link #myPyMemberSelectionPanel}
 *
 * @param <P> View presenter class
 * @param <C> View configuration class
 */
public abstract class MembersBasedViewSwingImpl<P extends MembersBasedPresenter, C extends MembersViewInitializationInfo>
  extends RefactoringDialog implements MembersBasedView<C> {

  /**
   * Panel to be displayed on the top
   */
  @NotNull
  protected final JPanel myTopPanel;
  /**
   * Panel to be displayed at the center
   */
  @NotNull
  protected final JComponent myCenterPanel;

  /**
   * Presenter
   */
  @NotNull
  protected final P myPresenter;

  /**
   * Panel with members
   */
  @NotNull
  protected final PyMemberSelectionPanel myPyMemberSelectionPanel;

  private boolean myConfigured;

  /**
   *
   * @param project         project this view runs
   * @param presenter       view's presenter
   * @param title           window title
   * @param supportAbstract supports "abstract" column?
   */
  protected MembersBasedViewSwingImpl(@NotNull final Project project, @NotNull final P presenter, @NotNull final String title,
                                      final boolean supportAbstract) {
    super(project, true);
    myTopPanel = new JPanel(new BorderLayout());
    myCenterPanel = new JPanel(new BorderLayout());
    myPresenter = presenter;
    myPyMemberSelectionPanel = new PyMemberSelectionPanel(title, supportAbstract);
    //TODO: Take this from presenter to prevent inconsistence: now it is possible to create view that supports abstract backed by presenter that does not. And vice versa.
  }

  @Override
  public boolean showConflictsDialog(@NotNull final MultiMap<PyClass, PyMemberInfo<?>> duplicatesConflict,
                                     @NotNull final Collection<PyMemberInfo<?>> dependenciesConflicts) {
    Preconditions
      .checkArgument(!(duplicatesConflict.isEmpty() && dependenciesConflicts.isEmpty()), "Can't show dialog for empty conflicts");
    final DialogWrapper conflictsDialog = new MembersConflictDialog(myProject, duplicatesConflict, dependenciesConflicts);
    return conflictsDialog.showAndGet();
  }

  @Override
  public void showError(@NotNull final String message) {
    Messages.showErrorDialog(getContentPane(), message);
  }

  @Override
  protected boolean hasPreviewButton() {
    return myPresenter.showPreview();
  }

  @Override
  protected void doAction() {
    myPresenter.okClicked();
  }

  @NotNull
  @Override
  protected JComponent createNorthPanel() {
    return myTopPanel;
  }

  @Override
  public void close() {
    close(OK_EXIT_CODE);
  }

  @Override
  protected JComponent createCenterPanel() {
    return myCenterPanel;
  }

  @NotNull
  @Override
  public Collection<PyMemberInfo<PyElement>> getSelectedMemberInfos() {
    return myPyMemberSelectionPanel.getSelectedMemberInfos();
  }

  @Override
  public void invokeRefactoring(@NotNull final BaseRefactoringProcessor processor) {
    super.invokeRefactoring(processor);
  }

  @Override
  public void configure(@NotNull final C configInfo) {
    Preconditions.checkArgument(!myConfigured, "Already configured");
    myConfigured = true;
    myPyMemberSelectionPanel.init(configInfo.getMemberInfoModel(), configInfo.getMemberInfos());
  }

  @Override
  public void initAndShow() {
    Preconditions.checkArgument(myConfigured, "Not configured, run 'configure' first!");
    init();
    myPyMemberSelectionPanel.redraw();  // To display errors for checked member
    show();
  }
}


text:
import PnpmError from '@pnpm/error'
import findWorkspaceDir from '@pnpm/find-workspace-dir'
import makeDedicatedLockfile from '.'

main() // eslint-disable-line

async function main () {
  const projectDir = process.cwd()
  const lockfileDir = await findWorkspaceDir(projectDir)
  if (!lockfileDir) {
    throw new PnpmError('WORKSPACE_NOT_FOUND', 'Cannot create a dedicated lockfile for a project that is not in a workspace.')
  }
  await makeDedicatedLockfile(lockfileDir, projectDir)
}


text:
using System.ComponentModel.Composition;
using Microsoft.VisualStudio.Text.Editor;

namespace Microsoft.CodeAnalysis.Editor.UnitTests
{
    // In 15.6 the editor (QuickInfo in particular) took a dependency on
    // IObscuringTipManager, which is only exported in VS editor layer.
    // This is tracked by the editor bug https://devdiv.visualstudio.com/DevDiv/_workitems?id=544569.
    // Meantime a workaround is to export dummy IObscuringTipManager.
    [Export(typeof(IObscuringTipManager))]
    internal class TestObscuringTipManager : IObscuringTipManager
    {
        public void PushTip(ITextView view, IObscuringTip tip)
        {
        }

        public void RemoveTip(ITextView view, IObscuringTip tip)
        {
        }
    }
}