This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
class Toy(object): | |
inventory = 0 | |
def __init__(self, price, name, quantity): | |
self.price = price | |
self.name = name | |
self.quantity = quantity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
def plotTSP(path, points, num_iters=1): | |
""" | |
path: List of lists with the different orders in which the nodes are visited | |
points: coordinates for the different nodes | |
num_iters: number of paths that are in the path list | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.spatial as ss | |
from itertools import combinations | |
from itertools import permutations | |
import math | |
import random | |
from time import clock | |
def length(point1, point2): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colorscheme slate | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
map <F2> :retab | |
set guifont=Monospace\ 8 | |
" To enable the saving and restoring of screen positions. | |
let g:screen_size_restore_pos = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
import boto.s3.connection | |
# credentials.py should contain the access_key and secret_key which are needed for | |
# the boto S3 connection | |
import credentials as cr | |
class AwsConnect(object): | |
def __init__(self, bucket): | |
self.bucket = bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-----------------------------------------------------------------------------# | |
# Parses the converted html files to find the swell heights and conditions | |
# and then prints these out into formatted tables | |
#-----------------------------------------------------------------------------# | |
import urllib2 | |
from bs4 import BeautifulSoup | |
# Scarpe the site and convert html to text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup guide for chromebook | |
# Crouton chroot comes with | |
# stripped down versions of the OS, so need to add a lot | |
# of applications | |
# Due to issues with the anaconda distribution | |
# and virtualenv, I am running two trusty/unity chroots | |
# one for data analysis work and one for development work | |
# I'll call the data chroot 'datatrusty' and the dev chroot |