You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
2011å¹´01æ31æ¥22:30 ã«ãã´ãªCultureLightweight Languages perl - ããæªã ã«ç®ãé¢ããªãåã¤ããããã¯ãã ä¸ã¤ã®çç± ãã¯ããé¢ãã¾ãã£ã¦ããã®ã§ã åçå¸æãã©ã¯ããããã以å¤ã§ã@dankogai ããã¨ãï¼ ããä»ããã¦Perlãåãçç±ã¨ããã®ãå人çã«ã¯æãæµ®ãã°ãªããçç²ã®Perl使ããªããã£ã¨æµæ¢ãªè§£çãç¨æãã¦ãããã¨æããã ããã°ã©ãã³ã°è¨èªäººæ°TOP10ã®ç°¡æ解説 http://ht.ly/3NaTkless than a minute ago via HootSuiteä½è¤ æ²»ç· HalSato ããã°ã©ãã³ã°è¨èªäººæ°TOP10ã®ç°¡æ解説ç¨éçã«PythonãRubyã¨è¢«ãã®ã§ãä»ããã¦Perlãåãçç±ã¨ããã®ãå人çã«ã¯æãæµ®ãã°ãªããçç²ã®Perl使ããªããã£ã¨æµæ¢ãªè§£çãç¨æãã¦ãããã¨æãã ãã¿ ããã°ã©ã
JavaScript ã§ã®å¤§è¦æ¨¡éçºã§ã¯ ã·ã³ãã«ã®è¡çªãé常ã«å¤§ããªåé¡ã¨ãªãããã®ä»£è¡¨ä¾ã Firefox ã®æ¡å¼µæ©è½å ã®ã·ã³ãã«ã§ããã ã§ããããªè¨è¿°ã«ã¼ã«ã¯ã©ãã ãã window['http://d.hatena.ne.jp/amachang/']={}; // URI (function(){with(this){ // ããã«ã³ã¼ããæ¸ã }}).apply(window['http://d.hatena.ne.jp/amachang/']); // URI ä¾ãã° window['http://d.hatena.ne.jp/amachang/']={}; (function(){with(this){ var hoge = 'hoge'; // ãã®ã¹ã³ã¼ãå ã§å ±æããã·ã³ãã« this.fuga = 'fuga'; // åãåå空éã§å ±æããã·ã³ãã« window.p
ããã°ã©ãã«åã£ã¦éè¦ãªè½åã¨ãããæ°è³ªã¨ãã¦ãä¸äºç ã¨ããã®ãããããããªãããªã¼ã¨ããµã¨æã£ãã®ã ã£ãã ãªããã¡ãã£ã¨ãããã¨ãéæããæã«ãããããªãã¦ãã£ããªã¬ããã¼ï¼ï¼ãã°ããªã¬æ°ä¸çã®ç¥ã ï¼ï¼ï¼ãã¿ãããªãã¨ãæã£ããã¨ããã人ã¯çµæ§ããã¨æãããã§ããã¾ãæ°å¹´ãä¸å¹´ãä¸ã¶æãæã«ã¯ä¸æ¥ã§å®ã¯ãããªã«ãããããã¨ã§ããªãã£ããã¨ã«æ°ä»ãã¦ãæ¥ããããæãããããããããã§ããã ããèªåã®éå»ã®æ¥è¨ã¨ãè¦ãã®ã¯é¢ç½ãããã§ãã ã§ã¾ããã®æ°è³ªã£ã¦ãå¾ã§èããã¨æ¥ãããããã¨ã ã£ãããããã ãã©ãããããã®åã³ãå³ãã£ãç¬éã¨ããã®ã¯ãªããªãå¿«æãªããã§ãããã°ã©ãã®äººã ã¨çµæ§ããããçµé¨ããã人ã¯å¤ãããããªããã¨æãã¾ããããã°ã©ããããªãã¦ãç 究è·ã¨ãã§ãçµæ§ããããã§ããã ã§ãããããæ°è³ªãç¡ã人ã£ã¦ãããã£ãã Hello, world! ã£ã¦åºããããã£ãããããªã¹
Base64 Encoding for Images. ç»åèªä½ãBase64ã¨ã³ã³ã¼ããã¦HTMLå ã«åãè¾¼ãã§é«éåããPHPã³ã¼ãä¾ã Googleãã¤ã³ã¹ã¿ã³ããã¬ãã¥ã¼ãç»åæ¤ç´¢ã§å°å ¥ãã¦ãã®èªã¿è¾¼ã¿é度ã«é©ããæ¹ãå¤ãããããã¾ããã ãã®ææ³ãPHPã§å®ç¾ããã³ã¼ããæ²è¼ããã¦ãã¾ããã®ã§ãç´¹ä»ã PHPã§ããã«ã¯ãããªã«é£ããããã§ã¯ãªãããã <?php $img_src = "image/sample.png"; // ç»åãã¡ã¤ã«ã®æå® $imgbinary = fread(fopen($img_src, "r"), filesize($img_src)); // ãã¤ããªãã¼ã¿ãèªã¿è¾¼ã¿ $img_str = base64_encode($imgbinary); // base64ã¨ã³ã³ã¼ã echo '<img src="data:image/png;base6
æè¿ã¯ã¢ã¼ããã¯ãã¨ããå½¹å²ã§å®¢å ã«å¸¸é§ãããã¬ã¼ã ã¯ã¼ã¯ã®é¸å®ãããããäºåã«å ±éé¨åãè¨è¨ãããããå½¹å²ãæ ãä»äºãå¼ãåãããã¨ãçµæ§ããã¾ããããã§éããã客æ§ã®ããã¼ã¸ã£ã¼ããªãã¸ã§ã¯ãæåéçºã®çµé¨ãååã«ããæ¹ã ã¨ãIDEãªã©ã®éçºç°å¢ãã¤ã³ã¿ã¼ãããæ¥ç¶ç°å¢ãå½ç¶ã®ããã«ç¨æãã¦ãããã®ã§æåããä»äºãã¹ã ã¼ãºã«ã§ããã®ã§ãããããã§ãªãã¨MS Officeããå ¥ã£ã¦ããªããã¼ã¹ããã¯ã®ãã¼ãPCã渡ããã¦ãè¦ä»¶å®ç¾©ãã§ã¼ãºã®æéä¸ããã¬ã¼ã ã¯ã¼ã¯ã®è¨è¨ããé¡ããã¾ãã¨ããç§ã¨ãã¦ã¯ã¡ãã£ã¨é¦ããããã¦ãã¾ããããªå°ã£ããã¨ãè¨ããã¦ãã¾ãå ´åãããã¾ããéçºãã§ã¼ãºãå§ã¾ãåå¹´å¾ã¾ã§ã¯ã³ã¼ãã£ã³ã°ã¯åºæ¬çã«ä¸è¦ã¨ããèãæ¹ã§ããã¢ããªã±ã¼ã·ã§ã³ã®ã¢ã¼ããã¯ãã¨ããå½¹å²ã§ã¯å°ãªãã¨ãã³ã¼ãã£ã³ã°è¦ç´ãèãããããã¼ã«ããã¬ã¼ã ã¯ã¼ã¯ã®é¸å®ããããããå¿ è¦ãããã¾ãããããã¸
sw 789 สลà¹à¸à¸ à¹à¸§à¹à¸à¸à¸à¸±à¸ à¸à¸µà¹ à¹à¸à¸¥à¸´à¸à¹à¸à¸¥à¸´à¸à¸à¸±à¸à¸à¸²à¸£à¹à¸à¸´à¸¡à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸µà¹à¸à¸¥à¸à¸à¸ ัยà¹à¸¥à¸°à¹à¸à¹à¸à¹à¸à¸à¸¥à¸±à¸à¸©à¸à¹à¸à¸µà¹à¸ªà¸¸à¸à¹à¸à¹à¸à¸¢! à¸à¸³à¹à¸£à¹à¸à¹à¸à¸à¸ à¸à¸¸à¸à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸¥à¹à¸à¸à¸²à¸£à¸à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¹à¸à¹à¸à¸¢à¹à¸²à¸à¸à¸¥à¸à¸à¸ ัยà¹à¸¥à¸°à¸¡à¸±à¹à¸à¹à¸à¸à¸±à¸à¹à¸§à¹à¸à¹à¸à¸à¹à¹à¸£à¸²à¸à¸µà¹à¹à¸à¸·à¹à¸à¸à¸·à¸à¹à¸à¹à¸à¸¥à¸à¸à¹à¸§à¸¥à¸² à¹à¸à¸·à¹à¸ à¹à¸¥à¹à¸à¹à¸à¸¡à¸à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸µà¹à¹à¸«à¹à¸à¸§à¸²à¸¡à¸ªà¸à¸¸à¸à¹à¸¥à¸°à¸à¸§à¸²à¸¡à¸ªà¸à¸¸à¸à¹à¸à¹à¸à¸¸à¸à¹à¸§à¸¥à¸²! à¹à¸¡à¸·à¹à¸à¸¡à¸²à¹à¸¥à¹à¸à¸à¸²à¸£à¸à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸±à¸à¹à¸£à¸² à¸à¸¸à¸à¸à¸°à¹à¸à¹à¸£à¸±à¸à¸à¸£à¸°à¸ªà¸à¸à¸²à¸£à¸à¹à¸à¸µà¹à¹à¸¡à¹à¹à¸«à¸¡à¸·à¸à¸à¹à¸à¸£à¸à¸¸à¸à¸à¸£à¸±à¹à¸! sw 789 สลà¹à¸à¸ ยัà¸à¸¡à¸µ ระà¸à¸à¹à¸à¸´à¸¡à¸à¸±à¸à¸à¸à¸à¹à¸¥à¸à¹à¸à¸±à¸à¹à¸ à¸à¸¥à¸à¸à¸ ัย à¹à¸¥à¸°à¸¡à¸µà¸£à¸°à¸à¸à¸à¸²à¸à¸à¸à¸à¸
Javaå¤æ ææ³æéãã¹ã¿ã¼ - ããã°ã©ãã¼ã®è³ã¿ãããªã¹ãã¯ãã JavaScriptã®å¤æ ææ³ã»ææ³ä¸è¦§ã§ããããã¾ã使ããªããã©ãç¥ã£ã¦ãã¨XSSã¨ãæ»æãããã®ã«WAFã«å¦¨å®³ããããªã©ãããããå¶ç´ãããã¨ããå ´åã«ä¾¿å©ã æååã®çæ å¼ç¨ç¬¦ã使ããã«ããã£ã¨æååãä½ããfromCharCode ã¨ã使ã£ã¦ããããã©ããã©ãããã®ã§ãæ£è¦è¡¨ç¾ãE4Xãå©ç¨ã alert( /string/.source ); alert( <>string</> ) 空ç½æåã使ããè¨è¿° æèä¸ãã¹ãã¼ã¹ãæ¸ãããããã©ããããå¶ç´ããã£ã¦æ¸ããªãå ´åã«ã¯ã³ã¡ã³ãã§ä»£æ¿ãå®è¡ããã³ã¼ããä½ãä¸ãã¦evalãã¦ããããã©å¤§è¢è£ãªã®ã§ã var/**/x=1; */ ãå«ãã³ã¼ããããã¯ãã³ã¡ã³ãã¢ã¦ã ã³ã¼ãã®å¡ããã³ã¡ã³ãã¢ã¦ããããã¨æã£ã¦ /* */ ã§å²ãã¨ãã³ã¼ãå ã« string.
ã¢ã¡ãªã«æéã®æ¼ããã«Twitterä¸ãä¸ã¤ã®ãã¥ã¼ã¹ã§åãå°½ãããã¾ããã PHPãC++ã«å¤æãã¦é«éåããæè¡ãFacebookãå ¬éããã¨ãããã®ã§ããä¸çä¸ã®PHPããã«ã¼ã注ç®ããèå³æ·±ããªãªã¼ã¹ã¨ããäºã§ã¡ãã£ã¨é·ãã§ããããªãªã¼ã¹ãã¼ãã®å訳ãè¡ãã¾ããã åæ http://developers.facebook.com/news.php?blog=1&story=358 Facebookã«ããã¦éè¦ãªãã¨ã®ã²ã¨ã¤ãåä½ã®éãã§ããéå»6å¹´éã«ããã£ã¦ãPHPãæä¾ããé«éãªéçºãã¼ã¹ã«ãã£ã¦å¤ããæãéãã¦ãã¾ãããããã°ã©ãã³ã°è¨èªã¨ãã¦ã¿ãã¨ãPHPã¯ã·ã³ãã«ã§ããç°¡åã«ç¿å¾ããç°¡åã«æ¸ããç°¡åã«èªã¿ãç°¡åã«ãããã°ããäºãã§ãã¾ããæã ã¯ä»ã®è¨èªãããæ©ãã¨ã³ã¸ãã¢ãç²å¾ããããã«ãã£ã¦ããæ©ãã¤ããã¼ã·ã§ã³ããããã¨ãã§ãã¾ãã ä»æ¥ãç§ã¯2å¹´ã«æ¸¡ã£ã¦ä½æ¥ãã¦
å¤ãè¿ãã®ã«å¤±æãããããããªãå¦çãæ±ãå ´é¢ã¨ããã®ã¯å¤ãã ä¾ãã°ãããã¡ã¤ã«ã®ä¸èº«ãåå¾ããå¦çã«ã¤ãã¦èããã¨ããã¡ã¤ã«ãåå¨ããå ´åã¯ãã®ä¸èº«ãåå¾ãã¦è¿ããã¨ãã§ããããããã§ãªãå ´åã¯ä¸èº«ãåå¾ããã®ã«å½ç¶å¤±æããã PHPã«äºãç¨æããã¦ããfile_get_contentsã¯ã¾ãã«ããã ãããã®é¢æ°ã¯å¦çã«å¤±æããã¨falseãè¿ãã ããã§ã¯å¥ã«ããä¸ã¤ä¼¼ãé¢æ°ãä½ã£ã¦ã¿ãã <?php function my_file_get_contents($path) { $buf = file_get_contents($path); return $buf === false ? array() : array($buf); } ãã®my_file_get_contentsé¢æ°ã¯ããã¡ã¤ã«ã®ä¸èº«ãæåããå ´åã¯çµæãæã£ãé åãè¿ããããã§ãªããã°ç©ºã®é åãè¿ãã ãããã
Perlã¨Rubyã®ææ³ä¸è¦§ãã¨ã¦ãè¯ãã¾ã¨ã¾ã£ã¦ããã®ã§ã便ä¹ãã¦PHPã§ããã£ã¦ã¿ã¾ããã Perlåºç¤ææ³æéãã¹ã¿ã¼ â Perlå ¥éããµã³ãã«ã³ã¼ãã«ããPerlå ¥éã Route 477 â Rubyåºç¤ææ³æéãã¹ã¿ã¼ ä»ã®è¨èªãããç¨åº¦ç¥ã£ã¦ãã人ã¯ãããèªãã°PHPã®ææ³ãä½ã¨ãªãç解ã§ããã¨æãã¾ãã ééããä¸è¶³çã ããã°æãã¦ä¸ããm(_ _)m ãã¼ã¸ã§ã³ PHP5.3ç³»ããªãªã¼ã¹ããã¦ãã¾ãããããã§ã¯PHP5.2ç³»ã対象ã¨ãã¦ãã¾ãã 1.åºç¤ ã³ã¼ãããã㯠PHPã³ã¼ãã¯ã<?phpãã¨ããéå§ã¿ã°ããå§ã¾ãã¾ããçµäºã¿ã°ã¯ã?>ãã§ããHTMLã«PHPã³ã¼ããåããéã¯çµäºã¿ã°ã使ãã¾ãããã©ã¤ãã©ãªã®ããã«PHPã³ã¼ãã®ã¿ãè¨è¿°ããéã¯çµäºã¿ã°ãçããã¨ãæ £ä¾ã¨ãªã£ã¦ãã¾ãã çµäºã¿ã°ãçãçç±ã«ã¤ã㦠id:Kiske ããã«è§£èª¬é ãã¦ãã¾ããããã
ããæ°å¹´Rubyã使ã£ã¦ãã¾ãã Rubyããæé«ã®ã¹ã¯ãªããè¨èªã ã¨æã£ã¦ãã¾ããã Rubyã®ååã®ç±æ¥ãããããPerl (pearlã¯6æã®èªçç³ãruby ã¯7æã®èªçç³Â ) ã¨ããæå³ãæèãã¦ã®ãã®ã§ãã ãã®ãããRubyãçéã«ãªã£ãä»ãPerlã使ã£ã¦ãã人ã¯ãRubyã«ä¹ãé ãã¦ãPerlã®ç¥èã«ãã°ããã¦ããã ããããæã£ã¦ãã¾ããã ã§ãããã®æãã¯ééã£ã¦ãã¾ããã Perlã«ã¯Perlã®ããããããRubyã«ãã£ãã¦å£ã£ã¦ããªããã¨æè¿ãã確信ããã«ãããã¾ããã ããã§æºæã®æå³ãããã¦ãRubyã«æ¯ã¹ãPerlã®ãããè¿°ã¹ããã¨æãã¾ãã ï¼ï¼åç §åæ°ã«ãããªãã¸ã§ã¯ãç ´æ£ã®ãããç ´æ£æãæ確ã§ããã perlã¯å¯¾è±¡ã®ãªãã¸ã§ã¯ãã®ãªãã¡ã¬ã³ã¹ããªããªã£ãæã«ç ´æ£ãå®è¡ãããã®ã«å¯¾ããrubyã¯GC(ã¬ãã¼ã¸ã³ã¬ã¯ã¿ã¼ï¼ã«ããç ´æ£ã®ãããç ´æ£ããã¤è¡ããã
Getting Started Introduction A simple tutorial Language Reference Basic syntax Types Variables Constants Expressions Operators Control Structures Functions Classes and Objects Namespaces Enumerations Errors Exceptions Fibers Generators Attributes References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Predefined Attributes Context options and parameters Su
é±æ«æçããã¦ãã¦è¶³ãåã£ã¦ãã¾ãã¾ãããagoã§ãã 以åPerlã¯æ¸ãã¦ãããã§ããããã®é 以ä¸ã®è¨äºãèªãã§é常ã«æéãåãã¾ããã Perlããã°ã©ãã®ã¬ãã«10 - Perlããã°ã©ãã³ã°æå½ç æ£ãã - naoyaã®ã¯ã¦ãªãã¤ã¢ãªã¼ å½æãã¾ãã³ãã¥ããã£ã¨ã®ã¤ãããããªãã£ãã®ã§ããèªåã®ã¹ãã«ã®çµ¶å¯¾ä½ç½®ããã次ã®ã¬ãã«ã¸è¡ãããã«å¿ è¦ãªãã®ããç¥ããã¨ã§é常ã«å®å¿æãæããè¨æ¶ãããã¾ãã ãã¾ç¢ºèªããã¨ããããJavaScriptããã°ã©ãã®ã¬ãã«10ãã¯ãªããããªã®ã§æ¸ãã¦ã¿ã¾ããã Perlããã°ã©ã Schemeããã°ã©ã Rubyããã°ã©ã ï¼æ¬å®¶ã«ç´æ¥ãªã³ã¯ã§ããURLãç¡ãã£ããããåç §ãã¼ã¸ã¸ãªã³ã¯ãã¦ãã¾ãï¼ haskellããã°ã©ã å è½ããCããã°ã©ã HTMLç¥èã¬ãã« ããã°ã©ãã¬ãã« ä¼æ¥æ³å JavaScriptã®æ¥åã¹ãã«ã¬ãã«ãå¤å¥è¡¨ãï¼ï¼
JavaScriptããã©ã¼ãã³ã¹æ¹å(3) ãªãã¸ã§ã¯ããé åãã©ããå¤å®ããæ¹æ³ ã調æ»å¯¾è±¡ã ãã©ã¦ã¶ï¼ IEï¼Firefox æ¯è¼å¯¾è±¡JavaScriptã³ã¼ãï¼ (e instanceof Array) vs (e.length > 1) æ¯è¼çµæï¼ (e instanceof Array)ã®æ¹ãæ°åæ©ãã£ããIEã¯ç´1.5åï¼Firefoxã¯ç´5åã ãSample Codeã (Abbreviation) if (e instanceof Array) { // fast. IE 1.5 times. FF 5 times. } (Abbreviation) if (e.length > 1) { // slow } (Abbreviation)
19.1 State ãã¿ã¼ã³ã¨ã¯ 第19ç« ã§ã¯ State ãã¿ã¼ã³ãå¦ã³ã¾ããState ã¨ã¯ãè±èªã§ãç¶æ ããæå³ããåèªã§ãã ãªãã¸ã§ã¯ãæåè¨è¨ã§ã¯ãã¢ããã¯ã©ã¹ã¨ãã¦è¡¨ç¾ãããã¨ãå¤ãããã¾ããState ãã¿ã¼ã³ã¨ã¯ã ã¢ãã§ã¯ãªãããç¶æ ããã¯ã©ã¹ã¨ãã¦è¡¨ç¾ãããã¿ã¼ã³ã§ãã ç¶æ ã«ãã£ã¦ãåä½ã®ãã¿ã¼ã³ãå¤ãããã¨ãããããã¾ãã ä¾ãã°ããæ©å«ã®ããç¶æ ããæ©å«ãæªãç¶æ ãã®2ã¤ã®ç¶æ ããããæ¯ããã«ããã¤ãé ¼ã¿ãã¨ããããã¨ãèãã¾ãã æ©å«ã®ããç¶æ ã®ãæ¯ããã«ããå°é£ãé æ´ããããã¤é æ´ããªã©ã®ãé¡ããããå ´åã ãã¯ãã¯ããã¨ãã£ã¦ãå°é£ãããããããããã¤ãåºãã¦ããããããã§ãããã ããããæ©å«ã®æªãç¶æ ã®ãæ¯ããã«ãããã®ãé¡ãããã¦ãèãå ¥ãã¦ãããªãããããã¾ããã ãæ¯ããã¯ç¶æ ã«ãã£ã¦ãæ¯ãèããå¤ããããã§ãã State ãã¿ã¼ã³ã¨ã¯ããã®
PHP_CodeSnifferã®ã½ã¼ã¹ãè¦ã¦ãã¨ãã«æ°ã¥ããã®ã§ãããPHPã§$a{N}ã¨ãã表ç¾ãã§ãããã¨ãåãã¦ç¥ãã¾ããã < ?php $a = "abc"; echo $a{0} . "\n"; echo $a{1} . "\n"; echo $a{2} . "\n"; ?> $ php -f test.php a b c substr($a, N, 1)ã¨åãã§ãããï¼ããã¥ã¢ã«è¦ããè¼ã£ã¦ã¾ãããããï¼ ã¡ãªã¿ã«æ¥æ¬èªã¯ã°ã£ã¡ãåãã¾ãã < ?php $a = "ããã"; echo $a{0} . "\n"; echo $a{1} . "\n"; echo $a{2} . "\n"; ?> $ php -f test.php ã ã ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}