public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$this->virtualFields['displayName'] = sprintf('CONCAT(%s.name_prefix, %s.name, %s.name_suffix)', $this->alias, $this->alias, $this->alias);
$this->virtualFields['employ_kbn_view'] = "SELECT kbn_name1 FROM mst_hanyo_kbn WHERE kbn_id LIKE '03' AND kbn_value LIKE LPAD(`TrnKyujinInfo`.`employ_kbn`, '3', '0')";
$this->virtualFields['licence_cd1_view'] = "SELECT licence_nm FROM mst_licence WHERE licence_cd LIKE LPAD(`TrnKyujinInfo`.`licence_cd1`, '3', '0')";
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Heron | |
module Heron | |
def self.calc(a, b, c) | |
s = (a + b + c) * 0.5 | |
Math.sqrt(s * (s - a) * (s - b) * (s - c)) | |
end | |
end | |
def dist(x1, y1, x2, y2) | |
Math.sqrt((x1 - x2)**2 + (y1 - y2)**2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$stmt = $db->prepare('SELECT * FROM `foo` WHERE `key` LIKE ?'); | |
$res = $stmt->execute(array($Req->get('key'))); | |
$slot = $res->fetchRow(MDB2_FETCHMODE_ASSOC); | |
$query = 'SELECT * FROM `foo` WHERE `key` LIKE ' . $db->quote($Req->get('key')); | |
$data = $db->queryRow($query, null, MDB2_FETCHMODE_ASSOC); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CsvImport Helper | |
* | |
* @author Toshimasa Oguni <tsmsogn@gmail.com> | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License | |
*/ | |
class CsvImportHelper { | |
private $__default = array('delimiter' => ',', 'enclosure' => '"', 'hasHeader' => true, 'headerMap' => ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
App::uses('Component', 'Controller'); | |
class CartComponent extends Component { | |
/** | |
* @var array | |
*/ | |
public $components = array('Session'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max_input_vars 100000 |
It's working
$this->User->set($this->request->data);
$this->User->invalidate('name', 'invalid name');
It's not working
$this->User->invalidate('name', 'invalid name');
$this->User->set($this->request->data);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=/usr/local/bin:$PATH:$HOME/.phpenv/bin | |
# Swapping from PHP53 to PHP54 | |
export PATH="$(brew --prefix josegonzalez/php/php53)/bin:$PATH" | |
# export PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH" | |
if which rbenv > /dev/null; then eval "$(rbenv init - zsh)"; fi | |
setopt nonomatch | |
# users generic .zshrc file for zsh(1) |
OlderNewer