ハブ君の寝言

日記のような何か

2010-05-01から1ヶ月間の記事一覧

epsでグラフの出力

完全に毎回ググってることをメモするだけの日記状態gnuplotで毎回同じコマンド検索してるからメモ > plot "data_file" notitle use 1:2 with line > set terminal postscript > set output 'data.eps' > replot んで、これだとepsに出力されないっぽい? eps…

文字列配列のmalloc

c

よく使うけど、毎回間違えたりして死ぬのでメモ char **elem; int i; elem = (char**)malloc(sizeof(char*)*N); for(i=0;i

str2double

c

"123 456"って感じのデータをdoubleにする関数。書いて気づいた。小数点どうすんのって まぁいいか void str2double(char *str, double *x, double *y){ int i=0; *x = 0.0; *y = 0.0; while(str[i]!=' '){ *x = *x * 10; *x += str[i] - '0'; i++; } i++; w…

%02x

馬鹿すぎる ダチックプログラムはなるべくやめようとしてたのに…。無駄な分岐を削除して回ったので多少は処理がまともになったのかな…before if(k<16) fprintf(fd, "0%x ",k); else fprintf(fd, "%x ",k); aftar fprintf(fd, "%02x ",k); はい、馬鹿でしたね…

parity

parityのオンオフをチェックボックスで切り替えてみたしかし、 System::IO::Ports::Parity::Even; System::IO::Ports::Parity::Odd; System::IO::Ports::Parity::Mark; System::IO::Ports::Parity::Space; の選択くらいは出来るようにした方がいいのかなぁ… …