2007年12月25日星期二

Transition 2


  • Safari 和 Firefox 图片色彩渲染的差别。Move to Safari!

    ff2 vs safari


    (在 Neo 的提点下,发现 firefox 3b2 果然改进了)
    ff3 vs safari


  • OSX 用 launchd 代替了传统的 init, cron, anacron, inetd, xinetd 等等,所以管理各种 daemons 的配置文件变得统一。As other open source products from Apple, launchd uses "plist file" (xml)。下面就是一个简单的例子,让 /Users/eickgadias/Unix/lib/launchd/daily.diary 这个脚本在每天的 3:45pm 和 4:45pm 自动运行,下载 national geographic 的每日图片,freedictionary.com 的没日名言,copy diary entry,更新汇率数据和 index quote。

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.eickgadias.daily-diary</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Users/eickgadias/Unix/lib/launchd/daily.diary</string>
    </array>
    <key>StartCalendarInterval</key>
    <array>
    <dict>
    <key>Hour</key>
    <integer>15</integer>
    <key>Minute</key>
    <integer>45</integer>
    </dict>
    <dict>
    <key>Hour</key>
    <integer>16</integer>
    <key>Minute</key>
    <integer>45</integer>
    </dict>
    </array>
    </dict>
    </plist>

  • Hpricot 是一个挺好用的 ruby html analyzer。下面是一个在 yahoo 搜索歌词的例子。response 是一个 hpricot object,response.search("table") 是一个返回 "table" element 的 iterator。

    def yhlyric(data)
    postdata = "http://music.cn.yahoo.com/lyric.html?pid=ysearch&source=ysmi_hsch_r&p="
    postdata << URI.escape( data.join('+') )
    postdata << '&mimetype=lyric&source=ysmi_hsch_r'
    response = Hpricot(open(postdata))
    i = 0
    response.search("table").each do |table|
    if i > 1
    break
    end
    i += 1
    puts ""
    table.inner_html.to_s.gsub(/(<br \/>)+/, "\n").gsub(/<[^>]+>/, "").each do |line|
    if not line =~ /^[ \t]*$/ and not line =~ /^[ \t]*(发送|查看)/
    puts line.gsub(/&nbsp;/, "").gsub(/^[ \t]*/, "").gsub(/[ \t]$/, "")
    end
    end
    end
    end

  • mitbbs 的热点话题从来离不开外嫁女,北美 wsn,更有甚者说趁着学校报销保险生个孩子啥的。还是 tianya 好。看月光的单骑西藏帖,格外心动。身体下地狱,眼睛上天堂,灵魂归故乡

    那一天
    闭目在经殿的香雾中
    蓦然听见
    你诵经的真言

    那一月
    我转动所有的经筒
    不为超度
    只为触摸你的指尖

    那一年
    我磕长头匍匐在山路
    不为觐见
    只为贴着你的温暖

    那一世
    我转山转水转佛塔呀
    不为修来世
    只为在途中与你相见

  • 教会里的老人讨论《金婚》,小孩讨论



  • 朋友一句“还记得陈楚生吗”让人想起一夜:
    这一夜是伤心夜
    这一刻说再见
    这一夜是孤独夜
    半瓶酒和半支烟

    20071221-night_kitchen (by Phidias)

7 条评论:

Neo 说...

观察真是细心,我还没有发现两个浏览器在色彩上的差异。
Safari工具栏上的那个剪刀的图标是做什么用的?Windows版好像没有啊。

Neo 说...

另外打开OpenID Commenting吧!
http://buzz.blogger.com/2007/12/openid-commenting.html

Michael 说...

噢,是 open page in dashboard~

Unknown 说...

爽啥呢,现在?

Michael 说...

不爽呢,没钱出去玩,不就过圣诞么

Unknown 说...

你小子那么多钱还没钱啊?
老吴回国了。在家爽着呢。

Michael 说...

回国当然爽啊,在这里慢慢算税