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 | |
git clone https://github.com/vim/vim.git --depth=1 | |
cd vim | |
make -p $HOME/local/bin | |
./configure --prefix=$HOME/local/vim --enable-multibyte --with-tlib=tinfo --enable-pythoninterp --enable-rubyinterp --with-ruby-command=/usr/bin/ruby --with-features=huge | |
make -j24 | |
make install | |
cd $HOME/local/bin | |
for file in $(ls $HOME/local/vim/bin); do ln -sf $HOME/local/vim/bin/$file $file; done |
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> | |
using hash_t = size_t; | |
constexpr hash_t prime = 0x100000001B3ull; | |
constexpr hash_t basis = 0xCBF29CE484222325ull; | |
hash_t hash_run_time(const char* str) { | |
hash_t ret = basis; |
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 | |
# displayfile (Skim) | |
# | |
# Usage: displayfile [-r] [-g] PDFFILE | |
# | |
# Modified from "displayline" to only revert the file, not jump to a given line | |
# | |
if [ $# == 0 -o "$1" == "-h" -o "$1" == "-help" ]; then |
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
\documentclass{article} | |
\usepackage{xcolor} | |
\usepackage{listings} | |
\lstdefinestyle{lfonts}{ | |
basicstyle = \footnotesize\ttfamily, | |
stringstyle = \color{purple}, | |
keywordstyle = \color{blue!60!black}\bfseries, | |
commentstyle = \color{olive}\scshape, | |
} | |
\lstdefinestyle{lnumbers}{ |
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 <unordered_set> | |
#include <random> | |
template <typename IntType = int> | |
class distinct_uniform_int_distribution { | |
public: | |
using result_type = IntType; | |
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
class MersenneTwister: | |
__n = 624 | |
__m = 397 | |
__a = 0x9908b0df | |
__b = 0x9d2c5680 | |
__c = 0xefc60000 | |
__kInitOperand = 0x6c078965 | |
__kMaxBits = 0xffffffff | |
__kUpperBits = 0x80000000 | |
__kLowerBits = 0x7fffffff |
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
\documentclass{article} | |
\usepackage{amsmath} | |
\newcommand{\arbbv}[3][0]{\ensuremath{#2_{#1}, #2_{#1}, \ldots, #2_{#3}}} | |
\begin{document} | |
\[ | |
\arbbv{a}{n}. | |
\] | |
\end{document} |
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
/* borrowed from https://users.cs.cf.ac.uk/Dave.Marshall/C/node28.html */ | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/un.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#define NSTRS 3 /* no. of strings */ |
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 <stddef.h> | |
#include <iostream> | |
class Base { | |
public: | |
virtual void f() { | |
std::cout << "Your are calling Base::f (public)." << std::endl; | |
} | |
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 <stdio.h> | |
#define offsetof(s, m) reinterpret_cast<size_t>(&reinterpret_cast<const volatile char&>(\ | |
static_cast<s*>(nullptr)->m)) | |
struct S { | |
char c; | |
double d; | |
char cc; | |
}; |