This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <future> | |
| #include <vector> | |
| #include <cassert> | |
| struct S { | |
| bool on_main_thread = false; | |
| int tasks_run_on_this_thread = 0; | |
| S() { std::cerr << "S ctor\n"; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <iostream> | |
| #include <tuple> | |
| #include <functional> | |
| template<typename Container> | |
| struct enumerate_iterator { | |
| typename Container::size_type i; | |
| typename Container::iterator v; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <algorithm> | |
| void make_killer(int size, std::vector<int>& v) { | |
| int candidate = 0; | |
| int num_solid = 0; | |
| int gas = size - 1; | |
| std::vector<int> tmp(size); | |
| v.resize(size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <iomanip> | |
| #include <algorithm> | |
| #include <iterator> | |
| #include <vector> | |
| #include <functional> | |
| #include <cassert> | |
| #include <chrono> | |
| #include <array> | |
| #include <memory> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <algorithm> | |
| #include <iterator> | |
| #include <chrono> | |
| #include <random> | |
| #include <iostream> | |
| #include <functional> | |
| std::vector<int> all_equal(std::vector<int>::size_type n) { | |
| return std::vector<int>(n, 1000000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void tessellate_sphere(...) { | |
| // tetrahedron | |
| //Point a{ { 1, 1, 1 } }, b{ { 1,-1, -1 } }, c{ { -1, 1, -1 } }, d{ { -1, -1, 1 } }; | |
| //std::vector<Triangle> tris = { | |
| // { { a, b, c } }, | |
| // { { a, c, d } }, | |
| // { { a, d, b } }, | |
| // { { b, d, c } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BasedOnStyle: LLVM # LLVM, Google, Chromium, Mozilla, WebKit | |
| AccessModifierOffset: -4 | |
| AlignEscapedNewlinesLeft: true | |
| AlignTrailingComments: true | |
| AllowAllParametersOfDeclarationOnNextLine: false | |
| AllowShortBlocksOnASingleLine: false | |
| AllowShortCaseLabelsOnASingleLine: true | |
| AllowShortFunctionsOnASingleLine: false # None(false), Inline, All(true) | |
| AllowShortIfStatementsOnASingleLine: false | |
| AllowShortLoopsOnASingleLine: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- python -*- | |
| # ex: set syntax=python: | |
| c = BuildmasterConfig = {} | |
| ####### authentication credentials | |
| web_status_users = [("user","fakefakefake")] | |
| slaves = [("local-slave", "fakefakefake"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <future> | |
| #include <atomic> | |
| #include <iostream> | |
| #include <vector> | |
| #include <chrono> | |
| template<typename Clock> | |
| typename Clock::duration | |
| check_clock_resolution() { | |
| auto s = Clock::now(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <random> | |
| #include <cassert> | |
| #include <cstdint> | |
| static int odd_bits(std::uint64_t i) { | |
| auto a = (0xFFFFFFFFu & i) ^ (i >> 32); | |
| auto b = (0x0000FFFFu & a) ^ (a >> 16); | |
| auto c = (0x000000FFu & b) ^ (b >> 8); | |
| auto d = (0x0000000Fu & c) ^ (c >> 4); |
OlderNewer