When I read g0n's post I couldn't help but wonder if there are any Monks out there that happened to join PerlMonks on their birthday. Either:
So, shamelessly stealing g0n's script and making a few modifications, I decided to find out. Of course, not all Monks provide their birthdays for pmstats (only 432/5000 that I looked at), and of those that do we don't know whether or not they are telling the truth. But anyway, lets not allow a minor point like that to get in the way of a good yarn ;)
Once I had the data from pmstats, I wrote a short script to compare dates.
#!/usr/bin/perl -w use strict; use Date::Calc qw(Day_of_Year); # Format of monkdays.txt # marto:01-28:11-30 # <nick>:<join date mm-dd>:<birthdate mm-dd> my $monkfile = "monkdays.txt"; my %monks; open MONKS, "<$monkfile" or die "Ugh:$!\n"; while (<MONKS>) { chomp; my ($nick, $joined, $bday) = split(/:/, $_); $monks{$nick}{joined} = $joined; $monks{$nick}{bday} = $bday; # Calculate the julian day for each date, and add to hash $monks{$nick}{jday_joined} = Day_of_Year("2006", split(/-/, $joine +d)); $monks{$nick}{jday_bday} = Day_of_Year("2006", split(/-/, $bday)); # Now, calculate the delta (in days) between birthdate and joined +date $monks{$nick}{delta} = ($monks{$nick}{jday_joined} > $monks{$nick} +{jday_bday}) ? ($monks{$nick}{jday_joined} - $monks{$nick} +{jday_bday}) : ($monks{$nick}{jday_bday} - $monks{$nick}{j +day_joined}); } close MONKS; print "Total Monks with birthdays:", scalar (keys %monks), "\n\n"; print "Monks who joined within 10 days of their birthday:\n\n"; printf "%-20s %-10s %-10s %-5s", "Monk", "Joined", "Birthday", "Delta" +; print "\n"; foreach my $monk (sort by_delta keys %monks) { last if $monks{$monk}{delta} > 10; printf "%-20s %-10s %-10s %-5s", "$monk", "$monks{$monk}{joined}", "$monks{$monk}{bday}", "$monks{$monk}{delta}"; print "\n"; } sub by_delta { return $monks{$a}{delta} <=> $monks{$b}{delta}; }
Perhaps a little disappointingly, I didn't find any Monks that had joined on their birthdays. But I did find a few that joined very close. Here is the output of the above script:
Total Monks with birthdays:432 Monks who joined within 10 days of their birthday: Monk Joined Birthday Delta Random_Walk 08-12 08-13 1 snowcrash 03-29 03-28 1 salva 04-09 04-11 2 BazB 11-26 11-24 2 tekniko 05-18 05-21 3 leira 02-13 02-09 4 ejf 08-22 08-26 4 LostS 04-03 04-07 4 bassplayer 03-04 02-27 5 katgirl 08-30 08-25 5 bibo 03-31 04-05 5 cacharbe 04-03 03-29 5 arhuman 01-20 01-26 6 chicks 04-20 04-14 6 monsieur_champs 05-26 05-20 6 thunders 09-24 10-01 7 hattmoward 04-08 04-01 7 ajt 09-20 09-28 8 andreychek 04-30 04-21 9 da 05-11 05-20 9 Ven'Tatsu 06-20 06-11 9 Roger 08-29 08-19 10 Siddartha 03-28 04-07 10
/me crawls back into his little hole :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Happy Monkday | more
by talexb (Chancellor) on Jan 17, 2006 at 17:44 UTC | |
|
Re: Happy Monkday | more
by bassplayer (Monsignor) on Jan 17, 2006 at 15:42 UTC | |
|
Re: Happy Monkday | more
by Random_Walk (Prior) on Jan 18, 2006 at 10:06 UTC |