text:
# Routing

- [Basic Routing](#basic-routing)
- [Route Parameters](#route-parameters)
    - [Required Parameters](#required-parameters)
    - [Optional Parameters](#parameters-optional-parameters)
- [Named Routes](#named-routes)
- [Route Groups](#route-groups)
    - [Middleware](#route-group-middleware)
    - [Namespaces](#route-group-namespaces)
    - [Sub-Domain Routing](#route-group-sub-domain-routing)
    - [Route Prefixes](#route-group-prefixes)
- [Route Model Binding](#route-model-binding)
    - [Implicit Binding](#implicit-binding)
    - [Explicit Binding](#explicit-binding)
- [Form Method Spoofing](#form-method-spoofing)
- [Accessing The Current Route](#accessing-the-current-route)

## Basic Routing

The most basic Laravel routes simply accept a URI and a `Closure`, providing a very simple and expressive method of defining routes:

    Route::get('foo', function () {
        return 'Hello World';
    });

#### The Default Route Files

All Laravel routes are defined in your route files, which are located in the `routes` directory. These files are automatically loaded by the framework. The `routes/web.php` file defines routes that are for your web interface. These routes are assigned the `web` middleware group, which provides features like session state and CSRF protection. The routes in `routes/api.php` are stateless and are assigned the `api` middleware group.

For most applications, you will begin by defining routes in your `routes/web.php` file.

#### Available Router Methods

The router allows you to register routes that respond to any HTTP verb:

    Route::get($uri, $callback);
    Route::post($uri, $callback);
    Route::put($uri, $callback);
    Route::patch($uri, $callback);
    Route::delete($uri, $callback);
    Route::options($uri, $callback);

Sometimes you may need to register a route that responds to multiple HTTP verbs. You may do so using the `match` method. Or, you may even register a route that responds to all HTTP verbs using the `any` method:

    Route::match(['get', 'post'], '/', function () {
        //
    });

    Route::any('foo', function () {
        //
    });

#### CSRF Protection

Any HTML forms pointing to `POST`, `PUT`, or `DELETE` routes that are defined in the `web` routes file should include a CSRF token field. Otherwise, the request will be rejected. You can read more about CSRF protection in the [CSRF documentation](/docs/{{version}}/csrf):

    <form method="POST" action="/profile">
        {{ csrf_field() }}
        ...
    </form>

## Route Parameters

### Required Parameters

Of course, sometimes you will need to capture segments of the URI within your route. For example, you may need to capture a user's ID from the URL. You may do so by defining route parameters:

    Route::get('user/{id}', function ($id) {
        return 'User '.$id;
    });

You may define as many route parameters as required by your route:

    Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) {
        //
    });

Route parameters are always encased within `{}` braces and should consist of alphabetic characters. Route parameters may not contain a `-` character. Use an underscore (`_`) instead.

### Optional Parameters

Occasionally you may need to specify a route parameter, but make the presence of that route parameter optional. You may do so by placing a `?` mark after the parameter name. Make sure to give the route's corresponding variable a default value:

    Route::get('user/{name?}', function ($name = null) {
        return $name;
    });

    Route::get('user/{name?}', function ($name = 'John') {
        return $name;
    });

## Named Routes

Named routes allow the convenient generation of URLs or redirects for specific routes. You may specify a name for a route by chaining the `name` method onto the route definition:

    Route::get('user/profile', function () {
        //
    })->name('profile');

You may also specify route names for controller actions:

    Route::get('user/profile', 'UserController@showProfile')->name('profile');

#### Generating URLs To Named Routes

Once you have assigned a name to a given route, you may use the route's name when generating URLs or redirects via the global `route` function:

    // Generating URLs...
    $url = route('profile');

    // Generating Redirects...
    return redirect()->route('profile');

If the named route defines parameters, you may pass the parameters as the second argument to the `route` function. The given parameters will automatically be inserted into the URL in their correct positions:

    Route::get('user/{id}/profile', function ($id) {
        //
    })->name('profile');

    $url = route('profile', ['id' => 1]);

## Route Groups

Route groups allow you to share route attributes, such as middleware or namespaces, across a large number of routes without needing to define those attributes on each individual route. Shared attributes are specified in an array format as the first parameter to the `Route::group` method.

### Middleware

To assign middleware to all routes within a group, you may use the `middleware` key in the group attribute array. Middleware are executed in the order they are listed in the array:

    Route::group(['middleware' => 'auth'], function () {
        Route::get('/', function ()    {
            // Uses Auth Middleware
        });

        Route::get('user/profile', function () {
            // Uses Auth Middleware
        });
    });

### Namespaces

Another common use-case for route groups is assigning the same PHP namespace to a group of controllers using the `namespace` parameter in the group array:

    Route::group(['namespace' => 'Admin'], function() {
        // Controllers Within The "App\Http\Controllers\Admin" Namespace
    });

Remember, by default, the `RouteServiceProvider` includes your route files within a namespace group, allowing you to register controller routes without specifying the full `App\Http\Controllers` namespace prefix. So, you only need to specify the portion of the namespace that comes after the base `App\Http\Controllers` namespace.

### Sub-Domain Routing

Route groups may also be used to handle sub-domain routing. Sub-domains may be assigned route parameters just like route URIs, allowing you to capture a portion of the sub-domain for usage in your route or controller. The sub-domain may be specified using the `domain` key on the group attribute array:

    Route::group(['domain' => '{account}.myapp.com'], function () {
        Route::get('user/{id}', function ($account, $id) {
            //
        });
    });

### Route Prefixes

The `prefix` group attribute may be used to prefix each route in the group with a given URI. For example, you may want to prefix all route URIs within the group with `admin`:

    Route::group(['prefix' => 'admin'], function () {
        Route::get('users', function ()    {
            // Matches The "/admin/users" URL
        });
    });

## Route Model Binding

When injecting a model ID to a route or controller action, you will often query to retrieve the model that corresponds to that ID. Laravel route model binding provides a convenient way to automatically inject the model instances directly into your routes. For example, instead of injecting a user's ID, you can inject the entire `User` model instance that matches the given ID.

### Implicit Binding

Laravel automatically resolves Eloquent models defined in routes or controller actions whose variable names match a route segment name. For example:

    Route::get('api/users/{user}', function (App\User $user) {
        return $user->email;
    });

In this example, since the Eloquent `$user` variable defined on the route matches the `{user}` segment in the route's URI, Laravel will automatically inject the model instance that has an ID matching the corresponding value from the request URI. If a matching model instance is not found in the database, a 404 HTTP response will automatically be generated.

#### Customizing The Key Name

If you would like model binding to use a database column other than `id` when retrieving a given model class, you may override the `getRouteKeyName` method on the Eloquent model:

    /**
     * Get the route key for the model.
     *
     * @return string
     */
    public function getRouteKeyName()
    {
        return 'slug';
    }

### Explicit Binding

To register an explicit binding, use the router's `model` method to specify the class for a given parameter. You should define your explicit model bindings in the `boot` method of the `RouteServiceProvider` class:

    public function boot()
    {
        parent::boot();

        Route::model('user', App\User::class);
    }

Next, define a route that contains a `{user}` parameter:

    $router->get('profile/{user}', function(App\User $user) {
        //
    });

Since we have bound all `{user}` parameters to the `App\User` model, a `User` instance will be injected into the route. So, for example, a request to `profile/1` will inject the `User` instance from the database which has an ID of `1`.

If a matching model instance is not found in the database, a 404 HTTP response will be automatically generated.

#### Customizing The Resolution Logic

If you wish to use your own resolution logic, you may use the `Route::bind` method. The `Closure` you pass to the `bind` method will receive the value of the URI segment and should return the instance of the class that should be injected into the route:

    $router->bind('user', function ($value) {
        return App\User::where('name', $value)->first();
    });

## Form Method Spoofing

HTML forms do not support `PUT`, `PATCH` or `DELETE` actions. So, when defining `PUT`, `PATCH` or `DELETE` routes that are called from an HTML form, you will need to add a hidden `_method` field to the form. The value sent with the `_method` field will be used as the HTTP request method:

    <form action="/foo/bar" method="POST">
        <input type="hidden" name="_method" value="PUT">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
    </form>

You may use the `method_field` helper to generate the `_method` input:

    {{ method_field('PUT') }}

## Accessing The Current Route

You may use the `current`, `currentRouteName`, and `currentRouteAction` methods on the `Route` facade to access information about the route handling the incoming request:

    $route = Route::current();

    $name = Route::currentRouteName();

    $action = Route::currentRouteAction();

Refer to the API documentation for both the [underlying class of the Route facade](http://laravel.com/api/{{version}}/Illuminate/Routing/Router.html) and [Route instance](http://laravel.com/api/{{version}}/Illuminate/Routing/Route.html) to review all accessible methods.


text:
import sys
import ctypes

from .wintypes import *

#===============================================================================
# Globals/Aliases
#===============================================================================
PPYTHON = PVOID
PPYTRACEFUNC = PVOID
PUSERDATA = PVOID

#===============================================================================
# Classes
#===============================================================================
class TRACE_STORE_METADATA(Structure):
    _fields_ = [
        ('NumberOfRecords', ULARGE_INTEGER),
        ('RecordSize', LARGE_INTEGER),
    ]

PTRACE_STORE_METADATA = POINTER(TRACE_STORE_METADATA)

class _TRACE_STORE_METADATA(Union):
    _fields_ = [
        ('Metadata', TRACE_STORE_METADATA),
        ('pMetadata', PTRACE_STORE_METADATA),
    ]

class TRACE_STORE_MEMORY_MAP(Structure):
    _fields_ = [
        ('SlimReadWriteLock',   SRWLOCK),
        ('MappingHandle',       HANDLE),
        ('MappingSize',         LARGE_INTEGER),
        ('BaseAddress',         PVOID),
        ('ExtendAtAddress',     PVOID),
        ('EndAddress',          PVOID),
        ('PrevAddress',         PVOID),
        ('NextAddress',         PVOID),
    ]
PTRACE_STORE_MEMORY_MAP = POINTER(TRACE_STORE_MEMORY_MAP)

class TRACE_STORE(Structure):
    _fields_ = [
        ('TraceStores', PVOID),
        ('FileHandle', HANDLE),
        ('InitialSize', LARGE_INTEGER),
        ('ExtensionSize', LARGE_INTEGER),
        ('FileInfo', FILE_STANDARD_INFO),
        ('CriticalSection', PCRITICAL_SECTION),
        ('DroppedRecords', ULONG),
        ('MemoryMap', TRACE_STORE_MEMORY_MAP),
        ('NextMemoryMap', TRACE_STORE_MEMORY_MAP),
        ('MetadataStore', PVOID),
        ('AllocateRecords', PVOID),
        ('', _TRACE_STORE_METADATA),
    ]
PTRACE_STORE = POINTER(TRACE_STORE)

class TRACE_STORES(Structure):
    _fields_ = [
        ('Size',                USHORT),
        ('NumberOfTraceStores', USHORT),
        ('Reserved',            ULONG),
        ('Events',              TRACE_STORE),
        ('Frames',              TRACE_STORE),
        ('Modules',             TRACE_STORE),
        ('Functions',           TRACE_STORE),
        ('Exceptions',          TRACE_STORE),
        ('Lines',               TRACE_STORE),
        ('EventsMetadata',      TRACE_STORE),
        ('FramesMetadata',      TRACE_STORE),
        ('ModulesMetadata',     TRACE_STORE),
        ('FunctionsMetadata',   TRACE_STORE),
        ('ExceptionsMetadata',  TRACE_STORE),
        ('LinesMetadata',       TRACE_STORE),
    ]
PTRACE_STORES = POINTER(TRACE_STORES)

class TRACE_SESSION(Structure):
    _fields_ = [
        ('Size',            DWORD),
        ('SessionId',       LARGE_INTEGER),
        ('MachineGuid',     GUID),
        ('Sid',             PVOID),
        ('UserName',        PCWSTR),
        ('ComputerName',    PCWSTR),
        ('DomainName',      PCWSTR),
        ('SystemTime',      FILETIME),
    ]
PTRACE_SESSION = POINTER(TRACE_SESSION)

class TRACE_CONTEXT(Structure):
    _fields_ = [
        ('Size',                ULONG),
        ('SequenceId',          ULONG),
        ('TraceSession',        POINTER(TRACE_SESSION)),
        ('TraceStores',         POINTER(TRACE_STORES)),
        ('SystemTimerFunction', PVOID),
        ('UserData',            PVOID),
    ]
PTRACE_CONTEXT = POINTER(TRACE_CONTEXT)

class PYTHON_TRACE_CONTEXT(Structure):
    _fields_ = [
        ('Size',                    ULONG),
        ('Python',                  PPYTHON),
        ('TraceContext',            PTRACE_CONTEXT),
        ('PythonTraceFunction',     PVOID),
        ('UserData',                PVOID),
    ]
PPYTHON_TRACE_CONTEXT = POINTER(PYTHON_TRACE_CONTEXT)

#===============================================================================
# Functions
#===============================================================================
def vspyprof(path=None, dll=None):
    assert path or dll
    if not dll:
        dll = ctypes.PyDLL(path)

    dll.CreateProfiler.restype = c_void_p
    dll.CreateCustomProfiler.restype = c_void_p
    dll.CreateCustomProfiler.argtypes = [c_void_p, ctypes.c_void_p]
    dll.CloseThread.argtypes = [c_void_p]
    dll.CloseProfiler.argtypes = [c_void_p]
    dll.InitProfiler.argtypes = [c_void_p]
    dll.InitProfiler.restype = c_void_p

    #dll.SetTracing.argtypes = [c_void_p]
    #dll.UnsetTracing.argtypes = [c_void_p]
    #dll.IsTracing.argtypes = [c_void_p]
    #dll.IsTracing.restype = c_bool

    return dll

def pytrace(path=None, dll=None):
    assert path or dll
    dll = vspyprof(path, dll)

    dll.CreateTracer.restype = PVOID
    dll.CreateTracer.argtypes = [PVOID, PVOID]

    dll.InitializeTraceStores.restype = BOOL
    dll.InitializeTraceStores.argtypes = [
        PWSTR,
        PVOID,
        PDWORD,
        PDWORD,
    ]

    return dll

def tracer(path=None, dll=None):
    assert path or dll
    if not dll:
        dll = ctypes.PyDLL(path)

    dll.InitializeTraceStores.restype = BOOL
    dll.InitializeTraceStores.argtypes = [
        PWSTR,
        PVOID,
        PDWORD,
        PDWORD,
    ]

    dll.InitializeTraceContext.restype = BOOL
    dll.InitializeTraceContext.argtypes = [
        PTRACE_CONTEXT,
        PDWORD,
        PTRACE_SESSION,
        PTRACE_STORES,
        PVOID,
    ]

    dll.InitializeTraceSession.restype = BOOL
    dll.InitializeTraceSession.argtypes = [
        PTRACE_SESSION,
        PDWORD
    ]

    #dll.CallSystemTimer.restype = BOOL
    #dll.CallSystemTimer.argtypes = [
    #    PFILETIME,
    #    PVOID,
    #]

    return dll

def python(path=None, dll=None):
    assert path or dll
    if not dll:
        dll = ctypes.PyDLL(path)

    dll.InitializePython.restype = BOOL
    dll.InitializePython.argtypes = [
        HMODULE,
        PVOID,
        PDWORD
    ]

    return dll

def pythontracer(path=None, dll=None):
    assert path or dll
    if not dll:
        dll = ctypes.PyDLL(path)

    dll.InitializePythonTraceContext.restype = BOOL
    dll.InitializePythonTraceContext.argtypes = [
        PPYTHON_TRACE_CONTEXT,
        PULONG,
        PPYTHON,
        PTRACE_CONTEXT,
        PPYTRACEFUNC,
        PUSERDATA
    ]

    dll.StartTracing.restype = BOOL
    dll.StartTracing.argtypes = [ PPYTHON_TRACE_CONTEXT, ]

    dll.StopTracing.restype = BOOL
    dll.StopTracing.argtypes = [ PPYTHON_TRACE_CONTEXT, ]

    return dll

# vim:set ts=8 sw=4 sts=4 tw=80 et                                             :

redpajama_set_name: RedPajamaGithub


text:
// ==========================================================================
//  Squidex Headless CMS
// ==========================================================================
//  Copyright (c) Squidex UG (haftungsbeschraenkt)
//  All rights reserved. Licensed under the MIT license.
// ==========================================================================

using System.Diagnostics.Contracts;
using Squidex.Infrastructure;

namespace Squidex.Domain.Apps.Core.Schemas;

public sealed class FieldCollection<T> where T : IField
{
    public static readonly FieldCollection<T> Empty = new FieldCollection<T>();

    private static readonly Dictionary<long, T> EmptyById = new Dictionary<long, T>();
    private static readonly Dictionary<string, T> EmptyByString = new Dictionary<string, T>();

    private readonly T[] fieldsOrdered;
    private Dictionary<long, T>? fieldsById;
    private Dictionary<string, T>? fieldsByName;

    public IReadOnlyList<T> Ordered
    {
        get => fieldsOrdered;
    }

    public IReadOnlyDictionary<long, T> ById
    {
        get
        {
            if (fieldsById == null)
            {
                if (fieldsOrdered.Length == 0)
                {
                    fieldsById = EmptyById;
                }
                else
                {
                    fieldsById = fieldsOrdered.ToDictionary(x => x.Id);
                }
            }

            return fieldsById;
        }
    }

    public IReadOnlyDictionary<string, T> ByName
    {
        get
        {
            if (fieldsByName == null)
            {
                if (fieldsOrdered.Length == 0)
                {
                    fieldsByName = EmptyByString;
                }
                else
                {
                    fieldsByName = fieldsOrdered.ToDictionary(x => x.Name);
                }
            }

            return fieldsByName;
        }
    }

    private FieldCollection()
    {
        fieldsOrdered = Array.Empty<T>();
    }

    public FieldCollection(T[] fields)
    {
        Guard.NotNull(fields);

        fieldsOrdered = fields;
    }

    private FieldCollection(IEnumerable<T> fields)
    {
        fieldsOrdered = fields.ToArray();
    }

    [Pure]
    public FieldCollection<T> Remove(long fieldId)
    {
        if (!ById.TryGetValue(fieldId, out _))
        {
            return this;
        }

        return new FieldCollection<T>(fieldsOrdered.Where(x => x.Id != fieldId));
    }

    [Pure]
    public FieldCollection<T> Reorder(List<long> ids)
    {
        Guard.NotNull(ids);

        if (ids.Count != fieldsOrdered.Length || ids.Any(x => !ById.ContainsKey(x)))
        {
            ThrowHelper.ArgumentException("Ids must cover all fields.", nameof(ids));
        }

        if (ids.SequenceEqual(fieldsOrdered.Select(x => x.Id)))
        {
            return this;
        }

        return new FieldCollection<T>(fieldsOrdered.OrderBy(f => ids.IndexOf(f.Id)));
    }

    [Pure]
    public FieldCollection<T> Add(T field)
    {
        Guard.NotNull(field);

        if (ByName.ContainsKey(field.Name))
        {
            ThrowHelper.ArgumentException($"A field with name '{field.Name}' already exists.", nameof(field));
        }

        if (ById.ContainsKey(field.Id))
        {
            ThrowHelper.ArgumentException($"A field with ID {field.Id} already exists.", nameof(field));
        }

        return new FieldCollection<T>(fieldsOrdered.Union(Enumerable.Repeat(field, 1)));
    }

    [Pure]
    public FieldCollection<T> Update(long fieldId, Func<T, T> updater)
    {
        Guard.NotNull(updater);

        if (!ById.TryGetValue(fieldId, out var field))
        {
            return this;
        }

        var newField = updater(field);

        if (ReferenceEquals(newField, field))
        {
            return this;
        }

        if (newField is null)
        {
            ThrowHelper.InvalidOperationException($"Field must be of type {typeof(T)}");
            return default!;
        }

        return new FieldCollection<T>(fieldsOrdered.Select(x => ReferenceEquals(x, field) ? newField : x));
    }
}


text:
using SeeClickFix.WP8.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace SeeClickFix.WP8.Converters
{
    /// <summary>
    /// Used to select visibility in the Fullmode popup of ListPicker
    ///  where we hide the 'Select item's item
    /// </summary>
    public class SelectRequestTypeItemVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            RequestTypeViewModel vm = (RequestTypeViewModel)value;
            return vm.IsDummyItem() ? Visibility.Collapsed : Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}


text:
import Core from "../Core";

export default function convertToType(value: any, type: string) {
  switch (type) {
    case "string": {
      return value.toString();
    }
    case "int": {
      return Core.Instance.dsModule.int(value);
    }
    case "double": {
      return Core.Instance.dsModule.double(value);
    }
    case "datetime": {
      if (Object.prototype.toString.call(value) === "[object Date]") {
        return value;
      } else {
        return new Date(value);
      }
    }
    case "geoPoint": {
      if (value && value.value != null) {
        // This is the structure of the GeoPoint object
        return Core.Instance.dsModule.geoPoint(value.value);
      }

      return Core.Instance.dsModule.geoPoint(value);
    }
    case "array":
    case "boolean":
    case "object": {
      return value;
    }
    case "serializedJson": {
      return JSON.stringify(value);
    }
    default: {
      return value;
    }
  }
}


text:
package edu.drexel.acin.sf.api;

import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: ids
 * Date: 3/22/12
 * Time: 5:59 PM
 * To change this template use File | Settings | File Templates.
 */
public class PageForm {
    private ClassDescriptor classDescriptor;
    private URI id;
    private String name;
    private final List<DataField> fields = new ArrayList<DataField>();

    public PageForm() {
    }

    public PageForm(String name, URI id, ClassDescriptor classDescriptor, List<DataField> fields) {
        this.classDescriptor = classDescriptor;
        this.id = id;
        this.name = name;
        setFields(fields);
    }

    public URI getId() {
        return id;
    }

    public void setId(URI id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ClassDescriptor getClassDescriptor() {
        return classDescriptor;
    }

    public void setClassDescriptor(ClassDescriptor classDescriptor) {
        this.classDescriptor = classDescriptor;
    }

    public List<DataField> getFields() {
        return fields;
    }

    public void setFields(List<DataField> fields) {
        this.fields.clear();
        this.fields.addAll(fields);
    }

    public void addFields(List<DataField> fields) {
        this.fields.addAll(fields);
    }

    public void addFields(DataField... fields) {
        this.fields.addAll(Arrays.asList(fields));
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PageForm pageForm = (PageForm) o;

        if (classDescriptor != null ? !classDescriptor.equals(pageForm.classDescriptor) : pageForm.classDescriptor != null)
            return false;
        if (fields != null ? !fields.equals(pageForm.fields) : pageForm.fields != null) return false;
        if (id != null ? !id.equals(pageForm.id) : pageForm.id != null) return false;
        if (name != null ? !name.equals(pageForm.name) : pageForm.name != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = classDescriptor != null ? classDescriptor.hashCode() : 0;
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (fields != null ? fields.hashCode() : 0);
        return result;
    }
}


text:
.class public abstract Lcom/android/internal/widget/ILockSettings$Stub;
.super Landroid/os/Binder;
.source "ILockSettings.java"

# interfaces
.implements Lcom/android/internal/widget/ILockSettings;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/widget/ILockSettings;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x409
    name = "Stub"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/internal/widget/ILockSettings$Stub$Proxy;
    }
.end annotation

# static fields
.field private static final DESCRIPTOR:Ljava/lang/String; = "com.android.internal.widget.ILockSettings"

.field static final TRANSACTION_checkPassword:I = 0xb

.field static final TRANSACTION_checkPattern:I = 0x9

.field static final TRANSACTION_getBoolean:I = 0x4

.field static final TRANSACTION_getLockPatternSize:I = 0x7

.field static final TRANSACTION_getLong:I = 0x5

.field static final TRANSACTION_getString:I = 0x6

.field static final TRANSACTION_havePassword:I = 0xd

.field static final TRANSACTION_havePattern:I = 0xc

.field static final TRANSACTION_removeUser:I = 0xe

.field static final TRANSACTION_setBoolean:I = 0x1

.field static final TRANSACTION_setLockPassword:I = 0xa

.field static final TRANSACTION_setLockPattern:I = 0x8

.field static final TRANSACTION_setLong:I = 0x2

.field static final TRANSACTION_setString:I = 0x3

# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 15
    invoke-direct {p0}, Landroid/os/Binder;-><init>()V

    .line 16
    const-string v0, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p0, p0, v0}, Lcom/android/internal/widget/ILockSettings$Stub;->attachInterface(Landroid/os/IInterface;Ljava/lang/String;)V

    .line 17
    return-void
.end method

.method public static asInterface(Landroid/os/IBinder;)Lcom/android/internal/widget/ILockSettings;
    .locals 2
    .parameter "obj"

    .prologue
    .line 24
    if-nez p0, :cond_0

    .line 25
    const/4 v0, 0x0

    .line 31
    :goto_0
    return-object v0

    .line 27
    :cond_0
    const-string v1, "com.android.internal.widget.ILockSettings"

    invoke-interface {p0, v1}, Landroid/os/IBinder;->queryLocalInterface(Ljava/lang/String;)Landroid/os/IInterface;

    move-result-object v0

    .line 28
    .local v0, iin:Landroid/os/IInterface;
    if-eqz v0, :cond_1

    instance-of v1, v0, Lcom/android/internal/widget/ILockSettings;

    if-eqz v1, :cond_1

    .line 29
    check-cast v0, Lcom/android/internal/widget/ILockSettings;

    goto :goto_0

    .line 31
    :cond_1
    new-instance v0, Lcom/android/internal/widget/ILockSettings$Stub$Proxy;

    .end local v0           #iin:Landroid/os/IInterface;
    invoke-direct {v0, p0}, Lcom/android/internal/widget/ILockSettings$Stub$Proxy;-><init>(Landroid/os/IBinder;)V

    goto :goto_0
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 0

    .prologue
    .line 35
    return-object p0
.end method

.method public onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
    .locals 9
    .parameter "code"
    .parameter "data"
    .parameter "reply"
    .parameter "flags"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v7, 0x0

    const/4 v6, 0x1

    .line 39
    sparse-switch p1, :sswitch_data_0

    .line 213
    invoke-super {p0, p1, p2, p3, p4}, Landroid/os/Binder;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    move-result v6

    :goto_0
    return v6

    .line 43
    :sswitch_0
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p3, v7}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    goto :goto_0

    .line 48
    :sswitch_1
    const-string v8, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v8}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 50
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 52
    .local v0, _arg0:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v8

    if-eqz v8, :cond_0

    move v1, v6

    .line 54
    .local v1, _arg1:Z
    :goto_1
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 55
    .local v3, _arg2:I
    invoke-virtual {p0, v0, v1, v3}, Lcom/android/internal/widget/ILockSettings$Stub;->setBoolean(Ljava/lang/String;ZI)V

    .line 56
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .end local v1           #_arg1:Z
    .end local v3           #_arg2:I
    :cond_0
    move v1, v7

    .line 52
    goto :goto_1

    .line 61
    .end local v0           #_arg0:Ljava/lang/String;
    :sswitch_2
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 63
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 65
    .restart local v0       #_arg0:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readLong()J

    move-result-wide v1

    .line 67
    .local v1, _arg1:J
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 68
    .restart local v3       #_arg2:I
    invoke-virtual {p0, v0, v1, v2, v3}, Lcom/android/internal/widget/ILockSettings$Stub;->setLong(Ljava/lang/String;JI)V

    .line 69
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 74
    .end local v0           #_arg0:Ljava/lang/String;
    .end local v1           #_arg1:J
    .end local v3           #_arg2:I
    :sswitch_3
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 76
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 78
    .restart local v0       #_arg0:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v1

    .line 80
    .local v1, _arg1:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 81
    .restart local v3       #_arg2:I
    invoke-virtual {p0, v0, v1, v3}, Lcom/android/internal/widget/ILockSettings$Stub;->setString(Ljava/lang/String;Ljava/lang/String;I)V

    .line 82
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto :goto_0

    .line 87
    .end local v0           #_arg0:Ljava/lang/String;
    .end local v1           #_arg1:Ljava/lang/String;
    .end local v3           #_arg2:I
    :sswitch_4
    const-string v8, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v8}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 89
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 91
    .restart local v0       #_arg0:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v8

    if-eqz v8, :cond_2

    move v1, v6

    .line 93
    .local v1, _arg1:Z
    :goto_2
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 94
    .restart local v3       #_arg2:I
    invoke-virtual {p0, v0, v1, v3}, Lcom/android/internal/widget/ILockSettings$Stub;->getBoolean(Ljava/lang/String;ZI)Z

    move-result v4

    .line 95
    .local v4, _result:Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 96
    if-eqz v4, :cond_1

    move v7, v6

    :cond_1
    invoke-virtual {p3, v7}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .end local v1           #_arg1:Z
    .end local v3           #_arg2:I
    .end local v4           #_result:Z
    :cond_2
    move v1, v7

    .line 91
    goto :goto_2

    .line 101
    .end local v0           #_arg0:Ljava/lang/String;
    :sswitch_5
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 103
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 105
    .restart local v0       #_arg0:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readLong()J

    move-result-wide v1

    .line 107
    .local v1, _arg1:J
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 108
    .restart local v3       #_arg2:I
    invoke-virtual {p0, v0, v1, v2, v3}, Lcom/android/internal/widget/ILockSettings$Stub;->getLong(Ljava/lang/String;JI)J

    move-result-wide v4

    .line 109
    .local v4, _result:J
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 110
    invoke-virtual {p3, v4, v5}, Landroid/os/Parcel;->writeLong(J)V

    goto/16 :goto_0

    .line 115
    .end local v0           #_arg0:Ljava/lang/String;
    .end local v1           #_arg1:J
    .end local v3           #_arg2:I
    .end local v4           #_result:J
    :sswitch_6
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 117
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    .line 119
    .restart local v0       #_arg0:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v1

    .line 121
    .local v1, _arg1:Ljava/lang/String;
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v3

    .line 122
    .restart local v3       #_arg2:I
    invoke-virtual {p0, v0, v1, v3}, Lcom/android/internal/widget/ILockSettings$Stub;->getString(Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;

    move-result-object v4

    .line 123
    .local v4, _result:Ljava/lang/String;
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 124
    invoke-virtual {p3, v4}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    goto/16 :goto_0

    .line 129
    .end local v0           #_arg0:Ljava/lang/String;
    .end local v1           #_arg1:Ljava/lang/String;
    .end local v3           #_arg2:I
    .end local v4           #_result:Ljava/lang/String;
    :sswitch_7
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 131
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    .line 132
    .local v0, _arg0:I
    invoke-virtual {p0, v0}, Lcom/android/internal/widget/ILockSettings$Stub;->getLockPatternSize(I)B

    move-result v4

    .line 133
    .local v4, _result:B
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 134
    invoke-virtual {p3, v4}, Landroid/os/Parcel;->writeByte(B)V

    goto/16 :goto_0

    .line 139
    .end local v0           #_arg0:I
    .end local v4           #_result:B
    :sswitch_8
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 141
    invoke-virtual {p2}, Landroid/os/Parcel;->createByteArray()[B

    move-result-object v0

    .line 143
    .local v0, _arg0:[B
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v1

    .line 144
    .local v1, _arg1:I
    invoke-virtual {p0, v0, v1}, Lcom/android/internal/widget/ILockSettings$Stub;->setLockPattern([BI)V

    .line 145
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 150
    .end local v0           #_arg0:[B
    .end local v1           #_arg1:I
    :sswitch_9
    const-string v8, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v8}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 152
    invoke-virtual {p2}, Landroid/os/Parcel;->createByteArray()[B

    move-result-object v0

    .line 154
    .restart local v0       #_arg0:[B
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v1

    .line 155
    .restart local v1       #_arg1:I
    invoke-virtual {p0, v0, v1}, Lcom/android/internal/widget/ILockSettings$Stub;->checkPattern([BI)Z

    move-result v4

    .line 156
    .local v4, _result:Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 157
    if-eqz v4, :cond_3

    move v7, v6

    :cond_3
    invoke-virtual {p3, v7}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 162
    .end local v0           #_arg0:[B
    .end local v1           #_arg1:I
    .end local v4           #_result:Z
    :sswitch_a
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 164
    invoke-virtual {p2}, Landroid/os/Parcel;->createByteArray()[B

    move-result-object v0

    .line 166
    .restart local v0       #_arg0:[B
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v1

    .line 167
    .restart local v1       #_arg1:I
    invoke-virtual {p0, v0, v1}, Lcom/android/internal/widget/ILockSettings$Stub;->setLockPassword([BI)V

    .line 168
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 173
    .end local v0           #_arg0:[B
    .end local v1           #_arg1:I
    :sswitch_b
    const-string v8, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v8}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 175
    invoke-virtual {p2}, Landroid/os/Parcel;->createByteArray()[B

    move-result-object v0

    .line 177
    .restart local v0       #_arg0:[B
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v1

    .line 178
    .restart local v1       #_arg1:I
    invoke-virtual {p0, v0, v1}, Lcom/android/internal/widget/ILockSettings$Stub;->checkPassword([BI)Z

    move-result v4

    .line 179
    .restart local v4       #_result:Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 180
    if-eqz v4, :cond_4

    move v7, v6

    :cond_4
    invoke-virtual {p3, v7}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 185
    .end local v0           #_arg0:[B
    .end local v1           #_arg1:I
    .end local v4           #_result:Z
    :sswitch_c
    const-string v8, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v8}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 187
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    .line 188
    .local v0, _arg0:I
    invoke-virtual {p0, v0}, Lcom/android/internal/widget/ILockSettings$Stub;->havePattern(I)Z

    move-result v4

    .line 189
    .restart local v4       #_result:Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 190
    if-eqz v4, :cond_5

    move v7, v6

    :cond_5
    invoke-virtual {p3, v7}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 195
    .end local v0           #_arg0:I
    .end local v4           #_result:Z
    :sswitch_d
    const-string v8, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v8}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 197
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    .line 198
    .restart local v0       #_arg0:I
    invoke-virtual {p0, v0}, Lcom/android/internal/widget/ILockSettings$Stub;->havePassword(I)Z

    move-result v4

    .line 199
    .restart local v4       #_result:Z
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    .line 200
    if-eqz v4, :cond_6

    move v7, v6

    :cond_6
    invoke-virtual {p3, v7}, Landroid/os/Parcel;->writeInt(I)V

    goto/16 :goto_0

    .line 205
    .end local v0           #_arg0:I
    .end local v4           #_result:Z
    :sswitch_e
    const-string v7, "com.android.internal.widget.ILockSettings"

    invoke-virtual {p2, v7}, Landroid/os/Parcel;->enforceInterface(Ljava/lang/String;)V

    .line 207
    invoke-virtual {p2}, Landroid/os/Parcel;->readInt()I

    move-result v0

    .line 208
    .restart local v0       #_arg0:I
    invoke-virtual {p0, v0}, Lcom/android/internal/widget/ILockSettings$Stub;->removeUser(I)V

    .line 209
    invoke-virtual {p3}, Landroid/os/Parcel;->writeNoException()V

    goto/16 :goto_0

    .line 39
    nop

    :sswitch_data_0
    .sparse-switch
        0x1 -> :sswitch_1
        0x2 -> :sswitch_2
        0x3 -> :sswitch_3
        0x4 -> :sswitch_4
        0x5 -> :sswitch_5
        0x6 -> :sswitch_6
        0x7 -> :sswitch_7
        0x8 -> :sswitch_8
        0x9 -> :sswitch_9
        0xa -> :sswitch_a
        0xb -> :sswitch_b
        0xc -> :sswitch_c
        0xd -> :sswitch_d
        0xe -> :sswitch_e
        0x5f4e5446 -> :sswitch_0
    .end sparse-switch
.end method


text:
<?php
header('Access-Control-Allow-Origin: *');
include_once('../login/checkUser.php');

if(!$user_ok || $userType != 'network'){
	echo 'you arent a network jake';
	exit();
}
/*------------------------------------------/
*            Network Track Deny
*
*	Confirm network is logged in and grab the networkID.
*	We will grab the following POST data:
*		-submissionID	(int)
*		-responseId (int)
*		-other   	(string)
*
*	Sanitize the data.
*
*	Change the status to "declined" of the entry corresponding to the trackID and networkID in the "submissions" table. Grab the submissionID.
*
*	if other is set, change the responseID to empty. Change otherResponse in the table to the "other" variable.
*	ELSE (if other is empty), change the responseID in the table to the responseID.
*
*	Input a new record into "submissionEvents" with the submissionID and the social BOOLEAN options.
*
*
*	Return TRUE.
*
*------------------------------------------*/

$submissionID = (int)preg_replace('#[^0-9]#i', '', $_POST['submissionID']);
$responseID = (int)preg_replace('#[^0-9]#i', '', $_POST['responseID']);
$other = mysqli_real_escape_string($db_connect, $_POST['other']);
if($other!=''){
	$sql = "UPDATE submissions SET status='declined', otherResponse='$other' WHERE id=$submissionID";
} else {
	$sql = "UPDATE submissions SET status='declined', responseID=$responseID WHERE id=$submissionID";
}

$query = mysqli_query($db_connect, $sql);

$sql = "SELECT profit FROM submissions WHERE id=$submissionID LIMIT 1";
$query = mysqli_query($db_connect, $sql);
$row = mysqli_fetch_row($query);
$profit = $row[0];

$sql = "UPDATE bits SET tier1 = tier1 + $profit WHERE id=$userID";
$query = mysqli_query($db_connect, $sql);

$sql = "SELECT trackID FROM submissions WHERE id=$submissionID";
$query = mysqli_query($db_connect, $sql);
$row = mysqli_fetch_row($query);
$trackID = $row[0];

$sql = "UPDATE tracks SET notification=1 WHERE id=$trackID";
$query = mysqli_query($db_connect, $sql);
//Example response
echo TRUE;
exit();

?>


text:
namespace llvm {

class Type;
class Module;
class Value;
class raw_ostream;
template <typename T> class SmallVectorImpl;

/// TypePrinting - Type printing machinery.
class TypePrinting {
  void *TypeNames;  // A map to remember type names.
  TypePrinting(const TypePrinting &);   // DO NOT IMPLEMENT
  void operator=(const TypePrinting&);  // DO NOT IMPLEMENT
public:
  TypePrinting();
  ~TypePrinting();

  void clear();

  void print(const Type *Ty, raw_ostream &OS, bool IgnoreTopLevelName = false);

  void printAtLeastOneLevel(const Type *Ty, raw_ostream &OS) {
    print(Ty, OS, true);
  }

  /// hasTypeName - Return true if the type has a name in TypeNames, false
  /// otherwise.
  bool hasTypeName(const Type *Ty) const;

  /// addTypeName - Add a name for the specified type if it doesn't already have
  /// one.  This name will be printed instead of the structural version of the
  /// type in order to make the output more concise.
  void addTypeName(const Type *Ty, const std::string &N);

private:
  void CalcTypeName(const Type *Ty, SmallVectorImpl<const Type *> &TypeStack,
                    raw_ostream &OS, bool IgnoreTopLevelName = false);
};

// WriteTypeSymbolic - This attempts to write the specified type as a symbolic
// type, if there is an entry in the Module's symbol table for the specified
// type or one of its component types.
//
void WriteTypeSymbolic(raw_ostream &, const Type *, const Module *M);

// WriteAsOperand - Write the name of the specified value out to the specified
// ostream.  This can be useful when you just want to print int %reg126, not the
// whole instruction that generated it.  If you specify a Module for context,
// then even constants get pretty-printed; for example, the type of a null
// pointer is printed symbolically.
//
void WriteAsOperand(raw_ostream &, const Value *, bool PrintTy = true,
                    const Module *Context = 0);

} // End llvm namespace

#endif


text:
<!DOCTYPE html>

    <meta http-equiv="refresh" content="0;URL=../../../libc/fn.nl_langinfo.html">

Redirecting to ../../../libc/fn.nl_langinfo.html...


text:
const STORE_URL = '/speculation-rules/prerender/resources/key-value-store.py';

function assertSpeculationRulesIsSupported() {
  assert_implements(
      'supports' in HTMLScriptElement,
      'HTMLScriptElement.supports is not supported');
  assert_implements(
      HTMLScriptElement.supports('speculationrules'),
      '<script type="speculationrules"> is not supported');
}

// Starts prerendering for `url`.
function startPrerendering(url) {
  // Adds <script type="speculationrules"> and specifies a prerender candidate
  // for the given URL.
  // TODO(https://crbug.com/1174978): <script type="speculationrules"> may not
  // start prerendering for some reason (e.g., resource limit). Implement a
  // WebDriver API to force prerendering.
  const script = document.createElement('script');
  script.type = 'speculationrules';
  script.text = `{"prerender": [{"source": "list", "urls": ["${url}"] }] }`;
  document.head.appendChild(script);
}

class PrerenderChannel extends EventTarget {
  #ids = new Set();
  #url;
  #active = true;

  constructor(name, uid = new URLSearchParams(location.search).get('uid')) {
    super();
    this.#url = `/speculation-rules/prerender/resources/deprecated-broadcast-channel.py?name=${name}&uid=${uid}`;
    (async() => {
      while (this.#active) {
        // Add the "keepalive" option to avoid fetch() results in unhandled
        // rejection with fetch abortion due to window.close().
        const messages = await (await fetch(this.#url, {keepalive: true})).json();
        for (const {data, id} of messages) {
          if (!this.#ids.has(id))
            this.dispatchEvent(new MessageEvent('message', {data}));
          this.#ids.add(id);
        }
      }
    })();
  }

  close() {
    this.#active = false;
  }

  set onmessage(m) {
    this.addEventListener('message', m)
  }

  async postMessage(data) {
    const id = new Date().valueOf();
    this.#ids.add(id);
    // Add the "keepalive" option to prevent messages from being lost due to
    // window.close().
    await fetch(this.#url, {method: 'POST', body: JSON.stringify({data, id}), keepalive: true});
  }
}

// Reads the value specified by `key` from the key-value store on the server.
async function readValueFromServer(key) {
  const serverUrl = `${STORE_URL}?key=${key}`;
  const response = await fetch(serverUrl);
  if (!response.ok)
    throw new Error('An error happened in the server');
  const value = await response.text();

  // The value is not stored in the server.
  if (value === "")
    return { status: false };

  return { status: true, value: value };
}

// Convenience wrapper around the above getter that will wait until a value is
// available on the server.
async function nextValueFromServer(key) {
  while (true) {
    // Fetches the test result from the server.
    const { status, value } = await readValueFromServer(key);
    if (!status) {
      // The test result has not been stored yet. Retry after a while.
      await new Promise(resolve => setTimeout(resolve, 100));
      continue;
    }

    return value;
  }
}

// Writes `value` for `key` in the key-value store on the server.
async function writeValueToServer(key, value) {
  const serverUrl = `${STORE_URL}?key=${key}&value=${value}`;
  await fetch(serverUrl);
}

// Loads the initiator page, and navigates to the prerendered page after it
// receives the 'readyToActivate' message.
function loadInitiatorPage() {
  // Used to communicate with the prerendering page.
  const prerenderChannel = new PrerenderChannel('prerender-channel');
  window.addEventListener('unload', () => {
    prerenderChannel.close();
  });

  // We need to wait for the 'readyToActivate' message before navigation
  // since the prerendering implementation in Chromium can only activate if the
  // response for the prerendering navigation has already been received and the
  // prerendering document was created.
  const readyToActivate = new Promise((resolve, reject) => {
    prerenderChannel.addEventListener('message', e => {
      if (e.data != 'readyToActivate')
        reject(`The initiator page receives an unsupported message: ${e.data}`);
      resolve(e.data);
    });
  });

  const url = new URL(document.URL);
  url.searchParams.append('prerendering', '');
  // Prerender a page that notifies the initiator page of the page's ready to be
  // activated via the 'readyToActivate'.
  startPrerendering(url.toString());

  // Navigate to the prerendered page after being informed.
  readyToActivate.then(() => {
    window.location = url.toString();
  }).catch(e => {
    const testChannel = new PrerenderChannel('test-channel');
    testChannel.postMessage(
        `Failed to navigate the prerendered page: ${e.toString()}`);
    testChannel.close();
    window.close();
  });
}

// Returns messages received from the given PrerenderChannel
// so that callers do not need to add their own event listeners.
// nextMessage() returns a promise which resolves with the next message.
//
// Usage:
//   const channel = new PrerenderChannel('channel-name');
//   const messageQueue = new BroadcastMessageQueue(channel);
//   const message1 = await messageQueue.nextMessage();
//   const message2 = await messageQueue.nextMessage();
//   message1 and message2 are the messages received.
class BroadcastMessageQueue {
  constructor(c) {
    this.messages = [];
    this.resolveFunctions = [];
    this.channel = c;
    this.channel.addEventListener('message', e => {
      if (this.resolveFunctions.length > 0) {
        const fn = this.resolveFunctions.shift();
        fn(e.data);
      } else {
        this.messages.push(e.data);
      }
    });
  }

  // Returns a promise that resolves with the next message from this queue.
  nextMessage() {
    return new Promise(resolve => {
      if (this.messages.length > 0)
        resolve(this.messages.shift())
      else
        this.resolveFunctions.push(resolve);
    });
  }
}

// Returns <iframe> element upon load.
function createFrame(url) {
  return new Promise(resolve => {
      const frame = document.createElement('iframe');
      frame.src = url;
      frame.onload = () => resolve(frame);
      document.body.appendChild(frame);
    });
}

// `opt` provides additional query params for the prerendered URL.
// `init_opt` provides additional query params for the page that triggers
// the prerender.
// `rule_extras` provides additional parameters for the speculation rule used
// to trigger prerendering.
async function create_prerendered_page(t, opt = {}, init_opt = {}, rule_extras = {}) {
  const baseUrl = '/speculation-rules/prerender/resources/exec.py';
  const init_uuid = token();
  const prerender_uuid = token();
  const discard_uuid = token();
  const init_remote = new RemoteContext(init_uuid);
  const prerender_remote = new RemoteContext(prerender_uuid);
  const discard_remote = new RemoteContext(discard_uuid);

  const init_params = new URLSearchParams(baseUrl.search);
  init_params.set('uuid', init_uuid);
  for (const p in init_opt)
    init_params.set(p, init_opt[p]);
  window.open(`${baseUrl}?${init_params.toString()}&init`, '_blank', 'noopener');

  const params = new URLSearchParams(baseUrl.search);
  params.set('uuid', prerender_uuid);
  params.set('discard_uuid', discard_uuid);
  for (const p in opt)
    params.set(p, opt[p]);
  const url = `${baseUrl}?${params.toString()}`;

  await init_remote.execute_script((url, rule_extras) => {
      const a = document.createElement('a');
      a.href = url;
      a.innerText = 'Activate';
      document.body.appendChild(a);
      const rules = document.createElement('script');
      rules.type = "speculationrules";
      rules.text = JSON.stringify({prerender: [{source: 'list', urls: [url], ...rule_extras}]});
      document.head.appendChild(rules);
  }, [url, rule_extras]);

  await Promise.any([
    prerender_remote.execute_script(() => {
        window.import_script_to_prerendered_page = src => {
            const script = document.createElement('script');
            script.src = src;
            document.head.appendChild(script);
            return new Promise(resolve => script.addEventListener('load', resolve));
        }
    }), new Promise(r => t.step_timeout(r, 3000))
    ]);

  t.add_cleanup(() => {
    init_remote.execute_script(() => window.close());
    discard_remote.execute_script(() => window.close());
    prerender_remote.execute_script(() => window.close());
  });

  async function tryToActivate() {
    const prerendering = prerender_remote.execute_script(() => new Promise(resolve => {
        if (!document.prerendering)
            resolve('activated');
        else document.addEventListener('prerenderingchange', () => resolve('activated'));
    }));

    const discarded = discard_remote.execute_script(() => Promise.resolve('discarded'));

    init_remote.execute_script(url => {
        location.href = url;
    }, [url]);
    return Promise.any([prerendering, discarded]);
  }

  async function activate() {
    const prerendering = await tryToActivate();
    if (prerendering !== 'activated')
      throw new Error('Should not be prerendering at this point')
  }

  return {
    exec: (fn, args) => prerender_remote.execute_script(fn, args),
    activate,
    tryToActivate
  };
}

function test_prerender_restricted(fn, expected, label) {
  promise_test(async t => {
    const {exec} = await create_prerendered_page(t);
    let result = null;
    try {
      await exec(fn);
      result = "OK";
    } catch (e) {
      result = e.name;
    }

    assert_equals(result, expected);
  }, label);
}

function test_prerender_defer(fn, label) {
  promise_test(async t => {
    const {exec, activate} = await create_prerendered_page(t);
    let activated = false;
    const deferred = exec(fn);

    const post = new Promise(resolve =>
      deferred.then(result => {
        assert_true(activated, "Deferred operation should occur only after activation");
        resolve(result);
      }));

    await activate();
    activated = true;
    await post;
  }, label);
}

/**
 * Starts prerendering a page from the given referrer `RemoteContextWrapper`,
 * using `<script type="speculationrules">`.
 *
 * See
 * /html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
 * for more details on the `RemoteContextWrapper` framework, and supported fields for extraConfig.
 *
 * The returned `RemoteContextWrapper` for the prerendered remote
 * context will have an extra `url` property, which is used by
 * @see activatePrerenderRC. (Most `RemoteContextWrapper` uses should not care
 * about the URL, but prerendering is unique in that you need to navigate to
 * a prerendered page after creating it.)
 *
 * @param {RemoteContextWrapper} referrerRemoteContext
 * @param {RemoteContextConfig|object} extraConfig
 * @returns {Promise<RemoteContextWrapper>}
 */
async function addPrerenderRC(referrerRemoteContext, extraConfig) {
  let savedURL;
  const prerenderedRC = await referrerRemoteContext.helper.createContext({
    executorCreator(url) {
      // Save the URL which the remote context helper framework assembled for
      // us, so that we can attach it to the returned `RemoteContextWrapper`.
      savedURL = url;

      return referrerRemoteContext.executeScript(url => {
        const script = document.createElement("script");
        script.type = "speculationrules";
        script.textContent = JSON.stringify({
          prerender: [
            {
              source: "list",
              urls: [url]
            }
          ]
        });
        document.head.append(script);
      }, [url]);
    }, extraConfig
  });

  prerenderedRC.url = savedURL;
  return prerenderedRC;
}

/**
 * Activates a prerendered RemoteContextWrapper `prerenderedRC` by navigating
 * the referrer RemoteContextWrapper `referrerRC` to it. If the navigation does
 * not result in a prerender activation, the returned
 * promise will be rejected with a testharness.js AssertionError.
 *
 * See
 * /html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
 * for more on the RemoteContext helper framework.
 *
 * @param {RemoteContextWrapper} referrerRC - The referrer
 *     `RemoteContextWrapper` in which the prerendering was triggered,
 *     probably via `addPrerenderRC()`.
 * @param {RemoteContextWrapper} prerenderedRC - The `RemoteContextWrapper`
 *     pointing to the prerendered content. This is monitored to ensure the
 *     navigation results in a prerendering activation.
 * @param {(string) => Promise<undefined>} [navigateFn] - An optional function
 *     to customize the navigation. It will be passed the URL of the prerendered
 *     content, and will run as a script in `referrerRC` (see
 *     `RemoteContextWrapper.prototype.executeScript`). If not given, navigation
 *     will be done via the `location.href` setter (see
 *     `RemoteContextWrapper.prototype.navigateTo`).
 * @returns {Promise<undefined>}
 */
async function activatePrerenderRC(referrerRC, prerenderedRC, navigateFn) {
  // Store a promise that will fulfill when the prerenderingchange event fires.
  await prerenderedRC.executeScript(() => {
    window.activatedPromise = new Promise(resolve => {
      document.addEventListener("prerenderingchange", () => resolve("activated"));
    });
  });

  if (navigateFn === undefined) {
    referrerRC.navigateTo(prerenderedRC.url);
  } else {
    referrerRC.navigate(navigateFn, [prerenderedRC.url]);
  }

  // Wait until that event fires. If the activation fails and a normal
  // navigation happens instead, then prerenderedRC will start pointing to that
  // other page, where window.activatedPromise is undefined. In that case this
  // assert will fail since undefined !== "activated".
  assert_equals(
    await prerenderedRC.executeScript(() => window.activatedPromise),
    "activated",
    "The prerendered page must be activated; instead a normal navigation happened."
  );
}

async function getActivationStart(prerenderedRC) {
  return await prerenderedRC.executeScript(() => {
    const entry = performance.getEntriesByType("navigation")[0];
    return entry.activationStart;
  });;
}

// Used by the opened window, to tell the main test runner to terminate a
// failed test.
function failTest(reason, uid) {
  const bc = new PrerenderChannel('test-channel', uid);
  bc.postMessage({result: 'FAILED', reason});
  bc.close();
}


text:
package com.clover_studio.spikachatmodule;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;

import com.clover_studio.spikachatmodule.adapters.UsersInChatRecyclerViewAdapter;
import com.clover_studio.spikachatmodule.base.BaseActivity;
import com.clover_studio.spikachatmodule.base.SingletonLikeApp;
import com.clover_studio.spikachatmodule.dialogs.NotifyDialog;
import com.clover_studio.spikachatmodule.models.GetUserModel;
import com.clover_studio.spikachatmodule.models.User;
import com.clover_studio.spikachatmodule.api.retrofit.CustomResponse;
import com.clover_studio.spikachatmodule.api.retrofit.SpikaOSRetroApiInterface;
import com.clover_studio.spikachatmodule.utils.Const;

import java.util.ArrayList;

import retrofit2.Call;
import retrofit2.Response;

public class UsersInChatActivity extends BaseActivity {

    private String roomId;
    RecyclerView rvMain;

    public static void starUsersInChatActivity(Context context, String roomId){
        Intent intent = new Intent(context, UsersInChatActivity.class);
        intent.putExtra(Const.Extras.ROOM_ID, roomId);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_users_in_chat);

        setToolbar(R.id.tToolbar, R.layout.custom_users_in_chat_toolbar);
        setMenuLikeBack();

        rvMain = (RecyclerView) findViewById(R.id.rvMain);
        rvMain.setLayoutManager(new LinearLayoutManager(this));
        rvMain.setAdapter(new UsersInChatRecyclerViewAdapter(new ArrayList<User>()));

        //check for user
        if(!getIntent().hasExtra(Const.Extras.ROOM_ID)){
            noRoomIdDialog();
            return;
        }else{
            roomId = getIntent().getStringExtra(Const.Extras.ROOM_ID);
            if(TextUtils.isEmpty(roomId)){
                noRoomIdDialog();
                return;
            }
        }

        getUsers(roomId);

    }

    /**
     * get users from room
     * @param roomId id of room
     */
    private void getUsers(String roomId) {
        handleProgress(true);
        SpikaOSRetroApiInterface retroApiInterface = getRetrofit().create(SpikaOSRetroApiInterface.class);
        Call<GetUserModel> call = retroApiInterface.getUsersInRoom(roomId, SingletonLikeApp.getInstance().getSharedPreferences(getActivity()).getToken());
        call.enqueue(new CustomResponse<GetUserModel>(getActivity(), true, true) {

            @Override
            public void onCustomSuccess(Call<GetUserModel> call, Response<GetUserModel> response) {
                super.onCustomSuccess(call, response);
                ((UsersInChatRecyclerViewAdapter) rvMain.getAdapter()).setData(response.body().data);
            }

        });

    }

    protected void noRoomIdDialog(){
        NotifyDialog dialog = NotifyDialog.startInfo(this, getString(R.string.room_error_title), getString(R.string.room_error_not_sent));
        dialog.setOneButtonListener(new NotifyDialog.OneButtonDialogListener() {
            @Override
            public void onOkClicked(NotifyDialog dialog) {
                dialog.dismiss();
                finish();
            }
        });
    }

}


text:
package cloudwatch

import (
    "github.com/fromkeith/awsgo"
    "errors"
    "fmt"
)

type CreateLogStreamRequest struct {
    awsgo.RequestBuilder

    LogGroupName            string          `json:"logGroupName"`
    LogStreamName           string          `json:"logStreamName"`
}

type CreateLogStreamResponse struct {

}

func NewCreateLogStreamRequest() *CreateLogStreamRequest {
    req := new(CreateLogStreamRequest)
    req.Host.Service = "logs"
    req.Host.Region = "us-east-1"
    req.Host.Domain = "amazonaws.com"
    req.Headers = make(map[string]string)
    req.Headers["X-Amz-Target"] = "Logs_20140328.CreateLogStream"
    req.Headers["Content-Type"] = "application/x-amz-json-1.1"
    req.RequestMethod = "POST"
    req.CanonicalUri = "/"
    return req
}

func (req * CreateLogStreamRequest) VerifyInput() (error) {
    if len(req.LogGroupName) == 0 || len(req.LogGroupName) > 512 {
        return errors.New("Bad LogGroupName")
    }
    if len(req.LogStreamName) == 0 || len(req.LogStreamName) > 512 {
        return errors.New("Bad LogStreamName")
    }
    // TODO: regex to check LogGroupName
    return nil
}

func (req CreateLogStreamRequest) DeMarshalResponse(response []byte, headers map[string]string, statusCode int) (interface{}) {
    if err := CheckForErrorResponse(response, statusCode); err != nil {
        return err
    }
    if statusCode != 200 {
        return errors.New(fmt.Sprintf("Bad Status code: %d", statusCode))
    }
    return new(CreateLogStreamResponse)
}

func (req CreateLogStreamRequest) Request() (*CreateLogStreamResponse, error) {
    request, err := awsgo.NewAwsRequest(&req, req)
    if err != nil {
        return nil, err
    }
    request.RequestSigningType = awsgo.RequestSigningType_AWS4
    resp, err := request.DoAndDemarshall(&req)
    if resp == nil {
        return nil, err
    }
    return resp.(*CreateLogStreamResponse), err
}


text:
package org.apache.hadoop.yarn.server.resourcemanager;

import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.test.GenericTestUtils;
import org.apache.hadoop.yarn.conf.YarnConfiguration;

/**
 * Test Utils for NodeAttribute.
 */
public final class NodeAttributeTestUtils {

  private NodeAttributeTestUtils() {

  }

  public static YarnConfiguration getRandomDirConf(Configuration conf)
      throws IOException {
    YarnConfiguration newConf;
    if (conf == null) {
      newConf = new YarnConfiguration();
    } else {
      newConf = new YarnConfiguration(conf);
    }
    File tempDir = GenericTestUtils.getRandomizedTestDir();
    FileUtils.deleteDirectory(tempDir);
    tempDir.mkdirs();
    tempDir.deleteOnExit();
    newConf.set(YarnConfiguration.FS_NODE_ATTRIBUTE_STORE_ROOT_DIR,
        tempDir.getAbsolutePath());
    return newConf;
  }

}


text:
/* */
module.exports = require('./modern/index');


text:
<!DOCTYPE html>

    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Class: Concurrent::Actor::Behaviour::Linking

    — Concurrent Ruby

</title>

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

  <link rel="stylesheet" href="../../../css/common.css" type="text/css" />

    Index (L) »
    Concurrent » Actor » Behaviour
     »
    Linking

        <svg width="24" height="24">
          <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
        </svg>

Class: Concurrent::Actor::Behaviour::Linking

Inherits:

      Abstract

Object

Abstract

Concurrent::Actor::Behaviour::Linking

        show all

Defined in:

lib/concurrent-ruby-edge/concurrent/actor/behaviour/linking.rb

Overview

Links the actor to other actors and sends actor's events to them,
like: :terminated, :paused, :resumed, errors, etc.
Linked actor needs to handle those messages.

listener = AdHoc.spawn name: :listener do
  lambda do |message|
    case message
    when Reference
      if message.ask!(:linked?)
        message << :unlink
      else
        message << :link
      end
    else
      puts "got event #{message.inspect} from #{envelope.sender}"
    end
  end
end

an_actor = AdHoc.spawn name: :an_actor, supervise: true, behaviour_definition: Behaviour.restarting_behaviour_definition do
  lambda { |message| raise 'failed'}
end

# link the actor
listener.ask(an_actor).wait
an_actor.ask(:fail).wait
# unlink the actor
listener.ask(an_actor).wait
an_actor.ask(:fail).wait
an_actor << :terminate!

produces only two events, other events happened after unlinking

got event #<RuntimeError: failed> from #<Concurrent::Actor::Reference /an_actor (Concurrent::Actor::Utils::AdHoc)>
got event :reset from #<Concurrent::Actor::Reference /an_actor (Concurrent::Actor::Utils::AdHoc)>

      Instance Method Summary
      collapse

      #initialize(core, subsequent, core_options)  ⇒ Linking

    constructor

A new instance of Linking.

      #link(ref)  ⇒ undocumented

      #on_envelope(envelope)  ⇒ undocumented

      #on_event(public, event)  ⇒ undocumented

      #unlink(ref)  ⇒ undocumented

Constructor Details

    #initialize(core, subsequent, core_options)  ⇒ <tt>Linking</tt>

Returns a new instance of Linking.

43
44
45
46
47

# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/linking.rb', line 43

def initialize(core, subsequent, core_options)
  super core, subsequent, core_options
  @linked = Set.new
  @linked.add Actor.current if core_options[:link] != false
end

Instance Method Details

    #link(ref)  ⇒ <tt>undocumented</tt>

64
65
66
67

# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/linking.rb', line 64

def link(ref)
  @linked.add(ref)
  true
end

    #on_envelope(envelope)  ⇒ <tt>undocumented</tt>

49
50
51
52
53
54
55
56
57
58
59
60
61
62

# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/linking.rb', line 49

def on_envelope(envelope)
  case envelope.message
  when :link
    link envelope.sender
  when :unlink
    unlink envelope.sender
  when :linked?
    @linked.include? envelope.sender
  when :linked
    @linked.to_a
  else
    pass envelope
  end
end

    #on_event(public, event)  ⇒ <tt>undocumented</tt>

74
75
76
77
78
79

# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/linking.rb', line 74

def on_event(public, event)
  event_name, _ = event
  @linked.each { |a| a << event } if public
  @linked.clear if event_name == :terminated
  super public, event
end

    #unlink(ref)  ⇒ <tt>undocumented</tt>

69
70
71
72

# File 'lib/concurrent-ruby-edge/concurrent/actor/behaviour/linking.rb', line 69

def unlink(ref)
  @linked.delete(ref)
  true
end

  Generated by yard.


text:
"use strict";
var core_1 = require('@angular/core');
var SidenavComponent = (function () {
    function SidenavComponent() {
    }
    SidenavComponent = __decorate([
        core_1.Component({
            templateUrl: 'app/javascript/side-nav/side-nav.component.html'
        }),
        __metadata('design:paramtypes', [])
    ], SidenavComponent);
    return SidenavComponent;
}());
exports.SidenavComponent = SidenavComponent;
//# sourceMappingURL=side-nav.component.js.map


text:
package ru.stqa.pft.addressbook.tests;

import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;

import java.util.Arrays;
import java.util.stream.Collectors;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;

public class ContactPhoneTest extends TestBase {

    @Test
    public void testContactPhones(){
        app.contact().homePage();
        ContactData contact = app.contact().all().iterator().next();
        ContactData contactInfoFromEditForm  = app.contact().infoFromEditForm(contact);
        assertThat(contact.getAllPhones(), equalTo(mergePhones(contactInfoFromEditForm)));
    }

    private String mergePhones(ContactData contact) {
        return Arrays.asList(contact.getHome(), contact.getMobile(), contact.getWork())
                .stream().filter((s) -> ! s.equals(""))
                .map(ContactPhoneTest::cleaned)
                .collect(Collectors.joining("\n"));
    }

    public static String cleaned(String phone) {
        return phone.replaceAll("\\s", "").replaceAll("[-()]", "");
    }
}


text:
/*
 * (C) 2007-2012 Alibaba Group Holding Limited.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * Authors:
 *   wuhua <wq163@163.com> , boyan <killme2008@gmail.com>
 */
package com.taobao.metamorphosis.tools.shell;

import java.io.PrintStream;
import java.io.PrintWriter;

import javax.management.ObjectInstance;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionGroup;
import org.apache.commons.cli.Options;

import com.taobao.metamorphosis.tools.utils.CommandLineUtils;
import com.taobao.metamorphosis.tools.utils.JMXClient;

/**
 * <pre>
 * usage:
 *      TimetunnelPluginTool -start
 *      TimetunnelPluginTool -stop
 *      TimetunnelPluginTool -look
 * @author ÎÞ»¨
 * @since 2011-11-1 ÏÂÎç3:07:22
 * </pre>
 */

public class TimetunnelPluginTool extends ShellTool {
    final static private String TT_NAME = "com.taobao.metamorphosis.timetunnel:type=TimetunnelMessageListener,*";

    public TimetunnelPluginTool(PrintStream out) {
        super(out);
    }

    public TimetunnelPluginTool(PrintWriter writer) {
        super(writer);
    }

    public static void main(String[] args) throws Exception {
        new TimetunnelPluginTool(System.out).doMain(args);
    }

    @Override
    public void doMain(String[] args) throws Exception {
        CommandLine commandLine = this.getCommandLine(args);
        String host = commandLine.getOptionValue("host", "127.0.0.1");
        int port = Integer.parseInt(commandLine.getOptionValue("port", "9999"));
        JMXClient jmxClient = JMXClient.getJMXClient(host, port);
        this.println("connected to " + jmxClient.getAddressAsString());
        ObjectInstance ttInstance = jmxClient.queryMBeanForOne(TT_NAME);
        if (ttInstance == null) {
            this.println("ûÓÐÕÒµ½ " + TT_NAME);
            return;
        }
        if (commandLine.hasOption("start")) {
            jmxClient.invoke(ttInstance.getObjectName(), "startSub", new Object[0], new String[0]);
            this.println("invoke " + ttInstance.getClassName() + "#startSub success");
        }
        else if (commandLine.hasOption("stop")) {
            jmxClient.invoke(ttInstance.getObjectName(), "stopSub", new Object[0], new String[0]);
            this.println("invoke " + ttInstance.getClassName() + "#stopSub success");
        }
        else if (commandLine.hasOption("look")) {
            String ret = (String) jmxClient.getAttribute(ttInstance.getObjectName(), "SubStatus");
            this.println(ret);
        }
        else {
            this.println("unknown option");
        }

        jmxClient.close();
    }

    private CommandLine getCommandLine(String[] args) {
        Option startOption = new Option("start", false, "start");
        Option stopOption = new Option("stop", false, "stop");
        Option lookOption = new Option("look", false, "look status");
        OptionGroup group = new OptionGroup();
        group.addOption(startOption).addOption(stopOption).addOption(lookOption);

        return CommandLineUtils.parseCmdLine(args, new Options().addOptionGroup(group).addOption("host", true, "host")
            .addOption("port", true, "port"));
    }
}


text:
/*
  Write a program that prompts the user to enter the number of students and
  each student's name and score, and finally displays the name of the student
  with the highest score.
*/

import java.util.Scanner;

public class E5_08 {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);
    System.out.print("Enter the number of students: ");
    int numOfStudents = input.nextInt();

    String bestStudentName = "";
    double bestStudentScore = -1.0;
    for (int i = 0; i < numOfStudents; i++) {
      System.out.print("Enter student name: ");
      String name = input.next();
      System.out.print("Enter score: ");
      double score = input.nextDouble();
      if (score > bestStudentScore) {
        bestStudentName = name;
        bestStudentScore = score;
      }
    }

    System.out.println(bestStudentName);
  }
}


text:
function asyncAdd(a, b, __ASYNC) {
    return callback(a + b);
}
function asyncExample(__ASYNC) {
    console.log(__AWAIT(asyncAdd(1, 2)) + __AWAIT(asyncAdd(3, 4)));
}


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:id="@android:id/text1"
          android:layout_width="match_parent"
          android:layout_height="48dp"
          android:gravity="center"
          android:textColor="@color/white"
          tools:textColor="@color/black"
          tools:text="DEVELOP"
          android:textAllCaps="true"
          android:paddingLeft="16dp"
          android:paddingStart="16dp"
          android:paddingRight="16dp"
          android:paddingEnd="16dp"
    />


text:
<editor>
    <help>https://docs.cloudbees.com/docs/cloudbees-cd/latest/plugins/ec-ec2#API_CreateVPC</help>
    <formElement>
        <type>entry</type>
        Configuration:

        <configuration>1</configuration>

        <property>config</property>
        <required>1</required>
        <documentation>The name of the config which holds all the connection information. This must reference a valid existing configuration.</documentation>
    </formElement>
    <formElement>
        <type>entry</type>
        VPC Name:
        <property>vpcName</property>
        <value/>
        <required>0</required>
        <documentation>Name to be given to VPC.</documentation>
    </formElement>
    <formElement>
        <type>entry</type>
        CIDR Block:
        <property>cidrBlock</property>
        <value/>
        <required>1</required>
        <documentation>The range of IPs to use for your VPC, in CIDR format, for example,10.0.0.0/24.Block size must be between a /16 netmask and /28 netmask.</documentation>
    </formElement>
    <formElement>
        <type>entry</type>
        Results Location:
        <property>propResult</property>
        <required>0</required>
        <documentation>Where to put the result. If not specified, the result is only printed.</documentation>
    </formElement>
</editor>


text:
package couk.doridori.android.lib.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.widget.Button;

/**
 * Class to work around the annoying queuing of multiple taps for Buttons. Could have a time attribute.
 *
 * This is useful as sometimes (on some platform / device combos) you can quickly tap on a button and end up
 * starting an activity more than one. The reuests seem to be queued before the action has taken place so
 * solutions like disabling the buttons or setting singleTop do not seem to work :(
 *
 * @author dori
 */
public class SafeButton extends Button {
    public SafeButton(Context context) {
        super(context);
    }

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

    public SafeButton(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    public void setOnClickListener(OnClickListener l) {
        super.setOnClickListener(new OnClickListenerWrapper(l));
    }

    private class OnClickListenerWrapper implements OnClickListener{

        private static final long DEFAULT_MIN_INTERVAL = 1500;
        private long mLastClickTime = 0;
        private final OnClickListener mListener;

        public OnClickListenerWrapper(OnClickListener listener){
            mListener = listener;
        }

        @Override
        public void onClick(View v) {
            long currentTime = AnimationUtils.currentAnimationTimeMillis();
            if(currentTime - mLastClickTime > DEFAULT_MIN_INTERVAL){
                mListener.onClick(v);
                mLastClickTime = currentTime;
            }
        }
    }
}


text:
include("${CMAKE_SOURCE_DIR}/common.cmake")

# 版本号
set(MAJOR_VERSION 0)
set(MINOR_VERSION 1)

# 目录
set(GNET_DIR_3RD "${CMAKE_SOURCE_DIR}/3rd")
set(GNET_DIR_PROTO "${CMAKE_SOURCE_DIR}/proto")
set(GNET_DIR_SRC "${CMAKE_SOURCE_DIR}/src")
set(GNET_DIR_GW "${CMAKE_SOURCE_DIR}/gw")

# 包含头文件
set(GNET_DIR_3RD_INCLUDE "${GNET_DIR_3RD}/include")
include_directories(
    ${CMAKE_SOURCE_DIR}
    ${GNET_DIR_3RD_INCLUDE}
)

# 链接(gbase依赖curl和openssl, 需要时再加)
set(GNET_LIB_LINK "${COMMON_LINK_LIN}" protobuf)
link_directories("${GNET_DIR_3RD}/lib")

# 发布目录
string(TIMESTAMP TS "%y%m%d")
set(GNET_DIR_RELEASE "${CMAKE_SOURCE_DIR}/release-${MAJOR_VERSION}.${MINOR_VERSION}.${TS}")

# 编译选项
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11")

# 转换protocol
execute_process(
    COMMAND sh gen.sh
    WORKING_DIRECTORY ${GNET_DIR_PROTO}
)
message("gnet proto protoc convert complete.")

# 编译lib
aux_source_directory(${GNET_DIR_PROTO} GNET_LIB_SOURCE)
aux_source_directory(${GNET_DIR_SRC} GNET_LIB_SOURCE)
foreach(GNET_LIB_SOURCE_FILE ${GNET_LIB_SOURCE})
    CommonEcho(COLOR CYAN "===> lib source: ${GNET_LIB_SOURCE_FILE}")
endforeach()
add_library(gnet ${GNET_LIB_SOURCE})

# 安装到发布目录(todo)
install(
    DIRECTORY ${GNET_DIR_PROTO}
    DESTINATION "${GNET_DIR_RELEASE}"
    USE_SOURCE_PERMISSIONS
    FILES_MATCHING PATTERN "*.conf"
)
install(
    TARGETS gnet
    DESTINATION "${GNET_DIR_RELEASE}/lib"
)


text:
import shapes = require('../appTypes/shapes');
export declare class Action {
    actionName: string;
    payload: shapes.IActionPayload;
    private handlers;
    private isExecuting;
    private isCompleted;
    private storeInstances;
    constructor(actionName: string, payload: shapes.IActionPayload);
    private getStore(storeName);
    /**
     * Calls an individual store's handler function
     * @method callHandler
     * @param {String} storeName
     * @private
     * @throws {Error} if handler does not exist for storeName
     */
    private callHandler(storeName);
    setStoreInstances(stores: shapes.IStoreInstanceMap): void;
    /**
     * Executes all handlers for the action
     * @method execute
     * @param {Function[]} handlers A mapping of store names to handler function
     * @throws {Error} if action has already been executed
     */
    execute(handlers: shapes.IDispatcherMap): void;
    /**
     * Waits until all stores have finished handling an action and then calls
     * the callback
     * @method waitFor
     * @param {String|String[]|Constructor|Constructor[]} stores An array of stores as strings or constructors to wait for
     * @param {Function} callback Called after all stores have completed handling their actions
     * @throws {Error} if the action is not being executed
     */
    waitFor(stores: string | string[], callback: Function): void;
}


text:
"use strict";

var chalk = require('chalk'),
  q = require('q');

var utils = {};

utils.printTask = function(task) {
  if (!task) {
    return;
  }

  var message = 'Current task: "' + chalk.green(task.description) + '"';

  if (task.paused) {
    message += chalk.red(' paused');
  }

  console.log(message);
};

/**
 * Calculate the duration of the task.
 *
 * @return {hours: <hours>, minutes: <minutes>}
 */
utils.calculateDuration = function(task) {
  var milliseconds = 0;

  task.times.every(function(time) {
    if (!time.end) {
      milliseconds = -1;

      return false;
    }

    milliseconds += time.end.getTime() - time.start.getTime();

    return true;
  });

  if (milliseconds === -1) {
    return 'Still running...';
  }

  var overallMinutes = Math.round(milliseconds / 1000 / 60);
  var minutes = overallMinutes % 60;
  var hours = (overallMinutes - minutes) / 60;

  return {
    hours: hours,
    minutes: minutes,
    toString: function() {
      return this.hours + ' h ' + this.minutes + ' min';
    }
  };
};

utils.defer = function(resolve) {
  var deferred = q.defer();

  if (resolve) {
    deferred.resolve();
  } else {
    deferred.reject();
  }

  return deferred.promise;
};

module.exports = utils;


text:
module Requestable
  extend ActiveSupport::Concern
  include Stateable

  included do
    extend Enumerize
    # extend ActiveModel::Naming

    enumerize :state,
              in: [:opened, :reviewed, :approved, :accepted],
              default: :opened,
              scope: true
  end

  def can_approve?
    state.reviewed?
  end

  def approve
    update(state: :approved) if can_approve?
  end

  def can_accept?
    state.approved?
  end

  def accept
    update(state: :accepted) if can_accept?
  end
end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>expressage</title>

        <input type="text" id="orderId">
        <input type="button" value="查询" id="searchBtn">


text:
.class final Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;
.super Ljava/lang/Object;
.source "AppCompatPopupWindow.java"

# interfaces
.implements Landroid/view/ViewTreeObserver$OnScrollChangedListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/support/v7/internal/widget/AppCompatPopupWindow;->wrapOnScrollChangedListener(Landroid/widget/PopupWindow;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

# instance fields
.field final synthetic val$fieldAnchor:Ljava/lang/reflect/Field;

.field final synthetic val$originalListener:Landroid/view/ViewTreeObserver$OnScrollChangedListener;

.field final synthetic val$popup:Landroid/widget/PopupWindow;

# direct methods
.method constructor <init>(Ljava/lang/reflect/Field;Landroid/widget/PopupWindow;Landroid/view/ViewTreeObserver$OnScrollChangedListener;)V
    .locals 0

    .prologue
    .line 100
    iput-object p1, p0, Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;->val$fieldAnchor:Ljava/lang/reflect/Field;

    iput-object p2, p0, Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;->val$popup:Landroid/widget/PopupWindow;

    iput-object p3, p0, Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;->val$originalListener:Landroid/view/ViewTreeObserver$OnScrollChangedListener;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onScrollChanged()V
    .locals 3

    .prologue
    .line 104
    :try_start_0
    iget-object v1, p0, Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;->val$fieldAnchor:Ljava/lang/reflect/Field;

    iget-object v2, p0, Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;->val$popup:Landroid/widget/PopupWindow;

    invoke-virtual {v1, v2}, Ljava/lang/reflect/Field;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/ref/WeakReference;

    .line 105
    .local v0, "mAnchor":Ljava/lang/ref/WeakReference;, "Ljava/lang/ref/WeakReference<Landroid/view/View;>;"
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    if-nez v1, :cond_1

    .line 113
    .end local v0    # "mAnchor":Ljava/lang/ref/WeakReference;, "Ljava/lang/ref/WeakReference<Landroid/view/View;>;"
    :cond_0
    :goto_0
    return-void

    .line 108
    .restart local v0    # "mAnchor":Ljava/lang/ref/WeakReference;, "Ljava/lang/ref/WeakReference<Landroid/view/View;>;"
    :cond_1
    iget-object v1, p0, Landroid/support/v7/internal/widget/AppCompatPopupWindow$1;->val$originalListener:Landroid/view/ViewTreeObserver$OnScrollChangedListener;

    invoke-interface {v1}, Landroid/view/ViewTreeObserver$OnScrollChangedListener;->onScrollChanged()V
    :try_end_0
    .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 110
    .end local v0    # "mAnchor":Ljava/lang/ref/WeakReference;, "Ljava/lang/ref/WeakReference<Landroid/view/View;>;"
    :catch_0
    move-exception v1

    goto :goto_0
.end method


text:
@interface ToastMessage : NSObject
+(void)setBottomOffsetPortrait:(float)offset; // default is 90
+(void)show:(NSString *)str;
+(void)show:(NSString *)str window:(UIWindow *)window;
+(void)showWithSound:(NSString *)str;

@end


text:
package org.eclipse.php.ui;

import java.io.IOException;

import org.eclipse.dltk.ast.Modifiers;
import org.eclipse.dltk.core.*;
import org.eclipse.dltk.internal.core.util.MethodOverrideTester;
import org.eclipse.dltk.ui.DLTKPluginImages;
import org.eclipse.dltk.ui.ScriptElementImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
import org.eclipse.php.core.ast.nodes.IMethodBinding;
import org.eclipse.php.core.compiler.PHPFlags;
import org.eclipse.php.internal.ui.PHPUiPlugin;
import org.eclipse.php.internal.ui.corext.util.SuperTypeHierarchyCache;
import org.eclipse.php.internal.ui.util.ImageDescriptorRegistry;
import org.eclipse.php.internal.ui.util.ImageImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;

/**
 * LabelDecorator that decorates an method's image with override or implements
 * overlays. The viewer using this decorator is responsible for updating the
 * images on element changes.
 *
 *

 * This class may be instantiated; it is not intended to be subclassed.
 *

 *
 * @since 2.0
 *
 * @noextend This class is not intended to be subclassed by clients.
 */
public class OverrideIndicatorLabelDecorator implements ILabelDecorator, ILightweightLabelDecorator {

	private ImageDescriptorRegistry fRegistry;
	private boolean fUseNewRegistry = false;

	/**
	 * Creates a decorator. The decorator creates an own image registry to cache
	 * images.
	 */
	public OverrideIndicatorLabelDecorator() {
		this(null);
		fUseNewRegistry = true;
	}

	/*
	 * Creates decorator with a shared image registry.
	 *
	 * @param registry The registry to use or null to use the Java
	 * plugin's image registry.
	 */
	/**
	 * Note: This constructor is for internal use only. Clients should not call
	 * this constructor.
	 *
	 * @param registry
	 *            The registry to use.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	public OverrideIndicatorLabelDecorator(ImageDescriptorRegistry registry) {
		fRegistry = registry;
	}

	private ImageDescriptorRegistry getRegistry() {
		if (fRegistry == null) {
			fRegistry = fUseNewRegistry ? new ImageDescriptorRegistry() : PHPUiPlugin.getImageDescriptorRegistry();
		}
		return fRegistry;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see ILabelDecorator#decorateText(String, Object)
	 */
	@Override
	public String decorateText(String text, Object element) {
		return text;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see ILabelDecorator#decorateImage(Image, Object)
	 */
	@Override
	public Image decorateImage(Image image, Object element) {
		if (image == null)
			return null;

		int adornmentFlags = computeAdornmentFlags(element);
		if (adornmentFlags != 0) {
			ImageDescriptor baseImage = new ImageImageDescriptor(image);
			Rectangle bounds = image.getBounds();
			return getRegistry().get(new ScriptElementImageDescriptor(baseImage, adornmentFlags,
					new Point(bounds.width, bounds.height)));
		}
		return image;
	}

	/**
	 * Note: This method is for internal use only. Clients should not call this
	 * method.
	 *
	 * @param element
	 *            The element to decorate
	 * @return Resulting decorations (combination of
	 *         JavaElementImageDescriptor.IMPLEMENTS and
	 *         JavaElementImageDescriptor.OVERRIDES)
	 *
	 * @noreference This method is not intended to be referenced by clients.
	 */
	public int computeAdornmentFlags(Object element) {
		if (element instanceof IMethod) {
			try {
				IMethod method = (IMethod) element;
				if (method.getParent().getElementType() != IModelElement.TYPE) {
					return 0;
				}
				if (!method.getScriptProject().isOnBuildpath(method)) {
					return 0;
				}

				if (!shouldCompute((IType) method.getParent())) {
					return 0;
				}

				if (!shouldCompute(method)) {
					return 0;
				}

				return getOverrideIndicators(method);
			} catch (ModelException e) {
				if (!e.isDoesNotExist()) {
					PHPUiPlugin.log(e);
				}
			} catch (IOException e) {
				PHPUiPlugin.log(e);
			}
		}
		return 0;
	}

	private boolean shouldCompute(IType parent) throws ModelException {
		return !PHPFlags.isInterface(parent.getFlags()) && parent.getSuperClasses() != null
				&& parent.getSuperClasses().length != 0;
	}

	private boolean shouldCompute(IMethod method) throws ModelException {
		int flags = method.getFlags();
		return !method.isConstructor() && !Flags.isPrivate(flags) && !Flags.isStatic(flags);
	}

	/**
	 * Note: This method is for internal use only. Clients should not call this
	 * method.
	 *
	 * @param method
	 *            The element to decorate
	 * @return Resulting decorations (combination of
	 *         ScriptElementImageDescriptor.IMPLEMENTS and
	 *         ScriptElementImageDescriptor.OVERRIDES)
	 * @throws ModelException
	 * @throws IOException
	 *
	 * @noreference This method is not intended to be referenced by clients.
	 */
	protected int getOverrideIndicators(IMethod method) throws ModelException, IOException {
		IType type = method.getDeclaringType();
		if (type != null) {
			MethodOverrideTester methodOverrideTester = SuperTypeHierarchyCache.getMethodOverrideTester(type);
			IMethod defining = methodOverrideTester.findOverriddenMethod(method, true);
			if (defining != null) {
				if (isAbstract(defining)) {
					return ScriptElementImageDescriptor.IMPLEMENTS;
				} else {
					return ScriptElementImageDescriptor.OVERRIDES;
				}
			}
		}
		return 0;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * org.eclipse.jface.viewers.ILightweightLabelDecorator#decorate(java.lang
	 * .Object, org.eclipse.jface.viewers.IDecoration)
	 */
	@Override
	public void decorate(Object element, IDecoration decoration) {
		int adornmentFlags = computeAdornmentFlags(element);
		if ((adornmentFlags & ScriptElementImageDescriptor.IMPLEMENTS) != 0) {

			decoration.addOverlay(DLTKPluginImages.DESC_OVR_IMPLEMENTS);
		} else if ((adornmentFlags & ScriptElementImageDescriptor.OVERRIDES) != 0) {

			decoration.addOverlay(DLTKPluginImages.DESC_OVR_OVERRIDES);
		}
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see IBaseLabelProvider#addListener(ILabelProviderListener)
	 */
	@Override
	public void addListener(ILabelProviderListener listener) {
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see IBaseLabelProvider#dispose()
	 */
	@Override
	public void dispose() {
		if (fRegistry != null && fUseNewRegistry) {
			fRegistry.dispose();
		}
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see IBaseLabelProvider#isLabelProperty(Object, String)
	 */
	@Override
	public boolean isLabelProperty(Object element, String property) {
		return true;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see IBaseLabelProvider#removeListener(ILabelProviderListener)
	 */
	@Override
	public void removeListener(ILabelProviderListener listener) {
	}

	private static boolean isAbstract(IMember member) throws ModelException {
		return Flags.isAbstract(member.getFlags());
	}

	private static boolean isAbstract(IMethodBinding member) {
		return isAbstract(member.getModifiers());
	}

	private static boolean isAbstract(int mod) {
		return (mod & Modifiers.AccAbstract) != 0;
	}

}


text:
import nsmemcached

from distutils.core import setup

setup(
    name='NSMemcached',
    version=nsmemcached.__version__,
    description='A simple implementation of a namespaced memcached client',
    author='Nicolas Perriault',
    author_email='np@akei.com',
    url='https://github.com/n1k0/NSMemcached',
    packages=['nsmemcached', ],
    requires=['python_memcached (>=1.47, <2.0)', ],
    license='MIT',
    long_description=open('README.rst').read(),
)


text:
FROM ubuntu:12.04
MAINTAINER Julien Graziano <julien.graziano@arobas-music.com>
# Install dependencies
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server
# Configure SSH service
ENV NOTVISIBLE "in users profile"
ENV PASSWORD="supercalifragilisticexpialidocious"
RUN echo "export VISIBLE=now" >> /etc/profile
RUN echo "session optional pam_loginuid.so" >> /etc/pam.d/sshd
RUN echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config
RUN mkdir /var/run/sshd
# Configure container
COPY sshd /usr/local/bin/
EXPOSE 22
CMD ["sshd"]


text:
package org.eclipse.collections.impl.map.immutable.primitive;

import org.eclipse.collections.impl.test.Verify;
import org.junit.Test;

public class ImmutableLongFloatEmptyMapSerializationTest
{
    @Test
    public void serializedForm()
    {
        Verify.assertSerializedForm(
                1L,
                "rO0ABXNyAE9vcmcuZWNsaXBzZS5jb2xsZWN0aW9ucy5pbXBsLm1hcC5pbW11dGFibGUucHJpbWl0\n"
                        + "aXZlLkltbXV0YWJsZUxvbmdGbG9hdEVtcHR5TWFwAAAAAAAAAAECAAB4cA==",
                new ImmutableLongFloatEmptyMap());
    }
}