text:
import collections
import json
import sys

INFO = 'Info'

ERR_COUNT = collections.Counter()

def report(otype, oid, *msg):
    ERR_COUNT[otype] += 1
    print ('{} {}: {}'.format(otype, oid, ': '.join(msg)))

def check_cluster(data, cid, cluster):
    if cid != cluster[INFO]['id']:
        report('Cluster', cid, 'id mismatch', cluster[INFO]['id'])
    for vid in cluster[INFO]['volumes']:
        if vid not in data['volumeentries']:
            report('Cluster', cid, 'unknown volume', vid)
    for vid in cluster[INFO]['blockvolumes']:
        if vid not in data['blockvolumeentries']:
            report('Cluster', cid, 'unknown block volume', vid)

def check_brick(data, bid, brick):
    if bid != brick[INFO]['id']:
        report('Brick', bid, 'id mismatch', brick[INFO]['id'])
    # check brick points to real device
    device_id = brick[INFO]['device']
    if device_id not in data['deviceentries']:
        report('Brick', bid, 'device mismatch', device_id)
    elif bid not in data['deviceentries'][device_id]['Bricks']:
        report('Brick', bid, 'no link back to brick for device', device_id)
    # check that our volume points at the brick
    volume_id = brick[INFO]['volume']
    if volume_id not in data['volumeentries']:
        report('Brick', bid, 'volume mismatch', volume_id)
    elif bid not in data['volumeentries'][volume_id]['Bricks']:
        report('Brick', bid, 'no link back to brick for volume', volume_id)
    # check brick points to real node
    if brick[INFO]['node'] not in data['nodeentries']:
        report('Brick', bid, 'node mismatch', brick[INFO]['node'])
    _check_pending('Brick', bid, brick, data)

def check_volume(data, vid, volume):
    if vid != volume[INFO]['id']:
        report('Volume', vid, 'id mismatch', volume[INFO]['id'])
    for bid in volume['Bricks']:
        if bid not in data['brickentries']:
            report('Volume', vid, 'unknown brick', bid)
    bvsize = 0
    for bvid in volume[INFO].get("blockinfo", {}).get("blockvolume", []):
        if bvid not in data["blockvolumeentries"]:
            report('Volume', vid, 'unknown block volume', bvid)
        else:
            bv = data["blockvolumeentries"][bvid]
            bvsize += bv[INFO]['size']
    if volume[INFO].get("block"):
        vol_size = volume[INFO]["size"]
        free_size = volume[INFO].get("blockinfo", {}).get("freesize", 0)
        rsvd_size = volume[INFO].get("blockinfo", {}).get("reservedsize", 0)
        used_size = vol_size - free_size - rsvd_size
        if bvsize != used_size:
            report('Volume', vid, 'block size differs',
                'calulated-size={} size={} free-size={} reserved-size={} used-size={}'.format(
                    bvsize, vol_size, free_size, rsvd_size, used_size))
    elif bvsize != 0:
        report('Volume', vid, 'has block volumes but not block flag')
    _check_pending('Volume', vid, volume, data)

def check_block_volume(data, bvid, bvol):
    if bvid != bvol[INFO]['id']:
        report('Block Volume', bvid, 'id mismatch', bvol[INFO]['id'])
    cluster_id = bvol[INFO].get("cluster")
    bhv_id = bvol[INFO]["blockhostingvolume"]
    if cluster_id and cluster_id not in data["clusterentries"]:
        report("Block Volume", bvid, "cluster not found", cluster_id)
    if bhv_id not in data["volumeentries"]:
        report("Block Volume", bvid, "hosting volume not found", bhv_id)
    _check_pending('Block Volume', bvid, bvol, data)

def check_device(data, did, device):
    if did != device[INFO]['id']:
        report('Device', did, 'id mismatch', device[INFO]['id'])
    bsum = 0
    for bid in device['Bricks']:
        if bid not in data['brickentries']:
            report('Device', did, 'unknown brick', bid)
        else:
            b = data['brickentries'][bid]
            bsum += b["TpSize"] + b["PoolMetadataSize"]
    s = device[INFO]["storage"]
    if s["total"] != s["free"] + s["used"]:
        report("Device", did, "size values differ",
               "total={total}  free={free} used={used}".format(**s))
    if s["used"] != bsum:
        report("Device", did, "size values differ",
               "used={} brick-sum={}".format(s["used"], bsum))
    _check_pending('Device', did, device, data)

def check_pending(data, pid, pop):
    if pid != pop["Id"]:
        report("Pending Op", pid, "id mismatch", pop["Id"])
    changetype_to_key = {
        1: "brickentries", # add brick
        2: "volumeentries", # add vol
        3: "brickentries", # del brick
        4: "volumeentries", # del vol
        5: "volumeentries", #ExpandVolume
        6: "blockvolumeentries", #AddBlockVolume
        7: "blockvolumeentries", #DeleteBlockVolume
        8: "deviceentries", #RemoveDevice
        9: "volumeentries", #CloneVolume
        10: "volumeentries", #SnapshotVolume
        11: "volumeentries", #AddVolumeClone
    }
    for a in pop["Actions"]:
        ch_type = a["Change"]
        ch_id = a["Id"]
        key = changetype_to_key.get(ch_type)
        if not key:
            report("Pending Op", pid, "unexpected change type", ch_type)
            continue
        if ch_id not in data[key]:
            report("Pending Op", pid, "id in change missing",
                "{} not found in {}".format(ch_id, key))

def _check_pending(what, myid, item, data):
    pid = item.get("Pending", {}).get("Id")
    if not pid:
        return
    if pid not in data["pendingoperations"]:
        report(what, myid, "marked pending but no pending op", pid)

def check_db(data):
    for cid, c in data['clusterentries'].items():
        check_cluster(data, cid, c)

    for vid, v in data['volumeentries'].items():
        check_volume(data, vid, v)

    for bvid, bv in data['blockvolumeentries'].items():
        check_block_volume(data, bvid, bv)

    for did, d in data['deviceentries'].items():
        check_device(data, did, d)

    for bid, b in data['brickentries'].items():
        check_brick(data, bid, b)

    for pid, p in data['pendingoperations'].items():
        check_pending(data, pid, p)

def summarize_db(data):
    cc = collections.Counter()
    kc = [
        ('clusters', 'clusterentries'),
        ('devices', 'deviceentries'),
        ('bricks', 'brickentries'),
        ('volumes', 'volumeentries'),
        ('blockvolumes', 'blockvolumeentries'),
        ('pending', 'pendingoperations'),
    ]
    for key, data_key in kc:
        cc[key] = len(data[data_key])
        pc = len([x for x in data[data_key].values()
                  if x.get('Pending', {}).get('Id')])
        if pc:
            cc['pending_' + key] = pc

    for key, _ in kc:
        if key.startswith('pending_'):
            continue
        pk = 'pending_' + key
        if pk in cc:
            print ('{:>16}: {:5d}  ({:d} pending)'.format(
                key.title(), cc[key], cc[pk]))
        else:
            print ('{:>16}: {:5d}'.format(key.title(), cc[key]))
    print ('')

try:
    filename = sys.argv[1]
except IndexError:
    sys.stderr.write("error: filename required")
    sys.exit(2)

with open(filename) as fh:
    data = json.load(fh)

summarize_db(data)
check_db(data)
if ERR_COUNT:
    sys.exit(1)


text:
import re
import sys
from collections import Counter
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE,SIG_DFL)

num_words = None
text = sys.stdin.read().lower()
words = re.split('\W+', text)
cnt = Counter(words)
for word, count in cnt.most_common(num_words):
	print(word)

redpajama_set_name: RedPajamaGithub


text:
//-----------------------------------------------------------------------
// <copyright file="ISearchService.cs" company="Microsoft Corporation">
//     Copyright (c) Microsoft Corporation 2011. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

using System.Collections.Generic;
using System.Threading.Tasks;
using WWTMVC5.Models;
using WWTMVC5.ViewModels;

namespace WWTMVC5.Services.Interfaces
{
    /// <summary>
    /// Interface representing the search service methods. Also, needed for adding unit test cases.
    /// </summary>
    public interface ISearchService
    {
        /// <summary>
        /// Searches the presence of the given text in communities and contents tables (Name, description and tags fields).
        /// </summary>
        /// <param name="searchText">Text to be searched</param>
        /// <param name="userId">Id of the user who is accessing</param>
        /// <param name="pageDetails">Details about the pagination</param>
        /// <param name="searchQueryDetails">Search query details like filters, sorting and items per page</param>
        /// <returns>Communities/Contents which are having the search text</returns>
        Task<IEnumerable<EntityViewModel>> SimpleSearch(string searchText, long userId, PageDetails pageDetails, SearchQueryDetails searchQueryDetails);

        /// <summary>
        /// Searches the presence of the given text in communities and contents tables (Name, description and tags fields).
        /// </summary>
        /// <param name="searchText">Text to be searched</param>
        /// <param name="userId">Id of the user who is accessing</param>
        /// <returns>Communities/Contents which are having the search text</returns>
        Task<IEnumerable<DeepZoomViewModel>> DeepZoomSearch(string searchText, long userId);
    }
}


text:
from typing import (
    Any,
    Callable,
    Iterator,
    Sequence,
    Tuple,
)

from google.longrunning import operations_pb2

class ListOperationsPager:
    """A pager for iterating through ``list_operations`` requests.

    This class thinly wraps an initial
    :class:`google.longrunning.operations_pb2.ListOperationsResponse` object, and
    provides an ``__iter__`` method to iterate through its
    ``operations`` field.

    If there are more pages, the ``__iter__`` method will make additional
    ``ListOperations`` requests and continue to iterate
    through the ``operations`` field on the
    corresponding responses.

    All the usual :class:`google.longrunning.operations_pb2.ListOperationsResponse`
    attributes are available on the pager. If multiple requests are made, only
    the most recent response is retained, and thus used for attribute lookup.
    """

    def __init__(
        self,
        method: Callable[..., operations_pb2.ListOperationsResponse],
        request: operations_pb2.ListOperationsRequest,
        response: operations_pb2.ListOperationsResponse,
        *,
        metadata: Sequence[Tuple[str, str]] = ()
    ):
        """Instantiate the pager.

        Args:
            method (Callable): The method that was originally called, and
                which instantiated this pager.
            request (google.longrunning.operations_pb2.ListOperationsRequest):
                The initial request object.
            response (google.longrunning.operations_pb2.ListOperationsResponse):
                The initial response object.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.
        """
        self._method = method
        self._request = request
        self._response = response
        self._metadata = metadata

    def __getattr__(self, name: str) -> Any:
        return getattr(self._response, name)

    @property
    def pages(self) -> Iterator[operations_pb2.ListOperationsResponse]:
        yield self._response
        while self._response.next_page_token:
            self._request.page_token = self._response.next_page_token
            self._response = self._method(self._request, metadata=self._metadata)
            yield self._response

    def __iter__(self) -> Iterator[operations_pb2.Operation]:
        for page in self.pages:
            yield from page.operations

    def __repr__(self) -> str:
        return "{0}<{1!r}>".format(self.__class__.__name__, self._response)


text:
<?php

namespace FluxBB\Web;

use FastRoute\Dispatcher;
use FastRoute\RouteParser;
use FastRoute\DataGenerator;

class Router
{
    /**
     * @var \FastRoute\DataGenerator
     */
    protected $dataGenerator;

    /**
     * @var \FastRoute\RouteParser
     */
    protected $routeParser;

    /**
     * @var string
     */
    protected $currentRequestName;

    /**
     * @var array
     */
    protected $currentRequestParameters;

    /**
     * @var array
     */
    protected $reverse = [];

    /**
     * @var \FastRoute\Dispatcher
     */
    protected $dispatcher;

    public function __construct()
    {
        $this->routeParser = new RouteParser\Std;
        $this->dataGenerator = new DataGenerator\GroupCountBased;
    }

    public function get($path, $name, $handler)
    {
        return $this->addRoute('GET', $path, $name, $handler);
    }

    public function post($path, $name, $handler)
    {
        return $this->addRoute('POST', $path, $name, $handler);
    }

    public function put($path, $name, $handler)
    {
        return $this->addRoute('PUT', $path, $name, $handler);
    }

    public function delete($path, $name, $handler)
    {
        return $this->addRoute('DELETE', $path, $name, $handler);
    }

    public function addRoute($method, $path, $name, $handler)
    {
        $routeData = $this->routeParser->parse($path);
        $this->dataGenerator->addRoute($method, $routeData, $handler);

        $routeDate['method'] = $method;
        $this->reverse[$name] = $routeData;

        return $this;
    }

    public function getPath($name, $parameters = [])
    {
        $parts = $this->reverse[$name];

        $path = implode('', array_map(function ($part) use ($parameters) {
            if (is_array($part)) {
                $part = $parameters[$part[0]];
            }
            return $part;
        }, $parts));

        $path = '/' . ltrim($path, '/');
        return $path;
    }

    public function getCurrentPath()
    {
        $name = $this->currentRequestName;
        $parameters = $this->currentRequestParameters;

        return $this->getPath($name, $parameters);
    }

    public function getMethod($handler)
    {
        return array_get($this->reverse, $handler . '.method', '');
    }

    public function getCallable($method, $uri)
    {
        $routeInfo = $this->getDispatcher()->dispatch($method, $uri);

        switch ($routeInfo[0]) {
            case Dispatcher::NOT_FOUND:
                throw new \Exception('404 Not Found');
            case Dispatcher::METHOD_NOT_ALLOWED:
                throw new \Exception('405 Method Not Allowed');
            case Dispatcher::FOUND:
                $handler = $routeInfo[1];
                $parameters = $routeInfo[2];

                return [$handler, $parameters];
        }
    }

    protected function getDispatcher()
    {
        if (! isset($this->dispatcher)) {
            $this->dispatcher = new Dispatcher\GroupCountBased($this->dataGenerator->getData());
        }

        return $this->dispatcher;
    }
}


text:
<?php

class iHomefinderAgentOrOfficeListingsVirtualPageImpl extends iHomefinderAbstractVirtualPage {

	public function getContent() {
		iHomefinderStateManager::getInstance()->setLastSearchUrl();
		$agentId = iHomefinderUtility::getInstance()->getRequestVar("agentId");
		$officeId = iHomefinderUtility::getInstance()->getRequestVar("officeId");
		$this->remoteRequest
			->addParameter("method", "handleRequest")
			->addParameter("viewType", "json")
			->addParameter("requestType", "agent-or-office-listings")
			->addParameter("agentId", $agentId)
			->addParameter("officeId", $officeId)
		;
		$this->remoteResponse = $this->remoteRequest->remoteGetRequest();
	}

}


text:
package hydrograph.engine.jaxb.inputtypes;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import hydrograph.engine.jaxb.commontypes.ElementValueIntegerType;
import hydrograph.engine.jaxb.commontypes.ElementValueStringType;
import hydrograph.engine.jaxb.isparkredshift.TypeInputSparkredshiftBase;

/**
 *
Java class for sparkredshift complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="sparkredshift">
 *   <complexContent>
 *     <extension base="{hydrograph/engine/jaxb/isparkredshift}type-input-sparkredshift-base">
 *       <sequence>
 *         <element name="databaseName" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type"/>
 *         <element name="hostName" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type"/>
 *         <element name="port" type="{hydrograph/engine/jaxb/commontypes}element-value-integer-type" minOccurs="0"/>
 *         <element name="userName" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type"/>
 *         <element name="password" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type"/>
 *         <element name="schemaName" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type" minOccurs="0"/>
 *         <element name="temps3dir" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type"/>
 *         <choice>
 *           <element name="tableName" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type" minOccurs="0"/>
 *           <sequence>
 *             <element name="selectQuery" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type"/>
 *             <element name="countQuery" type="{hydrograph/engine/jaxb/commontypes}element-value-string-type" minOccurs="0"/>
 *           </sequence>
 *         </choice>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sparkredshift", namespace = "hydrograph/engine/jaxb/inputtypes", propOrder = {
    "databaseName",
    "hostName",
    "port",
    "userName",
    "password",
    "schemaName",
    "temps3Dir",
    "tableName",
    "selectQuery",
    "countQuery"
})
public class Sparkredshift
    extends TypeInputSparkredshiftBase
{

    @XmlElement(required = true)
    protected ElementValueStringType databaseName;
    @XmlElement(required = true)
    protected ElementValueStringType hostName;
    protected ElementValueIntegerType port;
    @XmlElement(required = true)
    protected ElementValueStringType userName;
    @XmlElement(required = true)
    protected ElementValueStringType password;
    protected ElementValueStringType schemaName;
    @XmlElement(name = "temps3dir", required = true)
    protected ElementValueStringType temps3Dir;
    protected ElementValueStringType tableName;
    protected ElementValueStringType selectQuery;
    protected ElementValueStringType countQuery;

    /**
     * Gets the value of the databaseName property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getDatabaseName() {
        return databaseName;
    }

    /**
     * Sets the value of the databaseName property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setDatabaseName(ElementValueStringType value) {
        this.databaseName = value;
    }

    /**
     * Gets the value of the hostName property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getHostName() {
        return hostName;
    }

    /**
     * Sets the value of the hostName property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setHostName(ElementValueStringType value) {
        this.hostName = value;
    }

    /**
     * Gets the value of the port property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueIntegerType }
     *
     */
    public ElementValueIntegerType getPort() {
        return port;
    }

    /**
     * Sets the value of the port property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueIntegerType }
     *
     */
    public void setPort(ElementValueIntegerType value) {
        this.port = value;
    }

    /**
     * Gets the value of the userName property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getUserName() {
        return userName;
    }

    /**
     * Sets the value of the userName property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setUserName(ElementValueStringType value) {
        this.userName = value;
    }

    /**
     * Gets the value of the password property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getPassword() {
        return password;
    }

    /**
     * Sets the value of the password property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setPassword(ElementValueStringType value) {
        this.password = value;
    }

    /**
     * Gets the value of the schemaName property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getSchemaName() {
        return schemaName;
    }

    /**
     * Sets the value of the schemaName property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setSchemaName(ElementValueStringType value) {
        this.schemaName = value;
    }

    /**
     * Gets the value of the temps3Dir property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getTemps3Dir() {
        return temps3Dir;
    }

    /**
     * Sets the value of the temps3Dir property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setTemps3Dir(ElementValueStringType value) {
        this.temps3Dir = value;
    }

    /**
     * Gets the value of the tableName property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getTableName() {
        return tableName;
    }

    /**
     * Sets the value of the tableName property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setTableName(ElementValueStringType value) {
        this.tableName = value;
    }

    /**
     * Gets the value of the selectQuery property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getSelectQuery() {
        return selectQuery;
    }

    /**
     * Sets the value of the selectQuery property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setSelectQuery(ElementValueStringType value) {
        this.selectQuery = value;
    }

    /**
     * Gets the value of the countQuery property.
     *
     * @return
     *     possible object is
     *     {@link ElementValueStringType }
     *
     */
    public ElementValueStringType getCountQuery() {
        return countQuery;
    }

    /**
     * Sets the value of the countQuery property.
     *
     * @param value
     *     allowed object is
     *     {@link ElementValueStringType }
     *
     */
    public void setCountQuery(ElementValueStringType value) {
        this.countQuery = value;
    }

}


text:
from a10sdk.common.A10BaseClass import A10BaseClass

class RunningConfig(A10BaseClass):

    """Class Description::
    Configure the behaviour of show running config.

    Class running-config supports CRUD Operations and inherits from `common/A10BaseClass`.
    This class is the `"PARENT"` class for this module.`

    :param aflex: {"default": 0, "optional": true, "type": "number", "description": "Show aFleX scripts", "format": "flag"}
    :param uuid: {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}
    :param class_list: {"default": 0, "optional": true, "type": "number", "description": "Show class-list files", "format": "flag"}
    :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`

    URL for this object::
    `https://<Hostname|Ip address>//axapi/v3/running-config`.

    """
    def __init__(self, **kwargs):
        self.ERROR_MSG = ""
        self.required=[]
        self.b_key = "running-config"
        self.a10_url="/axapi/v3/running-config"
        self.DeviceProxy = ""
        self.aflex = ""
        self.uuid = ""
        self.class_list = ""

        for keys, value in kwargs.items():
            setattr(self,keys, value)


text:
Most environments will start an ssh agent for you and propagate it to your shell via `SSH_AUTH_SOCK` environment variable: no problem.

# Windows, with cygwin and mintty

The problem is Windows doesn't start an ssh agent, so when we open a new shell and there is no ssh agent running, we need to start one, then when we open new shells we need to reattach to that one.

Put this in your `.bashrc`:

    # find a running ssh-agent and link to it
    # useful below and in other scenarios (e.g. root using user ssh agent)
    link_ssh_agent() {
      local dir sock
      dir=$(find /tmp -type d -name 'ssh-*' 2>/dev/null | head -1)
      sock=$(find "$dir" -type s -name 'agent.*' 2>/dev/null)
      if [[ -r "$sock" ]]; then
        ln -snf "$sock" ~/.ssh-agent
        echo "Agent linked: $sock"
        ssh-add -l
      else
        echo "Error: cannot find running ssh-agent in /tmp"
      fi
    }

    # start ssh-agent if not started, else link to it
    if ! ps ax 2>/dev/null | grep -q ssh-agent; then
      # make sure no dead ssh agent sockets remain
      rm -rf /tmp/ssh-*
      eval $(ssh-agent) > /dev/null
    else
      export SSH_AUTH_SOCK=~/.ssh-agent
      link_ssh_agent > /dev/null
    fi

# SSH and screen

The problem is screen won't get the ssh agent because it inherits the environment from when it started, so when using screen we set it to a static file in the home directory, and maintain a symlink to the current ssh agent using the `.ssh/rc` file executed at every connection.

Put in your `.bashrc`:

    # .ssh/rc maintains SSH agent symlink at ~/.ssh-agent, use it in screen.
    case "$TERM" in
      screen*) export SSH_AUTH_SOCK=~/.ssh-agent ;;
    esac

Put in your `.ssh/rc`:

    #!/bin/sh
    # Do not use bash, this file is executed by /bin/sh regardless of shebang.

    # Maintain ~/.ssh-agent symlink to the current SSH agent.
    if [ -e "$SSH_AUTH_SOCK" ]; then
      ln -snf "$SSH_AUTH_SOCK" ~/.ssh-agent
    fi

    # sshd(8) says if no ~/.ssh/rc, xauth is run; so we have to do it ourselves.
    if read proto cookie && [ -n "$DISPLAY" ]; then
      part1=$(echo "$DISPLAY" | cut -d: -f1)
      part2=$(echo "$DISPLAY" | cut -d: -f2)
      if [ "$part1" = "localhost" ]; then
        # sshd with X11UseLocalhost=yes
        xauth -q add "unix:$part2" "$proto" "$cookie"
      else
        # sshd with X11UseLocalhost=no
        xauth -q add "$DISPLAY" "$proto" "$cookie"
      fi
    fi

Then you can use ssh forwarding, use screen and your ssh agent always works.
Also, X11 forwarding still works.

By the way, instead of ssh and typing screen, I use a handy `co` function that automatically reattaches to the current screen session or creates a new one:

    co() {
      ssh -t "$@" 'screen -rx || screen'
    }

    co machine
    co machine -A # with SSH forwarding


text:
package dta.chat.model.socket;

import java.io.IOException;

import dta.chat.model.ChatMessage;

public class ChatSocketImpl implements ChatSocket{
	private ClientSocket client;

	public ChatSocketImpl(String ip, int port) throws ChatClientException {
		try {
			client = new ClientSocket(ip, port);
		} catch (IOException e) {
			throw new ChatClientException("creation problem", e);
		}
	}

	@Override
	public void sendMessage(ChatMessage msg) throws ChatClientException {
		try {
			client.sendObject(msg);
		} catch (IOException e) {
			throw new ChatClientException("read problem", e);
		}

	}

	@Override
	public ChatMessage readMessage() throws ChatClientException {
		try {
			return (ChatMessage) client.readObject();
		} catch (ClassNotFoundException | IOException e) {
			throw new ChatClientException("read problem", e);
		}

	}

	@Override
	public void close() throws Exception {
		client.close();
	}

}


text:
	<title>Geometry Generation</title>

	<link rel="stylesheet" type="text/css" media="all" href="styles.css"/>

		<xml3d id="myxml3dcanvas" style="width: 100%; height: 100%; background-color: eeeeee;" activeview="#selected-view">

			<shader id="flag-material" script="#flag-material-script">
				<float name="diffuseIntensity">0.95</float>
				<float name="ambientIntensity">0.15</float>
				<float name="roughness">0.85</float>
				<texture name="diffuseTexture" wrapS="clamp" wrapT="clamp">

				</texture>
			</shader>

			<asset id="flag" src="assets.xml#cloth" shader="#flag-material">
				<assetdata name="export">
					<float2 name="extend" id="cloth-extend">1 1</float2>
					<int name="segments" id="cloth-segments">1 1</int>
					<int name="pins" id="pins">0</int>
				</assetdata>
			</asset>

			<group style="transform: scale3d(0.1, 0.1, 0.1)">
				<model src="assets.xml#pole" style="transform: translate3d(-127.5px, -62px, 0px);"></model>
				<model src="assets.xml#gg" style="transform: translate3d(-127.5px, -250px, 0px);"></model>

				<model src="assets.xml#box" style="transform: translate3d(23.25px, 125px, 0px);">
					<assetdata name="export">
						<float3 name="extend">303.5 2 2</float3>
					</assetdata>
				</model>

				<model src="#flag" style="transform: translate3d(25px, 34px, 0px);">
					<assetdata name="export">
						<float3 name="windforce" id="wind-force">0 0 0</float3>
						<float name="time" class="global-time">0</float>
					</assetdata>
				</model>

			</group>

			<view id="default-view" position="0 0 85" orientation="1 0 0 0"></view>
			<view id="selected-view" position="-48.64032897949219 40.3162109375 56.8658203125" orientation="-0.5635820031166077 -0.8061190247535706 -0.18040907382965088 0.853056196844724"></view>

			<lightshader id="light1" script="urn:xml3d:lightshader:directional">
				<float3 name="intensity">1 1 1</float3>
			</lightshader>

			<group style="transform: rotateY(25deg) rotateX(-35deg)" >
				<light shader="#light1"></light>
			</group>
		</xml3d>


text:
Translations
------------
This is how to generate the po template file from top level repository directory::

    # extract strings from ui files
    intltool-extract --type=gettext/glade ui/config.glade
    intltool-extract --type=gettext/glade ui/choose.glade

    # generate subliminal.pot
    xgettext -k_ -kN_ -w 120 --from-code=utf-8 -o i18n/subliminal.pot ui/config.glade.h ui/choose.glade.h nautilus-subliminal.py

    # clean up
    rm ui/*.h

.. _Subliminal: https://github.com/Diaoul/subliminal


text:
package com.velo.cityon.api.vo.rest;

import com.velo.cityon.api.vo.CityVO;

public class CityResponse extends Response {
	private CityVO city;

	public CityVO getCity() {
		return city;
	}
	public void setCity(CityVO city) {
		this.city = city;
	}
}


text:
package net.foreworld.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import net.foreworld.model.Menu;
import net.foreworld.service.MenuService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *
 * @author Administrator
 *
 */
@Controller
public class MenuController {

	@Autowired
	private MenuService menuService;

	@RequestMapping(value = { "/manage/menu/" }, method = RequestMethod.GET)
	public String _m_indexUI(HttpSession session, Map<String, Object> map) {

		List<Menu> list = menuService.findByMenu(null, 1, Integer.MAX_VALUE);
		map.put("data_list", list);

		map.put("session_user", session.getAttribute("session.user"));
		map.put("nav_choose", ",08,0803,");
		return "m/Menu/index";
	}
}


text:
package org.ros.time;

import org.junit.Test;
import org.ros.address.InetAddressFactory;

import java.io.IOException;
import java.util.concurrent.Executors;

/**
 * @author damonkohler@google.com (Damon Kohler)
 */
public class NtpTimeProviderTest {

  @Test
  public void testNtpTime() throws IOException {
    // TODO(damonkohler): This is only a simple sanity check.
    NtpTimeProvider ntpTimeProvider =
        new NtpTimeProvider(InetAddressFactory.newFromHostString("ntp.ubuntu.com"),
            Executors.newScheduledThreadPool(Integer.MAX_VALUE));
    ntpTimeProvider.updateTime();
    ntpTimeProvider.getCurrentTime();
    System.out.println("System time: " + System.currentTimeMillis());
    System.out.println("NTP time: " + ntpTimeProvider.getCurrentTime().totalNsecs() / 1000000);
  }
}


text:
MASON_NAME=proj
MASON_VERSION=4.8.0
MASON_LIB_FILE=lib/libproj.a
#MASON_PKGCONFIG_FILE=lib/pkgconfig/proj.pc

. ${MASON_DIR}/mason.sh

function mason_load_source {
    mason_download \
        http://download.osgeo.org/proj/proj-${MASON_VERSION}.tar.gz \
        531953338fd3167670cafb44ca59bd58eaa8712d

    mason_extract_tar_gz

    export MASON_BUILD_PATH=${MASON_ROOT}/.build/${MASON_NAME}-${MASON_VERSION}
}

function mason_compile {
    curl --retry 3 -f -# -L http://download.osgeo.org/proj/proj-datumgrid-1.5.zip -o proj-datumgrid-1.5.zip
    cd nad
    unzip -o ../proj-datumgrid-1.5.zip
    cd ../
    ./configure --prefix=${MASON_PREFIX} \
    --without-mutex ${MASON_HOST_ARG} \
    --with-jni=no \
    --enable-static \
    --disable-shared \
    --disable-dependency-tracking

    make -j${MASON_CONCURRENCY}
    make install
}

function mason_ldflags {
    echo "-lproj"
}

function mason_clean {
    make clean
}

mason_run "$@"


text:
#ifndef MMAL_METADATA_H
#define MMAL_METADATA_H

#include "mmal_common.h"

/** \defgroup MmalMetadata List of pre-defined metadata types
 * This defines a list of standard metadata types. Components can still define proprietary
 * metadata types by using their own FourCC and defining their own metadata structures. */
/* @{ */

/** \name Pre-defined metadata FourCCs */
/* @{ */
#define MMAL_METADATA_HELLO_WORLD             MMAL_FOURCC('H','E','L','O')
/* @} */

/** Generic metadata type. All metadata structures need to begin with these fields. */
typedef struct MMAL_METATDATA_T
{
   uint32_t id;    /**< Metadata id. This is a FourCC */
   uint32_t size;  /**< Size in bytes of the following metadata (not including id and size) */
} MMAL_METADATA_T;

/** Hello World metadata. */
typedef struct MMAL_METATDATA_HELLO_WORLD_T
{
   uint32_t id;    /**< Metadata id. This is a FourCC */
   uint32_t size;  /**< Size in bytes of the following metadata (not including id and size) */

   uint32_t myvalue; /**< Metadata value */
} MMAL_METADATA_HELLO_WORLD_T;

/** Get metadata item from buffer header.
 * This will search through all the metadata in the buffer header and return a pointer to the
 * first instance of the requested metadata id.
 *
 * @param header buffer header containing the metadata
 * @param id     requested metadata id
 *
 * @return Pointer to metadata requested or NULL if not found.
 */
MMAL_METADATA_T *mmal_metadata_get(MMAL_BUFFER_HEADER_T *header, uint32_t id);

/** Set metadata item in buffer header.
 * This will store the metadata item into the buffer header. This operation can fail if not
 * enough memory is available in the data section of the buffer header.
 *
 * @param header   buffer header to store the metadata into
 * @param metadata metadata item to store in buffer header
 *
 * @return MMAL_SUCCESS on success or MMAL_ENOMEM if not enough memory is available for storing
 * the metadata
 */
MMAL_STATUS_T mmal_metadata_set(MMAL_BUFFER_HEADER_T *header, MMAL_METADATA_T *metadata);

/* @} */

#endif /* MMAL_METADATA_H */


text:
/* 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.
 */
package org.camunda.bpm.engine.impl.cmmn;

import static org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull;

import java.util.Map;

import org.camunda.bpm.engine.exception.NotAllowedException;
import org.camunda.bpm.engine.exception.NotFoundException;
import org.camunda.bpm.engine.exception.NotValidException;
import org.camunda.bpm.engine.exception.NullValueException;
import org.camunda.bpm.engine.exception.cmmn.CaseDefinitionNotFoundException;
import org.camunda.bpm.engine.exception.cmmn.CaseIllegalStateTransitionException;
import org.camunda.bpm.engine.impl.cmmn.cmd.CreateCaseInstanceCmd;
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
import org.camunda.bpm.engine.impl.interceptor.CommandExecutor;
import org.camunda.bpm.engine.runtime.CaseInstance;
import org.camunda.bpm.engine.runtime.CaseInstanceBuilder;
import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.Variables;

/**
 * @author Roman Smirnov
 *
 */
public class CaseInstanceBuilderImpl implements CaseInstanceBuilder {

  protected CommandExecutor commandExecutor;
  protected CommandContext commandContext;

  protected String caseDefinitionKey;
  protected String caseDefinitionId;
  protected String businessKey;
  protected VariableMap variables;

  public CaseInstanceBuilderImpl(CommandExecutor commandExecutor, String caseDefinitionKey, String caseDefinitionId) {
    this(caseDefinitionKey, caseDefinitionId);
    ensureNotNull("commandExecutor", commandExecutor);
    this.commandExecutor = commandExecutor;
  }

  public CaseInstanceBuilderImpl(CommandContext commandContext, String caseDefinitionKey, String caseDefinitionId) {
    this(caseDefinitionKey, caseDefinitionId);
    ensureNotNull("commandContext", commandContext);
    this.commandContext = commandContext;
  }

  private CaseInstanceBuilderImpl(String caseDefinitionKey, String caseDefinitionId) {
    this.caseDefinitionKey = caseDefinitionKey;
    this.caseDefinitionId = caseDefinitionId;
  }

  public CaseInstanceBuilder businessKey(String businessKey) {
    this.businessKey = businessKey;
    return this;
  }

  public CaseInstanceBuilder setVariable(String variableName, Object variableValue) {
    ensureNotNull(NotValidException.class, "variableName", variableName);
    if (variables == null) {
      variables = Variables.createVariables();
    }
    variables.putValue(variableName, variableValue);
    return this;
  }

  public CaseInstanceBuilder setVariables(Map<String, Object> variables) {
    if (variables != null) {
      if (this.variables == null) {
        this.variables = Variables.fromMap(variables);
      }
      else {
        this.variables.putAll(variables);
      }
    }
    return this;
  }

  public CaseInstance create() {
    try {
      CreateCaseInstanceCmd command = new CreateCaseInstanceCmd(this);
      if(commandExecutor != null) {
        return commandExecutor.execute(command);
      } else {
        return command.execute(commandContext);
      }

    } catch (CaseDefinitionNotFoundException e) {
      throw new NotFoundException(e.getMessage(), e);

    } catch (NullValueException e) {
      throw new NotValidException(e.getMessage(), e);

    } catch (CaseIllegalStateTransitionException e) {
      throw new NotAllowedException(e.getMessage(), e);

    }
  }

  // getters ////////////////////////////////////

  public String getCaseDefinitionKey() {
    return caseDefinitionKey;
  }

  public String getCaseDefinitionId() {
    return caseDefinitionId;
  }

  public String getBusinessKey() {
    return businessKey;
  }

  public VariableMap getVariables() {
    return variables;
  }

}


text:
package net.suaree.eventbrite.model;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.joda.time.DateMidnight;
import org.joda.time.Weeks;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Represents a weekly schedule for an event.
 *
 * @author roger
 */
public class WeeklySchedule extends RepeatSchedule {
    private static final Log log = LogFactory.getLog(WeeklySchedule.class);

    private static final Pattern RegexScheduleType =
            Pattern.compile("^(\\d+)\\-([YN](?:,[YN]){6})\\-(\\d{2}/\\d{2}/\\d{4})$");

    private static final DateFormat EndDateFormat = new SimpleDateFormat("MM/dd/yyyy");

    private int frequency;

    private final boolean[] occurrs = new boolean[7];

    private Calendar endDate;

    public WeeklySchedule(TimeZone timeZone) {
        super(timeZone);
    }

    /**
     * Parses the remainder of the schedule spec.
     *
     * @param rawScheduleRemainder The remainder of the schedule spec to parse.
     */
    @Override
    protected void parseSchedule(String rawScheduleRemainder) {
        Matcher matcher = RegexScheduleType.matcher(rawScheduleRemainder);

        if (!matcher.find()) {
            throw new IllegalArgumentException("rawScheduleRemainder");
        }

        frequency = Integer.parseInt(matcher.group(1));

        try {
            endDate = Calendar.getInstance(getTimeZone());
            endDate.setTime(EndDateFormat.parse(matcher.group(3)));
        } catch (ParseException ex) {
            log.error("ParseException:", ex);

            throw new IllegalArgumentException("rawScheduleRemainder", ex);
        }

        String[] occurrsParts = matcher.group(2).split(",");
        assert occurrsParts.length == occurrs.length;

        for (int i = 0; i < occurrs.length; i++) {
            occurrs[i] = "Y".equals(occurrsParts[i]);
        }
    }

    /**
     * Gets up to max dates after startDate that match this schedule which started on firstDate.
     *
     * @param firstDate The first date for the schedule.
     * @param startDate The start date for the schedule; only results on or after this date must be returned.
     * @param max       The maximum number of schedule dates to return;
     * @return A List of Calendar objects representing the dates that match this schedule.
     */
    @Override
    protected List<Calendar> getDates(Calendar firstDate, Calendar startDate, int max) {
        assert 0 < max;

        ArrayList<Calendar> result = new ArrayList<Calendar>();
        Calendar firstDateFirstDoW = Calendar.getInstance(getTimeZone());
        Calendar current = Calendar.getInstance(getTimeZone());
        Calendar tmp;

        current.clear();
        current.set(startDate.get(Calendar.YEAR), startDate.get(Calendar.MONTH), startDate.get(Calendar.DAY_OF_MONTH));

        firstDateFirstDoW.setTimeInMillis(firstDate.getTimeInMillis());
        firstDateFirstDoW.add(Calendar.DATE, -(firstDate.get(Calendar.DAY_OF_WEEK) - 1));

        // TODO: There must be a more efficient way to do this.
        while (!current.after(endDate)) {
            if (matchesSchedule(firstDateFirstDoW, current)) {
                result.add(current);

                if (max == result.size()) {
                    break;
                }
            }

            tmp = current;
            current = Calendar.getInstance(getTimeZone());
            current.setTimeInMillis(tmp.getTimeInMillis());
            current.add(Calendar.DATE, 1);
        }

        return result;
    }

    private boolean matchesSchedule(Calendar firstDate, Calendar testDate) {
        DateMidnight dmFirst = new DateMidnight(firstDate.getTimeInMillis());
        DateMidnight dmTest = new DateMidnight(testDate.getTimeInMillis());

        Weeks weeks = Weeks.weeksBetween(dmFirst, dmTest);
        if (0 != weeks.getWeeks() % frequency) {
            return false;
        }

        int dow = testDate.get(Calendar.DAY_OF_WEEK);
        int dayIndex = ((dow - Calendar.SUNDAY) + 6) % 7;

        return occurrs[dayIndex];
    }
}


text:
.class final Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;
.super Ljava/lang/Object;
.source "PowerManagerService.java"

# interfaces
.implements Lcom/android/server/power/DisplayBlanker;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/power/PowerManagerService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x12
    name = "DisplayBlankerImpl"
.end annotation

# instance fields
.field private mBlanked:Z

.field final synthetic this$0:Lcom/android/server/power/PowerManagerService;

# direct methods
.method private constructor <init>(Lcom/android/server/power/PowerManagerService;)V
    .locals 0
    .parameter

    .prologue
    .line 2696
    iput-object p1, p0, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;->this$0:Lcom/android/server/power/PowerManagerService;

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

    return-void
.end method

.method synthetic constructor <init>(Lcom/android/server/power/PowerManagerService;Lcom/android/server/power/PowerManagerService$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 2696
    invoke-direct {p0, p1}, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;-><init>(Lcom/android/server/power/PowerManagerService;)V

    return-void
.end method

# virtual methods
.method public blankAllDisplays()V
    .locals 1

    .prologue
    .line 2701
    monitor-enter p0

    .line 2702
    const/4 v0, 0x1

    :try_start_0
    iput-boolean v0, p0, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;->mBlanked:Z

    .line 2703
    iget-object v0, p0, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;->this$0:Lcom/android/server/power/PowerManagerService;

    #getter for: Lcom/android/server/power/PowerManagerService;->mDisplayManagerService:Lcom/android/server/display/DisplayManagerService;
    invoke-static {v0}, Lcom/android/server/power/PowerManagerService;->access$2700(Lcom/android/server/power/PowerManagerService;)Lcom/android/server/display/DisplayManagerService;

    move-result-object v0

    invoke-virtual {v0}, Lcom/android/server/display/DisplayManagerService;->blankAllDisplaysFromPowerManager()V

    .line 2704
    const/4 v0, 0x0

    #calls: Lcom/android/server/power/PowerManagerService;->nativeSetInteractive(Z)V
    invoke-static {v0}, Lcom/android/server/power/PowerManagerService;->access$2800(Z)V

    .line 2705
    const/4 v0, 0x1

    #calls: Lcom/android/server/power/PowerManagerService;->nativeSetAutoSuspend(Z)V
    invoke-static {v0}, Lcom/android/server/power/PowerManagerService;->access$2900(Z)V

    .line 2706
    monitor-exit p0

    .line 2707
    return-void

    .line 2706
    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 2721
    monitor-enter p0

    .line 2722
    :try_start_0
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "blanked="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;->mBlanked:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    monitor-exit p0

    return-object v0

    .line 2723
    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public unblankAllDisplays()V
    .locals 1

    .prologue
    .line 2711
    monitor-enter p0

    .line 2712
    const/4 v0, 0x0

    :try_start_0
    #calls: Lcom/android/server/power/PowerManagerService;->nativeSetAutoSuspend(Z)V
    invoke-static {v0}, Lcom/android/server/power/PowerManagerService;->access$2900(Z)V

    .line 2713
    const/4 v0, 0x1

    #calls: Lcom/android/server/power/PowerManagerService;->nativeSetInteractive(Z)V
    invoke-static {v0}, Lcom/android/server/power/PowerManagerService;->access$2800(Z)V

    .line 2714
    iget-object v0, p0, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;->this$0:Lcom/android/server/power/PowerManagerService;

    #getter for: Lcom/android/server/power/PowerManagerService;->mDisplayManagerService:Lcom/android/server/display/DisplayManagerService;
    invoke-static {v0}, Lcom/android/server/power/PowerManagerService;->access$2700(Lcom/android/server/power/PowerManagerService;)Lcom/android/server/display/DisplayManagerService;

    move-result-object v0

    invoke-virtual {v0}, Lcom/android/server/display/DisplayManagerService;->unblankAllDisplaysFromPowerManager()V

    .line 2715
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/server/power/PowerManagerService$DisplayBlankerImpl;->mBlanked:Z

    .line 2716
    monitor-exit p0

    .line 2717
    return-void

    .line 2716
    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method


text:
<?php

require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/bootstrap.php';
require_once __DIR__ . '/routes/api.php';

$app->run();


text:
<?php

require_once(dirname(__FILE__).'/../../bootstrap/unit.php');

$t = new lime_test(5, new lime_output_color());

// __construct()
$t->diag('__construct()');
try
{
  new sfValidatorRegex();
  $t->fail('__construct() throws an RuntimeException if you don\'t pass a pattern option');
}
catch (RuntimeException $e)
{
  $t->pass('__construct() throws an RuntimeException if you don\'t pass a pattern option');
}

$v = new sfValidatorRegex(array('pattern' => '/^[0-9]+$/'));

// ->clean()
$t->diag('->clean()');
$t->is($v->clean(12), '12', '->clean() checks that the value match the regex');

try
{
  $v->clean('symfony');
  $t->fail('->clean() throws an sfValidatorError if the value does not match the pattern');
  $t->skip('', 1);
}
catch (sfValidatorError $e)
{
  $t->pass('->clean() throws an sfValidatorError if the value does not match the pattern');
  $t->is($e->getCode(), 'invalid', '->clean() throws a sfValidatorError');
}

// ->asString()
$t->diag('->asString()');
$t->is($v->asString(), 'Regex({ pattern: \'/^[0-9]+$/\' })', '->asString() returns a string representation of the validator');


text:
namespace csapex
{
class CSAPEX_COMMAND_EXPORT CommandDispatcher : public CommandExecutor
{
public:
    typedef std::shared_ptr<CommandDispatcher> Ptr;

public:
    CommandDispatcher(CsApexCore& core);

    bool execute(const CommandPtr& command) override;
    void executeLater(const CommandPtr& command) override;
    void executeLater() override;

    bool isDirty() const override;

    bool canUndo() const override;
    bool canRedo() const override;

    void undo() override;
    void redo() override;

    CommandConstPtr getNextUndoCommand() const;
    CommandConstPtr getNextRedoCommand() const;

    void visitUndoCommands(std::function<void(int level, const Command& cmd)> callback) const;
    void visitRedoCommands(std::function<void(int level, const Command& cmd)> callback) const;

    void reset();
    void setDirty();
    void setClean();
    void resetDirtyPoint();
    void clearSavepoints();

private:
    bool doExecute(Command::Ptr command);
    void setDirty(bool dirty);

protected:
    CommandDispatcher(const CommandDispatcher& copy);
    CommandDispatcher& operator=(const CommandDispatcher& assign);

private:
    CsApexCore& core_;

    std::vector<Command::Ptr> later;

    std::deque<Command::Ptr> done;
    std::deque<Command::Ptr> undone;
    bool dirty_;
};

}  // namespace csapex

#endif  // COMMAND_DISPATCHER_H


text:
=head1 LICENSE

Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2022] EMBL-European Bioinformatics Institute

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.

=cut

package EnsEMBL::Web::Component::Regulation::FeatureSummary;

use strict;
use warnings;
no warnings "uninitialized";
use base qw(EnsEMBL::Web::Component::Regulation);

sub _init {
  my $self = shift;
  $self->cacheable(0);
  $self->ajaxable(1);
  $self->has_image(1);
}

sub content {
  my $self = shift;
  my $object = $self->object || $self->hub->core_object('regulation');

  $self->cell_line_button('reg_summary');

  my $object_slice = $object->get_context_slice(25000);
     $object_slice = $object_slice->invert if $object_slice->strand < 1;

  my $fsets = $object->get_feature_sets;

  my $wuc = $object->get_imageconfig( 'reg_summary' );
  $wuc->cache( 'feature_sets', $fsets);

  $wuc->set_parameters({
    'container_width'   => $object_slice->length,
    'image_width',      => $self->image_width || 800,
    'slice_number',     => '1|1',
  });

  $wuc->{'data_by_cell_line'} = $self->new_object('Slice', $object_slice, $object->__data)->get_cell_line_data($wuc);

  my $image    = $self->new_image( $object_slice, $wuc, [$object->stable_id] );
      $image->imagemap           = 'yes';
      $image->{'panel_number'} = 'top';
      $image->set_button( 'drag', 'title' => 'Drag to select region' );
  return if $self->_export_image( $image );

  return $image->render;
}

1;


text:
<?php

$qr_data 						= $this->getVar('data');		// this is a search result row
$va_access_values 		= $this->getVar('access_values');
?>

<?php
	if($vs_media_tag = $qr_data->getMediaTag('ca_object_representations.media', 'thumbnail', array('checkAccess' => $va_access_values))){
		print caNavLink($this->request, $vs_media_tag, '', 'Detail', 'Object', 'Show', array('object_id' => $qr_data->get("ca_objects.object_id")));
	}
?>

	<?php print caNavLink($this->request, ''.$qr_data->get("ca_objects.idno").': '.$qr_data->get("ca_objects.preferred_labels"), '', 'Detail', 'Object', 'Show', array('object_id' => $qr_data->get("ca_objects.object_id"))); ?>


text:
{% extends "base.html" %}
{% block body %}
    {% if notification %}

            {{notification}}

    {% endif %}

{{channel.channel}} on {{channel.server}}

    ← back to all channels
    ·
    ↓ Oldest messages at the bottom
    ·
    Edit channel properties
    ·
    {% if hide_bots %}
        Show bots
    {% else %}
        Hide bots
    {% endif %}

    <form>
	<input type="text" name="q" id="q" style="display:inline" />
	<input type="submit" value="search" name="search" />
    </form>

            Time
            User
            Message

        {% if messages %}
            {% for message in messages %}
                {# timestamp #}
                {% ifchanged %}

                    {{ message.timestamp|date:"l, F jS" }}

                {% endifchanged %}

                {# the message #}
                {% ifequal message.message_type 'message' %}

                        {# display friendly time since value if the message was posted today #}
                        {% if message.timestamp.date == today %}
                            {{message.timestamp|timesince}} ago

                        {# otherwise display the time posted, currently as UTC #}
                        {% else %}
                            {{message.timestamp|date:"H:i"}}
                        {% endif %}

                    {{message.user.nickname}}
                    {{ message.message_content|escape|urlize }}

                {% endifequal %}

                {% ifequal message.message_type 'action'  %}

                            {{ message.user.nickname }} {{ message.message_content|escape|urlize }} at {{message.timestamp|date:"H:i"}}

                {% endifequal %}

                {% ifequal message.message_type 'system'  %}

                        {% if message.timestamp.date == today %}
                            {{message.timestamp|timesince}} ago
                        {% else %}
                            {{message.timestamp|date:"H:i"}}
                        {% endif %}

                    {{ message.message_content|escape|urlize }}

                {% endifequal %}
            {% endfor %}

                    {% if next %}

                            Older →

                    {% endif %}
                    {% if cursor %}

                            ← Newer

                    {% endif %}

        {% else %}

                No messages were posted today

        {% endif %}

{% endblock %}


text:
DynamicDOM
==========
*DOM generation, clean and simple.*

```javascript
_dd.create('div', {
    content: [
        'A simple way to generate DOM trees from code: ',
        { tag: 'a', href: 'https://github.com/nickwb/ddom', content: 'DynamicDOM'}
    ]
});
```

### DynamicDOM is:

+ Simple, intuitive and powerful.
+ Compatible with all major browsers.
+ Available as a standalone library, or with a jQuery adapter.
+ Licensed under the MIT license.

### Tiny:
+ Standalone - **1.6KB** minified, **850 Bytes** gzipped.
+ Using jQuery Adapter - **1.0KB** minified, **540 Bytes** gzipped.

### Features:

+ Easily create DOM trees of any depth.
+ Utilities are provided to easily bind events and set CSS styles/classes.
+ Function evaluation to generate subtrees.

### Next Steps:

+ Ready to see more? [Check out the examples](https://github.com/nickwb/ddom/blob/master/examples.html).
+ You can download minified sources from [here](https://github.com/nickwb/ddom/blob/master/build/).


text:
/*
 * TaggedNgram.cc --
 *	Tagged N-gram backoff language models
 *
 */

#ifndef lint
static char Copyright[] = "Copyright (c) 1995-2010 SRI International.  All Rights Reserved.";
static char RcsId[] = "@(#)$Header: /home/srilm/devel/lm/src/RCS/TaggedNgram.cc,v 1.7 2010/06/02 05:49:58 stolcke Exp $";
#endif

#include "TaggedNgram.h"

#include "Array.cc"

/*
 * Debug levels used
 */
#define DEBUG_NGRAM_HITS 2		/* from Ngram.cc */

TaggedNgram::TaggedNgram(TaggedVocab &vocab, unsigned neworder)
    : Ngram(vocab, neworder), vocab(vocab)
{
}

/*
 * The tagged ngram LM uses the following backoff hierarchy:
 *
 *	- try word n-gram
 *	- try n-grams obtained by replacing the most distant word with its tag
 *	- try (n-1)-grams (recursively)
 */
LogP
TaggedNgram::wordProbBO(VocabIndex word, const VocabIndex *context, unsigned int clen)
{
    LogP result;
    VocabIndex usedContext[maxNgramOrder];
    VocabIndex untaggedWord = vocab.unTag(word);

    /*
     * Extract the word ngram from the context
     */
    unsigned i;
    for (i = 0; i < clen; i++) {
	usedContext[i] = vocab.unTag(context[i]);
    }
    usedContext[i] = Vocab_None;

    LogP *prob = findProb(untaggedWord, usedContext);

    if (prob) {
	if (running() && debug(DEBUG_NGRAM_HITS)) {
	    dout() << "[" << (clen + 1) << "gram]";
	}
	result = *prob;
    } else if (clen > 0) {
	/*
	 * Backoff weight from word to tag-ngram
	 */
	LogP *bow = findBOW(usedContext);
        LogP totalBOW = bow ? *bow : 0.0;

	/*
	 * Now replace the last word with its tag
	 */
	usedContext[clen - 1] = vocab.tagWord(Tagged_None,
				    vocab.getTag(context[clen - 1]));

	prob = findProb(untaggedWord, usedContext);

	if (prob) {
	    if (running() && debug(DEBUG_NGRAM_HITS)) {
		dout() << "[" << clen << "+Tgram]";
	    }
	    result = totalBOW + *prob;
	} else {
	    /*
	     * No tag-ngram, so back off to shorter context.
	     */
	    bow = findBOW(usedContext);

	    totalBOW += bow ? *bow : 0.0;
	    result = totalBOW + wordProbBO(word, context, clen - 1);
	}
    } else {
	result = LogP_Zero;
    }

    return result;
}

/*
 * Renormalize language model by recomputing backoff weights.
 *
 * The BOW(c) for a context c is computed to be
 *
 *	BOW(c) = (1 - Sum p(x | c)) /  (1 - Sum p_BO(x | c))
 *
 * where Sum is a summation over all words x with explicit probabilities
 * in context c, p(x|c) is that probability, and p_BO(x|c) is the
 * probability for that word according to the backoff algorithm.
 */
void TaggedNgram::recomputeBOWs()
{
    makeArray(VocabIndex, context, order + 1);

    /*
     * Here it is important that we compute the backoff weights in
     * increasing order, since the higher-order ones refer to the
     * lower-order ones in the backoff algorithm.
     * Note that this will only generate backoff nodes for those
     * contexts that have words with explicit probabilities.  But
     * this is precisely as it should be.
     */
    unsigned i;
    for (i = 0; i < order; i++) {
	BOnode *node;
	NgramBOsIter iter1(*this, context, i);

	while ((node = iter1.next())) {
	    NgramProbsIter piter(*node);
	    VocabIndex word;
	    LogP *prob;

	    double numerator = 1.0;
	    double denominator = 1.0;

	    while ((prob = piter.next(word))) {
		numerator -= LogPtoProb(*prob);
		if (i > 0) {
		    denominator -=
			LogPtoProb(wordProbBO(word, context, i - 1));
		}
	    }

	    /*
	     * Avoid some predicatble anomalies due to rounding errors
	     */
	    if (numerator < 0.0 && numerator > -Prob_Epsilon) {
		numerator = 0.0;
	    }
	    if (denominator < 0.0 && denominator > -Prob_Epsilon) {
		denominator = 0.0;
	    }

	    if (numerator < 0.0) {
		cerr << "BOW numerator for context \""
		     << (vocab.use(), context)
		     << "\" is " << numerator << " < 0\n";
	    } else if (denominator <= 0.0) {
		if (numerator > Prob_Epsilon) {
		    cerr << "BOW denominator for context \""
			 << (vocab.use(), context)
			 << "\" is " << denominator << " <= 0"
			 << endl;
		} else {
		    node->bow = 0.0;
		}
	    } else {
		/*
		 * If unigram probs leave a non-zero probability mass
		 * then we should give that mass to the zero-order (uniform)
		 * distribution for zeroton words.  However, the ARPA
		 * BO format doesn't support a "null context" BOW.
		 * We simluate the intended distribution by spreading the
		 * left-over mass uniformly over all vocabulary items that
		 * have a zero probability.
		 * NOTE: We used to do this only if there was prob mass left,
		 * but some ngram software requires all words to appear as
		 * unigrams, which we achieve by giving them zero probability.
		 */
		if (i == 0 /*&& numerator > 0.0*/) {
		    distributeProb(numerator, context);
		} else {
		    node->bow = ProbToLogP(numerator) - ProbToLogP(denominator);
		}
	    }
	}
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annls mycol. 12: 108 (1914)

#### Original name
Schroeteriaster glochidii Syd. & P. Syd.

### Remarks
null


text:
class CreateMonthreports < ActiveRecord::Migration
  def self.up
    create_table :monthreports do |t|
      t.date :date
      t.decimal :expenses, :precision => 9, :scale => 2, :null => false, :default => 0.00
      t.decimal :income, :precision => 9, :scale => 2, :null => false, :default => 0.00
      t.integer :account_id
      t.decimal :saldo, :precision => 9, :scale => 2, :null => false, :default => 0.00

      t.timestamps
    end
  end

  def self.down
    drop_table :monthreports
  end
end


text:
/*
   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.
 */
package com.ocs.dynamo.ui.composite.type;

/**
 * The supported grid editing modes
 *
 * @author Bas Rutten
 *
 */
public enum GridEditMode {

	SINGLE_ROW, SIMULTANEOUS;
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>登陆页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="./css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="./css/index.css">

XB_chatRoom欢迎登陆

                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            ×
                        </button>

登陆失败

如果没有注册,自动注册

                            <form>

                                    用户名
                                    <input type="text" class="form-control" id="login_username" placeholder="Email">

                                    密码
                                    <input type="password" class="form-control" id="login_password" placeholder="Password">

                                    <button type="button" class="btn btn-primary" id="login_login_btn">登陆</button>

                            </form>


text:
  <fieldset>
    <legend>Using <md-checkbox> with the 'indeterminate' attribute</legend>
      <md-checkbox aria-label="Select All"
                   ng-checked="isChecked()"
                   md-indeterminate="isIndeterminate()"
                   ng-click="toggleAll()">
        Un-Select All
      </md-checkbox>

        <md-checkbox ng-checked="exists(item, selected)" ng-click="toggle(item, selected)">
          {{ item }}
        </md-checkbox>

  </fieldset>


text:
package cellularAutomata.util;

/**
 * Holds a pair of points representing the width and height of a JPanel.
 *
 * @author David Bahr
 */
public class PanelSize
{
    private int width = 0;
    private int height = 0;

    /**
     * Create a pair of points representing the width and height of a JPanel.
     *
     * @param width The width of a JPanel.
     * @param height The height of a JPanel.
     */
    public PanelSize(int width, int height)
    {
        this.width = width;
        this.height = height;
    }

    /**
     * Get the height.
     */
    public int getHeight()
    {
        return height;
    }

    /**
     * Get the width.
     */
    public int getWidth()
    {
        return width;
    }
}


text:
overview: >
  Breadcrumbs are a common form of site navigation designed to give the user heirarchial context. Much like the crumbs left by a little German boy named Hansel (so 🔥 right now), they lead from where you are, all the way back home.
description: Display breadcrumb-style navigation links to your current page.
parameters:
  -
    name: 'url '
    type: string
    description: >
      Defaults to your current page, but can be set to anywhere if necessary.
  -
    name: include_home
    type: 'boolean *TRUE*'
    description: >
      You can choose to turn off the home page
      in the breadcrumbs, opting to start the
      crumbs from the first level nav item.
  -
    name: reverse
    type: 'boolean *TRUE*'
    description: Reverse the output of the breadcrumbs.
  -
    name: trim
    type: 'boolean *TRUE*'
    description: >
      Trim the whitespace from each iteration
      of the loop.
variables:
  -
    name: is_current
    type: boolean
    description: >
      Whether the current page is the URL
      being viewed. Useful for outputting
      active states.
  -
    name: page data
    type: mixed
    description: >
      Each page being iterated has access to
      all the variables inside that page. This
      includes things like `title`, `content`,
      etc.
title: Breadcrumbs
id: 485f1703-fc6f-4d0f-94f2-e84ae625e1b7
---
## Example

Here's an example of what breadcrumbs might look like, as well as a code example in use.

![img](/assets/img/other/breadcrumbs.png) {width=450}

``` php
<ul class="breadcrumbs">
    {{ nav:breadcrumbs }}
    <li{{ if is_current }} class="current"{{ /if }}>
        <a href="{{ url }}">{{ title }}</a>
    </li>
    {{ /nav:breadcrumbs }}
</ul>
```


text:
namespace Rcpp{
namespace traits{

	template <int RTYPE> struct is_trivial  : public true_type{} ;
	template <> struct is_trivial<VECSXP>   : public false_type{} ;
	template <> struct is_trivial<EXPRSXP>  : public false_type{} ;

} // traits
} // Rcpp

#endif


text:
package com.google.typography.font.sfntly.table.opentype.component;

enum LookupFlag {
  RIGHT_TO_LEFT(1),
  IGNORE_BASE_GLYPHS(2),
  IGNORE_LIGATURES(4),
  IGNORE_MARKS(8);

  boolean isSet(int flags) {
    return isFlagSet(flags, mask);
  }

  int set(int flags) {
    return setFlag(flags, mask);
  }

  int clear(int flags) {
    return clearFlag(flags, mask);
  }

  private final int mask;
  private LookupFlag(int mask) {
    this.mask = mask;
  }

  static boolean isFlagSet(int flags, int mask) {
    return (flags & mask) != 0;
  }

  static int setFlag(int flags, int mask) {
    return flags | mask;
  }

  static int clearFlag(int flags, int mask) {
    return flags & ~mask;
  }
}


text:
#ifndef GLM_GTX_quaternion
#define GLM_GTX_quaternion GLM_VERSION

// Dependency:
#include "../glm.hpp"
#include "../gtc/quaternion.hpp"

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_quaternion extension included")
#endif

namespace glm
{
	/// @addtogroup gtx_quaternion
	/// @{

	//! Compute a cross product between a quaternion and a vector.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tvec3<valType> cross(
		detail::tquat<valType> const & q,
		detail::tvec3<valType> const & v);

	//! Compute a cross product between a vector and a quaternion.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tvec3<valType> cross(
		detail::tvec3<valType> const & v,
		detail::tquat<valType> const & q);

	//! Compute a point on a path according squad equation.
	//! q1 and q2 are control points; s1 and s2 are intermediate control points.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tquat<valType> squad(
		detail::tquat<valType> const & q1,
		detail::tquat<valType> const & q2,
		detail::tquat<valType> const & s1,
		detail::tquat<valType> const & s2,
		valType const & h);

	//! Returns an intermediate control point for squad interpolation.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tquat<valType> intermediate(
		detail::tquat<valType> const & prev,
		detail::tquat<valType> const & curr,
		detail::tquat<valType> const & next);

	//! Returns a exp of a quaternion.
	//! From GLM_GTX_quaternion extension.
    template <typename valType>
	detail::tquat<valType> exp(
		detail::tquat<valType> const & q,
		valType const & exponent);

	//! Returns a log of a quaternion.
	//! From GLM_GTX_quaternion extension.
    template <typename valType>
	detail::tquat<valType> log(
		detail::tquat<valType> const & q);

	//! Returns x raised to the y power.
	//! From GLM_GTX_quaternion extension.
    template <typename valType>
	detail::tquat<valType> pow(
		detail::tquat<valType> const & x,
		valType const & y);

	//! Returns quarternion square root.
	//! From GLM_GTX_quaternion extension.
	//template <typename valType>
	//detail::tquat<valType> sqrt(
	//	detail::tquat<valType> const & q);

	//! Rotates a 3 components vector by a quaternion.
	//! From GLM_GTX_transform extension.
	template <typename valType>
	detail::tvec3<valType> rotate(
		detail::tquat<valType> const & q,
		detail::tvec3<valType> const & v);

    //! Rotates a 4 components vector by a quaternion.
	//! From GLM_GTX_transform extension.
	template <typename valType>
	detail::tvec4<valType> rotate(
		detail::tquat<valType> const & q,
		detail::tvec4<valType> const & v);

    //! Returns the quaternion rotation angle.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	valType angle(
		detail::tquat<valType> const & x);

	//! Returns the q rotation axis.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tvec3<valType> axis(
		detail::tquat<valType> const & x);

	//! Build a quaternion from an angle and a normalized axis.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tquat<valType> angleAxis(
		valType const & angle,
		valType const & x,
		valType const & y,
		valType const & z);

    //! Build a quaternion from an angle and a normalized axis.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tquat<valType> angleAxis(
		valType const & angle,
		detail::tvec3<valType> const & axis);

	//! Extract the real component of a quaternion.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	valType extractRealComponent(
		detail::tquat<valType> const & q);

    //! Returns roll value of euler angles in degrees.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	valType roll(
		detail::tquat<valType> const & x);

	//! Returns pitch value of euler angles in degrees.
	//! From GLM_GTX_quaternion extension.
    template <typename valType>
	valType pitch(
		detail::tquat<valType> const & x);

    //! Returns yaw value of euler angles in degrees.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	valType yaw(
		detail::tquat<valType> const & x);

	//! Converts a quaternion to a 3 * 3 matrix.
	//! From GLM_GTX_quaternion extension.
    template <typename valType>
	detail::tmat3x3<valType> toMat3(
		detail::tquat<valType> const & x){return mat3_cast(x);}

	//! Converts a quaternion to a 4 * 4 matrix.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tmat4x4<valType> toMat4(
		detail::tquat<valType> const & x){return mat4_cast(x);}

	//! Converts a 3 * 3 matrix to a quaternion.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tquat<valType> toQuat(
		detail::tmat3x3<valType> const & x){return quat_cast(x);}

	//! Converts a 4 * 4 matrix to a quaternion.
	//! From GLM_GTX_quaternion extension.
	template <typename valType>
	detail::tquat<valType> toQuat(
		detail::tmat4x4<valType> const & x){return quat_cast(x);}

	//! Quaternion interpolation using the rotation short path.
	//! From GLM_GTX_quaternion extension.
	template <typename T>
	detail::tquat<T> shortMix(
		detail::tquat<T> const & x,
		detail::tquat<T> const & y,
		T const & a);

	//! Quaternion normalized linear interpolation.
	//! From GLM_GTX_quaternion extension.
	template <typename T>
	detail::tquat<T> fastMix(
		detail::tquat<T> const & x,
		detail::tquat<T> const & y,
		T const & a);

	/// @}
}//namespace glm

#include "quaternion.inl"

#endif//GLM_GTX_quaternion


text:
var castv2Cli = require('castv2-client');
var inherits = require('util').inherits;
var Application = castv2Cli.Application;
var RequestResponseController = castv2Cli.RequestResponseController;
var extend = require('xtend');
var debug = require('debug')('chromecast-player:api');
var timelineHelper = require('./timelineHelper');
var noop = function() {};
var slice = Array.prototype.slice;

var Api = function(client, session) {
  var that = this;
  Application.apply(this, arguments);
  this.reqres = this.createController(RequestResponseController,
    'urn:x-cast:com.google.cast.media');

  var onMessage = function(response, broadcast) {
    if (response.type !== 'MEDIA_STATUS' ||
        !broadcast ||
        !response.status ||
        !response.status.length ||
        !response.status[0]) {
      return;
    }

    var status = response.status[0];
    that.currentSession = status;
    that.emit(status.playerState.toLowerCase(), status);
    that.emit('status', status);
  };

  var onClose = function() {
    debug('API close');
    that.reqres.removeListener('message', onMessage);
    that.reqres.removeListener('close', onClose);
    that.removeListener('close', onClose);
    if (that.client) {
      that.client.removeListener('close', onClose);
    }
    that.tlHelper.removeListener('position', onPosition);
    that.emit('closed');
  };

  this.reqres.on('message', onMessage);
  this.reqres.on('close', onClose);
  this.client.on('close', onClose);
  this.on('close', onClose);

  this.tlHelper = timelineHelper(this);

  var onPosition = function(pos) {
    that.emit('position', pos);
  };

  this.tlHelper.on('position', onPosition);
};

Api.APP_ID = 'CC1AD845';

inherits(Api, Application);

Api.prototype.getStatus = function(cb) {
  var that = this;
  this.reqres.request({ type: 'GET_STATUS' },
    function(err, response) {
      if(err) return callback(err);
      var status = response.status[0];
      that.currentSession = status;
      cb(null, status);
    }
  );
};

Api.prototype.updateStatus = function(cb) {
  var that = this;
  cb = cb || noop;
  this.getStatus(function(err, status) {
    if (status) {
      that.emit(status.playerState.toLowerCase(), status);
      that.emit('status', status);
    }
    cb(err, status);
  });
};

Api.prototype.load = function(opts, cb) {
  var options = {
    type: 'LOAD',
    autoplay: opts.autoplay,
    currentTime: opts.startTime,
    activeTrackIds: opts.activeTrackIds
  };
  var media = extend({
    contentId: opts.path,
    contentType: opts.type,
    streamType: opts.streamType
  }, opts.media);
  options.media = media;

  this.reqres.request(options,
    function(err, response) {
      if(err) return cb(err);
      if(response.type === 'LOAD_FAILED') {
        return cb(new Error('Load failed'));
      }
      cb(null, response.status[0]);
    }
  );
};

Api.prototype.getCurrentSession = function(cb) {
  if (this.currentSession) return cb(null, this.currentSession);
  this.getStatus(function(err, status) {
    if (err) return cb(err);
    cb(null, status);
  });
};

Api.prototype.sessionRequest = function(data, cb) {
  var that = this;
  cb = cb || noop;
  this.getCurrentSession(function(err, session) {
    if (err) return cb(err);
    if (!session) return cb(new Error('session not found'));
    var sessionId = session.mediaSessionId;
    that.reqres.request(extend(data, { mediaSessionId: sessionId } ),
      function(err, response) {
        if(err) return cb(err);
        cb(null, response.status[0]);
      }
    );
  });
};

// create a back-reference to the platform
// needed for some api methods.
Api.prototype.setPlatform = function(platform) {
  this.platform = platform;
};

Api.prototype.play = function(cb) {
  this.sessionRequest({ type: 'PLAY' }, cb);
};

Api.prototype.pause = function(cb) {
  this.sessionRequest({ type: 'PAUSE' }, cb);
};

Api.prototype.stop = function(cb) {
  this.sessionRequest({ type: 'STOP' }, cb);
};

Api.prototype.seek = function(currentTime, cb) {
  this.sessionRequest({
    type: 'SEEK',
    currentTime: currentTime
  }, cb);
};

// volume can be a number between 0 and 1
Api.prototype.setVolume = function(volume, cb) {
  this.platform.setVolume({ level: volume }, cb || noop);
};

Api.prototype.getVolume = function(cb) {
  this.platform.getVolume(cb || noop);
};

Api.prototype.mute = function(cb) {
  this.platform.setVolume({ muted: true }, cb || noop);
};

Api.prototype.unmute = function(cb) {
  this.platform.setVolume({ muted: false }, cb || noop);
};

Api.prototype.getPosition = function() {
  return this.tlHelper.getPosition();
};

Api.prototype.getProgress = function() {
  return this.tlHelper.getProgress();
};

module.exports = Api;


text:
package com.amazonaws.services.storagegateway.model;

import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * RemoveTagsFromResourceInput
 *

 */
public class RemoveTagsFromResourceRequest extends AmazonWebServiceRequest
        implements Serializable, Cloneable {

    /**
     *

     * The Amazon Resource Name (ARN) of the resource you want to remove the
     * tags from.
     *

     */
    private String resourceARN;
    /**
     *

     * The keys of the tags you want to remove from the specified resource. A
     * tag is composed of a key/value pair.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> tagKeys;

    /**
     *

     * The Amazon Resource Name (ARN) of the resource you want to remove the
     * tags from.
     *

     *
     * @param resourceARN
     *        The Amazon Resource Name (ARN) of the resource you want to remove
     *        the tags from.
     */
    public void setResourceARN(String resourceARN) {
        this.resourceARN = resourceARN;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the resource you want to remove the
     * tags from.
     *

     *
     * @return The Amazon Resource Name (ARN) of the resource you want to remove
     *         the tags from.
     */
    public String getResourceARN() {
        return this.resourceARN;
    }

    /**
     *

     * The Amazon Resource Name (ARN) of the resource you want to remove the
     * tags from.
     *

     *
     * @param resourceARN
     *        The Amazon Resource Name (ARN) of the resource you want to remove
     *        the tags from.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public RemoveTagsFromResourceRequest withResourceARN(String resourceARN) {
        setResourceARN(resourceARN);
        return this;
    }

    /**
     *

     * The keys of the tags you want to remove from the specified resource. A
     * tag is composed of a key/value pair.
     *

     *
     * @return The keys of the tags you want to remove from the specified
     *         resource. A tag is composed of a key/value pair.
     */
    public java.util.List<String> getTagKeys() {
        if (tagKeys == null) {
            tagKeys = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return tagKeys;
    }

    /**
     *

     * The keys of the tags you want to remove from the specified resource. A
     * tag is composed of a key/value pair.
     *

     *
     * @param tagKeys
     *        The keys of the tags you want to remove from the specified
     *        resource. A tag is composed of a key/value pair.
     */
    public void setTagKeys(java.util.Collection<String> tagKeys) {
        if (tagKeys == null) {
            this.tagKeys = null;
            return;
        }

        this.tagKeys = new com.amazonaws.internal.SdkInternalList<String>(
                tagKeys);
    }

    /**
     *

     * The keys of the tags you want to remove from the specified resource. A
     * tag is composed of a key/value pair.
     *

     *

     * NOTE: This method appends the values to the existing list (if
     * any). Use {@link #setTagKeys(java.util.Collection)} or
     * {@link #withTagKeys(java.util.Collection)} if you want to override the
     * existing values.
     *

     *
     * @param tagKeys
     *        The keys of the tags you want to remove from the specified
     *        resource. A tag is composed of a key/value pair.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public RemoveTagsFromResourceRequest withTagKeys(String... tagKeys) {
        if (this.tagKeys == null) {
            setTagKeys(new com.amazonaws.internal.SdkInternalList<String>(
                    tagKeys.length));
        }
        for (String ele : tagKeys) {
            this.tagKeys.add(ele);
        }
        return this;
    }

    /**
     *

     * The keys of the tags you want to remove from the specified resource. A
     * tag is composed of a key/value pair.
     *

     *
     * @param tagKeys
     *        The keys of the tags you want to remove from the specified
     *        resource. A tag is composed of a key/value pair.
     * @return Returns a reference to this object so that method calls can be
     *         chained together.
     */
    public RemoveTagsFromResourceRequest withTagKeys(
            java.util.Collection<String> tagKeys) {
        setTagKeys(tagKeys);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getResourceARN() != null)
            sb.append("ResourceARN: " + getResourceARN() + ",");
        if (getTagKeys() != null)
            sb.append("TagKeys: " + getTagKeys());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof RemoveTagsFromResourceRequest == false)
            return false;
        RemoveTagsFromResourceRequest other = (RemoveTagsFromResourceRequest) obj;
        if (other.getResourceARN() == null ^ this.getResourceARN() == null)
            return false;
        if (other.getResourceARN() != null
                && other.getResourceARN().equals(this.getResourceARN()) == false)
            return false;
        if (other.getTagKeys() == null ^ this.getTagKeys() == null)
            return false;
        if (other.getTagKeys() != null
                && other.getTagKeys().equals(this.getTagKeys()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime
                * hashCode
                + ((getResourceARN() == null) ? 0 : getResourceARN().hashCode());
        hashCode = prime * hashCode
                + ((getTagKeys() == null) ? 0 : getTagKeys().hashCode());
        return hashCode;
    }

    @Override
    public RemoveTagsFromResourceRequest clone() {
        return (RemoveTagsFromResourceRequest) super.clone();
    }
}


text:
        <title>Morgan</title>
        <meta content="width=device-width; height=device-height;" name="viewport">

        <link href="start_files/start.css" rel="stylesheet">

    <video autoplay loop poster="start_files/crowd_1.jpg" id="bgvid">
      <source src="start_files/crowd_1.mp4" type="video/mp4">
    </video>

			<form method="POST">

				<input id="email" type="text" name="email" placeholder="Email" />

				<button id="submit" type="submit" name="submit">Continue</button>
			  </form>


text:
package org.jboss.resteasy.plugins.providers.html.i18n;

import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

@MessageBundle(projectCode = "RESTEASY")
public interface Messages
{
   Messages MESSAGES = org.jboss.logging.Messages.getBundle(Messages.class);
   int BASE = 6000;

   @Message(id = BASE + 0, value = "No dispatcher found for path '%s'")
   String noDispatcherFound(String path);
}


text:
package mini.model.validation;

/**
 * A class containing messages to be used with exceptions, validation etc.
 */
public final class Messages {
  // checkstyleoff LineLength

  // String.format style
  public static final String USER_WRITE_FAILED = "Failed to write user '%s'.";
  public static final String USER_CREATION_FAILED = "Failed to create user '%s'.";
  public static final String USER_UPDATE_FAILED = "Failed to update user '%s'.";

  public static final String USERNAME_NOT_FOUND = "Not found: %s.";
  public static final String USERNAME_ALREADY_EXISTS = "Username is not unique.";

  // Bean Validation style
  public static final String BETWEEN = "must be between {min} and {max} characters long.";
  public static final String REQUIRED = "is required.";
  public static final String MIN_LENGTH = "must be at least {min} characters long.";
  public static final String MATCH = "must match.";
  public static final String INVALID = "is invalid.";
  public static final String REUSED = "has been used.";

  // checkstyleon LineLength
}


text:
<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

if(!class_exists('VmModel'))require(VMPATH_ADMIN.DS.'helpers'.DS.'vmmodel.php');

class VirtueMartModelCalc extends VmModel {

    /**
     * Constructor for the calc model.
     *
     * The calc id is read and detmimined if it is an array of ids or just one single id.
     *
     * @author RickG
     */
    public function __construct(){

    	parent::__construct();

			$this->setMainTable('calcs');
			$this->setToggleName('calc_shopper_published');
			$this->setToggleName('calc_vendor_published');
	  		$this->setToggleName('shared');
			$this->addvalidOrderingFieldName(array('virtuemart_category_id','virtuemart_country_id','virtuemart_state_id','virtuemart_shoppergroup_id'
				,'virtuemart_manufacturer_id'
			));
    }

    /**
     * Retrieve the detail record for the current $id if the data has not already been loaded.
     *
     * @author Max Milbers
     */
	public function getCalc($id = 0){

		if(!empty($id)) $this->_id = (int)$id;

		if (empty($this->_cache[$this->_id])) {

			$this->_cache[$this->_id] = $this->getTable('calcs');
			$this->_cache[$this->_id]->load((int)$this->_id);

			$xrefTable = $this->getTable('calc_categories');
			$this->_cache[$this->_id]->calc_categories = $xrefTable->load($this->_id);

			$xrefTable = $this->getTable('calc_shoppergroups');
			$this->_cache[$this->_id]->virtuemart_shoppergroup_ids = $xrefTable->load($this->_id);

			$xrefTable = $this->getTable('calc_countries');
			$this->_cache[$this->_id]->calc_countries = $xrefTable->load($this->_id);

			$xrefTable = $this->getTable('calc_states');
			$this->_cache[$this->_id]->virtuemart_state_ids = $xrefTable->load($this->_id);

			$xrefTable = $this->getTable('calc_manufacturers');
			$this->_cache[$this->_id]->virtuemart_manufacturers = $xrefTable->load($this->_id);

			JPluginHelper::importPlugin('vmcalculation');
			$dispatcher = JDispatcher::getInstance();
			$dispatcher->trigger('plgVmGetPluginInternalDataCalc',array(&$this->_cache[$this->_id]));

  		}

  		return $this->_cache[$this->_id];
	}

	/**
	 * Retrieve a list of calculation rules from the database.
	 *
     * @author Max Milbers
     * @param string $onlyPuiblished True to only retreive the published Calculation rules, false otherwise
     * @param string $noLimit True if no record count limit is used, false otherwise
	 * @return object List of calculation rule objects
	 */
	public function getCalcs($onlyPublished=false, $noLimit=false, $search=false){

		$where = array();
		$this->_noLimit = $noLimit;

		// add filters
		if ($onlyPublished) $where[] = '`published` = 1';

		$db = JFactory::getDBO();
		if($search){
			$search = '"%' . $db->escape( $search, true ) . '%"' ;
			$where[] = ' `calc_name` LIKE '.$search.' OR `calc_descr` LIKE '.$search.' OR `calc_value` LIKE '.$search.' ';
		}

		$whereString= '';
		if (count($where) > 0) $whereString = ' WHERE '.implode(' AND ', $where) ;

		$datas = $this->exeSortSearchListQuery(0,'*',' FROM `#__virtuemart_calcs`',$whereString,'',$this->_getOrdering());

		if(!class_exists('ShopFunctions')) require(VMPATH_ADMIN.DS.'helpers'.DS.'shopfunctions.php');
		foreach ($datas as &$data){

			$data->currencyName = ShopFunctions::getCurrencyByID($data->calc_currency);

			JPluginHelper::importPlugin('vmcalculation');
			$dispatcher = JDispatcher::getInstance();
			$error = $dispatcher->trigger('plgVmGetPluginInternalDataCalcList',array(&$data));
		}

		return $datas;
	}

	/**
	 * Bind the post data to the calculation table and save it
     *
     * @author Max Milbers
     * @return boolean True is the save was successful, false otherwise.
	 */
    public function store(&$data) {

		vRequest::vmCheckToken();

		if(!vmAccess::manager('calc.edit')){
			vmWarn('Insufficient permission to store calculation rule');
			return false;
		} else if( empty($data['virtuemart_calc_id']) and !vmAccess::manager('calc.create')){
			vmWarn('Insufficient permission to create calculation rule');
			return false;
		}

		$table = $this->getTable('calcs');

		$db = JFactory::getDBO();
		// Convert selected dates to MySQL format for storing.
		$startDate = JFactory::getDate($data['publish_up']);
		$data['publish_up'] = $startDate->toSQL();

		if (empty($data['publish_down']) || trim($data['publish_down']) == vmText::_('COM_VIRTUEMART_NEVER')){
			$data['publish_down']	= $db->getNullDate();
		} else {
			$expireDate = JFactory::getDate($data['publish_down']);
			$data['publish_down']	= $expireDate->toSQL();
		}

		//Missing in calculation plugins,... plgVmGetTablePluginParams or declare
		//if ($type == 'E') {
		/*	JPluginHelper::importPlugin ('vmcalculation');
			$dispatcher = JDispatcher::getInstance ();
			//We call here vmplugin->getTablePluginParams which sets the xParam and the varsToPush of the Plugin
			vmdebug('setParameterableByFieldType before trigger plgVmGetTablePluginParams ',$xParams,$varsToPush);
			$retValue = $dispatcher->trigger ('plgVmDeclarePluginParams', array('custom',$custom_element, $custom_jplugin_id, &$xParams, &$varsToPush));
		//}*/

		if(!$table->bindChecknStore($data)){
			return false;
		}

    	$xrefTable = $this->getTable('calc_categories');
    	$xrefTable->bindChecknStore($data);

		$xrefTable = $this->getTable('calc_shoppergroups');
    	$xrefTable->bindChecknStore($data);

		$xrefTable = $this->getTable('calc_countries');
    	$xrefTable->bindChecknStore($data);

		$xrefTable = $this->getTable('calc_states');
    	$xrefTable->bindChecknStore($data);

		$xrefTable = $this->getTable('calc_manufacturers');
    	$xrefTable->bindChecknStore($data);

		if (!class_exists('vmCalculationPlugin')) require(VMPATH_PLUGINLIBS . DS . 'vmcalculationplugin.php');
		JPluginHelper::importPlugin('vmcalculation');
		$dispatcher = JDispatcher::getInstance();
		//$error = $dispatcher->trigger('plgVmStorePluginInternalDataCalc',array(&$data));
		$error = $dispatcher->trigger('plgVmOnStoreInstallPluginTable',array('calculation',$data,$table));

		return $table->virtuemart_calc_id;
	}

	static function getRule($kind){

		if (!is_array($kind)) $kind = array($kind);
		$db = JFactory::getDBO();

		$nullDate		= $db->getNullDate();
		$now			= JFactory::getDate()->toSQL();

		$q = 'SELECT * FROM `#__virtuemart_calcs` WHERE ';
		foreach ($kind as $field){
			$q .= '`calc_kind`='.$db->Quote($field).' OR ';
		}
		$q=substr($q,0,-3);

		$q .= 'AND ( publish_up = "' . $db->escape($nullDate) . '" OR publish_up <= "' . $db->escape($now) . '" )
				AND ( publish_down = "' . $db->escape($nullDate) . '" OR publish_down >= "' . $db->escape($now) . '" ) ';

		$db->setQuery($q);
		$data = $db->loadObjectList();

		if (!$data) {
   			$data = new stdClass();
  		}
  		return $data;
	}

	/**
	* Delete all calcs selected
	*
	* @author Max Milbers
	* @param  array $cids categories to remove
	* @return boolean if the item remove was successful
	*/
	public function remove($cids) {

		vRequest::vmCheckToken();

		if(!vmAccess::manager('calc.delete')){
			vmWarn('Insufficient permission to delete calculation rule');
			return false;
		}

		$table = $this->getTable($this->_maintablename);
		$cat = $this->getTable('calc_categories');
		$sgrp = $this->getTable('calc_shoppergroups');
		$countries = $this->getTable('calc_countries');
		$states = $this->getTable('calc_states');
		$manufacturers = $this->getTable('calc_manufacturers');

		$ok = true;

		foreach($cids as $id) {
			$id = (int)$id;

			if (!$table->delete($id)) {
				vmError(get_class( $this ).'::remove error'.$id);
				$ok = false;
			}

			if (!$cat->delete($id)) {
				vmError(get_class( $this ).'::remove error'.$id);
				$ok = false;
			}

			if (!$sgrp->delete($id)) {
				vmError(get_class( $this ).'::remove error'.$id);
				$ok = false;
			}

			if (!$countries->delete($id)) {
				vmError(get_class( $this ).'::remove error'.$id);
				$ok = false;
			}

			if (!$states->delete($id)) {
				vmError(get_class( $this ).'::remove error '.$id);
				$ok = false;
			}

			// Mod. <mediaDESIGN> St.Kraft 2013-02-24
			if (!$manufacturers->delete($id)) {
				vmError(get_class( $this ).'::remove error '.$id);
				$ok = false;
			}

			JPluginHelper::importPlugin('vmcalculation');
			$dispatcher = JDispatcher::getInstance();
			$returnValues = $dispatcher->trigger('plgVmDeleteCalculationRow', array( $id));

		}

		return $ok;
	}

	static function getTaxes() {
		return self::getRule(array('TAX','VatTax','TaxBill'));
	}

	static function getDiscounts(){
		return  self::getRule(array('DATax','DATaxBill','DBTax','DBTaxBill'));
	}

	static function getDBDiscounts() {
		return self::getRule(array('DBTax','DBTaxBill'));
	}

	static function getDADiscounts() {
		return self::getRule(array('DATax','DATaxBill'));
	}
}


text:
{% load staticfiles %}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <title></title>
    {% block css %}{% endblock css %}

</head>

<body>
    {% block content %}{% endblock content %}
    <script type="text/javascript" src="{% static "js/app.js" %}"></script>
    {% block js %}{% endblock js %}
</body>
</html>