I hereby claim:
- I am skilbjo on github.
- I am skilbjo (https://keybase.io/skilbjo) on keybase.
- I have a public key ASAUJee-HKey3vwxRxk-zWrL9uB7MJ_2Or77tBr_Z2Vqygo
To claim this, I am signing this object:
# FizzBuzz is a classic programming exercise. | |
# | |
# The usual example asks the developer to write a program which prints out each number from 1 to 100. But for multiples of 3 | |
# print 'Fizz' instead of the number and for multiples of 5 print 'Buzz'. For numbers which are multiples of both 3 and 5 print | |
# 'FizzBuzz'. | |
def fizzbuzz(): | |
for n in range(1,101): | |
if n%3 == 0 and n%5 == 0: print "fizzbuzz" | |
else: |
http://garysieling.com/blog/converting-json-to-a-csv-file-with-python | |
Ideally we want selections from these as a CSV for manual review, and import into mapping software. First, we load a list of files: | |
import os | |
folder = 'G:\\maps\\churches\\db.tar\\db\\db' | |
files = [] | |
for root, dirs, f in os.walk(folder): |
## guide for mavericks 10.9 configuration + python development environment setup | |
http://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/ | |
http://hackercodex.com/guide/python-development-environment-on-mac-osx/ | |
## installing xcode command line tools | |
xcode-select --install | |
## installing homebrew | |
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" | |
brew doctor |
var range = [490,510], | |
start = range[0], | |
end = range[1] | |
; | |
var check_prime = function(num, j, ans){ | |
if(j === 1) return ans; | |
if(num % j === 0) { | |
ans.push(false); |
var | |
prompt = require('prompt'), | |
matrix = [], | |
o = 'o', | |
x = 'x', | |
round = 0 | |
; | |
// initialize the matrix | |
for (var i = 0; i <= 2; i++){ |
// Recursive => Funcational, yay! But dat runtime doe.. :( | |
var recursive_fib = function(n){ | |
if(n<=1) return n; | |
return recursive_fib(n-2) + recursive_fib(n-1); | |
}; | |
// Recursive w/ memoization (caching) => Funcational + performant! | |
var recursive_memo_fib = function(n){ | |
var f = function(n,cache){ | |
if( cache[n] ) { |
// Recursive => Funcational, yay! But dat runtime doe.. :( | |
var recursive_fib = function(n){ | |
if(n<=1) return n; | |
return recursive_fib(n-2) + recursive_fib(n-1); | |
}; | |
// Recursive w/ memoization (caching) => Funcational + performant! | |
var recursive_memo_fib = function(n){ | |
var f = function(n,cache){ | |
if( cache[n] ) { |
var mark = '*', | |
n = 25, | |
create_arr = function(n){ | |
var arr = []; | |
for(var row=0; row < n; row++){ | |
var line = []; | |
for(var field=0; field < n; field++){ | |
line.push(' '); | |
} | |
arr.push(line); |
nohup make -j 4 V=0 </dev/null >/dev/null 2>&1 & | |
mount /dev/sdb1 usb-drive | |
sudo mount -o bind ~/usb-drive/tmp /tmp | |
_python2_ver_major=$(pacman -Qi python2|gawk '$1~/Version/{split($3,v,".");print v[1] "." v[2]}') \ | |
LIBS='-lprotobuf -lglog' && \ |
I hereby claim:
To claim this, I am signing this object: