Archive for April, 2007

爨底下

Friday, April 13th, 2007

上周六和爸妈去了趟门头沟的爨底下,一个倚山而见的村子。说N久以前一场大火烧了村子,村里人都都死于这场灾难,只有一男一女当时不在村里,当他们再回到村子时完全不敢相信眼前的一切,后来他们结为连理,决心将村子的血脉一直传下去。到现在村子里已经是第十七代人了,姓韩。

星期天和朋友们在计算所边上的郭林聚了一下,那会大家在一起真是一段很难忘的经历~

明天和兄弟们踢球,陪老婆,回家~后天12:00,UA888,San Francisco

I love MySQL and the company

Monday, April 9th, 2007

I read from mysql official docs:

MySQL’s core value:

  • To be the best and the most widely used database in the world
  • To be available and affordable by all
  • To be easy to use
  • To be continuously improved while remaining fast and safe
  • To be fun to use and improve
  • To be free from bugs

MySQL AB’s core value:

  • We subscribe to the Open Source philosophy and support the Open Source community
  • We aim to be good citizens
  • We prefer partners that share our values and mindset
  • We answer email and provide support
  • We are a virtual company, networking with others
  • We work against software patents

Rails Cache

Friday, April 6th, 2007

这两天一直在弄 cache,page cache基本不可用,因为它控制不了权限。action cache应该是可以执行filter的,不过不得法用的有点异常。最后还是fragment cache比较靠谱,简单好用。不过截止到现在 expire_fragment 还有点不正常,我用的是正则匹配的方式,好像删的不彻底,不过被缓存页面确实变化了。周一在盯着log看看。

两篇关于cache的tutorial:文章1文章2

还有这篇也可以看看

string with argument in GetText of rails

Friday, April 6th, 2007

You can give the arguments to the string with String#% method.

_("%s was not found") % "foo.rb"
_("%s and %s is not same file") % ["foo.rb", "bar.rb"]
_("%s is %d byte") % ["foo.rb", 100]

Also you can write as:

_("%{filename} was not found") % {:filename => "foo.rb"}
_("%{filename1} and %{filename2} is not same file") % {:filename1 => "foo.rb",
:filename2 => "bar.rb"}
_("%{filename} is %{filesize} byte") % {:filename => "foo.rb",
:filesize => 100}

Translators can understand what the msgid mean easily, so the second way is recommanded.

大部分介绍rails gettext的文章貌似都没有涉及这个内容,而从实际使用来说,这个东西是必然碰到的。

看文档还得看原版,作者blog上的两篇很全面!文章1文章2

春节 上海之旅

Friday, April 6th, 2007

第一次春节没在家过年,和LP去上海玩了一趟,早就想看看这个传说中的美丽妖怪城市了,终于亲眼所见!真的很棒,很喜欢春节时陕西南路的安静和校场路的热闹。不过我还是喜欢上海这种繁华的地方,同里的宁静让我感觉有点不自在,习惯了的生活方式在这里得不到满足,倒是可以回归最原始的状态 :)
照片传了N久,终于搞定。结论是用浏览器直接传和Flock的flickr extension去传速度实在不靠谱,还是mac上的flickr官方uploader最快,对tag和set的操作也方便.

ShangHai Set @ Flickr