View gist:5e737e8ceb65695db7f309ed5a9fbade
This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am bastih on github. | |
* I am bastih (https://keybase.io/bastih) on keybase. | |
* I have a public key ASCp-2LNJOtKuUYKBX2HTUDz4TXIvhf0_TeyPmlxQ1yDPgo | |
To claim this, I am signing this object: |
View compile_emacs.sh
This file contains 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
# install needed libraries | |
sudo yum install texinfo libXpm-devel giflib-devel libtiff-devel libotf-devel automake ncurses-devel | |
# compile autoconf | |
cd /tmp | |
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2 | |
tar xjvf autoconf-2.68.tar.bz2 | |
cd autoconf-2.68/ | |
./configure && make && sudo make install |
View gist:3c786b103bda1974b578
This file contains 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 | |
#ifndef NDEBUG | |
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
template <typename T> | |
void print(T arg, std::string delim = " ") { |
View gist:9391405
This file contains 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> | |
#include <sstream> | |
int main() | |
{ | |
std::string number = "111111111.2"; | |
std::cout << std::setprecision(20) << atof(number.c_str()) << std::endl; // double: 111111111.20000000298 | |
std::stringstream ss; | |
ss << number; |
View setup.sh
This file contains 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/sh | |
sudo apt-get -y install sphinx-common emacs24-nox gdb valgrind tmux zsh perl ruby python-virtualenv | |
sudo apt-get -y --no-install-recommends install doxygen graphviz | |
git clone git://github.com/ndbroadbent/scm_breeze.git ~/.scm_breeze | |
curl -L http://cpanmin.us | sudo perl - App::cpanminus | |
sudo cpanm Term::ANSIColor Getopt::ArgvFile Getopt::Long Regexp::Common |
View gist:5947369
This file contains 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
#ifdef _LIBCPP_VERSION | |
template < | |
typename kT, | |
typename vT, | |
typename comp=typename std::map<kT, vT>::key_compare, | |
typename alloc=alloc_adapter<typename std::map<kT, vT>::value_type> | |
> | |
using map = std::map<kT, vT, comp, alloc>; |
View gist:5890712
This file contains 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 <boost/operators.hpp> | |
// Mostly inspired by boosts strong typedef, but without the macros | |
// Resulting type is ordered just like the wrapped type | |
template <typename T> | |
class strong_typedef : boost::totally_ordered1<strong_typedef<T>, boost::totally_ordered2<strong_typedef<T>, T>> { | |
public: | |
strong_typedef() = default; | |
strong_typedef(const strong_typedef & t_) : |
View gist:5804733
This file contains 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
cmake_minimum_required(VERSION 2.8) | |
set(CMAKE_DISABLE_SOURCE_CHANGES ON) | |
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) | |
set(CMAKE_VERBOSE_MAKEFILE OFF) | |
set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}) | |
project(bencho C CXX) | |
find_library(PAPI NAMES papi) |
View gist:4643077
This file contains 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
struct A { | |
template <bool b> | |
void foo () {} | |
}; | |
template<class T > | |
struct B { | |
void foo() { | |
T t; | |
t.foo<false>(); // fix via: t.template foo<false>(); |
View test.cpp
This file contains 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 <vector> | |
#include <string> | |
#include <iostream> | |
enum class clt { | |
integer, | |
fp | |
}; | |
class ColumnMetadata { |
NewerOlder