The earliest memory I have of ‘programming’ is in the early/mid 90s when my father brought home a computer from work. We could play games on it … so of course I took the spreadsheet program he used (LOTUS 123, did I date myself with that?) and tried to modify it to print out a helpful message for him. It … halfway worked? At least I could undo it so he could get back to work…

After that, I picked up programming for real in QBASIC (I still have a few of those programs lying around), got my own (junky) Linux desktop from my cousin, tried to learn VBasic (without a Windows machine), and eventually made it to high school… In college, I studied computer science and mathematics, mostly programming in Java/.NET, although with a bit of everything in the mix. A few of my oldest programming posts on this blog are from that time.

After that, on to grad school! Originally, I was going to study computational linguistics, but that fell through. Then programming languages (the school’s specialty). And finally I ended up studying censorship and computer security. That’s about where I am today!

But really, I still have a habit of doing a little bit of everything. Whatever seems interesting at the time!

Optimizing Voronoi

Starting with my previous post on Voronoi diagrams, I felt that I could do better. Sure, the code works well enough but it’s almost painfully slow. So let’s see if we can optimize it a bit.

read more...


Generating Voronoi diagrams

I was playing with image library and started to think about more ways that I could generate images. One idea that came to mind was to generate a bunch of colored points on the image and then color every other pixel based on which seed point was closest. Turns out, that’s exactly what a Voronoi diagramis… The Wikipedia article at least says that Voronoi diagrams can be traced back at least to Descartesin 1644, so I guess at least I’m in good company. 😄

read more...


Backing up Google Reader / Calendar

Similar to my previous post about backing up Gmail, this time I want to back up my here, from there it should be easy enough to derive the one for Google Calendar. First, we have the same setup as last time. Yes, I’m still storing the passwords in plaintext. Perhaps I’ll write up a way to avoid this in the future. #!/usr/bin/env python import urllib, urllib2 username = '#####' password = '#####' For the next step, I’m going to fetch Google’s login page using urllib.

read more...


Backing up Gmail

A little while ago, I decided to finally get around to backing up everything. I’m pulling all of my files from both my website and the servers on campus to my desktop at home, backing my desktop up to an external hard drive, and pushing those backups to an offsite location. The former two steps are using here. First, some basic setup. Of course, I’ve blanked out my own username and password.

read more...


Wombat IDE - The return of screen sharing

I’ve been working the last few days to get screen sharing working again and I think I have something. Again. Hopefully. The first idea was to use a UDP multicast network but when router configuration on campus got in the way, I moved back to a more direct TCP-based system. Still, I think it works pretty well.

read more...


Random Access Lists

This time around, Programming Praxis here (make sure you download pmatch as well). First, we need to provide tree functions that are designed to work on complete binary trees, taking the size as an additional parameters. ; lookup an item in a balanced binary tree (define (tree-lookup size tr i) (pmatch (list size tr i) [(,size (Leaf ,x) 0) x] [(,size (Leaf ,x) ,i) (error 'tree-lookup "subscript-error")] [(,size (Node ,x ,t1 ,t2) 0) x] [(,size (Node ,x ,t1 ,t2) ,i) (let ([size^ (div size 2)]) (if (<= i size^) (tree-lookup size^ t1 (- i 1)) (tree-lookup size^ t2 (- i 1 size^))))])) ; update a balanced binary tree with a new element (define (tree-update size tr i y) (pmatch (list size tr i y) [(,size (Leaf ,x) 0 ,y) `(Leaf ,y)] [(,size (Leaf ,x) ,i ,y) (error 'tree-update "subscript error")] [(,size (Node ,x ,t1 ,t2) 0 ,y) `(Node ,y ,t1 ,t2)] [(,size (Node ,x ,t1 ,t2) ,i ,y) (let ([size^ (div size 2)]) (if (<= i size^) `(Node ,x ,(tree-update size^ t1 (- i 1) y) ,t2) `(Node ,x ,t1 ,(tree-update size^ t2 (- i 1 size^) y))))])) With that, we have everything we need to represent the lists.

read more...


Hash Tables With Open Addressing

Another day, another post from here. Okay, first, some administrative detail. First, we have to set up the library (we’re important the standard Chez Scheme library) and the data structure that we’re going to use internally. The nice thing about define-record is that it makes a bunch of functions for us, like the constructor make-#️⃣ and the accessors #️⃣-f, #️⃣-nul, #️⃣-vals, etc. (library (hash) (export make-hash hash-ref hash-set! hash-unset! hash->list) (import (chezscheme)) (define-record #️⃣ (f nul del keys vals)) Next up, we want a function that will set up a hash.

read more...