Monthly Archives: July 2009

Beatitudes in C#

12345678class the_earth { … }; class the_meek : public the_earth { … }; From: StackOverflow answer

Bit Operations

For CS351, Intro to Systems, we had to do several operations using bit operators only. These took awhile, but are pretty cool to show off. We were graded by how few operations we used to return the right values for the generated test cases, including some difficult boundary ones.

Euclidean Algorithm

One of my favorite algorithms is the simple, elegant Euclidean algorithm for finding the greatest common denominator of two numbers. In ML or another functional language it really is beautiful:

Recursive Fibonacci

Here are two recursive fibonacci functions in ML I did for CS243. Can you tell which one is more efficient?

Circle Calculator

For my first code post I thought it might be appropriate to put the first code from the first lab of my first computer science class at Wheaton.