Posts

Showing posts from February, 2011

Installing wxPython on MacOS(SnowLeopard)

memo for myself. It's not very simple to install wxPython on MacOSX, because it's been using Carbon and Cocoa version is released only as unstable version. install wxPython2.9 downloaded from here install python framework-build with homebrew. brew install python --framework set PYTHONPATH PYTHONPATH=$PYTHONPATH:/usr/local/lib/wxPython/lib/python2.7/site-packages/wx-2.9.1-osx_cocoa

[iPhone]UIButton does not respond when layouted.(layoutSubviewでUIButtonを動かすと、反応しなくなる)

I have been in stuck for days that UIButton does not respond to touch. I finally figured out that because overridden "layoutSubviews" function did not call it's super's "layoutSubviews" on the top. If you want to move UIButtons along layout, you should write something like, -(void) layoutSubviews { [super layoutSubviews];

文字コード一括変換のワンライナー(One Liner for changing text files' encodings)

Change all *.txt files to UTF-8 and UNIX LF. すべての*.txtのファイルをutf-8とunix-lfに変えたファイルにする for f in *.txt; do nkf -Lu -w "$f" > "${f%.txt}utf8.txt"; done -Lu unix lf -w utf-8 元データが必要なければ for f in *.txt; do nkf -Lu -w --overwrite "$f"; done

bashワンライナーで関数宣言

bashワンライナーで関数を書こうとしてつまずいた。 二つ下のディレクトリをなんどもgrepする必要があるので書いたのだが search_proj() { grep -i $1 */*.scala; } のセミコロンを忘れてて、「あれ? 定義できない」の繰り返し。