March 2008 Archives

Visualizing Parrot bugs

| No Comments

Will Coleda has graphed up the state of the Parrot bug queue in Google Spreadsheets. I had no idea there was so much Tcl action going on.

Perl Foundation elects new members

| No Comments

The Perl Foundation has three new members

  • Karen Pauley, Steering Committee Chair
  • Josh McAdams, Public Relations
  • Jeremy Fluhmann, Conferences Committee Chair
Thanks to Josh to taking the mantle of PR from my shoulders! I wouldn't be surprised if we wind up teaming up on some stuff down the road....

Help find students for Perl projects in Google Summer of Code 2008

| No Comments

(Following is Eric Wilhelm's call for participation in Google Summer of Code.) -- Andy

The Perl Foundation is participating in Google's 2008 Summer of Code™ and we have a lot of capable, willing mentors looking forward to working with some talented, driven students. So, we would like you to help find those students (and quickly -- the students must apply before March 24th.)

This is a rare opportunity for students to get a chance to get a paid summer of hacking on exciting projects like Parrot, Perl 6, Moose, Jifty, SVK, Catalyst, or their very own Perl modules or applications. It also brings new talent into the community and gives the student a hefty "real world" experience with a knowledgable mentor. Further, employers love to see this sort of demonstration of teamwork, handling deadlines, communication skills, resourcefulness and etc.

We're looking for promising students who are interested in open source (or maybe you know someone who *should* be interested in open source.) Knowledge of Perl is optional if the project is Parrot-related. The student doesn't need to be an expert in the problem domain (after all, learning is part of the process), but should bring a big pile of creativity, problem-solving skills, and determination.

Students should review the page of suggested projects, encouraged to bring their own proposals (those are often the best.) The most important first step is getting in touch with the community and discussing their project idea with potential mentors.

Google has posted some flyers if you happen to have a university bulletin board or hallway handy:
http://code.google.com/p/google-summer-of-code/wiki/GsocFlyers

Additional info:

http://www.perlfoundation.org/perl5/index.cgi?gsoc2008
http://code.google.com/soc/2008/
http://code.google.com/soc/2008/faqs.html

(Note that Google has particular requirements to do with the fact that they are paying the students. The student must be able to show their eligibility regarding enrollment and employability.)

Remember, the Perl community draws talent from many fields, so if you came to Perl from a non-computer-science major and still have contacts in that department from your university, it is probably worth mentioning to them.

Please feel free to forward this to whoever may be interested.

Tim Bunce debunks Perl myths

| 1 Comment

Tim Bunce has put together a presentation debunking three pervasive myths about Perl:

  • Perl is dead
  • Perl is hard to read / test / maintain
  • Perl 6 is killing Perl 5
That last one has a sort of corollary: "Perl 6 is taking too long", which presupposes that anyone can say how long Perl 6 should be taking.

Perl Foundation accepted in Google Summer of Code 2008

| No Comments

Details are non-existent right now, but the Perl Foundation is back in Google's Summer Of Code program. Congratulations to all who helped us get in there, especially Eric Whilhelm, who displayed an astonishing level of JFDI to get this to happen.

YAPC::EU 2008, Portuguese Perl Workshop calling for papers

| No Comments

The Call For Papers for YAPC::EU 2008 is now open. The theme for this year pleases me: "Beautiful Perl."

The Portuguese Perl Workshop is also calling for papers.

Finally, does any read these call for paper announcements? I feel redundant to use.perl.org on this score, and have nothing additional to add other than "Hey, here's a link." I will drop coverage of them unless I hear otherwise.

TPF helps defend the Artistic License

| No Comments

Jim Brandt writes in the TPF news blog that the Perl Foundation is helping a court case surrounding the Artistic License. A Java project has adopted the Artistic License and is now in the middle of a legal battle that could be important legal precedent for future cases regarding open source licensing. TPF has helped support an amicus curae brief in the case.

Jim's article notes "the argument [in the case] that there can be no remedy to a copyright holder who chooses not to charge money for their work." It's kind of like how puzzled relatives ask why me work on open source projects if I'm not getting paid to do it, as if it's less worthwhile that there's no money (directly) changing hands. Here, the plaintiffs in the case are trying to make that perception into settled case law. Thanks to TPF for their work here against that happening.

rt.cpan.org source released

| No Comments

Jesse Vincent announced that Best Practical has released the source for rt.cpan.org. All the general magic that Jesse &. co. use to make the de facto bug tracking system for the CPAN is now available from BestPractical's Subversion site.

Jesse says "If you've been hankering for a new feature in rt.cpan.org, now's the time to start sending patches. After 3 good patches, we'll grant you a commit bit to the rt.cpan.org extensions." Kudos to Jesse for opening things up and helping spread the workload of maintaining this crucial tool.

Sloppy and lazy database handling: PHP's shortcomings, part #47

| 10 Comments

Here's yet another reason why PHP is deficient when it comes to doing Real Work with Real Databases. We're currently working on a PostgreSQL-based database with six million book records. We want to walk the book table and slurp up the rows as we go. The code looks like this.

$sql = 'select field1, field2, ... field8 from book';
$set = pg_query( $sql );
while ( $row = pg_fetch_row( $set ) ) {
    // Do some processing
}
pg_free_result( $set );

Nothing crazy, right? I'm just walking the table, one row at a time. However, the PHP PostgreSQL functions slurp up all six million rows, even though my calling code doesn't need to see all the rows at once. This eats up tons of RAM and makes us worry about memory allocation for the PHP process. too bad for us users! We can't even get to the first pg_fetch_row() call because the pg_query slurps up all the rows immediately.

Now, there IS functionality where you can retrieve a given row, like:

$row = pg_fetch_row( $set, $rowno );

In this case, it's necessary to iterate to that given $rowno, but even then you wouldn't have to get to the end of the dataset.

If that's not lazy enough coding on the back end, check out this little nugget from the docs for the pg_free_result function:

pg_free_result() frees the memory and data associated with the specified PostgreSQL query result resource.

This function need only be called if memory consumption during script execution is a problem. Otherwise, all result memory will be automatically freed when the script ends.

The PHP docs encourage sloppy coding. Rather than promoting good, safe programming behaviors, they're saying "Eh, no big deal." It's like the PHP team knows that PHP won't be used on large datasets, and it becomes a self-fulfilling prophecy.

PHP needs to be left to the ghetto of guestbooks and the odd bulletin board system. Leave the real work to the real languages.

USENIX opens conference proceedings

| No Comments

USENIX, the Advanced Computing Systems Organization, has announced:

USENIX is pleased to announce open public access to all its conference proceedings.

This significant decision will allow universal access to some of the most important technical research in advanced computing. In making this move USENIX is setting the standard for open access to information, an essential part of its mission.

USENIX could not achieve such goals without the support and dedication of its membership. We urge you to encourage others to join USENIX. Membership helps us present over 20 influential conferences each year and offer open access to the technical information presented there.

The proceedings are available at http://www.usenix.org/publications/library/proceedings/

LINSWAN: An acronym we can steal from Ruby

| 2 Comments

Pat Eyler's recent blog post introduced me to a term I hadn't seen from the Ruby community. MINSWAN stands for "Matz Is Nice, So We Are Nice."

What a marvelous idea! I'd like to steal it as LINSWAN, for "Larry Is Nice, So We Are Nice," although I suspect that people might get confused and think of Pittsburgh Steelers Hall of Famer Lynn Swann.

More companies openly supporting Perl projects

| No Comments

More companies are showing their support for open source projects, and I couldn't be happier about it.

Those of you following Ovid's blog on use.perl.org, or reading his code improvements in the perl-qa mailing list, should give thanks to the BBC for supporting his Perl work. It's not all philanthropic, of course, since the BBC wants good tools for themselves, but I love that they're letting Ovid hitch his stories to the BBC wagon. That helps give Perl some credence in the eyes of open source skeptics.

Now, as you readers of Mechanix know, Devel::NYTProf is the hot new profiler in town. Not only is the New York Times allowing code to be released, it turns out there's a blog, open.blogs.nytimes.com, where Adam Kaplan announced the module. I love that a company that's not (exactly) in the software business is blogging about their open source software work. Let's hope it's a light in the darkness that others will lend their illumination to as well.

Perl Foundation needs new members

| 2 Comments

The Perl Foundation needs new blood. Jim Brandt writes:

Have you ever wanted to get involved in The Perl Foundation, but didn't know how? Well, now's your chance. I'm pleased to announce open self-nominations for the following TPF roles:

You can follow the links above to read descriptions of each of the positions. If you think you're a good fit for one or more of them, send me an email at cbrandt at perlfoundation dot org. I'll then invite you to a dedicated wiki we have set up just for the election.

Once you join the wiki, you'll set up a page to post all of your experience and answer the questions provided in each section above. The wiki is private, but you'll be able to see the other candidate pages, and they'll see yours.

The deadline to get all of your information in is midnight next Tuesday, March 11. Our committees elect their members, so the Conferences Committee will be voting on the CC chair and the Steering Committee will vote on the chair and PR positions. After we have a chance to look over everyone's information, we vote and select our newest members.

You only have a week, so don't wait too long. I look forward to hearing from you.

Karen Pauley is stepping up to run for Steering Committee chair, so how about you? Maybe that's a spot you'd like to work on, or maybe public relations is more up your alley. This is your chance to help lead TPF lead Perl and Perl development.

Astute followers of TPF will note that the PR spot is open, a spot that I once held. Yes, I am no longer doing PR for TPF. I've done that job for a while, and now I'm moving on to do other things, not least of which is this little news called perlbuzz.com.

Lessons in workshop organization from Frozen Perl 2008

| No Comments

Dave Rolsky has written up a recap of Frozen Perl from the organizers' point of view. Some interesting tidbits:

  • 2/3rds of FP2008 expenses were paid by sponsors, keeping attendee cost low
  • Some sponsors are interested in the tax deduction; some see it as a marketing expense
  • With very low ticket prices, each additional attendee ends up being a net loss
  • A potential solution to the lightning talk machine dance could be a KVM.
  • Income $7,190 - Expenses $6,213.43 = $976.57 overage

The workshop came together beautifully. I was very impressed with what Dave & Co. pulled together.

Who will take over perl101.org?

| 3 Comments

Who out there has some free time and is interested in helping out beginners?

My little project for Perl beginners, Perl101.org, has been largely ignored lately. My idea was to have a cookbooky style set of pages that beginners could read for things like the right way to get a count of elements in an array, or how to extract links from a web page without using a regular expression.

It started out pretty nicely, but has lain fallow for months now. I'd like it if someone could take it over. I'll hand over the domain name and the Google Code project for the site, and you'll keep this going and make it something more useful. If you want to overhaul how it works, or keep the same system going, it doesn't matter to me. All I require is that you'll do something useful for the beginners.

Any interest?

Sign up to help with Summer Of Code

| No Comments

Google's Summer Of Code is upon us again. The Perl community has had some problems in years past with lack of organization, and the SOC mentors seem determined to not let that happen this year. Eric Wilhelm posts:

TPF needs volunteers to make summer of code happen this year. It sounds like the administrators got stretched too thin in 2005 and 2006, and we really didn't have ourselves together in 2007. So, I'm proposing a departmental structure under a TPF umbrella, which will localize the cat-herding effects within various large projects (so far, parrot and Catalyst appear to be on board with this.) I would like to demonstrate that we have our act together this year, so we need to get a solid pool of administrative volunteers and mentors together before the 8th.

Eric says that they need a backup administrator, to minimize the reliance on a single person; department heads for p5p, "modules", etc; suggestions about department structure, and plenty of mentors.

What does a mentor do?

  • Act as a point-of-accountability for google
    • keep tabs on your student
    • prod the student for updates
    • fill-out midterm and completion evaluation forms
  • Take the student under your wing
    • get them participating on mailing lists, irc
    • make sure they know where to go for help and resources
    • answer questions about the bugs in the social machine
  • Represent the community
  • Get a t-shirt

If you'd like to help, or have ideas, contribute at one of these three pages:

Good Perl code is the best form of evangelism

| 4 Comments

Here in the Perl echo chamber, there's a lot of talk about advocacy and getting people to use Perl and whether Perl is more popular in the job market than PHP, but I think most of that is just wind in sails. We talk and talk and talk but when it gets down to it, people don't use Perl because it's bigger in the job market, or because of a well-argued thread on Slashdot. People use Perl because the power of Perl makes their lives easier.

Back on the 17th, I posted that Perl would be allowed in the Microsoft Scripting Games. Now, I'm no friend of the "scripting" moniker, but I was glad it was allowed in and thought maybe there would be some good visibility for the power of Perl.

Then I saw the results.

Event 2 in the competition was to read in a text file of comma-separated values of ice skating scores, drop the high & low scores from each skater, and show the top three skaters and their average scores. Trivial for Perl, right? The solution that Microsoft posted, however, was effectively a VBScript script translated to a Perl program (by their own admission).

Here's the solution they posted.

%dictionary = ();

open (SkaterScores, "C:\\Scripts\\Skaters.txt");
@arrSkaters = <SkaterScores>;
close (SkaterScores);

foreach $strSkater (@arrSkaters) 
    {
        $intTotal = 0;
        @arrScores = split(",",$strSkater);
        
        $strName = @arrScores[0];
        @arrScoresOnly = (@arrScores[1],@arrScores[2],
                @arrScores[3],@arrScores[4],
                @arrScores[5],@arrScores[6],@arrScores[7]);

        @arrScoresOnly = sort({$a <=> $b} @arrScoresOnly);

        $intTotal = @arrScoresOnly[1] + @arrScoresOnly[2] + 
                @arrScoresOnly[3] + @arrScoresOnly[4] + 
                @arrScoresOnly[5];
        
        $dblAverage = $intTotal / 5;
        $dictionary{$strName} = $dblAverage;
    }

$i = 0;

foreach (sort {$dictionary{$b} <=> $dictionary{$a} } 
                     keys %dictionary)
    { 
        $i++;
        print "$_, $dictionary{$_}\n"; 
        if ($i == 3) {exit}
    }

Just dreadful. Among the atrocities: Stringing together list elements with plus signs to get a sum; Hardcoded array indexes; Hungarian notation prefixes of variables, in addition to the Perl sigils; breaking out of a loop after three records are shown, rather than starting with a list of the top three. It's just not good idiomatic Perl code.

Perl's arrays and hashes are powerful, and underused here. Perl arrays are treated like C arrays.

In a few minutes, I had put together the following program which is shorter and clearer because it takes advantages of Perl's strengths.

use warnings;
use strict;

my %averages;

open( my $SCORES, '<', 'c:/scripts/skaters.txt' )
    or die "Can't open score file: $!\n";
while ( <$SCORES> ) {
    chomp;
    my ($name,@scores) = split ',';
    @scores = sort @scores;

    # Drop high & low scores
    pop @scores;
    shift @scores;

    my $total;
    $total += $_ for @scores;
    $averages{$name} = $total/scalar @scores;
}
close $SCORES;

my @names_by_score = 
    sort {$averages{$b} <=> $averages{$a}} keys %averages;
for my $name ( @names_by_score[0..2] ) {
    print "$name: $averages{$name}\n";
}

(I'll admit I haven't tested it against their sample data because their sample data is only available in a self-extracting .EXE, which is a bummer for us non-Windows folks, no?)

After I wrote my solution, I noticed that they have an Experts Page that includes links to solutions offered by Jan Dubois of ActiveState. No surprise, Jan's solution is exemplary Perl, and I'm glad that Microsoft provides it. My frothing subsided a bit after discovering this.

Rather than arguing with non-Perl people about which language is better, let's show them. Even more, let's show the people who think that Perl is only a scripting language, only for web sites, or can't be deciphered that Perl will make their lives easier if they'd only open their Swiss Army knives beyond the first blade.

« February 2008 | Main Index | Archives | April 2008 »