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!
'use strict'; | |
var COMPILED = !0, goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = !1; | |
goog.LOCALE = "en"; | |
goog.provide = function (a) { | |
if (!COMPILED) { | |
if (goog.isProvided_(a)) | |
throw Error('Namespace "' + a + '" already declared.'); | |
delete goog.implicitNamespaces_[a]; |
#!/bin/sh | |
# This script will migrate schema and data from a SQLite3 database to PostgreSQL. | |
# Schema translation based on http://stackoverflow.com/a/4581921/1303625. | |
# Some column types are not handled (e.g blobs). | |
if [ $# -lt 3 ]; then | |
echo "usage: sqlite2pg.sh sqlite_db_path pg_db_name pg_user_name"; | |
exit 1 | |
fi |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Start a g2.2xlarge or better (GPU instance) with https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-ffba7b94 | |
Login, username is ubuntu | |
Update a bunch of stuff and make sure cudnn R2 is used: | |
luarocks install image | |
luarocks install loadcaffe | |
luarocks install torch | |
export LD_LIBRARY_PATH=/home/ubuntu/torch-distro/install/lib:/home/ubuntu/torch-distro/install/lib:/home/ubuntu/cudnn-6.5-linux-x64-v2-rc2 |
# Template composition with inclusion | |
Every template language I have seen provides some mechanism for one template to include another, thus supporting the reuse of repeated elements like headers and footers. The included templates are called partials in Mustache parlance: | |
```html | |
<!-- home.hbs --> | |
<html> | |
<body> | |
{{> header}} | |
<p> HOME </p> | |
{{> footer}} |