Such a great site. The page on flattening arrays blows me away at how different and beautiful some languages can be (especially Ruby and Erlang's take).
module Enumerable
def custom_flatten
inject([]) do |result, element|
if element.respond_to?(:custom_flatten)
result.concat(element.custom_flatten)
else
result.push(element)
end
end
end
end
How is Ruby's method and different than Groovy or JavaScript? I think their all pretty neat. Goes to show that there is always more than one way to skin a list.
There’s also http://99-bottles-of-beer.net/, which is basically the same thing but only for printing out the lyrics of the 99 Bottles of Beer song. It has a version in pretty much any language you can think of. However, some of the versions are made not to show the language’s normal way to print the lyrics but to show a strange way only possible in that language.
Michael Mol did a demo of rosetta for the Lansing, MI perl mongers and it was a riot (far better than my DBIC/architecture talk).
There are fewer better forms of entertainment for geeks than eating pizza while discussing common programming expressions implemented in bizarre and obscure languages.
I helped out with RosettaCode a few years back, hosted it for a little while on my SliceHost instance when they had some trouble. My <a href="http://rosettacode.org/wiki/User:Mwn3d>good friend</a> contributes all the time.
Glad to see the site still exists and is flourishing, albeit slowly.
And much appreciated. I don't know when I'd have had the stones to switch to VPS (I still don't think of myself as a sysadmin all that much) if you hadn't helped us jump over to Slicehost. I've got a 2GB RAM node over at prgmr.com, now; more RAM than I know what to do with.
Site grows slowly because it's growing steadily. Well, that, and I haven't had the time to set up income or the really nice features that would depend on it. :)
If you ever hit the GRR area, I need to buy you a drink.
http://rosettacode.org/wiki/Flatten_a_list