タグ

ブックマーク / blog.64p.org (10)

  • なんてこった…CPANモジュールをnode.jsで動かしてしまうライブラリ「node-perl」 - tokuhirom's blog

    https://github.com/tokuhirom/node-perl/ ここ最近、プログラミング言語同士の壁が徐々に破壊されている気がします。あるプログラミング言語上で別なプログラミング言語を動くようにしたり、置き換えてしまったりするような類です。今回はその一つ、CPAN moduleをnode.js上で動かすという、かなり無茶な気がしなくもない、そんなソフトウェアnode-perlを紹介します。 var Perl = require('../index.js').Perl; var perl = new Perl(); perl.use('LWP::UserAgent'); var ua = perl.getClass('LWP::UserAgent').new(); var res = ua.get('http://mixi.jp/'); console.log(res.as_

  • Node.js で重い処理をしてしまったときにタイムアウトするの法 - tokuhirom's blog

    (この記事は Node.js アドベントカレンダー不参加記事です) チャットサーバー的な使い方とか意外とみんな興味なくて、普通のウェブアプリケーションなどをかく、という用途にちょっと node.js がつかえたらいいのにな、とおもっている人がおおいようにかんじています。Node.js が人気なのは、v8 をうまくパッケージングしているのが node.js ぐらいで、そして v8 をうまくパッケージングするのが結構めんどくさいから、というところが大きいのです。ぶっちゃけ node.js が〜 とさわいでる人のうち8割は I/O multiplexing だからとかそういう理由で支持しているわけではなかったりするのです(偏見)。 さて、普通の web application のようなものを書こうとしたときに Node.js って基シングルスレッドだし、なんかうっかり重い処理したときにどうした

  • Testing JavaScript with node.js - tokuhirom's blog

    http://d.hatena.ne.jp/gfx/20110206/1296979666 JavaScript のライブラリやアプリケーションなどを JE でテストしたりするのは、筋が悪いとかんじます。創りかけのものを創りかけのものでテストするのは、時間の無駄になりやすいからです。 最近では v8(の一ラッパーとしての node.js)やSpiderMonkey などが用意に手にはいるので、これを利用すればよろしい。CommonJS などというものもでてきており、最近ではサーバーサイドでのテストもかんたんになりつつあるだろうし ということで、mustache.js をテストするスクリプトを以下にあげる。これは node.js でテストする場合です。JavaScript で簡易的な TAP Producer を実装してみたけども、これよりちゃんとしたものを誰か node-test-simp

  • web application 開発における git のブランチ運用ルール - tokuhirom's blog

    俺は普段こういう運用でやっているが、君はどうか。 社内の trac にドキュメントをかいたので、コピペしておく。git についてはカジュアルにつかってるだけなので、もっとこうしたほうがいいんじゃねえのというのがあればおしえてください。 ブランチ命名規則master 番の deploy 用。誰かに deploy されてこまるものはいれない。stg ステージングの deploy 用iss(\d+) チケット$1 用の topic branch。master から分岐させるその他、キャンペーン関係など、おいやすくしたい者は別途名前つけてもよし。 stg の運用基的に、開発はチケットにひもづく topic branch でおこなうので、以下のような作業フローとなる git co master git co -b issXXX # トピックブランチをきる ... # development gi

    t_43z
    t_43z 2010/12/15
  • リアルタイムWebのためのPubSubHubbub の Subscriber を構築する方法 - tokuhirom's blog

    PubSubHubbub(以下PuSH)は、フィードの更新をリアルタイムに通知するためのプロトコルである。 ウェブ上にころがっている"PuSH"の情報は、"Pub" の部分を実装する方法か、「PubSubHubbub の家GAE実装を手元でうごかしてみたよ」という記事しかなくて、"Sub"を実装する方法について解説しているブログなどはみあたらなかったので、ここに記す(英語だといくつかあった)。 基的に、ほとんどの人が興味あるのは "Pub" の部分である。自分のブログの更新情報等をリアルタイムにおくりつけたいと考えるからである。実際、ほとんどのブログソフトウェアではすでに PuSH 対応がすんでいる。see MT-PuSH, etc. しかし、私は今まさに Subscriber をつくりたいとおもったのである。なぜならば、"friendfeed.com/cpan" の更新情報を PuS

  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

    t_43z
    t_43z 2009/10/09
  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

  • tokuhirom blog

    Blog Search when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${entry.path} [in template "__entry.ftlh" at line 3, column 25] - Reached through: #include "__entry.ftlh" [in template "entry.ftlh" at

  • 1