Hello World / plɹoM ollǝH

Programmers Live in Vain

2018-12-01から1ヶ月間の記事一覧

C++ Visual Studioビルド時スタイライズ&スタイルチェック

Visual Studio2017でclang-formatが使えるようになってた dungeonneko.hatenablog.com インストールするもの AStyle cpplint (要Python) AStyle Win版を落としてbinフォルダのAStyle.exeを適当な場所にコピー https://sourceforge.net/projects/astyle/files…

子プロセスもデバッグしてくれるVSプラグイン

Microsoft Child Process Debugging Power Tool - Visual Studio Marketplace

時代に逆らう人のためのregファイル

最近のWindows Updateが気にくわない Windows Registry Editor Version 5.00 // コマンドウインドウをここに開くを追加 [HKEY_CLASSES_ROOT\directory\background\shell\CommandPrompt] @="@shell32.dll,-8506" "Extended"="" "NoWorkingDirectory"="" [HKEY…

pip install PySide2

いつの間にかPySide2がpip installできるようになっているではありませんか

msbuild (Visual Studio) で並列ビルドが効かない場合

ビルドルールが違うものは並列に実行されないっぽい。例えば同じファイル名のcppが複数あるプロジェクトで出力オブジェクトファイル名を変更していたりするとこの問題にハマることがある。

非弾性衝突

const auto r = (r0 + r1) * 0.5f; // 反発係数 const auto m0 = 1.0f; // Aの質量 const auto m1 = 1.0f; // Bの質量 const auto u0 = n * dot(vel0, n); // 衝突面(法線N)に対しての垂直方向のAの速度 const auto u1 = n * dot(vel1, n); // 衝突面(法線N)…

C言語の線形合成法

http://c-faq.com/lib/rand.html

2D Perlin Noise in C++

こんな感じやろか? float interp(float x, float y, float t) { return x + (y - x) * t; // とりあえず線形 } float noise(int32_t x, int32_t y) { auto n = x + y * 57; n = (n << 13) ^ n; return (1.0f - ((n * (n * n * 15731 + 789221) + 1376312589…

カスタムビルドツールが毎回ビルドされる

出力ファイルにファイル名だけじゃなくパスも書くと大丈夫っぽい ソースと同じ場所に出力したいなら%(RelativeDir)hogeとか

実行中のプロセス計測 (Visual Studio)

デバッグ実行中の場合はデタッチしておく(これをしないとアタッチ/デタッチのメニューが選択できない) デバッグ -> プロファイラー -> パフォーマンス エクスプローラー -> アタッチ/デタッチ からプロセスを選択