Archive for the 'Links' Category

phdfs.py, a ctypes wrapper of hadoop libhdfs for python

Saturday, May 10th, 2008

I use python and hadoop distributed file system (HDFS) to process large amount of data at work. Instead of using the regular map-reduce mechanism provided by hadoop, I have my home-made map-reduce python engine written using Pyro. It turns out it is quite efficient and sometimes it is much faster than the corresponding streaming code for some simple map-reduce work. For this kind of work, I access the file in HDFS using “hadoop fs -cat” by the unix pipe (popen) in python. It seems to me it might be useful to be able to bypass the somehow ugly unix pipe and “hadoop fs -cat” combination. There already is a SWIG wrapper of python for hdfs. However, I think it will be nice to have ctypes wrapper such that no extra compiling is necessary for installation. I spend a few nights working on such wrapper and hope it will be useful. The results is a single python module that I call “phdfs“. It provides most of the API in the libhdfs. It will be useful if one want to read, write and manipulate the hadoop filesystem with the flexible and powerful python syntax.

You can download the phdfs.py, and try it out yourself. I have not tested all the methods, so YMMV.

bugs

Tuesday, November 8th, 2005

History’s Worst Software Bugs

nice stories

Wednesday, September 28th, 2005

The road to a science Ph.D.

Part I
Part II

這個有用

Wednesday, May 11th, 2005

Boing Boing 上看到的有用的東西,特別記下來。

The Sound of iPodThe Sound of iPod

Friday, February 25th, 2005

今天看到這個 hack,實在了不起。下載了這位仁兄所錄的 iPod 之音來聽了聽,不僅讓人聯想到在若干年前,有多少對科技(或是打電玩)充滿期待的一代人,拿著錄音帶(過不了多久,就會有人問那是甚麼東西?),接到碩大無比的『微電腦』上,花了個二三十分鐘,儲存檔案,或是把電玩程式傳進那小小的記憶體裡。現在隨便一台不到一兩百美元的電話,Game boy,iPod,相機等等,都比當年的 Apple (and Apple clones) 有強太多的計算能力,但是現在的這些平台就不像當年的平台對 hack 友善了。有時候還真希望自己有精神花上數個小時來錄 iPod 之音

The Sound of iPod:
http://www.ipodlinux.org/stories/piezo/
http://vitanuova.loyalty.org/weblog/nb.cgi/view/vitanuova/2005/02/25/1

物理評論 100 年的經典的論文

Tuesday, February 15th, 2005

今天無意間發現這個網站,應該是 95 年左右收集的 Physics Review 一百年中經典的論文。雖說沒有看 hard core 的物理文章有好一陣子,但看到這些經典的論文,光看標題和摘要就讓人熱血沸騰。奇怪的是為甚麼我到現在才發現這個論文集?95 年的時候還在當兵,網路也沒現在發達,太概是如此吧!

政治與色情本質比較的有趣註腳

Friday, October 29th, 2004

Lie Girls…
This is very funny, although it seems only for men as most games for politics. Maybe, most election campaigns are just months of political porn for men.

Do you want to be smarter?

Tuesday, October 26th, 2004

Electric currents boost brain power (news.nature.com headlines)

也許好好看幾本好書的效果更好吧!

剪報

Tuesday, October 12th, 2004

我很希望這報紙上對中國的評論不是真的,但中國歷史上的確應付奴才的機會多過和平對話的經驗。有智慧的人實在不該重演舊歷史。

Chinatime1013

Read the rest of this entry »

反軍購

Friday, June 18th, 2004

人不在台灣,不然一定要去參加! http://uuu.to/619

“Students to reach their own conclusion about being a good digital citizen”

Friday, April 30th, 2004

See Wired News

有點可怕的故事,看來就是一種洗腦的過程。由 MPAA 決定怎麼樣的行為是 “a good digital citizen”? 這就像是由一個集權政府告訴你怎樣是『正確的思想』。 MPAA 不思索如何去因應因科技帶來的挑戰,卻像一個末日極權,經由各種荒謬手段來保有其獨大的地位,努力的保護其獨占發行管道所帶來的利益。

Quote form the news:

The program presents a “tremendously one-sided view of copyright,” says Wendy Seltzer, a lawyer for the Electronic Frontier Foundation. “There’s no balance; it’s entirely corporate driven. If anything, it’s an exercise in how efficiently you can brainwash students.”

Loyalty to Computers

Monday, April 26th, 2004

A BBC News talks about how a study shows that students are getting loyalty to certain computers in computer labs. Well, I guess it is simply that all computers are not built equally. Some are certainly more reliable to others. However, it seems that it is human nature that one needs to believe in something, including computers.

Well, I do hope my computers to be loyalty to me. Don’t break down when a what seems to be a harmless update is applied.