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 PRINT_TIMES = 0; | |
#define PRINT(x) PRINT_TIMES++; if (PRINT_TIMES <= 40) {std::cout << #x << " = " << x << "\n";} | |
#define PRINT_VECTOR(x) PRINT_TIMES++; if (PRINT_TIMES <= 40){std::cout << #x << " = "; print_vector(x);} | |
template <typename T> | |
void print_vector(T &v) { | |
std::cout << "{"; | |
bool first_value = true; | |
for (auto i = v.begin(); i != v.end(); ++i) { | |
if (first_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
"""Convert a nondeterministic finite state automaton to a deterministic finite state automaton""" | |
from collections import OrderedDict | |
START = 'a' | |
STATES = { | |
'a': { | |
0: {'a'}, | |
1: {'a', 'b'} | |
}, |
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/sh | |
# https://gist.github.com/x2q/5124616#file-usbreset-c-L41 | |
/usr/bin/usbreset /dev/bus/usb/001/002 |
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
name: ww | |
init: Start | |
accept: Success | |
Start,a,_ | |
GoRight,a,X,>,> | |
Start,b,_ | |
GoRight,b,X,>,> | |
Start,a,Y | |
2GoLeft,a,Y,<,< |
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
pip3 install virtualenv | |
python3.4 `which virtualenv` --python=`which python3.4` --no-site-packages env | |
mv env ~/.virtualenvs/ |
NewerOlder