This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"speed": 50"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Christopher Gregorian | |
# Website: csgregorian.com | |
# Name: Legend of Zelda: Link to the Present | |
# Completed: 03:18 AM, June 16th, 2014 | |
# # # Imports # # # | |
# # Built-Ins # # | |
import sys | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def max_contiguous_subarray(array): | |
max_so_far = array[0] | |
max_at_ending = array[0] | |
for i in array: | |
max_at_ending = max(max_so_far + i, i) | |
max_so_far = max(max_at_ending, max_so_far) | |
return max_so_far | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class HashTable<T> { | |
private ArrayList<LinkedList<T>> table; | |
private int size, maxSize; | |
private double maxLoad; | |
public HashTable() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LinkedListTest.java | |
import java.util.*; | |
public class LinkedListTest { | |
public static void main(String[] args) { | |
LinkedList list = new LinkedList<Integer>(3); | |
list.print(); | |
list.enqueue(4); | |
list.print(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeID(length) { | |
var text = ''; | |
var possible = 'abcdefghijklmnopqrstuvwxyz0123456789'; | |
for (var i = 0; i < length; i++) { | |
text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
} | |
return text; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sieve(n): | |
primes = [] | |
sieve = [True] * (n + 1) | |
for p in range(2, n+1): | |
if sieve[p]: | |
primes.append(p) | |
for i in range(p ** 2, n + 1, p): | |
sieve[i] = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am csgregorian on github. | |
* I am csg (https://keybase.io/csg) on keybase. | |
* I have a public key whose fingerprint is 5389 E696 FE01 731C 60AF 9669 C5A3 21A9 E252 61B2 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
j() { | |
clear | |
echo "Compiling..." | |
javac $1.java | |
echo "Compiling complete! Running..." | |
java $1 | |
echo "Running complete!" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jarcompile() { | |
jar cvfe $1.jar $1 *.class resources/* | |
echo -e "cd \$(dirname \$BASH_SOURCE)\njava -jar $1.jar\n" > $1.command | |
echo -e "java -jar $1.jar\n" > $1.bat | |
chmod +x $1.command | |
} |
NewerOlder