Skip to content

Instantly share code, notes, and snippets.

View apnorton's full-sized avatar
:octocat:
That Gibson won't hack itself

Andrew Norton apnorton

:octocat:
That Gibson won't hack itself
View GitHub Profile
import java.util.*;
//Example recursive functions
public class Recurrence {
public static void main(String[] args) {
//GCD Demonstration
System.out.println("The greatest common divisor of 12 and 8 is " + gcd(12, 8));
System.out.println("The greatest common divisor of 15 and 7 is " + gcd(15, 7));
import csv
import matplotlib.pyplot as plt
from math import log
def make_plot(x, y, xmin=0, ymin=0, xmax=None, ymax=None, xlabel='X', ylabel='Y'):
# clear the figure
plt.clf()
if xmax is None:
xmax = max(x)

Keybase proof

I hereby claim:

  • I am apnorton on github.
  • I am apnorton (https://keybase.io/apnorton) on keybase.
  • I have a public key whose fingerprint is 773F B9C9 A32E 8CB0 FD43 0CFE 1BD7 8F8D 030E E72D

To claim this, I am signing this object:

@apnorton
apnorton / .vimrc
Created January 30, 2016 19:56
My .vimrc
set shiftwidth =2
set tabstop =2
set softtabstop =2
set backspace =2
set autoindent
set smarttab
set expandtab
set number
set linebreak
@apnorton
apnorton / compute_score.py
Created May 10, 2016 13:52
Copy and paste the results from the autograder into "results.txt" and then run this program.
opt_runtimes = {
'cells-40-21' : 4110539 ,
'crm2xu-benchmark1' : 778286 ,
'crm2xu-benchmark2' : 883497 ,
'ctj4t-test1' : 1046270 ,
'ctj4t-test2' : 1164499 ,
'dcb6y-test1' : 841626 ,
'dcb6y-test2' : 858063 ,
'hairy-scary-double': 871919 ,
'hello-world' : 663546 ,
@apnorton
apnorton / disjoint_set.py
Created April 19, 2017 23:22
Disjoint Set Data Structure
# Referenced (and written for) a question on StackOverflow: http://stackoverflow.com/q/43485892/1110928
import numpy as np
class DisjointSet:
def __init__(self, size):
self.parent = np.arange(size) # parent of tree rooted at index i
self.sz = np.zeros(size) # size of tree rooted at index i
# Finds the root of given element, c, and returns the root
@apnorton
apnorton / jaiminisbox_download.py
Created July 3, 2020 20:09
Tool for downloading zips of scanlations from jaiminisbox. Usage: python jaiminisbox_download.py [url_to_series_page]
import os
import sys
import logging
import requests
from functools import partial
from bs4 import BeautifulSoup
import multiprocessing
from multiprocessing import Pool
logging.basicConfig(level=logging.INFO)