C言語

OpenMP テスト

MinGW GCC 4.4.0 リリース記念、OpenMP 動作テスト. テスト後に libgomp-1.dll が GPL であることに気づき絶望した. pthreadGC2.dll は LGPL なのに・・・. #include <stdio.h> #include <omp.h> int main() { int i; #pragma omp parallel for for(i = 0; i < 20; i++) { pr</omp.h></stdio.h>…

Apache のアクセスログを TSV に変換する

setbuf 重要. stdout に fflush するのは初めてだw #include <stdio.h> int main() { int c; int q = 0; int b = 0; char buf[BUFSIZ]; setbuf(stdout, buf); while ((c = getchar()) != EOF) { switch (c) { case ' ': case '[': case ']': case '"': if ((c == ' ')</stdio.h>…

Symantec AntiVirus のウインドウをタスクバーから消す

昨日フルスキャンをかけている途中で間違って止めてしまった. 意味も無くタスクバーを占拠するせいだということで、隠してしまうことに決めた. #include <tchar.h> #include <windows.h> #define BUFFERSIZE (1024) #define SAVSTR _T("Symantec AntiVirus") BOOL IsSAVWindow(HW</windows.h></tchar.h>…

固定長配列へのポインタ

型宣言周りは Delphi の方が何倍も分かりやすいな... typedef BYTE (*BYTETRIPLE)[3];