2013-01-01から1年間の記事一覧

window message

適当に抜き出しただけ 0 WM_NULL 1 WM_CREATE 2 WM_DESTROY 3 WM_MOVE 5 WM_SIZE 6 WM_ACTIVATE 7 WM_SETFOCUS 8 WM_KILLFOCUS 10 WM_ENABLE 11 WM_SETREDRAW 12 WM_SETTEXT 13 WM_GETTEXT 14 WM_GETTEXTLENGTH 15 WM_PAINT 16 WM_CLOSE 17 WM_QUERYENDSESSI…

OpenMP

C++

ExpressバージョンのVCでも、Windows SDKから omp.h、ompassem.h、vcomp.lib、vcompd.lib を取ってくれば、OpenMPが使えるというのでやってみた。 #include <iostream> #include <omp.h> using namespace std; int main() { #pragma omp parallel cout << "Hello OpenMP!" << </omp.h></iostream>…

inf

C++

※VCの場合はfloat.hに_finiteがあることがわかった。 #include <iostream> #include <cmath> using namespace std; int main() { cout << log10(0) << endl; // -inf cout << isinf(log10(0)) << endl; // 1 cout << isfinite(log10(0)) << endl; // 0 cout << (int)log10(0) <</cmath></iostream>…

引数テスト

function funcA(a, b) { Services.console.logStringMessage([(typeof a), (typeof b)]); } var h = {}; funcA(1, 2); //=> number,number funcA(3); //=> number,undefined funcA(4, h['x']); //=> number,undefined funcA(h['x'], 5); //=> undefined,numb…