Perl helps prove universality of 2, 3 Turing machine

Posted by Tom Moertel Fri, 26 Oct 2007 17:23:00 GMT

Alex Smith, a 20-year-old EE student in the UK, proved that the 2, 3 Turing machine is universal. In doing so, he was able to claim the $25,000 prize that Stephen Wolfram offered for the first proof (or disproof) of the 2, 3 machine’s universality.

This story has been getting a lot of attention lately, but one part of the story has not: that the Perl programming language is featured in the proof. In his documentation of the proof, Universality of Wolfram’s 2, 3 Turing Machine, Smith wrote, “I have written several Perl programs, to demonstrate the constructions given in the proof and to interpret the systems given in various conjectures.” Smith’s proof includes no fewer than 7 Perl programs.

Go Perl!

Posted in
Tags , ,
1 comment
no trackbacks
Reddit Delicious

PPW 2007 is here!

Posted by Tom Moertel Sat, 13 Oct 2007 10:06:00 GMT

PPW logo Today is day 1 of the Pittsburgh Perl Workshop 2007. Judging by the attendance at last night’s pre-conference party (hosted by the great folks at Google Pittsburgh), this year’s PPW is going to be a blast.

Right now, I’m off to help set up the conference facility with the rest of the PPW organizing team. After we’re done, and after the initial check-in rush, I hope to kick back and soak up some of the talks.

Ha! If last year is any indication, I’ll be too busy running around doing conference-organizer stuff to enjoy the talks. But, this year, we are recording the talks. So at least I’ll get to listen to them later.

Gotta run.

Posted in
Tags ,
no comments
no trackbacks
Reddit Delicious

PPW 2007: a twenty-ton can of programming whoop-ass

Posted by Tom Moertel Tue, 25 Sep 2007 23:04:00 GMT

I am on the planning committee for the Pittsburgh Perl Workshop. So far, it’s been an interesting ride. Last year was the first PPW, and it went surprisingly well. In the post-conference surveys, 94 percent of respondents said they wanted to come back for another PPW, so we committed ourselves to repeating the grueling conference-planning process for 2007. (Fact: making big commitments like this is much more likely to happen if you’re drinking beer at the time.)

Now a year has gone by, and PPW 2007 is only three weeks away. This year’s conference is 100% larger – two full days – and offers a new, much-asked-for option: a one-day introductory course to give programmers new to Perl a quick dose of the language so they can dive into the rest of the conference. This year’s conference also offers a full-length Hackathon for those who feel the urge to code at the conference.

The main attraction, however, is the conference’s wide array of technical talks. We have retained the same mix of industry and academic speakers that attendees said they liked so much last year. Indeed, our speaker list includes some of last year’s most fascinating speakers, as well as many new speakers drawn from the world of Perl. No matter what your interests are, you’ll find talks for you at PPW 2007. (I’m particularly interested in the talks on continuation-based web applications, the cool new stuff in Perl 5.10, and the Moose object system.)

All of this is to say: Do not miss PPW 2007! Where else are you going to find so many interesting people, so many fascinating talks, and so many opportunities to have fun and make friends while learning useful stuff, all for so little expense? (Regular admission is only $70, and students get a big discount.) Get your ticket now because over half of the seats are already gone.

I hope to see you there.

Posted in
Tags , , , ,
no comments
no trackbacks
Reddit Delicious

Pittsburgh Perl Workshop 2007: Don't miss your chance to speak!

Posted by Tom Moertel Mon, 20 Aug 2007 23:18:00 GMT

This year’s Pittsburgh Perl Workshop is shaping up to be uber-techno-awesome. This year, it’s two big days of lively technical talks and full-force Perl festiveness. Yes, come October, programmers of all stripes will gather in Pittsburgh over the weekend of the 13th to grab a slice of the fun. A big slice. And you – yes you, my friend – should be there.

Lots of interesting talks are flowing in, but it’s not too late to grab a speaking slot. If you have anything interesting to say about Perl, now is your time. 20- and 50-minute slots are available. To claim one, just go to pghpw.org and submit a talk proposal. It’s easy. But act now, before it’s too late!

If you have any interest in Perl, you’ll want to be at PPW 2007, and if you have anything to say about Perl, you’ll definitely want to speak at PPW 2007.

Don’t miss your opportunity. Seize the day!

Posted in
Tags , , ,
no comments
no trackbacks
Reddit Delicious

The 2006 Pittsburgh Perl Workshop is a ten-ton can of programming whoop-ass

Posted by Tom Moertel Tue, 12 Sep 2006 21:30:00 GMT

I am on the planning committee for the 2006 Pittsburgh Perl Workshop and serve as the primary point of contact for speakers. That means I get the inside scoop on the talks. And from what I have seen, all I can say is, These talks kick ass. Well, actually I can say one more thing:

If there is any possible way you can manage to get yourself to Pittsburgh, Pennsylvania on Saturday, 23 September 2006, do not wait, do not mull it over, register now for the Pittsburgh Perl Workshop.

If you miss this one, you’ll probably end up weeping in front of your keyboard for a long, long time.

Perl At Work

PPW ’06 has speakers from the worlds of finance, bioinformatics, engineering, politics, health care, insurance, Web-2.0 start-ups, environmental monitoring, and mathematics. And they all have fascinating things to share with you about how they make Perl work for them and about how you can make Perl work for you.

Registration is only $20 – can you imagine that, in an age when programming conferences routinely cost hundreds if not thousands of dollars? – and all of the talks show you how to use Perl to do real work, solve real problems, and make your real life as a programming professional a whole lot saner. Even if you think you don’t care about Perl, you ought to be a part of PPW ’06 just for the rare opportunity to discover something you may have overlooked. (At $20, when are you ever going to get a chance like this again?)

Posted in ,
Tags , , , , , ,
1 comment
no trackbacks
Reddit Delicious

Solving the Google Code Jam "countPaths" problem in Perl

Posted by Tom Moertel Thu, 17 Aug 2006 06:21:00 GMT

As promised, here’s a Perl version of a dynamic-programming-based solver for the Google Code Jam “countPaths” problem. It is a straight translation of my improved Ruby implementation. As you might expect, the Perl version was pretty fast. It proved faster than the other scripting-language implementations I tried (in this rather unscientific benchmark, not to be taken seriously):

ImplementationRun time (s)
Haskell 0.9
Perl (code below) 1.7
Python 2.8
Ruby 4.2

All timings were taken while solving the maximum-size, all-the-same-letter problem on my 1.8-GHz Opteron box.

Here’s the Perl implementation:

#!/usr/bin/perl

# Tom Moertel <tom@moertel.com>
# 2006-08-16
#
# Perl-based solution to the Google Code Jam problem "countPaths".
# See http://www.cs.uic.edu/~hnagaraj/articles/code-jam/ for more.

use strict;
use warnings;

use List::Util 'sum';
use Math::BigInt;

sub count_paths {

  my ($grid, $word) = @_;

  my $rword  = reverse $word;
  my $rowmax = $#$grid;
  my $colmax = length($grid->[0]);
  my ($slab, $sum);

  for my $i (0 .. length($rword) - 1) {
    my $char = substr $rword, $i, 1;
    ($slab, my $previous_slab) = ([], $slab);
    for my $r (0 .. $rowmax) {
      my ($row, $line) = ($grid->[$r], $slab->[$r] ||= []);
      for my $c (0 .. $colmax) {
        $line->[$c] = $char ne substr($row,$c,1) ? 0 : $i == 0 ? 1 : do {
          $sum = 0;
          my $clo = $c > 0 ? $c - 1 : $c;
          my $chi = $c < $colmax ? $c + 1 : $c;
          for my $nr (($r>0 ? $r-1 : $r) .. ($r<$rowmax ? $r+1 : $r)) {
            for my $nc ($clo .. $chi) {
              $sum += $previous_slab->[$nr][$nc]
                if $nr != $r || $nc != $c;
            }
          }
          $sum;
        }
      }
    }
  }

  sum map @$_, @$slab;
}

print count_paths([("A"x50)x50], "A"x50), $/;
# 3.03835410591851e+47
Update: I simplified the code a whisper by removing an unnecessary variable $counts. Here’s a diff if you’re curious about what’s changed:
--- countpaths.pl.orig  2006-08-18 00:16:56.000000000 -0400
+++ /countpaths.pl      2006-08-18 00:19:30.000000000 -0400
@@ -19,11 +19,11 @@
   my $rword  = reverse $word;
   my $rowmax = $#$grid;
   my $colmax = length($grid->[0]);
-  my ($counts, $slab, $sum);
+  my ($slab, $sum);

   for my $i (0 .. length($rword) - 1) {
     my $char = substr $rword, $i, 1;
-    ($slab, my $previous_slab) = ($counts->[$i] ||= [], $slab);
+    ($slab, my $previous_slab) = ([], $slab);
     for my $r (0 .. $rowmax) {
       my ($row, $line) = ($grid->[$r], $slab->[$r] ||= []);
       for my $c (0 .. $colmax) {

Update 2: Augmented the introductory paragraph with a parenthetical comment that reminds readers that these single-fuzzy-data-point-style timings should not be taken seriously. Also removed the word “bested,” which might suggest that there is an optimization contest in play. Please, no wagering.

Update 3: Stripped another variable ($j), which was completely unused and leftover from previous implementation. (See why you shouldn’t code late at night?)

Posted in , ,
Tags , , , , , ,
2 comments
no trackbacks
Reddit Delicious

Mini-review of CafePress's direct-printed t-shirts

Posted by Tom Moertel Thu, 06 Jul 2006 03:48:00 GMT

As you may recall from a previous post, I set up a CafePress store to sell LectroTest Robot–branded stuff such as t-shirts, hats, mouse pads, magnets, and so on. CafePress does a good job of making their products appear to be of the highest quality, but I am naturally skeptical about such claims.

In particular, I wondered about their t-shirts. The results of their heat-transfer printing process – previously the only option – did not make me happy. Images with transparent areas revealed the transfer background, which over time yellowed and made the image seem to float on a sea of urine.

So when I set up The LectroTest Emporium, I specified the use of CafePress’s newer “direct-printing” process for t-shirts, hats, and every other product for which it was offered. Still, I wondered about the quality.

So I ordered up a LectroTest Robot t-shirt and put it to the test.

Test one: the eyeball and the scanner

When the t-shirt arrived, my initial impression was that it looked pretty darn good. The Robot came out perfectly, and even the pointy parts of the LectroTest lightning rendered without problems. The colors were true, if a little less saturated than I would have preferred.

Compared to silkscreen, the direct-printing process seems to produce results that are a bit less saturated and a bit less crisp. It’s like an airbrush artist rendered the Robot onto a billboard-sized shirt that was carefully shrunken to normal size.

Next, I threw the t-shirt on a flatbed scanner. The results are below. The first image is an overall view of the Robot logo. The second is a 300-dpi close-up of the lettering, where you can see the air-brush effect.

LectroTest Robot on CafePress white t-shirt

Close-up of LectroTest Robot on CafePress white t-shirt

Test two: the iron

To check for color offsetting, I turned the shirt inside out and ironed it on a full-steam, cotton setting. Throughout the ironing, the face of the front-side image was pressed into the white cotton of the back side of the shirt. Nevertheless, none of the ink migrated. The pure white remained pure white.

Test three: the washer

For the final test, I washed the shirt on a normal warm/cold cycle with a small load of other clothes. I then dried the clothing on a medium cycle. (CafePress recommends washing in cold water and drying on low, but nobody pampers their t-shirts like that, and so I tested under more typical conditions.)

When I took the shirt from the dryer, I didn’t see any signs of shrinkage or fading. To double-check, I ironed the shirt and threw it back on the flatbed scanner.

Doing a before-and-after comparison of the scans in the Gimp, I was able to see some shrinkage and fading (see image below). Top to bottom, the shirt shrank by about 4.5 percent; left to right, the shirt actually grew by about 1.8 percent. Minor fading was apparent, especially in the solid black areas. Neither the shrinkage nor the fading were concerning, however; both are typical for t-shirts, especially on the initial washing. The bottom line is that the shirt’s coolness was untarnished.

T-shirt before and after its first wash cycle

Summary

It’s a good t-shirt. It looked cool out of the box and fully captured the metallic fierceness of the beloved LectroTest Robot. The shirt handled a hot-steam ironing without any ink offsetting. It shrank and faded a bit on its initial wash, but neither change detracted meaningfully from the shirt. In sum, CafePress’s direct-printed t-shirts seem like the real deal: they look good and stand up to typical wear and washing.

Posted in , ,
Tags , , , ,
6 comments
no trackbacks
Reddit Delicious

LectroTest: new release, new talk, and the new LectroTest Emporium!

Posted by Tom Moertel Tue, 27 Jun 2006 18:21:00 GMT

LectroTest Robot

I have a bunch of LectroTest news. LectroTest, as you may know, is a specification-based, automatic testing system for Perl. It may look like Haskell’s QuickCheck, but it tastes like sweet, sweet Perl.

LectroTest 0.3500 was released

This version adds automatic tools for recording and playing back failures. Using them, you can automatically build regression-testing suites and incorporate them into your testing plan. All it takes is one new line of code:

use Test::LectroTest
    regressions => "regressions.txt";   # <-- that's it!

See the docs on CPAN for more.

My thanks to Steffen Müller, who suggested the feature and is already using it in cool stuff such as Number::WithError.

Slides from “Testing Tips with LectroTest” are now online

You can get the slides from my talk to the Pittsburgh Perl Mongers on 2006-06-14 here: Talk / Testing Tips with LectroTest. In the talk, I covered some of the newer LectroTest features, such as regression testing and Test::LectroTest::Compat, which lets you mix LectroTest with other Perl testing modules.

The LectroTest Emporium opens!

I have very little artistic ability. Nevertheless, alarming numbers of people seem to love the fiercely metallic mascot I created for LectroTest.

At the last Perl Mongers meeting, for example, people actually told me (somewhat sternly) I should put the adorable LectroTest Robot on t-shirts. I am now delighted to announce that I have taken their advice:

Introducing: The LectroTest Emporium

Some important points:

  • Yes, it’s a CafePress store
  • I’m not making any money on these things
  • I’m using direct printing, not heat-transfer printing, so the Robot won’t crack, feel stiff, or suffer from a yellowish transfer background. (CafePress has a comparison of the methods if you want the full details.)

Some items I have moral reservations about offering:

  • LectroTest Robot Teddy Bear - Who would be so reckless as to allow something as fierce and as powerful as the LectroTest Robot to come into direct contact with a defenseless, cuddly teddy bear?
  • LectroTest Robot Baby Bib - Actually, this is a great idea: your infant and the Robot exist in a symbiotic relationship. When your baby gets food all over the bib, the Robot will consume it (using a electrochemical process not entirely dissimilar to our human concept of “digestion”). Thus is the baby cleaned and the Robot fueled. It’s win-win.
  • LectroTest Robot Dog T-Shirt - I am fairly certain that the immense weight of the Robot would easily crush any smaller animal. This product strikes me as a very bad idea.

The T-shirts, on the other hand, are the robot’s meow. Check out the full collection at The LectroTest Emporium.

Posted in , , , ,
Tags , ,
1 comment
no trackbacks
Reddit Delicious

Perl and Pittsburgh: fun stuff coming your way!

Posted by Tom Moertel Wed, 12 Apr 2006 16:29:00 GMT

If you live anywhere near Pittsburgh and are interested in Perl, have I got a couple of announcements for you:

First, the ever-fascinating Mark Jason Dominus is speaking tonight (2006-04-12, now passed) on Improving Your Perl Code at the regular meeting of the Pittsburgh Perl Mongers. If you are interested in Perl, be there. (You don’t need to be a Perl Monger to attend.) Mark is a great speaker and wrote one of my favorite Perl books, Higher Order Perl, which puts the fun in functional programming.

Second, The Pittsburgh Perl Workshop is on. Put a big circle around this date on your calendar: Saturday, 23 September 2006. It’s a full day of sleeves-rolled-up Perl fun, all focused on the sweat-inducing theme of Perl At Work. To top it off, the Workshop is dirt cheap, especially if you get the 50-percent “Early Bird” discount. (Hint: register now.)

It’s a fun time for Perl folks in Pittsburgh.

Update: MJD gave his talk, and it rocked. If you missed it, you should find a time machine now and use it to take yourself back to Wednesday evening to hear his talk. Or you could find out when he is speaking in the future and be there. Either way, don’t miss out again.

Posted in ,
no comments
no trackbacks
Reddit Delicious

Talk: Embedded domain-specific languages for Perl

Posted by Tom Moertel Tue, 14 Mar 2006 22:39:00 GMT

Last week I gave a brief talk for the Pittsburgh Perl Mongers about embedding domain-specific languages into Perl. The slides from the talk are now available: Embedding an XHTML template language into Perl.

Title slide from my talk on embedding domain-specific languages into Perl

Posted in , ,
Tags , , ,
no comments
no trackbacks
Reddit Delicious

Older posts: 1 2