postgresql.conf ãã©ãã«ãããããããªããªã£ã
ps auxw | grep postgres
ã§ã ããããã¼ãã¤ã
symfony1.4 ã§ç¾å¨ã® routing åãåå¾ãã
$this->getContext()->getRouting()->getCurrentRouteName();
doctrine join ã㦠sfDocetinePager 使ãã¨å¤§éã«SQLã¯ããã
$this->hasMany('ATable', array('local' => 'a_table_id', 'foreign' => 'id')); $q = $this->createQuery() ->select('self.id as id') ->from($this->_options['name'] . ' self') ->leftJoin('self.ATable at'); $pager = new sfDoctrinePager($this->_options['name'], $limit); $pager->setQuery($q); $pager->setPage($page); $pager->init();
ã£ã¦ãã£ãã¨ãã«ããã§åå¾ããã¬ã³ã¼ãã foreach ã§åãã¨1ã¬ã³ã¼ããã¨ã«1SQLçºè¡ãã¡ããã
$this->hasMany('ATable', array('local' => 'a_table_id', 'foreign' => 'id')); $q = $this->createQuery() ->select('self.id as id, at.id as at_id') ->from($this->_options['name'] . ' self') ->leftJoin('self.ATable at'); $pager = new sfDoctrinePager($this->_options['name'], $limit); $pager->setQuery($q); $pager->setPage($page); $pager->init();
ã®ããã«ãã¦joinãã¦ããã¼ãã«ã®ä¸»ãã¼ï¼ä»åã®å ´åã¯at.id)ãæ示çã«selectããã¨è§£æ±ºã
ãªãã§ãããã
jquery ã§è¤æ°ã® ajax å¦çãçµãã£ããããå¦çããããã¨ã
var requests = [ { url: 'http://...', settings: { ... } }, { url: 'http://...', settings: { ... } }, { url: 'http://...', settings: { ... } } ]; var dfds = []; for (var i =0; i < requests.length; i++) { req = requests[i]; dfd = $.ajax(req.url, req.settings); dfds.push(dfd); } $.when.apply($, dfds).done(function() { //å¦ç })
ã£ã¦ããã¨dedsã®å¦çããã¹ã¦çµãã£ããç¹å®ã®å¦çãè¡ããã¨ãã§ããã
jQuery.ajax ã®ã³ã¼ã«ãè¡ã£ã¦ãæ»ãå¤ã¨ãã¦å¾ããã jQuery.Deferred ã dfds é
åã«æ ¼ç´ãã¦
$.when.apply($, dfds).doneãã§å
¨ã¦ã® Ajax ã³ã¼ã«ã®çµäºãå¾
æ©ãã¦ãã
ãªãã»ã©ã
親ã¯ã©ã¹ã®ä¸ã§å°ã¯ã©ã¹ã§ãªã¼ãã¼ã©ã¤ãããé¢æ°ãå¤æ°ã使ãããã¨ã
class parent { const test = 1; public function test() { echo self::test } } class child extends parent { const test = 2; } $hoge = new child; $hoge->test();
ã£ã¦ãã㨠1 ãåºåããã¡ããã
ããã 2 ãåºãããã¨ãã¯
class parent { const test = 1; public function test() { echo constant(get_called_class().'::test') } } class child extends parent { const test = 2; } $hoge = new child; $hoge->test();
ã£ã¦ãã£ã¦ããã㨠2 ãåºãã
å®æ°ãªã constant 使ãã°ããã
é¢æ°ãªã call_user_func 使ãã°OKï¼call_user_func(get_called_class().'::sendMail', $test)ããã¦æãï¼ã
androidãç»åã®ä¸æ¸ããããã
ä¸æ¸ãããã¨ãã¯ä¸æ¦ã¡ããã¨ãã¼ã¿ãã¼ã¹ã®æ
å ±ãæ¶ããªãã¨
ã®ã£ã©ãªã¼ã®ãµã ãã¤ã«ã§å¤ãã®è¡¨ç¤ºãããããã¡ãã
File saveFile = new File(attachName); if(saveFile.exists()) { //ä¸æ¸ãä¿åã®å ´åã¯ãã¼ã¿ãã¼ã¹ã®æ å ±ããã£ããæ¶ã String[] proj = { MediaStore.Images.Media._ID, MediaStore.Images.Media.DATA, }; Cursor cursor = activity.managedQuery( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, proj, MediaStore.Images.Media.DATA + " = ?", new String[] { attachName }, null); if(cursor.getCount() != 0) { cursor.moveToFirst(); Uri deleteUri = ContentUris.appendId( MediaStore.Images.Media.EXTERNAL_CONTENT_URI.buildUpon(), cursor.getLong(cursor.getColumnIndex(MediaStore.Images.Media._ID))).build(); activity.getContentResolver().delete(deleteUri, null, null); } }
android ã§åæéä¿¡ãããã£ã
ç»åAãããã§ç»åBãããã§ãã®å¾å¦çCãå®è¡ãããã¦æªæ¦è¦éã
ãããªæããã®ããã°ã«æããã¾ããã
http://ameblo.jp/programmer-samurai/entry-11518431582.html
æéããã¨ãã«ããã°ã©ã ã¡ããã¨èªãã§ã¿ãã