GLOBAL and struct

Refer to: Gnu - Global - Help - How to find the definition effectively

To put the story even shorter, the GNU GLOBAL will not treat C struct as definition, but as other symbol' . This means you may only find a struct withglobal -s`, which will give you lots of irrelevant results.

This feature is in the GLOBAL plans for the future already, which means it might be implemented sometime in the future. For now, it’s better to use GLOBAL to trace how the program runs, the relationship between functions, rather then finding the semantic details. For the semantic side, the ctags or etags is still my first choice.

A small tip for PIL

PIL stands for Python Imaging Library. It is fairly useful when it comes to handling images under python. However, it comes with a pet peeve to me: the show() method of a Image object will execute sh xv <imagefile>I don’t have xv installed on my system, neither do I want to since it’s shareware.

Now I really don’t know why I haven’t came out with this idea before: simply create a symbolic link /usr/local/bin/xv and link it to the display utility that comes with the common image handling package imagemagick then everything will work just fine.

最佳 Mail Solution ?

我相信一直以來,處理 email 應該是許多人的煩惱,或是根本不知道可以更加方便。

假如用免費的 mailbox,目前網路上提供最大的 gmail 是將近 3GB 左右,若是主要存文件檔,足夠了。而且考慮到 Google 有其他 PIM (personal information management) 相關的功能如 contacts, calander,事實上已經可以做為相當好的選擇。

但實際生活中,經常 mail 都有附件,以個人經驗來講,從 1998 年至今,大部分附加檔能刪就刪的結果,也有個 1.x GB,如果不刪,3 GB 可能還不夠。考慮到現在硬碟這麼便宜,很多人其實還是希望把信件下載,放到自己的電腦中。這方法有兩個問題:

其一是,必須選擇好的郵件處理程式。如果存 Outlook,我們知道 Outlook 以及 Outlook Express 在處理大檔案上都有些問題,mail 存量一多,速度以及穩定性就會減低。更何況我必須持續使用要付費的 Microsoft 軟體,才能看到我自己的信件。病毒、垃圾信等等問題也很困擾。

比較免費 Webmail 與 收信程式 (MUA)

Webmail 本地端
容量 受限制,2.8G左右 只受硬碟限制
防毒 需自備軟體
防垃圾信 需自備軟體

問題二是,如此會造成所有 mail 存在同一台機器,無法在各處存取,少了 web 的方便性。

在 Linux 下(正確的說,是 Unix-like 系統下),對此問題其實有現成的解法。大概的架構是這樣的:

利用 fetchmail 把各地方的個人信件集中收下來 -> 傳遞給 linux server 的 MTA (mail transfer agent) -> MTA 投遞到對應的使用者的 Maildir/mbox -> 前端處理:病毒、垃圾信、過濾分類等等 -> 使用者用自己的帳號連到 linux server 的 imap server,讀取信件。

這樣架構的好處是,利用 IMAP 或是在伺服器上自裝 webmail,只要有網路就可以存取自己的所有信件。連到伺服器上直接用 console 的 mail client 如 mutt 等等,也是很好的選擇。大概需要的軟體為:

  • fetchmail: 用 pop 把信件從遠端收取到本地端的 MTA
  • exim or other MTA: exim 有套件 exim-config 可以簡易設定。功能彈性也夠。
  • procmail or maildrop: 在 MTA 投遞到使用者這邊以後,可設定先經過這些程式做前端處理。彈性很大,可以直接過濾、轉寄等等,也可以先掃毒、垃圾信。
  • bogofilter: 不建議用 Spam Assassin,效果並不好。bogofilter 理論上應該不錯,不過我目前還沒時間研究怎麼設定。
  • Clam AntiVirus: 沒需要用到過,因為在 linux 使用環境下實在不怎麼怕病毒信。若有 widows client 可能會需要裝起來。
  • bincimap: 其實有很多其他選擇,若要裝 Courier IMAP 這種大傢伙當然也可以,我是裝了個輕量級的 bincimap 符合需求就好。

Winodws 下 mail client 的選擇:

  • Outlook Express: 不要用。
  • Outlook: 因為有完整 PIM 功能且各家軟體支援好,所以可以一用,但在許多信件時,IMAP 的速度還是很爛。
  • Thunderbird: 真的相當不錯,速度快,寄出的 mail 也符合公定規格。最可惜的就是通訊錄功能不怎麼樣,而且不支援 todo/ calander 等等 PIM 功能。

Linux 下:大部分都很不錯。

  • Evolution 功能最強,很像 Outlook,不過對 IMAP 的支援並不很好。不很好的部份是public folder,一般應該比較少用到,所以無妨。推薦使用。
  • Thunderbird: 也不錯,但一樣,沒 PIM 的部份不如 Evolution。但 IMAP 支援是目前圖形介面 mail client 最完整的。
  • mutt: 我的首選。命令列、快速、而且連到伺服器就可以使用,連把 IMAP 標頭抓到本機都免了。