tips

アドレス値を数値として演算したいとき

stdint.hに定義されているintptr_tまたはuintptr_tを使う.

ffmpegでiPod touch用に再エンコード

$ ffmpeg -i _INPUT_FILE_ -vcodec libx264 -vpre default -acodec libfaac -coder 0 -level 13 -threads 2 -flags loop -deblockalpha 2 -qmin 21 -sameq _OUTPUT_FILE_.mp4 入力ファイルはmpegだけど,詳しい形式はメモし忘れたので,後で調べる.

「Argument list too long」をどうにかする

ファイルの数が多い時に「mv * /path/to/destination/dir/」と打つと「Argument list too long」と怒られてしまったりする.そういう時は: find . -maxdepth 1 -name "your_wildcard" -exec mv {} /path/to/destination/dir \; while readと関数で: Example …

gccのオプションのメモ

gccで使用するオプションのメモ: -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wfloat-equal -Wpointer-arith References Warning Options - Using the GNU Compiler Collection (GCC) difference between gcc and vc …

なんとなく原因不明なビルドエラーが起こったら,リビルドしてみる

MacPortsでなぜかhelp2manがインストールできなかった.p5-locale-gettextでコケているらしい. 直感だけど原因らしい原因が分からなかったので,p5-locale-gettextをリビルド: $ sudo port -dv uninstall p5-local-gettext $ sudo port -dv install p5-loca…

Mac OS XのApacheを起動・停止・再起動など,コントロールするには

/usr/sbin/apachectlからできる.詳細はman apachectl(8)に. References man 8 apachectl

他のレポジトリにある作業中でないブランチをコピーする

AliceとBobが居て,gitで協業しようとしている. Aliceは,$ALICE_WORKING/reposというディレクトリにレポジトリがあり,masterとcur_workingというブランチがあって,cur_workingというブランチで作業中(current working branchとでも言えばいいのかな?)で…