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<string> | |
#include<set> | |
#include<iostream> | |
#include<sstream> | |
#include<regex> | |
using namespace std; | |
set<string> get_strings(istream& is, regex pat); |
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 <string> | |
#include <sstream> | |
int main(int argc, char ** argv) | |
{ | |
std::string content; | |
std::stringstream buffer; | |
if (argc > 1) |
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
int my_int; | |
float my_float; | |
char my_char; | |
long long my_longlong; | |
struct { char a; long long b; } my_aligned; |
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 <limits> | |
#include <math.h> | |
// x[i]=i++ + 1; | |
int array[5][2] = {{1, 2, 3}, {10, 20, 30}}; | |
int x = array[++i, ++j]; |
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 <forward_list> | |
#include <vector> | |
#include <map> | |
#include <unordered_map> | |
#include <set> | |
#include <deque> | |
#define PRINT(X) std::cout << #X " -> " << sizeof(X) << 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
#pragma once | |
{% block title %} | |
{% endblock %} | |
{% for this_class in all_classes %} | |
class {{ this_class.name }} | |
{ | |
{% for this_class in this_class.private %} |
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 <cstddef> | |
void action(char arg) | |
{ | |
std::cout << "char arg -> " << (int)arg << "\n"; | |
} | |
void action(signed char arg) | |
{ |
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 <thread> | |
#include <chrono> | |
class Monitor | |
{ | |
public: | |
void onHeartbeat(int id, int status) | |
{ | |
lastTimestamp = std::chrono::system_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
class Price | |
{ | |
public: | |
Price(double val) | |
{ | |
mValue = val * 1000; | |
} | |
operator double()() | |
{ |
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 <chrono> | |
#include <cstdio> | |
#include <iostream> | |
void write_file(std::FILE* fd) | |
{ | |
for (int i=0; i<1000000; i++) | |
{ | |
std::fprintf(fd, "iteration no %d (last bit=%d)\n", i, i % 2); | |
} |