星期一, 十二月 26, 2011

年终发几条笑话

国学一:

学生进私塾,先生先教“天子重英豪,文章教尔曹”。学生问:“这尔曹是什么意思?” 先生说:“尔就是你、汝,曹就是辈、们,你们说说看,尔曹指谁?” 学生们齐声答道:“我曹!”
——马伯庸

国学二:

『古文』逝者如斯夫,不舍昼夜。
『白话文』死去的人就像她的丈夫,不管是白天,还是黑夜,(都像)。

笑话三:

星期四, 十二月 15, 2011

I might be watching you!

I bought a webcam during my last trip to China. When inserted it to my Fedora desktop, It didn't work. It then lied in by drawer for almost a year. I bought another cheap cam. It didn't work either. Then I realized it is my desktop's problem. If cheese is not installed, then
# yum install cheese
$ cheese
Hooray!  My pictures are then on the screen.  It has no sound however.  I then tried mencoder.  It couldn't find /dev/dsp.  So,
$ sudo yum install v4l2ucp.x86_64
$ sudo modprobe snd_pcm_oss
$ mencoder -o test.avi -ovc x264 -v tv:// -tv device=/dev/video0:driver=v4l2
The video test.avi is on the disk now.  The last command can be of course run remotely.  So, be careful, I might be watching you if you are in my office.

The problem is that there is still no sound.  This is, however, enough to record a flourishing flower or alike things.

星期三, 十二月 14, 2011

Emacs + ibus

我的中文输入并不是每天都用到,因此并不是每次启动机器都启动 ibus。另外 X 的输入也没有单独设置。这样就涉及到 Emacs 中文输入的问题。如下:
$ ibus-daemon -d --xim
可以解决 Emacs 不能用 ibus 输入中文的问题。这样也不需要更改Locale。

另外一个更简单的办法是在终端:
$ ibus-daemon -d
$ emacs blah.blah -nw
这个甚至可以避免窗口 Emacs 中制表键可能失效的麻烦。
在 empathy 中右击输入窗口可以选择ibus输入法。

星期一, 十二月 05, 2011

Generation of Chi squared or student t distributed random numbers with MKL

The MKL includes 11 random number generators (RNG) with continuous distributions.  RNG for Χ2 and student t are not included.  They can however be obtained with the 11 available RNG.

Posting source codes

Frequently, I need to post sample source codes, either in C, C++ or other languages, here or some forum elsewhere.

星期五, 十二月 02, 2011

有马先生

十五年前,我还在读研究生,遇到一位来自日本的互访教授。他叫有马义信。有马的日语发音是 Olima。他右手的食指还没了,说是因为他父亲农场的机器太多。说来也奇怪,这么长时间过去,这些细节我还记得。

星期四, 十二月 01, 2011

Fedora's virtual service vs Amazon AWS

From now and then, I need to test some software on my desktop.  To prevent crashing my system, it is better to have some virtual systems.