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!
$ grunt watch --verbose --debug | |
Initializing | |
Command-line options: --verbose, --debug=1 | |
Reading "Gruntfile.js" Gruntfile...OK | |
Registering Gruntfile tasks. | |
Registering "grunt-contrib-clean" local Npm module tasks. | |
Reading /Users/alexlee/Programming/ng-boilerplate/node_modules/grunt-contrib-clean/package.json...OK |
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/FMD/.bin | |
source ~/.bin/git-completion.bash | |
source ~/.bin/git-prompt.sh | |
#============================================================================== | |
# BASH PROMPT LOOK | |
#============================================================================== | |
# Powerline | |
source ~/.vim/bundle/powerline/powerline/bindings/bash/powerline.sh | |
POWERLINE_COMMAND="$POWERLINE_COMMAND -c ext.shell.theme=default_leftonly" |
deploy django app on digitalocean | |
================================= | |
# Packages | |
sudo apt-get install python-pip python-dev python-virtualenv supervisor nginx | |
# Create dirs | |
mkdir -p /webapps/my-project/{logs,run} |
deploy django app on digitalocean | |
================================= | |
# Packages | |
sudo apt-get install python-pip python-dev python-virtualenv supervisor nginx | |
# Create dirs | |
mkdir -p /webapps/my-project/{logs,run} |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
echo '[Unit] | |
Description=High-performance, schema-free document-oriented database | |
After=syslog.target network.target | |
[Service] | |
User=mongodb | |
Group=mongodb | |
ExecStart=/usr/bin/mongod -f /etc/mongod.conf | |
[Install] |
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md)) | |
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md)) | |
all : $(SLIDES) $(HANDOUTS) | |
%.md.slides.pdf : %.md | |
pandoc $^ -t beamer --slide-level 2 -o $@ | |
%.md.handout.pdf : %.md | |
pandoc $^ -t beamer --slide-level 2 -V handout -o $@ |
#-*- coding: utf-8 -*- | |
""" | |
GIBBS SAMPLING IMPLEMENTATION FOR LATENT DIRICHLET ALLOCATION (2003) | |
IMPLEMENTED BY CHANG-UK, PARK | |
DATA FORMAT: "DocID\t WordID\t FREQUENCY\n" | |
""" | |
import sys | |
import random |