text:
<?php

require_once('BaseTModels.class.php');

class Class_Model_TStaffshifts extends BaseTModels
{
	/**
	 * @var string 対応テーブル名
	 */
	const TABLE_NAME = 't_staffshifts';
	protected $_name   = Class_Model_TStaffshifts::TABLE_NAME;

	public static function fieldArray($prefix = '')
	{
		if ($prefix == '')
			$prefix = Class_Model_TStaffshifts::TABLE_NAME;

		return array(
				$prefix . '_id' => 'id',

				$prefix . '_m_member_id' => 'm_member_id',
				$prefix . '_m_shift_id' => 'm_shift_id',
				$prefix . '_dow' => 'dow',

				$prefix . '_createdate' => 'createdate',
				$prefix . '_creator' => 'creator',
				$prefix . '_lastupdate' => 'lastupdate',
				$prefix . '_lastupdater' => 'lastupdater',
		);
	}

	public static function fieldArrayForInsert($prefix = '')
	{
		if ($prefix == '')
			$prefix = Class_Model_TStaffshifts::TABLE_NAME;

		return array(
				$prefix . '_m_member_id' => 'm_member_id',
				$prefix . '_m_shift_id' => 'm_shift_id',
				$prefix . '_dow' => 'dow',

				$prefix . '_createdate' => 'createdate',
				$prefix . '_creator' => 'creator',
				$prefix . '_lastupdate' => 'lastupdate',
				$prefix . '_lastupdater' => 'lastupdater',
		);
	}

	private function setJoinFieldForTwc($select)
	{
		$select
		->joinLeft(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				Class_Model_MShifts::fieldArray()
		)

		->joinLeft(
				array('timetables' => 'm_timetables'),
				'shifts.dayno = timetables.id',
				Class_Model_MTimetables::fieldArray()
		)

		->joinLeft(
				array('members' => 'm_members'),
				'staffshifts.m_member_id = members.id',
				Class_Model_MMembers::fieldArrayTwc()
		)

		->joinLeft(
				array('dockinds' => 'm_dockinds'),
				'shifts.m_dockind_id = dockinds.id',
				Class_Model_MDockinds::fieldArrayTwc()
		)

		->joinLeft(
				array('shiftclasses' => 'm_shiftclasses'),
				'dockinds.shiftclass = shiftclasses.id',
				Class_Model_MShiftclasses::fieldArray()
		)
		;

		return $select;
	}

	private function setJoinField($select)
	{
		$select
		->joinLeft(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				Class_Model_MShifts::fieldArray()
		)

		->joinLeft(
				array('timetables' => 'm_timetables'),
				'shifts.dayno = timetables.id',
				Class_Model_MTimetables::fieldArray()
		)

		->joinLeft(
				array('members' => 'm_members'),
				'staffshifts.m_member_id = members.id',
				Class_Model_MMembers::fieldArray()
		)
		;

		return $select;
	}

	private function setJoinFieldTwc($select)
	{
		$select
		->joinLeft(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				Class_Model_MShifts::fieldArray()
		)

		->joinLeft(
				array('timetables' => 'm_timetables'),
				'shifts.dayno = timetables.id',
				Class_Model_MTimetables::fieldArray()
		)

		->joinLeft(
				array('members' => 'm_members'),
				'staffshifts.m_member_id = members.id',
				Class_Model_MMembers::fieldArrayTwc()
		)
		;

		return $select;
	}

	// 指定のスタッフシフトを検索
	public function selectStaffshift($m_member_id, $m_shift_id, $dow)
	{
		$select = $this->select();
		$select->where('m_member_id = ?', $m_member_id);
		$select->where('m_shift_id = ?', $m_shift_id);
		$select->where('dow = ?', $dow);
		return $this->fetchRow($select);
	}

	// メンバーIDと期間IDとキャンパスIDで取得
	public function selectFromMemberIdAndTermIdAndCampusId($m_member_id, $termid, $campusid=1, $dockind=1)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id = ?', $dockind)
				->where('shifts.m_place_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_member_id = ?', $m_member_id)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	public function insertFromMemberIdAndTermIdAndCampusId($m_member_id, $termid, $pre_termid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		// 前学期のスタッフIDの学期IDのみを今学期のIDに変更して取得
		$preStaffShift = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.dow'))
		->join(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				array('shifts.m_dockind_id', 'shifts.m_place_id', 'shifts.dayno')
		)
		->join(
				array('original' => 'm_shifts'),
				new Zend_Db_Expr("shifts.m_dockind_id = original.m_dockind_id AND shifts.m_place_id = original.m_place_id AND shifts.dayno = original.dayno"),
				array('original.id')
		)
		->where('staffshifts.m_member_id = ?', $m_member_id)
		->where('shifts.m_term_id = ?', $pre_termid)
		->where('original.m_term_id = ?', $termid)
		;

		// 挿入するデータを整形する
		$select = $db->select()->from(
					array('pre'=> $preStaffShift),
					array(
							'm_member_id'	=> new Zend_Db_Expr("'" . $m_member_id . "'"),
							'm_shift_id'	=> 'pre.id',
							'dow'			=> 'pre.dow',
					)
				)
				;

		$select->columns(array('createdate' => new Zend_Db_Expr("'" . Zend_Registry::get('nowdatetime') . "'")));
		$select->columns(array('creator' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));
		$select->columns(array('lastupdate' => new Zend_Db_Expr("'" . Zend_Registry::get('nowdatetime') . "'")));
		$select->columns(array('lastupdater' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));

		$this->insertSelect('t_staffshifts', $select, $this::fieldArrayForInsert());
	}

	// 学期挿入時にシフトを更新
	public function insertStaffshiftFromTerm($termid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		// 現在のスタッフシフトのm_shift_idのみを挿入された学期IDに変更して取得
		$subselect = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.dow'))
		->join(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				array('termid' => '(' . $termid . ')')
		)
		->join(
				array('original' => 'm_shifts'),
				new Zend_Db_Expr("$termid = original.m_term_id AND shifts.m_dockind_id = original.m_dockind_id AND shifts.m_place_id = original.m_place_id AND shifts.dayno = original.dayno"),
				array('original.id')
		)
		;

		// 挿入するデータを整形する
		$select = $db->select()->from(
				array('sub'=> $subselect),
				array(
						'm_member_id'	=> 'sub.m_member_id',
						'm_shift_id'	=> 'sub.id',
						'dow'			=> 'sub.dow',
				)
		)
		->group(new Zend_Db_Expr("1,2,3,4,5,6"));

		$select->columns(array('createdate' => new Zend_Db_Expr("to_timestamp('" . Zend_Registry::get('nowdatetime') . "', 'YYYY/MM/DD HH24:MI:SS')")));
		$select->columns(array('creator' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));
		$select->columns(array('lastupdate' => new Zend_Db_Expr("to_timestamp('" . Zend_Registry::get('nowdatetime') . "', 'YYYY/MM/DD HH24:MI:SS')")));
		$select->columns(array('lastupdater' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));

		$this->insertSelect('t_staffshifts', $select, Class_Model_TStaffshifts::fieldArrayForInsert());
	}

	// 文書挿入時にシフトを更新
	public function insertStaffshiftFromDockind($dockindid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		// 現在のスタッフシフトのm_shift_idのみを挿入された文書IDに変更して取得
		$subselect = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.dow'))
		->join(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				array('dockindid' => '(' . $dockindid . ')')
		)
		->join(
				array('original' => 'm_shifts'),
				new Zend_Db_Expr("shifts.m_term_id = original.m_term_id AND $dockindid = original.m_dockind_id AND shifts.m_place_id = original.m_place_id AND shifts.dayno = original.dayno"),
				array('original.id')
		)
		;

		// 挿入するデータを整形する
		$select = $db->select()->from(
				array('sub'=> $subselect),
				array(
						'm_member_id'	=> 'sub.m_member_id',
						'm_shift_id'	=> 'sub.id',
						'dow'			=> 'sub.dow',
				)
		)
		->group(new Zend_Db_Expr("1,2,3,4,5,6"));

		$select->columns(array('createdate' => new Zend_Db_Expr("to_timestamp('" . Zend_Registry::get('nowdatetime') . "', 'YYYY/MM/DD HH24:MI:SS')")));
		$select->columns(array('creator' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));
		$select->columns(array('lastupdate' => new Zend_Db_Expr("to_timestamp('" . Zend_Registry::get('nowdatetime') . "', 'YYYY/MM/DD HH24:MI:SS')")));
		$select->columns(array('lastupdater' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));

		$this->insertSelect('t_staffshifts', $select, Class_Model_TStaffshifts::fieldArrayForInsert());
	}

	// 場所挿入時にシフトを更新
	public function insertStaffshiftFromPlace($placeid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		// 現在のスタッフシフトのm_shift_idのみを挿入された場所IDに変更して取得
		$subselect = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.dow'))
		->join(
				array('shifts' => 'm_shifts'),
				'staffshifts.m_shift_id = shifts.id',
				array('placeid' => '(' . $placeid . ')')
		)
		->join(
				array('original' => 'm_shifts'),
				new Zend_Db_Expr("shifts.m_term_id = original.m_term_id AND shifts.m_dockind_id = original.m_dockind_id AND $placeid = original.m_place_id AND shifts.dayno = original.dayno"),
				array('original.id')
		)
		;

		// 挿入するデータを整形する
		$select = $db->select()->from(
				array('sub'=> $subselect),
				array(
						'm_member_id'	=> 'sub.m_member_id',
						'm_shift_id'	=> 'sub.id',
						'dow'			=> 'sub.dow',
				)
		)
		->group(new Zend_Db_Expr("1,2,3,4,5,6"));

		$select->columns(array('createdate' => new Zend_Db_Expr("to_timestamp('" . Zend_Registry::get('nowdatetime') . "', 'YYYY/MM/DD HH24:MI:SS')")));
		$select->columns(array('creator' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));
		$select->columns(array('lastupdate' => new Zend_Db_Expr("to_timestamp('" . Zend_Registry::get('nowdatetime') . "', 'YYYY/MM/DD HH24:MI:SS')")));
		$select->columns(array('lastupdater' => new Zend_Db_Expr("'" . Zend_Auth::getInstance()->getIdentity()->id . "'")));

		$this->insertSelect('t_staffshifts', $select, Class_Model_TStaffshifts::fieldArrayForInsert());
	}

	// 学期IDで削除
	public function deleteFromTermId($termid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect = $db->select()->from(
				array('shifts' => 'm_shifts'),
				array('shifts.id')
		)
		->where('shifts.m_term_id = ?', $termid)
		;

		$where = $this->getAdapter()->quoteInto('m_shift_id IN (?)', $subselect);

		return $this->delete($where);
	}

	// 文書IDで削除
	public function deleteFromDockindId($dockindid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect = $db->select()->from(
				array('shifts' => 'm_shifts'),
				array('shifts.id')
		)
		->where('shifts.m_dockind_id = ?', $dockindid)
		;

		$where = $this->getAdapter()->quoteInto('m_shift_id IN (?)', $subselect);

		return $this->delete($where);
	}

	// 場所IDで削除
	public function deleteFromPlaceId($placeid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect = $db->select()->from(
				array('shifts' => 'm_shifts'),
				array('shifts.id')
		)
		->where('shifts.m_place_id = ?', $placeid)
		;

		$where = $this->getAdapter()->quoteInto('m_shift_id IN (?)', $subselect);

		return $this->delete($where);
	}

	// 期間IDとキャンパスIDで取得
	public function selectFromTermIdAndCampusId($termid, $campusid=1)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'));
		if($campusid != 0)
			$subselect1->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 日付期間とキャンパスIDで取得
	public function selectFromYmdAndCampusId($startdate, $campusid=0, $enddate=null)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subTerm = $db->select()->from(
				array('terms'=>'m_terms'),
				array('terms.id'))

				->where('(terms.startdate <= ?', $startdate)
				->where('terms.enddate >= ?)', $startdate)
				->orWhere('(terms.startdate <= ?', $enddate)
				->where('terms.enddate >= ?)', $enddate)
				->orWhere('(terms.startdate >= ?', $startdate)
				->where('terms.enddate <= ?)', $enddate)
				;

		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'));
		if($campusid != 0)
			$subselect1->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id IN (?)', $subTerm)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 期間IDで取得
	public function selectFromTermId($termid)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 期間IDとシフト種別IDで取得
	public function selectFromTermIdAndShiftclass($termid, $shiftclass=1)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));
		if($shiftclass != 9)
			$subselect1->where('dockinds.shiftclass = ?', $shiftclasses[0]);

		if(count($shiftclasses) > 1)
		{
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);
		}

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldForTwc($select));
	}

	// 関大:指定の期間、キャンパスに属するスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTermIdAndCampusIdIncludingDetailsPerDay($campusid, $weektop, $num, $memberid=0)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subTerm = $db->select()->from(
				array('terms'=>'m_terms'),
				array('terms.id'))
				->where("terms.startdate <= (date '$weektop' + $num)")
				->where("terms.enddate >= (date '$weektop' + $num)");

		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id IN (?)', $subTerm)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'のshiftidは削除
				->where("shiftdetails.shiftdate = (date '$weektop' + $num)")
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;
		// スタッフのシフトカレンダー用に追加
		if($memberid !== 0)
			$subdelete->where('shiftdetails.m_member_id = ?', $memberid);

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate = (date '$weektop' + $num)")
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;
		// スタッフのシフトカレンダー用に追加
		if($memberid !== 0)
			$subshiftdate->where('shiftdetails.m_member_id = ?', $memberid);

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'))
		->where('staffshifts.dow = ?', ($num + 1));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)
		->where('staffshifts.dow = ?', ($num + 1))

		//->order(array('staffshifts.createdate DESC'))
		;
		// スタッフのシフトカレンダー用に追加
		if($memberid !== 0)
			$select->where('staffshifts.m_member_id = ?', $memberid);

		return $this->fetchAll($this->setJoinField($select));
	}

	// 関大:指定の期間、キャンパスに属するスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTermIdAndCampusIdIncludingDetails($termid, $campusid, $weektop, $memberid=0)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'のshiftidは削除
				->where("shiftdetails.shiftdate >= (date '$weektop')")
				->where("shiftdetails.shiftdate <= (date '$weektop' + 4)")
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;
		// スタッフのシフトカレンダー用に追加
		if($memberid !== 0)
			$subdelete->where('shiftdetails.m_member_id = ?', $memberid);

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate >= (date '$weektop')")
				->where("shiftdetails.shiftdate <= (date '$weektop' + 4)")
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;
		// スタッフのシフトカレンダー用に追加
		if($memberid !== 0)
			$subshiftdate->where('shiftdetails.m_member_id = ?', $memberid);

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)

		//->order(array('staffshifts.createdate DESC'))
		;
		// スタッフのシフトカレンダー用に追加
		if($memberid !== 0)
			$select->where('staffshifts.m_member_id = ?', $memberid);

		return $this->fetchAll($this->setJoinField($select));
	}

	// 津田:指定の期間、シフト種別に属するスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTermIdAndShiftclassIncludingDetails($termid, $shiftclass, $weektop)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));

		if($shiftclasses[0] != 9)
			$subselect1->where("dockinds.shiftclass = ?", $shiftclasses[0]);

		if(count($shiftclasses) > 1)
		{
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);
		}

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'のshiftidは削除
				->where("shiftdetails.shiftdate >= (date '$weektop')")
				->where("shiftdetails.shiftdate <= (date '$weektop' + 4)")
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate >= (date '$weektop')")
				->where("shiftdetails.shiftdate <= (date '$weektop' + 4)")
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)
		->order(array('members.shift_roles ASC'));

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldForTwc($select));
	}

	// 期間IDとキャンパスIDとメンバーIDで取得
	public function selectFromTermIdAndCampusIdAndMemberId($memberid, $termid, $campusid=1, $dockind=1)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id = ?', $dockind)
				->where('shifts.m_place_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('staffshifts.m_member_id = ?', $memberid)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// メンバーIDと期間IDとキャンパスIDで取得
	public function selectFromMemberIdAndTermIdAndShiftclass($m_member_id, $termid, $shiftclass)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$shiftclasses = explode(",", $shiftclass);

		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));
		if($shiftclasses[0] != 9)
				$subselect1->where('dockinds.shiftclass = ?', $shiftclasses[0]);

		if(!empty($shiftclasses[1]))
		{
			$subselect1->orWhere('dockinds.shiftclass = ?', $shiftclasses[1]);
		}

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.m_member_id = ?', $m_member_id)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 指定のメンバーID、キャンパスID, シフト時間帯、曜日に属するシフトを選択
	public function selectFromShiftinput($termid, $campusid, $dayno, $m_member_id, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.dayno = ?', $dayno)
				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")
		->where('staffshifts.m_member_id = ?', $m_member_id)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('staffshifts.dow = ?', $dow)
		;

		return $this->fetchAll($select);
	}

	// 指定のメンバーID、シフト種別ID, シフト時間帯、曜日に属するシフトを選択
	public function selectFromShiftinputForTwc($termid, $shiftclass, $dayno, $m_member_id, $dow)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'))
				->where('dockinds.shiftclass = ?', $shiftclasses[0]);
		if(count($shiftclasses) > 1)
		{
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);
		}

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.dayno = ?', $dayno)
				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")
		->where('staffshifts.m_member_id = ?', $m_member_id)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('staffshifts.dow = ?', $dow)
		;

		return $this->fetchAll($select);
	}

	// 指定のキャンパスに属する相談場所で指定の順番のシフトを列挙し、そのシフトを参照している指定曜日のシフトスタッフを削除する
	public function deleteFromShiftinput($termid, $campusid, $dayno, $m_member_id, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.dayno = ?', $dayno)
				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$where = array(
				$db->quoteInto('m_member_id = ?', $m_member_id),
				$db->quoteInto('m_shift_id IN (?)', $subselect2),
				$db->quoteInto('dow = ?', $dow),
		);

		$db->delete($this->_name, $where);
	}

	// 指定のキャンパスに属する相談場所で指定の順番のシフトを列挙し、そのシフトを参照している指定曜日のシフトスタッフを削除する
	public function deleteFromShiftinputByMultiTermId(array $termids, $campusid, $dayno, $m_member_id, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.dayno = ?', $dayno)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		//配列の最初にポインタを移動
		reset($termids);
		//このときのキーを取得
		$array_first_info = each($termids);
		$array_first_key = $array_first_info["key"];

		//配列の最後にポインタを移動
		end($termids);
		//このときのキーを取得
		$array_last_info = each($termids);
		$array_last_key = $array_last_info["key"];

		foreach($termids as $key => $value)
		{
			if($key === $array_first_key)
				$subselect2->where('(shifts.m_term_id = ?', $value);
			elseif($key === $array_last_key)
				$subselect2->orWhere('shifts.m_term_id = ?)', $value);
			else
				$subselect2->orWhere('shifts.m_term_id = ?', $value);
		}

		$where = array(
				$db->quoteInto('m_member_id = ?', $m_member_id),
				$db->quoteInto('m_shift_id IN (?)', $subselect2),
				$db->quoteInto('dow = ?', $dow),
		);

		$db->delete($this->_name, $where);
	}

	// 指定の文書IDで指定の順番のシフトを列挙し、そのシフトを参照している指定曜日のシフトスタッフを削除する
	public function deleteFromShiftinputForTwc($termid, $shiftclass, $dayno, $m_member_id, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$shiftclasses = explode(",", $shiftclass);

		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'))

				->where('dockinds.shiftclass = ?', $shiftclasses[0])
				;
				if(count($shiftclasses) > 1)
				{
					$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);
				}

				$subselect2 = $db->select()->from(
						array('shifts'=>'m_shifts'),
						array('shifts.id'))

						->where('shifts.dayno = ?', $dayno)
						->where('shifts.m_term_id = ?', $termid)
						->where('shifts.m_dockind_id IN (?)', $subselect1)
						;

				$where = array(
						$db->quoteInto('m_member_id = ?', $m_member_id),
						$db->quoteInto('m_shift_id IN (?)', $subselect2),
						$db->quoteInto('dow = ?', $dow),
				);

				$db->delete($this->_name, $where);
	}

	// 指定の文書IDで指定の順番のシフトを列挙し、そのシフトを参照している指定曜日のシフトスタッフを削除する
	public function deleteFromShiftinputByMultiTermIdForTwc(array $termids, $shiftclass, $dayno, $m_member_id, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$shiftclasses = explode(",", $shiftclass);

		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'))

				->where('dockinds.shiftclass = ?', $shiftclasses[0])
				;
				if(count($shiftclasses) > 1)
				{
					$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);
				}

				$subselect2 = $db->select()->from(
						array('shifts'=>'m_shifts'),
						array('shifts.id'))

						->where('shifts.dayno = ?', $dayno)
						->where('shifts.m_dockind_id IN (?)', $subselect1)
						;

				//配列の最初にポインタを移動
				reset($termids);
				//このときのキーを取得
				$array_first_info = each($termids);
				$array_first_key = $array_first_info["key"];

				//配列の最後にポインタを移動
				end($termids);
				//このときのキーを取得
				$array_last_info = each($termids);
				$array_last_key = $array_last_info["key"];

				foreach($termids as $key => $value)
				{
					if($key === $array_first_key)
						$subselect2->where('(shifts.m_term_id = ?', $value);
					elseif($key === $array_last_key)
						$subselect2->orWhere('shifts.m_term_id = ?)', $value);
					else
						$subselect2->orWhere('shifts.m_term_id = ?', $value);
				}

				$where = array(
						$db->quoteInto('m_member_id = ?', $m_member_id),
						$db->quoteInto('m_shift_id IN (?)', $subselect2),
						$db->quoteInto('dow = ?', $dow),
				);

				$db->delete($this->_name, $where);
	}

	// 指定の期間、場所、シフト内連番、曜日に属するスタッフシフトを取得
	public function selectFromTodayStaff($termid, $campusid, $dayno, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				->where('shifts.dayno = ?', $dayno)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('members.id is not null')

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 指定の期間、シフト種別ID、シフト内連番、曜日に属するスタッフシフトを取得
	public function selectFromTodayStaffForTwc($termid, $shiftclass, $dayno, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$shiftclasses = explode(",", $shiftclass);

		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));

		if($shiftclasses[0] != 9)
			$subselect1->where('dockinds.shiftclass = ?', $shiftclasses[0]);

		if(!empty($shiftclasses[1]))
			$subselect1->orWhere('dockinds.shiftclass = ?', $shiftclasses[1]);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				->where('shifts.dayno = ?', $dayno)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldTwc($select));
	}

	// 関大:指定の期間、場所、シフト内連番、曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayStaffIncludingDetails($termid, $campusid, $dayno, $dow, $weektop)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				->where('shifts.dayno = ?', $dayno)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)	// type='0'のshiftidは削除
		->where('members.id is not null')

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 関大:指定の期間、場所、シフト内連番、曜日あるいは日付に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayStaffIncludingDetailsForAvailable($memberid, $shiftid, $dow, $ymd)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.id = ?', $shiftid)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')
				->where("shiftdetails.shiftdate = (date '$ymd')")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect)
				->where('shiftdetails.m_member_id = ?', $memberid)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate = (date '$ymd')")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect)
				->where('shiftdetails.m_member_id = ?', $memberid)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.m_member_id = ?', $memberid)
		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)	// type='0'のshiftidは削除

		//->order(array('members.name_kana asc'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 関大:指定の期間、場所、シフト内連番、曜日あるいは日付に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayStaffIncludingDetailsYmd($termid, $campusid, $dayno, $dow, $ymd)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				->where('shifts.dayno = ?', $dayno)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')
				->where("shiftdetails.shiftdate = (date '$ymd')")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate = (date '$ymd')")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)	// type='0'のshiftidは削除
		->where('members.id is not null')

		->order(array('members.name_kana asc'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 津田:指定の期間、キャンパス、シフト内連番、曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayStaffIncludingDetailsForTwc($termid, $shiftclass, $dayno, $dow, $weektop)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));

		if($shiftclasses[0] != 9)
			$subselect1->where('dockinds.shiftclass = ?', $shiftclasses[0]);

		if(count($shiftclasses) > 1)
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				->where('shifts.dayno = ?', $dayno)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidは登録
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)	// type='0'のshiftidは削除

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldTwc($select));
	}

	// 指定の期間、キャンパス、シフト内連番、曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromMemberIdAndTermIdAndCampusIdIncludingDetails($memberid, $termid, $campusid, $weektop)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.m_member_id = ?', $memberid)
				->where('shiftdetails.type = \'0\'')		// type='0'の(shiftid, dow)は除外
				->where("shiftdetails.shiftdate >= ?", $weektop)
				->where("shiftdetails.shiftdate <= (date ? + 4)", $weektop)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.m_member_id = ?', $memberid)
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidはUNION
				->where("shiftdetails.shiftdate >= ?", $weektop)
				->where("shiftdetails.shiftdate <= (date ? + 4)", $weektop)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.m_member_id = ?', $memberid)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 津田:指定の期間、シフト種別、シフト内連番、曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromMemberIdAndTermIdAndShiftclassIncludingDetails($memberid, $termid, $shiftclass, $weektop)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));
		if($shiftclasses[0] != 9)
			$subselect1->where("dockinds.shiftclass = ?", $shiftclasses[0]);
		if(count($shiftclasses) > 1)
		{
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);
		}

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.m_member_id = ?', $memberid)
				->where('shiftdetails.type = \'0\'')		// type='0'の(shiftid, dow)は除外
				->where("shiftdetails.shiftdate >= ?", $weektop)
				->where("shiftdetails.shiftdate <= (date ? + 4)", $weektop)
				;

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.m_member_id = ?', $memberid)
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidはUNION
				->where("shiftdetails.shiftdate >= ?", $weektop)
				->where("shiftdetails.shiftdate <= (date ? + 4)", $weektop)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.m_member_id = ?', $memberid)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldTwc($select));
	}

	// 関大:指定の学期、キャンパス、曜日に属するスタッフシフトを取得
	public function selectFromTodayStaffExceptDayno($termid, $campusid, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('members.id is not null')

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 津田:指定の学期、シフト種別、曜日に属するスタッフシフトを取得
	public function selectFromTodayStaffExceptDaynoForTwc($termid, $shiftclass, $dow)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));

		if($shiftclasses[0] != 9)
			$subselect1->where('dockinds.shiftclass = ?', $shiftclasses[0]);

		if(count($shiftclasses) > 1)
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldTwc($select));
	}

	// 関大:指定の学期、キャンパス、日付+曜日あるいは曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayStaffExceptDaynoIncludingDetails($termid, $campusid, $dow, $weektop)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'の(shiftid, dow)は除外
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidはUNION
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.dow = ?', $dow)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)
		->where('members.id is not null')
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 津田:指定の学期、シフト種別、日付+曜日あるいは曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayStaffExceptDaynoIncludingDetailsForTwc($termid, $shiftclass, $dow, $weektop)
	{
		$shiftclasses = explode(",", $shiftclass);

		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));

		if($shiftclasses[0] != 9)
			$subselect1->where('dockinds.shiftclass = ?', $shiftclasses[0]);

		if(count($shiftclasses) > 1)
			$subselect1->orWhere("dockinds.shiftclass = ?", $shiftclasses[1]);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				;

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'の(shiftid, dow)は除外
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidはUNION
				->where("shiftdetails.shiftdate = (date '$weektop' + $dow - 1)")
				->where('shiftdetails.dow = ?', $dow)
				->where('shiftdetails.m_shift_id IN (?)', $subselect2)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.dow = ?', $dow)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)
		;

		return $this->fetchAll($this->setJoinFieldTwc($select));
	}

	//masuda-------------------------------------------------------------------------
	public function selectFromTodayAllStaff($termid, $campusid, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 関大:指定の学期、キャンパス、曜日、日付あるいは曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayAllStaffExceptDaynoIncludingDetails($termid, $campusid, $dow, $ymd, $order=array('members.name_kana asc'))
	{
		$db = Zend_Db_Table::getDefaultAdapter();
		$subselect1 = $db->select()->from(
				array('places'=>'m_places'),
				array('places.id'))
				->where('places.m_campus_id = ?', $campusid);

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'の(shiftid, dow)は除外
				->where("shiftdetails.shiftdate = ?", $ymd)
				;

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidはUNION
				->where("shiftdetails.shiftdate = ?", $ymd)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.dow = ?', $dow)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)
		->order($order)
		;

		return $this->fetchAll($this->setJoinField($select));
	}

	// 津大:指定の学期、曜日、日付あるいは曜日に属すスタッフシフトを、
	// shiftdetailsテーブルのデータを含めて取得
	public function selectFromTodayAllStaffExceptDaynoIncludingDetailsForTwc($termid, $shiftclass=0, $dow, $ymd)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'));
		if($shiftclass != 0)
			$subselect1->where('dockinds.shiftclass = ?', $shiftclass);

		$subdelete = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'0\'')		// type='0'の(shiftid, dow)は除外
				->where("shiftdetails.shiftdate = ?", $ymd)
				;

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))
				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_dockind_id IN (?)', $subselect1)
				;

		$subshiftdate = $db->select()->from(
				array('shiftdetails'=>'t_shiftdetails'),
				array('shiftdetails.m_member_id', 'shiftdetails.m_shift_id', 'shiftdetails.dow'))
				->where('shiftdetails.type = \'1\'')		// type='1'のshiftidはUNION
				->where("shiftdetails.shiftdate = ?", $ymd)
				;

		$staffshifts = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), array('staffshifts.m_member_id', 'staffshifts.m_shift_id', 'staffshifts.dow'));

		$select = $this->select()->setIntegrityCheck(false)
		//->from(array('staffshifts' => $this->_name), "*")
		->from(array('staffshifts' => $db->select()->union(array($staffshifts, $subshiftdate))), "*")
		->where('staffshifts.dow = ?', $dow)
		->where('staffshifts.m_shift_id IN (?)', $subselect2)
		->where('(staffshifts.m_member_id, staffshifts.m_shift_id, staffshifts.dow) NOT IN (?)', $subdelete)
		;

		return $this->fetchAll($this->setJoinFieldTwc($select));
	}

	// 津大:シフト種別でシフト取得
	public function selectFromTodayAllStaffForTwc($termid, $shiftclass, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$shiftclasses = explode(",", $shiftclass);

		$subselect1 = $db->select()->from(
				array('dockinds'=>'m_dockinds'),
				array('dockinds.id'))
				->where('dockinds.shiftclass = ?', $shiftclasses[0]);
		if(!empty($shiftclasses[1]))
		{
			$subselect1->orWhere('dockinds.shiftclass = ?', $shiftclasses[1]);
		}

		$subselect2 = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				->where('shifts.m_place_id IN (?)', $subselect1)

				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect2)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldForTwc($select));
	}

	// 津田:本日の予約状況用、担当者・日付毎の担当予約件数をカウント
	public function getChargedReserveCountPerStaffAndDate($reservationdate)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$select = $db->query(
				'SELECT COUNT(*) as count, t_leadings.m_member_id_charge, t_reserves.reservationdate FROM t_leadings, t_reserves
						WHERE t_leadings.t_reserve_id = t_reserves.id AND t_reserves.reservationdate = ?
						GROUP BY m_member_id_charge, t_reserves.reservationdate', $reservationdate
		);

		return $select->fetchAll();
	}

	// 津大:本日の予約状況用
	public function selectFromTodayAllStaffForTwcReserveStatus($termid, $dow)
	{
		$db = Zend_Db_Table::getDefaultAdapter();

		$subselect = $db->select()->from(
				array('shifts'=>'m_shifts'),
				array('shifts.id'))

				->where('shifts.m_term_id = ?', $termid)
				;

		$select = $this->select()->setIntegrityCheck(false)
		->from(array('staffshifts' => $this->_name), "*")

		->where('staffshifts.dow = ?', $dow)

		->where('staffshifts.m_shift_id IN (?)', $subselect)

		//->order(array('staffshifts.createdate DESC'))
		;

		return $this->fetchAll($this->setJoinFieldForTwc($select));
	}
}


text:
/* global describe, it */

var stacked = require('../stacked')
  , expect = require('chai').expect
  , connect = require('connect')
  , request = require('supertest')

describe('stacked()', function () {
  describe('.use(layer)', function () {
    it('execute as middleware', function (done) {
      var app = connect()
      var pack = stacked()
      var middleware1Called = false
      var middleware2Called = false

      pack.use(function (req, res, next) {
        middleware1Called = true
        next()
      })

      pack.use(function (req, res, next) {
        middleware2Called = true
        res.statusCode = 200
        res.end()
      })

      app.use(pack)

      request(app)
        .get('/')
        .expect(200)
        .expect(function () {
          expect(middleware1Called).to.equal(true)
          expect(middleware2Called).to.equal(true)
        })
        .end(done)
    })
  })

  describe('.use(layer, layer)', function () {
    it('execute as middleware', function (done) {
      var app = connect()
      var middleware1Called = false
      var middleware2Called = false
      var pack = stacked(
        function (req, res, next) {
          middleware1Called = true
          next()
        },
        function (req, res, next) {
          middleware2Called = true
          res.statusCode = 200
          res.end()
        }
      )

      app.use(pack)

      request(app)
        .get('/')
        .expect(200)
        .expect(function () {
          expect(middleware1Called).to.equal(true)
          expect(middleware2Called).to.equal(true)
        })
        .end(done)
    })
  })

  describe('.layers', function () {
    it('is exposed on object', function () {
      var pack = stacked()
      var layer = function (req, res, next) {
        next()
      }
      pack.use(layer)

      expect(pack.layers.length).to.equal(1)
      expect(pack.layers[0].toString()).to.equal(layer.toString())
    })
  })

  describe('.mount(path, fn)', function () {
    it('executes at the given path', function (done) {
      var app = connect()
      var pack = stacked()
      var mountedMiddleware1Called = false
      var mountedMiddleware2Called = false

      pack.mount('/mount1', function (req, res, next) {
        mountedMiddleware1Called = true
        next()
      })

      pack.mount('/mount2', function (req, res, next) {
        mountedMiddleware2Called = true
        next()
      })

      app.use(pack)

      request(app)
        .get('/mount1')
        .expect(function () {
          expect(mountedMiddleware1Called).to.equal(true)
          expect(mountedMiddleware2Called).to.equal(false)
        })
        .end(done)
    })
  })
})

redpajama_set_name: RedPajamaGithub


text:
namespace FirebaseAdmin.Auth.Hash
{
    ///
    /// Represents the SHA256 password hashing algorithm. Can be used as an instance of
    /// UserImportHash when importing users.
    ///
    public sealed class Sha256 : RepeatableHash
    {
        ///
        /// Initializes a new instance of the <see cref="Sha256"/> class.
        /// Defines the name of the hash to be equal to SHA256.
        ///
        public Sha256()
            : base("SHA256") { }

        ///
        /// Gets the minimum number of rounds for a SHA256 hash, which is 1.
        ///
        protected override int MinRounds { get => 1; }

        ///
        /// Gets the maximum number of rounds for a SHA256 hash, which is 8192.
        ///
        protected override int MaxRounds { get => 8192; }
    }
}


text:
module Twitch.Run where
import Prelude hiding (FilePath, log)
import Twitch.Internal ( Dep, runDep )
import Twitch.InternalRule
    ( Config(dirs, logger), InternalRule, toInternalRule, setupRules )
import Twitch.Rule ( RuleIssue )
import Data.Either ( partitionEithers )
import System.FilePath ( FilePath )
import System.FSNotify ( WatchManager )
import System.Directory ( getCurrentDirectory )
import Twitch.Path ( findAllDirs )
import Data.Default ( Default(def) )

-- This the main interface for running a Dep

run :: Dep -> IO WatchManager
run dep =  do
  currentDir <- getCurrentDirectory
  dirs'      <- findAllDirs currentDir
  runWithConfig currentDir (def { logger = print, dirs = dirs' }) dep

runWithConfig :: FilePath -> Config -> Dep -> IO WatchManager
runWithConfig root config dep = do
  let (_issues, rules) = depToRules root dep
  -- TODO handle the issues somehow
  -- Log and perhaps error
  setupRules config rules

depToRulesWithCurrentDir :: Dep -> IO ([RuleIssue], [InternalRule])
depToRulesWithCurrentDir dep = do
  currentDir <- getCurrentDirectory
  return $ depToRules currentDir dep

depToRules :: FilePath -> Dep -> ([RuleIssue], [InternalRule])
depToRules currentDir
  = partitionEithers . map (toInternalRule currentDir) . runDep


text:
RethinkDB Cluster on Kubernetes
==============================

Setting up a [rethinkdb](http://rethinkdb.com/) cluster on [kubernetes](http://kubernetes.io)

**Features**

 * Auto configuration cluster by querying info from k8s
 * Simple

Quick start
-----------
**Step 0**

change the namespace of the current context to "rethinkdb"
```
$kubectl config view -o template --template='{{index . "current-context"}}' | xargs -I {} kubectl config set-context {} --namespace=rethinkdb
```

**Step 1**

antmanler/rethinkdb will discover peer using endpoints provided by kubernetes_ro service,
so first create a service so the following pod can query its endpoint

```shell
$kubectl create -f driver-service.yaml
```

check out:

```shell
$kubectl get se
NAME               LABELS        SELECTOR       IP(S)         PORT(S)
rethinkdb-driver   db=influxdb   db=rethinkdb   10.0.27.114   28015/TCP
```

**Step 2**

start fist server in cluster

```shell
$kubectl create -f rc.yaml
```

Actually, you can start servers as many as you want at one time, just modify the `replicas` in `rc.ymal`

check out again:

```shell
$kubectl get po
POD                         IP        CONTAINER(S)   IMAGE(S)                     HOST                      LABELS                       STATUS    CREATED      MESSAGE
rethinkdb-rc-1.16.0-6odi0                                                         kubernetes-minion-s59e/   db=rethinkdb,role=replicas   Pending   11 seconds
                                      rethinkdb      antmanler/rethinkdb:1.16.0
```

**Done!**

---

Scale
-----

You can scale up you cluster using `kubectl scale`, and new pod will join to exsits cluster automatically, for example

```shell
$kubectl scale rc rethinkdb-rc-1.16.0 --replicas=3
scaled
$kubectl get po
POD                         IP           CONTAINER(S)   IMAGE(S)                     HOST                                   LABELS                       STATUS    CREATED          MESSAGE
rethinkdb-rc-1.16.0-6odi0   10.244.3.3                                               kubernetes-minion-s59e/104.197.79.42   db=rethinkdb,role=replicas   Running   About a minute
                                         rethinkdb      antmanler/rethinkdb:1.16.0                                                                       Running   About a minute
rethinkdb-rc-1.16.0-e3mxv                                                            kubernetes-minion-d7ub/                db=rethinkdb,role=replicas   Pending   6 seconds
                                         rethinkdb      antmanler/rethinkdb:1.16.0
rethinkdb-rc-1.16.0-manu6                                                            kubernetes-minion-cybz/                db=rethinkdb,role=replicas   Pending   6 seconds
                                         rethinkdb      antmanler/rethinkdb:1.16.0
```

Admin
-----

You need a separate pod (labeled as role:admin) to access Web Admin UI

```shell
kubectl create -f admin-pod.yaml
kubectl create -f admin-service.yaml
```

find the service

```shell
$kubectl get se
NAME               LABELS        SELECTOR                  IP(S)            PORT(S)
rethinkdb-admin    db=influxdb   db=rethinkdb,role=admin   10.0.131.19      8080/TCP
                                                           104.197.19.120
rethinkdb-driver   db=influxdb   db=rethinkdb              10.0.27.114      28015/TCP
```

We request for an external load balancer in the [admin-service.yaml](admin-service.yaml) file:

```
createExternalLoadBalancer: true
```

The external load balancer allows us to access the service from outside via an external IP, which is 104.197.19.120 in this case.

Note that you may need to create a firewall rule to allow the traffic, assuming you are using GCE:
```
$ gcloud compute firewall-rules create rethinkdb --allow=tcp:8080
```

Now you can open a web browser and access to *http://104.197.19.120:8080* to manage your cluster.

**Why not just using pods in replicas?**

This is because kube-proxy will act as a load balancer and send your traffic to different server,
since the ui is not stateless when playing with Web Admin UI will cause `Connection not open on server` error.

- - -

**BTW**

  * All services and pods are placed under namespace `rethinkdb`.

  * `gen_pod.sh` is using to generate pod templates for my local cluster,
the generated pods which is using `nodeSelector` to force k8s to schedule containers to my designate nodes, for I need to access persistent data on my host dirs. Note that one needs to label the node before 'nodeSelector' can work, see this [tutorial](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/node-selection)

  * see [antmanler/rethinkdb-k8s](https://github.com/antmanler/rethinkdb-k8s) for detail

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/examples/rethinkdb/README.md?pixel)]()


text:
package com.example.yang.test.util;

import android.content.Context;
import android.os.Bundle;
import android.os.Environment;
import android.widget.Toast;

import com.iflytek.cloud.ErrorCode;
import com.iflytek.cloud.InitListener;
import com.iflytek.cloud.RecognizerListener;
import com.iflytek.cloud.RecognizerResult;
import com.iflytek.cloud.SpeechConstant;
import com.iflytek.cloud.SpeechError;
import com.iflytek.cloud.SpeechRecognizer;
import com.iflytek.cloud.util.ResourceUtil;

/**
 * Created by Administrator on 2017/1/9.
 */

public abstract class KqwSpeechRecognizer {
    /**
     * 初始化的回调
     *
     * @param flag true 初始化成功 false 初始化失败
     */
    public abstract void initListener(boolean flag);

    public abstract void resultData(String data);

    public abstract void speechLog(String log);

    // Log标签
    private static final String TAG = "KqwLocalCommandRecognizer";

    public static final String GRAMMAR_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/msc/test";
    // 上下文
    private Context mContext;
    // 语音识别对象
    private SpeechRecognizer mAsr;

    public KqwSpeechRecognizer(Context context) {
        mContext = context;

        // 初始化识别对象
        mAsr = SpeechRecognizer.createRecognizer(context, new InitListener() {

            @Override
            public void onInit(int code) {
                if (code != ErrorCode.SUCCESS) {
                    initListener(false);
                    Toast.makeText(mContext, "初始化失败,错误码:" + code, Toast.LENGTH_SHORT).show();
                } else {
                    initListener(true);
                }
            }
        });

    }

    /**
     * 参数设置
     */
    public void setParam() {
        // 清空参数
        mAsr.setParameter(SpeechConstant.PARAMS, null);
        // 设置识别引擎 本地引擎
        mAsr.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_LOCAL);
        // mAsr.setParameter(SpeechConstant.ENGINE_TYPE,
        // SpeechConstant.TYPE_MIX);
        // mAsr.setParameter(SpeechConstant.ENGINE_TYPE, "mixed");
        // // 设置本地识别资源
        mAsr.setParameter(ResourceUtil.ASR_RES_PATH, getResourcePath());
        // 设置语法构建路径
        mAsr.setParameter(ResourceUtil.GRM_BUILD_PATH, GRAMMAR_PATH);
        // 设置返回结果格式
        mAsr.setParameter(SpeechConstant.RESULT_TYPE, "json");
        // 设置本地识别使用语法id
        mAsr.setParameter(SpeechConstant.LOCAL_GRAMMAR, "kqw");
        // 设置识别的门限值
        mAsr.setParameter(SpeechConstant.MIXED_THRESHOLD, "60");
        // 使用8k音频的时候请解开注释
        // mAsr.setParameter(SpeechConstant.SAMPLE_RATE, "8000");
        mAsr.setParameter(SpeechConstant.DOMAIN, "iat");
        mAsr.setParameter(SpeechConstant.NLP_VERSION, "2.0");
        mAsr.setParameter("asr_sch", "1");
        // mAsr.setParameter(SpeechConstant.RESULT_TYPE, "json");
    }

    // 获取识别资源路径
    private String getResourcePath() {
        StringBuffer tempBuffer = new StringBuffer();
        // 识别通用资源
        tempBuffer.append(ResourceUtil.generateResourcePath(mContext, ResourceUtil.RESOURCE_TYPE.assets, "asr/common.jet"));
        // 识别8k资源-使用8k的时候请解开注释
        // tempBuffer.append(";");
        // tempBuffer.append(ResourceUtil.generateResourcePath(this,
        // RESOURCE_TYPE.assets, "asr/common_8k.jet"));
        return tempBuffer.toString();
    }

    int ret = 0;// 函数调用返回值

    /**
     * 开始识别
     */
    public void startListening() {
        // 设置参数
        setParam();

        ret = mAsr.startListening(mRecognizerListener);
        if (ret != ErrorCode.SUCCESS) {
        }
    }

    /**
     * 识别监听器。
     */
    private RecognizerListener mRecognizerListener = new RecognizerListener() {

        StringBuffer stringBuffer = new StringBuffer();

        public void onVolumeChanged(int volume) {
            speechLog("当前正在说话,音量大小:" + volume);
        }

        @Override
        public void onResult(final RecognizerResult result, boolean isLast) {
            /*
             * TODO 拼接返回的数据
             *
             * 这里返回的是Json数据,具体返回的是离线名命令词返回的Json还是语义返回的Json,需要做判断以后在对数据数据进行拼接
             */
            stringBuffer.append(result.getResultString()).append("");
            // isLast为true的时候,表示一句话说完,将拼接后的完整的一句话返回
            if (isLast) {
                // 数据回调
                resultData(stringBuffer.toString());
            }
        }

        @Override
        public void onEndOfSpeech() {
            speechLog("结束说话");
        }

        @Override
        public void onVolumeChanged(int i, byte[] bytes) {

        }

        @Override
        public void onBeginOfSpeech() {
            stringBuffer.delete(0, stringBuffer.length());
            speechLog("开始说话");
        }

        @Override
        public void onError(SpeechError error) {
            if (error.getErrorCode() == 20005) {
                // 本地命令词没有识别,也没有请求到网络
                resultData("没有构建的语法");
                speechLog("没有构建的语法");
                /*
                 * TODO
                 * 当网络正常的情况下是不会回调20005的错误,只有当本地命令词识别不匹配,网络请求也失败的情况下,会返回20005
                 * 这里可以自己再做处理,例如回复"没有听清"等回复
                 */
            } else {
                /*
                 * TODO
                 * 其他错误有很多,需要具体问题具体分析,正常在程序没有错误的情况下,只会回调一个没有检测到说话的错误,没记错的话错误码是10118
                 */
            }
        }

        @Override
        public void onEvent(int eventType, int arg1, int arg2, Bundle obj) {
        }

    };
}


text:
layout: page
title: Publications
---
This project was first presented at IEEEVR 2017 in a poster, entitled [*Uni-CAVE: A Unity3D Plugin for Non-head Mounted VR Display Systems*][2].

![UniCAVE]({{'images/uni-cave-unity3d.png' | absolute_url}})

#### APA

Tredinnick, R., &  Boettcher, B., & Smith, S. & Solovy, S. & Ponto, K. (2017). _Uni-CAVE: A Unity3D Plugin for Non-head Mounted VR Display Systems_. Virtual Reality (VR), 2017 IEEE, In Print.

#### BibTeX

```
@inproceedings{unicave2017,
  title={Uni-CAVE: A Unity3D Plugin for Non-head Mounted VR Display Systems},
  author={Tredinnick, Ross and Boettcher, Brady and Smith, Simon and Solovy, Sam and Ponto, Kevin},
  booktitle={Virtual Reality (VR), 2017 IEEE},
  pages={In Print},
  year={2017},
  organization={IEEE}
}
```

The project was also featured in the *VR Developer Gems* book.

![VR Developer Gems]({{'images/VRGems.jpg' | absolute_url}})

[VR Developer Gems: Chapter 4][1]
[UniCAVE: A Distributed Rendering System for Unity3D][1]
[Ross Tredinnick, Kevin Ponto][1]

#### APA

Sherman, W. R. (2019). VR Developer Gems. Milton: CRC Press LLC.

#### BibTeX

```
@book{vrgems,
  title={UniCAVE: A Distributed Rendering System for Unity3D},
  author={Tredinnick, Ross and Ponto, Kevin},
  booktitle={VR Developer Gems},
  publisher={Milton: CRC Press LLC},
  year={2019}
}
```

[1]: https://www.taylorfrancis.com/books/e/9781315157764/chapters/10.1201/b21598-4

[2]: http://pages.cs.wisc.edu/~kponto/publications/uni-cave-unity3d.pdf


text:
Route = function(router, path, options, group) {
  options = options || {};

  this.path = path;
  if (options.name) {
    this.name = options.name;
  }

  this._action = options.action || Function.prototype;
  this._subscriptions = options.subscriptions || Function.prototype;
  this._triggersEnter = options.triggersEnter || [];
  this._triggersExit = options.triggersExit || [];
  this._middlewares = options.middlewares || [];
  this._subsMap = {};
  this._router = router;

  this._params = new ReactiveDict();
  this._queryParams = new ReactiveDict();
  this._routeCloseDep = new Tracker.Dependency();

  // tracks the changes in the URL
  this._pathChangeDep = new Tracker.Dependency();

  this.group = group;
};

Route.prototype.clearSubscriptions = function() {
  this._subsMap = {};
};

Route.prototype.register = function(name, sub, options) {
  this._subsMap[name] = sub;
};

Route.prototype.getSubscription = function(name) {
  return this._subsMap[name];
};

Route.prototype.getAllSubscriptions = function() {
  return this._subsMap;
};

Route.prototype._processTriggersEnter = function(context) {
  _.each(this._triggersEnter, function(fn) {
    if (typeof fn === 'function') {
      fn(context);
    }
  });
};

Route.prototype._processMiddlewares = function(context, after) {
  var currentIndex = 0;
  var self = this;

  runMiddleware();
  function runMiddleware() {
    var fn = self._middlewares[currentIndex++];
    if(fn) {
      console.warn("'middleware' is deprecated. Use 'triggers' instead");
      fn(context.path, function(redirectPath) {
        if(redirectPath) {
          return self._router.redirect(redirectPath);
        } else {
          runMiddleware();
        }
      });
    } else {
      after();
    }
  }
};

Route.prototype.callAction = function(current) {
  var self = this;

  self._processTriggersEnter(current);

  self._processMiddlewares(current.context, function() {
    self._action(current.params, current.queryParams);
  });
};

Route.prototype.callSubscriptions = function(current) {
  this.clearSubscriptions();
  if (this.group) {
    this.group.callSubscriptions(current);
  }

  this._subscriptions(current.params, current.queryParams);
};

Route.prototype.getRouteName = function() {
  this._routeCloseDep.depend();
  return this.name;
};

Route.prototype.getParam = function(key) {
  this._routeCloseDep.depend();
  return this._params.get(key);
};

Route.prototype.getQueryParam = function(key) {
  this._routeCloseDep.depend();
  return this._queryParams.get(key);
};

Route.prototype.watchPathChange = function() {
  this._pathChangeDep.depend();
};

Route.prototype.registerRouteClose = function() {
  this._params = new ReactiveDict();
  this._queryParams = new ReactiveDict();
  this._routeCloseDep.changed();
  this._pathChangeDep.changed();
};

Route.prototype.registerRouteChange = function(currentContext, routeChanging) {
  // register params
  var params = currentContext.params;
  this._updateReactiveDict(this._params, params);

  // register query params
  var queryParams = currentContext.queryParams;
  this._updateReactiveDict(this._queryParams, queryParams);

  // if the route is changing, we need to defer triggering path changing
  // if we did this, old route's path watchers will detect this
  // Real issue is, above watcher will get removed with the new route
  // So, we don't need to trigger it now
  // We are doing it on the route close event. So, if they exists they'll
  // get notify that
  if(!routeChanging) {
    this._pathChangeDep.changed();
  }
};

Route.prototype._updateReactiveDict = function(dict, newValues) {
  var currentKeys = _.keys(newValues);
  var oldKeys = _.keys(dict.keyDeps);

  // set new values
  //  params is an array. So, _.each(params) does not works
  //  to iterate params
  _.each(currentKeys, function(key) {
    dict.set(key, newValues[key]);
  });

  // remove keys which does not exisits here
  var removedKeys = _.difference(oldKeys, currentKeys);
  _.each(removedKeys, function(key) {
    dict.set(key, undefined);
  });
};


text:
		<title>Member List</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">

				Main Page
				Class Hierarchy
				Compound List
				Compound Members

PxOutputStream Member List

This is the complete list of members for PxOutputStream, including all inherited members.

write(const void *src, PxU32 count)=0	PxOutputStream	pure virtual

~PxOutputStream()	PxOutputStream	inlinevirtual

Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com


text:
package de.egore911.dedup.ui.dto;

public class Column {
	private int index;
	private String label;

	public Column(int index, String label) {
		this.index = index;
		this.label = label;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
}


text:
.class public Lcom/android/systemui/SystemBars;
.super Lcom/android/systemui/SystemUI;
.source "SystemBars.java"

# instance fields
.field private mStatusBar:Lcom/android/systemui/SystemUI;

# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Lcom/android/systemui/SystemUI;-><init>()V

    return-void
.end method

.method private andLog(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/lang/RuntimeException;
    .locals 1

    const-string/jumbo v0, "SystemBars"

    invoke-static {v0, p1, p2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    new-instance v0, Ljava/lang/RuntimeException;

    invoke-direct {v0, p1, p2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0
.end method

.method private createStatusBarFromConfig()V
    .locals 7

    const/4 v6, 0x0

    const/4 v5, 0x0

    const/16 v3, -0x10

    invoke-static {v3}, Landroid/os/Process;->setThreadPriority(I)V

    iget-object v3, p0, Lcom/android/systemui/SystemBars;->mContext:Landroid/content/Context;

    const v4, 0x7f1201f4

    invoke-virtual {v3, v4}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    if-eqz v1, :cond_0

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v3

    if-nez v3, :cond_1

    :cond_0
    const-string/jumbo v3, "No status bar component configured"

    invoke-direct {p0, v3, v6}, Lcom/android/systemui/SystemBars;->andLog(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/lang/RuntimeException;

    move-result-object v3

    throw v3

    :cond_1
    const/4 v0, 0x0

    :try_start_0
    iget-object v3, p0, Lcom/android/systemui/SystemBars;->mContext:Landroid/content/Context;

    invoke-virtual {v3}, Landroid/content/Context;->getClassLoader()Ljava/lang/ClassLoader;

    move-result-object v3

    invoke-virtual {v3, v1}, Ljava/lang/ClassLoader;->loadClass(Ljava/lang/String;)Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/android/systemui/SystemUI;

    iput-object v3, p0, Lcom/android/systemui/SystemBars;->mStatusBar:Lcom/android/systemui/SystemUI;
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_1

    iget-object v3, p0, Lcom/android/systemui/SystemBars;->mStatusBar:Lcom/android/systemui/SystemUI;

    iget-object v4, p0, Lcom/android/systemui/SystemBars;->mContext:Landroid/content/Context;

    iput-object v4, v3, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

    iget-object v3, p0, Lcom/android/systemui/SystemBars;->mStatusBar:Lcom/android/systemui/SystemUI;

    iget-object v4, p0, Lcom/android/systemui/SystemBars;->mComponents:Ljava/util/Map;

    iput-object v4, v3, Lcom/android/systemui/SystemUI;->mComponents:Ljava/util/Map;

    iget-object v3, p0, Lcom/android/systemui/SystemBars;->mStatusBar:Lcom/android/systemui/SystemUI;

    invoke-virtual {v3}, Lcom/android/systemui/SystemUI;->start()V

    invoke-static {v5}, Landroid/os/Process;->setThreadPriority(I)V

    return-void

    :catch_0
    move-exception v2

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string/jumbo v4, "Error loading status bar component: "

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

    move-result-object v3

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

    move-result-object v3

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

    move-result-object v3

    invoke-direct {p0, v3, v2}, Lcom/android/systemui/SystemBars;->andLog(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/lang/RuntimeException;

    move-result-object v3

    throw v3

    :catch_1
    move-exception v2

    new-instance v3, Ljava/lang/StringBuilder;

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

    const-string/jumbo v4, "Error creating status bar component: "

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

    move-result-object v3

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

    move-result-object v3

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

    move-result-object v3

    invoke-direct {p0, v3, v2}, Lcom/android/systemui/SystemBars;->andLog(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/lang/RuntimeException;

    move-result-object v3

    throw v3
.end method

# virtual methods
.method public dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
    .locals 1

    iget-object v0, p0, Lcom/android/systemui/SystemBars;->mStatusBar:Lcom/android/systemui/SystemUI;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/android/systemui/SystemBars;->mStatusBar:Lcom/android/systemui/SystemUI;

    invoke-virtual {v0, p1, p2, p3}, Lcom/android/systemui/SystemUI;->dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V

    :cond_0
    return-void
.end method

.method public start()V
    .locals 0

    invoke-direct {p0}, Lcom/android/systemui/SystemBars;->createStatusBarFromConfig()V

    return-void
.end method


text:
@interface RoundedTabBar2ViewController : UIViewController <UITabBarDelegate, UITabBarControllerDelegate>
@property (retain, nonatomic) UITabBarController *tabBarController;

@end