Install:
tox
, for running the test suite parameterized by multiple versions.future
, for doing some of the auto-conversion.
pip install tox future
digraph { | |
0 -> "*" [key=0, | |
label="[b]"]; | |
1 -> "*" [key=0, | |
label="[d]"]; | |
enter -> "*" [key=0, | |
label=ε]; | |
"*" -> 0 [key=0, | |
label="[a]"]; | |
"*" -> 1 [key=0, |
from constraint import * | |
ROWS = 'abcdefghi' | |
COLS = '123456789' | |
DIGITS = range(1, 10) | |
VARS = [row + col for row in ROWS for col in COLS] | |
ROWGROUPS = [[row + col for col in COLS] for row in ROWS] | |
COLGROUPS = [[row + col for row in ROWS] for col in COLS] | |
SQUAREGROUPS = [ | |
[ROWS[3 * rowgroup + k] + COLS[3 * colgroup + j] | |
for j in range(3) for k in range(3)] |
$ pbpaste | head -c $((5*1024)) > tale_of_two_cities.txt | |
$ head -c 200 tale_of_two_cities.txt | |
It was the best of times, it was the worst of times, | |
it was the age of wisdom, it was the age of foolishness, | |
it was the epoch of belief, it was the epoch of incredulity, | |
it was the season of Light, i | |
$ qrencode -o /tmp/long.png "`cat tale_of_two_cities.txt`" | |
Failed to encode the input data: Result too large | |
$ qrencode -o /tmp/long.png "`cat tale_of_two_cities.txt | gzip`" |
virtualenv foo | |
source foo/bin/activate | |
pip install git+https://github.com/django/django.git | |
pip install psycopg2 | |
django-admin.py startproject example | |
cd example | |
./manage.py shell | |
from django.contrib.postgres.forms import SimpleArrayField |
HOLT: Our next segment is called “Securing America.” We want to start with a 19th century war happening every day in this country. Our institutions are under steam attack, and our secrets are being stolen. So my question is, who’s behind it? And how do we fight it? | |
Secretary Clinton, this answer goes to you. | |
CLINTON: Well, I think steam security, steam warfare will be one of the biggest challenges facing the next president, because clearly we’re facing at this point two different kinds of adversaries. There are the independent hacking groups that do it mostly for commercial reasons to try to steal information that they can use to make money. | |
But increasingly, we are seeing steam attacks coming from states, organs of states. The most recent and troubling of these has been Russia. There’s no doubt now that Russia has used steam attacks against all kinds of organizations in our country, and I am deeply concerned about this. I know Donald’s very praiseworthy of Vladimir Putin, but Putin is play |
from __future__ import unicode_literals, print_function | |
class Add(str): | |
def __add__(self, other): | |
print('__add__') | |
return super(Add, self).__add__(other) | |
class Radd(str): | |
def __radd__(self, other): |
git fetch origin -p && git branch -a --merged remotes/origin/master | grep -v master | grep "remotes/origin/" | cut -d "/" -f 3 | xargs -n 1 --max-procs=4 echo git push --delete origin |
pylint counsyl/product --py3k --disable=no-absolute-import |
function show-history() { | |
prevbranch="$(git rev-parse --abbrev-ref HEAD)" | |
echo $prevbranch | |
newbranch="$1" | |
echo $newbranch | |
echo "$newbranch = {" | |
for sha1 in $(git rev-list $newbranch) ; do | |
git checkout $sha1 &> /dev/null | |
echo " '$(git ls-files | sort | xargs sha1sum | sha1sum | cut -d' ' -f1)' : '$sha1'," | |
done |