さくっとDBを用意したいのでアンチョコ。
最小構成にするならスーパーユーザをそのまま使う方法ある。開発環境用なら正直これでも……。
| /// @file | |
| /// @brief xtw::com_trace - object tracer with vtable injection | |
| /// @author (C) 2024 ttsuki | |
| /// Distributed under the Boost Software License, Version 1.0. | |
| #pragma once | |
| #include <Windows.h> | |
| #include <combaseapi.h> |
| <?php | |
| function array_gcd(array $arr): int | |
| { | |
| return array_reduce($arr, function (int $a, int $b): int { | |
| while ($b) { | |
| $r = $a % $b; | |
| $a = $b; | |
| $b = $r; | |
| } |
| // Walker's Alias Method (C++) | |
| #include <utility> | |
| #include <initializer_list> | |
| #include <vector> | |
| #include <random> | |
| #include <stdexcept> | |
| template <class Label, class Probability = size_t> | |
| class weighted_random_choice // implements Walker's Alias Method |
| // coro_task: A study of C++20 co-routine task system | |
| #pragma once | |
| #include <array> | |
| #include <coroutine> | |
| #include <utility> | |
| #include <future> | |
| #include <optional> | |
| #include <stack> |
今まで、fetchとかthenとか、他のコードみて雰囲気で使ってたけど、つまるところ、何がどうなってるのか、ざっくりわかっておきたくなったので、今更ながらちょっと勉強した、その備忘メモ。
JavaScriptはシングルスレッドだけど非同期実行の仕組みがある。
古くは setTimeout だけど、今はPromiseとThenableなる概念があって、 fetch() とかがこれで実装されている。
MDNでは、ある非同期処理Promiseは「待機 (pending) 」「履行 (fulfilled)」「拒否(rejected)」のいずれかの状態を持つと説明される。
| syntax on | |
| set nocompatible | |
| set number | |
| set wildmenu | |
| set wildmode=full | |
| set mouse=a | |
| set laststatus=2 | |
| set incsearch | |
| set hlsearch | |
| set showcmd |
| #include <utility> | |
| namespace detail | |
| { | |
| enum struct CallConv | |
| { | |
| Cdecl, | |
| StdCall, | |
| }; |