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> | |
struct Wheel | |
{ | |
wheel(char initial_escape_symbol) : escape_id(0), left_id(1), right_id(2), switch_id(3) { while(symbols[escape_id] != esc) rotate(); } | |
void rotate() { escape_id++; left_id++; right_id++; switch_id++; } | |
char getEscapeSymbol() { return symbols[escape_id]; } |
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 <ctime> | |
inline bool randomBool() | |
{ | |
return rand() % 2; | |
} | |
int heads = 0; | |
int tails = 0; |
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
import random | |
class Sampling(object): | |
def __init__(self, size_max): | |
self.__count = 0 | |
self.__samples = list() | |
self.__size_max = size_max | |
def sample(self, value): |
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 <list> | |
#include <chrono> | |
#include <functional> | |
MEASURE(ID, STATEMENT) | |
M_START(ID) | |
M_STOP(ID) | |
class Queue |
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
class FastLogger | |
{ | |
void registerMessage(int msgId, std::string& ) | |
{ | |
} | |
void logMessage(enum logType, int msgId) | |
{ | |
} |
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> | |
struct X | |
{ | |
protected: | |
int i; | |
}; | |
struct A : 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
#include <iostream> | |
struct A | |
{ | |
}; | |
struct B : A | |
{ | |
}; |
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> | |
struct Object | |
{ | |
typedef int type; | |
static void action() | |
{ | |
std::cout << "Object::action()" << std::endl; | |
} |
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 <mutex> | |
#include <functional> | |
class Price | |
{ | |
std::uint64_t value; | |
std::ratio<1, 100> value; | |
}; |
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 <memory> | |
#include <list> | |
struct Heavy | |
{ | |
char buffer[1024 * 1024 * 8]; | |
}; | |
std::list<std::weak_ptr<Heavy>> container; |