image google 硬兔

image google “硬兔”,會出現儀隊耶 XD

Self-reproduce

Jserv’s blog 上看到一篇文章:
自我複製程式理論依據
提到 zao 的文章: http://s88.dyndns.org/index.php?p=144#more-144 ,他用
Turing Machine 來 prove 並 implement 一個 self-reproduce 的程式。

寫得還不錯 :)

FTP to SMTP

嘗試在自己的機器上 telnet port 21 (proftpd),然後 PORT xxx,xxx,xxx,xxx,0,25,GET mail_with_smtp.txt。結果 PORT 失敗,看 source 發現他說 PORT 六個參數都不能為零 Q_Q 惡搞失敗 orz

glibc 的 charmaps/UTF-8

最近在試用 rxvt-unicode,遇到了一些字寬[1]的問題。於是動手修了 glibc 的 charmaps/UTF-8.gz(Debian 是放在 /usr/share/i18n/charmaps/UTF-8.gz)。如果不想自己動手來,可以下載 http://victor.csie.org/archive/UTF-8.gz,跳到之後的 locale-gen 那段。這是用 Debian 的 glibc 2.3.2.ds1-22 + EastAsianWidth-4.1.0.txt 做出來的。

動手前,請先備份 charmaps/UTF-8.gz。

首先,到 unicode.org 抓一份表格(EastAsianWidth),這個表裡面定義了亞洲字形的寬度。可參考 http://www.unicode.org/reports/tr11/。

接下來我寫了一個 script 來產生符合 glibc 的 charmaps/XXX.gz 的格式。Script 裡面的 __DATA__ 是我目前 charmaps/UTF-8.gz 的 WIDTH 那段中,所有寬度為零的 range。因為來源有好幾個,所以為了方便,就直接從那邊 copy 過來。

./EastAsianWidth.pl  UTF-8.txt

接著,


cp /usr/share/i18n/charmaps/UTF-8.gz UTF-8.gz
gunzip UTF-8.gz

解開得到 UTF-8 後,開個 editor 把檔案最後面,從 “WIDTH” 一直到 “END WIDTH” 取代成 UTF-8.txt 裡面的東西。再壓好放回去原來的位置:


gzip UTF-8
cp UTF-8.gz /usr/share/i18n/charmaps/UTF-8.gz  # you need root here.

最後,執行 locale-gen,你可能會看到:

# locale-gen
Generating locales...
zh_TW.BIG5... done
zh_TW.UTF-8...
/usr/share/i18n/charmaps/UTF-8:28542: unknown character `U00002614'
/usr/share/i18n/charmaps/UTF-8:28560: unknown character `U0000FAD9'
/usr/share/i18n/charmaps/UTF-8:28564: unknown character `U0000FE19'
/usr/share/i18n/charmaps/UTF-8:28576: unknown character `U0003FFFD'
/usr/share/i18n/charmaps/UTF-8:28579: unknown character `U000E0100'
#

後面的錯誤是說,EastAsianWidth.txt 裡面定義的字,這幾個不在你的 charmaps/UTF-8 裡面。並不是什麼嚴重的問題,可以不理他。

這樣就大功告成了!接下來如果還有問題,就是 Big5 轉碼表跟字型的問題了吧。

[1] urxvt 是用 wcwidth(3)(也就是在 glibc 裡)判斷字寬。

找到 firefox 裡面 flash plugin crash 的原因了

不知道從什麼時候開始,我的 notebook 上的 firefox + flash 總是會 crash,但在別人的電腦上、我宿舍的電腦上都不會。今天終於發現是跟 xorg 不相容(?)的問題。有人說 xorg 如果不要 load Composite 的話就沒事,不過我沒試過。另一個方法是 export XLIB_SKIP_ARGB_VISUALS=1,我是放在 .xinitrc 裡面,現在看起來很好 :D

ii xserver-xorg 6.8.2-10 the X.Org X server

glibc typo

There is a wrong spelling in file localedata/charmaps/BIG5 of glibc. The “Aprhic should be Arphic.

% This charmap is converted from:
%     ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
% and also merged several characters (/xc6/xa1-/xc7/xfc) from:
%     Aprhic Tech. CO., LTD. Big5  Unicode mapping table.

AuthComments

I change the back-end of my previous Comments to SQLite. It’s much better, uh? I rename this plugin to AuthComments at the same time.

Download AuthComments.

WWW::OpenSVN !!

Wow, wow, wow! WWW::OpenSVN on CPAN!!