text:
<?php

abstract class BaseMlmDailyPipsCsv extends BaseObject  implements Persistent {

	protected static $peer;

	protected $pip_id;

	protected $traded_datetime;

	protected $file_id;

	protected $pips_string;

	protected $login_id;

	protected $login_name;

	protected $balance;

	protected $credit;

	protected $commissions;

	protected $taxes;

	protected $storage;

	protected $profit;

	protected $interest;

	protected $tax;

	protected $unrealizedpl;

	protected $equity;

	protected $status_code;

	protected $remarks;

	protected $created_by;

	protected $created_on;

	protected $updated_by;

	protected $updated_on;

	protected $alreadyInSave = false;

	protected $alreadyInValidation = false;

	public function getPipId()
	{

		return $this->pip_id;
	}

	public function getTradedDatetime($format = 'Y-m-d H:i:s')
	{

		if ($this->traded_datetime === null || $this->traded_datetime === '') {
			return null;
		} elseif (!is_int($this->traded_datetime)) {
						$ts = strtotime($this->traded_datetime);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [traded_datetime] as date/time value: " . var_export($this->traded_datetime, true));
			}
		} else {
			$ts = $this->traded_datetime;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	public function getFileId()
	{

		return $this->file_id;
	}

	public function getPipsString()
	{

		return $this->pips_string;
	}

	public function getLoginId()
	{

		return $this->login_id;
	}

	public function getLoginName()
	{

		return $this->login_name;
	}

	public function getBalance()
	{

		return $this->balance;
	}

	public function getCredit()
	{

		return $this->credit;
	}

	public function getCommissions()
	{

		return $this->commissions;
	}

	public function getTaxes()
	{

		return $this->taxes;
	}

	public function getStorage()
	{

		return $this->storage;
	}

	public function getProfit()
	{

		return $this->profit;
	}

	public function getInterest()
	{

		return $this->interest;
	}

	public function getTax()
	{

		return $this->tax;
	}

	public function getUnrealizedpl()
	{

		return $this->unrealizedpl;
	}

	public function getEquity()
	{

		return $this->equity;
	}

	public function getStatusCode()
	{

		return $this->status_code;
	}

	public function getRemarks()
	{

		return $this->remarks;
	}

	public function getCreatedBy()
	{

		return $this->created_by;
	}

	public function getCreatedOn($format = 'Y-m-d H:i:s')
	{

		if ($this->created_on === null || $this->created_on === '') {
			return null;
		} elseif (!is_int($this->created_on)) {
						$ts = strtotime($this->created_on);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_on] as date/time value: " . var_export($this->created_on, true));
			}
		} else {
			$ts = $this->created_on;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	public function getUpdatedBy()
	{

		return $this->updated_by;
	}

	public function getUpdatedOn($format = 'Y-m-d H:i:s')
	{

		if ($this->updated_on === null || $this->updated_on === '') {
			return null;
		} elseif (!is_int($this->updated_on)) {
						$ts = strtotime($this->updated_on);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [updated_on] as date/time value: " . var_export($this->updated_on, true));
			}
		} else {
			$ts = $this->updated_on;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	public function setPipId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->pip_id !== $v) {
			$this->pip_id = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::PIP_ID;
		}

	}

	public function setTradedDatetime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [traded_datetime] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->traded_datetime !== $ts) {
			$this->traded_datetime = $ts;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::TRADED_DATETIME;
		}

	}

	public function setFileId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->file_id !== $v) {
			$this->file_id = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::FILE_ID;
		}

	}

	public function setPipsString($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v;
		}

		if ($this->pips_string !== $v) {
			$this->pips_string = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::PIPS_STRING;
		}

	}

	public function setLoginId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->login_id !== $v) {
			$this->login_id = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::LOGIN_ID;
		}

	}

	public function setLoginName($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v;
		}

		if ($this->login_name !== $v) {
			$this->login_name = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::LOGIN_NAME;
		}

	}

	public function setBalance($v)
	{

		if ($this->balance !== $v) {
			$this->balance = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::BALANCE;
		}

	}

	public function setCredit($v)
	{

		if ($this->credit !== $v) {
			$this->credit = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::CREDIT;
		}

	}

	public function setCommissions($v)
	{

		if ($this->commissions !== $v) {
			$this->commissions = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::COMMISSIONS;
		}

	}

	public function setTaxes($v)
	{

		if ($this->taxes !== $v) {
			$this->taxes = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::TAXES;
		}

	}

	public function setStorage($v)
	{

		if ($this->storage !== $v) {
			$this->storage = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::STORAGE;
		}

	}

	public function setProfit($v)
	{

		if ($this->profit !== $v) {
			$this->profit = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::PROFIT;
		}

	}

	public function setInterest($v)
	{

		if ($this->interest !== $v) {
			$this->interest = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::INTEREST;
		}

	}

	public function setTax($v)
	{

		if ($this->tax !== $v) {
			$this->tax = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::TAX;
		}

	}

	public function setUnrealizedpl($v)
	{

		if ($this->unrealizedpl !== $v) {
			$this->unrealizedpl = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::UNREALIZEDPL;
		}

	}

	public function setEquity($v)
	{

		if ($this->equity !== $v) {
			$this->equity = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::EQUITY;
		}

	}

	public function setStatusCode($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v;
		}

		if ($this->status_code !== $v) {
			$this->status_code = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::STATUS_CODE;
		}

	}

	public function setRemarks($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v;
		}

		if ($this->remarks !== $v) {
			$this->remarks = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::REMARKS;
		}

	}

	public function setCreatedBy($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->created_by !== $v) {
			$this->created_by = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::CREATED_BY;
		}

	}

	public function setCreatedOn($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_on] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_on !== $ts) {
			$this->created_on = $ts;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::CREATED_ON;
		}

	}

	public function setUpdatedBy($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->updated_by !== $v) {
			$this->updated_by = $v;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::UPDATED_BY;
		}

	}

	public function setUpdatedOn($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [updated_on] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->updated_on !== $ts) {
			$this->updated_on = $ts;
			$this->modifiedColumns[] = MlmDailyPipsCsvPeer::UPDATED_ON;
		}

	}

	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->pip_id = $rs->getInt($startcol + 0);

			$this->traded_datetime = $rs->getTimestamp($startcol + 1, null);

			$this->file_id = $rs->getInt($startcol + 2);

			$this->pips_string = $rs->getString($startcol + 3);

			$this->login_id = $rs->getInt($startcol + 4);

			$this->login_name = $rs->getString($startcol + 5);

			$this->balance = $rs->getFloat($startcol + 6);

			$this->credit = $rs->getFloat($startcol + 7);

			$this->commissions = $rs->getFloat($startcol + 8);

			$this->taxes = $rs->getFloat($startcol + 9);

			$this->storage = $rs->getFloat($startcol + 10);

			$this->profit = $rs->getFloat($startcol + 11);

			$this->interest = $rs->getFloat($startcol + 12);

			$this->tax = $rs->getFloat($startcol + 13);

			$this->unrealizedpl = $rs->getFloat($startcol + 14);

			$this->equity = $rs->getFloat($startcol + 15);

			$this->status_code = $rs->getString($startcol + 16);

			$this->remarks = $rs->getString($startcol + 17);

			$this->created_by = $rs->getInt($startcol + 18);

			$this->created_on = $rs->getTimestamp($startcol + 19, null);

			$this->updated_by = $rs->getInt($startcol + 20);

			$this->updated_on = $rs->getTimestamp($startcol + 21, null);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 22;
		} catch (Exception $e) {
			throw new PropelException("Error populating MlmDailyPipsCsv object", $e);
		}
	}

	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(MlmDailyPipsCsvPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			MlmDailyPipsCsvPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(MlmDailyPipsCsvPeer::CREATED_ON))
    {
      $this->setCreatedOn(time());
    }

    if ($this->isModified() && !$this->isColumnModified(MlmDailyPipsCsvPeer::UPDATED_ON))
    {
      $this->setUpdatedOn(time());
    }

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

		if ($con === null) {
			$con = Propel::getConnection(MlmDailyPipsCsvPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;

						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = MlmDailyPipsCsvPeer::doInsert($this, $con);
					$affectedRows += 1;
					$this->setPipId($pk);
					$this->setNew(false);
				} else {
					$affectedRows += MlmDailyPipsCsvPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	}

	protected $validationFailures = array();

	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();

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

			$this->alreadyInValidation = false;
		}

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

	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = MlmDailyPipsCsvPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getPipId();
				break;
			case 1:
				return $this->getTradedDatetime();
				break;
			case 2:
				return $this->getFileId();
				break;
			case 3:
				return $this->getPipsString();
				break;
			case 4:
				return $this->getLoginId();
				break;
			case 5:
				return $this->getLoginName();
				break;
			case 6:
				return $this->getBalance();
				break;
			case 7:
				return $this->getCredit();
				break;
			case 8:
				return $this->getCommissions();
				break;
			case 9:
				return $this->getTaxes();
				break;
			case 10:
				return $this->getStorage();
				break;
			case 11:
				return $this->getProfit();
				break;
			case 12:
				return $this->getInterest();
				break;
			case 13:
				return $this->getTax();
				break;
			case 14:
				return $this->getUnrealizedpl();
				break;
			case 15:
				return $this->getEquity();
				break;
			case 16:
				return $this->getStatusCode();
				break;
			case 17:
				return $this->getRemarks();
				break;
			case 18:
				return $this->getCreatedBy();
				break;
			case 19:
				return $this->getCreatedOn();
				break;
			case 20:
				return $this->getUpdatedBy();
				break;
			case 21:
				return $this->getUpdatedOn();
				break;
			default:
				return null;
				break;
		} 	}

	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = MlmDailyPipsCsvPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getPipId(),
			$keys[1] => $this->getTradedDatetime(),
			$keys[2] => $this->getFileId(),
			$keys[3] => $this->getPipsString(),
			$keys[4] => $this->getLoginId(),
			$keys[5] => $this->getLoginName(),
			$keys[6] => $this->getBalance(),
			$keys[7] => $this->getCredit(),
			$keys[8] => $this->getCommissions(),
			$keys[9] => $this->getTaxes(),
			$keys[10] => $this->getStorage(),
			$keys[11] => $this->getProfit(),
			$keys[12] => $this->getInterest(),
			$keys[13] => $this->getTax(),
			$keys[14] => $this->getUnrealizedpl(),
			$keys[15] => $this->getEquity(),
			$keys[16] => $this->getStatusCode(),
			$keys[17] => $this->getRemarks(),
			$keys[18] => $this->getCreatedBy(),
			$keys[19] => $this->getCreatedOn(),
			$keys[20] => $this->getUpdatedBy(),
			$keys[21] => $this->getUpdatedOn(),
		);
		return $result;
	}

	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = MlmDailyPipsCsvPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setPipId($value);
				break;
			case 1:
				$this->setTradedDatetime($value);
				break;
			case 2:
				$this->setFileId($value);
				break;
			case 3:
				$this->setPipsString($value);
				break;
			case 4:
				$this->setLoginId($value);
				break;
			case 5:
				$this->setLoginName($value);
				break;
			case 6:
				$this->setBalance($value);
				break;
			case 7:
				$this->setCredit($value);
				break;
			case 8:
				$this->setCommissions($value);
				break;
			case 9:
				$this->setTaxes($value);
				break;
			case 10:
				$this->setStorage($value);
				break;
			case 11:
				$this->setProfit($value);
				break;
			case 12:
				$this->setInterest($value);
				break;
			case 13:
				$this->setTax($value);
				break;
			case 14:
				$this->setUnrealizedpl($value);
				break;
			case 15:
				$this->setEquity($value);
				break;
			case 16:
				$this->setStatusCode($value);
				break;
			case 17:
				$this->setRemarks($value);
				break;
			case 18:
				$this->setCreatedBy($value);
				break;
			case 19:
				$this->setCreatedOn($value);
				break;
			case 20:
				$this->setUpdatedBy($value);
				break;
			case 21:
				$this->setUpdatedOn($value);
				break;
		} 	}

	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = MlmDailyPipsCsvPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setPipId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setTradedDatetime($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setFileId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setPipsString($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setLoginId($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setLoginName($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setBalance($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setCredit($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setCommissions($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setTaxes($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setStorage($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setProfit($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setInterest($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setTax($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setUnrealizedpl($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setEquity($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setStatusCode($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setRemarks($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setCreatedBy($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setCreatedOn($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setUpdatedBy($arr[$keys[20]]);
		if (array_key_exists($keys[21], $arr)) $this->setUpdatedOn($arr[$keys[21]]);
	}

	public function buildCriteria()
	{
		$criteria = new Criteria(MlmDailyPipsCsvPeer::DATABASE_NAME);

		if ($this->isColumnModified(MlmDailyPipsCsvPeer::PIP_ID)) $criteria->add(MlmDailyPipsCsvPeer::PIP_ID, $this->pip_id);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::TRADED_DATETIME)) $criteria->add(MlmDailyPipsCsvPeer::TRADED_DATETIME, $this->traded_datetime);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::FILE_ID)) $criteria->add(MlmDailyPipsCsvPeer::FILE_ID, $this->file_id);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::PIPS_STRING)) $criteria->add(MlmDailyPipsCsvPeer::PIPS_STRING, $this->pips_string);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::LOGIN_ID)) $criteria->add(MlmDailyPipsCsvPeer::LOGIN_ID, $this->login_id);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::LOGIN_NAME)) $criteria->add(MlmDailyPipsCsvPeer::LOGIN_NAME, $this->login_name);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::BALANCE)) $criteria->add(MlmDailyPipsCsvPeer::BALANCE, $this->balance);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::CREDIT)) $criteria->add(MlmDailyPipsCsvPeer::CREDIT, $this->credit);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::COMMISSIONS)) $criteria->add(MlmDailyPipsCsvPeer::COMMISSIONS, $this->commissions);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::TAXES)) $criteria->add(MlmDailyPipsCsvPeer::TAXES, $this->taxes);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::STORAGE)) $criteria->add(MlmDailyPipsCsvPeer::STORAGE, $this->storage);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::PROFIT)) $criteria->add(MlmDailyPipsCsvPeer::PROFIT, $this->profit);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::INTEREST)) $criteria->add(MlmDailyPipsCsvPeer::INTEREST, $this->interest);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::TAX)) $criteria->add(MlmDailyPipsCsvPeer::TAX, $this->tax);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::UNREALIZEDPL)) $criteria->add(MlmDailyPipsCsvPeer::UNREALIZEDPL, $this->unrealizedpl);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::EQUITY)) $criteria->add(MlmDailyPipsCsvPeer::EQUITY, $this->equity);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::STATUS_CODE)) $criteria->add(MlmDailyPipsCsvPeer::STATUS_CODE, $this->status_code);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::REMARKS)) $criteria->add(MlmDailyPipsCsvPeer::REMARKS, $this->remarks);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::CREATED_BY)) $criteria->add(MlmDailyPipsCsvPeer::CREATED_BY, $this->created_by);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::CREATED_ON)) $criteria->add(MlmDailyPipsCsvPeer::CREATED_ON, $this->created_on);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::UPDATED_BY)) $criteria->add(MlmDailyPipsCsvPeer::UPDATED_BY, $this->updated_by);
		if ($this->isColumnModified(MlmDailyPipsCsvPeer::UPDATED_ON)) $criteria->add(MlmDailyPipsCsvPeer::UPDATED_ON, $this->updated_on);

		return $criteria;
	}

	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(MlmDailyPipsCsvPeer::DATABASE_NAME);

		$criteria->add(MlmDailyPipsCsvPeer::PIP_ID, $this->pip_id);

		return $criteria;
	}

	public function getPrimaryKey()
	{
		return $this->getPipId();
	}

	public function setPrimaryKey($key)
	{
		$this->setPipId($key);
	}

	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setTradedDatetime($this->traded_datetime);

		$copyObj->setFileId($this->file_id);

		$copyObj->setPipsString($this->pips_string);

		$copyObj->setLoginId($this->login_id);

		$copyObj->setLoginName($this->login_name);

		$copyObj->setBalance($this->balance);

		$copyObj->setCredit($this->credit);

		$copyObj->setCommissions($this->commissions);

		$copyObj->setTaxes($this->taxes);

		$copyObj->setStorage($this->storage);

		$copyObj->setProfit($this->profit);

		$copyObj->setInterest($this->interest);

		$copyObj->setTax($this->tax);

		$copyObj->setUnrealizedpl($this->unrealizedpl);

		$copyObj->setEquity($this->equity);

		$copyObj->setStatusCode($this->status_code);

		$copyObj->setRemarks($this->remarks);

		$copyObj->setCreatedBy($this->created_by);

		$copyObj->setCreatedOn($this->created_on);

		$copyObj->setUpdatedBy($this->updated_by);

		$copyObj->setUpdatedOn($this->updated_on);

		$copyObj->setNew(true);

		$copyObj->setPipId(NULL);
	}

	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new MlmDailyPipsCsvPeer();
		}
		return self::$peer;
	}

}


text:
import { CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { CoursesComponent } from './courses.component';

export class CanDeactivateCourses implements CanDeactivate<CoursesComponent> {
  public canDeactivate(
    component: CoursesComponent,
    route: ActivatedRouteSnapshot,
    state: RouterStateSnapshot
  ): Observable<boolean>|Promise<boolean>|boolean {
    console.log('CanDeactivateCourses#canDeactivate', arguments);
    return true;
  }

}

redpajama_set_name: RedPajamaGithub


text:
Expressive allows you to write [PSR-15](http://www.php-fig.org/psr/psr-15/)
middleware applications for the web.

PSR-15 consumes [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP Message
Interfaces; these are the incoming request and outgoing response for your
application. By using both PSR-15 and PSR-7, we ensure that your applications
will work in other contexts that are compatible with these standards.

Middleware is any code sitting between a request and a response; it typically
analyzes the request to aggregate incoming data, delegates it to another layer
to process, and then creates and returns a response. Middleware can and should
be relegated only to those tasks, and should be relatively easy to write and
maintain.

PSR-15 also defines _request handlers_; these are classes that receive a
request and return a response, without delegating to other layers of the
application. These are generally the inner-most layers of your application.

Middleware is also designed for composability; you should be able to nest
middleware and re-use middleware.

With Expressive, you can build middleware applications such as the following:

- APIs
- Websites
- Single Page Applications
- and more.

## Features

Expressive builds on [zend-stratigility](https://docs.zendframework.com/zend-stratigility/)
to provide a robust convenience layer on which to build applications. The
features it provides include:

- **Routing**

  Stratigility provides limited, literal matching only via its
  `PathMiddlewareDecorator`. Expressive allows you to utilize dynamic routing
  capabilities from a variety of routers, providing much more fine-grained
  matching capabilities. The routing layer also allows restricting matched
  routes to specific HTTP methods, and will return "405 Not Allowed" responses
  with an "Allow" HTTP header containing allowed HTTP methods for invalid
  requests.

  Routing is abstracted in Expressive, allowing the developer to choose the
  routing library that best fits the project needs. By default, we provide
  wrappers for Aura.Router, FastRoute, and the zend-router.

- **PSR-11 Container**

  Expressive encourages the use of Dependency Injection, and defines its
  `Application` class to compose a [PSR-11](https://www.php-fig.org/psr/psr-11)
  `ContainerInterface` instance. The container is used to lazy-load middleware,
  whether it is piped (Stratigility interface) or routed (Expressive).

- **Templating**

  While Expressive does not assume templating is being used, it provides a
  templating abstraction. Developers can write middleware that typehints on
  this abstraction, and assume that the underlying adapter will provide
  layout support and namespaced template support.

- **Error Handling**

  Applications should handle errors gracefully, but also handle them differently
  in development versus production. Expressive provides both basic error
  handling via Stratigility's own `ErrorHandler` implementation, providing
  specialized error response generators that can perform templating or use
  Whoops.

## Flow Overview

Below is a diagram detailing the workflow used by Expressive.

![Expressive Architectural Flow](../../images/architecture.png)

The `Application` acts as an "onion"; in the diagram above, the top is the
outer-most layer of the onion, while the bottom is the inner-most.

The `Application` dispatches each middleware. Each middleware receives a request
and a delegate for handing off processing of the request should the middleware
not be able to fully process it itself. Internally, the delegate composes a
queue of middleware, and invokes the next in the queue when invoked.

Any given middleware can return a *response*, at which point execution winds
its way back out the onion.

> ### Pipelines
>
> The terminology "pipeline" is often used to describe the onion. One way of
> looking at the "onion" is as a *queue*, which is first-in-first-out (FIFO) in
> operation. This means that the first middleware on the queue is executed first,
> and this invokes the next, and so on (and hence the "next" terminology). When
> looked at from this perspective:
>
> - In most cases, the entire queue *will not* be traversed.
> - The inner-most layer of the onion represents the last item in the queue, and
>   should be guaranteed to return a response; usually this is indicative of
>   a malformed request (HTTP 400 response status) and/or inability to route
>   the middleware to a handler (HTTP 404 response status).
> - Responses are returned back *through* the pipeline, in reverse order of
>   traversal.

> ### Double pass middleware
>
> The system described above is what is known as _lambda middleware_. Each
> middleware receives the request and a handler, and you pass only the
> request to the handler when wanting to hand off processing:
>
> ```php
> function (ServerRequestInterface $request, RequestHandlerInterface $handler)
> {
>     $response = $handler->handle($request);
>     return $response->withHeader('X-Test', time());
> }
> ```
>
> In Expressive 1.X, the default middleware style was what is known as _double
> pass_ middleware. Double pass middleware receives both the request and a
> response in addition to the handler, and passes both the request and response
> to the handler when invoking it:
>
> ```php
> function (ServerRequestInterface $request, ResponseInterface $response, callable $next)
> {
>     $response = $next($request, $response);
>     return $response->withHeader('X-Test', time());
> }
> ```
>
> It is termed "double pass" because you pass both the request and response when
> delegating to the next layer.
>
> Expressive 3 no longer supports double-pass middleware directly. However, if
> you decorate it using `Zend\Stratigility\doublePassMiddleware()`, we can
> consume it. That function requires first the double-pass middleware, and then
> a response prototype (which will be passed as the `$response` argument to the
> middleware):
>
> ```php
> use function Zend\Stratigility\doublePassMiddleware;
>
> $app->pipe(doublePassMiddleware(function ($request, $response, $next) {
>     // ...
> }, new Response()));
> ```
>
> If you use double-pass middleware, _do not_ use the `$response` instance
> passed to it unless you are returning it specifically (e.g., because you are not
> delegating to another layer).

The `Application` allows arbitrary middleware to be injected, with each being
executed in the order in which they are attached; returning a response from
middleware prevents any middleware attached later from executing.

The middleware pipeline is executed in the order of attachment.

Expressive provides default implementations of "routing" and "dispatch"
middleware, which you will attach to the middleware pipeline.  These are
implemented as the classes `Zend\Expressive\Router\Middleware\RouteMiddleware`
and `Zend\Expressive\Router\Middleware\DispatchMiddleware`, respectively.

Routing within Expressive consists of decomposing the request to match it to
middleware that can handle that given request. This typically consists of a
combination of matching the requested URI path along with allowed HTTP methods:

- map a GET request to the path `/api/ping` to the `PingMiddleware`
- map a POST request to the path `/contact/process` to the `HandleContactMiddleware`
- etc.

Dispatching is simply the act of calling the middleware mapped by routing. The
two events are modeled as separate middleware to allow you to act on the results
of routing before attempting to dispatch the mapped middleware; this can be
useful for implementing route-based authentication or validation, or, as we
provide by default, handling `HEAD` and `OPTIONS` requests, or providing `405
Method Not Allowed` responses.

The majority of your application will consist of routing rules that map to
routed middleware and request handlers.

Middleware piped to the application earlier than routing should be middleware
that you wish to execute for every request. These might include:

- bootstrapping
- parsing of request body parameters
- addition of debugging tools
- embedded middleware pipelines/application that you want to match at a given
  literal path
- etc.

Such middleware may decide that a request is invalid, and return a response;
doing so means no further middleware will be executed! This is an important
feature of middleware architectures, as it allows you to define
application-specific workflows optimized for performance, security, etc.

Middleware piped to the application after the routing and dispatch middleware
will execute in one of two conditions:

- routing failed
- routed middleware called on the next middleware instead of returning a response.

As such, the largest use case for such middleware is to provide a "default"
error response for your application, usually as an HTTP 404 Not Found response.

The main points to remember are:

- The application is a queue, and operates in FIFO order.
- Each middleware can choose whether to return a response, which will cause
  the queue to unwind, or to traverse to the next middleware.
- Most of the time, you will be defining *routed middleware*, and the routing
  rules that map to them.
- *You* get to control the workflow of your application by deciding the order in
  which middleware is queued.


text:
"use strict";

const singleton = require("singleton");
const ServiceMonitor = require("./lib/service_monitor");
const EventMonitor = require("./lib/event_monitor");

class Mgmt {
    constructor() {
        this.subscriptions = [];
        this.serviceMonitor = new ServiceMonitor();
        this.eventMonitor = new EventMonitor();
    }

    async start() {
        await this.serviceMonitor.start();
        await this.eventMonitor.start();
    }

    getServiceMonitorBusListener() {
        return this.serviceMonitor.mgmtBusListener.bind(this.serviceMonitor);
    }

    getEventMonitorBusListener() {
        return this.eventMonitor.busListener.bind(this.eventMonitor);
    }

    async dispose() {
        await this.serviceMonitor.dispose();
        await this.eventMonitor.dispose();
    }
}

module.exports = singleton(Mgmt);


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Security;
using Gablarski.Audio;
using Gablarski.OpenAL;

namespace Gablarski.OpenAL
{
	[SuppressUnmanagedCodeSecurity]
	public static class OpenAL
	{
		static OpenAL ()
		{
			#if DEBUG
			OpenAL.ErrorChecking = true;
			#endif

			Log = log4net.LogManager.GetLogger ("OpenAL");
			DebugLogging = Log.IsDebugEnabled;

			IsCaptureSupported = GetIsExtensionPresent ("ALC_EXT_CAPTURE");
		}

		/// <summary>
		/// Sets the distance model for OpenAL.
		/// </summary>
		public static DistanceModel DistanceModel
		{
			set
			{
				alDistanceModel (value);
				OpenAL.ErrorCheck ();
			}
		}

		/// <summary>
		/// Sets the speed of sound for OpenAL.
		/// </summary>
		public static float SpeedOfSound
		{
			set
			{
				alSpeedOfSound (value);
				OpenAL.ErrorCheck ();
			}
		}

		/// <summary>
		/// Sets the doppler factor for OpenAL.
		/// </summary>
		public static float DopplerFactor
		{
			set
			{
				alDopplerFactor (value);
				OpenAL.ErrorCheck ();
			}
		}

		/// <summary>
		/// Gets whether capture support is available.
		/// </summary>
		public static bool IsCaptureSupported
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets or sets whether error checking is enabled.
		/// </summary>
		public static bool ErrorChecking
		{
			get;
			private set;
		}

		/// <summary>
		/// Gets the underlying OpenAL provider version.
		/// </summary>
		public static string Version
		{
			get { return Marshal.PtrToStringAnsi (alGetString (AL_VERSION)); }
		}

		public static PlaybackDevice GetDefaultPlaybackDevice()
		{
			PlaybackDevice defaultDevice;
			GetPlaybackDevices (out defaultDevice);
			return defaultDevice;
		}

		public static IEnumerable<PlaybackDevice> GetPlaybackDevices()
		{
			PlaybackDevice defaultDevice;
			return GetPlaybackDevices (out defaultDevice);
		}

		public static IEnumerable<PlaybackDevice> GetPlaybackDevices (out PlaybackDevice defaultDevice)
		{
			defaultDevice = null;

			OpenAL.Debug ("Getting playback devices");

			string defaultName = null;
			string[] strings = new string[0];
			if (GetIsExtensionPresent ("ALC_ENUMERATE_ALL_EXT"))
			{
				defaultName = Marshal.PtrToStringAnsi (alcGetString (IntPtr.Zero, ALC_DEFAULT_ALL_DEVICES_SPECIFIER));
				strings = ReadStringsFromMemory (alcGetString (IntPtr.Zero, ALC_ALL_DEVICES_SPECIFIER));
			}
			else if (GetIsExtensionPresent ("ALC_ENUMERATION_EXT"))
			{
				defaultName = Marshal.PtrToStringAnsi (alcGetString (IntPtr.Zero, ALC_DEFAULT_DEVICE_SPECIFIER));
				strings = ReadStringsFromMemory (alcGetString (IntPtr.Zero, ALC_DEVICE_SPECIFIER));
			}

			PlaybackDevice[] devices = new PlaybackDevice[strings.Length];
			for (int i = 0; i < strings.Length; ++i)
			{
				string s = strings[i];
				devices[i] = new PlaybackDevice (s);

				if (s == defaultName)
					defaultDevice = devices[i];

				OpenAL.DebugFormat ("Found playback device {0}{1}", s, (s == defaultName) ? " (Default)" : String.Empty);
			}

			return devices;
		}

		public static CaptureDevice GetDefaultCaptureDevice()
		{
			//if (!IsCaptureSupported)
			//	throw new NotSupportedException();

			CaptureDevice defaultDevice;
			GetCaptureDevices (out defaultDevice);
			return defaultDevice;
		}

		public static IEnumerable<CaptureDevice> GetCaptureDevices()
		{
			CaptureDevice def;
			return GetCaptureDevices (out def);
		}

		public static IEnumerable<CaptureDevice> GetCaptureDevices (out CaptureDevice defaultDevice)
		{
			//if (!IsCaptureSupported)
			//	throw new NotSupportedException();

			OpenAL.Debug ("Getting capture devices");

			defaultDevice = null;

			string defaultName = Marshal.PtrToStringAnsi (alcGetString (IntPtr.Zero, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER));

			var strings = ReadStringsFromMemory (alcGetString (IntPtr.Zero, ALC_CAPTURE_DEVICE_SPECIFIER));
			CaptureDevice[] devices = new CaptureDevice[strings.Length];
			for (int i = 0; i < strings.Length; ++i)
			{
				string s = strings[i];
				devices[i] = new CaptureDevice (s);

				if (s == defaultName)
					defaultDevice = devices[i];

				OpenAL.DebugFormat ("Found capture device {0}{1}", s, (s == defaultName) ? " (Default)" : String.Empty);
			}

			return devices;
		}

		#region OpenALAudioFormat Extensions
		public static OpenALAudioFormat ToOpenALFormat (this AudioFormat format)
		{
			OpenALAudioFormat oalFormat = OpenALAudioFormat.Unknown;
			if (format.Channels == 1)
			{
				if (format.BitsPerSample == 8)
					oalFormat = OpenALAudioFormat.Mono8Bit;
				else if (format.BitsPerSample == 16)
					oalFormat = OpenALAudioFormat.Mono16Bit;
			}
			else if (format.Channels == 2)
			{
				if (format.BitsPerSample == 8)
					oalFormat = OpenALAudioFormat.Stereo8Bit;
				else if (format.BitsPerSample == 16)
					oalFormat = OpenALAudioFormat.Stereo16Bit;
			}

			return oalFormat;
		}

		public static uint GetBytesPerSample (this OpenALAudioFormat self)
		{
			switch (self)
			{
				default:
				case OpenALAudioFormat.Mono8Bit:
					return 1;

				case OpenALAudioFormat.Mono16Bit:
				case OpenALAudioFormat.Stereo8Bit:
					return 2;

				case OpenALAudioFormat.Stereo16Bit:
					return 4;
			}
		}

		public static uint GetBytes (this OpenALAudioFormat self, uint samples)
		{
			return self.GetBytesPerSample () * samples;
		}

		public static uint GetSamplesPerSecond (this OpenALAudioFormat self, uint frequency)
		{
			switch (self)
			{
				default:
				case OpenALAudioFormat.Mono8Bit:
				case OpenALAudioFormat.Mono16Bit:
					return frequency;

				case OpenALAudioFormat.Stereo8Bit:
				case OpenALAudioFormat.Stereo16Bit:
					return (frequency * 2);
			}
		}
		#endregion

		internal static IntPtr NullDevice = IntPtr.Zero;

		#region Imports
		// ReSharper disable InconsistentNaming
		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern void alDopplerFactor (float value);

		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern void alSpeedOfSound (float value);

		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern void alcGetIntegerv (IntPtr device, ALCEnum param, int size, out int data);

		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr alGetString (int name);

		[DllImport ("OpenAL32.dll", CallingConvention=CallingConvention.Cdecl)]
		internal static extern IntPtr alcGetString ([In] IntPtr device, int name);

		[DllImport ("OpenAL32.dll", CallingConvention=CallingConvention.Cdecl)]
		internal static extern int alGetError ();

		[DllImport ("OpenAL32.dll", CallingConvention=CallingConvention.Cdecl)]
		internal static extern int alcGetError ([In] IntPtr device);

		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern sbyte alcIsExtensionPresent ([In] IntPtr device, string extensionName);

		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern sbyte alIsExtensionPresent (string extensionName);

		[DllImport ("OpenAL32.dll", CallingConvention = CallingConvention.Cdecl)]
		internal static extern void alDistanceModel (DistanceModel model);
		// ReSharper restore InconsistentNaming
		#endregion

		internal static bool DebugLogging
		{
			get;
			private set;
		}

		internal static log4net.ILog Log
		{
			get; private set;
		}

		internal static void Debug (string message)
		{
			if (DebugLogging)
				Log.Debug (message);
		}

		internal static void DebugFormat (string format, params object[] args)
		{
			if (DebugLogging)
				Log.DebugFormat (format, args);
		}

		internal static bool GetIsExtensionPresent (string extension)
		{
			sbyte result;
			if (extension.StartsWith ("ALC"))
			{
				result = alcIsExtensionPresent (IntPtr.Zero, extension);
			}
			else
			{
				result = alIsExtensionPresent (extension);
				OpenAL.ErrorCheck ();
			}

			return (result == 1);
		}

		internal static bool GetIsExtensionPresent (Device device, string extension)
		{
			sbyte result;
			if (extension.StartsWith ("ALC"))
			{
				result = alcIsExtensionPresent (device.Handle, extension);
				OpenAL.ErrorCheck (device);
			}
			else
			{
				result = alIsExtensionPresent (extension);
				OpenAL.ErrorCheck ();
			}

			return (result == 1);
		}

		internal static string[] ReadStringsFromMemory (IntPtr location)
		{
			List<string> strings = new List<string> ();

			bool lastNull = false;
			int i = -1;
			byte c;
			while (!((c = Marshal.ReadByte (location, ++i)) == '\0' && lastNull))
			{
				if (c == '\0')
				{
					lastNull = true;

					strings.Add (Marshal.PtrToStringAnsi (location, i));
					location = new IntPtr ((long)location + i + 1);
					i = -1;
				}
				else
					lastNull = false;
			}

			return strings.ToArray();
		}

		[DebuggerStepThrough]
		internal static void ErrorCheck ()
		{
			if (!ErrorChecking)
				return;

			int err = alGetError ();
			switch ((ALError)err)
			{
				case ALError.AL_NO_ERROR:
					return;

				case ALError.AL_OUT_OF_MEMORY:
					throw new OutOfMemoryException ("OpenAL (AL) out of memory.");

				case ALError.AL_INVALID_ENUM:
					throw new ArgumentException ("Invalid enum");

				case ALError.AL_INVALID_NAME:
					throw new ArgumentException ("Invalid name");

				case ALError.AL_INVALID_VALUE:
					throw new ArgumentException ("Invalid value");

				case ALError.AL_INVALID_OPERATION:
					throw new InvalidOperationException ();
			}
		}

		[DebuggerStepThrough]
		internal static void ErrorCheck (Device device)
		{
			int error = alcGetError (device.Handle);
			switch ((ALCError)error)
			{
				case ALCError.ALC_NO_ERROR:
					return;

				case ALCError.ALC_INVALID_ENUM:
					throw new ArgumentException ("Invalid enum");

				case ALCError.ALC_INVALID_VALUE:
					throw new ArgumentException ("Invalid value");

				case ALCError.ALC_INVALID_CONTEXT:
					throw new ArgumentException ("Invalid context");

				case ALCError.ALC_INVALID_DEVICE:
					throw new ArgumentException ("Invalid device");

				case ALCError.ALC_OUT_OF_MEMORY:
					throw new OutOfMemoryException ("OpenAL (ALC) out of memory.");
			}
		}

		// ReSharper disable InconsistentNaming
		internal const int AL_VERSION = 0xB002;
		internal const int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004;
		internal const int ALC_DEVICE_SPECIFIER = 0x1005;
		internal const int ALC_CAPTURE_DEVICE_SPECIFIER = 0x310;
		internal const int ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311;
		internal const int ALC_ALL_DEVICES_SPECIFIER = 0x1013;
		internal const int ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012;
		// ReSharper restore InconsistentNaming
	}

	// ReSharper disable InconsistentNaming
	internal enum ALError
	{
		AL_NO_ERROR = 0,
		AL_INVALID_NAME = 0xA001,
		AL_INVALID_ENUM = 0xA002,
		AL_INVALID_VALUE = 0xA003,
		AL_INVALID_OPERATION = 0xA004,
		AL_OUT_OF_MEMORY = 0xA005,
	}

	internal enum ALCError
	{
		ALC_NO_ERROR		= 0,
		ALC_INVALID_DEVICE	= 0xA001,
		ALC_INVALID_CONTEXT	= 0xA002,
		ALC_INVALID_ENUM	= 0xA003,
		ALC_INVALID_VALUE	= 0xA004,
		ALC_OUT_OF_MEMORY	= 0xA005
	}

	internal enum ALEnum
	{
		AL_GAIN				= 0x100A,
		AL_FREQUENCY		= 0x2001,
		AL_BITS				= 0x2002,
		AL_CHANNELS			= 0x2003,
		AL_SIZE				= 0x2004,
	}

	internal enum ALCEnum
	{
		ALC_MAJOR_VERSION	= 0x1000,
		ALC_MINOR_VERSION	= 0x1001,
		ALC_ATTRIBUTES_SIZE	= 0x1002,
		ALC_ALL_ATTRIBUTES	= 0x1003,
		ALC_CAPTURE_SAMPLES	= 0x312,
		ALC_CONNECTED		= 0x313,
		ALC_FREQUENCY		= 0x1007,
		ALC_REFRESH			= 0x1008,
		ALC_SYNC			= 0x1009,
		ALC_MONO_SOURCES	= 0x1010,
		ALC_STEREO_SOURCES	= 0x1011,
	}

	public enum DistanceModel
	{
		None = 0
	}

	public enum OpenALAudioFormat
	{
		Unknown = 0,
		Mono8Bit = 0x1100,
		Mono16Bit = 0x1101,
		Stereo8Bit = 0x1102,
		Stereo16Bit = 0x1103
	}
	// ReSharper restore InconsistentNaming
}


text:
package eu.javaspecialists.tjsn.examples.issue190;

import eu.javaspecialists.tjsn.concurrency.*;

import java.util.concurrent.locks.*;

public class AutoLockInterruptiblyTest {
    private static final ReentrantLock lock = new ReentrantLock();

    public static void main(String[] args) throws InterruptedException {
        testLock();
        Thread.currentThread().interrupt();
        try {
            testLock();
        } catch (InterruptedException ex) {
            System.out.println(ex);
        }
    }

    public static void testLock() throws InterruptedException {
        try (AutoLock al = AutoLock.lockInterruptibly(lock)) {
            printLockStatus();
        }
        printLockStatus();
    }

    private static void printLockStatus() {
        System.out.println("We are locked: " + lock.isHeldByCurrentThread());
    }
}


text:
using System;
using System.Runtime.InteropServices;

namespace Microsoft.Internal.VisualStudio.Shell.Interop
{
    [ComImport, Guid("78A67F33-22CF-426C-8C90-B6E18FD35E0F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), TypeIdentifier]
    public interface SVsFeatureFlags
    {
    }
}


text:
package org.sagebionetworks.web.client.events;

import com.google.web.bindery.event.shared.binder.GenericEvent;
import org.sagebionetworks.web.client.place.Synapse;

public class ChangeSynapsePlaceEvent extends GenericEvent {

  private final Synapse place;

  public ChangeSynapsePlaceEvent(Synapse place) {
    this.place = place;
  }

  public Synapse getPlace() {
    return place;
  }
}


text:
sudo add-apt-repository ppa:numix/ppa
sudo apt update


text:
<?php

namespace WebModule\Pragmatik\Crud\Util\RawScan2GsmAdaptor;

/**
 * RawScan2Gsm2Adaptor
 * @author Lingtalfi
 * 2015-02-12
 *
 */
class RawScan2Gsm2Adaptor extends BaseRawScan2GsmAdaptor
{

    //------------------------------------------------------------------------------/
    // IMPLEMENTS RawScan2GsmAdaptorInterface
    //------------------------------------------------------------------------------/
    public function getGsm(array $rawScan)
    {
        $ret = [];
        foreach ($rawScan as $entry) {
            $ret[$entry['column']] = $this->getGsmNode($entry, $rawScan);
        }
        return $ret;
    }

    //------------------------------------------------------------------------------/
    //
    //------------------------------------------------------------------------------/
    protected function getGsmNode(array $rawScanEntry, array $rawScan)
    {
        $ret = $this->getTypeAndParamsByRawScanEntry($rawScanEntry, $rawScan);
        return $ret;
    }

}


text:
package jmespath

import "fmt"

const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF"

var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214}

func (i tokType) String() string {
	if i < 0 || i >= tokType(len(_tokType_index)-1) {
		return fmt.Sprintf("tokType(%d)", i)
	}
	return _tokType_name[_tokType_index[i]:_tokType_index[i+1]]
}
//Added a line for testing
//Adding another line for Git event testing part 2
//Adding another line for Git event testing part 2.1
//Adding another line for Git event testing part 2.2


text:
class PowerPointReader(Reader):
	__init__(self):
		pass

	def readToString(self, path):
		return 'ppt string'


text:
<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android">
	<solid android:color="#ffe83838"/>
	<stroke android:color="#ff484040" android:width="2dp"/>
	<corners android:radius="2dp"/>
</shape>


text:
#ifndef CSSCursorImageValue_h
#define CSSCursorImageValue_h

#include "CSSImageValue.h"
#include "IntPoint.h"
#include <wtf/HashSet.h>

namespace WebCore {

class Document;
class Element;
class SVGElement;

class CSSCursorImageValue : public CSSValue {
public:
    static PassRefPtr<CSSCursorImageValue> create(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot)
    {
        return adoptRef(new CSSCursorImageValue(imageValue, hasHotSpot, hotSpot));
    }

    ~CSSCursorImageValue();

    bool hasHotSpot() const { return m_hasHotSpot; }

    IntPoint hotSpot() const
    {
        if (m_hasHotSpot)
            return m_hotSpot;
        return IntPoint(-1, -1);
    }

    String customCSSText() const;

    bool updateIfSVGCursorIsUsed(Element*);
    StyleImage* cachedImage(CachedResourceLoader*);
    StyleImage* cachedOrPendingImage(Document*);

#if ENABLE(SVG)
    void removeReferencedElement(SVGElement*);
#endif

    bool equals(const CSSCursorImageValue&) const;

private:
    CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);

#if ENABLE(SVG)
    bool isSVGCursor() const;
    String cachedImageURL();
    void clearCachedImage();
#endif

    RefPtr<CSSValue> m_imageValue;

    bool m_hasHotSpot;
    IntPoint m_hotSpot;
    RefPtr<StyleImage> m_image;
    bool m_accessedImage;

#if ENABLE(SVG)
    HashSet<SVGElement*> m_referencedElements;
#endif
};

} // namespace WebCore

#endif // CSSCursorImageValue_h


text:
@implementation RFViewController

@synthesize debugTag;

-(void)onCreate:(NSDictionary*)creationDictionary {

}

-(void)onResume:(RFIntent*)intent
{
  self.debugTag = YES;
}

-(void)onPause:(RFIntent*)intent
{
  self.debugTag = YES;
}

@end


text:
using System.Data.SqlClient;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace TsqltNet.Tests
{
    [TestClass]
    public class MessageWritingSqlTestExecutorTests
    {
        [TestMethod]
        [Ignore]
        public void Runs_inner_executor_method()
        {
            // Arrange
            const string testName = "foo.bar";
            var sqlConnection = new SqlConnection();
            var innerExecutor = new Mock<ISqlTestExecutor>(MockBehavior.Strict);
            var testOutputMessageWriter = new Mock<ITestOutputMessageWriter>(MockBehavior.Strict);
            var installedTest = new Mock<IInstalledTest>(MockBehavior.Strict);
            installedTest.Setup(t => t.FullTestName).Returns(testName);
            var sut = new MessageWritingSqlTestExecutor(testOutputMessageWriter.Object, innerExecutor.Object);

            // Act
            sut.RunTest(sqlConnection, installedTest.Object);

            // Assert
            Assert.Fail(); // TODO
        }
    }
}


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Quick.CoreMVC.Api
{
    /// <summary>
    /// WEB API的返回结果
    /// </summary>
    public class ApiResult
    {
        [JsonProperty("code")]
        public Int32 Code { get; set; }
        [JsonProperty("message", NullValueHandling = NullValueHandling.Ignore)]
        public String Message { get; set; }
        //元数据
        [JsonProperty("meta", NullValueHandling = NullValueHandling.Ignore)]
        public IDictionary<string, string> Meta { get; set; }

        [JsonProperty("data", NullValueHandling = NullValueHandling.Ignore)]
        public Object Data { get; set; }

        public ApiResult(Int32 code, String message, Object data)
        {
            this.Code = code;
            this.Message = message;
            this.Data = data;
        }

        /// <summary>
        /// 设置元信息
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public void SetMetaInfo(string key, string value)
        {
            if (Meta == null)
                Meta = new Dictionary<string, string>();
            Meta[key] = value;
        }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }

        /// <summary>
        /// 返回成功结果
        /// </summary>
        /// <returns></returns>
        public static ApiResult Success()
        {
            return Success(null, null);
        }

        public static ApiResult Success(Object data)
        {
            return Success(null, data);
        }

        public static ApiResult Success(String message)
        {
            return Success(message, null);
        }

        /// <summary>
        /// 返回成功结果
        /// </summary>
        /// <param name="message">消息</param>
        /// <returns></returns>
        public static ApiResult Success(String message, Object data)
        {
            return new ApiResult(0, message, data);
        }

        /// <summary>
        /// 返回失败结果
        /// </summary>
        /// <returns></returns>
        public static ApiResult Error()
        {
            return Error(null);
        }

        /// <summary>
        /// 返回失败结果
        /// </summary>
        /// <param name="message">消息</param>
        /// <returns></returns>
        public static ApiResult Error(String message)
        {
            return Error(-1, message, null);
        }

        /// <summary>
        /// 返回失败的结果
        /// </summary>
        /// <param name="message"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public static ApiResult Error(String message, Object data)
        {
            return Error(-1, message, data);
        }

        /// <summary>
        /// 返回失败的结果
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static ApiResult Error(Object data)
        {
            return Error(-1, null, data);
        }

        /// <summary>
        /// 返回失败的结果
        /// </summary>
        /// <param name="code"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public static ApiResult Error(Int32 code, String message)
        {
            return Error(code, message, null);
        }

        /// <summary>
        /// 返回失败结果
        /// </summary>
        /// <param name="code">错误码</param>
        /// <param name="message">消息</param>
        /// <returns></returns>
        public static ApiResult Error(Int32 code, String message, Object data)
        {
            if (code == 0)
                code = -1;
            return new ApiResult(code, message, data);
        }
    }
}


text:
package.path = package.path .. ";FRC_Dissectors/?.lua"
require("FRC_RoboRIO")
require("FRC_DS")
require("FRC_NetConsole")
require("FRC_SideChannel")
require("FRC_NetworkTable")
require("FRC_DS_FMS")
require("FRC_FMS_DS")


text:
<meta name="generator"
content="HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net" />

<title></title>

TAJS jQuerry Test


text:
package org.onosproject.net.intent.impl.installer;

import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onosproject.net.flow.FlowRule;
import org.onosproject.net.flow.FlowRuleOperations;
import org.onosproject.net.flow.FlowRuleOperationsContext;
import org.onosproject.net.flow.FlowRuleService;
import org.onosproject.net.intent.FlowRuleIntent;
import org.onosproject.net.intent.IntentInstallCoordinator;
import org.onosproject.net.intent.IntentData;
import org.onosproject.net.intent.IntentExtensionService;
import org.onosproject.net.intent.IntentOperationContext;
import org.onosproject.net.intent.IntentInstaller;
import org.onosproject.net.intent.impl.IntentManager;
import org.onosproject.net.intent.ObjectiveTrackerService;
import org.slf4j.Logger;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

import static org.onosproject.net.intent.IntentInstaller.Direction.ADD;
import static org.onosproject.net.intent.IntentInstaller.Direction.REMOVE;
import static org.slf4j.LoggerFactory.getLogger;

/**
 * Installer for FlowRuleIntent.
 */
@Component(immediate = true)
public class FlowRuleIntentInstaller implements IntentInstaller<FlowRuleIntent> {
    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected IntentExtensionService intentExtensionService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected ObjectiveTrackerService trackerService;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected IntentInstallCoordinator intentInstallCoordinator;

    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
    protected FlowRuleService flowRuleService;

    @Activate
    public void activate() {
        intentExtensionService.registerInstaller(FlowRuleIntent.class, this);
    }

    @Deactivate
    public void deactivated() {
        intentExtensionService.unregisterInstaller(FlowRuleIntent.class);
    }

    protected final Logger log = getLogger(IntentManager.class);

    @Override
    public void apply(IntentOperationContext<FlowRuleIntent> context) {
        Optional<IntentData> toUninstall = context.toUninstall();
        Optional<IntentData> toInstall = context.toInstall();

        if (!toInstall.isPresent() && !toUninstall.isPresent()) {
            // Nothing to do.
            intentInstallCoordinator.intentInstallSuccess(context);
            return;
        }

        List<FlowRuleIntent> uninstallIntents = context.intentsToUninstall();
        List<FlowRuleIntent> installIntents = context.intentsToInstall();

        List<FlowRule> flowRulesToUninstall;
        List<FlowRule> flowRulesToInstall;

        if (toUninstall.isPresent()) {
            // Remove tracked resource from both Intent and installable Intents.
            trackIntentResources(toUninstall.get(), uninstallIntents, REMOVE);

            // Retrieves all flow rules from all flow rule Intents.
            flowRulesToUninstall = uninstallIntents.stream()
                    .map(FlowRuleIntent::flowRules)
                    .flatMap(Collection::stream)
                    .collect(Collectors.toList());
        } else {
            // No flow rules to be uninstalled.
            flowRulesToUninstall = Collections.emptyList();
        }

        if (toInstall.isPresent()) {
            // Track resource from both Intent and installable Intents.
            trackIntentResources(toInstall.get(), installIntents, ADD);

            // Retrieves all flow rules from all flow rule Intents.
            flowRulesToInstall = installIntents.stream()
                    .map(FlowRuleIntent::flowRules)
                    .flatMap(Collection::stream)
                    .collect(Collectors.toList());
        } else {
            // No flow rules to be installed.
            flowRulesToInstall = Collections.emptyList();
        }

        List<FlowRule> dontUninstall;
        List<FlowRule> dontTouch;

        // If both uninstall/install list contained equal (=match conditions are equal) FlowRules,
        // omit it from remove list, since it will/should be overwritten by install
        dontUninstall = flowRulesToUninstall.stream()
                .filter(flowRule -> flowRulesToInstall.stream().anyMatch(flowRule::equals))
                .collect(Collectors.toList());

        // If both contained exactMatch-ing FlowRules, remove from both list,
        // since it will result in no-op.
        dontTouch = flowRulesToInstall.stream()
                .filter(flowRule -> flowRulesToUninstall.stream().anyMatch(flowRule::exactMatch))
                .collect(Collectors.toList());

        flowRulesToUninstall.removeAll(dontUninstall);
        flowRulesToUninstall.removeAll(dontTouch);
        flowRulesToInstall.removeAll(dontTouch);

        if (flowRulesToInstall.isEmpty() && flowRulesToUninstall.isEmpty()) {
            // There is no flow rules to install/uninstall
            intentInstallCoordinator.intentInstallSuccess(context);
            return;
        }

        FlowRuleOperations.Builder builder = FlowRuleOperations.builder();
        // Add flows
        flowRulesToInstall.forEach(builder::add);
        // Remove flows
        flowRulesToUninstall.forEach(builder::remove);

        FlowRuleOperationsContext flowRuleOperationsContext = new FlowRuleOperationsContext() {
            @Override
            public void onSuccess(FlowRuleOperations ops) {
                intentInstallCoordinator.intentInstallSuccess(context);
            }

            @Override
            public void onError(FlowRuleOperations ops) {
                intentInstallCoordinator.intentInstallFailed(context);
            }
        };

        FlowRuleOperations operations = builder.build(flowRuleOperationsContext);
        log.debug("applying intent {} -> {} with {} rules: {}",
                  toUninstall.map(x -> x.key().toString()).orElse("<empty>"),
                  toInstall.map(x -> x.key().toString()).orElse("<empty>"),
                  operations.stages().stream().mapToLong(Set::size).sum(),
                  operations.stages());
        flowRuleService.apply(operations);
    }

    /**
     * Track or un-track network resource of a Intent and it's installable
     * Intents.
     *
     * @param intentData the Intent data
     * @param intentsToApply the list of flow rule Intents from the Intent
     * @param direction the direction to determine track or un-track
     */
    private void trackIntentResources(IntentData intentData, List<FlowRuleIntent> intentsToApply, Direction direction) {
        switch (direction) {
            case ADD:
                trackerService.addTrackedResources(intentData.key(), intentData.intent().resources());
                intentsToApply.forEach(installable ->
                                               trackerService.addTrackedResources(intentData.key(),
                                                                                installable.resources()));
                break;
            case REMOVE:
                trackerService.removeTrackedResources(intentData.key(), intentData.intent().resources());
                intentsToApply.forEach(installable ->
                                               trackerService.removeTrackedResources(intentData.intent().key(),
                                                                                installable.resources()));
                break;
            default:
                log.warn("Unknown resource tracking direction.");
                break;
        }
    }
}


text:
angular.module('webapp').factory('ConferencesService', ConferencesService)
ConferencesService.$inject = ['CurrentUser', 'SessionsService', 'SessionsConferencesService', 'Conference']

/**
 * @ngdoc service
 * @name webapp.service:ConferencesService
 * @description In charge of conferences management.
 */
function ConferencesService(CurrentUser, SessionsService, SessionsConferencesService, Conference) {
    var ConferencesService = {}

    /**
     * @ngdoc property
     * @name conferences
     * @propertyOf webapp.service:ConferencesService
     * @description Conferences list
     */
    ConferencesService.conferences = SessionsConferencesService.conferences

    /**
     * @ngdoc property
     * @name Model
     * @propertyOf webapp.service:ConferencesService
     * @description Conference model
     */
    ConferencesService.Model = Conference

    /**
     * @ngdoc method
     * @name addConference
     * @methodOf webapp.service:ConferencesService
     * @description Add a conference to firebase
     * @param {Conference} conference - The new conference
     * @param {Session} session - The session of the conference
     * @returns {Promise} ok if the conference was well added
     * @example
      ```javascript
      ConferencesService.addConference(conference, session)
      .then(function() {
        // success...
      })
      .catch(function(error) {
        // error...
      })
      ```
      */
    ConferencesService.addConference = function(conference, session) {
        return ConferencesService.conferences.$add({
            name: conference.name,
            start_time: conference.start_time.getTime(),
            end_time: conference.end_time.getTime(),
            speakers: conference.speakers,
            sessionId: conference.sessionId,
            abstract: conference.abstract
        }).then(function(ref) {
            return SessionsService.addConferenceTo(session, ref.key())
        })
    }

    /**
     * @ngdoc method
     * @name removeConference
     * @methodOf webapp.service:ConferencesService
     * @description Remove a conference from firebase
     * @param {Conference} conference - The conference to be removed
     * @param {Session} session - The session of the conference
     * @example
      ```javascript
      ConferencesService.removeConference(conference, session)
      ```
      */
    ConferencesService.removeConference = function(conference, session) {
        SessionsConferencesService.removeConference(conference, session)
    }

    /**
     * @ngdoc method
     * @name loadArray
     * @methodOf webapp.service:ConferencesService
     * @description Return a promise indicating if the conferences list is loaded
     * @returns {Promise} ok if the conferences list is loaded
     * @example
      ```javascript
      ConferencesService.loadArray()
      .then(function() {
        // success...
      })
      .catch(function(error) {
        // error...
      })
      ```
      */
    ConferencesService.loadArray = function() {
        return ConferencesService.conferences.$loaded()
    }

    /**
     * @ngdoc method
     * @name getConferenceById
     * @methodOf webapp.service:ConferencesService
     * @description Return a promise with the conference
     * @param {ID} id - The conference id
     * @returns {Promise} the conference found if it exists
     * @example
      ```javascript
      ConferencesService.getConferenceById(id)
      .then(function(conference) {
        // success...
      })
      .catch(function(error) {
        // error...
      })
      ```
      */
    ConferencesService.getConferenceById = function(id) {
        return SessionsConferencesService.getConferenceById(id)
    }

    /**
     * @ngdoc method
     * @name saveConference
     * @methodOf webapp.service:ConferencesService
     * @description Return a promise indicating if the conference was saved
     * @param {Conference} conference - The conference to be saved
     * @returns {Promise} ok if the conference was saved
     * @example
      ```javascript
      ConferencesService.saveConference(conference)
      .then(function() {
        // success...
      })
      .catch(function(error) {
        // error...
      })
      ```
      */
    ConferencesService.saveConference = function(conference) {
        return ConferencesService.conferences.$save(conference)
    }

    /**
     * @ngdoc method
     * @name getConferencesOfCurrentUser
     * @methodOf webapp.service:ConferencesService
     * @description Return the user's conferences
     * @returns {Array} the user's conferences
     * @example
      ```javascript
      ConferencesService.getConferencesOfCurrentUser()
      ```
      */
    ConferencesService.getConferencesOfCurrentUser = function() {
          if (CurrentUser.isLogged) {
              if (!CurrentUser.conferences()) {
                  return []
              } else {
                  var conferences = []
                  var cpt = CurrentUser.conferences().length
                  for (var i = 0; i < cpt; i++) {
                      conferences.push(ConferencesService.getConferenceById(CurrentUser.conferences()[i]))
                  }
                  return conferences
              }
          } else {
              []
          }
    }

    return ConferencesService
}


text:
package main

import (
	"bytes"
	"encoding/json"
	"github.com/bitly/go-nsq"
	"github.com/bitly/nsq/util"
	"log"
	"net"
	"os"
	"strconv"
	"time"
)

func (n *NSQd) lookupLoop() {
	syncTopicChan := make(chan *LookupPeer)

	hostname, err := os.Hostname()
	if err != nil {
		log.Fatalf("ERROR: failed to get hostname - %s", err.Error())
	}

	for _, host := range n.lookupdTCPAddrs {
		log.Printf("LOOKUP: adding peer %s", host)
		lookupPeer := NewLookupPeer(host, func(lp *LookupPeer) {
			ci := make(map[string]interface{})
			ci["version"] = util.BINARY_VERSION
			ci["tcp_port"] = n.tcpAddr.Port
			ci["http_port"] = n.httpAddr.Port
			ci["hostname"] = hostname
			ci["broadcast_address"] = n.options.broadcastAddress

			cmd, err := nsq.Identify(ci)
			if err != nil {
				lp.Close()
				return
			}
			resp, err := lp.Command(cmd)
			if err != nil {
				log.Printf("LOOKUPD(%s): ERROR %s - %s", lp, cmd, err.Error())
			} else if bytes.Equal(resp, []byte("E_INVALID")) {
				log.Printf("LOOKUPD(%s): lookupd returned %s", lp, resp)
			} else {
				err = json.Unmarshal(resp, &lp.Info)
				if err != nil {
					log.Printf("LOOKUPD(%s): ERROR parsing response - %v", lp, resp)
				} else {
					log.Printf("LOOKUPD(%s): peer info %+v", lp, lp.Info)
				}
			}

			go func() {
				syncTopicChan <- lp
			}()
		})
		lookupPeer.Command(nil) // start the connection
		n.lookupPeers = append(n.lookupPeers, lookupPeer)
	}

	// for announcements, lookupd determines the host automatically
	ticker := time.Tick(15 * time.Second)
	for {
		select {
		case <-ticker:
			// send a heartbeat and read a response (read detects closed conns)
			for _, lookupPeer := range n.lookupPeers {
				log.Printf("LOOKUPD(%s): sending heartbeat", lookupPeer)
				cmd := nsq.Ping()
				_, err := lookupPeer.Command(cmd)
				if err != nil {
					log.Printf("LOOKUPD(%s): ERROR %s - %s", lookupPeer, cmd, err.Error())
				}
			}
		case val := <-n.notifyChan:
			var cmd *nsq.Command
			var branch string

			switch val.(type) {
			case *Channel:
				// notify all nsqlookupds that a new channel exists, or that it's removed
				branch = "channel"
				channel := val.(*Channel)
				if channel.Exiting() == true {
					cmd = nsq.UnRegister(channel.topicName, channel.name)
				} else {
					cmd = nsq.Register(channel.topicName, channel.name)
				}
			case *Topic:
				// notify all nsqlookupds that a new topic exists, or that it's removed
				branch = "topic"
				topic := val.(*Topic)
				if topic.Exiting() == true {
					cmd = nsq.UnRegister(topic.name, "")
				} else {
					cmd = nsq.Register(topic.name, "")
				}
			}

			for _, lookupPeer := range n.lookupPeers {
				log.Printf("LOOKUPD(%s): %s %s", lookupPeer, branch, cmd)
				_, err := lookupPeer.Command(cmd)
				if err != nil {
					log.Printf("LOOKUPD(%s): ERROR %s - %s", lookupPeer, cmd, err.Error())
				}
			}
		case lookupPeer := <-syncTopicChan:
			commands := make([]*nsq.Command, 0)
			// build all the commands first so we exit the lock(s) as fast as possible
			n.RLock()
			for _, topic := range n.topicMap {
				topic.RLock()
				if len(topic.channelMap) == 0 {
					commands = append(commands, nsq.Register(topic.name, ""))
				} else {
					for _, channel := range topic.channelMap {
						commands = append(commands, nsq.Register(channel.topicName, channel.name))
					}
				}
				topic.RUnlock()
			}
			n.RUnlock()

			for _, cmd := range commands {
				log.Printf("LOOKUPD(%s): %s", lookupPeer, cmd)
				_, err := lookupPeer.Command(cmd)
				if err != nil {
					log.Printf("LOOKUPD(%s): ERROR %s - %s", lookupPeer, cmd, err.Error())
					break
				}
			}
		case <-n.exitChan:
			goto exit
		}
	}

exit:
	log.Printf("LOOKUP: closing")
}

func (n *NSQd) lookupHttpAddrs() []string {
	var lookupHttpAddrs []string
	for _, lp := range n.lookupPeers {
		if len(lp.Info.BroadcastAddress) <= 0 {
			continue
		}
		addr := net.JoinHostPort(lp.Info.BroadcastAddress, strconv.Itoa(lp.Info.HttpPort))
		lookupHttpAddrs = append(lookupHttpAddrs, addr)
	}
	return lookupHttpAddrs
}


text:
void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) {
  content::BrowserThread::GetBlockingPool()->PostTask(FROM_HERE,
      base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, client_info));
}

MetricsServicesManager::MetricsServicesManager(PrefService* local_state)
    : local_state_(local_state),
      may_upload_(false),
      may_record_(false) {
  DCHECK(local_state);
}

MetricsServicesManager::~MetricsServicesManager() {
}

metrics::MetricsService* MetricsServicesManager::GetMetricsService() {
  DCHECK(thread_checker_.CalledOnValidThread());
  return GetChromeMetricsServiceClient()->metrics_service();
}

rappor::RapporService* MetricsServicesManager::GetRapporService() {
  DCHECK(thread_checker_.CalledOnValidThread());
  if (!rappor_service_) {
    rappor_service_.reset(new rappor::RapporService(
        local_state_, base::Bind(&chrome::IsOffTheRecordSessionActive)));
    rappor_service_->Initialize(g_browser_process->system_request_context());
  }
  return rappor_service_.get();
}

variations::VariationsService* MetricsServicesManager::GetVariationsService() {
  DCHECK(thread_checker_.CalledOnValidThread());
  if (!variations_service_) {
    variations_service_ = variations::VariationsService::Create(
        make_scoped_ptr(new ChromeVariationsServiceClient()), local_state_,
        GetMetricsStateManager(), switches::kDisableBackgroundNetworking);
  }
  return variations_service_.get();
}

void MetricsServicesManager::OnPluginLoadingError(
    const base::FilePath& plugin_path) {
  GetChromeMetricsServiceClient()->LogPluginLoadingError(plugin_path);
}

ChromeMetricsServiceClient*
MetricsServicesManager::GetChromeMetricsServiceClient() {
  DCHECK(thread_checker_.CalledOnValidThread());
  if (!metrics_service_client_) {
    metrics_service_client_ = ChromeMetricsServiceClient::Create(
        GetMetricsStateManager(), local_state_);
  }
  return metrics_service_client_.get();
}

metrics::MetricsStateManager* MetricsServicesManager::GetMetricsStateManager() {
  DCHECK(thread_checker_.CalledOnValidThread());
  if (!metrics_state_manager_) {
    metrics_state_manager_ = metrics::MetricsStateManager::Create(
        local_state_,
        base::Bind(&ChromeMetricsServiceAccessor::IsMetricsReportingEnabled),
        base::Bind(&PostStoreMetricsClientInfo),
        base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo));
  }
  return metrics_state_manager_.get();
}

bool MetricsServicesManager::GetSafeBrowsingState() {
  // Start listening for updates to SB service state. This is done here instead
  // of in the constructor to avoid errors from trying to instantiate SB
  // service before the IO thread exists.
  SafeBrowsingService* sb_service = g_browser_process->safe_browsing_service();
  if (!sb_state_subscription_ && sb_service) {
    // base::Unretained(this) is safe here since this object owns the
    // sb_state_subscription_ which owns the pointer.
    sb_state_subscription_ = sb_service->RegisterStateCallback(
        base::Bind(&MetricsServicesManager::UpdateRunningServices,
                   base::Unretained(this)));
  }

  return sb_service && sb_service->enabled_by_prefs();
}

void MetricsServicesManager::UpdatePermissions(bool may_record,
                                               bool may_upload) {
  DCHECK(thread_checker_.CalledOnValidThread());
  // Stash the current permissions so that we can update the RapporService
  // correctly when the Rappor preference changes.  The metrics recording
  // preference partially determines the initial rappor setting, and also
  // controls whether FINE metrics are sent.
  may_record_ = may_record;
  may_upload_ = may_upload;
  UpdateRunningServices();
}

void MetricsServicesManager::UpdateRunningServices() {
  DCHECK(thread_checker_.CalledOnValidThread());
  metrics::MetricsService* metrics = GetMetricsService();

  const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();

  const bool only_do_metrics_recording =
      cmdline->HasSwitch(switches::kMetricsRecordingOnly) ||
      cmdline->HasSwitch(switches::kEnableBenchmarking);

  if (only_do_metrics_recording) {
    metrics->StartRecordingForTests();
    GetRapporService()->Update(
        rappor::UMA_RAPPOR_GROUP | rappor::SAFEBROWSING_RAPPOR_GROUP,
        false);
    return;
  }

  if (may_record_) {
    if (!metrics->recording_active())
      metrics->Start();

    if (may_upload_)
      metrics->EnableReporting();
    else
      metrics->DisableReporting();
  } else {
    metrics->Stop();
  }

  int recording_groups = 0;
#if defined(GOOGLE_CHROME_BUILD)
  if (may_record_)
    recording_groups |= rappor::UMA_RAPPOR_GROUP;
  if (GetSafeBrowsingState())
    recording_groups |= rappor::SAFEBROWSING_RAPPOR_GROUP;
#endif  // defined(GOOGLE_CHROME_BUILD)
  GetRapporService()->Update(recording_groups, may_upload_);
}

void MetricsServicesManager::UpdateUploadPermissions(bool may_upload) {
  return UpdatePermissions(
      ChromeMetricsServiceAccessor::IsMetricsReportingEnabled(), may_upload);
}


text:
// Copyright 2014 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.bazel.rules;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration.Fragment;
import com.google.devtools.build.lib.analysis.config.BuildOptions;
import com.google.devtools.build.lib.analysis.config.ConfigurationEnvironment;
import com.google.devtools.build.lib.analysis.config.ConfigurationFragmentFactory;
import com.google.devtools.build.lib.analysis.config.FragmentOptions;
import com.google.devtools.build.lib.analysis.config.InvalidConfigurationException;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.util.OS;
import com.google.devtools.build.lib.vfs.PathFragment;
import javax.annotation.Nullable;

/**
 * Bazel-specific configuration fragment.
 */
@Immutable
public class BazelConfiguration extends Fragment {
  /**
   * Loader for Bazel-specific settings.
   */
  public static class Loader implements ConfigurationFragmentFactory {
    @Override
    public Fragment create(ConfigurationEnvironment env, BuildOptions buildOptions)
        throws InvalidConfigurationException {
      return new BazelConfiguration();
    }

    @Override
    public Class<? extends Fragment> creates() {
      return BazelConfiguration.class;
    }

    @Override
    public ImmutableSet<Class<? extends FragmentOptions>> requiredOptions() {
      return ImmutableSet.of();
    }
  }

  public BazelConfiguration() {
  }

  @Override
  public PathFragment getShellExecutable() {
    if (OS.getCurrent() == OS.WINDOWS) {
      String path = System.getenv("BAZEL_SH");
      if (path != null) {
        return PathFragment.create(path);
      } else {
        return PathFragment.create("c:/tools/msys64/usr/bin/bash.exe");
      }
    }
    if (OS.getCurrent() == OS.FREEBSD) {
      String path = System.getenv("BAZEL_SH");
      if (path != null) {
        return  PathFragment.create(path);
      } else {
        return PathFragment.create("/usr/local/bin/bash");
      }
    }
    return PathFragment.create("/bin/bash");
  }

  @Override
  public void setupShellEnvironment(ImmutableMap.Builder<String, String> builder) {
    builder.put("PATH", pathOrDefault(System.getenv("PATH"), getShellExecutable()));

    String ldLibraryPath = System.getenv("LD_LIBRARY_PATH");
    if (ldLibraryPath != null) {
      builder.put("LD_LIBRARY_PATH", ldLibraryPath);
    }

    String tmpdir = System.getenv("TMPDIR");
    if (tmpdir != null) {
      builder.put("TMPDIR", tmpdir);
    }
  }

  private static String pathOrDefault(@Nullable String path, @Nullable PathFragment sh) {
    if (OS.getCurrent() != OS.WINDOWS) {
      return path == null ? "/bin:/usr/bin" : path;
    }

    // Attempt to compute the MSYS root (the real Windows path of "/") from `sh`.
    String newPath = "";
    if (sh != null && sh.getParentDirectory() != null) {
      newPath = sh.getParentDirectory().getPathString();
      if (sh.getParentDirectory().endsWith(PathFragment.create("usr/bin"))) {
        newPath +=
            ";" + sh.getParentDirectory().getParentDirectory().replaceName("bin").getPathString();
      } else if (sh.getParentDirectory().endsWith(PathFragment.create("bin"))) {
        newPath +=
            ";" + sh.getParentDirectory().replaceName("usr").getRelative("bin").getPathString();
      }
      newPath = newPath.replace('/', '\\');

      if (path != null) {
        newPath += ";" + path;
      }
    }
    return newPath;
  }
}


text:
<#

.SYNOPSIS
Set the color and pulse attributes of a CILAMP with a known system-ID.

.DESCRIPTION
The script accepts (and requires) three parameters:
-systemId (The ID that you give to your CILAMP during the configuration phase. This id is used so that your CILAMP knows what system it should listen to.)
-color (A six character long colorcode in hexadecimal notation. FF0000 is red, 00FF00 is corresponds to green and 0000FF is the blue.)
-duration (The number of milliseconds that a pulse should last. If you set this to zero, the light will be stable and not pulsing)

.EXAMPLE
./set_cilamp_color.ps1

If you start the script without parameters (like above), you will be prompted for them interactively.
.EXAMPLE
./set_cilamp_color.ps1 -systemId <put the system id here> -color 00ff00 -duration 0

If you want to supply the parameters from the command prompt, provide them like above.

.NOTES
BEWARE, HERE IS A SUBLIMINAL MESSAGE: "Go and buy yourself a CILAMP! Now!"
.LINK
http://www.cilamp.se

#>

Param
(
    [Parameter(Mandatory=$true)][string]$systemId,
    [Parameter(Mandatory=$true)][ValidateScript( { if ($_ -match "[0-9a-f]{6}") { "Matches" } else { Throw [System.Management.Automation.ValidationMetadataException] "The colorcode must consist of six hexadecimal characters, for example: FF0000" } } )] $color,
    [Parameter(Mandatory=$true)][uint16]$duration
)

#Send color and period to CILAMP
$requestURL = "https://api.cilamp.se/v1/" + $systemId
$postParams = @{color=$color;period=$duration}

Invoke-WebRequest -Uri $requestURL -Method POST -Body $postParams | Out-Null


text:
require 'spec_helper'

module TypekitCLI
  describe FamilyShow do

    let(:family) do
      OpenStruct.new({ 'id' => 'abcdef',
                       'name' => 'Awesome',
                       'slug' => 'awesome',
                       'css_names' => ['awesome'],
                       'css_stack' => '"awesome",sans-serif',
                       'subset' => 'default',
                       'variations' => ['n0'] })
    end

    subject { FamilyShow.new(family) }

    describe 'display' do

      # Newline at the top, and 7 more times for the attributes.
      it 'calls puts eight times' do
        expect(STDOUT).to receive(:puts).exactly(8).times
        subject.display
      end

    end

  end
end


text:
package models;

import org.hibernate.annotations.GenericGenerator;
import play.data.validation.Required;
import play.db.jpa.GenericModel;

import javax.persistence.*;

/**
 * Created by Administrator on 14-3-20.
 */
@Entity
@Table(name="Iorganization")
public class organization extends GenericModel {
    //UUID id编号
    @Id
    @GenericGenerator(name = "system-uuid", strategy = "uuid")
    @GeneratedValue(generator = "system-uuid")
    @Column(name="id")
    public String id;

    //机构简称
    @Required
    public String orgabbreviation;

    //机构名称
    @Required
    public String orgname;

    //电话
    @Required
    public String phone;

    //邮编
    @Required
    public String postcode;

    //网址
    @Required
    public String web;

    //地址
    @Required
    public String address;

    //传真号码
    @Required
    public String fax;
}


text:
"""MongoDB result store backend."""
from __future__ import absolute_import, unicode_literals

from datetime import datetime, timedelta

from kombu.exceptions import EncodeError
from kombu.utils.objects import cached_property
from kombu.utils.url import maybe_sanitize_url

from celery import states
from celery.exceptions import ImproperlyConfigured
from celery.five import items, string_t

from .base import BaseBackend

try:
    import pymongo
except ImportError:  # pragma: no cover
    pymongo = None   # noqa

if pymongo:
    try:
        from bson.binary import Binary
    except ImportError:                     # pragma: no cover
        from pymongo.binary import Binary   # noqa
    from pymongo.errors import InvalidDocument  # noqa
else:                                       # pragma: no cover
    Binary = None                           # noqa

    class InvalidDocument(Exception):       # noqa
        pass

__all__ = ('MongoBackend',)

BINARY_CODECS = frozenset(['pickle', 'msgpack'])

class MongoBackend(BaseBackend):
    """MongoDB result backend.

    Raises:
        celery.exceptions.ImproperlyConfigured:
            if module :pypi:`pymongo` is not available.
    """

    mongo_host = None
    host = 'localhost'
    port = 27017
    user = None
    password = None
    database_name = 'celery'
    taskmeta_collection = 'celery_taskmeta'
    groupmeta_collection = 'celery_groupmeta'
    max_pool_size = 10
    options = None

    supports_autoexpire = False

    _connection = None

    def __init__(self, app=None, **kwargs):
        self.options = {}

        super(MongoBackend, self).__init__(app, **kwargs)

        if not pymongo:
            raise ImproperlyConfigured(
                'You need to install the pymongo library to use the '
                'MongoDB backend.')

        # Set option defaults
        for key, value in items(self._prepare_client_options()):
            self.options.setdefault(key, value)

        # update conf with mongo uri data, only if uri was given
        if self.url:
            if self.url == 'mongodb://':
                self.url += 'localhost'

            uri_data = pymongo.uri_parser.parse_uri(self.url)
            # build the hosts list to create a mongo connection
            hostslist = [
                '{0}:{1}'.format(x[0], x[1]) for x in uri_data['nodelist']
            ]
            self.user = uri_data['username']
            self.password = uri_data['password']
            self.mongo_host = hostslist
            if uri_data['database']:
                # if no database is provided in the uri, use default
                self.database_name = uri_data['database']

            self.options.update(uri_data['options'])

        # update conf with specific settings
        config = self.app.conf.get('mongodb_backend_settings')
        if config is not None:
            if not isinstance(config, dict):
                raise ImproperlyConfigured(
                    'MongoDB backend settings should be grouped in a dict')
            config = dict(config)  # don't modify original

            if 'host' in config or 'port' in config:
                # these should take over uri conf
                self.mongo_host = None

            self.host = config.pop('host', self.host)
            self.port = config.pop('port', self.port)
            self.mongo_host = config.pop('mongo_host', self.mongo_host)
            self.user = config.pop('user', self.user)
            self.password = config.pop('password', self.password)
            self.database_name = config.pop('database', self.database_name)
            self.taskmeta_collection = config.pop(
                'taskmeta_collection', self.taskmeta_collection,
            )
            self.groupmeta_collection = config.pop(
                'groupmeta_collection', self.groupmeta_collection,
            )

            self.options.update(config.pop('options', {}))
            self.options.update(config)

    def _prepare_client_options(self):
        if pymongo.version_tuple >= (3,):
            return {'maxPoolSize': self.max_pool_size}
        else:  # pragma: no cover
            return {'max_pool_size': self.max_pool_size,
                    'auto_start_request': False}

    def _get_connection(self):
        """Connect to the MongoDB server."""
        if self._connection is None:
            from pymongo import MongoClient

            host = self.mongo_host
            if not host:
                # The first pymongo.Connection() argument (host) can be
                # a list of ['host:port'] elements or a mongodb connection
                # URI.  If this is the case, don't use self.port
                # but let pymongo get the port(s) from the URI instead.
                # This enables the use of replica sets and sharding.
                # See pymongo.Connection() for more info.
                host = self.host
                if isinstance(host, string_t) \
                   and not host.startswith('mongodb://'):
                    host = 'mongodb://{0}:{1}'.format(host, self.port)
            # don't change self.options
            conf = dict(self.options)
            conf['host'] = host

            self._connection = MongoClient(**conf)

        return self._connection

    def encode(self, data):
        if self.serializer == 'bson':
            # mongodb handles serialization
            return data
        payload = super(MongoBackend, self).encode(data)

        # serializer which are in a unsupported format (pickle/binary)
        if self.serializer in BINARY_CODECS:
            payload = Binary(payload)
        return payload

    def decode(self, data):
        if self.serializer == 'bson':
            return data
        return super(MongoBackend, self).decode(data)

    def _store_result(self, task_id, result, state,
                      traceback=None, request=None, **kwargs):
        """Store return value and state of an executed task."""
        meta = {
            '_id': task_id,
            'status': state,
            'result': self.encode(result),
            'date_done': datetime.utcnow(),
            'traceback': self.encode(traceback),
            'children': self.encode(
                self.current_task_children(request),
            ),
        }

        try:
            self.collection.save(meta)
        except InvalidDocument as exc:
            raise EncodeError(exc)

        return result

    def _get_task_meta_for(self, task_id):
        """Get task meta-data for a task by id."""
        obj = self.collection.find_one({'_id': task_id})
        if obj:
            return self.meta_from_decoded({
                'task_id': obj['_id'],
                'status': obj['status'],
                'result': self.decode(obj['result']),
                'date_done': obj['date_done'],
                'traceback': self.decode(obj['traceback']),
                'children': self.decode(obj['children']),
            })
        return {'status': states.PENDING, 'result': None}

    def _save_group(self, group_id, result):
        """Save the group result."""
        self.group_collection.save({
            '_id': group_id,
            'result': self.encode([i.id for i in result]),
            'date_done': datetime.utcnow(),
        })
        return result

    def _restore_group(self, group_id):
        """Get the result for a group by id."""
        obj = self.group_collection.find_one({'_id': group_id})
        if obj:
            return {
                'task_id': obj['_id'],
                'date_done': obj['date_done'],
                'result': [
                    self.app.AsyncResult(task)
                    for task in self.decode(obj['result'])
                ],
            }

    def _delete_group(self, group_id):
        """Delete a group by id."""
        self.group_collection.remove({'_id': group_id})

    def _forget(self, task_id):
        """Remove result from MongoDB.

        Raises:
            pymongo.exceptions.OperationsError:
                if the task_id could not be removed.
        """
        # By using safe=True, this will wait until it receives a response from
        # the server.  Likewise, it will raise an OperationsError if the
        # response was unable to be completed.
        self.collection.remove({'_id': task_id})

    def cleanup(self):
        """Delete expired meta-data."""
        self.collection.remove(
            {'date_done': {'$lt': self.app.now() - self.expires_delta}},
        )
        self.group_collection.remove(
            {'date_done': {'$lt': self.app.now() - self.expires_delta}},
        )

    def __reduce__(self, args=(), kwargs={}):
        return super(MongoBackend, self).__reduce__(
            args, dict(kwargs, expires=self.expires, url=self.url))

    def _get_database(self):
        conn = self._get_connection()
        db = conn[self.database_name]
        if self.user and self.password:
            if not db.authenticate(self.user, self.password):
                raise ImproperlyConfigured(
                    'Invalid MongoDB username or password.')
        return db

    @cached_property
    def database(self):
        """Get database from MongoDB connection.

        performs authentication if necessary.
        """
        return self._get_database()

    @cached_property
    def collection(self):
        """Get the meta-data task collection."""
        collection = self.database[self.taskmeta_collection]

        # Ensure an index on date_done is there, if not process the index
        # in the background.  Once completed cleanup will be much faster
        collection.ensure_index('date_done', background='true')
        return collection

    @cached_property
    def group_collection(self):
        """Get the meta-data task collection."""
        collection = self.database[self.groupmeta_collection]

        # Ensure an index on date_done is there, if not process the index
        # in the background.  Once completed cleanup will be much faster
        collection.ensure_index('date_done', background='true')
        return collection

    @cached_property
    def expires_delta(self):
        return timedelta(seconds=self.expires)

    def as_uri(self, include_password=False):
        """Return the backend as an URI.

        Arguments:
            include_password (bool): Password censored if disabled.
        """
        if not self.url:
            return 'mongodb://'
        if include_password:
            return self.url

        if ',' not in self.url:
            return maybe_sanitize_url(self.url)

        uri1, remainder = self.url.split(',', 1)
        return ','.join([maybe_sanitize_url(uri1), remainder])


text:
@interface Utility : NSObject

// Class (static) methods
// A user of this class does not have to create an instance of this class

// Typical date classes: NSDate, NSCalendar, NSDateComponents

// Use an NSCalendar to decompose an NSDate into an NSDateComponents
// Use an NSCalendar to create an NSDate from an NSDateComponents

// We'll assume the usage of the Gregorian calendar (which is standard in North America)

+ (NSDate *) OneDayFromNow;
+ (NSDate *) OneDayAgo;

+ (NSInteger) ThisDayNum;
+ (NSInteger) DayNum:(NSDate *)date;

// To do - convert the rest of "This..." methods to accept a date argument
+ (NSInteger) ThisWeekdayNum;
+ (NSString *) ThisWeekdayName;

// To do - function to return the weekday name (e.g. Monday, Tuesday, ...)
+ (NSInteger) ThisMonthNum;
+ (NSInteger) ThisYearNum;

+ (NSDate *) NewDateFromYear:(int)year month:(int)month day:(int)day;

@end