jdporter's Journal http://use.perl.org/~jdporter/journal/ jdporter's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:17:00+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 jdporter's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~jdporter/journal/ Do not look sulky! http://use.perl.org/~jdporter/journal/22743?from=rss <a href="http://www.francep.com/english/black_chanterelles.htm">Black chanterelles</a> jdporter 2005-01-17T02:19:06+00:00 journal "One of these summers the West will burn down." http://use.perl.org/~jdporter/journal/21184?from=rss Dear journal:<blockquote><div><p>Fire fighters, instead of being viewed as heroes, should be called what they are: money grubbing mercenaries out to kill fires. [Forest] Fires have as much right to exist as grizzlies and wolves.</p><blockquote><div><p>-- <i> <a href="http://www.fire-ecology.org/research/smokey_bear_legacy.htm">Smokey the Bear's Legacy on the West</a> </i></p></div> </blockquote></div> </blockquote> jdporter 2004-10-04T19:23:18+00:00 journal Dereliction of diligence http://use.perl.org/~jdporter/journal/19269?from=rss <a href="http://www.amconmag.com/2004_06_21/cover.html">"It is impossible to exaggerate the dereliction of diligence in the Congress."</a> jdporter 2004-06-15T18:21:36+00:00 journal Three-hour boy-meets-girl candyfloss extravaganza http://use.perl.org/~jdporter/journal/19262?from=rss <p> <a href="http://www.reuters.com/newsArticle.jhtml?storyID=5417414">Girlfriends</a> </p><p>also - <a href="http://www.ne.jp/asahi/bluemoon/earth/19981221/19981221.html">Fire</a> </p> jdporter 2004-06-15T12:35:10+00:00 journal WMP in my DVD player? No thanks. http://use.perl.org/~jdporter/journal/17442?from=rss MicroS..t is trying to embrace and extend (and we know what that means) the nascent digitial home theater business. But as one independent contractor <a href="http://resmagonline.com/articles/publish/article_261.shtml">wrote</a>:<blockquote><div><p> <i>"...Just in writing this article, my laptop running WinXP crashed twice, and I'm not willing to specify that level of unreliability into a customer's system."</i></p></div> </blockquote> jdporter 2004-02-16T19:34:25+00:00 journal Useful stuff for Perl Monks http://use.perl.org/~jdporter/journal/9254?from=rss Those of you who use <a href="http://perlmonks.org/">Perl Monks</a> frequently may be interested in the <a href="http://perlmonks.org/index.pl?node_id=215946"> the module and suite of tools</a> I published recently. They allow you to perform various PerlMonks tasks programmatically or at the command line. jdporter 2002-12-03T21:40:23+00:00 journal Bad Ass http://use.perl.org/~jdporter/journal/8544?from=rss <a href="http://story.news.yahoo.com/news?tmpl=story&amp;ncid=404&amp;e=7&amp;cid=404&amp;u=/021022/126/2hnwy.html"> For many years, Manassas (Virginia) has had a reputation as a red-neck town.</a> jdporter 2002-10-23T16:22:44+00:00 journal Pandorama http://use.perl.org/~jdporter/journal/8524?from=rss <p>Here is a very cool "camera-less film" by the very cool Nina Paley. It is called <a href="http://www.ninapaley.com/pandoramahome.html"> <i>Pandorama</i> </a>.</p><p>(Caution: it's a 16 megabyte Quicktime video.)</p> jdporter 2002-10-22T15:32:38+00:00 journal Satanicide http://use.perl.org/~jdporter/journal/8523?from=rss <p>Yesterday I read in someone's blog about how the <a href="http://www.whitehouse.org/firstlady/">First Lady</a> is teaming up with rock music players <a href="http://www.satanicide.com/">Satanicide</a> to promote <a href="http://www.whitehouse.org/satanicide/">teen abstinence</a>.</p><p>And don't miss <a href="http://www.cafeshops.com/cp/store.aspx?s=jenna">WWJD</a>!</p> jdporter 2002-10-22T15:17:26+00:00 journal Falls Church http://use.perl.org/~jdporter/journal/8449?from=rss <p>It's strange, hearing the name of my little home town mentioned all over the national news. Ordinarily, Falls Church is obscured in the umbra of Washington D.C.</p><p>I wasn't too scared about the sniper thing while he was striking up in Maryland and down around Fredericksburg. I mean, it was terrible, and cause for great concern, but I didn't feel like my own life was in danger.</p><p>But... I live about a mile away from that Home Depot. I've been there many times. I drive by that shopping center every day, on my way to and from work.</p><p>Not that I'm afraid, really. Between the tiny probability of the sniper fixing <i>me</i> in his crosshairs, and the fact that I'm not afraid to die, there isn't much reason to be really scared.</p> jdporter 2002-10-18T15:05:18+00:00 journal Senses working overtime http://use.perl.org/~jdporter/journal/8446?from=rss <p>Quick -- how many different kinds of things can we taste?</p><p>If you said <i>zillions</i>, think again.</p><p>If you said <i>four</i>, then huzzah for remembering what we all learned in kindergarten.</p><p>What are they?</p><p>Sweet, sour, salty, bitter.</p><p>Well, it turns out that there is actually a fifth. It is sometimes described as "savory", "meaty", or "pungent", but the Japanese have a word for it: <i>umami</i>. And chemically it is the sensitivity to glutamic acid and its salts, the glutamates. Glutamic acid is one of the amino acids, found in abundance in protein.</p><p><a href="http://www.google.com/search?q=%22glutamic+acid%22+umami"></a><br>Here's a nice Google search that should turn up more info on the subject.</p> jdporter 2002-10-18T14:47:25+00:00 journal JPPPP http://use.perl.org/~jdporter/journal/8196?from=rss <p>This is an addendum to <a href="http://use.perl.org/~jdporter/journal/5720">a previous journal entry</a>.</p><p>This evening, on a news talk show about the impending invasion of Iraq, some ex-general type said something like</p><blockquote><div><p><nobr> <wbr></nobr><i>...the cost is going to increase, the cost in terms of humans lives are going to increase...</i></p></div> </blockquote><p><b>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARRRRRGH!</b></p> jdporter 2002-10-06T03:54:24+00:00 journal wiki blows http://use.perl.org/~jdporter/journal/7423?from=rss <p>Don't get me wrong, wiki is a pretty cool idea. And in many ways, it's better than almost anything to which it might be reasonably compared.</p><p>But let's face it, wiki pretty much blows.</p><p>The problem? Scalability.</p><p>One of the other guys where I work, the chairman of a technical working group, decided to try using wiki as a collaboration tool as the group hammered out some revisions to a honking old document.</p><p>With only as few as <b>three</b> people working on the document -- some 100 different pages -- we had a problem with people overwriting each other's edits.</p><p>One part of the cause was a kind of social phenomenon: although there were around 100 pages in the wiki, at any given time only about 2 or 3 were actually of any interest to anyone. You know how it happens: one guy modifies a page; another guy checks to see what pages have been recently modified, notices that one, goes to check out what changed, and immediately wants to weigh in with his own changes. Get two guys doing that, and <b>whammo!</b> -- big headaches and discontent.</p><p>I'm now quite convinced that the wiki paradigm of editing whole web pages cannot reliably scale above <b> <i>exactly one author</i> </b>.</p><p>The real problem, of course, is locking. The lack thereof, that is.</p> jdporter 2002-08-30T18:47:25+00:00 journal :syntax english http://use.perl.org/~jdporter/journal/7249?from=rss <p>So, just for the heck of it, I created a syntax highlighting module for english. (This is for vim, of course -- the only <b>real</b> editor.<nobr> <wbr></nobr>;-)</p><p>It works well enough, but:<br>a) it takes almost 10 minutes to highlight a screen-full of english text on my 1 GHz linux box; and<br>b) the result appears -- at a casual peruse, anyway -- to be little more useful than if the words were highlighted with random colors!</p><p>Oh well...<nobr> <wbr></nobr>:-)</p> jdporter 2002-08-22T20:49:54+00:00 journal Tcl http://use.perl.org/~jdporter/journal/7110?from=rss <p>Well, I've started dabbling in Tcl. It's something I've been meaning to do for Quite Some Time Now.</p><p>I have to say that the experience, over all, has been very satisfactory and non-frustrating. That is, it has not been what I expected it to be!</p><p>The Scary Thing About Tcl, as Perl hackers are typically led to believe, is its Obnoxious Shell-like Whitespace-based Parsage. Also its Ubiquitous Symbolic References. And "Variable Scoping is Hacked and Twisted, so Use Global Variables For Your Mental Health".</p><p>But in practice, I find that Tcl has an elegant -- if imperfect -- consistency that is easy to program in. Yes, it's been a mental adjustment, but not a huge one.</p><p>One of the things I like about Tcl is its Lispiness. Essentially, square braces are eval'ed like lists in Lisp, and curly braces are like quoted lists. A block of code is just a block of terms that might (might!) get sent to the eval function. In fact, Tcl's syntax is extremely reminiscent of Lisp's. (One thing that's different is Tcl's (less than desirable) sensitivity to newlines.)</p><p>I also like Tcl's built-in support for event loops.</p><p>Basically what it boils down to is that all the things I've heard people say to try to scare me away from Tcl have turned out to be bogus.</p><p>That's not to say there aren't a few good reasons to continue using Perl... but mostly they're cultural, or community things. The one thing about perl that can be said to be qualitatively better, as a language, is that it is possible to write things much more tersely. Well, I'm sure there are others. I'm sure the Tcl regex engine hasn't kept up with Perl's, for example.</p> jdporter 2002-08-15T17:33:51+00:00 journal perl lists in mbox http://use.perl.org/~jdporter/journal/6606?from=rss <p>Wanting to get caught up on various perl.org-based mailing lists, I thought I'd just download the archives in mbox format and view them in my local mail reader.</p><p>Not so fast.</p><p>Turns out the mailing lists are managed with ezmlm, which stores the messages in a format other than mbox.</p><p>So I asked Ask what it would take to bring that capability to reality. He told me, and I volunteered to do it. So I was up until about 2:30 last night banging out a script which converts from <i>maildir</i> format to mbox.</p><p>I thought about trying to use the tools that come with ezmlm, or maybe the <tt>Mail::Ezmlm</tt> wrapper module... But it turns out that this conversion is too simple to require that approach. Basically, every message is stored in its own file, and the files are shoved down in a directory structure that seems to have no more purpose than to keep any given directory from having too many files in it. Also, each directory contains an index file.</p><p>So, essentially, converting that to mbox format takes nothing more than concatenating all the files of interest into one file.</p><p>But there are (of course) a few glitches.</p><p>First and foremost, the messages as stored do not have the initial '<tt>From </tt>' line. So, I process each file through <tt>formail -a Date:</tt>, which fabricates a '<tt>From </tt>' line, containing the info from the <tt>Date:</tt> header.</p><p>Then I process each file through a little loop of perl which parses the date (using the handy Date::Manip module) and reformats it into the correct format required for '<tt>From </tt>' lines.</p><p>The second issue is filtering down the messages to just those of interest. In this case, I want to select only those whose date is in a given year/month timeframe (specified by the user).</p><p>Anyway, the script works pretty nicely. It's not particularly fast. In my test, it takes 13 seconds (user) to read in 1300 messages and process 200 messages through formail out to the mbox. The main overhead is probably spawning and reading from formail. Considering how little it actually does, I should probably replace it with some perl. Some more performance hit probably comes from using Date::Manip to parse and reformat dates. But man, the flexibility! It can understand just about anything you throw at it. For example, to convert the current month's messages, you can specify "today" rather than an explicit year and month.</p><p>----<br>O.k., replaced the formail bit with perl code to create the '<tt>From </tt>' line. Shaved about 10% off the time. But remember that this step is only done for the messages which match the interest criteria. In general, the number of matching messages will be much less than the total number of messages in the archive.</p> jdporter 2002-07-24T16:40:05+00:00 journal robot girl http://use.perl.org/~jdporter/journal/6484?from=rss <p>Broke out the ol' Was (Not Was) this morning... Damn cool. Was is a geek for sure.</p><p>(The following lyrics have "Robot Girl" scattered throughout; I've omitted them for clarity.)</p><blockquote><div><p> <i><br><b>Robot Girl</b></i></p><p><i>TV screen faces are'nt pretty, it's true<br>She will do anything I tell her to<br>Her conversation's not what you'd call clever<br>But she can't contradict me, oh no never</i></p><p><i>Move your arms a few degrees more<br>Now gently back and forth<br>You know just where to scratch<br>We're such a perfect match</i></p><p><i>I'm in a whirl - You're my robot girl</i></p><p><i>Programmed for love, she can be quite tender<br>Treat her unkind, nothing offends her<br>She vacuums the carpet and doesn't complain<br>She'll walk the dog in the pouring rain</i></p><p><i>You are my world - You're my robot girl</i></p><p><i>Don't have to worry about diamonds and furs<br>There's no confusion about what's mine and what's hers<br>When she fixes her lens on my bedside I shudder<br>She goes through my blood like a hot knife through butter<br></i></p></div> </blockquote> jdporter 2002-07-19T20:01:28+00:00 journal JPPPP http://use.perl.org/~jdporter/journal/6393?from=rss <p>This is one that is not very common in ordinary usage, but which seems to recur like a bad rash in bureaucratese and militarese.</p><p><i>"to include"</i></p><p>Apparently some technical writers have an aversion to the more usual (and more correct) <i>"including"</i>.</p><p>Granted, "to include" can be right in certain contexts -- specifically, when describing a future/potential situation, as in some kind of specification. E.g.:</p><blockquote><div><p> <i>The vessel shall be capable of containing, with zero leakage, a variety of solvents, to include water, ethanol, and benzene.</i></p></div> </blockquote><p>Problem is, some people conclude that it therefore makes sense in <i>every</i> context. Consider:</p><blockquote><div><p> <i>Medieval lords employed cruel tactics to keep serfs in subjugation, to include torture, whimsical justice, and extreme taxation.<br></i></p></div> </blockquote> jdporter 2002-07-16T17:53:03+00:00 journal JPPPP http://use.perl.org/~jdporter/journal/6373?from=rss <p>And the list goes on...</p><p>O.k., people, it's not "extendable", it's "extensible".</p><p>I think people just think they take the infinitive form, and add "-able".</p><p>Wrong!</p><p>And I just read in another journal (which shall remain anonymous) the word "undefendable".</p><p>Cripes. "Defensible", "indefensible".</p><p>Make a note of it.</p> jdporter 2002-07-15T21:46:39+00:00 journal Mulholland Drive http://use.perl.org/~jdporter/journal/6366?from=rss <p>(CAUTION: SPOILER BELOW)</p><p>We watched Mulholland Drive last Sunday (yesterday), and it has me pretty freaked. I mean, <b>WTF</b> is going on in that movie? I really liked Lost Highway, and there are plenty of similarities between the two (almost too many, one might opine), but at least with Lost Highway I was able to fit the ends of the mobius strip together and make it make sense. Mulholland Drive just has too much bizarre, unconnected stuff, it's too much of a puzzle for me. I think I might have to watch it a time or two more. One web site I found (google search: "mulholland drive what the fuck is going on") does a pretty good job of putting some of the bigger pieces into place, such as that the second part of the movie is "real", i.e. Diane is the real person, and the events shown really happen, while the first part is Diane's dream or fantasy, and Betty is her persona in that dream.</p><p>Actually, given that the first part is a paranoid hallucination, there's not a lot of point in making it all make sense. But still... why would Diane include, as part of her fantasy, finding herself dead and decomposing in her bed?</p><p>And also, Diane's neighbor comes to the door and says that Diane has been missed for three weeks. Where did those three weeks go? Was she magically asleep, only to be awakened by the Cowboy? And what's all that about, anyway?</p><p>----<br>Actually, it doesn't make sense to say that the second part is more "real" than the first part. I mean, the homeless guy has the blue cube? And when he drops it, the tiny loony old folks come out, and get into Diane's apartment, and terrorize her?</p> jdporter 2002-07-15T16:29:16+00:00 journal JPPPP http://use.perl.org/~jdporter/journal/6365?from=rss <p>Here's Yet Another Bad Practice That Makes Me Wince Every Time I See It:</p><p>when people use <i>setup</i> as a verb, when they should write <i>set up</i> -- two words.</p><p>Other things are similar, but not quite as ubiquitous. E.g. "everyday", as in the ridiculous "floss your teeth everyday".</p><p>And WTF is up with "albeit"? Last Saturday was bizarre. I read like half a dozen articles (both on line and in print) in a row, and <i>every single one</i> used the word "albeit". The RNG in the Matrix needs a good thump, or something.</p> jdporter 2002-07-15T16:19:29+00:00 journal the golden rule ain't so... http://use.perl.org/~jdporter/journal/6302?from=rss <p>It just occurred to me that the Golden Rule is pretty lame.</p><p>I mean, it may be great for kids, when you're trying to socialize them. But for adults, its usefulness is pretty limited.</p><p>The problem is the premise: it works if we all want the same thing. But we don't. We all want <i>different</i> things. So if you want to be nice to someone, don't treat them the way you would want to be treated; treat them the way <i>they</i> want to be treated.</p><p>This came to me as I was pondering <a href="http://archive.develooper.com/perl6-internals@perl.org/msg10841.html">a recent thread on an email list</a>, in which two people expressed entirely opposite viewpoints on the issue of "courtesy copies". One person finds them annoying, and so he always trims out all addresses from To/Cc except for the email list; the other person thinks they're useful, so he leaves the other addresses in. They're both following the Golden Rule, and in the process, hurting each other. The Golden Rule has backfired.</p><p>Of course, in a situation like this, things aren't so black-and-white, since there are the other members of the list to consider. Both individuals are serving the interests of some fraction (roughly half?) of the community, so it's not like either one should necessarily be enjoined to reverse his behavior.</p> jdporter 2002-07-12T10:29:25+00:00 journal tcl and smalltalk http://use.perl.org/~jdporter/journal/6255?from=rss <p>Believe it or not, reading the perl6 summaries (thanks, pd!) has gotten me to look at other "meta-compiled" languages, in particular, Tcl and Smalltalk.</p><p>I have to say, I really like the semantics of Tcl (the source-level language) (though the syntax is perhaps slightly less than ideal), and I really REALLY like the execution semantics of the smalltalk virtual machine. But the syntax of Smalltalk is heinously hideous! I wonder if there are any other languages that have back-ends targeting the smalltalk vm? I almost wish the perl6 guys had considering using the smalltalk vm, at least as a starting point. So much good work has already been done on virtual machines, and I'm not convinced that reading a few papers is enough to allow one to say that he is not reinventing the wheel.</p> jdporter 2002-07-10T15:31:16+00:00 journal doodling... http://use.perl.org/~jdporter/journal/6033?from=rss <p>Well, I finally decided that it has been waay too long since I put a module on CPAN, so went about making one that I've been thinking about for a while.</p><p>Basically, sometimes you want to do something with one of several arrays (or hashes) based on some discriminant. For example, you have have a list of filenames, and you want to stick all the file names in one array and directory names in another. Ordinarily you might do this:</p><p> &nbsp; &nbsp; for ( @names ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; if ( -d $_ ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push @dirs, $_;<br> &nbsp; &nbsp; &nbsp; &nbsp; } else {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push @files, $_;<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; }</p><p>Or perhaps:</p><p> &nbsp; &nbsp; @a = ( \@files, \@dirs );<br> &nbsp; &nbsp; for ( @names ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; push @{ $a[ -d $_ ] }, $_;<br> &nbsp; &nbsp; }</p><p>If you think you're clever, you might do this:</p><p> &nbsp; &nbsp; for ( @names ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; push @{ -d $_ ? \@dirs : \@files }, $_<br> &nbsp; &nbsp; }</p><p>But what I want is to do this:</p><p> &nbsp; &nbsp; for ( @names ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; push @x, $_<br> &nbsp; &nbsp; }</p><p>and have @x be magically aliased to the correct array.</p><p>So I wrote a module which does this. It uses tie, of course.</p><p> &nbsp; &nbsp; tie my @x, 'Tie::Multiplex',<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { -d $_ },<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ \@files, \@dirs ];</p><p>Now the above form will Just Work.</p><p>The first argument after the the tie class name is a sub-ref which is called by the object to get an index value. The next argument is an array(ref) of array-refs. The result of calling the sub is used to select one of the arrays in that anonymous array. In the above example, -d returns either true or false, which get converted into numeric (0 or 1) for indexing into the array.</p><p>You could have more than two, and you could have a hash of arrays instead of an array of arrays:</p><p> &nbsp; &nbsp; tie my @x, 'Tie::Multiplex', \$proto,<br> &nbsp; &nbsp; &nbsp; &nbsp; {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http =&gt; \@http,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ftp =&gt; \@ftp,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mailto =&gt; \@mailto,<br> &nbsp; &nbsp; &nbsp; &nbsp; };</p><p> &nbsp; &nbsp; for ( @URLs ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; $proto = extract_proto $_;<br> &nbsp; &nbsp; &nbsp; &nbsp; push @x, $_;<br> &nbsp; &nbsp; }</p><p>There, I didn't use a sub, I just supplied a ref to the variable to be queried directly.</p><p>Also you can multiplex hashes instead of arrays:</p><p> &nbsp; &nbsp; tie my %x, 'Tie::Multiplex',<br> &nbsp; &nbsp; &nbsp; &nbsp; sub { is_word_valid $_ },<br> &nbsp; &nbsp; &nbsp; &nbsp; [ \%invalid_words, \%valid_words ];</p><p> &nbsp; &nbsp; for ( @words ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; $x{$_}++;<br> &nbsp; &nbsp; }</p><p>That way, %valid_words ends up with keys which are all the valid words.</p><p>What happens if your selector sub returns an index which is out of range?</p><p> &nbsp; &nbsp; my @arrays = ( \@present, \@absent );<br> &nbsp; &nbsp; tie my @x, 'Tie::Multiplex',<br> &nbsp; &nbsp; &nbsp; &nbsp; sub { system("grep 'foo' $_")&gt;&gt;8 },<br> &nbsp; &nbsp; &nbsp; &nbsp; \@arrays;<br> &nbsp; &nbsp; # ordinarily, grep just returns 0 if found,<br> &nbsp; &nbsp; # 1 if not found.</p><p> &nbsp; &nbsp; for ( @files ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; push @x, $_;<br> &nbsp; &nbsp; }</p><p> &nbsp; &nbsp; # but if the file does not exist, grep returns 2, and we don't have that many arrays to push onto.</p><p>By default, the Tie::Multiplex object will autovivify the new member. (The reason for the @arrays variable above is so that you could actually go get the newly-made sub-arrays if you're interested.)</p><p>But if you want to be strict, you ask Tie::Multiplex to barf on out-of-bounds conditions, by passing a true value as a third arg:</p><p> &nbsp; &nbsp; tie @x, 'Tie::Multiplex', \$i, \@arrays, 'BARF';</p><p>I think it's purty sweet, but I am skeptical that anyone would want to use it.</p><p>But then, maybe I'm just not visionary enough to foresee the ends to which someone might be inspired to use such a module.</p> jdporter 2002-06-28T04:34:21+00:00 journal this program http://use.perl.org/~jdporter/journal/5982?from=rss <p>Yup, I'm programming in Perl at work.</p><p>We had this nasty old perl program floating around, and when I looked into it, I could not believe the insanely bad programming. I'd like to say that the programmer was a converted Fortran hacker, but that would be too generous. I can't even assume that this programmer learned how to write perl by looking at Matt's Scripts. It's more like, he selected about 1 in 5 random lines from perltut, and kept only those bits that worked without modification. As a result, the only array operations he knows about are:</p><p> &nbsp; &nbsp; for ( @a )</p><p> &nbsp; &nbsp; @a = &lt;F&gt;;</p><p> &nbsp; &nbsp; $a[$i] =<nobr> <wbr></nobr>...</p><p>That's sure not much to go on.<br>He didn't even know how to assign a list to an array. He thought the way to initialize (or "blank out") an array was with</p><p> &nbsp; &nbsp; $a[0] = "";</p><p>WTF?!!!</p><p>He also didn't know about push. In order to add an element onto an array, he would do the following:</p><p> &nbsp; &nbsp; open F, "&gt; file";<br> &nbsp; &nbsp; for ( @a ) {<br> &nbsp; &nbsp; &nbsp; &nbsp; $line = $_; # lord have mercy.<br> &nbsp; &nbsp; &nbsp; &nbsp; print F "$line\n";<br> &nbsp; &nbsp; }<br> &nbsp; &nbsp; print F "new item\n";<br> &nbsp; &nbsp; close F;<br> &nbsp; &nbsp; open F, "&lt; file";<br> &nbsp; &nbsp; @a = &lt;F&gt;;<br> &nbsp; &nbsp; close F;</p><p>This was done in about two dozen places in this ~5000 line program. As you can imagine, it ran like a dog.</p><p>Also, this programmer knew nothing about lexical variables, subroutine arguments, or subroutine return values. All variables global; no use strict or perl -w.<nobr> <wbr></nobr>;-P</p><p>(more later...)</p> jdporter 2002-06-26T21:49:04+00:00 journal moz http://use.perl.org/~jdporter/journal/5936?from=rss <p>So I've installed Mozilla 1.0 on my stupid, consarned Windows box here at work (interestingly, my company has mandated the use of Windows (NT4) and Microsoft Office crap -- "All documents shall be in Word format" -- for most things... but then, "Thou shalt not use IE, but rather, Netscape").</p><p>Well, Netscape was giving problems, acting flaky, and IE, while sufficient in a pinch, was leaving a very bad taste in my mouth. So I went searching for a Better Browser. I've tried Opera in the past, and though it has some niftiness, it's also not open source. And then I heard that Moz1.0 was out, so I tried that.</p><p>Mozilla++</p><p>Mozilla rocks! On Windows at least, it is very slick, full featured, and stable. It also allegedly handles the latest in web standards correctly. Woo hoo!</p> jdporter 2002-06-25T17:06:02+00:00 journal Bad dream last night http://use.perl.org/~jdporter/journal/5897?from=rss <p>Do you remember, back when the U.S. Marines were deployed in Somalia (as in Black Hawk Down), we heard stories on the news about the use of a drug in Somalia called khat, a leafy plant that is chewed.</p><p>Well, for some reason, my unconscious mind decided to make that the basis of a terrible dream last night.</p><p>&lt;dream&gt;</p><p>Apparently some marines, or other persons deployed to Somalia, had brought back with them khat plants to the U.S.</p><p>Then, someone figured out a way to isolate and purify the active ingredient, a powerful narcotic which in its natural state is extremely dilute.</p><p>Addiction is becoming epidemic. The use of this drug is accelerating so rapidly that the legislative bodies have not had time to outlaw it.</p><p>This drug is distributed and consumed in the form of a clear, colorless syrup. It is administered orally. It is not swallowed, but is held in the mouth, to be absorbed through the mucus membranes.</p><p>The user can take one or two spoons of the syrup himself, but then quickly enters a stupor. After that, someone else administers the drug, dripping it (like honey) into the user's mouth. After just a few more spoonsful of this stuff, the addict begins to sieze. Scenes of this drug use (parties) have several people with mouths agape, clear syrup running down their chins onto their clothes, convulsing and unable to sit upright.</p><p>And yet, there appear to be (so far) no lasting detrimental effects. No known instances of death amongst the addicted population, no cases of someone emerging from their stupor with half their previous I.Q. And everyone insists that the drug produces very pleasurable feelings in the mind, and they all want to do it again, despite the rather unpleasant appearance of its consumption to others. Physical addiction is instantaneous, and psychological addition almost so.</p><p>&lt;/dream&gt;</p><p>Horrible, just horrible.</p> jdporter 2002-06-24T15:25:27+00:00 journal JPPPP http://use.perl.org/~jdporter/journal/5895?from=rss <p>Has anybody else noticed this?</p><p>On the evening news, when they're talking about some recent local crime (for example), you'll hear the idiot reporter say things like:</p><p><i>The suspect then smashed through this window, out into the alley; witnesses say the suspect then jumped in a car and sped away...</i></p><p>What's wrong here? It is not the <b>suspect</b> who did these things, it is the <b>perpetrator</b>.</p><p>People seem to have forgotten about the word "perpetrator", and consequently the critical difference between a perpetrator and a suspect.</p><p>A suspect is a person whose identity, or some other personal info, is known, and who is thought -- though not (yet) known -- to have committed the crime. The perpetrator is the person who did, in fact and in actuality, commit the crime, even if nothing about him/her is known at all. The perpetrator is the person who is truly guilty of the crime, even if never identified, caught, or tried. A suspect is someone can be identified and caught, and yet who is presumed innocent until proven otherwise in court.</p> jdporter 2002-06-24T15:02:01+00:00 journal Eggplant rulz http://use.perl.org/~jdporter/journal/5848?from=rss <p>I've decided that eggplant is about the yummiest thing in the whole wide world. I could eat it every day. Jen sorta got me started on it, with this Persian stew (khoresh-e bademjan), but other forms are good too. Like eggplant parmesan. And bengan bharta. And baba ganoush. And imam bayildi.</p><p>eggplant++<br>aubergine++<br>bademjan++<br>baunjaun++<br>bengan++</p><p>(Any other names for it?)</p> jdporter 2002-06-21T20:16:43+00:00 journal journal http://use.perl.org/~jdporter/journal/5815?from=rss <p>Seems like some people actually use their journals to write down what they're doing that day. I suppose I could give it a try...</p><p>I'm going for a hair cut tonight. First time in months, and man am I overdue. Jeni has decided to let me get a color this time (after years of pleading). Probly because she has a coupon for it.</p><p>Did anyone watch American Idol last night and the night before? I was very skeptical at first, because it was such an obvious rip-off of Pop Stars. (Fox copying WB. Imagine!) But it turned out not to be.</p><p>One thing that was cool was that the show was broadcast live. LOTS of unscripted moments. I can't believe how awful some of the contestants were, at this semifinal level. That girl Rhodesia... words can not describe. What the hell was she thinking, with "Daydream Believer"? Anyway, there's no way she could win, because not only must they have vocal talent, and showmanship, but they have to have The Look. That rules out a lot of people, including people with talent.</p><p>My fave: Ryan Starr. The girl can obviously sing. I bet she really could sing anything thrown at her. Also I have to give her extra marks because she looks *exactly* like one lover from the days of my youth, and also a lot like another sweetheart of not so long ago.</p><p>Jeni and I are planning to go see Norah Jones in concert tomorrow night at the 9:30 club. Now there's a girl with talent. Diana Krall WISHES she could sing half so well as Norah Jones.<br> &nbsp; &nbsp; Norah Jones++<br> &nbsp; &nbsp; Diana Krall--</p> jdporter 2002-06-20T18:55:33+00:00 journal