Sun 07 December, 2008
Sat 06 December, 2008

Phusion is on a roll today. Not only did we just get a new Passenger, they’ve also just dropped a new REE (the Ruby patches for copy-on-write) that includes 64-bit support as well as compatibility with OS X and Solaris. They’ve also fitted the excellent RailsBench patches from Stefan Kaes that allows you to tweak the GC settings in Ruby if you need to.
This edition was sponsored by 37signals, Curve21, Dr Dispatch Transportation Software, InfoEther, Martian Interactive, New York Times, Shopify, Trevor Turk, and Utah Imaging.
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlFri 05 December, 2008

November 29-December 5, 2008 Edition
Rails 2.3 development is still continuing at a healthy clip. Here’s an overview of what’s happened this week.
Application Templates
Rails now incorporates Jeremy McAnally’s rg application generator. What this means is that we now have template-based application generation built right into Rails; if you have a set of plugins you include in every application (among many other use cases), you can just set up a template once and use it over and over again when you run the rails command. Pratik Naik provided a thorough writeup of this feature over on his blog. commit
Find Improvements
Even the venerable code used by Active Record to talk to databases can be improved, and we had a couple of improvements checked in this week. First, the SQL generated for preloading records in has_and_belongs_to_many associations has had an extra “AS” excised, which makes it work better with some databases. Also, we now have a :having option on find (as well as on has_many and has_and_belongs_to_many associations) for filtering records in grouped finds. As those with heavy SQL backgrounds know, this allows filtering based on grouped results:
developers = Developer.find(:all, :group => "salary",
:having => "sum(salary) > 10000", :select => "salary")
Rack Integration
The tighter integration of Rails with Rack continues. This week saw the death of the venerable CGI processor within Rails, as well as the use of Rack to handle FCGI. There was also some refactoring down in the Rails tests to make them play nicer with Rack. commit commit
Configuration File Cleanup
Over the years, the default environment.rb file had gotten a bit cluttered with comments, random documentation, and settings that mot people don’t need. DHH took a few minutes to clean up the mess, and the current state of this file is much leaner. As part of the cleanup, session store configuration has been moved out to its own file. commit
No More Process Scripts
If you’re one of the (fairly rare) Rails developers who deploys in a fashion that depends on the inspector, reaper, and spawner scripts, you’ll need to know that those scripts are no longer included in core Rails. For Rails applications that are reployed with current alternatives like Passenger, these are just unnecessary baggage. But if you need them, you’ll be able to pick up copies via the irs_process_scripts plugin. commit
Odds and Ends
The fact that Rails checks for IP spoofing can be a nuisance for sites that do heavy traffic with cell phones, because their proxies don’t generally set things up right. If that’s you, you can now set ActionController::Base.ip_spoofing_check = false to disable the check entirely. commit
Rails.root now returns a Pathname object, which means you can use it directly with the join method to clean up existing code that uses File.join. commit
ActionController::Dispatcher now implements its own middleware stack, which you can see by running rake middleware. commit
Gem loading is smarter about missing dependencies. commit
auto_link now properly applies options (such as :target and :class) to generated e-mail links. commit
add to del.icio.us. look up in del.icio.us.
add to furl
The Phusion team keeps blazing ahead with Passenger and improving it rapidly. They’ve just released version 2.0.5, which includes a few fixes and introduces compatibility with the Rack-based Edge Rails.
At 37signals, we’ve already switched over Ta-da List and are busy working on getting the rest of our suite running on Passenger. It’s just so much easier to deal with and the memory savings you get through REE are a nice cherry on top.
I keep getting a steady stream of success reports from all over the world as well. I’ve even read of a few people getting back into Rails development because Passenger finally took out the inconvenience of deploying.
It’s hard to argue with the usability. I’ve personally been setting up a new server running Ubuntu 8.10 and using Apache 2 with Passenger. The time it took me to go from a fresh install to a complete production setup was ridiculously low. There’s just so much less to worry about.
If you haven’t given Passenger a chance yet, now is definitely the time.
add to del.icio.us. look up in del.icio.us.
add to furlThu 04 December, 2008


- 说明
- 通用即时通讯工具Adiumx解决了MSN账号在Apple上的即时通讯问题。
- 另一款通用即时通讯工具Pidgin
add to del.icio.us. look up in del.icio.us.
add to furlWed 03 December, 2008


- 说明
- RJS教程是使用早期的Rails版本为基础的
- RJS中文教程不是完整的翻译版本
- 谁来着手以Rails 2.2版本重新写该教程的命令?
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlTue 02 December, 2008

当读书成为一种常态,有一段时间不读书,自己就会觉得空虚。之前,空虚了一段时间,突然觉得对不起自己,于是,又开始新一轮的读书。老妈给了我一个还算好用的脑子,当我扔下书本,隔一段时间再捡起来,思维居然还有连续性。所以,我可以并行读几本书。
《费马大定理》,这是一本数学八卦,非常好看。数学,是一种美,非常严谨的美。当时报考大学的时侯,如果没有计算机专业的话,我很可能会去学数学,我喜欢数学的那种美,也喜欢问题成功解决那一瞬间的快感,就如同程序顺利运行的那一瞬给我的感觉。《费马大定理》讲述了费马大定理的证明过程,作者非常八卦的把证明前前后后涉及的种种人和事谈了一遍,完全就是一个数学发展史,远到毕达哥拉斯定理,近到椭圆方程。好书好译,让这书读起来异常流畅。读这本书时,有一种力量,牵引着我,让我不忍放下。上一本给我这种感觉的书是《达芬奇密码》。当然,由于这是一本跟数学相关的书,所以,其中会一些定理的简单推导过程,即便是作者解释得非常清晰,仍会有一丝障碍,“好读书,不求甚解”或许是最好的解决方案。
之所以会读《费马大定理》,主要是最近又对数学有了兴趣,而这个兴趣来自《什么是数学》。
如果一个数的各位数字之和能够被3(或9)整除,则这个数可以被3(或9)整除。
怎么样,勾起童年回忆了吧!《什么是数学》给出一个非常清晰的证明,让人一看便知。《什么是数学》算是一本科普读物,问题讲得行云流水一般,数学的严谨之美在这本书体现得非常明显。在我看来,当年学的数学知识只是一个个零散的点,而这本书把这些点串了起来,所以,很多原来不那么清楚的地方,似乎变得再清楚不过了。不过,这必竟不是小说,不可能那么一下子就完全理解,所以,慢慢来,好好读。
只有当认识问题到一定深度之后,才可能用浅显的方式讲出来,《什么是数学》如此,《万历十五年》也如此。
记得很小的时侯,老妈送给我一本像新华字典一样的小册子,里面有各种各样的知识,我对它爱不释手。其中,这本书的后半部份讲的是中国历史,这也形成了我对中国历史最初的认识。想来,对历史的兴趣和现在停留在脑子里面的历史知识,大多是来自那本小册子。
《万历十五年》,一本关于明朝历史的书。那些面孔严肃的教科书太不受人喜欢,于是,有了《明朝那些事儿》之类的文字出现。相比之下,《万历十五年》是一本居于二者之间的书,不似教材般刻板,不似明月般调侃。一位深刻洞察力的历史学家像讲故事一样讲历史,历史变得生动起来。在这本书里面,你会看到做人臣难,当皇帝也不容易;会看到政治的阴阳;会看到冰冻三尺非一日之寒;会看到那些我们印象中的那些忠臣,也符合“人非完人”的规律……
其实,这段时间并行读的书还有一些,但大多是一些技术书籍,这里已经聊了太多和技术相关的内容,所以,才会有了《闲杂书等》。
add to del.icio.us. look up in del.icio.us.
add to furl
That’s not actual code; I made that up.
Here’s something not made up: Stellar talent Daniel Davis has challenged me to present seven random facts about myself.
I’m not a fan of anything that smacks of a chain-letter, but Daniel rules so I’ll at least spew out some unneeded detail. (But I won’t be inflicting this on on seven other people. Feel free to take up the challenge on your own if you feel so inclined.)
0. Favorite color: Plaid
1. Born and raised on an island
2. First cat was named George Sand
3. First 45 RPM vinyl single bought: Frankenstein by Edgar Winter Group
4. Learned FORTRAN in college by coding cellular automata for a semester. Still do not understand how I passed the Numerical Analysis with FORTRAN course since, oddly enough, CA were not on any test or assignment.
5. Have never skied
6. Favorite movie is Metropolis, unless it’s Citizen Kane or Animal House
add to del.icio.us. look up in del.icio.us.
add to furlMon 01 December, 2008


警告:在复制本博客代码时,空行存在中文空格,需要删除!!!
- 国际化功能问与答(三):本地化翻译方法
- 如何调用翻译函数?
I18n.translate < key >
如:
I18n.translate :hello
或者
I18n.t :hello - 如何调用具有插值的翻译函数?
I18n.translate < key >, < 插值 >
如:
I18n.translate :hello_with_name, :name=>”Hans” - 如何调用多元化的翻译函数?
I18n.translate < key >, < 多元化变量 >
如:
I18n.translate :second_in_words, :count=>12 - 如何调用具有命名空间的翻译函数?
I18n.translate < 命名空间.key >, < 多元化变量 >
如:
I18n.translate “namespcae.second_in_words”, :count=>2 - 如何调用时间对象的本地化函数?
I18n.localize < 时间对象 >, :format=>< key >
如:
I18n.localize Time.now, :format=>:long
或者
I18n.l Time.now, :format=>:long - 如何调用日期对象的本地化函数?
I18n.localize < 日期对象 >, :format=>< key >
如:
I18n.localize Date.parse(‘2008-11-29’) - 如何调用时间和日期名称的翻译函数?
I18n.translate < 命名空间.key >
如:
I18n.translate(‘date.month_names’)
I18n.translate(‘date.month_names’).last
- 如何调用翻译函数?
- 注
- 在图中的命令sc就是“ruby script/console”命令。
add to del.icio.us. look up in del.icio.us.
add to furl
RubyConf2008 videos are now going up.
First one you should watch: David’s talk on Monkeybars: easy cross platform GUIs. Learn about making commercial desktop apps in Ruby.
Monkeybars means Ruby GUI apps done right.
add to del.icio.us. look up in del.icio.us.
add to furlSun 30 November, 2008

Die Polemik zum Christkindlesmarkt von letztem Jahr gilt immer noch, aber da ich nun die meiste Zeit in München verbringe, tangiert mich das nur wenig. In München gibts natürlich auch Weihnachtsmärkte.
An der Adventskalenderfront stehen mal wieder an:
Mathekalender 2008, ein Muss als Mathestudent?
Perl Advent Calendar, aus Nostalgie.
24ways sollte auch wieder da sein.
Dieses Jahr Sterne mit Zirkel und Lineal konstruiert. 5-zackige, 17-zackige oder, wenn’s beliebt, 257- und 65537-zackige!
NP: Bearries—Explorer One
add to del.icio.us. look up in del.icio.us.
add to furl


