Last summer, while working on my Google Summer of Code project, I needed a Base32 encoder in C# for the Creative Commons hash generation code. The RFC is easy enough to understand but there’s no substituting a good example. Or better yet, public domain code! I used this Java base32 encoder to write translate to [...]
When I was taking a compilers course, I noticed the grammars for C/C++/Java etc. allow for blocks with no conditional or function signature at the top. I couldn’t think of what this would be used for except to make the grammar easier to describe. Later, while writing code with lots of mutual exclusion, my code [...]
¶
Posted 13 April 2007
§
Also tagged: Updated
‡
My friend Phil was trying to time how fast he could speedcube but he only had a Linux terminal with GNU tools. How can you time yourself using GNU tools? Here was our though process: run date twice and take the difference in times run time cat /dev/zero > /dev/null and ^C to stop our [...]
¶
Posted 10 April 2007
§
Also tagged: Linux
‡
This is a nifty little one-liner I wrote which takes a power of two (an integer x where x = 2n) and returns the log2x. class Pow2 { public static void main(String[] args) { int i = 1; int n = 1048576; while( ((n >> ++i) % 2) == 0 ); System.out.println(“Power of 2: ” [...]
¶
Posted 08 February 2007
§
Also tagged:
‡