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 | |
#include <type_traits> | |
#include <utility> // for std::forward | |
#include "utils.hh" | |
#include "constraints.hh" | |
#include "const-helper.macro.hh" | |
namespace meta | |
{ | |
template <class NIL, class ...MEMBERS> |
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 <deque> | |
#include <iterator> | |
namespace tue | |
{ | |
// 10-based arbitary precision number | |
struct arbitary_precision | |
{ | |
struct one {}; |
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 "list.h" | |
typedef struct node node_t; | |
struct node | |
{ | |
node_t* next; | |
void* data; | |
}; | |
struct list |
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
.PHONY: ${MAKECMDGOALS} | |
all $(filter-out all,${MAKECMDGOALS}): .forward | |
@# no op | |
.forward: | |
@${MAKE} --no-print-directory -C build ${MAKECMDGOALS} || true # known-issue: no error return 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
#!/bin/bash | |
DIR=/tmp | |
PREFIX=$DIR/widow | |
PIDFILE=$PREFIX.pid | |
IN=$PREFIX.in | |
OUT=$PREFIX.out | |
echo -e '\e[1;33mkilling ex widow queen...\e[0m' | |
empty -k $(< $PIDFILE) |
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 <utility> | |
#include <iostream> | |
using std::cout; | |
using std::endl; | |
// move-identity | |
template <class T> T&& operator+(T& x) { return std::move(x); } | |
struct foo | |
{ |
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
// modified from the example in http://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution | |
#include <random> | |
#include <iostream> | |
int main() | |
{ | |
std::random_device rd; // this is very likely a "real" random number generator | |
std::mt19937 gen(rd()); // pseudo random number GENerator with seed from "rd" | |
std::uniform_int_distribution<> dis(0, 100); // DIStribute the result uniformly inside closed interval [0, 100] |
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 | |
#include "bitmask_decl.hh" | |
#include "bitmask_impl.hh" |