jest's Journal jest'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:13+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 jest's Journal Worst sentence ever written about programming in the MSM <p>"R is similar to other programming languages, like C, Java and Perl, in that it helps people perform a wide variety of computing tasks by giving them access to various commands."</p><p></p><p>Oh. My. God. I just don't even know where to begin.</p> jest 2009-01-07T10:58:47+00:00 journal matts in today's NYT Here I am, drinking coffee and reading the New York Times, when who do I see but matts with his picture on the front page of the business section! <br> <a href=""></a> <br> Nice publicity! jest 2006-05-21T11:58:46+00:00 journal and My first article has appeared, <a href="">here</a>. I now feel like slightly less of an amateur. (Thanks to Sebastian Riedel, whose name couldn't appear on the article due to some obscure technical reason.) Everyone read it and start using Catalyst! <p> I'm in Oxford now, and took the opportunity to drop in on at their June social. Nice to meet all of you, and thanks for being so welcoming! You have good beer.</p> jest 2005-06-03T06:50:23+00:00 journal Productivity <p>I have a project that's needed some improvements for a while. I had been putting it off, because I thought it would be very difficult to get everything done well, and I was also waiting for a colleague whose input would have some (extremely minor, but good to have as an excuse) impact on how I implemented the changes. Finally, the colleague's comments came in, and I got started.</p><p>In about three hours, I had <i>everything</i> done that I had wanted to do. And tested. And this wasn't just a single thingI had to write several new helper methods, add additional database code, write a few new templates, tweak a stylesheet. My errors during the process were all simple things, like missing semicolons.</p><p>I'm looking at the working result and feeling happily flabbergasted that it all worked so smoothly.</p><p>And I'm trying to figure out how it happened. Is it that I spent months thinking about it instead of doing it, so that when the time came to code, I had already worked it out? Was it actually a simple process, and I had just convinced myself it was hard? Did I become a better programmer in the few months since I planned to start?</p><p>Whatever it is, it's a good feeling. Now, if only I could do something so that this is the way I work <i>all</i> the time....</p> jest 2004-11-08T02:30:29+00:00 journal CVS: the perfect laptop bag <p>For several years, I've been looking for the perfect laptop bag. I have a very cheap nylon briefcase from my company, that happens to be very good: it's lightweight, small, but very expandable--I can put a few hardcovers in there if I need too--has the right amount of pen slots, etc. But it's ugly, and cheap, and unpadded. Yet everything else I've seen is inappropriate in some other way--so heavily padded that you can't put anything else in there, the size of a suitcase, heavy, ugly. I've even bought one or two that I never use, and from one of them I removed the padded liner and use it in my cheap bag.</p><p>It's only relatively recently that I've started to use CVS for my software. I'm a one-person operation, so it seemed like overkill, but one too many times of "Shit! This doesn't work anymore--what did I do to screw it up?" and I got onboard. Initially I just kept things there and moved them to the right location by hand, but then I wrote actual "build scripts"--it's an embarrassment to call them that, just a few shell lines looking like <code>cp -r templates/<nobr> <wbr></nobr>/usr/local/www/data/MyApp/templates/</code>--but they work, and when I type "make install" I feel like a Real Programmer.</p><p>The side effect from this is that I never carry my laptop anymore. I have a few computers at work, I have a few computers at home, everything has about the same software, and all I have to do is remember to type "cvs commit" when I leave the office, and "cvs update -dP" when I get home. And vice-versa. It's really great, I must say.</p><p>I'm still looking for the perfect bag. I do travel, and need to program or show demos or whatever. But it's no longer the crucial thing that it used to be, thanks to version control.</p> jest 2004-10-01T12:55:50+00:00 journal Nice to meet other programmers <p>I had an extremely enjoyable time going out for beer with some Perl programmers. Professionals, that is. I program mostly for fun, so I usually don't have the chance to talk to programmers in person. Thus when I have problems or issues, I express them poorly and then get humiliated on some mailing list.</p><p>What was particularly <i>great</i> was the fact that everyone has the same issues! And there really is MTOWTDI! I would say, "I need to do so-and-so, and it's a pain when I have to...", and someone would say, "Yeah, I never figured out a good way to do that either" or "Just don't use [something that everyone uses], it's a waste of time."</p><p>Or we'd be discussing a so-and-so, and one person would say, "Well, I always use This and That and The::Other::Thing," and another guy would say, "I hate This and That; I use Foo and Bar and then I wrote a wrapper The::Other::Thing::FooBar so my code will work with his," and then another guy would say... And these are all people working at the same place! And they work on things you've heard of, and used!</p><p>I guess this is stuff that everyone knows. But it's nice just to hear it, and to know that not everyone is busy embedding FORTH interpreters into their code, or golfing DNA sequencers down to 67 characters, or whatever. And as I've said elsewhere, I miss being able to turn to the guy next to me and ask a general question.</p> jest 2004-09-23T03:57:32+00:00 journal slashdotted <p>I am the lead story on <a href="">Slashdot</a>!</p><p>It's also mentioned on the <a href="">Language Log</a>, and probably in other places too by now.</p><p>How cool. And damn, is my server getting hammered. But holding up fine. Thank you, open-source languages and operating systems and databases....</p> jest 2004-03-15T21:23:58+00:00 journal OT: %#$! configuring X <p>Trying to do some X configuration stuff that I would have expected to be straightforward and well-FAQ'ed somewhere. It is less so than I'd like.</p><p>Any X gurus out there with some free time<nobr> <wbr></nobr>;-)?</p> jest 2004-02-13T15:01:30+00:00 journal My first CPAN module! <p>I have released my first CPAN module. Huzzah!</p><p>Of course, it has exactly one line of real code, and still it took me about four hours to get it done, what with fucking up the POD, getting confused about the tests (thanks <a href="">Andy</a>!), and forgotting to read the base class's docs to realize what my module should be returning.</p><p>Oh, and then releasing it, only to discover minutes later that I had a big error in the docs as a result of cutting-and-pasting from a similar module. Grr.</p><p>Anyway, it's my first module! And more in this extraordinarily simple vein will be coming, before I turn my not-considerable talents to something more useful.</p><p> <a href="">Enjoy!</a> </p> jest 2004-02-12T03:46:14+00:00 journal WANT <p>IBM is about to release a new model of the Thinkpad, the X40. Unlike previous releases in the X series, it's not merely a speed bumpit's smaller. <i>Way</i> smaller. My beloved X23 is supposedly 3.6 pounds; the X40, with the same size screen and keyboard, is 2.7.</p><p>I don't need it. My current computer is perfectly fine, I love it. <strong>But I want it.</strong> </p><p>Oh well, there's probably some weird hardware stuff that'll prevent FreeBSD from working on it, unless I learn Forth to write weird drivers, or something. Yeah, that's right.</p> jest 2004-02-06T15:12:37+00:00 journal Users suck <p>I run a small library database for my company, most of which is based in England. Every month, a cron job sends a listing of newly added books, based on the record-creation date, to the library administrator, who then forwards it to everyone.</p><p>Yesterday, I got e-mail from the library admin, saying, "There was a problem with the book listthere were books on it that aren't new, but had just been edited in the past month. Several people complained, 'Wait, don't we already have that in the library?'"</p><p>So I run tests. I look over the code with a fine-tooth comb. As far as I can tell, there's absolutely no way this can be happening as described. I e-mail back, saying "Which books turn up as new that were already in? What sort of editing did the keyboarder to do these records?"</p><p>This morning I get an e-mail, "Well, the keyer didn't actually edit the entriesshe just deleted them and then added them again with the changes made."</p><p> <code>$self-&gt;bang(head =&gt; $wall);</code> </p> jest 2003-12-03T15:30:58+00:00 journal Refactoring the Wheel <p>Perhaps a year ago, I wrote some programs to deal with running a library database. The application worked nicely, but the programs were terrible--huge chunks of repeated, unmaintainable code.</p><p>A number of months ago, I learned a lot more about OO Perl, and went through a big refactoring binge and stuffed lots of things in modules.</p><p>A smaller number of months ago, I learned even more about OO Perl, and fixed some of the infelicities of the code.</p><p>A few days ago, I greatly generalized the code, so I can use the same modules to handle other databases I work with. This refactoring pass went very smoothly, and I felt confident. In the process I realized that one big chunk of the code is still appallingly bad; I spent a huge amount of effort on this elaborate solution to a problem that could have been solved much more easily if I had just used some templating system. (I had set up complicated modules to generate and process forms in a particular way.) So now I realize I have to go through and refactor this entire chunk to use TT or something, which will be non-trivial due to the complexity of the existing code.</p><p>When I'm finished with this, I will be in <i>exactly the same place as over a year ago</i>. I mean, I'll be a better programmer, and know a lot more, but this code has been in production use the whole time and no one knows I've done anything at all.</p><p>I suppose this is a good thing. But I'd like to throw in something neat, that I couldn't have done a year ago, or something.</p><p>&lt;/meditation&gt;</p> jest 2003-10-29T19:19:14+00:00 journal I am a published Perl author! <p>It's true! My article "[Review of] <i>Programming for Linguists: Perl for Language Researchers,</i> by Michael Hammond" has just appeared in the <i>Journal of English Linguistics</i>, XXXI:3 (Sept. 2003). Props to my man <a href="">Sean M. Burke</a> for some very valuable comments on an early draft, which comments encouraged me because they exactly matched what I had already decided about the book.</p><p>The review is considerably more critical than the one that appeared on Linguist List earlier this year.</p><p>But enough of that. I have published about Perl in a peer-reviewed journal! I'm all grown up! Why, I think I even understand closures now!</p> jest 2003-09-02T14:17:00+00:00 journal $self-&gt;bang({head =&gt; "wall"}); <p>So last night I sit down to do a big refactoring job on some code. It should be fairly straightforward; I'm not changing how anything is done, just some of the structure of the OO code to make it more like an MVC approach.</p><p>And for no reason I can think of, this one aspect of the display is not working. It's effectively identical to what was there before, and it works on the first run of this one program, but when the program is re-called, a radiogroup gets messed up. And I just can't figure out why it's happening. Worse, changing around things that should make absolutely no difference cause it to work.</p><p>I go to sleep late, having accomplished very little, and in the morning ask another coder to look at it. He can't figure it out either. Finally, for the hell of it, I change this one variable from </p><blockquote><div><p> <tt>-values</tt></p></div> </blockquote><p> to </p><blockquote><div><p> <tt>-content</tt></p></div> </blockquote><p>, and lo! it's working!</p><p>But I don't know why.</p><p>Oh, and happy birthday to me!</p> jest 2003-08-05T15:45:43+00:00 journal Still on a roll <p>Thanks especially to some very helpful comments from <a href="">ziggy</a>, I managed to have another burst of productive programming last night, wiping away the worst remaining bit of cruft from my app. Now to revise my definition of 'cruft' downwards, and go to it again....</p><p>In the process I also managed to get my banal <a href=""> question</a> frontpaged on perlmonks, but got the answer I needed.</p><p>On the other hand, the revolting food over here is really killing me.</p> jest 2003-07-30T12:44:18+00:00 journal Groovin' <p>After a depressing week of learning C, during which I worked very hard and spent much time each evening rigorously working through exercises, I returned to Perl. And god, what a joy! I had put aside a problem I had been having, and then after an encouraging e-mail from <a href="">Sam Tregar</a>, whose <a href="">book</a> I found very helpful, I returned to my Perl problem and solved it within minutes.</p><p>Of course, it's still a mess; I took some octopus-like code and "improved" it by hacking off the tentacles and stuffing them in modules, so now I have my code writhing away somewhere behind the scenes. I have to learn lots more about subclassing and such to make this really effective. And, especially at this point, when I'm changing the code very frequently, the OO approach is really confusing, since it takes me more time to sort through six modules to figure out where something is happening than it did when everything was in one bloated script.</p><p>But I feel like I'm making progress.</p><p>Whether any of this is because of C is an open question.</p> jest 2003-07-28T08:47:20+00:00 journal Does knowing C help write Perl? <p>Out of some weird sense of completeness, I've decided recently to put some effort into learning C. I'd like to understand more about how things actually work, and I'd like to be able to contribute in some more serious way to projects, like Perl, that I like. Also, I had the vague notion that it would make my Perl better.</p><p>This is <i>really</i> hard. I'm not a math type, and I've never understood much about pure comp science, so everything is really confusing. I've been working through K&amp;R, which is really advanced. (Aside: I also bought the Oualline book from O'Reilly, which has a weird set of Amazon reviews--some one-star reviews saying "this is too hard!", and then five-star reviews saying "this is real programming--get over it! It's a great book." However, the book is a joke compared to K&amp;R. 70 pages into it, you're still on "Hello, world!" level stuff, while K&amp;R has you working out genuinely difficult things from about page 5.)</p><p>First of all, every exercise, I think "I could do this in Perl in about seventeen characters." Perhaps that's the point. But I also find that I often have a good sense of how to do something, I just don't know how to execute it. And I spend all my debugging time realizing that I meant </p><blockquote><div><p> <tt>i &lt;= len</tt></p></div> </blockquote><p>, not </p><blockquote><div><p> <tt>i &lt; len</tt></p></div> </blockquote><p>, etc. If I wanted to have to know math, I wouldn't have read Classics. I'm also not sure what Perlish practices should be used in C, or what will make me look like a dork--e.g. using curly braces around single statements in C:</p><blockquote><div><p> <tt>&nbsp; for (i = 0; i &lt; MAX; ++i) {<br>&nbsp; &nbsp; printf("%d: %d",i,value(i));<br>&nbsp; }</tt></p></div> </blockquote><p>I'm beginning to wonder what the point of all this is. I'll never be good enough at C to actually contribute to the Perl core, or to debug perl. Will this make me a better person? Will it improve my Perl code?</p> jest 2003-07-22T09:21:03+00:00 journal Arrival in Oxford <p>Well, here I am in Oxford, with the kids in tow and not-too-bad jetlag, surprisingly. The room I'm in has some bizarre ancient method of connecting to the Net, which means I have to use the horrid Win98 hulk sitting here instead of plugging in my laptop, but whatever.</p><p>After a reasonable night's sleep I should be ready to go! Oh, after giving the kids a tour of the city. Responsibility, responsibility.</p> jest 2003-07-19T17:27:48+00:00 journal Frustrations <p>Grr. I've lately been working on a database-to-Web application. Originally it was incredibly redundant, with tons of cut-and-pasted code; lately I've been working hard to modularize it, with much help from my main man <a href="">ziggy</a>. This has gone fairly well but is still a lot of work because, well, there's a lot to do.</p><p>So of course seeing today's <a href="">article</a> on <a href=""></a> on this <i>exact</i> subject, but made easier by using TT and Class::DBI, is just making me really frustrated. I've looked at both of these before, but thought either that they'd be too hard to use, or would too obscure the close control over my code that I sort of think I want. But now I'm wondering if perhaps I should consider it.</p><p>Which will, of course, necessitate yet another big round of re-writing.</p><p>Perhaps I'll chuck it all and just finally try to teach myself C.</p> jest 2003-07-16T16:59:38+00:00 journal Saying hello <p>Hello.</p><p>I've been using Perl for several years, not especially well, but in spite of that I enjoy the hell out of it and wish I could do more. Thus, here I am.</p> jest 2003-07-14T18:50:34+00:00 journal