どうもこの辺のエラーが出ていて困り中。

err

VC++2008 Expressで開発しているのだけれど、 ActiveScriptRubyをBuildしてる環境とバージョンが違うようだ。 もう少し様子を見ようかな。

posted by Png genki on Fri 29 Feb 2008 at 18:29

基本的にはnetstatコマンドを使えばいいのですが、 linux系とはオプションがちょっと違います。

   1  > netstat -a -o | grep 12345

上記のコマンドを実行すると、一番右端のカラムにPIDが出力されます。

posted by Png genki on Fri 29 Feb 2008 at 13:50

cmd.exeから以下のようにコマンドを実行することで、 WindowsのプロセスをIDでKillすることができます。

   1  > taskkill /PID 12345

強制終了する場合は、/Fオプションを追加します。

posted by Png genki on Fri 29 Feb 2008 at 13:47

prototype.jsのEvent.observeは非常に便利なのですが、 初期化処理など、一度だけイベントの処理したい場合にはちょっと不便です。 度々そのような処理を行う機会があったので、以下のような 一度だけイベントをハンドルする関数を作ってみました。

   1  Event.observeOnce = function(element, event, observer){
   2    var handler = function(){
   3      Event.stopObserving(element, event, handler);
   4      return observer.apply(null, $A(arguments));
   5    };
   6    Event.observe(element, event, handler);
   7  };

使い方は、通常のEvent.observeと同様です。

   1  Event.observeOnce(document, 'dom:loaded', function(){
   2    /* some code goes here */
   3  });

Railsアプリケーションであれば、public/javascripts/application.js あたりに置いておくと便利かもしれません。

posted by Png genki on Thu 28 Feb 2008 at 17:04

以前は、Railsのhelperメソッドのオプションや細かい挙動を調べるために、 secondlifeさんの http://api.rails2u.com/ や、 :::ruby.search::: のお世話になることが多かったのですが、 近頃ではRailsのドキュメントを参照する機会が減ってきました。

細かい理由はいろいろあるのですが、一番大きいのは、 以前紹介したRak を使って直接Railsのソースを確認するのが便利な事です。

使い方はこんな感じです。

  • vendor/rails以下にRailsをfreezeさせます。
  • GNU screenでcd vendor/railsしたスクリーンを用意しておきます。
  • 何か調べたいときは、rak def\ method_nameを実行して、出てきたファイルをvimで読む。
  • Rtags(rails.vimの機能)でジャンプもできる。

さらに、細かい挙動やメソッドに渡ってきた値を調べたい時などは、 vendor/railsのソースにdebuggerと書き込んで、 script/server -uでデバッグモードを起動します (「Rails 2.0でデバッグをする新しいやり方」参照)

posted by Png genki on Thu 28 Feb 2008 at 13:20

apt-get install git-coreですんなり終わるかと思っていたら、 GNU Interactive Toolsというのと競合してるらしく、 以下のようなメッセージが出てきます。

   1  git, the filemanager with GNU Interactive Tools, is now called gitfm.
   2  
   3  If you are looking for git, Linus Torvald's content tracker, install
   4  the cogito and git-core packages and see README.Debian and git(7).
   5  
   6  This transition script will be removed in the debian stable
   7  release after etch.
   8  
   9  If you wish to complete the transition early, install git-core
  10  and use (as root):
  11   update-alternatives --config git
  12  
  13  Press RETURN to run gitfm

指示の通り、update-alternatives --config gitを実行すると、 今度はこんな感じのメッセージが出るので、

   1  # update-alternatives --config git
   2  
   3  There are 2 alternatives which provide `git'.
   4  
   5    Selection    Alternative
   6  -----------------------------------------------
   7  *+        1    /usr/bin/git.transition
   8            2    /usr/bin/git-scm
   9  
  10  Press enter to keep the default[*], or type selection number: 

2の/usr/bin/git-scmを選択します。

これでGitを使えるようになりました。

posted by Png genki on Thu 28 Feb 2008 at 10:13

技術評論社さま、献本ありがとうございます。

WEB+DB PRESS Vol.43
WEB+DB PRESS Vol.43
posted with amazlet on 08.02.28
WEB+DB PRESS編集部
技術評論社 (2008/02/23)
売り上げランキング: 122

今号は連載の最終回が多いですね。季節を感じる一冊です。

個人的に面白かったのは、

  • 弾さんの「Alpha Geekに逢いたい」(TwitterのEvan Williams氏)
  • masuidriveさんの「Amazon EC2&S3」(素晴らしい内容)
  • ひろせさんの「見逃さない通知の極意」

ですね。参考にさせていただきます。

posted by Png genki on Thu 28 Feb 2008 at 06:18

このブログに英語(非常にbrokenですが)で書いている記事を、 今後はもう一つのブログの方に書くことにしました。

理由としては、複数の言語が混在しているのは読みにくいのでは ないかということと、別なブログとして英語のブログを作ることで 英語の勉強に気合を入れるためです。

ということで、よろしくお願いいたします。

posted by Png genki on Wed 27 Feb 2008 at 13:48

At rev. 8929, I have found a good news for OpenID users.

http://svn.rubyonrails.org/rails/plugins/open_id_authentication/CHANGELOG

Tied plugin to ruby-openid 1.1.4 gem until we can make it compatible with 2.x [DHH]

Thanks DHH!

posted by Png genki on Tue 26 Feb 2008 at 16:30

OoO workshop has been successfully held on last Sunday thanks to SGI Japan.

Syoyo, the founder of this event, had predicted the future of GPU in his presentation using a comparison of two charts which are about the Nikkei 225 index and the speed of GPU. Detail is here.

This is the most interesting prediction about GPU I ever met. Nowadays, CPU is speeding up much faster than GPU and its power consumption is still low against GPU's.

I think that FPGA can be a competitor of CPU rather than GPU in near future. The number of gates in FPGA has become very large so that it could be used for development of very complex processor such as Raytracing Processing Unit as known as RPU.

posted by Png genki on Tue 26 Feb 2008 at 11:11