text:
<?php

namespace Eulogix\Cool\Bundle\CoreBundle\Model\Core\om;

use \Criteria;
use \Exception;
use \ModelCriteria;
use \PDO;
use \Propel;
use \PropelException;
use \PropelObjectCollection;
use \PropelPDO;
use Eulogix\Cool\Bundle\CoreBundle\Model\Core\Lookup;
use Eulogix\Cool\Bundle\CoreBundle\Model\Core\LookupPeer;
use Eulogix\Cool\Bundle\CoreBundle\Model\Core\LookupQuery;

/**
 * @method LookupQuery orderByLookupId($order = Criteria::ASC) Order by the lookup_id column
 * @method LookupQuery orderByDomainName($order = Criteria::ASC) Order by the domain_name column
 * @method LookupQuery orderByValue($order = Criteria::ASC) Order by the value column
 * @method LookupQuery orderByDecIt($order = Criteria::ASC) Order by the dec_it column
 * @method LookupQuery orderByDecEn($order = Criteria::ASC) Order by the dec_en column
 * @method LookupQuery orderByDecEs($order = Criteria::ASC) Order by the dec_es column
 * @method LookupQuery orderByDecPt($order = Criteria::ASC) Order by the dec_pt column
 * @method LookupQuery orderByDecEl($order = Criteria::ASC) Order by the dec_el column
 * @method LookupQuery orderBySortOrder($order = Criteria::ASC) Order by the sort_order column
 * @method LookupQuery orderBySchemaFilter($order = Criteria::ASC) Order by the schema_filter column
 * @method LookupQuery orderByFilter($order = Criteria::ASC) Order by the filter column
 * @method LookupQuery orderByExt($order = Criteria::ASC) Order by the ext column
 *
 * @method LookupQuery groupByLookupId() Group by the lookup_id column
 * @method LookupQuery groupByDomainName() Group by the domain_name column
 * @method LookupQuery groupByValue() Group by the value column
 * @method LookupQuery groupByDecIt() Group by the dec_it column
 * @method LookupQuery groupByDecEn() Group by the dec_en column
 * @method LookupQuery groupByDecEs() Group by the dec_es column
 * @method LookupQuery groupByDecPt() Group by the dec_pt column
 * @method LookupQuery groupByDecEl() Group by the dec_el column
 * @method LookupQuery groupBySortOrder() Group by the sort_order column
 * @method LookupQuery groupBySchemaFilter() Group by the schema_filter column
 * @method LookupQuery groupByFilter() Group by the filter column
 * @method LookupQuery groupByExt() Group by the ext column
 *
 * @method LookupQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method LookupQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method LookupQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method Lookup findOne(PropelPDO $con = null) Return the first Lookup matching the query
 * @method Lookup findOneOrCreate(PropelPDO $con = null) Return the first Lookup matching the query, or a new Lookup object populated from the query conditions when no match is found
 *
 * @method Lookup findOneByDomainName(string $domain_name) Return the first Lookup filtered by the domain_name column
 * @method Lookup findOneByValue(string $value) Return the first Lookup filtered by the value column
 * @method Lookup findOneByDecIt(string $dec_it) Return the first Lookup filtered by the dec_it column
 * @method Lookup findOneByDecEn(string $dec_en) Return the first Lookup filtered by the dec_en column
 * @method Lookup findOneByDecEs(string $dec_es) Return the first Lookup filtered by the dec_es column
 * @method Lookup findOneByDecPt(string $dec_pt) Return the first Lookup filtered by the dec_pt column
 * @method Lookup findOneByDecEl(string $dec_el) Return the first Lookup filtered by the dec_el column
 * @method Lookup findOneBySortOrder(int $sort_order) Return the first Lookup filtered by the sort_order column
 * @method Lookup findOneBySchemaFilter(string $schema_filter) Return the first Lookup filtered by the schema_filter column
 * @method Lookup findOneByFilter(string $filter) Return the first Lookup filtered by the filter column
 * @method Lookup findOneByExt(string $ext) Return the first Lookup filtered by the ext column
 *
 * @method array findByLookupId(int $lookup_id) Return Lookup objects filtered by the lookup_id column
 * @method array findByDomainName(string $domain_name) Return Lookup objects filtered by the domain_name column
 * @method array findByValue(string $value) Return Lookup objects filtered by the value column
 * @method array findByDecIt(string $dec_it) Return Lookup objects filtered by the dec_it column
 * @method array findByDecEn(string $dec_en) Return Lookup objects filtered by the dec_en column
 * @method array findByDecEs(string $dec_es) Return Lookup objects filtered by the dec_es column
 * @method array findByDecPt(string $dec_pt) Return Lookup objects filtered by the dec_pt column
 * @method array findByDecEl(string $dec_el) Return Lookup objects filtered by the dec_el column
 * @method array findBySortOrder(int $sort_order) Return Lookup objects filtered by the sort_order column
 * @method array findBySchemaFilter(string $schema_filter) Return Lookup objects filtered by the schema_filter column
 * @method array findByFilter(string $filter) Return Lookup objects filtered by the filter column
 * @method array findByExt(string $ext) Return Lookup objects filtered by the ext column
 */
abstract class BaseLookupQuery extends ModelCriteria
{
    /**
     * Initializes internal state of BaseLookupQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = null, $modelName = null, $modelAlias = null)
    {
        if (null === $dbName) {
            $dbName = 'cool_db';
        }
        if (null === $modelName) {
            $modelName = 'Eulogix\\Cool\\Bundle\\CoreBundle\\Model\\Core\\Lookup';
        }
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new LookupQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param   LookupQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return LookupQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof LookupQuery) {
            return $criteria;
        }
        $query = new LookupQuery(null, null, $modelAlias);

        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     *
     * $obj  = $c->findPk(12, $con);
     *
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   Lookup|Lookup[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = LookupPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is already in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(LookupPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Alias of findPk to use instance pooling
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return                 Lookup A model object, or null if the key is not found
     * @throws PropelException
     */
     public function findOneByLookupId($key, $con = null)
     {
        return $this->findPk($key, $con);
     }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return                 Lookup A model object, or null if the key is not found
     * @throws PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT lookup_id, domain_name, value, dec_it, dec_en, dec_es, dec_pt, dec_el, sort_order, schema_filter, filter, ext FROM core.lookup WHERE lookup_id = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new Lookup();
            $obj->hydrate($row);
            LookupPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return Lookup|Lookup[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     *
     * $objs = $c->findPks(array(12, 56, 832), $con);
     *
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|Lookup[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Find objects by primary key while maintaining the original sort order of the keys
     *
     * $objs = $c->findPksKeepingKeyOrder(array(12, 56, 832), $con);

     *
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return Lookup[]
     */
    public function findPksKeepingKeyOrder($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $ret = array();

        foreach($keys as $key)
            $ret[ $key ] = $this->findPk($key, $con);

        return $ret;
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(LookupPeer::LOOKUP_ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(LookupPeer::LOOKUP_ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the lookup_id column
     *
     * Example usage:
     *
     * $query->filterByLookupId(1234); // WHERE lookup_id = 1234
     * $query->filterByLookupId(array(12, 34)); // WHERE lookup_id IN (12, 34)
     * $query->filterByLookupId(array('min' => 12)); // WHERE lookup_id >= 12
     * $query->filterByLookupId(array('max' => 12)); // WHERE lookup_id <= 12
     *
     *
     * @param     mixed $lookupId The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByLookupId($lookupId = null, $comparison = null)
    {
        if (is_array($lookupId)) {
            $useMinMax = false;
            if (isset($lookupId['min'])) {
                $this->addUsingAlias(LookupPeer::LOOKUP_ID, $lookupId['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lookupId['max'])) {
                $this->addUsingAlias(LookupPeer::LOOKUP_ID, $lookupId['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(LookupPeer::LOOKUP_ID, $lookupId, $comparison);
    }

    /**
     * Filter the query on the domain_name column
     *
     * Example usage:
     *
     * $query->filterByDomainName('fooValue');   // WHERE domain_name = 'fooValue'
     * $query->filterByDomainName('%fooValue%'); // WHERE domain_name LIKE '%fooValue%'
     *
     *
     * @param     string $domainName The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByDomainName($domainName = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($domainName)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $domainName)) {
                $domainName = str_replace('*', '%', $domainName);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::DOMAIN_NAME, $domainName, $comparison);
    }

    /**
     * Filter the query on the value column
     *
     * Example usage:
     *
     * $query->filterByValue('fooValue');   // WHERE value = 'fooValue'
     * $query->filterByValue('%fooValue%'); // WHERE value LIKE '%fooValue%'
     *
     *
     * @param     string $value The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByValue($value = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($value)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $value)) {
                $value = str_replace('*', '%', $value);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::VALUE, $value, $comparison);
    }

    /**
     * Filter the query on the dec_it column
     *
     * Example usage:
     *
     * $query->filterByDecIt('fooValue');   // WHERE dec_it = 'fooValue'
     * $query->filterByDecIt('%fooValue%'); // WHERE dec_it LIKE '%fooValue%'
     *
     *
     * @param     string $decIt The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByDecIt($decIt = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($decIt)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $decIt)) {
                $decIt = str_replace('*', '%', $decIt);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::DEC_IT, $decIt, $comparison);
    }

    /**
     * Filter the query on the dec_en column
     *
     * Example usage:
     *
     * $query->filterByDecEn('fooValue');   // WHERE dec_en = 'fooValue'
     * $query->filterByDecEn('%fooValue%'); // WHERE dec_en LIKE '%fooValue%'
     *
     *
     * @param     string $decEn The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByDecEn($decEn = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($decEn)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $decEn)) {
                $decEn = str_replace('*', '%', $decEn);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::DEC_EN, $decEn, $comparison);
    }

    /**
     * Filter the query on the dec_es column
     *
     * Example usage:
     *
     * $query->filterByDecEs('fooValue');   // WHERE dec_es = 'fooValue'
     * $query->filterByDecEs('%fooValue%'); // WHERE dec_es LIKE '%fooValue%'
     *
     *
     * @param     string $decEs The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByDecEs($decEs = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($decEs)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $decEs)) {
                $decEs = str_replace('*', '%', $decEs);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::DEC_ES, $decEs, $comparison);
    }

    /**
     * Filter the query on the dec_pt column
     *
     * Example usage:
     *
     * $query->filterByDecPt('fooValue');   // WHERE dec_pt = 'fooValue'
     * $query->filterByDecPt('%fooValue%'); // WHERE dec_pt LIKE '%fooValue%'
     *
     *
     * @param     string $decPt The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByDecPt($decPt = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($decPt)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $decPt)) {
                $decPt = str_replace('*', '%', $decPt);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::DEC_PT, $decPt, $comparison);
    }

    /**
     * Filter the query on the dec_el column
     *
     * Example usage:
     *
     * $query->filterByDecEl('fooValue');   // WHERE dec_el = 'fooValue'
     * $query->filterByDecEl('%fooValue%'); // WHERE dec_el LIKE '%fooValue%'
     *
     *
     * @param     string $decEl The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByDecEl($decEl = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($decEl)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $decEl)) {
                $decEl = str_replace('*', '%', $decEl);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::DEC_EL, $decEl, $comparison);
    }

    /**
     * Filter the query on the sort_order column
     *
     * Example usage:
     *
     * $query->filterBySortOrder(1234); // WHERE sort_order = 1234
     * $query->filterBySortOrder(array(12, 34)); // WHERE sort_order IN (12, 34)
     * $query->filterBySortOrder(array('min' => 12)); // WHERE sort_order >= 12
     * $query->filterBySortOrder(array('max' => 12)); // WHERE sort_order <= 12
     *
     *
     * @param     mixed $sortOrder The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterBySortOrder($sortOrder = null, $comparison = null)
    {
        if (is_array($sortOrder)) {
            $useMinMax = false;
            if (isset($sortOrder['min'])) {
                $this->addUsingAlias(LookupPeer::SORT_ORDER, $sortOrder['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($sortOrder['max'])) {
                $this->addUsingAlias(LookupPeer::SORT_ORDER, $sortOrder['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(LookupPeer::SORT_ORDER, $sortOrder, $comparison);
    }

    /**
     * Filter the query on the schema_filter column
     *
     * Example usage:
     *
     * $query->filterBySchemaFilter('fooValue');   // WHERE schema_filter = 'fooValue'
     * $query->filterBySchemaFilter('%fooValue%'); // WHERE schema_filter LIKE '%fooValue%'
     *
     *
     * @param     string $schemaFilter The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterBySchemaFilter($schemaFilter = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($schemaFilter)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $schemaFilter)) {
                $schemaFilter = str_replace('*', '%', $schemaFilter);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::SCHEMA_FILTER, $schemaFilter, $comparison);
    }

    /**
     * Filter the query on the filter column
     *
     * Example usage:
     *
     * $query->filterByFilter('fooValue');   // WHERE filter = 'fooValue'
     * $query->filterByFilter('%fooValue%'); // WHERE filter LIKE '%fooValue%'
     *
     *
     * @param     string $filter The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByFilter($filter = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($filter)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $filter)) {
                $filter = str_replace('*', '%', $filter);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::FILTER, $filter, $comparison);
    }

    /**
     * Filter the query on the ext column
     *
     * Example usage:
     *
     * $query->filterByExt('fooValue');   // WHERE ext = 'fooValue'
     * $query->filterByExt('%fooValue%'); // WHERE ext LIKE '%fooValue%'
     *
     *
     * @param     string $ext The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function filterByExt($ext = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($ext)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $ext)) {
                $ext = str_replace('*', '%', $ext);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(LookupPeer::EXT, $ext, $comparison);
    }

    /**
     * Exclude object from result
     *
     * @param   Lookup $lookup Object to remove from the list of results
     *
     * @return LookupQuery The current query, for fluid interface
     */
    public function prune($lookup = null)
    {
        if ($lookup) {
            $this->addUsingAlias(LookupPeer::LOOKUP_ID, $lookup->getLookupId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}


text:
package org.wso2.carbon.cassandra.mgt;

import me.prettyprint.hector.api.ddl.KeyspaceDefinition;
import org.wso2.carbon.cassandra.dataaccess.ClusterInformation;

public class DriverBasedCassandraManager implements CassandraManager {

    @Override
    public String getClusterName() throws CassandraServerManagementException {
        return null;
    }

    @Override
    public String[] getKeyspaces(ClusterInformation cfInfo) throws CassandraServerManagementException {
        return new String[0];
    }

    @Override
    public KeyspaceDefinition getKeyspaceDefinition(String ksName) throws CassandraServerManagementException {
        return null;
    }

    @Override
    public void addColumnFamily(ColumnFamilyInformation cfInfo) throws CassandraServerManagementException {

    }

    @Override
    public void updateColumnFamily(ColumnFamilyInformation cfInfo) throws CassandraServerManagementException {

    }

    @Override
    public boolean deleteKeyspace(String ksName) throws CassandraServerManagementException {
        return false;
    }

    @Override
    public void addKeyspace(KeyspaceInformation ksInfo) throws CassandraServerManagementException {

    }

    @Override
    public void updatedKeyspace(KeyspaceInformation ksInfo) throws CassandraServerManagementException {

    }

    @Override
    public ColumnFamilyInformation getColumnFamilyOfCurrentUser(String ksName, String cfName) throws CassandraServerManagementException {
        return null;
    }

    @Override
    public KeyspaceInformation getKeyspaceofCurrentUser(String ksName) throws CassandraServerManagementException {
        return null;
    }

    @Override
    public String[] listColumnFamiliesOfCurrentUser(String ksName) throws CassandraServerManagementException {
        return new String[0];
    }
}

redpajama_set_name: RedPajamaGithub


text:
from channels.routing import ProtocolTypeRouter, URLRouter
from django.conf.urls import url

from openslides.utils.consumers import SiteConsumer
from openslides.utils.middleware import AuthMiddlewareStack

application = ProtocolTypeRouter(
    {
        # WebSocket chat handler
        "websocket": AuthMiddlewareStack(URLRouter([url(r"^ws/$", SiteConsumer)]))
    }
)


text:
package org.kie.uberfire.client.wizards;

/**
 * An event representing the selection of a page within a Wizard
 */
public class WizardPageSelectedEvent {

    private final WizardPage selectedPage;

    public WizardPageSelectedEvent( final WizardPage selectedPage ) {
        this.selectedPage = selectedPage;
    }

    public WizardPage getSelectedPage() {
        return selectedPage;
    }

}


text:
from dataclasses import dataclass

from utils import utilfuncs, utilities, exitutils
import logsupport
from logsupport import ConsoleWarning, ConsoleError

TriggerTypes = {}

@dataclass
class TriggerRecord:
	Parse: callable
	Arm: callable
	Trig: callable

def getvalid(spec, item, choices, default=None):
	i = spec.get(item, default)
	if i is not None:
		if i in choices:
			return i
		else:
			logsupport.Logs.Log('Choice error: ' + item + " not in " + str(choices), severity=logsupport.ConsoleWarning)
			exitutils.errorexit(exitutils.ERRORDIE)
	else:
		logsupport.Logs.Log('Missing required alert parameter: ' + item, severity=ConsoleWarning)
		exitutils.errorexit(exitutils.ERRORDIE)

import operator

Tests = ['EQ', 'NE', 'GT', 'LT', 'GE', 'LE']  # standard tests 2 operands
TestOps = {x: operator.__dict__[x.lower()] for x in Tests}
Tests = Tests + ['ISNONE', 'ISTRUE', 'ISFALSE']
TestOps['ISNONE'] = lambda arg1, arg2: arg1 is None

def TestTrue(arg1, arg2):
	if arg1 in ('on', 'true', 'yes'): return True
	if isinstance(arg1, int): return arg1 > 0

def TestFalse(arg1, arg2):
	if arg1 in ('off', 'false', 'no'): return True
	if isinstance(arg1, int): return arg1 == 0

TestOps['ISTRUE'] = TestTrue
TestOps['ISFALSE'] = TestFalse

def comparams(cspec):
	ctest = getvalid(cspec, 'Test', Tests)
	cvalue = cspec.get('Value', None)
	cdelay = utilities.get_timedelta(cspec.get('Delay', None))
	return ctest, cvalue, cdelay

def TestCondition(arg1, arg2, test):
	if type(arg1) != type(arg2):
		arg1 = int(arg1) if utilfuncs.RepresentsInt(arg1) else arg1
		arg2 = int(arg2) if utilfuncs.RepresentsInt(arg2) else arg2
	try:
		return TestOps[test](arg1, arg2)
	except TypeError:
		return False
	except KeyError:
		logsupport.Logs.Log('Bad test in IsTrue', test, severity=ConsoleError)
		return False


text:
<?php

namespace frontend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use frontend\models\SolicitudCambio;

/**
 * SolicitudCambioSearch represents the model behind the search form about `frontend\models\SolicitudCambio`.
 */
class SolicitudCambioSearch extends SolicitudCambio
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['ID_CAMBIO', 'ID_ESTADO_CAMBIO', 'CAPACIDAD_CAMBIO'], 'integer'],
            [['ASIGNATURA_CAMBIO', 'SECCION_CAMBIO', 'SALA_CAMBIO', 'DOCENTE_CAMBIO'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = SolicitudCambio::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'ID_CAMBIO' => $this->ID_CAMBIO,
            'ID_ESTADO_CAMBIO' => $this->ID_ESTADO_CAMBIO,
            'CAPACIDAD_CAMBIO' => $this->CAPACIDAD_CAMBIO,
        ]);

        $query->andFilterWhere(['like', 'ASIGNATURA_CAMBIO', $this->ASIGNATURA_CAMBIO])
            ->andFilterWhere(['like', 'SECCION_CAMBIO', $this->SECCION_CAMBIO])
            ->andFilterWhere(['like', 'SALA_CAMBIO', $this->SALA_CAMBIO])
            ->andFilterWhere(['like', 'DOCENTE_CAMBIO', $this->DOCENTE_CAMBIO]);

        return $dataProvider;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Chimera: Member List</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Classes

Files

Directories

Class List

Class Members

ChimeraState Member List
This is the complete list of members for ChimeraState, including all inherited members.

bootstrapMsgStore	ChimeraState

bootstrapMutex	ChimeraState

certificateMutex	ChimeraState

certificateStore	ChimeraState

chimera	ChimeraState

host	ChimeraState

log	ChimeraState

message	ChimeraState

network	ChimeraState

route	ChimeraState

<address style="align: right;">Generated on Thu Feb 16 21:42:40 2006 for Chimera by

 1.4.5 </address>


text:
namespace AssetPackage
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Request Settings.
    /// </summary>
    public class RequestSetttings
    {
        /// <summary>
        /// The method.
        /// </summary>
        public string method;

        /// <summary>
        /// URI of the document.
        /// </summary>
        public Uri uri;

        /// <summary>
        /// The request headers.
        /// </summary>
        public Dictionary<String, String> requestHeaders;

        /// <summary>
        /// The body.
        /// </summary>
        public String body;

        /// <summary>
        /// The allowed responses.
        /// </summary>
        public List<int> allowedResponsCodes;

        /// <summary>
        /// Initializes a new instance of the AssetPackage.requestParameters
        /// class.
        /// </summary>
        public RequestSetttings()
        {
            method = "GET";
            requestHeaders = new Dictionary<String, String>();
            body = String.Empty;
            allowedResponsCodes = new List<int>();
            allowedResponsCodes.Add(200);
        }
    }

    /// <summary>
    /// Response results.
    /// </summary>
    public class RequestResponse : RequestSetttings
    {
        /// <summary>
        /// The response code.
        /// </summary>
        public int responseCode;

        /// <summary>
        /// Message describing the respons.
        /// </summary>
        public string responsMessage;

        /// <summary>
        /// The response headers.
        /// </summary>
        public Dictionary<String, String> responseHeaders;

        /// <summary>
        /// Initializes a new instance of the AssetPackage.RequestResponse class.
        /// </summary>
        public RequestResponse() : base()
        {
            responseCode = 0;
            responsMessage = String.Empty;

            responseHeaders = new Dictionary<String, String>();
        }

        /// <summary>
        /// Initializes a new instance of the AssetPackage.RequestResponse class.
        /// </summary>
        ///
        /// <remarks>
        /// The body is not copied as it will contain thee response body instead.
        /// </remarks>
        ///
        /// <param name="settings"> Options for controlling the operation. </param>
        public RequestResponse(RequestSetttings settings) : this()
        {
            method = settings.method;
            requestHeaders = settings.requestHeaders;
            uri = settings.uri;
            body = String.Empty;

            allowedResponsCodes = settings.allowedResponsCodes;
        }

        /// <summary>
        /// Gets a value indicating whether result is allowed.
        /// </summary>
        ///
        /// <value>
        /// true if result allowed, false if not.
        /// </value>
        public bool ResultAllowed
        {
            get
            {
                return allowedResponsCodes.Contains(responseCode);
            }
        }
    }

    /// <summary>
    /// Interface for web service request.
    /// </summary>
    ///
    /// <remarks>
    /// Implemented on a Bridge.
    /// </remarks>
    public interface IWebServiceRequest
    {
        /// <summary>
        /// Web service request.
        /// </summary>
        ///
        /// <returns>
        /// A RequestResponse.
        /// </returns>
        ///
        /// <param name="requestSettings">  Options for controlling the operation. </param>
        /// <param name="requestResponse"> The request response. </param>
        void WebServiceRequest(RequestSetttings requestSettings, out RequestResponse requestResponse);
    }
}


text:
<?php declare(strict_types=1);

namespace DrdPlus\RollsOn\Traps;

use Granam\DiceRolls\Templates\Rolls\Roll2d6DrdPlus;
use DrdPlus\BaseProperties\Strength;
use DrdPlus\RollsOn\QualityAndSuccess\RollOnQuality;

class RollOnStrength extends RollOnQuality
{
    /**
     * @var Strength
     */
    private $strength;

    public function __construct(Strength $strength, Roll2d6DrdPlus $roll2d6DrdPlus)
    {
        $this->strength = $strength;
        parent::__construct($strength->getValue(), $roll2d6DrdPlus);
    }

    public function getStrength(): Strength
    {
        return $this->strength;
    }
}


text:
{-# LANGUAGE NoMonomorphismRestriction #-}

{-|

 -}
module Main
where

import Diagrams.Prelude
import Diagrams.Backend.SVG.CmdLine

import Diagrams.Swimunit.Dotmatrix

{-|
  MAIN method. Call 'main' to produce output.
 -}
main :: IO ()
main = mainWith (
           let mname = (
                   dotmatrix    defdot dotfont_B6x9 "SWIMUNIT.DOTMATRIX" # fc aqua  # lc dodgerblue
                   <>
                   notdotmatrix defdot dotfont_B6x9 "SWIMUNIT.DOTMATRIX" # fc black # lc darkslategray
                   ) # centerXY
           in mname
               <>
               backgroundrect 1.1 mname
                   # centerXY   -- center background
       )

defdot :: Diagram B
defdot = circle 1.0

{-|
  Define dark background rectangle.
 -}
backgroundrect :: Double
               -> Diagram B
               -> Diagram B
backgroundrect scl diagram = rect ((width diagram) * scl) ((height diagram) * scl)
                               # lc gray
                               # fc black
 --
----
 --


text:
using SendGrid;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SendGrid_Test.Requests
{
    public class GetAllSpamEmailsRequest : Request
    {
        public readonly SendGridClient.Method method;
        public readonly string urlPath;
        public readonly string requestBody = null;
        public readonly string queryParams;

        public GetAllSpamEmailsRequest(SendGridClient.Method method, string urlPath, string queryParams)
        {
            this.method = method;
            this.urlPath = urlPath;
            this.queryParams = queryParams;
        }

        public override SendGridClient.Method Method => method;

        public override string URLPath => urlPath;

        public override string RequestBody => requestBody;

        public override string QueryParams => queryParams;
    }
}


text:
package org.apache.hadoop.hdfs.server.namenode;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.DF;
import org.apache.hadoop.hdfs.DFSConfigKeys;
import org.apache.hadoop.hdfs.DFSUtil;
import org.apache.hadoop.hdfs.HdfsConfiguration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor;
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager;
import org.junit.Test;

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

import static org.junit.Assert.assertTrue;

/**
 * This tests InterDataNodeProtocol for block handling.
 */
public class TestNamenodeCapacityReport {
  private static final Log LOG =
      LogFactory.getLog(TestNamenodeCapacityReport.class);

  /**
   * The following test first creates a file.
   * It verifies the block information from a datanode.
   * Then, it updates the block with new information and verifies again.
   */
  @Test
  public void testVolumeSize() throws Exception {
    Configuration conf = new HdfsConfiguration();
    MiniDFSCluster cluster = null;

    // Set aside fifth of the total capacity as reserved
    long reserved = 10000;
    conf.setLong(DFSConfigKeys.DFS_DATANODE_DU_RESERVED_KEY, reserved);

    try {
      cluster = new MiniDFSCluster.Builder(conf).build();
      cluster.waitActive();

      final FSNamesystem namesystem = cluster.getNamesystem();
      final DatanodeManager dm =
          cluster.getNamesystem().getBlockManager().getDatanodeManager();

      // Ensure the data reported for each data node is right
      final List<DatanodeDescriptor> live = new ArrayList<DatanodeDescriptor>();
      final List<DatanodeDescriptor> dead = new ArrayList<DatanodeDescriptor>();
      dm.fetchDatanodes(live, dead, false);

      assertTrue(live.size() == 1);

      long used, remaining, configCapacity, nonDFSUsed, bpUsed;
      float percentUsed, percentRemaining, percentBpUsed;

      for (final DatanodeDescriptor datanode : live) {
        used = datanode.getDfsUsed();
        remaining = datanode.getRemaining();
        nonDFSUsed = datanode.getNonDfsUsed();
        configCapacity = datanode.getCapacity();
        percentUsed = datanode.getDfsUsedPercent();
        percentRemaining = datanode.getRemainingPercent();
        bpUsed = datanode.getBlockPoolUsed();
        percentBpUsed = datanode.getBlockPoolUsedPercent();

        LOG.info("Datanode configCapacity " + configCapacity + " used " + used +
            " non DFS used " + nonDFSUsed + " remaining " + remaining +
            " perentUsed " + percentUsed + " percentRemaining " +
            percentRemaining);

        assertTrue(configCapacity == (used + remaining + nonDFSUsed));
        assertTrue(percentUsed == DFSUtil.getPercentUsed(used, configCapacity));
        assertTrue(percentRemaining ==
            DFSUtil.getPercentRemaining(remaining, configCapacity));
        assertTrue(
            percentBpUsed == DFSUtil.getPercentUsed(bpUsed, configCapacity));
      }

      DF df = new DF(new File(cluster.getDataDirectory()), conf);

      //
      // Currently two data directories are created by the data node
      // in the MiniDFSCluster. This results in each data directory having
      // capacity equals to the disk capacity of the data directory.
      // Hence the capacity reported by the data node is twice the disk space
      // the disk capacity
      //
      // So multiply the disk capacity and reserved space by two
      // for accommodating it
      //
      int numOfDataDirs = 2;

      long diskCapacity = numOfDataDirs * df.getCapacity();
      reserved *= numOfDataDirs;

      configCapacity = namesystem.getCapacityTotal();
      used = namesystem.getCapacityUsed();
      nonDFSUsed = namesystem.getNonDfsUsedSpace();
      remaining = namesystem.getCapacityRemaining();
      percentUsed = namesystem.getPercentUsed();
      percentRemaining = namesystem.getPercentRemaining();
      bpUsed = namesystem.getBlockPoolUsedSpace();
      percentBpUsed = namesystem.getPercentBlockPoolUsed();

      LOG.info("Data node directory " + cluster.getDataDirectory());

      LOG.info("Name node diskCapacity " + diskCapacity + " configCapacity " +
          configCapacity + " reserved " + reserved + " used " + used +
          " remaining " + remaining + " nonDFSUsed " + nonDFSUsed +
          " remaining " + remaining + " percentUsed " + percentUsed +
          " percentRemaining " + percentRemaining + " bpUsed " + bpUsed +
          " percentBpUsed " + percentBpUsed);

      // Ensure new total capacity reported excludes the reserved space
      assertTrue(configCapacity == diskCapacity - reserved);

      // Ensure new total capacity reported excludes the reserved space
      assertTrue(configCapacity == (used + remaining + nonDFSUsed));

      // Ensure percent used is calculated based on used and present capacity
      assertTrue(percentUsed == DFSUtil.getPercentUsed(used, configCapacity));

      // Ensure percent used is calculated based on used and present capacity
      assertTrue(
          percentBpUsed == DFSUtil.getPercentUsed(bpUsed, configCapacity));

      // Ensure percent used is calculated based on used and present capacity
      assertTrue(percentRemaining ==
          ((float) remaining * 100.0f) / (float) configCapacity);
    } finally {
      if (cluster != null) {
        cluster.shutdown();
      }
    }
  }
}


text:
angular.module("umbraco").controller("UIOMatic.PropertyEditors.MultiPicker",
    function ($scope, $interpolate, editorService, uioMaticObjectResource) {

        $scope.maxItems = $scope.model.config.maxItems || 0;

        $scope.openDialog = function () {

            editorService.open({
                view: '/App_Plugins/UIOMatic/backoffice/views/dialogs/objectsearcher.html',
                show: true,
                size: 'small',

                submit: function (selectedIds) {
                    $scope.selectedIds = selectedIds;
                    editorService.close();
                    getFullDetails();
                },
                close: function () {
                    editorService.close();
                },
                dialogData: {
                    maxItems: $scope.maxItems > 0 ? $scope.maxItems - $scope.selectedIds.length : 0,
                    typeAlias: $scope.model.config.typeAlias,
                    textTemplate: $scope.model.config.textTemplate,
                    selectedIds: $scope.selectedIds,
                    label: $scope.model.label
                },
            });
        }

        $scope.remove = function (index) {
            $scope.items.splice(index, 1);
            $scope.selectedIds.splice(index, 1);
        }

        function getFullDetails() {
            $scope.items = [];
            if ($scope.selectedIds.length > 0) {
                angular.forEach($scope.selectedIds, function (id, idx) {
                    uioMaticObjectResource.getById($scope.model.config.typeAlias, id).then(function (resp) {
                        $scope.items.splice(idx, 0, {
                            id: id,
                            text: $interpolate($scope.model.config.textTemplate)(resp)
                        });
                    });
                });
            }
        }

        function init() {
            $scope.selectedIds = $scope.model.value ? $scope.model.value.toString().split(',') : [];

            getFullDetails();

            $scope.$watch("selectedIds", function () {
                $scope.model.value = $scope.selectedIds ? $scope.selectedIds.join() : undefined;
            }, true);

            // Watch items for sorting
            $scope.$watch(function () {
                return _.map($scope.items, function (i) {
                    return i.id;
                }).join();
            }, function () {
                $scope.selectedIds = _.map($scope.items, function (i) {
                    return i.id;
                });
            });
        }

        init();
    }
);


text:
import { defineMessages } from 'react-intl';

const messages = defineMessages({
  'Password.changePassword': {
    id: 'Password.changePassword',
    description: 'Title',
    defaultMessage: '修改密碼',
  },

  'Password.newPassword.label': {
    id: 'Password.newPassword.label',
    description: 'Label',
    defaultMessage: '新密碼',
  },
  'Password.newPassword.placeholder': {
    id: 'Password.newPassword.placeholder',
    description: 'Placeholder',
    defaultMessage: '輸入新密碼',
  },
  'Password.lengthError': {
    id: 'Password.lengthError',
    defaultMessage: '密碼長度需要長於 8 個字元',
  },

  'Password.newPasswordAgain.label': {
    id: 'Password.newPasswordAgain',
    description: 'Label',
    defaultMessage: '確認密碼',
  },
  'Password.newPasswordAgain.placeholder': {
    id: 'Password.newPasswordAgain.placeholder',
    description: 'Placeholder',
    defaultMessage: '再次輸入新密碼',
  },
  'Password.newPasswordAgain.error': {
    id: 'Password.newPasswordAgain.error',
    defaultMessage: '新密碼和確認密碼不一致',
  },
  'Password.cancel': {
    id: 'Password.cancel',
    defaultMessage: '取消',
  },
  'Password.save': {
    id: 'Password.save',
    defaultMessage: '儲存',
  },
  'Password.success': {
    id: 'Password.success',
    description: 'Toast',
    defaultMessage: '成功!你已經成功修改密碼。',
  },
});

export default messages;


text:
package com.aiteu.dailyreading;

import java.util.Timer;
import java.util.TimerTask;

import org.xml.sax.Parser;

import com.aiteu.dailyreading.book.PageSplitor;
import com.aiteu.dailyreading.dealer.DataParser;
import com.aiteu.dailyreading.handler.MainHandler;
import com.aiteu.dailyreading.update.AppUpdate;
import com.aiteu.dailyreading.view.drawer.SlidingDrawer;
import com.aiteu.dailyreading.view.list.XListView;
import com.aiteu.dailyreading.view.list.XListView.IXListViewListener;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.aiteu.http.util.NetWorkHelper;
import com.aiteu.http.util.PreferenceUtil;
import com.aiteu.log.LogTools;

import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.RelativeLayout;
import android.widget.Toast;

public class MainActivity extends BaseActivity implements IXListViewListener{
	private static final String TAG = MainActivity.class.getSimpleName();

	private AppUpdate mAppUpdate = null;
	private SlidingDrawer mMenuDrawer = null;
	private View mMenuView = null;
	private View mContentView = null;
//	private View splashLay = null;
	private XListView mListView = null;
	private DailyAdapter mAdapter = null;
	//private LoadDailyDataTask mDailyDataTask = null;
	private PageSplitor mPageSplitor = null;
	private NetWorkHelper netWorkHelper;

	private Boolean isWifi;
	private boolean isDoubleClick = false; // 点击两次返回键推出程序

	private RelativeLayout sanwenLayout, qingganLayout, xiaohuaLayout,
			otherLayout, settingLayout;

	//定义数据处理逻辑
	private MainHandler mHandler = null;

	public Handler getHandler(){
		return mHandler;
	}

	public PageSplitor getPageSplitor(){
		return mPageSplitor;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		initViews(); //初始化控件
		mPageSplitor = new PageSplitor();
		mHandler = new MainHandler(this);
		mHandler.initData(); //初始化数据

		mListView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				// TODO Auto-generated method stub
				//list从1开始,因为要加上header
				Intent intent = new Intent(MainActivity.this, ReadPager.class);
				String url = mPageSplitor.getDailyList().get(position-1).getDetailUrl();
				intent.putExtra("URL", url);
				LogTools.getInstance().info(url);
				startActivity(intent);
			}
		});

//		settingLayout.setOnClickListener(new View.OnClickListener() {
//
//			@Override
//			public void onClick(View arg0) {
//				// TODO Auto-generated method stub
//				Intent intent = new Intent(MainActivity.this,
//						SettingActivity.class);
//				startActivity(intent);
//			}
//		});
	}

	private void initViews() {
//		splashLay = findViewById(R.id.welcome_lay_id);
		mListView = (XListView) findViewById(R.id.article_listview);
		mListView.setXListViewListener(this);
		mListView.setPullRefreshEnable(true);
		mListView.setPullLoadEnable(true);
		mAdapter = new DailyAdapter(this);
		mListView.setAdapter(mAdapter);

		// LayoutInflater mInflater = getLayoutInflater();
		// mMenuView = mInflater.inflate(R.layout.main_menu, null);
		// mContentView = mInflater.inflate(R.layout.main_content, null);
		// mMenuDrawer = (SlidingDrawer)findViewById(R.id.drawer_menu);
		// mMenuDrawer.setTouchMode(MenuDrawer.TOUCH_MODE_BEZEL);
		// mMenuDrawer.setContentView(mContentView);
		// mMenuDrawer.setMenuView(mMenuView);
		// mMenuDrawer.setDropShadow(R.drawable.shadow);
		// mMenuDrawer.setDropShadowSize((int) getResources().getDimension(
		// R.dimen.shadow_width));
		// mMenuDrawer.setMaxAnimationDuration(3000);
		// mMenuDrawer.setHardwareLayerEnabled(false);
		// mMenuDrawer.setMenuSize((int) getResources().getDimension(
		// R.dimen.slidingmenu_offset));
		// mMenuDrawer.setTouchBezelSize(50);

//		sanwenLayout = (RelativeLayout) findViewById(R.id.sanwenLayout);
//		qingganLayout = (RelativeLayout) findViewById(R.id.qingganLayout);
//		xiaohuaLayout = (RelativeLayout) findViewById(R.id.xiaohualayout);
//		otherLayout = (RelativeLayout) findViewById(R.id.otherlayout);
//		settingLayout = (RelativeLayout) findViewById(R.id.settinglayout);
	}

	public void showNetworkUnavailable(){
//		splashLay.setVisibility(View.GONE);
	}

	public void showEmpty(){
		mListView.stopRefresh();
		mListView.stopLoadMore();
//		splashLay.setVisibility(View.GONE);
	}

	public void showError(){
//		splashLay.setVisibility(View.GONE);
		mListView.stopRefresh();
		mListView.stopLoadMore();
	}

	public void showDailyList() {
		mListView.stopRefresh();
		mListView.stopLoadMore();
//		splashLay.setVisibility(View.GONE);
		mAdapter.setData(mPageSplitor.getDailyList());
		mAdapter.notifyDataSetChanged();
	}

	//加载最新的数据
	@Override
	public void onRefresh() {
		Log.d(TAG, "onRefresh");
		if(mPageSplitor.getDailyList().isEmpty()){
			mPageSplitor.setLastRefreshTime(0);
		}else{
			mPageSplitor.setLastRefreshTime(PreferenceUtil.getLastRefreshTime(this));
		}
		mPageSplitor.setLoadType(PageSplitor.LOAD_TYPE_REFRESH);
		mPageSplitor.setStart(0);
		mHandler.initData();
	}

	//加载更早的数据
	@Override
	public void onLoadMore() {
		Log.d(TAG, "onLoadMore");
		mPageSplitor.setLoadType(PageSplitor.LOAD_DATA_MORE);
		mHandler.initData();
	}

	Timer mQuitTimer = new Timer();

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		if (event.getAction() == KeyEvent.ACTION_DOWN) {
			if (keyCode == KeyEvent.KEYCODE_BACK) {
				if (!isDoubleClick) {
					isDoubleClick = true;
					Toast.makeText(this, getText(R.string.msg_quit),
							Toast.LENGTH_LONG).show();
					mQuitTimer.schedule(new TimerTask() {

						@Override
						public void run() {
							// TODO Auto-generated method stub
							isDoubleClick = false;
						}
					}, 1500);
				} else {
					exit();
				}
				return true;
			}
		}
		return super.onKeyDown(keyCode, event);
	}
}


text:
/**
 *
 */
package org.bigtester.ate.model.page.atewebdriver;

import org.openqa.selenium.WebDriver;

/**
 * @author peidong
 *
 */
public interface IMyWebDriver2 extends IMyWebDriver {

	/**
	 * Gets the web driver instance.
	 *
	 * @param forceToNew the force to new
	 * @return the web driver instance
	 */
	WebDriver getWebDriverInstance(boolean forceToNew);
}


text:
Activate current process window.

## Installation

Add this line to your application's Gemfile:

    gem 'win32-activate'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install win32-activate

## Usage

execute
     ruby -r rubygems -r win32/activate -e "system('notepad.exe');Win32::Activate.active"

after user close notepad window, command line window is activate

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
> mkdir raw && node downloadPlayers && node downloadGames && node parseGames

# todo

-[x] De dupe 'S. Curry'
-[x] run off of season/player/team spreadsheet
-[x] rotate
-[x] try sm
-[ ] validate against mp
-[ ] check ot display
-[ ] try line graph of last 5 min
-[ ] correct secounds getting shaved off of subs


text:
package org.apache.flink.streaming.tests.verify;

import org.apache.flink.api.common.state.State;
import org.apache.flink.api.common.state.StateDescriptor;
import org.apache.flink.api.common.state.StateTtlConfig;
import org.apache.flink.api.common.typeutils.TypeSerializer;
import org.apache.flink.runtime.state.FunctionInitializationContext;
import org.apache.flink.util.StringUtils;

import javax.annotation.Nonnull;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Random;

/** Base class for State TTL verifiers. */
abstract class AbstractTtlStateVerifier<D extends StateDescriptor<S, SV>, S extends State, SV, UV, GV>
	implements TtlStateVerifier<UV, GV> {
	static final Random RANDOM = new Random();

	@Nonnull
	final D stateDesc;

	AbstractTtlStateVerifier(@Nonnull D stateDesc) {
		this.stateDesc = stateDesc;
	}

	@Nonnull
	static String randomString() {
		return StringUtils.getRandomString(RANDOM, 2, 20);
	}

	@SuppressWarnings("unchecked")
	@Override
	@Nonnull
	public State createState(@Nonnull FunctionInitializationContext context, @Nonnull StateTtlConfig ttlConfig) {
		stateDesc.enableTimeToLive(ttlConfig);
		return createState(context);
	}

	abstract State createState(FunctionInitializationContext context);

	@SuppressWarnings("unchecked")
	@Override
	@Nonnull
	public TypeSerializer<UV> getUpdateSerializer() {
		return (TypeSerializer<UV>) stateDesc.getSerializer();
	}

	@SuppressWarnings("unchecked")
	@Override
	public GV get(@Nonnull State state) throws Exception {
		return getInternal((S) state);
	}

	abstract GV getInternal(@Nonnull S state) throws Exception;

	@SuppressWarnings("unchecked")
	@Override
	public void update(@Nonnull State state, Object update) throws Exception {
		updateInternal((S) state, (UV) update);
	}

	abstract void updateInternal(@Nonnull S state, UV update) throws Exception;

	@SuppressWarnings("unchecked")
	@Override
	public boolean verify(@Nonnull TtlVerificationContext<?, ?> verificationContextRaw) {
		TtlVerificationContext<UV, GV> verificationContext = (TtlVerificationContext<UV, GV>) verificationContextRaw;
		long currentTimestamp = verificationContext.getUpdateContext().getTimestamp();

		GV valueBeforeUpdate = verificationContext.getUpdateContext().getValueBeforeUpdate();
		List<ValueWithTs<UV>> updates = new ArrayList<>(verificationContext.getPrevUpdates());
		GV expectedValueBeforeUpdate = expected(updates, currentTimestamp);

		GV valueAfterUpdate = verificationContext.getUpdateContext().getValueAfterUpdate();
		ValueWithTs<UV> update = verificationContext.getUpdateContext().getUpdateWithTs();
		updates.add(update);
		GV expectedValueAfterUpdate = expected(updates, currentTimestamp);

		return Objects.equals(valueBeforeUpdate, expectedValueBeforeUpdate) && Objects.equals(valueAfterUpdate, expectedValueAfterUpdate);
	}

	abstract GV expected(@Nonnull List<ValueWithTs<UV>> updates, long currentTimestamp);

	boolean expired(long lastTimestamp, long currentTimestamp) {
		return lastTimestamp + stateDesc.getTtlConfig().getTtl().toMilliseconds() <= currentTimestamp;
	}
}


text:
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var base_module_1 = require("./base-module");
var common_1 = require("../common");
var Domains = /** @class */ (function (_super) {
    __extends(Domains, _super);
    function Domains(pageSize, requestHelper) {
        var _this = _super.call(this, pageSize, requestHelper) || this;
        _this.basePath = 'domains';
        _this.baseOptions = {
            actionPath: _this.basePath + "/",
        };
        return _this;
    }
    /**
     * Get all Domains
     * @param [tagName] filter to only return Domains with a given tag
     * @param [includeAll] return all Domains, paginated (optional)
     * @param [page] the specific page of Domains to return (optional)
     * @param [pageSize] the number of Domains to return per page (optional)
     * @returns Promise
     */
    Domains.prototype.getAll = function (tagName, includeAll, page, pageSize) {
        if (includeAll === void 0) { includeAll = false; }
        if (page === void 0) { page = 1; }
        if (pageSize === void 0) { pageSize = this.pageSize; }
        var requestOptions = this._getBasePaginatedRequestOptions(__assign(__assign({}, this.baseOptions), { key: 'domains', tagName: tagName, pageSize: pageSize, page: page, includeAll: includeAll }));
        return this._execute(requestOptions);
    };
    /**
     * Create a new Domain
     * @param options the options for the new Domain
     * @returns Promise
     */
    Domains.prototype.create = function (options) {
        return this._execute(__assign(__assign({}, this.baseOptions), { method: common_1.HttpMethods.POST, body: options }));
    };
    /**
     * Get a Domain
     * @params domainName the name of the Domain to retrieve
     * @returns Promise
     */
    Domains.prototype.getByName = function (domainName) {
        return this._execute({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName),
        });
    };
    /**
     * Delete a Domain
     * @params domainName the name of the Domain to delete
     * @returns Promise
     */
    Domains.prototype.delete = function (domainName) {
        return this._execute({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName),
            method: common_1.HttpMethods.DELETE,
        });
    };
    /**
     * Get all Domain Records
     * @param domainName the Domain to get the records for
     * @param [tagName] filter to only return Domains with a given tag
     * @param [includeAll] return all Domains, paginated (optional)
     * @param [page] the specific page of Domains to return (optional)
     * @param [pageSize] the number of Domains to return per page (optional)
     * @returns Promise
     */
    Domains.prototype.getAllRecords = function (domainName, tagName, includeAll, page, pageSize) {
        if (includeAll === void 0) { includeAll = false; }
        if (page === void 0) { page = 1; }
        if (pageSize === void 0) { pageSize = this.pageSize; }
        var requestOptions = this._getBasePaginatedRequestOptions({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName) + "/records",
            key: 'domain_records',
            tagName: tagName,
            pageSize: pageSize,
            page: page,
            includeAll: includeAll,
        });
        return this._execute(requestOptions);
    };
    /**
     * Add a new Record to a Domain
     * @param domainName the name of the Domain to add it to
     * @param options the Domain Record options
     * @returns Promise
     */
    Domains.prototype.createRecord = function (domainName, options) {
        return this._execute({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName) + "/records",
            method: common_1.HttpMethods.POST,
            body: options,
        });
    };
    /**
     * Get a Domain Record
     * @param domainName the name of the Domain to retrieve it from
     * @param recordId the Record identifier to retrieve
     * @returns Promise
     */
    Domains.prototype.getRecord = function (domainName, recordId) {
        return this._execute({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName) + "/records/" + encodeURIComponent(recordId),
        });
    };
    /**
     * Delete a Domain Record
     * @param domainName the name of the Domain to retrieve it from
     * @param recordId the Record identifier to retrieve
     * @returns Promise
     */
    Domains.prototype.deleteRecord = function (domainName, recordId) {
        return this._execute({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName) + "/records/" + encodeURIComponent(recordId),
            method: common_1.HttpMethods.DELETE,
        });
    };
    /**
     * Update a Domain Record
     * @param domainName the name of the Domain to update
     * @param recordId the Record identifier to update
     * @param options the update options
     * @returns Promise
     */
    Domains.prototype.updateRecord = function (domainName, recordId, options) {
        return this._execute({
            actionPath: this.basePath + "/" + encodeURIComponent(domainName) + "/records/" + encodeURIComponent(recordId),
            method: common_1.HttpMethods.PUT,
            body: options,
        });
    };
    return Domains;
}(base_module_1.BaseModule));
exports.default = Domains;


text:
package lombok.javac.handlers.singulars;

import static lombok.javac.Javac.*;
import static lombok.javac.handlers.JavacHandlerUtil.*;

import java.util.Arrays;

import lombok.core.LombokImmutableList;
import lombok.core.handlers.HandlerUtil;
import lombok.javac.JavacNode;
import lombok.javac.JavacTreeMaker;
import lombok.javac.handlers.JavacHandlerUtil;
import lombok.javac.handlers.JavacSingularsRecipes.JavacSingularizer;
import lombok.javac.handlers.JavacSingularsRecipes.SingularData;

import org.mangosdk.spi.ProviderFor;

import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCBlock;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.tree.JCTree.JCModifiers;
import com.sun.tools.javac.tree.JCTree.JCStatement;
import com.sun.tools.javac.tree.JCTree.JCTypeParameter;
import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
import com.sun.tools.javac.util.Name;

@ProviderFor(JavacSingularizer.class)
public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer {
	@Override public LombokImmutableList<String> getSupportedTypes() {
		return LombokImmutableList.of("java.util.Map", "java.util.SortedMap", "java.util.NavigableMap");
	}

	@Override public java.util.List<Name> listFieldsToBeGenerated(SingularData data, JavacNode builderType) {
		if (useGuavaInstead(builderType)) {
			return guavaMapSingularizer.listFieldsToBeGenerated(data, builderType);
		}

		String p = data.getPluralName().toString();
		return Arrays.asList(builderType.toName(p + "$key"), builderType.toName(p + "$value"));
	}

	@Override public java.util.List<Name> listMethodsToBeGenerated(SingularData data, JavacNode builderType) {
		if (useGuavaInstead(builderType)) {
			return guavaMapSingularizer.listMethodsToBeGenerated(data, builderType);
		}

		return super.listMethodsToBeGenerated(data, builderType);
	}

	@Override public java.util.List<JavacNode> generateFields(SingularData data, JavacNode builderType, JCTree source) {
		if (useGuavaInstead(builderType)) {
			return guavaMapSingularizer.generateFields(data, builderType, source);
		}

		JavacTreeMaker maker = builderType.getTreeMaker();

		JCVariableDecl buildKeyField; {
			JCExpression type = JavacHandlerUtil.chainDots(builderType, "java", "util", "ArrayList");
			type = addTypeArgs(1, false, builderType, type, data.getTypeArgs(), source);
			buildKeyField = maker.VarDef(maker.Modifiers(Flags.PRIVATE), builderType.toName(data.getPluralName() + "$key"), type, null);
		}

		JCVariableDecl buildValueField; {
			JCExpression type = JavacHandlerUtil.chainDots(builderType, "java", "util", "ArrayList");
			List<JCExpression> tArgs = data.getTypeArgs();
			if (tArgs != null && tArgs.size() > 1) tArgs = tArgs.tail;
			else tArgs = List.nil();
			type = addTypeArgs(1, false, builderType, type, tArgs, source);
			buildValueField = maker.VarDef(maker.Modifiers(Flags.PRIVATE), builderType.toName(data.getPluralName() + "$value"), type, null);
		}

		JavacNode valueFieldNode = injectFieldAndMarkGenerated(builderType, buildValueField);
		JavacNode keyFieldNode = injectFieldAndMarkGenerated(builderType, buildKeyField);

		return Arrays.asList(keyFieldNode, valueFieldNode);
	}

	@Override public void generateMethods(SingularData data, JavacNode builderType, JCTree source, boolean fluent, boolean chain) {
		if (useGuavaInstead(builderType)) {
			guavaMapSingularizer.generateMethods(data, builderType, source, fluent, chain);
			return;
		}

		JavacTreeMaker maker = builderType.getTreeMaker();

		JCExpression returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(maker, CTC_VOID));
		JCStatement returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null;
		generateSingularMethod(maker, returnType, returnStatement, data, builderType, source, fluent);

		returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(maker, CTC_VOID));
		returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null;
		generatePluralMethod(maker, returnType, returnStatement, data, builderType, source, fluent);
	}

	private void generateSingularMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) {
		List<JCTypeParameter> typeParams = List.nil();
		List<JCExpression> thrown = List.nil();
		JCModifiers mods = maker.Modifiers(Flags.PUBLIC);
		ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
		statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, true, source));
		Name keyName = builderType.toName(data.getSingularName().toString() + "Key");
		Name valueName = builderType.toName(data.getSingularName().toString() + "Value");
		/* this.pluralname$key.add(singularnameKey); */ {
			JCExpression thisDotKeyFieldDotAdd = chainDots(builderType, "this", data.getPluralName() + "$key", "add");
			JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotKeyFieldDotAdd, List.<JCExpression>of(maker.Ident(keyName)));
			statements.append(maker.Exec(invokeAdd));
		}
		/* this.pluralname$value.add(singularnameValue); */ {
			JCExpression thisDotValueFieldDotAdd = chainDots(builderType, "this", data.getPluralName() + "$value", "add");
			JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotValueFieldDotAdd, List.<JCExpression>of(maker.Ident(valueName)));
			statements.append(maker.Exec(invokeAdd));
		}
		if (returnStatement != null) statements.append(returnStatement);
		JCBlock body = maker.Block(0, statements.toList());
		long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext());

		Name name = data.getSingularName();
		if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("put", name.toString()));
		JCExpression paramTypeKey = cloneParamType(0, maker, data.getTypeArgs(), builderType, source);
		JCExpression paramTypeValue = cloneParamType(1, maker, data.getTypeArgs(), builderType, source);
		JCVariableDecl paramKey = maker.VarDef(maker.Modifiers(paramFlags), keyName, paramTypeKey, null);
		JCVariableDecl paramValue = maker.VarDef(maker.Modifiers(paramFlags), valueName, paramTypeValue, null);
		JCMethodDecl method = maker.MethodDef(mods, name, returnType, typeParams, List.of(paramKey, paramValue), thrown, body, null);
		injectMethod(builderType, method);
	}

	private void generatePluralMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) {
		List<JCTypeParameter> typeParams = List.nil();
		List<JCExpression> jceBlank = List.nil();
		JCModifiers mods = maker.Modifiers(Flags.PUBLIC);
		ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>();
		statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, true, source));
		long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext());
		long baseFlags = JavacHandlerUtil.addFinalIfNeeded(0, builderType.getContext());
		Name entryName = builderType.toName("$lombokEntry");

		JCExpression forEachType = chainDots(builderType, "java", "util", "Map", "Entry");
		forEachType = addTypeArgs(2, true, builderType, forEachType, data.getTypeArgs(), source);
		JCExpression keyArg = maker.Apply(List.<JCExpression>nil(), maker.Select(maker.Ident(entryName), builderType.toName("getKey")), List.<JCExpression>nil());
		JCExpression valueArg = maker.Apply(List.<JCExpression>nil(), maker.Select(maker.Ident(entryName), builderType.toName("getValue")), List.<JCExpression>nil());
		JCExpression addKey = maker.Apply(List.<JCExpression>nil(), chainDots(builderType, "this", data.getPluralName() + "$key", "add"), List.of(keyArg));
		JCExpression addValue = maker.Apply(List.<JCExpression>nil(), chainDots(builderType, "this", data.getPluralName() + "$value", "add"), List.of(valueArg));
		JCBlock forEachBody = maker.Block(0, List.<JCStatement>of(maker.Exec(addKey), maker.Exec(addValue)));
		JCExpression entrySetInvocation = maker.Apply(jceBlank, maker.Select(maker.Ident(data.getPluralName()), builderType.toName("entrySet")), jceBlank);
		JCStatement forEach = maker.ForeachLoop(maker.VarDef(maker.Modifiers(baseFlags), entryName, forEachType, null), entrySetInvocation, forEachBody);
		statements.append(forEach);

		if (returnStatement != null) statements.append(returnStatement);
		JCBlock body = maker.Block(0, statements.toList());
		Name name = data.getPluralName();
		if (!fluent) name = builderType.toName(HandlerUtil.buildAccessorName("putAll", name.toString()));
		JCExpression paramType = chainDots(builderType, "java", "util", "Map");
		paramType = addTypeArgs(2, true, builderType, paramType, data.getTypeArgs(), source);
		JCVariableDecl param = maker.VarDef(maker.Modifiers(paramFlags), data.getPluralName(), paramType, null);
		JCMethodDecl method = maker.MethodDef(mods, name, returnType, typeParams, List.of(param), jceBlank, body, null);
		injectMethod(builderType, method);
	}

	@Override public void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer<JCStatement> statements, Name targetVariableName) {
		if (useGuavaInstead(builderType)) {
			guavaMapSingularizer.appendBuildCode(data, builderType, source, statements, targetVariableName);
			return;
		}

		JavacTreeMaker maker = builderType.getTreeMaker();

		if (data.getTargetFqn().equals("java.util.Map")) {
			statements.appendList(createJavaUtilSetMapInitialCapacitySwitchStatements(maker, data, builderType, true, "emptyMap", "singletonMap", "LinkedHashMap", source));
		} else {
			statements.appendList(createJavaUtilSimpleCreationAndFillStatements(maker, data, builderType, true, true, false, true, "TreeMap", source));
		}
	}
}


text:
include_recipe "packages"

if platform?("centos","redhat","debian","ubuntu") and dist_only?
  package value_for_platform(
    "centos" => { "default" => "rubygem-stompserver" },
    "redhat" => { "default" => "rubygem-stompserver" },
    "debian" => { "default" => "stompserver" },
    "ubuntu" => { "default" => "stompserver" }
  )

  service "stompserver" do
    supports [ :restart, :reload, :status ]
    action [ :enable, :start ]
  end

  return
end

include_recipe "runit"

gem_package "stompserver" do
  action :install
end

runit_service "stompserver"


text:
<?php

use forxer\Gravatar\Gravatar;

class AuthController extends BaseController {

    protected $client_id;
    protected $client_secret;
    protected $callback_url;

    public function __construct()
    {
        $this->client_id = Config::get('services.spotify.client_id');
        $this->client_secret = Config::get('services.spotify.client_secret');
        $this->callback_url = config::get('services.spotify.callback_url');
    }

    public function getIndex()
    {
        $session = new SpotifyWebAPI\Session($this->client_id, $this->client_secret, $this->callback_url);
        $scopes = array(
            'user-read-private',
            'user-library-read',
            'user-read-email',
            'playlist-read-private',
            'playlist-modify-public',
            'playlist-modify-private'
        );

        $authorizeUrl = $session->getAuthorizeUrl(array(
            'scope' => $scopes
        ));

        header('Location: ' . $authorizeUrl);
        die();
    }

    public function getSpotifyCallback()
    {
        $session = new SpotifyWebAPI\Session($this->client_id, $this->client_secret, $this->callback_url);
        $api = new SpotifyWebAPI\SpotifyWebAPI();

        // Request a access token using the code from Spotify
        $session->requestToken(Input::get('code'));
        $accessToken = $session->getAccessToken();

        // Set the access token on the API wrapper
        $api->setAccessToken($accessToken);

        $refreshToken = $session->getRefreshToken();

        $user = $api->me();

        try{
            $userImage = $user->images[0]->url;
        }catch (Exception $e){
            $userImage = Gravatar::image($user->email, 100, 'mm');
        }

        Session::put('accessToken', $accessToken);
        Session::put('refreshToken', $refreshToken);
        Session::put('userID', $user->id);
        Session::put('userName', $user->display_name);
        Session::put('userImage', $userImage);

        if(!Session::get('userOnlineID')){
            $onlineUser = $this->reportOnlineUser($user->id);
            Session::put('userOnlineID', $onlineUser);
        }

        return Redirect::to('/');
    }

    public function postLogin()
    {

        // Refresh Spotify token so we are hopefully always fresh
        $session = new SpotifyWebAPI\Session($this->client_id, $this->client_secret, $this->callback_url);
        $api = new SpotifyWebAPI\SpotifyWebAPI();

        $session->setRefreshToken(Session::get('refreshToken'));
        $session->refreshToken();

        $accessToken = $session->getAccessToken();

        Session::put('accessToken', $accessToken);

        $api->setAccessToken($accessToken);

        $user = $api->me();

        // Authorize with Pusher
        $userName = $user->id;
        $pusher = new Pusher(
            Config::get('services.pusher.app_key'),
            Config::get('services.pusher.app_secret'),
            Config::get('services.pusher.app_id')
        );

        try {
            $userImage = $user->images[0]->url;
        } catch (Exception $e) {
            $userImage = Gravatar::image($user->email, 100, 'mm');
        }

        if(Session::get('userID')){
            $onlineUser = $this->reportOnlineUser(Session::get('userID'));

            // I think this deserves to be set again, as opposed to letting
            // the user use their previous sessions onlineID if it still exsits
            // but right now this also lets the user round robin their previous
            // entries plus any new ones they add in
            // The opposite inverse. though, would be someone who hasn't been in for a while
            // Their songs could, in theory cut right to the top of the queue even though they
            // might technically be way further down the line

            // I think the solve is to either kill their music in the queue all together..
            // Or to keep the data but remove it from the queue.
            Session::put('userOnlineID', $onlineUser);
        }

        $presence_data = array(
            'id' => $userName,
            'name' => $user->display_name,
            'image' => $userImage,
            'onlineID' => Session::get('userOnlineID', 'shouldBeSomething')
        );

        return $pusher->presence_auth(
            Input::get('channel_name', 'presence-tapmusic1'),
            Input::get('socket_id'),
            $userName,
            $presence_data
        );
    }

    public function getUser()
    {
        $session = new SpotifyWebAPI\Session($this->client_id, $this->client_secret, $this->callback_url);
        $api = new SpotifyWebAPI\SpotifyWebAPI();

        $api->setAccessToken(Session::get('accessToken'));

        $user = $api->me();
        dd($user);

        //return Config::get('services.spotify.callbackUrl');

        //dd(Session::get('userImage'));
    }

    public function reportOnlineUser($userID)
    {
        $removedUser = OnlineUser::where('userID', '=', $userID)->delete();

        $onlineUser = new OnlineUser();
        $onlineUser->userID = $userID;
        $onlineUser->save();

        return $onlineUser->id;
    }
}


text:
import commands
import json
import os
import re
import signal
import socket
import subprocess
import sys
import time
import yaml
import Cheetah
import common
import pickle

from os import chmod
from os import remove
from os.path import exists
from string import Template
from yaml.constructor import ConstructorError
from Cheetah.Template import Template

###############################################################################
# Supporting functions
###############################################################################

#------------------------------------------------------------------------------
# juju_log:  calls juju-log and records the message defined by the message
#            variable
#------------------------------------------------------------------------------
def juju_log(message=None):
    return (subprocess.call(['juju-log', str(message)]) == 0)

#------------------------------------------------------------------------------
# service:  Analogous to calling service on the command line to start/stop
#           and get status of a service/daemon.
#           Parameters:
#           service_name:    The name of the service to act on.
#           service_action:  The action (start, stop, status, etc.)
#           Returns: True if the command was successfully executed or False on
#                    error.
#------------------------------------------------------------------------------
def service(service_name=None, service_action=None):
    juju_log("service: %s, action: %s" % (service_name, service_action))
    if service_name is not None and service_action is not None:
        retVal = subprocess.call(
            ["service", service_name, service_action]) == 0
    else:
        retVal = False
    juju_log("service %s %s returns: %s" %
    (service_name, service_action, retVal))
    return(retVal)

#------------------------------------------------------------------------------
# unit_get:  Convenience function wrapping the juju command unit-get
#            Parameter:
#            setting_name:  The setting to get out of unit_get
#            Returns:  The requested information or None on error
#------------------------------------------------------------------------------
def unit_get(setting_name=None):
    juju_log("unit_get: %s" % setting_name)
    try:
        cmd_line = ['unit-get', '--format=json']
        if setting_name is not None:
            cmd_line.append(setting_name)
        unit_data = json.loads(subprocess.check_output(cmd_line))
    except Exception, e:
        subprocess.call(['juju-log', str(e)])
        unit_data = None
    finally:
        juju_log("unit_get %s returns: %s" % (setting_name, unit_data))
        return(unit_data)

#------------------------------------------------------------------------------
# config_get:  Returns a dictionary containing all of the config information
#              Optional parameter: scope
#              scope: limits the scope of the returned configuration to the
#                     desired config item.
#------------------------------------------------------------------------------
def config_get(scope=None):
    juju_log("config_get: %s" % scope)
    try:
        config_cmd_line = ['config-get']
        if scope is not None:
            config_cmd_line.append(scope)
        config_cmd_line.append('--format=json')
        config_data = json.loads(subprocess.check_output(config_cmd_line))
    except Exception, e:
        juju_log(str(e))
        config_data = None
    finally:
        juju_log("config_get: %s returns: %s" % (scope, config_data))
        return(config_data)

#------------------------------------------------------------------------------
# relation_get:  Returns a dictionary containing the relation information
#                Optional parameters: scope, relation_id
#                scope:        limits the scope of the returned data to the
#                              desired item.
#                unit_name:    limits the data ( and optionally the scope )
#                              to the specified unit
#                relation_id:  specify relation id for out of context usage.
#------------------------------------------------------------------------------
def relation_get(scope=None, unit_name=None, relation_id=None):
    juju_log("relation_get: scope: %s, unit_name: %s, relation_id: %s" %
    (scope, unit_name, relation_id))
    try:
        relation_cmd_line = ['relation-get', '--format=json']
        if relation_id is not None:
            relation_cmd_line.extend(('-r', relation_id))
        if scope is not None:
            relation_cmd_line.append(scope)
        else:
            relation_cmd_line.append('')
        if unit_name is not None:
            relation_cmd_line.append(unit_name)
        relation_data = json.loads(subprocess.check_output(relation_cmd_line))
    except Exception, e:
        juju_log(str(e))
        relation_data = None
    finally:
        juju_log("relation_get returns: %s" % relation_data)
        return(relation_data)

#------------------------------------------------------------------------------
# get_host_specific_config: Returns the appropriate config for the desired
#                           hostname
#
#------------------------------------------------------------------------------
def get_host_specific_config(hostname):
     mapping=yaml.load(config_get('mapping'), Loader=yaml.loader.BaseLoader)
     print mapping
     map_conf = dict()
     if mapping is not None:
        for k, v in mapping.iteritems():
            if k in [hostname]:
               print("APPLY HOST SPEC CONF")
               juju_log("Config for %s to be applied" % hostname)
               map_conf = v
     juju_log("Applying general config")
     host_conf = {
        'n1kv-vsm-ip': map_conf['n1kv-vsm-ip'] if 'n1kv-vsm-ip' in map_conf else config_get('n1kv-vsm-ip'),
        'n1kv-vsm-domain-id': map_conf['n1kv-vsm-domain-id'] if 'n1kv-vsm-domain-id' in map_conf else config_get('n1kv-vsm-domain-id'),
        'host_mgmt_intf': map_conf['host_mgmt_intf'] if 'host_mgmt_intf' in map_conf else config_get('host_mgmt_intf'),
        'uplink_profile': map_conf['uplink_profile'] if 'uplink_profile' in map_conf else config_get('uplink_profile'),
        'vtep_config': map_conf['vtep_config'] if 'vtep_config' in map_conf else config_get('vtep_config'),
        'node_type': map_conf['node_type'] if 'node_type' in map_conf else config_get('node_type'),
        'vtep_in_same_subnet': map_conf['vtep_in_same_subnet'] if 'vtep_in_same_subnet' in map_conf else config_get('vtep_in_same_subnet'),
     }
     return host_conf

#------------------------------------------------------------------------------
# update_n1kv_config: Updates the /etc/n1kv/n1kv.conf file with the latest
#                     updated values in the data.yaml
#
#------------------------------------------------------------------------------
def update_n1kv_config():
   juju_log("update_n1kv_config")
   with open('data.yaml', 'r') as f:
        temp=f.read()
   n1kv_conf_data = yaml.load(temp, Loader=yaml.loader.BaseLoader)
   t2 = Template( file = 'templates/n1kv.conf.tmpl',
        searchList = [{ 'host_mgmt_intf':n1kv_conf_data["n1kv_conf"]["host_mgmt_intf"],
                        'uplink_profile':n1kv_conf_data["n1kv_conf"]["uplink_profile"].replace(', ', '\n').replace(',','\n'),
                        'vsm_ip':n1kv_conf_data["n1kv_conf"]["n1kv-vsm-ip"],
                        'vsm_domain_id':n1kv_conf_data["n1kv_conf"]["n1kv-vsm-domain-id"],
                        'node_type':n1kv_conf_data["n1kv_conf"]["node_type"],
                        'vtep_config':n1kv_conf_data["n1kv_conf"]["vtep_config"].replace(', ', '\n').replace(',','\n')
                      }])
   juju_log(str(t2))
   outfile = file('/etc/n1kv/n1kv.conf', 'w')
   outfile.write(str(t2))
   outfile.close()
   subprocess.call(["service", "n1kv", "restart"])
   #subprocess.call(["vemcmd", "reread", "config"])

#------------------------------------------------------------------------------
# ifconfig: ifconfig int <int-name> <up/down>
#
#------------------------------------------------------------------------------
def ifconfig(interface, state):
   juju_log("ifconfig %s %s" % (interface, state))
   try:
      subprocess.call(["ifconfig", interface, state])
   except Exception, e:
      subprocess.call(['juju-log', str(e)])

#------------------------------------------------------------------------------
# enable_uplink: Enable uplink interfaces
#
#------------------------------------------------------------------------------
def enable_uplink(uplink_conf):
   uplink_conf = uplink_conf.replace(', ', '\n').replace(',','\n').split('\n')
   for k in uplink_conf:
      ifconfig(k.split(" ")[1], "up")

def import_key(keyid):
    cmd = "apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 " \
          "--recv-keys %s" % keyid
    try:
        subprocess.check_call(cmd.split(' '))
    except subprocess.CalledProcessError:
        error_out("Error importing repo key %s" % keyid)

def configure_installation_source(rel):
    '''Configure apt installation source.'''
    rel_list = rel.replace(', ', '\n').replace(',','\n').split('\n')
    if os.path.exists('/etc/apt/sources.list.d/n1k_deb.list'):
       os.remove('/etc/apt/sources.list.d/n1k_deb.list')
    for rel in rel_list:
       if rel == 'distro':
           return
       elif rel[:4] == "ppa:":
           src = rel
           subprocess.check_call(["add-apt-repository", "-y", src])
       elif rel[:3] == "deb":
           l = len(rel.split('|'))
           if l == 2:
               src, key = rel.split('|')
               juju_log("Importing PPA key from keyserver for %s" % src)
               import_key(key)
           elif l == 1:
               src = rel
           with open('/etc/apt/sources.list.d/n1k_deb.list', 'ab+') as f:
               f.write("%s \n" % (src))
       elif rel[:6] == 'cloud:':
           ubuntu_rel = lsb_release()['DISTRIB_CODENAME']
           rel = rel.split(':')[1]
           u_rel = rel.split('-')[0]
           ca_rel = rel.split('-')[1]

           if u_rel != ubuntu_rel:
               e = 'Cannot install from Cloud Archive pocket %s on this Ubuntu '\
                   'version (%s)' % (ca_rel, ubuntu_rel)
               error_out(e)

           if 'staging' in ca_rel:
               # staging is just a regular PPA.
               os_rel = ca_rel.split('/')[0]
               ppa = 'ppa:ubuntu-cloud-archive/%s-staging' % os_rel
               cmd = 'add-apt-repository -y %s' % ppa
               subprocess.check_call(cmd.split(' '))
               return

        # map charm config options to actual archive pockets.
           pockets = {
               'folsom': 'precise-updates/folsom',
               'folsom/updates': 'precise-updates/folsom',
               'folsom/proposed': 'precise-proposed/folsom',
               'grizzly': 'precise-updates/grizzly',
               'grizzly/updates': 'precise-updates/grizzly',
               'grizzly/proposed': 'precise-proposed/grizzly',
               'havana': 'precise-updates/havana',
               'havana/updates': 'precise-updates/havana',
               'havana/proposed': 'precise-proposed/havana',
           }

           try:
               pocket = pockets[ca_rel]
           except KeyError:
               e = 'Invalid Cloud Archive release specified: %s' % rel
               error_out(e)

           src = "deb %s %s main" % (CLOUD_ARCHIVE_URL, pocket)
           apt_install('ubuntu-cloud-keyring', fatal=True)

           with open('/etc/apt/sources.list.d/cloud-archive.list', 'ab+') as f:
               f.write("%s \n" % (src))
       else:
           error_out("Invalid openstack-release specified: %s" % rel)