Skip to content

Instantly share code, notes, and snippets.

Avatar

Joseph Winters jdw1996

View GitHub Profile
@jdw1996
jdw1996 / bqf-reduction.py
Created Jul 15, 2018
Spring 2018 PMATH340 BQF Reduction Algorithm
View bqf-reduction.py
#!/usr/bin/env python3
# Joseph Winters
# Reduction Algorithm
# July 2018
# This script implements the reduction of primitive, positive definite binary
# quadratic forms, which are those of the form:
# ax^2 + bxy + cy^2
# having:
@jdw1996
jdw1996 / co454a4q2a.py
Created Jul 3, 2018
Spring 2018 CO454 A4 Q2(a) Solver
View co454a4q2a.py
#!/usr/bin/env python3
#
# Joseph Winters
# July 2018
# CO 454 Assignment 4, Question 2
#
import sys
import math
@jdw1996
jdw1996 / data-creation.sql
Last active Mar 25, 2018
Code snippets used in my blog post on nesting aggregate functions in SQL: https://jdw1996.github.io/2017-03-26-nesting-sql-aggregate-functions.html
View data-creation.sql
-- Create the table to hold our data.
CREATE TABLE purchases (
name VARCHAR(5),
amount DECIMAL(5,2),
year CHAR(4)
);
-- Insert the example data.
@jdw1996
jdw1996 / max_people_living.py
Created Jan 27, 2017
An interview-style programming question.
View max_people_living.py
#!/usr/bin/env python3
# Joseph Winters
# January 27, 2017
# Given a list of people with birth years and death years, all of which fall in
# the range [1900, 2000], find the year in which the most people were alive. If
# a person is alive for any part of a year, they count towards the total number
# of living people for that year.