text:
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
 *  Main authors:
 *     Christian Schulte <schulte@gecode.org>
 *
 *  Copyright:
 *     Christian Schulte, 2007
 *
 *  Last modified:
 *     $Date: 2011-09-06 14:19:49 +0200 (Tue, 06 Sep 2011) $ by $Author: schulte $
 *     $Revision: 12393 $
 *
 *  This file is part of Gecode, the generic constraint
 *  development environment:
 *     http://www.gecode.org
 *
 *  Permission is hereby granted, free of charge, to any person obtaining
 *  a copy of this software and associated documentation files (the
 *  "Software"), to deal in the Software without restriction, including
 *  without limitation the rights to use, copy, modify, merge, publish,
 *  distribute, sublicense, and/or sell copies of the Software, and to
 *  permit persons to whom the Software is furnished to do so, subject to
 *  the following conditions:
 *
 *  The above copyright notice and this permission notice shall be
 *  included in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

namespace Gecode { namespace Int { namespace Circuit {

  /*
   * The actual propagator
   *
   */
  template<class View, class Offset>
  forceinline
  Dom<View,Offset>::Dom(Home home, ViewArray<View>& x, Offset& o)
    : Base<View,Offset>(home,x,o) {}

  template<class View, class Offset>
  forceinline
  Dom<View,Offset>::Dom(Space& home, bool share, Dom<View,Offset>& p)
    : Base<View,Offset>(home,share,p) {}

  template<class View, class Offset>
  Actor*
  Dom<View,Offset>::copy(Space& home, bool share) {
    return new (home) Dom<View,Offset>(home,share,*this);
  }

  template<class View, class Offset>
  PropCost
  Dom<View,Offset>::cost(const Space&, const ModEventDelta& med) const {
    if (View::me(med) == Int::ME_INT_VAL)
      return PropCost::linear(PropCost::LO, x.size());
    else
      return PropCost::quadratic(PropCost::HI, x.size());
  }

  template<class View, class Offset>
  ExecStatus
  Dom<View,Offset>::propagate(Space& home, const ModEventDelta& med) {
    if (View::me(med) == Int::ME_INT_VAL) {
      GECODE_ES_CHECK((Int::Distinct::prop_val<View,true>(home,y)));
      ExecStatus escv = connected(home);
      if (escv != ES_FIX)
        return escv;
      if (y.size() < 2)
        return home.ES_SUBSUMED(*this);
      return home.ES_FIX_PARTIAL(*this,View::med(Int::ME_INT_DOM));
    }

    if (dc.available()) {
      GECODE_ES_CHECK(dc.sync(home));
    } else {
      GECODE_ES_CHECK(dc.init(home,y));
    }
    bool assigned;
    GECODE_ES_CHECK(dc.propagate(home,assigned));

    ExecStatus esc = connected(home);
    if (esc != ES_FIX)
      return esc;

    // Elminiate assigned views from y, as they have been assigned
    // and propagated by domain consistent propagation. This is required
    // as we need to know how many assigned views actually exist.
    if (assigned)
      for (int i=y.size(); i--; )
        if (y[i].assigned())
          y.move_lst(i);

    return path(home);
  }

  template<class View, class Offset>
  ExecStatus
  Dom<View,Offset>::post(Home home, ViewArray<View>& x, Offset& o) {
    int n = x.size();
    if (n == 1) {
      GECODE_ME_CHECK(o(x[0]).eq(home,0));
    } else if (n == 2) {
      GECODE_ME_CHECK(o(x[0]).eq(home,1));
      GECODE_ME_CHECK(o(x[1]).eq(home,0));
    } else {
      for (int i=n; i--; ) {
        GECODE_ME_CHECK(o(x[i]).gq(home,0));
        GECODE_ME_CHECK(o(x[i]).le(home,n));
        GECODE_ME_CHECK(o(x[i]).nq(home,i));
      }
      (void) new (home) Dom<View,Offset>(home,x,o);
    }
    return ES_OK;
  }

}}}

// STATISTICS: int-prop


text:
Pagination
==========

> Note: This section is under development.
>
> It has no content yet.

redpajama_set_name: RedPajamaGithub


text:
import { SyntaxKind, SourceLocation } from "../../core"

export class ParameterAnalyzer {
    constructor(private node:any) { }

    withDefaultValue(){
        return this.node.type == SyntaxKind.AssignmentPattern
    }

    getName() {
        if(this.withDefaultValue())
            return this.node.left.name
        else return this.node.name;
    }

    getLocation() {
        return <SourceLocation> {
            start: this.node.start,
            end: this.node.end
        };
    }
}


text:
package ArchiChaT.Services;

import java.io.*;
import java.rmi.RemoteException;

/**
 * Created by kevin on 31/05/2017.
 */
public class PersistenceService implements IPersistenceService {

	@Override
	public Object read( String filename ) throws RemoteException {

		Object content = null;
		try {
			File fI = new File( filename );

			if ( fI.exists() ) {

				FileInputStream fileI = new FileInputStream( filename );
				ObjectInputStream in = new ObjectInputStream( fileI );

				// Method for deserialization of object
				content = in.readObject();

				in.close();
				fileI.close();

			}
		} catch ( ClassNotFoundException ex ) {
			System.out.println( "ClassNotFoundException is caught" );
			return null;
		} catch ( IOException ex ) {
			System.out.println( "IOException is caught" );
			return null;
		}

		return content;

	}

	@Override
	public boolean write( String filename, Object content ) throws RemoteException {

		try {

			//Saving of object in a file
			FileOutputStream fileO = new FileOutputStream( filename );
			ObjectOutputStream out = new ObjectOutputStream( fileO );

			out.writeObject( content );

			out.close();
			fileO.close();

		} catch ( IOException ex ) {
			System.out.println( "IOException is caught" );
			return false;
		}

		return true;
	}
}


text:
/*
 * (C) 2007-2010 Alibaba Group Holding Limited.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */
package com.taobao.common.tfs.packet;

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

import com.taobao.common.tfs.etc.TfsConstant;

public class GetBlockInfoMessage extends BasePacket {
    private int blockId;
    private int mode;
    private List<Long> failServer;

    public GetBlockInfoMessage(Transcoder transcoder) {
        super(transcoder);
        this.pcode = TfsConstant.GET_BLOCK_INFO_MESSAGE;
        blockId = 0;
        mode = 0;
        failServer = new ArrayList<Long>();
    }

    /*
     * length = sizeof (int) * 3 + failServer.size() * 8
     *

     *

     * [int=4] mode
     * [int=4] blockId
     * [int=4] failServer.size()
     * [long=8] element of failServer
     *

     *

     * @see com.taobao.common.tfs.tbnet.BasePacket#getPacketLength()
     */
    public int getPacketLength() {
        return TfsConstant.INT_SIZE * 3 + failServer.size() * TfsConstant.LONG_SIZE;
    }

    @Override
    public void writePacketStream() {
        byteBuffer.putInt(mode);
        byteBuffer.putInt(blockId);
        StreamTranscoderUtil.writeVL(byteBuffer, failServer);
    }

    public int getBlockId() {
        return blockId;
    }

    public void setBlockId(int blockId) {
        this.blockId = blockId;
    }

    public int getMode() {
        return mode;
    }

    public void setMode(int mode) {
        this.mode = mode;
    }

    public List<Long> getFailServer() {
        return failServer;
    }

    public void setFailServer(List<Long> failServer) {
        this.failServer = failServer;
    }

}


text:
<?php

/**
 * Base class that represents a row from the 'sf_guard_remember_key' table.
 *
 *
 *
 * This class was autogenerated by Propel 1.3.0-dev on:
 *
 * Sat May 29 00:26:27 2010
 *
 * @package    lib.model.om
 */
abstract class BaseSfGuardRememberKey extends BaseObject  implements Persistent {

  const PEER = 'SfGuardRememberKeyPeer';

	/**
	 * The Peer class.
	 * Instance provides a convenient way of calling static methods on a class
	 * that calling code may not be able to identify.
	 * @var        SfGuardRememberKeyPeer
	 */
	protected static $peer;

	/**
	 * The value for the user_id field.
	 * @var        int
	 */
	protected $user_id;

	/**
	 * The value for the remember_key field.
	 * @var        string
	 */
	protected $remember_key;

	/**
	 * The value for the ip_address field.
	 * @var        string
	 */
	protected $ip_address;

	/**
	 * The value for the created_at field.
	 * @var        string
	 */
	protected $created_at;

	/**
	 * Flag to prevent endless save loop, if this object is referenced
	 * by another object which falls in this transaction.
	 * @var        boolean
	 */
	protected $alreadyInSave = false;

	/**
	 * Flag to prevent endless validation loop, if this object is referenced
	 * by another object which falls in this transaction.
	 * @var        boolean
	 */
	protected $alreadyInValidation = false;

	/**
	 * Initializes internal state of BaseSfGuardRememberKey object.
	 * @see        applyDefaults()
	 */
	public function __construct()
	{
		parent::__construct();
		$this->applyDefaultValues();
	}

	/**
	 * Applies default values to this object.
	 * This method should be called from the object's constructor (or
	 * equivalent initialization method).
	 * @see        __construct()
	 */
	public function applyDefaultValues()
	{
	}

	/**
	 * Get the [user_id] column value.
	 *
	 * @return     int
	 */
	public function getUserId()
	{
		return $this->user_id;
	}

	/**
	 * Get the [remember_key] column value.
	 *
	 * @return     string
	 */
	public function getRememberKey()
	{
		return $this->remember_key;
	}

	/**
	 * Get the [ip_address] column value.
	 *
	 * @return     string
	 */
	public function getIpAddress()
	{
		return $this->ip_address;
	}

	/**
	 * Get the [optionally formatted] temporal [created_at] column value.
	 *
	 *
	 * @param      string $format The date/time format string (either date()-style or strftime()-style).
	 *							If format is NULL, then the raw DateTime object will be returned.
	 * @return     mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL, and 0 if column value is 0000-00-00 00:00:00
	 * @throws     PropelException - if unable to parse/validate the date/time value.
	 */
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{
		if ($this->created_at === null) {
			return null;
		}

		if ($this->created_at === '0000-00-00 00:00:00') {
			// while technically this is not a default value of NULL,
			// this seems to be closest in meaning.
			return null;
		} else {
			try {
				$dt = new DateTime($this->created_at);
			} catch (Exception $x) {
				throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
			}
		}

		if ($format === null) {
			// Because propel.useDateTimeClass is TRUE, we return a DateTime object.
			return $dt;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $dt->format('U'));
		} else {
			return $dt->format($format);
		}
	}

	/**
	 * Set the value of [user_id] column.
	 *
	 * @param      int $v new value
	 * @return     SfGuardRememberKey The current object (for fluent API support)
	 */
	public function setUserId($v)
	{
		if ($v !== null) {
			$v = (int) $v;
		}

		if ($this->user_id !== $v) {
			$this->user_id = $v;
			$this->modifiedColumns[] = SfGuardRememberKeyPeer::USER_ID;
		}

		return $this;
	} // setUserId()

	/**
	 * Set the value of [remember_key] column.
	 *
	 * @param      string $v new value
	 * @return     SfGuardRememberKey The current object (for fluent API support)
	 */
	public function setRememberKey($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->remember_key !== $v) {
			$this->remember_key = $v;
			$this->modifiedColumns[] = SfGuardRememberKeyPeer::REMEMBER_KEY;
		}

		return $this;
	} // setRememberKey()

	/**
	 * Set the value of [ip_address] column.
	 *
	 * @param      string $v new value
	 * @return     SfGuardRememberKey The current object (for fluent API support)
	 */
	public function setIpAddress($v)
	{
		if ($v !== null) {
			$v = (string) $v;
		}

		if ($this->ip_address !== $v) {
			$this->ip_address = $v;
			$this->modifiedColumns[] = SfGuardRememberKeyPeer::IP_ADDRESS;
		}

		return $this;
	} // setIpAddress()

	/**
	 * Sets the value of [created_at] column to a normalized version of the date/time value specified.
	 *
	 * @param      mixed $v string, integer (timestamp), or DateTime value.  Empty string will
	 *						be treated as NULL for temporal objects.
	 * @return     SfGuardRememberKey The current object (for fluent API support)
	 */
	public function setCreatedAt($v)
	{
		// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
		// -- which is unexpected, to say the least.
		if ($v === null || $v === '') {
			$dt = null;
		} elseif ($v instanceof DateTime) {
			$dt = $v;
		} else {
			// some string/numeric value passed; we normalize that so that we can
			// validate it.
			try {
				if (is_numeric($v)) { // if it's a unix timestamp
					$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));
					// We have to explicitly specify and then change the time zone because of a
					// DateTime bug: http://bugs.php.net/bug.php?id=43003
					$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
				} else {
					$dt = new DateTime($v);
				}
			} catch (Exception $x) {
				throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);
			}
		}

		if ( $this->created_at !== null || $dt !== null ) {
			// (nested ifs are a little easier to read in this case)

			$currNorm = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
			$newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;

			if ( ($currNorm !== $newNorm) // normalized values don't match
					)
			{
				$this->created_at = ($dt ? $dt->format('Y-m-d H:i:s') : null);
				$this->modifiedColumns[] = SfGuardRememberKeyPeer::CREATED_AT;
			}
		} // if either are not null

		return $this;
	} // setCreatedAt()

	/**
	 * Indicates whether the columns in this object are only set to default values.
	 *
	 * This method can be used in conjunction with isModified() to indicate whether an object is both
	 * modified _and_ has some values set which are non-default.
	 *
	 * @return     boolean Whether the columns in this object are only been set with default values.
	 */
	public function hasOnlyDefaultValues()
	{
			// First, ensure that we don't have any columns that have been modified which aren't default columns.
			if (array_diff($this->modifiedColumns, array())) {
				return false;
			}

		// otherwise, everything was equal, so return TRUE
		return true;
	} // hasOnlyDefaultValues()

	/**
	 * Hydrates (populates) the object variables with values from the database resultset.
	 *
	 * An offset (0-based "start column") is specified so that objects can be hydrated
	 * with a subset of the columns in the resultset rows.  This is needed, for example,
	 * for results of JOIN queries where the resultset row includes columns from two or
	 * more tables.
	 *
	 * @param      array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
	 * @param      int $startcol 0-based offset column which indicates which restultset column to start with.
	 * @param      boolean $rehydrate Whether this object is being re-hydrated from the database.
	 * @return     int next starting column
	 * @throws     PropelException  - Any caught Exception will be rewrapped as a PropelException.
	 */
	public function hydrate($row, $startcol = 0, $rehydrate = false)
	{
		try {

			$this->user_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
			$this->remember_key = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
			$this->ip_address = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
			$this->created_at = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
			$this->resetModified();

			$this->setNew(false);

			if ($rehydrate) {
				$this->ensureConsistency();
			}

			// FIXME - using NUM_COLUMNS may be clearer.
			return $startcol + 4; // 4 = SfGuardRememberKeyPeer::NUM_COLUMNS - SfGuardRememberKeyPeer::NUM_LAZY_LOAD_COLUMNS).

		} catch (Exception $e) {
			throw new PropelException("Error populating SfGuardRememberKey object", $e);
		}
	}

	/**
	 * Checks and repairs the internal consistency of the object.
	 *
	 * This method is executed after an already-instantiated object is re-hydrated
	 * from the database.  It exists to check any foreign keys to make sure that
	 * the objects related to the current object are correct based on foreign key.
	 *
	 * You can override this method in the stub class, but you should always invoke
	 * the base method from the overridden method (i.e. parent::ensureConsistency()),
	 * in case your model changes.
	 *
	 * @throws     PropelException
	 */
	public function ensureConsistency()
	{

	} // ensureConsistency

	/**
	 * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
	 *
	 * This will only work if the object has been saved and has a valid primary key set.
	 *
	 * @param      boolean $deep (optional) Whether to also de-associated any related objects.
	 * @param      PropelPDO $con (optional) The PropelPDO connection to use.
	 * @return     void
	 * @throws     PropelException - if this object is deleted, unsaved or doesn't have pk match in db
	 */
	public function reload($deep = false, PropelPDO $con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("Cannot reload a deleted object.");
		}

		if ($this->isNew()) {
			throw new PropelException("Cannot reload an unsaved object.");
		}

		if ($con === null) {
			$con = Propel::getConnection(SfGuardRememberKeyPeer::DATABASE_NAME, Propel::CONNECTION_READ);
		}

		// We don't need to alter the object instance pool; we're just modifying this instance
		// already in the pool.

		$stmt = SfGuardRememberKeyPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
		$row = $stmt->fetch(PDO::FETCH_NUM);
		$stmt->closeCursor();
		if (!$row) {
			throw new PropelException('Cannot find matching row in the database to reload object values.');
		}
		$this->hydrate($row, 0, true); // rehydrate

		if ($deep) {  // also de-associate any related objects?

		} // if (deep)
	}

	/**
	 * Removes this object from datastore and sets delete attribute.
	 *
	 * @param      PropelPDO $con
	 * @return     void
	 * @throws     PropelException
	 * @see        BaseObject::setDeleted()
	 * @see        BaseObject::isDeleted()
	 */
	public function delete(PropelPDO $con = null)
	{

    foreach (sfMixer::getCallables('BaseSfGuardRememberKey:delete:pre') as $callable)
    {
      $ret = call_user_func($callable, $this, $con);
      if ($ret)
      {
        return;
      }
    }

		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(SfGuardRememberKeyPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		$con->beginTransaction();
		try {
			SfGuardRememberKeyPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollBack();
			throw $e;
		}

    foreach (sfMixer::getCallables('BaseSfGuardRememberKey:delete:post') as $callable)
    {
      call_user_func($callable, $this, $con);
    }

  }
	/**
	 * Persists this object to the database.
	 *
	 * If the object is new, it inserts it; otherwise an update is performed.
	 * All modified related objects will also be persisted in the doSave()
	 * method.  This method wraps all precipitate database operations in a
	 * single transaction.
	 *
	 * @param      PropelPDO $con
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
	 * @throws     PropelException
	 * @see        doSave()
	 */
	public function save(PropelPDO $con = null)
	{

    foreach (sfMixer::getCallables('BaseSfGuardRememberKey:save:pre') as $callable)
    {
      $affectedRows = call_user_func($callable, $this, $con);
      if (is_int($affectedRows))
      {
        return $affectedRows;
      }
    }

    if ($this->isNew() && !$this->isColumnModified(SfGuardRememberKeyPeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(SfGuardRememberKeyPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
		}

		$con->beginTransaction();
		try {
			$affectedRows = $this->doSave($con);
			$con->commit();
    foreach (sfMixer::getCallables('BaseSfGuardRememberKey:save:post') as $callable)
    {
      call_user_func($callable, $this, $con, $affectedRows);
    }

			SfGuardRememberKeyPeer::addInstanceToPool($this);
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollBack();
			throw $e;
		}
	}

	/**
	 * Performs the work of inserting or updating the row in the database.
	 *
	 * If the object is new, it inserts it; otherwise an update is performed.
	 * All related objects are also updated in this method.
	 *
	 * @param      PropelPDO $con
	 * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
	 * @throws     PropelException
	 * @see        save()
	 */
	protected function doSave(PropelPDO $con)
	{
		$affectedRows = 0; // initialize var to track total num of affected rows
		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;

			// If this object has been modified, then save it to the database.
			if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = SfGuardRememberKeyPeer::doInsert($this, $con);
					$affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
										 // should always be true here (even though technically
										 // BasePeer::doInsert() can insert multiple rows).

					$this->setNew(false);
				} else {
					$affectedRows += SfGuardRememberKeyPeer::doUpdate($this, $con);
				}

				$this->resetModified(); // [HL] After being saved an object is no longer 'modified'
			}

			$this->alreadyInSave = false;

		}
		return $affectedRows;
	} // doSave()

	/**
	 * Array of ValidationFailed objects.
	 * @var        array ValidationFailed[]
	 */
	protected $validationFailures = array();

	/**
	 * Gets any ValidationFailed objects that resulted from last call to validate().
	 *
	 *
	 * @return     array ValidationFailed[]
	 * @see        validate()
	 */
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	/**
	 * Validates the objects modified field values and all objects related to this table.
	 *
	 * If $columns is either a column name or an array of column names
	 * only those columns are validated.
	 *
	 * @param      mixed $columns Column name or an array of column names.
	 * @return     boolean Whether all columns pass validation.
	 * @see        doValidate()
	 * @see        getValidationFailures()
	 */
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	/**
	 * This function performs the validation work for complex object models.
	 *
	 * In addition to checking the current object, all related objects will
	 * also be validated.  If all pass then true is returned; otherwise
	 * an aggreagated array of ValidationFailed objects will be returned.
	 *
	 * @param      array $columns Array of column names to validate.
	 * @return     mixed true if all validations pass; array of ValidationFailed objets otherwise.
	 */
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();

			if (($retval = SfGuardRememberKeyPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}

			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	/**
	 * Retrieves a field from the object by name passed in as a string.
	 *
	 * @param      string $name name
	 * @param      string $type The type of fieldname the $name is of:
	 *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
	 *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
	 * @return     mixed Value of field.
	 */
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = SfGuardRememberKeyPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		$field = $this->getByPosition($pos);
		return $field;
	}

	/**
	 * Retrieves a field from the object by Position as specified in the xml schema.
	 * Zero-based.
	 *
	 * @param      int $pos position in xml schema
	 * @return     mixed Value of field at $pos
	 */
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getUserId();
				break;
			case 1:
				return $this->getRememberKey();
				break;
			case 2:
				return $this->getIpAddress();
				break;
			case 3:
				return $this->getCreatedAt();
				break;
			default:
				return null;
				break;
		} // switch()
	}

	/**
	 * Exports the object as an array.
	 *
	 * You can specify the key type of the array by passing one of the class
	 * type constants.
	 *
	 * @param      string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
	 *                        BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
	 * @param      boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns.  Defaults to TRUE.
	 * @return     an associative array containing the field names (as keys) and field values
	 */
	public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
	{
		$keys = SfGuardRememberKeyPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getUserId(),
			$keys[1] => $this->getRememberKey(),
			$keys[2] => $this->getIpAddress(),
			$keys[3] => $this->getCreatedAt(),
		);
		return $result;
	}

	/**
	 * Sets a field from the object by name passed in as a string.
	 *
	 * @param      string $name peer name
	 * @param      mixed $value field value
	 * @param      string $type The type of fieldname the $name is of:
	 *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
	 *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
	 * @return     void
	 */
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = SfGuardRememberKeyPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	/**
	 * Sets a field from the object by Position as specified in the xml schema.
	 * Zero-based.
	 *
	 * @param      int $pos position in xml schema
	 * @param      mixed $value field value
	 * @return     void
	 */
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setUserId($value);
				break;
			case 1:
				$this->setRememberKey($value);
				break;
			case 2:
				$this->setIpAddress($value);
				break;
			case 3:
				$this->setCreatedAt($value);
				break;
		} // switch()
	}

	/**
	 * Populates the object using an array.
	 *
	 * This is particularly useful when populating an object from one of the
	 * request arrays (e.g. $_POST).  This method goes through the column
	 * names, checking to see whether a matching key exists in populated
	 * array. If so the setByName() method is called for that column.
	 *
	 * You can specify the key type of the array by additionally passing one
	 * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
	 * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
	 * The default key type is the column's phpname (e.g. 'AuthorId')
	 *
	 * @param      array  $arr     An array to populate the object from.
	 * @param      string $keyType The type of keys the array uses.
	 * @return     void
	 */
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = SfGuardRememberKeyPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setUserId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setRememberKey($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setIpAddress($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setCreatedAt($arr[$keys[3]]);
	}

	/**
	 * Build a Criteria object containing the values of all modified columns in this object.
	 *
	 * @return     Criteria The Criteria object containing all modified values.
	 */
	public function buildCriteria()
	{
		$criteria = new Criteria(SfGuardRememberKeyPeer::DATABASE_NAME);

		if ($this->isColumnModified(SfGuardRememberKeyPeer::USER_ID)) $criteria->add(SfGuardRememberKeyPeer::USER_ID, $this->user_id);
		if ($this->isColumnModified(SfGuardRememberKeyPeer::REMEMBER_KEY)) $criteria->add(SfGuardRememberKeyPeer::REMEMBER_KEY, $this->remember_key);
		if ($this->isColumnModified(SfGuardRememberKeyPeer::IP_ADDRESS)) $criteria->add(SfGuardRememberKeyPeer::IP_ADDRESS, $this->ip_address);
		if ($this->isColumnModified(SfGuardRememberKeyPeer::CREATED_AT)) $criteria->add(SfGuardRememberKeyPeer::CREATED_AT, $this->created_at);

		return $criteria;
	}

	/**
	 * Builds a Criteria object containing the primary key for this object.
	 *
	 * Unlike buildCriteria() this method includes the primary key values regardless
	 * of whether or not they have been modified.
	 *
	 * @return     Criteria The Criteria object containing value(s) for primary key(s).
	 */
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(SfGuardRememberKeyPeer::DATABASE_NAME);

		$criteria->add(SfGuardRememberKeyPeer::USER_ID, $this->user_id);
		$criteria->add(SfGuardRememberKeyPeer::IP_ADDRESS, $this->ip_address);

		return $criteria;
	}

	/**
	 * Returns the composite primary key for this object.
	 * The array elements will be in same order as specified in XML.
	 * @return     array
	 */
	public function getPrimaryKey()
	{
		$pks = array();

		$pks[0] = $this->getUserId();

		$pks[1] = $this->getIpAddress();

		return $pks;
	}

	/**
	 * Set the [composite] primary key.
	 *
	 * @param      array $keys The elements of the composite key (order must match the order in XML file).
	 * @return     void
	 */
	public function setPrimaryKey($keys)
	{

		$this->setUserId($keys[0]);

		$this->setIpAddress($keys[1]);

	}

	/**
	 * Sets contents of passed object to values from current object.
	 *
	 * If desired, this method can also make copies of all associated (fkey referrers)
	 * objects.
	 *
	 * @param      object $copyObj An object of SfGuardRememberKey (or compatible) type.
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
	 * @throws     PropelException
	 */
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setUserId($this->user_id);

		$copyObj->setRememberKey($this->remember_key);

		$copyObj->setIpAddress($this->ip_address);

		$copyObj->setCreatedAt($this->created_at);

		$copyObj->setNew(true);

	}

	/**
	 * Makes a copy of this object that will be inserted as a new row in table when saved.
	 * It creates a new object filling in the simple attributes, but skipping any primary
	 * keys that are defined for the table.
	 *
	 * If desired, this method can also make copies of all associated (fkey referrers)
	 * objects.
	 *
	 * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
	 * @return     SfGuardRememberKey Clone of current object.
	 * @throws     PropelException
	 */
	public function copy($deepCopy = false)
	{
		// we use get_class(), because this might be a subclass
		$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	/**
	 * Returns a peer instance associated with this om.
	 *
	 * Since Peer classes are not to have any instance attributes, this method returns the
	 * same instance for all member of this class. The method could therefore
	 * be static, but this would prevent one from overriding the behavior.
	 *
	 * @return     SfGuardRememberKeyPeer
	 */
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new SfGuardRememberKeyPeer();
		}
		return self::$peer;
	}

	/**
	 * Resets all collections of referencing foreign keys.
	 *
	 * This method is a user-space workaround for PHP's inability to garbage collect objects
	 * with circular references.  This is currently necessary when using Propel in certain
	 * daemon or large-volumne/high-memory operations.
	 *
	 * @param      boolean $deep Whether to also clear the references on all associated objects.
	 */
	public function clearAllReferences($deep = false)
	{
		if ($deep) {
		} // if ($deep)

	}

  public function __call($method, $arguments)
  {
    if (!$callable = sfMixer::getCallable('BaseSfGuardRememberKey:'.$method))
    {
      throw new sfException(sprintf('Call to undefined method BaseSfGuardRememberKey::%s', $method));
    }

    array_unshift($arguments, $this);

    return call_user_func_array($callable, $arguments);
  }

} // BaseSfGuardRememberKey


text:
<?php
class Project_UpdatepriceController extends Zend_Controller_Action {
	const REDIRECT_URL = '/project';
	public function init()
	{
		header('content-type: text/html; charset=utf8');
		defined('BASE_URL')	|| define('BASE_URL', Zend_Controller_Front::getInstance()->getBaseUrl());
	}
	public function indexAction(){
		try{
			$db = new Project_Model_DbTable_Dbupdateprice();
			if($this->getRequest()->isPost()){
				$formdata=$this->getRequest()->getPost();
				$search = array(
					'adv_search' => $formdata['adv_search'],
					'streetlist'=>$formdata['streetlist'],
					'branch_id'=>$formdata['branch_id'],
				);
			}
			else{
				$search = array(
					'adv_search' => '',
					'branch_id'=>-1,
					'streetlist'=>''
				);
			}
			$rs_rows= $db->getAllRoad($search);
			$this->view->rs = $rs_rows;

		}catch(Exception $e){
			Application_Form_FrmMessage::message("Application Error");
			Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
		}
		$frm = new Application_Form_FrmAdvanceSearch();
		$frm = $frm->AdvanceSearch();
		Application_Model_Decorator::removeAllDecorator($frm);
		$this->view->frm_search = $frm;
		$this->view->result=$search;

		$fm = new Project_Form_FrmLand();
		$frmserch = $fm->FrmLandInfo();
		Application_Model_Decorator::removeAllDecorator($frmserch);
		$this->view->frm_land = $frmserch;
	}
	public function addAction(){
		$this->_redirect("/project/updateprice");
	}
	public function editAction(){
		$id = $this->getRequest()->getParam("id");
		$id = empty($id)?0:$id;
		$branch_id = $this->getRequest()->getParam("branch_id");
		$branch_id = empty($branch_id)?null:$branch_id;

		$property_type = $this->getRequest()->getParam("pro_type");
		$property_type = empty($property_type)?null:$property_type;

		$db = new Project_Model_DbTable_Dbupdateprice();
		if($this->getRequest()->isPost()){
			try{
				$data = $this->getRequest()->getPost();
				$data['branch_id']=$branch_id;
				$db->updatePrice($data);
				Application_Form_FrmMessage::Sucessfull('EDIT_SUCCESS',"/project/updateprice");
			}catch (Exception $e){
				Application_Form_FrmMessage::message("EDIT_FAILE");
				Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
			}
		}
		$row = $db->getPropertiesByStreet($id,$branch_id,$property_type);
	    $this->view->result=$row;
		if(empty($row)){
			$this->_redirect("/group/updateprice");
		}
	}
}


text:
function stats = computeStats(all_samples)
% For each variable (field in the all_samples structure), compute a series
% of statistics (which will be fields of stats). The only complexity is
% that we have to be sensitive to whether each variable is a scalar,
% vector, or 2D matrix. Higher-dimensional variables are not currently
% supported.
disp('CODA: Calculating statistics')
assert(isstruct(all_samples))

variable_list = asRowVector(fieldnames(all_samples));

stats = struct('Rhat',[], 'mean', [], 'median', [], 'std', [],...
	'ci_low' , [] , 'ci_high' , [],...
	'hdi_low', [] , 'hdi_high' , []);

for variable_name = variable_list

	variable_samples = all_samples.(variable_name{:});

	switch ndims(variable_samples)
		case{2}
			stats = calcStatsScalar(stats, variable_samples, variable_name{:});
		case{3}
			stats = calcStatsVector(stats, variable_samples, variable_name{:});
		case{4}
			stats = calcStatsMatrix(stats, variable_samples, variable_name{:});
		otherwise
			stats = calcStatsTensor3(stats, variable_samples, variable_name{:});
	end

	Rhat = calcRhat(variable_samples);
	if ~isnan(Rhat)
		stats.Rhat.(variable_name{:}) = squeeze(Rhat);
	end

end

end

function stats = calcStatsScalar(stats, var_samples, var_name)
stats.mode.(var_name)	= calcMode( var_samples(:) );
stats.median.(var_name) = median( var_samples(:) );
stats.mean.(var_name)	= mean( var_samples(:) );
stats.std.(var_name)	= std( var_samples(:) );
[stats.ci_low.(var_name), stats.ci_high.(var_name)] = calcCI(var_samples(:));
[stats.hdi_low.(var_name), stats.hdi_high.(var_name)] = calcHDI(var_samples(:));
end

function stats = calcStatsVector(stats, var_samples, var_name)
sz = size(var_samples);
for n=1:sz(3)
	stats.mode.(var_name)(n)	= calcMode( vec(var_samples(:,:,n)) );
	stats.median.(var_name)(n)	= median( vec(var_samples(:,:,n)) );
	stats.mean.(var_name)(n)	= mean( vec(var_samples(:,:,n)) );
	stats.std.(var_name)(n)		= std( vec(var_samples(:,:,n)) );
	[stats.ci_low.(var_name)(n),...
		stats.ci_high.(var_name)(n)] = calcCI( vec(var_samples(:,:,n)) );
	[stats.hdi_low.(var_name)(n),...
		stats.hdi_high.(var_name)(n)] = calcHDI( vec(var_samples(:,:,n)) );
end
end

function stats = calcStatsMatrix(stats, var_samples, var_name)
sz = size(var_samples);
for a=1:sz(3)
	for b=1:sz(4)
		stats.mode.(var_name)(a,b)		= calcMode( vec(var_samples(:,:,a,b)) );
		stats.median.(var_name)(a,b)	= median( vec(var_samples(:,:,a,b)) );
		stats.mean.(var_name)(a,b)		= mean( vec(var_samples(:,:,a,b)) );
		stats.std.(var_name)(a,b)		= std( vec(var_samples(:,:,a,b)) );
		[stats.ci_low.(var_name)(a,b),...
			stats.ci_high.(var_name)(a,b)] = calcCI( vec(var_samples(:,:,a,b)) );
		[stats.hdi_low.(var_name)(a,b),...
			stats.hdi_high.(var_name(a,b))] = calcHDI( vec(var_samples(:,:,a,b)) );
	end
end
end

function stats = calcStatsTensor3(stats, var_samples, var_name)
warning('calculation of stats not supported for >2D matricies. You could implement it and send a pull request.')
stats.mode.(var_name) = [];
stats.median.(var_name) = [];
stats.mean.(var_name) = [];
stats.std.(var_name) = [];
stats.ci_low.(var_name) = [];
stats.ci_high.(var_name) = [];
stats.hdi_low.(var_name) = [];
stats.hdi_high.(var_name) = [];
end

function Rhat = calcRhat(var_samples)
% "estimated potential scale reduction" statistics due to Gelman and Rubin
sz = size(var_samples);
Nchains = sz(1);
Nsamples = sz(2);

st_mean_per_chain = mean(var_samples, 2);
st_mean_overall   = mean(st_mean_per_chain, 1);

if Nchains > 1
	B = (Nsamples/Nchains-1) * ...
		sum((st_mean_per_chain - repmat(st_mean_overall, [Nchains,1])).^2);
	varPerChain = var(var_samples, 0, 2);
	W = (1/Nchains) * sum(varPerChain);
	vhat = ((Nsamples-1)/Nsamples) * W + (1/Nsamples) * B;
	Rhat = sqrt(vhat./(W+eps));
else
	Rhat = nan;
end
end

function [low, high] = calcCI(reshaped_samples)
% get the 95% interval of the posterior
ci_samples_overall = prctile( reshaped_samples , [ 2.5 97.5 ] , 1 );
ci_samples_overall_low = ci_samples_overall( 1,: );
ci_samples_overall_high = ci_samples_overall( 2,: );
low = squeeze(ci_samples_overall_low);
high = squeeze(ci_samples_overall_high);
end

function [low, high] = calcHDI(reshaped_samples)
% get the 95% highest density intervals of the posterior
[hdi] = HDIofSamples(reshaped_samples, 0.95);
low = squeeze(hdi(1));
high = squeeze(hdi(2));
end


text:
// Copyright 2018 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.rules.java;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.TransitionMode;
import com.google.devtools.build.lib.analysis.actions.CustomCommandLine;
import com.google.devtools.build.lib.analysis.actions.CustomCommandLine.VectorArg;
import com.google.devtools.build.lib.analysis.actions.SpawnAction;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.rules.java.JavaConfiguration.ImportDepsCheckingLevel;
import java.util.stream.Collectors;

/** Utility for generating a call to the import_deps_checker. */
public final class ImportDepsCheckActionBuilder {

  public static ImportDepsCheckActionBuilder newBuilder() {
    return new ImportDepsCheckActionBuilder();
  }

  private Artifact jdepsArtifact;
  private Label ruleLabel;
  private NestedSet<Artifact> jarsToCheck;
  private NestedSet<Artifact> bootclasspath;
  private NestedSet<Artifact> declaredDeps;
  private NestedSet<Artifact> transitiveDeps;
  private ImportDepsCheckingLevel importDepsCheckingLevel;

  private ImportDepsCheckActionBuilder() {}

  public ImportDepsCheckActionBuilder checkJars(NestedSet<Artifact> jarsToCheck) {
    checkState(this.jarsToCheck == null);
    this.jarsToCheck = checkNotNull(jarsToCheck);
    return this;
  }

  public ImportDepsCheckActionBuilder ruleLabel(Label ruleLabel) {
    checkState(this.ruleLabel == null);
    this.ruleLabel = checkNotNull(ruleLabel);
    return this;
  }

  public ImportDepsCheckActionBuilder importDepsCheckingLevel(
      ImportDepsCheckingLevel importDepsCheckingLevel) {
    checkState(this.importDepsCheckingLevel == null);
    this.importDepsCheckingLevel = checkNotNull(importDepsCheckingLevel);
    return this;
  }

  public ImportDepsCheckActionBuilder bootclasspath(NestedSet<Artifact> bootclasspath) {
    checkState(this.bootclasspath == null);
    this.bootclasspath = checkNotNull(bootclasspath);
    return this;
  }

  public ImportDepsCheckActionBuilder jdepsOutputArtifact(Artifact jdepsArtifact) {
    checkState(this.jdepsArtifact == null);
    this.jdepsArtifact = checkNotNull(jdepsArtifact);
    return this;
  }

  public ImportDepsCheckActionBuilder declareDeps(NestedSet<Artifact> declaredDeps) {
    checkState(this.declaredDeps == null);
    this.declaredDeps = checkNotNull(declaredDeps);
    return this;
  }

  public ImportDepsCheckActionBuilder transitiveDeps(NestedSet<Artifact> transitiveDeps) {
    checkState(this.transitiveDeps == null);
    this.transitiveDeps = checkNotNull(transitiveDeps);
    return this;
  }

  public void buildAndRegister(RuleContext ruleContext) {
    checkNotNull(jarsToCheck);
    checkNotNull(bootclasspath);
    checkNotNull(declaredDeps);
    checkNotNull(transitiveDeps);
    checkNotNull(importDepsCheckingLevel);
    checkNotNull(jdepsArtifact);
    checkNotNull(ruleLabel);

    ruleContext.registerAction(
        new SpawnAction.Builder()
            .useDefaultShellEnvironment()
            .setExecutable(
                ruleContext.getExecutablePrerequisite("$import_deps_checker", TransitionMode.HOST))
            .addTransitiveInputs(jarsToCheck)
            .addTransitiveInputs(declaredDeps)
            .addTransitiveInputs(transitiveDeps)
            .addTransitiveInputs(bootclasspath)
            .addOutput(jdepsArtifact)
            .setMnemonic("ImportDepsChecker")
            .setProgressMessage(
                "Checking the completeness of the deps for %s",
                jarsToCheck.toList().stream()
                    .map(Artifact::prettyPrint)
                    .collect(Collectors.joining(", ")))
            .addCommandLine(buildCommandLine())
            .build(ruleContext));
  }

  private CustomCommandLine buildCommandLine() {
    return CustomCommandLine.builder()
        .addExecPaths(VectorArg.addBefore("--input").each(jarsToCheck))
        .addExecPaths(VectorArg.addBefore("--directdep").each(declaredDeps))
        .addExecPaths(VectorArg.addBefore("--classpath_entry").each(transitiveDeps))
        .addExecPaths(VectorArg.addBefore("--bootclasspath_entry").each(bootclasspath))
        .addDynamicString(convertErrorFlag(importDepsCheckingLevel))
        .addExecPath("--jdeps_output", jdepsArtifact)
        .add("--rule_label", ruleLabel.toString())
        .build();
  }

  private static String convertErrorFlag(ImportDepsCheckingLevel level) {
    switch (level) {
      case ERROR:
        return "--checking_mode=error";
      case WARNING:
        return "--checking_mode=warning";
      case OFF:
        return "--checking_mode=silence";
      default:
        throw new RuntimeException("Unhandled deps checking level: " + level);
    }
  }
}


text:
<?php

namespace Top\Bundle\AppBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Top\Common\ImageUploadHelper;

class ImageController extends BaseController
{

    public function editorUploadAction(Request $request)
    {
        $uploadedFile = $request->files->get('file');
        $hepler = new ImageUploadHelper($this->container);
        list($result, $error) = $hepler->validate($uploadedFile);

        if (!$result) {
            return $this->createJsonResponse(array('error' => 1, 'message' => $error));
        }

        list($originalUri, $originalFullFilePath) = $hepler->ready('product_des', true, '.' . $uploadedFile->guessExtension());

        $originalFileName = substr($originalUri, strlen(dirname($originalUri)) + 1);
        $uploadedFile->move(dirname($originalFullFilePath), $originalFileName);

        return $this->createJsonResponse(array('error' => 0, 'url' => '/files/' . $originalUri));
    }

}


text:
var xml2js = require('xml2js');
var express = require('express');
var request = require('request');
var session = require('express-session');
var _ = require('underscore');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var cookieSession = require('cookie-session');

var wsApiUrl = 'https://www.worksnaps.net/api/';

var app = express();
app.use(cookieParser());

app.use( bodyParser.json() );
app.use(bodyParser.urlencoded({
    extended: true
}));
app.set('views', __dirname + '/templates');
app.engine('html', require('ejs').renderFile);
app.set('trust proxy', 1);
app.use(cookieSession({
    name: 'session',
    signed: true,
    keys: ['test', 'key2']
}));

function toArray (i) {
    if (!_.isArray(i)) {
        return [i];
    }
    return i;
}

function convertDateForWSParams (s, end) {
    var date = new Date(s);
    if (end) {
        date.setHours(23);
        date.setMinutes(59);
        date.setSeconds(59);
    }
    else {
        date.setHours(0);
        date.setMinutes(0);
        date.setSeconds(0);
    }
    return Math.round(date.getTime()/1000);
}

function fillZero (str) {
    if (str.toString().length < 2) {
        return '0' + str;
    }
    return str;
}

function ws (url, token, done, params) {
    request.get(wsApiUrl + url, {
        auth: {
            user: token,
            pass: ''
        },
        qs: params
    }, function (error, response, body) {
        if (error) {
            done(error, null);
            return
        }
        xml2js.parseString(body, {explicitArray: false}, function (err, result) {
            if (err) {
                done(err, null);
                return
            }
            done(null, result);
        });
    });
}

app.get('/', function (req, res) {
    var sess = req.session;
    if (sess.user) {
        res.redirect('/projects');
    }
    res.render('login.html');
});

app.post('/', function (req, res) {
    ws('me.xml', req.body.token, function (err, data) {
        if (data) {
            req.session.token = req.body.token;
            console.log(req.session.token);
            res.redirect('/projects');
        }
        else {
            res.redirect('/');
        }
    });
});

app.get('/logout', function (req, res) {
    req.session.destroy(function () {
        res.redirect('/');
    });

});

app.get('/projects', function (req, res) {
    ws('projects.xml', req.session.token, function (err, data) {
        res.render('projects.html', {projects: toArray(data.projects.project)});
    });
});

app.get('/projects/:id', function (req, res) {
    ws('projects/' + req.params.id + '.xml', req.session.token, function (err, data) {
        res.render('project.html', {project: data.project, _: _});
    });
});

app.get('/projects/:id/report', function (req, res) {
    ws('projects/' + req.params.id + '/reports.xml', req.session.token, function (err, data) {
        data = toArray(data.time_entries.time_entry);
        res.render('report.html', {
            data: data, _: _, r: function (x) {
                var hours = Math.floor(x / 60);
                var minutes = x % 60;

                return fillZero(hours) + ':' + fillZero(minutes)
            }
        });
    }, {
        name: 'time_entries',
        from_timestamp: convertDateForWSParams(req.query.from),
        to_timestamp: convertDateForWSParams(req.query.to, true)
    });
});

var server = app.listen(process.env.PORT || 9000, function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log('App listening at http://%s:%s', host, port);
});


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.IO;
using System.Diagnostics;
using System.Resources;
using System.Reflection;
using System.Collections;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Build.Tasks.Deployment.ManifestUtilities;
using Microsoft.Build.Shared;

namespace Microsoft.Build.Tasks
{
    /// <summary>
    /// Main class for the native reference resolution task.
    /// </summary>
    public class ResolveNativeReference : TaskExtension
    {
        #region Constructors

        /// <summary>
        ///  ResolveNativeReference constructor
        /// </summary>
        public ResolveNativeReference()
        {
            // do nothing.
        }
        #endregion

        #region Properties
        [Required]
        public ITaskItem[] NativeReferences
        {
            get
            {
                ErrorUtilities.VerifyThrowArgumentNull(_nativeReferences, "nativeReferences");
                return _nativeReferences;
            }
            set
            {
                _nativeReferences = value;
            }
        }

        [Required]
        public string[] AdditionalSearchPaths
        {
            get
            {
                ErrorUtilities.VerifyThrowArgumentNull(_additionalSearchPaths, "additionalSearchPaths");
                return _additionalSearchPaths;
            }
            set
            {
                _additionalSearchPaths = value;
            }
        }

        [Output]
        public ITaskItem[] ContainingReferenceFiles
        {
            get
            {
                return _containingReferenceFiles;
            }
            set
            {
                _containingReferenceFiles = value;
            }
        }

        [Output]
        public ITaskItem[] ContainedPrerequisiteAssemblies
        {
            get
            {
                return _containedPrerequisiteAssemblies;
            }
            set
            {
                _containedPrerequisiteAssemblies = value;
            }
        }

        [Output]
        public ITaskItem[] ContainedComComponents
        {
            get
            {
                return _containedComComponents;
            }
            set
            {
                _containedComComponents = value;
            }
        }

        [Output]
        public ITaskItem[] ContainedTypeLibraries
        {
            get
            {
                return _containedTypeLibraries;
            }
            set
            {
                _containedTypeLibraries = value;
            }
        }

        [Output]
        public ITaskItem[] ContainedLooseTlbFiles
        {
            get
            {
                return _containedLooseTlbFiles;
            }
            set
            {
                _containedLooseTlbFiles = value;
            }
        }

        [Output]
        public ITaskItem[] ContainedLooseEtcFiles
        {
            get
            {
                return _containedLooseEtcFiles;
            }
            set
            {
                _containedLooseEtcFiles = value;
            }
        }

        private ITaskItem[] _nativeReferences = null;
        private ITaskItem[] _containingReferenceFiles = null;
        private ITaskItem[] _containedPrerequisiteAssemblies = null;
        private ITaskItem[] _containedComComponents = null;
        private ITaskItem[] _containedTypeLibraries = null;
        private ITaskItem[] _containedLooseTlbFiles = null;
        private ITaskItem[] _containedLooseEtcFiles = null;
        private string[] _additionalSearchPaths = new string[0];
        #endregion

        #region Nested classes
        private class ItemSpecComparerClass : IComparer
        {
            int IComparer.Compare(Object taskItem1, Object taskItem2)
            {
                // simply calls string.Compare on the item specs of the items
                return (string.Compare(((ITaskItem)taskItem1).ItemSpec, ((ITaskItem)taskItem2).ItemSpec, StringComparison.OrdinalIgnoreCase));
            }
        }
        #endregion

        #region ITask members

        /// <summary>
        /// Task entry point.
        /// </summary>
        /// <returns></returns>
        public override bool Execute()
        {
            // Process each task item. If one of them fails we still process the
            // rest of them, but remember that the task should return failure.
            bool retValue = true;
            int reference = 0;

            Hashtable containingReferenceFilesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
            Hashtable containedPrerequisiteAssembliesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
            Hashtable containedComComponentsTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
            Hashtable containedTypeLibrariesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
            Hashtable containedLooseTlbFilesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
            Hashtable containedLooseEtcFilesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);

            for (reference = 0; reference < NativeReferences.GetLength(0); reference++)
            {
                ITaskItem item = NativeReferences[reference];
                string path = item.GetMetadata("HintPath");
                // If no HintPath then fallback to trying to resolve from the assembly identity...
                if (String.IsNullOrEmpty(path) || !File.Exists(path))
                {
                    AssemblyIdentity ai = AssemblyIdentity.FromAssemblyName(item.ItemSpec);
                    if (ai != null)
                    {
                        Log.LogMessageFromResources(MessageImportance.Low, "ResolveNativeReference.ResolveReference", item.ItemSpec);
                        foreach (string searchPath in AdditionalSearchPaths)
                        {
                            Log.LogMessageFromResources(MessageImportance.Low, "ResolveAssemblyReference.FourSpaceIndent", searchPath);
                        }
                        path = ai.Resolve(AdditionalSearchPaths);
                    }
                }
                else
                {
                    Log.LogMessageFromResources(MessageImportance.Low, "ResolveNativeReference.ResolveReference", item.ItemSpec);
                    Log.LogMessageFromResources(MessageImportance.Low, "ResolveAssemblyReference.FourSpaceIndent", path);
                }

                if (!String.IsNullOrEmpty(path))
                {
#if _DEBUG
                    try
                    {
#endif
                    if (!ExtractFromManifest(NativeReferences[reference], path, containingReferenceFilesTable, containedPrerequisiteAssembliesTable, containedComComponentsTable, containedTypeLibrariesTable, containedLooseTlbFilesTable, containedLooseEtcFilesTable))
                    {
                        retValue = false;
                    }
#if _DEBUG
                    }
                    catch (Exception)
                    {
                        Debug.Assert(false, "Unexpected exception in ResolveNativeReference.Execute. " +
                            "Please log a MSBuild bug specifying the steps to reproduce the problem.");
                        throw;
                    }
#endif
                }
                else
                {
                    Log.LogWarningWithCodeFromResources("ResolveNativeReference.FailedToResolveReference", item.ItemSpec);
                }
            }

            IComparer itemSpecComparer = new ItemSpecComparerClass();

            _containingReferenceFiles = new ITaskItem[containingReferenceFilesTable.Count];
            containingReferenceFilesTable.Values.CopyTo(_containingReferenceFiles, 0);
            Array.Sort(_containingReferenceFiles, itemSpecComparer);

            _containedPrerequisiteAssemblies = new ITaskItem[containedPrerequisiteAssembliesTable.Count];
            containedPrerequisiteAssembliesTable.Values.CopyTo(_containedPrerequisiteAssemblies, 0);
            Array.Sort(_containedPrerequisiteAssemblies, itemSpecComparer);

            _containedComComponents = new ITaskItem[containedComComponentsTable.Count];
            containedComComponentsTable.Values.CopyTo(_containedComComponents, 0);
            Array.Sort(_containedComComponents, itemSpecComparer);

            _containedTypeLibraries = new ITaskItem[containedTypeLibrariesTable.Count];
            containedTypeLibrariesTable.Values.CopyTo(_containedTypeLibraries, 0);
            Array.Sort(_containedTypeLibraries, itemSpecComparer);

            _containedLooseTlbFiles = new ITaskItem[containedLooseTlbFilesTable.Count];
            containedLooseTlbFilesTable.Values.CopyTo(_containedLooseTlbFiles, 0);
            Array.Sort(_containedLooseTlbFiles, itemSpecComparer);

            _containedLooseEtcFiles = new ITaskItem[containedLooseEtcFilesTable.Count];
            containedLooseEtcFilesTable.Values.CopyTo(_containedLooseEtcFiles, 0);
            Array.Sort(_containedLooseEtcFiles, itemSpecComparer);

            return retValue;
        }
        #endregion

        #region Methods

        /// <summary>
        /// Helper manifest resolution method. Cracks the manifest and extracts the different elements from it.
        /// </summary>
        internal bool ExtractFromManifest(ITaskItem taskItem, string path, Hashtable containingReferenceFilesTable, Hashtable containedPrerequisiteAssembliesTable, Hashtable containedComComponentsTable, Hashtable containedTypeLibrariesTable, Hashtable containedLooseTlbFilesTable, Hashtable containedLooseEtcFilesTable)
        {
            Log.LogMessageFromResources(MessageImportance.Low, "ResolveNativeReference.Comment", path);

            Manifest manifest = null;

            try
            {
                manifest = ManifestReader.ReadManifest(path, false);
            }
            catch (System.Xml.XmlException ex)
            {
                Log.LogErrorWithCodeFromResources("GenerateManifest.ReadInputManifestFailed", path, ex.Message);
                return false;
            }

            if (manifest != null)
            {
                manifest.TreatUnfoundNativeAssembliesAsPrerequisites = true;
                manifest.ReadOnly = true; // only reading a manifest, set flag so we get GenerateManifest.ResolveFailedInReadOnlyMode instead of GenerateManifest.ResolveFailedInReadWriteMode messages
                manifest.ResolveFiles();
                if (!manifest.OutputMessages.LogTaskMessages(this))
                    return false;

                ApplicationManifest applicationManifest = manifest as ApplicationManifest;
                bool isClickOnceApp = applicationManifest != null && applicationManifest.IsClickOnceManifest;
                // ClickOnce application manifest should not be added as native reference, but we should open and process it.
                if (containingReferenceFilesTable.ContainsKey(path) == false && !isClickOnceApp)
                {
                    ITaskItem itemNativeReferenceFile = new TaskItem();
                    itemNativeReferenceFile.ItemSpec = path;
                    if (manifest.AssemblyIdentity.Name != null)
                        itemNativeReferenceFile.SetMetadata(ItemMetadataNames.fusionName, manifest.AssemblyIdentity.Name);
                    if (taskItem != null)
                        taskItem.CopyMetadataTo(itemNativeReferenceFile);
                    containingReferenceFilesTable.Add(path, itemNativeReferenceFile);
                }

                if (manifest.AssemblyReferences != null)
                {
                    foreach (AssemblyReference assemblyref in manifest.AssemblyReferences)
                    {
                        if (assemblyref.IsVirtual)
                        {
                            //It is a CLR virtual reference, not a real reference.
                            continue;
                        }

                        if (!assemblyref.IsPrerequisite)
                        {
                            // recurse and call ExtractFromManifest for this assembly--if it has a manifest it will be cracked.
                            ExtractFromManifest(null, assemblyref.ResolvedPath, containingReferenceFilesTable, containedPrerequisiteAssembliesTable, containedComComponentsTable, containedTypeLibrariesTable, containedLooseTlbFilesTable, containedLooseEtcFilesTable);
                        }
                        else
                        {
                            string id = assemblyref.AssemblyIdentity.GetFullName(AssemblyIdentity.FullNameFlags.All);
                            // add the assembly to the prerequisites list, if it's not already there
                            if (containedPrerequisiteAssembliesTable.ContainsKey(id) == false)
                            {
                                ITaskItem item = new TaskItem();
                                item.ItemSpec = id;
                                item.SetMetadata("DependencyType", "Prerequisite");
                                containedPrerequisiteAssembliesTable.Add(id, item);
                            }
                        }
                    }
                }

                if (manifest.FileReferences != null)
                {
                    foreach (FileReference fileref in manifest.FileReferences)
                    {
                        if (fileref.ResolvedPath == null)
                            continue;

                        // add the loose file to the outputs list, if it's not already there
                        if (containedLooseEtcFilesTable.ContainsKey(fileref.ResolvedPath) == false)
                        {
                            ITaskItem itemLooseEtcFile = new TaskItem();
                            itemLooseEtcFile.ItemSpec = fileref.ResolvedPath;
                            // The ParentFile attribute (visible thru Project Outputs) relates the loose
                            // file to the parent assembly of which it is a part. This is important so we can
                            // group those files together with their parent assembly in the deployment tool
                            // (i.e. ClickOnce application files dialog).
                            itemLooseEtcFile.SetMetadata(ItemMetadataNames.parentFile, Path.GetFileName(path));
                            containedLooseEtcFilesTable.Add(fileref.ResolvedPath, itemLooseEtcFile);
                        }

                        if (fileref.ComClasses != null)
                        {
                            foreach (ComClass comclass in fileref.ComClasses)
                            {
                                // add the comclass to the outputs list, if it's not already there
                                if (containedComComponentsTable.ContainsKey(comclass.ClsId) == false)
                                {
                                    ITaskItem itemComClass = new TaskItem();
                                    itemComClass.ItemSpec = comclass.ClsId;
                                    containedComComponentsTable.Add(comclass.ClsId, itemComClass);
                                }
                            }
                        }

                        if (fileref.TypeLibs != null)
                        {
                            foreach (TypeLib typelib in fileref.TypeLibs)
                            {
                                // add the typelib to the outputs list, if it's not already there
                                if (containedTypeLibrariesTable.ContainsKey(typelib.TlbId) == false)
                                {
                                    ITaskItem itemTypeLib = new TaskItem();
                                    itemTypeLib.ItemSpec = typelib.TlbId;
                                    itemTypeLib.SetMetadata(ComReferenceItemMetadataNames.wrapperTool, ComReferenceTypes.tlbimp);
                                    itemTypeLib.SetMetadata(ComReferenceItemMetadataNames.guid, typelib.TlbId);
                                    itemTypeLib.SetMetadata(ComReferenceItemMetadataNames.lcid, "0");
                                    string delimStr = ".";
                                    char[] delimiter = delimStr.ToCharArray();
                                    string[] verMajorAndMinor = null;
                                    verMajorAndMinor = typelib.Version.Split(delimiter);
                                    // UNDONE: are major and minor version numbers in base 10 or 16?
                                    itemTypeLib.SetMetadata(ComReferenceItemMetadataNames.versionMajor, verMajorAndMinor[0]);
                                    itemTypeLib.SetMetadata(ComReferenceItemMetadataNames.versionMinor, verMajorAndMinor[1]);
                                    containedTypeLibrariesTable.Add(typelib.TlbId, itemTypeLib);
                                }
                            }

                            // add the loose TLB file to the outputs list, if it's not already there
                            if (containedLooseTlbFilesTable.Contains(fileref.ResolvedPath) == false)
                            {
                                ITaskItem itemLooseTlbFile = new TaskItem();
                                itemLooseTlbFile.ItemSpec = fileref.ResolvedPath;
                                containedLooseTlbFilesTable.Add(fileref.ResolvedPath, itemLooseTlbFile);
                            }
                        }
                    }
                }
            }
            return true;
        }
        #endregion
    }
}


text:
/**
 *
 * @author Oleg Pimenov, https://github.com/fost
 *
 */
/*jslint nomen: true, plusplus: true, vars: true */
/*global flyjs, console, game*/

this.game = this.game || {};

(function () {
    'use strict';

    var Game = function (canvasParent, options) {
        this.initialize(canvasParent, options);
    };

    var p = Game.prototype = new flyjs.StageRender();

    p.StageRender_initialize = p.initialize;
    p.StageRender_tick = p.tickHandler;

    p.initialize = function (canvasParent, options) {
        // must call super !!
        this.StageRender_initialize(canvasParent, options);

    };

    p.loadManifestComplete = function (event) {
        this._createEntities();

        // after create game Entities run Stage update
        this.startRender();
    };

    /**
     * @private
     * @param stage
     */
    p._createEntities = function () {
        this.add(new game.Hero(this));
    };

    /**
     * @override
     */
    p.tickHandler = function (event) {
        event.currentTarget.StageRender_tick(event);
    };

    game.Game = Game;
}());


text:
Powershell script for fixing devices in Windows System.

Developed to fix a recorrent problem on my Asus N53SV USB ports device.

**Always run as Administrator**

##Credits

Developed using [Device Management PowerShell Cmdlets](https://gallery.technet.microsoft.com/Device-Management-7fad2388) by Ricardo Mendes - MSFT

##Disclaimer

This script take use of some experimental features so it can crash and/or not work as pretended, tested on Windows 10 and Windows 8/8.1

##Problems

Error: *Could not load file or assembly HRESULT: 0x80131515*

Solution: Verify if you got the files in Modules folder and the script itself "Unlocked". This option shows up in the file properties dialog.

Error: *Execution of scripts is disabled on this system*

Solution: Run the command ``` Set-ExecutionPolicy RemoteSigned ```


text:
from datetime import datetime, timezone

def utc_now() -> datetime:
    """ Return current time with tz=UTC """
    return datetime.now(tz=timezone.utc)


text:
module Effective
  module Providers
    module Paypal
      extend ActiveSupport::Concern

      included do
        skip_before_action :verify_authenticity_token, only: [:paypal_postback]
      end

      # TODO: Make paypal postback work with admin checkout workflow

      def paypal_postback
        raise('paypal provider is not available') unless EffectiveOrders.paypal?

        @order ||= Effective::Order.where(id: (params[:invoice].to_i rescue 0)).first

        (EffectiveResources.authorize!(self, :update, @order) rescue false)

        if @order.present?
          if @order.purchased?
            order_purchased(payment: params, provider: 'paypal', card: params[:payment_type])
          elsif (params[:payment_status] == 'Completed' && params[:custom] == EffectiveOrders.paypal[:secret])
            order_purchased(payment: params, provider: 'paypal', card: params[:payment_type])
          else
            order_declined(payment: params, provider: 'paypal', card: params[:payment_type])
          end
        end

        head(:ok)
      end

    end
  end
end


text:
/* _________________________________________________________ */
/* _________________________________________________________ */
/**
 * Fichier : Athlete.java
 *
 * Créé le 31 oct. 2013 à 10:54:05
 *
 * Auteur : Jerome POINAS
 */
package business;

import java.util.ArrayList;
import java.util.List;
import business.exceptions.InvalidFirstNameException;
import business.exceptions.InvalidNameException;

/* _________________________________________________________ */
/**
 * La classe Athlete.
 * Cette classe représente un Athlete.
 * Un Athlete est une personne, il a un name et un prénom.
 *
 * Il a une liste de performances/performances.
 *
 * @author Jerome POINAS
 */
public class Athlete implements Comparable<Athlete>
{
	/**
	 * Le name de famille de l'athlete.
	 */
	private String				name;
	/**
	 * Le firstName de l'athlete.
	 */
	private String				firstName;
	/**
	 * Les performances de cet athlete.
	 */
	private List<Performance>	performances;

	/* _________________________________________________________ */
	/**
	 * Retourne la valeur du champ name.
	 *
	 * @return la valeur du champ name.
	 */
	public String getName()
	{
		return name;
	}

	/* _________________________________________________________ */
	/**
	 * Retourne la valeur du champ firstName.
	 *
	 * @return la valeur du champ firstName.
	 */
	public String getFirstName()
	{
		return firstName;
	}

	/* _________________________________________________________ */
	/**
	 * Retourne la valeur du champ performances.
	 *
	 * @return la valeur du champ performances.
	 */
	public List<Performance> getPerformances()
	{
		return performances;
	}

	/* _________________________________________________________ */
	/**
	 * Constructeur d'un athlete.
	 *
	 * @param nom
	 *            the nom
	 * @param prenom
	 *            the prenom
	 * @throws InvalidNameException
	 *             Exception le name est null.
	 * @throws InvalidFirstNameException
	 *             Exception le firstName est null.
	 */
	public Athlete(final String nom, final String prenom)
			throws InvalidNameException, InvalidFirstNameException
	{
		performances = new ArrayList<Performance>();
		setName(nom);
		setFirstName(prenom);
	}

	/* _________________________________________________________ */
	/**
	 * Constructeur d'un athlete.
	 *
	 * @param nom
	 *            the nom
	 * @param prenom
	 *            the prenom
	 * @param list
	 *            the list
	 * @throws InvalidNameException
	 *             Exception le name est null.
	 * @throws InvalidFirstNameException
	 *             Exception le firstName est null.
	 */
	public Athlete(final String nom, final String prenom,
			final List<Performance> list) throws InvalidNameException,
			InvalidFirstNameException
	{
		setName(nom);
		setFirstName(prenom);
		setListPerf(list);
	}

	/**
	 * Methode qui permet de modifier le name de l'athlete.
	 *
	 * @param nom
	 *            the new le name de famille de l'athlete
	 * @throws InvalidNameException
	 *             to
	 */
	public void setName(final String nom) throws InvalidNameException
	{
		if (nom == null)
		{
			throw new InvalidNameException("Le name est invalide");
		}
		name = nom;
	}

	/**
	 * Methode qui permet de modifier le firstName de l'athlete.
	 *
	 * @param prenom
	 *            the new le firstName de l'athlete
	 * @throws InvalidFirstNameException
	 *             to
	 */
	public void setFirstName(final String prenom)
			throws InvalidFirstNameException
	{
		if (prenom == null)
		{
			throw new InvalidFirstNameException("Le firstName est invalide");
		}
		firstName = prenom;
	}

	/**
	 * Methode qui permet de modifier la liste des performances de l'athlete.
	 *
	 * @param mesPerformances
	 *            La liste des performances.
	 */
	public void setListPerf(final List<Performance> mesPerformances)
	{
		performances = mesPerformances;
	}

	/* _________________________________________________________ */
	/**
	 * To string.
	 *
	 * @return the string
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		final StringBuilder builder = new StringBuilder();
		builder.append(firstName).append(" ").append(name);
		builder.append("[");
		for (int i = 0; i < performances.size(); i++)
		{
			final Performance perf = performances.get(i);
			if (i == (performances.size() - 1))
			{
				builder.append(perf);
			}
			else
			{
				builder.append(perf).append(";");
			}
		}
		builder.append("]");
		builder.append("\n");
		return builder.toString();
	}

	/* _________________________________________________________ */
	/**
	 * Methode permettant de comparer deux athletes.
	 *
	 * @param athlete
	 *            L'athlete a comparer.
	 * @return int représentant l'égalité ou pas des deux athletes.
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(final Athlete athlete)
	{
		int resultat = 0;
		if (getName().compareTo(athlete.getName()) > 0)
		{
			resultat = 1;
		}
		else if (getName().compareTo(athlete.getName()) < 0)
		{
			resultat = -1;
		}
		else if (getName().equals(athlete.getName()))
		{
			if (getFirstName().compareTo(athlete.getFirstName()) > 0)
			{
				resultat = 1;
			}
			else if (getFirstName().compareTo(athlete.getFirstName()) < 0)
			{
				resultat = -1;
			}
			else
			{
				resultat = 0;
			}
		}
		return resultat;
	}
}
/* _________________________________________________________ */
/*
 * Fin du fichier Athlete.java.
 * /*_________________________________________________________
 */


text:
import { Injectable } from '@angular/core';
import { Cordova, Plugin } from '@ionic-native/core';

export interface BarcodeScannerOptions {

  /**
   * Prefer front camera. Supported on iOS and Android.
   */
  preferFrontCamera?: boolean;

  /**
   * Show flip camera button. Supported on iOS and Android.
   */
  showFlipCameraButton?: boolean;

  /**
   * Show torch button. Supported on iOS and Android.
   */
  showTorchButton?: boolean;

  /**
   * Disable animations. Supported on iOS only.
   */
  disableAnimations?: boolean;

  /**
   * Disable success beep. Supported on iOS only.
   */
  disableSuccessBeep?: boolean;

  /**
   * Prompt text. Supported on Android only.
   */
  prompt?: string;

  /**
   * Formats separated by commas. Defaults to all formats except `PDF_417` and `RSS_EXPANDED`.
   */
  formats?: string;

  /**
   * Orientation. Supported on Android only. Can be set to `portrait` or `landscape`. Defaults to none so the user can rotate the phone and pick an orientation.
   */
  orientation?: string;

  /**
   * Launch with the torch switched on (if available). Supported on Android only.
   */
  torchOn?: boolean;

  /**
   * Display scanned text for X ms. 0 suppresses it entirely, default 1500. Supported on Android only.
   */
  resultDisplayDuration?: number;

}

/**
 * @name Barcode Scanner
 * @description
 * The Barcode Scanner Plugin opens a camera view and automatically scans a barcode, returning the data back to you.
 *
 * Requires Cordova plugin: `phonegap-plugin-barcodescanner`. For more info, please see the [BarcodeScanner plugin docs](https://github.com/phonegap/phonegap-plugin-barcodescanner).
 *
 * @usage
 * ```typescript
 * import { BarcodeScanner } from '@ionic-native/barcode-scanner';
 *
 * constructor(private barcodeScanner: BarcodeScanner) { }
 *
 * ...
 *
 *
 * this.barcodeScanner.scan().then((barcodeData) => {
 *  // Success! Barcode data is here
 * }, (err) => {
 * 	// An error occurred
 * });
 * ```
 * @interfaces
 * BarcodeScannerOptions
 */
@Plugin({
  pluginName: 'BarcodeScanner',
  plugin: 'phonegap-plugin-barcodescanner',
  pluginRef: 'cordova.plugins.barcodeScanner',
  repo: 'https://github.com/phonegap/phonegap-plugin-barcodescanner',
  platforms: ['Android', 'iOS', 'Windows Phone 8', 'Windows 10', 'Windows 8', 'BlackBerry 10', 'Browser']
})
@Injectable()
export class BarcodeScanner {

  Encode: {
    TEXT_TYPE: string;
    EMAIL_TYPE: string;
    PHONE_TYPE: string;
    SMS_TYPE: string;
  } = {
    TEXT_TYPE: 'TEXT_TYPE',
    EMAIL_TYPE: 'EMAIL_TYPE',
    PHONE_TYPE: 'PHONE_TYPE',
    SMS_TYPE: 'SMS_TYPE'
  };

  /**
   * Open the barcode scanner.
   * @param options {BarcodeScannerOptions} Optional options to pass to the scanner
   * @returns {Promise<any>} Returns a Promise that resolves with scanner data, or rejects with an error.
   */
  @Cordova({
    callbackOrder: 'reverse'
  })
  scan(options?: BarcodeScannerOptions): Promise<any> { return; }

  /**
   * Encodes data into a barcode.
   * NOTE: not well supported on Android
   * @param type {string} Type of encoding
   * @param data {any} Data to encode
   * @returns {Promise<any>}
   */
  @Cordova()
  encode(type: string, data: any): Promise<any> { return; }

}


text:
import { Class, ModelElement, Package, Property } from '../../models';
import { StringService } from '../../services';
import { Template } from '../Template';
import { TypeScriptBundler } from './TypeScriptBundler';

export class TypeScriptTemplate extends Template {
  constructor(protected bundler: TypeScriptBundler) {
    super();
  }

  protected static forEach<T>(
    a: { [Symbol.iterator](): Iterator<T> },
    callback: (a: T) => string,
    separator: string = '',
  ): string {
    return [...a].map(callback).join(separator);
  }

  protected static exportStmt(model: ModelElement) {
    if (model instanceof Package) {
      return `export * from './${StringService.camelToHyphenCase(model.name || '')}';`;
    }

    if (model instanceof Class) {
      return `export { ${model.name} } from './${model.name}';\nexport { I${model.name} } from './I${model.name}';`;
    }

    return `export { ${model.name} } from './${model.name}';`;
  }

  protected static typeOf(model: ModelElement | null, importCb: (model: ModelElement, type: string) => void = () => {}) {
    if (!model) return 'any';

    switch (model.getHref()) {
      case 'http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi#String': return 'string';
      case 'http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi#Integer': return 'number';
      case 'http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi#UnlimitedNatural': return 'number';
      case 'http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi#Real': return 'number';
      case 'http://www.omg.org/spec/UML/20131001/PrimitiveTypes.xmi#Boolean': return 'boolean';
      case 'http://www.omg.org/spec/UML/20131001/UML.xmi#Element': return 'Metagram.Element';
      case 'http://www.omg.org/spec/XMI/20131001/XMI-model.xmi#_XMI-DateTime': return 'Date';
    }

    const name = `${model instanceof Class ? 'I' : ''}${model.name}`;
    importCb(model, `{ ${name} }`);
    return name;
  }

  protected static pluralize(str: string): string {
    return StringService.pluralize(str);
  }

  protected static upperCaseFirst(str: string): string {
    return StringService.upperCaseFirst(str);
  }

  protected static attributeConstructor(attr: Property): string {
    const typeOf = TypeScriptTemplate.typeOf;
    return `new Metagram.Attribute<${typeOf(attr.type)}>('${attr.name!}', ${attr.ordered}, ${attr.unique}, ${attr.lower}, ${attr.upper})`;
  }

  protected static collectionInterfaceName(attr: Property): string {
    const typeOf = TypeScriptTemplate.typeOf;
    return `Metagram.${attr.ordered ? 'Ordered' : 'Arbitrary'}${attr.unique ? 'Unique' : 'Ambiguous'}Collection<${typeOf(attr.type)}>`;
  }

  generateFilename(data: any, options: any = {}): string {
    if (data instanceof Package) {
      return `${this.bundler.getPackageDirectory(data)}/index.ts`;
    }

    if (data instanceof ModelElement) {
      const path = this.bundler.getPackageDirectory(data.owningElement);
      const basename = this.generateBasename(data);
      return `${path}/${basename}`;
    }

    return 'src/index.ts';
  }

  generateBasename(element: ModelElement): string {
    return `${element.name}.ts`;
  }

  generateImports(map: Map<string, string>): string {
    const array = [...map].sort(([imp1, filename1], [imp2, filename2]) => this.compareFilenames(filename1, filename2));
    return array.map(([imp1, filename1]) => `import ${imp1} from '${filename1}';`).join('\n');
  }

  compareFilenames(fn1: string, fn2: string): number {
    const doesNotStartWithDot = /^[^\.]/;
    if (fn1.match(doesNotStartWithDot) && !fn2.match(doesNotStartWithDot)) return -1;
    if (!fn1.match(doesNotStartWithDot) && fn2.match(doesNotStartWithDot)) return 1;
    if (fn1 < fn2) return -1;
    if (fn1 > fn2) return 1;
    return 0;
  }
}


text:
html, body {
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
}
h1 {
  margin-left: 5px;
  margin-right: 5px;
}

/* Tabs */
#tabRow>td {
  border: 1px solid #ccc;
}
td.tabon {
  border-bottom-color: #ddd !important;
  background-color: #ddd;
  padding: 5px 19px;
}
td.taboff {
  cursor: pointer;
  padding: 5px 19px;
}
td.taboff:hover {
  background-color: #eee;
}
td.tabmin {
  border-top-style: none !important;
  border-left-style: none !important;
  border-right-style: none !important;
}
td.tabmax {
  border-top-style: none !important;
  border-left-style: none !important;
  border-right-style: none !important;
  width: 99%;
  padding-left: 10px;
  padding-right: 10px;
  text-align: right;
}
html[dir=rtl] td.tabmax {
  text-align: left;
}

table {
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  border: none;
}
td {
  padding: 0;
  vertical-align: top;
}
.content {
  visibility: hidden;
  margin: 0;
  padding: 1ex;
  position: absolute;
}
pre.content {
  overflow: scroll;
}
#content_blocks {
  padding: 0;
}
.blocklySvg {
  border-top: none !important;
}
#content_xml {
  resize: none;
  outline: none;
  border: none;
  font-family: monospace;
  overflow: scroll;
}
#languageMenu {
  vertical-align: top;
  margin-top: 15px;
  margin-right: 15px;
}

/* Buttons */
button {
  padding: 1px 10px;
  margin: 1px 5px;
}
#pastebinButton {
  position:relative;
  height: 28px;
  top:-3px;
  //background-color:darkblue;
  //color:white;
}
.hiddenIframe {
  display: none;
}
.visibleIframe {
  height: 35px;
  width: 100%;
  display: block;
  border: 0;
}
.hiddenButton {
  display: none;
}
/* Sprited icons. */
.icon21 {
  height: 21px;
  width: 21px;
  background-image: url(icons.png);
}
.trash {
  background-position: 0px 0px;
}
.link {
  background-position: -21px 0px;
}
.run {
  background-position: -42px 0px;
}


text:
package com.ptun.app.eventbus;

/**
 * Created by Lenovo on 4/29/2017.
 */
public class EventBus {
    private static com.google.common.eventbus.EventBus eventBus;

    public static com.google.common.eventbus.EventBus getDefault() {
        if (eventBus == null)
            eventBus = new com.google.common.eventbus.EventBus();
        return eventBus;
    }
}


text:
namespace ExampleApp
{
    namespace InteriorsPosition
    {
        namespace SdkModel
        {
            namespace SenionLab
            {
                SenionLabLocationService::SenionLabLocationService(Eegeo::Location::ILocationService& defaultLocationService,
                                                                   const Eegeo::Rendering::EnvironmentFlatteningService& environmentFlatteningService,
                                                                   const Eegeo::Resources::Interiors::InteriorInteractionModel& interiorInteractionModel)
                : m_defaultLocationService(defaultLocationService)
                , m_environmentFlatteningService(environmentFlatteningService)
                , m_interiorInteractionModel(interiorInteractionModel)
                , m_isAuthorized(false)
                , m_latLong(Eegeo::Space::LatLong::FromDegrees(0, 0))
                , m_floorIndex(-1)
                {
                }

                const bool SenionLabLocationService::GetIsAuthorized() const
                {
                    return m_isAuthorized;
                }

                bool SenionLabLocationService::IsIndoors()
                {
                    return true;
                }

                Eegeo::Resources::Interiors::InteriorId SenionLabLocationService::GetInteriorId()
                {
                    if(m_interiorInteractionModel.HasInteriorModel())
                    {
                        return m_interiorInteractionModel.GetInteriorModel()->GetId();
                    }
                    else return Eegeo::Resources::Interiors::InteriorId::NullId();
                }

                bool SenionLabLocationService::GetLocation(Eegeo::Space::LatLong& latLong)
                {
                    if(std::abs(m_latLong.GetLatitude()) > 0 || std::abs(m_latLong.GetLongitude()) > 0)
                    {
                        latLong.SetLatitude(m_latLong.GetLatitude());
                        latLong.SetLongitude(m_latLong.GetLongitude());
                    }
                    else
                    {
                        m_defaultLocationService.GetLocation(latLong);
                    }
                    return true;
                }

                bool SenionLabLocationService::GetAltitude(double& altitude)
                {
                    const Eegeo::Resources::Interiors::InteriorsModel* interiorModel = m_interiorInteractionModel.GetInteriorModel();
                    if(interiorModel)
                    {
                        altitude = ExampleApp::Helpers::InteriorHeightHelpers::GetFloorHeightAboveSeaLevelIncludingEnvironmentFlattening(*interiorModel,
                                                                                m_floorIndex,
                                                                                m_environmentFlatteningService.GetCurrentScale());
                        return true;
                    }

                    return false;
                }

                bool SenionLabLocationService::GetFloorIndex(int& floorIndex)
                {
                    floorIndex = m_floorIndex;
                    return true;
                }

                bool SenionLabLocationService::GetHorizontalAccuracy(double& accuracyInMeters)
                {
                    accuracyInMeters = m_horizontalAccuracyInMeters;
                    return true;
                }

                bool SenionLabLocationService::GetHeadingDegrees(double& headingDegrees)
                {
                    return m_defaultLocationService.GetHeadingDegrees(headingDegrees);
                }

                void SenionLabLocationService::StopListening()
                {
                }

                void SenionLabLocationService::SetIsAuthorized(bool isAuthorized)
                {
                    m_isAuthorized = isAuthorized;
                }

                void SenionLabLocationService::SetLocation(Eegeo::Space::LatLong &latLong)
                {
                    m_latLong = latLong;
                }

                void SenionLabLocationService::SetHorizontalAccuracyInMeters(double horizontalAccuracyInMeters){
                    m_horizontalAccuracyInMeters = horizontalAccuracyInMeters;
                }

                void SenionLabLocationService::SetFloorIndex(int floorIndex)
                {
                    m_floorIndex = floorIndex;
                }
            }
        }
    }
}


text:
'use strict';

angular.module('copayApp.controllers').controller('preferencesFeeController',
  function($rootScope, $scope, configService, go, gettext) {
    var config = configService.getSync();
    this.feeName = config.wallet.settings.feeName || 'Priority';
    this.feeOpts = [{
      name: gettext('Priority'),
      value: 100,
    }, {
      name: gettext('Normal'),
      value: 50,
    }, {
      name: gettext('Economy'),
      value: 10,
    }, {
      name: gettext('Emergency'),
      red: true,
      value: 500,
    }, ];

    this.save = function(newFee) {
      var opts = {
        wallet: {
          settings: {
            feeName: newFee.name,
            feeValue: newFee.value * 100,
          }
        }
      };
      this.feeName = newFee.name;

      configService.set(opts, function(err) {
        if (err) console.log(err);
      });

    };
  });


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Sifter DEV</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/>
    <link href="DT_bootstrap.css" rel="stylesheet"/>
    <link href="utsa.css" rel="stylesheet"/>

        SIFTER

        Evidence
					About

					          BOOKMARK

        LOADED DOCUMENTS

        Hover over cell for more information.

      <form class="well form-search" id="searchQuery">
      <input type="text" class="span8" id="searchBox"></input><button type="submit" class="btn"> Search</button>
      </form>

      Download (CSV)

<button id="FilesViewBtn" class="btn" style="width: 8em;">Files</button><button id="HitsViewBtn" class="btn" style="width: 8em;">Search Hits</button>

      0 items.
      0 selected.

          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Sifter

Build version: v1.0

          <form id="indexInfoForm">
            <fieldset>

Sifter was created by:

Dr. Nicole Beebe, nbeebe@utsa.edu, University of Texas-San Antonio

Jon Stewart, jon@lightboxtechnologies.com, Lightbox Technologies, Inc.

Jonathan Solis, jonathan.aaron.solis@gmail.com

            </fieldset>
          </form>

Copyright © 2013, University of Texas at San Antonio

Create Bookmark

          Comment
          <textarea type="text" name="commentText" class="span12" id="commentText"></textarea>

          Cancel
          OK

          ×

Index Evidence

Index an evidence file for searching and analysis.

          <form class="form-inline">
            <fieldset>

            Evidence file

              <input class="input-file" id="fileInput" type="file">

                <input type="checkbox" id="unallocatedCb" value="unallocated">
                Index unallocated clusters

                <input type="checkbox" id="archivesCb" value="archives">
                Index file archives

                <input type="checkbox" id="emailCb" value="email">
                Index email

            </fieldset>
          </form>

          Index
          Cancel

          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Add Evidence

Specify the path to the evidence index.

          <form id="indexInfoForm">
            <fieldset>
              Index Path
              <input type="text" class="span12" id = "indexInfoPath"/>
            </fieldset>
          </form>

          Cancel
          OK