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 <stdint.h> | |
#include <functional> | |
template <typename TFirst, typename TSecond> | |
struct HashablePair : public std::pair<TFirst, TSecond> { | |
typedef std::pair<TFirst, TSecond> Base; | |
public: | |
HashablePair() : Base() {}; | |
HashablePair(const Base& a) : Base(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
//header file | |
struct MyStruct { | |
public: | |
const std::unordered_map<std::string, uint32_t> str_to_int{ | |
{ "a", 1 }, | |
{ "b", 2 }, | |
//... | |
{ "z", 26 } | |
}; |
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 os | |
import sys | |
import pdb | |
import traceback | |
try: | |
your code here | |
except: | |
type, value, tb = sys.exc_info() |
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
#ifndef MEM_POOL_H_ | |
#define MEM_POOL_H_ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <vector> | |
#define USE_CPLUSCPLUS_MEMORY_POOL_FOR_PARTS 1 | |
#define MEMORY_POOL_CHUNK_SIZE 1024 |
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
/** | |
* @file chrono.h | |
* @author David Alberto Nogueira (dan) | |
* @brief std::chrono wrapper. | |
* | |
* USAGE: | |
* @code{.cpp} | |
* chronowrap::Chronometer chrono; //Declare a Chronometer | |
* chrono.GetTime(); //Start timer | |
* { |
NewerOlder