Archive for July, 2009

How many users on Twitter have all “u”s as a username?

require 'net/http'
Net::HTTP.start( 'twitter.com' ) { |http|
    us=0
    us+=1 until Net::HTTPNotFound==http.request_head('/'+'u'*us).class
    puts us
}
# 15

Last Sunday, after getting bored implementing error handling in the Ruby version of the food journal, I decided to take a stab at the ICFP 2009 Programming Contest. Although already finished, the problem is so intense and interesting that I had to try. My solution is written in the lovely functional language Haskell.

Today, I achieved a milestone. My program can load and execute the Orbit virtual machine, run a sequence of frames and reports a score of -1.0 when the controlled satellite’s fuel is exhausted.

Browse the code on GitHub. Remember, I’m still learning, so don’t expect anything miraculous!

Continue reading ‘Controlling Satellites With Haskell’ »