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...


Life isn't fair...

…but if you have an unfair coin, you can fix it!

Based on this post over at Lauren Ipsum, you can use statistics to make any unfair coin (defined as something that can return either heads or tails with some arbitrary but constant percent chance) into a fair one with a 50/50 chance of heads or tails.

read more...


Analyzing the dice game

Lifehacker had an interesting post today where they outlined a simple dice game where you have three distinct six-sided dice, each with a different number scheme. The neat thing was that the dice had a mutually intransitive set of win probabilities, similar to rock paper scissors. So if your opponent chooses first and you choose the die that has the 5/9 edge over theirs, you will win about 5% more of the rolls (1/18).

read more...


AudioVision Update

Since deciding that I cannot use MATLAB because of the additional addons necessary to use webcams, I have been deciding between C# and Python as the next language to try. I’ve settled on Python for the time being, using VideoCapture to connect to the webcams and Numpy to process the data. It turns out that Python + VideoCapture + Numpy is actually rather similar in functionality and syntax to MATLAB with its image processing library.

read more...


PyMint - A Python Multi-Interpreter

During the computer architecture class I took at Rose-Hulman, we were working with a simple assembly language that we had to compile by hand down to MIPS bytecode and that’s no fun (also there’s nothing not worth over doing 😄). So I decided to write a program that would allow for modular XML definitions of a language or translation and run it on pretty much any given code.

read more...


PyBallWorlds

Back in the first quarter of my Freshman year at Rose-Hulman, we wrote a small Java program called BallWorlds. The idea was to teach us about objects and inheritance by asking us to make a 2d simulation of balls of various types bouncing around in an enclosed environment. There could be balls that bounced off each other, sticky balls that clumped together, balls that grew when they hit something, and really any combination there of. The sky was the limit. The idea so intrigued me that when I was playing with OpenGL (and specifically PyOpenGL), I decided to rewrite the same thing in Python.

read more...