text:
<?php

namespace RedBeanPHP;

use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
use RedBeanPHP\QueryWriter as QueryWriter;
use RedBeanPHP\BeanHelper as BeanHelper;
use RedBeanPHP\RedException\SQL as SQLException;
use RedBeanPHP\QueryWriter\AQueryWriter as AQueryWriter;
use RedBeanPHP\Cursor as Cursor;
use RedBeanPHP\Cursor\NullCursor as NullCursor;

abstract class Repository
{
	/**
	 * @var array
	 */
	protected $stash = NULL;

	/*
	 * @var integer
	 */
	protected $nesting = 0;

	/**
	 * @var DBAdapter
	 */
	protected $writer;

	/**
	 * Stores a bean and its lists in one run.
	 *
	 * @param OODBBean $bean bean to process
	 *
	 * @return void
	 */
	protected function storeBeanWithLists( OODBBean $bean )
	{
		$sharedAdditions = $sharedTrashcan = $sharedresidue = $sharedItems = $ownAdditions = $ownTrashcan = $ownresidue = $embeddedBeans = array(); //Define groups
		foreach ( $bean as $property => $value ) {
			$value = ( $value instanceof SimpleModel ) ? $value->unbox() : $value;
			if ( $value instanceof OODBBean ) {
				$this->processEmbeddedBean( $embeddedBeans, $bean, $property, $value );
				$bean->setMeta("sys.typeof.{$property}", $value->getMeta('type'));
			} elseif ( is_array( $value ) ) {
				foreach($value as &$item) {
					$item = ( $item instanceof SimpleModel ) ? $item->unbox() : $item;
				}
				$originals = $bean->moveMeta( 'sys.shadow.' . $property, array() );
				if ( strpos( $property, 'own' ) === 0 ) {
					list( $ownAdditions, $ownTrashcan, $ownresidue ) = $this->processGroups( $originals, $value, $ownAdditions, $ownTrashcan, $ownresidue );
					$listName = lcfirst( substr( $property, 3 ) );
					if ($bean->moveMeta( 'sys.exclusive-'.  $listName ) ) {
						OODBBean::setMetaAll( $ownTrashcan, 'sys.garbage', TRUE );
						OODBBean::setMetaAll( $ownAdditions, 'sys.buildcommand.fkdependson', $bean->getMeta( 'type' ) );
					}
					unset( $bean->$property );
				} elseif ( strpos( $property, 'shared' ) === 0 ) {
					list( $sharedAdditions, $sharedTrashcan, $sharedresidue ) = $this->processGroups( $originals, $value, $sharedAdditions, $sharedTrashcan, $sharedresidue );
					unset( $bean->$property );
				}
			}
		}
		$this->storeBean( $bean );
		$this->processTrashcan( $bean, $ownTrashcan );
		$this->processAdditions( $bean, $ownAdditions );
		$this->processResidue( $ownresidue );
		$this->processSharedTrashcan( $bean, $sharedTrashcan );
		$this->processSharedAdditions( $bean, $sharedAdditions );
		$this->processSharedResidue( $bean, $sharedresidue );
	}

	/**
	 * Process groups. Internal function. Processes different kind of groups for
	 * storage function. Given a list of original beans and a list of current beans,
	 * this function calculates which beans remain in the list (residue), which
	 * have been deleted (are in the trashcan) and which beans have been added
	 * (additions).
	 *
	 * @param  array $originals originals
	 * @param  array $current   the current beans
	 * @param  array $additions beans that have been added
	 * @param  array $trashcan  beans that have been deleted
	 * @param  array $residue   beans that have been left untouched
	 *
	 * @return array
	 */
	protected function processGroups( $originals, $current, $additions, $trashcan, $residue )
	{
		return array(
			array_merge( $additions, array_diff( $current, $originals ) ),
			array_merge( $trashcan, array_diff( $originals, $current ) ),
			array_merge( $residue, array_intersect( $current, $originals ) )
		);
	}

	/**
	 * Processes an embedded bean.
	 *
	 * @param OODBBean|SimpleModel $embeddedBean the bean or model
	 *
	 * @return integer
	 */
	protected function prepareEmbeddedBean( $embeddedBean )
	{
		if ( !$embeddedBean->id || $embeddedBean->getMeta( 'tainted' ) ) {
			$this->store( $embeddedBean );
		}

		return $embeddedBean->id;
	}

	/**
	 * Processes a list of beans from a bean. A bean may contain lists. This
	 * method handles shared addition lists; i.e. the $bean->sharedObject properties.
	 *
	 * @param OODBBean $bean             the bean
	 * @param array            $sharedAdditions  list with shared additions
	 *
	 * @return void
	 */
	protected function processSharedAdditions( $bean, $sharedAdditions )
	{
		foreach ( $sharedAdditions as $addition ) {
			if ( $addition instanceof OODBBean ) {
				$this->oodb->getAssociationManager()->associate( $addition, $bean );
			} else {
				throw new RedException( 'Array may only contain OODBBeans' );
			}
		}
	}

	/**
	 * Processes a list of beans from a bean. A bean may contain lists. This
	 * method handles own lists; i.e. the $bean->ownObject properties.
	 * A residue is a bean in an own-list that stays where it is. This method
	 * checks if there have been any modification to this bean, in that case
	 * the bean is stored once again, otherwise the bean will be left untouched.
	 *
	 * @param OODBBean $bean       bean tor process
	 * @param array    $ownresidue list to process
	 *
	 * @return void
	 */
	protected function processResidue( $ownresidue )
	{
		foreach ( $ownresidue as $residue ) {
			if ( $residue->getMeta( 'tainted' ) ) {
				$this->store( $residue );
			}
		}
	}

	/**
	 * Processes a list of beans from a bean. A bean may contain lists. This
	 * method handles own lists; i.e. the $bean->ownObject properties.
	 * A trash can bean is a bean in an own-list that has been removed
	 * (when checked with the shadow). This method
	 * checks if the bean is also in the dependency list. If it is the bean will be removed.
	 * If not, the connection between the bean and the owner bean will be broken by
	 * setting the ID to NULL.
	 *
	 * @param OODBBean $bean bean   to process
	 * @param array    $ownTrashcan list to process
	 *
	 * @return void
	 */
	protected function processTrashcan( $bean, $ownTrashcan )
	{
		foreach ( $ownTrashcan as $trash ) {

			$myFieldLink = $bean->getMeta( 'type' ) . '_id';
			$alias = $bean->getMeta( 'sys.alias.' . $trash->getMeta( 'type' ) );
			if ( $alias ) $myFieldLink = $alias . '_id';

			if ( $trash->getMeta( 'sys.garbage' ) === true ) {
				$this->trash( $trash );
			} else {
				$trash->$myFieldLink = NULL;
				$this->store( $trash );
			}
		}
	}

	/**
	 * Unassociates the list items in the trashcan.
	 *
	 * @param OODBBean $bean           bean to process
	 * @param array    $sharedTrashcan list to process
	 *
	 * @return void
	 */
	protected function processSharedTrashcan( $bean, $sharedTrashcan )
	{
		foreach ( $sharedTrashcan as $trash ) {
			$this->oodb->getAssociationManager()->unassociate( $trash, $bean );
		}
	}

	/**
	 * Stores all the beans in the residue group.
	 *
	 * @param OODBBean $bean          bean to process
	 * @param array    $sharedresidue list to process
	 *
	 * @return void
	 */
	protected function processSharedResidue( $bean, $sharedresidue )
	{
		foreach ( $sharedresidue as $residue ) {
			$this->store( $residue );
		}
	}

	/**
	 * Determines whether the bean has 'loaded lists' or
	 * 'loaded embedded beans' that need to be processed
	 * by the store() method.
	 *
	 * @param OODBBean $bean bean to be examined
	 *
	 * @return boolean
	 */
	protected function hasListsOrObjects( OODBBean $bean )
	{
		$processLists = FALSE;
		foreach ( $bean as $value ) {
			if ( is_array( $value ) || is_object( $value ) ) {
				$processLists = TRUE;
				break;
			}
		}

		return $processLists;
	}

	/**
	 * Converts an embedded bean to an ID, removed the bean property and
	 * stores the bean in the embedded beans array.
	 *
	 * @param array    $embeddedBeans destination array for embedded bean
	 * @param OODBBean $bean          target bean to process
	 * @param string   $property      property that contains the embedded bean
	 * @param OODBBean $value         embedded bean itself
	 *
	 * @return void
	 */
	protected function processEmbeddedBean( &$embeddedBeans, $bean, $property, OODBBean $value )
	{
		$linkField = $property . '_id';
		$id = $this->prepareEmbeddedBean( $value );
		if ($bean->$linkField != $id) $bean->$linkField = $id;
		$bean->setMeta( 'cast.' . $linkField, 'id' );
		$embeddedBeans[$linkField] = $value;
		unset( $bean->$property );
	}

	/**
	 * Constructor, requires a query writer.
	 * Creates a new instance of the bean respository class.
	 *
	 * @param QueryWriter $writer the Query Writer to use for this repository
	 *
	 * @return void
	 */
	public function __construct( OODB $oodb, QueryWriter $writer )
	{
		$this->writer = $writer;
		$this->oodb = $oodb;
	}

	/**
	 * Checks whether a OODBBean bean is valid.
	 * If the type is not valid or the ID is not valid it will
	 * throw an exception: Security.
	 *
	 * @param OODBBean $bean the bean that needs to be checked
	 *
	 * @return void
	 */
	public function check( OODBBean $bean )
	{
		//Is all meta information present?
		if ( !isset( $bean->id ) ) {
			throw new RedException( 'Bean has incomplete Meta Information id ' );
		}
		if ( !( $bean->getMeta( 'type' ) ) ) {
			throw new RedException( 'Bean has incomplete Meta Information II' );
		}
		//Pattern of allowed characters
		$pattern = '/[^a-z0-9_]/i';
		//Does the type contain invalid characters?
		if ( preg_match( $pattern, $bean->getMeta( 'type' ) ) ) {
			throw new RedException( 'Bean Type is invalid' );
		}
		//Are the properties and values valid?
		foreach ( $bean as $prop => $value ) {
			if (
				is_array( $value )
				|| ( is_object( $value ) )
			) {
				throw new RedException( "Invalid Bean value: property $prop" );
			} else if (
				strlen( $prop ) < 1
				|| preg_match( $pattern, $prop )
			) {
				throw new RedException( "Invalid Bean property: property $prop" );
			}
		}
	}

	/**
	 * Searches the database for a bean that matches conditions $conditions and sql $addSQL
	 * and returns an array containing all the beans that have been found.
	 *
	 * Conditions need to take form:
	 *
	 * <code>
	 * array(
	 *    'PROPERTY' => array( POSSIBLE VALUES... 'John', 'Steve' )
	 *    'PROPERTY' => array( POSSIBLE VALUES... )
	 * );
	 * </code>
	 *
	 * All conditions are glued together using the AND-operator, while all value lists
	 * are glued using IN-operators thus acting as OR-conditions.
	 *
	 * Note that you can use property names; the columns will be extracted using the
	 * appropriate bean formatter.
	 *
	 * @param string $type       type of beans you are looking for
	 * @param array  $conditions list of conditions
	 * @param string $addSQL     SQL to be used in query
	 * @param array  $bindings   whether you prefer to use a WHERE clause or not (TRUE = not)
	 *
	 * @return array
	 */
	public function find( $type, $conditions = array(), $sql = NULL, $bindings = array() )
	{
		//for backward compatibility, allow mismatch arguments:
		if ( is_array( $sql ) ) {
			if ( isset( $sql[1] ) ) {
				$bindings = $sql[1];
			}
			$sql = $sql[0];
		}
		try {
			$beans = $this->convertToBeans( $type, $this->writer->queryRecord( $type, $conditions, $sql, $bindings ) );

			return $beans;
		} catch ( SQLException $exception ) {
			$this->handleException( $exception );
		}

		return array();
	}

	/**
	 * Finds a BeanCollection.
	 *
	 * @param string $type     type of beans you are looking for
	 * @param string $sql      SQL to be used in query
	 * @param array  $bindings whether you prefer to use a WHERE clause or not (TRUE = not)
	 *
	 * @return BeanCollection
	 */
	public function findCollection( $type, $sql, $bindings = array() )
	{
		try {
			$cursor = $this->writer->queryRecordWithCursor( $type, $sql, $bindings );
			return new BeanCollection( $type, $this, $cursor );
		} catch ( SQLException $exception ) {
			$this->handleException( $exception );
		}
		return new BeanCollection( $type, $this, new NullCursor );
	}

	/**
	 * Stores a bean in the database. This method takes a
	 * OODBBean Bean Object $bean and stores it
	 * in the database. If the database schema is not compatible
	 * with this bean and RedBean runs in fluid mode the schema
	 * will be altered to store the bean correctly.
	 * If the database schema is not compatible with this bean and
	 * RedBean runs in frozen mode it will throw an exception.
	 * This function returns the primary key ID of the inserted
	 * bean.
	 *
	 * The return value is an integer if possible. If it is not possible to
	 * represent the value as an integer a string will be returned. We use
	 * explicit casts instead of functions to preserve performance
	 * (0.13 vs 0.28 for 10000 iterations on Core i3).
	 *
	 * @param OODBBean|SimpleModel $bean bean to store
	 *
	 * @return integer|string
	 */
	public function store( $bean )
	{
		$processLists = $this->hasListsOrObjects( $bean );
		if ( !$processLists && !$bean->getMeta( 'tainted' ) ) {
			return $bean->getID(); //bail out!
		}
		$this->oodb->signal( 'update', $bean );
		$processLists = $this->hasListsOrObjects( $bean ); //check again, might have changed by model!
		if ( $processLists ) {
			$this->storeBeanWithLists( $bean );
		} else {
			$this->storeBean( $bean );
		}
		$this->oodb->signal( 'after_update', $bean );

		return ( (string) $bean->id === (string) (int) $bean->id ) ? (int) $bean->id : (string) $bean->id;
	}

	/**
	 * Returns an array of beans. Pass a type and a series of ids and
	 * this method will bring you the corresponding beans.
	 *
	 * important note: Because this method loads beans using the load()
	 * function (but faster) it will return empty beans with ID 0 for
	 * every bean that could not be located. The resulting beans will have the
	 * passed IDs as their keys.
	 *
	 * @param string $type type of beans
	 * @param array  $ids  ids to load
	 *
	 * @return array
	 */
	public function batch( $type, $ids )
	{
		if ( !$ids ) {
			return array();
		}
		$collection = array();
		try {
			$rows = $this->writer->queryRecord( $type, array( 'id' => $ids ) );
		} catch ( SQLException $e ) {
			$this->handleException( $e );
			$rows = FALSE;
		}
		$this->stash[$this->nesting] = array();
		if ( !$rows ) {
			return array();
		}
		foreach ( $rows as $row ) {
			$this->stash[$this->nesting][$row['id']] = $row;
		}
		foreach ( $ids as $id ) {
			$collection[$id] = $this->load( $type, $id );
		}
		$this->stash[$this->nesting] = NULL;

		return $collection;
	}

	/**
	 * This is a convenience method; it converts database rows
	 * (arrays) into beans. Given a type and a set of rows this method
	 * will return an array of beans of the specified type loaded with
	 * the data fields provided by the result set from the database.
	 *
	 * New in 4.3.2: meta mask. The meta mask is a special mask to send
	 * data from raw result rows to the meta store of the bean. This is
	 * useful for bundling additional information with custom queries.
	 * Values of every column whos name starts with $mask will be
	 * transferred to the meta section of the bean under key 'data.bundle'.
	 *
	 * @param string $type type of beans you would like to have
	 * @param array  $rows rows from the database result
	 * @param string $mask meta mask to apply (optional)
	 *
	 * @return array
	 */
	public function convertToBeans( $type, $rows, $mask = NULL )
	{
		$masklen = 0;
		if ( $mask !== NULL ) $masklen = mb_strlen( $mask );

		$collection                  = array();
		$this->stash[$this->nesting] = array();
		foreach ( $rows as $row ) {
			$meta = array();
			if ( !is_null( $mask ) ) {
				foreach( $row as $key => $value ) {
					if ( strpos( $key, $mask ) === 0 ) {
						unset( $row[$key] );
						$meta[$key] = $value;
					}
				}
			}

			$id                               = $row['id'];
			$this->stash[$this->nesting][$id] = $row;
			$collection[$id]                  = $this->load( $type, $id );

			if ( $mask !== NULL ) {
				$collection[$id]->setMeta( 'data.bundle', $meta );
			}
		}
		$this->stash[$this->nesting] = NULL;

		return $collection;
	}

	/**
	 * Counts the number of beans of type $type.
	 * This method accepts a second argument to modify the count-query.
	 * A third argument can be used to provide bindings for the SQL snippet.
	 *
	 * @param string $type     type of bean we are looking for
	 * @param string $addSQL   additional SQL snippet
	 * @param array  $bindings parameters to bind to SQL
	 *
	 * @return integer
	 */
	public function count( $type, $addSQL = '', $bindings = array() )
	{
		$type = AQueryWriter::camelsSnake( $type );
		if ( count( explode( '_', $type ) ) > 2 ) {
			throw new RedException( 'Invalid type for count.' );
		}

		try {
			return (int) $this->writer->queryRecordCount( $type, array(), $addSQL, $bindings );
		} catch ( SQLException $exception ) {
			if ( !$this->writer->sqlStateIn( $exception->getSQLState(), array(
				 QueryWriter::C_SQLSTATE_NO_SUCH_TABLE,
				 QueryWriter::C_SQLSTATE_NO_SUCH_COLUMN ) ) ) {
				throw $exception;
			}
		}

		return 0;
	}

	/**
	 * Removes a bean from the database.
	 * This function will remove the specified OODBBean
	 * Bean Object from the database.
	 *
	 * @param OODBBean|SimpleModel $bean bean you want to remove from database
	 *
	 * @return void
	 */
	public function trash( $bean )
	{
		$this->oodb->signal( 'delete', $bean );
		foreach ( $bean as $property => $value ) {
			if ( $value instanceof OODBBean ) {
				unset( $bean->$property );
			}
			if ( is_array( $value ) ) {
				if ( strpos( $property, 'own' ) === 0 ) {
					unset( $bean->$property );
				} elseif ( strpos( $property, 'shared' ) === 0 ) {
					unset( $bean->$property );
				}
			}
		}
		try {
			$this->writer->deleteRecord( $bean->getMeta( 'type' ), array( 'id' => array( $bean->id ) ), NULL );
		} catch ( SQLException $exception ) {
			$this->handleException( $exception );
		}
		$bean->id = 0;
		$this->oodb->signal( 'after_delete', $bean );
	}

	/**
	 * Checks whether the specified table already exists in the database.
	 * Not part of the Object Database interface!
	 *
	 * @deprecated Use AQueryWriter::typeExists() instead.
	 *
	 * @param string $table table name
	 *
	 * @return boolean
	 */
	public function tableExists( $table )
	{
		return $this->writer->tableExists( $table );
	}

	/**
	 * Trash all beans of a given type. Wipes an entire type of bean.
	 *
	 * @param string $type type of bean you wish to delete all instances of
	 *
	 * @return boolean
	 */
	public function wipe( $type )
	{
		try {
			$this->writer->wipe( $type );

			return TRUE;
		} catch ( SQLException $exception ) {
			if ( !$this->writer->sqlStateIn( $exception->getSQLState(), array( QueryWriter::C_SQLSTATE_NO_SUCH_TABLE ) ) ) {
				throw $exception;
			}

			return FALSE;
		}
	}
}


text:
package com.android.launcher3;

import android.support.v4.widget.AutoScrollHelper;
import android.widget.ScrollView;

/**
 * An implementation of {@link AutoScrollHelper} that knows how to scroll
 * through a {@link Folder}.
 */
public class FolderAutoScrollHelper extends AutoScrollHelper {
    private static final float MAX_SCROLL_VELOCITY=1500f;

    private final ScrollView mTarget;

    public FolderAutoScrollHelper(ScrollView target){
        super(target);

        mTarget=target;

        setActivationDelay(0);
        setEdgeType(EDGE_TYPE_INSIDE_EXTEND);
        setExclusive(true);
        setMaximumVelocity(MAX_SCROLL_VELOCITY,MAX_SCROLL_VELOCITY);
        setRampDownDuration(0);
        setRampUpDuration(0);
    }

    @Override
    public boolean canTargetScrollHorizontally(int direction){
        // List do not scroll horizontally.
        return false;
    }

    @Override
    public boolean canTargetScrollVertically(int direction){
        return mTarget.canScrollVertically(direction);
    }

    @Override
    public void scrollTargetBy(int deltaX,int deltaY){
        mTarget.scrollBy(deltaX,deltaY);
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
* <auto-generated />
* This file was generated by a StringTemplate 4 template.
* Don't change it directly as your change would get overwritten. Instead, make changes
* to the .stg file (i.e. the StringTemplate 4 template file) and save it to regenerate this file.
*
* For more infor on StringTemplate 4 template please go to -
* https://github.com/antlr/antlrcs
*
* @author  Kola Oyewumi
* @version 1.0.0
* @since   2017-01-03
*
* A class which represents the schedulers table.
*/

package com.sugaronrest.modules;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sugaronrest.restapicalls.Module;
import com.sugaronrest.restapicalls.CustomDateDeserializer;
import com.sugaronrest.restapicalls.CustomDateSerializer;

import java.util.Date;

@Module(name = "Schedulers", tablename = "schedulers")
@JsonRootName(value = "schedulers")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Schedulers {
    public String getId() {
        return id;
    }

    public void setId(String value) {
        id = value;
    }
    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer value) {
        deleted = value;
    }
    public Date getDateEntered() {
        return dateEntered;
    }

    public void setDateEntered(Date value) {
        dateEntered = value;
    }
    public Date getDateModified() {
        return dateModified;
    }

    public void setDateModified(Date value) {
        dateModified = value;
    }
    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String value) {
        createdBy = value;
    }
    public String getModifiedUserId() {
        return modifiedUserId;
    }

    public void setModifiedUserId(String value) {
        modifiedUserId = value;
    }
    public String getName() {
        return name;
    }

    public void setName(String value) {
        name = value;
    }
    public String getJob() {
        return job;
    }

    public void setJob(String value) {
        job = value;
    }
    public Date getDateTimeStart() {
        return dateTimeStart;
    }

    public void setDateTimeStart(Date value) {
        dateTimeStart = value;
    }
    public Date getDateTimeEnd() {
        return dateTimeEnd;
    }

    public void setDateTimeEnd(Date value) {
        dateTimeEnd = value;
    }
    public String getJobInterval() {
        return jobInterval;
    }

    public void setJobInterval(String value) {
        jobInterval = value;
    }
    public Date getTimeFrom() {
        return timeFrom;
    }

    public void setTimeFrom(Date value) {
        timeFrom = value;
    }
    public Date getTimeTo() {
        return timeTo;
    }

    public void setTimeTo(Date value) {
        timeTo = value;
    }
    public Date getLastRun() {
        return lastRun;
    }

    public void setLastRun(Date value) {
        lastRun = value;
    }
    public String getStatus() {
        return status;
    }

    public void setStatus(String value) {
        status = value;
    }
    public Integer getCatchUp() {
        return catchUp;
    }

    public void setCatchUp(Integer value) {
        catchUp = value;
    }

    @JsonProperty("id")
    private String id;

    @JsonProperty("deleted")
    private Integer deleted;

    @JsonProperty("date_entered")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date dateEntered;

    @JsonProperty("date_modified")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date dateModified;

    @JsonProperty("created_by")
    private String createdBy;

    @JsonProperty("modified_user_id")
    private String modifiedUserId;

    @JsonProperty("name")
    private String name;

    @JsonProperty("job")
    private String job;

    @JsonProperty("date_time_start")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date dateTimeStart;

    @JsonProperty("date_time_end")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date dateTimeEnd;

    @JsonProperty("job_interval")
    private String jobInterval;

    @JsonProperty("time_from")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date timeFrom;

    @JsonProperty("time_to")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date timeTo;

    @JsonProperty("last_run")
    @JsonDeserialize(using = CustomDateDeserializer.class)
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date lastRun;

    @JsonProperty("status")
    private String status;

    @JsonProperty("catch_up")
    private Integer catchUp;

}


text:
package com.bnorm.auto.weave;

import java.lang.annotation.Annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.METHOD})
@Retention(RetentionPolicy.SOURCE)
public @interface AutoAdvice {

    Class<? extends Annotation>[] value();
}


text:
package org.cfr.commons.app.plugin;

/**
 * Factory for mutable, non-threadsafe PluginSettings objects.
 *
 * @since 1.0
 */
public interface IPluginSettingsFactory {

    /**
     * Gets all settings for a key, for which valid values are application-specific (Confluence maps this to space keys,
     * JIRA to project keys, and FishEye to repository keys, for example). To store settings for other keys,
     * createGlobalSettings should be used, and the keys should be sensibly namespaced by the plugin.
     *
     * @param key the key, can be null to retrieve global settings
     * @throws IllegalArgumentException if no "concept" for the key can be found
     * @return The settings
     */
    IPluginSettings createSettingsForKey(String key);

    /**
     * Gets all global settings. This is useful to store settings against arbitrary keys. When storing settings against
     * arbitrary keys, plugins are advised to namespace the key with something unique to the plugin (for example
     * "com.example.plugin:key-I-would-like-to-use" ) to avoid clashes with other keys.
     *
     * @return Global settings
     */
    IPluginSettings createGlobalSettings();
}


text:
package com.intellij.psi.formatter.java;

import com.intellij.formatting.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.formatter.FormatterUtil;
import com.intellij.psi.impl.source.tree.ElementType;
import com.intellij.psi.impl.source.tree.JavaDocElementType;
import com.intellij.psi.impl.source.tree.StdTokenSets;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;

public class BlockContainingJavaBlock extends AbstractJavaBlock{

  private final static int BEFORE_FIRST = 0;
  private final static int BEFORE_BLOCK = 1;
  private final static int AFTER_ELSE = 2;

  private final List<Indent> myIndentsBefore = new ArrayList<Indent>();

  public BlockContainingJavaBlock(final ASTNode node, final Wrap wrap, final Alignment alignment, final Indent indent, CodeStyleSettings settings) {
    super(node, wrap, alignment, indent, settings);
  }
  protected List<Block> buildChildren() {
    final ArrayList<Block> result = new ArrayList<Block>();
    Alignment childAlignment = createChildAlignment();
    Wrap childWrap = createChildWrap();

    buildChildren(result, childAlignment, childWrap);

    return result;

  }

  private void buildChildren(final ArrayList<Block> result, final Alignment childAlignment, final Wrap childWrap) {
    ASTNode child = myNode.getFirstChildNode();

    int state = BEFORE_FIRST;

    while (child != null) {
      if (!FormatterUtil.containsWhiteSpacesOnly(child) && child.getTextLength() > 0){
        final Indent indent = calcIndent(child,  state);
        myIndentsBefore.add(calcIndentBefore(child,  state));
        state = calcNewState(child, state);
        child = processChild(result, child, childAlignment, childWrap, indent);
        for (int i = myIndentsBefore.size(); i < result.size(); i++) {
          myIndentsBefore.add(Indent.getContinuationIndent());
        }
      }
      if (child != null) {
        child = child.getTreeNext();
      }
    }
  }

  private int calcNewState(final ASTNode child, final int state) {
    if (state == BEFORE_FIRST) {
      if (child.getElementType() == ElementType.ELSE_KEYWORD) {
        return AFTER_ELSE;
      }
      if (StdTokenSets.COMMENT_BIT_SET.contains(child.getElementType())) {
        return BEFORE_FIRST;
      }
      if (child.getElementType() == ElementType.CATCH_SECTION) {
        return BEFORE_FIRST;
      }
    } else if (state == BEFORE_BLOCK){
      if (child.getElementType() == ElementType.ELSE_KEYWORD) {
        return AFTER_ELSE;
      }
      if (child.getElementType() == ElementType.BLOCK_STATEMENT) {
        return BEFORE_FIRST;
      }
      if (child.getElementType() == ElementType.CODE_BLOCK) {
        return BEFORE_FIRST;
      }

    }
    return BEFORE_BLOCK;
  }

  private Indent calcIndent(final ASTNode child, final int state) {
    if (state == AFTER_ELSE && child.getElementType() == ElementType.IF_STATEMENT) {
      if (!mySettings.SPECIAL_ELSE_IF_TREATMENT) {
        return getCodeBlockInternalIndent(1);
      } else {
        return getCodeBlockExternalIndent();
      }
    }
    if (isSimpleStatement(child)){
      return createNormalIndent(1);
    }
    if (child.getElementType() == ElementType.ELSE_KEYWORD)
      return Indent.getNoneIndent();
    if (state == BEFORE_FIRST) {
      return Indent.getNoneIndent();
    }
    else if (child.getElementType() == ElementType.WHILE_KEYWORD) {
      return Indent.getNoneIndent();
    }
    else {
      if (isPartOfCodeBlock(child)) {
        return getCodeBlockExternalIndent();
      }
      else if (isSimpleStatement(child)){
        return getCodeBlockInternalIndent(1);
      }
      else if (StdTokenSets.COMMENT_BIT_SET.contains(child.getElementType())) {
        return getCodeBlockInternalIndent(1);
      }
      else {
        return Indent.getContinuationIndent();
      }
    }
  }

  private Indent calcIndentBefore(final ASTNode child, final int state) {
    if (state == AFTER_ELSE) {
      if (!mySettings.SPECIAL_ELSE_IF_TREATMENT) {
        return getCodeBlockInternalIndent(1);
      } else {
        return getCodeBlockExternalIndent();
      }
    }
    if (state == BEFORE_BLOCK && (isSimpleStatement(child) || child.getElementType() == ElementType.BLOCK_STATEMENT)){
      return getCodeBlockInternalIndent(0);
    }
    if (state == BEFORE_FIRST) {
      return getCodeBlockExternalIndent();
    }
    if (child.getElementType() == ElementType.ELSE_KEYWORD)
      return getCodeBlockExternalIndent();

    return Indent.getContinuationIndent();
  }

  private boolean isSimpleStatement(final ASTNode child) {
    if (child.getElementType() == ElementType.BLOCK_STATEMENT) return false;
    if (!ElementType.STATEMENT_BIT_SET.contains(child.getElementType())) return false;
    return isStatement(child, child.getTreeParent());
  }

  private boolean isPartOfCodeBlock(final ASTNode child) {
    if (child == null) return false;
    if (child.getElementType() == ElementType.BLOCK_STATEMENT) return true;
    if (child.getElementType() == ElementType.CODE_BLOCK) return true;

    if (FormatterUtil.containsWhiteSpacesOnly(child)) return isPartOfCodeBlock(child.getTreeNext());
    if (child.getElementType() == ElementType.END_OF_LINE_COMMENT) return isPartOfCodeBlock(child.getTreeNext());
    return child.getElementType() == JavaDocElementType.DOC_COMMENT;
  }

  protected Wrap getReservedWrap(final IElementType elementType) {
    return null;
  }

  protected void setReservedWrap(final Wrap reservedWrap, final IElementType operationType) {
  }

  @NotNull
  public ChildAttributes getChildAttributes(final int newChildIndex) {
    if (isAfter(newChildIndex, new IElementType[]{JavaDocElementType.DOC_COMMENT})) {
      return new ChildAttributes(Indent.getNoneIndent(), null);
    }

    if (myNode.getElementType() == ElementType.FOR_STATEMENT && mySettings.ALIGN_MULTILINE_FOR && isInsideForParens(newChildIndex)) {
      Alignment prev = getUsedAlignment(newChildIndex);
      if (prev != null) {
        return new ChildAttributes(null, prev);
      }
    }

    if (newChildIndex == 0) {
      return new ChildAttributes(getCodeBlockExternalIndent(), null);
    }

    if (newChildIndex == getSubBlocks().size()) {
      return new ChildAttributes(getCodeBlockChildExternalIndent(newChildIndex), null);
    }

    return new ChildAttributes(myIndentsBefore.get(newChildIndex), null);

  }

  private boolean isInsideForParens(final int newChildIndex) {
    final List<Block> subBlocks = getSubBlocks();
    for (int i = 0; i < newChildIndex; i++) {
      if (i >= subBlocks.size()) return false;
      final Block block = subBlocks.get(i);
      if (block instanceof LeafBlock) {
        if (((LeafBlock)block).getTreeNode().getElementType() == ElementType.RPARENTH) return false;
      }
    }
    return true;
  }

}


text:
import styled from 'styled-components';

import NormalImg from 'components/Img';

const Img = styled(NormalImg)`
  width: 100%;
  margin: 0 auto;
  display: block;
`;
export const ImgSmall = styled(NormalImg)`
  width: 20%;
  margin: 0 auto;
  display: block;
`;

export default Img;


text:
<?php

namespace Predis\Silex;

use PHPUnit_Framework_TestCase as StandardTestCase;
use Pimple;
use Silex\Application;
use Predis\Client;

/**
 *
 */
abstract class ProviderTestCase extends StandardTestCase
{
    abstract protected function getProviderInstance($prefix = 'predis');

    protected function register(Array $arguments = array(), ClientServiceProvider $provider = null)
    {
        $app = new Application();

        $app->register($provider ?: $this->getProviderInstance(), $arguments);
        $app->boot();

        return $app;
    }

    protected function getSomeParameters()
    {
        return array(
            'scheme' => 'tcp',
            'host' => '192.168.1.1',
            'port' => 1000
        );
    }

    protected function getParametersAndOptions(Client $client)
    {
        $parameters = $client->getConnection()->getParameters();
        $options = $client->getOptions();

        return array($parameters, $options);
    }

    protected function checkParameters(Pimple $container, $clientID, $parameters)
    {
        list($params,) = $this->getParametersAndOptions($container[$clientID]);

        foreach ($parameters as $k => $v) {
            $this->assertSame($v, $params->{$k});
        }
    }

    public function testProviderRegistration()
    {
        $app = $this->register();

        $this->checkRegisteredProvider($app, 'predis');
    }

    public function testPrefixProviderRegistration()
    {
        $prefix = 'my_predis';
        $app = $this->register(array(), $this->getProviderInstance($prefix));

        $this->checkRegisteredProvider($app, $prefix);
    }
}


text:
#include <aws/forecast/model/DescribePredictorBacktestExportJobResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::ForecastService::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribePredictorBacktestExportJobResult::DescribePredictorBacktestExportJobResult()
{
}

DescribePredictorBacktestExportJobResult::DescribePredictorBacktestExportJobResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DescribePredictorBacktestExportJobResult& DescribePredictorBacktestExportJobResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("PredictorBacktestExportJobArn"))
  {
    m_predictorBacktestExportJobArn = jsonValue.GetString("PredictorBacktestExportJobArn");

  }

  if(jsonValue.ValueExists("PredictorBacktestExportJobName"))
  {
    m_predictorBacktestExportJobName = jsonValue.GetString("PredictorBacktestExportJobName");

  }

  if(jsonValue.ValueExists("PredictorArn"))
  {
    m_predictorArn = jsonValue.GetString("PredictorArn");

  }

  if(jsonValue.ValueExists("Destination"))
  {
    m_destination = jsonValue.GetObject("Destination");

  }

  if(jsonValue.ValueExists("Message"))
  {
    m_message = jsonValue.GetString("Message");

  }

  if(jsonValue.ValueExists("Status"))
  {
    m_status = jsonValue.GetString("Status");

  }

  if(jsonValue.ValueExists("CreationTime"))
  {
    m_creationTime = jsonValue.GetDouble("CreationTime");

  }

  if(jsonValue.ValueExists("LastModificationTime"))
  {
    m_lastModificationTime = jsonValue.GetDouble("LastModificationTime");

  }

  return *this;
}


text:
from django.conf.urls import patterns, url

from .views import *

urlpatterns = patterns(
    '',
    url(r'^interesse-modal/(\d+)/$', InteresseFormView.as_view(template_name='inschrijven/interesse/modal.html'),
        name='interessemodal'),
    url(r'^interesse/(\d+)/$', InteresseFormView.as_view(template_name='inschrijven/interesse/plugin.html'),
        name='interesseformulier'),
    url(r'^inschrijven-modal/(\d+)/$', InschrijfView.as_view(template_name='inschrijven/inschrijven/modal.html'),
        name='inschrijfmodal'),
    url(r'^inschrijven/(\d+)/$', InschrijfView.as_view(template_name='inschrijven/inschrijven/plugin.html'),
        name='inschrijfformulier'),
    url(r'^confirmation/$', Confirmation.as_view(), name='confirmation'),
)


text:
'use strict';

/**
 * Module dependencies.
 */
require('./consumptions.server.model.js');
require('./payment.server.model.js');
var mongoose = require('mongoose'),
  Schema = mongoose.Schema,
  Consumption = mongoose.model('Consumption'),
  Payment = mongoose.model('Payment'),
  _ = require('underscore');

/**
 * Consumption Schema
 */
var ConsumptionUserSchema = new Schema({
  firstName: {
    type: String,
    trim: true,
    default: '',
  },
  lastName: {
    type: String,
    trim: true,
    default: '',
  },
  displayName: {
    type: String,
    trim: true
  },
  email: {
    type: String,
    unique: true,
    lowercase: true,
    trim: true,
    default: '',
  },
  username: {
    type: String,
    lowercase: true,
    trim: true
  },
  barcode: {
    type: Number
  }
}, {
  collection: 'users'
});

ConsumptionUserSchema.statics.getConsumed = function(params){
  return new Promise(function(resolve, reject){
    Consumption.aggregate([{
      $match: params
    },{
      $group: {
        _id: '$user',
        consumed: {
          $sum: '$price'
        }
      }
    }], function(err, results){
      if(err){
        reject(err);
      }else{
        resolve(results);
      }
    });

  });
};

ConsumptionUserSchema.statics.getPaid = function(params){
  return new Promise(function(resolve, reject){
    Payment.aggregate([{
      $match: params
    },{
      $group: {
        _id: '$user',
        paid: {
          $sum: '$amount'
        }
      }
    }], function(err, results){
      if(err){
        reject(err);
      }else{
        resolve(results);
      }
    });

  });
};

ConsumptionUserSchema.statics.getUsersWithBalance = function(params, single){
  var model = this.model('ConsumptionUser');
  return new Promise(function(resolve, reject){

    var users = [];
    var aggrParams = {};
    var consumed = [];
    var paid = [];

    var fn = single ? model.findOne : model.find;

    fn.apply(model, [params]).exec().then(function(results, err){
      var barcodes = single ? [results.barcode] : _.map(results, function(result){
        return result.barcode;
      });

      aggrParams = {
        user: {$in: barcodes}
      };

      users = single ? [results] : results;
      return ConsumptionUserSchema.statics.getConsumed(aggrParams);
    }).then(function(results, err){
      consumed = results;
      return ConsumptionUserSchema.statics.getPaid(aggrParams);
    }).then(function(results){
      paid = results;

      users = _.map(users, function(user){

        var userConsumed = _.find(consumed, function(userConsumed){
          return userConsumed._id === user.barcode;
        });

        var userPaid = _.find(paid, function(userPaid){
          return userPaid._id === user.barcode;
        });

        userConsumed = userConsumed ? userConsumed.consumed : 0;
        userPaid = userPaid ? userPaid.paid : 0;

        user = user.toObject();
        user.balance = userPaid - userConsumed;
        return user;
      });

      if(!single && params.sort){
        var sorting = JSON.parse(params.sort);
        for(var field in sorting) break;

        users = _.sortBy(users, function(user){
          return user[field];
        });

        if(sorting[field] < 0)
          users = users.reverse();
      }

      var returnValue = single ? users[0] : users;
      resolve(returnValue);
    }).catch(function(err){
      reject(err);
    });
  });
};

mongoose.model('ConsumptionUser', ConsumptionUserSchema);


text:
<?php defined('C5_EXECUTE') or die("Access Denied.");?>
<form method="post" id="site-form" action="<?php echo $view->action('update_library')?>">

		<?php echo t('Spam Whitelist Group')?>
		<?php echo $form->select('group_id', (array) $groups, $whitelistGroup);?>

	<?php echo $this->controller->token->output('update_library')?>
	<?php if (count($libraries) > 0) {
    ?>

		<?php echo $form->label('activeLibrary', t('Active Library'))?>
		<?php
        $activeHandle = '';
    if (is_object($activeLibrary)) {
        $activeHandle = $activeLibrary->getSystemAntispamLibraryHandle();
    }
    ?>

		<?php echo $form->select('activeLibrary', $libraries, $activeHandle, array('class' => 'form-control'))?>

		<?php if (is_object($activeLibrary)) {
    if ($activeLibrary->hasOptionsForm()) {
        if ($activeLibrary->getPackageID() > 0) {
            Loader::packageElement('system/antispam/' . $activeLibrary->getSystemAntispamLibraryHandle() . '/form', $activeLibrary->getPackageHandle());
        } else {
            Loader::element('system/antispam/' . $activeLibrary->getSystemAntispamLibraryHandle() . '/form');
        }
    }
}
    if (is_object($activeLibrary)) {
        ?>
			<fieldset>
				<legend style="margin-bottom: 0"><?php echo t('Log Settings')?></legend>

						<?php echo $form->checkbox('ANTISPAM_LOG_SPAM', 1, Config::get('concrete.log.spam'))?> <?php echo t('Log entries marked as spam.')?>

					<?php echo t('Logged entries can be found in Dashboard > Reports > Logs', $view->url('/dashboard/reports/logs'))?>

					<?php echo t('Email Notification')?>
					<?php echo $form->text('ANTISPAM_NOTIFY_EMAIL', Config::get('concrete.spam.notify_email'))?>
					<?php echo t('Any email address in this box will be notified when spam is detected.')?>

			</fieldset>
			<?php

    }
    ?>

	<?php
} else {
    ?>

<?php echo t('You have no anti-spam libraries installed.')?>

	<?php
} ?>

		    <?php echo Loader::helper('concrete/ui')->submit(t('Save'), 'submit', 'right', 'btn-primary')?>

</form>


text:
/* simple unit test for dynamic_array.c
 *
 * AUTHOR: Alex Lord.
 */
#include "array_test.h"

int* malloc_new_data(int data_value);

int main(void){
    Array* array = NULL;
    void* new_data = NULL;
    size_t error_check = 0;
    size_t i = 0;

    array = create_array(10);
    assert(array != NULL);
    assert(array->capacity == 10);

    for(i=0; i < 10; i++){
        new_data = malloc_new_data(i);
        error_check = add_element(array, new_data);
        assert(error_check == ARRAY_SUCCESS);
    }
    assert(array->capacity == 10);
    assert(array->end == 10);

    //test sequantial entry and
    for(i=0; i < 10; i++){
        assert(*(int*)array->data[i] == i);
    }

    new_data = malloc_new_data(10);
    error_check = add_element(array, new_data);
    assert(error_check == ARRAY_SUCCESS);
    assert(array->capacity == 20);
    assert(array->end == 11);

    error_check = delete_array(array);
    assert(error_check == ARRAY_SUCCESS);

    fprintf(stderr, "all tests passed\n");
    exit(0);
}

int* malloc_new_data(int data_value){
    int * data = NULL;
    data = malloc(sizeof(int));;
    *data = data_value;
    return data;
}


text:
<?php

/**
 * Class instance holder class.
 */
class Lisbeth_ObjectPool {
	/**
	 * @var array
	 */
	private static $instances = array();

	/**
	 * Return a class from object pool, using lazy initialisation.
	 *
	 * @param string $className
	 * @param int $parameter
	 * @return mixed instance of given $className
	 */
	public static function get($className, $parameter = null) {
		$parameter = (int)$parameter;

		if (!self::has($className, $parameter)) {
			$instance = (null === $parameter)
				? new $className()
				: new $className($parameter);

			self::set($instance, $className, $parameter);
		}

		return self::$instances[$className][$parameter];
	}

	/**
	 * @param $className
	 * @return array
	 */
	public static function classes($className) {
		if (array_key_exists($className, self::$instances)) {
			return self::$instances[$className];
		}

		return array();
	}

	/**
	 * @static
	 * @param string $className
	 * @param int $parameter
	 * @return bool
	 */
	public static function has($className, $parameter = null) {
		return isset(self::$instances[$className][$parameter]);
	}

	/**
	 * @static
	 * @param $instance
	 * @param $className
	 * @param null $parameter
	 */
	public static function set($instance, $className, $parameter = null) {
		self::$instances[$className][$parameter] = $instance;
	}

	public static function clear() {
		self::$instances = array();
	}
}


text:
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import lazyload from 'vue-lazyload'

import 'common/stylus/index.styl'

Vue.config.productionTip = false

Vue.use(lazyload, {loading: require('common/image/loading.gif')})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})


text:
require File.expand_path('../spec_helper', File.dirname(__FILE__))

describe 'Users' do

  def should_be_validated(user, password, message = "Password is invalid")
    assert(user.valid_ldap_authentication?(password), message)
  end

  def should_not_be_validated(user, password, message = "Password is not properly set")
     assert(!user.valid_ldap_authentication?(password), message)
  end

  describe "With default settings" do
    before do
      default_devise_settings!
      reset_ldap_server!
    end

    describe "look up and ldap user" do
      it "should return true for a user that does exist in LDAP" do
        assert_equal true, ::Devise::LdapAdapter.valid_login?('example.user@test.com')
      end

      it "should return false for a user that doesn't exist in LDAP" do
        assert_equal false, ::Devise::LdapAdapter.valid_login?('barneystinson')
      end
    end

    describe "create a basic user" do
      before do
        @user = Factory.create(:user)
      end

      it "should check for password validation" do
        assert_equal(@user.email, "example.user@test.com")
        should_be_validated @user, "secret"
        should_not_be_validated @user, "wrong_secret"
        should_not_be_validated @user, "Secret"
      end
    end

    describe "change a LDAP password" do
      before do
        @user = Factory.create(:user)
      end

      it "should change password" do
        should_be_validated @user, "secret"
        @user.password = "changed"
        @user.change_password!("secret")
        should_be_validated @user, "changed", "password was not changed properly on the LDAP sevrer"
      end

      it "should not allow to change password if setting is false" do
        should_be_validated @user, "secret"
        ::Devise.ldap_update_password = false
        @user.reset_password!("wrong_secret", "wrong_secret")
        should_not_be_validated @user, "wrong_secret"
        should_be_validated @user, "secret"
      end
    end

    describe "create new local user if user is in LDAP" do

      before do
        assert(User.all.blank?, "There shouldn't be any users in the database")
      end

      it "should don't create user in the database" do
        @user = User.authenticate_with_ldap(:email => "example.user@test.com", :password => "secret")
        assert(User.all.blank?)
      end

      describe "creating users is enabled" do
        before do
          ::Devise.ldap_create_user = true
        end

        it "should create a user in the database" do
          @user = User.authenticate_with_ldap(:email => "example.user@test.com", :password => "secret")
          assert_equal(User.all.size, 1)
          User.all.collect(&:email).should include("example.user@test.com")
        end

        it "should not create a user in the database if the password is wrong_secret" do
          @user = User.authenticate_with_ldap(:email => "example.user", :password => "wrong_secret")
          assert(User.all.blank?, "There's users in the database")
        end

        it "should create a user if the user is not in LDAP" do
          @user = User.authenticate_with_ldap(:email => "wrong_secret.user@test.com", :password => "wrong_secret")
          assert(User.all.blank?, "There's users in the database")
        end

        it "should create a user in the database if case insensitivity does not matter" do
          ::Devise.case_insensitive_keys = []
          @user = Factory.create(:user)

          expect do
            User.authenticate_with_ldap(:email => "EXAMPLE.user@test.com", :password => "secret")
          end.to change { User.count }.by(1)
        end

        it "should not create a user in the database if case insensitivity matters" do
          ::Devise.case_insensitive_keys = [:email]
          @user = Factory.create(:user)

          expect do
            User.authenticate_with_ldap(:email => "EXAMPLE.user@test.com", :password => "secret")
          end.to_not change { User.count }
        end

        it "should create a user with downcased email in the database if case insensitivity matters" do
          ::Devise.case_insensitive_keys = [:email]

          @user = User.authenticate_with_ldap(:email => "EXAMPLE.user@test.com", :password => "secret")
          User.all.collect(&:email).should include("example.user@test.com")
        end
      end

    end

    describe "use groups for authorization" do
      before do
        @admin = Factory.create(:admin)
        @user = Factory.create(:user)
        ::Devise.authentication_keys = [:email]
        ::Devise.ldap_check_group_membership = true
      end

      it "should admin should be allowed in" do
        should_be_validated @admin, "admin_secret"
      end

      it "should admin should have the proper groups set" do
        @admin.ldap_groups.should include('cn=admins,ou=groups,dc=test,dc=com')
      end

      it "should user should not be allowed in" do
        should_not_be_validated @user, "secret"
      end
    end

    describe "check group membership" do
      before do
        @admin = Factory.create(:admin)
        @user = Factory.create(:user)
      end

      it "should return true for admin being in the admins group" do
        assert_equal true, @admin.in_ldap_group?('cn=admins,ou=groups,dc=test,dc=com')
      end

      it "should return false for admin being in the admins group using the 'foobar' group attribute" do
        assert_equal false, @admin.in_ldap_group?('cn=admins,ou=groups,dc=test,dc=com', 'foobar')
      end

      it "should return true for user being in the users group" do
        assert_equal true, @user.in_ldap_group?('cn=users,ou=groups,dc=test,dc=com')
      end

      it "should return false for user being in the admins group" do
        assert_equal false, @user.in_ldap_group?('cn=admins,ou=groups,dc=test,dc=com')
      end

      it "should return false for a user being in a nonexistent group" do
        assert_equal false, @user.in_ldap_group?('cn=thisgroupdoesnotexist,ou=groups,dc=test,dc=com')
      end
    end

    describe "use role attribute for authorization" do
      before do
        @admin = Factory.create(:admin)
        @user = Factory.create(:user)
        ::Devise.ldap_check_attributes = true
      end

      it "should admin should be allowed in" do
        should_be_validated @admin, "admin_secret"
      end

      it "should user should not be allowed in" do
        should_not_be_validated @user, "secret"
      end
    end

    describe "use admin setting to bind" do
      before do
        @admin = Factory.create(:admin)
        @user = Factory.create(:user)
        ::Devise.ldap_use_admin_to_bind = true
      end

      it "should description" do
        should_be_validated @admin, "admin_secret"
      end
    end

  end

  describe "use uid for login" do
    before do
      default_devise_settings!
      reset_ldap_server!
      ::Devise.ldap_config = "#{Rails.root}/config/#{"ssl_" if ENV["LDAP_SSL"]}ldap_with_uid.yml"
      ::Devise.authentication_keys = [:uid]
    end

    describe "description" do
      before do
        @admin = Factory.create(:admin)
        @user = Factory.create(:user, :uid => "example_user")
      end

      it "should be able to authenticate using uid" do
        should_be_validated @user, "secret"
        should_not_be_validated @admin, "admin_secret"
      end
    end

    describe "create user" do
      before do
        ::Devise.ldap_create_user = true
      end

      it "should create a user in the database" do
        @user = User.authenticate_with_ldap(:uid => "example_user", :password => "secret")
        assert_equal(User.all.size, 1)
        User.all.collect(&:uid).should include("example_user")
      end

      it "should call ldap_before_save hooks" do
        User.class_eval do
          def ldap_before_save
            @foobar = 'foobar'
          end
        end
        user = User.authenticate_with_ldap(:uid => "example_user", :password => "secret")
        assert_equal 'foobar', user.instance_variable_get(:"@foobar")
        User.class_eval do
          undef ldap_before_save
        end
      end

      it "should not call ldap_before_save hook if not defined" do
        assert_nothing_raised do
          should_be_validated Factory.create(:user, :uid => "example_user"), "secret"
        end
      end
    end
  end

  describe "using ERB in the config file" do
    before do
      default_devise_settings!
      reset_ldap_server!
      ::Devise.ldap_config = "#{Rails.root}/config/#{"ssl_" if ENV["LDAP_SSL"]}ldap_with_erb.yml"
    end

    describe "authenticate" do
      before do
        @admin = Factory.create(:admin)
        @user = Factory.create(:user)
      end

      it "should be able to authenticate" do
        should_be_validated @user, "secret"
        should_be_validated @admin, "admin_secret"
      end
    end
  end

  describe "using variants in the config file" do
    before do
      default_devise_settings!
      reset_ldap_server!
      ::Devise.ldap_config = Rails.root.join 'config', 'ldap_with_boolean_ssl.yml'
    end

    it "should not fail if config file has ssl: true" do
      assert_nothing_raised do
        Devise::LdapAdapter::LdapConnect.new
      end
    end
  end

  describe "use username builder" do
    before do
      default_devise_settings!
      reset_ldap_server!
      ::Devise.ldap_auth_username_builder = Proc.new() do |attribute, login, ldap|
        "#{attribute}=#{login},ou=others,dc=test,dc=com"
      end
      @other = Factory.create(:other)
    end

    it "should be able to authenticate" do
      should_be_validated @other, "other_secret"
    end
  end

end


text:
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html

namespace opencv_test { namespace {

/****************************************************************************************\
*            Regression tests for feature detectors comparing keypoints.                 *
\****************************************************************************************/

class CV_FeatureDetectorTest : public cvtest::BaseTest
{
public:
    CV_FeatureDetectorTest( const string& _name, const Ptr<FeatureDetector>& _fdetector ) :
        name(_name), fdetector(_fdetector) {}

protected:
    bool isSimilarKeypoints( const KeyPoint& p1, const KeyPoint& p2 );
    void compareKeypointSets( const vector<KeyPoint>& validKeypoints, const vector<KeyPoint>& calcKeypoints );

    void emptyDataTest();
    void regressionTest(); // TODO test of detect() with mask

    virtual void run( int );

    string name;
    Ptr<FeatureDetector> fdetector;
};

void CV_FeatureDetectorTest::emptyDataTest()
{
    // One image.
    Mat image;
    vector<KeyPoint> keypoints;
    try
    {
        fdetector->detect( image, keypoints );
    }
    catch(...)
    {
        ts->printf( cvtest::TS::LOG, "detect() on empty image must not generate exception (1).\n" );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
    }

    if( !keypoints.empty() )
    {
        ts->printf( cvtest::TS::LOG, "detect() on empty image must return empty keypoints vector (1).\n" );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
        return;
    }

    // Several images.
    vector<Mat> images;
    vector<vector<KeyPoint> > keypointCollection;
    try
    {
        fdetector->detect( images, keypointCollection );
    }
    catch(...)
    {
        ts->printf( cvtest::TS::LOG, "detect() on empty image vector must not generate exception (2).\n" );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
    }
}

bool CV_FeatureDetectorTest::isSimilarKeypoints( const KeyPoint& p1, const KeyPoint& p2 )
{
    const float maxPtDif = 1.f;
    const float maxSizeDif = 1.f;
    const float maxAngleDif = 2.f;
    const float maxResponseDif = 0.1f;

    float dist = (float)cv::norm( p1.pt - p2.pt );
    return (dist < maxPtDif &&
            fabs(p1.size - p2.size) < maxSizeDif &&
            abs(p1.angle - p2.angle) < maxAngleDif &&
            abs(p1.response - p2.response) < maxResponseDif &&
            p1.octave == p2.octave &&
            p1.class_id == p2.class_id );
}

void CV_FeatureDetectorTest::compareKeypointSets( const vector<KeyPoint>& validKeypoints, const vector<KeyPoint>& calcKeypoints )
{
    const float maxCountRatioDif = 0.01f;

    // Compare counts of validation and calculated keypoints.
    float countRatio = (float)validKeypoints.size() / (float)calcKeypoints.size();
    if( countRatio < 1 - maxCountRatioDif || countRatio > 1.f + maxCountRatioDif )
    {
        ts->printf( cvtest::TS::LOG, "Bad keypoints count ratio (validCount = %d, calcCount = %d).\n",
                    validKeypoints.size(), calcKeypoints.size() );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
        return;
    }

    int progress = 0, progressCount = (int)(validKeypoints.size() * calcKeypoints.size());
    int badPointCount = 0, commonPointCount = max((int)validKeypoints.size(), (int)calcKeypoints.size());
    for( size_t v = 0; v < validKeypoints.size(); v++ )
    {
        int nearestIdx = -1;
        float minDist = std::numeric_limits<float>::max();

        for( size_t c = 0; c < calcKeypoints.size(); c++ )
        {
            progress = update_progress( progress, (int)(v*calcKeypoints.size() + c), progressCount, 0 );
            float curDist = (float)cv::norm( calcKeypoints[c].pt - validKeypoints[v].pt );
            if( curDist < minDist )
            {
                minDist = curDist;
                nearestIdx = (int)c;
            }
        }

        assert( minDist >= 0 );
        if( !isSimilarKeypoints( validKeypoints[v], calcKeypoints[nearestIdx] ) )
            badPointCount++;
    }
    ts->printf( cvtest::TS::LOG, "badPointCount = %d; validPointCount = %d; calcPointCount = %d\n",
                badPointCount, validKeypoints.size(), calcKeypoints.size() );
    if( badPointCount > 0.9 * commonPointCount )
    {
        ts->printf( cvtest::TS::LOG, " - Bad accuracy!\n" );
        ts->set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY );
        return;
    }
    ts->printf( cvtest::TS::LOG, " - OK\n" );
}

void CV_FeatureDetectorTest::regressionTest()
{
    assert( !fdetector.empty() );
    string imgFilename = string(ts->get_data_path()) + FEATURES2D_DIR + "/" + IMAGE_FILENAME;
    string resFilename = string(ts->get_data_path()) + DETECTOR_DIR + "/" + string(name) + ".xml.gz";

    // Read the test image.
    Mat image = imread( imgFilename );
    if( image.empty() )
    {
        ts->printf( cvtest::TS::LOG, "Image %s can not be read.\n", imgFilename.c_str() );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
        return;
    }

    FileStorage fs( resFilename, FileStorage::READ );

    // Compute keypoints.
    vector<KeyPoint> calcKeypoints;
    fdetector->detect( image, calcKeypoints );

    if( fs.isOpened() ) // Compare computed and valid keypoints.
    {
        // TODO compare saved feature detector params with current ones

        // Read validation keypoints set.
        vector<KeyPoint> validKeypoints;
        read( fs["keypoints"], validKeypoints );
        if( validKeypoints.empty() )
        {
            ts->printf( cvtest::TS::LOG, "Keypoints can not be read.\n" );
            ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
            return;
        }

        compareKeypointSets( validKeypoints, calcKeypoints );
    }
    else // Write detector parameters and computed keypoints as validation data.
    {
        fs.open( resFilename, FileStorage::WRITE );
        if( !fs.isOpened() )
        {
            ts->printf( cvtest::TS::LOG, "File %s can not be opened to write.\n", resFilename.c_str() );
            ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
            return;
        }
        else
        {
            fs << "detector_params" << "{";
            fdetector->write( fs );
            fs << "}";

            write( fs, "keypoints", calcKeypoints );
        }
    }
}

void CV_FeatureDetectorTest::run( int /*start_from*/ )
{
    if( !fdetector )
    {
        ts->printf( cvtest::TS::LOG, "Feature detector is empty.\n" );
        ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_TEST_DATA );
        return;
    }

    emptyDataTest();
    regressionTest();

    ts->set_failed_test_info( cvtest::TS::OK );
}

}} // namespace


text:
/* GlobalObj */
#define DISPID_GLOBAL_NAN           0x0000
#define DISPID_GLOBAL_INFINITY      0x0001
#define DISPID_GLOBAL_ARRAY         0x0002
#define DISPID_GLOBAL_BOOLEAN       0x0003
#define DISPID_GLOBAL_DATE          0x0004
#define DISPID_GLOBAL_FUNCTION      0x0005
#define DISPID_GLOBAL_NUMBER        0x0006
#define DISPID_GLOBAL_OBJECT        0x0007
#define DISPID_GLOBAL_STRING        0x0008
#define DISPID_GLOBAL_REGEXP        0x0009
#define DISPID_GLOBAL_ACTIVEXOBJ    0x000a
#define DISPID_GLOBAL_VBARRAY       0x000b
#define DISPID_GLOBAL_ENUMERATOR    0x000c
#define DISPID_GLOBAL_ESCAPE        0x000d
#define DISPID_GLOBAL_EVAL          0x000e
#define DISPID_GLOBAL_ISNAN         0x000f
#define DISPID_GLOBAL_ISFINITE      0x0010
#define DISPID_GLOBAL_PARSEINT      0x0011
#define DISPID_GLOBAL_PARSEFLOAT    0x0012
#define DISPID_GLOBAL_UNESCAPE      0x0013
#define DISPID_GLOBAL_GETOBJECT     0x0014
#define DISPID_GLOBAL_SCRIPTENGINE  0x0015
#define DISPID_GLOBAL_MAJORVER      0x0016
#define DISPID_GLOBAL_MINORVER      0x0017
#define DISPID_GLOBAL_BUILDVER      0x0018
#define DISPID_GLOBAL_COLLECT       0x0019
#define DISPID_GLOBAL_MATH          0x001a

/* DateObj */
#define DISPID_DATEOBJ_PARSE  0x0064
#define DISPID_DATEOBJ_UTC    0x0065

/* MathObj */
#define DISPID_MATHOBJ_E        0x00c8
#define DISPID_MATHOBJ_LOG2E    0x00c9
#define DISPID_MATHOBJ_LOG10E   0x00ca
#define DISPID_MATHOBJ_LN2      0x00cb
#define DISPID_MATHOBJ_LN10     0x00cc
#define DISPID_MATHOBJ_PI       0x00cd
#define DISPID_MATHOBJ_SQRT2    0x00ce
#define DISPID_MATHOBJ_SQRT1_2  0x00cf
#define DISPID_MATHOBJ_ABS      0x00d0
#define DISPID_MATHOBJ_ACOS     0x00d1
#define DISPID_MATHOBJ_ASIN     0x00d2
#define DISPID_MATHOBJ_ATAN     0x00d3
#define DISPID_MATHOBJ_ATAN2    0x00d4
#define DISPID_MATHOBJ_CEIL     0x00d5
#define DISPID_MATHOBJ_COS      0x00d6
#define DISPID_MATHOBJ_EXP      0x00d7
#define DISPID_MATHOBJ_FLOOR    0x00d8
#define DISPID_MATHOBJ_LOG      0x00d9
#define DISPID_MATHOBJ_MAX      0x00da
#define DISPID_MATHOBJ_MIN      0x00db
#define DISPID_MATHOBJ_POW      0x00dc
#define DISPID_MATHOBJ_RANDOM   0x00dd
#define DISPID_MATHOBJ_ROUND    0x00de
#define DISPID_MATHOBJ_SIN      0x00df
#define DISPID_MATHOBJ_SQRT     0x00e0
#define DISPID_MATHOBJ_TAN      0x00e1

/* NumberObj */
#define DISPID_NUMBEROBJ_MAX_VALUE          0x012c
#define DISPID_NUMBEROBJ_MIN_VALUE          0x012d
#define DISPID_NUMBEROBJ_NAN                0x012e
#define DISPID_NUMBEROBJ_NEGATIVE_INFINITY  0x012f
#define DISPID_NUMBEROBJ_POSITIVE_INFINITY  0x0130

/* RegExpObj */
#define DISPID_REGEXPOBJ_INDEX      0x0190
#define DISPID_REGEXPOBJ_INPUT      0x0191
#define DISPID_REGEXPOBJ_LASTINDEX  0x0192

/* StringObj */
#define DISPID_STRINGOBJ_FROMCHARCODE  0x01f4

/* ArrayInstance */
#define DISPID_ARRAY_LENGTH       0x0258
#define DISPID_ARRAY_CONCAT       0x0259
#define DISPID_ARRAY_JOIN         0x025a
#define DISPID_ARRAY_POP          0x025b
#define DISPID_ARRAY_PUSH         0x025c
#define DISPID_ARRAY_REVERSE      0x025d
#define DISPID_ARRAY_SHIFT        0x025e
#define DISPID_ARRAY_SLICE        0x025f
#define DISPID_ARRAY_SORT         0x0260
#define DISPID_ARRAY_SPLICE       0x0261
#define DISPID_ARRAY_TOSTRING     0x0262
#define DISPID_ARRAY_TOLOCSTRING  0x0263
#define DISPID_ARRAY_VALUEOF      0x0264
#define DISPID_ARRAY_UNSHIFT      0x0265
#define DISPID_ARRAY_HASOWNPROP   0x0266
#define DISPID_ARRAY_PROPISENUM   0x0267
#define DISPID_ARRAY_ISPROTOF     0x0268

/* FunctionInstance */
#define DISPID_FUNCTION_LENGTH       0x02bc
#define DISPID_FUNCTION_TOSTRING     0x02bd
#define DISPID_FUNCTION_TOLOCSTRING  0x02be
#define DISPID_FUNCTION_VALUEOF      0x02bf
#define DISPID_FUNCTION_APPLY        0x02c0
#define DISPID_FUNCTION_CALL         0x02c1
#define DISPID_FUNCTION_HASOWNPROP   0x02c2
#define DISPID_FUNCTION_PROPISENUM   0x02c3
#define DISPID_FUNCTION_ISPROTOF     0x02c4

/* StringInstance */
#define DISPID_STRING_LENGTH          0x0320
#define DISPID_STRING_TOSTRING        0x0321
#define DISPID_STRING_VALUEOF         0x0322
#define DISPID_STRING_ANCHOR          0x0323
#define DISPID_STRING_BIG             0x0324
#define DISPID_STRING_BLINK           0x0325
#define DISPID_STRING_BOLD            0x0326
#define DISPID_STRING_CHARAT          0x0327
#define DISPID_STRING_CHARCODEAT      0x0328
#define DISPID_STRING_CONCAT          0x0329
#define DISPID_STRING_FIXED           0x032a
#define DISPID_STRING_FONTCOLOR       0x032b
#define DISPID_STRING_FONTSIZE        0x032c
#define DISPID_STRING_INDEXOF         0x032d
#define DISPID_STRING_ITALICS         0x032e
#define DISPID_STRING_LASTINDEXOF     0x032f
#define DISPID_STRING_LINK            0x0330
#define DISPID_STRING_MATCH           0x0331
#define DISPID_STRING_REPLACE         0x0332
#define DISPID_STRING_SEARCH          0x0333
#define DISPID_STRING_SLICE           0x0334
#define DISPID_STRING_SMALL           0x0335
#define DISPID_STRING_SPLIT           0x0336
#define DISPID_STRING_STRIKE          0x0337
#define DISPID_STRING_SUB             0x0338
#define DISPID_STRING_SUBSTRING       0x0339
#define DISPID_STRING_SUBSTR          0x033a
#define DISPID_STRING_SUP             0x033b
#define DISPID_STRING_TOLOWERCASE     0x033c
#define DISPID_STRING_TOUPPERCASE     0x033d
#define DISPID_STRING_TOLOCLOWERCASE  0x033e
#define DISPID_STRING_TOLOCUPPERCASE  0x033f
#define DISPID_STRING_LOCCOMPARE      0x0340
#define DISPID_STRING_HASOWNPROP      0x0341
#define DISPID_STRING_PROPISENUM      0x0342
#define DISPID_STRING_ISPROTOF        0x0343

/* BoolInstance */
#define DISPID_BOOL_TOSTRING     0x0384
#define DISPID_BOOL_TOLOCSTRING  0x0385
#define DISPID_BOOL_VALUEOF      0x0386
#define DISPID_BOOL_HASOWNPROP   0x0387
#define DISPID_BOOL_PROPISENUM   0x0388
#define DISPID_BOOL_ISPROTOF     0x0389

/* NumberInstance */
#define DISPID_NUMBER_TOSTRING       0x03e8
#define DISPID_NUMBER_TOLOCSTRING    0x03e9
#define DISPID_NUMBER_TOFIXED        0x03ea
#define DISPID_NUMBER_TOEXPONENTIAL  0x03eb
#define DISPID_NUMBER_TOPRECISION    0x03ec
#define DISPID_NUMBER_VALUEOF        0x03ed
#define DISPID_NUMBER_HASOWNPROP     0x03ee
#define DISPID_NUMBER_PROPISENUM     0x03ef
#define DISPID_NUMBER_ISPROTOF       0x03f0

/* ObjectInstance */
#define DISPID_OBJECT_TOSTRING     0x044c
#define DISPID_OBJECT_TOLOCSTRING  0x044d
#define DISPID_OBJECT_HASOWNPROP   0x044e
#define DISPID_OBJECT_PROPISENUM   0x044f
#define DISPID_OBJECT_ISPROTOF     0x0450
#define DISPID_OBJECT_VALUEOF      0x0451

/* DateInstance */
#define DISPID_DATE_TOSTRING            0x04b0
#define DISPID_DATE_TOLOCSTRING         0x04b1
#define DISPID_DATE_HASOWNPROP          0x04b2
#define DISPID_DATE_PROPISENUM          0x04b3
#define DISPID_DATE_ISPROTOF            0x04b4
#define DISPID_DATE_VALUEOF             0x04b5
#define DISPID_DATE_TOUTCSTRING         0x04b6
#define DISPID_DATE_TODATESTRING        0x04b7
#define DISPID_DATE_TOTIMESTRING        0x04b8
#define DISPID_DATE_TOLOCDATESTRING     0x04b9
#define DISPID_DATE_TOLOCTIMESTRING     0x04ba
#define DISPID_DATE_GETTIME             0x04bb
#define DISPID_DATE_GETFULLYEAR         0x04bc
#define DISPID_DATE_GETUTCFULLYEAR      0x04bd
#define DISPID_DATE_GETMONTH            0x04be
#define DISPID_DATE_GETUTCMONTH         0x04bf
#define DISPID_DATE_GETDATE             0x04c0
#define DISPID_DATE_GETUTCDATE          0x04c1
#define DISPID_DATE_GETDAY              0x04c2
#define DISPID_DATE_GETUTCDAY           0x04c3
#define DISPID_DATE_GETHOURS            0x04c4
#define DISPID_DATE_GETUTCHOURS         0x04c5
#define DISPID_DATE_GETMINUTES          0x04c6
#define DISPID_DATE_GETUTCMINUTES       0x04c7
#define DISPID_DATE_GETSECONDS          0x04c8
#define DISPID_DATE_GETUTCSECONDS       0x04c9
#define DISPID_DATE_GETMILLISECONDS     0x04ca
#define DISPID_DATE_GETUTCMILLISECONDS  0x04cb
#define DISPID_DATE_GETTIMEZONEOFFSET   0x04cc
#define DISPID_DATE_SETTIME             0x04cd
#define DISPID_DATE_SETMILLISECONDS     0x04ce
#define DISPID_DATE_SETUTCMILLISECONDS  0x04cf
#define DISPID_DATE_SETSECONDS          0x04d0
#define DISPID_DATE_SETUTCSECONDS       0x04d1
#define DISPID_DATE_SETMINUTES          0x04d2
#define DISPID_DATE_SETUTCMINUTES       0x04d3
#define DISPID_DATE_SETHOURS            0x04d4
#define DISPID_DATE_SETUTCHOURS         0x04d5
#define DISPID_DATE_SETDATE             0x04d6
#define DISPID_DATE_SETUTCDATE          0x04d7
#define DISPID_DATE_SETMONTH            0x04d8
#define DISPID_DATE_SETUTCMONTH         0x04d9
#define DISPID_DATE_SETFULLYEAR         0x04da
#define DISPID_DATE_SETUTCFULLYEAR      0x04db

/* RegExpInstance */
#define DISPID_REGEXP_SOURCE       0x0514
#define DISPID_REGEXP_GLOBAL       0x0515
#define DISPID_REGEXP_IGNORECASE   0x0516
#define DISPID_REGEXP_MULTILINE    0x0517
#define DISPID_REGEXP_LASTINDEX    0x0518
#define DISPID_REGEXP_TOSTRING     0x0519
#define DISPID_REGEXP_TOLOCSTRING  0x051a
#define DISPID_REGEXP_HASOWNPROP   0x051b
#define DISPID_REGEXP_PROPISENUM   0x051c
#define DISPID_REGEXP_ISPROTOF     0x051d
#define DISPID_REGEXP_EXEC         0x051e

/* ErrorInstance */
#define DISPID_ERROR_NAME         0x0578
#define DISPID_ERROR_MESSAGE      0x0579
#define DISPID_ERROR_IGNORECASE   0x057a
#define DISPID_ERROR_MULTILINE    0x057b
#define DISPID_ERROR_LASTINDEX    0x057c
#define DISPID_ERROR_TOSTRING     0x057d
#define DISPID_ERROR_TOLOCSTRING  0x057e
#define DISPID_ERROR_HASOWNPROP   0x057f
#define DISPID_ERROR_PROPISENUM   0x0580
#define DISPID_ERROR_ISPROTOF     0x0581


text:
class HL7::Message::Segment::AIP < HL7::Message::Segment
  weight 0
  add_field :set_id
  add_field :segment_action_code
  add_field :personnel_resource_id
  add_field :resource_role
  add_field :resource_group
  add_field :start_date_time
  add_field :start_date_time_offset
  add_field :start_date_time_offset_units
  add_field :duration
  add_field :duration_units
  add_field :allow_substitution_code
  add_field :filler_status_code
end


text:
![banner](https://user-images.githubusercontent.com/15742618/27032120-e55acbd0-4f90-11e7-8811-f8aa3d15b5aa.png)

An internship project that provides various insights, and analysis, through visualizations for [IPL](http://www.iplt20.com/)(Indian Premier League) using Pyspark, Flask, Bokeh, and Pygal.

## Pre-requisites
* [Python 2.7](https://www.python.org/download/releases/2.7/)
* [Pyspark 2.1.1](https://spark.apache.org/downloads.html)
* [Bokeh 0.12.5](http://bokeh.pydata.org/en/latest/)
* [Flask 0.12.2](https://pypi.python.org/pypi/Flask/0.12.2)
* [Pygal 2.4.0](http://pygal.org/en/stable/installing.html)

## How to run
* Execute run.sh
* Choose desired operation (RunWebServer or UnitTesting)
* Access WebServer URL for further usage instructions (default: http://localhost:5000/)

## Screenshots
* TO-DO

## Team PySpy
* [Vivek Patel](https://github.com/Necrote)
* [Kishan Chawla](https://github.com/kris0107)

## Dataset Sources
* [Kaggle IPL Dataset](https://www.kaggle.com/manasgarg/ipl)

## Track Progress
* [Trello](https://trello.com/b/xMd8BeIs/pyspy-weekwise)

## License
#### MIT


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta name="description" content="Neon Admin Panel" />
	<meta name="author" content="Laborator.co" />

	<title>Neon | Form Wizard</title>

	<link rel="stylesheet" href="../../../neon-x/assets/js/jquery-ui/css/no-theme/jquery-ui-1.10.3.custom.min.css"  id="style-resource-1">
	<link rel="stylesheet" href="../../../neon-x/assets/css/font-icons/entypo/css/entypo.css"  id="style-resource-2">
	<link rel="stylesheet" href="../../../neon-x/assets/css/font-icons/entypo/css/animation.css"  id="style-resource-3">
	<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Noto+Sans:400,700,400italic"  id="style-resource-4">
	<link rel="stylesheet" href="../../../neon-x/assets/css/neon.css"  id="style-resource-5">
	<link rel="stylesheet" href="../../../neon-x/assets/css/custom.css"  id="style-resource-6">

					<form method="get" action="#">
						<input type="text" name="q" class="search-input" placeholder="Search something..." />
						<button type="submit"></button>
					</form>

		Dashboard

			Dashboard 1

			Dashboard 2

		Layouts

			Layout API

			Collapsed Sidebar

			Fixed Sidebar

			Chat Open

			Horizontal Menu Boxed

			Horizontal Menu Fluid

			Mixed Menus

			Page Enter Transitions

				Fade Scale

				Left In

				Right In

				Fade Only

		UI Elements

			Panels

			Tiles

			Buttons

			Typography

			Tabs & Accordions

			Tooltips & Popovers

			Navbars

			Breadcrumbs

			Badges & Labels

			Progress Bars

			Modals

			Blockquotes

			Alerts

			Pagination

		Mailbox8

			Inbox

			Compose Message

			View Message

		Forms

			Basic Elements

			Advanced Plugins

			Form Wizard

			Data Validation

			Input Masks

			Sliders

			File Upload

			Editors

		Tables

			Basic Tables

			Data Tables

		ExtraNew Items

			Icons3

				Font Awesome

				Entypo

				Glyph Icons

			Portlets

			Maps

				Google Maps

				Vector Maps

			Chat API

			Calendar

			Lockscreen

			Login

			Invoice

			404 Page

			Blank Page

			Tocify

			Notifications

			Scrollbox

		Charts

		Menu Levels

			Menu Level 1.1

			Menu Level 1.2

			Menu Level 1.3

				Menu Level 2.1

				Menu Level 2.2

					Menu Level 3.1

						Menu Level 4.1

					Menu Level 3.2

				Menu Level 2.3

					Art Ramadani

							Edit Profile

							Inbox

							Calendar

							Tasks

					6

		Mark all Read
		You have 3 new notifications.

					New user registered

					30 seconds ago

					Someone special liked this

					2 minutes ago

					Privacy settings have been changed

					3 hours ago

					John cancelled the event

					9 hours ago

					The server is status is stable

					yesterday at 10:30am

					New comments waiting approval

					last week

	View all notifications

					10

					Luc Chartier
					- yesterday

					This ain't our first item, it is the best of the rest.

					Salma Nyberg
					- 2 days ago

					Oh he decisively impression attachment friendship so if everything.

					Hayden Cartwright
					- a week ago

					Whose her enjoy chief new young. Felicity if ye required likewise so doubtful.

					Sandra Eberhardt
					- 16 days ago

					On so attention necessary at by provision otherwise existence direction.

	All Messages

					1

You have 6 pending tasks

					Procurement
					27%

						27% Complete

					App Development
					83%

						83% Complete

					HTML Slicing
					91%

						91% Complete

					Database Repair
					12%

						12% Complete

					Backup Create Progress
					54%

						54% Complete

					Upgrade Progress
					17%

						17% Complete

	See all tasks

				Live Site

					Chat

					0

					Log Out

				Home

							Forms

							Form Wizard

Form Wizard

Simple Form Wizard - add class form-wizard to the form

<form id="rootwizard" method="post" action="#" class="form-horizontal form-wizard">

			1First

			2Second

			3Third

			4Forth

			5Fifth

			6Sixth

			7Seventh

1

2

3

4

5

6

7

				First

				 Previous

				Last

				Next

</form>

Form Wizard with Validation - add class validate to the form

Please fill the details to register new account.

<form id="rootwizard-2" method="post" action="#" class="form-wizard validate">

			1Personal Info

			2Address

			3Education

			4Work Experience

			5Register

						Full Name
						<input class="form-control" name="full_name" id="full_name" data-validate="required" placeholder="Your full name" />

						Date of Birth
						<input class="form-control" name="birthdate" id="birthdate" data-validate="required" data-mask="date" placeholder="Pre-formatted birth date" />

						Write Something About You
						<textarea class="form-control autogrow" name="about" id="about" data-validate="minlength[10]" rows="5" placeholder="Could be used also as Motivation Letter"></textarea>

						Street
						<input class="form-control" name="street" id="street" data-validate="required" placeholder="Enter your street address" />

						Door no.
						<input class="form-control" name="door_no" id="door_no" data-validate="number" placeholder="Numbers only" />

						Address Line 2
						<input class="form-control" name="address_line_2" id="address_line_2" placeholder="(Optional) Secondary Address" />

						City
						<input class="form-control" name="city" id="city" data-validate="required" placeholder="Current city" />

						State

						<select name="test" class="selectboxit">
							<optgroup label="United States">
								<option value="1">Alabama</option>
								<option value="2">Boston</option>
								<option value="3">Ohaio</option>
								<option value="4">New York</option>
								<option value="5">Washington</option>
							</optgroup>
						</select>

						Zip
						<input class="form-control" name="zip" id="zip" data-mask="** *** **" data-validate="required" placeholder="Zip Code" />

			Primary School

						Subject
						<input class="form-control" name="prim_subject" id="prim_subject" data-validate="require" placeholder="Graduation Degree" />

						School Name
						<input class="form-control" name="prim_school" id="prim_school" placeholder="Which school did you attended" />

						Start Date
						<input class="form-control datepicker" name="prim_date_start" id="prim_date_start" data-start-view="2" placeholder="(Optional)" />

						End Date
						<input class="form-control datepicker" name="prim_date_end" id="prim_date_end" data-start-view="2" placeholder="(Optional)" />

			Secondary School

						Subject
						<input class="form-control" name="second_subject" id="second_subject" data-validate="require" placeholder="High School" />

						School Name
						<input class="form-control" name="second_school" id="second_school" placeholder="Which school did you attended" />

						Start Date
						<input class="form-control datepicker" name="second_date_start" id="second_date_start" data-start-view="2" placeholder="(Optional)" />

						End Date
						<input class="form-control datepicker" name="second_date_end" id="second_date_end" data-start-view="2" placeholder="(Optional)" />

						Other Qualifications
						<textarea class="form-control autogrow" name="other_qualifications" id="other_qualifications" placeholder="List one subject per row"></textarea>

			Current & Past Jobs

						1

						Company Name
						<input class="form-control" name="job_position_1" id="job_position_1" data-validate="require" placeholder="Your current job" />

						Job Position
						<input class="form-control" name="job_position_1" id="job_position_1" data-validate="require" placeholder="Your current position" />

						Start Date
						<input class="form-control datepicker" name="job_position_start_date_1" id="job_position_start_date_1" placeholder="(Optional)" />

						End Date
						<input class="form-control datepicker" name="job_position_end_date_1" id="job_position_end_date_1" placeholder="(Optional)" />

						2

						Company Name
						<input class="form-control" name="job_position_2" id="job_position_2" data-validate="require" placeholder="(Optional)" />

						Job Position
						<input class="form-control" name="job_position_2" id="job_position_2" data-validate="require" placeholder="(Optional)" />

						Start Date
						<input class="form-control datepicker" name="job_position_start_date_2" id="job_position_start_date_2" placeholder="(Optional)" />

						End Date
						<input class="form-control datepicker" name="job_position_end_date_2" id="job_position_end_date_2" placeholder="(Optional)" />

						3

						Company Name
						<input class="form-control" name="job_position_3" id="job_position_3" data-validate="require" placeholder="(Optional)" />

						Job Position
						<input class="form-control" name="job_position_3" id="job_position_3" data-validate="require" placeholder="(Optional)" />

						Start Date
						<input class="form-control datepicker" name="job_position_start_date_3" id="job_position_start_date_3" placeholder="(Optional)" />

						End Date
						<input class="form-control datepicker" name="job_position_end_date_3" id="job_position_end_date_3" placeholder="(Optional)" />

						4

						Company Name
						<input class="form-control" name="job_position_4" id="job_position_4" data-validate="require" placeholder="(Optional)" />

						Job Position
						<input class="form-control" name="job_position_4" id="job_position_4" data-validate="require" placeholder="(Optional)" />

						Start Date
						<input class="form-control datepicker" name="job_position_start_date_4" id="job_position_start_date_4" placeholder="(Optional)" />

						End Date
						<input class="form-control datepicker" name="job_position_end_date_4" id="job_position_end_date_4" placeholder="(Optional)" />

				Choose Username

					<input type="text" class="form-control" name="username" id="username" data-validate="required,minlength[5]" data-message-minlength="Username must have minimum of 5 chars." placeholder="Could also be your email" />

						Choose Password

							<input type="password" class="form-control" name="password" id="password" data-validate="required" placeholder="Enter strong password" />

						Repeat Password

							<input type="password" class="form-control" name="password" id="password" data-validate="required,equalTo[#password]" data-message-equal-to="Passwords doesn't match." placeholder="Confirm password" />

						Include Services

						<select multiple="multiple" name="my-select[]" class="form-control multi-select">
							<option value="1">Web Builder</option>
							<option value="2" selected>Server Side Scripting</option>
							<option value="3">Secure Connection</option>
							<option value="4" selected>Database Access</option>
							<option value="5" selected>Email</option>
							<option value="6">eCommerce</option>
						</select>

						Gender

						    <input type="checkbox" checked>

						Subscribe for Newsletter

						    <input type="checkbox" checked>

							Auto-renew Subscription
							Yearly

						    <input type="checkbox" checked>

					<input type="checkbox" name="chk-rules" id="chk-rules" data-validate="required" data-message-message="You must accept rules in order to complete this registration.">
					By registering I accept terms and conditions.

				<button type="submit" class="btn btn-primary">Finish Registration</button>

				 Previous

				Next

</form>

		Purchase this theme for $21

	© 2013 Neon Admin Theme by Laborator

			Chat
			0

			Favorites

			 Catherine J. Watkins
			 Nicholas R. Walker
			 Susan J. Best
			 Brandon S. Young
			 Fernando G. Olson

			Work

			 Robert J. Garcia
			 Daniel A. Pena
			 Rodrigo E. Lozano

			Social

			 Velma G. Pearson
			 Margaret R. Dedmon
			 Kathleen M. Canales
			 Tracy J. Rodriguez

			<textarea class="form-control autogrow" placeholder="Type your message"></textarea>

		Art Ramadani

Are you here?

		09:00

		Catherine J. Watkins

This message is pre-queued.

		09:25

		Catherine J. Watkins

Whohoo!

		09:26

		Catherine J. Watkins

Do you like it?

		09:27

		Daniel A. Pena

I am going out.

		08:21

		Daniel A. Pena

Call me when you see this message.

		08:27

	<link rel="stylesheet" href="../../../neon-x/assets/js/selectboxit/jquery.selectBoxIt.css"  id="style-resource-1">


text:
package javax.servlet.http;

import java.io.IOException;
import java.util.Hashtable;
import java.util.ResourceBundle;
import java.util.StringTokenizer;

import javax.servlet.ServletInputStream;

/**
 * @deprecated            As of Java(tm) Servlet API 2.3.
 *                        These methods were only useful
 *                        with the default encoding and have been moved
 *                        to the request interfaces.
 */
@SuppressWarnings("dep-ann") // Spec API does not use @Deprecated
public class HttpUtils {

    private static final String LSTRING_FILE =
        "javax.servlet.http.LocalStrings";
    private static final ResourceBundle lStrings =
        ResourceBundle.getBundle(LSTRING_FILE);

    /**
     * Constructs an empty HttpUtils object.
     *
     */
    public HttpUtils() {
        // NOOP
    }

    /**
     *
     * Parses a query string passed from the client to the
     * server and builds a HashTable object
     * with key-value pairs.
     * The query string should be in the form of a string
     * packaged by the GET or POST method, that is, it
     * should have key-value pairs in the form key=value,
     * with each pair separated from the next by a & character.
     *
     *
A key can appear more than once in the query string
     * with different values. However, the key appears only once in
     * the hashtable, with its value being
     * an array of strings containing the multiple values sent
     * by the query string.
     *
     *
The keys and values in the hashtable are stored in their
     * decoded form, so
     * any + characters are converted to spaces, and characters
     * sent in hexadecimal notation (like %xx) are
     * converted to ASCII characters.
     *
     * @param s                a string containing the query to be parsed
     *
     * @return                a HashTable object built
     *                         from the parsed key-value pairs
     *
     * @exception IllegalArgumentException        if the query string
     *                                                is invalid
     *
     */
    public static Hashtable<String,String[]> parseQueryString(String s) {

        String valArray[] = null;

        if (s == null) {
            throw new IllegalArgumentException();
        }
        Hashtable<String,String[]> ht = new Hashtable<>();
        StringBuilder sb = new StringBuilder();
        StringTokenizer st = new StringTokenizer(s, "&");
        while (st.hasMoreTokens()) {
            String pair = st.nextToken();
            int pos = pair.indexOf('=');
            if (pos == -1) {
                // XXX
                // should give more detail about the illegal argument
                throw new IllegalArgumentException();
            }
            String key = parseName(pair.substring(0, pos), sb);
            String val = parseName(pair.substring(pos+1, pair.length()), sb);
            if (ht.containsKey(key)) {
                String oldVals[] = ht.get(key);
                valArray = new String[oldVals.length + 1];
                for (int i = 0; i < oldVals.length; i++)
                    valArray[i] = oldVals[i];
                valArray[oldVals.length] = val;
            } else {
                valArray = new String[1];
                valArray[0] = val;
            }
            ht.put(key, valArray);
        }
        return ht;
    }

    /**
     *
     * Parses data from an HTML form that the client sends to
     * the server using the HTTP POST method and the
     * application/x-www-form-urlencoded MIME type.
     *
     *
The data sent by the POST method contains key-value
     * pairs. A key can appear more than once in the POST data
     * with different values. However, the key appears only once in
     * the hashtable, with its value being
     * an array of strings containing the multiple values sent
     * by the POST method.
     *
     *
The keys and values in the hashtable are stored in their
     * decoded form, so
     * any + characters are converted to spaces, and characters
     * sent in hexadecimal notation (like %xx) are
     * converted to ASCII characters.
     *
     *
     *
     * @param len        an integer specifying the length,
     *                        in characters, of the
     *                        ServletInputStream
     *                        object that is also passed to this
     *                        method
     *
     * @param in        the ServletInputStream
     *                        object that contains the data sent
     *                        from the client
     *
     * @return                a HashTable object built
     *                        from the parsed key-value pairs
     *
     *
     * @exception IllegalArgumentException        if the data
     *                        sent by the POST method is invalid
     *
     */
    public static Hashtable<String,String[]> parsePostData(int len,
                                          ServletInputStream in) {
        // XXX
        // should a length of 0 be an IllegalArgumentException

        // cheap hack to return an empty hash
        if (len <=0)
            return new Hashtable<>();

        if (in == null) {
            throw new IllegalArgumentException();
        }

        // Make sure we read the entire POSTed body.
        byte[] postedBytes = new byte [len];
        try {
            int offset = 0;

            do {
                int inputLen = in.read (postedBytes, offset, len - offset);
                if (inputLen <= 0) {
                    String msg = lStrings.getString("err.io.short_read");
                    throw new IllegalArgumentException (msg);
                }
                offset += inputLen;
            } while ((len - offset) > 0);

        } catch (IOException e) {
            throw new IllegalArgumentException(e.getMessage(), e);
        }

        // XXX we shouldn't assume that the only kind of POST body
        // is FORM data encoded using ASCII or ISO Latin/1 ... or
        // that the body should always be treated as FORM data.
        try {
            String postedBody = new String(postedBytes, 0, len, "8859_1");
            return parseQueryString(postedBody);
        } catch (java.io.UnsupportedEncodingException e) {
            // XXX function should accept an encoding parameter & throw this
            // exception.  Otherwise throw something expected.
            throw new IllegalArgumentException(e.getMessage(), e);
        }
    }

    /*
     * Parse a name in the query string.
     */
    private static String parseName(String s, StringBuilder sb) {
        sb.setLength(0);
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            switch (c) {
            case '+':
                sb.append(' ');
                break;
            case '%':
                try {
                    sb.append((char) Integer.parseInt(s.substring(i+1, i+3),
                                                      16));
                    i += 2;
                } catch (NumberFormatException e) {
                    // XXX
                    // need to be more specific about illegal arg
                    throw new IllegalArgumentException();
                } catch (StringIndexOutOfBoundsException e) {
                    String rest  = s.substring(i);
                    sb.append(rest);
                    if (rest.length()==2)
                        i++;
                }

                break;
            default:
                sb.append(c);
                break;
            }
        }
        return sb.toString();
    }

    /**
     *
     * Reconstructs the URL the client used to make the request,
     * using information in the HttpServletRequest object.
     * The returned URL contains a protocol, server name, port
     * number, and server path, but it does not include query
     * string parameters.
     *
     *
Because this method returns a StringBuffer,
     * not a string, you can modify the URL easily, for example,
     * to append query parameters.
     *
     *
This method is useful for creating redirect messages
     * and for reporting errors.
     *
     * @param req        a HttpServletRequest object
     *                        containing the client's request
     *
     * @return                a StringBuffer object containing
     *                        the reconstructed URL
     *
     */
    public static StringBuffer getRequestURL (HttpServletRequest req) {
        StringBuffer url = new StringBuffer ();
        String scheme = req.getScheme ();
        int port = req.getServerPort ();
        String urlPath = req.getRequestURI();

        url.append (scheme);                // http, https
        url.append ("://");
        url.append (req.getServerName ());
        if ((scheme.equals ("http") && port != 80)
                || (scheme.equals ("https") && port != 443)) {
            url.append (':');
            url.append (req.getServerPort ());
        }

        url.append(urlPath);
        return url;
    }
}


text:
#ifndef _PACKET_SMB_BROWSE_H_
#define _PACKET_SMB_BROWSE_H_

int
dissect_smb_server_type_flags(tvbuff_t *tvb, int offset, packet_info *pinfo,
			      proto_tree *parent_tree, guint8 *drep,
			      gboolean infoflag);

#endif


text:
Some demo images to play with :)

The ND2 files are real samples. The TIF file is a synthetic sample in which each channel ("ordered" = first channel, "disordered" = second) ramps from zero to 100% intensity with ordered highest on the left and disordered highest on the right side of the image.

### To process the DemoTest_3Ch.tif file:
- Open the macro in ImageJ/Fiji
- Run the macro
- Locate the folder containing DemoTest_3Ch.tif (doesn't matter if the .nd2 files are there also!) and select that folder.
- In the settings:
  - adjust the Input file extension to .tif
  - ordered is channel 1, disordered is channel 2, and immunofluo is channel 3.
  - Highly recommended: change the LUT from 16_colors to something with a sensible (continuous) range. The 'low end' of 16_colors is black, so all your disordered data will be black and these images are also using intensity data from another image which will use black as 'dim intensity'. So it all gets very misleading. The top end is white, which also causes interpretation problems. If you like, run it twice with different LUTs and see which ones are more informative. The 16_colors LUT is selected to be compatible with the history of this macro.
- Click OK to run and check the Results folder when it's done.

### To process the ND2 files:
- As above, but leave the file extension as .nd2
- Leave the IF channel as 3
- Leave the HSB brightness source as 'Sum & IF' (you'll get an HSB image for each).
- Ideally also adjust the LUT to something sensible or at least compare a sensible LUT to 16_colors.


text:
class EmailTemplate < ActiveRecord::Base
  belongs_to :competition
  validates :competition, presence: true

  validates :name, presence: true
  validates :name, uniqueness: { scope: :competition_id, case_sensitive: true }, allow_nil: true, allow_blank: true

  validates :subject, liquid: true, allow_nil: true, allow_blank: true
  validates :content, liquid: true, allow_nil: true, allow_blank: true

  auto_strip_attributes :name, :subject
end


text:
{{<layout-agent}}

{{$content}}

  <form action="/" method="post" class="form">

      Text verification

We've sent you a text message with a verification code

      Enter verification code

      <input type="text" class="form-control" id="full-name">

I haven't recieved a text

      Continue

  </form>

{{/content}}

{{/layout-agent}}


text:
Dashboard

Friends

Mailings

Recruit

Zach Smith

          Logout

      Powered by Amicus

      Data by Catalist

  <form accept-charset="UTF-8" action="/facebook_users" id="facebook_hidden_login_form" method="post">

<input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="KCdtCpFIHNS2X46CDN1IoXaEZSc7CrW+2+rIyqMhOws=" />

    <input id="signed_request" name="signed_request" type="hidden" />
    <input id="access_token" name="access_token" type="hidden" />
    <input id="facebook_redirect_to" name="facebook_redirect_to" type="hidden" />
  </form>


text:
from wtforms import BooleanField, StringField
from wtforms.validators import DataRequired

from indico.modules.designer.models.templates import TemplateType
from indico.util.i18n import _
from indico.web.forms.base import IndicoForm
from indico.web.forms.fields import IndicoEnumSelectField
from indico.web.forms.widgets import SwitchWidget

class AddTemplateForm(IndicoForm):
    title = StringField(_('Title'), [DataRequired()])
    type = IndicoEnumSelectField(_('Template'), enum=TemplateType, default=TemplateType.poster)
    is_clonable = BooleanField(_('Allow cloning'), widget=SwitchWidget(), default=True,
                               description=_("Allow cloning this template in subcategories and events"))


text:
SYNONYM

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

#### Published in
Verh. Mitth. Siebenbürg. Vereins Naturwiss. Hermannstadt 4:91. 1853

#### Original name
null

### Remarks
null