Entries Tagged as 'Uncategorized'

Thursday, July 16th, 2009

Project Euler Problems #3 and #5

I got ahead of myself last post and skipped problem 3. Maybe it’s because it wasn’t that interesting: what’s the largest prime factor of 600851475143? Being an odd number meant 2 was not the largest prime factor, and no even numbers are prime so this simple trial division function seemed to work pretty well: def […]

Sunday, July 12th, 2009

Project Euler Problem #4

As I work through these projecteuler problems, it’s become apparent that my brain tends towards a particular style of solution. When I know one way to solve a problem, I tend to just implement it, as I want to get to the next one. In the future, I’m going to start trying to find multiple […]

Monday, July 6th, 2009

Project Euler Problem #2

Problem 2 from projecteuler requested the sum of all the even Fibonacci numbers below 4 million. I had seen references to “generators” in some of the Python howtos and after further reading, this seemed like a reasonable place to try them out. def fibGenerator(): fib0 = 0 fib1 = 1 while True: yield fib1 fibNext […]

Friday, July 3rd, 2009

projecteuler.net + Python

I’ve started working through the problems at projecteuler, using Python. After playing around with Erlang for a while, I began to dislike the way the programming methodologies were baked into the language. It’s not that I disagreed with them, but sometimes it’s overkill to HAVE to do things via the idioms of assign once and […]

Sunday, June 7th, 2009

Palm Pre SUCCESS, Moonbow FAIL

On Saturday I woke up a bit early and arrived at the Sprint store in Emeryville at 8:06a with the hopes of purchasing a Palm Pre. I had received an e-mail the previous day informing me that certain stores would open at 8a instead of 10a (apparently I wasn’t special enough to receive the e-mail […]

Thursday, May 28th, 2009

On Learning

Earlier this year on Facebook, a few of my friends started playing a game called Geochallenge. The game creators had implemented a viral feature such that whenever a friend played, I received updates e.g. “So and so’s city knowledge is improving, test yours!” I played a few times, and beat all but one of my […]

Tuesday, April 28th, 2009

Uncharacteristic

I did something out of character during lunch today; I bought a McDonalds Double Cheeseburger for a stranger. In most cases, I am strongly against any type of handouts, so I’m still trying to figure out why this transpired. I had gone for a run during lunch, so perhaps elevated endorphins are to blame. Nevertheless, […]

Thursday, April 9th, 2009

Blue And Yellow

While working with a friend on a project, I received a chunk of data consisting of 122443 schools/parishes/colleges along with their primary and secondary colors (in hexadecimal). I hacked together a simple color quantizer that converted the colors to the 216 color web safe palette. If the color combinations are given, 1 per row, formatted […]

Sunday, March 8th, 2009

Upscale Flea Market

Last year I read an article about the White Elephant Sale and went on the last day. They neglected to mention most items are 50% off on the final day…so the single item we purchased, a copper trivet with Ganesha on it only set us back $0.25. We felt we had to buy something… This […]

Saturday, March 7th, 2009

Codereviews

I was recently cc’d on an e-mail containing a code review request, just so I’d be aware of an upcoming change to the data returned from an API used by my code. A little while later one of my co-workers commented, “he wrote a whole parser, very C like.” Prior to that, I hadn’t planned […]