Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
import macros | |
proc typeName(head: NimNode): NimNode = | |
if head.len == 0: head else: head[1] | |
proc baseName(head: NimNode): NimNode = | |
if head.len == 0: newIdentNode("RootObj") else: head[2] | |
proc isObjectDef(head: NimNode): bool = | |
head.len == 0 or head[2].kind == nnkIdent |
sudo yum install gcc python27 python27-devel postgresql-devel | |
sudo curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python27 | |
sudo /usr/bin/easy_install-2.7 pip | |
sudo pip2.7 install psycopg2 |
class conduit(object): | |
def __init__(self, iterator): | |
self.iterator = iterator | |
def filter(self, predicate): | |
return conduit(itertools.ifilter(predicate, self.iterator)) | |
def map(self, func): | |
return conduit(itertools.imap(func, self.iterator)) |
""" | |
Some python code for | |
Markov Chain Monte Carlo and Gibs sampling | |
by Bruce Walsh | |
""" | |
import numpy as np | |
import numpy.linalg as npla |