ãã®æ¸ç±ã¯Creative Commons Attribution-NonCommercialã® ã©ã¤ã»ã³ã¹ ã§å ¬éããã¦ãã¾ãã ã¾ããPDFã¨ãã¦ã¬ã³ããªã³ã°ãããã¼ã¸ã§ã³ã¯ä»¥ä¸ãããã¦ã³ãã¼ããããã¨ãã§ãã¾ãã
æè¿nodejsã§éãã§ãã®ã§ãããnodejsåä½ã ã¨é¢åãªäºãå¤ãã®ã§ã©ã¤ãã©ãªãè²ã 調ã¹ã¦ã¿ã¾ãããä»åã¯ãã®ã¾ã¨ãã§ãã ããè¦ããã® ä¸éã§ãã使ããã¦ããã§ãåºæ¬çãªãã®ã並ã¹ã¦ã¿ã¾ãã node-dev ã¹ã¯ãªãããæ´æ°ãããããèªåçã«åèµ·åãã¦ãããã©ã¤ãã©ãªã§ãã node-inspector chromeã¨ããnodejsã®ãããã¬ã¨ãã¦å©ç¨å¯è½ã«ããã©ã¤ãã©ãªã§ãã express ä¸éã§ããè¦ããã¬ã¼ã ã¯ã¼ã¯ã§ãã便å©ãWebãããªãå¿ é ãªå°è±¡ã§ãã socket.io websocketã§éã¶ãªãããã§ããã connect expressãå©ç¨ãã¦ããWebãã¬ã¼ã ã¯ã¼ã¯ããµã¼ãã¨ãä½ãæ©è½ãããã¿ããã§ãã ã³ã¼ã«ããã¯ãä½ã¨ãããç³» nodeã¯ã·ã³ã°ã«ã¹ã¬ããã«ãããããããã«ãã¹ã¬ããã§åä½ãã¦ãããã®ããã«è¦ãããããé次å¦çãããã¨ãã¦ãæ³å®ã¨éãå
Linuxã¨Windowsã«node.jsãã¤ã³ã¹ãã¼ã«ãã¦ã¿ãã®ã§ãå°ã使ã£ã¦ã¿ã¾ããã JavaScriptã«ããã¦ãæ©è½ãæ¬ ãã¦ãã¦å°ãäºã£ã¦ä½ã§ããããã¯ã©ã¹ããªãã¨ãã¯ããããåé¡ãããªãã¨æãã®ã§ãããã¢ã¸ã¥ã¼ã«æ©æ§ããªãã®ã¯ãã³ãã«è¾ãã§ããnode.jsã«ã¯ãå¾ æã®ã¢ã¸ã¥ã¼ã«æ©æ§ãå°å ¥ããã¦ãã¾ããã©ããããCommonJSï¼http://www.commonjs.org/ï¼ã¨ããä»æ§ã«å¾ã£ã¦ããããã§ãããåã¯ä»æ§ãèªãã ããã§ã¯ãªãã¦ãå®éã®node.jsã触ã£ã¦è¦å½ãä»ããã ãã§ããããã以ä¸ã«æ¸ãã¾ãã ç°å¢ã¯ãWindowsï¼MinGW/MSYS ã§ãã $ echo $HOME /c/Users/hiyama/Work $ which node /c/Users/hiyama/Work/bin/node.exe $ node --version v0.5.0-p
JavaScript Advent Calendar 2011 (Node.js/WebSocketsã³ã¼ã¹) ã® 13 æ¥ç®ã®è¨äºã§ãï¼ Node ã¨ããã°éåæããã°ã©ãã³ã°ã§ããï¼ãã®ã¹ã¿ã¤ã«ã¯å¤§éæã«ãã㦠2 種é¡ããã¾ãï¼ä¸ã¤ç®ã¯ fs ã¢ã¸ã¥ã¼ã«ãªã©ã§ä½¿ããã¦ããã³ã¼ã«ããã¯é¢æ°ã®ã¹ã¿ã¤ã«ï¼ fs.readFile(path, function(err, content) { if (err) { // ã¨ã©ã¼æã®å¦ç return; } // æåæã®å¦ç });ãã®ã¹ã¿ã¤ã«ã¯ï¼ä½ããã®è¦æ±ã«å¯¾ããçµæãä¸çºã§åãåã (è¦æ±ã¨çµæã 1 対 1) å ´åã«ä½¿ããã¾ãï¼ããã¦ï¼ã³ã¼ã«ããã¯é¢æ°ã®ç¬¬1å¼æ°ã§ã¨ã©ã¼ã®æç¡ãéç¥ããã¾ãï¼ã¨ã©ã¼ããªããã° nullï¼ã¨ã©ã¼ããã£ãå ´å㯠Error ãªãã¸ã§ã¯ãã¨ããã®ãååã®ãããªæ°ããã¾ããï¼undefined ã渡ãããããã
This domain may be for sale!
2011å¹´12æ07æ¥03:30 ã«ãã´ãªLightweight Languages javascript - é¢æ°åã®åå¾ã¨typeof()ã®åã çºæ ãªããªãã ã£ã¦ã¼!? ã¯ã¦ãªããã¯ãã¼ã¯ - kamisetoã®ããã¯ãã¼ã¯ constructor.nameãè¦ãã°ããããããªã®ï¼éãã®ããªï¼ ãããªããããããããã£ãªãã¦ããã£ãã£ã? MDNã®ä¸ã§é¢ã£ãããããªâ¦ constructor.name?ãããªã®JavaScript: The Good Partsã©ããããµã¤æ¬ã§ãè¦ããã¨ãã¼ããã§ãconsoleã¤ã¤ããã確ãã«ä½¿ãã⦠è¦ã¤ãã¾ããã Function - MDN name Non-standard The name of the function. Non-standard, Non-standard, Non-standardãã ã¨!? å®éããããå ãåã£ã¦ã¿
ãªãã¸ã§ã¯ãã®è©±ã®2åç®ã§ãã ä»å㯠prototype ã®è©±ããã ãã®è¾ºã¾ã§ã ã¨ããã«ãå ¥éã£ã¦æãã§æ¥½ãªãã§ããã©ããã ä¾ã«ãã£ã¦ããããã¼ã°ãã§æããæç®ãé »ç¹ã«åç §ãã¦ãã¾ãã ãããã®æç®ãåç §ããªããã覧ã«ãªããã¨ããè¦ããã¾ãã ã¾ããã®åã§ã¯èª¬æã®é½åä¸ã¯ã©ã¹ã¨ã³ã³ã¹ãã©ã¯ã¿ãå義ã«æ±ã£ã¦ãã¾ãã ãã®ç¹ã«ã¤ãã¦ã¯è³å ã§é©å½ã«å¤æãã¦èªãã§ããã ããã¨å¬ããã§ãã ããã¾ã§èª¬æããã¨ããé¢æ°ããªãã¸ã§ã¯ãã§ãã å¤æ°ãããããã£ã«å¤ã¨ãã¦ä»£å ¥ã§ããã»ãï¼ èªèº«ã«ãããããã£ãã¡ã½ããã追å ãããã¨ãã§ãã¾ãï¼ããããæå³ã§ã¯ãã¼ã¿åã®ãªãã¸ã§ã¯ãã®ä¸ç¨®ã¨ã¿ãªãã¾ãï¼ã ä¾ãã°ããããæ¸ãæ¹ãã§ãã¾ãã uniqueId.counter = 0; function uniqueId() { return uniqueId.counter++; } WScript.Ech
ãJavaScriptã«ã¯ãã¯ã©ã¹ã¨ãã®ç¶æ¿ã¯ãªããããããã¿ã¤ããã¼ã¹ã®ç¶æ¿ããµãã¼ããã¦ãããã¨ãã¾ã¼ãããã¯ããè¨ããã決ã¾ãæå¥ã§ãããããããJavaScriptã«ãããã¢ã¬ãç¶æ¿ã¨å¼ãã§ãããã®ãã©ããï¼ ãç¶æ¿ãã¨ããã°ãå¤ãã®äººãé常ã®ç¶æ¿ãã¤ã¾ãã¯ã©ã¹ãã¼ã¹ã®ç¶æ¿ãã¤ã¡ã¼ã¸ããã§ãããããç¡æèã«é常ã®ç¶æ¿ã¨ã®ã¢ããã¸ã¼ã追ããã¨ã«ãªãã§ããããããã¯å±éºã ã¨æãã¾ããã ããããã¿ã¤ããã¨ããç¶æ¿ãã¨ããè¨èããé£æ³ãã常èçãªã¤ã¡ã¼ã¸ã¯å ¨é¨æ¨ã¦ã¦ãäºå®ãç½ç´ããçºãã¾ãããããã®äºå®ã¨ã¯ããJavaScriptã«ã¯ãå®è¡æããããã£æ¤ç´¢ã®ã¡ã«ããºã ããããã¨ãããã ãã§ãã ä»åã®å å®¹ï¼ ããããã¿ã¤ããããããªãã®ãã¨ã ãããããªã __proto__ããããã£ã__proto__ãªãã¸ã§ã¯ãã__proto__ãã§ã¼ã³ __proto__ãã§ã¼ã³ã追ãããã¦ã¿ã
ãããããããæ¬é¡ã®Prototype.jsã§ããæ¬è¨äºã§ã¯ãPrototype.jsã®æ©è½ã®ä¸ã§ãã代表çãªããªãã¸ã§ã¯ãæåã®æ©è½ããé¢æ°ãæ¡å¼µããæ©è½ããé åã®æä½ãæ¡å¼µããæ©è½ããDOMã®æä½ã«é¢ããæ©è½ãã«ã¤ãã¦ç´¹ä»ãããã¾ãã ããã¦ãæçµçã«ã¯ã²ã¨ã¤ã®å®ç¨çãªã¯ã©ã¹ãä½ãã¾ããPrototype.jsããã使ãããªãã¨ãããã¨ãéè¦ãããã¾ã使ãããªãæ©è½ãªã©ã¯ç´¹ä»ããªããã¨ã¨ãã¾ãã Prototype.jsã®ãã£ã¨ãéè¦ãªæ©è½ã¯ããªãã¸ã§ã¯ãæåã«é¢é£ããæ©è½ã§ãããã¯ããã«ãã§ãè¿°ã¹ãããã«ãçµ±ä¸ãããæ¹æ³ã§ãªãã¸ã§ã¯ãæåãæ¸ããã¨ãããã¨ãããªãã¸ã§ã¯ãã®ä¿å®æ§ãé常ã«è¯ããã¦ãããã®ã§ãã Prototype.jsã§ã¯ããªãã¸ã§ã¯ãæåã®ä»£è¡¨çãªæ©è½ã¨ãã¦ãã¯ã©ã¹ãã¨ãç¶æ¿ããæä¾ãã¦ãã¾ãã
100ããªç§ã®ã¦ã§ã¤ããå ¥ãHelloWorldPHP<?php usleep(100000); echo "Hello World"; ?> Node.jsvar http = require('http') server = http.createServer() server.on('request', function(req, res){ setTimeout(function(){ res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello World'); res.end() }, 100) }) server.listen(3000, '127.0.0.1'); console.log('Server running at http://127.0.0.1:3000/'); å®è¡ãå¿ããã«
ã¯ã¦ãªã°ã«ã¼ãã®çµäºæ¥ã2020å¹´1æ31æ¥(é)ã«æ±ºå®ãã¾ãã 以ä¸ã®ã¨ã³ããªã®éããä»å¹´æ«ãç®å¦ã«ã¯ã¦ãªã°ã«ã¼ããçµäºäºå®ã§ããæ¨ããç¥ãããã¦ããã¾ããã 2019å¹´æ«ãç®å¦ã«ãã¯ã¦ãªã°ã«ã¼ãã®æä¾ãçµäºããäºå®ã§ã - ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãã®ãã³ãæ£å¼ã«çµäºæ¥ã決å®ãããã¾ããã®ã§ã以ä¸ã®éãã確èªãã ããã çµäºæ¥: 2020å¹´1æ31æ¥(é) ã¨ã¯ã¹ãã¼ãå¸æç³è«æé:2020å¹´1æ31æ¥(é) çµäºæ¥ä»¥éã¯ãã¯ã¦ãªã°ã«ã¼ãã®é²è¦§ããã³æ稿ã¯è¡ãã¾ãããæ¥è¨ã®ã¨ã¯ã¹ãã¼ããå¿ è¦ãªæ¹ã¯ä»¥ä¸ã®è¨äºã«ãããã£ã¦æç¶ãããã¦ãã ããã ã¯ã¦ãªã°ã«ã¼ãã«æ稿ãããæ¥è¨ãã¼ã¿ã®ã¨ã¯ã¹ãã¼ãã«ã¤ã㦠- ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãå©ç¨ã®ã¿ãªãã¾ã«ã¯ãè¿·æãããããããã¾ãããã©ãããããããé¡ããããã¾ãã 2020-06-25 è¿½è¨ ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ã®ã¨ã¯ã¹ãã¼ããã¼ã¿ã¯2020å¹´2æ28
ãã®ã¨ã³ããªã® 親åã¸ãããã°ãæ¸ããã - ITæ¦è¨ y ãããã°ãå§ããã¿ãããªã®ã§ãèªãã§ã¿ãã ã§ãææ°ã®ã¨ã³ããªãèªãã§ã¿ããã Y ã³ã³ããã¼ã¿ã¨ãããã®ã«ã¤ãã¦æ¸ãã¦ãã£ãã®ã§ã Y Combinatorãåãããï¼ - yuji1982ã®æ¥è¨ Y ã³ã³ããã¼ã¿ã£ã¦ä½ã£ã¦ã¨ãããããèªåã§ãããããèãã¦ã¿ãã çµå±ãªããªã®ããã£ã±ãåãããªãã£ããã§ãããèªåãèãããã¨ãã¾ã¨ãã¦ãã ã¾ãããã£ããããæ°ãæ±ãã fib ãå®ç¾©ãã var fib = function(n){ return (n <= 2) ? 1 : (arguments.callee(n-1) + arguments.callee(n-2)); }; fib(10); ããï¼ JS ããã¼ï¼åå㯠n ãã使ã£ã¦ãã¼ãï¼ ãã§ããããã§ãããããããããªãã¦ï¼ JS ãç´ æ´ããéãã¦è©±ãçµãã£ã¦ãã¾
ååããã¨ãããã«ããããYã³ã³ããã¼ã¿ï¼(絵解ã解説編) - ãããããã¾ããã¨ããã¨ã³ããªã§ãYã³ã³ããã¼ã¿(ä¸åç¹æ¼ç®å)ã¨å帰ã®çµµè§£ã解説ããã¾ããã Yã³ã³ããã¼ã¿èªèº«ã¯ãçµå±ã®ã¨ããå帰ãç£ã¿åºãã¦ãããã ãã§ããé¢æ°(æ£ç¢ºã«ã¯Î»ã¨ããåç´ãªæååå¤æã«ã¼ã«)ã ãã§åºæ¥ã¦ãããã°ã©ãã³ã°ã«é¢ããããããªåçã®ç 究ãå¯è½ã«ããã®ãåã訳ã§ãããã®è¾ºã®ãããããããã ããã解説ããã¦ãã¾ããããããåãªãå帰ãªããå®éã®ããã°ã©ãã³ã°ã§ã¯Yã³ã³ããã¼ã¿ãªãã¦ä½¿ããªãã¦ãåºæ¥ã¾ãã ããããYã³ã³ããã¼ã¿ã¨ãä¸åç¹ã¨ãã¯ãåãå¦è ããã¨ããç 究ã«ä½¿ãã°ãããã®ã§ãæ®éã®ããã°ã©ãã«ã¯ä½ã®æå³ããªãã¢ããªã®ã§ããããï¼ ã¨ããããã§ãä»åã¯ãã¸ãã£ãã«ãYã³ã³ããã¼ã¿ãä¸åç¹ã§åºã¦ããèãæ¹ããçè«ã ããããªããå®éã®ããã°ã©ãã³ã°ã«å¿ç¨ããä¾ãè¦ã¦ã¿ã¾ãããã ä»åãããã°ã©ã ã®ä¾ã
9.1 ã³ã³ã¹ãã©ã¯ã¿ è¨è¿°ä¾ function Rectangle(w, h){ this.width = w; this.height = h; // returnæã¯è¨è¿°ããªã } var rect1 = new Rectangle(2, 4); var rect2 = new Rectangle(8.5, 11); ãªãã¸ã§ã¯ãã®çææ¹æ³ ãªãã¸ã§ã¯ããªãã©ã«ã§{}ã¨è¨è¿°ãã ex.) var point = {x:0, y:0}; ã³ã³ã¹ãã©ã¯ã¿é¢æ°ã使ã ex.) var today = new Date(); ã³ã³ã¹ãã©ã¯ã¿é¢æ°ã¨ã¯ ãªãã¸ã§ã¯ãã®ããããã£ãåæåããé¢æ° newæ¼ç®åã¨ä¸ç·ã«ä½¿ããã ãªãã¸ã§ã¯ãã®"ã¯ã©ã¹*1"ãå®ç¾©ããã«ã¯ã³ã³ã¹ãã©ã¯ã¿é¢æ°ãå®ç¾©ããã ãã§ãã é常ãæ»ãå¤ããªã*2 thisã¨ã¯ å®è¡ä¸ã®ã³ã¼ã*3ããèªåèªèº«ãã表ããªãã¸ã§ã¯ãã«ã¢
ã好ããªé£ã¹ç©ãã¿ã¤ãããªãããèªãã å¤è³ååãããã好ããªé£ã¹ç©ãã¿ã¤ãããªããã¨ããæ¬ãåºãããä¸ã«åã®è¨äºã«è§¦ãã¦ããããã¼ãããã£ã¦ããã®é¢ä¿ã§ããã ãã¦æ©ãã«èªããã¨ãã§ããã ããã¯å¤è³ããã好ããªé£ã¹ç©ãæ¢ãæ¬ãã¨ãã»ã¤ã¨ããã¨ãçã話ãããããå ¥ã£ã¦ãããã®ããèªãã ãã¨â¦
id:cheesepie:20070131:1170172709 æè¿ã¯ããããã風㫠JavaScript ãåå¼·ãã人ãå¢ãã¦ãã¦ã¨ã¦ãå¬ããã§ã ^^ id:cheesepie ããé å¼µã£ã¦ãã ããï¼ ã§ãã¡ãã£ã¨é åã¨é£æ³é åã®ä½¿ããããéããããªã®ã§ãã¨ã³ããªã¼ãæ¸ããã¨æãã¾ãããããã£ããã ã£ãããã¿ã¾ããï¼ï¼ ï¼ ãã£ã±ãããã®ã¸ãã JavaScript ã®é£ããã¨ããã®ã²ã¨ã¤ãªã®ã ãããã ã¨ãããã¨ã§ã JavaScript ã®é åã¨é£æ³é åã®éã ãã£ã¦ã¿ããã¼ é£æ³é åã¨ã¯ JavaScript ã§ã¯é£æ³é åã¯ä¸çªã·ã³ãã«ãªãªãã¸ã§ã¯ãã®ãã¨ã§ãããã¤ã¾ãããã¹ã¦ã®ãªãã¸ã§ã¯ãã¯é£æ³é åã§ããã 以ä¸ã®ãã¹ã¦ã®é£æ³é åã¯ã¾ã£ããåããã®ã§ããã // 1 var obj = { hoge: 'hoge' }; // 2 var obj = { 'hoge': 'h
ã¿ã¤ãã«ã¯é£ãã§ãããå®éã«ã°ãªã¢ã³ã®éçºå¹çãæ°æã¡æªããããã«ä¸ããã¾ãã 2009/06/02è¿½è¨ åç»upãã¾ãã åãã¦ãªã®ã§ããããé©å½ã§ãããã容赦ã ããã¯ä½ï¼ vimã®ç°å¢è¨å®ã®åå¼·ãã¦ããgreasemonkeyã®éçºç°å¢ãä½ã£ã¦ã¿ã¾ãã ç°å¢ã¯ãUbuntu8.0.4ã§ã ã§ãããã¨ã¯ä»¥ä¸ã®éã ã³ã¼ãè£å® ã¹ããããã«å¯¾å¿ user.jsã§æ°è¦ãã¡ã¤ã«ãä½ãã¨ããã³ãã¬ã¼ããèªåã«ä½ã£ã¦ããã ã³ãã³ãä¸çºã§ãfirefoxã«ã°ãªã¢ã³ãã¤ã³ã¹ãã¼ã« ä¿åæã«èªåçã«firefoxã®ä»éãã¦ããã¼ã¸ãåèªã¿è¾¼ã¿ ã¾ãã¯ãvimrcã¨å ¥ãããã©ã°ã¤ã³ .vimrc ä¸è¨ã®è¨å®ã¨ããã¾ã¨ãã.vimrcã¯ä»¥ä¸ã®éãã§ã set encoding=utf-8 set nu syntax on "æ°ããè¡ã®ã¤ã³ãã³ããç¾å¨è¡ã¨åãã«ãã set autoindent "ã¤ã³ã¯
WEB+DB PRESS ç·¨éã® R ãããããåã®é£è¼è¨äºã«èªè æ§ãã質åãæ¥ã¦ããã¨æãã¦ããã ããã®ã§ããã®å 容ãæãã¦ããã ãã¾ããã 以ä¸ãå 容ãè»¢è¼ ãJavaScriptããããéçºéãã®è¨äºã«é¢ãã¦è³ªåã§ãã ä»åã®å 容ã§ç¹ã«èå³ãæã£ãã®ã¯thisãã¼ã¯ã¼ãã®æ¯ãèãã§ããã thisãã¼ã¯ã¼ãã®èª¬æã«ã¯ããªãã¸ã§ã¯ãåã®å¤æ°ãå¥ã®å¤æ°ã«ã³ãã¼ãã¦ããåæåããã¨ãã³ãã¼ããå¤æ°ããã¡ã½ãããå®è¡ã§ããªããªãã¨ããä¾ãç´¹ä»ããã¦ãã¾ããã ããã«ã¯ãï¼1ï¼ã®æç¹ã§obj0ã«ã¯{}ãå ¥ã£ã¦ãããããhogeã¯æªå®ç¾©ã¨ãªã£ã¦ãã¾ããã¨ãã説æãããã®ã§ãããèªé¢ã®é½åä¸çç¥ãããããããthisãã¼ã¯ã¼ããç¨ãããã¨ã§åé¡ãåé¿ã§ããã¨ããçç±ããªããªãç解ã§ããªãã§ãã¾ãã èªåãªãã«èãã¦ã¿ãã¨ãããå é¨çã«ã¯ä»¥ä¸ã®ãããªãã¨ãèµ·ãã¦ããã®ã§ã¯ãªããã¨æãã¾ããã (1)
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}