Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
''' | |
(c) 2011, 2012 Georgia Tech Research Corporation | |
This source code is released under the New BSD license. Please see | |
http://wiki.quantsoftware.org/index.php?title=QSTK_License | |
for license details. | |
Created on March, 5, 2012 | |
@author: Sourabh Bajaj | |
@contact: [email protected] |
# First, try to get question body with default filter | |
μ> (fmap head . askSE $ questionsOnUsers [972985] <> site "stackoverflow" ) >>= (^! field "body") :: IO String | |
*** Exception: user error (key "body" not present) | |
# Okay, create appropriate filter for this task and get its name | |
μ> (askSE $ createFilter ["question.body"] [] "default") >>= (^! field "items" . fields "filter") :: IO [String] | |
["!9hnGssGO4"] | |
# See | |
μ> (fmap head . askSE $ questionsOnUsers [972985] <> site "stackoverflow" <> filter "!9hnGssGO4") >>= (^! field "body") :: IO String |
package streams | |
import common._ | |
trait GameDef { | |
case class Pos(x: Int, y: Int) { | |
def dx(d: Int) = copy(x = x + d, y) | |
def dy(d: Int) = copy(x, y = y + d) |
Feature: search for movies by director | |
As a movie buff | |
So that I can find movies with my favorite director | |
I want to include and serach on director information in movies I enter | |
Background: movies in database | |
Given the following movies exist: | |
| title | rating | director | release_date | |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns | |
Disk seek 10,000,000 ns |
#!/bin/bash | |
# Create and deploy a Python/Flask "hello world" app on Heroku. | |
# by James Thornton, http://jamesthornton.com | |
# To run it, do: | |
# $ heroku login | |
# $ bash setup.sh helloworld | |
# $ cd helloworld |
#include <iterator> | |
#include <algorithm> | |
#include <vector> | |
#include <map> | |
#include <set> | |
#include <iostream> | |
#include <cassert> | |
#include <memory> | |
#include <future> | |
#include <chrono> |
Forever a work in progress.
I recommend you install these from the python package manager - pip
.
Keep in mind that you have to resolve the dependencies yourself(unless those dependencies are python packages), if you feel that you cannot do this then please install them from your distro's package manager.
Kaggle Wiki - some resources come from here.
ML: