#Drone Specs
- Flat Area
- Great wifi
- Hopefully High ceilings without any crazy wires (eg. 120ft high ceilings in Berlin)
class MySpider(Spider): | |
# [...] | |
# start requests from generator | |
def start_requests(self): | |
url = 'http://some.page.tld/%s/category' | |
for page in xrange(1, 247): | |
link = url % page | |
yield Request(url=link) |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: APPLICATION | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the APPLICATION unicorns at boot | |
# Description: Enable APPLICATION at boot time. | |
### END INIT INFO |
require 'em-redis' | |
require 'redis' | |
require 'redis/distributed' | |
require "fiber_pool" | |
class Redis | |
class Distributed | |
def initialize(urls, options = {}) | |
@tag = options.delete(:tag) || /^\{(.+?)\}/ |
gonz@bamboo:~ > git clone git://github.com/maccman/juggernaut.git | |
Cloning into juggernaut... | |
remote: Counting objects: 558, done. | |
remote: Compressing objects: 100% (258/258), done. | |
remote: Total 558 (delta 309), reused 481 (delta 255) | |
Receiving objects: 100% (558/558), 576.74 KiB | 135 KiB/s, done. | |
Resolving deltas: 100% (309/309), done. | |
gonz@bamboo:~ > cd juggernaut |
module Mongoid | |
class Criteria | |
def each_by(by, &block) | |
idx = 0 | |
total = 0 | |
set_limit = options[:limit] | |
while ((results = ordered_clone.limit(by).skip(idx)) && results.any?) | |
results.each do |result| | |
return self if set_limit and set_limit >= total |
mkdir project1 | |
cd project1 | |
sbt | |
set name := "project1" | |
set version := "1.0" | |
set scalaVersion := "2.9.3" | |
session save | |
exit |
// Excercies from chapter 5: Strictness and laziness | |
def foldRight[A,B](z: => B)(s: Stream[A])(f: (A, => B) => B): B = | |
s match { | |
case hd #:: tail => f(hd, foldRight(z)(tail)(f)) | |
case _ => z | |
} | |
def exists[A](s: Stream[A])(p: A => Boolean): Boolean = | |
foldRight(false)(s)((x,a) => if (p(x)) true else a) |
var AMP = 0.5; // amplitude | |
var len = 15; // seconds | |
e = new webkitAudioContext(); | |
var source = e.createBufferSource(); | |
var SR = e.sampleRate; | |
source.buffer = e.createBuffer(1, len * SR, SR); | |
var dat = source.buffer.getChannelData(0); | |
for (var i = 0; i < len * SR; i++) { | |
dat[i] = AMP * (Math.random() * 2 - 1); | |
} |
"""Parallel grid search for sklearn's GradientBoosting. | |
This script uses IPython.parallel to run cross-validated | |
grid search on an IPython cluster. Each cell on the parameter grid | |
will be evaluated ``K`` times - results are stored in MongoDB. | |
The procedure tunes the number of trees ``n_estimators`` by averaging | |
the staged scores of the GBRT model averaged over all K folds. | |
You need an IPython ipcluster to connect to - for local use simply |