Contours of San Francisco overlayed over OpenStreeMap vector tiles using code from mbostock's vector tiles with multiple layers example. View the hi-res file
See gist for code used to generate contours.
| angular.module('stateMock',[]); | |
| angular.module('stateMock').service("$state", function($q){ | |
| this.expectedTransitions = []; | |
| this.transitionTo = function(stateName){ | |
| if(this.expectedTransitions.length > 0){ | |
| var expectedState = this.expectedTransitions.shift(); | |
| if(expectedState !== stateName){ | |
| throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName ); | |
| } | |
| }else{ |
| /** | |
| * This casper scipt checks for 404 internal links for a given root url. | |
| * | |
| * Usage: | |
| * | |
| * $ casperjs 404checker.js http://mysite.tld/ | |
| * $ casperjs 404checker.js http://mysite.tld/ --max-depth=42 | |
| */ | |
| /*global URI*/ |
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
| // Flyweight.js - Copyright Addy Osmani, 2012. | |
| // Consider public domain | |
| // My implementation in JS of this: | |
| // http://en.wikipedia.org/wiki/Flyweight_pattern | |
| // Simulate pure virtual inheritance/'implement' keyword for JS | |
| Function.prototype.implementsFor = function (parentClassOrObject) { | |
| if (parentClassOrObject.constructor == Function) { | |
| // Normal Inheritance | |
| this.prototype = new parentClassOrObject; |
| // installed Clojure packages: | |
| // | |
| // * BracketHighlighter | |
| // * lispindent | |
| // * SublimeREPL | |
| // * sublime-paredit | |
| { | |
| "word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?", | |
| "paredit_enabled": true, |
| import multiprocessing | |
| import pandas as pd | |
| import numpy as np | |
| def _apply_df(args): | |
| df, func, kwargs = args | |
| return df.apply(func, **kwargs) | |
| def apply_by_multiprocessing(df, func, **kwargs): | |
| workers = kwargs.pop('workers') |
Contours of San Francisco overlayed over OpenStreeMap vector tiles using code from mbostock's vector tiles with multiple layers example. View the hi-res file
See gist for code used to generate contours.
[ Launch: Electron 1 ] 26109e789eb01a5de6d7 by ahlusar1989
| from __future__ import division | |
| from numpy import * | |
| class AdaBoost: | |
| def __init__(self, training_set): | |
| self.training_set = training_set | |
| self.N = len(self.training_set) | |
| self.weights = ones(self.N)/self.N | |
| self.RULES = [] |
| # -*- coding: utf-8 -*- | |
| """ Small script that shows hot to do one hot encoding | |
| of categorical columns in a pandas DataFrame. | |
| See: | |
| http://scikit-learn.org/dev/modules/generated/sklearn.preprocessing.OneHotEncoder.html#sklearn.preprocessing.OneHotEncoder | |
| http://scikit-learn.org/dev/modules/generated/sklearn.feature_extraction.DictVectorizer.html | |
| """ | |
| import pandas | |
| import random |