Skip to content

Instantly share code, notes, and snippets.

View NickCarneiro's full-sized avatar
🔨
Building

Nick Carneiro NickCarneiro

🔨
Building
View GitHub Profile
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class InfAddMathEquation {
public static void main( String args[]) throws IOException {
System.out.println("Enter Numbers, Type eq to add");
double[] anArray= new double[99];
@NickCarneiro
NickCarneiro / gist:1967598
Created March 3, 2012 19:17
Theater Class
package server;
import java.util.ArrayList;
import java.util.HashMap;
/*
* Thread safe representation of a movie theatre
*/
public class Theater {
//ArrayList of seat numbers
@NickCarneiro
NickCarneiro / gist:1990451
Created March 7, 2012 02:07 — forked from Spikey3/gist:1990423
Fixed compile bugs
package game;
import java.util.ArrayList;
public class RunningGame extends Minigame {
private int correct = 2;
private IconEntity arrow_left;
private IconEntity arrow_right;
private int selected = 0;
@NickCarneiro
NickCarneiro / gist:1996112
Created March 7, 2012 20:49
RunningGame with arrows
package game;
import java.util.ArrayList;
public class RunningGame extends Minigame {
private int correct = 2;
private IconEntity arrow_left;
private IconEntity arrow_right;
private int selected = 0;
@NickCarneiro
NickCarneiro / gist:1996766
Created March 7, 2012 22:33
Clide's running game
package game;
import java.util.ArrayList;
public class RunningGame extends Minigame {
private int correct = 2;
private IconEntity arrow_left;
private IconEntity arrow_right;
private int selected = 0;
package game;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@NickCarneiro
NickCarneiro / gist:2008402
Created March 9, 2012 20:11
fixed braces
package game;
import java.util.ArrayList;
public class RunningGame extends Minigame {
//introducing private entity
private IconEntity arrow_left;
private IconEntity arrow_right;
long countdown;
package game;
import java.util.ArrayList;
public class RunningGame extends Minigame {
//introducing private entity
private IconEntity arrow_left;
private IconEntity arrow_right;
private IconEntity[] animations;
@NickCarneiro
NickCarneiro / extract.py
Created April 3, 2012 04:20
Cap 10k parsing script
from bs4 import BeautifulSoup
#produce tab delimited CSV files from large html files
for year in range(2008, 2013):
print 'processing ' + str(year)
file = str(year) + '.html'
f = open(file, 'r');
html = f.read()
soup = BeautifulSoup(html)
table = soup.find("table")
@NickCarneiro
NickCarneiro / jpf_plugin_osx.txt
Created April 10, 2012 20:16
How to REALLY get the JPF eclipse plugin running on OSX
1) Install the plugin using the instructions from the wiki.
Ensure that you are running Eclipse >= 3.5 (Galileo)
In Eclipse go to Help -> Install New Software
In the new window selected "Add"
The name is up to you but, set "Location" to http://babelfish.arc.nasa.gov/trac/jpf/raw-attachment/wiki/install/eclipse-plugin/update/
From the "Work with:" drop down menu select the update site that you just entered from the previous step
Check the "Eclipse-JPF" check box, select "Next" and go through the install process.
2) Download the jpf core binary and extract it somewhere: http://babelfish.arc.nasa.gov/trac/jpf/attachment/wiki/projects/jpf-core/jpf-core-r615.zip