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> | |
#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
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 <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
#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 <iomanip> | |
//using namespace std; | |
void display(double n) | |
{ | |
std::cout << "Flottant : \"" << n << "\" (précision " << std::cout.precision() << ")" << 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 <vector> | |
#include <queue> | |
#include <list> | |
#include <set> | |
#include <unordered_set> | |
#include <algorithm> | |
using namespace std; |
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 <math.h> | |
/* | |
* Complete the function below. | |
*/ | |
int getIntegerComplement(int n) { | |
if(n <= 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
#include <stdio.h> | |
typedef struct | |
{ | |
int a; | |
char b; | |
int c; | |
char d; | |
} s1; |
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 <stdio.h> | |
int main(int argc, char* argv[]) | |
{ | |
union | |
{ | |
signed short int signed_short_int; | |
unsigned short int unsigned_short_int; | |
struct {unsigned char char1; unsigned char char2;} s; | |
} u; |