text:
"""Recurrent neural network modules.

THe RNNCell modules can be scanned using lifted transforms. For more information
see: https://flax.readthedocs.io/en/latest/advanced_topics/lift.html.
"""

import abc
from functools import partial   # pylint: disable=g-importing-member
from typing import Any, Callable, Mapping, Optional, Sequence, Tuple, Union

from flax.linen.activation import sigmoid
from flax.linen.activation import tanh
from flax.linen.dtypes import promote_dtype
from flax.linen.initializers import orthogonal
from flax.linen.initializers import zeros
from flax.linen.linear import Conv
from flax.linen.linear import default_kernel_init
from flax.linen.linear import Dense
from flax.linen.linear import PrecisionLike
from flax.linen.module import compact
from flax.linen.module import Module
from jax import numpy as jnp
from jax import random
import numpy as np

PRNGKey = Any
Shape = Tuple[int, ...]
Dtype = Any  # this could be a real type?
Array = Any

class RNNCellBase(Module):
  """RNN cell base class."""

  @staticmethod
  def initialize_carry(rng, batch_dims, size, init_fn=zeros):
    """Initialize the RNN cell carry.

    Args:
      rng: random number generator passed to the init_fn.
      batch_dims: a tuple providing the shape of the batch dimensions.
      size: the size or number of features of the memory.
      init_fn: initializer function for the carry.
    Returns:
      An initialized carry for the given RNN cell.
    """
    raise NotImplementedError

class LSTMCell(RNNCellBase):
  r"""LSTM cell.

  The mathematical definition of the cell is as follows

  .. math::
      \begin{array}{ll}
      i = \sigma(W_{ii} x + W_{hi} h + b_{hi}) \\
      f = \sigma(W_{if} x + W_{hf} h + b_{hf}) \\
      g = \tanh(W_{ig} x + W_{hg} h + b_{hg}) \\
      o = \sigma(W_{io} x + W_{ho} h + b_{ho}) \\
      c' = f * c + i * g \\
      h' = o * \tanh(c') \\
      \end{array}

  where x is the input, h is the output of the previous time step, and c is
  the memory.

  Attributes:
    gate_fn: activation function used for gates (default: sigmoid)
    activation_fn: activation function used for output and memory update
      (default: tanh).
    kernel_init: initializer function for the kernels that transform
      the input (default: lecun_normal).
    recurrent_kernel_init: initializer function for the kernels that transform
      the hidden state (default: orthogonal).
    bias_init: initializer for the bias parameters (default: zeros)
    dtype: the dtype of the computation (default: infer from inputs and params).
    param_dtype: the dtype passed to parameter initializers (default: float32).
  """
  gate_fn: Callable[..., Any] = sigmoid
  activation_fn: Callable[..., Any] = tanh
  kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = default_kernel_init
  recurrent_kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = orthogonal()
  bias_init: Callable[[PRNGKey, Shape, Dtype], Array] = zeros
  dtype: Optional[Dtype] = None
  param_dtype: Dtype = jnp.float32

  @compact
  def __call__(self, carry, inputs):
    r"""A long short-term memory (LSTM) cell.

    Args:
      carry: the hidden state of the LSTM cell,
        initialized using `LSTMCell.initialize_carry`.
      inputs: an ndarray with the input for the current time step.
        All dimensions except the final are considered batch dimensions.

    Returns:
      A tuple with the new carry and the output.
    """
    c, h = carry
    hidden_features = h.shape[-1]
    # input and recurrent layers are summed so only one needs a bias.
    dense_h = partial(Dense,
                      features=hidden_features,
                      use_bias=True,
                      kernel_init=self.recurrent_kernel_init,
                      bias_init=self.bias_init,
                      dtype=self.dtype,
                      param_dtype=self.param_dtype)
    dense_i = partial(Dense,
                      features=hidden_features,
                      use_bias=False,
                      kernel_init=self.kernel_init,
                      dtype=self.dtype,
                      param_dtype=self.param_dtype)
    i = self.gate_fn(dense_i(name='ii')(inputs) + dense_h(name='hi')(h))
    f = self.gate_fn(dense_i(name='if')(inputs) + dense_h(name='hf')(h))
    g = self.activation_fn(dense_i(name='ig')(inputs) + dense_h(name='hg')(h))
    o = self.gate_fn(dense_i(name='io')(inputs) + dense_h(name='ho')(h))
    new_c = f * c + i * g
    new_h = o * self.activation_fn(new_c)
    return (new_c, new_h), new_h

  @staticmethod
  def initialize_carry(rng, batch_dims, size, init_fn=zeros):
    """Initialize the RNN cell carry.

    Args:
      rng: random number generator passed to the init_fn.
      batch_dims: a tuple providing the shape of the batch dimensions.
      size: the size or number of features of the memory.
      init_fn: initializer function for the carry.
    Returns:
      An initialized carry for the given RNN cell.
    """
    key1, key2 = random.split(rng)
    mem_shape = batch_dims + (size,)
    return init_fn(key1, mem_shape), init_fn(key2, mem_shape)

class DenseParams(Module):
  """Dummy module for creating parameters matching `flax.linen.Dense`."""

  features: int
  use_bias: bool = True
  param_dtype: Dtype = jnp.float32
  precision: PrecisionLike = None
  kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = default_kernel_init
  bias_init: Callable[[PRNGKey, Shape, Dtype], Array] = zeros

  @compact
  def __call__(self, inputs: Array) -> Tuple[Array, Array]:
    k = self.param(
        'kernel', self.kernel_init, (inputs.shape[-1], self.features),
        self.param_dtype)
    if self.use_bias:
      b = self.param('bias', self.bias_init, (self.features,), self.param_dtype)
    else:
      b = None
    return k, b

class OptimizedLSTMCell(RNNCellBase):
  r"""More efficient LSTM Cell that concatenates state components before matmul.

  The parameters are compatible with `LSTMCell`. Note that this cell is often
  faster than `LSTMCell` as long as the hidden size is roughly <= 2048 units.

  The mathematical definition of the cell is the same as `LSTMCell` and as
  follows

  .. math::

      \begin{array}{ll}
      i = \sigma(W_{ii} x + W_{hi} h + b_{hi}) \\
      f = \sigma(W_{if} x + W_{hf} h + b_{hf}) \\
      g = \tanh(W_{ig} x + W_{hg} h + b_{hg}) \\
      o = \sigma(W_{io} x + W_{ho} h + b_{ho}) \\
      c' = f * c + i * g \\
      h' = o * \tanh(c') \\
      \end{array}

  where x is the input, h is the output of the previous time step, and c is
  the memory.

  Attributes:
    gate_fn: activation function used for gates (default: sigmoid).
    activation_fn: activation function used for output and memory update
      (default: tanh).
    kernel_init: initializer function for the kernels that transform
      the input (default: lecun_normal).
    recurrent_kernel_init: initializer function for the kernels that transform
      the hidden state (default: orthogonal).
    bias_init: initializer for the bias parameters (default: zeros).
    dtype: the dtype of the computation (default: infer from inputs and params).
    param_dtype: the dtype passed to parameter initializers (default: float32).
  """
  gate_fn: Callable[..., Any] = sigmoid
  activation_fn: Callable[..., Any] = tanh
  kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = default_kernel_init
  recurrent_kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = orthogonal()
  bias_init: Callable[[PRNGKey, Shape, Dtype], Array] = zeros
  dtype: Optional[Dtype] = None
  param_dtype: Dtype = jnp.float32

  @compact
  def __call__(self, carry: Tuple[Array, Array],
               inputs: Array) -> Tuple[Tuple[Array, Array], Array]:
    r"""An optimized long short-term memory (LSTM) cell.

    Args:
      carry: the hidden state of the LSTM cell, initialized using
        `LSTMCell.initialize_carry`.
      inputs: an ndarray with the input for the current time step. All
        dimensions except the final are considered batch dimensions.

    Returns:
      A tuple with the new carry and the output.
    """
    c, h = carry
    hidden_features = h.shape[-1]

    def _concat_dense(inputs: Array,
                      params: Mapping[str, Tuple[Array, Array]],
                      use_bias: bool = True) -> Array:
      # Concatenates the individual kernels and biases, given in params, into a
      # single kernel and single bias for efficiency before applying them using
      # dot_general.
      kernels, biases = zip(*params.values())
      kernel = jnp.concatenate(kernels, axis=-1)
      if use_bias:
        bias = jnp.concatenate(biases, axis=-1)
      else:
        bias = None
      inputs, kernel, bias = promote_dtype(inputs, kernel, bias, dtype=self.dtype)
      y = jnp.dot(inputs, kernel)
      if use_bias:
        y += jnp.reshape(bias, (1,) * (y.ndim - 1) + (-1,))

      # Split the result back into individual (i, f, g, o) outputs.
      split_indices = np.cumsum([kernel.shape[-1] for kernel in kernels[:-1]])
      ys = jnp.split(y, split_indices, axis=-1)
      return dict(zip(params.keys(), ys))

    # Create params with the same names/shapes as `LSTMCell` for compatibility.
    dense_params_h = {}
    dense_params_i = {}
    for component in ['i', 'f', 'g', 'o']:
      dense_params_i[component] = DenseParams(
          features=hidden_features, use_bias=False,
          param_dtype=self.param_dtype,
          kernel_init=self.kernel_init, bias_init=self.bias_init,
          name=f'i{component}')(inputs)
      dense_params_h[component] = DenseParams(
          features=hidden_features, use_bias=True,
          param_dtype=self.param_dtype,
          kernel_init=self.recurrent_kernel_init, bias_init=self.bias_init,
          name=f'h{component}')(h)
    dense_h = _concat_dense(h, dense_params_h, use_bias=True)
    dense_i = _concat_dense(inputs, dense_params_i, use_bias=False)

    i = self.gate_fn(dense_h['i'] + dense_i['i'])
    f = self.gate_fn(dense_h['f'] + dense_i['f'])
    g = self.activation_fn(dense_h['g'] + dense_i['g'])
    o = self.gate_fn(dense_h['o'] + dense_i['o'])

    new_c = f * c + i * g
    new_h = o * self.activation_fn(new_c)
    return (new_c, new_h), new_h

  @staticmethod
  def initialize_carry(rng, batch_dims, size, init_fn=zeros):
    """Initialize the RNN cell carry.

    Args:
      rng: random number generator passed to the init_fn.
      batch_dims: a tuple providing the shape of the batch dimensions.
      size: the size or number of features of the memory.
      init_fn: initializer function for the carry.

    Returns:
      An initialized carry for the given RNN cell.
    """
    key1, key2 = random.split(rng)
    mem_shape = batch_dims + (size,)
    return init_fn(key1, mem_shape), init_fn(key2, mem_shape)

class GRUCell(RNNCellBase):
  r"""GRU cell.

  The mathematical definition of the cell is as follows

  .. math::

      \begin{array}{ll}
      r = \sigma(W_{ir} x + W_{hr} h + b_{hr}) \\
      z = \sigma(W_{iz} x + W_{hz} h + b_{hz}) \\
      n = \tanh(W_{in} x + b_{in} + r * (W_{hn} h + b_{hn})) \\
      h' = (1 - z) * n + z * h \\
      \end{array}

  where x is the input and h, is the output of the previous time step.

  Attributes:
    gate_fn: activation function used for gates (default: sigmoid)
    activation_fn: activation function used for output and memory update
      (default: tanh).
    kernel_init: initializer function for the kernels that transform
      the input (default: lecun_normal).
    recurrent_kernel_init: initializer function for the kernels that transform
      the hidden state (default: orthogonal).
    bias_init: initializer for the bias parameters (default: zeros)
    dtype: the dtype of the computation (default: None).
    param_dtype: the dtype passed to parameter initializers (default: float32).
  """
  gate_fn: Callable[..., Any] = sigmoid
  activation_fn: Callable[..., Any] = tanh
  kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = (
      default_kernel_init)
  recurrent_kernel_init: Callable[[PRNGKey, Shape, Dtype], Array] = (
      orthogonal())
  bias_init: Callable[[PRNGKey, Shape, Dtype], Array] = zeros
  dtype: Optional[Dtype] = None
  param_dtype: Dtype = jnp.float32

  @compact
  def __call__(self, carry, inputs):
    """Gated recurrent unit (GRU) cell.

    Args:
      carry: the hidden state of the LSTM cell,
        initialized using `GRUCell.initialize_carry`.
      inputs: an ndarray with the input for the current time step.
        All dimensions except the final are considered batch dimensions.

    Returns:
      A tuple with the new carry and the output.
    """
    h = carry
    hidden_features = h.shape[-1]
    # input and recurrent layers are summed so only one needs a bias.
    dense_h = partial(Dense,
                      features=hidden_features,
                      use_bias=False,
                      dtype=self.dtype,
                      param_dtype=self.param_dtype,
                      kernel_init=self.recurrent_kernel_init,
                      bias_init=self.bias_init)
    dense_i = partial(Dense,
                      features=hidden_features,
                      use_bias=True,
                      dtype=self.dtype,
                      param_dtype=self.param_dtype,
                      kernel_init=self.kernel_init,
                      bias_init=self.bias_init)
    r = self.gate_fn(dense_i(name='ir')(inputs) + dense_h(name='hr')(h))
    z = self.gate_fn(dense_i(name='iz')(inputs) + dense_h(name='hz')(h))
    # add bias because the linear transformations aren't directly summed.
    n = self.activation_fn(dense_i(name='in')(inputs) +
                           r * dense_h(name='hn', use_bias=True)(h))
    new_h = (1. - z) * n + z * h
    return new_h, new_h

  @staticmethod
  def initialize_carry(rng, batch_dims, size, init_fn=zeros):
    """Initialize the RNN cell carry.

    Args:
      rng: random number generator passed to the init_fn.
      batch_dims: a tuple providing the shape of the batch dimensions.
      size: the size or number of features of the memory.
      init_fn: initializer function for the carry.
    Returns:
      An initialized carry for the given RNN cell.
    """
    mem_shape = batch_dims + (size,)
    return init_fn(rng, mem_shape)

class ConvLSTM(RNNCellBase):
  r"""A convolutional LSTM cell.

  The implementation is based on xingjian2015convolutional.
  Given x_t and the previous state (h_{t-1}, c_{t-1})
  the core computes

  .. math::

     \begin{array}{ll}
     i_t = \sigma(W_{ii} * x_t + W_{hi} * h_{t-1} + b_i) \\
     f_t = \sigma(W_{if} * x_t + W_{hf} * h_{t-1} + b_f) \\
     g_t = \tanh(W_{ig} * x_t + W_{hg} * h_{t-1} + b_g) \\
     o_t = \sigma(W_{io} * x_t + W_{ho} * h_{t-1} + b_o) \\
     c_t = f_t c_{t-1} + i_t g_t \\
     h_t = o_t \tanh(c_t)
     \end{array}

  where * denotes the convolution operator;
  i_t, f_t, o_t are input, forget and output gate activations,
  and g_t is a vector of cell updates.

  Notes:
    Forget gate initialization:
      Following jozefowicz2015empirical we add 1.0 to b_f
      after initialization in order to reduce the scale of forgetting in
      the beginning of the training.

  Attributes:
    features: number of convolution filters.
    kernel_size: shape of the convolutional kernel.
    strides: a sequence of `n` integers, representing the inter-window
      strides.
    padding: either the string `'SAME'`, the string `'VALID'`, or a sequence
      of `n` `(low, high)` integer pairs that give the padding to apply before
      and after each spatial dimension.
    bias: whether to add a bias to the output (default: True).
    dtype: the dtype of the computation (default: None).
    param_dtype: the dtype passed to parameter initializers (default: float32).
  """

  features: int
  kernel_size: Sequence[int]
  strides: Optional[Sequence[int]] = None
  padding: Union[str, Sequence[Tuple[int, int]]] = 'SAME'
  use_bias: bool = True
  dtype: Optional[Dtype] = None
  param_dtype: Dtype = jnp.float32

  @compact
  def __call__(self, carry, inputs):
    """Constructs a convolutional LSTM.

    Args:
      carry: the hidden state of the Conv2DLSTM cell,
        initialized using `Conv2DLSTM.initialize_carry`.
      inputs: input data with dimensions (batch, spatial_dims..., features).
    Returns:
      A tuple with the new carry and the output.
    """
    c, h = carry
    input_to_hidden = partial(Conv,
                              features=4*self.features,
                              kernel_size=self.kernel_size,
                              strides=self.strides,
                              padding=self.padding,
                              use_bias=self.use_bias,
                              dtype=self.dtype,
                              param_dtype=self.param_dtype,
                              name='ih')

    hidden_to_hidden = partial(Conv,
                               features=4*self.features,
                               kernel_size=self.kernel_size,
                               strides=self.strides,
                               padding=self.padding,
                               use_bias=self.use_bias,
                               dtype=self.dtype,
                               param_dtype=self.param_dtype,
                               name='hh')

    gates = input_to_hidden()(inputs) + hidden_to_hidden()(h)
    i, g, f, o = jnp.split(gates, indices_or_sections=4, axis=-1)

    f = sigmoid(f + 1)
    new_c = f * c + sigmoid(i) * jnp.tanh(g)
    new_h = sigmoid(o) * jnp.tanh(new_c)
    return (new_c, new_h), new_h

  @staticmethod
  def initialize_carry(rng, batch_dims, size, init_fn=zeros):
    """Initialize the RNN cell carry.

    Args:
      rng: random number generator passed to the init_fn.
      batch_dims: a tuple providing the shape of the batch dimensions.
      size: the input_shape + (features,).
      init_fn: initializer function for the carry.
    Returns:
      An initialized carry for the given RNN cell.
    """
    key1, key2 = random.split(rng)
    mem_shape = batch_dims + size
    return init_fn(key1, mem_shape), init_fn(key2, mem_shape)


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

<title>Uses of Class javax.crypto.SealedObject (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev

Next

Frames

No Frames

All Classes

Uses of Class
javax.crypto.SealedObject

Packages that use SealedObject

Package
Description

javax.crypto

Provides the classes and interfaces for cryptographic operations.

Uses of SealedObject in javax.crypto

Constructors in javax.crypto with parameters of type SealedObject

Constructor and Description

SealedObject(SealedObject so)

Constructs a SealedObject object from the passed-in SealedObject.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.

redpajama_set_name: RedPajamaGithub


text:
/* This file is automatically generated by ./make_class.pl, do not edit */
{ "gaussian", &grib_iterator_class_gaussian, },
{ "gaussian_reduced", &grib_iterator_class_gaussian_reduced, },
{ "gen", &grib_iterator_class_gen, },
{ "lambert_azimuthal_equal_area", &grib_iterator_class_lambert_azimuthal_equal_area, },
{ "lambert_conformal", &grib_iterator_class_lambert_conformal, },
{ "latlon", &grib_iterator_class_latlon, },
{ "latlon_reduced", &grib_iterator_class_latlon_reduced, },
{ "polar_stereographic", &grib_iterator_class_polar_stereographic, },
{ "regular", &grib_iterator_class_regular, },


text:
.class public Lcom/android/internal/app/ProcessMap;
.super Ljava/lang/Object;
.source "ProcessMap.java"

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<E:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;"
    }
.end annotation

# instance fields
.field final mMap:Landroid/util/ArrayMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/ArrayMap",
            "<",
            "Ljava/lang/String;",
            "Landroid/util/SparseArray",
            "<TE;>;>;"
        }
    .end annotation
.end field

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

    .prologue
    .line 22
    .local p0, "this":Lcom/android/internal/app/ProcessMap;, "Lcom/android/internal/app/ProcessMap<TE;>;"
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 23
    new-instance v0, Landroid/util/ArrayMap;

    invoke-direct {v0}, Landroid/util/ArrayMap;-><init>()V

    iput-object v0, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    return-void
.end method

# virtual methods
.method public get(Ljava/lang/String;I)Ljava/lang/Object;
    .locals 2
    .param p1, "name"    # Ljava/lang/String;
    .param p2, "uid"    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "I)TE;"
        }
    .end annotation

    .prologue
    .line 27
    .local p0, "this":Lcom/android/internal/app/ProcessMap;, "Lcom/android/internal/app/ProcessMap<TE;>;"
    iget-object v1, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    invoke-virtual {v1, p1}, Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/util/SparseArray;

    .line 28
    .local v0, "uids":Landroid/util/SparseArray;, "Landroid/util/SparseArray<TE;>;"
    if-nez v0, :cond_0

    const/4 v1, 0x0

    .line 29
    :goto_0
    return-object v1

    :cond_0
    invoke-virtual {v0, p2}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;

    move-result-object v1

    goto :goto_0
.end method

.method public getMap()Landroid/util/ArrayMap;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Landroid/util/ArrayMap",
            "<",
            "Ljava/lang/String;",
            "Landroid/util/SparseArray",
            "<TE;>;>;"
        }
    .end annotation

    .prologue
    .line 53
    .local p0, "this":Lcom/android/internal/app/ProcessMap;, "Lcom/android/internal/app/ProcessMap<TE;>;"
    iget-object v0, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    return-object v0
.end method

.method public put(Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/Object;
    .locals 2
    .param p1, "name"    # Ljava/lang/String;
    .param p2, "uid"    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "ITE;)TE;"
        }
    .end annotation

    .prologue
    .line 33
    .local p0, "this":Lcom/android/internal/app/ProcessMap;, "Lcom/android/internal/app/ProcessMap<TE;>;"
    .local p3, "value":Ljava/lang/Object;, "TE;"
    iget-object v1, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    invoke-virtual {v1, p1}, Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/util/SparseArray;

    .line 34
    .local v0, "uids":Landroid/util/SparseArray;, "Landroid/util/SparseArray<TE;>;"
    if-nez v0, :cond_0

    .line 35
    new-instance v0, Landroid/util/SparseArray;

    .end local v0    # "uids":Landroid/util/SparseArray;, "Landroid/util/SparseArray<TE;>;"
    const/4 v1, 0x2

    invoke-direct {v0, v1}, Landroid/util/SparseArray;-><init>(I)V

    .line 36
    .restart local v0    # "uids":Landroid/util/SparseArray;, "Landroid/util/SparseArray<TE;>;"
    iget-object v1, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    invoke-virtual {v1, p1, v0}, Landroid/util/ArrayMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 38
    :cond_0
    invoke-virtual {v0, p2, p3}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V

    .line 39
    return-object p3
.end method

.method public remove(Ljava/lang/String;I)V
    .locals 2
    .param p1, "name"    # Ljava/lang/String;
    .param p2, "uid"    # I

    .prologue
    .line 43
    .local p0, "this":Lcom/android/internal/app/ProcessMap;, "Lcom/android/internal/app/ProcessMap<TE;>;"
    iget-object v1, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    invoke-virtual {v1, p1}, Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/util/SparseArray;

    .line 44
    .local v0, "uids":Landroid/util/SparseArray;, "Landroid/util/SparseArray<TE;>;"
    if-eqz v0, :cond_0

    .line 45
    invoke-virtual {v0, p2}, Landroid/util/SparseArray;->remove(I)V

    .line 46
    invoke-virtual {v0}, Landroid/util/SparseArray;->size()I

    move-result v1

    if-nez v1, :cond_0

    .line 47
    iget-object v1, p0, Lcom/android/internal/app/ProcessMap;->mMap:Landroid/util/ArrayMap;

    invoke-virtual {v1, p1}, Landroid/util/ArrayMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 50
    :cond_0
    return-void
.end method


text:
from django.db import models
from django_markdown.models import MarkdownField
from .managers import EntryManager, SpeakerManager, SponsorManager
from .enum import LEVEL_CHOICES
from .enum import BRONZE

class Entry(models.Model):
    title = models.CharField(max_length=200)
    body = MarkdownField()
    slug = models.SlugField(max_length=200, unique=True)
    publish = models.BooleanField(default=False)
    created = models.DateTimeField(auto_now_add=True)
    modified = models.DateTimeField(auto_now=True)
    objects = EntryManager()

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = "New"
        verbose_name_plural = "News"
        ordering = ["-created"]

class Speakers(models.Model):
    name = models.CharField(max_length=200)
    ocupation = models.CharField(max_length=200)
    subject = models.CharField(max_length=200)
    picture = models.ImageField(upload_to='speakers')
    objects = SpeakerManager()

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = "Speaker"
        verbose_name_plural = "Speakers"

    def go(self):
        return self.name.lower()

class Sponsors(models.Model):
    brand = models.CharField(max_length=200)
    level = models.IntegerField(choices=LEVEL_CHOICES, default=BRONZE)
    picture = models.ImageField(upload_to='sponsors')
    objects = SponsorManager()

    def __str__(self):
        return self.brand

    class Meta:
        verbose_name = 'Sponsor'
        verbose_name_plural = 'Sponsors'
        ordering = ['level']


text:
require 'spec_helper'

describe PrivatePlease::MethodsCallsTracker do
  describe '.instance' do
    it 'is idempotent' do
      PrivatePlease.instance.should be
      PrivatePlease.instance.should eq(PrivatePlease.instance)
    end
  end

  describe '.init' do
    it 'resets the instance' do
      i1 = PrivatePlease.instance
      PrivatePlease.reset
      PrivatePlease.instance.should be
      PrivatePlease.instance.should_not eq(i1)
    end
  end
end


text:
ace.define('ace/snippets/stylus', ['require', 'exports', 'module' ], function(require, exports, module) {

exports.snippetText = "";
exports.scope = "stylus";

});


text:
<?php

namespace PRO4\ProjectBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Project
 *
 * @ORM\Table(name="project")
 * @ORM\Entity
 */
class Project
{
    /**
     * @var integer
     *
     * @ORM\Column(name="project_id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $projectId;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=40, nullable=false)
     *
     * @Assert\NotBlank()
     * @Assert\Length(min = "3", max = "40")
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text", nullable=false)
     *
     * @Assert\NotBlank()
     * @Assert\Length(min = "20")
     */
    private $description;

    /**
     * @var boolean
     *
     * @ORM\Column(name="completed", type="boolean", nullable=false)
     */
    private $completed;

    /**
     * @ORM\ManyToMany(targetEntity="\PRO4\UserBundle\Entity\User", inversedBy="projects")
     * @ORM\JoinTable(name="user_in_project",
     *      joinColumns={@ORM\JoinColumn(name="project_id", referencedColumnName="project_id")},
     *      inverseJoinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="user_id")}
     *      )
     * @ORM\OrderBy({"eMail" = "ASC"})
     */
     private $users;

    /**
     *
     * @ORM\OneToMany(targetEntity="PRO4\ProjectBundle\Entity\Department", mappedBy="project", cascade={"persist"})
     * @ORM\OrderBy({"name" = "ASC"})
     *
     **/
     private $departments;

	public function __construct() {
		$this->completed = false;
		$this->users = new ArrayCollection();
		$this->departments = new ArrayCollection();
	}

	public function getId() {
		return $this->getProjectId();
	}

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

    /**
     * Set name
     *
     * @param string $name
     * @return Project
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

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

    /**
     * Set description
     *
     * @param string $description
     * @return Project
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

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

    /**
     * Set completed
     *
     * @param boolean $completed
     * @return Project
     */
    public function setCompleted($completed)
    {
        $this->completed = $completed;

        return $this;
    }

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

    /**
     * Add users
     *
     * @param \PRO4\UserBundle\Entity\User $users
     * @return Project
     */
    public function addUser(\PRO4\UserBundle\Entity\User $user)
    {
    	if(!$this->users->contains($user)) {
    		$user->addProject($this);
        	$this->users[] = $user;
    	}

        return $this;
    }

    /**
     * Remove users
     *
     * @param \PRO4\UserBundle\Entity\User $users
     */
    public function removeUser(\PRO4\UserBundle\Entity\User $user)
    {
    	$user->removeProject($this);
        $this->users->removeElement($user);
    }

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

    /**
     * Add department
     *
     * @param \PRO4\ProjectBundle\Entity\Department $department
     * @return Project
     */
    public function addDepartment(\PRO4\ProjectBundle\Entity\Department $department)
    {
        $this->departments[] = $department;
        $department->setProject($this);

        return $this;
    }

    /**
     * Remove department
     *
     * @param \PRO4\ProjectBundle\Entity\Department $department
     */
    public function removeDepartment(\PRO4\ProjectBundle\Entity\Department $department)
    {
        $this->departments->removeElement($department);
        $department->setProject(null);
    }

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


text:
module Image
  # Class for image
  class Image
    attr_accessor :path, :suffix, :width, :height
    def initialize path, suffix, width, height
      @path, @suffix, @width, @height = path, suffix, width, height
    end
  end
end


text:
namespace gfx {
class Insets;
class Path;
class Point;
class Rect;
class Size;
}

namespace views {
class ImageButton;
class Label;
class Throbber;
class Widget;
}

namespace chromeos {

// BubbleFrameView implements a BubbleBorder based window frame.
class BubbleFrameView : public views::NonClientFrameView,
                        public views::ButtonListener {
 public:
  BubbleFrameView(views::WidgetDelegate* widget_delegate,
                  DialogStyle style);
  virtual ~BubbleFrameView();

  // Overridden from views::NonClientFrameView:
  virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
  virtual gfx::Rect GetWindowBoundsForClientBounds(
      const gfx::Rect& client_bounds) const OVERRIDE;
  virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
  virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask)
      OVERRIDE;
  virtual void ResetWindowControls() OVERRIDE;
  virtual void UpdateWindowIcon() OVERRIDE;

  // View overrides:
  virtual gfx::Insets GetInsets() const OVERRIDE;
  virtual gfx::Size GetPreferredSize() OVERRIDE;
  virtual void Layout() OVERRIDE;
  virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;

  // Overridden from views::ButtonListener:
  virtual void ButtonPressed(views::Button* sender, const views::Event& event)
      OVERRIDE;

  void StartThrobber();
  void StopThrobber();

 private:
  // Allows to tweak appearance of the view.
  DialogStyle style_;

  // Title label
  views::Label* title_;

  // The bounds of the client view, in this view's coordinates.
  gfx::Rect client_view_bounds_;

  // Close button for STYLE_XBAR case.
  views::ImageButton* close_button_;

  // Throbber is optional. Employed by STYLE_THROBBER.
  views::Throbber* throbber_;

  DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_


text:
Spedi is a speculative disassembler for the variable-size Thumb ISA.
Given an ELF file as input, Spedi can:

  - Recover correct assembly instructions.
  - Recover targets of switch jumps tables.
  - Identify functions in the binary and their call graph.

Spedi works directly on the binary without using symbol information. We found Spedi
to outperform IDA Pro in our experiments.

# Idea

Spedi recovers all possible Basic Blocks (BBs) available in the binary. BBs that
 share the same jump instruction are grouped in one Maximal Block (MB). Then, MBs
 are refined  using overlap and CFG conflict analysis.
 Details can be found in our CASES'16 paper "*Speculative disassembly of binary code*".
 The paper is available [here].

# Result summary

Spedi (almost) perfectly recovers assembly instructions from our benchmarks binaries
with 99.96% average. In comparison, IDA Pro has an average of 95.83% skewed by the
relative poor performance on *sha* benchmark.

Spedi precisely recovers 97.46% of functions on average. That is, it identifies
the correct start address and end address. Compare that to 40.53% average achieved by IDA Pro.

A nice property of our technique is that it's also fast and scales well with increased
benchmark size. For example, spedi disassembles *du* (50K instructions) in about 150 ms.
Note that there is good room for further optimizations.

# Citing

To cite Spedi in an academic work please use:

```
@inproceedings{BenKhadraSK2016,
 author = {Ben Khadra, M. Ammar and Stoffel, Dominik and Kunz, Wolfgang},
 title = {Speculative Disassembly of Binary Code},
 booktitle = {Proceedings of the International Conference on Compilers, Architectures and Synthesis for Embedded Systems},
 year = {2016},
 location = {Pittsburgh, Pennsylvania},
 articleno = {16},
 doi = {10.1145/2968455.2968505},
 acmid = {2968505},
 publisher = {ACM},
}
```
# Usage
Build the project and try it on one of the binaries in our benchmark suite
 available in this [repository].

The following command will instruct `spedi` to speculatively disassemble
 the `.text` section,

```sh
$ ./spedi -t -s -f $FILE > speculative.inst
```

Use the following command to disassemble the `.text` section
based on ARM code mapping symbols which provides the ground truth about correct instructions,

```sh
$ ./spedi -t -f $FILE > correct.inst
```
The easiest way to compare both outputs is by using,

```sh
$ diff -y correct.inst speculative.inst |less
```

Currently, you need to manually modify `main.cpp` to show results related to
 switch table and call-graph recovery.

# Road map

This tool is an academic proof-of-concept. Currently, it's not on our priority list.
However, there are certain features that we have in mind for the future, namely:

  - **Mixed-mode ARM/Thumb disassembly**. The general idea of speculative disassembly
  provides the framework to do this.
  Basically, one needs to speculatively disassemble a code region
  twice. One time in Thumb mode, and a second time in ARM mode. Later, mode
  switching instructions (mainly `bx` and `blx`) should be analyzed. This [paper]
  provides some related details.
  - **Support for x86/x64**. Thumb and similar RISC-like ISA have limited variability.
  Basically, instructions can either be 2 or 4 bytes width. We need to push the
  challenge even further by supporting x86/x64. To this end, overlap analysis might
  span more than two MB which complicates things. Current Maximal Block data structure
  is not efficient to do this.
  - **Refactorings**. The code is tightly coupled with our ELF reader. Also, it is
  specific to Thumb ISA. We need to make it more modular to support other ISAs and binary formats.
  - **ELF Reader**: Our ELF reader is based on [libelfin]. We inherit some memory
  leakage issues. Additionally, the reader might crash on binaries with DWARF
  debug info. These issues needs to be addressed either in upstream or directly here.

# Related work

Recently, Andriesse et. al. have been working on `Nucleus`, a tool for function
identification in x64 binaries. Their paper "*Compiler-Agnostic Function Detection in Binaries*"
was accepted at IEEE Euro S&P 2017. They use more or less the same function identification
techniques implemented in Spedi. If you are interested in x64 support, you can
have a look at their [tool].

Note, however, that their tool is based on the assumption that recent x64
compilers allocate jump-table data in `.rodata` section.
That makes instruction recovery significantly easier since it can be done reliably with
linear sweep. In comparison, Spedi handles the more general case of mixed code/data
using speculative disassembly.

# Dependencies

This project depends on [Capstone] disassembly library (v3.0.4).

  [here]: <http://dx.doi.org/10.1145/2968455.2968505>
  [Capstone]: <https://github.com/aquynh/capstone>
  [repository]: <https://github.com/abenkhadra/cases16-benchmarks>
  [paper]: <http://dl.acm.org/citation.cfm?id=2555748>
  [libelfin]: <https://github.com/aclements/libelfin>
  [tool]: <https://bitbucket.org/vusec/nucleus>


text:
#include "diskio.h"
#include "interface.h"
#include "lib.h"

typedef struct diskio {
	EFI_DISK_IO interface;
	media_t *media;
} diskio_t;

static EFI_STATUS read_block(media_t *media, EFI_LBA lba,
			     unsigned char **block)
{
	EFI_LBA count;

	*block = malloc(media->m.BlockSize);
	if (!*block)
		return EFI_OUT_OF_RESOURCES;

	count = media->storage->read(media->storage, lba, 1, *block);
	if (count != 1) {
		free(*block);
		return EFI_DEVICE_ERROR;
	}

	return EFI_SUCCESS;
}

static EFIAPI EFI_STATUS
diskio_read(EFI_DISK_IO *This,
	    UINT32 MediaId,
	    UINT64 Offset,
	    UINTN BufferSize,
	    VOID *Buffer)
{
	EFI_STATUS ret;
	diskio_t *diskio = (diskio_t *)This;
	UINT32 count, size;
	UINT32 blksz;
 	unsigned char *buf = Buffer, *block;
	media_t *media;

	if (!This || !Buffer)
		return EFI_INVALID_PARAMETER;

	if (!diskio->media)
		return EFI_INVALID_PARAMETER;
	media = diskio->media;

	if (media->m.MediaId != MediaId)
		return EFI_MEDIA_CHANGED;

	blksz = media->m.BlockSize;
	if (!blksz)
		return EFI_INVALID_PARAMETER;

	if (Offset % blksz) {
		ret = read_block(media, Offset / blksz, &block);
		if (EFI_ERROR(ret))
			return ret;

		size = min(blksz - (Offset % blksz), BufferSize);
		memcpy(buf, block + (Offset % blksz), size);
		free(block);

		buf += size;
		Offset += size;
		BufferSize -= size;
	}

	size = BufferSize / blksz;
	if (size > 0) {
		count = media->storage->read(media->storage, Offset / blksz, size, buf);
		if (count != size)
			return EFI_DEVICE_ERROR;
		size *= blksz;
		BufferSize -= size;
		Offset += size;
		buf += size;
	}
	if (BufferSize) {
		ret = read_block(media, Offset / blksz, &block);
		if (EFI_ERROR(ret))
			return ret;
		memcpy(buf, block, BufferSize);
		free(block);
	}

	return EFI_SUCCESS;
}

static EFIAPI EFI_STATUS
diskio_write(EFI_DISK_IO *This,
	     UINT32 MediaId,
	     UINT64 Offset,
	     UINTN BufferSize,
	     VOID *Buffer)
{
	EFI_STATUS ret;
	diskio_t *diskio = (diskio_t *)This;
	UINT32 count, size;
	UINT32 blksz;
	unsigned char *buf = Buffer, *block;
	media_t *media;

	if (!This || !Buffer)
		return EFI_INVALID_PARAMETER;

	if (!diskio->media)
		return EFI_INVALID_PARAMETER;
	media = diskio->media;

	if (media->m.MediaId != MediaId)
		return EFI_MEDIA_CHANGED;

	blksz = media->m.BlockSize;
	if (!blksz)
		return EFI_INVALID_PARAMETER;

	if (Offset % blksz) {
		ret = read_block(media, Offset / blksz, &block);
		if (EFI_ERROR(ret))
			return ret;

		size = min(blksz - (Offset % blksz), BufferSize);
		memcpy(block + (Offset % blksz), buf, size);

		count = media->storage->write(media->storage, Offset / blksz, 1, block);
		free(block);
		if (count != 1)
			return EFI_DEVICE_ERROR;

		buf += size;
		Offset += size;
		BufferSize -= size;
	}

	size = BufferSize / blksz;
	if (size > 0) {
		count = media->storage->write(media->storage, Offset / blksz, size, buf);
		if (count != size)
			return EFI_DEVICE_ERROR;

		size *= blksz;
		BufferSize -= size;
		Offset += size;
		buf += size;
	}
	if (BufferSize) {
		ret = read_block(media, Offset / blksz, &block);
		if (EFI_ERROR(ret))
			return ret;

		memcpy(block, buf, BufferSize);
		count = media->storage->write(media->storage, Offset / blksz, 1, block);
		free(block);
		if (count != 1)
			return EFI_DEVICE_ERROR;
	}

	return EFI_SUCCESS;
}

static EFI_GUID diskio_guid = DISK_IO_PROTOCOL;

EFI_STATUS diskio_init(EFI_SYSTEM_TABLE *st, media_t *media,
		       EFI_HANDLE *handle)
{
	static diskio_t diskio_default = {
		.interface = {
			.Revision = EFI_DISK_IO_INTERFACE_REVISION,
			.ReadDisk = diskio_read,
			.WriteDisk = diskio_write
		}
	};
	EFI_STATUS ret;
	diskio_t *diskio;

	ret = interface_init(st, &diskio_guid, handle,
			     &diskio_default, sizeof(diskio_default),
			     (void **)&diskio);
	if (EFI_ERROR(ret))
		return ret;

	diskio->media = media;

	return EFI_SUCCESS;
}

EFI_STATUS diskio_free(EFI_SYSTEM_TABLE *st, EFI_HANDLE handle)
{
	return interface_free(st, &diskio_guid, handle);
}


text:
@implementation ReportPointButton

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setImage:[UIImage imageNamed:@"pro_in_construction"] forState:UIControlStateNormal];
        [self setImage:[UIImage imageNamed:@"pro_complete"] forState:UIControlStateSelected];
    }
    return self;
}

- (void)setHighlighted:(BOOL)highlighted {}

@end


text:
using System;
using System.Threading.Tasks;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.DataConverters3D;
using MatterHackers.Localizations;
using MatterHackers.MatterControl.ConfigurationPage.PrintLeveling;
using MatterHackers.MatterControl.DesignTools;
using MatterHackers.MatterControl.Library;
using MatterHackers.MatterControl.PartPreviewWindow;
using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.MatterControl.SlicerConfiguration;
using MatterHackers.VectorMath;
using static MatterHackers.MatterControl.ConfigurationPage.PrintLeveling.XyCalibrationWizard;

namespace MatterHackers.MatterControl
{
	public class XyCalibrationSelectPage : WizardPage
	{
		private readonly RadioButton coarseCalibration;
		private readonly RadioButton normalCalibration;
		private readonly RadioButton fineCalibration;
		private PartViewMode preCalibrationPrintViewMode;

		public XyCalibrationSelectPage(XyCalibrationWizard calibrationWizard)
			: base(calibrationWizard)
		{
			this.WindowTitle = "Nozzle Offset Calibration Wizard".Localize();
			this.HeaderText = "Calibration Print".Localize();

			preCalibrationPrintViewMode = printer.ViewState.ViewMode;

			contentRow.Padding = theme.DefaultContainerPadding;

			// default to normal offset
			calibrationWizard.Offset = printer.Settings.GetValue<double>(SettingsKey.nozzle_diameter) / 3.0;

			contentRow.AddChild(
				new TextWidget(
					"This wizard will close to print a calibration part and resume after the print completes.".Localize(),
					textColor: theme.TextColor,
					pointSize: theme.DefaultFontSize)
				{
					Margin = new BorderDouble(bottom: theme.DefaultContainerPadding)
				});

			contentRow.AddChild(
				new TextWidget(
					"Calibration Mode".Localize(),
					textColor: theme.TextColor,
					pointSize: theme.DefaultFontSize)
				{
					Margin = new BorderDouble(0, theme.DefaultContainerPadding)
				});

			var column = new FlowLayoutWidget(FlowDirection.TopToBottom)
			{
				Margin = new BorderDouble(left: theme.DefaultContainerPadding),
				HAnchor = HAnchor.Stretch,
			};
			contentRow.AddChild(column);

			var coarseText = calibrationWizard.Quality == QualityType.Coarse ? "Initial (Recommended)".Localize() : "Coarse".Localize();
			column.AddChild(coarseCalibration = new RadioButton(coarseText, textColor: theme.TextColor, fontSize: theme.DefaultFontSize)
			{
				Checked = calibrationWizard.Quality == QualityType.Coarse
			});
			coarseCalibration.CheckedStateChanged += (s, e) =>
			{
				calibrationWizard.Quality = QualityType.Coarse;
				calibrationWizard.Offset = printer.Settings.GetValue<double>(SettingsKey.nozzle_diameter);
			};

			var normalText = calibrationWizard.Quality == QualityType.Normal ? "Normal (Recommended)".Localize() : "Normal".Localize();
			column.AddChild(normalCalibration = new RadioButton(normalText, textColor: theme.TextColor, fontSize: theme.DefaultFontSize)
			{
				Checked = calibrationWizard.Quality == QualityType.Normal
			});
			normalCalibration.CheckedStateChanged += (s, e) =>
			{
				calibrationWizard.Quality = QualityType.Normal;
				calibrationWizard.Offset = printer.Settings.GetValue<double>(SettingsKey.nozzle_diameter) / 3.0;
			};

			column.AddChild(fineCalibration = new RadioButton("Fine".Localize(), textColor: theme.TextColor, fontSize: theme.DefaultFontSize)
			{
				Checked = calibrationWizard.Quality == QualityType.Fine
			});
			fineCalibration.CheckedStateChanged += (s, e) =>
			{
				calibrationWizard.Quality = QualityType.Fine;
				calibrationWizard.Offset = printer.Settings.GetValue<double>(SettingsKey.nozzle_diameter) / 9.0;
			};

			this.NextButton.Visible = false;

			// add in the option to tell the system the printer is already calibrated
			var alreadyCalibratedButton = theme.CreateDialogButton("Already Calibrated".Localize());
			alreadyCalibratedButton.Name = "Already Calibrated Button";
			alreadyCalibratedButton.Click += (s, e) =>
			{
				printer.Settings.SetValue(SettingsKey.xy_offsets_have_been_calibrated, "1");
				this.FinishWizard();
			};

			this.AddPageAction(alreadyCalibratedButton);

			var startCalibrationPrint = theme.CreateDialogButton("Start Print".Localize());
			startCalibrationPrint.Name = "Start Calibration Print";
			startCalibrationPrint.Click += async (s, e) =>
			{
				await PrintCalibrationPart(calibrationWizard);
			};

			this.AcceptButton = startCalibrationPrint;

			this.AddPageAction(startCalibrationPrint);
		}

		private async Task PrintCalibrationPart(XyCalibrationWizard calibrationWizard)
		{
			var scene = new Object3D();

			// create the calibration objects
			IObject3D item = await CreateCalibrationObject(printer, calibrationWizard);

			// add the calibration object to the bed
			scene.Children.Add(item);

			// move the part to the center of the bed
			var bedBounds = printer.Settings.BedBounds;
			var aabb = item.GetAxisAlignedBoundingBox();
			item.Matrix *= Matrix4X4.CreateTranslation(bedBounds.Center.X - aabb.MinXYZ.X - aabb.XSize / 2, bedBounds.Center.Y - aabb.MinXYZ.Y - aabb.YSize / 2, -aabb.MinXYZ.Z);

			// register callbacks for print completion
			printer.Connection.Disposed += this.Connection_Disposed;
			printer.Connection.PrintCanceled += this.Connection_PrintCanceled;
			printer.Connection.CommunicationStateChanged += this.Connection_CommunicationStateChanged;

			// hide this window
			this.DialogWindow.Visible = false;

			string gcodePath = EditContext.GCodeFilePath(printer, scene);

			printer.Connection.CommunicationState = CommunicationStates.PreparingToPrint;

			(bool slicingSucceeded, string finalGCodePath) = await ApplicationController.Instance.SliceItemLoadOutput(
				printer,
				scene,
				gcodePath);

			// Only start print if slicing completed
			if (slicingSucceeded)
			{
				await printer.Bed.LoadContent(new EditContext()
				{
					SourceItem = new FileSystemFileItem(gcodePath),
					ContentStore = null // No content store for GCode
				});

				await printer.Connection.StartPrint(finalGCodePath, calibrationPrint: true);
				ApplicationController.Instance.MonitorPrintTask(printer);
			}
			else
			{
				printer.Connection.CommunicationState = CommunicationStates.Connected;
			}
		}

		private void Connection_PrintCanceled(object sender, EventArgs e)
		{
			this.ReturnToCalibrationWizard();
		}

		private void UnregisterPrinterEvents()
		{
			printer.Connection.Disposed -= this.Connection_Disposed;
			printer.Connection.CommunicationStateChanged -= this.Connection_CommunicationStateChanged;
			printer.Connection.PrintCanceled -= this.Connection_PrintCanceled;
		}

		private void Connection_CommunicationStateChanged(object sender, EventArgs e)
		{
			switch (printer.Connection.CommunicationState)
			{
				case CommunicationStates.Disconnected:
				case CommunicationStates.AttemptingToConnect:
				case CommunicationStates.FailedToConnect:
				case CommunicationStates.ConnectionLost:
				case CommunicationStates.PrintingFromSd:
				case CommunicationStates.FinishedPrint:
					// We are no longer printing, exit and return to where we started
					this.ReturnToCalibrationWizard();

					break;
			}
		}

		private void ReturnToCalibrationWizard()
		{
			UiThread.RunOnIdle(() =>
			{
				// Restore the original DialogWindow
				this.DialogWindow.Visible = true;

				// Restore to original view mode
				printer.ViewState.ViewMode = preCalibrationPrintViewMode;

				this.MoveToNextPage();
			});

			this.UnregisterPrinterEvents();
		}

		private void Connection_Disposed(object sender, EventArgs e)
		{
			this.UnregisterPrinterEvents();
		}

		private static async Task<IObject3D> CreateCalibrationObject(PrinterConfig printer, XyCalibrationWizard calibrationWizard)
		{
			var layerHeight = printer.Settings.GetValue<double>(SettingsKey.layer_height);
			var firstLayerHeight = printer.Settings.GetValue<double>(SettingsKey.first_layer_height);

			switch (calibrationWizard.Quality)
			{
				case QualityType.Coarse:
					return await XyCalibrationTabObject3D.Create(
						1,
						Math.Max(firstLayerHeight * 2, layerHeight * 2),
						calibrationWizard.Offset,
						printer.Settings.GetValue<double>(SettingsKey.nozzle_diameter));

				default:
					return await XyCalibrationFaceObject3D.Create(
						1,
						firstLayerHeight + layerHeight,
						layerHeight,
						calibrationWizard.Offset,
						printer.Settings.GetValue<double>(SettingsKey.nozzle_diameter),
						printer.Settings.GetValue<double>(SettingsKey.wipe_tower_size),
						4);
			}
		}
	}
}


text:
/* Generated code */

interface TesterFlagsResource {

	tester?: boolean;

	autoDelete?: boolean;

	noBilling?: boolean;

	noBillingLimit?: boolean;
}

export default TesterFlagsResource;


text:
#define KL_LOG KL_SIGNAL
#include <sys/mimiker.h>
#include <sys/signal.h>
#include <sys/thread.h>
#include <sys/klog.h>
#include <sys/errno.h>
#include <sys/proc.h>
#include <sys/ucontext.h>

static register_t sig_stack_push(mcontext_t *uctx, void *data, size_t len) {
  _REG(uctx, SP) -= roundup(len, STACK_ALIGN);
  register_t sp = _REG(uctx, SP);
  if (copyout(data, (void *)sp, len)) {
    /* This thread has a corrupted stack, it can no longer react on a signal
     * with a custom handler. Kill the process. */
    klog("User stack (%p) is corrupted, terminating with SIGILL!", sp);
    sig_exit(thread_self(), SIGILL);
  }
  return sp;
}

int sig_send(signo_t sig, sigset_t *mask, sigaction_t *sa, ksiginfo_t *ksi) {
  thread_t *td = thread_self();
  mcontext_t *uctx = td->td_uctx;

  ucontext_t uc;
  mcontext_copy(&uc.uc_mcontext, uctx);
  uc.uc_sigmask = *mask;

  register_t sc_code = sig_stack_push(uctx, sigcode, esigcode - sigcode);
  register_t sc_info = sig_stack_push(uctx, &ksi->ksi_info, sizeof(siginfo_t));
  register_t sc_uctx = sig_stack_push(uctx, &uc, sizeof(ucontext_t));

  /* Prepare user context so that on return to usermode the handler gets
   * executed. No need to check whether the handler address is valid (aligned,
   * user space, mapped memory, executable). If it is not, an exception will be
   * raised and the user process will get the punishment it deserves (SIGILL,
   * SIGSEGV). */
  _REG(uctx, EPC) = (register_t)sa->sa_handler;
  /* Set arguments to signal number, signal info, and user context. */
  _REG(uctx, A0) = sig;
  _REG(uctx, A1) = sc_info;
  _REG(uctx, A2) = sc_uctx;
  /* The calling convention is such that the callee may write to the address
   * pointed by sp before extending the stack - so we need to set it at least
   * 1 word before the stored context! */
  _REG(uctx, SP) -= STACK_ALIGN;
  /* Also, make sure that sigcode runs when the handler exits. */
  _REG(uctx, RA) = sc_code;

  return 0;
}

/* TODO: fill in various fields of ksiginfo_t based on context values. */
void sig_trap(ctx_t *ctx, signo_t sig) {
  proc_t *proc = proc_self();
  WITH_MTX_LOCK (&proc->p_lock)
    sig_kill(proc, &DEF_KSI_TRAP(sig));
}


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Management.Batch.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Moq;
using System.Management.Automation;
using Xunit;
using BatchClient = Microsoft.Azure.Commands.Batch.Models.BatchClient;

namespace Microsoft.Azure.Commands.Batch.Test.Accounts
{
    public class NewBatchAccountCommandTests : WindowsAzure.Commands.Test.Utilities.Common.RMTestBase
    {
        private NewBatchAccountCommand cmdlet;
        private Mock<BatchClient> batchClientMock;
        private Mock<ICommandRuntime> commandRuntimeMock;

        public NewBatchAccountCommandTests(Xunit.Abstractions.ITestOutputHelper output)
        {
            ServiceManagemenet.Common.Models.XunitTracingInterceptor.AddToContext(new ServiceManagemenet.Common.Models.XunitTracingInterceptor(output));
            batchClientMock = new Mock<BatchClient>();
            commandRuntimeMock = new Mock<ICommandRuntime>();
            cmdlet = new NewBatchAccountCommand()
            {
                CommandRuntime = commandRuntimeMock.Object,
                BatchClient = batchClientMock.Object
            };
        }

        [Fact]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void NewBatchAccountTest()
        {
            string accountName = "account01";
            string resourceGroup = "resourceGroup";
            string location = "location";
            BatchAccount accountResource = BatchTestHelpers.CreateAccountResource(accountName, resourceGroup);
            BatchAccountContext expected = BatchAccountContext.ConvertAccountResourceToNewAccountContext(accountResource);

            batchClientMock.Setup(b => b.CreateAccount(resourceGroup, accountName, location, null, null)).Returns(expected);

            cmdlet.AccountName = accountName;
            cmdlet.ResourceGroupName = resourceGroup;
            cmdlet.Location = location;

            cmdlet.ExecuteCmdlet();

            commandRuntimeMock.Verify(r => r.WriteObject(expected), Times.Once());
        }

        [Fact]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void NewBatchWithAutoStorageAccountTest()
        {
            string accountName = "account01";
            string resourceGroup = "resourceGroup";
            string location = "location";
            string storageId = "storageId";

            BatchAccount accountResource = BatchTestHelpers.CreateAccountResource(accountName, resourceGroup);
            BatchAccountContext expected = BatchAccountContext.ConvertAccountResourceToNewAccountContext(accountResource);

            batchClientMock.Setup(b => b.CreateAccount(resourceGroup, accountName, location, null, storageId)).Returns(expected);

            cmdlet.AccountName = accountName;
            cmdlet.ResourceGroupName = resourceGroup;
            cmdlet.Location = location;
            cmdlet.AutoStorageAccountId = storageId;

            cmdlet.ExecuteCmdlet();

            commandRuntimeMock.Verify(r => r.WriteObject(expected), Times.Once());
        }
    }
}


text:
.. _introduction:

Introduction
==============

Why Arrested?


text:
package com.pushtorefresh.storio.sample.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.support.annotation.NonNull;

import com.pushtorefresh.storio.sample.db.table.TweetTableMeta;

public class DbOpenHelper extends SQLiteOpenHelper {

    public DbOpenHelper(@NonNull Context context) {
        super(context, "sample_db", null, 1);
    }

    // better than static final field -> allows VM to unload useless String
    @NonNull
    private static String getCreateTweetTableQuery() {
        return "CREATE TABLE " + TweetTableMeta.TABLE + "("
                + TweetTableMeta.COLUMN_ID + " INTEGER NOT NULL PRIMARY KEY, "
                + TweetTableMeta.COLUMN_AUTHOR + " TEXT NOT NULL, "
                + TweetTableMeta.COLUMN_CONTENT + " TEXT NOT NULL, "
                + TweetTableMeta.COLUMN_CONTENT1 + " TEXT NOT NULL, "
                + TweetTableMeta.COLUMN_CONTENT2 + " TEXT NOT NULL"
                + ");";
    }

    private static String getCreateTweetKVTableQuery() {
        return "CREATE TABLE " + TweetTableMeta.TABLEKV + "("
                + TweetTableMeta.COLUMN_ID + " INTEGER NOT NULL PRIMARY KEY, "
                + TweetTableMeta.COLUMN_BLOB + " BLOB TEXT NOT NULL"
                + ");";
    }

    @Override
    public void onCreate(@NonNull SQLiteDatabase db) {
        db.execSQL(getCreateTweetTableQuery());
        db.execSQL(getCreateTweetKVTableQuery());
    }

    @Override
    public void onUpgrade(@NonNull SQLiteDatabase db, int oldVersion, int newVersion) {
        // no impl
    }

}


text:
<!DOCTYPE html>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta charset="UTF-8">
  <title>Unathi Dywili</title>
  <link rel="stylesheet" href="style.css">

 let me tell you about me

FAMILY
I am Unathi Dywili a girl that grew up in a township with my both parents and my 3 siblings, 2 brothers and 1 sister.
 My mother is a very humble,kind but strict woman.
 My father is a very quite man who always makes sure that his kids get what they need and most of all he is very firm.

  My older brother is the most supportive person I have ever known and he always wants whats best for me all the time.
 OMG my little sister and brother are very naughty they always want special attension from me but then I so love my siblings.

  My home is full of love and support, with my family everything is possible.

SCHOOL
 I am doing greade 10 at COSAT I am an avarage student I WORK HARD and I make sure that I pass a certain subject by more than 60% I have a very good teachers that make sure that I understand stuff in class.
 My favourate subjects are

Mathematics

Life Orientation

Life Science

Isixhosa

  AND I am doing well at those I love school so much as I am very interested in learning new things.

  CODING

At school we do have a coding class but wer are not doing it with jave script, html and css we are doing it using DELPHY I so enjoy coding as I like making new things like creating an app. I started coding this year and I think i UNDERSTAND the work that we do as i have some awesome tutors that hel me to understand more

  i think that is all I could say


text:
'use strict';

var ptr = require('..'),
  http = require('http'),
  util = require('util');

// A flickr feed, tags surf,pipeline
var feed = 'http://api.flickr.com/services/feeds/photos_public.gne?tags=surf,pipeline&tagmode=all&format=json&jsoncallback=processResponse';

// Compile/prepare the pointers...
var items = ptr.create('#/items');
var author = ptr.create('#/author');
var media = ptr.create('#/media/m');

function processResponse(json) {
  var data = items.get(json);

  if (data && Array.isArray(data)) {
    let images = data.reduce((acc, it) => {
      // Using the prepared pointers to select parts...
      acc.push({
        author: author.get(it),
        media: media.get(it)
      });
      return acc;
    }, []);
    console.log(util.inspect(images, false, 9));
  }
}

http.get(feed, function(res) {
  var data = '';

  res.on('data', function(chunk) {
    data += chunk;
  });

  res.on('end', function() {
    // result is formatted as jsonp... this is for illustration only.
    data = eval(data); // eslint-disable-line no-eval
    processResponse(data);
  });
}).on('error', function(e) {
  console.log('Got error: ' + e.message);
});


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

$string['addscreenshots'] = 'Add screenshots';
$string['advertise'] = 'Advertise this course for people to join';
$string['advertised'] = 'Advertised';
$string['advertiseon'] = 'Advertise this course on {$a}';
$string['readvertiseon'] = 'Update advertising information on {$a}';
$string['advertiseonhub'] = 'Advertise this course on a hub';
$string['advertiseonmoodleorg'] = 'Advertise this course on moodle.org';
$string['advertisepublication_help'] = 'Advertising your course on a community hub server allows people to find this course and come here to enrol.';
$string['all'] = 'All';
$string['allowglobalsearch'] = 'Publish this hub and allow global search of all courses';
$string['allowpublicsearch'] = 'Publish this hub so people can join it';
$string['audience'] = 'Audience';
$string['audience_help'] = 'Select the intended audience for the course.';
$string['audienceeducators'] = 'Educators';
$string['audiencestudents'] = 'Students';
$string['audienceadmins'] = 'Moodle administrators';
$string['badurlformat'] = 'Bad URL format';
$string['badgesnumber'] = 'Number of badges ({$a})';
$string['community'] = 'Community';
$string['communityremoved'] = 'That course link has been removed from your list';
$string['confirmregistration'] = 'Confirm registration';
$string['cannotsearchcommunity'] = 'Sorry, you don\'t have the right permissions to see this page';
$string['contactable'] = 'Contact from the public';
$string['contactable_help'] = 'Set to yes, the hub will display your email address.';
$string['contactemail'] = 'Contact email';
$string['contactname'] = 'Contact name';
$string['contactphone'] = 'Phone';
$string['contactphone_help'] = 'Phone numbers are displayed to the Hub administrator only and are not shown publicly.';
$string['continue'] = 'Continue';
$string['contributornames'] = 'Other contributors';
$string['contributornames_help'] = 'You can use this field to list the names of anyone else who contributed to this course.';
$string['coursemap'] = 'Course map';
$string['coursename'] = 'Name';
$string['courseprivate'] = 'Private';
$string['coursepublic'] = 'Public';
$string['coursepublished'] = 'This course has been published successfully on \'{$a}\'.';
$string['courseshortname'] = 'Shortname';
$string['courseshortname_help'] = 'Enter a short name for your course. It does not need to be unique.';
$string['coursesnumber'] = 'Number of courses ({$a})';
$string['courseunpublished'] = 'The course {$a->courseshortname} is no longer published on {$a->hubname}.';
$string['courseurl'] = 'Course URL';
$string['courseurl_help'] = 'It is the URL of your course. This URL is displayed as a link in a search result.';
$string['creatorname'] = 'Creator';
$string['creatorname_help'] = 'The creator is the course creator.';
$string['creatornotes'] = 'Creator notes';
$string['creatornotes_help'] = 'Creator notes are a guide for teachers on how to use the course.';
$string['deletescreenshots'] = 'Delete these screenshots';
$string['deletescreenshots_help'] = 'Delete all the currently uploaded screenshots.';
$string['demourl'] = 'Demo URL';
$string['demourl_help'] = 'Enter the demo URL of your course. By default it is the URL of your course. The demo URL is displayed as a link in a search result.';
$string['description'] = 'Description';
$string['description_help'] = 'This description text will be showing in the course listing on the hub.';
$string['detectednotexistingpublication'] = '{$a->hubname} is listing a course that does not exist any more. Alert this hub administrator that the publication number {$a->id} should be removed.';
$string['downloadable'] = 'Downloadable';
$string['educationallevel'] = 'Educational level';
$string['educationallevel_help'] = 'Select the most appropriate educational level that the course fits into.';
$string['edulevelassociation'] = 'Association';
$string['edulevelcorporate'] = 'Corporate';
$string['edulevelgovernment'] = 'Government';
$string['edulevelother'] = 'Other';
$string['edulevelprimary'] = 'Primary';
$string['edulevelsecondary'] = 'Secondary';
$string['eduleveltertiary'] = 'Tertiary';
$string['emailalert'] = 'Email notifications';
$string['emailalert_help'] = 'If this is enabled the hub administrator will send you emails about security issues and other important news.';
$string['enrollable'] = 'Enrollable';
$string['errorbadimageheightwidth'] = 'The image should have a maximum size of {$a->width} X {$a->height}';
$string['errorcourseinfo'] = 'An error occurred when retrieving course metadata from the hub ({$a}). Please try again to retrieve the course metadata from the hub by reloading this page later. Otherwise you can decide to continue the registration process with the following default metadata. ';
$string['errorcoursepublish'] = 'An error occurred during the course publication ({$a}). Please try again later.';
$string['errorcoursewronglypublished'] = 'A publication error has been returned by the hub. Please try again later.';
$string['errorcron'] = 'An error occurred during registration update on "{$a->hubname}" ({$a->errormessage})';
$string['errorcronnoxmlrpc'] = 'XML-RPC must be enabled in order to update the registration.';
$string['errorhublisting'] = 'An error occurred when retrieving the hub listing from Moodle.org, please try again later. ({$a})';
$string['errorlangnotrecognized'] = 'The provided language code is unknown by Moodle. Please contact {$a}';
$string['errorregistration'] = 'An error occurred during registration, please try again later. ({$a})';
$string['errorunpublishcourses']= 'Due to an unexpected error, the courses could not be deleted on the hub. Try again later (recommended) or contact the hub administrator.';
$string['existingscreenshotnumber'] = '{$a} existing screenshots. You will be able to see these screenshots on this page, only once the hub administrator enables your course.';
$string['existingscreenshots'] = 'Existing screenshots';
$string['forceunregister'] = 'Yes, clean registration data';
$string['forceunregisterconfirmation'] = 'Your site cannot reach {$a}. This hub could be temporarily down. Unless you are sure you want to continue to remove registration locally, please cancel and try again later.';
$string['geolocation'] = 'Geolocation';
$string['geolocation_help'] = 'In future we may provide location-based searching. If you want to specify the location for your course use a latitude/longitude value here (eg: -31.947884,115.871285).  One way to find this is to use Google Maps.';
$string['hub'] = 'Hub';
$string['imageurl'] = 'Image URL';
$string['imageurl_help'] = 'This image will be displayed on the hub. This image must be available from the hub at any moment. The image should have a maximum size of {$a->width} X {$a->height}';
$string['information'] = 'Information';
$string['issuedbadgesnumber'] = 'Number of issued badges ({$a})';
$string['language'] = 'Language';
$string['language_help'] = 'The main language of this course.';
$string['lasttimechecked'] = 'Last time checked';
$string['licence'] = 'Licence';
$string['licence_help'] = 'Select the licence you want to distribute your course under.';
$string['licence_link'] = 'licenses';
$string['logourl'] = 'Logo URL';
$string['modulenumberaverage'] = 'Average number of course modules ({$a})';
$string['moodleorg'] = 'Moodle.org';
$string['mustselectsubject'] = 'You must select a subject';
$string['name'] = 'Name';
$string['name_help'] = 'This name will be showing in the course listing.';
$string['neverchecked'] = 'Never checked';
$string['next'] = 'Next';
$string['no'] = 'No';
$string['nocheckstatusfromunreghub'] = 'The site is not registered on the hub so the status can not be checked.';
$string['nohubselected'] = 'No hub selected';
$string['none'] = 'None';
$string['nosearch'] = 'Don\'t publish hub or courses';
$string['notregisteredonhub'] = 'Your administrator needs to register this site with at least one hub before you can publish a course. Contact your site administrator.';
$string['notregisteredonmoodleorg'] = 'Your administrator needs to register this site with moodle.org.';
$string['operation'] = 'Actions';
$string['orenterprivatehub'] = 'Alternatively, enter a private hub URL:';
$string['participantnumberaverage'] = 'Average number of participants ({$a})';
$string['postaladdress'] = 'Postal address';
$string['postaladdress_help'] = 'Postal address of this site, or of the entity represented by this site.';
$string['postsnumber'] = 'Number of posts ({$a})';
$string['previousregistrationdeleted'] = 'The previous registration has been deleted from {$a}. You can restart the registration process. Thank you.';
$string['prioritise'] = 'Prioritise';
$string['privacy'] = 'Privacy';
$string['privacy_help'] = 'The hub may want to display a list of registered sites. If it does then you can choose whether or not you want to appear on that list.';
$string['private'] = 'Private';
$string['privatehuburl'] = 'Private hub URL';
$string['publicationinfo'] = 'Course publication information';
$string['publichub'] = 'Public hub';
$string['publishcourse'] = 'Publish {$a}';
$string['publishcourseon'] = 'Publish on {$a}';
$string['publishedon'] = 'Published on';
$string['publisheremail'] = 'Publisher email';
$string['publisheremail_help'] = 'The publisher email address allows the hub administrator to alert the publisher about any changes to the status of the published course.';
$string['publishername'] = 'Publisher';
$string['publishername_help'] = 'The publisher is the person or organisation that is the official publisher of the course.  Unless you are publishing it on behalf of someone else, it will usually be you.';
$string['publishon'] = 'Publish on';
$string['publishonspecifichub'] = 'Publish on another Hub';
$string['questionsnumber'] = 'Number of questions ({$a})';
$string['registeredcourses'] = 'Registered courses';
$string['registeredsites'] = 'Registered sites';
$string['registrationinfo'] = 'Registration information';
$string['registeredmoodleorg'] = 'Moodle.org ({$a})';
$string['registeredon'] = 'Where your site is registered';
$string['registermoochtips'] = 'In order to register with Moodle.net, your site must be registered with Moodle.org.';
$string['registersite'] = 'Register with {$a}';
$string['registerwith'] = 'Register with a hub';
$string['registrationconfirmed'] = 'Site registration confirmed';
$string['registrationconfirmedon'] = 'Thank you for registering your site. Registration information will be kept up to date by the \'Site registration\' scheduled task.';
$string['registrationupdated'] = 'Registration has been updated.';
$string['registrationupdatedfailed'] = 'Registration update failed.';
$string['removefromhub'] = 'Remove from hub';
$string['renewregistration'] = 'Renew registration';
$string['resourcesnumber'] = 'Number of resources ({$a})';
$string['restartregistration'] = 'Restart registration';
$string['roleassignmentsnumber'] = 'Number of role assignments ({$a})';
$string['screenshots'] = 'Screenshots';
$string['screenshots_help'] = 'Any screenshots of the course will be displayed in search results.';
$string['search'] = 'Search';
$string['selecthub'] = 'Select hub';
$string['selecthubinfo'] = 'A community hub is a server that lists courses. You can only publish your courses on hubs that this Moodle site is registered with.  If the hub you want is not listed below, please contact your site administrator.';
$string['selecthubforadvertise'] = 'Select hub for advertising';
$string['selecthubforsharing'] = 'Select hub for uploading';
$string['sendingcourse'] = 'Sending course';
$string['sendingsize'] = 'Please wait the course file is uploading ({$a->total}Mb)...';
$string['sendfollowinginfo'] = 'More information';
$string['sendfollowinginfo_help'] = 'The following information will be sent to contribute to overall statistics only.  It will not be made public on any site listing.';
$string['sent'] = '...finished';
$string['settings'] = 'Settings';
$string['settingsupdated'] = 'Settings have been updated.';
$string['share'] = 'Share this course for people to download';
$string['shared'] = 'Shared';
$string['shareon'] = 'Upload this course to {$a}';
$string['shareonhub'] = 'Upload this course to a hub';
$string['sharepublication_help'] = 'Uploading this course to a community hub server will enable people to download it and install it on their own Moodle sites.';
$string['siteadmin'] = 'Administrator';
$string['siteadmin_help'] = 'The full name of the site administrator.';
$string['sitecountry'] = 'Country';
$string['sitecountry_help'] = 'The country your organisation is in.';
$string['sitecreated'] = 'Site created';
$string['sitedesc'] = 'Description';
$string['sitedesc_help'] = 'This description of your site may be shown in the site listing.  Please use plain text only.';
$string['sitegeolocation'] = 'Geolocation';
$string['sitegeolocation_help'] = 'In future we may provide location-based searching in the hubs. If you want to specify the location for your site use a latitude/longitude value here (eg: -31.947884,115.871285).  One way to find this is to use Google Maps.';
$string['siteemail'] = 'Email address';
$string['siteemail_help'] = 'You need to provide an email address so the hub administrator can contact you if necessary.  This will not be used for any other purpose. It is recommended to enter a email address related to a position (example: sitemanager@example.com) and not directly to a person.';
$string['sitelang'] = 'Language';
$string['sitelang_help'] = 'Your site language will be displayed on the site listing.';
$string['sitename'] = 'Name';
$string['sitename_help'] = 'The name of the site will be shown on the site listing if the hub allows that.';
$string['sitephone'] = 'Phone';
$string['sitephone_help'] = 'Your phone number will only be seen by the hub administrator.';
$string['siteprivacy'] = 'Privacy';
$string['siteprivacynotpublished'] = 'Please do not publish this site';
$string['siteprivacypublished'] = 'Publish the site name only';
$string['siteprivacylinked'] = 'Publish the site name with a link';
$string['siteregconfcomment'] = 'Your site needs a final confirmation on {$a} (in order to avoid spam on {$a})';
$string['siteregistrationcontact'] = 'Contact form';
$string['siteregistrationcontact_help'] = 'If you allow it, other people may be able to contact you via a contact form on the hub.  They will never be able to see your email address.';
$string['siteregistrationemail'] = 'Email notifications';
$string['siteregistrationemail_help'] = 'If you enable this the hub administrator may email you to inform you of important news like security issues.';
$string['siteregistrationupdated'] = 'Site registration updated';
$string['siterelease'] = 'Moodle release';
$string['siterelease_help'] = 'Moodle release number of this site.';
$string['siteupdatedcron'] = 'Site registration updated on "{$a}"';
$string['siteupdatesend'] = 'Finished registration update on hubs.';
$string['siteupdatesstart'] = 'Starting registration update on hubs...';
$string['siteurl'] = 'Site URL';
$string['siteurl_help'] = 'The URL is the address of this site.  If privacy settings allow people to see site addresses then this is the URL that will be used.';
$string['siteversion'] = 'Moodle version';
$string['siteversion_help'] = 'The Moodle version of this site.';
$string['subject'] = 'Subject';
$string['subject_help'] = 'Select the main subject area which the course covers.';
$string['specifichubregistrationdetail'] = 'You can also register your site with other community hubs.';
$string['statistics'] = 'Statistics privacy';
$string['status'] = 'Hub listing';
$string['statuspublished'] = 'Listed';
$string['statusunpublished'] = 'Not listed';
$string['tags'] = 'Tags';
$string['tags_help'] = 'Tags help to further categorise your course and help it to be found. Please use simple, meaningful words and separate them with a comma. Example: math, algebra, geometry';
$string['trustme'] = 'Trust';
$string['type'] = 'Advertised / Shared';
$string['unknownstatus'] = 'Unknown';
$string['unlistedurl'] = 'Unlisted hub URL';
$string['unprioritise'] = 'Unprioritise';
$string['unpublish'] = 'Unpublish';
$string['unpublishalladvertisedcourses'] = 'Remove all courses currently being advertised on a hub';
$string['unpublishalluploadedcourses'] = 'Removed all courses that were uploaded to a hub';
$string['unpublishconfirmation'] = 'Do you really want to remove the course "{$a->courseshortname}" from the hub "{$a->hubname}"';
$string['unpublishcourse'] = 'Unpublish {$a}';
$string['unregister'] = 'Unregister';
$string['unregisterfrom'] = 'Unregister from {$a}';
$string['unregisterconfirmation'] = 'You are about to unregister this site from the hub {$a}.  Once you disconnect from it, you will not be able to manage any courses you left there.  Are you sure you want to unregister?';
$string['unregistrationerror'] = 'An error occurred when the site tried to unregister from the hub: {$a}';
$string['untrustme'] = 'Not trusted';
$string['update'] = 'Update';
$string['updatesite'] = 'Update registration on {$a}';
$string['updatestatus'] = 'Check it now.';
$string['uploaded'] = 'Uploaded';
$string['url'] = 'hub URL';
$string['urlalreadyregistered'] = 'Your site seems to be already registered on this hub, which means something has gone wrong. Please contact the hub administrator to reset your registration so you can try again.';
$string['usersnumber'] = 'Number of users ({$a})';
$string['warning'] = 'WARNING';
$string['wrongtoken'] = 'The registration failed for some unknown reason (network?). Please try again.';
$string['wrongurlformat'] = 'Bad URL format';
$string['xmlrpcdisabledcommunity'] = 'The XML-RPC extension is not enabled on the server. You can not search and download courses.';
$string['xmlrpcdisabledpublish'] = 'The XML-RPC extension is not enabled on the server. You can not publish courses or manage published courses.';
$string['xmlrpcdisabledregistration'] = 'The XML-RPC extension is not enabled on the server. You will not be able to unregister or update your registration until you enable it.';


text:
package com.airbnb.reair;

import static spark.Spark.get;
import static spark.Spark.port;

import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import spark.ModelAndView;

import java.util.HashMap;
import java.util.Map;

public class WebServer {

  private static Logger LOG = LoggerFactory.getLogger(WebServer.class);

  /**
   * TODO. Warning suppression needed for the OptionBuilder API
   *
   * @param argv TODO
   *
   * @throws Exception TODO
   */
  @SuppressWarnings("static-access")
  public static void main(final String[] argv) throws Exception {
    Options options = new Options();

    options.addOption(OptionBuilder.withLongOpt("thrift-host")
        .withDescription("Host name for the thrift service").hasArg().withArgName("HOST").create());

    options.addOption(OptionBuilder.withLongOpt("thrift-port")
        .withDescription("Port for the thrift service").hasArg().withArgName("PORT").create());

    options.addOption(OptionBuilder.withLongOpt("http-port")
        .withDescription("Port for the HTTP service").hasArg().withArgName("PORT").create());

    CommandLineParser parser = new BasicParser();
    CommandLine cl = parser.parse(options, argv);

    String thriftHost = "localhost";
    int thriftPort = 9996;
    int httpPort = 8080;

    if (cl.hasOption("thrift-host")) {
      thriftHost = cl.getOptionValue("thrift-host");
      LOG.info("thriftHost=" + thriftHost);
    }

    if (cl.hasOption("thrift-port")) {
      thriftPort = Integer.valueOf(cl.getOptionValue("thrift-port"));
      LOG.info("thriftPort=" + thriftPort);
    }

    if (cl.hasOption("http-port")) {
      httpPort = Integer.valueOf(cl.getOptionValue("http-port"));
      LOG.info("httpPort=" + httpPort);
    }

    port(httpPort);

    final String finalThriftHost = thriftHost;
    final int finalThriftPort = thriftPort;

    LOG.info(String.format("Connecting to thrift://%s:%s and " + "serving HTTP on %s",
        finalThriftHost, finalThriftPort, httpPort));
    get("/jobs", (request, response) -> {
      PageData pd = new PageData(finalThriftHost, finalThriftPort);

      boolean dataFetchSuccessful = false;
      try {
        pd.fetchData();
        dataFetchSuccessful = true;
      } catch (TException e) {
        LOG.error("Error while fetching data!", e);
      }

      Map<String, Object> model = new HashMap<>();
      model.put("host", finalThriftHost);
      model.put("port", finalThriftPort);
      model.put("data_fetch_successful", dataFetchSuccessful);
      model.put("lag_in_minutes", pd.getLag() / 1000 / 60);
      model.put("active_jobs", pd.getActiveJobs());
      model.put("retired_jobs", pd.getRetiredJobs());
      model.put("date_utils", new DateUtils());
      return new ModelAndView(model, "jobs");
    } , new ThymeleafTemplateEngine());

  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PVeins: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

PVeins

traci_api

LinearSpeedChangeController

traci_api::LinearSpeedChangeController Member List

This is the complete list of members for traci_api::LinearSpeedChangeController, including all inherited members.

LinearSpeedChangeController(VEHICLE *vhc, float target_speed, int duration)	traci_api::LinearSpeedChangeController

nextTimeStep() override	traci_api::LinearSpeedChangeController	virtual

repeat() override	traci_api::LinearSpeedChangeController	inlinevirtual

~BaseSpeedController()	traci_api::BaseSpeedController	inlinevirtual

~LinearSpeedChangeController() override	traci_api::LinearSpeedChangeController	inline

<address class="footer">
Generated by

 1.8.13
</address>


text:
package com.facebook.buck.shell;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import com.facebook.buck.cli.FakeBuckConfig;
import com.facebook.buck.model.BuildTargetFactory;
import com.facebook.buck.parser.NoSuchBuildTargetException;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer;
import com.facebook.buck.rules.Description;
import com.facebook.buck.rules.FakeBuildRuleParamsBuilder;
import com.facebook.buck.rules.FakeSourcePath;
import com.facebook.buck.rules.TargetGraph;
import com.google.common.collect.ImmutableMap;

import org.junit.Test;

import java.util.Optional;

public class WorkerToolDescriptionTest {
  @Test
  public void testGetMaxWorkersWhenSet() throws NoSuchBuildTargetException {
    int maxWorkers = 14;
    WorkerTool workerTool = createWorkerTool(maxWorkers);
    assertThat(workerTool.getMaxWorkers(), equalTo(maxWorkers));
  }

  @Test
  public void testGetMaxWorkersWhenSetToZero() throws NoSuchBuildTargetException {
    WorkerTool workerTool = createWorkerTool(0);
    assertThat(workerTool.getMaxWorkers(), equalTo(Integer.MAX_VALUE));
  }

  @Test
  public void testGetMaxWorkersWhenSetToNegativeInt() throws NoSuchBuildTargetException {
    WorkerTool workerTool = createWorkerTool(-2);
    assertThat(workerTool.getMaxWorkers(), equalTo(Integer.MAX_VALUE));
  }

  private static WorkerTool createWorkerTool(Integer maxWorkers)
      throws NoSuchBuildTargetException {
    TargetGraph targetGraph = TargetGraph.EMPTY;
    BuildRuleResolver resolver =
        new BuildRuleResolver(targetGraph, new DefaultTargetNodeToBuildRuleTransformer());

    BuildRule shBinaryRule = new ShBinaryBuilder(
        BuildTargetFactory.newInstance("//:my_exe"))
        .setMain(new FakeSourcePath("bin/exe"))
        .build(resolver);

    WorkerToolDescription.Arg args = new WorkerToolDescription.Arg();
    args.env = ImmutableMap.of();
    args.exe = shBinaryRule.getBuildTarget();
    args.args = Optional.empty();
    args.maxWorkers = Optional.of(maxWorkers);
    args.persistent = Optional.empty();

    Description<WorkerToolDescription.Arg> workerToolDescription = new WorkerToolDescription(
        FakeBuckConfig.builder().build());
    return (WorkerTool) workerToolDescription.createBuildRule(
        targetGraph,
        new FakeBuildRuleParamsBuilder("//arbitrary:target").build(),
        resolver,
        args);
  }
}


text:
void AAITrigger::OnTriggerOverlap(AActor* OverlapedActor)
{
	if (OverlapedActor->IsA<ARnCCharacter>())
	{
		TArray<AActor*> Enemies;

		UGameplayStatics::GetAllActorsOfClass(GetWorld(), AMeleeEnemyCharacter::StaticClass(), Enemies);

		for (auto It = Enemies.CreateIterator(); It;It++)
		{
			AMeleeEnemyCharacter* Enemy = Cast<AMeleeEnemyCharacter>(*It);
			if (Enemy) Enemy->EnableHunting();
		}

		GLog->Log("Notified ai");
	}
}

void AAITrigger::BeginPlay()
{
	Super::BeginPlay();

	OnActorBeginOverlap.AddDynamic(this, &AAITrigger::OnTriggerOverlap);
}


text:
<?php

namespace CmsAuthorization\Mvc\Controller;

use Zend\Mvc\Controller\AbstractActionController;

class RoleController extends AbstractActionController
{
    public function indexAction()
    {
        return [];
    }
}


text:
package com.mrprona.brawlassistant.base.youtube;

import android.os.AsyncTask;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;

import com.google.api.services.youtube.YouTube;
import com.google.api.services.youtube.model.PlaylistItem;
import com.google.api.services.youtube.model.PlaylistItemListResponse;
import com.google.api.services.youtube.model.Video;
import com.google.api.services.youtube.model.VideoListResponse;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * 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.
 */
public abstract class GetPlaylistAsyncTask extends AsyncTask<String, Void, Pair<String, List<Video>>> {
    private static final String TAG = "GetPlaylistAsyncTask";
    private static final Long YOUTUBE_PLAYLIST_MAX_RESULTS = 10L;

    //see: https://developers.google.com/youtube/v3/docs/playlistItems/list
    private static final String YOUTUBE_PLAYLIST_PART = "snippet";
    private static final String YOUTUBE_PLAYLIST_FIELDS = "pageInfo,nextPageToken,items(id,snippet(resourceId/videoId))";
    //see: https://developers.google.com/youtube/v3/docs/videos/list
    private static final String YOUTUBE_VIDEOS_PART = "snippet,contentDetails,statistics"; // video resource properties that the response will include.
    private static final String YOUTUBE_VIDEOS_FIELDS = "items(id,snippet(title,description,thumbnails/high),contentDetails/duration,statistics)"; // selector specifying which fields to include in a partial response.

    private YouTube mYouTubeDataApi;
    private String mChannelId;

    public GetPlaylistAsyncTask(YouTube api) {
        mYouTubeDataApi = api;
    }

    @Override
    protected Pair<String, List<Video>> doInBackground(String... params) {
        final String playlistId = params[0];
        final String nextPageToken;

        if (params.length == 2) {
            nextPageToken = params[1];
        } else {
            nextPageToken = null;
        }

        PlaylistItemListResponse playlistItemListResponse;
        try {
            playlistItemListResponse = mYouTubeDataApi.playlistItems()
                    .list(YOUTUBE_PLAYLIST_PART)
                    .setPlaylistId(playlistId)
                    .setPageToken(nextPageToken)
                    .setFields(YOUTUBE_PLAYLIST_FIELDS)
                    .setMaxResults(YOUTUBE_PLAYLIST_MAX_RESULTS)
                    .setKey(ApiKey.YOUTUBE_API_KEY)
                    .execute();
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }

        if (playlistItemListResponse == null) {
            Log.e(TAG, "Failed to get playlist");
            return null;
        }

        List<String> videoIds = new ArrayList();

        // pull out the video id's from the playlist page
        for (PlaylistItem item : playlistItemListResponse.getItems()) {
            videoIds.add(item.getSnippet().getResourceId().getVideoId());
        }

        // get details of the videos on this playlist page
        VideoListResponse videoListResponse = null;
        try {
            videoListResponse = mYouTubeDataApi.videos()
                    .list(YOUTUBE_VIDEOS_PART)
                    .setFields(YOUTUBE_VIDEOS_FIELDS)
                    .setKey(ApiKey.YOUTUBE_API_KEY)
                    .setId(TextUtils.join(",", videoIds)).execute();
        } catch (IOException e) {
            e.printStackTrace();
        }

        return new Pair(playlistItemListResponse.getNextPageToken(), videoListResponse.getItems());
    }
}