123
 123

Sun 29 July, 2007

Click here to bookmark this link.Channel Image14:00 OSCON Wrap-up» John Lam on Software
OSCON is my favorite conference these days. I love it because it brings so many diverse people under a single umbrella for a week. For a week we can get together and experience new ideas from different communities and avoid...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image13:32 二进制输出转换» Ruby Object Oriented
class Fixnum  alias to_b to_s   def to_s    to_b(2)  end  end   p 0b100 + 0b111 也可以二进制32位输出表示: class Fixnum   def to_s     sprintf("%032b",self)   end  end        p 0b1010^0b111 xor加密试验: a="中文777"   s=String.new a.each_byte do |m|   s+=(m^155).chr   end   p s a=s s=String.new a.each_byte do |m|   s+=(m^155).chr   end   puts s
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image11:24 IronRuby 和 Ruby.NET的不同点» 404 梦想没找到
参见http://article.gmane.org/gmane.comp.lang.ruby.dotnet/57。 CLR(Common Language Runtime)和DLR(Dynamic Language Runtime) * IronRuby 基于DLR. * Ruby.NET 基于 CLR. 与Silverlight的集成 *IronRuby最初的alpha版将不会支持Silverlight,将来版本会考虑这个问题。 *Ruby.NET不清楚 * IronRuby使用了Ruby.NET的分析器,这个分析器基于MSFT许可。 对Ruby库的支持 * Ruby.NET完全支持1.8.2核心库。 * IronRuby支持的比较有限。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 楽天技術研究所» Matzにっき
で、次に六本木に移動して、午後は楽天技術研究所でのミーティング。 今までのサーベイをもとに今後の方向性について考える。 あまり非現実的で実現できないのも困るが、 かといって「(誰でも)やればできる」というような、 簡単(に見える)ものでも困るということで、悩ましい。 が、方向性は見えてきたかな。 途中はともかく、最終成果はオープンソースにできるように念を押す。 好感触である。 あと、楽天名刺ができたので、名実ともに「楽天の中の人」というイメージが強くなった気がする。 最後に「楽天、システム開発拠点を国内主要5..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 上京» Matzにっき
朝の飛行機で東京へ。 まずは品川のソニーで打ち合わせ。 近いうちにソニーの中で講演会をしようという話。 ソニーくらい大きいと社内だけで立派なイベントが開催できるんだねえ。 私の前に呼ばれた講師が世界的なビッグネームたちで(確証が持てないので名前は非公開)、 思わず遠慮しようかと思ったのだけど、そこは説得されてしまった。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 よしみ視点 - Ruby開発者:まつもとゆきひろ氏の集中授業» Matzにっき
本題は私の集中を受けそこねた、という話なのだが、 野村総研、検索語に関連の深いキーワードを連想する「連想検索エンジン」を開発 インターネット-発表資料:IT-PLUS この検索エンジンは、Ruby(正確には、Ruby on Rails)で開発されています。 というリーク(?)が。NRIがRubyに興味を持ってる話は知ってたけど(社内講演会もしたし)、 こういう風に使うとは知らなかった。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 まめめも - 高速 Bignum#to_s» Matzにっき
桁数の多いBignumのto_sをkaratsuba系アルゴリズムを利用して Rubyで実装し直したらより高速になったという話。 Rubyの実行コストを考えると驚異的な話だと思う。 いや、ただ今使ってるアルゴリズムが効率悪すぎ、という話なのだが。 が、正直、アルゴリズムの説明を読んでもよくわかんなかった。数学苦手。 だれかCで実装し直してくれないだろうか。 喜んで取り込むから。イヤじゃなかったらChangeLogに名前を刻みこむから。 他力本願。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 なぜ楽天か» Matzにっき
で、この辺で「なぜ私が楽天フェローを引き受けたか」についてちゃんと書いとこうと思う。 とはいえ、最大の理由は「縁」なのだが、 より具体的には以下のようなことが理由である。 最初のオファーであった。 楽天は私に対するこの種のオファーの中で最初のものであった。 楽天との契約にはある種の排他条項があるので、 今後、無制限にフェローを引き受けることはできない(しない)。 私の活動を制限する意図がない もちろん、東京でのミーティングが発生するので まったく制限がないわけではないが、 基本的に私の最優先事項である「Ruby..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 Slash7 with Amy Hoy - Help Vampires: A Spotter's Guide» Matzにっき
海外版「教えてクン」、その傾向と対策。 洋の東西を問わず、そういう人たちは居るのね。 でも、このエントリではそういう「Help Vampire」を 救済しようとする試みも含んでいる。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 IronRuby and Ruby.NET: The Differences and Benefits of Both» Matzにっき
最近話題のIronRubyと、最初の実用的な.NET上のRuby処理系であるRuby.NETの違いについて。 IronRubyはDLR上で動く Ruby.NETはCLR上で動く IronRubyはRuby.NETのパーザーで動く Ruby.NETは1.8.2添付のライブラリが動く。 IronRubyは現時点では機能的にまだまだ
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 Buran Composition on-board computer» Matzにっき
ソビエト版スペースシャトルであるBuranに搭載されている コンピュータは完全にオリジナルなものであったが、 彼らはそのためにBuran用の新言語、Prol-2とDipolと、 データ記述用言語Floksを開発した、という話。 ロシアの技術は侮りがたし。 コストを度外視した開発は時として驚くべきものを産み出す。 これも一種の蠱毒か。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image04:50 :gnuvince.net >> Blog Archive >> My 5 things I hate about Python» Matzにっき
私がPythonで嫌いな5つのこと。 listにdictのget相当(範囲外でNoneを得る)がない (x)rangeが終端を含まない 「for month in xrange(1,13)」とか (Cの)static変数相当がない メソッドだったり関数だったり。len()とかsort()とか lambdaが1行式しか書けない まあ、大したことないって言えば大したことない。 逆にいうとそれ以外は嫌いじゃないってことだものな。 インデントの件は含んでないし*1。 この人は実はかなりPythonファンだと思う。 しかし、コメント欄ではそれらに対してかなり厳しい反論が付いている。 「真の」Pythonファンは、..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sat 28 July, 2007

Click here to bookmark this link.Channel Image20:29 今天又跑去看了看» Ruby Object Oriented
code complete 2到是一本不错的书,翻译的也不错. 今天我又做车去看了看,这次看了看”子程序”和”全局数据”相关的章节. 回想起我上次写的图搜索的代码: if c==target[1]                        #return closed                       unless closed.assoc(target[1]) && closed.rassoc(target[0])                return nil              end              p=target[1]              path=[target[1]]    [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image12:56 Sequel:轻量级的Ruby ORM库» LetRails
简介 Sequel是一个轻量级的Ruby ORM程序库,支持线程安全,连接池,同时还提供了一个简洁的DSL来操作数据库。 如何你只是想写一个简单的纯Ruby的数据库应用,而不想同庞大的ActiveRecord发生关系...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Fri 27 July, 2007

Click here to bookmark this link.Channel Image21:31 筑波大学 集中講義 「プログラミング言語の設計と実装」 (2日目)» Matzにっき
集中講義、2日目。今日は「プログラミング言語の実装」。 今日は言語処理系の典型的な構造や実行環境などについて。 字句解析、構文解析、最適化などの基本的な部分や、 仮想機械やガーベージコレクションについても説明する。 昨日はプログラミング言語概論という感じで 「お話」としても聞ける内容だったと思うのだが、 今日はいきなり実装の詳細部分まで踏み込んだのでかなり難易度が高かったように思う。 難しいと思った人はごめんね。 今年も昨年同様、実際に学生さんに前に出てもらって、 ガーベージコレクションを実地で体験しても..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image21:31 第2回 「小成功病」が経営者を蝕む:ITpro» Matzにっき
企業が「とりあえず」のところまで成長してしまうと 安住してしまって、成長が止まってしまう(おそらくは無意識のうちに)、という話。 NaClとかもそういう地点に到達しているのかなあ。 RubyやRailsを起爆剤に次のレベルに大きく伸ばすのか、 無茶せずに少しずつ着実に成長することを考えるのか。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image21:31 Whoever does not understand LISP, is doomed to reinvent it. | Lambda the Ultimate» Matzにっき
Lispのことをわかってない人は、結局Lispを「再発明」する破目に陥る、という話。 グリーンスパンの第10法則ふたたび。 まあ、RubyだってLispの再発明であると言えないことはないわけで、 それは認めちゃうんだけど、とはいえ、じゃあ、Lispが再発明も要らないほど 素晴らしい言語かっていうと、ちょっと疑問がある。 「Lispファン」にはまったく見えないが、 そうでない人には障害になる「なにか」が確実に存在して、 再発明されたRubyとかが(Lispよりも)人気があるのは その「なにか」成分が少ないんじゃないかと。 ということは、再発..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image21:31 (The Scheme Way): The recruiting secret weapon» Matzにっき
リクルートの条件に「Scheme」と書いたら、 他だったらとても自分のところに来てくれなそうな優秀な人材が応募してきた。 マイナーな(でもとんがった)技術をもって募集するのは採用の秘密兵器になるかも、 という話。 そうなのか。 しかし、最近の応募状況を考えると、 「Rubyで仕事ができる」とか「Ruby開発者と仕事できる」くらいでは もはやあまり強力な秘密兵器にならないように思う。 これはNaClもSchemeに移行するしか(嘘
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image18:07 筑波移動» Matzにっき
明日からの講義に備えて、米子空港から東京へ。 途中、病院によって母のお見舞い。 その後、羽田→秋葉原→つくばの順に移動。 ホテルオークラへ。今年は本館。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image18:07 筑波大学 集中講義 「プログラミング言語の設計と実装」 (1日目)» Matzにっき
今年で三年目になる母校での集中講義。 なんでも同じ内容の集中講義は3年までなのだそうで、 今年が最後になる。 一日目の内容は「プログラミング言語の設計」。 自己紹介から始まって、プログラミング言語の歴史や 発展の経緯など。また、「良いプログラミング言語」を判定する基準など。 一日目のレポートは「20年後のプログラミング言語像を予想せよ」というもの。 例年通り面白い内容のものが多かったが、 講義の中で「プログラミング言語の進化は遅い」とか繰り返し述べたものだから、 「20年経っても変化しない」と予想した人が思..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image10:55 万物皆数-图搜索» Ruby Object Oriented
有向图搜索,寻找从起点到终点的最短路径(所需节点数最少). #graph_search:v0.01 #author:axgle class Array   def path_find(target)     g=self.dup     opened=[target[0]]     closed=[]           while c=opened.shift                 next if closed.rassoc(c)         g.each_with_index do |p,i|                           if c==target[1]                        #return closed      [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image08:33 Offline RDoc» Projectionist

Tip Offline RDoc

Run the gem_server executable bundled with RubyGems and point your browser at localhost:8808


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 半自動 ls (2)» 青木日記
ランダムで cd するようにしてみた。 #!/usr/bin/env ruby unless Array.method_defined?(:choice) class Array def choice at(rand(size())) end end end def main Signal.trap(:INT, 'EXIT') actions = [ lambda { cmd ls }, lambda { cmd ls -l }, lambda { cmd ls -a }, lambda { cmd ls -s }, lambda { random_chdir } ] $stdin.each do |line| exit if line.strip == 'exit' actions.choice.call end rescue Interrupt exit 1 end def cmd(s) $stderr.puts s system s end def random_chdir ent = (Dir.entries('.') - ['.']).select..
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 半自動 ls» 青木日記
自分で ls を連打しなくて済ますためのシェルスクリプトを書いてみた。 return を連打するだけでランダムに ls, ls -l, ls -as を実行する。 #!/bin/sh while read cmd do [ $cmd = exit ] exit case `expr $RANDOM % 3` in 0) ls ;; 1) ls -l ;; 2) ls -as ;; *) echo ??? ;; esac done 手抜きしたので $RANDOM があるシェル専用。 (01:17)
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 半自動 ls (2)» 青木日記
ランダムで cd するようにしてみた。 #!/usr/bin/env ruby
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 unless Array.method_defined?(:choice)» 青木日記
class Array def choice at(rand(size())) end end end
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 def random_chdir» 青木日記
ent = (Dir.entries('.') - ['.']).select {|ent| File.directory?(ent) }.choice $stderr.puts cd #{ent} Dir.chdir ent end
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 def main» 青木日記
Signal.trap(:INT, 'EXIT') actions = [ lambda { cmd ls }, lambda { cmd ls -l }, lambda { cmd ls -a }, lambda { cmd ls -s }, lambda { random_chdir } ] $stdin.each do |line| exit if line.strip == 'exit' actions.choice.call end rescue Interrupt exit 1 end
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 def cmd(s)» 青木日記
Click here to bookmark this link.Channel Image02:10 SPI が信用できない» 青木日記
どうもファイアウォールってか SPI (Stateful PacketInspection) が信用できない。 ZyWall のときも pipelining SMTP が SPI ファイアウォールに止められたし、 DNS スレーブ接続もブロックされたし、 MR504DV で HTTP が止まるのもどうも SPI がらみのような気がするんだよな。 SPI がパケットをブロックした直後から HTTP が全部止まってんだもん。 つーかさー、もうファイアウォールいらなくね? 邪魔するばっかりで全然役に立ってねえよ。 ちゃんとルーティングだけしてくれればそれでいいじゃん。 (00:32)
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:10 OMRON ルータ MR504DV リストラ» 青木日記
もー、HTTP が突然止まる病がどうしてもなおらないので、 ルータをリストラしました。 今度は Corega にしてみた (安かった)。 これでしばらく運用してみよう。 (00:17)
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Thu 26 July, 2007

Click here to bookmark this link.Channel Image21:22 REST on Rails: 扩展MIME类型» LetRails
还记得前面的那个层叠Select的实现 吗?为了让cities_controller的index方法能够返回一个select tag,我采用了如下的方法: respond_to do |format|   format.html { render :partial => params[:partial]} ...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image14:36 Links for 2007-07-25 [del.icio.us]» John Lam on Software

add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image08:07 django master class随感» 动态感觉 静观其变
昨天晚上认真的看了一下django master class那篇tutorial,越发觉得有必要说说它。不仅因为3个作者是django team的成员,揭示了django中一些核心,更因为其中包容其他开源软件的一种态度,这是一种难得的开源态度。也和自己最近的一些思路有些吻合。
django master class的最后连续提到了几个非python的软件:
1)capistrano,这是一个ruby写的,用于软件的部署,能同时对多个服务器操作。
2)perlbal,这是一个perl写的,用于负载平衡,在django book中提及过。
3)memcached,这是一个用c写的,用于memory caching,能加快访问速度。
4)再次提到ajax,对jquery则格外青睐,都是用它来示例。

同时django team这些也不是关起门来自己做,眼睛还是会关注ror的,前面test framework中,反复提到了rails中test,我想他们是吸取别人的经验,利用python,使之更pythonic,呵呵,这是一个不变的情结。文中还提到了很多google code上的项目,这些项目也进入了他们的视线。

捏合这么多种软件的思路,我想是必要的,因为世界本身就是复杂的,多样的,个人的喜好是不同,但目的是一样的,就是让工具为人服务,减轻人的负担,这就提出了一个要求,就是尽可能让工具简单化,上面提到的,包括python本身,都具有这样的特质。随便说两句,有想法再写。
...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image06:13 I’m really open minde...» Projectionist
I’m really open minded but Larry Wall is insane.

Marcel


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image05:28 The data-parallel languages...» Projectionist
The data-parallel languages of the future will be functional languages.

Simon Peyton Jones


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image02:49 网络上品:Rails框架免费视频大全» 道喜技术日记

网络上品:Rails框架免费视频大全


全面地学习Rails框架视频教材
完整的参考资料链接


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image01:07 Busted» Lovable Lyle
Not me. But somebody. From ars technica, via Shelley Powers: [Harry Potter and the Deathly Hallows] actually leaked out through the tubes last week as some enterprising soul took photographs of every single page of the book and made them available through BitTorrent… The EFF took a peek of its own at the leaked photos and did [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Wed 25 July, 2007

Click here to bookmark this link.Channel Image18:39 Feisty安装apache2遇到郁闷的问题» Suave's Blog
在 ubuntu feisty 上用 apt-get 装 apache2,安装完成后 /etc/init.d/apache2 无法启动,没有任何返回,/var/log/apache2/error.log里面也没有任何信息!用 apache2ctl start 启动提示没有设置 ServerName,好说,在 /etc/ap...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image17:21 How to remove Nginx from Ubuntu Feisty» Suave's Blog
Feisty中的Nginx有问题,不能用 apt-get remove 卸载。方法看这里 ...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image14:33 根据ruby类体系原理实现权限管理» Ruby Object Oriented
这是我一时的灵感,有空一定试一试 1.一个用户只有一个角色,一个角色能够继承另外一个角色,并且必定是单继承 2.可以给用户分配单体角色(特权),该单体角色继承原来他所属的角色 3……. 总之,结合rbac思想和ruby原理实现,命名为rps(ruby permission system)
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image09:07 很重要的一篇django slide» 动态感觉 静观其变
最近在看一些python functional programming,因为没有什么研究,所以也谈不出什么心得,只是学习一下python中fp的用法。今天看到了一篇django master class,感觉对django的开发人员来说是个需要关注的一个slide,上面提到很多有趣的路线图:
1)unit testing
2)middleware
3)signal
4)form & ajax
5)openid
6)template tag pattern
7)custom field
8)。。。

我也要仔细看看,品味一番了。确实很难得的资料!
...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Tue 24 July, 2007

Click here to bookmark this link.Channel Image20:54 Matz,Koichi访谈(四):多语言支持» LetRails
问:我们已经讨论了多线程,下面让我们来谈谈字符编码吧,根据Ruby规划,这将会是变动较大的一个部分。Matz,你曾经说过你计划在Ruby中加入m17n(multilingualization,多语言支持,详情请参见...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image13:14 mysql如何判断某ip位于两个ip之间» Ruby Object Oriented
用INET_ATON函数即可. SELECT INET_ATON('0.0.1.1') 例如: 从ips表里查询ip=116.17.20.30对应的code是什么? CREATE TABLE `ips` (   `id` int(11) NOT NULL auto_increment,   `start_ip` varchar(15) default NULL,   `end_ip` varchar(15) default NULL,   `code` varchar(10) default NULL,   PRIMARY KEY  (`id`) ) ;   INSERT INTO `ips` (`id`, `start_ip`, `end_ip`, `code`) VALUES (1, '116.0.24.0', '116.0.31.255', 'hk'), (2, '116.16.0.0', '116.31.255.255', 'cn'); 答案: SELECT code from ips where INET_ATON('116.17.20.30') between INET_ATON(start_ip) and INET_ATON(end_ip) 参考资料: http://www.ixdba.com/html/y2007/m05/92-mysql-function.html
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image06:37 Chained Builds in CruiseControl.rb (Update)» Lovable Lyle
Last Thursday I wrote about the kind of chained builds functionality that I want from CruiseControl.rb. I think I’ve got it hacked in, at least to the “good enough” stage. The first big change was to change the @trigger instance variable for the Project class from a single trigger to an array of triggers. I modified [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image05:13 红玉一图:基于数据库软件的基本架构» 道喜技术日记

基于数据库软件的基本架构


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image03:38 技术信息:Rails框架国际化插件的新动向» 道喜技术日记

Rails框架国际化插件的新动向


  本文介绍两款比较新的而且非常容易使用的Rails框架国际化插件。这是Rails框架中文软件必不可少的工具。

  软件的国际化是软件开发的一个重要工作,尤其是我们中文,框架是大部分是英文,没有现成的方法马上可以直接进入中文软件的开发。Rails框架本身也没有相关的软件包,要进行Rails框架软件的国际化,就需要依靠第三方Rails框架的插件,开始使用比较多的有:Gettext ,相关资料 [ 1 ],和 Globalize 。二者功能比较强大,同时也带来安装和使用的复杂性。

》》详细阅读
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image03:27 First Drop of the IronRuby Sourcecode» James Britt - Code, Content, Caffiene

By way of Tim Heuer :

John lam just announced the first drop of the ironruby sourcecode! the source is licensed under the microsoft permissive license (BSD-style). also the team has announced that they will be accepting source code contributions for the ironruby libraries! this is phenomenal. there will be a lot of work to make that happen and the intention is to get ironruby on to rubyforge by end of august. John also announced that in some some micro-benchmark tests, ironruby is testing significantly faster than ruby 1.8.6 in some areas and on par in others. john will be at oscon as previously mentioned demonstrating some ironruby code, talking about the dynamic language runtime, working with ironruby in silverlight, etc.

(Not sure why, but all of Tim’s posts seem to follow an E. E. Cummings approach to capitalization.)

Edit: See also John’s post.


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Mon 23 July, 2007

Click here to bookmark this link.Channel Image20:56 Matz, Koichi访谈(三):多线程» LetRails
问:让我们谈谈多线程吧,这可以算是新版本比较大的改动了,你们分别谈谈1.8和1.9中的线程模型吗? Matz:老的线程模型属于绿色线程模型(最早出现于Java语言中,指线程不是由操作系统,...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image19:55 到底谁是天朝的害群之马?» 404 梦想没找到
邵佳一?我选你,球都拿不住,虽然也能进球。 海龟,孙继海和孙祥发灰不是很好,郑智第一轮就申请了个无谓的黄牌,当时我就说了,李玮峰你们俩,等着停赛吧。果然,第二场又得了牌。间接导致了惨败乌队。 董方卓就是一个悲哀,要是我就不去朱的队里。 毫无疑问,朱责任最大。究其深层原因,在于足协,在于天朝子民。 深圳又被曼联踩了,KingDong今天真的有点丢人。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image19:54 A first look at IronRuby» John Lam on Software
We've been working very hard over the past couple of months to get our first source code release ready. I'm happy to announce today the first drop of the IronRuby source code. IronRuby is licensed under very liberal terms as...
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image19:50 禁止全文转载» 404 梦想没找到
1.版权问题 这是对原作者的态度的问题。很多时候转载之后,根本不见了原作者的信息了。 2.信息冗余 相信你去搜索引擎搜到的东西,有很多都是一样的,重复的数据,因为这些文章本来就是互相拷贝过来的。从这么多的搜索结构找到自己想要的,真是难。所以不转载,也能帮Google和baidu的人省点事。 3.排版问题 很多文章的排版都乱得不能再看了,基本上就如同垃圾一样,白白的浪费了硬盘和流量。 4.文章更新问题 有时候可能会转载比较新的可能哪里写的有错误的文章,但是原作者修改之后,转载这可能99%不会知道,更不会去更新他转载过的文章。所以,这很耽误人。 所以,不要简单的用ctrl+a ,ctrl+c,ctrl+v来转载了,不管是为了集聚人气,还算是为了论坛积分,还是自己喜欢。当然,要看情况而定。
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image01:21 SchützaBlog 2007: Danke» chris blogs

In willkürlicher Reihenfolge:

Dank an die Schwedenmusik für ihre originellen neuen Stücke.

Dank an die WG-Trommler für einen alkoholischen Fixpunkt.

Dank an das Fußvolk der Schweden für groben Klamauk beim Fechten.

Dank an die Bäckerei Zoll für belegte Brötchen morgens um halb sechs.

Dank an den Stecken für warme Seelen und Memminger Gold.

Dank an die RAN für ihr Vordach.

Dank ans Tweety für den Treffpunkt.

Dank den Izmir-Döner für die guten und scharfen Pizzas.

Dank an den Schimmeldöner, weil er bis sechs auf hat.

Dank an den REWE-Mitarbeiter, der fast die Marmelade wegen einer Palette 5,0 fallengelassen hat.

Dank an alle, die lieber das Schützenfestlied als was von Landser sangen.

Bis nächstes Jahr verbleibe ich mit einer
Scheene Schütza!

NP: Bob Dylan—A Hard Rain’s A-Gonna Fall


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl

Sun 22 July, 2007

Click here to bookmark this link.Channel Image18:10 Capistrano 2.0» Riding Rails - home

Capistrano 2.0 is real. (What is Capistrano?)

Install it thus:

gem install capistrano

It’s been through four preview releases, and has seen significant changes since 1.4.1. If you’re currently using 1.4.1, be sure to check out the upgrade documentation at http://www.capify.org. If you’re altogether new to Capistrano, you might like to read about getting started.

Since the last preview release (number four, version 1.99.3), the changes are primarily bug fixes, but the following featureish modifications snuck in, too:

  • The uploader has added a tiny bit of sleep to prevent the CPU from going bonkers during uploads.
  • You can specify the $CAPISTRANO:HOST$ placeholder in the filenames that you give to “put”, and it will be replaced with the actual host that the file is being uploaded to.

Also, some people reported SFTP uploads were hanging for them. If this happens to you, try adding the following line to the top of your recipe file:

set :synchronous_connect, true

That will cause connections to the servers to be established serially, rather than in parallel, so if you’ve got a lot of servers that you are connecting to, it might make things a bit time-consuming. However, this appeared to work around the hanging SFTP issue.

You can read the complete changelog here. If you are using Capistrano at all, please also consider joining the mailing list, it’s a great place to share tips and report issues.

KNOWN ISSUES

Yes, there are a few of these. Two are of immediate significance:

  1. If you try to use the ‘put’ command to upload a file to two or more hosts via a gateway, you run a good chance of encountering “corrupted mac” errors. This is due to design flaws in Net::SSH and Net::SFTP, and (to my knowledge) cannot be worked around. The current best practice is to upload to a single host, and then use scp or rsync from the remote hosts to pull the file.
  2. A very few people have reported commands hanging inexplicably and infrequently. I suspect this is also due to flaws in Net::SSH, but I’m not certain yet.

add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image16:53 你的心情还好吗?» 梦想风暴

周末,跨越了大半个北京城和几个老朋友聚到了一起,由于有一段时间没有见到,自然一个个都变成了话痨。一个朋友的精神状态对比于之前见到的他来说,明显好了许多,生活显然也丰富多彩了一些。聊到原因,他从之前一个很糟糕的情况逐渐摆脱了出来,心情好了,自然而然人的状态也随之好转了。当然,朋友们也看到了我类似的变化。加入到ThoughtWorks后,我整个人的状态变得明显不同了,更活泼了。按照一个朋友的说法,明显是被释放的结果。

曾经和老妈聊天,我说找工作的标准是“钱多和心情好” 至少有一样。其实,虽然我也知道金钱的重要性,但我一直没有树立了一个良好的追逐金钱的观念,所以,我真正看重的是心情。工作最初的部门给我留下了一些很美好的回忆,其中一个重要的原因就是那里给了我一个良好的心情,周围的环境让我感到很舒服,所以,在那里我的表现也得到了大家的认可。虽然后来我离开了那里,但原因也与环境无关。反而,每次我回到沈阳,都会回到那个部门与一些老朋友叙旧。在我正式离职之前,我还曾经到那个部门与大家分享了一些Ruby的东西。

之后工作的那个部门,虽然我从中也学到了不少的东西,但自己整体评价我那两年的表现,很糟糕。自我分析的结果是,我一直没有找一个让自己心情愉快的理由。虽然大家也经常在一起玩,但那个部门的整体氛围一直不是我很喜欢的,人和人之间表现得也不是那么友善。正所谓祸不单行,有一段时间,我觉得自己很“背”,把该倒的霉在那一段时间都倒了。所以,在这种氛围中工作了一段时间之后,我感觉很压抑。我知道自己肯定会离开,只是不知道什么时候,下一个落脚点会在哪里,直到我找到了ThoughtWorks。

一个朋友看到我写的那篇《一月思想工作者》给出的评价是如鱼得水。经过长时间的压抑之后,我感觉自己一下子解脱了。我很快就融入了这样的环境中,以至于一些新来的同事误以为我已经在这里工作了很长的时间。ThoughtWorks给了我一个我喜欢的环境。我不会为了那些没有意义的东西,消磨自己锐气。

在ThoughtWorks的招聘流程中,有一条原则,如果应聘者让你感觉不舒服,你就完全有理由拒绝这个应聘者。这是一条看似不合理的原则,但对于维护一个良好的企业文化却至关重要。因为招进来的人是要和我们一起工作的。如果这个人在应聘过程中让人不舒服,那么在日后的工作过程中,他可能也同样会表现得让不舒服,让人不舒服的结果就会是影响工作效率,精力被浪费在一些无谓的地方。事实上,正是有这样一条原则,所以,几乎与所有ThoughtWorker在一起都会让人感觉很舒服。不管这个人来自哪里,即便是刚刚认识,也会很快就会熟悉起来。

你的工作环境给了你怎样的心情呢?


add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image16:00 code complete» Ruby Object Oriented
这周六读到”code complete”这本书. 我直接翻到了”表驱动法”那一章 一看,哈,我遇到的一些经验被”表驱动法”很好的描述了出来,同时又有一些我没有遇到过的新的有意思有实用价值的相关技术. 于是我用”Table-Driven(7-21)”,来表示7月21日那天,我读到了Table-Driven(表驱动)这个概念. 然后我结合关系数据库,想到了如何来Table-Driven.一个记录是一个节点,可以用关系数据库来表示树结构或图结构. 结合”基于表示和搜索”的人工智能思想,就可以解决很多问题. ============== 上面的是昨天的事情. 今天,我又翻看了一下”code complete”这本书,还是翻到了表驱动法这一章.这次我看到了上次我没有看到的一些细节,例如: 1.索引技术访问表 2.阶梯法访问表 其中又顺便看了看”循环”,外循环与内循环,”把最忙的循环放到内循环中”这些优化循环速度的代码调整技术,以及循环合并,if语句和循环语句的调整等等,实在是拍案叫绝,哈哈,有意思.”如果已经知道某件事情了,那么就不必在判断” ============= 今天我想到的两个量词搜索的问题: 查询表的时候,判断是否所有的x,x是p,可以或者应该转化为搜索”是否存在x,x不是p”,然后取反.哈哈,虽然对于”任意x,x是p”和”不存在x,x非p”在逻辑上是等价的,但是在基于搜索算法的效率上面,后者却有可能是优化了的. class Array   def any?      each do |item|       return true if yield(item)     end     return false      end   def all?      !any?{|i|!yield(i)}   end     end    p [1,1,0,1].any?{|i|i==0} p [1,1,0,1].all?{|i|i==0} p [1,1,0,1].all?{|i|i>=0} 同样的道理,适用于关系数据库里量词的搜索:判断”是否存在某属性”,只需要搜索到一个记录,就可以停止搜索.判断”是否所有”,可以转化为搜索是否存在相反属性,如果存在,这表示不是”所有”,如果不存在相反属性,则表示”所有成立”.
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Click here to bookmark this link.Channel Image14:05 IP class» Ruby Object Oriented
class IP    include Comparable   attr :ip   def initialize(ip)     @str_ip=ip     @ip=ip.split(".").map{|c|c.to_i}   end     def +(n)     rs=[]     ip=@ip.dup     while c=ip.pop       n,cc=(n+c).divmod(256)            rs.unshift(cc)     end      self.class.new(rs.join("."))       end      def <=>(other)     self.ip.each_with_index do |c,i|       if c!=other.ip[i]         return c<=>other.ip[i]       end      [...]
add to del.icio.us add to del.icio.us. look up in del.icio.us.   add to furl.net add to furl
Sources