Archive for April, 2006

codes

Sunday, April 23rd, 2006

Would a person’s mental state be determined by the way he codes?

My code:
# to use: cat file|perl prog.pl
#!/usr/bin/perl

my $chk;
my $text;
my $name;
my $line;

$chk=0;

while (<>) {
    chomp;

    if($chk==1)
    {
$text.="$_\n";    }
   
    if (/^$/)
    {$chk=1;}else
    {$chk=0;}
}

for(split /\n/, $text){
my ($first, $second) = split;
$name .= $first ."\n";
$line .= $second ."\n";
}

#print $text;
print $name, "\n";
print $line;

I thought my code was neat, till…

His code:
#!/usr/bin/perl

my %tbl;

local $/ = undef;
my $all = <>;

for ($all =~ /(.*?\n{2,}|.+)/sg) {
        my ($first, $second) = split;
        push @{$tbl{$second}}, $first;
}

map {
        print "$_: ";
        map {
                print "$_, ";
        } @{$tbl{$_}};
} (keys %tbl);

Juris Doctor gonna be?!

Saturday, April 22nd, 2006

“Miss Judy? This is calling from the xxx University Faculty of Law. Your letter of recommendation to the administration is almost ready for your application for Juris Doctor. We just lack a photocopy of your identification card…”

That shocked me while I was lazily reading up on some last-minute executive summary of the topic I gonna get for my upcoming job interview. Oh yeah, I did filled up the online application form for the JD in Feb, but I didn’t send in the supporting documents like reference letters, self appraisal and whatever, after realizing that I could neither afford the time to gather those supporting materials, nor could I able to afford the HKD 187 k for the entire course.

Hmm…? I remember how I wanted to write a good self-appraisal and how I worried about it. Duh. I’m a lucky one, I guess. Really.

Should I take this JD seriously? I am supposed to worry whether my MPhil thesis would be ready for summer submission instead. Well, leave that till the admission letter arrive then.