Skip to content

Instantly share code, notes, and snippets.

View elliottsj's full-sized avatar

Spencer Elliott elliottsj

View GitHub Profile
@elliottsj
elliottsj / game_of_life.v
Created December 2, 2013 01:27
Conway's Game of Life in Verilog
/*****
*
* CSC258, Fall 2013
* Conway's Game of Life
* By: Spencer Elliott (999992539), Dean Britto (999895298)
*
*****/
/**
* Main module to be instantiated in a project that uses a VGA controller
import java.io.*;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
DiskLruCache diskLruCache = null;
try {
diskLruCache = DiskLruCache.open(new File("DiskLruCache"), 1, 2, 20 * 2^20);
} catch (IOException e) {
@elliottsj
elliottsj / DiskLruCacheTest.java
Last active January 1, 2016 20:39
For some reason, DiskLruCacheTest.java runs fine, but Main.java hangs before returning and doesn't write to the cache. EDIT: Fixed the issue by using Math.pow() instead of ^.
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class DiskLruCacheTest {
@elliottsj
elliottsj / DiskLruCacheTest.java
Created January 3, 2014 19:52
DiskLruCache is not saving ArrayLists properly.
import android.content.Context;
import android.test.AndroidTestCase;
import android.test.IsolatedContext;
import com.jakewharton.disklrucache.DiskLruCache;
import junit.framework.Assert;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import com.jakewharton.disklrucache.DiskLruCache;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
public class MyCache {
DiskLruCache mDiskLruCache;
@elliottsj
elliottsj / sportsball.sql
Created February 2, 2014 22:15
Example schema for CSC343S (2014) Assignment 1.
CREATE TABLE Team (
country TEXT PRIMARY KEY,
coach TEXT UNIQUE
);
CREATE TABLE Player (
PID SERIAL PRIMARY KEY,
fname TEXT,
lname TEXT,
position TEXT,
@elliottsj
elliottsj / Makefile
Created March 7, 2014 01:11
CSC209 Assignment 2
# The first rule is what is executed when you run make with no arguments
# In this case it will build two programs.
all : packetize readstream
# The executable program depends on the .o files.
# The compile line links all the .o files together to create the executable.
packetize : packetize.o crc16.o list.o
gcc -Wall -g -o packetize packetize.o list.o crc16.o
@elliottsj
elliottsj / Makefile
Created April 20, 2014 02:37
CSC209 Assignment 3
all : pfact
pfact : pfact.c
gcc -Wall -g -o pfact pfact.c -lm
clean :
rm *.o pfact
@elliottsj
elliottsj / Makefile
Created April 22, 2014 03:41
CSC209 Excercise 5
all : validate checkpasswd
validate : validate.c
gcc -Wall -g -o validate validate.c
checkpasswd : checkpasswd.c
gcc -Wall -g -o checkpasswd checkpasswd.c
$ git push dokku
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ -n git-receive-pack 'scala-getting-started' ]]
+ export -n SSH_ORIGINAL_COMMAND
+ [[ git-receive-pack =~ config-* ]]
+ /usr/local/bin/dokku git-receive-pack ''\''scala-getting-started'\'''
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ -n '' ]]