text:
package psi.iv.ii.decorator;

import java.util.Map;

public interface DarbininkasInterface {
	public void dirbti(Map<String, Object> darbai);
	public String kaMoka();
    public void pridetiDarba(String darbas);
}

redpajama_set_name: RedPajamaGithub


text:
package se.lagrummet.rinfo.base.rdf;

import java.io.*;
import org.apache.commons.lang.ArrayUtils;

import javax.xml.transform.Templates;
import org.openrdf.repository.Repository;
import se.lagrummet.rinfo.base.TransformerUtil;

public class GritTransformer {

    Templates[] templates;

    public GritTransformer(Templates... templates) {
        try {
            Templates gritXslt = TransformerUtil.newTemplates(
                    getClass(), "/xslt/rdfxml-grit.xslt");
            this.templates = (Templates[]) ArrayUtils.add(templates, 0, gritXslt);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public void writeXhtml(InputStream inputStream, Writer writer)
            throws IOException {
        TransformerUtil.writeXhtml(inputStream, writer, templates);
    }
}


text:
# Object Data Mapping component for DynamoDb

The oasis/dynamodb-odm is an ODM (object data mapping) library for easy use of AWS' powerful key-value database: DynamoDb.

> **NOTE**: this document assumes you have some understanding of what DynamoDB is and the difference between DynamoDB and traditional RDBMS (e.g. MySQL). Some terms and ideas discussed in this document are DynamoDB specific and will not be explained in this documentation. To study DynamoDB, please refer to the [official dev guide](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide)

## Installation & Configuration

To get oasis/dynamodb-odm, you can simple require it via `composer`:

```bash
$ composer require oasis/dynamodb-odm
```

### Class Loading

Autoloading for DynamoDb ODM is taken care of by `composer`. You just need to include the composer autoload file in your project:

```php
<?php

require_once "vendor/autoload.php";
```

### Obtaining an ItemManager

Once you have prepared the class loading, you acquire an **ItemManager** instance. The ItemManager class is the primary access point to ODM functionality provided by the library.

```php
<?php
use Oasis\Mlib\ODM\Dynamodb\ItemManager;

$awsConfig     = [
    "profile" => "oasis-minhao",
    "region"  => "ap-northeast-1"
];
$tablePrefix   = "odm-";
$cacheDir      = __DIR__ . "/ut/cache";
$isDev         = true;
$itemNamespace = 'Oasis\Mlib\ODM\Dynamodb\Ut'; // in practice, this usually looks like: My\Root\Namespace\Items
$itemSrcDir    = __DIR__ . "/ut"; // in practice, this usually points to src/Items directory

$im = new ItemManager(
    $awsConfig,
    $tablePrefix,
    $cacheDir,
    $isDev
);
$im->addNamespace(
    $itemNamespace,
    $itemSrcDir
);

```

The explanation of each argument can be found below:

argument        | description                   | default value
---             | ---                           | ---
awsConfig       | configuration array for aws SDK, `profile` and `region` are mandatory.    | **mandatory**
tablePrefix     | a prefix to table names       | **mandatory**
cacheDir        | cache direcotry to store metadata | **mandatory**
isDev           | is development environment or not. Under dev environment, changes to Item class will automatically invalidate cached metadata. Under production environment, this has to be done manually.    | `true`
itemSrcDir      | a source directory under which Item classes can be found | **mandatory**
itemNamespace   | the base namespace for the managed Item classes source directory  | **mandatory**

> **NOTE**: an Item class defines a type of item managed by ODM. Some typical examples are: User, Order, GameRoom, and Card

### Setting Up Command Line Tool

DynamoDb ODM ships with a number of command line tools that are very helpful during development. You can call this command from the Composer binary directory:

```bash
$ ./vendor/bin/oasis-dynamodb-odm
```

You need to register your application's `ItemManager` to the console tool to make use of the built-in command. This is done by creating an **odm-config.php** file under the calling directory, with the following content:

```php
<?php
use Oasis\Mlib\ODM\Dynamodb\Console\ConsoleHelper;

// replace with file to your own project bootstrap
require_once 'bootstrap.php';

// replace with your own mechanism to retrieve the item manager
$itemManager = GetItemManager();

return new ConsoleHelper($itemManager);

```

Detailed usage can be found in later [section](#using-the-command-line-tool)

## Mapping

The fundamental functionality of an ODM library is to map object models (i.e. classes) to database sctructure. DynamoDb ODM provides a handy way to establish this mapping with the help of annotations:

```php
<?php
use Oasis\Mlib\ODM\Dynamodb\Annotations\Field;
use Oasis\Mlib\ODM\Dynamodb\Annotations\Item;

/**
 * @Item(
 *     table="users",
 *     primaryIndex={"id"}
 * )
 */
class User
{
    /**
     * @var int
     * @Field(type="number")
     */
    protected $id;

    /**
     * @var string
     * @Field(type="string")
     */
    protected $name;
}

```

The class above declares a simple User model, wich will be mapped to DynamoDb table "users" (possibly with a prefix). The annotations are explained below:

#### Item

Every PHP object that you want to save to database using ODM is referred to as an "Item". To describe an object as an item, we have to describe the class of this object.

Class annotated with the _@Item_ annotation will be managed by ItemManager. An Item accepts the following attributes:

- **table**: table name of the object
- **primaryIndex**: primary index, wich can be either an array of keys, or an [_@Index_](#index) annotation object
- **globalSecondaryIndices**: array of global secondary indices; a global secondary index is either an array of keys, or an _@Index_ annotation object
- **localSecondaryIndices**: array of local secondary indices; a local secondary index is either an array of keys, or an _@Index_ annotation object
- **repository**: the repository class name; by default, `\Oasis\Mlib\ODM\Dynamodb\ItemRepository` is used
- **projected**: whether this item is projected only. _Projected Item_ is not updatable (remove action is allowed). And when reading (i.e. get/query/scan) a projected item, only attrbutes for this item will be fetched from DynamoDB.

#### Field

The next step after making a PHP class an Item is mapping its properties to attributes in DynamoDb.

We use _@Field_ annotation to describe class properties which are DynamoDb attributes. The _@Field_ annotation supports following attributes:

- **type**: the type of the attribute, which can be one of the following:
    - string (default)
    - number
    - binary
    - bool
    - null
    - list
    - map
- **name**: the name of the DynamoDb attribute, if it's not the same as the property name. This value defaults to `null`, meaning the attribute key is the same as the property name.

#### Partitioned Hash Key

A partitioned hash key is an extension to fields used as hash key in queries. There are circumstances that you only want to query on a single value (or very few values) for that field. The nature of DynamoDB will only utilize a fraction of the read capacity assigned, and therefore limit your system performance. However, by using a partitioned hash key for that field, each value of the originial field will have a group of mapped values in the partitioned hash key field. By querying those partitioned values parallelly (see [Multi Query](#by-using-multi-query-on-partitioned-hash-key)), your query performace should be significantly improved in this use case.

We use _@PartitionedHashKey_ annotation to describe the partitioned hash key field. The supported attributes are:

- **baseField**: the original field name
- **hashField**: the field whose value is used as a hashing source, always use a well distributed field as hash field (e.g. unqiue ID for the item)
- **size**: size of partition, default to 16

#### Index

When declaring different indexes, we can use the _@Index_ annotation to make the docblock more readable. An _@Index_ is composited with two keys:
- **hash**: the hash key name
- **range**: the range key name, leave empty if no range key for this index
- **name**: the name of the index, leave empty if you would like ODM to automatically generate one for you. (**NOTE**: a primary index doesn't need a name)

Below is the User class declaration when we add a global secondary index to it:

```php
/**
 * @Item(
 *     table="users",
 *     primaryIndex={"id"},
 *     globalSecondaryIndices={
 *         @Index(hash="class", range="age", name="class-age-gsi")
 *     }
 * )
 */
class User
{
    // ...

    /**
     * @var string
     * @Field()
     */
    protected $class;

    /**
     * @var int
     * @Field(type="number")
     */
    protected $age;
}
```

#### Check and Set

A field and be declared as a check-and-set field, using the "cas" attribute of the _@Field_ annotation.

A check-and-set field is a field ODM uses to make sure no single item is updated/inserted more than once by different workers at the same time.

The value of the "cas" property can be one of the following:
- _disabled_: this is the default value, and the field with "cas" disabled will not be checked when updating/inserting item
- _enabled_: the old value of this field will be checked when updating the item. When inserting an item, this field must either posses a NULL value, or be absent.
- _timestamp_: this is a special type of enabled cas property. Every time an item is updated/inserted, the value of this field will automatically be set to the current timestamp.

> **NOTE**: Check-and-set validation is done only when you call `ItemManger#flush()`. Failure to meet the check and set condition(s) will lead to an `Oasis\Mlib\ODM\Dynamodb\Exceptions\DataConsistencyException` being thrown.

## Working with Objects

All objects (items) in ODM are managed. Operations on objects are managed like object-level transaction. Once an object is managed, either by persisted as a new object or fetched from database, its managed state is stored in the ItemManager. Any change to the object will be recorded in memory. Changes to object can then be commited by invoking the `ItemManager#flush()` method on the ItemManager.

The ItemManager can be manually cleared by calling `ItemManager#clear()`. However, any changes that are not committed yet will be lost.

> **NOTE**: it is very **important** to understand, that only `ItemManager#flush()` will cause write operations against the database. Any other methods such as `ItemManager#persist($item)` or `ItemManager#remove($item)` only notify the ItemManager to perform these operations during flush. Not calling `ItemManager#flush()` will lead to all changes during that request being lost.

#### Persisting Item

An item can be made persistent by passing it to the `ItemManager#persist($item)` method. By applying the persist operation on some item, that item becomes **MANAGED**, which means that its persistence is from now on managed by an ItemManager. As a result the persistent state of such an item will subsequently be properly synchronized with the database when `ItemManager#flush()` is invoked.

Example:

```php
<?php
/** @var ItemManger $im */
$user = new User();
$user->setName('Mr.Right');
$im->persist($user);
$im->flush();

```

#### Removing Item

An item can be removed from persistent storage by passing it to the `ItemManager#remove($item)` method. By applying the remove operation on some item, that item becomes **REMOVED**, which means that its persistent state will be deleted once `ItemManager#flush()` is invoked.

Example:

```php
<?php
/** @var ItemManger $im */
/** @var User $user */
$im->remove($user);
$im->flush();

```

#### Detaching Item

An item is detached from an ItemManager and thus no longer managed by invoking the `ItemManager#detach($item)` method on it. Changes made to the detached item, if any (including removal of the item), will not be synchronized to the database after the item has been detached.

DynamoDb ODM will not hold on to any references to a detached item.

Example:

```php
<?php
/** @var ItemManger $im */
/** @var User $user */
$im->detach($user);
$user->setName('Mr.Left');
$im->flush(); // changes to $user will not be synchronized

```

#### Synchronization with the Database

The state of persistent items is synchronized with the database on `flush()` of an ItemManager. The synchronization involves writing any updates to persistent items to the database. When `ItemManager#flush()` is called, ODM inspects all managed, new and removed items and will perform the following operations:

- create new object in database
- update changed attributes for managed items in database
- delete removed item from database

## Fetching Item(s)

DynamoDb ODM provides the following ways, in increasing level of power and flexibility, to fetch persistent object(s). You should always start with the simplest one that suits your needs.

#### By Primary Index

The most basic way to fetch a persistent object is by its primary index using the `ItemManager#get($itemClass, $primayKeys)` method. Here is an example:

```php
<?php
/** @var ItemManager $im */
$user = $im->get(User::class, ["id" => 1]);

```

The return value is either the found item instance or null if no instance could be found with the given identifier.

Essentially, `ItemManager#get()` is just a shortcut for the following:

```php
/** @var ItemManager $im */
/** @var ItemRepository $userRepo */
$userRepo = $im->getRepository(User::class);
$user = $userRepo->get(["id" => 1]);

```

#### By Simple Conditions on Queriable Index

To query for one or more items based on simple conditions, use the `ItemManager#query()` and `ItemManager#queryAndRun()` methods on a repository as follows:

```php
/** @var ItemManager $im */
/** @var ItemRepository $userRepo */
$userRepo = $im->getRepository(User::class);
/** @var Users[] $users */
$users = $userRepo->query(
    "#class = :class AND #age >= :minAge",
    [
        ":class" => "A",
        ":minAge" => 25,
    ],
    "class-age-index"
);

```

> **NOTE**: a simple condition is a condition that uses one and only one index. If the used index contains both _hash key_ and _range key_, the _range key_ may only be used when _hash key_ is also presented in the condition. Furthermore, only equal test operation can be performed against the _hash key_.

#### By Using Multi Query on Partitioned Hash Key

To query for one or more items based on a PartitionedHashKey, use `ItemManager#multiQueryAndRun()` methods on a repository as follows:

```php
/** @var ItemManager $im */
/** @var ItemRepository $userRepo */
$userRepo = $im->getRepository(User::class);
/** @var Users[] $users */
$users = $userRepo->multiQueryAndRun(
    function ($item) {
        // each item returned can be accessed here in the callback
    },
    "classPartition", // PartitionedHashKey field name
    "A", // value expected in the base field (not the partition field)
    "#age >= :minAge", // only range conditions here
    [
        ":minAge" => 25,
    ],
    "class-partition-age-index" // index for PartitionedHashKey
);

```

#### By Filters on Non-Queriable Index

To query for one or more items which has no associated index, use the `ItemManager#scan()` and `ItemManager#scanAndRun()` methods on a repository as follows:

```php
/** @var ItemManager $im */
/** @var ItemRepository $userRepo */
$userRepo = $im->getRepository(User::class);
/** @var Users[] $users */
$users = $userRepo->scan(
    "#class = :class AND #age >= :minAge AND #name = :name",
    [
        ":class" => "A",
        ":minAge" => 25,
        ":name" => "John",
    ],
);

```

## Using the Command Line Tool

DynamoDb ODM ships an executable tool together with the library. After installation, there are following built-commands which helps you manage the database schema for the items:

#### Create

```bash
$ ./vendor/bin/oasis-dynamodb-odm odm:schema-tool:create
```

The create command will iterate all managed items and create tables correspondingly. All primary index, LSIs and GSIs are created as well.

> **NOTE**: if a table with the same name under the same prefix already exists, an exception will be thrown. No table will be created in this case.

> **NOTE**: if you would like to skip creating existing table (i.e. only create non-existing tables), you can use the "--skip-existing-table" option

#### Update

```bash
$ ./vendor/bin/oasis-dynamodb-odm odm:schema-tool:update
```

The update command is actually a more powerful (and slower too) version of create command. It checks all managed items and creates the table if it doesn't exist. Furthermore, if a table exists but have different GSIs defined, the update command will update the GSIs accordingly.

> **NOTE**: due to the nature of DynamoDb, it is not possible to update the primary index or LSI when a table is already created. Under dev environment, it is suggested to drop the table and re-create them when needed.

> **NOTE**: if you would like to only see the changes to database schemas without perfoming actual update, you can specify the "--dry-run" option in command line. The program will only prompts possible changes withou actually performing them.

#### Drop

```bash
$ ./vendor/bin/oasis-dynamodb-odm odm:schema-tool:drop
```

The drop command will drop all tables associated with the managed items. **DO NOT** run this command in production environment!


text: module.exports = require('./dist/memory-resource');


text:
package com.thoughtworks.go.server.domain;

import java.sql.Timestamp;
import java.util.Date;

public class ServerMaintenanceMode {
    private boolean isMaintenanceMode = false;
    private String updatedBy;
    private Timestamp updatedOn;

    public ServerMaintenanceMode() {
    }

    public ServerMaintenanceMode(boolean isMaintenanceMode, String updatedBy, Date updatedOn) {
        this.isMaintenanceMode = isMaintenanceMode;
        this.updatedBy = updatedBy;
        this.updatedOn = new Timestamp(updatedOn.getTime());
    }

    public boolean isMaintenanceMode() {
        return isMaintenanceMode;
    }

    public String updatedBy() {
        return updatedBy;
    }

    public Timestamp updatedOn() {
        return updatedOn;
    }

    public void updatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public void updatedOn(Timestamp updatedOn) {
        this.updatedOn = updatedOn;
    }

    public void setMaintenanceMode(boolean maintenanceMode) {
        isMaintenanceMode = maintenanceMode;
    }
}


text:
/**
 * @file    urosMsgTypes.h
 * @author  Andrea Zoppi <texzk@email.it>
 *
 * @brief   TCPROS message and service descriptors.
 */

#ifndef _UROSMSGTYPES_H_
#define _UROSMSGTYPES_H_

/*===========================================================================*/
/* HEADER FILES                                                              */
/*===========================================================================*/

#include <urosTcpRos.h>

/*===========================================================================*/
/*  MESSAGE TYPES                                                            */
/*===========================================================================*/

/** @addtogroup tcpros_msg_types */
/** @{ */

/*~~~ MESSAGE: std_msgs/Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>std_msgs/Header</tt> message descriptor.
 * @details MD5 sum: <tt>2176decaecbce78abc3b96ef049fabed</tt>.
 */
struct msg__std_msgs__Header {
  uint32_t      seq;
  uros_time_t   stamp;
  UrosString    frame_id;
};

/*~~~ MESSAGE: rosgraph_msgs/Log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>rosgraph_msgs/Log</tt> message descriptor.
 * @details MD5 sum: <tt>acffd30cd6b6de30f120938c17c593fb</tt>.
 */
struct msg__rosgraph_msgs__Log {
  struct msg__std_msgs__Header  header;
  uint8_t                       level;
  UrosString                    name;
  UrosString                    msg;
  UrosString                    file;
  UrosString                    function;
  uint32_t                      line;
  UROS_VARARR(UrosString)       topics;
};

/*~~~ MESSAGE: turtlesim/Pose ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/Pose</tt> message descriptor.
 * @details MD5 sum: <tt>863b248d5016ca62ea2e895ae5265cf9</tt>.
 */
struct msg__turtlesim__Pose {
  float x;
  float y;
  float theta;
  float linear_velocity;
  float angular_velocity;
};

/*~~~ MESSAGE: turtlesim/Color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/Color</tt> message descriptor.
 * @details MD5 sum: <tt>353891e354491c51aabe32df673fb446</tt>.
 */
struct msg__turtlesim__Color {
  uint8_t   r;
  uint8_t   g;
  uint8_t   b;
};

/*~~~ MESSAGE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/Velocity</tt> message descriptor.
 * @details MD5 sum: <tt>9d5c2dcd348ac8f76ce2a4307bd63a13</tt>.
 */
struct msg__turtlesim__Velocity {
  float linear;
  float angular;
};

/** @} */

/*===========================================================================*/
/* SERVICE TYPES                                                             */
/*===========================================================================*/

/** @addtogroup tcpros_srv_types */
/** @{ */

/*~~~ SERVICE: turtlesim/SetPen ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/SetPen</tt> service request descriptor.
 */
struct in_srv__turtlesim__SetPen {
  uint8_t   r;
  uint8_t   g;
  uint8_t   b;
  uint8_t   width;
  uint8_t   off;
};

/**
 * @brief   TCPROS <tt>turtlesim/SetPen</tt> service response descriptor.
 */
struct out_srv__turtlesim__SetPen {
  /* This message type has no fields.*/
  uint8_t _dummy;
};

/*~~~ SERVICE: turtlesim/Spawn ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/Spawn</tt> service request descriptor.
 */
struct in_srv__turtlesim__Spawn {
  float         x;
  float         y;
  float         theta;
  UrosString    name;
};

/**
 * @brief   TCPROS <tt>turtlesim/Spawn</tt> service response descriptor.
 */
struct out_srv__turtlesim__Spawn {
  UrosString    name;
};

/*~~~ SERVICE: turtlesim/Kill ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/Kill</tt> service request descriptor.
 */
struct in_srv__turtlesim__Kill {
  UrosString    name;
};

/**
 * @brief   TCPROS <tt>turtlesim/Kill</tt> service response descriptor.
 */
struct out_srv__turtlesim__Kill {
  /* This message type has no fields.*/
  uint8_t _dummy;
};

/*~~~ SERVICE: turtlesim/TeleportAbsolute ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/TeleportAbsolute</tt> service request descriptor.
 */
struct in_srv__turtlesim__TeleportAbsolute {
  float x;
  float y;
  float theta;
};

/**
 * @brief   TCPROS <tt>turtlesim/TeleportAbsolute</tt> service response descriptor.
 */
struct out_srv__turtlesim__TeleportAbsolute {
  /* This message type has no fields.*/
  uint8_t _dummy;
};

/*~~~ SERVICE: std_srvs/Empty ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>std_srvs/Empty</tt> service request descriptor.
 */
struct in_srv__std_srvs__Empty {
  /* This message type has no fields.*/
  uint8_t _dummy;
};

/**
 * @brief   TCPROS <tt>std_srvs/Empty</tt> service response descriptor.
 */
struct out_srv__std_srvs__Empty {
  /* This message type has no fields.*/
  uint8_t _dummy;
};

/*~~~ SERVICE: turtlesim/TeleportRelative ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/**
 * @brief   TCPROS <tt>turtlesim/TeleportRelative</tt> service request descriptor.
 */
struct in_srv__turtlesim__TeleportRelative {
  float linear;
  float angular;
};

/**
 * @brief   TCPROS <tt>turtlesim/TeleportRelative</tt> service response descriptor.
 */
struct out_srv__turtlesim__TeleportRelative {
  /* This message type has no fields.*/
  uint8_t _dummy;
};

/** @} */

/*===========================================================================*/
/* MESSAGE CONSTANTS                                                         */
/*===========================================================================*/

/** @addtogroup tcpros_msg_consts */
/** @{ */

/*~~~ MESSAGE: rosgraph_msgs/Log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

/** @name Message <tt>rosgraph_msgs/Log</tt> */
/** @{ */

#define msg__rosgraph_msgs__Log__DEBUG      ((uint8_t)1)
#define msg__rosgraph_msgs__Log__INFO       ((uint8_t)2)
#define msg__rosgraph_msgs__Log__WARN       ((uint8_t)4)
#define msg__rosgraph_msgs__Log__ERROR      ((uint8_t)8)
#define msg__rosgraph_msgs__Log__FATAL      ((uint8_t)16)

/** @} */

/** @} */

/*===========================================================================*/
/* SERVICE CONSTANTS                                                         */
/*===========================================================================*/

/** @addtogroup tcpros_srv_consts */
/** @{ */

/* There are no service costants.*/

/** @} */

#ifdef __cplusplus
extern "C" {
#endif

/*===========================================================================*/
/* MESSAGE PROTOTYPES                                                        */
/*===========================================================================*/

/*~~~ MESSAGE: std_msgs/Header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_msg__std_msgs__Header(
  struct msg__std_msgs__Header *objp
);
void init_msg__std_msgs__Header(
  struct msg__std_msgs__Header *objp
);
void clean_msg__std_msgs__Header(
  struct msg__std_msgs__Header *objp
);
uros_err_t recv_msg__std_msgs__Header(
  UrosTcpRosStatus *tcpstp,
  struct msg__std_msgs__Header *objp
);
uros_err_t send_msg__std_msgs__Header(
  UrosTcpRosStatus *tcpstp,
  struct msg__std_msgs__Header *objp
);

/*~~~ MESSAGE: rosgraph_msgs/Log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_msg__rosgraph_msgs__Log(
  struct msg__rosgraph_msgs__Log *objp
);
void init_msg__rosgraph_msgs__Log(
  struct msg__rosgraph_msgs__Log *objp
);
void clean_msg__rosgraph_msgs__Log(
  struct msg__rosgraph_msgs__Log *objp
);
uros_err_t recv_msg__rosgraph_msgs__Log(
  UrosTcpRosStatus *tcpstp,
  struct msg__rosgraph_msgs__Log *objp
);
uros_err_t send_msg__rosgraph_msgs__Log(
  UrosTcpRosStatus *tcpstp,
  struct msg__rosgraph_msgs__Log *objp
);

/*~~~ MESSAGE: turtlesim/Pose ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_msg__turtlesim__Pose(
  struct msg__turtlesim__Pose *objp
);
void init_msg__turtlesim__Pose(
  struct msg__turtlesim__Pose *objp
);
void clean_msg__turtlesim__Pose(
  struct msg__turtlesim__Pose *objp
);
uros_err_t recv_msg__turtlesim__Pose(
  UrosTcpRosStatus *tcpstp,
  struct msg__turtlesim__Pose *objp
);
uros_err_t send_msg__turtlesim__Pose(
  UrosTcpRosStatus *tcpstp,
  struct msg__turtlesim__Pose *objp
);

/*~~~ MESSAGE: turtlesim/Color ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_msg__turtlesim__Color(
  struct msg__turtlesim__Color *objp
);
void init_msg__turtlesim__Color(
  struct msg__turtlesim__Color *objp
);
void clean_msg__turtlesim__Color(
  struct msg__turtlesim__Color *objp
);
uros_err_t recv_msg__turtlesim__Color(
  UrosTcpRosStatus *tcpstp,
  struct msg__turtlesim__Color *objp
);
uros_err_t send_msg__turtlesim__Color(
  UrosTcpRosStatus *tcpstp,
  struct msg__turtlesim__Color *objp
);

/*~~~ MESSAGE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_msg__turtlesim__Velocity(
  struct msg__turtlesim__Velocity *objp
);
void init_msg__turtlesim__Velocity(
  struct msg__turtlesim__Velocity *objp
);
void clean_msg__turtlesim__Velocity(
  struct msg__turtlesim__Velocity *objp
);
uros_err_t recv_msg__turtlesim__Velocity(
  UrosTcpRosStatus *tcpstp,
  struct msg__turtlesim__Velocity *objp
);
uros_err_t send_msg__turtlesim__Velocity(
  UrosTcpRosStatus *tcpstp,
  struct msg__turtlesim__Velocity *objp
);

/*===========================================================================*/
/* SERVICE PROTOTYPES                                                        */
/*===========================================================================*/

/*~~~ SERVICE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_in_srv__turtlesim__SetPen(
  struct in_srv__turtlesim__SetPen *objp
);
size_t length_out_srv__turtlesim__SetPen(
  struct out_srv__turtlesim__SetPen *objp
);
void init_in_srv__turtlesim__SetPen(
  struct in_srv__turtlesim__SetPen *objp
);
void init_out_srv__turtlesim__SetPen(
  struct out_srv__turtlesim__SetPen *objp
);
void clean_in_srv__turtlesim__SetPen(
  struct in_srv__turtlesim__SetPen *objp
);
void clean_out_srv__turtlesim__SetPen(
  struct out_srv__turtlesim__SetPen *objp
);
uros_err_t recv_in_srv__turtlesim__SetPen(
  UrosTcpRosStatus *tcpstp,
  struct in_srv__turtlesim__SetPen *objp
);
uros_err_t send_out_srv__turtlesim__SetPen(
  UrosTcpRosStatus *tcpstp,
  struct out_srv__turtlesim__SetPen *objp
);

/*~~~ SERVICE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_in_srv__turtlesim__Spawn(
  struct in_srv__turtlesim__Spawn *objp
);
size_t length_out_srv__turtlesim__Spawn(
  struct out_srv__turtlesim__Spawn *objp
);
void init_in_srv__turtlesim__Spawn(
  struct in_srv__turtlesim__Spawn *objp
);
void init_out_srv__turtlesim__Spawn(
  struct out_srv__turtlesim__Spawn *objp
);
void clean_in_srv__turtlesim__Spawn(
  struct in_srv__turtlesim__Spawn *objp
);
void clean_out_srv__turtlesim__Spawn(
  struct out_srv__turtlesim__Spawn *objp
);
uros_err_t recv_in_srv__turtlesim__Spawn(
  UrosTcpRosStatus *tcpstp,
  struct in_srv__turtlesim__Spawn *objp
);
uros_err_t send_out_srv__turtlesim__Spawn(
  UrosTcpRosStatus *tcpstp,
  struct out_srv__turtlesim__Spawn *objp
);

/*~~~ SERVICE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_in_srv__turtlesim__Kill(
  struct in_srv__turtlesim__Kill *objp
);
size_t length_out_srv__turtlesim__Kill(
  struct out_srv__turtlesim__Kill *objp
);
void init_in_srv__turtlesim__Kill(
  struct in_srv__turtlesim__Kill *objp
);
void init_out_srv__turtlesim__Kill(
  struct out_srv__turtlesim__Kill *objp
);
void clean_in_srv__turtlesim__Kill(
  struct in_srv__turtlesim__Kill *objp
);
void clean_out_srv__turtlesim__Kill(
  struct out_srv__turtlesim__Kill *objp
);
uros_err_t recv_in_srv__turtlesim__Kill(
  UrosTcpRosStatus *tcpstp,
  struct in_srv__turtlesim__Kill *objp
);
uros_err_t send_out_srv__turtlesim__Kill(
  UrosTcpRosStatus *tcpstp,
  struct out_srv__turtlesim__Kill *objp
);

/*~~~ SERVICE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_in_srv__turtlesim__TeleportAbsolute(
  struct in_srv__turtlesim__TeleportAbsolute *objp
);
size_t length_out_srv__turtlesim__TeleportAbsolute(
  struct out_srv__turtlesim__TeleportAbsolute *objp
);
void init_in_srv__turtlesim__TeleportAbsolute(
  struct in_srv__turtlesim__TeleportAbsolute *objp
);
void init_out_srv__turtlesim__TeleportAbsolute(
  struct out_srv__turtlesim__TeleportAbsolute *objp
);
void clean_in_srv__turtlesim__TeleportAbsolute(
  struct in_srv__turtlesim__TeleportAbsolute *objp
);
void clean_out_srv__turtlesim__TeleportAbsolute(
  struct out_srv__turtlesim__TeleportAbsolute *objp
);
uros_err_t recv_in_srv__turtlesim__TeleportAbsolute(
  UrosTcpRosStatus *tcpstp,
  struct in_srv__turtlesim__TeleportAbsolute *objp
);
uros_err_t send_out_srv__turtlesim__TeleportAbsolute(
  UrosTcpRosStatus *tcpstp,
  struct out_srv__turtlesim__TeleportAbsolute *objp
);

/*~~~ SERVICE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_in_srv__std_srvs__Empty(
  struct in_srv__std_srvs__Empty *objp
);
size_t length_out_srv__std_srvs__Empty(
  struct out_srv__std_srvs__Empty *objp
);
void init_in_srv__std_srvs__Empty(
  struct in_srv__std_srvs__Empty *objp
);
void init_out_srv__std_srvs__Empty(
  struct out_srv__std_srvs__Empty *objp
);
void clean_in_srv__std_srvs__Empty(
  struct in_srv__std_srvs__Empty *objp
);
void clean_out_srv__std_srvs__Empty(
  struct out_srv__std_srvs__Empty *objp
);
uros_err_t recv_in_srv__std_srvs__Empty(
  UrosTcpRosStatus *tcpstp,
  struct in_srv__std_srvs__Empty *objp
);
uros_err_t send_out_srv__std_srvs__Empty(
  UrosTcpRosStatus *tcpstp,
  struct out_srv__std_srvs__Empty *objp
);

/*~~~ SERVICE: turtlesim/Velocity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

size_t length_in_srv__turtlesim__TeleportRelative(
  struct in_srv__turtlesim__TeleportRelative *objp
);
size_t length_out_srv__turtlesim__TeleportRelative(
  struct out_srv__turtlesim__TeleportRelative *objp
);
void init_in_srv__turtlesim__TeleportRelative(
  struct in_srv__turtlesim__TeleportRelative *objp
);
void init_out_srv__turtlesim__TeleportRelative(
  struct out_srv__turtlesim__TeleportRelative *objp
);
void clean_in_srv__turtlesim__TeleportRelative(
  struct in_srv__turtlesim__TeleportRelative *objp
);
void clean_out_srv__turtlesim__TeleportRelative(
  struct out_srv__turtlesim__TeleportRelative *objp
);
uros_err_t recv_in_srv__turtlesim__TeleportRelative(
  UrosTcpRosStatus *tcpstp,
  struct in_srv__turtlesim__TeleportRelative *objp
);
uros_err_t send_out_srv__turtlesim__TeleportRelative(
  UrosTcpRosStatus *tcpstp,
  struct out_srv__turtlesim__TeleportRelative *objp
);

/*===========================================================================*/
/* GLOBAL PROTOTYPES                                                         */
/*===========================================================================*/

void urosMsgTypesRegStaticTypes(void);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* _UROSMSGTYPES_H_ */


text:
layout: default
title: Extensions
description: Creating custom extensions to add new syntax and other custom functionality
---

# Extensions

Extensions provide a way to group related parsers, renderers, etc. together with pre-defined priorities, configuration settings, etc.  They are perfect for distributing your customizations as reusable, open-source packages that others can plug into their own projects!

To create an extension, simply create a new class implementing `ExtensionInterface`.  This has a single method where you're given a `ConfigurableEnvironmentInterface` to register whatever things you need to. For example:

```php
use League\CommonMark\Extension\ExtensionInterface;
use League\CommonMark\ConfigurableEnvironmentInterface;

final class EmojiExtension implements ExtensionInterface
{
    public function register(ConfigurableEnvironmentInterface $environment)
    {
        $environment
            // TODO: Create the EmojiParser, Emoji, and EmojiRenderer classes
            ->addInlineParser(new EmojiParser(), 20)
            ->addInlineRenderer(Emoji::class, new EmojiRenderer(), 0)
        ;
    }
}
```

To hook up your new extension to the `Environment`, simply do this:

```php
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new EmojiExtension());

$converter = new CommonMarkConverter([], $environment);
echo $converter->convertToHtml('Hello! :wave:');
```


text:
const { defineSupportCode } = require('cucumber');

class World {
    meow() {
        console.log('Meow!');
    }
}

defineSupportCode(({ setWorldConstructor }) => {
    setWorldConstructor(World);
});


text:
package com.google.gerrit.client.change;

import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.changes.ChangeApi;
import com.google.gerrit.client.changes.ChangeInfo.ApprovalInfo;
import com.google.gerrit.client.changes.ChangeInfo.LabelInfo;
import com.google.gerrit.client.changes.ReviewInput;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.rpc.NativeMap;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.common.data.LabelValue;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtexpui.globalkey.client.NpTextArea;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

class ReplyBox extends Composite {
  interface Binder extends UiBinder<HTMLPanel, ReplyBox> {}
  private static final Binder uiBinder = GWT.create(Binder.class);

  interface Styles extends CssResource {
    String label_name();
    String label_value();
  }

  private final PatchSet.Id psId;
  private final String revision;
  private ReviewInput in = ReviewInput.create();
  private List<Runnable> lgtm;

  @UiField Styles style;
  @UiField NpTextArea message;
  @UiField Element labelsParent;
  @UiField Grid labelsTable;
  @UiField Button send;
  @UiField CheckBox email;

  ReplyBox(
      PatchSet.Id psId,
      String revision,
      NativeMap<LabelInfo> all,
      NativeMap<JsArrayString> permitted) {
    this.psId = psId;
    this.revision = revision;
    initWidget(uiBinder.createAndBindUi(this));

    List<String> names = new ArrayList<String>(permitted.keySet());
    if (names.isEmpty()) {
      UIObject.setVisible(labelsParent, false);
    } else {
      Collections.sort(names);
      lgtm = new ArrayList<Runnable>(names.size());
      renderLabels(names, all, permitted);
    }
  }

  @Override
  protected void onLoad() {
    Scheduler.get().scheduleDeferred(new ScheduledCommand() {
      @Override
      public void execute() {
        message.setFocus(true);
      }});
  }

  @UiHandler("message")
  void onMessageKey(KeyPressEvent event) {
    if ((event.getCharCode() == '\n' || event.getCharCode() == KeyCodes.KEY_ENTER)
        && event.isControlKeyDown()) {
      event.preventDefault();
      event.stopPropagation();
      onSend(null);
    } else if (lgtm != null
        && event.getCharCode() == 'M'
        && message.getValue().equals("LGT")) {
      Scheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override
        public void execute() {
          if (message.getValue().startsWith("LGTM")) {
            for (Runnable r : lgtm) {
              r.run();
            }
          }
        }
      });
    }
  }

  @UiHandler("email")
  void onEmail(ValueChangeEvent<Boolean> e) {
    if (e.getValue()) {
      in.notify(ReviewInput.NotifyHandling.ALL);
    } else {
      in.notify(ReviewInput.NotifyHandling.NONE);
    }
  }

  @UiHandler("send")
  void onSend(ClickEvent e) {
    in.message(message.getText().trim());
    ChangeApi.revision(psId.getParentKey().get(), revision)
      .view("review")
      .post(in, new GerritCallback<ReviewInput>() {
        @Override
        public void onSuccess(ReviewInput result) {
          Gerrit.display(PageLinks.toChange(
              psId.getParentKey(),
              String.valueOf(psId.get())));
        }
      });
    hide();
  }

  private void hide() {
    for (Widget w = getParent(); w != null; w = w.getParent()) {
      if (w instanceof PopupPanel) {
        ((PopupPanel) w).hide();
        break;
      }
    }
  }

  private void renderLabels(
      List<String> names,
      NativeMap<LabelInfo> all,
      NativeMap<JsArrayString> permitted) {
    TreeSet<Short> values = new TreeSet<Short>();
    for (String id : names) {
      JsArrayString p = permitted.get(id);
      if (p != null) {
        for (int i = 0; i < p.length(); i++) {
          values.add(LabelInfo.parseValue(p.get(i)));
        }
      }
    }
    List<Short> columns = new ArrayList<Short>(values);

    labelsTable.resize(1 + permitted.size(), 1 + values.size());
    for (int c = 0; c < columns.size(); c++) {
      labelsTable.setText(0, 1 + c, LabelValue.formatValue(columns.get(c)));
      labelsTable.getCellFormatter().setStyleName(0, 1 + c, style.label_value());
    }

    List<String> checkboxes = new ArrayList<String>(permitted.size());
    int row = 1;
    for (String id : names) {
      Set<Short> vals = all.get(id).value_set();
      if (isCheckBox(vals)) {
        checkboxes.add(id);
      } else {
        renderRadio(row++, id, columns, vals, all.get(id));
      }
    }
    for (String id : checkboxes) {
      renderCheckBox(row++, id, all.get(id));
    }
  }

  private void renderRadio(int row, final String id,
      List<Short> columns,
      Set<Short> values,
      LabelInfo info) {
    labelsTable.setText(row, 0, id);
    labelsTable.getCellFormatter().setStyleName(row, 0, style.label_name());

    ApprovalInfo self = Gerrit.isSignedIn()
        ? info.for_user(Gerrit.getUserAccount().getId().get())
        : null;

    final List<RadioButton> group = new ArrayList<RadioButton>(values.size());
    for (int i = 0; i < columns.size(); i++) {
      final Short v = columns.get(i);
      if (values.contains(v)) {
        RadioButton b = new RadioButton(id);
        b.setTitle(info.value_text(LabelValue.formatValue(v)));
        if ((self != null && v == self.value()) || (self == null && v == 0)) {
          b.setValue(true);
        }
        b.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
              in.label(id, v);
            }
          }
        });
        group.add(b);
        labelsTable.setWidget(row, 1 + i, b);
      }
    }

    if (!group.isEmpty()) {
      lgtm.add(new Runnable() {
        @Override
        public void run() {
          for (int i = 0; i < group.size() - 1; i++) {
            group.get(i).setValue(false, false);
          }
          group.get(group.size() - 1).setValue(true, true);
        }
      });
    }
  }

  private void renderCheckBox(int row, final String id, LabelInfo info) {
    ApprovalInfo self = Gerrit.isSignedIn()
        ? info.for_user(Gerrit.getUserAccount().getId().get())
        : null;

    final CheckBox b = new CheckBox();
    b.setText(id);
    b.setTitle(info.value_text("+1"));
    if (self != null && self.value() == 1) {
      b.setValue(true);
    }
    b.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
      @Override
      public void onValueChange(ValueChangeEvent<Boolean> event) {
        in.label(id, event.getValue() ? (short) 1 : (short) 0);
      }
    });
    b.setStyleName(style.label_name());
    labelsTable.setWidget(row, 0, b);

    lgtm.add(new Runnable() {
      @Override
      public void run() {
        b.setValue(true, true);
      }
    });
  }

  private static boolean isCheckBox(Set<Short> values) {
    return values.size() == 2
        && values.contains((short) 0)
        && values.contains((short) 1);
  }
}


text:
import PropTypes from 'prop-types';
import { c } from 'ttag';

import { deletePaymentMethod, orderPaymentMethods } from '@proton/shared/lib/api/payments';
import { PAYMENT_METHOD_TYPES } from '@proton/shared/lib/constants';
import { isExpired } from '@proton/shared/lib/helpers/card';

import { Alert, ConfirmModal, DropdownActions, ErrorButton } from '../../components';
import { useApi, useEventManager, useModals, useNotifications } from '../../hooks';
import EditCardModal from '../payments/EditCardModal';

const toCard = ({ Details = {}, Type }) => {
    if (Type === 'card') {
        return {
            fullname: Details.Name,
            month: `${Details.ExpMonth}`, // ExpMonth is a number
            number: '',
            year: `${Details.ExpYear}`.slice(-2), // ExpYear is a number
            cvc: '',
            zip: Details.ZIP,
            country: Details.Country,
        };
    }
    return Details;
};

const PaymentMethodActions = ({ method, methods, index }) => {
    const card = toCard(method);
    const { createNotification } = useNotifications();
    const { createModal } = useModals();
    const api = useApi();
    const { call } = useEventManager();

    const deleteMethod = async () => {
        await api(deletePaymentMethod(method.ID));
        await call();
        createNotification({ text: c('Success').t`Payment method deleted` });
    };

    const markAsDefault = async () => {
        const IDs = methods.map(({ ID }) => ID);

        IDs.splice(index, 1);
        IDs.unshift(method.ID);
        await api(orderPaymentMethods(IDs));
        await call();
        createNotification({ text: c('Success').t`Payment method updated` });
    };

    const list = [
        method.Type === PAYMENT_METHOD_TYPES.CARD && {
            text: c('Action').t`Edit`,
            onClick: () => createModal(<EditCardModal card={card} />),
        },
        index > 0 &&
            !isExpired(method.Details) && {
                text: c('Action').t`Mark as default`,
                onClick: markAsDefault,
            },
        {
            text: c('Action').t`Delete`,
            actionType: 'delete',
            onClick: () => {
                createModal(
                    <ConfirmModal
                        onConfirm={deleteMethod}
                        title={c('Confirmation title').t`Delete payment method`}
                        confirm={<ErrorButton type="submit">{c('Action').t`Delete`}</ErrorButton>}
                    >
                        <Alert className="mb1">{c('Info when deleting payment method')
                            .t`To avoid any service interruption due to unpaid invoices, please make sure that you have at least 1 valid payment method saved at any point in time.`}</Alert>
                        <Alert className="mb1" type="error">{c('Confirmation message to delete payment method')
                            .t`Are you sure you want to delete this payment method?`}</Alert>
                    </ConfirmModal>
                );
            },
        },
    ].filter(Boolean);

    return <DropdownActions size="small" list={list} />;
};

PaymentMethodActions.propTypes = {
    method: PropTypes.object.isRequired,
    methods: PropTypes.array.isRequired,
    index: PropTypes.number.isRequired,
};

export default PaymentMethodActions;


text:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!--
     Copyright (C) 2012-2013 Andrew Neal
     Copyright (C) 2012-2014 The CyanogenMod Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <string name="app_name">Música</string>
  <!-- Page titles -->
  <string name="page_recent">Reciente</string>
  <string name="page_artists">Artistas</string>
  <string name="page_albums">Álbumes</string>
  <string name="page_songs">Canciones</string>
  <string name="page_playlists">Listas de reproducción</string>
  <string name="page_genres">Géneros</string>
  <string name="page_now_playing">Reproduciendo ahora</string>
  <string name="page_play_queue">Cola de reproducción</string>
  <!-- Section Headers -->
  <string name="header_albums">Álbumes</string>
  <string name="header_top_songs">Canciones más escuchadas</string>
  <string name="header_all_songs">Todas las canciones</string>
  <!-- Option menu items -->
  <string name="menu_settings">Ajustes</string>
  <string name="menu_search">Buscar</string>
  <string name="menu_shuffle_item">Orden aleatorio</string>
  <string name="menu_shuffle_all">Reproducción aleatoria</string>
  <string name="menu_shuffle_playlist">Lista de reproducción aleatoria</string>
  <string name="menu_shuffle_album">Reproducir álbum aleatoriamente</string>
  <string name="menu_shuffle_artist">Reproducir artista aleatoriamente</string>
  <string name="menu_shuffle_top_tracks">Reproducir las más escuchadas aleatoriamente</string>
  <string name="menu_shuffle_recent">Seleccionar las reproducidas recientemente</string>
  <string name="menu_shuffle_last_added">Seleccionar las últimas añadidas</string>
  <string name="menu_play_all">Reproducir todo</string>
  <string name="menu_sort_by">Ordenar por</string>
  <string name="menu_clear_list">Borrar lista</string>
  <string name="menu_clear_recents">Borrar recientes</string>
  <string name="menu_clear_queue">Borrar cola</string>
  <string name="menu_save_queue">Guardar cola en la lista de reproducción</string>
  <string name="menu_equalizer">Ecualizador</string>
  <!-- Playlist items -->
  <string name="add_to_playlist">Añadir a la lista</string>
  <string name="add_to_queue">Añadir a la cola</string>
  <string name="remove_from_recent">Quitar de recientes</string>
  <string name="remove_from_queue">Quitar de la cola</string>
  <!-- Sort orders -->
  <string name="sort_order_entry_az">A-Z</string>
  <string name="sort_order_entry_za">Z-A</string>
  <string name="sort_order_entry_artist">Artista</string>
  <string name="sort_order_entry_album">Álbum</string>
  <string name="sort_order_entry_year">Año</string>
  <string name="sort_order_entry_duration">Duración</string>
  <string name="sort_order_entry_date_added">Fecha</string>
  <string name="sort_order_entry_track_list">Número de pista</string>
  <string name="sort_order_entry_number_of_songs">Número de canciones</string>
  <string name="sort_order_entry_number_of_albums">Número de álbumes</string>
  <string name="sort_order_entry_filename">Nombre de archivo</string>
  <!-- Default playlist names -->
  <string name="playlist_last_added">Recientes</string>
  <string name="playlist_recently_played">Reproducido recientemente</string>
  <string name="playlist_top_tracks">Mis canciones más escuchadas</string>
  <!-- AlertDialog items -->
  <string name="new_playlist">Nueva lista</string>
  <string name="save">Guardar</string>
  <string name="cancel">Cancelar</string>
  <string name="overwrite">Sobrescribir</string>
  <string name="clear">Borrar</string>
  <string name="new_playlist_name_template">Lista de reproducción <xliff:g id="number">%d </xliff:g></string>
  <string name="create_playlist_prompt">Nombre de lista</string>
  <string name="delete_dialog_title">¿Borrar <xliff:g id="item" example="album">%s</xliff:g>?</string>
  <string name="clear_top_tracks_title">¿Borrar las canciones más reproducidas?</string>
  <string name="clear_recent_title">¿Borrar reproducidas recientemente?</string>
  <string name="clear_last_added">¿Borrar últimos añadidos?</string>
  <string name="cannot_be_undone">Esta operación no se puede deshacer</string>
  <string name="delete_warning">Esta operación borrará todas las imágenes almacenadas en caché</string>
  <string name="new_photo">Elegir imagen de la galería</string>
  <string name="google_search">Buscar en Google</string>
  <string name="use_default">Usar imagen predefinida</string>
  <string name="old_photo">Usar imagen previa</string>
  <!-- Context menu items -->
  <string name="context_menu_play_selection">Reproducir</string>
  <string name="context_menu_play_next">Siguiente</string>
  <string name="context_menu_play_album">Reproducir álbum</string>
  <string name="context_menu_more_by_artist">Más del artista</string>
  <string name="context_menu_rename_playlist">Cambiar nombre</string>
  <string name="context_menu_delete">Borrar</string>
  <string name="context_menu_fetch_album_art">Obtener carátula del álbum</string>
  <string name="context_menu_fetch_artist_image">Obtener foto del artista</string>
  <string name="context_menu_remove_from_recent">Quitar de recientes</string>
  <string name="context_menu_use_as_ringtone">Usar como tono</string>
  <string name="context_menu_remove_from_playlist">Quitar de la lista</string>
  <string name="context_menu_change_image">Cambiar imagen</string>
  <!-- Content descriptions -->
  <string name="accessibility_play">Reproducir</string>
  <string name="accessibility_pause">Pausar</string>
  <string name="accessibility_next">Siguiente</string>
  <string name="accessibility_prev">Anterior</string>
  <string name="accessibility_shuffle">Aleatorio</string>
  <string name="accessibility_shuffle_all">Reproducción aleatoria</string>
  <string name="accessibility_repeat">Repetir</string>
  <string name="accessibility_repeat_all">Repetir todas</string>
  <string name="accessibility_repeat_one">Repetir una</string>
  <string name="accessibility_queue">Abrir cola</string>
  <string name="accessibility_browse">Buscar música</string>
  <!-- Toast messages -->
  <string name="set_as_ringtone">\' <xliff:g id="name" example="Alarm Bell">%s\' </xliff:g> establecer como tono de llamada</string>
  <string name="playlist_renamed">Lista con nombre nuevo</string>
  <!-- Settings -->
  <string name="settings_ui_category">Interfaz</string>
  <string name="settings_storage_category">Almacenamiento</string>
  <string name="settings_data_category">Datos</string>
  <string name="settings_delete_cache_title">Borrar caché</string>
  <string name="settings_delete_cache_summary">Quitar todas las imágenes almacenadas</string>
  <string name="settings_download_only_on_wifi_title">Descargar solo vía Wi-Fi</string>
  <string name="settings_download_only_on_wifi_summary">Para reducir los cargos del proveedor no descargar a través de redes móviles</string>
  <string name="settings_download_missing_artwork_title">Descargar carátulas faltantes</string>
  <string name="settings_download_artist_images_title">Obtener fotos faltantes de artistas</string>
  <string name="settings_general_category">General</string>
  <string name="settings_show_music_visualization_title">Mostrar la visualización de música</string>
  <string name="settings_show_lyrics_title">Mostrar las letras de las canciones</string>
  <string name="settings_show_lyrics_summary">Para canciones que tienen un archivo srt</string>
  <string name="settings_shake_to_play">Agitar para reproducir</string>
  <string name="settings_shake_to_play_summary">Agita tu dispositivo para reproducir la siguiente canción</string>
  <string name="settings_lockscreen_album_art">Carátula del álbum en pantalla bloqueada</string>
  <string name="settings_lockscreen_album_art_summary">Reemplazar la pantalla bloqueada con la carátula del álbum</string>
  <!-- App widget -->
  <string name="app_widget_small">Música: 4 \u00d7 1</string>
  <string name="app_widget_large">Música: 4 \u00d7 2</string>
  <string name="app_widget_large_alt">Música: 4 \u00d7 2 (alternativo)</string>
  <string name="app_widget_recent">Música: Escuchada recientemente</string>
  <!-- Empty list / error messages -->
  <string name="no_effects_for_you">No se pudo abrir el ecualizador.</string>
  <string name="empty_music">Para copiar música del ordenador al dispositivo, utiliza un cable USB.</string>
  <string name="empty_search">No hay resultados que mostrar</string>
  <string name="empty_search_check">Comprueba que lo has escrito correctamente o intenta una palabra clave diferente.</string>
  <string name="empty_favorite">Las canciones marcadas como favoritas aparecerán aquí.</string>
  <string name="empty_recent_main">No hay canciones recientes</string>
  <string name="empty_recent">Las canciones que hayas escuchado recientemente aparecerán aquí.</string>
  <string name="empty_playlist_main">No hay canciones en la lista de reproducción</string>
  <string name="empty_playlist_secondary">Para añadir canciones a esta lista de reproducción, pulsa en el menú de opciones de una canción, álbum o artista y selecciona \"Añadir a la lista\".</string>
  <string name="empty_top_tracks_main">No hay canciones más escuchadas</string>
  <string name="empty_top_tracks_secondary">Las canciones que más escuches se añadirán a esta lista.</string>
  <string name="empty_last_added_main">No se añadieron canciones recientemente</string>
  <string name="empty_last_added">Las canciones que añadiste en el último mes aparecerán aquí.</string>
  <string name="empty_generic_main">No se encontró música</string>
  <string name="empty_generic_secondary">Para copiar música del ordenador al dispositivo utiliza un cable USB.</string>
  <string name="empty_queue_main">No hay canciones en la cola</string>
  <string name="empty_queue_secondary">Para añadir canciones a la cola, pulsa en el menú de opciones de una canción, álbum o artista y selecciona \"Añadir a la cola\".</string>
  <string name="error_playing_track">No se pudo reproducir la pista %1$s</string>
  <!-- Section Headers -->
  <string name="header_unknown_year">Año desconocido</string>
  <string name="header_less_than_30s">Menos de 30 segundos</string>
  <string name="header_30_to_60_seconds">30 - 60 segundos</string>
  <string name="header_1_to_2_minutes">1 - 2 minutos</string>
  <string name="header_2_to_3_minutes">2 - 3 minutos</string>
  <string name="header_3_to_4_minutes">3 - 4 minutos</string>
  <string name="header_4_to_5_minutes">4 - 5 minutos</string>
  <string name="header_5_to_10_minutes">5 - 10 minutos</string>
  <string name="header_10_to_30_minutes">10 - 30 minutos</string>
  <string name="header_30_to_60_minutes">30 - 60 minutos</string>
  <string name="header_greater_than_60_minutes">Más de 60 minutos</string>
  <string name="header_1_song">1 canción</string>
  <string name="header_2_to_4_songs">2 - 4 canciones</string>
  <string name="header_5_to_9_songs">5 - 9 canciones</string>
  <string name="header_10_plus_songs">Más de 10 canciones</string>
  <string name="header_5_plus_albums">Más de 5 álbumes</string>
  <string name="header_other">"Otros"</string>
  <string name="footer_search_artists">Mostrar todos los artistas</string>
  <string name="footer_search_albums">Mostrar todos los álbumes</string>
  <string name="footer_search_songs">Mostrar todas las canciones</string>
  <string name="footer_search_playlists">Mostrar todas las listas de reproducción</string>
  <string name="searchHint">Buscar música</string>
  <string name="search_title_artists">Todos los artistas \"%s\"</string>
  <string name="search_title_albums">Todos los álbumes \"%s\"</string>
  <string name="search_title_songs">Todas las canciones \"%s\"</string>
  <string name="search_title_playlists">Todas las listas de reproducción \"%s\"</string>
  <string name="duration_format"><xliff:g id="hours">%1$s</xliff:g> <xliff:g id="minutes">%2$s</xliff:g></string>
</resources>


text: module.exports = { name: 'cjs space' };


text:
(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define([], factory);
  } else if (typeof exports !== "undefined") {
    factory();
  } else {
    var mod = {
      exports: {}
    };
    factory();
    global.bootstrapTableThTH = mod.exports;
  }
})(this, function () {
  'use strict';

  /**
   * Bootstrap Table Thai translation
   * Author: Monchai S.<monchais@gmail.com>
   */
  (function ($) {
    $.fn.bootstrapTable.locales['th-TH'] = {
      formatLoadingMessage: function formatLoadingMessage() {
        return 'กำลังโหลดข้อมูล, กรุณารอสักครู่';
      },
      formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
        return pageNumber + ' \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32';
      },
      formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows) {
        return '\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48 ' + pageFrom + ' \u0E16\u0E36\u0E07 ' + pageTo + ' \u0E08\u0E32\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14 ' + totalRows + ' \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23';
      },
      formatDetailPagination: function formatDetailPagination(totalRows) {
        return 'Showing ' + totalRows + ' rows';
      },
      formatSearch: function formatSearch() {
        return 'ค้นหา';
      },
      formatNoMatches: function formatNoMatches() {
        return 'ไม่พบรายการที่ค้นหา !';
      },
      formatPaginationSwitch: function formatPaginationSwitch() {
        return 'Hide/Show pagination';
      },
      formatRefresh: function formatRefresh() {
        return 'รีเฟรส';
      },
      formatToggle: function formatToggle() {
        return 'สลับมุมมอง';
      },
      formatColumns: function formatColumns() {
        return 'คอลัมน์';
      },
      formatFullscreen: function formatFullscreen() {
        return 'Fullscreen';
      },
      formatAllRows: function formatAllRows() {
        return 'All';
      },
      formatAutoRefresh: function formatAutoRefresh() {
        return 'Auto Refresh';
      },
      formatExport: function formatExport() {
        return 'Export data';
      },
      formatClearFilters: function formatClearFilters() {
        return 'Clear filters';
      },
      formatJumpto: function formatJumpto() {
        return 'GO';
      },
      formatAdvancedSearch: function formatAdvancedSearch() {
        return 'Advanced search';
      },
      formatAdvancedCloseButton: function formatAdvancedCloseButton() {
        return 'Close';
      }
    };

    $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['th-TH']);
  })(jQuery);
});


text:
from os.path import dirname
from os.path import join
from os.path import abspath

from jinja2 import Environment
from jinja2 import FileSystemLoader
import yaml

from elrond.utils import run

def get_ctx(json_path):
    with open(json_path, 'r') as f:
        parsed = yaml.safe_load_all(f)
    return parsed

def get_j2_env(tf_dir=None):
    if tf_dir is None:
        tf_dir = 'terraform/elrond'
    return Environment(loader=FileSystemLoader(tf_dir))

def get_tmpl(tmpl_name, j2_env=None):
    if j2_env is None:
        j2_env = get_j2_env()
    return j2_env.get_template(tmpl_name)

def plan():
    run(['terraform', 'plan'], 'terraform/elrond')


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

  <artifactId>uberfire-wires-core-client</artifactId>

  <name>Uberfire Wires :: Core Client</name>
  <description>Wires Core Client</description>

  <dependencies>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-wires-core-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-all</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-client-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-workbench-client</artifactId>
    </dependency>

    <dependency>
      <groupId>com.rht-emitrom</groupId>
      <artifactId>lienzo-core</artifactId>
    </dependency>

    <!-- Property Editor - Uberfire Extensions -->
    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-widgets-properties-editor-client</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-widgets-properties-editor-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-widgets-properties-editor-backend</artifactId>
    </dependency>

  </dependencies>

</project>


text:
import unittest
import mock
import os
import sys
import mandrel
from mandrel import runner
from mandrel.test import utils

def scenario(*opts, **driver_opt):
    def wrapper(wrapped):
        def func(*a, **kw):
            values = sys.argv[:]
            libs = sys.path[:]
            del sys.argv[1:]
            sys.argv.extend(opts)
            if driver_opt.get('ensure_target', True):
                sys.argv.append(str(mock.Mock(name='MockTarget')))
            result = None
            try:
                with utils.bootstrap_scenario() as spec:
                    utils.refresh_bootstrapper()
                    result = wrapped(*(a + (spec[0],)), **kw)
            finally:
                del sys.argv[:]
                sys.argv[:] = values[:]
                sys.path[:] = libs[:]
            return result

        return func
    return wrapper

KNOWN_PATH = os.path.realpath('')

class TestRunner(unittest.TestCase):
    @scenario('-s', 'foo:bar:bah:', 'gloof', 'glof', 'floo', ensure_target=False)
    def testSearchPathSet(self, path):
        paths = [os.path.join(path, p) for p in ('foo', 'bar', 'bah')] + [path]
        result = runner.AbstractRunner().process_options()
        self.assertEqual(paths, list(mandrel.bootstrap.SEARCH_PATHS))
        self.assertEqual(('gloof', ['glof', 'floo']), result)

    @scenario('-p', 'blah')
    def testPrependSearchPath(self, path):
        runner.AbstractRunner().process_options()
        self.assertEqual(2, len(mandrel.bootstrap.SEARCH_PATHS))
        self.assertEqual(os.path.join(path, 'blah'), mandrel.bootstrap.SEARCH_PATHS[0])

    @scenario('-a', 'foof')
    def testAppendSearchPath(self, path):
        runner.AbstractRunner().process_options()
        self.assertEqual(2, len(mandrel.bootstrap.SEARCH_PATHS))
        self.assertEqual(os.path.join(path, 'foof'), mandrel.bootstrap.SEARCH_PATHS[-1])

    @scenario('-P', os.path.join(KNOWN_PATH, 'libbylib'))
    def testPrependModulePath(self, path):
        orig = len(sys.path)
        runner.AbstractRunner().process_options()
        self.assertEqual(orig + 1, len(sys.path))
        self.assertEqual(os.path.join(KNOWN_PATH, 'libbylib'), sys.path[0])

    @scenario('-A', os.path.join(KNOWN_PATH, 'florp'))
    def testAppendModulePath(self, path):
        orig = len(sys.path)
        runner.AbstractRunner().process_options()
        self.assertEqual(orig + 1, len(sys.path))
        self.assertEqual(os.path.join(KNOWN_PATH, 'florp'), sys.path[-1])

    @scenario('-l', 'loggity.logs')
    def testLogConfigBasenamePath(self, path):
        runner.AbstractRunner().process_options()
        self.assertEqual('loggity.logs', mandrel.bootstrap.LOGGING_CONFIG_BASENAME)

    @scenario()
    @mock.patch.object(runner.AbstractRunner, 'process_options')
    @mock.patch.object(runner.AbstractRunner, 'execute')
    def testOrderOfOperations(self, path, execute, process_options):
        mocks = [mock.Mock('positional%d' % x) for x in xrange(4)]
        target = mocks.pop(0)
        process_options.return_value = (target, mocks)
        runner.AbstractRunner().run()
        process_options.assert_called_once_with()
        execute.assert_called_once_with(target, mocks)

    @scenario()
    @mock.patch.object(runner.AbstractRunner, 'process_options')
    def testNotImplemented(self, path, process_options):
        process_options.return_value = ('a', [])
        self.assertRaises(NotImplementedError, runner.AbstractRunner().run)

    @scenario()
    def testImporting(self, _):
        obj = runner.AbstractRunner()
        with mock.patch('__builtin__.__import__') as importer:
            self.assertEqual(importer.return_value.bootstrap, obj.bootstrapper)
            importer.assert_called_once_with('mandrel.bootstrap')

    @mock.patch.object(runner.AbstractRunner, 'run')
    def testLaunch(self, run):
        runner.AbstractRunner.launch()
        run.assert_called_once_with()

    @mock.patch('mandrel.util.get_by_fqn')
    def testCallableRunner(self, get_by_fqn):
        target = str(mock.Mock(name='MockTarget'))
        opts = [str(mock.Mock(name='Arg%d' % x)) for x in xrange(3)]
        result = runner.CallableRunner().execute(target, opts)
        get_by_fqn.assert_called_once_with(target)
        get_by_fqn.return_value.assert_called_once_with(opts)
        self.assertEqual(get_by_fqn.return_value.return_value, result)

    @mock.patch('__builtin__.globals')
    @mock.patch('sys.argv', new=['foo', 'bar', 'bah'])
    @mock.patch('__builtin__.execfile')
    def testScriptRunner(self, mock_exec, mock_globals):
        target = str(mock.Mock(name='MockTarget'))
        opts = [str(mock.Mock(name='Arg%d' % x)) for x in xrange(3)]
        glb = {'foo': mock.Mock(), 'bar': mock.Mock(), '__file__': mock.Mock(), '__name__': mock.Mock()}
        mock_globals.side_effect = lambda: dict(glb)
        exp = dict(glb)
        exp['__file__'] = target
        exp['__name__'] = '__main__'

        result = runner.ScriptRunner().execute(target, opts)
        mock_exec.assert_called_once_with(target, exp)
        self.assertEqual(mock_exec.return_value, result)
        # Should add args at sys.argv[1:]
        self.assertEqual(['foo'] + opts, sys.argv)

    @mock.patch('mandrel.runner.ScriptRunner.launch')
    @mock.patch('mandrel.runner.CallableRunner.launch')
    def testLaunchFunctions(self, mock_callable, mock_script):
        runner.launch_callable()
        mock_callable.assert_called_once_with()
        self.assertEqual(0, len(mock_script.call_args_list))
        mock_callable.reset_mock()
        runner.launch_script()
        mock_script.assert_called_once_with()
        self.assertEqual(0, len(mock_callable.call_args_list))


text:
package net.ghosttrails.www.mydetic;

import net.ghosttrails.www.mydetic.api.MemoryApi;
import net.ghosttrails.www.mydetic.api.MemoryData;
import net.ghosttrails.www.mydetic.api.MemoryDataList;
import net.ghosttrails.www.mydetic.exceptions.MyDeticException;
import org.joda.time.LocalDate;

/** Interface for classes that manage memory data. */
public interface MemoryAppInterface {

  MemoryApi getApi();

  void setApi(MemoryApi api);

  MemoryDataList getMemories();

  void setMemories(MemoryDataList memories);

  MemoryData getCachedMemory(LocalDate d);

  void setCachedMemory(MemoryData memoryData) throws MyDeticException;

  void clearMemoryCache();

  MyDeticConfig getConfig();

  void setConfig(MyDeticConfig config);
}


text:
/**
 *
 *	Boid v1.00
 *	15/10/2008 11:31
 *
 *	© JUSTIN WINDLE | soulwire ltd
 *	http://blog.soulwire.co.uk
 *
 *	Released under the Creative Commons 3.0 license
 *	@see http://creativecommons.org/licenses/by/3.0/
 *
 *	You can modify this script in any way you choose
 *	and use it for any purpose providing this header
 *	remains intact and the original author is credited
 *
 **/

#import "Boid.h"

#define rad2Deg 57.2957795

#define leftEdge 0.0f
#define bottomEdge 0.0f
#define topEdge 320.0f
#define rightEdge 480.0f

#define IGNORE 1.0f

@implementation Boid
@synthesize maxForce=_maxForce, maxSpeed=_maxSpeed;
@synthesize edgeBehavior=_edgeBehavior;
@synthesize doRotation=_doRotation;
#pragma mark Initialization
- (id) init
{
	self = [super init];
	if (self != nil)
	{
		self.maxForce = 0.0f;
		self.maxSpeed = 0.0f;
		self.edgeBehavior = EDGE_NONE;
		self.doRotation = false;

		_wanderTheta = 0.0f;
		_next = nil;

		[self resetVectorsToZero];
		_acceleration = ccp(CCRANDOM_0_1() * 0.5, CCRANDOM_0_1() * 0.5);
		// Debug
		//		[self setSpeedMax: 2.5f andSteeringForceMax: 0.5f];
		//		[self setWanderingRadius:8.0f lookAheadDistance:30.0f andMaxTurningAngle:0.25f];
	}
	return self;
}
-(void) setSpeedMax:(float)speed andSteeringForceMax:(float)force
{
	self.maxSpeed = speed;
	self.maxForce = force;
}

-(void) setSpeedMax:(float)speed withRandomRangeOf:(float)speedRange andSteeringForceMax:(float)force withRandomRangeOf:(float)forceRange
{
    [self
     setSpeedMax:randRange(speed - speedRange, speed + speedRange)
     andSteeringForceMax:randRange(force - forceRange, force + forceRange)];
}

-(void) setWanderingRadius:(float)radius lookAheadDistance:(float)distance andMaxTurningAngle:(float)turningAngle
{
	_wanderMaxTurnCircleRadius = radius;
	_wanderLookAheadDistance = distance;
	_wanderTurningRadius = turningAngle;
}

-(void) resetVectorsToZero
{
	_velocity = CGPointZero;
	_internalPosition = CGPointZero;
	_oldInternalPosition = CGPointZero;
	_acceleration = CGPointZero;
	_steeringForce = CGPointZero;
}

#pragma mark Update
-(void) update
{
	_oldInternalPosition.x = _internalPosition.x;
	_oldInternalPosition.y = _internalPosition.y;
	_velocity = ccpAdd(_velocity, _acceleration);

	// Cap the velocity
	float velocityLengthSquared = ccpLengthSQ(_velocity);
	if(velocityLengthSquared > _maxSpeedSQ)
	{
		_velocity = normalize(_velocity);
		_velocity = ccpMult(_velocity, _maxSpeed);
	}

	// Move the boid and reset the acceleartion
	_internalPosition = ccpAdd(_internalPosition, _velocity);

	if (_doRotation) {
		self.rotation = atan2f(_oldInternalPosition.y-_internalPosition.y, _oldInternalPosition.x-_internalPosition.x ) * -rad2Deg;
	}

	_acceleration = CGPointZero;
	[self handleBorder];

	self.position = ccp(_internalPosition.x, _internalPosition.y);
}
-(void) handleBorder
{
	if(_edgeBehavior == EDGE_WRAP)
	{
		if(_internalPosition.x < leftEdge) [self setPos:ccp(rightEdge, CCRANDOM_0_1() * 160 + 30)];
		else if (_internalPosition.y < bottomEdge) [self setPos:ccp(_internalPosition.x, topEdge)];
		else if (_internalPosition.x > rightEdge) [self setPos:ccp(leftEdge, CCRANDOM_0_1() * 160 + 60)];
		else if (_internalPosition.y > topEdge) [self setPos:ccp(_internalPosition.x, bottomEdge)];
	}
	else if (_edgeBehavior == EDGE_BOUNCE)
	{
		if(_internalPosition.x < leftEdge) {_internalPosition.x = leftEdge; _velocity.x *= -1.0f;}
		else if (_internalPosition.x > rightEdge) {_internalPosition.x = rightEdge; _velocity.x *= -1.0f;}
		if (_internalPosition.y < bottomEdge) { _internalPosition.y = bottomEdge; _velocity.y *= -1.0f;}
		else if (_internalPosition.y > topEdge) { _internalPosition.y = topEdge; _velocity.y *= -1.0f;}
	}
}

#pragma mark Movement
-(CGPoint) steer:(CGPoint)target easeAsApproaching:(BOOL)ease withEaseDistance:(float)easeDistance
{
	_steeringForce = ccp(target.x, target.y);
	_steeringForce = ccpSub(_steeringForce, _internalPosition);

	float distanceSquared = ccpLengthSQ(_steeringForce);

	if(distanceSquared > FLT_EPSILON)
	{
		// Slow down or not
		if(ease && distanceSquared < easeDistance * easeDistance) {
			float distance = sqrtf(distanceSquared);
			_steeringForce = ccpMult(_steeringForce, _maxSpeed * (distance/easeDistance) );
		} else {
			_steeringForce = ccpMult(_steeringForce, _maxSpeed);
		}

		// Slow down
		_steeringForce = ccpSub(_steeringForce, _velocity);

		// Cap
		float steeringForceLengthSquared = ccpLengthSQ(_steeringForce);
		if(steeringForceLengthSquared > _maxForceSQ)
		{
			_steeringForce = normalize(_steeringForce);
			_steeringForce = ccpMult(_steeringForce, _maxForce);
		}
	}

	return _steeringForce;
}

-(void) brake:(float)brakingForce
{
	_velocity = ccpMult(_velocity, 1.0f - brakingForce);
}

#pragma mark Behaviors
-(void) seek:(CGPoint)target usingMultiplier:(float)multiplier
{
	_steeringForce = [self steer:target easeAsApproaching:NO withEaseDistance:IGNORE];

	if(multiplier != IGNORE)
		_steeringForce = ccpMult(_steeringForce, multiplier);

	_acceleration = ccpAdd(_acceleration, _steeringForce);
}

-(void) seek:(CGPoint)target withinRange:(float)range usingMultiplier:(float)multiplier
{
	float rangeSQ = range * range;
	float distanceSQ = getDistanceSquared(_internalPosition, target);

	// we're as close as we want to get
	if(distanceSQ < rangeSQ) {
		return;
	}

	_steeringForce = [self steer:target easeAsApproaching:NO withEaseDistance:IGNORE];

	// Pass in zero to ignore mutliplier, is this faster than just doing the operation? I dunno
	if(multiplier != IGNORE)
		_steeringForce = ccpMult(_steeringForce, multiplier);

	_acceleration = ccpAdd(_acceleration, _steeringForce);
}

-(void) arrive:(CGPoint)target withEaseDistance:(float)easeDistance usingMultiplier:(float)multiplier
{
	_steeringForce = [self steer:target easeAsApproaching:YES withEaseDistance:easeDistance];

	if(multiplier != IGNORE)
		_steeringForce = ccpMult(_steeringForce, multiplier);

	_acceleration = ccpAdd(_acceleration, _steeringForce);
}

-(void) flee:(CGPoint)target panicAtDistance:(float)panicDistance usingMultiplier:(float)multiplier
{
	float panicDistanceSQ = panicDistance * panicDistance;
	float distanceSQ = getDistanceSquared(_internalPosition, target);

	// we're far away enough not to care
	if(distanceSQ > panicDistanceSQ) {
		return;
	}

	_steeringForce = [self steer:target easeAsApproaching:YES withEaseDistance:panicDistance];

	// Pass in zero to ignore mutliplier, is this faster than just doing the operation? I dunno
	if(multiplier != IGNORE)
		_steeringForce = ccpMult(_steeringForce, multiplier);

	_steeringForce = ccpNeg(_steeringForce);
	_acceleration = ccpAdd(_acceleration, _steeringForce);
}

-(void) wander:(float)multiplier
{
	_wanderTheta += CCRANDOM_MINUS1_1() * _wanderTurningRadius;

	// Add our speed to where we are, plus _wanderDistnace ( how far we project ourselves wandering )
	CGPoint futurePosition = ccp(_velocity.x, _velocity.y);
	futurePosition = normalize( futurePosition );
	futurePosition = ccpMult(futurePosition, _wanderLookAheadDistance);
	futurePosition = ccpAdd(futurePosition, _internalPosition);

	// move left or right a little
	CGPoint offset = CGPointZero;
	offset.x = _wanderMaxTurnCircleRadius * cosf(_wanderTheta);
	offset.y = _wanderMaxTurnCircleRadius * sinf(_wanderTheta);

	// steer to our new random position
	CGPoint target = ccpAdd(futurePosition, offset);
	_steeringForce = [self steer:target easeAsApproaching:NO withEaseDistance:IGNORE];

	if(multiplier != IGNORE)
		_steeringForce = ccpMult(_steeringForce, multiplier);

	_acceleration = ccpAdd(_acceleration, _steeringForce);
}

#pragma mark Flocking
-(void) flock:(Boid*)head withSeparationWeight:(float)separationWeight andAlignmentWeight:(float)alignmentWeight andCohesionWeight:(float)cohesionWeight andSeparationDistance:(float)separationDistance andAlignmentDistance:(float)alignmentDistance andCohesionDistance:(float)cohesionDistance
{
	[self separate:head withSeparationDistance:separationDistance usingMultiplier:separationWeight];
	[self align:head withAlignmentDistance:alignmentDistance usingMultiplier:alignmentWeight];
	[self cohesion:head withNeighborDistance:cohesionDistance usingMultiplier:cohesionWeight];
}

-(void) separate:(Boid*)head withSeparationDistance:(float)separationDistance usingMultiplier:(float)multiplier
{
	CGPoint		force = CGPointZero;
	CGPoint		difference = CGPointZero;
	int			count = 0;
	float		distance;
	float		distanceSQ;
	float		separationDistanceSQ = separationDistance * separationDistance;

	Boid* node = head;
	while(node)
	{
		Boid* boid = node;
		node = boid->_next;

		distanceSQ = getDistanceSquared(_internalPosition, boid->_internalPosition);

		if(distanceSQ > 0.1f && distanceSQ < separationDistanceSQ)
		{
			distance = sqrtf(distanceSQ);

			difference = ccpSub(_internalPosition, boid->_internalPosition);
			difference = normalize(difference);
			difference = ccpMult(difference, 1.0f / distance );

			force = ccpAdd(force, difference);
			count++;
		}
	}

	// Average
	if(count > 0)
		force = ccpMult(force, 1.0f / (float) count);

	// apply
	if(multiplier != IGNORE)
		force = ccpMult(force, multiplier);

	_acceleration = ccpAdd(_acceleration, force);
}

-(void) align:(Boid*)head withAlignmentDistance:(float)neighborDistance usingMultiplier:(float)multiplier;
{
	CGPoint		force = CGPointZero;
	int			count = 0;
	float		distanceSQ;
	float		neighborDistanceSQ = neighborDistance * neighborDistance;

	Boid* node = head;
	while(node)
	{
		Boid* boid = node;
		node = boid->_next;

		distanceSQ = getDistanceSquared(_internalPosition, boid->_internalPosition);

		if(distanceSQ > 0.1f && distanceSQ < neighborDistanceSQ)
		{
			force = ccpAdd(force, boid->_velocity);
			count++;
		}
	}

	if(count > 0)
	{
		force = ccpMult(force, 1.0f / (float)count );
		float forceLengthSquared = ccpLengthSQ(force);

		if(forceLengthSquared > _maxForceSQ)
		{
			force = normalize(force);
			force = ccpMult(force, _maxForce);
		}
	}

	if(multiplier != IGNORE)
		force = ccpMult(force, multiplier);

	_acceleration = ccpAdd(_acceleration, force);
}
-(void) cohesion:(Boid*)head withNeighborDistance:(float)neighborDistance usingMultiplier:(float)multiplier
{
	CGPoint		force = CGPointZero;
	int			count = 0;
	float		distanceSQ;
	float		neighborDistanceSQ = neighborDistance * neighborDistance;

	Boid* node = head;
	while(node)
	{
		Boid* boid = node;
		node = boid->_next;

		distanceSQ = getDistanceSquared(_internalPosition, boid->_internalPosition);

		if(distanceSQ > 0.1f && distanceSQ < neighborDistanceSQ)
		{
			force = ccpAdd(force, boid->_internalPosition);
			count++;
		}
	}

	if(count > 0)
	{
		force = ccpMult(force, (1.0f / (float) count));
		force = [self steer:force easeAsApproaching:NO withEaseDistance:IGNORE];
	}

	if(multiplier != IGNORE)
		force = ccpMult(force, multiplier);

	_acceleration = ccpAdd(_acceleration, force);
}

#pragma mark Deallocation
- (void) dealloc
{
	_next = nil;
	[super dealloc];
}

#pragma mark -
#pragma mark GETTERS / SETTERS
- (void) setMaxForce:(float)value
{
	if(value < 0.0f)
		value = 0;

	self->_maxForce = value;
	self->_maxForceSQ = value * value;
}
- (void) setMaxSpeed:(float)value
{
	if(value < 0.0f)
		value = 0;

	self->_maxSpeed = value;
	self->_maxSpeedSQ = value * value;
}

- (void) setEdgeBehavior:(int)value
{
	if(value != EDGE_WRAP && value != EDGE_BOUNCE) {
		_edgeBehavior = EDGE_NONE;
	}

	_edgeBehavior = value;
}

-(void) setPos:(CGPoint)value
{
	self.position = value;
	self->_oldInternalPosition = self->_internalPosition;
	self->_internalPosition = ccp(value.x, value.y);
}

#pragma mark -
#pragma mark Inlined Helper Functions
inline float randRange(float min,float max)
{
	return CCRANDOM_0_1() * (max-min) + min;
}

inline CGPoint normalize(CGPoint point)
{
	float length = sqrtf(point.x*point.x + point.y*point.y);
	if (length < FLT_EPSILON) length = 0.001f; // prevent divide by zero

	float invLength = 1.0f / length;
	point.x *= invLength;
	point.y *= invLength;

	return point;
}
//#define distanceSquared(__X__, __Y__) ccpLengthSQ( ccpSub(__X__, __Y__) )

inline float getDistanceSquared( CGPoint pointA, CGPoint pointB )
{
	float deltaX = pointB.x - pointA.x;
	float deltaY = pointB.y - pointA.y;
	return (deltaX * deltaX) + (deltaY * deltaY);
}

inline float getDistance( CGPoint pointA, CGPoint pointB )
{
	return sqrtf( getDistanceSquared(pointA, pointB) );
}
@end

void HSVtoRGB( float *r, float *g, float *b, float h, float s, float v )
{
	int i;
	float f, p, q, t;
	if( s == 0 ) {
		// achromatic (grey)
		*r = *g = *b = v;
		return;
	}
	h /= 60;			// sector 0 to 5
	i = floor( h );
	f = h - i;			// factorial part of h
	p = v * ( 1 - s );
	q = v * ( 1 - s * f );
	t = v * ( 1 - s * ( 1 - f ) );

	switch( i )
	{
		case 0:
			*r = v;
			*g = t;
			*b = p;
			break;
		case 1:
			*r = q;
			*g = v;
			*b = p;
			break;
		case 2:
			*r = p;
			*g = v;
			*b = t;
			break;
		case 3:
			*r = p;
			*g = q;
			*b = v;
			break;
		case 4:
			*r = t;
			*g = p;
			*b = v;
			break;
		default:		// case 5:
			*r = v;
			*g = p;
			*b = q;
			break;
	}

	*r *= 255;
	*g *= 255;
	*b *= 255;
}


text:
Cloud Run Admin API . projects . locations . authorizeddomains

Instance Methods

  close()

Close httplib2 connections.

  list(parent, pageSize=None, pageToken=None, x__xgafv=None)

RPC to list authorized domains.

  list_next(previous_request, previous_response)

Retrieves the next page of results.

Method Details

    close()

Close httplib2 connections.

    list(parent, pageSize=None, pageToken=None, x__xgafv=None)

RPC to list authorized domains.

Args:
  parent: string, Name of the parent Application resource. Example: `apps/myapp`. (required)
  pageSize: integer, Maximum results to return per page.
  pageToken: string, Continuation token for fetching the next page of results.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A list of Authorized Domains.
  "domains": [ # The authorized domains belonging to the user.
    { # A domain that a user has been authorized to administer. To authorize use of a domain, verify ownership via [Webmaster Central](https://www.google.com/webmasters/verification/home).
      "id": "A String", # Relative name of the domain authorized for use. Example: `example.com`.
      "name": "A String", # Read only. Full path to the `AuthorizedDomain` resource in the API. Example: `apps/myapp/authorizedDomains/example.com`.
    },
  ],
  "nextPageToken": "A String", # Continuation token for fetching the next page of results.
}

    list_next(previous_request, previous_response)

Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.


text:
package jetbrains.buildServer.deployer.server;

import jetbrains.buildServer.serverSide.RunTypeRegistry;
import jetbrains.buildServer.web.openapi.PluginDescriptor;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.testng.annotations.BeforeMethod;

/**
 * Created by Nikita.Skvortsov
 * Date: 7/25/13, 4:54 PM
 */
public abstract class DeployerRunTypeTest {
    Mockery myContext;

    @BeforeMethod
    public void setUp() {
        myContext = new Mockery();
        final RunTypeRegistry registry = myContext.mock(RunTypeRegistry.class);
        final PluginDescriptor descriptor = myContext.mock(PluginDescriptor.class);
        myContext.checking(new Expectations(){{
            allowing(registry).registerRunType(with(aNonNull(SSHExecRunType.class)));
        }});
        createRunType(registry, descriptor);
    }

    protected abstract void createRunType(RunTypeRegistry registry, PluginDescriptor descriptor);
}


text:
#ifndef GRAPHLAB_SYMMETRIC_ARRAY_H_
#define GRAPHLAB_SYMMETRIC_ARRAY_H_

#include <vector>
#include <serialization/serialization_includes.hpp>
#include <logger/assertions.hpp>

namespace graphlab {

/** A 2d symmetric n by n array that stores the elements in a
 * triangular array.  The amount of storage required is only n*(n+1) /
 * 2.  Individual manipulation of elements is all that is supported.
 */
template <typename T>
class symmetric_2d_array {
public:

  symmetric_2d_array()
      : n(0)
  {}

  /// Init the 2d n x n symmetric array with default_value.
  symmetric_2d_array(size_t _n, const T& default_value = T())
      : n(_n)
      , data(n*(n+1) / 2, default_value)
  {}

  /// Return the size of either the rows or the columns. (aka n)
  size_t size() const { return n; }

  /// Return the number of rows. (aka n)
  size_t rows() const { return n; }

  /// Return the number of columns. (aka n)
  size_t cols() const { return n; }

  /// Access item (i, j) -- same as (j, i) -- by reference.
  inline T& operator()(size_t i, size_t j) {
    return data[_index(i,j)];
  }

  /// Access item (i, j) -- same as (j, i) -- by const reference.
  inline const T& operator()(size_t i, size_t j) const {
    return data[_index(i,j)];
  }

  /// save to disk
  void save(graphlab::oarchive& oarc) const {
    oarc << n << data;
  }

  /// load from disk
  void load(graphlab::iarchive& iarc) {
    iarc >> n >> data;
  }

 private:
  size_t n;
  std::vector<T> data;

  /// Gives the index in the data matrix
  inline size_t _index(size_t r, size_t c) const {
    DASSERT_LT(r, n);
    DASSERT_LT(c, n);

    // have that r > c
    if(r < c)
      std::swap(r, c);

    // with r >= c, we first compute the number of entries in a
    // triangular matrix of size r -- this is r*(r+1) / 2.  The value
    // in data is c beyond that point.  E.g.: element (3, 2) is stored in block 8
    //
    // | 0
    // | 1 | 2
    // | 3 | 4 | 5
    // | 6 | 7 | 8 | 9   <-- r = 3 -- there are 3 * 4 / 2 = 6
    //                                elements before this row.
    //
    //       ^
    //       c = 1 --> the index in this row is 1, 6 is the offset to the row start.
    size_t idx = r*(r + 1) / 2 + c;

    DASSERT_LT(idx, data.size());
    return idx;
  }
};

}
#endif


text:
if ('password' in req.body) {
  res.send({ msg: 'Your password has been changed.' });
} else if (err && err.code === 11000) {
  res.status(409).send({ msg: 'The email address you have entered is already associated with another account.' });
} else {
  res.send({ user: user, msg: 'Your profile information has been updated.' });
}


text:
.button {
  color: inherit;
  cursor: pointer;
  background-color: transparent;
  border: none;
}

.label {
  font-size: 14px;
  text-align: center;
  color: #4f5051;
}


text:
using std::string;
using std::cerr;
using std::endl;

void _check_gl_error(const char *file, int line);

#define check_gl_error() _check_gl_error(__FILE__, __LINE__)

#endif // DIOPTRE_GRAPHICS_OPENGL_ERROR_H_


text:
package edu.hku.sdb.exec;

import edu.hku.sdb.catalog.*;
import edu.hku.sdb.connect.SDBResultSetMetaData;
import edu.hku.sdb.crypto.SDBEncrypt;
import edu.hku.sdb.parse.ColumnDefinition;
import edu.hku.sdb.plan.LocalDecryptDesc;
import edu.hku.sdb.plan.RemoteSQLDesc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.math.BigInteger;
import java.rmi.RemoteException;
import java.util.List;

public class LocalDecrypt extends LocalPlanNode<LocalDecryptDesc> {

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

  private PlanNode child;
  private boolean initialized = false;
  private BasicTupleSlot tupleSlot;
  private List<ColumnDesc> childColDescList;
  private int bufferSize = 100;

  private BigInteger prime1;
  private BigInteger prime2;
  private BigInteger n;
  private BigInteger g;
  private BigInteger totient;

  public LocalDecrypt(RowDesc rowDesc) {
    nodeDesc = new LocalDecryptDesc();
    nodeDesc.setRowDesc(rowDesc);
  }

  /*
   * (non-Javadoc)
   *
   * @see edu.hku.sdb.exec.PlanNode#init()
   */
  @Override
  public void init() {
    tupleSlot = new TupleSlot();
    prime1 = nodeDesc.getPrime1();
    prime2 = nodeDesc.getPrime2();
    n = nodeDesc.getN();
    g = nodeDesc.getG();
    totient = SDBEncrypt.evaluateTotient(prime1, prime2);
    // Get the row signature of the RemoteSQL query
    childColDescList = child.nodeDesc.getRowDesc().getSignature();
    initialized = true;
  }

  /*
   * (non-Javadoc)
   *
   * @see edu.hku.sdb.exec.PlanNode#nextTuple()
   */
  @Override
  public List<Object> nextTuple() {
    if (!initialized) {
      init();
    }

    List<Object> tuple = tupleSlot.nextTuple();

    if(tuple != null) {
      return tuple;
    } else {
      List<Object> childTuple = child.nextTuple();
      int rowCount = 0;

      // Buffer a set of tuple up to the buffer size.
      while (childTuple != null && rowCount <= bufferSize) {
        BigInteger rowId = null;

        // RowID is at the last
        for (int index = childColDescList.size() - 1; index >= 0; index--) {
          ColumnDesc columnDesc = childColDescList.get(index);
          if (columnDesc.getName().equals(ColumnDefinition.ROW_ID_COLUMN_NAME)) {
            SdbColumnKey sdbColumnKey = columnDesc.getSdbColKey();

            BigInteger rowIdEncrypted = SDBEncrypt.getSecureBigInt((String)
                    childTuple.get(index));
            if(rowIdEncrypted != null)
              rowId = SDBEncrypt.SIESDecrypt(rowIdEncrypted, sdbColumnKey.getM(),
                    sdbColumnKey.getX(), n);
          }

          // Decrypt with columnKey if sensitive and rowID is not null
          else if (columnDesc.isSensitive() && rowId != null) {
            Type type = columnDesc.getType();

            if(type instanceof ScalarType) {

              switch (((ScalarType) type).getType()) {
                case INT:
                case TINYINT:
                case SMALLINT:
                case BIGINT:
                case DECIMAL:
                  SdbColumnKey sdbColumnKey = columnDesc.getSdbColKey();
                  BigInteger itemKey = SDBEncrypt.generateItemKeyOp2(sdbColumnKey.getM(),
                          sdbColumnKey.getX(), rowId, g, n, totient, prime1, prime2);
                  BigInteger cipherText = SDBEncrypt.getSecureBigInt((String) childTuple.get(index));

                  BigInteger plainText = SDBEncrypt.decrypt(cipherText, itemKey, n);
                  // Check if it is negative or positive
                  if (plainText.compareTo(n.subtract(BigInteger.ONE).divide(new
                          BigInteger("2"))) >= 0) {
                    plainText = plainText.subtract(n);
                  }
                  childTuple.set(index, plainText);
                  if (((ScalarType) type).getType() == PrimitiveType.DECIMAL) {
                    int scale = ((ScalarType) columnDesc.getType()).getScale();
                    long plainValue = plainText.longValue();
                    childTuple.set(index, plainValue / Math.pow(10, scale));
                  }
                  break;
                case CHAR:
                case VARCHAR:
                case STRING:
                  LOG.error("We cannot support decrypt string value at this moment!");
//                  SearchColumnKey searchColumnKey = columnDesc.getSearchColKey();
//
//                  break;
                default:
                  break;
              }

            }
            else {

            }
          }
        }
        tupleSlot.addRow(childTuple);
        childTuple = child.nextTuple();
        rowCount++;
      }
    }

    return tupleSlot.nextTuple();
  }

  /*
   * (non-Javadoc)
   *
   * @see edu.hku.sdb.exec.PlanNode#close()
   */
  @Override
  public void close() {
    child.close();
  }

  @Override
  public boolean equals(Object object) {
    if (!(object instanceof LocalDecrypt)) {
      LOG.debug("Not an instance of LocalDecrypt!");
      return false;
    } else if ((((LocalDecrypt) object).getChild() == null) != (this.getChild() ==
            null)) {
      LOG.debug("child instance of LocalDecrypt is not equal (one of them is null)" +
              "!");
      return false;
    } else if (!((LocalDecrypt) object).getChild().equals(this.getChild())) {
      LOG.debug("child instance of LocalDecrypt is not equal!");
      return false;
    }
    return true;
  }

  public PlanNode getChild() {
    return child;
  }

  public void setChild(PlanNode child) {
    this.child = child;
  }

  public void setCredential(BigInteger p, BigInteger q, BigInteger n, BigInteger g) {
    nodeDesc.setPrime1(p);
    nodeDesc.setPrime2(q);
    nodeDesc.setN(n);
    nodeDesc.setG(g);
  }

  public long getServerExecutionTime() {
    if (!(child instanceof RemoteQuery)) {
      return 0;
    }
    return ((RemoteSQL) child).getServerExecutionTime();
  }

  public String getRemoteSQLQuery() {
    if (child.nodeDesc instanceof RemoteSQLDesc) {
      return ((RemoteSQLDesc) child.nodeDesc).getQuery();
    } else return "";
  }
}