Skip to content

Instantly share code, notes, and snippets.

@dellsystem
dellsystem / content.md
Created January 7, 2013 14:50
MATH 236 lecture notes for Monday, January 7. While the wikinotes server is down.

Lecture notes from the first lecture of [[MATH 236]], taught by Bulent Tosun. In this lecture, we took a short preliminary quiz, and went over some of the motivation behind linear algebra.

Link to syllabus (PDF)

[TOC]

Quiz

The quiz lasted approximately 17 minutes. There were 6 true/false questions on basic linear algebra material, which are summarised below:

@dellsystem
dellsystem / confparse.py
Created August 20, 2012 02:17
While the SOCS file server is undergoing maintenance
import json
from tfx import errors, utils
class ConfParser:
"""
Only checks for correctly-formatted conf files, with all the
necessary keys present, etc. It will check that all the values (and the
values of any nested dictionaries and lists) are the right type and
@dellsystem
dellsystem / 2.sml
Created May 17, 2012 22:08
Project euler q2
datatype 'a stream = Stream of (unit -> 'a * 'a stream);
val count = ref 0;
val FibStream =
let
fun fib a b = Stream (fn () => (a, fib b (a+b)))
in
fib 0 1
end;
@dellsystem
dellsystem / tests.sml
Created April 11, 2012 02:27
COMP 302 Assignment 5 question 2
use "hw5-q2.sml";
(* ------------------------------------------------------------
Place this file in the same directory as hw5-q2.sml, and run "sml tests.sml".
You must have a function called "occurs" (typ option ref -> typ -> bool) and
a function called unify (typ * typ -> unit).
If you don't have a function called "occurs", or if it's a different type,
set the flag testOccurs below to false.
------------------------------------------------------------*)
<?php
// Prints out the data for just the price graph
$max_price = 50;
$graph = array();
$initial_time = 1321711400;
@dellsystem
dellsystem / single_reverse.py
Created October 25, 2011 05:44
Reversing a singly-linked list sans usage of data structures
import unittest
"""
Reversing a singly-linked list without using any sort of data structure
The highlight of my day
"""
class Item:
def __init__(self, next=None):
self.next = next
@dellsystem
dellsystem / q4.py
Created October 21, 2011 04:04
Ternary Huffman coding
from heapq import heappush, heappop
# List-backed priority queue (using the heapq library)
queue = []
chars = {
'a': 0.15,
'b': 0.07,
'c': 0.21,
'd': 0.10,
'e': 0.05,
@dellsystem
dellsystem / dijkstra.py
Created October 20, 2011 02:44
COMP 251 Assignment 2 Question 5
import sys
"""
Skeleton for dijkstra.py. Based on code originally written by Andrea Sigler.
Brought to you by wikinotes.ca.
"""
# Based on the original HeapNode class, only modified slightly
class HeapNode:
@dellsystem
dellsystem / ucp_dynamo.php
Created September 1, 2011 03:31
root/includes/ucp/ucp_dynamo.php fix
<?php
/**
*
* @package Dynamo (Dynamic Avatar MOD for phpBB3)
* @version $Id: acp_dynamo.php [email protected]$
* @copyright (c) 2011 dellsystem (www.dellsystem.me)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@dellsystem
dellsystem / check_sizes.py
Created June 18, 2011 21:01
Liber usualis image processing/resizing
#!/usr/bin/env python
import glob
import sys
from PIL import Image
if len(sys.argv) < 3:
print "Usage: ./check_sizes.py [directory] [desired zoom level]"
exit(1)