This was inspired by g0n's recent post (Happy monkday!), 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 # <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 :)


In reply to Happy Monkday | more by McDarren

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.