Skip to content

Instantly share code, notes, and snippets.

View JonCooperWorks's full-sized avatar

JonCooperWorks

View GitHub Profile
body {
background: url('http://www.cs.washington.edu/education/courses/cse190m/12su/homework/2/background.png');
font-family: 'Tahoma', 'Verdana', 'sans-serif';
font-size: 8pt;
margin: 0;
padding: 0;
}
dt {
font-weight: bold;
@JonCooperWorks
JonCooperWorks / api_spec.txt
Created October 3, 2012 03:04
API Spec for BroBot
BroBot API Spec
---------------
Root: /api
(Eg: http://oursite.com/api/login, etc)
URI: /login
POST: Log user in
URI: /logout
<!DOCTYPE html>
<html>
<head>
<title>Buy Your Way to a Better Education!</title>
<link href="http://www.cs.washington.edu/education/courses/cse190m/12sp/labs/4/buyagrade.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
@JonCooperWorks
JonCooperWorks / sucker.php
Created October 3, 2012 16:16
Lab cheating.
<!DOCTYPE html>
<html>
<head>
<title>Buy Your Way to a Better Education!</title>
<link href="http://www.cs.washington.edu/education/courses/cse190m/12sp/labs/4/buyagrade.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
<!DOCTYPE html>
<html>
<head>
<title>Buy Your Way to a Better Education!</title>
<link href="http://www.cs.washington.edu/education/courses/cse190m/12sp/labs/4/buyagrade.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
@JonCooperWorks
JonCooperWorks / assignment1.py
Created October 6, 2012 14:54
Solution to COMP1126 assignment
'''Assignment 1 Python'''
def isUpper(char):
return ord(char) in range(65, 91)
def toUpper(char):
if not isUpper(char) and ord(char) != 32:
return chr(ord(char) - 32)
<!DOCTYPE html>
<html>
<head>
<title>Buy Your Way to a Better Education!</title>
<link href="http://www.cs.washington.edu/education/courses/cse190m/12sp/labs/4/buyagrade.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
@JonCooperWorks
JonCooperWorks / Lesson1.scala
Created October 20, 2012 14:04
Scala practice: Creating some of the higher order functions from Python (map, filter) and recursion.
import scala.annotation.tailrec
object Lesson1 {
def main(args: Array[String]) = {
val ls = List(1,2,3,4,5,6,7,8,9,10)
val xs = List(1,2,3)
val filt = filter(ls) { _%2 ==0 }
val newls = map(ls) { _*2 }
val sm = sum(ls)(_*1)
println(newls)
@JonCooperWorks
JonCooperWorks / Customers.scala
Created October 21, 2012 19:55
Working with data in Scala using files and list comprehensions
/*
* Simple Customer management system in Scala.
* Uses a companion object as a basic DBMS emulator, and uses list comprehensions
* to filter data, allowing for more concise code that the Java equivalent;
* 39 lines of Scala without comments, to be exact.
*/
import scala.io.Source
import java.io.FileWriter
//Extend App to eliminate the need for a main() method.
var index = 0;
var myVar;
var intervalTime = 250;
function changeAnimation(){
if ($("animation").value == "blank")
{
$("textBox").value = BLANK;
}
else if ($("animation").value == "custom")