之前有一段時間迷上了魔方(港譯:扭計骰),網上有不少有video的教程,成功完成後很有滿足感。(我現在的最快時間是1分20秒,基本上兩分鐘內可以完成。)在公司更引起年青的同事們一股玩魔方的熱潮。
後來有一個同事順便買了一個兩階(2x2x2)的魔方,但一直放在公司,有人試過要完成它但沒有成功,大家的感覺就是:兩階跟三階不太一樣呀。
今天突然想到要去網上看看兩階的解法,有一個網頁就簡單說了一句:基本上用跟三階類似解法,先對好底層,然後對頂層的角順序。
天!為什麼我沒想到呢?我就把三階魔方用的幾個方法,用在兩階魔方上,很快就完成了。
當我跟別人說這個的時候,他們的反應是:“二階魔方用跟三階類似解法很合理呀。”是的,但是為什麼我就想不到呢?
這讓我想起哥倫布的故事。
有時候我會覺得人們眼中的天才,就是常常能洞察到別人還沒有看到,但說出來又很簡單的東西。
A Linux Engineer who is working in Hong Kong. Interested in participating in some Open Source Software development for fun and programming practice. ;-)
Thursday, February 19, 2009
Thursday, December 18, 2008
Restart Marker for kSar
I would like to propose a new feature to kSar. I called it "Restart Marker".
Actually the system reboot information is recorded by sar. It would be convenient to show it on kSar and the graph would be much clearer if the graph line is broken when the system restart. The left-end of the gap is the last record before the system restart. And the right-end of the gap is the first record after the system restart. And the time of the marker is the exact time that the system restart.


I have already completed the patch for Linux sar file. As I know, the sar file in other OS should have similar record too but I don't have them in hand. Would anyone please provide me such sar file with system restart record so that I can add this feature for other OS?
You can download the testing ksar here.
The patch for ksar-5.0.6 is here.
Actually the system reboot information is recorded by sar. It would be convenient to show it on kSar and the graph would be much clearer if the graph line is broken when the system restart. The left-end of the gap is the last record before the system restart. And the right-end of the gap is the first record after the system restart. And the time of the marker is the exact time that the system restart.


I have already completed the patch for Linux sar file. As I know, the sar file in other OS should have similar record too but I don't have them in hand. Would anyone please provide me such sar file with system restart record so that I can add this feature for other OS?
You can download the testing ksar here.
The patch for ksar-5.0.6 is here.
Thursday, August 21, 2008
制度與發展
工作了幾年,見過不同公司、不同部門、還有不同地方的管理之後,我開始覺得:一間公司,能有一個相對來說比較能motivate人的制度,就已經很不錯了。因為一間公司的制度,很多時候都會受很多能想到的或意想不到東西影響,例如公司文化,歷史,人事關係,或者只是當權者的好惡等等。受這些因素影響下的制度,很多時不能合理地motivate人,或是把人motivate到不productive的方向去了。
例如:如果一間公司的情況是拍馬屁就能升職加薪,就會把大家motivate去努力拍馬屁,而不是做好工作。
在wikipedia中看到一段有趣的歷史:
(Ref. http://zh.wikipedia.org/w/index.php?title=邓小平&variant=zh-tw)
對香港人來說,考試已經是生命中的一部分,考試中的不公平永遠都是可以批評的話題。但是再看看沒有高考前的中國,就知道為什麼說高考是“中國被最公正公平執行的大學招生制度”:
例如:如果一間公司的情況是拍馬屁就能升職加薪,就會把大家motivate去努力拍馬屁,而不是做好工作。
在wikipedia中看到一段有趣的歷史:
鄧小平的另一大成就是恢復了全國大學統一入學考試,即高考。自從1977年恢復高考,31年中,它是中國被最公正公平執行的大學招生制度。高考讓中國大批有能青年有了獲得普遍承認的機會,讓廣大貧困家庭有了另一個改變命運的途徑。當今一些學者認為,鄧小平的理念是,推進科學化的同時推進民主化進程。
(Ref. http://zh.wikipedia.org/w/index.php?title=邓小平&variant=zh-tw)
對香港人來說,考試已經是生命中的一部分,考試中的不公平永遠都是可以批評的話題。但是再看看沒有高考前的中國,就知道為什麼說高考是“中國被最公正公平執行的大學招生制度”:
(Ref. http://zh.wikipedia.org/w/index.php?title=全国普通高等学校招生入学考试&variant=zh-tw)全國普通高等學校招生入學考試
歷史
高考于1955年設立,在1966年開始的文化大革命期 間被中斷。文革時期,上大學的資格很大程度上由家庭背景而定。全中國實施「自願報名,群眾推薦,領導批准,學校複審」的方法招收具有兩年以上實踐經驗、初 中以上文化程度的工、農、兵上大學。「工農兵學員」上大學的主要任務不是學習,而是「上大學、管大學、用毛澤東思想改造大學」,簡稱「上、管、改」。高考 的廢除破壞了中國十一年的發展教育事業,耽誤了一代人的前程,對中國文明、經濟、生產力與國力的發展造成了嚴重的阻礙。1976年毛澤東去世以後,文化大革命結束,鄧小平上任並恢復了全國高考。
Saturday, August 2, 2008
北京新景象
臨近北京奧運,雖然我覺得北京的奧運氣氛沒有傳媒說得這麼熱烈,但是變化還是有的:
這是北京首都機場的三號航站樓,挺漂亮的,格局有點像香港機場的。(還是所有新建的機場都是一個格局?)

我公司對面的CCTV新大樓,我是看著它起的。有點後悔沒有每天拍一張照片然後合起來成為一個video。
對市民有最大幫助的一定是新建的地鐡線路了。這些照片是在新開的十號線拍的。十號線從西北面的中關村一帶,沿三環往東到三元橋,再往南通過國貿一帶。可以說是連接兩大商業區(中關村一帶和國貿CBD)的重要交通工具。從前兩個區之間的交通非常繁忙,如果你要由北面到CBD,或者由東面到中關村,最少要花一個多小時在車上,現在卻是非常方便。有個同事說從北面的回龍觀到公司,坐十號線省了半個小時,現在可以到KFC吃個早餐才上班。(這讓我想起80年代末香港"搭地下鐵路,話咁快就到"那種廣告。)


還有就是最近的單雙號行車,也對空氣真的有點幫助。照片中那種晴空的感覺,平常只有下雨後才會有一天,第二天又恢復原狀了。但是最近一個星期都能保持這樣的空氣質素。真的讓整個北京都心曠神怡。

這是北京首都機場的三號航站樓,挺漂亮的,格局有點像香港機場的。(還是所有新建的機場都是一個格局?)

我公司對面的CCTV新大樓,我是看著它起的。有點後悔沒有每天拍一張照片然後合起來成為一個video。
對市民有最大幫助的一定是新建的地鐡線路了。這些照片是在新開的十號線拍的。十號線從西北面的中關村一帶,沿三環往東到三元橋,再往南通過國貿一帶。可以說是連接兩大商業區(中關村一帶和國貿CBD)的重要交通工具。從前兩個區之間的交通非常繁忙,如果你要由北面到CBD,或者由東面到中關村,最少要花一個多小時在車上,現在卻是非常方便。有個同事說從北面的回龍觀到公司,坐十號線省了半個小時,現在可以到KFC吃個早餐才上班。(這讓我想起80年代末香港"搭地下鐵路,話咁快就到"那種廣告。)

還有就是最近的單雙號行車,也對空氣真的有點幫助。照片中那種晴空的感覺,平常只有下雨後才會有一天,第二天又恢復原狀了。但是最近一個星期都能保持這樣的空氣質素。真的讓整個北京都心曠神怡。
Wednesday, July 23, 2008
My favorite comic

PHD Comics is one of my favorite comics because it really showing both the interesting and boring academic life of the graduate students.
Monday, July 21, 2008
kSar Interrupt list
Here is my new patch for kSar: Interrupt list

It was a missing feature of kSar for Linux. And an option is also added to show it in the stacked way.
Sar would capture first 16 interrupts by default. The interrupts are identified by an number, which is known as IRQ. And you can check the mapping between IRQ and the device in /proc/interrupts on the system.
I don't think normal system admin need to investigate IRQ closely. I would like to add this feature mainly because of functional completeness. And it may be useful if you want to monitor the Interrupt rate or binding, for tuning for better system response time (e.g. for a Real time system). For more information about Interrupt binding, you can see here .
Here is the patch for kSar-4.0.14.
Here is the compiled jar with this feature as an option.

It was a missing feature of kSar for Linux. And an option is also added to show it in the stacked way.
Sar would capture first 16 interrupts by default. The interrupts are identified by an number, which is known as IRQ. And you can check the mapping between IRQ and the device in /proc/interrupts on the system.
I don't think normal system admin need to investigate IRQ closely. I would like to add this feature mainly because of functional completeness. And it may be useful if you want to monitor the Interrupt rate or binding, for tuning for better system response time (e.g. for a Real time system). For more information about Interrupt binding, you can see here .
Here is the patch for kSar-4.0.14.
Here is the compiled jar with this feature as an option.
Sunday, July 20, 2008
Gift Card
It is interesting that our company have an quite flexible encouraging mechanism "recognition reward". Everyone can nominate any other colleague (usually in another team or in another Geo) to have a reward because of his/her help on their work. The reward includes a paper certificate with our marketing souvenir for a help, or a USD50 gift card (Debt card) for a big help.
Recently I got a USD50 gift card because I help the customer services team to translate some Chinese customer email when their Chinese staff is on a trip.


Then the problem comes, how to spend the USD gift card in China? I think the company who can receive Visa card can use this. And my colleagues, who have received this card before, share that they can use this card in Super Market in China, like Walmart or Carrefour.
Reference:
Utopia de Fai: Reward
Recently I got a USD50 gift card because I help the customer services team to translate some Chinese customer email when their Chinese staff is on a trip.


Then the problem comes, how to spend the USD gift card in China? I think the company who can receive Visa card can use this. And my colleagues, who have received this card before, share that they can use this card in Super Market in China, like Walmart or Carrefour.
Reference:
Utopia de Fai: Reward
Subscribe to:
Posts (Atom)