<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Tag perl</title>
    <link>http://blog.moertel.com/articles/tag/perl?tag=perl</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>See you at the Pittsburgh Perl Workshop 2008!</title>
      <description>&lt;p&gt;The &lt;a href="http://pghpw.org/ppw2008/"&gt;2008 Pittsburgh Perl Workshop&lt;/a&gt; is this
weekend!  I can&amp;#8217;t wait. (BTW, there are still seats available.  If you
can somehow get yourself to Pittsburgh this weekend, by
all means, &lt;a href="http://pghpw.org/ppw2008/purchase"&gt;grab a &lt;span class="caps"&gt;PPW&lt;/span&gt;
ticket&lt;/a&gt; &lt;em&gt;now&lt;/em&gt;.)&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m on the organizing committee, so I get an advance look at the
talks, and I&amp;#8217;m continually impressed by the quantity and sheer
interestingness of the things that the Perl community has to say.
When leading members of a community &lt;em&gt;volunteer&lt;/em&gt; their time to talk to
you about something they&amp;#8217;re passionate about, that something is
usually fascinating.&lt;/p&gt;


	&lt;p&gt;This year is no exception.  There are tons of talks I want to see.  Check out the schedule for
&lt;a href="http://pghpw.org/ppw2008/schedule?day=2008-10-11"&gt;Saturday&lt;/a&gt; and
&lt;a href="http://pghpw.org/ppw2008/schedule?day=2008-10-12"&gt;Sunday&lt;/a&gt;,
and you&amp;#8217;ll see what I mean.  (You&amp;#8217;ll note that there are even
talks on programming GPUs and adorable &lt;span class="caps"&gt;BUG&lt;/span&gt; embedded hardware.)&lt;/p&gt;


	&lt;p&gt;In addition to technical talks, there are &lt;em&gt;three&lt;/em&gt; courses being
offered this year.  Daniel Klein is once again leading his &lt;a href="http://pghpw.org/ppw2008/zerotoperl.html"&gt;From Zero
To Perl&lt;/a&gt; introductory course, which was widely praised at last year&amp;#8217;s
&lt;span class="caps"&gt;PPW&lt;/span&gt;.  Author and Perl trainer Peter Scott is offering &lt;a href="http://pghpw.org/ppw2008/maintainingcode.html"&gt;Maintaining
Code While Staying Sane&lt;/a&gt;, which is all about maintaining legacy code,
something most programmers must do for a (surprisingly) large chunk of
their careers.  Finally, the ever-knowledgeable brian d foy is
offering his &lt;a href="http://pghpw.org/ppw2008/masteringperl.html"&gt;Mastering Perl&lt;/a&gt; course for coders interested in learning
how to reliably write professional, enterprise-quality Perl programs.
(I think there are openings for some of the classes, too.  If you&amp;#8217;re interested,
click one of the links above and try to grab a spot.)&lt;/p&gt;


	&lt;p&gt;This year we&amp;#8217;re expanding on the Hackathons, too.  We actually have
allocated a dedicated &amp;#8220;Hackathon Room&amp;#8221; &amp;#8211; and we&amp;#8217;ve arranged for
freshly ground, freshly brewed coffee all day long to fuel the
hacking.  &lt;code&gt;:-)&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;All in all, it&amp;#8217;s shaping up to be another fun-filled, festive &lt;span class="caps"&gt;PPW&lt;/span&gt;.
I hope to see you there!&lt;/p&gt;</description>
      <pubDate>Wed, 08 Oct 2008 21:04:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:35955fc4-0c83-4e36-8e3c-74627f056f48</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2008/10/08/see-you-at-the-pittsburgh-perl-workshop-2008</link>
      <category>perl</category>
      <category>perl</category>
      <category>ppw</category>
      <category>ppw08</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/830</trackback:ping>
    </item>
    <item>
      <title>Perl helps prove universality of 2, 3 Turing machine</title>
      <description>&lt;p&gt;Alex Smith, a 20-year-old EE student in the UK, &lt;a href="http://www.nature.com/news/2007/071024/full/news.2007.190.html"&gt;proved that the 2, 3 Turing machine is universal&lt;/a&gt;. 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&amp;#8217;s universality.&lt;/p&gt;


	&lt;p&gt;This story has been getting a lot of attention lately, but one part of
the story has not: that the &lt;strong&gt;Perl&lt;/strong&gt; programming language is featured in the proof. In his documentation of the proof, &lt;a href="http://www.wolframscience.com/prizes/tm23/TM23Proof.pdf"&gt;Universality of Wolfram’s 2, 3 Turing
Machine&lt;/a&gt;,
Smith wrote, &amp;#8220;I have written several Perl programs, to demonstrate the
constructions given in the proof and to interpret the systems given in
various conjectures.&amp;#8221;  Smith&amp;#8217;s proof includes no fewer than 7 Perl
programs.&lt;/p&gt;


	&lt;p&gt;Go Perl!&lt;/p&gt;</description>
      <pubDate>Fri, 26 Oct 2007 13:23:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:bc3fe548-c24c-46bc-9c90-bba00f0326e9</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/10/26/perl-helps-prove-universality-of-2-3-turing-machine</link>
      <category>perl</category>
      <category>perl</category>
      <category>math</category>
      <category>proof</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/607</trackback:ping>
    </item>
    <item>
      <title>PPW 2007: a twenty-ton can of programming whoop-ass</title>
      <description>&lt;p&gt;I am on the planning committee for the &lt;a href="http://pghpw.org/"&gt;Pittsburgh Perl
Workshop&lt;/a&gt;.  So far, it&amp;#8217;s been an interesting
ride.  Last year was the first &lt;span class="caps"&gt;PPW&lt;/span&gt;, and it went surprisingly well.  In
the post-conference surveys, 94 percent of respondents said they
wanted to come back for another &lt;span class="caps"&gt;PPW&lt;/span&gt;, 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&amp;#8217;re drinking beer at the time.)&lt;/p&gt;


	&lt;p&gt;Now a year has gone by, and &lt;a href="http://pghpw.org/ppw2007/"&gt;&lt;span class="caps"&gt;PPW 2007&lt;/span&gt;&lt;/a&gt; is
only three weeks away.  This year&amp;#8217;s conference is 100% larger &amp;#8211; two
 full days &amp;#8211; and offers a new, much-asked-for option: a
&lt;a href="http://pghpw.org/ppw2007/zerotoperl.html"&gt;one-day introductory course&lt;/a&gt;
to give programmers new to Perl a quick dose of the language so they
can dive into the rest of the conference.  This year&amp;#8217;s conference also
offers a full-length Hackathon for those who feel the urge to code
at the conference.&lt;/p&gt;


	&lt;p&gt;The main attraction, however, is the conference&amp;#8217;s wide array of
&lt;a href="http://pghpw.org/ppw2007/schedule"&gt;technical talks&lt;/a&gt;.  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&amp;#8217;s most fascinating speakers, as well as many new speakers
drawn from the world of Perl.  No matter what your interests are,
you&amp;#8217;ll find talks for &lt;em&gt;you&lt;/em&gt; at &lt;span class="caps"&gt;PPW 2007&lt;/span&gt;.  (I&amp;#8217;m particularly interested
in the talks on continuation-based web applications, the cool new
stuff in Perl 5.10, and the Moose object system.)&lt;/p&gt;


	&lt;p&gt;All of this is to say: &lt;strong&gt;Do not miss &lt;span class="caps"&gt;PPW 2007&lt;/span&gt;!&lt;/strong&gt; 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 &lt;em&gt;learning useful stuff&lt;/em&gt;, all for so little expense?
(Regular admission is only $70, and students get a big discount.)
&lt;a href="http://pghpw.org/ppw2007/purchase"&gt;Get your ticket now&lt;/a&gt; because
over half of the seats are already gone.&lt;/p&gt;


	&lt;p&gt;I hope to see you there.&lt;/p&gt;</description>
      <pubDate>Tue, 25 Sep 2007 19:04:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:d03805d8-3998-40e2-a054-28497c9b3db8</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/09/25/ppw-2007-a-twenty-ton-can-of-programming-whoop-ass</link>
      <category>perl</category>
      <category>perl</category>
      <category>pittsburgh</category>
      <category>ppw</category>
      <category>ppw2007</category>
      <category>conferences</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/585</trackback:ping>
    </item>
    <item>
      <title>Pittsburgh Perl Workshop 2007: Don't miss your chance to speak!</title>
      <description>&lt;p&gt;This year&amp;#8217;s &lt;a href="http://pghpw.org/"&gt;Pittsburgh Perl Workshop&lt;/a&gt; is shaping up
to be &lt;em&gt;uber-techno-awesome&lt;/em&gt;.  This year, it&amp;#8217;s &lt;em&gt;two&lt;/em&gt; 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 &amp;#8211; yes 
&lt;em&gt;you&lt;/em&gt;, my friend &amp;#8211; should be there.&lt;/p&gt;


	&lt;p&gt;Lots of interesting talks are flowing in, but it&amp;#8217;s not too late 
to grab a speaking slot.  If &lt;strong&gt;you&lt;/strong&gt; have
&lt;em&gt;anything&lt;/em&gt; interesting to say about Perl, &lt;em&gt;now is your time&lt;/em&gt;.  20-
and 50-minute slots are available.  To claim one, just go to
&lt;a href="http://pghpw.org/"&gt;pghpw.org&lt;/a&gt; and &lt;a href="http://pghpw.org/ppw2007/newtalk"&gt;submit a talk
proposal&lt;/a&gt;. It&amp;#8217;s easy.  But
act now, before it&amp;#8217;s too late!&lt;/p&gt;


	&lt;p&gt;If you have any interest in Perl, you&amp;#8217;ll want to be at &lt;a href="http://pghpw.org/ppw2007/"&gt;&lt;span class="caps"&gt;PPW&lt;/span&gt;
2007&lt;/a&gt;, and if you have anything to say about
Perl, you&amp;#8217;ll definitely want to &lt;a href="http://pghpw.org/ppw2007/newtalk"&gt;speak at &lt;span class="caps"&gt;PPW&lt;/span&gt;
2007&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Don&amp;#8217;t miss your opportunity.  Seize the day!&lt;/p&gt;</description>
      <pubDate>Mon, 20 Aug 2007 19:18:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:8366fe0e-4a11-4443-8084-4b15651acd14</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/08/20/pittsburgh-perl-workshop-2007-dont-miss-your-chance-to-speak</link>
      <category>perl</category>
      <category>perl</category>
      <category>pghpw</category>
      <category>ppw2007</category>
      <category>speaking</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/541</trackback:ping>
    </item>
    <item>
      <title>Talk: Fun with Numbers: R and Perl (and IMDB data)</title>
      <description>&lt;p&gt;Last week I gave a talk on the &lt;a href="http://www.r-project.org/"&gt;R statistics
system&lt;/a&gt; and Perl for the &lt;a href="http://pgh.pm.org/"&gt;Pittsburgh Perl
Mongers&lt;/a&gt;.  The example that threaded through the
talk was something I have written about here before, &lt;a href="http://blog.moertel.com/articles/2006/01/17/mining-gold-from-the-internet-movie-database-part-1"&gt;extracting
useful information from the Internet Movie
Database&lt;/a&gt;.
If you&amp;#8217;ve read my earlier &lt;a href="http://blog.moertel.com/articles/2006/01/17/mining-gold-from-the-internet-movie-database-part-1"&gt;blog
post&lt;/a&gt;
or have used the &lt;a href="http://community.moertel.com/ss/space/IMDB+Movie-Rating+Decoder+Ring"&gt;Grand Unified &lt;span class="caps"&gt;IMDB&lt;/span&gt; Movie Rating Decoder
Ring&lt;/a&gt;,
you might find the slides from the talk interesting.  They provide
some more details about the R and Perl code used to analyze the &lt;span class="caps"&gt;IMDB&lt;/span&gt; data
and create the decoder ring.&lt;/p&gt;


	&lt;p&gt;You can get the slides here:&lt;/p&gt;


&lt;div class="slide"&gt;
&lt;a href="http://community.moertel.com/~thor/talks/pgh-pm-perl-and-r.pdf"&gt;&lt;img src="http://community.moertel.com/~thor/talks/pgh-pm-perl-and-r.png" title="Title slide from my talk on R and Perl" alt="Title slide from my talk on R and Perl" /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Thu, 21 Jun 2007 14:38:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:790fc9ef-72d5-43fc-b140-f0aaeccad6ee</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2007/06/21/talk-fun-with-numbers-r-and-perl-and-imdb-data</link>
      <category>talks</category>
      <category>perl</category>
      <category>talks</category>
      <category>R</category>
      <category>imdb</category>
      <category>statistics</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/481</trackback:ping>
    </item>
    <item>
      <title>The 2006 Pittsburgh Perl Workshop is a ten-ton can of programming whoop-ass</title>
      <description>&lt;p&gt;I am on the planning committee for the &lt;a href="//pghpw.org/"&gt;2006 Pittsburgh Perl
Workshop&lt;/a&gt; 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, &lt;em&gt;These
talks kick ass.&lt;/em&gt;  Well, actually I can say one more thing:&lt;/p&gt;


&lt;p style="padding-left:2em; padding-right:2em"&gt;&lt;em&gt;
If there is any possible way you can manage to get yourself to Pittsburgh, Pennsylvania
on Saturday, 23 September 2006, &lt;strong&gt;do not wait, do not mull
it over, &lt;a href="http://pghpw.org/register.html"&gt;register now for the Pittsburgh Perl Workshop&lt;/a&gt;&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you miss this one, you&amp;#8217;ll probably end up weeping in front of your keyboard for a long, long time.&lt;/p&gt;

	&lt;p&gt;&lt;a href="http://pghpw.org/"&gt;&lt;img src="http://community.moertel.com/~thor/pix/20060912/perl-at-work-sign.png" style="float: right; margin-left: 2em;;" title="Perl At Work" alt="Perl At Work" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;&lt;span class="caps"&gt;PPW&lt;/span&gt;&amp;#160;&amp;#8217;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.&lt;/p&gt;


	&lt;p&gt;Registration is only $20 &amp;#8211; can you imagine that, in an age when
programming conferences routinely cost &lt;a href="http://weblog.rubyonrails.org/2005/11/27/railsconf-2006-june-22-25-chicago"&gt;hundreds&lt;/a&gt; if not &lt;a href="http://java.sun.com/javaone/sf/registration.jsp"&gt;thousands&lt;/a&gt; of dollars? &amp;#8211; 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 &lt;em&gt;think&lt;/em&gt;
you don&amp;#8217;t care about Perl, you ought to be a part of
&lt;span class="caps"&gt;PPW&lt;/span&gt;&amp;#160;&amp;#8217;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?)&lt;/p&gt;</description>
      <pubDate>Tue, 12 Sep 2006 17:30:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:c9ac1a00-4f9f-46dc-8756-be1963447590</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2006/09/12/the-2006-pittsburgh-perl-workshop-is-a-ten-ton-can-of-programming-whoop-ass</link>
      <category>perl</category>
      <category>pittsburgh</category>
      <category>perl</category>
      <category>pittsburgh</category>
      <category>ppw</category>
      <category>ppw06</category>
      <category>talks</category>
      <category>cool</category>
      <category>stuff</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/175</trackback:ping>
    </item>
    <item>
      <title>Solving the Google Code Jam &amp;quot;countPaths&amp;quot; problem in Perl</title>
      <description>&lt;p&gt;As promised, here&amp;#8217;s a Perl version of a dynamic-programming-based solver
for the Google Code Jam &amp;#8220;countPaths&amp;#8221; problem.  It is a straight
translation of my &lt;a href="http://blog.moertel.com/articles/2006/08/16/solving-the-google-code-jam-countpaths-problem-in-ruby"&gt;improved Ruby implementation&lt;/a&gt;.
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):&lt;/p&gt;


&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Implementation&lt;/th&gt;&lt;th&gt;Run time (s)&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href="http://blog.moertel.com/articles/2006/08/15/solving-the-google-code-jam-countpaths-problem-in-haskell"&gt;Haskell&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;0.9&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Perl (code below)&lt;/td&gt;
    &lt;td&gt;1.7&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href="http://my.opera.com/ipeev/blog/show.dml/409336"&gt;Python&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;2.8&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href="http://blog.moertel.com/articles/2006/08/16/solving-the-google-code-jam-countpaths-problem-in-ruby"&gt;Ruby&lt;/a&gt;&lt;/td&gt;
    &lt;td&gt;4.2&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

	&lt;p&gt;All timings were taken while solving the maximum-size, all-the-same-letter
problem on my 1.8-GHz Opteron box.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the Perl implementation:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl

# Tom Moertel &amp;lt;tom@moertel.com&amp;gt;
# 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-&amp;gt;[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-&amp;gt;[$r], $slab-&amp;gt;[$r] ||= []);
      for my $c (0 .. $colmax) {
        $line-&amp;gt;[$c] = $char ne substr($row,$c,1) ? 0 : $i == 0 ? 1 : do {
          $sum = 0;
          my $clo = $c &amp;gt; 0 ? $c - 1 : $c;
          my $chi = $c &amp;lt; $colmax ? $c + 1 : $c;
          for my $nr (($r&amp;gt;0 ? $r-1 : $r) .. ($r&amp;lt;$rowmax ? $r+1 : $r)) {
            for my $nc ($clo .. $chi) {
              $sum += $previous_slab-&amp;gt;[$nr][$nc]
                if $nr != $r || $nc != $c;
            }
          }
          $sum;
        }
      }
    }
  }

  sum map @$_, @$slab;
}

print count_paths([("A"x50)x50], "A"x50), $/;
# 3.03835410591851e+47
&lt;/code&gt;&lt;/pre&gt;

&lt;div class="update"&gt; &lt;strong&gt;Update:&lt;/strong&gt; I simplified the code a whisper by
removing an unnecessary variable &lt;code&gt;$counts&lt;/code&gt;.  Here&amp;#8217;s a diff
if you&amp;#8217;re curious about what&amp;#8217;s changed:

&lt;pre&gt;&lt;code&gt;--- 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-&amp;gt;[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-&amp;gt;[$i] ||= [], $slab);
+    ($slab, my $previous_slab) = ([], $slab);
     for my $r (0 .. $rowmax) {
       my ($row, $line) = ($grid-&amp;gt;[$r], $slab-&amp;gt;[$r] ||= []);
       for my $c (0 .. $colmax) {
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt; 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
&amp;#8220;bested,&amp;#8221; which might suggest that there is an optimization
contest in play.  Please, no wagering.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Update 3:&lt;/strong&gt; Stripped another variable (&lt;code&gt;$j&lt;/code&gt;), which was
completely unused and leftover from previous implementation.  (See
why you shouldn&amp;#8217;t code late at night?)&lt;/p&gt;


&lt;/div&gt;</description>
      <pubDate>Thu, 17 Aug 2006 02:21:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:53c5a877-68a2-450b-8d93-6bdbbd5ffd59</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2006/08/17/solving-the-google-code-jam-countpaths-problem-in-perl</link>
      <category>programming</category>
      <category>perl</category>
      <category>fun stuff</category>
      <category>google</category>
      <category>code</category>
      <category>jam</category>
      <category>wordpaths</category>
      <category>countpaths</category>
      <category>puzzles</category>
      <category>perl</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/160</trackback:ping>
    </item>
    <item>
      <title>LectroTest: new release, new talk, and the new LectroTest Emporium!</title>
      <description>&lt;div class="centered"&gt;
&lt;img src="http://community.moertel.com/ss/space/LectroTest/LectroTestLogoSmall.png" title="LectroTest Robot" alt="LectroTest Robot" /&gt;
&lt;/div&gt;

	&lt;p&gt;I have a bunch of &lt;a href="http://community.moertel.com/LectroTest"&gt;LectroTest&lt;/a&gt; news.  LectroTest, as you may know, is a specification-based,
automatic testing system for Perl.  It may look like Haskell&amp;#8217;s &lt;a href="http://www.cs.chalmers.se/~rjmh/QuickCheck/"&gt;QuickCheck&lt;/a&gt;, but it tastes like sweet, sweet Perl.&lt;/p&gt;


	&lt;h3&gt;LectroTest 0.3500 was released&lt;/h3&gt;


	&lt;p&gt;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:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;use Test::LectroTest
    regressions =&amp;gt; "regressions.txt";   # &amp;lt;-- that's it!
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;See the &lt;a href="http://search.cpan.org/dist/Test-LectroTest/"&gt;docs on &lt;span class="caps"&gt;CPAN&lt;/span&gt;&lt;/a&gt; for more.&lt;/p&gt;


	&lt;p&gt;My thanks to Steffen Müller, who suggested the feature and is already
using it in cool stuff such as &lt;a href="http://search.cpan.org/dist/Number-WithError/"&gt;Number::WithError&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;Slides from &amp;#8220;Testing Tips with LectroTest&amp;#8221; are now online&lt;/h3&gt;


	&lt;p&gt;You can get the slides from my talk to the Pittsburgh Perl Mongers on
2006-06-14 here: &lt;a href="http://community.moertel.com/ss/space/Talks/Testing+Tips+with+LectroTest"&gt;Talk / Testing Tips with
LectroTest&lt;/a&gt;.
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.&lt;/p&gt;


	&lt;h3&gt;The LectroTest Emporium opens!&lt;/h3&gt;


	&lt;p&gt;I have very little artistic ability.  Nevertheless, alarming numbers
of people seem to love the fiercely metallic mascot I created for
LectroTest.&lt;/p&gt;


	&lt;p&gt;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:&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Introducing: &lt;em&gt;&lt;a href="http://www.cafepress.com/lectrotest"&gt;The LectroTest Emporium&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Some important points:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Yes, it&amp;#8217;s a CafePress store&lt;/li&gt;
		&lt;li&gt;I&amp;#8217;m not making any money on these things&lt;/li&gt;
		&lt;li&gt;I&amp;#8217;m using &lt;em&gt;direct printing&lt;/em&gt;, not heat-transfer printing, so
  the Robot won&amp;#8217;t crack, feel stiff, or suffer from a yellowish
  transfer background.  (CafePress has a &lt;a href="http://www.cafepress.com/cp/info/help/help_printingprocess.aspx"&gt;comparison of the methods&lt;/a&gt; if you want the full details.)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Some items I have moral reservations about offering:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.cafepress.com/lectrotest.63672177"&gt;LectroTest Robot Teddy Bear&lt;/a&gt; -
  Who would be so reckless as to allow something as fierce and as powerful
  as the LectroTest Robot to come into &lt;em&gt;direct contact&lt;/em&gt; with a defenseless, cuddly
  teddy bear?&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://www.cafepress.com/lectrotest.63669666"&gt;LectroTest Robot Baby Bib&lt;/a&gt; -
  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 &amp;#8220;digestion&amp;#8221;).  Thus is the
  baby cleaned and the Robot fueled.  It&amp;#8217;s win-win.&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://www.cafepress.com/lectrotest.63672178"&gt;LectroTest Robot Dog T-Shirt&lt;/a&gt; -
  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.&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;&lt;a href="http://www.cafepress.com/lectrotest#apparel"&gt;The T-shirts&lt;/a&gt;, on the other hand, are the robot&amp;#8217;s meow.  Check out the
full collection at &lt;a href="http://www.cafepress.com/lectrotest"&gt;The LectroTest Emporium&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Tue, 27 Jun 2006 14:21:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:eb99eca33b05593075a39ab873549308</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2006/06/27/lectrotest-new-release-new-talk-and-the-new-lectrotest-emporium</link>
      <category>perl</category>
      <category>fun stuff</category>
      <category>testing</category>
      <category>marketing</category>
      <category>talks</category>
      <category>perl</category>
      <category>testing</category>
      <category>lectrotest</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/72</trackback:ping>
    </item>
    <item>
      <title>Talk: Embedded domain-specific languages for Perl</title>
      <description>&lt;p&gt;Last week I gave a brief talk for the &lt;a href="http://pgh.pm.org/"&gt;Pittsburgh Perl
Mongers&lt;/a&gt; about embedding domain-specific languages
into Perl.  The slides from the talk are now available:
&lt;a href="http://community.moertel.com/ss/space/Talks/Embedding+an+XHTML-template+language+into+Perl"&gt;Embedding an &lt;span class="caps"&gt;XHTML&lt;/span&gt; template language into Perl&lt;/a&gt;.&lt;/p&gt;


&lt;div class="slide"&gt;
&lt;a href="http://community.moertel.com/ss/space/Talks/Embedding+an+XHTML-template+language+into+Perl"&gt;&lt;img src="http://community.moertel.com/ss/space/Talks/Embedding+an+XHTML-template+language+into+Perl/pgh-pm-edsls.png" title="Title slide from my talk on embedding domain-specific languages into Perl" alt="Title slide from my talk on embedding domain-specific languages into Perl" /&gt;&lt;/a&gt;
&lt;/div&gt;</description>
      <pubDate>Tue, 14 Mar 2006 17:39:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:191081838b4ed9661674f99937da8ea9</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2006/03/14/talk-embedded-domain-specific-languages-for-perl</link>
      <category>programming languages</category>
      <category>perl</category>
      <category>talks</category>
      <category>perl</category>
      <category>talks</category>
      <category>dsls</category>
      <category>pghpm</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/59</trackback:ping>
    </item>
    <item>
      <title>Finding duplicate words in writing: a handy Perl script</title>
      <description>&lt;p&gt;While we read, our minds subconsciously correct mistakes and overlook omissions in the steam of words we see, especially when reading familiar texts.  This mental feature, which allows us to skim long documents, has a nasty drawback when we are writing:  it makes it our own mistakes harder to spot.&lt;/p&gt;


	&lt;p&gt;One of the most common writing mistakes that our brains stealthily correct is the the duplicate word problem.  For example, I inserted a double &lt;em&gt;the&lt;/em&gt; into the previous sentence.  Did you catch it?&lt;/p&gt;


	&lt;p&gt;If so, don&amp;#8217;t be too proud of your accomplishment.  It is easier to see errors in others&amp;#8217; writing than in your own. Your brain is attuned to your natural writing patterns and much more likely to repair &lt;em&gt;your&lt;/em&gt; mistakes without your knowing.&lt;/p&gt;


	&lt;p&gt;To overcome this problem, some writers recommend reading your work backward, but I think computers are a more practical solution.&lt;/p&gt;


	&lt;p&gt;Here&amp;#8217;s the Perl script that I use to spot duplicate words:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;#!/usr/bin/perl -n00
# dupwords.pl - find duplicate words in the input stream

print "$ARGV: para $.: ($1)\n" 
    while /(\b(\w+)\b\s+\b\2\b)/sg;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;I use this script from Emacs via &lt;code&gt;shell-command-on-region&lt;/code&gt;.  I also use it from the command line to find duplicate-word errors in batch:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;find . -name '*.txt' | xargs dupwords.pl
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The duplicate-words problem is a favorite for programming cookbooks, so if you don&amp;#8217;t like my recipe (or Perl), you have many other options.&lt;/p&gt;</description>
      <pubDate>Wed, 01 Mar 2006 15:17:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:71bf254d3e1a057246c1b9ee1d5fd452</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2006/03/01/finding-duplicate-words-in-writing-a-handy-perl-script</link>
      <category>perl</category>
      <category>writing</category>
      <category>perl</category>
      <category>writing</category>
      <category>tools</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/57</trackback:ping>
    </item>
  </channel>
</rss>
