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/html; charset=utf-8"/>
    <title>Statistics of X in UD_Hungarian-Szeged</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Hungarian-Szeged: POS Tags: X

There are 13 X lemmas (0%), 16 X types (0%) and 18 X tokens (0%).
Out of 16 observed tags, the rank of X is: 13 in number of lemmas, 13 in number of types and 15 in number of tokens.

The 10 most frequent X lemmas: _, ad, Cosi, ars, by, clausus, giusto, hard, ice, limina

The 10 most frequent X types:  ad, csak, Cosi, ars, by, clausus, giusto, hard, ice, ilyen

The 10 most frequent ambiguous lemmas: ad (<tt>VERB</tt> 37, <tt>X</tt> 2), Cosi (<tt>PROPN</tt> 1, <tt>X</tt> 1), tutte (<tt>PROPN</tt> 1, <tt>X</tt> 1)

The 10 most frequent ambiguous types:  ad (<tt>VERB</tt> 6, <tt>X</tt> 2), csak (<tt>ADV</tt> 109, <tt>X</tt> 2), Cosi (<tt>PROPN</tt> 1, <tt>X</tt> 1), ilyen (<tt>ADJ</tt> 10, <tt>DET</tt> 5, <tt>X</tt> 1)

ad

<tt>VERB</tt> 6: — Sokkal több feladatot ad a tűzoltóknak az adventi koszorúk okozta kár .

<tt>X</tt> 2: Koncz Imre , az SZDSZ helyi frakciójának elnöke szerint miután most szakmai ad hoc bizottság alakult , már kellőképpen előkészítettnek tekintik az illetékesek a tervet .

csak

<tt>ADV</tt> 109: A terepjáró-gépkocsik hólánccal is csak vergődnek .

<tt>X</tt> 2: Ezek már pénzt is hoznának a házhoz , nem csak nekem , hanem az Universumnak is .

Cosi

<tt>PROPN</tt> 1: A mai jubileumi előadás első felében Mozart Cosi fan tuttéjének I. felvonása hangzik fel , ezt pedig Johann Strauss Cigánybárójának I. felvonása követi majd — mindkettőt maga az ünnepelt választotta a programba .

<tt>X</tt> 1: Az előadás első felében a Cosi fan tutte I. felvonása hangzik fel , ezt követően pedig a Cigánybáró I. felvonása .

ilyen

<tt>ADJ</tt> 10: Nem tagadom , ilyen őrült tempó után jólesik majd a pihenés odahaza .

<tt>DET</tt> 5: A németeknél ez a helyzet , de nincsenek mindenhol ilyen idilli állapotok .

<tt>X</tt> 1: Ugyan ilyen konkrét eset ismert az érdekképviselők előtt Kerekegyházán is .

Morphology

The form / lemma ratio of X is 1.230769 (the average of all parts of speech is 1.503840).

The 1st highest number of forms (4) was observed with the lemma "_": csak, ilyen, szituált, ta.

The 2nd highest number of forms (1) was observed with the lemma "Cosi": Cosi.

The 3rd highest number of forms (1) was observed with the lemma "ad": ad.

X does not occur with any features.

Relations

X nodes are attached to their parents using 8 different relations: <tt>goeswith</tt> (5; 28% instances), <tt>nmod:att</tt> (3; 17% instances), <tt>amod:att</tt> (2; 11% instances), <tt>case</tt> (2; 11% instances), <tt>compound</tt> (2; 11% instances), <tt>flat:name</tt> (2; 11% instances), <tt>nmod</tt> (1; 6% instances), <tt>obj</tt> (1; 6% instances)

Parents of X nodes belong to 7 different parts of speech: <tt>NOUN</tt> (6; 33% instances), <tt>X</tt> (3; 17% instances), <tt>ADJ</tt> (2; 11% instances), <tt>CCONJ</tt> (2; 11% instances), <tt>PROPN</tt> (2; 11% instances), <tt>VERB</tt> (2; 11% instances), <tt>ADV</tt> (1; 6% instances)

12 (67%) X nodes are leaves.

2 (11%) X nodes have one child.

3 (17%) X nodes have two children.

1 (6%) X nodes have three or more children.

The highest child degree of a X node is 3.

Children of X nodes are attached using 6 different relations: <tt>punct</tt> (4; 36% instances), <tt>det</tt> (2; 18% instances), <tt>flat:name</tt> (2; 18% instances), <tt>amod:att</tt> (1; 9% instances), <tt>case</tt> (1; 9% instances), <tt>nmod</tt> (1; 9% instances)

Children of X nodes belong to 5 different parts of speech: <tt>PUNCT</tt> (4; 36% instances), <tt>X</tt> (3; 27% instances), <tt>DET</tt> (2; 18% instances), <tt>ADJ</tt> (1; 9% instances), <tt>NOUN</tt> (1; 9% instances)

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
using System;
using System.Security.Cryptography;
using Sodium.Exceptions;
using Sodium.Interop;

namespace Sodium
{
  /// A public / private key pair.
  public class KeyPair : IDisposable
  {
    private readonly byte[] _publicKey;
    private readonly byte[] _privateKey;

    /// Initializes a new instance of the <see cref="KeyPair"/> class.
    /// <param name="publicKey">The public key.</param>
    /// <param name="privateKey">The private key.</param>
    /// <exception cref="KeyOutOfRangeException"></exception>
    public KeyPair(byte[] publicKey, byte[] privateKey)
    {
      //verify that the private key length is a multiple of 16
      if (privateKey.Length % 16 != 0)
        throw new KeyOutOfRangeException("Private Key length must be a multiple of 16 bytes.");

      _publicKey = publicKey;

      _privateKey = privateKey;
      RuntimeShim.ProtectMemory(_privateKey);
    }

    ~KeyPair()
    {
      Dispose();
    }

    /// Gets or sets the Public Key.
    public byte[] PublicKey
    {
      get { return _publicKey; }
    }

    /// Gets or sets the Private Key.
    public byte[] PrivateKey
    {
      get
      {
        RuntimeShim.UnprotectMemory(_privateKey);
        var tmp = new byte[_privateKey.Length];
        Array.Copy(_privateKey, tmp, tmp.Length);
        RuntimeShim.ProtectMemory(_privateKey);

        return tmp;
      }
    }

    /// Dispose of private key in memory.
    public void Dispose()
    {
      if (_privateKey != null && _privateKey.Length > 0)
        Array.Clear(_privateKey, 0, _privateKey.Length);
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
This guide gets you started programming in the low-level TensorFlow APIs
(TensorFlow Core), showing you how to:

  * Manage your own TensorFlow program (a `tf.Graph`) and TensorFlow
    runtime (a `tf.Session`), instead of relying on Estimators to manage them.
  * Run TensorFlow operations, using a `tf.Session`.
  * Use high level components ([datasets](#datasets), [layers](#layers), and
    [feature_columns](#feature_columns)) in this low level environment.
  * Build your own training loop, instead of using the one
    @{$premade_estimators$provided by Estimators}.

We recommend using the higher level APIs to build models when possible.
Knowing TensorFlow Core is valuable for the following reasons:

  * Experimentation and debugging are both more straight forward
    when you can use low level TensorFlow operations directly.
  * It gives you a mental model of how things work internally when
    using the higher level APIs.

## Setup

Before using this guide, @{$install$install TensorFlow}.

To get the most out of this guide, you should know the following:

*   How to program in Python.
*   At least a little bit about arrays.
*   Ideally, something about machine learning.

Feel free to launch `python` and follow along with this walkthrough.
Run the following lines to set up your Python environment:

```python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import numpy as np
import tensorflow as tf
```

## Tensor Values

The central unit of data in TensorFlow is the **tensor**. A tensor consists of a
set of primitive values shaped into an array of any number of dimensions. A
tensor's **rank** is its number of dimensions, while its **shape** is a tuple
of integers specifying the array's length along each dimension. Here are some
examples of tensor values:

```python
3. # a rank 0 tensor; a scalar with shape [],
[1., 2., 3.] # a rank 1 tensor; a vector with shape [3]
[[1., 2., 3.], [4., 5., 6.]] # a rank 2 tensor; a matrix with shape [2, 3]
[[[1., 2., 3.]], [[7., 8., 9.]]] # a rank 3 tensor with shape [2, 1, 3]
```

TensorFlow uses numpy arrays to represent tensor **values**.

## TensorFlow Core Walkthrough

You might think of TensorFlow Core programs as consisting of two discrete
sections:

1.  Building the computational graph (a @{tf.Graph}).
2.  Running the computational graph (using a @{tf.Session}).

### Graph

A **computational graph** is a series of TensorFlow operations arranged into a
graph. The graph is composed of two types of objects.

  * @{tf.Operation$Operations} (or "ops"): The nodes of the graph.
    Operations describe calculations that consume and produce tensors.
  * @{tf.Tensor$Tensors}: The edges in the graph. These represent the values
    that will flow through the graph. Most TensorFlow functions return
    `tf.Tensors`.

Important: `tf.Tensors` do not have values, they are just handles to elements
in the computation graph.

Let's build a simple computational graph. The most basic operation is a
constant. The Python function that builds the operation takes a tensor value as
input. The resulting operation takes no inputs. When run, it outputs the
value that was passed to the constructor. We can create two floating point
constants `a` and `b` as follows:

```python
a = tf.constant(3.0, dtype=tf.float32)
b = tf.constant(4.0) # also tf.float32 implicitly
total = a + b
print(a)
print(b)
print(total)
```

The print statements produce:

```
Tensor("Const:0", shape=(), dtype=float32)
Tensor("Const_1:0", shape=(), dtype=float32)
Tensor("add:0", shape=(), dtype=float32)
```

Notice that printing the tensors does not output the values `3.0`, `4.0`, and
`7.0` as you might expect. The above statements only build the computation
graph. These `tf.Tensor` objects just represent the results of the operations
that will be run.

Each operation in a graph is given a unique name. This name is independent of
the names the objects are assigned to in Python. Tensors are named after the
operation that produces them followed by an output index, as in
`"add:0"` above.

### TensorBoard

TensorFlow provides a utility called TensorBoard. One of TensorBoard's many
capabilities is visualizing a computation graph. You can easily do this with
a few simple commands.

First you save the computation graph to a TensorBoard summary file as
follows:

```
writer = tf.summary.FileWriter('.')
writer.add_graph(tf.get_default_graph())
```

This will produce an `event` file in the current directory with a name in the
following format:

```
events.out.tfevents.{timestamp}.{hostname}
```

Now, in a new terminal, launch TensorBoard with the following shell command:

```bsh
tensorboard --logdir .
```

Then open TensorBoard's [graphs page](http://localhost:6006/#graphs) in your
browser, and you should see a graph similar to the following:

![TensorBoard screenshot](https://www.tensorflow.org/images/getting_started_add.png)

For more about TensorBoard's graph visualization tools see @{$graph_viz}.

### Session

To evaluate tensors, instantiate a @{tf.Session} object, informally known as a
**session**. A session encapsulates the state of the TensorFlow runtime, and
runs TensorFlow operations. If a `tf.Graph` is like a `.py` file, a `tf.Session`
is like the `python` executable.

The following code creates a `tf.Session` object and then invokes its `run`
method to evaluate the `total` tensor we created above:

```python
sess = tf.Session()
print(sess.run(total))
```

When you request the output of a node with `Session.run` TensorFlow backtracks
through the graph and runs all the nodes that provide input to the requested
output node. So this prints the expected value of 7.0:

```
7.0
```

You can pass multiple tensors to `tf.Session.run`. The `run` method
transparently handles any combination of tuples or dictionaries, as in the
following example:

```python
print(sess.run({'ab':(a, b), 'total':total}))
```

which returns the results in a structure of the same layout:

``` None
{'total': 7.0, 'ab': (3.0, 4.0)}
```

During a call to `tf.Session.run` any `tf.Tensor` only has a single value.
For example, the following code calls `tf.random_uniform` to produce a
`tf.Tensor` that generates a random 3-element vector (with values in `[0,1)`):

```python
vec = tf.random_uniform(shape=(3,))
out1 = vec + 1
out2 = vec + 2
print(sess.run(vec))
print(sess.run(vec))
print(sess.run((out1, out2)))
```

The result shows a different random value on each call to `run`, but
a consistent value during a single `run` (`out1` and `out2` receive the same
random input):

```
[ 0.52917576  0.64076328  0.68353939]
[ 0.66192627  0.89126778  0.06254101]
(
  array([ 1.88408756,  1.87149239,  1.84057522], dtype=float32),
  array([ 2.88408756,  2.87149239,  2.84057522], dtype=float32)
)
```

Some TensorFlow functions return `tf.Operations` instead of `tf.Tensors`.
The result of calling `run` on an Operation is `None`. You run an operation
to cause a side-effect, not to retrieve a value. Examples of this include the
[initialization](#Initializing Layers), and [training](#Training) ops
demonstrated later.

### Feeding

As it stands, this graph is not especially interesting because it always
produces a constant result. A graph can be parameterized to accept external
inputs, known as **placeholders**. A **placeholder** is a promise to provide a
value later, like a function argument.

```python
x = tf.placeholder(tf.float32)
y = tf.placeholder(tf.float32)
z = x + y
```

The preceding three lines are a bit like a function in which we
define two input parameters (`x` and `y`) and then an operation on them. We can
evaluate this graph with multiple inputs by using the `feed_dict` argument of
the @{tf.Session.run$run method} to feed concrete values to the placeholders:

```python
print(sess.run(z, feed_dict={x: 3, y: 4.5}))
print(sess.run(z, feed_dict={x: [1, 3], y: [2, 4]}))
```
This results in the following output:

```
7.5
[ 3.  7.]
```

Also note that the `feed_dict` argument can be used to overwrite any tensor in
the graph. The only difference between placeholders and other `tf.Tensors` is
that placeholders throw an error if no value is fed to them.

## Datasets

Placeholders work for simple experiments, but @{tf.data$Datasets} are the
preferred method of streaming data into a model.

To get a runnable `tf.Tensor` from a Dataset you must first convert it to a
@{tf.data.Iterator}, and then call the Iterator's
@{tf.data.Iterator.get_next$`get_next`} method.

The simplest way to create an Iterator is with the
@{tf.data.Dataset.make_one_shot_iterator$`make_one_shot_iterator`} method.
For example, in the following code the `next_item` tensor will return a row from
the `my_data` array on each `run` call:

``` python
my_data = [
    [0, 1,],
    [2, 3,],
    [4, 5,],
    [6, 7,],
]
slices = tf.data.Dataset.from_tensor_slices(my_data)
next_item = slices.make_one_shot_iterator().get_next()
```

Reaching the end of the data stream causes `Dataset` to throw an
@{tf.errors.OutOfRangeError$`OutOfRangeError`}. For example, the following code
reads the `next_item` until there is no more data to read:

``` python
while True:
  try:
    print(sess.run(next_item))
  except tf.errors.OutOfRangeError:
    break
```

If the `Dataset` depends on stateful operations you may need to
initialize the iterator before using it, as shown below:

``` python
r = tf.random_normal([10,3])
dataset = tf.data.Dataset.from_tensor_slices(r)
iterator = dataset.make_initializable_iterator()
next_row = iterator.get_next()

sess.run(iterator.initializer)
while True:
  try:
    print(sess.run(next_row))
  except tf.errors.OutOfRangeError:
    break
```

For more details on Datasets and Iterators see: @{$guide/datasets}.

## Layers

A trainable model must modify the values in the graph to get new outputs with
the same input.  @{tf.layers$Layers} are the preferred way to add trainable
parameters to a graph.

Layers package together both the variables and the operations that act
on them. For example a
[densely-connected layer](https://developers.google.com/machine-learning/glossary/#fully_connected_layer)
performs a weighted sum across all inputs
for each output and applies an optional
[activation function](https://developers.google.com/machine-learning/glossary/#activation_function).
The connection weights and biases are managed by the layer object.

### Creating Layers

The following code creates a @{tf.layers.Dense$`Dense`} layer that takes a
batch of input vectors, and produces a single output value for each. To apply a
layer to an input, call the layer as if it were a function. For example:

```python
x = tf.placeholder(tf.float32, shape=[None, 3])
linear_model = tf.layers.Dense(units=1)
y = linear_model(x)
```

The layer inspects its input to determine sizes for its internal variables. So
here we must set the shape of the `x` placeholder so that the layer can
build a weight matrix of the correct size.

Now that we have defined the calculation of the output, `y`, there is one more
detail we need to take care of before we run the calculation.

### Initializing Layers

The layer contains variables that must be **initialized** before they can be
used. While it is possible to initialize variables individually, you can easily
initialize all the variables in a TensorFlow graph as follows:

```python
init = tf.global_variables_initializer()
sess.run(init)
```

Important: Calling `tf.global_variables_initializer` only
creates and returns a handle to a TensorFlow operation. That op
will initialize all the global variables when we run it with `tf.Session.run`.

Also note that this `global_variables_initializer` only initializes variables
that existed in the graph when the  initializer was created. So the initializer
should be one of the last things added during graph construction.

### Executing Layers

Now that the layer is initialized, we can evaluate the `linear_model`'s output
tensor as we would any other tensor. For example, the following code:

```python
print(sess.run(y, {x: [[1, 2, 3],[4, 5, 6]]}))
```

will generate a two-element output vector such as the following:

```
[[-3.41378999]
 [-9.14999008]]
```

### Layer Function shortcuts

For each layer class (like @{tf.layers.Dense}) TensorFlow also supplies a
shortcut function (like @{tf.layers.dense}). The only difference is that the
shortcut function versions create and run the layer in a single call. For
example, the following code is equivalent to the earlier version:

```python
x = tf.placeholder(tf.float32, shape=[None, 3])
y = tf.layers.dense(x, units=1)

init = tf.global_variables_initializer()
sess.run(init)

print(sess.run(y, {x: [[1, 2, 3], [4, 5, 6]]}))
```

While convenient, this approach allows no access to the @{tf.layers.Layer}
object. This makes introspection and debugging more difficult,
and layer reuse impossible.

## Feature columns

The easiest way to experiment with feature columns is using the
@{tf.feature_column.input_layer} function. This function only accepts
@{$feature_columns$dense columns} as inputs, so to view the result
of a categorical column you must wrap it in an
@{tf.feature_column.indicator_column}. For example:

``` python
features = {
    'sales' : [[5], [10], [8], [9]],
    'department': ['sports', 'sports', 'gardening', 'gardening']}

department_column = tf.feature_column.categorical_column_with_vocabulary_list(
        'department', ['sports', 'gardening'])
department_column = tf.feature_column.indicator_column(department_column)

columns = [
    tf.feature_column.numeric_column('sales'),
    department_column
]

inputs = tf.feature_column.input_layer(features, columns)
```

Running the `inputs` tensor will parse the `features` into a batch of vectors.

Feature columns can have internal state, like layers, so they often need to be
initialized. Categorical columns use @{tf.contrib.lookup$lookup tables}
internally and these require a separate initialization op,
@{tf.tables_initializer}.

``` python
var_init = tf.global_variables_initializer()
table_init = tf.tables_initializer()
sess = tf.Session()
sess.run((var_init, table_init))
```

Once the internal state has been initialized you can run `inputs` like any
other `tf.Tensor`:

```python
print(sess.run(inputs))
```

This shows how the feature columns have packed the input vectors, with the
one-hot "department" as the first two indices and "sales" as the third.

```None
[[  1.   0.   5.]
 [  1.   0.  10.]
 [  0.   1.   8.]
 [  0.   1.   9.]]
```

## Training

Now that you're familiar with the basics of core TensorFlow, let's train a
small regression model manually.

### Define the data

First let's define some inputs, `x`, and the expected output for each input,
`y_true`:

```python
x = tf.constant([[1], [2], [3], [4]], dtype=tf.float32)
y_true = tf.constant([[0], [-1], [-2], [-3]], dtype=tf.float32)
```

### Define the model

Next, build a simple linear model, with 1 output:

``` python
linear_model = tf.layers.Dense(units=1)

y_pred = linear_model(x)
```

You can evaluate the predictions as follows:

``` python
sess = tf.Session()
init = tf.global_variables_initializer()
sess.run(init)

print(sess.run(y_pred))
```

The model hasn't yet been trained, so the four "predicted" values aren't very
good. Here's what we got; your own output will almost certainly differ:

``` None
[[ 0.02631879]
 [ 0.05263758]
 [ 0.07895637]
 [ 0.10527515]]
```

### Loss

To optimize a model, you first need to define the loss. We'll use the mean
square error, a standard loss for regression problems.

While you could do this manually with lower level math operations,
the @{tf.losses} module provides a set of common loss functions. You can use it
to calculate the mean square error as follows:

``` python
loss = tf.losses.mean_squared_error(labels=y_true, predictions=y_pred)

print(sess.run(loss))
```
This will produce a loss value, something like:

``` None
2.23962
```

### Training

TensorFlow provides
[**optimizers**](https://developers.google.com/machine-learning/glossary/#optimizer)
implementing standard optimization algorithms. These are implemented as
sub-classes of @{tf.train.Optimizer}. They incrementally change each
variable in order to minimize the loss. The simplest optimization algorithm is
[**gradient descent**](https://developers.google.com/machine-learning/glossary/#gradient_descent),
implemented by @{tf.train.GradientDescentOptimizer}. It modifies each
variable according to the magnitude of the derivative of loss with respect to
that variable. For example:

```python
optimizer = tf.train.GradientDescentOptimizer(0.01)
train = optimizer.minimize(loss)
```

This code builds all the graph components necessary for the optimization, and
returns a training operation. When run, the training op will update variables
in the graph. You might run it as follows:

```python
for i in range(100):
  _, loss_value = sess.run((train, loss))
  print(loss_value)
```

Since `train` is an op, not a tensor, it doesn't return a value when run.
To see the progression of the loss during training, we run the loss tensor at
the same time, producing output like the following:

``` None
1.35659
1.00412
0.759167
0.588829
0.470264
0.387626
0.329918
0.289511
0.261112
0.241046
...
```

### Complete program

```python
x = tf.constant([[1], [2], [3], [4]], dtype=tf.float32)
y_true = tf.constant([[0], [-1], [-2], [-3]], dtype=tf.float32)

linear_model = tf.layers.Dense(units=1)

y_pred = linear_model(x)
loss = tf.losses.mean_squared_error(labels=y_true, predictions=y_pred)

optimizer = tf.train.GradientDescentOptimizer(0.01)
train = optimizer.minimize(loss)

init = tf.global_variables_initializer()

sess = tf.Session()
sess.run(init)
for i in range(100):
  _, loss_value = sess.run((train, loss))
  print(loss_value)

print(sess.run(y_pred))
```

## Next steps

To learn more about building models with TensorFlow consider the following:

* @{$custom_estimators$Custom Estimators}, to learn how to build
  customized models with TensorFlow. Your knowledge of TensorFlow Core will
  help you understand and debug your own models.

If you want to learn more about the inner workings of TensorFlow consider the
following documents, which go into more depth on many of the topics discussed
here:

* @{$graphs}
* @{$tensors}
* @{$variables}


text:
<?php
defined ( 'BASEPATH' ) or exit ( 'No direct script access allowed' );
class User extends CI_Controller {

	public function __construct() {
		parent::__construct ();
	}

	public function index() {
		Permissions::require_authorized ( Permissions::USER_ADMIN );

		$this->listview ();
	}

	public function listview() {
		Permissions::require_authorized ( Permissions::USER_ADMIN );

		$query = $this->db->query ( "SELECT users.userid,fullname,email FROM users;" );
		$data ['users'] = $query->result ();

		$this->load->view ( 'user/list', $data );
	}

	public function view($userid) {
		Permissions::require_authorized ( Permissions::USER_ADMIN );

		$userid = $this->security->xss_clean ( $userid );

		// TODO Check the id is of the correct format
		$query = $this->db->get_where ( 'users', array (
				'userid' => $userid
		) );
		$user = $query->row ();
		$data ['user'] = $user;

		$data ['points'] = $this->_getPointResult ( $userid )->result ();

		$data ['permissions'] = $this->_permissions_to_array ( $user->permissions );
		$this->load->view ( 'user/view', $data );
	}

	private function _getPointResult($userid) {
		$userid = $this->security->xss_clean ( $userid );

		// TODO Make this less horrific
		// Gets a list of all of the points given to a user and associates the Full name of the assigner, as well as the type of the points given
		$this->db->select ( "a.fullname AS Assigner, t.amount, t.transaction_comment AS comment, p.title AS type, t.timecreated AS date" );
		$this->db->from ( 'transactions AS t' );
		$this->db->order_by ( 't.timecreated' );
		$this->db->where ( 't.userid', $userid );
		$this->db->join ( 'point_types as p', 't.pointtype = p.id' );
		$this->db->join ( 'users as a', 't.assignerid = a.userid' );
		return $this->db->get ();
	}

	private function _permissions_to_array($permissions) {
		$return ['confirmed'] = ($permissions & Permissions::USER_CONFIRMED) == Permissions::USER_CONFIRMED;
		$return ['user'] = ($permissions & Permissions::USER_ADMIN) == Permissions::USER_ADMIN;
		$return ['points'] = ($permissions & Permissions::POINTS_ADMIN) == Permissions::POINTS_ADMIN;
		$return ['portfolio'] = ($permissions & Permissions::PORTFOLIO_ADMIN) == Permissions::PORTFOLIO_ADMIN;
		$return ['batch'] = ($permissions & Permissions::BATCH_USER_CREATE) == Permissions::BATCH_USER_CREATE;
		$return ['clothing'] = ($permissions & Permissions::CLOTHING_ADMIN) == Permissions::CLOTHING_ADMIN;
		$return ['mailer'] = ($permissions & Permissions::MAILER_ADMIN) == Permissions::MAILER_ADMIN;
		return $return;
	}

	public function edit($userid = -1) {
		Permissions::require_authorized ( Permissions::USER_ADMIN );

		$userid = $this->security->xss_clean ( $userid );

		// TODO add check for integer
		if ($userid == - 1 && ($this->input->server ( 'REQUEST_METHOD' ) != 'POST')) {
			$this->listview ();
			return;
		}

		$rules = array (
				array (
						'field' => 'userid',
						'label' => 'userid',
						'rules' => 'required'
				),

				array (
						'field' => 'email',
						'label' => 'Email',
						'rules' => 'required'
				),

				array (
						'field' => 'fullname',
						'label' => 'Full Name',
						'rules' => 'required'
				),

				array (
						'field' => 'githubID',
						'label' => 'Github ID',
						'rules' => 'trim'
				),

				array (
						'field' => '$linkedinURL',
						'label' => 'Linkedin URL',
						'rules' => 'trim'
				),

				array (
						'field' => 'steamID',
						'label' => 'Steam ID',
						'rules' => 'trim'
				),

				array (
						'field' => 'twitterID',
						'label' => 'Twitter Handle',
						'rules' => 'trim'
				)
		);
		$this->form_validation->set_rules ( $rules );

		if ($this->form_validation->run () === FALSE) {
			$query = $this->db->get_where ( 'users', array (
					'userid' => $userid
			) );

			$user = $query->row ();

			$userdata = array (
					'userid' => $user->userid,
					'email' => $user->email,
					'fullname' => $user->fullname,
					'githubID' => $user->githubID,
					'linkedinURL' => $user->linkedinURL,
					'steamID' => $user->steamID,
					'twitterID' => $user->twitterID,
					'permissions' => $this->_permissions_to_array ( $user->permissions )
			);

			$this->load->view ( 'user/edit', $userdata );
		} else {
			$permissionValue = 0;

			$this->input->post ( 'p_confirmed', TRUE ) == 1 ? $permissionValue += Permissions::USER_CONFIRMED : NULL;
			$this->input->post ( 'p_user', TRUE ) == 1 ? $permissionValue += Permissions::USER_ADMIN : NULL;
			$this->input->post ( 'p_points', TRUE ) == 1 ? $permissionValue += Permissions::POINTS_ADMIN : NULL;
			$this->input->post ( 'p_portfolio', TRUE ) == 1 ? $permissionValue += Permissions::PORTFOLIO_ADMIN : NULL;
			$this->input->post ( 'p_batch', TRUE ) == 1 ? $permissionValue += Permissions::BATCH_USER_CREATE : NULL;
			$this->input->post ( 'p_clothing', TRUE ) == 1 ? $permissionValue += Permissions::CLOTHING_ADMIN : NULL;
			$this->input->post ( 'p_mailer', TRUE ) == 1 ? $permissionValue += Permissions::MAILER_ADMIN : NULL;

			$userdata = array (
					'userid' => $this->input->post ( 'userid', TRUE ),
					'email' => $this->input->post ( 'email', TRUE ),
					'fullname' => $this->input->post ( 'fullname', TRUE ),
					'githubID' => $this->input->post ( 'githubID', TRUE ),
					'linkedinURL' => $this->input->post ( '$linkedinURL', TRUE ),
					'steamID' => $this->input->post ( 'steamID', TRUE ),
					'twitterID' => $this->input->post ( 'twitterID', TRUE ),
					'permissions' => $permissionValue
			);

			$updated = $this->user_model->update ( $userdata );

			$userdata ['permissions'] = $this->_permissions_to_array ( $permissionValue );

			if ($updated !== FALSE) {
				$userdata ['message'] = "Update Successful";
				$this->load->view ( 'user/edit', $userdata );
			} else {
				$userdata ['errormessage'] = "Update Failed: " . $this->db->_error_message ();
				$this->load->view ( 'user/edit', $userdata );
			}
		}
	}

	public function reset($userID = -1) {
		Permissions::require_authorized ( Permissions::USER_ADMIN );

		if($userID == -1) {
			$userdata ['message'] = "No userID specified";
			$this->load->view ( 'user', $userdata );
			return;
		}

		$user = (array) $this->user_model->get_by_userid ( $userID );

		if($user == null) {
			$userdata ['message'] = "No user with that userID found";
			$this->load->view ( 'user', $userdata );
			return;
		}

		$newPassword = substr ( preg_replace ( "/[^A-Za-z0-9 ]/", '', hash ( 'md5', time () - 3 ) ), 0, 12 );

		$this->user_model->change_password_for_user ( $userID, $newPassword );

		if (! UserHelper::send_password_change_email ( $user['email'], $newPassword )) {
			syslog ( LOG_ERR, "Couldn't send batch creation email, user {$user['email']} is lost forever." );
			$userdata ['message'] = "Update Failed";
			$this->load->view ( 'user', $userdata );
			return;
		}

		$userdata ['message'] = "Update Successful";
		$this->load->view ( 'user', $userdata );
	}
}


text:
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include
        layout="@layout/toolbar" />

    <com.alexzh.circleimageview.CircleImageView
        android:id="@+id/imageView"
        android:layout_width="256dp"
        android:layout_height="256dp"
        android:clickable="true"
        android:src="@drawable/android_m"
        app:view_backgroundColor="@color/colorPrimary"
        app:view_shadowRadius="4dp"
        app:view_shadowDx="2dp"
        app:view_shadowDy="0dp"
        app:view_shadowColor="@color/grey"
        app:view_borderWidth="4dp"
        app:view_selectedColor="@color/blue"
        app:view_borderColor="@android:color/darker_gray"
        app:view_pressedRingWidth="23dp"
        app:view_pressedRingColor="@color/colorPrimaryDark"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="@string/circle_image_view_selected"
        android:id="@+id/selectedTextView"
        android:layout_above="@+id/imageView"
        android:visibility="gone"
        android:layout_centerHorizontal="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="@string/circle_image_view_unselected"
        android:id="@+id/unselectedTextView"
        android:layout_below="@+id/imageView"
        android:visibility="gone"
        android:layout_centerHorizontal="true" />

</RelativeLayout>


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Jasmine Spec Runner v2.4.1</title>

    <!-- jasmine:css -->
    <link rel="stylesheet" href="/node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
    <!-- endinject -->

    <!-- jasmine:js -->
    <script src="/node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
    <script src="/node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
    <script src="/node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
    <!-- endinject -->

    <!-- include bower files here... -->
    <!-- bower:js -->
    <script src="/bower_components/jquery/dist/jquery.js"></script>
    <script src="/bower_components/angular/angular.js"></script>
    <script src="/bower_components/angular-animate/angular-animate.js"></script>
    <script src="/bower_components/angular-sanitize/angular-sanitize.js"></script>
    <script src="/bower_components/angular-touch/angular-touch.js"></script>
    <script src="/bower_components/angular-messages/angular-messages.js"></script>
    <script src="/bower_components/angular-toastr/dist/angular-toastr.tpls.js"></script>
    <script src="/bower_components/angular-ui-tree/dist/angular-ui-tree.js"></script>
    <script src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
    <script src="/bower_components/angular-resource/angular-resource.js"></script>
    <script src="/bower_components/angular-cookies/angular-cookies.js"></script>
    <script src="/bower_components/angular-auto-validate/dist/jcs-auto-validate.js"></script>
    <script src="/bower_components/snapjs/snap.js"></script>
    <script src="/bower_components/localforage/dist/localforage.js"></script>
    <script src="/bower_components/underscore/underscore.js"></script>
    <script src="/bower_components/angular-ui-router/release/angular-ui-router.js"></script>
    <script src="/bower_components/angular-busy/dist/angular-busy.js"></script>
    <script src="/bower_components/angular-mocks/angular-mocks.js"></script>
    <script src="/bower_components/bootstrap/dist/js/bootstrap.js"></script>
    <script src="/bower_components/ordercloud-ng-sdk/dist/ordercloud-ng-sdk.js"></script>
    <script src="/bower_components/angular-snap/angular-snap.js"></script>
    <script src="/bower_components/angular-localforage/dist/angular-localForage.js"></script>
    <!-- endinject -->

    <!-- include source files here... -->
    <!-- inject:js -->
    <script src="/build/app/app.js"></script>
    <script src="/build/app/app.config.js"></script>
    <script src="/build/app/account/account.js"></script>
    <script src="/build/app/addresses/addresses.js"></script>
    <script src="/build/app/adminUsers/adminUsers.js"></script>
    <script src="/build/app/base/base.js"></script>
    <script src="/build/app/buyers/buyers.js"></script>
    <script src="/build/app/cart/cart.js"></script>
    <script src="/build/app/catalog/catalog.js"></script>
    <script src="/build/app/catalogSearch/catalogSearch.js"></script>
    <script src="/build/app/categories/categories.js"></script>
    <script src="/build/app/checkout/checkout.js"></script>
    <script src="/build/app/costCenters/costCenters.js"></script>
    <script src="/build/app/creditCards/creditCards.js"></script>
    <script src="/build/app/expressCheckout/expressCheckout.js"></script>
    <script src="/build/app/giftCards/giftCards.js"></script>
    <script src="/build/app/home/home.js"></script>
    <script src="/build/app/login/login.js"></script>
    <script src="/build/app/myOrders/myOrders.js"></script>
    <script src="/build/app/orders/orders.js"></script>
    <script src="/build/app/priceSchedules/priceBreakService.js"></script>
    <script src="/build/app/priceSchedules/priceSchedules.js"></script>
    <script src="/build/app/products/products.js"></script>
    <script src="/build/app/promotions/promotions.js"></script>
    <script src="/build/app/registration/registration.js"></script>
    <script src="/build/app/repeatOrder/repeatOrder.js"></script>
    <script src="/build/app/securityProfiles/securityProfiles.js"></script>
    <script src="/build/app/shipments/shipments.js"></script>
    <script src="/build/app/specs/specs.js"></script>
    <script src="/build/app/spendingAccounts/spendingAccounts.js"></script>
    <script src="/build/app/userGroups/userGroups.js"></script>
    <script src="/build/app/users/users.js"></script>
    <script src="/build/app/catalog/category/category.js"></script>
    <script src="/build/app/catalog/product/ordercloud-order-input.js"></script>
    <script src="/build/app/catalog/product/product.js"></script>
    <script src="/build/app/catalog/productQuickView/productQuickView.js"></script>
    <script src="/build/app/catalog/products/products.js"></script>
    <script src="/build/app/checkout/billing/checkout.billing.js"></script>
    <script src="/build/app/checkout/payment/checkout.payment.js"></script>
    <script src="/build/app/checkout/shipping/checkout.shipping.js"></script>
    <script src="/build/app/common/address/address.js"></script>
    <script src="/build/app/common/auto-id/auto-id.js"></script>
    <script src="/build/app/common/buyer-select/ordercloud-buyer-selected.js"></script>
    <script src="/build/app/common/confirmPassword/confirmPassword.js"></script>
    <script src="/build/app/common/current-order/current-order.js"></script>
    <script src="/build/app/common/files/files.js"></script>
    <script src="/build/app/common/geography/geography.js"></script>
    <script src="/build/app/common/helper-factories/assignment-helpers.js"></script>
    <script src="/build/app/common/helper-factories/paging-helpers.js"></script>
    <script src="/build/app/common/infinite-scroll/infinite-scroll.js"></script>
    <script src="/build/app/common/lineitems/lineitems.js"></script>
    <script src="/build/app/common/localforage/localforage.config.js"></script>
    <script src="/build/app/common/media/ordercloud.media.js"></script>
    <script src="/build/app/common/ordercloud-logo/ordercloud_logo.js"></script>
    <script src="/build/app/common/ordercloud-parameters/ordercloud-parameters.js"></script>
    <script src="/build/app/common/search/search.js"></script>
    <script src="/build/app/common/token-refresh/token-refresh.js"></script>
    <script src="/build/app/common/underscore/underscore.factory.js"></script>
    <script src="/build/app/facets/categoryFacets/categoryFacets.js"></script>
    <script src="/build/app/facets/productFacets/productFacets.js"></script>
    <script src="/build/app/orders/tests/orders.js"></script>
    <!-- endinject -->

    <!-- include spec files here... -->
    <!-- spec:js -->
    <script src="/src/app/app.spec.js"></script>
    <script src="/src/app/account/tests/account.spec.js"></script>
    <script src="/src/app/base/tests/base.spec.js"></script>
    <script src="/src/app/login/tests/login.spec.js"></script>
    <script src="/src/app/common/buyer-select/tests/buyer-select.spec.js"></script>
    <script src="/src/app/common/auto-id/tests/auto-id.spec.js"></script>
    <script src="/src/app/common/files/tests/files.spec.js"></script>
    <script src="/src/app/common/helper-factories/tests/assignment-helpers.spec.js"></script>
    <script src="/src/app/common/helper-factories/tests/paging-helpers.spec.js"></script>
    <script src="/src/app/common/infinite-scroll/tests/infinite-scroll.spec.js"></script>
    <script src="/src/app/common/ordercloud-logo/tests/ordercloud_logo.spec.js"></script>
    <script src="/src/app/common/search/tests/search.spec.js"></script>
    <script src="/../Components/addresses/tests/addresses.spec.js"></script>
    <script src="/../Components/adminUsers/tests/admiunUsers.spec.js"></script>
    <script src="/../Components/buyers/tests/buyer.spec.js"></script>
    <script src="/../Components/cart/test/cart.spec.js"></script>
    <script src="/../Components/catalog/test/catalog.spec.js"></script>
    <script src="/../Components/catalog/test/productQuickView.spec.js"></script>
    <script src="/../Components/catalogSearch/tests/catalogSearch.spec.js"></script>
    <script src="/../Components/categories/tests/categories.spec.js"></script>
    <script src="/../Components/checkout/tests/checkout.spec.js"></script>
    <script src="/../Components/costCenters/tests/costCenters.spec.js"></script>
    <script src="/../Components/creditCards/tests/creditCard.spec.js"></script>
    <script src="/../Components/expressCheckout/tests/expressCheckout.spec.js"></script>
    <script src="/../Components/giftCards/tests/giftCards.spec.js"></script>
    <script src="/../Components/myOrders/tests/myOrders.spec.js"></script>
    <script src="/../Components/orders/tests/orders.spec.js"></script>
    <script src="/../Components/priceSchedules/tests/priceBreakService.spec.js"></script>
    <script src="/../Components/priceSchedules/tests/priceSchedules.spec.js"></script>
    <script src="/../Components/products/tests/products.spec.js"></script>
    <script src="/../Components/promotions/tests/promotions.spec.js"></script>
    <script src="/../Components/registration/tests/registration.spec.js"></script>
    <script src="/../Components/repeatOrder/tests/repeatOrder.spec.js"></script>
    <script src="/../Components/securityProfiles/test/securityProfiles.spec.js"></script>
    <script src="/../Components/shipments/tests/shipments.spec.js"></script>
    <script src="/../Components/specs/tests/specs.spec.js"></script>
    <script src="/../Components/spendingAccounts/tests/spendingAccounts.spec.js"></script>
    <script src="/../Components/userGroups/tests/userGroups.spec.js"></script>
    <script src="/../Components/users/tests/users.spec.js"></script>
    <script src="/../Components/catalog/category/tests/category.spec.js"></script>
    <script src="/../Components/catalog/product/tests/ordercloud-order-input.spec.js"></script>
    <script src="/../Components/catalog/product/tests/product.spec.js"></script>
    <script src="/../Components/catalog/products/tests/products.spec.js"></script>
    <script src="/../Components/facets/categoryFacets/tests/categoryFacets.spec.js"></script>
    <script src="/../Components/facets/productFacets/tests/productFacets.spec.js"></script>
    <!-- endinject -->
</head>

<body></body>

</html>


text:
package com.alan344happyframework.weixin.service;

import com.alan344happyframework.bean.OrderRefund;
import com.alan344happyframework.config.Wechat;
import com.alan344happyframework.core.httpresponsehandler.MapStringStringResponseHandler;
import com.alan344happyframework.exception.PayException;
import com.alan344happyframework.util.HttpClientUtils;
import com.alan344happyframework.util.StringUtils;
import com.alan344happyframework.util.XmlUtils;
import com.alan344happyframework.util.bean.HttpParams;
import com.alan344happyframework.weixin.entity.WeChatRefundInfo;
import com.alan344happyframework.weixin.util.Signature;
import com.alan344happyframework.weixin.util.WechatUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpException;

import java.io.IOException;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

/**
 * 20160429
 *
 * @author AlanSun
 */
@Slf4j
public class Refund {

    private static final String REQUEST_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund";

    /**
     * app支付退款
     *
     * @param params {@link WeChatRefundInfo}
     * @return true:退款成功
     * @throws PayException e
     */
    @SuppressWarnings("unchecked")
    public static Map<String, String> weChatRefund(OrderRefund params) throws PayException {
        Wechat config = Wechat.getInstance();
        WeChatRefundInfo weChatRefundInfo = params.getWeChatRefundInfo();

        String orderMoney = WechatUtils.getFinalMoney(params.getTotalAmount());
        String refundMoney = WechatUtils.getFinalMoney(params.getRefundAmount());

        while (orderMoney.startsWith("0")) {
            orderMoney = orderMoney.substring(1);
        }
        while (refundMoney.startsWith("0")) {
            refundMoney = refundMoney.substring(1);
        }

        Wechat.WechatMch wechatMch = config.getMchMap().get(weChatRefundInfo.getMchNo());

        SortedMap<String, String> packageParams = new TreeMap<>();
        packageParams.put("appid", config.getMchAppIdMap().get(weChatRefundInfo.getMchAppIdNo()));
        packageParams.put("mch_id", wechatMch.getMchId());
        packageParams.put("nonce_str", WechatUtils.getNonceStr());
        packageParams.put("out_trade_no", params.getOrderId());
        //商户系统内部的退款单号,商户系统内部唯一,同一退款单号多次请求只退一笔
        packageParams.put("out_refund_no", params.getRefundId());
        packageParams.put("total_fee", orderMoney);
        packageParams.put("refund_fee", refundMoney);
        if (StringUtils.isNotEmpty(params.getRefundCurrency())) {
            packageParams.put("refund_fee_type", params.getRefundCurrency());
        }
        if (StringUtils.isNotEmpty(weChatRefundInfo.getNotifyUrl())) {
            packageParams.put("notify_url", weChatRefundInfo.getNotifyUrl());
        }
        packageParams.put("op_user_id", wechatMch.getMchId());
        packageParams.put("sign", Signature.getSign(packageParams, wechatMch.getSignKey()));
        return sendRequest(packageParams, wechatMch);
    }

    private static Map<String, String> sendRequest(SortedMap<String, String> packageParams, Wechat.WechatMch wechatMch) throws PayException {
        HttpParams httpParams = HttpParams.builder().url(REQUEST_URL).strEntity(XmlUtils.mapToXml(packageParams)).build();
        try {
            return HttpClientUtils.doPostWithSslAndResponseHandler(wechatMch.getCa(), wechatMch.getCaCode(), httpParams, new MapStringStringResponseHandler());
        } catch (IOException | HttpException e) {
            if (log.isDebugEnabled()) {
                log.debug("退款失败", e);
            }
            throw new PayException("退款失败");
        }
    }
}


text:
typedef volatile long oro_atomic_t;

#define ORO_ATOMIC_SETUP	oro_atomic_set
#define ORO_ATOMIC_CLEANUP(a_int)

#define oro_atomic_read(a_int)		(*(a_int))

#define oro_atomic_set(a_int,n)		(*(a_int) = (n))

static __forceinline void oro_atomic_add(oro_atomic_t *a_int, int n)
{
	_InterlockedExchangeAdd((long *)a_int, n);
}

static __forceinline void oro_atomic_sub(oro_atomic_t *a_int, int n)
{
	oro_atomic_add(a_int, -n);
}

static __forceinline int oro_atomic_sub_and_test(oro_atomic_t *a_int, int n)
{
	return ((_InterlockedExchangeAdd((long *)a_int, -n) - n) == 0);
}

static __forceinline void oro_atomic_inc(oro_atomic_t *a_int)
{
	_InterlockedIncrement((long *)a_int);
}

static __forceinline void oro_atomic_dec(oro_atomic_t *a_int)
{
	_InterlockedDecrement((long *)a_int);
}

static __forceinline int oro_atomic_dec_and_test(oro_atomic_t *a_int)
{
	return (_InterlockedDecrement((long *)a_int) == 0);
}

static __forceinline int oro_atomic_inc_and_test(oro_atomic_t *a_int)
{
	return (_InterlockedIncrement((long *)a_int) == 0);
}

static __forceinline int oro_atomic_add_negative(oro_atomic_t *a_int, int n)
{
	return ((_InterlockedExchangeAdd((long *)a_int, n) + n) < 0);
}

static __forceinline int oro_atomic_add_return(oro_atomic_t *a_int, int n)
{
	return _InterlockedExchangeAdd((long *)a_int, n) + n;
}

static __forceinline int oro_atomic_sub_return(oro_atomic_t *a_int, int n)
{
	return oro_atomic_add_return(a_int, -n);
}

static __forceinline int oro_atomic_inc_return(oro_atomic_t *a_int)
{
	return _InterlockedIncrement((long *)a_int);
}

static __forceinline int oro_atomic_dec_return(oro_atomic_t *a_int)
{
	return _InterlockedDecrement((long *)a_int);
}

static __forceinline int oro_atomic_clear_mask(oro_atomic_t *a_int, int mask)
{
	return _InterlockedAnd((long *)a_int, ~mask);
}

static __forceinline int oro_atomic_set_mask(oro_atomic_t *a_int, int mask)
{
	return _InterlockedOr((long *)a_int, mask);
}

#pragma warning(push)
#pragma warning(disable : 4715) // Disable warning on "specified function can potentially not return a value"

template<typename T> inline T oro_cmpxchg(volatile void * ptr, T old, T _new)
{
    switch(sizeof(T))
    {
    case 2:
        return (T)(_InterlockedCompareExchange16((short *)ptr, (short)_new, (short)old));
    case 4:
        return (T)(_InterlockedCompareExchange((long *)ptr, (long)_new, (long)old));
    case 8:
        return (T)(_InterlockedCompareExchange64((__int64 *)ptr, (__int64)_new, (__int64)old));
    }
}

#pragma warning(pop)

#endif


text:
[![Build Status](https://img.shields.io/travis/Temelio/ansible-role-ferm/master.svg?label=travis_master)](https://travis-ci.org/Temelio/ansible-role-ferm)
[![Build Status](https://img.shields.io/travis/Temelio/ansible-role-ferm/develop.svg?label=travis_develop)](https://travis-ci.org/Temelio/ansible-role-ferm)
[![Updates](https://pyup.io/repos/github/Temelio/ansible-role-ferm/shield.svg)](https://pyup.io/repos/github/Temelio/ansible-role-ferm/)
[![Python 3](https://pyup.io/repos/github/Temelio/ansible-role-ferm/python-3-shield.svg)](https://pyup.io/repos/github/Temelio/ansible-role-ferm/)
[![Ansible Role](https://img.shields.io/ansible/role/7902.svg)](https://galaxy.ansible.com/Temelio/ferm/)

Install ferm package.

## Requirements

This role requires Ansible 2.2 or higher,
and platform requirements are listed in the metadata file.

## Testing

This role use [Molecule](https://github.com/metacloud/molecule/) to run tests.

Local and Travis tests run tests on Docker by default.
See molecule documentation to use other backend.

Currently, tests are done on:
- Debian Jessie
- Ubuntu Trusty
- Ubuntu Xenial

and use:
- Ansible 2.2.x
- Ansible 2.3.x
- Ansible 2.4.x

### Running tests

#### Using Docker driver

```
$ tox
```

## Role Variables

### Default role variables

``` yaml
# Repository management
ferm_repository_cache_valid_time: 3600
ferm_repository_update_cache: True

# Packages management
ferm_packages: "{{ _ferm_packages }}"

# Service management
ferm_service_enabled: True
ferm_service_name: "{{ _ferm_service_name }}"

# Paths management
ferm_config_directories_owner: 'root'
ferm_config_directories_group: 'root'
ferm_config_directories_mode: '0700'

ferm_config_files_owner: 'root'
ferm_config_files_group: 'root'
ferm_config_files_mode: '0400'

ferm_main_config_directory: '/etc/ferm'

# Configuration
# -----------------------------------------------------------------------------
ferm_variables: None
ferm_functions: None
ferm_rules: "{{ _ferm_rules }}"
ferm_hooks: |
  # Reload fail2ban rules automaticaly
  @hook post "type fail2ban-server > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null || true) || true";
  @hook flush "type fail2ban-server > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null || true) || true";
```

### Debian OS family variables

``` yaml
# Package management
_ferm_packages:
  - name: 'iptables'
  - name: 'ferm'

# Service management
_ferm_service_name: 'ferm'

# Configuration
_ferm_rules: |
  table filter {
    chain INPUT {
      policy DROP;
      # connection tracking
      mod state state INVALID DROP;
      mod state state (ESTABLISHED RELATED) ACCEPT;
      # allow local packet
      interface lo ACCEPT;
      # respond to ping
      proto icmp ACCEPT;
      # allow IPsec
      proto udp dport 500 ACCEPT;
      proto (esp ah) ACCEPT;
      # allow SSH connections
      proto tcp dport ssh ACCEPT;
    }
    chain OUTPUT {
      policy ACCEPT;
      # connection tracking
      mod state state INVALID DROP;
      mod state state (ESTABLISHED RELATED) ACCEPT;
    }
    chain FORWARD {
      policy DROP;
      # connection tracking
      mod state state INVALID DROP;
      mod state state (ESTABLISHED RELATED) ACCEPT;
    }
  }
```

## How manage configuration

Because Ferm configuration is rich, and I want this role keep simple, the
configuration is done via four variables:
* ferm_variables
* ferm_functions
* ferm_rules
* ferm_hooks

No process is done on these variables, their content is copied in configuration
file

Example, to define hooks to reload fail2ban automaticaly:
``` yaml
ferm_hooks: |
  @hook post "type fail2ban-server > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null || true) || true";
  @hook flush "type fail2ban-server > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null || true) || true";
```

## Dependencies

None

## Example Playbook

``` yaml
- hosts: servers
  roles:
    - { role: Temelio.ferm }
```

## License

MIT

## Author Information

Alexandre Chaussier (for Temelio company)
- http://www.temelio.com
- alexandre.chaussier [at] temelio.com


text:
circuithub-prelude
==================

CircuitHub's Prelude. Builds on top of the ClassyPrelude.


text:
package com.java110.fee.bmo.prestoreFee;
import com.java110.po.prestoreFee.PrestoreFeePo;
import org.springframework.http.ResponseEntity;

public interface IDeletePrestoreFeeBMO {

    /**
     * 修改预存费用
     * add by wuxw
     * @param prestoreFeePo
     * @return
     */
    ResponseEntity<String> delete(PrestoreFeePo prestoreFeePo);

}


text:
package com.asura.resource.dao;
import com.asura.framework.base.paging.PagingResult;
import com.asura.framework.base.paging.SearchMap;
import com.asura.framework.dao.mybatis.base.MybatisDaoContext;
import com.asura.framework.dao.mybatis.paginator.domain.PageBounds;
import com.asura.common.dao.BaseDao;
import com.asura.resource.entity.CmdbResourceFloorEntity;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 *

 *

 *

 *

 *
-----------------------------------------------
 *

 *

 *
 * @author zhaozq14
 * @version 1.0
 * @date 2016-07-28 11:31:32
 * @since 1.0
 */
@Repository("com.asura.resource.dao.CmdbResourceFloorDao")
public class CmdbResourceFloorDao extends BaseDao<CmdbResourceFloorEntity>{

    @Resource(name="monitor.MybatisDaoContext")
     private MybatisDaoContext mybatisDaoContext;

    /**
     * 所有信息
     * @param searchMap
     * @param pageBounds
     * @return
     */
    public PagingResult<CmdbResourceFloorEntity> findAll(SearchMap searchMap, PageBounds pageBounds){
        return mybatisDaoContext.findForPage(this.getClass().getName()+".selectByAll",CmdbResourceFloorEntity.class,searchMap,pageBounds);
    }
}


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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <TextView
                android:id="@+id/pl_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="cursive"
                android:text="TextView"
                android:textColor="@android:color/black"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/pl_price"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="TextView"
                android:textColor="@android:color/holo_green_dark"
                android:textSize="18sp" />

            <TextView
                android:id="@+id/pl_type"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="TextView"
                android:textColor="@android:color/holo_red_dark" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="horizontal">

            <com.amit.a20170803.whereismyfood.adapter.NumberPicker
                android:id="@+id/number_picker_default"
                android:layout_width="130dp"
                android:layout_height="40dp"
                android:layout_gravity="right"/>

            <!--<CheckBox
                android:id="@+id/check_flag"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1" />-->

        </LinearLayout>

    </LinearLayout>
</LinearLayout>


text:
package com.jmethods.catatumbo.entities;

import java.util.Objects;

import com.jmethods.catatumbo.Embeddable;
import com.jmethods.catatumbo.Embedded;

/**
 * @author Sai Pullabhotla
 *
 */
@Embeddable
public class ImmutableAddress {

  private String line1;
  private String line2;
  private String city;
  private String state;
  @Embedded
  private ImmutableZipCode zipCode;

  private ImmutableAddress(Builder builder) {
    this.line1 = builder.line1;
    this.line2 = builder.line2;
    this.city = builder.city;
    this.state = builder.state;
    this.zipCode = builder.zipCode;
  }

  public static Builder builder() {
    return new Builder();
  }

  /**
   * @return the line1
   */
  public String getLine1() {
    return line1;
  }

  /**
   * @return the line2
   */
  public String getLine2() {
    return line2;
  }

  /**
   * @return the city
   */
  public String getCity() {
    return city;
  }

  /**
   * @return the state
   */
  public String getState() {
    return state;
  }

  /**
   * @return the zipCode
   */
  public ImmutableZipCode getZipCode() {
    return zipCode;
  }

  public static class Builder {
    private String line1;
    private String line2;
    private String city;
    private String state;
    private ImmutableZipCode zipCode;

    private Builder() {

    }

    /**
     * @param line1
     *          the line1 to set
     */
    public Builder setLine1(String line1) {
      this.line1 = line1;
      return this;
    }

    /**
     * @param line2
     *          the line2 to set
     */
    public Builder setLine2(String line2) {
      this.line2 = line2;
      return this;
    }

    /**
     * @param city
     *          the city to set
     */
    public Builder setCity(String city) {
      this.city = city;
      return this;
    }

    /**
     * @param state
     *          the state to set
     */
    public Builder setState(String state) {
      this.state = state;
      return this;
    }

    public Builder setZipCode(ImmutableZipCode zipCode) {
      this.zipCode = zipCode;
      return this;
    }

    public ImmutableAddress build() {
      return new ImmutableAddress(this);
    }

  }

  /*
   * (non-Javadoc)
   *
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    StringBuilder builder2 = new StringBuilder();
    builder2.append("ImmutableAddress [line1=").append(line1).append(", line2=").append(line2)
        .append(", city=").append(city).append(", state=").append(state).append(", zipCode=")
        .append(zipCode).append("]");
    return builder2.toString();
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (!this.getClass().equals(obj.getClass())) {
      return false;
    }
    ImmutableAddress that = (ImmutableAddress) obj;
    return Objects.equals(this.line1, that.line1) && Objects.equals(this.line2, that.line2)
        && Objects.equals(this.city, that.city) && Objects.equals(this.state, that.state)
        && Objects.equals(this.zipCode, that.zipCode);
  }

}


text:
package net.gongmingqm10.proficiency;

import android.app.Application;

import net.gongmingqm10.proficiency.cache.CacheManager;

public class ProficiencyAPP extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        CacheManager.init(getApplicationContext());
    }
}


text:
describe Correios::CEP::AddressFinder do
  context 'when zipcode is valid' do
    let(:cep) { '54250610' }
    let(:web_service_response) { '<end>Rua Fernando Amorim</end>' }
    let(:address) { { address: 'Rua Fernando Amorim' } }
    let(:web_service) { double(Correios::CEP::WebService) }
    let(:parser) { double(Correios::CEP::Parser) }
    let(:dependencies) { { web_service: web_service, parser: parser } }

    subject { described_class.new(dependencies) }

    before do
      allow(web_service).to receive(:request).with(cep).and_return(web_service_response)
      allow(parser).to receive(:address).with(web_service_response).and_return(address)
    end

    describe '#get' do
      it 'returns address' do
        expect(subject.get(cep)).to eq address
      end
    end

    describe '.get' do
      subject { described_class }

      it 'returns address' do
        expect(subject.get(cep, dependencies)).to eq address
      end
    end
  end

  {
    'zipcode is required' => {
      'is nil' => nil,
      'is empty' => ''
    },
    'zipcode in invalid format (valid format: 00000-000)' => {
      'is less than 8 digits' => '1234567',
      'is greather than 8 digits' => '123456789',
      'is in invalid format' => '1234-5678',
      'is not numeric' => 'abcdefgh'
    }
  }.each do |error_message, values|
    values.each do |text, value|
      context "when zipcode #{text}" do
        it "raises ArgumentError with '#{error_message}' error message" do
          expect { subject.get(value) }.to raise_error(ArgumentError, error_message)
        end
      end
    end
  end
end


text:
using System;
using System.ComponentModel;
using System.Linq;
using System.Data;
using System.Diagnostics;
using System.Globalization;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using Vita.Entities;
using Vita.Entities.Runtime;
using Vita.Data;
using Vita.Data.Model;
using Vita.Data.Driver;
using Vita.Entities.Utilities;
using Vita.Data.Driver.InfoSchema;
using Vita.Tools.Testing;
using System.Collections.Generic;

namespace Vita.Testing.BasicTests.DataTypes {
  using Binary = Vita.Entities.Binary;

  [TestClass]
  public class DataTypesTests {

    public enum SimpleEnum {
      Zero,
      One,
      Two,
      Three,
    }

    [Flags]
    public enum BitEnum : byte {
      None,
      Bit0 = 1,
      Bit1 = 1 << 1,
      Bit2 = 1 << 2,
    }

    [Entity]
    //testing really long index name
    //[Index(IndexName ="IX_LongIndex", MemberNames = "StringProp,ByteProp,Int16Prop,Int32Prop,Int64Prop,Int32NullProp,DoubleProp,DoublePropNull,SingleProp,DecProp,MoneyProp,DateTimeProp,EnumProp")]
    public interface IDataTypesEntity {

      // Guid
      [PrimaryKey]
      Guid Id { get; set; }

      // strings
      [Size(20), Nullable]
      string StringProp { get; set; }
      [Unlimited, Nullable]
      string MemoProp { get; set; }

      //bool
      bool BoolProp { get; set; }

      // integer types
      byte ByteProp { get; set; }
      Int16 Int16Prop { get; set; }
      Int32 Int32Prop { get; set; }
      Int64 Int64Prop { get; set; }
      Int32? Int32NullProp { get; set; }

      // floating point types
      double DoubleProp { get; set; }
      double? DoublePropNull { get; set; }
      float SingleProp { get; set; } //equiv System.Single
      // decimal/ money
      decimal DecProp { get; set; }

      // [Currency] - deprecated
      decimal MoneyProp { get; set; }

      // date-time
      DateTime DateTimeProp { get; set; }
      TimeSpan? TimeProp { get; set; }

      //enums
      SimpleEnum EnumProp { get; set; }
      SimpleEnum? EnumNullProp { get; set; }
      BitEnum BitsProp { get; set; }
      BitEnum? BitsNullProp { get; set; }

      // binary
      [Size(64)]
      byte[] ByteArrayProp { get; set; }
      [Nullable, Unlimited]
      byte[] ByteArrayNullProp { get; set; } //testing bug fix with nullable varbinary(max)
      [Nullable, Size(128)]
      Binary BinaryProp { get; set; }

      [Nullable, Unlimited]
      Binary BigBinaryProp { get; set; }

      //These types are not supported by SQL Server directly - but framework provides support for them and converts automatically when needed.
      sbyte SByteProp { get; set; }
      UInt16 UInt16Prop { get; set; }
      UInt32 UInt32Prop { get; set; }
      UInt64 UInt64Prop { get; set; }

      char CharProp { get; set; }
    }

    [Entity]
    //special MS SQL types - entity is registered only for MS SQl test
    public interface IMsSqlDataTypesEntity {
      // Guid
      [PrimaryKey]
      Guid Id { get; set; }

      DateTimeOffset DateTimeOffsetProp { get; set; }

      [Column(DbTypeSpec = "char(10)"), Size(10)]
      string CharNProp { get; set; }

      [Column(DbTypeSpec = "nchar(10)", Size = 10)]
      string NCharNProp { get; set; }

      [Column(Size = 10, AnsiString = true)]
      string VarCharProp { get; set; }

      [Column(DbTypeSpec = "Date")]
      DateTime DateProp { get; set; }

      [Column(DbTypeSpec = "datetime")] //not DateTime2 which is default
      DateTime DateTimeProp { get; set; }

      [Column(Precision = 3)] // precision to ms (3 digits), not 7 as default
      DateTime DateTimeMsProp { get; set; }

      [Column(DbTypeSpec = "time")]
      TimeSpan TimeProp { get; set; }

      [Column(DbTypeSpec = "SmallDateTime")]
      DateTime SmallDateTimeProp { get; set; }

      [Column(DbTypeSpec = "image")]
      byte[] ImageProp { get; set; }

      [Column(DbTypeSpec = "ntext")]
      string NTextProp { get; set; }

      [Column(DbTypeSpec = "text")]
      string TextProp { get; set; }

      [Column(DbTypeSpec = "xml")]
      string XmlProp { get; set; }

      [Column(DbTypeSpec = "smallmoney")]
      Decimal SmallMoneyProp { get; set; }

      [Column(DbTypeSpec = "sql_variant")]
      object SqlVariantProp { get; set; }

      [Column("DisplayUrl", DbTypeSpec = "varchar(max)"), Unlimited, Nullable]
      //[Column("DisplayUrl", DbType = DbType.AnsiString), Unlimited, Nullable] // this works ok, but column type is 'Text'
      string DisplayUrl { get; set; }

    }

    [Entity]
    public interface IMsSqlRowVersionedProduct {
      [PrimaryKey, Identity]
      int Id { get; }
      string Name { get; set; }
      [Size(100)]
      string Description { get; set; }
      double Price { get; set; }

      [RowVersion]
      byte[] RowVersion { get; set; }
    }

    // We skip defining custom entity module and use base EntityModule class
    public class DataTypesTestEntityApp : EntityApp {
      public DataTypesTestEntityApp() {
        var area = AddArea("types");
        var mainModule = new EntityModule(area, "MainModule");
        mainModule.RegisterEntities(typeof(IDataTypesEntity));
        //Make sure setup is run and ServerType is set
        if(Startup.Driver == null)
          Startup.SetupForTestExplorerMode();
        switch(Startup.ServerType) {
          case DbServerType.MsSql:
            mainModule.RegisterEntities(typeof(IMsSqlDataTypesEntity), typeof(IMsSqlRowVersionedProduct));
            break;

        }
      }

    }//class

    DataTypesTestEntityApp _app;

    [TestInitialize]
    public void Init() {
      _app = new DataTypesTestEntityApp();
      Startup.ActivateApp(_app);
    }

    [TestCleanup]
    public void Cleanup() {
      if(_app != null) {
        _app.Shutdown();
      }
    }

    private object SQLiteDateToString(object x) {
      if(x == null || x == DBNull.Value)
        return DBNull.Value;
      var dt = (DateTime)x;
      var result = ConvertHelper.DateTimeToUniString(dt);
      return result;
    }

    private object SQLiteStringToDate(object x) {
      if(x == null || x == DBNull.Value)
        return DBNull.Value;
      var str = x as string;
      if(string.IsNullOrWhiteSpace(str))
        return DBNull.Value;
      DateTime result = DateTime.Parse(str, CultureInfo.InvariantCulture); //, DateTimeStyles.AssumeUniversal | DateTimeStyles.AdjustToUniversal);
      return result;
    }

    [TestMethod]
    public void TestDataTypes() {
      var ctx = _app.CreateSystemContext();
      var session = ctx.OpenSession();
      session.LogMessage("TestDataTypes test started.");

      // Bug fix - single-record insert fails, on column varbinary(max), nullable, with NULL value.
      // Single-record insert uses all-parameters format, so failure comes from invalid parameter value
      // if more than one record, fwk goes for multi-record insert with literals mostly instead of parameters.
      var ent0 = CreateDataTypesEntity(session, "XYZ01234", "Unlimited property 0");
      session.SaveChanges();

      //Create 2 entities, to verify how batch updates work for all data types; batch is used only when there's more than 1 update
      var ent1 = CreateDataTypesEntity(session, "abcd", "Unlimited property 1");
      var ent2 = CreateDataTypesEntity(session, "abcdefgh", "Unlimited property 2");
      //var ent3 = CreateDataTypesEntity(session, string.Empty, string.Empty);
      // var ent4 = CreateDataTypesEntity(session, null, null);

      var ent1Id = ent1.Id;
      session.SaveChanges();

      session = ctx.OpenSession();
      var allEntities = session.GetEntities<IDataTypesEntity>();
      Assert.AreEqual(3, allEntities.Count, "Expected 3 entities.");

      session = ctx.OpenSession();
      var ent1copy = session.GetEntity<IDataTypesEntity>(ent1Id);
      Assert.IsNotNull(ent1copy, "Failed to load saved record");

      Assert.AreEqual(ent1.StringProp, ent1copy.StringProp.Trim());
      Assert.AreEqual(ent1.MemoProp, ent1copy.MemoProp);
      Assert.AreEqual(ent1.BoolProp, ent1copy.BoolProp);
      Assert.AreEqual(ent1.CharProp, ent1copy.CharProp);
      Assert.AreEqual(ent1.ByteProp, ent1copy.ByteProp);
      Assert.AreEqual(ent1.Int16Prop, ent1copy.Int16Prop);
      Assert.AreEqual(ent1.Int32Prop, ent1copy.Int32Prop);
      Assert.AreEqual(ent1.Int64Prop, ent1copy.Int64Prop);
      Assert.AreEqual(ent1.Int32NullProp, ent1copy.Int32NullProp);

      Assert.AreEqual(ent1.DoubleProp, ent1copy.DoubleProp);
      Assert.AreEqual(ent1.DoublePropNull, ent1copy.DoublePropNull);
      Assert.AreEqual(ent1.SingleProp, ent1copy.SingleProp);
      Assert.AreEqual(ent1.DecProp, ent1copy.DecProp);
      Assert.AreEqual(ent1.MoneyProp, ent1copy.MoneyProp);

      Assert.IsTrue(Equal(ent1.DateTimeProp, ent1copy.DateTimeProp));

      Assert.AreEqual(ent1.EnumProp, ent1copy.EnumProp);
      Assert.AreEqual(ent1.EnumNullProp, ent1copy.EnumNullProp);
      Assert.AreEqual(ent1.BitsProp, ent1copy.BitsProp);
      Assert.AreEqual(ent1.BitsNullProp, ent1copy.BitsNullProp);

      Assert.IsTrue(ent1.ByteArrayProp.EqualsTo(ent1copy.ByteArrayProp));
      Assert.IsTrue(ent1.BinaryProp.Equals(ent1copy.BinaryProp));
      Assert.IsTrue(ent1.BigBinaryProp.Equals(ent1copy.BigBinaryProp));

      Assert.AreEqual(ent1.SByteProp, ent1copy.SByteProp);
      Assert.AreEqual(ent1.UInt16Prop, ent1copy.UInt16Prop);
      Assert.AreEqual(ent1.UInt32Prop, ent1copy.UInt32Prop);
      Assert.AreEqual(ent1.UInt64Prop, ent1copy.UInt64Prop);

      //try to set nullable double to Null
      ent1copy.DoublePropNull = null;
      ent1copy.Int64Prop = 123; //this is test for SQLite, check how small numbers in big ints are saved/loaded
      session.SaveChanges();

      session = ctx.OpenSession();
      ent1 = session.GetEntity<IDataTypesEntity>(ent1Id);
      Assert.AreEqual(null, ent1.DoublePropNull, "Null expected in Nullable property");
      Assert.AreEqual(123, ent1.Int64Prop, "Int64 property test failed.");

      session.LogMessage("=== Test Completed =======================");
    }//method

    [TestMethod]
    public void TestDataTypesProviderSpecific() {
      switch(Startup.ServerType) {
        case DbServerType.MsSql:
          TestMsSqlTypes();
          TestMsSqlRowVersion();
          break;
      }
    }

    public void TestMsSqlTypes() {
      if (Startup.ServerType != DbServerType.MsSql)
        return;
      // Verify data types
      var db = _app.GetDefaultDataSource().Database;
      var loader = Startup.Driver.CreateDbModelLoader(db.Settings, null);
      var dtColumns = loader.GetColumns();
      CheckDataType(dtColumns, "CharNProp", "char", 10);
      CheckDataType(dtColumns, "NCharNProp", "nchar", 10);
      CheckDataType(dtColumns, "VarCharProp", "varchar", 10);
      CheckDataType(dtColumns, "DateProp", "date");
      CheckDataType(dtColumns, "DateTimeProp", "datetime2");
      CheckDataType(dtColumns, "TimeProp", "time");
      CheckDataType(dtColumns, "SmallDateTimeProp", "smalldatetime");
      /*
      CheckDataType(dtColumns, "GeographyProp", "geography");
      CheckDataType(dtColumns, "GeometryProp", "geometry");
      CheckDataType(dtColumns, "HierarchyIdProp", "hierarchyid");
      */
      CheckDataType(dtColumns, "ImageProp", "image");
      CheckDataType(dtColumns, "NTextProp", "ntext");
      CheckDataType(dtColumns, "TextProp", "text");
      CheckDataType(dtColumns, "XmlProp", "xml");
      CheckDataType(dtColumns, "SmallMoneyProp", "smallmoney");
      CheckDataType(dtColumns, "SqlVariantProp", "sql_variant");

      //Create 2 records, to test formatting of data values for batch in batch mode (batch is used only when >1 records are saved)
      var session = _app.OpenSession();
      var ent1 = CreateSpecialDataTypesEntity(session, "ent1");
      var ent2 = CreateSpecialDataTypesEntity(session, "ent2");
      session.SaveChanges();
      //Read back and verify DateTimeOffset is saved properly (fix for a bug)
      var session2 = _app.OpenSession();
      var ent1Copy = session2.GetEntity<IMsSqlDataTypesEntity>(ent1.Id);
      Assert.AreEqual(ent1.DateTimeOffsetProp, ent1Copy.DateTimeOffsetProp, "Datetime offset prop does not match");

      // test single space - reported bug
      ent1Copy.CharNProp = " ";
      session2.SaveChanges(); //just checking it does not blow up
    }//test method

    private void CheckDataType(InfoTable dtColumns, string columnName, string dataType, int size = 0) {
      //find row
      var colRow = dtColumns.FindRow("column_name", columnName);
      Assert.AreEqual(dataType, (string)colRow["Data_Type"], "Data type does not match, column: " + columnName);
      if (size > 0)
        Assert.AreEqual(size, (int)colRow["character_maximum_length"], "Size does not match, column: " + columnName);
    }

    private IDataTypesEntity CreateDataTypesEntity(IEntitySession session, string strProp, string memoProp) {
      var rand = new Random();
      var ent = session.NewEntity<IDataTypesEntity>();
      var id = ent.Id = Guid.NewGuid();
      ent.StringProp = strProp;
      ent.MemoProp = memoProp;
      ent.ByteProp = 234; // (byte) rand.Next(255);
      ent.BoolProp = true;
      ent.Int16Prop = (Int16)rand.Next(Int16.MaxValue);
      ent.Int32Prop = - rand.Next(int.MaxValue - 1);
      ent.Int64Prop = Int64.MinValue + 1;
      ent.Int32NullProp = 222;
      ent.CharProp = 'X';

      ent.DoubleProp = 3.456;
      ent.DoublePropNull = 1.2345;
      ent.SingleProp = 4.567f;
      ent.DecProp = 2.34m;
      ent.MoneyProp = 3.45m;
      ent.DateTimeProp = DateTime.Now;
      ent.TimeProp = DateTime.Now.TimeOfDay;

      ent.EnumProp = SimpleEnum.Two;
      ent.EnumNullProp = SimpleEnum.Three;
      ent.BitsProp = BitEnum.Bit1 | BitEnum.Bit2;
      ent.BitsNullProp = BitEnum.Bit0;

      ent.ByteArrayProp = new byte[] { 1, 2, 3 };
      ent.BinaryProp = new Binary(new byte[] { 4, 5, 6 });
      ent.BigBinaryProp = new Binary(new byte[] { 11, 12, 13, 14 });

      ent.SByteProp = 12;
      ent.UInt16Prop = 456;
      ent.UInt32Prop = 567;
      ent.UInt64Prop = 678;

      return ent;
    }

    private IMsSqlDataTypesEntity CreateSpecialDataTypesEntity(IEntitySession session, string varCharProp) {
      var ent = session.NewEntity<IMsSqlDataTypesEntity>();
      ent.Id = Guid.NewGuid();
      // Test bug fix
      ent.CharNProp = "12345678";
      ent.NCharNProp = "234567";
      ent.VarCharProp = varCharProp;
      ent.TimeProp = DateTime.Now.TimeOfDay;
      ent.DateProp = DateTime.Now.Date;
      ent.DateTimeProp = DateTime.Now;
      ent.SmallDateTimeProp = DateTime.Now;
      ent.DateTimeOffsetProp = new DateTimeOffset(2015, 3, 14, 9, 26, 53, TimeSpan.FromHours(-7)); //PI day/time in Seattle DateTimeOffset.Now;
      /*
            // Have no idea how to properly assign these properties; assigning random data does not work, so made columns nullable and skip assignment
            ent.GeographyProp = new byte[] { 1, 2, 3, 4 };
            ent.GeometryProp = new byte[] { 5, 6, 7, 8 };
            ent.HierarchyIdProp = new byte[] { 11, 12, 13, 14 };
       */
      ent.ImageProp = new byte[] { 21, 22, 23, 24 };
      ent.NTextProp = "abcd";
      ent.TextProp = "defg";
      ent.XmlProp = "<foo/>";
      ent.SmallMoneyProp = 1.23m;
      ent.SqlVariantProp = "xx"; // 1234;

      return ent;
    }

    public void TestMsSqlRowVersion() {
      if(Startup.ServerType != DbServerType.MsSql)
        return;
      var session = _app.OpenSession();
      var prod = session.NewEntity<IMsSqlRowVersionedProduct>();
      prod.Name = "Coffee Maker 2000";
      prod.Description = "Automatic coffee maker.";
      prod.Price = 22.99;
      session.SaveChanges();
      var prodId = prod.Id;

      var rv1 = prod.RowVersion;
      prod.Price = 19.99;
      session.SaveChanges();
      var rv2 = prod.RowVersion;
      Assert.IsFalse(rv2.EqualsTo(rv1), "Row version did not increase.");

      // Test LINQ query against table with Row version column - make sure LINQ can read rowversion column
      session = _app.OpenSession();
      var q = from vp in session.EntitySet<IMsSqlRowVersionedProduct>()
              where vp.Price > 5
              select vp;
      var pList = q.ToList();
      Assert.IsTrue(pList.Count > 0, "Failed to run LINQ query.");
      var rv3 = pList[0].RowVersion;
      Assert.IsTrue(rv3.EqualsTo(rv2), "Row version from LINQ query mismatch.");

      // Concurrent update through different sessions
      // first session and product entity
      session = _app.OpenSession();
      prod = session.GetEntity<IMsSqlRowVersionedProduct>(prodId);
      // other, concurrent session, updates the same entity
      var session2 = _app.OpenSession();
      var prodCopy = session2.GetEntity<IMsSqlRowVersionedProduct>(prodId);
      prodCopy.Price = 18.99;
      session2.SaveChanges();
      // first session tries to update now stale entity - should get DataAccessException with subtype ConcurrentUpdate
      var dex = TestUtil.ExpectDataAccessException(() => {
        prod.Price = 17.99;
        session.SaveChanges();
      });
      Assert.AreEqual(DataAccessException.SubTypeConcurrentUpdate, dex.SubType);
      var tableName = dex.Data[DataAccessException.KeyEntityName];
      Assert.AreEqual("MsSqlRowVersionedProduct", tableName, "Entity name mismatch in concurrent update exception");
      // Debug.WriteLine("Concurrent update conflict - as expected.");
    }

    //Helper methods to compare
    private bool Equal(DateTime x, DateTime y) {
      int precMs = 10;
      switch(Startup.ServerType) {
        case DbServerType.MySql:
        case DbServerType.Oracle:
          precMs = 1000;
          break;
      }
      return y > x.AddMilliseconds(-precMs) && y < x.AddMilliseconds(precMs);
    }

    private bool Equal(DateTimeOffset x, DateTimeOffset y) {
      return y > x.AddMilliseconds(-10) && y < x.AddMilliseconds(10);
    }

/*
    public void OracleTestDataReader() {
      var ctx = _app.CreateSystemContext();
      var session = ctx.OpenSession();

      // Oracle quick test of output data types
      var directDb = session.GetDirectDbConnector();
      var cmd = directDb.DbConnection.CreateCommand();
      cmd.CommandText = "SELECT * FROM \"DataTypesEntity\"";
      var reader = directDb.ExecuteSelect(cmd);
      if (reader.Read()) {
        var values = new Dictionary<string, object>();
        for (int i = 0; i < reader.FieldCount; i++) {
          var colName = reader.GetName(i);
          var colType = reader.GetFieldType(i);
          var colValue = reader.GetValue(i);
          var isNull = reader.IsDBNull(i);
          Debug.WriteLine($"  Col: {colName}, type: {colType}, value={colValue}");
          values[colName] = colValue;
        }
      }
      reader.Close();
      directDb.CloseConnection();
    }
*/

  }

}


text:
package fr.logica.business.data;

import java.io.Serializable;

import fr.logica.business.Entity;

public class LinkData implements Serializable {

	/** serialUID */
	private static final long serialVersionUID = -8032354830494378725L;

	private String entityName;

	private Entity targetEntity;

	private String targetDescription;

	public LinkData(String entityName, Entity targetEntity, String targetDescription) {
		this.entityName = entityName;
		this.targetEntity = targetEntity;
		this.targetDescription = targetDescription;
	}

	public String getEntityName() {
		return entityName;
	}

	public void setEntityName(String entityName) {
		this.entityName = entityName;
	}

	public Entity getTargetEntity() {
		return targetEntity;
	}

	public void setTargetEntity(Entity targetEntity) {
		this.targetEntity = targetEntity;
	}

	public String getTargetDescription() {
		return targetDescription;
	}

	public void setTargetDescription(String targetDescription) {
		this.targetDescription = targetDescription;
	}
}


text:
package org.apache.jackrabbit.oak.run;

enum Mode {

    BACKUP("backup", new BackupCommand()),
    RESTORE("restore", new RestoreCommand()),
    BENCHMARK("benchmark", new BenchmarkCommand()),
    CONSOLE("console", new ConsoleCommand()),
    DEBUG("debug", new DebugCommand()),
    GRAPH("graph", new GraphCommand()),
    HISTORY("history", new HistoryCommand()),
    CHECK("check", new CheckCommand()),
    COMPACT("compact", new CompactCommand()),
    SERVER("server", new ServerCommand()),
    UPGRADE("upgrade", new UpgradeCommand()),
    SCALABILITY("scalability", new ScalabilityCommand()),
    EXPLORE("explore", new ExploreCommand()),
    PRIMARY("primary", new PrimaryCommand()),
    STANDBY("standy", new StandbyCommand()),
    CHECKPOINTS("checkpoints", new CheckpointsCommand()),
    RECOVERY("recovery", new RecoveryCommand()),
    REPAIR("repair", new RepairCommand()),
    TIKA("tika", new TikaCommand()),
    GARBAGE("garbage", new GarbageCommand()),
    TARMKDIFF("tarmkdiff", new FileStoreDiffCommand()),
    TARMKRECOVERY("tarmkrecovery", new FileStoreRevisionRecoveryCommand()),
    DUMPDATASTOREREFS("dumpdatastorerefs", new DumpDataStoreReferencesCommand()),
    HELP("help", new HelpCommand());

    private final String name;

    private final Command command;

    Mode(String name, Command command) {
        this.name = name;
        this.command = command;
    }

    @Override
    public String toString() {
        return name;
    }

    public void execute(String... args) throws Exception {
        command.execute(args);
    }

}


text:
<?xml version="1.0"?>
<script>
<title>check-route.slax</title>
<author>mpergament</author>
<synopsis>
Check route validity of route lookup for every address book entry
</synopsis>
<coe>op</coe>
<type>display</type>

<description>
List all IP addresses/networks that are covered by a group that are/aren't reachable following the routing table and zones assignment.
</description>

 <example>
 <title>Configuration</title>
 <description>Configuration for the script check-route.slax</description>
 <output>example-1.output</output>
 </example>

<xhtml:script xmlns:xhtml="http://www.w3.org/1999/xhtml"
src="../../../../../web/leaf.js"
type="text/javascript"/>
</script>


text:
@interface SZSelectCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIImageView *selectImageView;

@end

@implementation SZSelectCell

- (void)awakeFromNib
{
    [super awakeFromNib];
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *const ID = @"cell";
    SZSelectCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
    }
    return cell;
}

- (void)setItem:(id)Item
{
    _titleLabel.text = Item;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    _selectImageView.hidden = !selected;
}

@end


text:
namespace GuavaBlog.Web.Models
{
    public class Tag
    {
        public int Id { get; set; }

        public string Title { get; set; }

        public string Name { get; set; }

        public string Image { get; set; }

        public string Description { get; set; }

        public string Metadata { get; set; }
    }
}


text:
package com.orgecc.calltimer;

import org.slf4j.Logger;

public final class NoOpCallTimer extends BaseCallTimer {

    NoOpCallTimer( final Ticker ticker, final Logger logger ) {
        super( Ticker.NO_OP, null );
    }

    @Override
    protected void saveEvent( final Throwable throwable, final String msg ) {
        // not used
    }

    @Override
    public void callEnd( final Throwable throwable ) {
        this.callEnded = true;
        restoreThreadName();
    }

}


text:
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Components;
using Content.Server.Hands.Systems;
using Content.Shared.Alert;
using Content.Shared.Atmos;
using Content.Shared.Inventory;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Content.Shared.Verbs;
using Content.Server.Popups;
using Robust.Shared.Player;
using Content.Server.DoAfter;
using System.Threading;

namespace Content.Server.Body.Systems;

public sealed class InternalsSystem : EntitySystem
{
    [Dependency] private readonly IPrototypeManager _protoManager = default!;
    [Dependency] private readonly AlertsSystem _alerts = default!;
    [Dependency] private readonly AtmosphereSystem _atmos = default!;
    [Dependency] private readonly DoAfterSystem _doAfter = default!;
    [Dependency] private readonly GasTankSystem _gasTank = default!;
    [Dependency] private readonly HandsSystem _hands = default!;
    [Dependency] private readonly InventorySystem _inventory = default!;
    [Dependency] private readonly PopupSystem _popupSystem = default!;

    public override void Initialize()
    {
        base.Initialize();

        SubscribeLocalEvent<InternalsComponent, InhaleLocationEvent>(OnInhaleLocation);
        SubscribeLocalEvent<InternalsComponent, ComponentStartup>(OnInternalsStartup);
        SubscribeLocalEvent<InternalsComponent, ComponentShutdown>(OnInternalsShutdown);
        SubscribeLocalEvent<InternalsComponent, GetVerbsEvent<InteractionVerb>>(OnGetInteractionVerbs);
        SubscribeLocalEvent<InternalsComponent, ToggleOtherInternalsCompleteEvent>(OnToggleOtherInternalsComplete);
        SubscribeLocalEvent<InternalsComponent, ToggleOtherInternalsCancelledEvent>(OnToggleOtherInternalCanceled);
    }

    private void OnGetInteractionVerbs(EntityUid uid, InternalsComponent component, GetVerbsEvent<InteractionVerb> args)
    {
        if (!args.CanAccess || !args.CanInteract || args.Hands == null)
            return;

        InteractionVerb verb = new()
        {
            Act = () =>
            {
                ToggleInternals(uid, args.User, false, component);
            },
            Message = Loc.GetString("action-description-internals-toggle"),
            IconTexture = "/Textures/Interface/VerbIcons/dot.svg.192dpi.png",
            Text = Loc.GetString("action-name-internals-toggle"),
        };

        args.Verbs.Add(verb);
    }

    public void ToggleInternals(EntityUid uid, EntityUid user, bool force, InternalsComponent? internals = null)
    {
        if (!Resolve(uid, ref internals, false))
        {
            return;
        }

        // Toggle off if they're on
        if (AreInternalsWorking(internals))
        {
            DisconnectTank(internals);
            return;
        }

        // If they're not on then check if we have a mask to use
        if (internals.BreathToolEntity == null)
        {
            _popupSystem.PopupEntity(Loc.GetString("internals-no-breath-tool"), uid, Filter.Entities(user));
            return;
        }

        var tank = FindBestGasTank(internals);

        if (tank == null)
        {
            _popupSystem.PopupEntity(Loc.GetString("internals-no-tank"), uid, Filter.Entities(user));
            return;
        }

        // Is the target not you? If yes, use a do-after to give them time to respond.
        if (!force && uid != user)
        {
            internals.CancelToken?.Cancel();
            internals.CancelToken = new CancellationTokenSource();
            _doAfter.DoAfter(new DoAfterEventArgs(user, internals.Delay, internals.CancelToken.Token, uid)
            {
                BreakOnUserMove = true,
                BreakOnDamage = true,
                BreakOnStun = true,
                BreakOnTargetMove = true,
                MovementThreshold = 0.1f,
                TargetFinishedEvent = new ToggleOtherInternalsCompleteEvent(user, tank),
                TargetCancelledEvent = new ToggleOtherInternalsCancelledEvent(),
            });

            return;
        }

        _gasTank.ConnectToInternals(tank);
    }

    private void OnToggleOtherInternalsComplete(EntityUid uid, InternalsComponent component, ToggleOtherInternalsCompleteEvent ev)
    {
        component.CancelToken = null;
        ToggleInternals(uid, ev.User, true, component);
    }

    private static void OnToggleOtherInternalCanceled(EntityUid uid, InternalsComponent component, ToggleOtherInternalsCancelledEvent ev)
    {
        component.CancelToken = null;
    }

    private void OnInternalsStartup(EntityUid uid, InternalsComponent component, ComponentStartup args)
    {
        _alerts.ShowAlert(component.Owner, AlertType.Internals, GetSeverity(component));
    }

    private void OnInternalsShutdown(EntityUid uid, InternalsComponent component, ComponentShutdown args)
    {
        _alerts.ClearAlert(uid, AlertType.Internals);
    }

    private void OnInhaleLocation(EntityUid uid, InternalsComponent component, InhaleLocationEvent args)
    {
        if (AreInternalsWorking(component))
        {
            var gasTank = Comp<GasTankComponent>(component.GasTankEntity!.Value);
            args.Gas = _gasTank.RemoveAirVolume(gasTank, Atmospherics.BreathVolume);
            // TODO: Should listen to gas tank updates instead I guess?
            _alerts.ShowAlert(component.Owner, AlertType.Internals, GetSeverity(component));
        }
    }
    public void DisconnectBreathTool(InternalsComponent component)
    {
        var old = component.BreathToolEntity;
        component.BreathToolEntity = null;

        if (TryComp(old, out BreathToolComponent? breathTool) )
        {
            _atmos.DisconnectInternals(breathTool);
            DisconnectTank(component);
        }

        _alerts.ShowAlert(component.Owner, AlertType.Internals, GetSeverity(component));
    }

    public void ConnectBreathTool(InternalsComponent component, EntityUid toolEntity)
    {
        if (TryComp(component.BreathToolEntity, out BreathToolComponent? tool))
        {
            _atmos.DisconnectInternals(tool);
        }

        component.BreathToolEntity = toolEntity;
        _alerts.ShowAlert(component.Owner, AlertType.Internals, GetSeverity(component));
    }

    public void DisconnectTank(InternalsComponent? component)
    {
        if (component == null) return;

        if (TryComp(component.GasTankEntity, out GasTankComponent? tank))
        {
            _gasTank.DisconnectFromInternals(tank);
        }

        component.GasTankEntity = null;
        _alerts.ShowAlert(component.Owner, AlertType.Internals, GetSeverity(component));
    }

    public bool TryConnectTank(InternalsComponent component, EntityUid tankEntity)
    {
        if (component.BreathToolEntity == null)
            return false;

        if (TryComp(component.GasTankEntity, out GasTankComponent? tank))
        {
            _gasTank.DisconnectFromInternals(tank);
        }

        component.GasTankEntity = tankEntity;
        _alerts.ShowAlert(component.Owner, AlertType.Internals, GetSeverity(component));
        return true;
    }

    public bool AreInternalsWorking(InternalsComponent component)
    {
        return TryComp(component.BreathToolEntity, out BreathToolComponent? breathTool) &&
               breathTool.IsFunctional &&
               TryComp(component.GasTankEntity, out GasTankComponent? gasTank) &&
               gasTank.Air != null;
    }

    private short GetSeverity(InternalsComponent component)
    {
        if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2;

        // If pressure in the tank is below low pressure threshhold, flash warning on internals UI
        if (TryComp<GasTankComponent>(component.GasTankEntity, out var gasTank)
            && gasTank.IsLowPressure)
                return 0;

        return 1;
    }

    public GasTankComponent? FindBestGasTank(InternalsComponent component)
    {
        // Prioritise
        // 1. exo-slot tanks
        // 2. in-hand tanks
        // 3. pocket/belt tanks
        InventoryComponent? inventory = null;
        ContainerManagerComponent? containerManager = null;

        if (_inventory.TryGetSlotEntity(component.Owner, "suitstorage", out var entity, inventory, containerManager) &&
            TryComp<GasTankComponent>(entity, out var gasTank) &&
            _gasTank.CanConnectToInternals(gasTank))
        {
            return gasTank;
        }

        var tanks = new List<GasTankComponent>();

        foreach (var hand in _hands.EnumerateHands(component.Owner))
        {
            if (TryComp(hand.HeldEntity, out gasTank) && _gasTank.CanConnectToInternals(gasTank))
            {
                tanks.Add(gasTank);
            }
        }

        if (tanks.Count > 0)
        {
            tanks.Sort((x, y) => y.Air.TotalMoles.CompareTo(x.Air.TotalMoles));
            return tanks[0];
        }

        if (Resolve(component.Owner, ref inventory, false))
        {
            var enumerator = new InventorySystem.ContainerSlotEnumerator(component.Owner, inventory.TemplateId, _protoManager, _inventory, SlotFlags.POCKET | SlotFlags.BELT);

            while (enumerator.MoveNext(out var container))
            {
                if (TryComp(container.ContainedEntity, out gasTank) && _gasTank.CanConnectToInternals(gasTank))
                {
                    tanks.Add(gasTank);
                }
            }

            if (tanks.Count > 0)
            {
                tanks.Sort((x, y) => y.Air.TotalMoles.CompareTo(x.Air.TotalMoles));
                return tanks[0];
            }
        }

        return null;
    }
    private readonly record struct ToggleOtherInternalsCompleteEvent(EntityUid User, GasTankComponent Tank)
    {
        public readonly EntityUid User = User;
        public readonly GasTankComponent Tank = Tank;
    }

    private readonly record struct ToggleOtherInternalsCancelledEvent;
}


text:
using System;

namespace Testing.Common
{
	public class DerivedSubEntity : SubEntity
	{
		public int DerivedSimple
		{
			get;
			set;
		}
	}
}


text:
//// [superCallFromClassThatHasNoBaseTypeButWithSameSymbolInterface.ts]
interface Foo extends Array<number> {}

class Foo {
    constructor() {
        super(); // error
    }
}

//// [superCallFromClassThatHasNoBaseTypeButWithSameSymbolInterface.js]
var Foo = /** @class */ (function () {
    function Foo() {
        return _super.call(this) || this;
    }
    return Foo;
}());