新PC移行でWSL環境をセットアップしたので、備忘録的に書いておきます。
zsh をインストールしてない場合はまずインストールします。
# WSLを導入したての場合はまずパッケージを更新する| const getRandomInt = (min: number, max: number): number => { | |
| const minCeiled = Math.ceil(min); | |
| const maxFloored = Math.floor(max); | |
| return Math.floor(Math.random() * (maxFloored - minCeiled) + minCeiled); | |
| }; | |
| const sample = <T>(n: number, arr: readonly T[]): T[] => { | |
| const result = [...arr]; | |
| const len = result.length; | |
| for (let i = 0; i < n; i += 1) { |
| #!/usr/bin/env bash | |
| set -ueo pipefail | |
| SEPARATOR=${SEPARATOR:- } | |
| TRAILING_SEPARATOR=${TRAILING_SEPARATOR:-} | |
| quote_each_args() { | |
| for i in $(seq 1 $#); do | |
| printf '%q' "${!i}" | |
| if [[ $i -lt $# ]]; then |
| #include <string> | |
| #include <unordered_set> | |
| #include <vector> | |
| #include <memory> | |
| #include <limits> | |
| struct symptom; | |
| using symptom_t = std::shared_ptr<symptom const>; | |
| using symptom_list = std::vector<symptom_t>; |
| ジェスカイ・バーン | |
| 24 lands | |
| 4 神秘の僧院 | |
| 4 凱旋の神殿 | |
| 3 シヴの浅瀬 | |
| 3 戦場の鍛冶場 | |
| 4 溢れかえる岸辺 | |
| 2 島 | |
| 2 山 |
| #include <random> | |
| #include <iterator> | |
| template<class RandomGen> | |
| auto make_random_values(RandomGen&& gen, std::size_t n) | |
| -> std::vector<typename RandomGen::result_type> { | |
| std::vector<typename RandomGen::result_type> result; | |
| result.reserve(n); | |
| for (std::size_t i = 0; i < n; ++i) { | |
| result.push_back(gen()); |
| 高まるつらみ (黒) | |
| インスタント | |
| クリーチャー1体を対象とする。それはターン終了時まで-1/-1の修整を受ける。高まるつらみがあなたの墓地から唱えられた場合、代わりにそのクリーチャーは-2/-2の修整を受ける。 | |
| フラッシュバック(2)(黒)(黒)(あなたはあなたの墓地にあるこのカードを、そのフラッシュバック・コストで唱えてもよい。その後それを追放する。) |
| #include <iostream> | |
| #include <boost/spirit/include/qi.hpp> | |
| namespace qi = boost::spirit::qi; | |
| int main() { | |
| auto word = qi::raw[+qi::graph]; | |
| auto rule = qi::omit[*qi::space] >> word >> qi::omit[+qi::space]; | |
| std::string s = " hoge fuga"; |
| #include <functional> | |
| namespace etude { | |
| template<class F> | |
| struct fixed { | |
| template<class F_, | |
| class = typename std::enable_if<std::is_convertible<F_, F>{}>::type> | |
| explicit fixed(F_ && f) | |
| : f_(std::forward<F_>(f)) { |