text:
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone

class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
    ]

    operations = [
        migrations.CreateModel(
            name='EXDBUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=30, unique=True, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
            ],
            options={
                'verbose_name': 'user',
                'abstract': False,
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Affiliation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
            ],
        ),
        migrations.CreateModel(
            name='Experience',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
                ('description', models.TextField(blank=True)),
                ('start_datetime', models.DateTimeField()),
                ('end_datetime', models.DateTimeField()),
                ('goal', models.TextField(blank=True)),
                ('audience', models.CharField(blank=True, choices=[('b', 'Building'), ('c', 'Campus'), ('f', 'Floor')], max_length=1)),
                ('guest', models.CharField(blank=True, max_length=300)),
                ('guest_office', models.CharField(blank=True, max_length=300)),
                ('attendance', models.IntegerField(blank=True, null=True)),
                ('created_datetime', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('status', models.CharField(choices=[('de', 'Denied'), ('dr', 'Draft'), ('pe', 'Pending Approval'), ('ad', 'Approved'), ('co', 'Completed'), ('ca', 'Cancelled')], default='dr', max_length=2)),
                ('conclusion', models.TextField(blank=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ExperienceApproval',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('approver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='approval_set', to=settings.AUTH_USER_MODEL)),
                ('experience', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='approval_set', to='exdb.Experience')),
            ],
            options={
                'ordering': ['timestamp'],
            },
        ),
        migrations.CreateModel(
            name='ExperienceComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('experience', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comment_set', to='exdb.Experience')),
            ],
            options={
                'ordering': ['timestamp'],
            },
        ),
        migrations.CreateModel(
            name='Keyword',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
                ('affiliation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exdb.Affiliation')),
            ],
        ),
        migrations.CreateModel(
            name='SubType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
            ],
        ),
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300)),
                ('needs_verification', models.BooleanField(default=True)),
            ],
        ),
        migrations.AddField(
            model_name='experience',
            name='keywords',
            field=models.ManyToManyField(blank=True, to='exdb.Keyword'),
        ),
        migrations.AddField(
            model_name='experience',
            name='next_approver',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='approval_queue', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='experience',
            name='planners',
            field=models.ManyToManyField(blank=True, related_name='planner_set', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='experience',
            name='recognition',
            field=models.ManyToManyField(blank=True, to='exdb.Section'),
        ),
        migrations.AddField(
            model_name='experience',
            name='sub_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exdb.SubType'),
        ),
        migrations.AddField(
            model_name='experience',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exdb.Type'),
        ),
        migrations.AddField(
            model_name='exdbuser',
            name='affiliation',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='exdb.Affiliation'),
        ),
        migrations.AddField(
            model_name='exdbuser',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='exdbuser',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
    ]


text:
@implementation Message

-(Message *)initWithPaap:(Paap *)paap andMessage:(NSString *)message time:(NSString *)time
{
    self = [[Message alloc] init];
    if(self)
    {
        self.paap = paap;
        self.messages = [NSMutableArray arrayWithObject:message];
        self.time = time;
    }
    return self;
}

-(NSString *)description
{
    return [NSString stringWithFormat:@"Paap: %@, time: %@, Messages: %@",self.paap,self.time,self.messages ];
}
@end

redpajama_set_name: RedPajamaGithub


text:
Demonstrates the connection of an iOS app to a Dropbox account via OAuth2,
the creation of files on iOS, the upload of said files to Dropbox and the
storage of the metadata response from Dropbox using Core Data

I need to stress the word **demonstrates**. This is not a generic framework,
it's an example app and, perhaps, a starting-point for other projects.
Frameworks tend to account for edge cases which bloat the code to epic
proportions.

# Generic classes
Below is a list of generic classes included in this project. With minimal
configuration, you ought to be able to drop these classes into your project.

- `ADWebService`: A generic handler for RESTfull HTTP requests. This is a tiny
  handler built around `NSURLSession` which was introduced in iOS 7. I'm quite
  certain it will suffice for nearly all iOS network requirements.
- `ADPersistentStack`: A generic handler for Core Data. This class was taken
  from Florian Kugler's example app, [NestedTodoList][todolist].
- `ADFetchedResultsControllerDataSource`: An implementation of
  `NSFetchedResultsController`. Once again taken from Florian Kugler. This class
   the most generic of the 3.

# Why bother? Dropbox has an iOS SDK
The iOS SDK for Dropbox was last updated in September of 2014. The code in the
SDK is not ARC compliant and contains unmaintained packages like
[MPOAuth][mpoauth]. More over, the SDK is extremely bloated. Downloading and
uploading files is a simple process, but the Dropbox SDK would make you believe
it's rocket surgery.

# Installation
To begin with, you'll need a Dropbox account and you'll have to set up a Dropbox
App. Next, rename `Resources/Secrets.example.plist` to `Resources/Secrets.plist`
and enter in the correct information.

More on this later.

[json]: https://developer.apple.com/library//ios/documentation/Foundation/Reference/NSJSONSerialization_Class/index.html
[url]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSession_class/
[mpoauth]: https://github.com/thekarladam/MPOAuth
[todolist]: https://github.com/objcio/issue-4-full-core-data-application


text:
package com.google.android.apps.forscience.whistlepunk;

import android.annotation.TargetApi;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

/**
 * SensorCardHeader gets Touch Events and calls an OnTouchListener function. It does not steal touch
 * events from its children.
 */
public class SensorCardHeader extends RelativeLayout {

  public interface onHeaderTouchListener {
    void onTouch();
  }

  private onHeaderTouchListener onTouchListener;

  public SensorCardHeader(Context context) {
    super(context);
  }

  public SensorCardHeader(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public SensorCardHeader(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
  }

  @TargetApi(21)
  public SensorCardHeader(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    super(context, attrs, defStyleAttr, defStyleRes);
  }

  public void setOnHeaderTouchListener(onHeaderTouchListener listener) {
    onTouchListener = listener;
  }

  @Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    if (onTouchListener != null) {
      onTouchListener.onTouch();
    }
    return false;
  }
}


text:
[CmdletBinding()]
param (
)

# Set a flag to force verbose as a default
$VerbosePreference ='Continue' # equiv to -verbose

# use the new API to set the variables
$Path = Get-VstsInput -Name "Path"
$VersionNumber = Get-VstsInput -Name "VersionNumber"
$InjectVersion = Get-VstsInput -Name "InjectVersion"
$VersionRegex = Get-VstsInput -Name "VersionRegex"
$outputversion = Get-VstsInput -Name "outputversion"
$Field = Get-VstsInput -Name "Field"
$FilenamePattern = Get-VstsInput -Name "FilenamePattern"

# Make sure path to source code directory is available
if (-not (Test-Path $Path))
{
    Write-Error "Source directory does not exist: $Path"
    exit 1
}
Write-Verbose "Source Directory: $Path"
Write-Verbose "Filename Pattern: $FilenamePattern"
Write-Verbose "Version Number/Build Number: $VersionNumber"
Write-Verbose "Version Filter to extract build number: $VersionRegex"
Write-Verbose "Field to update (all if empty): $Field"
Write-Verbose "Inject Version: $InjectVersion"
Write-verbose "Output: Version Number Parameter Name: $outputversion"

#dot source function for getting the file encoding.
. .\Get-FileEncoding.ps1

if ([System.Convert]::ToBoolean($InjectVersion) -eq $true) {
    Write-Verbose "Using the version number directly"
    $NewVersion = $VersionNumber
} else {
    Write-Verbose "Extracting version number from build number"
    $VersionData = [regex]::matches($VersionNumber,$VersionRegex)
    switch($VersionData.Count)
    {
    0
        {
            Write-Error "Could not find version number data in $VersionNumber."
            exit 1
        }
    1 {}
    default
        {
            Write-Warning "Found more than instance of version data in $VersionNumber."
            Write-Warning "Will assume first instance is version."
        }
    }
    $NewVersion = $VersionData[0]
}
Write-Verbose "Extracted Version: $NewVersion"

# Apply the version to the assembly property files
$files = Get-ChildItem $Path -recurse -include $FilenamePattern
if($files)
{
    Write-Verbose "Will apply $NewVersion to $($files.count) files."

    foreach ($file in $files) {
        $FileEncoding = Get-FileEncoding -Path $File.FullName
        $filecontent = Get-Content -Path $file.Fullname
        attrib $file -r
        if ([string]::IsNullOrEmpty($field))
        {
            Write-Verbose "Updating all version fields"
            $filecontent -replace $VersionRegex, $NewVersion | Out-File $file -Encoding $FileEncoding
        } else {
            Write-Verbose "Updating only the '$field' version"
            $filecontent -replace "$field\(`"$VersionRegex", "$field(`"$NewVersion" | Out-File $file -Encoding $FileEncoding
        }

        Write-Verbose "$file - version applied"
    }
    Write-Verbose "Set the output variable '$outputversion' with the value $NewVersion"
    Write-Host "##vso[task.setvariable variable=$outputversion;]$NewVersion"
}
else
{
    Write-Warning "Found no files."
}


text:
layout: default
---

{% include page_header.html %}

		{% if page.ads %}

			{% unless page.disable_sharing %}

			{% endunless %}

				{{ content }}

				{% include subscription.html %}

		{% else %}

			{% unless page.disable_sharing %}

			{% endunless %}

				{{ content }}

		{% endif %}


text:
Grunt handles all CoffeeScript configuration. You can configure compiler
settings in the project's Gruntfile.js.

There may be boilerplate javascript files in `app/public/js`. Move or delete
them to avoid collision.

For detailed information on configuring CoffeeScript with Grunt, see the docs
at https://github.com/gruntjs/grunt-contrib-coffee.


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

<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>
Choice (leJOS NXJ API documentation)
</TITLE>

<META NAME="date" CONTENT="2011-05-16">

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

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

javax.microedition.lcdui

Interface Choice

All Known Implementing Classes:
ChoiceGroup, List

public interface Choice

Author:

Andre Nijholt

Field Summary

static int
EXCLUSIVE

static int
IMPLICIT

static int
MULTIPLE

static int
POPUP

static int
TEXT_WRAP_DEFAULT

static int
TEXT_WRAP_OFF

static int
TEXT_WRAP_ON

Method Summary

 int
append(String stringPart,
       Image imagePart)

 void
delete(int elementNum)

 void
deleteAll()

 Image
getImage(int elementNum)

 int
getSelectedFlags(boolean[] selectedArray_return)

 int
getSelectedIndex()

 String
getString(int elementNum)

 void
insert(int elementNum,
       String stringPart,
       Image imagePart)

 boolean
isSelected(int elementNum)

 void
set(int elementNum,
    String stringPart,
    Image imagePart)

 void
setSelectedFlags(boolean[] selectedArray)

 void
setSelectedIndex(int elementNum,
                 boolean selected)

 int
size()

Field Detail

EXCLUSIVE

static final int EXCLUSIVE

See Also:
Constant Field Values

MULTIPLE

static final int MULTIPLE

See Also:
Constant Field Values

IMPLICIT

static final int IMPLICIT

See Also:
Constant Field Values

POPUP

static final int POPUP

See Also:
Constant Field Values

TEXT_WRAP_DEFAULT

static final int TEXT_WRAP_DEFAULT

See Also:
Constant Field Values

TEXT_WRAP_ON

static final int TEXT_WRAP_ON

See Also:
Constant Field Values

TEXT_WRAP_OFF

static final int TEXT_WRAP_OFF

See Also:
Constant Field Values

Method Detail

append

int append(String stringPart,
           Image imagePart)

delete

void delete(int elementNum)

deleteAll

void deleteAll()

getImage

Image getImage(int elementNum)

getSelectedFlags

int getSelectedFlags(boolean[] selectedArray_return)

getSelectedIndex

int getSelectedIndex()

getString

String getString(int elementNum)

insert

void insert(int elementNum,
            String stringPart,
            Image imagePart)

isSelected

boolean isSelected(int elementNum)

set

void set(int elementNum,
         String stringPart,
         Image imagePart)

setSelectedFlags

void setSelectedFlags(boolean[] selectedArray)

setSelectedIndex

void setSelectedIndex(int elementNum,
                      boolean selected)

size

int size()

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<?php
class Kwc_Shop_Cart_Checkout_Payment_PayPal_Component extends Kwc_Shop_Cart_Checkout_Payment_Abstract_Component
{
    public static function getSettings()
    {
        $ret = parent::getSettings();
        $ret['componentName'] = trlKwfStatic('PayPal');
        $ret['generators']['child']['component']['confirmLink'] = 'Kwc_Shop_Cart_Checkout_Payment_PayPal_ConfirmLink_Component';
        $ret['generators']['confirm']['component'] = 'Kwc_Shop_Cart_Checkout_Payment_PayPal_Confirm_Component';
        $ret['generators']['confirm']['name'] = trlKwfStatic('done');
        $ret['generators']['ipn'] = array(
            'class' => 'Kwf_Component_Generator_Page_Static',
            'component' => 'Kwc_Shop_Cart_Checkout_Payment_PayPal_Ipn_Component'
        );
        $ret['generators']['cancel'] = array(
            'class' => 'Kwf_Component_Generator_Page_Static',
            'component' => 'Kwc_Shop_Cart_Checkout_Payment_PayPal_Cancel_Component',
            'name' => trlKwfStatic('Cancel')
        );

        /**
         * Do not prompt buyers for a shipping address. Allowable values are:
         * 0 - prompt for an address, but do not require one
         * 1 - do not prompt for an address
         * 2 - prompt for an address, and require one
         */
        $ret['noShipping'] = 1;
        return $ret;
    }

    public static function validateSettings($settings, $componentClass)
    {
        if (isset($settings['business'])) {
            throw new Kwf_Exception('setting "business" is deprectated, use paypalId in config');
        }
    }

    public function confirmOrder($order)
    {
        throw new Kwf_Exception("Not valid for PayPal");
    }

    public function getItemName($order)
    {
        return trlKwf('Order at {0}', Kwf_Registry::get('config')->application->name);
    }

    public function processIpn(Kwf_Util_PayPal_Ipn_LogModel_Row $row, $param)
    {
        if ($row->txn_type == 'web_accept') {
            $order = Kwf_Model_Abstract::getInstance(Kwc_Abstract::getSetting($this->getData()->parent->parent->componentClass, 'childModel'))
                ->getReferencedModel('Order')->getRow($param['orderId']);
            if (!$order) {
                throw new Kwf_Exception("Order not found!");
            }

            $order->payment_component_id = $this->getData()->componentId;
            $order->checkout_component_id = $this->getData()->parent->componentId;
            $order->cart_component_class = $this->getData()->parent->parent->componentClass;

            if ($row->payment_status == 'Completed') {
                $order->status = 'payed';
                $order->payed = date('Y-m-d H:i:s');
            }

            if (!$order->confirm_mail_sent) {
                foreach ($this->getData()->parent->parent->getComponent()->getShopCartPlugins() as $p) {
                    $p->orderConfirmed($order);
                }
                foreach ($order->getChildRows('Products') as $p) {
                    $addComponent = Kwf_Component_Data_Root::getInstance()
                        ->getComponentByDbId($p->add_component_id);
                    $addComponent->getComponent()->orderConfirmed($p);
                }
                $this->sendConfirmMail($order);

                $order->date = date('Y-m-d H:i:s');
                $order->confirm_mail_sent = date('Y-m-d H:i:s');
            }

            $order->save();
            return true;
        } else {
            $mail = new Zend_Mail('utf-8');
            $mail->setBodyText(print_r($row->toArray(), true))
                ->setSubject('shop paypal: unbekannte notification');
            $mail->addTo('ns@vivid-planet.com');
            $mail->send();
        }
        return false;
    }
}


text:
Помимо декларативного использования `<router-link>` для создания ссылок, можно использовать роутер и императивно, напрямую вызывая методы его экземпляра.

#### `router.push(location, onComplete?, onAbort?)`

**Примечание: Внутри экземпляра Vue у вас есть доступ к экземпляру маршрутизатора через `$router`. Поэтому вы можете вызвать `this.$router.push`.**

Для перехода к новому URL, используйте `router.push`. Этот метод добавляет новую запись в стек истории навигации, что позволяет клику пользователя по кнопке "назад" в браузере сработать привычным образом.

При клике на `<router-link>` этот метод вызывается автоматически. Клик по `<router-link :to="...">` эквивалентен императивному вызову `router.push(...)`.

| Декларативная запись      | Императивная запись |
|---------------------------|---------------------|
| `<router-link :to="...">` | `router.push(...)`  |

В качестве аргумента можно передать строку или объект, описывающий путь. Например:

``` js
// строка
router.push('home')

// объект
router.push({ path: 'home' })

// именованный путь
router.push({ name: 'user', params: { userId: 123 }})

// со строкой запроса, получится /register?plan=private
router.push({ path: 'register', query: { plan: 'private' }})
```

**Примечание**: `params` игнорируются, если указан `path`, что не соответствует случаю с `query` показанному в примере выше.
Вместо этого, вам нужно указать `name` маршрута или вручную указать весь `path` с необходимыми параметрами:

```js
const userId = 123
router.push({ name: 'user', params: { userId }}) // -> /user/123
router.push({ path: `/user/${userId}` }) // -> /user/123
// Это НЕ БУДЕТ работать
router.push({ path: '/user', params: { userId }}) // -> /user
```

Те же правила применяются и к свойству `to` компонента `router-link`.

В версии 2.2.0+, можно указать опциональные `onComplete` и `onAbort` коллбеки в `router.push` или `router.replace` в качестве 2-го и 3-го аргументов. Эти коллбеки будут вызываться когда навигация либо успешно завершена (после того как все асинхронные хуки будут завершены), или прервана (переходом на этот же маршрут, или на другой маршрут прежде чем текущая навигация будет завершена), соответственно.

**Примечание:** Если путь назначения совпадает с текущим маршрутом и меняются только параметры (например, переход из одного профиля в другой `/users/1` -> `/users/2`), вам потребуется использовать [`beforeRouteUpdate`](./dynamic-matching.html#отслеживание-изменений-параметров) чтобы реагировать на изменения (например, получение информации о пользователе).

#### `router.replace(location, onComplete?, onAbort?)`

Действует подобно `router.push`, с той лишь разницей, что вместо добавления новой записи к стеку истории переходов, заменяет текущую запись в нём.

| Декларативная запись              |  Императивная запись  |
|-----------------------------------|-----------------------|
| `<router-link :to="..." replace>` | `router.replace(...)` |

#### `router.go(n)`

Единственным параметром этого метода является целое число, указывающее на сколько шагов необходимо перейти по стеку истории навигации (вперёд или назад, аналогично `window.history.go(n)`.

Примеры

``` js
// перейти на одну запись вперёд, эквивалентно history.forward()
router.go(1)

// перейти на одну запись назад, эквивалентно history.back()
router.go(-1)

// перейти на 3 записи вперёд
router.go(3)

// если записей в истории недостаточно много, перехода просто не произойдёт
router.go(-100)
router.go(100)
```

#### Манипулирование историей переходов

Вы могли заметить, что `router.push`, `router.replace` и `router.go` соответствуют [`window.history.pushState`, `window.history.replaceState` и `window.history.go`](https://developer.mozilla.org/en-US/docs/Web/API/History), имитируя таким образом API `window.history`.

По этой причине, если вы уже знакомы с [API истории переходов браузера](https://developer.mozilla.org/en-US/docs/Web/API/History_API), то и со Vue-router неожиданностей не возникнет.

Стоит отметить, что методы навигации Vue-router'а (`push`, `replace`, `go`) работают одинаково во всех режимах роутера (`history`, `hash` и `abstract`).


text:
package com.mygdx.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Vector2;

import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TiledMapRenderer;
import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;

import java.util.ArrayList;

public class GameScreen implements Screen {

    final DroidStrike game;
    ArrayList<Player> bullets;
    OrthographicCamera camera;

    private SpriteBatch batch;
    private TiledMap map;
    private TextureRegion bull;
    private Texture bulletTexture;

    private TextureRegion region;
    private Texture texture;

    private TextureRegion regionDown;
    private Texture textureDown;

    private TextureRegion regionUp;
    private Texture textureUp;

    private TextureRegion regionLeft;
    private Texture textureLeft;

    private Player player;

    public GameScreen (final DroidStrike game) {
        this.game = game;
        this.player = new Player();
        this.batch = new SpriteBatch();

        this.texture = new Texture(Gdx.files.internal("westdrone.png"));
		this.textureDown = new Texture(Gdx.files.internal("southdrone.png"));
		this.textureUp = new Texture(Gdx.files.internal("northdrone.png"));
		this.textureLeft = new Texture(Gdx.files.internal("eastdrone.png"));
        this.bulletTexture = new Texture(Gdx.files.internal("bullet.png"));

        bull = new TextureRegion(bulletTexture);

        region = new TextureRegion(texture);

        regionDown = new TextureRegion(textureDown);

        regionUp = new TextureRegion(textureUp);

        regionLeft = new TextureRegion(textureLeft);

        camera = new OrthographicCamera();
        camera.setToOrtho(false, 800, 480);

		bullets = new ArrayList<Player>();
    }

	@Override
    public void render(float delta) {
        Gdx.gl.glClearColor(0, 0, 0.2f, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

		float ydir = Gdx.input.getAccelerometerY();
		float xdir = Gdx.input.getAccelerometerX();

        player.setDirection(ydir, -1*xdir);

        player.move(delta);
		player.speed = 10;

        for(int i = 0; i < bullets.size(); i++) {
			if (bullets.size() > 50 || bullets.get(i).killOrInc())
				bullets.remove(i);
			else bullets.get(i).moveBullet(delta);
        }

        if (Gdx.input.isTouched()) {
            Player bullet = new Player();
			Vector2 dir = new Vector2(player.direction.x, player.direction.y);
			dir = dir.nor();
			if (xdir < 0 && Math.abs(xdir) > Math.abs(ydir))
            	bullet.setDirection(0, 1);
			else if (xdir > 0 && Math.abs(xdir) > Math.abs(ydir))
            	bullet.setDirection(0, -1);
			else if (ydir < 0 && Math.abs(ydir) > Math.abs(xdir))
				bullet.setDirection(-1, 0);
			else bullet.setDirection(1, 0);
            bullet.position.x = player.position.x;
            bullet.position.y = player.position.y;
            bullet.speed = 40;
            bullets.add(bullet);
        }

        batch.begin();

        for(Player b: bullets) {
            batch.draw(bull, b.position.x, b.position.y);
        }

		if (xdir < 0 && Math.abs(xdir) > Math.abs(ydir))
        	batch.draw(regionUp, player.position.x - textureUp.getWidth()/2f, player.position.y);
		else if (xdir > 0 && Math.abs(xdir) > Math.abs(ydir))
			batch.draw(regionDown, player.position.x - textureDown.getWidth()/2f, player.position.y);
		else if (ydir < 0 && Math.abs(ydir) > Math.abs(xdir))
        	batch.draw(region, player.position.x - texture.getWidth()/2f, player.position.y);
		else
        	batch.draw(regionLeft, player.position.x - textureLeft.getWidth()/2f, player.position.y);

        batch.end();
        camera.update();
    }

	@Override
    public void resize(int width, int height) {
    }

    @Override
    public void show() {
    }

    @Override
    public void hide() {
    }

    @Override
    public void pause() {
    }

    @Override
    public void resume() {
    }

    @Override
    public void dispose() {
        batch.dispose();
        bulletTexture.dispose();
        texture.dispose();
        textureUp.dispose();
        textureDown.dispose();
        textureLeft.dispose();
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp">

    <com.jude.rollviewpager.RollPagerView
        android:id="@+id/news_banner"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        app:rollviewpager_play_delay="5000"/>
</LinearLayout>


text:
Overview
========

Dask arrays implement a subset of the NumPy interface on large arrays using
blocked algorithms and task scheduling.

Scope
-----

The ``dask.array`` library supports the following interface from ``numpy``.

*  Arithmetic and scalar mathematics, ``+, *, exp, log, ...``
*  Reductions along axes, ``sum(), mean(), std(), sum(axis=0), ...``
*  Tensor contractions / dot products / matrix multiply, ``tensordot``
*  Axis reordering / transpose, ``transpose``
*  Slicing, ``x[:100, 500:100:-2]``
*  Fancy indexing along single axes with lists or numpy arrays, ``x[:, [10, 1, 5]]``
*  The array protocol ``__array__``

These operations should match the NumPy interface precisely.

Construct
---------

We can construct dask array objects from other array objects that support
numpy-style slicing.  Here we wrap a dask array around an HDF5 dataset,
chunking that dataset into blocks of size ``(1000, 1000)``.

.. code-block:: Python

   >>> import h5py
   >>> f = h5py.File('myfile.hdf5')
   >>> dset = f['/data/path']

   >>> import dask.array as da
   >>> x = da.from_array(dset, chunks=(1000, 1000))

Often we have many such datasets.  We can use the ``stack`` or ``concatenate``
functions to bind many dask arrays into one.

.. code-block:: Python

   >>> dsets = [h5py.File(fn)['/data'] for fn in sorted(glob('myfiles.*.hdf5')]
   >>> arrays = [da.from_array(dset, chunks=(1000, 1000))
                   for dset in dsets]

   >>> x = da.stack(arrays, axis=0)  # Stack along a new first axis

Interact
--------

Dask copies the NumPy API for an important subset of operations, including
arithmetic operators, ufuncs, slicing, dot products, and reductions.

.. code-block:: Python

   >>> y = log(x + 1)[:5].sum(axis=1)

Store
-----

If your data is small you can call ``np.array`` on your dask array to turn it
in to a normal NumPy array.

If your data is large then you can store your dask array in any object that
supports numpy-style item assignment like an ``h5py.Dataset``.

.. code-block:: Python

   >>> import h5py  # doctest: +SKIP
   >>> f = h5py.File('myfile.hdf5')

   >>> dset = f.create_dataset('/data', shape=y.shape,
   ...                                  chunks=[t[0] for t in y.chunks],
   ...                                  dtype='f8')

   >>> y.store(dset)

Limitations
-----------

Dask.array does not implement the entire numpy interface.  Users expecting this
will be disappointed.  Notably dask.array has the following failings:

1.  Dask does not implement all of ``np.linalg``.  This has been done by a
    number of excellent BLAS/LAPACK implementations and is the focus of
    numerous ongoing academic research projects.
2.  Dask.array does not support any operation where the resulting shape
    depends on the values of the array.  In order to form the dask graph we
    must be able to infer the shape of the array before actually executing the
    operation.  This precludes operations like indexing one dask array with
    another or operations like ``np.where``.
3.  Dask.array does not attempt operations like ``sort`` which are notoriously
    difficult to do in parallel and are of somewhat diminished value on very
    large data (you rarely actually need a full sort).
    Often we include parallel-friendly alternatives like ``topk``.
4.  Dask development is driven by immediate need, and so many lesser used
    functions, like ``np.full_like`` have not been implemented purely out of
    laziness.  These would make excellent community contributions.


text:
<?xml version="1.0" encoding="UTF-8"?>

    <title>Wicket Examples - component reference</title>
    <link rel="stylesheet" type="text/css" href="style.css"/>

wicket.markup.html.form.TextArea

	<wicket:link>[back to the reference]</wicket:link>

	A TextArea is like a TextField, but is used for multiple rows of text.

	 <form wicket:id="form">

		  multiple lines of text

		  <textarea wicket:id="text" rows="6" cols="20">Input comes here</textarea>

		   <input type="submit" value="submit" />

	 </form>
	 feedbackmessages will be put here

    panel contents come here


text:
package com.cisco.axl.api._8;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for XMlppDomain complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="XMlppDomain">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence minOccurs="0">
 *         <element name="domainName" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="domainId" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "XMlppDomain", propOrder = {
    "domainName",
    "domainId"
})
public class XMlppDomain {

    protected String domainName;
    protected String domainId;

    /**
     * Gets the value of the domainName property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDomainName() {
        return domainName;
    }

    /**
     * Sets the value of the domainName property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDomainName(String value) {
        this.domainName = value;
    }

    /**
     * Gets the value of the domainId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDomainId() {
        return domainId;
    }

    /**
     * Sets the value of the domainId property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDomainId(String value) {
        this.domainId = value;
    }

}


text:
@interface MBLChartPager : NSView {

	int _currentPage;
	int _totalPages;
}

- (void)setCurrentPage:(int)page;
- (int)currentPage;
- (void)setTotalPages:(int)pages;
- (int)totalPages;

@end


text:
<?php

namespace GEMA\gemaBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * CategoriaNoticia
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="GEMA\gemaBundle\Entity\OfertaLaboralRepository")
 * @ORM\Table(name="ofertalaboral")

 */
class OfertaLaboral {

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     * @ORM\Column(name="titulo", type="string", length=1500)
     */
    private $titulo;

    /**
     * @ORM\Column(name="activa", type="boolean", nullable=true)
     */
    private $activa;

    /**
     * @var string
     * @ORM\Column(name="area", type="string", length=1500)
     */
    private $area;

    /**
     * @var string
     * @ORM\Column(name="descripcion", type="string", length=1500)
     */
    private $descripcion;

    /**
     * @ORM\OneToMany(targetEntity="GEMA\gemaBundle\Entity\Postulaciones" , mappedBy="oferta", cascade={"persist"})
     */

    private $postulaciones;

    public function __toString()
    {
        return $this->getTitulo();
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set titulo
     *
     * @param string $titulo
     * @return OfertaLaboral
     */
    public function setTitulo($titulo)
    {
        $this->titulo = $titulo;

        return $this;
    }

    /**
     * Get titulo
     *
     * @return string
     */
    public function getTitulo()
    {
        return $this->titulo;
    }

    /**
     * Set activa
     *
     * @param boolean $activa
     * @return OfertaLaboral
     */
    public function setActiva($activa)
    {
        $this->activa = $activa;

        return $this;
    }

    /**
     * Get activa
     *
     * @return boolean
     */
    public function getActiva()
    {
        return $this->activa;
    }

    /**
     * Set area
     *
     * @param string $area
     * @return OfertaLaboral
     */
    public function setArea($area)
    {
        $this->area = $area;

        return $this;
    }

    /**
     * Get area
     *
     * @return string
     */
    public function getArea()
    {
        return $this->area;
    }

    /**
     * Set descripcion
     *
     * @param string $descripcion
     * @return OfertaLaboral
     */
    public function setDescripcion($descripcion)
    {
        $this->descripcion = $descripcion;

        return $this;
    }

    /**
     * Get descripcion
     *
     * @return string
     */
    public function getDescripcion()
    {
        return $this->descripcion;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->postulaciones = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Add postulaciones
     *
     * @param \GEMA\gemaBundle\Entity\Postulaciones $postulaciones
     * @return OfertaLaboral
     */
    public function addPostulacione(\GEMA\gemaBundle\Entity\Postulaciones $postulaciones)
    {
        $this->postulaciones[] = $postulaciones;

        return $this;
    }

    /**
     * Remove postulaciones
     *
     * @param \GEMA\gemaBundle\Entity\Postulaciones $postulaciones
     */
    public function removePostulacione(\GEMA\gemaBundle\Entity\Postulaciones $postulaciones)
    {
        $this->postulaciones->removeElement($postulaciones);
    }

    /**
     * Get postulaciones
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPostulaciones()
    {
        return $this->postulaciones;
    }
}


text:
namespace Vsts.Vault.TeamServices
{
    using System.Threading.Tasks;

    /// <summary>
    ///
    /// </summary>
    public interface ITeamServicesConsumer
    {
        /// <summary>
        /// Gets the asynchronous.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="url">The URL.</param>
        /// <returns></returns>
        Task<T> GetAsync<T>(string url);
    }
}


text:
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { ILogService } from 'vs/platform/log/common/log';
import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService';
import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensionService';
import { ExtHostLogService } from 'vs/workbench/api/worker/extHostLogService';

// #########################################################################
// ###                                                                   ###
// ### !!! PLEASE ADD COMMON IMPORTS INTO extHost.common.services.ts !!! ###
// ###                                                                   ###
// #########################################################################

registerSingleton(IExtHostExtensionService, ExtHostExtensionService);
registerSingleton(ILogService, ExtHostLogService);


text:
package io.fabric8.itests.paxexam.support;

import io.fabric8.api.FabricService;
import io.fabric8.api.ServiceProxy;
import io.fabric8.service.jclouds.CreateJCloudsContainerOptions;

public class JcloudsContainerBuilder extends ContainerBuilder<JcloudsContainerBuilder, CreateJCloudsContainerOptions.Builder> {

	protected JcloudsContainerBuilder(ServiceProxy<FabricService> proxy, CreateJCloudsContainerOptions.Builder optionsBuilder) {
		super(proxy, optionsBuilder);
	}
}


text:
package langheiter.textSize;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JScrollBar;

public class View {

	private Controller c;
	private MyFrame frame;
	private JPanel panel;
	private DrawPanel drawPanel;
	private JScrollBar scroll;

	public View(Controller c) {
		this.c = c;
		buildGui();
	}

	private void buildGui() {
		drawPanel = new DrawPanel();

		scroll = new JScrollBar(JScrollBar.HORIZONTAL, 35, 10, 10, 80 + 10); // 80 + 10 Because of extend
		scroll.addAdjustmentListener(c);

		panel = new JPanel();
		panel.setLayout(new BorderLayout());
		panel.add(drawPanel, BorderLayout.CENTER);
		panel.add(scroll, BorderLayout.SOUTH);

		frame = new MyFrame("Text-Size-Selector", panel);
		frame.defaultSize();
	}

	public void setFontSize(int size) {
		drawPanel.setTextSize(size);
		drawPanel.repaint();
	}

}


text:
terminal-webcam
===============

A webcam that can be run on a bare terminal.

setup
-----

Tested on Ubuntu 12.04

```python
sudo apt-get install python-opencv libncurses5-dev libncurses5 ncurses-term
```

usage
-----

```python
python capture.py

# For colored version which may be slower, needs optimizing
export TERM=xterm-256color && python color.py WIDTH_IN_CHARS
```

If you want to take an ascii screenshot, press 'p'

demo
----

http://showterm.io/1e036bb3ba91b8cf40335

output
------

![sample-output](https://raw.githubusercontent.com/mustafaakin/terminal-webcam/master/colorful.png)


text:
package sunmi.ui.flexible;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewConfiguration;
import android.widget.ScrollView;

/**
 * Created by longtao.li on 2016/12/7.
 */
public class FlexibleScrollView extends ScrollView implements Flexible{
    private static final String TAG = "FlexibleScrollView";

    /**
     * Sentinel value for no current active pointer.
     * Used by {@link #mActivePointerId}.
     */
    private static final int INVALID_POINTER = -1;

    private FlexibleEffect mFlexibleEffect;

    private int mLastMotionY;
    private int mActivePointerId = INVALID_POINTER;
    /**
     * True if the user is currently dragging this ScrollView around. This is
     * not the same as 'is being flinged', which can be checked by
     * mScroller.isFinished() (flinging begins when the user lifts his finger).
     */
    private boolean mIsBeingDragged = false;

    private int mTouchSlop;

    /**
     * Determines speed during touch scrolling
     */
    private VelocityTracker mVelocityTracker;
    private int mMaximumVelocity;
    private float currentVelocity;

    public FlexibleScrollView(Context context) {
        super(context);
        init();
    }

    public FlexibleScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public FlexibleScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public FlexibleScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        init();
    }

    private void init() {
        setOverScrollMode(OVER_SCROLL_NEVER);
        mFlexibleEffect = new FlexibleEffect(this);
        final ViewConfiguration configuration = ViewConfiguration.get(getContext());
        mTouchSlop = configuration.getScaledTouchSlop();
        mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {

        initVelocityTrackerIfNotExists();
        mVelocityTracker.addMovement(ev);

        final int action = ev.getAction();
        switch (action & MotionEvent.ACTION_MASK) {
            case MotionEvent.ACTION_DOWN:
                mIsBeingDragged = false;
                mLastMotionY = (int) ev.getY();
                mActivePointerId = ev.getPointerId(0);
                break;
            case MotionEvent.ACTION_MOVE:
                final int activePointerIndex = ev.findPointerIndex(mActivePointerId);
                if (activePointerIndex == -1) {
//                    Log.e(TAG, "Invalid pointerId=" + mActivePointerId + " in onTouchEvent");
                    break;
                }

                final int y = (int) ev.getY(activePointerIndex);
                int deltaY = mLastMotionY - y;

                if (!mIsBeingDragged && Math.abs(deltaY) > mTouchSlop) {
                    mIsBeingDragged = true;
                    if (deltaY > 0) {
                        deltaY -= mTouchSlop;
                    } else {
                        deltaY += mTouchSlop;
                    }
                }
                if (mIsBeingDragged) {
                    // Scroll to follow the motion event
                    mLastMotionY = y;
                    mFlexibleEffect.onPull((float) deltaY / getHeight());
                    if(!mFlexibleEffect.isFinished()){
                        return true;
                    }

                }

                break;
            case MotionEvent.ACTION_UP:
                if (mIsBeingDragged) {
                    mActivePointerId = INVALID_POINTER;
                    mIsBeingDragged = false;
                    if (mFlexibleEffect != null&&mFlexibleEffect.isPulling()) {
                        mFlexibleEffect.onAbsorb(-1);
                    }
                    final VelocityTracker velocityTracker = mVelocityTracker;
                    velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);
                    currentVelocity = mVelocityTracker.getYVelocity(mActivePointerId);
                    Log.d(TAG, "currentVelocity:"+mVelocityTracker.getYVelocity(mActivePointerId) );
                    recycleVelocityTracker();
                }
                break;
            case MotionEvent.ACTION_CANCEL:
                break;
        }

        return super.onTouchEvent(ev);
    }

    private void initVelocityTrackerIfNotExists() {
        if (mVelocityTracker == null) {
            mVelocityTracker = VelocityTracker.obtain();
        }
    }

    private void recycleVelocityTracker() {
        if (mVelocityTracker != null) {
            mVelocityTracker.recycle();
            mVelocityTracker = null;
        }
    }

    @Override
    public boolean isTop() {
        return getScrollY() == 0;
    }

    @Override
    public boolean isBottom() {
        View childView = getChildAt(0);
        boolean isBottom = false;
        if(childView != null){
            isBottom = childView.getMeasuredHeight() <= getScrollY() + getHeight();
        }
        return isBottom;
    }

    @Override
    public void setResistance(float resistance) {
        mFlexibleEffect.setResistance(resistance);
    }

    @Override
    public void setTopFlexible(boolean topFlexible) {
        mFlexibleEffect.setTopFlexible(topFlexible);
    }

    @Override
    protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
        super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);
        if(isBottom()||isTop()){
            mFlexibleEffect.onFling(currentVelocity);
            currentVelocity = 0;
        }

    }
}


text:
cask "axure-rp" do
  version "9.0.0.3719"
  sha256 "1284fb82679f154d639f2c05900b526e3270a3aacb58348cd27bb0b659cf503e"

  # axure.cachefly.net/ was verified as official when first introduced to the cask
  url "https://axure.cachefly.net/AxureRP-Setup.dmg"
  appcast "https://www.axure.com/release-history"
  name "Axure RP"
  desc "Planning and prototyping tool for developers"
  homepage "https://www.axure.com/"

  app "Axure RP #{version.major}.app"

  zap trash: [
    "~/Library/Preferences/com.axure.AxureRP#{version.major}.plist",
    "~/Library/Saved Application State/com.axure.AxureRP#{version.major}.savedState",
    "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.axure.axurerp#{version.major}.sfl*",
  ]
end


text:
NSString * const kZFRewardVideoMediatorTargetAppnext = @"Appnext";

NSString * const kZFRewardVideoMediatorActionSetAppnextDelegate = @"setDelegate";
NSString * const kZFRewardVideoMediatorActionStartAppnextWithPlacementId = @"startWithPlacementId";
NSString * const kZFRewardVideoMediatorActionPlayAppnext = @"showRV";

@implementation ZFRewardVideoMediator (Appnext)

- (void)ZFRewardVideoMediator_setAppnextDelegate:(id<ZFRewardVideoDelegate>)delegate {

    [self performTarget:kZFRewardVideoMediatorTargetAppnext
                 action:kZFRewardVideoMediatorActionSetAppnextDelegate
                 params:@{@"delegate" : delegate}
      shouldCacheTarget:NO];
}

- (void)ZFRewardVideoMediator_startAppnextWithPlacementId:(NSString *)placementId {

    [self performTarget:kZFRewardVideoMediatorTargetAppnext
                 action:kZFRewardVideoMediatorActionStartAppnextWithPlacementId
                 params:@{@"placementId" : placementId}
      shouldCacheTarget:NO];
}

- (void)ZFRewardVideoMediator_playAppnext {

    [self performTarget:kZFRewardVideoMediatorTargetAppnext
                 action:kZFRewardVideoMediatorActionPlayAppnext
                 params:@{@"options" : @{}}
      shouldCacheTarget:NO];
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>uk.nhs.careconnect.ccri</groupId>
    <artifactId>ccri-fhirserver</artifactId>
    <version>4.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>ccri-fhirserver</name>
    <description>Care Connect FHIR Server EPR</description>

    <parent>
        <groupId>uk.nhs.careconnect.ri</groupId>
        <artifactId>clinical-data-repository-sql</artifactId>
        <version>4.0.0-SNAPSHOT</version>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>11</java.version>
        <care-connect-version>4.0.0-SNAPSHOT</care-connect-version>

        <junit-version>4.12</junit-version>
        <cucumber-version>1.2.5</cucumber-version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Spring Boot BOM -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot-version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>bintray-kevinmayfield-careconnect</id>
            <name>kevinmayfield-careconnect</name>
            <url>https://dl.bintray.com/kevinmayfield/careconnect</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <!-- Spring OAuth2 Dependencies -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-jwt</artifactId>
            <version>${spring_security_version}</version>
        </dependency>

        <!-- JPA and Database -->

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.2.2</version>
        </dependency>

        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>7.2.2.jre8</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate_version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>${hibernate_version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate_version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate_validator_version}</version>
        </dependency>

        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-jpaserver-base</artifactId>
            <version>${hapi-fhir-version}</version>
        </dependency>

        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-converter</artifactId>
            <version>${hapi-fhir-version}</version>
        </dependency>

        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <version>5.2.4</version>
        </dependency>

        <!-- HAPI FHIR -->

        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-base</artifactId>
            <version>${hapi-fhir-version}</version>
        </dependency>

        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-server</artifactId>
            <version>${hapi-fhir-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-dstu3</artifactId>
            <version>${hapi-fhir-version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-r4</artifactId>
            <version>${hapi-fhir-version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
            <version>${hapi-fhir-version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-validation-resources-r4</artifactId>
            <version>${hapi-fhir-version}</version>
            <optional>true</optional>
        </dependency>

        <!-- Care Connect -->

        <dependency>
            <groupId>uk.org.hl7.fhir</groupId>
            <artifactId>cc-core</artifactId>
            <version>${care-connect-version}</version>
        </dependency>

        <dependency>
            <groupId>uk.nhs.careconnect.ri</groupId>
            <artifactId>ccri-dao-stu3</artifactId>
            <version>${care-connect-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>

            </exclusions>
        </dependency>

        <dependency>
            <groupId>uk.nhs.careconnect.ri</groupId>
            <artifactId>ccri-dao-r4</artifactId>
            <version>${care-connect-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>

            </exclusions>
        </dependency>
        <dependency>
            <groupId>uk.nhs.careconnect.ri</groupId>
            <artifactId>ccri-database</artifactId>
            <version>${care-connect-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Hawt.io -->

        <dependency>
            <groupId>io.hawt</groupId>
            <artifactId>hawtio-springboot</artifactId>
            <version>${hawtio.version}</version>
        </dependency>
        <dependency>
            <groupId>io.hawt</groupId>
            <artifactId>hawtio-core</artifactId>
            <version>${hawtio.version}</version>
        </dependency>

        <dependency>
            <groupId>io.hawt</groupId>
            <artifactId>hawtio-log</artifactId>
            <version>${hawtio.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>org.apache.logging.log4j</artifactId>
                    <groupId>log4j-slf4j-impl</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Testing -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>${cucumber-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>${cucumber-version}</version>
            <scope>test</scope>
        </dependency>

        <!-- flying saucer pdf -->
        <dependency>
            <groupId>org.xhtmlrenderer</groupId>
            <artifactId>flying-saucer-pdf</artifactId>
            <version>9.1.4</version>
        </dependency>

        <dependency>
            <groupId>org.fusesource.jansi</groupId>
            <artifactId>jansi</artifactId>
            <version>1.16</version>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>ccri-fhirserver</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
                <configuration>
                    <!--   <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine> -->
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


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

/*
{\"type\":35,\"time\":\"%s\",\"attacker\":\"%s\",\"target\":\"%s\",\"target_source\":\"%s\",\"value\":%d},"
    */
namespace HGV.Perserverance.MatchMessages
{
    public class KillStreak : GameMessage
    {
        public string attacker { get; set; }
        public string target { get; set; }
        public string targetSource { get; set; }
        public int value { get; set; }
    }
}


text:
require 'spec_helper'

describe RegistrantEventSignUp do
  let(:re) { FactoryGirl.create(:registrant_event_sign_up) }

  it "is valid from FactoryGirl" do
    expect(re.valid?).to eq(true)
  end
  it "requires an event_category" do
    re.event_category = nil
    expect(re.valid?).to eq(false)
  end

  it "requires a registrant" do
    re.registrant = nil
    expect(re.valid?).to eq(false)
  end

  describe "when an auto-competitor event exists" do
    before :each do
      @competition = FactoryGirl.create(:competition)
      @competition_source = FactoryGirl.create(:competition_source, target_competition: @competition, event_category: re.event_category)
    end

    it "doesn't add the competition on change of state if the competition isn't auto-creation" do
      re.signed_up = false
      expect(re.save).to be_truthy

      re.signed_up = true
      expect do
        expect(re.save).to be_truthy
      end.to change(Competitor, :count).by(0)
    end
  end

  describe "when a competitor already exists and I un-sign up" do
    before :each do
      @competition = FactoryGirl.create(:competition, num_members_per_competitor: "One")
      @competition_source = FactoryGirl.create(:competition_source, target_competition: @competition, event_category: re.event_category)
      @competitor = FactoryGirl.create(:event_competitor, competition: @competition)
      @member = @competitor.members.first
      @member.update_attributes(registrant: re.registrant)
      re.reload
    end

    it "marks the member as dropped when I un-sign up for the competition" do
      re.signed_up = false
      re.save
      expect(@member.reload).to be_dropped_from_registration
    end

    it "marks the competitor as withdrawn if this is the only member" do
      re.signed_up = false
      re.save
      expect(@competitor.reload.status).to eq("withdrawn")
    end

    describe "When the event has multiple categories" do
      before :each do
        @event = re.event_category.event
        @cat2 = FactoryGirl.create(:event_category, event: @event)
      end

      it "marks the member as dropped when I change the category I signed up for" do
        re.event_category = @cat2
        re.save
        expect(@member.reload).to be_dropped_from_registration
      end
    end
  end
end

describe "when a competition exists before a sign-up" do
  let(:event_category) { FactoryGirl.create(:event).event_categories.first }
  before :each do
    @competition = FactoryGirl.create(:competition, automatic_competitor_creation: true, num_members_per_competitor: "One")
    @competition_source = FactoryGirl.create(:competition_source, target_competition: @competition, event_category: event_category)
  end

  it "adds the competition on change of state" do
    @re = FactoryGirl.create(:registrant_event_sign_up, event_category: event_category, signed_up: false)
    expect do
      expect(@re.save).to be_truthy
    end.to change(Competitor, :count).by(0)

    @re.signed_up = true
    expect do
      expect(@re.save).to be_truthy
    end.to change(Competitor, :count).by(1)

    expect(Competitor.last.status).to eq("active")
  end

  describe "but the gender filter is in effect" do
    before :each do
      @competition_source.update_attribute(:gender_filter, "Female")
    end

    it "doesn't add the competitor on change of state" do
      @re = FactoryGirl.create(:registrant_event_sign_up, event_category: event_category, signed_up: false)
      expect(@re.registrant.gender).to eq("Male")

      @re.signed_up = true
      expect do
        expect(@re.save).to be_truthy
      end.to change(Competitor, :count).by(0)
    end
  end
end


text:
package net.sandius.rembulan.lib;

import net.sandius.rembulan.ByteString;
import net.sandius.rembulan.ByteStringBuilder;
import net.sandius.rembulan.Conversions;
import net.sandius.rembulan.LuaRuntimeException;
import net.sandius.rembulan.StateContext;
import net.sandius.rembulan.Table;
import net.sandius.rembulan.env.RuntimeEnvironment;
import net.sandius.rembulan.impl.UnimplementedFunction;
import net.sandius.rembulan.load.ChunkLoader;
import net.sandius.rembulan.load.LoaderException;
import net.sandius.rembulan.runtime.Dispatch;
import net.sandius.rembulan.runtime.ExecutionContext;
import net.sandius.rembulan.runtime.LuaFunction;
import net.sandius.rembulan.runtime.ResolvedControlThrowable;
import net.sandius.rembulan.runtime.UnresolvedControlThrowable;
import net.sandius.rembulan.util.ByteIterator;

import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;

/**
 * The package library provides basic facilities for loading modules in Lua. It exports
 * one function directly in the global environment: {@code require}.
 * Everything else is exported in a {@code table} package.
 */
public final class ModuleLib {

	static final byte PATH_SEPARATOR = (byte) ';';
	static final byte PATH_TEMPLATE_PLACEHOLDER = (byte) '?';
	static final byte WIN_DIRECTORY_PLACEHOLDER = (byte) '!';  // FIXME: not used in Rembulan
	static final byte LUAOPEN_IGNORE = (byte) '-';  // FIXME: not used in Rembulan!

	/**
	 * Returns a function {@code package.searchpath} that uses {@code fileSystem}.
	 *
	 *
The following is the corresponding entry from the Lua Reference Manual:

	 *
	 *

	 * {@code package.searchpath (name, path [, sep [, rep]])}
	 *
	 *
Searches for the given name in the given path.

	 *
	 *
A path is a string containing a sequence of templates separated by semicolons.
	 * For each template, the function replaces each interrogation mark (if any) in the template
	 * with a copy of name wherein all occurrences of {@code sep} (a dot, by default) were
	 * replaced by {@code rep} (the system's directory separator, by default), and then tries
	 * to open the resulting file name.

	 *
	 *
For instance, if the path is the string

	 *

	 *   "./?.lua;./?.lc;/usr/local/?/init.lua"
	 *

	 *
the search for the name {@code foo.a} will try to open the files {@code ./foo/a.lua},
	 * {@code ./foo/a.lc}, and {@code /usr/local/foo/a/init.lua}, in that order.

	 *
	 *
Returns the resulting name of the first file that it can open in read mode (after closing
	 * the file), or nil plus an error message if none succeeds. (This error message
	 * lists all file names it tried to open.)

	 *

	 *
	 * @param fileSystem  the filesystem, must not be {@code null}
	 * @return  the function {@code package.searchpath}
	 *
	 * @throws NullPointerException  if {@code fileSystem} is {@code null}
	 *
	 * @see
	 *     the Lua 5.3 Reference Manual entry for coroutine.yield
	 */
	public static LuaFunction searchpath(FileSystem fileSystem) {
		return new SearchPath(fileSystem);
	}

	// TODO: publish require

	private ModuleLib() {
		// not to be instantiated
	}

	/**
	 * Installs the package library to the global environment {@code env} in the state
	 * context {@code context}. The package functions will use the runtime environment
	 * {@code runtimeEnvironment}, and load modules using {@code chunkLoader} (for Lua
	 * scripts), and {@code classLoader} (for Java libraries).
	 *
	 *
The nullity of {@code runtimeEnvironment}, {@code runtimeEnvironment.fileSystem()},
	 * {@code chunkLoader} and {@code classLoader} determines the configuration in which
	 * the package library will be installed:

	 *

	 *
if {@code runtimeEnvironment == null || runtimeEnvironment.fileSystem() == null},
	 *     then no {@code package.config}, {@code package.path} and {@code package.searchpath}
	 *     will be provided, and the searchers will not include any searchers or loaders
	 *     that require access to a filesystem;

	 *
if {@code chunkLoader == null}, then no searchers and loaders that load
	 *     Lua chunks will be installed;

	 *
if {@code classLoader == null}, then no searchers and loaders that load
	 *     Java modules by examining the classpath of the virtual machine will be installed.

	 *

	 *
	 *
For instance, if {@code runtimeEnvironment}, {@code chunkLoader}
	 * and {@code classLoader} are all {@code null}, then the only way for a module to be
	 * installed using the {@code require} function will be by adding a loader to
	 * {@code package.preload}.

	 *
	 *
Installs {@code env} and the module library table to {@code env.package.loaded}
	 * with the keys {@code "_G"} and {@code "package"}, respectively.

	 *
	 * @param context  the state context, must not be {@code null}
	 * @param env  the global environment, must not be {@code null}
	 * @param runtimeEnvironment  the runtime environment, may be {@code null}
	 * @param chunkLoader  the chunk loader, may be {@code null}
	 * @param classLoader  the class loader for Java modules, may be {@code null}
	 *
	 * @throws NullPointerException  if {@code context} or {@code env} is {@code null}
	 */
	public static void installInto(StateContext context, Table env, RuntimeEnvironment runtimeEnvironment, ChunkLoader chunkLoader, ClassLoader classLoader) {
		Objects.requireNonNull(context);
		Objects.requireNonNull(env);

		FileSystem fileSystem = runtimeEnvironment != null ? runtimeEnvironment.fileSystem() : null;

		Table t = context.newTable();

		final ByteString config;
		Table loaded = context.newTable();
		Table preload = context.newTable();
		final ByteString path;
		Table searchers = context.newTable();
		LuaFunction require = new Require(t, loaded);

		// package.config
		{
			if (fileSystem != null) {
				ByteStringBuilder builder = new ByteStringBuilder();

				builder.append(fileSystem.getSeparator()).append((byte) '\n');
				builder.append(PATH_SEPARATOR).append((byte) '\n');
				builder.append(PATH_TEMPLATE_PLACEHOLDER).append((byte) '\n');
				builder.append(WIN_DIRECTORY_PLACEHOLDER).append((byte) '\n');
				builder.append(LUAOPEN_IGNORE).append((byte) '\n');

				config = builder.toByteString();
			}
			else {
				config = null;
			}
		}

		// package.loaded
		{
			loaded.rawset("_G", env);
			loaded.rawset("package", t);
		}

		// package.path
		{
			if (runtimeEnvironment != null) {
				String envPath = runtimeEnvironment.getEnv("LUA_PATH_5_3");
				if (envPath == null) {
					envPath = runtimeEnvironment.getEnv("LUA_PATH");
				}

				path = getPath(envPath, defaultPath(runtimeEnvironment.fileSystem()));
			}
			else {
				path = null;
			}
		}

		// package.searchers
		{
			addSearcher(searchers, new PreloadSearcher(preload));
			if (chunkLoader != null) {
				addSearcher(searchers, new ChunkLoadPathSearcher(fileSystem, t, chunkLoader, env));
			}
			if (classLoader != null) {
				addSearcher(searchers, new LoaderProviderServiceLoaderSearcher(runtimeEnvironment, env, classLoader));
			}
		}

		t.rawset("config", config);
		t.rawset("loaded", loaded);
		t.rawset("loadlib", new UnimplementedFunction("package.loadlib"));
		t.rawset("preload", preload);
		t.rawset("searchers", searchers);
		if (fileSystem != null) t.rawset("searchpath", searchpath(fileSystem));
		t.rawset("path", path);

		// install into the global environment
		env.rawset("package", t);
		env.rawset("require", require);
	}

	static void addSearcher(Table searchers, LuaFunction fn) {
		searchers.rawset(searchers.rawlen() + 1, fn);
	}

	static void addToLoaded(Table env, String modName, Object value) {
		Object pkg = env.rawget("package");
		if (pkg instanceof Table) {
			Object loaded = ((Table) pkg).rawget("loaded");
			if (loaded instanceof Table) {
				((Table) loaded).rawset(modName, value);
			}
		}
	}

	static void addToPreLoad(Table env, String modName, LuaFunction loader) {
		Object pkg = env.rawget("package");
		if (pkg instanceof Table) {
			Object preload = ((Table) pkg).rawget("preload");
			if (preload instanceof Table) {
				((Table) preload).rawset(modName, loader);
			}
		}
	}

	static void install(Table env, String modName, Object value) {
		env.rawset(modName, value);
		addToLoaded(env, modName, value);
	}

	static Table searchers(Table libTable) {
		Object o = libTable.rawget("searchers");
		return o instanceof Table ? (Table) o : null;
	}

	static ByteString defaultPath(FileSystem fileSystem) {
		// TODO: make this depend on the platform
		return ByteString.of("/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua");
	}

	static ByteString getPath(String envPath, ByteString defaultPath) {
		if (envPath != null) {
			return ByteString.of(envPath).replace(ByteString.of(";;"), defaultPath);
		}
		else {
			return defaultPath;
		}
	}

	static class Require extends AbstractLibFunction {

		private final Table libTable;
		private final Table loaded;

		private static class Require_SuspendedState {

			private final int state;
			private final ByteString error;
			private final ByteString modName;
			private final Table searchers;
			private final long idx;

			private Require_SuspendedState(int state, ByteString error, ByteString modName, Table searchers, long idx) {
				this.state = state;
				this.error = error;
				this.modName = modName;
				this.searchers = searchers;
				this.idx = idx;
			}

		}

		public Require(Table libTable, Table loaded) {
			this.libTable = Objects.requireNonNull(libTable);
			this.loaded = Objects.requireNonNull(loaded);
		}

		@Override
		protected String name() {
			return "require";
		}

		@Override
		protected void invoke(ExecutionContext context, ArgumentIterator args) throws ResolvedControlThrowable {
			ByteString modName = args.nextString();

			Object mod = loaded.rawget(modName);

			if (mod != null) {
				// already loaded
				context.getReturnBuffer().setTo(mod);
			}
			else {
				// get package.searchers
				Table searchers = searchers(libTable);
				if (searchers == null) {
					throw new IllegalStateException("'package.searchers' must be a table");
				}
				search(context, 0, ByteString.empty(), modName, searchers, 1);
			}
		}

		private void search(ExecutionContext context, int state, ByteString error, ByteString modName, Table searchers, long idx)
				throws ResolvedControlThrowable {

			final LuaFunction loader;
			final Object origin;

			loop:
			while (true) {
				try {
					switch (state) {
						case 0:
							Object o = searchers.rawget(idx++);
							if (o == null) {
								// reached the end of the list
								throw new LuaRuntimeException("module '" + modName + "' not found:" + error);
							}
							state = 1;
							Dispatch.call(context, o, modName);

						case 1:
							Object result = context.getReturnBuffer().get0();
							if (result instanceof LuaFunction) {
								// found it
								loader = (LuaFunction) result;
								origin = context.getReturnBuffer().get1();

								break loop;
							}
							else {
								// not a loader

								// append error string
								ByteString s = Conversions.stringValueOf(result);
								if (s != null) {
									error = error.concat(s);
								}

								state = 0;  // continue with the next iteration
								break;
							}

						default:
							throw new IllegalStateException("Invalid state: " + state);
					}
				}
				catch (UnresolvedControlThrowable ct) {
					throw ct.resolve(this, new Require_SuspendedState(state, error, modName, searchers, idx));
				}
			}

			load(context, modName, loader, origin);
		}

		private void load(ExecutionContext context, ByteString modName, LuaFunction loader, Object origin)
				throws ResolvedControlThrowable {

			try {
				Dispatch.call(context, loader, modName, origin);
			}
			catch (UnresolvedControlThrowable ct) {
				throw ct.resolve(this, modName);
			}

			resumeLoad(context, modName);
		}

		private void resumeLoad(ExecutionContext context, ByteString modName) {
			Object loadResult = context.getReturnBuffer().get0();
			Object requireResult = loadResult != null ? loadResult : true;

			loaded.rawset(modName, requireResult);
			context.getReturnBuffer().setTo(requireResult);
		}

		@Override
		public void resume(ExecutionContext context, Object suspendedState) throws ResolvedControlThrowable {
			if (suspendedState instanceof Require_SuspendedState) {
				Require_SuspendedState ss = (Require_SuspendedState) suspendedState;
				search(context, ss.state, ss.error, ss.modName, ss.searchers, ss.idx);
			}
			else {
				resumeLoad(context, (ByteString) suspendedState);
			}
		}

	}

	static class PreloadSearcher extends AbstractLibFunction {

		private final Table preload;

		PreloadSearcher(Table preload) {
			this.preload = Objects.requireNonNull(preload);
		}

		@Override
		protected String name() {
			return "(preload searcher)";
		}

		@Override
		protected void invoke(ExecutionContext context, ArgumentIterator args) throws ResolvedControlThrowable {
			ByteString modName = args.nextString();

			Object entry = preload.rawget(modName);

			if (entry != null) {
				context.getReturnBuffer().setTo(entry);
			}
			else {
				String error = "\n\tno field package.preload['" + modName + "']";
				context.getReturnBuffer().setTo(error);
			}
		}

	}

	static class ChunkLoadPathSearcher extends AbstractLibFunction {

		private final Table libTable;
		private final FileSystem fileSystem;
		private final ChunkLoader loader;
		private final Object env;

		ChunkLoadPathSearcher(FileSystem fileSystem, Table libTable, ChunkLoader loader, Object env) {
			this.fileSystem = Objects.requireNonNull(fileSystem);
			this.libTable = Objects.requireNonNull(libTable);
			this.loader = Objects.requireNonNull(loader);
			this.env = env;
		}

		@Override
		protected String name() {
			return "(path searcher)";
		}

		private LuaFunction loaderForPath(ByteString path) throws LoaderException {
			return BasicLib.loadTextChunkFromFile(fileSystem, loader, path.toString(), BasicLib.Load.DEFAULT_MODE, env);
		}

		@Override
		protected void invoke(ExecutionContext context, ArgumentIterator args) throws ResolvedControlThrowable {
			ByteString modName = args.nextString();

			// FIXME: it might be easier and more modular to just call package.searchpath and loadfile

			ByteString path = Conversions.stringValueOf(libTable.rawget("path"));
			if (path == null) {
				throw new IllegalStateException("'package.path' must be a string");
			}

			List<ByteString> paths = SearchPath.getPaths(modName, path, SearchPath.DEFAULT_SEP, ByteString.of(fileSystem.getSeparator()));

			ByteStringBuilder msgBuilder = new ByteStringBuilder();
			for (ByteString s : paths) {
				Path p = fileSystem.getPath(s.toString());
				if (Files.isReadable(p)) {
					final LuaFunction fn;
					try {
						fn = loaderForPath(s);
					}
					catch (LoaderException ex) {
						throw new LuaRuntimeException("error loading module '" + modName + "' from file '" + s + "'"
								+ "\n\t" + ex.getLuaStyleErrorMessage());
					}

					context.getReturnBuffer().setTo(fn, s);
					return;
				}
				else {
					msgBuilder.append("\n\tno file '").append(s).append((byte) '\'');
				}
			}

			context.getReturnBuffer().setTo(msgBuilder.toByteString());
		}

	}

	/**
	 * An abstract searcher function that uses a {@link ServiceLoader} to discover
	 * loader services.
	 *
	 * @param <T>  the type of the loader service
	 */
	static abstract class AbstractServiceLoaderSearcher<T> extends AbstractLibFunction {

		private final Class<T> serviceClass;
		private final ServiceLoader<T> serviceLoader;

		protected AbstractServiceLoaderSearcher(Class<T> serviceClass, ClassLoader classLoader) {
			this.serviceClass = Objects.requireNonNull(serviceClass);
			this.serviceLoader = ServiceLoader.load(serviceClass, classLoader);
		}

		@Override
		protected String name() {
			return "(" + serviceClass.getName() + " ServiceLoader searcher)";
		}

		private LuaFunction findLoader(String modName) {
			try {
				for (T service : serviceLoader) {
					if (matches(modName, service)) {
						LuaFunction loader = getLoader(service);
						if (loader != null) {
							return loader;
						}
					}
				}
			}
			catch (ServiceConfigurationError error) {
				// TODO: maybe we should just let the VM crash?
				throw new LuaRuntimeException(error);
			}

			// not found
			return null;
		}

		/**
		 * Returns {@code} true if the given service {@code service} provides a module with
		 * the name {@code moduleName}.
		 *
		 * @param moduleName  module name
		 * @param service  a service to be examined
		 *
		 * @return  {@code true} if the {@code service} provides a module with the name
		 *          {@code moduleName}
		 */
		protected abstract boolean matches(String moduleName, T service);

		/**
		 * Returns the loader provided by a given service.
		 *
		 *
May return {@code null} to indicate that {@code service} does not provide
		 * a loader.

		 *
		 * @param service  the service to get the loader from
		 * @return  the loader function
		 */
		protected abstract LuaFunction getLoader(T service);

		@Override
		protected void invoke(ExecutionContext context, ArgumentIterator args) throws ResolvedControlThrowable {
			ByteString modName = args.nextString();

			LuaFunction loader = findLoader(modName.toString());

			if (loader != null) {
				context.getReturnBuffer().setTo(loader);
			}
			else {
				String error = "\n\tno " + serviceClass.getName() + " for '" + modName + "'";
				context.getReturnBuffer().setTo(error);
			}

		}

	}

	static class LoaderProviderServiceLoaderSearcher extends AbstractServiceLoaderSearcher<LoaderProvider> {

		private final RuntimeEnvironment runtimeEnvironment;
		private final Table env;

		public LoaderProviderServiceLoaderSearcher(RuntimeEnvironment runtimeEnvironment, Table env, ClassLoader classLoader) {
			super(LoaderProvider.class, classLoader);
			this.runtimeEnvironment = Objects.requireNonNull(runtimeEnvironment);
			this.env = Objects.requireNonNull(env);
		}

		@Override
		protected boolean matches(String modName, LoaderProvider service) {
			return service.name().equals(modName);
		}

		@Override
		protected LuaFunction getLoader(LoaderProvider service) {
			return service.newLoader(runtimeEnvironment, env);
		}

	}

	static class SearchPath extends AbstractLibFunction {

		private static final ByteString DEFAULT_SEP = ByteString.constOf(".");

		private final FileSystem fileSystem;
		private final ByteString defaultDirSeparator;

		SearchPath(FileSystem fileSystem) {
			this.fileSystem = Objects.requireNonNull(fileSystem);
			defaultDirSeparator = ByteString.of(fileSystem.getSeparator());
		}

		@Override
		protected String name() {
			return "searchpath";
		}

		static List<ByteString> getPaths(ByteString name, ByteString path, ByteString sep, ByteString rep) {
			List<ByteString> result = new ArrayList<>();

			name = name.replace(sep, rep);

			ByteStringBuilder builder = new ByteStringBuilder();
			ByteIterator it = path.byteIterator();
			while (it.hasNext()) {
				byte b = it.nextByte();
				switch (b) {
					case PATH_TEMPLATE_PLACEHOLDER:
						builder.append(name);
						break;
					case PATH_SEPARATOR:
						result.add(builder.toByteString());
						builder.setLength(0);
						break;
					default:
						builder.append(b);
						break;
				}
			}

			if (builder.length() > 0) {
				result.add(builder.toByteString());
			}

			return result;
		}

		@Override
		protected void invoke(ExecutionContext context, ArgumentIterator args) throws ResolvedControlThrowable {
			ByteString name = args.nextString();
			ByteString path = args.nextString();
			ByteString sep = args.nextOptionalString(DEFAULT_SEP);
			ByteString rep = args.nextOptionalString(defaultDirSeparator);

			ByteStringBuilder msgBuilder = new ByteStringBuilder();

			for (ByteString s : getPaths(name, path, sep, rep)) {
				Path p = fileSystem.getPath(s.toString());
				if (Files.isReadable(p)) {
					context.getReturnBuffer().setTo(s);
					return;
				}
				else {
					msgBuilder.append("\n\tno file '").append(s).append((byte) '\'');
				}
			}

			// no readable file found
			context.getReturnBuffer().setTo(null, msgBuilder.toString());
		}

	}

}


text:
<?php

/**
 * @access private
 * @package Helpers
 * @category Concrete
 * @author Andrew Embler <andrew@concrete5.org>
 * @copyright  Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)
 * @license    http://www.concrete5.org/license/     MIT License
 */

defined('C5_EXECUTE') or die("Access Denied.");
class ConcreteUpgradeVersion500b2Helper {

	public function notes() {
		$arr = array();
		return $arr;
	}

	public function run() {
		Loader::model("job");
		Loader::model('single_page');
		Job::installByHandle('generate_sitemap');
		$d1 = SinglePage::add('/download_file');
		if (is_object($d1)) {
			$d1->update(array('cName'=>'Download File'));
		}
		$d2 = SinglePage::add('/dashboard/logs');
		if (is_object($d2)) {
			$d2->update(array('cName'=>'Logging', 'cDescription' => 'Keep tabs on your site.'));
		}

	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace FriendFeedSharp
{
    internal static class Util
    {
        public static XmlElement ChildElement(XmlElement element, string name)
        {
            XmlNodeList list = element.GetElementsByTagName(name);
            foreach (XmlElement child in list)
            {
                if (child.ParentNode == element)
                {
                    return child;
                }
            }
            return null;
        }

        public static string ChildValue(XmlElement element, string name)
        {
            XmlElement child = ChildElement(element, name);
            return (child == null) ? null : child.InnerText;
        }
    }
}


text:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity"
    >

  <!-- content-->
  <android.support.design.widget.CoordinatorLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      >

    <!-- app bar-->
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        >

      <!-- toolbar-->
      <android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?actionBarSize"
          android:background="@color/bbm_material_primaryColor"
          app:layout_scrollFlags="scroll|enterAlways"
          app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
          app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
          />

      <!-- tab layout-->
      <android.support.design.widget.TabLayout
          android:id="@+id/tabLayout"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          />

    </android.support.design.widget.AppBarLayout>
    <!--end appbar-->

    <RelativeLayout
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >
      <!-- viewpager-->
      <android.support.v4.view.ViewPager
          android:id="@+id/viewPager"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          />

      <!--<android.support.design.widget.FloatingActionButton-->
      <!--android:layout_width="wrap_content"-->
      <!--android:id="@+id/btnFab"-->
      <!--android:layout_alignParentRight="true"-->
      <!--android:layout_alignParentBottom="true"-->
      <!--app:borderWidth="0dp"-->
      <!--app:elevation="2dp"-->
      <!--android:src="@drawable/ic_add_white_36dp"-->
      <!--android:layout_marginRight="10dp"-->
      <!--android:layout_marginBottom="10dp"-->
      <!--app:fabSize="normal"-->
      <!--android:layout_height="wrap_content"/>-->

    </RelativeLayout>

  </android.support.design.widget.CoordinatorLayout>

  <!-- nav drawer-->
  <android.support.design.widget.NavigationView
      android:id="@+id/navigationView"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_gravity="start"
      android:fitsSystemWindows="true"
      app:menu="@menu/menu_nav_drawer"
      />

</android.support.v4.widget.DrawerLayout>


text:
package com.github.sviengine.unittest;

import android.content.res.Configuration;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class ScreenRotationTestActivity extends UnitTestBaseActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
	}

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		// TODO Auto-generated method stub
		super.onConfigurationChanged(newConfig);
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}

	@Override
	public boolean createWindow() {
		// TODO Auto-generated method stub
		mWindow = new ScreenRotationTestWindow(this);

		if( mWindow == null )
			return false;

		return true;
	}

	@Override
	public boolean onCreateOptionsMenu (Menu menu) {
		menu.add("Change Mode");
		return true;
	}

	@Override
	public boolean onOptionsItemSelected (MenuItem item) {
		mWindow.onOptionsItemSelected(item);
		return true;
	}
}