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
ã¯ããã« ä½ã æ¨ã§ããéçºçµé¨ãç¡ãJavaScriptã触ã£ããã¨ããªãåã§ãããã©ããã¦ãAWS lambdaã触ã£ã¦ã¿ããã£ãã®ã§ãåè¦å «è¦ããªãããã£ã¦ã¿ã¾ããã ãã§ã«ããªããªæ´»ç¨ãã¦ããããã°è¨äºãããããåºã¦ãã¾ãããæ¬è¨äºã¯æ¬å½ã«ä½ãããããªãåããã¡ãã¡æ©ããã¦ããå 容ã§ãã®ã§ãæ·±ãã¨ããã¯æå¾ ããªãã§ãã ãããããã¦èè ã®ããã³ãããå¾ ã¡ãã¦ããã¾ãã AWS lambdaã®åºæ¬çãªä½¿ãæ¹ã¯ä»¥ä¸ã®è¨äºããåç §ãã ããã AWS Lambdaãå§ãã¦ã¿ã(1).ã¦ã¼ã¶ã¼ã¢ããªã±ã¼ã·ã§ã³ããã®ã¤ãã³ããæ±ã AWS Lambdaãå§ãã¦ã¿ã(2).Amazon S3ã¤ãã³ããæ±ã ãã£ã¦ã¿ã MBAã«node.jsãã¤ã³ã¹ãã¼ã«ãã ã¨ããããç°¡åãªæ§æãã§ãã¯ã ãã§ãæå ã§ããããã®ã§ãMBAã«brewã使ã£ã¦node.jsãã¤ã³ã¹ãã¼ã«ãã¾ãã $ brew insta
JavaScriptãã¡ã¤ã«ãã¹ã¯ãªããããéåæã§èªã¿è¾¼ããã¿ã¼ã³ã¯å¤ããã¨ãã話ãç®ã«ããã®ã¯ããåå¹´åã®ãã¨ã è¨ã£ãã®ã¯Ilya Grigorikãææ«ã®Google Japanã§ã®ã¤ãã³ããæåã®HTTP2Conferenceã«ããWebããã©ã¼ãã³ã¹çã®ãããã²ã¨ã§ããã Script-injected "async scripts" considered harmful - igvita.com 件ã®ãã¿ã¼ã³ã¯ãã¹ã¯ãªããã§åçã« script ãçæãã¦ãããã«èªã¿è¾¼ã¿ããJavaScriptãã¡ã¤ã«ãã¶ã£ããã§èªã¿è¾¼ãã¨ãããã®ã <script> var script = document.createElement('script'); script.src = "//somehost.com/awesome-widget.js"; document.getEleme
ã©ããã¯ããã¾ãã¦ãæ ªå¼ä¼ç¤¾ã¯ã¦ãªã®id:cho45ã§ããããããæ°åã«æ¸¡ããæä½ã®JavaScriptã®ã©ã¤ãã©ãªã§ããJSDeferredã®ç´¹ä»ã¨ãããã«é¢ä¿ããJavaScriptã«ãããéåæã®æè¡ã«é¢ãã¦è§£èª¬ããã¦ããã ãã¾ãã JavaSciptã«ãããéåæå¦ç éåæå¦çã¨ã¯ ã¾ãã¯ç¢ºèªç¨åº¦ã«ãéåæå¦çãã©ããããã®ãã解説ãã¦ããã¾ããå ã«ä¹±æ´ã«ã¾ã¨ãã¦ãã¾ãã¨ã以ä¸ã®äºæã大åãªã¨ããã§ãã éåæã¨ã¯ããã¨ã§ãã¨ããæå³ åæå¦çã¯ã³ã¼ãã®è¦ãç®é ã«å®è¡ãããï¼éåæã§ã¯ãããªããªã JavaScript ã®éåæå¦çã¯çµ¶å¯¾ã«åæå¦çã«ãããã¨ãã§ããªã JavaScriptã«ãããéåæå¦çãããã¤ãä¾ã«åºãã¨ã以ä¸ã®ãããªãã®ãæãããã¾ãã ãªã¹ã1 // XMLHttpRequest ã®ä¾ var req = new XMLHttpRequest(); re
ã¤ãã¼æ ªå¼ä¼ç¤¾ã¯ã2023å¹´10æ1æ¥ã«LINEã¤ãã¼æ ªå¼ä¼ç¤¾ã«ãªãã¾ãããLINEã¤ãã¼æ ªå¼ä¼ç¤¾ã®æ°ããããã°ã¯ãã¡ãã§ããLINEã¤ãã¼ Tech Blog Yahoo!ãããããã¼ãããã¯ã¼ã¯ã®ä¸é(@Hiraku)ã§ããJavaScriptã§ãµã³ãã«ã³ã¼ããæ¸ãæ©ä¼ããã£ãã®ã§ãã©ããªã¤ã³ã¿ã¼ãã§ã¼ã¹ã§æä¾ããã®ã便å©ãªã®ãèãã¦ã¿ã¾ãããããåé¡ã«ãªãã³ã¼ã«ããã¯ã®ãã¹ãåé¡ã«ã¤ãã¦ãä¸è¬çãªè©±ãã¾ã¨ãã¦ã¿ã¾ãã ãé¡ çªç¶ã§ããã次ã®ãããªå¦çãè¡ãå¿ è¦ãããã¨ãã¾ãã ã0ããåºåãã 1ç§å¾ 㤠ã1ããåºåãã 1ç§å¾ 㤠ã2ããåºåãã ãããããã°ã©ã ã§æ¸ãã¨ã©ããªãã§ããããï¼ ã·ã§ã«ã¹ã¯ãªããã®å ´åï¼åæï¼ ãã¨ãã°ã·ã§ã«ã¹ã¯ãªããã§ç´ ç´ã«æ¸ãã¨ã次ã®ããã«ãªãã¾ãã
JavaScript Promiseã®æ¬ã¨ããç¡æã§èªããé»åæ¸ç±ãæ¸ãã¾ããã ã¿ã¤ãã«ãã®ã¾ã¾ã§ãJavaScriptã®Promiseã«ã¤ãã¦æ¸ããæ¸ç±ã§ãã æ¸ç±ã®ç®ç ãã®æ¸ç±ãèªããã¨ã§å¦ã¹ãäºã¨ãã¦ã次ã®3ã¤ãç®æ¨ã«ãã¦æ¸ãã¾ããã Promiseã«ã¤ãã¦å¦ã³ããã¿ã¼ã³ããã¹ããæ±ããããã«ãªãäº Promiseã®åãä¸åãã«ã¤ãã¦å¦ã³ãä½ã§ãPromiseã§è§£æ±ºããã¹ãã§ã¯ãªãã¨ç¥ãäº ECMAScript6 Promiseã®åºæ¬ãããå¦ã³ãçºå±ããå½¢ãèªåã§å½¢æã§ããããã«ãªãäº Promiseã¯ã次ã®ECMAScriptã®è¨èªä»æ§ã¨ãã¦çå®ãé²ãããã¦ãã¦æ¢ã«å¤ãã®ãã©ã¦ã¶ã«å®è£ ããã¦ãã¾ãã Promiseã«ã¤ãã¦æ±ãæ¸ç±ã§ããããã®æ©è½ã¯jQuery.Deferred()ãAngularJSã®$qãBluebirdçã®é¡ä¼¼ã®æ©è½ãæ¢ã«ããããæ±ã£ããã¨ãããããããã¾
JavaScript (Node.js) ã§éçºããä¸ã§é¿ãã¦ã¯éããªã éåæå¦çãã³ã¼ã«ããã¯ã«ã¤ãã¦èãã¦ã¿ããã èªåãªãã®ãå§ãã®æ¹å¼ãæ¸ãã¦ã¿ãã ãããããªãã®ã試ããçµæã§ããã â»ãã®è¨äºã§ã®ãå§ãã®æ¹æ³ã¯ ES2015 (ES6) ã§å®è£ ããã generators (yield) ã®æè¡ã使ç¨ãã¦ãã¾ãã å®ã¯ã¾ã Babel(6to5) çãå©ç¨ããã Node.js v4ï½v8 ã§ãã å®è³ªçã«ä½¿ç¨ã§ããªãæè¡ã ã¨æãã¾ããæªããããã (æ©ãå ¨ã¦ã®ãã©ã¦ã¶ã«åºãæ®åããäºãç¥ã£ã¦ãã¾ã) ã¾ã ãã©ã¦ã¶ã§ã¯ç¬èªã©ã¤ãã©ãªã Promise (Deferred) çã使ã£ã¦ãã¾ãã â»2015/10/15: è¨äºã®å 容ã npm aa (async-await) ã«å¯¾å¿ããã¾ããã â»2015/04/19: è¨äºã®å 容ã npm co@4 ã«å¯¾å¿ããã¾ããã â»20
Hackers Barã£ã¦ãªã«ï¼ Hackers Bar å æ¬æ¨ã«ããã«ã¼ãããã¦ãªãããããã¼ãèªçãã¾ãã ãHackers Barãã¯ãããã«ã¼ã®ããã°ã©ãã³ã°ã©ã¤ãã ãã¸ãã¹ã¡ã¤ãã³ã°ã楽ãã空éã§ãã ãããããã ããã¾ãã§å¶æ¥ãã¦ãã®ï¼ï¼ã£ã¦åä¿¡åçã§è¡ã£ã¦ã¿ããã ã¾ãã§å¶æ¥ãã¦ãï½ãåå¨ãã¦ãï½ï½ï½ï½ ãåºèªä½ã®ããããã¬ãããã¨ãã¼ã«ãè¼ã£ãã¿ãã ã«ã¯ãã«åãããã«ã¼ã¹ã¯ãªã¼ã³ããã¹ãã²ããã£ãã£ã¦ä¸åãããã§ããï¼ãå æ¬æ¨ã«ã§ãããHackers Barãè¡ã£ã¦ãã - ãã¨ãã¼ ãã£ã¦ããã£ãã©ã¤ãã³ã¼ãã£ã³ã° å¼ããããã´ã«ã½ãã¡ã¼ããããã£ã¦è¨ã£ã¦ã¦ã ãã£ãã¼ã£ã¦ããããªãã ãã©ãâ¢äººæãã§ã¾ããã«ãã£ã½ãï¼ ãé¨å±ã®ã¥ãã ãããã¶ã£ã½ããã ãã©ã éã°ãã¦ããæããã³ã·ã§ã³ã®ã¨ã¬ãã¼ã¿ã¼ã«ã¡ããã¨å ¥ãã®ããªï¼ â¦ã£ã¦ãã¨ã§ããããè¨ç®ãããã¦ï¼(^o^)ï¼¼
ãHackerNews翻訳ãã¦ã¿ããã POSTD (ãã¹ãã»ãã£ã¼) ã¨ãã¦ãªãã¥ã¼ã¢ã«ãã¾ããï¼ ãã®è¨äºã¯ããã§ãå ¬éããã¦ãã¾ãã Original article: Managing Node.js Callback Hell with Promises, Generators and Other Approaches by Marc Harter ä¸ã®ãããªã³ã¼ããã親ãã¿ãããã¦ãã³ã¼ã«ããã¯å°çãã¨ããæ»ã®ãã©ããããã¨ãå¼ã°ãã¦ããã®ã¯ãåãã§ãããã doAsync1(function () { doAsync2(function () { doAsync3(function () { doAsync4(function () { }) }) }) ãã®ç¶æ ãã³ã¼ã«ããã¯å°çãã©ããã¯ãæè¦ã®åãããã¨ããã§ãããããã¹ãããããæ·±ãã¦ãå ¨ãåé¡ããªãã³ã¼ããããããã§
ã¯ããã« ãã®è¨äºã¯ã JavaScript/ES6 promisesã«ã¤ãã¦ãç解ããããã«èªãã æ¹ãããã¨æãããè¨äºãã¹ã©ã¤ãçãç´¹ä»ãã¦ãã¾ãã PromisesãDeferredã¨ãã£ãè¨èãéåæå¦çã®è©±ãªã©ã§èããäºãããããããã¾ãããã ç¾å¨Promisesã¯æ¬¡ã®ECMAScriptã®è¨èªä»æ§ã¨ãã¦çå®ãé²ãããã¦ãã¾ãã ECMAScript Language Specification ECMA-262 6th Edition â DRAFT domenic/promises-unwrapping ã¾ã ES6ã¯çå®æ®µéã§ãããæ¢ã«Promisesã«ã¤ãã¦ã¯polyfillã¨ãã¦å©ç¨ã§ããã©ã¤ãã©ãªçããããã¾ãä»ã®ã©ã¤ãã©ãªå ã§ãjQuery.Deferred()ãAngularã®$qçé¡ä¼¼ããå®è£ ãåå¨ãã¾ãã ãã®ãããGeneratorsçã«æ¯ã¹ãã¨ä»ãã使ãã
ãã®ããã¹ã㯠JavaScript ã®ã³ã¼ã«ããã¯å°çã«ç²ããã²ã¨ã®ããã®ã³ã¼ã«ããã¯é§éè¡æåæ¸ã§ãã対象èªè 㯠JavaScriptéå段ãããã®äººã§ãããã®ããã¹ããèªãã¨ã以ä¸ã®ããããã®æ段ã«ãããéåæå¦çå¶å¾¡ã®ä»çµã¿ãå©ç¹ããã³æ¬ ç¹ããããããã«ãªãããããã¾ããã ã³ã¼ã«ããã¯å°ç jQuery.Deferred async.js Concurrent.Thread generators co fibers Web Workers (â»ãªãããé²æã®å·¨äººãã®ä¸é¨ãã¿ãã¬ãå«ã¾ããã®ã§æ³¨æãã¦ãã ãã) ããã¯ãä½æ 人ã¯ã³ã¼ã«ããã¯ããã®ããã¨ãã話ã§ããããï¼ éåæå¦çã£ã¦é¢åã§ããããJavaScriptã§ã¯ãããã ã³ã¼ã«ããã¯å°ç ã¨ãããã¤ã«ãã°ãã°é¥ããã¡ã§ãããã¨ãã°ãAjax ã§ãµãã¤ã®ãã¡ã¤ã« hoge.txt 㨠piyo.txt ãæã£ã¦ãã¦ãããã
é£è¼ãWebãµã¤ãã»ã¢ããªé«éåãã¯ããã¯å¾¹åºè§£èª¬ã第2åã¯ãJavaScriptã®é«éåã«ã¤ãã¦ãã¾ãã¯åç·¨ãå¾ç·¨ã«æ¸¡ã£ã¦ã¦ã¼ã¶ã¼ã®ä½æé度ãåä¸ãããããã®æ¹æ³ãç´¹ä»ãã¾ããJavaScriptã®åæã»éåæã®ä»çµã¿ãscriptè¦ç´ ã®asyncå±æ§ãdeferå±æ§ã«ã¤ãã¦è©³ãã解説ãã¾ãã ä»åããè¤æ°åã«åãã¦ãJavaScriptã®é«éåããã¼ãã«è§£èª¬ãã¦ããã¾ããã¾ãã¯ãã¦ã¼ã¶ã¼ã®ä½æé度ãé«ããããã®JavaScriptãã¥ã¼ãã³ã°ã¨ãããã¨ã§ãåç´ãªJavaScriptã®æ§æã«ããã¹ãã¼ããæ¯è¼ãããããªãã®ã§ã¯ãªãã主ã«ã¦ã¼ã¶ã¼è¦ç¹ããã®é«éåã主ç¼ã«è§£èª¬ãã¾ãããã®ä¸ã§ãåæã»éåæã¨ãã£ãJavaScriptã®ä»çµã¿ãscriptè¦ç´ ã®asyncå±æ§ãdeferå±æ§ãªã©ã«ã¤ãã¦ã触ãã¦ããã¾ãã ã¦ã¼ã¶ã¼ã®ä½æé度ãåä¸ããã ä¸æ¦ã«JavaScriptã®é«éåã¨ãã£
åºåãã½ã¼ã·ã£ã«ç³»ã®ãµã¼ããã¼ãã£ã¼è£½ããã°ãã¼ããå¼µããããã ãã©ããµã¤ãã®è¡¨ç¤ºé度ãé ããªãã®ã£ã¦ææ ¢ãªãã¾ããããããããã£ãããã°ãã¼ãã®å¤ãã JavaScript ã§ä½ããã¦ãã¾ããèªãµã¼ãã¼ã«è¨ç½®ããã¹ã¯ãªãããªãã¾ã æã®æã¡ããã¯ããããæ¬ãµã¤ãã§ã JavaScript èªã¿è¾¼ã¿ãé«éåããããã®éåæåãã¿ãå¹¾ã¤ãæ±ã£ã¦ãã¾ãããä¾ãã° Google Analitics ã®éåæãã©ããã³ã°ã¹ãããã ã LABjsãHEAD JS ãªã©ã®éåæãã¼ãã¼ãæåãªã¨ããã§ãããã ã¨ãããå°ã£ããã¨ã«ããããã£ããµã¼ããã¼ãã£è£½ã¹ã¯ãªããã« document.write ã使ããã¦ããã¨ãGoogle Analitics ã®ãããªãã¯ããã¯ãéåæãã¼ãã¼ã§ã¯ãã»ã¨ãã©ã®å ´åã§ãã¼ã¸ãç½ç´ã¨ãªã£ã¦ãã¾ã使ãã¾ãããTwitter ã Facebook ãªã©è¶ æåã©ããã¯æ¢
node.js ã代表ã¨ãã JavaScript ãç¨ããéåæããã°ã©ãã³ã°ç°å¢ã«ããã¦ã¯ãã³ã¼ãã£ã³ã°ãã¿ã¼ã³ã®ãã¹ããã©ã¯ãã£ã¹ãå ±æããã¦ããããçµæã¨ãã¦å質ã®ä½ãã³ã¼ããå¤ããªãã¨ããåé¡ãããããã«æãã¾ããããã§ãç¹ã«ã¨ã©ã¼å¦çãã©ãæ¸ãã¹ãããæ¢åã®ã©ã¤ãã©ãªã使ãæ¹æ³ãç´¹ä»ãã¦ã¿ããã¨ã«ãã¾ããã ãããªãã§ããããã¡ã¤ã«ã®æåæ°ãè¿ãé¢æ°ãä½ããã¨ãèãã¦ã¿ã¾ããJava ã ã¨ä»¥ä¸ã®ãããªæãã«ãªãã§ãããããcountChars ã¡ã½ããã«æ³¨ç®ããã¨ãã¨ã©ã¼ãä¾å¤ã¨ãã¦æ±ã£ã¦ãã¦ãã¢ã¸ã¥ã©ã¼ãã¤ç°¡æ½ã«ãªã£ã¦ãããã¨ããããã¾ãã class FileCounter { static long countChars(String filename) throws IOException { FileInputStream is = new FileInputStre
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}