Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am loganwilliams on github.
  • I am loganwilliams (https://keybase.io/loganwilliams) on keybase.
  • I have a public key whose fingerprint is 4127 CEDA C51F FAD4 6809 1E34 354D E9F9 C1BC A211

To claim this, I am signing this object:

@loganwilliams
loganwilliams / overflow.py
Last active December 23, 2015 02:19
overflow rainbows
import math
from scipy.misc import imread, imsave
import numpy as np
num_images = 2025
mult_range = np.logspace(0,1.3,num_images)
for i in range(num_images):
print(str(i))
a = imread('IMG_1037/IMG_1037 ' + str(i+1).zfill(4) + '.jpg')
import base64
import os
import re
import sys
from googleapiclient import discovery
from googleapiclient import errors
import nltk
from nltk.stem.snowball import EnglishStemmer
from oauth2client.client import GoogleCredentials
import urllib
from PIL import Image
import cStringIO as StringIO
import numpy as np
import time
# index for naming images
n = 0
# iterate over the x/y locations of the map tiles
function adjust_phase(phase_delta::ImagePyramid, corrected_phase_delta::ImagePyramid)
adjusted_phase = ImagePyramid(phase_delta)
update_subband!(adjusted_phase, 0, adjust_phase(subband(phase_delta, 0), subband(corrected_phase_delta, 0)))
for l = 1:pyramid1.num_levels
for o = 1:pyramid1.num_orientations
update_subband!(adjusted_phase, l, adjust_phase(subband(phase_delta, l, orientation=o), subband(corrected_phase_delta, l, orientation=o)), orientation=o)
end
end
from selenium import webdriver
import json
import time
import datetime
import sys
from wand.image import Image
import wand.exceptions
import requests
from StringIO import StringIO
from pymongo import MongoClient
import urllib2
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
import seaborn
# return numerical angle from the degrees/minutes format NOAA publishes
def parse_angle(a):
w = float(a.split('° ')[0])
#define F_CPU 16000000UL
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <stdlib.h>
volatile unsigned int limit = 2;
volatile unsigned int count = 0;
import gpxpy
import gpxpy.gpx
import geopy.distance
from geographiclib.geodesic import Geodesic
import copy
gpxfile = open('path/to/gpx_file.gpx','r')
gpx = gpxpy.parse(gpxfile)
def get_distance(point1, point2):
last_pano = ''
last_date = ''
i = 0
pairs = []
for i in range(len(interpolated_points)):
print i
new_pano, new_date = outdoors(interpolated_points[i][0], interpolated_points[i][1])
if (new_pano > 0) and (new_pano != last_pano):
if (new_date == last_date):