I did that recently while surfing the net - I think it started when I found myself on a a site suggested by Google Reader's Explore function. It listed 5 most overused expressions on the Internet.
Sometimes I encounter internet memes that I've never heard of - maybe I'm turning into a fuddy-duddy, too esoteric in my usual surfing or just simply ignorant, I don't know; but I didn't realise "die in a fire" was such a fad. I heard it for the first time recently while watching 2 Months 2 Million, when some guy got burned in an on-line poker game and jested back with "hope you die in a grease fire". Charming.
So I googled it, as you do, to find out how much of a hit it is. Oddly, a handful of listings down I came across a programming blog.
Blogger Eric Florenzano was/is trying to start a programming meme (another word I'm almost surprised people haven't heard of).
His basic premise was to ask a simple programming question, and see how many languages the blogosphere tried to solve it with - so here's my contribution:
The Rules:
- Implement a program that takes in a user's name and their age, and prints hello to them once for every year that they have been alive.
- Post these rules, the source code for your solution, and the following list (with you included) on your blog.
- Bonus points if you implement it in a language not yet seen on the following list!
The List (as I found it):
To get the format in context (st | nd | th), I had to do some manipulation with rownum. I've used the first solution I came to that worked, I'd be interested to know if anyone has any normalised solutions.
ScottWe
- [Python] http://www.eflorenzano.com/blog/post/trying-start-programming-meme
- [Bash] http://aartemenko.com/texts/bash-meme/
- [C] http://dakrauth.com/media/site/text/hello.c
- [Java] http://adoleo.com/blog/2008/nov/25/programming-meme/
- [Python 3] http://mikewatkins.ca/2008/11/25/hello-meme/
- [Ruby] http://stroky.l.googlepages.com/gem
- [Ruby] http://im.camronflanders.com/archive/meme/
- [Lisp] http://justinlilly.com/blog/2008/nov/25/back-on-the-horse/
- [Lua] http://aartemenko.com/texts/lua-hello-meme/
- [Functional Python] http://aartemenko.com/texts/python-functional-hello-meme/
- [Erlang] http://surfacedepth.blogspot.com/2008/11/erics-programming-meme-in-erlang.html
- [Haskell] http://jasonwalsh.us/meme.html
- [PHP] http://fitzgeraldsteele.wordpress.com/2008/11/25/memeing-in-php-2/
- [Javascript] http://www.taylanpince.com/blog/posts/responding-to-a-programming-meme/
- [Single-File Django] http://www.pocketuniverse.ca/archive/2008/november/27/florenzano-factor/
- [Oracle SQL] http://triangle-circle-square.blogspot.com/2010/09/trying-to-continue-programming-meme.html
accept my_name CHAR prompt 'name [] ' accept age NUMBER prompt 'age [] ' select 'Happy '||rownum||substr(to_char(to_date('201001'||(mod(rownum,10)+20),'yyyymmdd'),'ddth'),3) ||' birthday, &my_name' salutation from dual connect by level <= &age /
SQL> @grease
name [] Scott Wesley
age [] 31
SALUTATION
---------------------------------
Happy 1st birthday, Scott Wesley
Happy 2nd birthday, Scott Wesley
Happy 3rd birthday, Scott Wesley
Happy 4th birthday, Scott Wesley
Happy 5th birthday, Scott Wesley
Happy 6th birthday, Scott Wesley
Happy 7th birthday, Scott Wesley
Happy 8th birthday, Scott Wesley
Happy 9th birthday, Scott Wesley
Happy 10th birthday, Scott Wesley
Happy 11st birthday, Scott Wesley
Happy 12nd birthday, Scott Wesley
Happy 13rd birthday, Scott Wesley
Happy 14th birthday, Scott Wesley
Happy 15th birthday, Scott Wesley
Happy 16th birthday, Scott Wesley
Happy 17th birthday, Scott Wesley
Happy 18th birthday, Scott Wesley
Happy 19th birthday, Scott Wesley
Happy 20th birthday, Scott Wesley
Happy 21st birthday, Scott Wesley
Happy 22nd birthday, Scott Wesley
Happy 23rd birthday, Scott Wesley
Happy 24th birthday, Scott Wesley
Happy 25th birthday, Scott Wesley
Happy 26th birthday, Scott Wesley
Happy 27th birthday, Scott Wesley
Happy 28th birthday, Scott Wesley
Happy 29th birthday, Scott Wesley
Happy 30th birthday, Scott Wesley
Happy 31st birthday, Scott Wesley
31 rows selected.
To get the format in context (st | nd | th), I had to do some manipulation with rownum. I've used the first solution I came to that worked, I'd be interested to know if anyone has any normalised solutions.
ScottWe
Nice post, might need a lttle tweak to get your 11th/st birthday correct....
ReplyDeleteNow you've got the option to tell me to go "Die in a fire" ;)
I also encountered that kind of problem, thanks for helping me figure it out.
ReplyDeleteMatt - thanks for reminding me - no proof reading too early in the morning :-)
ReplyDeleteJeorge - which kind of problem, exactly? curious...
Good thing you are not 32
ReplyDeleteAl, I'll take the hit on not spotting the "11st" (and 12,13), but what's wrong with 32nd?
ReplyDeleteI checked to age 50 and it seemed ok, rechecked, still good.