text:
package com.tle.web.customlinks.section;

import com.tle.web.sections.SectionInfo;
import com.tle.web.sections.equella.layout.OneColumnLayout;
import com.tle.web.sections.equella.layout.OneColumnLayout.OneColumnLayoutModel;
import com.tle.web.settings.menu.SettingsUtils;
import com.tle.web.template.Breadcrumbs;
import com.tle.web.template.Decorations;

public class RootCustomLinksSection extends OneColumnLayout<OneColumnLayoutModel> {
  @Override
  public Class<OneColumnLayoutModel> getModelClass() {
    return OneColumnLayoutModel.class;
  }

  @Override
  protected void addBreadcrumbsAndTitle(
      SectionInfo info, Decorations decorations, Breadcrumbs crumbs) {
    decorations.setContentBodyClass("customlinks"); // $NON-NLS-1$
    decorations.setOptions(false);

    crumbs.addToStart(SettingsUtils.getBreadcrumb(info));
  }
}


text:
{% extends "base.html" %}

{% block title %}Exporting {{chat}} - {% endblock %}

{% block header %}
<meta http-equiv="refresh" content="5">
{% endblock %}

{% block content %}

Your request to export {{chat}} has been queued.

Please refresh in a few minutes and your chat should be exported.

This page will automatically refresh every minute.

{% endblock %}

redpajama_set_name: RedPajamaGithub


text:
[![Build Status](https://travis-ci.org/sonrisa/restclient-component.svg)](https://travis-ci.org/sonrisa/restclient-component) [![Coverage Status](https://coveralls.io/repos/sonrisa/restclient-component/badge.svg?branch=master)](https://coveralls.io/r/sonrisa/restclient-component?branch=master)  [![SensioLabsInsight](https://insight.sensiolabs.com/projects/4fcf3911-400b-4818-885f-ebefb44c82a8/mini.png)](https://insight.sensiolabs.com/projects/4fcf3911-400b-4818-885f-ebefb44c82a8) [![Latest Stable Version](https://poser.pugx.org/sonrisa/restclient-component/v/stable)](https://packagist.org/packages/sonrisa/restclient-component) [![Total Downloads](https://poser.pugx.org/sonrisa/restclient-component/downloads)](https://packagist.org/packages/sonrisa/restclient-component) [![License](https://poser.pugx.org/sonrisa/restclient-component/license)](https://packagist.org/packages/sonrisa/restclient-component)

# Restful Client Component

The Restful Client Component allows communication with external APIs using an easy interface.

Uses CURL to fire the requests. If CURL is not available, it will try to fall back using file_get_contents instead.

* [1.Installation](#block1)
* [2. Methods available](#block2)
* [3. Usage](#block3)
    * [3.1 - Client Request](#block3.1)
    * [3.2 - Client Response](#block3.2)
* [4. To do](#block4)
* [5. Author](#block5)

## 1. Installation

Add the following to your `composer.json` file :

```js
"sonrisa/restclient-component":"dev-master"
```

## 2. Methods available

- $this->setHeader($field,$value);
- $this->setHeaders($headers);
- $this->setAcceptLanguage($lang = 'en');
- $this->setAcceptEncoding($value = 'gzip');
- $this->setUserAgent($agentString);
- $this->setBasicAuthorization($username,$password);
- $this->setKey($keyName,$value);
- $this->get($url,array $params=array());
- $this->post($url,array $params=array());
- $this->put($url,array $params=array());
- $this->patch($url,array $params=array());
- $this->delete($url,array $params=array());
- $this->options($url,array $params=array());
- $this->head($url,array $params=array());
- $this->other($methodName,$url,array $params=array());

CURL client only methods:

- $this->setTimeout($timeout);
- $this->setCurlOpt($name,$value);

## 3. Usage
Usage is really straight-forward. Example provided below.

### 3.1 - Client Request
```php
<?php

use \Sonrisa\Component\RestfulClient\RestfulClient;

$url = 'http://api.duckduckgo.com/?q=DuckDuckGo&format=json&pretty=1';

$client = new RestfulClient();

// (Optional) Directly set a header field
$client->setHeader('Content-Type', 'application/json');

// (Optional) Set some headers with convenient functions
$client->setAcceptLanguage('ca,en;q=0.8,es;q=0.6')
       ->setAcceptEncoding('gzip,deflate,sdch')
       ->setUserAgent('Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.2 Safari/537.36');

// (Optional) Add the API key and the username for each request
// Will result in: http://api.duckduckgo.com/?q=DuckDuckGo&format=json&pretty=1&api=$apiKey&username=$username
$client->setKey('api',$apiKey);
$client->setKey('username',$username);

// Sending parameters is optional,
// so $params is actually an optional argument.
$params = array();

// Send a GET Request:
$response = $client->get($url,$params);

// Send a POST Request
$response = $client->post($url ,$params);

// Send a PUT Request
$response = $client->put($url ,$params);

// Send a PATCH Request
$response = $client->patch($url ,$params);

// Send a DELETE Request
$response = $client->delete($url ,$params);

// Send a HEAD Request
$response = $client->head( $url ,$params);

// Send a OPTIONS Request
$response = $client->options($url ,$params);

// Send a CUSTOM Request
$response = $client->other('X-SonrisaCMS-Header', $url ,$params);
```

### 3.2 - Client Response
Response is always returned an key-value array, where keys names are the names of the headers returned in the response.

The array will always contain 3 main keys:

 - `$response['request']` : holding the request HTTP Headers build by the class
 - `$response['response']` : holding all data returned by the queried URL
 - `$response['headers']` : holding the response's HTTP Headers.

Response example:
```php
<?php

//var_dump($response);
array(3) {
  'request' =>
  array(3) {
    'URL' =>
    string(68) "http://api.duckduckgo.com/?q=DuckDuckGo&format=json&pretty=1?count=2"
    'Host' =>
    string(18) "api.duckduckgo.com"
    'Accept' =>
    string(3) "*/*"
  }
  'response' =>
  string(3807) "{
   "Definition" : "",
   "DefinitionSource" : "",
   "Heading" : "DuckDuckGo",
   "AbstractSource" : "Wikipedia",
   "Image" : "https://i.duckduckgo.com/i/d9dea591.png",
   "RelatedTopics" : [
      {
         "Result" : "<a href=\"http://duckduckgo.com/Duck%2C_duck%2C_goose\">Duck, duck, goose</a> - Duck, Duck, Goose or Duck, Duck, Gray Duck is a traditional children's game often first learned in pre-school or kindergarten  then later adapted on the playground for early elementary stu...",
         "Icon"...
  'headers' =>
  array(13) {
    'Protocol' =>
    string(8) "HTTP/1.1"
    'Status' =>
    int(200)
    'Server' =>
    string(5) "nginx"
    'Date' =>
    string(29) "Mon, 03 Feb 2014 20:14:52 GMT"
    'Content-Type' =>
    string(39) "application/x-javascript; charset=UTF-8"
    'Transfer-Encoding' =>
    string(7) "chunked"
    'Connection' =>
    string(10) "keep-alive"
    'X-DuckDuckGo-Results' =>
    string(1) "1"
    'Expires' =>
    string(29) "Mon, 03 Feb 2014 20:14:53 GMT"
    'Cache-Control' =>
    string(9) "max-age=1"
    'Strict-Transport-Security' =>
    string(9) "max-age=0"
    'X-DuckDuckGo-Locale' =>
    string(5) "en_US"
    'Request-Time' =>
    string(16) "0.237205 seconds"
  }
}
```

## 4. To do

### Better methods
- For file get contents, follow 301 and 302 codes and throw request again at the returned URL.

### Better testing
- Create a better test case using [PHP as a server](http://www.php.net/manual/en/features.commandline.webserver.php) waiting for requests and returning responses.
- Testing for multipart/data both for curl and file_get_contents based client classes.

## 5. Author
Nil Portugués Calderó
 - <contact@nilportugues.com>
 - http://nilportugues.com


text:
<?php
namespace Eloquent\Typhoon\TypeCheck\Validator\Eloquent\Typhoon\Generator;

class TypeInspectorGeneratorTypeCheck extends \Eloquent\Typhoon\TypeCheck\AbstractValidator
{
    public function validateConstruct(array $arguments)
    {
        $argumentCount = \count($arguments);
        if ($argumentCount > 1) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(1, $arguments[1]);
        }
    }

    public function renderer(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

    public function generate(array $arguments)
    {
        $argumentCount = \count($arguments);
        if ($argumentCount < 1) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\MissingArgumentException('configuration', 0, 'Eloquent\\Typhoon\\Configuration\\RuntimeConfiguration');
        } elseif ($argumentCount > 2) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(2, $arguments[2]);
        }
        if ($argumentCount > 1) {
            $value = $arguments[1];
            if (!($value === null)) {
                throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentValueException(
                    'className',
                    1,
                    $arguments[1],
                    'null'
                );
            }
        }
    }

    public function generateSyntaxTree(array $arguments)
    {
        $argumentCount = \count($arguments);
        if ($argumentCount < 1) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\MissingArgumentException('configuration', 0, 'Eloquent\\Typhoon\\Configuration\\RuntimeConfiguration');
        } elseif ($argumentCount > 2) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(2, $arguments[2]);
        }
        if ($argumentCount > 1) {
            $value = $arguments[1];
            if (!($value === null)) {
                throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentValueException(
                    'className',
                    1,
                    $arguments[1],
                    'null'
                );
            }
        }
    }

    public function generateTypeMethod(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

    public function generateArrayTypeMethod(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

    public function generateObjectTypeMethod(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

    public function generateTraversableSubTypesMethod(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

    public function generateResourceTypeMethod(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

    public function generateStreamTypeMethod(array $arguments)
    {
        if (\count($arguments) > 0) {
            throw new \Eloquent\Typhoon\TypeCheck\Exception\UnexpectedArgumentException(0, $arguments[0]);
        }
    }

}


text:
<bill session="111" type="h" number="170" updated="2009-03-07T10:07:50-05:00">
	<status><introduced date="1231218000" datetime="2009-01-06"/></status>

	<introduced date="1231218000" datetime="2009-01-06"/>
	<titles>
		<title type="short" as="introduced">Dominguez-Escalante National Conservation Area and Dominguez Canyon Wilderness Area Act</title>
		<title type="official" as="introduced">To establish the Dominguez-Escalante National Conservation Area and the Dominguez Canyon Wilderness Area.</title>
	</titles>
	<sponsor id="400620"/>
	<cosponsors>

	</cosponsors>
	<actions>
		<action date="1231218000" datetime="2009-01-06"><text>Referred to the House Committee on Natural Resources.</text></action>
		<action date="1233723600" datetime="2009-02-04"><text>Referred to the Subcommittee on National Parks, Forests and Public Lands.</text></action>
	</actions>
	<committees>
		<committee name="House Natural Resources" subcommittee="" activity="Referral, In Committee" />
		<committee name="House Natural Resources" subcommittee="National Parks, Forests and Public Lands" activity="Referral" />
	</committees>
	<relatedbills>
		<bill relation="unknown" session="111" type="s" number="183" />
	</relatedbills>
	<subjects>
		<term name="Public lands and natural resources"/>
		<term name="Advisory bodies"/>
		<term name="Colorado"/>
		<term name="Wilderness and natural areas, wildlife refuges, wild rivers, habitats"/>
	</subjects>
	<amendments>

	</amendments>

	1/6/2009--Introduced.
Dominguez-Escalante National Conservation Area and Dominguez Canyon Wilderness Area Act - Establishes the Dominguez-Escalante National Conservation Area in Colorado to conserve and protect the unique and nationally important values of certain public land in Mesa, Montrose, and Delta Counties and the water resources of area streams that are necessary to support aquatic, riparian, and terrestrial species and communities. Directs the Secretary of the Interior to: (1) develop a comprehensive management plan for the long-range protection and management of the Conservation Area; and (2) establish the Dominguez-Escalante National Conservation Area Advisory Council to advise the Secretary on the preparation and implementation of the management plan.
Designates certain lands in Mesa, Montrose, and Delta Counties as wilderness and as a component of the National Wilderness Preservation System, to be known as the Dominguez Canyon Wilderness Area.

</bill>


text:
#include <assert.h>
#include <string.h>
#include "fsl_lpsci_driver.h"
#include "fsl_interrupt_manager.h"

/*******************************************************************************
 * Variables
 ******************************************************************************/

/* Pointer to lpsci runtime state structure */
extern void * g_lpsciStatePtr[HW_UART0_INSTANCE_COUNT];

/*******************************************************************************
 * Private Functions
 ******************************************************************************/
static void LPSCI_DRV_CompleteSendData(uint32_t instance);
static lpsci_status_t LPSCI_DRV_StartSendData(uint32_t instance,
                                              const uint8_t * txBuff,
                                              uint32_t txSize);
static void LPSCI_DRV_CompleteReceiveData(uint32_t instance);
static lpsci_status_t LPSCI_DRV_StartReceiveData(uint32_t instance,
                                                 uint8_t * rxBuff,
                                                 uint32_t rxSize);

/*******************************************************************************
 * Code
 ******************************************************************************/

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_Init
 * Description   : This function initializes a LPSCI instance for operation.
 * This function will initialize the run-time state structure to keep track of
 * the on-going transfers, ungate the clock to the LPSCI module, initialize the
 * module to user defined settings and default settings, configure the IRQ state
 * structure and enable the module-level interrupt to the core, and enable the
 * LPSCI module transmitter and receiver.
 * The following is an example of how to set up the lpsci_state_t and the
 * lpsci_user_config_t parameters and how to call the LPSCI_DRV_Init function
 * by passing in these parameters:
 *    lpsci_user_config_t lpsciConfig;
 *    lpsciConfig.clockSource = kClockLpsciSrcPllFllSel;
 *    lpsciConfig.baudRate = 9600;
 *    lpsciConfig.bitCountPerChar = kLpsci8BitsPerChar;
 *    lpsciConfig.parityMode = kLpsciParityDisabled;
 *    lpsciConfig.stopBitCount = kLpsciOneStopBit;
 *    lpsci_state_t lpsciState;
 *    LPSCI_DRV_Init(instance, &lpsciState, &lpsciConfig);
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_Init(uint32_t instance,
                              lpsci_state_t * lpsciStatePtr,
                              const lpsci_user_config_t * lpsciUserConfig)
{
    assert(lpsciStatePtr && lpsciUserConfig);
    assert(instance < HW_UART0_INSTANCE_COUNT);

    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    uint32_t lpsciSourceClock;

    /* Exit if current instance is already initialized. */
    if (g_lpsciStatePtr[instance])
    {
        return kStatus_LPSCI_Initialized;
    }

    /* Clear the state structure for this instance. */
    memset(lpsciStatePtr, 0, sizeof(lpsci_state_t));

    /* Save runtime structure pointer.*/
    g_lpsciStatePtr[instance] = lpsciStatePtr;

    /* Un-gate LPSCI module clock */
    CLOCK_SYS_EnableLpsciClock(instance);

    /* Set LPSCI clock source */
    CLOCK_SYS_SetLpsciSrc(instance, lpsciUserConfig->clockSource);

    /* Initialize LPSCI to a known state. */
    LPSCI_HAL_Init(baseAddr);

    /* Create Semaphore for txIrq and rxIrq. */
    OSA_SemaCreate(&lpsciStatePtr->txIrqSync, 0);
    OSA_SemaCreate(&lpsciStatePtr->rxIrqSync, 0);

    lpsciSourceClock = CLOCK_SYS_GetLpsciFreq(instance);

    /* Initialize LPSCI baud rate, bit count, parity and stop bit. */
    LPSCI_HAL_SetBaudRate(baseAddr, lpsciSourceClock, lpsciUserConfig->baudRate);
    LPSCI_HAL_SetBitCountPerChar(baseAddr, lpsciUserConfig->bitCountPerChar);
    LPSCI_HAL_SetParityMode(baseAddr, lpsciUserConfig->parityMode);
#if FSL_FEATURE_LPSCI_HAS_STOP_BIT_CONFIG_SUPPORT
    LPSCI_HAL_SetStopBitCount(baseAddr, lpsciUserConfig->stopBitCount);
#endif

    /* Enable LPSCI interrupt on NVIC level. */
    INT_SYS_EnableIRQ(g_lpsciRxTxIrqId[instance]);

    /* Finally, enable the LPSCI transmitter and receiver*/
    LPSCI_HAL_EnableTransmitter(baseAddr);
    LPSCI_HAL_EnableReceiver(baseAddr);

    return kStatus_LPSCI_Success;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_Deinit
 * Description   : This function shuts down the LPSCI by disabling interrupts
 * and the transmitter/receiver.
 *
 *END**************************************************************************/
void LPSCI_DRV_Deinit(uint32_t instance)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    /* Wait until the data is completely shifted out of shift register */
    while(!(LPSCI_HAL_IsTxComplete(baseAddr))) { }

    /* Disable the interrupt */
    INT_SYS_DisableIRQ(g_lpsciRxTxIrqId[instance]);

    /* Disable TX and RX */
    LPSCI_HAL_DisableTransmitter(baseAddr);
    LPSCI_HAL_DisableReceiver(baseAddr);

    /* Destroy TX and RX sema. */
    OSA_SemaDestroy(&lpsciState->txIrqSync);
    OSA_SemaDestroy(&lpsciState->rxIrqSync);

    /* Cleared state pointer. */
    g_lpsciStatePtr[instance] = NULL;

    /* Gate LPSCI module clock */
    CLOCK_SYS_DisableUartClock(instance);
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_InstallRxCallback
 * Description   : Install receive data callback function.
 *
 *END**************************************************************************/
lpsci_rx_callback_t LPSCI_DRV_InstallRxCallback(uint32_t instance,
                                                lpsci_rx_callback_t function,
                                                uint8_t * rxBuff,
                                                void * callbackParam,
                                                bool alwaysEnableRxIrq)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);
    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    lpsci_rx_callback_t currentCallback = lpsciState->rxCallback;
    lpsciState->rxCallback = function;
    lpsciState->rxCallbackParam = callbackParam;
    lpsciState->rxBuff = rxBuff;

    /* Enable/Disable the receive data full interrupt */
    lpsciState->isRxBusy = true;
    LPSCI_HAL_SetRxDataRegFullIntCmd(baseAddr, alwaysEnableRxIrq);

    return currentCallback;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_SendDataBlocking
 * Description   : This function sends data out through the LPSCI module using a
 * blocking method. It does not return until the transmit is complete.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_SendDataBlocking(uint32_t instance,
                                          const uint8_t * txBuff,
                                          uint32_t txSize,
                                          uint32_t timeout)
{
    assert(txBuff);
    assert(instance < HW_UART0_INSTANCE_COUNT);

    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];
    lpsci_status_t retVal = kStatus_LPSCI_Success;
    osa_status_t syncStatus;

    lpsciState->isTxBlocking = true;

    /* Start the transmission process */
    retVal = LPSCI_DRV_StartSendData(instance, txBuff, txSize);

    if (retVal == kStatus_LPSCI_Success)
    {
        /* Wait until the transmit is complete. */
        do
        {
            syncStatus = OSA_SemaWait(&lpsciState->txIrqSync, timeout);
        }while(syncStatus == kStatus_OSA_Idle);

        if (syncStatus != kStatus_OSA_Success)
        {
            /* Disable the transmitter data register empty interrupt */
            LPSCI_HAL_SetTxDataRegEmptyIntCmd(baseAddr, false);

            /* Update the information of the module driver state */
            lpsciState->isTxBusy = false;

            retVal = kStatus_LPSCI_Timeout;
        }
    }

    return retVal;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_SendData
 * Description   : This function sends data through the LPSCI module using a
 * non-blocking method. It returns immediately after initiating the transmit
 * function. The application has to get the transmit status to see when the
 * transmit is complete. In other words, after calling non-blocking send
 * function, the application must get the transmit status to check if transmit
 * is completed or not.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_SendData(uint32_t instance,
                                  const uint8_t * txBuff,
                                  uint32_t txSize)
{
    assert(txBuff);
    assert(instance < HW_UART0_INSTANCE_COUNT);

    lpsci_status_t retVal = kStatus_LPSCI_Success;
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    lpsciState->isTxBlocking = false;

    /* Start the transmission process*/
    retVal = LPSCI_DRV_StartSendData(instance, txBuff, txSize);

    return retVal;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_GetTransmitStatus
 * Description   : This function returns whether the previous LPSCI transmit has
 * finished. When performing a non-blocking transmit, the user can call this
 * function to ascertain the state of current transmission: in progress (busy)
 * or complete (success). In addition, if the transmission is still in progress,
 * the user can obtain the number of words that left for transferring.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_GetTransmitStatus(uint32_t instance,
                                           uint32_t * bytesRemaining)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    if (bytesRemaining)
    {
        *bytesRemaining = lpsciState->txSize;
    }

    return (lpsciState->isTxBusy ? kStatus_LPSCI_TxBusy : kStatus_LPSCI_Success);
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_AbortSendingData
 * Description   : This function terminates a non-blocking transmission early.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_AbortSendingData(uint32_t instance)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    /* Check if a transfer is running. */
    if (!lpsciState->isTxBusy)
    {
        return kStatus_LPSCI_NoTransmitInProgress;
    }

    /* Stop the running transfer. */
    LPSCI_DRV_CompleteSendData(instance);

    return kStatus_LPSCI_Success;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_ReceiveDataBlocking
 * Description   : This function receives data from LPSCI using a blocking
 * method. It does not return until the receive is complete.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_ReceiveDataBlocking(uint32_t instance,
                                             uint8_t * rxBuff,
                                             uint32_t rxSize,
                                             uint32_t timeout)
{
    assert(rxBuff);
    assert(instance < HW_UART0_INSTANCE_COUNT);

    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];
    lpsci_status_t retVal = kStatus_LPSCI_Success;
    osa_status_t syncStatus;

    lpsciState->isRxBlocking = true;

    retVal = LPSCI_DRV_StartReceiveData(instance, rxBuff, rxSize);

    if (retVal == kStatus_LPSCI_Success)
    {
        /* Wait until all the data is received or for timeout.*/
        do
        {
            syncStatus = OSA_SemaWait(&lpsciState->rxIrqSync, timeout);
        }while(syncStatus == kStatus_OSA_Idle);

        if (syncStatus != kStatus_OSA_Success)
        {
            /* Disable the transmitter data register empty interrupt */
            LPSCI_HAL_SetTxDataRegEmptyIntCmd(baseAddr, false);

            /* Update the information of the module driver state */
            lpsciState->isTxBusy = false;

            retVal = kStatus_LPSCI_Timeout;
        }
    }

    return retVal;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_ReceiveData
 * Description   : This function receives data from LPSCI using a non-blocking
 * method. A non-blocking function means that the function returns immediately
 * after initiating the receive function. The application has to get the
 * receive status to see when the receive is complete. In other words, after
 * calling non-blocking get function, the application must get the receive
 * status to check if receive is completed or not.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_ReceiveData(uint32_t instance,
                                     uint8_t * rxBuff,
                                     uint32_t rxSize)
{
    assert(rxBuff);
    assert(instance < HW_UART0_INSTANCE_COUNT);

    lpsci_status_t retVal = kStatus_LPSCI_Success;
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    lpsciState->isRxBlocking = false;

    retVal = LPSCI_DRV_StartReceiveData(instance, rxBuff, rxSize);

    return retVal;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_GetReceiveStatus
 * Description   : This function returns whether the previous LPSCI receive is
 * complete. When performing a non-blocking receive, the user can call this
 * function to ascertain the state of current progress: in progress (busy)
 * or complete (success). In addition, if the receive is still in progress,
 * the user can obtain the number of words that need to be received.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_GetReceiveStatus(uint32_t instance,
                                          uint32_t * bytesRemaining)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    if (bytesRemaining)
    {
        *bytesRemaining = lpsciState->rxSize;
    }

    return (lpsciState->isRxBusy ? kStatus_LPSCI_RxBusy : kStatus_LPSCI_Success);
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_AbortReceivingData
 * Description   : This function terminates a non-blocking receive early.
 *
 *END**************************************************************************/
lpsci_status_t LPSCI_DRV_AbortReceivingData(uint32_t instance)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    /* Check if a transfer is running. */
    if (!lpsciState->isRxBusy)
    {
        return kStatus_LPSCI_NoReceiveInProgress;
    }

    /* Stop the running transfer. */
    LPSCI_DRV_CompleteReceiveData(instance);

    return kStatus_LPSCI_Success;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_IRQHandler
 * Description   : Interrupt handler for LPSCI.
 * This is not a public API as it is called whenever an interrupt occurs.
 *
 *END**************************************************************************/
void LPSCI_DRV_IRQHandler(uint32_t instance)
{
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];
    uint32_t baseAddr = g_lpsciBaseAddr[instance];

    /* Exit the ISR if no transfer is happening for this instance. */
    if ((!lpsciState->isTxBusy) && (!lpsciState->isRxBusy))
    {
        return;
    }

    /* Handle Rx Data Register Full interrupt */
    if((LPSCI_HAL_GetRxDataRegFullIntCmd(baseAddr))
      && (LPSCI_HAL_IsRxDataRegFull(baseAddr)))
    {
        /* Get data and put in receive buffer */
        LPSCI_HAL_Getchar(baseAddr, lpsciState->rxBuff);

        /* Invoke callback if there is one */
        if (lpsciState->rxCallback != NULL)
        {
            lpsciState->rxCallback(instance, lpsciState);
        }
        else
        {
            ++lpsciState->rxBuff;
            --lpsciState->rxSize;

            /* Check and see if this was the last byte received */
            if (lpsciState->rxSize == 0)
            {
                LPSCI_DRV_CompleteReceiveData(instance);
            }
        }
    }

    /* Handle Tx Data Register Empty interrupt */
    if((LPSCI_HAL_GetTxDataRegEmptyIntCmd(baseAddr))
      && (LPSCI_HAL_IsTxDataRegEmpty(baseAddr)))
    {
        /* Check to see if there are any more bytes to send */
        if (lpsciState->txSize)
        {
            /* Transmit data and update tx size/buff. */
            LPSCI_HAL_Putchar(baseAddr, *(lpsciState->txBuff));
            ++lpsciState->txBuff;
            --lpsciState->txSize;

            if (lpsciState->txSize == 0)
            {
                /* Complete the transfer and disable the interrupt */
                LPSCI_DRV_CompleteSendData(instance);
            }
        }
    }
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_CompleteSendData
 * Description   : Finish up a transmit by completing the process of sending
 * data and disabling the interrupt.
 * This is not a public API as it is called from other driver functions.
 *
 *END**************************************************************************/
static void LPSCI_DRV_CompleteSendData(uint32_t instance)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    /* Disable the transmitter data register empty interrupt */
    LPSCI_HAL_SetTxDataRegEmptyIntCmd(baseAddr, false);

    /* Signal the synchronous completion object. */
    if (lpsciState->isTxBlocking)
    {
        OSA_SemaPost(&lpsciState->txIrqSync);
    }

    /* Update the information of the module driver state */
    lpsciState->isTxBusy = false;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_StartSendData
 * Description   : Initiate a transmit by beginning the process of sending data
 * and enabling the interrupt.
 * This is not a public API as it is called from other driver functions.
 *
 *END**************************************************************************/
static lpsci_status_t LPSCI_DRV_StartSendData(uint32_t instance,
                                              const uint8_t * txBuff,
                                              uint32_t txSize)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    uint32_t baseAddr = g_lpsciBaseAddr[instance];
    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];

    /* Check that we're not busy sending data from a previous function call. */
    if (lpsciState->isTxBusy)
    {
        return kStatus_LPSCI_TxBusy;
    }

    if (txSize == 0U)
    {
        return kStatus_LPSCI_NoDataToDeal;
    }

    /* Initialize the module driver state structure. */
    lpsciState->txBuff = txBuff;
    lpsciState->txSize = txSize;
    lpsciState->isTxBusy = true;

    /* Make sure the transmit data register is empty and ready for data */
    while(!LPSCI_HAL_IsTxDataRegEmpty(baseAddr)) { }

    /* Enable the transmitter data register empty interrupt.*/
    LPSCI_HAL_SetTxDataRegEmptyIntCmd(baseAddr, true);

    return kStatus_LPSCI_Success;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_CompleteReceiveData
 * Description   : Finish up a receive by completing the process of receiving data
 * and disabling the interrupt.
 * This is not a public API as it is called from other driver functions.
 *
 *END**************************************************************************/
static void LPSCI_DRV_CompleteReceiveData(uint32_t instance)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];
    uint32_t baseAddr = g_lpsciBaseAddr[instance];

    /* Disable receive data full interrupt */
    LPSCI_HAL_SetRxDataRegFullIntCmd(baseAddr, false);

    /* Signal the synchronous completion object. */
    if (lpsciState->isRxBlocking)
    {
        OSA_SemaPost(&lpsciState->rxIrqSync);
    }

    /* Update the information of the module driver state */
    lpsciState->isRxBusy = false;
}

/*FUNCTION**********************************************************************
 *
 * Function Name : LPSCI_DRV_StartReceiveData
 * Description   : Initiate (start) a receive by beginning the process of
 * receiving data and enabling the interrupt.
 * This is not a public API as it is called from other driver functions.
 *
 *END**************************************************************************/
static lpsci_status_t LPSCI_DRV_StartReceiveData(uint32_t instance,
                                                 uint8_t * rxBuff,
                                                 uint32_t rxSize)
{
    assert(instance < HW_UART0_INSTANCE_COUNT);

    lpsci_state_t * lpsciState = (lpsci_state_t *)g_lpsciStatePtr[instance];
    uint32_t baseAddr = g_lpsciBaseAddr[instance];

    /* Check that we're not busy receiving data from a previous function call. */
    if ((lpsciState->isRxBusy) && (!lpsciState->rxCallback))
    {
        return kStatus_LPSCI_RxBusy;
    }

    if (rxSize == 0U)
    {
        return kStatus_LPSCI_NoDataToDeal;
    }

    /* Initialize the module driver state structure. */
    lpsciState->rxBuff = rxBuff;
    lpsciState->rxSize = rxSize;
    lpsciState->isRxBusy = true;

    /* Enable the receive data full interrupt */
    LPSCI_HAL_SetRxDataRegFullIntCmd(baseAddr, true);

    return kStatus_LPSCI_Success;
}

/*******************************************************************************
 * EOF
 ******************************************************************************/


text:
package internal

// Eval evaluates the Slip program represented as a string
// on the given environment, returning the value of the last expression.
func Eval(s string, env *Enviroment) (Value, error) {
	values, err := Parse(string(s))
	if err != nil {
		return nil, err
	}

	var out Value
	for _, value := range values {
		out = value.Eval(env)
	}

	return out, nil
}

type Enviroment struct {
	symbols map[string]Value
	parent  *Enviroment
}

func NewEnviroment() *Enviroment {
	env := &Enviroment{symbols: make(map[string]Value)}

	for name, fn := range BuiltInFuncs {
		env.Define(NewSymbol(name), fn)
	}

	return env
}

func NewChildEnviroment(parent *Enviroment) *Enviroment {
	return &Enviroment{symbols: make(map[string]Value), parent: parent}
}

func (e *Enviroment) Define(sym Symbol, val Value) {
	e.symbols[string(sym)] = val
}

func (e *Enviroment) Resolve(sym Symbol) Value {
	val := e.symbols[string(sym)]
	if val == nil && e.parent != nil {
		return e.parent.Resolve(sym)
	}
	return val
}


text:
package com.adobe.acs.commons.xss;

import org.osgi.annotation.versioning.ProviderType;
import org.apache.sling.xss.XSSAPI;

/**
 * XSSAPI JSP Function wrappers.
 */
@ProviderType
@SuppressWarnings("checkstyle:abbreviationaswordinname")
public final class XSSFunctions {

    private XSSFunctions() {
    }

    /**
     * Encode a string for HTML.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    public static CharSequence encodeForHTML(XSSAPI xssAPI, String source) {
        return xssAPI.encodeForHTML(source);
    }

    /**
     * @deprecated replaced by {@link #encodeForHTML(XSSAPI, String)}
     *
     * Encode a string for HTML.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    @Deprecated
    public static CharSequence encodeForHTML(com.adobe.granite.xss.XSSAPI xssAPI, String source) {
        return xssAPI.encodeForHTML(source);
    }

    /**
     * Encode a string for an HTML attribute.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    public static CharSequence encodeForHTMLAttr(XSSAPI xssAPI, String source) {
        return xssAPI.encodeForHTMLAttr(source);
    }

    /**
     * @deprecated replaced by {@link #encodeForHTMLAttr(XSSAPI, String)}
     *
     * Encode a string for an HTML attribute.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    @Deprecated
    public static CharSequence encodeForHTMLAttr(com.adobe.granite.xss.XSSAPI xssAPI, String source) {
        return xssAPI.encodeForHTMLAttr(source);
    }

    /**
     * Encode a string for an JavaScript string.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    public static CharSequence encodeForJSString(XSSAPI xssAPI, String source) {
        return xssAPI.encodeForJSString(source);
    }

    /**
     * @deprecated replaced by {@link #encodeForJSString(XSSAPI, String)}
     *
     * Encode a string for an JavaScript string.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    @Deprecated
    public static CharSequence encodeForJSString(com.adobe.granite.xss.XSSAPI xssAPI, String source) {
        return xssAPI.encodeForJSString(source);
    }

    /**
     * Filter a string for HTML.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    public static CharSequence filterHTML(XSSAPI xssAPI, String source) {
        return xssAPI.filterHTML(source);
    }

    /**
     * @deprecated replaced by {@link #filterHTML(XSSAPI, String)}
     *
     * Filter a string for HTML.
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    @Deprecated
    public static CharSequence filterHTML(com.adobe.granite.xss.XSSAPI xssAPI, String source) {
        return xssAPI.filterHTML(source);
    }

    /**
     * Get a valid href. This does not use the standard XSS API due to a bug
     * impacting CQ 5.6.1 (and earlier). Internal bug reference: GRANITE-4193
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    public static CharSequence getValidHref(XSSAPI xssAPI, String source) {
        return xssAPI.getValidHref(source);
    }

    /**
     * @deprecated replaced by {@link #getValidHref(XSSAPI, String)}
     *
     * Get a valid href. This does not use the standard XSS API due to a bug
     * impacting CQ 5.6.1 (and earlier). Internal bug reference: GRANITE-4193
     *
     * @param xssAPI the XSSAPI
     * @param source the source string
     * @return the encoded string
     */
    @Deprecated
    public static CharSequence getValidHref(com.adobe.granite.xss.XSSAPI xssAPI, String source) {
        return xssAPI.getValidHref(source);
    }

    /**
     * Validate a string which should contain a dimension, returning a default value if the source is
     * empty, can't be parsed, or contains XSS risks.  Allows integer dimensions and the keyword "auto".
     *
     * @param xssAPI the XSSAPI
     * @param dimension the source dimension
     * @param defaultValue a default value if the source can't be used
     * @return a sanitized dimension
     */
    public static String getValidDimension(XSSAPI xssAPI, String dimension, String defaultValue) {
        return xssAPI.getValidDimension(dimension, defaultValue);
    }

    /**
     * @deprecated replaced by {@link #getValidDimension(XSSAPI, String, String)}
     *
     * Validate a string which should contain a dimension, returning a default value if the source is
     * empty, can't be parsed, or contains XSS risks.  Allows integer dimensions and the keyword "auto".
     *
     * @param xssAPI the XSSAPI
     * @param dimension the source dimension
     * @param defaultValue a default value if the source can't be used
     * @return a sanitized dimension
     */
    @Deprecated
    public static String getValidDimension(com.adobe.granite.xss.XSSAPI xssAPI, String dimension, String defaultValue) {
        return xssAPI.getValidDimension(dimension, defaultValue);
    }

    /**
     * Validate a string which should contain an integer, returning a default value if the source is
     * empty, can't be parsed, or contains XSS risks.
     *
     * @param xssAPI the XSSAPI
     * @param integer the source integer
     * @param defaultValue a default value if the source can't be used
     * @return a sanitized integer
     */
    public static Integer getValidInteger(XSSAPI xssAPI, String integer, int defaultValue) {
        return xssAPI.getValidInteger(integer, defaultValue);
    }

    /**
     * @deprecated replaced by {@link #getValidInteger(XSSAPI, String, int)}
     *
     * Validate a string which should contain an integer, returning a default value if the source is
     * empty, can't be parsed, or contains XSS risks.
     *
     * @param xssAPI the XSSAPI
     * @param integer the source integer
     * @param defaultValue a default value if the source can't be used
     * @return a sanitized integer
     */
    @Deprecated
    public static Integer getValidInteger(com.adobe.granite.xss.XSSAPI xssAPI, String integer, int defaultValue) {
        return xssAPI.getValidInteger(integer, defaultValue);
    }

    /**
     * Validate a Javascript token.  The value must be either a single identifier, a literal number,
     * or a literal string.
     *
     * @param xssAPI the XSSAPI
     * @param token the source token
     * @param defaultValue a default value to use if the source doesn't meet validity constraints.
     * @return a string containing a single identifier, a literal number, or a literal string token
     */
    public static String getValidJSToken(XSSAPI xssAPI, String token, String defaultValue) {
        return xssAPI.getValidJSToken(token, defaultValue);
    }

    /**
     * @deprecated replaced by {@link #getValidJSToken(XSSAPI, String, String)}
     *
     * Validate a Javascript token.  The value must be either a single identifier, a literal number,
     * or a literal string.
     *
     * @param xssAPI the XSSAPI
     * @param token the source token
     * @param defaultValue a default value to use if the source doesn't meet validity constraints.
     * @return a string containing a single identifier, a literal number, or a literal string token
     */
    @Deprecated
    public static String getValidJSToken(com.adobe.granite.xss.XSSAPI xssAPI, String token, String defaultValue) {
        return xssAPI.getValidJSToken(token, defaultValue);
    }

}


text:
require "google/cloud/dlp/v2"

##
# Example demonstrating basic usage of
# Google::Cloud::Dlp::V2::DlpService::Client#update_job_trigger
#
def update_job_trigger
  # Create a client object. The client can be reused for multiple calls.
  client = Google::Cloud::Dlp::V2::DlpService::Client.new

  # Create a request. To set request fields, pass in keyword arguments.
  request = Google::Cloud::Dlp::V2::UpdateJobTriggerRequest.new

  # Call the update_job_trigger method.
  result = client.update_job_trigger request

  # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger.
  p result
end
# [END dlp_v2_generated_DlpService_UpdateJobTrigger_sync]


text:
<!DOCTYPE html>

    <base href="<%= APP_BASE %>">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><%= APP_TITLE %></title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="icon" type="image/png" href="assets/img/icon.png">

    <sd-app>

    </sd-app>

    <% if (ENV === 'dev') { %>

    <% } %>

    <% if (ENV === 'dev') { %>

    <% } %>


text:
<?php

namespace Seven\RpcBundle\XmlRpc\ValueType;

class DoubleType extends AbstractType
{
    /**
     * @param \DOMDocument $document
     * @param $value
     * @return \DOMElement
     */

    public function pack(\DOMDocument $document, $value)
    {
        return $this->wrap($document->createElement("double", (double) $value), "value");
    }

    /**
     * @param  \DOMElement $element
     * @return float
     */

    public function extract(\DOMElement $element)
    {
        return (double) $element->nodeValue;
    }

}


text:
package org.languagetool.rules.patterns;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.TreeSet;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;
import org.languagetool.AnalyzedToken;
import org.languagetool.AnalyzedTokenReadings;
import org.languagetool.Language;
import org.languagetool.rules.patterns.Match.IncludeRange;
import org.languagetool.synthesis.Synthesizer;
import org.languagetool.tools.StringTools;

import static org.languagetool.JLanguageTool.PARAGRAPH_END_TAGNAME;
import static org.languagetool.JLanguageTool.SENTENCE_END_TAGNAME;
import static org.languagetool.JLanguageTool.SENTENCE_START_TAGNAME;

/**
 * The state of a matching process. This state is NOT thread-safe.
 *
 * @author Stefan Lotties
 * @since 2.3
 */
public class MatchState {

  private final Match match;
  private final Synthesizer synthesizer;

  private AnalyzedTokenReadings formattedToken;
  private AnalyzedTokenReadings matchedToken;
  private String skippedTokens;

  public MatchState(Match match, Synthesizer synthesizer) {
    this.match = match;
    this.synthesizer = synthesizer;
    String lemma = match.getLemma();
    if (!StringUtils.isEmpty(lemma)) {
      formattedToken = new AnalyzedTokenReadings(new AnalyzedToken(lemma, match.getPosTag(), lemma), 0);
    }
  }

  public void setToken(AnalyzedTokenReadings token) {
    if (match.isStaticLemma()) {
      this.matchedToken = token;
    } else {
      this.formattedToken = token;
    }
  }

  /**
   * Sets the token to be formatted etc. and includes the support for
   * including the skipped tokens.
   *
   * @param tokens Array of tokens
   * @param index Index of the token to be formatted
   * @param next Position of the next token (the skipped tokens are the ones between the tokens[index] and tokens[next]
   */
  public final void setToken(AnalyzedTokenReadings[] tokens, int index, int next) {
    int idx = index;
    if (index >= tokens.length) {
      // TODO: hacky workaround, find a proper solution. See EnglishPatternRuleTest.testBug()
      idx = tokens.length - 1;
    }
    setToken(tokens[idx]);
    IncludeRange includeSkipped = match.getIncludeSkipped();
    if (next > 1 && includeSkipped != IncludeRange.NONE) {
      StringBuilder sb = new StringBuilder();
      if (includeSkipped == IncludeRange.FOLLOWING) {
        formattedToken = null;
      }
      for (int k = index + 1; k < index + next; k++) {
        if (tokens[k].isWhitespaceBefore()
            && !(k == index + 1 && includeSkipped == IncludeRange.FOLLOWING)) {
          sb.append(' ');
        }
        sb.append(tokens[k].getToken());
      }
      skippedTokens = sb.toString();
    } else {
      skippedTokens = "";
    }
  }

  public final AnalyzedTokenReadings filterReadings() {
    List<AnalyzedToken> l = new ArrayList<>();
    if (formattedToken != null) {
      if (match.isStaticLemma()) {
        // Note: we want the token without ignored characters so we can't use matchedToken.getToken()
        matchedToken.leaveReading(new AnalyzedToken(matchedToken.getReadings().get(0).getToken(),
                match.getPosTag(), formattedToken.getToken()));
        formattedToken = matchedToken;
      }
      // Note: we want the token without ignored characters so we can't use formattedToken.getToken()
      String token = formattedToken.getAnalyzedToken(0).getToken();
      Pattern regexMatch = match.getRegexMatch();
      String regexReplace = match.getRegexReplace();
      if (regexMatch != null && regexReplace != null) {
        /* only replace if it is something to replace */
        token = regexMatch.matcher(token).replaceAll(regexReplace);
      }
      token = convertCase(token, token, null);

      String posTag = match.getPosTag();
      if (posTag != null) {
        int numRead = formattedToken.getReadingsLength();
        if (match.isPostagRegexp()) {
          Pattern pPosRegexMatch = match.getPosRegexMatch();
          String posTagReplace = match.getPosTagReplace();
          String targetPosTag;
          for (int i = 0; i < numRead; i++) {
            String testTag = formattedToken.getAnalyzedToken(i).getPOSTag();
            if (testTag != null && pPosRegexMatch.matcher(testTag).matches()) {
              targetPosTag = testTag;
              if (posTagReplace != null) {
                targetPosTag = pPosRegexMatch.matcher(targetPosTag).replaceAll(posTagReplace);
              }
              l.add(new AnalyzedToken(token, targetPosTag,
                  formattedToken.getAnalyzedToken(i).getLemma()));
              l.get(l.size() - 1).setWhitespaceBefore(formattedToken.isWhitespaceBefore());
            }
          }
          if (l.isEmpty()) {
            l.addAll(getNewToken(numRead, token));
          }
        } else {
          l.addAll(getNewToken(numRead, token));
        }
        String lemma = formattedToken.getAnalyzedToken(0).getLemma();
        if (formattedToken.isSentenceEnd()) {
          l.add(new AnalyzedToken(formattedToken.getToken(), SENTENCE_END_TAGNAME, lemma));
        }
        if (formattedToken.isParagraphEnd()) {
          l.add(new AnalyzedToken(formattedToken.getToken(), PARAGRAPH_END_TAGNAME, lemma));
        }

      }
    }
    if (l.isEmpty()) {
      return formattedToken;
    }
    final AnalyzedTokenReadings anTkRead = new AnalyzedTokenReadings(
        l.toArray(new AnalyzedToken[0]),
        formattedToken.getStartPos());
    // TODO: in case original had ignored characters we want to restore readings.token
    // but there's no setToken() available :(
//    anTkRead.setToken(formattedToken.getToken());

    anTkRead.setWhitespaceBefore(formattedToken.getWhitespaceBefore());
    if (!formattedToken.getChunkTags().isEmpty()) {
      anTkRead.setChunkTags(formattedToken.getChunkTags());
    }
    if (formattedToken.isImmunized()) {
      anTkRead.immunize();
    }
    return anTkRead;
  }

  /**
   * Converts case of the string token according to match element attributes.
   * @param s Token to be converted.
   * @param sample the sample string used to determine how the original string looks like (used only on case preservation)
   * @return Converted string.
   */
  String convertCase(String s, String sample, Language lang) {
    return CaseConversionHelper.convertCase(match.getCaseConversionType(), s, sample, lang);
  }

  private List<AnalyzedToken> getNewToken(int numRead, String token) {
    String posTag = match.getPosTag();
    List<AnalyzedToken> list = new ArrayList<>();
    String lemma = "";
    for (int j = 0; j < numRead; j++) {
      String tempPosTag = formattedToken.getAnalyzedToken(j).getPOSTag();
      if (tempPosTag != null) {
        if (tempPosTag.equals(posTag) && formattedToken.getAnalyzedToken(j).getLemma() != null) {
          lemma = formattedToken.getAnalyzedToken(j).getLemma();
        }
        if (StringTools.isEmpty(lemma)) {
          lemma = formattedToken.getAnalyzedToken(0).getLemma();
        }
        list.add(new AnalyzedToken(token, posTag, lemma));
        list.get(list.size() - 1).setWhitespaceBefore(
            formattedToken.isWhitespaceBefore());
      }
    }
    return list;
  }

  /**
   * Gets all strings formatted using the match element.
   */
  public final String[] toFinalString(Language lang) throws IOException {
    String[] formattedString = new String[1];
    if (formattedToken != null) {
      int readingCount = formattedToken.getReadingsLength();
      formattedString[0] = formattedToken.getToken();

      Pattern pRegexMatch = match.getRegexMatch();
      String regexReplace = match.getRegexReplace();
      if (pRegexMatch != null) {
        formattedString[0] = pRegexMatch.matcher(formattedString[0]).replaceAll(regexReplace);
      }

      String posTag = match.getPosTag();
      if (posTag != null) {
        if (synthesizer == null) {
          formattedString[0] = formattedToken.getToken();
        } else if (match.isPostagRegexp()) {
          TreeSet<String> wordForms = new TreeSet<>();
          boolean oneForm = false;
          for (int k = 0; k < readingCount; k++) {
            if (formattedToken.getAnalyzedToken(k).getLemma() == null) {
              String posUnique = formattedToken.getAnalyzedToken(k).getPOSTag();
              if (posUnique == null) {
                wordForms.add(formattedToken.getToken());
                oneForm = true;
              } else {
                if (SENTENCE_START_TAGNAME.equals(posUnique)
                    || SENTENCE_END_TAGNAME.equals(posUnique)
                    || PARAGRAPH_END_TAGNAME.equals(posUnique)) {
                  if (!oneForm) {
                    wordForms.add(formattedToken.getToken());
                  }
                  oneForm = true;
                } else {
                  oneForm = false;
                }
              }
            }
          }
          String targetPosTag = getTargetPosTag();
          if (!oneForm) {
            for (int i = 0; i < readingCount; i++) {
              String[] possibleWordForms = synthesizer.synthesize(
                  formattedToken.getAnalyzedToken(i), targetPosTag, true);
              if (possibleWordForms != null && possibleWordForms.length > 0) {
                wordForms.addAll(Arrays.asList(possibleWordForms));
              }
            }
          }
          if (wordForms.isEmpty()) {
            formattedString[0] = "(" + formattedToken.getToken() + ")";
          } else {
            formattedString = wordForms.toArray(new String[0]);
          }
        } else {
          TreeSet<String> wordForms = new TreeSet<>();
          for (int i = 0; i < readingCount; i++) {
            String[] possibleWordForms = synthesizer.synthesize(formattedToken.getAnalyzedToken(i), posTag);
            if (possibleWordForms != null) {
              wordForms.addAll(Arrays.asList(possibleWordForms));
            }
          }
          formattedString = wordForms.toArray(new String[0]);
        }
      }
    }
    String original;
    if (match.isStaticLemma()) {
      original = matchedToken != null ? matchedToken.getToken() : "";
    } else {
      original = formattedToken != null ? formattedToken.getToken() : "";
    }
    for (int i = 0; i < formattedString.length; i++) {
      formattedString[i] = convertCase(formattedString[i], original, lang);
    }
    // TODO should case conversion happen before or after including skipped tokens?
    IncludeRange includeSkipped = match.getIncludeSkipped();
    if (includeSkipped != IncludeRange.NONE && skippedTokens != null
        && !skippedTokens.isEmpty()) {
      String[] helper = new String[formattedString.length];
      for (int i = 0; i < formattedString.length; i++) {
        if (formattedString[i] == null) {
          formattedString[i] = "";
        }
        helper[i] = formattedString[i] + skippedTokens;
      }
      formattedString = helper;
    }
    if (match.checksSpelling() && lang != null) {
      List<String> formattedStringElements = Arrays.asList(formattedString);
      // tagger-based speller
      List<AnalyzedTokenReadings> analyzed = lang.getTagger().tag(
          formattedStringElements);
      for (int i = 0; i < formattedString.length; i++) {
        AnalyzedToken analyzedToken = analyzed.get(i).getAnalyzedToken(0);
        if (analyzedToken.getLemma() == null && analyzedToken.hasNoTag()) {
          formattedString[i] = PatternRuleMatcher.MISTAKE;
        }
      }
    }
    return formattedString;
  }

  /**
   * Format POS tag using parameters already defined in the class.
   *
   * @return Formatted POS tag as String.
   */
  // FIXME: gets only the first POS tag that matches, this can be wrong
  // on the other hand, many POS tags = too many suggestions?
  public final String getTargetPosTag() {
    String targetPosTag = match.getPosTag();
    List<String> posTags = new ArrayList<>();
    Pattern pPosRegexMatch = match.getPosRegexMatch();
    String posTagReplace = match.getPosTagReplace();

    if (match.isStaticLemma()) {
      for (AnalyzedToken analyzedToken : matchedToken) {
        String tst = analyzedToken.getPOSTag();
        if (tst != null && pPosRegexMatch.matcher(tst).matches()) {
          targetPosTag = analyzedToken.getPOSTag();
          posTags.add(targetPosTag);
        }
      }

      if (pPosRegexMatch != null && posTagReplace != null && !posTags.isEmpty()) {
        targetPosTag = pPosRegexMatch.matcher(targetPosTag).replaceAll(
            posTagReplace);
      }
    } else {
      for (AnalyzedToken analyzedToken : formattedToken) {
        String tst = analyzedToken.getPOSTag();
        if (tst != null && pPosRegexMatch.matcher(tst).matches()) {
          targetPosTag = analyzedToken.getPOSTag();
          posTags.add(targetPosTag);
        }
      }
      if (pPosRegexMatch != null && posTagReplace != null) {
        if (posTags.isEmpty()) {
          posTags.add(targetPosTag);
        }
        StringBuilder sb = new StringBuilder();
        int posTagLen = posTags.size();
        int l = 0;
        for (String lPosTag : posTags) {
          l++;
          lPosTag = pPosRegexMatch.matcher(lPosTag).replaceAll(posTagReplace);
          if (match.setsPos()) {
            lPosTag = synthesizer.getPosTagCorrection(lPosTag);
          }
          sb.append(lPosTag);
          if (l < posTagLen) {
            sb.append('|');
          }
        }
        targetPosTag = sb.toString();
      }
    }
    return targetPosTag;
  }

  /**
   * Method for getting the formatted match as a single string. In case of
   * multiple matches, it joins them using a regular expression operator "|".
   * @return Formatted string of the matched token.
   */
  final String toTokenString() throws IOException {
    String[] stringToFormat = toFinalString(null);
    return String.join("|", Arrays.asList(stringToFormat));
  }

  public Match getMatch() {
    return match;
  }
}


text:
.sc_player_container1 {
display: inline;
}
.sc_player_container1 .myButton_play {
background: transparent url(../image/round-play-button-black.png) no-repeat !important;
cursor: pointer !important;
width: 32px !important;
height: 32px !important;
border: none !important;
position: relative;
margin: 0 !important;
padding: 0 !important;
}
.sc_player_container1 .myButton_stop {
background: transparent url(../image/round-pause-button-black.png) no-repeat !important;
cursor: pointer !important;
width: 32px !important;
height: 32px !important;
border: none !important;
position: relative;
margin: 0 !important;
padding: 0 !important;
}

.sc_player_container2 {
max-width:56em;
}
.sc_player_container2 .myButton_play {
background:url(../image/stop-play.jpg) no-repeat;
background-position: -30px -30px;
cursor:pointer;
width: 40px;
height: 30px;
border: none;
position:relative;
}
.sc_player_container2 .myButton_stop {
background:url(../image/stop-play.jpg) no-repeat;
background-position: -31px -90px;
cursor:pointer;
width: 40px;
height: 30px;
border: none;
position:relative;
}


text:
/**
 *
 */
package org.bigmouth.dao.datastore.entity.subscriber;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import org.bigmouth.dao.datastore.entity.DSEntity;

import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Index;

/**
 * @author Sam
 *
 */
@NoArgsConstructor
@ToString
@EqualsAndHashCode(of = "id", callSuper = true)
@Entity(name="user")
public class SubscriberEntity extends DSEntity {

	@Getter
	@Setter
	String firstName, lastName, website, description, gender;

	@Index
	@Getter
	@Setter
	String email;

}


text:
class AddTotalYearlyPtoPerUserToSiteSettings < ActiveRecord::Migration
  def self.up
    add_column :site_settings, :total_yearly_pto_per_user, :decimal, :precision => 10, :scale => 2
  end

  def self.down
    remove_column :site_settings, :total_yearly_pto_per_user
  end
end


text:
---
title: "AS3: StringTemplate class"
date: 2011-08-06
---
A _simple_ class can many times be a powerful tool to build more complex stuff on top.

By simple a mean that has few or one concern, and takes care of an initially uninteresting task. The StringTemplate might be an example of that.

What it does is quite simple, really. If you feed in a context and later you provide an object, it will resolve the objects attributes value that are present in the template. One example such make this more obvious:

    var template:String = "Hello {username}, welcome to {cityname}!";
    var data:Object = {username:"Goliatone", cityname:"New York" };
    var resolver:StringTemplate = new StringTemplate();
    resolver.template = template;
    trace( resolver.execute(data)) //Hello Goliatone, welcome to New York!

And the class would look like this:

    package  com.skinnygeek.media.text {
    	import com.skinnygeek.utils.ObjectUtils;

    	/**
    	 * StringTemplate.
    	 *
    	 *	@langversion ActionScript 3.0
    	 *	@Flash 		 Player 9.0.28.0
    	 *	@author 	 Emiliano Burgos
    	 *	@url		 http://www.enjoy-mondays.com
    	 *  @version 	 1.0
    	 */
    	public class StringTemplate {

    		/** @private **/
    		private var _template					:String;

    		/** @private **/
    		private var _data						:Object;

    		/**
    		 * StringTemplate
    		 * com.skinnygeek.media.text.StringTemplate
    		 */
    		public function StringTemplate() {
    			reset( );
    		}

    		public function reset( ):void {
    			_data = { };
    			_template = null;
    		}

    		/**
    		 *
    		 * @param	key
    		 * @param	value
    		 */
    		public function set( key:String, value:* ):void {
    			_data[key] = value//.toString();
    		}

    		/**
    		 *
    		 * @param	key
    		 */
    		public function unset(key:String):void {
    			delete _data[key];
    		}

    		/**
    		 *
    		 * @param	data
    		 * @return
    		 */
    		public function  execute( data:Object = null ):String {
    			if ( data ) this.data = ObjectUtils.instance.merge( this.data, data );
    			return parseTemplate( _template, this.data );
    		}

    		/**
    		 *
    		 */
    		public function get data():Object { return _data; }
    		/** @private **/
    		public function set data(value:Object):void {
    			_data = value;
    		}

    		/**
    		 * String template holding the markers to be replaced.
    		 */
    		public function get template():String { return _template; }
    		/** @private **/
    		public function set template(value:String):void {
    			_template = value;
    		}

    		/**
    		* Simple string replacement.
    		*

    		* 	var table : Object = { name : "lorem ipsum", date : "2010/11/23" };
    		*	var template: String = "{name} - {date}";
    		*
    		* 	trace(StringTemplate.parseTemplate(template, table)); // -> lorem ipsum - 2010/11/23
    		*

    		*
    		* @param	template String to be parsed
    		* @param 	data Object containing Key -> Value pairs.
    		* @return 	Formated string
    		*
    		*/
    		static public function parseTemplate( template:String, data:Object): String {
    			function replaceFn():String {
    				var prop:String = arguments[1];
    				return (prop in data) ? data[prop] : '';
    			}
    			return template.replace(/{(\w+)}/g, replaceFn);
    		}

    	}
    }


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Friesia 11(4): 238 (1978)

#### Original name
Micronectriella pavgii R.A. Singh, 1978

### Remarks
null