- 絵チャ製作
- setup-project の複数テンプレート対応
- Node.js でオブジェクト共有
- illumos ハック
- kvps-proxy の改良
This file contains hidden or 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
| #include <stdio.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <sys/socket.h> | |
| #include <sys/ioctl.h> | |
| #include <net/ethernet.h> | |
| #include <netpacket/packet.h> | |
| #include <netinet/if_ether.h> | |
| #include <linux/if.h> |
This file contains hidden or 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
| function maybe (callback) { | |
| return function (f) { // then | |
| return function (err) { // actual callback | |
| if (err) { | |
| callback(err); | |
| } else { | |
| f.apply(this, Array.prototype.slice.call(arguments, 1)); | |
| } | |
| }; | |
| }; |
This file contains hidden or 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
| ================================================================== | |
| Enumerator -> Enumeratee -> Iteratee | |
| ================================================================== | |
| Iteratee >>== Iteratee | |
| := Iteratee | |
| ------------------------------------------------------------------ | |
| Enumerator $$ Iteratee | |
| := Iteratee | |
| ------------------------------------------------------------------ | |
| Enumeratee =$ Iteratee |
This file contains hidden or 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
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
This file contains hidden or 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
| var net = require('net'); | |
| net.createServer(function (client) { | |
| var remote = net.connect({ | |
| host: 'koba789.com', | |
| port: 8281 | |
| }); | |
| remote.pipe(client); | |
| var source = client, |
このチュートリアルでは Storm トポロジーの作り方とそれを Storm クラスタにデプロイする方法を学べます。Java を主な言語として使いますが、Storm が多言語対応であることを示すためにいくつかの例は Python を使います。
このチュートリアルでは storm-starter にある例を使います。このプロジェクトを clone し、例にそって追うことをおすすめします。Read [[Setting up development environment]] and [[Creating a new Storm project]] to get your machine set up.
Storm クラスターはぱっと見 Hadoop クラスターに似ています。Hadoop では「MapReduce ジョブ」を走らせるのに対して、Storm では「トポロジー」を走らせます。「ジョブ」と「トポロジ」は大いに異なります。1つの鍵となる違いは MapReduce ジョブがいつかは終わることに対して、トポロジーは永遠にメッセージを処理し続けます(終了しない限り)。
This file contains hidden or 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
| function Class (bar) { | |
| this.foo = bar; | |
| } | |
| Class.prototype.method = function () { | |
| return this.foo; | |
| }; | |
| var instance = new Class('baz'), | |
| func = instance.method; |
OS X なら公式からインストーラをダウンロードしましょう。
nodeコマンドでnodeのインタプリタを起動。
This file contains hidden or 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
| // [EDIT]========================================[EDIT] | |
| var consumer = { | |
| key: 'YOUR CONSUMER KEY', | |
| secret: 'YOUR CONSUMER SECRET' | |
| }; | |
| // [EDIT]========================================[EDIT] | |
| var rl = require('readline'); | |
| var i = rl.createInterface(process.stdin, process.stdout, null); |