バイオ燃料

デュポンがセルロースから燃料をつくるベンチャーを立ち上げ、だって。
デンプンから燃料を作るのはつまり酒であり、長年にわたる人類の英知の蓄積が使えるわけだ。しかし、その分人間が食べる分が減るわけであり、世界の人口が急増しているのに穀物生産量は増えてない、という現状において非常に好ましくない。
セルロース、つまり藁なんかはいままで、せいぜい藁葺き屋根や麦わら帽子に使うくらいであんまり役に立ってきてないので、これは歓迎すべき動きだ。しかし、そうとう難しいんだけどね。
日本の微生物学の人たちも頑張らなあかんのです。

Larry King Live

今回のアメリカ滞在はなんだか忙しくて、テレビを見るヒマもなかったのだが、最後の夜になんとなく CNN をみてる。
たまには政治の話でもしようか。
こっちの大学の人と、今回の大統領選はいつもと全然違うよね、と話をしたのだけれど、アメリカは大きな変革の時を迎えているのかもしれないね。国民の関心が、日本より高い気がする。大統領制、という仕組みのせいなのかもしれないけど、日本とはみんなの政治に対する関与の意識が全然違うように思う。きょうびのアメリカ政府には言いたいことがないわけではないが、日本やドイツに民主主義を教えてくれた古き良きアメリカの魂はまだ死んでいないんだな、と感じた。
日本人は変われるか。
正直、俺らの国はこのままじゃだいぶやばいぜ。

Sony すごいぜ!

いわゆる Sony Timer が怖いので、普段は Sony 製品をあんまり買わない (特に可動部分があるもの…) のだけれど、ヘッドフォンとかはやっぱり Sony ってすごいなー、と思う。スピーカーとかヘッドフォンとかは、けっこう Sony のを持ってるな。
で、最近買ったのは MDR-NC500D というノイズキャンセリングヘッドフォン。前に使っていた MDR-NC50 なんかと比べると、ちいさくて頼りない感じの外観だが、信号処理部がデジタル化されており、性能は全然違う。ノイズ低減効果はものすごくて、飛行機ではきわめて快適。しかも、音質はかなりのものだ。
MDR-NC50 はいかにも、「頑張ってノイズ低減しているので、ちょっと音も悪くなりますごめんなさい」的な感じ。スイッチを入れたときの感覚は、水に潜ったような感じだ。おそらくアナログ処理だと調整がシビアで、最初に買ったときは数日でハウリングがひどくなって交換してもらった。MDR-NC500D は、ノイズ低減の感じも、音楽の聞こえ方もすごく自然。ドアとか窓を閉めたような感じで、でも、人の声とかはちゃんと聞こえるので、機内のアナウンスなんかは聞き漏らすこともなくていい感じだ。
問題は、
– あんまり電池がもたない (内蔵で15時間、外付け単3×2で10時間)
– 電池が切れると何もきこえなくなる
– 軽いけど、ハンガーなんかの強度がちょっと頼りないかも。ヨドバシの展示品はぽっきり折れてた…
といったところ。でも、いいところのほうがはるかに多いね。大事に使おう。

Xilinx ISE 10.1 on OpenSuSE 10.3 x86_64

Xilinx ISE 10.1 works pretty well on my OpenSuSE 10.3/x86_64 on Intel’s Core2Quad processor. However, I couldn’t compile the included Platform Cable USB driver, so I couldn’t program my FPGA cards. There’s a possible solution (with a non-proprietary driver) on a wiki page in University of Heiderberg, but it was a little bit old and written in German.
Here’s my solution with the non-proprietary driver (the master site of the driver is written in English! I didn’t know…) I took yesterday:
[ Step 1: Things to be installed by YaST ]
– libusb-devel (a library to handle USB devices)
– fxload (something to load firmware on some USB devices, including the Xilinx cable)
[ Step 2: get driver stuff ]
– Checkout the driver by: wget ‘http://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver?a=snapshot;h=HEAD’
– Official documentation at http://www.rmdir.de/~michael/xilinx/.
[ Step 3: setup udev ]
– Confirm that Platform Cable USB’s firmware exists at: YOUR_ISE_HOME/bin/lin64/xusbdfwu.hex (it must be, if you have a valid ISE installation)
– Edit /etc/udev/rules.d/xusbdfwu.rules. You may want to write /usr/share/xusbdfwu.hex to ISE_HOME/bin/lin64/xusbdfwu.hex.
SYSFS{idVendor}==”03fd”, SYSFS{idProduct}==”0008″, NAME=”windrvr6″
BUS==”usb”, ACTION==”add”, SYSFS{idVendor}==”03fd”,SYSFS{idProduct}==”0007″, RUN+=”/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE”
BUS==”usb”, ACTION==”add”, SYSFS{idVendor}==”03fd”,SYSFS{idProduct}==”0009″, RUN+=”/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE”
BUS==”usb”, ACTION==”add”, SYSFS{idVendor}==”03fd”,SYSFS{idProduct}==”000b”, RUN+=”/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE”
BUS==”usb”, ACTION==”add”, SYSFS{idVendor}==”03fd”,SYSFS{idProduct}==”000d”, RUN+=”/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE”
BUS==”usb”, ACTION==”add”, SYSFS{idVendor}==”03fd”,SYSFS{idProduct}==”000f”, RUN+=”/sbin/fxload -v -t fx2 -I /usr/share/xusbdfwu.hex -D $TEMPNODE”
ACTION==”add”, BUS==”usb”, SYSFS{idVendor}==”03fd”, MODE=”666″
– Restart udev, or reboot the Linux box to load the firmware. Once the firmware is loaded successfully, the status LED of the cable will light.
[ Step 3: build the driver ]
– Extract the driver you got from gitweb in step 2.
– just do: cd usb-driver; make lib, and you’ll get libusb-driver.so. This library emulates the driver (I don’t know how, but this is really great…). If you’re running 32bit Linux, you may have to run “make lib32” instead, but I’m not sure.
– Copy libusb-driver.so to anywhere you like.
[ Step 4: hack iMPACT to use the driver ]
– cd to YOUR_ISE_HOME/bin/lin64
– mv _impact _impact.bin
– vi _impact
#!/bin/sh
LD_PRELOAD=/YOUR_PATH/TO/LIBUSB_DRIVER_DOT_SO/libusb-driver.so $0.bin $*
– chmod a+x _impact
And try to launch “impact”. Then you’ll get connected!
[ Appendix: problems currently I have ]
– iMPACT fails to detect the cable when iMPACT is launched from ISE.
– Once iMPACT have failed to connect, I have to reboot my Linux box 🙁

Portable process killer with GLib

Since Windows API (and MinGW) doesn’t have fork() / exec() calls, I love GLib’s g_spawn_sync() and its friends to spawn child process in portable (and Unix like) way.
However, GLib provides nothing like kill() to terminate processes. So I have to find a way to kill a process by myself. As a portable process identifier, g_spawn_sync() gives GPid. This is defined in GLIB_PREFIX/lib/glib-2.0/include/glibconfig.h as:
– Unix: typedef int GPid;
– Win32: typedef void * GPid;
The one for Unix is equal to pid, and the one for Win32 is equal to HANDLE (defined in winnt.h, as “typedef void *HANDLE;”).
So, a process launched by g_spawn_sync() may be killed by:
kill(GPid p, 15);
TerminateProcess(GPid p, UINT return_code);
MSDN document says “The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.”
Source code of a Gimp plugin gives a good example, but I haven’t tested it yet. Hope this works…

.Mac bookmark

家の iMac G5 (Leopard) だけ、.Mac で何度同期しても Safari の bookmarks が古いままで更新されず、なんでかなー、と思っていた。
ふと思い立って、bookmarks を全部削除したらあらふしぎ、.Mac な bookmarks が現れました。
なんでー!?!?!?
まあ、ちゃんとみられるようになったから、いいのだ。

カーボン

4月号のサイクルスポーツをやっと読んでいる。
アメリカのフレームビルダーのコメントに、「なんでスチールバイクが流行ってるかって?プラスチックの自転車に飽きちまったんだろ」というのがあった。なるほどね。
昔は僕もカーボンの自転車ほしいなー、と思ったこともあったんだけど、やっぱりスチールフレームだろ、と思う今日この頃。

Xilinx Platform Cable USB

Linux な開発環境は OpenSuSE 10.3 を使っており、Xilinx ISE はどうやら動きそうなのだが、Platform Cable USB のドライバがコンパイルできない。こまった。
http://stefan.endrullis.de/en/xilinx_ise_8.2_ubuntu.html の記事によると、non-proprietary なドライバが https://wiki.kip.uni-heidelberg.de/KIPwiki/index.php/EDV:Xilinx-USB-Treiber にあるらしい。しかしね、ドイツ語なんだよ。辞書引っ張り出してきて読むかなー。

しらす

連休にじっとしているのもアレなので、江ノ島いってシラス食べてきた。
激うま。生シラスは売り切れていたので、昆布じゃこ買った。
DSCN1966.JPG
お店で食べた丼はこんなの。これで 1800 円!
DSCN1968.JPG