Daily del.icio.us bookmarks

Shared bookmarks for del.icio.us user tvset on 2005-07-05

Profiling perl

After I’ve complained on #perl channel that dprofpp (perl profiler) dies on me, I received a number of suggestions on how to profile the code without using dprofpp. Ideas ranged from elemetary insertion of ‘print “Started”, time,”\n”‘ to all sorts of dynamic subroutine overloading. Here is one elegant solution that was suggested:

sub foo { print "foo (@_)\n" }
sub bar { print "bar (@_)\n" }

for (qw(foo bar)) {
  my $name = "main::" . $_;
  my $old = *$name{CODE};
  *$name = sub {
    print scalar(localtime), " Started $name\n";
    &$old;
    print scalar(localtime), " Finished $name\n";
  };
}

foo(qw(one two));
bar(qw(three four));

Oh, and someone also mentioned that dprofpp is known to be buggy. Here is a quote from the “Profiling Perl” article at perl.com:

The other problem you might face is that Devel::DProf, being somewhat venerable, occasionally has problems keeping up on certain recent Perls, (particularly the 5.6.x series) and may end up segfaulting all over the place.

Englightment

During the last few days I started to change my understanding of the word “enlightment”. I think I already mentioned that Maxim loves looking at light sources (lamps, windows, etc). He loved looking at them from his very first day in this world and he still enjoys it.

Sometimes he would lay on the bed looking at the light bulb, thinking about something. And than he would suddenly start talking in his meaningful manner (‘Rggggrgg’,’Arrrrgggrrgg’, etc). When I see him like this, I say that he just was “enlighted”. Thus “enlightment” is talking your mind out after watching a light source.

Education in the Red States

Ovid has an insightful post in his LiveJournal that touches on the topic of education in the United States. Here is a quote that he quotes:

[Gerry Fedchun, president of the Automotive Parts Manufacturers’ Association,] said Nissan and Honda have encountered difficulties getting new plants up to full production in recent years in Mississippi and Alabama due to an untrained – and often illiterate – workforce. In Alabama, trainers had to use “pictorials” to teach some illiterate workers how to use high-tech plant equipment.

Make sure to read the comments as well. There are some interesting bits, like this one for example:

There is a high percentage of folks who do not let their kids go to school because they actually believe schools poison their children’s minds…and no, I am not kidding.

Fascinating, isn’t it?

Mr. & Mrs. Smith

One of the films that I was waiting to come out, but never managed to go to the cinema, was “Mr. & Mrs. Smith” Finally I saw it and can now participate in all those discussions…

Directed by: Doug Liman
Genres: Action, Adventure, Comedy, Romance, Thriller
Cast: Brad Pitt, Angelina Jolie, Vince Vaughn, Adam Brody, Kerry Washington, Keith David, Chris Weitz, Rachael Huntley, Michelle Monaghan, Stephanie March, Jennifer Morrison, Theresa Barrera, Perrey Reeves, Jerry T. Adams, Melanie Tolbert
IMDB raintg: 6.7
My rating: 7.5 [rate 7.5]

Continue reading Mr. & Mrs. Smith