Happy Monkday | more
McDarren
created: 2006-01-17 09:26:50
This was inspired by [g0n]'s recent post ([id://522755]), and almost certainly falls into the category of totally-useless-but-vaguely-interesting-trivia :)

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
# ::

my $monkfile = "monkdays.txt";
my %monks;

open MONKS, "<$monkfile" or die "Ugh:$!\n";

while () {
    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(/-/, $joined));
    $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}{jday_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 :)

Re: Happy Monkday | more
created: 2006-01-17 10:42:56
The only better birthday-time treat than quickly getting the answer I needed that day, was finding this great site for learning about and contributing to Perl.

bassplayer

Re: Happy Monkday | more
created: 2006-01-17 12:44:45

I joined on my step-son's birthday -- not by design, but because pair Network's Insider Report for November or December 2001 interviewed Damian Conway, and he praised Perl Monks as a terrific Perl resource.

I visited the site, and immediately signed up with the same userId as I used on pair, instead of something interesting like bassplayer (I do play bass, just not often) or GrandFather (not yet).

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: Happy Monkday | more
created: 2006-01-18 05:06:54

Wow, After all those months struggling for XP I finaly made it to the top of a list on PM and for something completely random. How appropriate

Thank you McDarren for making me feel special :-)

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

perlmonks.org content © perlmonks.org and bassplayer, McDarren, Random_Walk, talexb

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03