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 <memory> | |
| #include <cassert> | |
| #include <Windows.h> | |
| struct FileHandle | |
| { | |
| ::HANDLE fileHandle; | |
| //implicit | |
| FileHandle(::HANDLE h) noexcept |
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
| bool SkipIfChar(const char* str, const char** newPos, char c) | |
| { | |
| const char* pos = str; | |
| while(*pos == c) | |
| ++pos; | |
| *newPos = pos; | |
| return pos != str; | |
| } | |
| bool SkipIfNextChar(const char* str, const char** newPos, char 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
| #include <cstdio> | |
| #include <cstdint> | |
| #include <cinttypes> | |
| void MoveCursorTo(std::uint32_t line, std::uint32_t column) noexcept | |
| { | |
| std::printf("\x1B[%" PRIu32 ";%" PRIu32 "H", line, column); | |
| } | |
| void SetBackgroundColor(std::uint8_t color) noexcept |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Text; | |
| using System.Diagnostics; | |
| using System.Diagnostics.Contracts; | |
| namespace Calculator | |
| { | |
| enum SyntaxKind | |
| { |
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 <cstdint> | |
| #include <Windows.h> | |
| #include <cassert> | |
| #include <thread> | |
| #include <iostream> | |
| struct Mutex | |
| { | |
| public: | |
| void lock() |
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 <variant> | |
| #include <functional> | |
| #include <memory> | |
| #include <iostream> | |
| #include <thread> | |
| #include <chrono> | |
| #include <stdexcept> | |
| #include <Windows.h> | |
| using Win32Handle = std::unique_ptr<void, void (*)(void *) noexcept>; |
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
| #define UNICODE | |
| #include <string> | |
| #include <experimental/generator> | |
| #include <iostream> | |
| #include <functional> | |
| #include <string_view> | |
| #include <Windows.h> | |
| using namespace std::experimental; |
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 <type_traits> | |
| #include <functional> | |
| #include <tuple> | |
| #include <utility> | |
| #include <iostream> | |
| #include <memory> | |
| template<int I> | |
| struct Placeholder | |
| { |
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 <type_traits> | |
| #include <limits> | |
| #include <cassert> | |
| enum class uint32_t : unsigned int {}; | |
| constexpr uint32_t operator""_u32(unsigned long long x) { | |
| using underlying = std::underlying_type_t<uint32_t>; | |
| assert(static_cast<unsigned long long>(std::numeric_limits<underlying>::max()) >= x); | |
| return uint32_t{static_cast<underlying>(x)}; |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace GaussianOffsetsCalculator | |
| { | |
| class Program | |
| { | |
| private static long[] _fracCache = new long[30]; |