Archive for March, 2009

metaSendsEscape

Monday, March 30th, 2009

Occasionally we can found that the Bash key-binding such as M-f/M-b will not work in XTerm (this happened both in my laptop and desktop), to solve this problem, just press `Control’ and left mouse and check the item `Meta Sends Escape’ from the main options.

To turn it on permanently, add the following line to configure file ‘/etc/X11/app-defaults/XTerm’:

*metaSendsEscape: true

无题

Saturday, March 28th, 2009

已经很久没有在这一亩三分地写下稍许文字,而每次动笔的冲动总会在不经意间悄然消融。隐约中有一股落寞与寂寥,无法言语。

断断续续的,SICP已经只剩最后一章没看了。因为工作关系使用了一段时间Ruby,我觉得这是最接近Lisp的语言之一,一切都很自然,仿佛邂逅一位多年不见的好友,一点都不陌生。最近又有点迷上Haskell,读完SICP第四章特别是逻辑程序设计那一节后,居然连Haskell代码看起来也挺顺眼。Solidot上有篇文章说,“程序设计语言就像女朋友:新的更好,因为你想变得更好。你认为学了新语言就能成为更好的程序员。”

我个人认为这在某种程度上是一种排遣方式 - 旧语言的习惯已经根深蒂固,很难找到进步的喜悦。新语言对程序员而言是一种新鲜感和收获感 - 在了解到一定程度后继续重复该循环。

文章里还说:不要追求你不需要的东西。

[招聘]: Sr. Software Engineer

Wednesday, March 25th, 2009

Job Description:
Basic project management skill
Basic people management skill
Good communication skill
Good oral & written English

Experience in building scalable infrastructure software or distributed systems
Experience in Web service design and implementation, especially RESTful Web service

Experience in IT infrastructure architecture
Experience in networking
Experience with virtualization technologies, especially VMWare

Programming experience in C, C++, Python, Ruby, Java
Experience in Linux
Security fundamentals

有意者电邮: liqun82 [at] users.sf.net

cset-100

Wednesday, March 18th, 2009

今天向自己的hg仓库检入了第一百个changeset,初步完成了自己的第一个代码生成工具。回头在看看这五百行Scheme代码,我确信自己很不喜欢它们 — 直白但流于杂乱。

这几天读cgia才豁然发现,在聪明的程序员手中,很多枯燥的工作都能以优美的方式解决。问题是,很多时候,自己缺乏那种视角,所谓“不识庐山真面目,只缘身在此山中”。

如果让我重写,我可能会用ERB来解决之。Template System的好处是数据和逻辑分离,而我现在的Scheme代码中直接hard-code了目标代码。

g_thread_init

Wednesday, March 11th, 2009

This afternoon I spent almost two hours hunting a memory leak reported by valgrind. It said that there are 2034 bytes definitely lost in g_hash_table_new_full(), but I am pretty sure that g_hash_table_destroy() is invoked with each key been passed to g_free().

The fix turned out to be a slight modification of call sequence to g_thread_init(), from:

  1. create hash table
  2. add hash entry
  3. g_thread_init()
  4. reclaim hash table

to:

  1. g_thread_init()
  2. create hash table
  3. add hash entry
  4. reclaim hash table

then, the error memory leak error just vanished.