Skip Navigation

March 31, 2004

Brand Spanking New Perl... By Accident

After my last adventure with Perl, I was wishing I could upgrade my Perl 5.8.2 to 5.8.3 without breaking anything. I had learned that the “autobundle” command of CPAN can create a giant archive module of all your modules to make reinstallation of them easy after an upgrade.

In testing autobundle, however, I ran into an immediate problem. While I could easily create my autobundle, I couldn’t re-install it. The message I received was: “Warning: Cannot install Bundle::Snapshot_2004_03_31_00.pm, don’t know what it is.” I Googled for help with this, but came up dry. There’s a lesson to be learned here. Whenever you have a problem that no one else has ever had (apparently), it means you’re probably doing something incredibly boneheaded and not encountering some rare bug. This was true in my case, as well. Perl modules and bundles have extensions of .pm, but in CPAN you don’t use it. All I had to do was chop the extension off of Snapshot_2004_03_31_00.pm and all was well.

In reading the output from the reinstallation, there were some modules it was having trouble with, so I tried installing one manually, using “force.” This particular module is reportedly included with the new version of Perl, so CPAN merrily set about installing Perl 5.8.3! Not what I had in mind, of course, but it all went well. I have a shiny new Perl and all updated modules. Ain’t technology wunnerful?

March 30, 2004

Cool Science Stuff

Two links from the world of science: 1) a breathtaking slide show of images from the Hubble, and 2) an equally awe-inspiring animated journey from outer space to subatomic particles. Each frame of the animation is an order of magnitude smaller than the one before.

In other news...

HAVE MYSQL WORKING WITH PHP AND PERL STOP CELEBRATION IN ORDER STOP MUST STOP DOWNLOADING MODULES NOW STOP NO MORE MODULES STOP NOT ANOTHER ONE STOP JUST STOP STOP ME GO SLEEP NOW STOP ZZZZZZZZ STOP

March 28, 2004

More Songs About Wine and Food

We subscribe to three food/cooking magazines at the moment: Cook’s Illustrated, Fine Cooking, and Bon Appétit. The first because we saw copies at a friend’s house and were hooked; the second because everything from Taunton Press is first-rate (I was a long-standing subscriber of Fine Woodworking and Fine Homebuilding back in the day); and the third because it was really cheap. (I’ve linked to each magazine’s web site, but to be honest, I haven’t spent any time at any of these sites.)

More often than not, we make things from magazines instead of cookbooks these days for several reasons. The recipes are seasonally oriented, so they suggest making what we’re already in the mood for, and the instructions are typically more complete with techniques illustrated with color pictures. Magazines keep things easy and interesting.

Tonight we made one of the “juicy pork chop” recipes featured in the current issue of Fine Cooking accompanied by a side of skillet-roasted Yukon Gold potatoes. We took the opportunity to stage another wine tasting, this time between two Pinot Grigios: San Angelo and Folonari. The clear winner was the San Angelo with a lively and complex flavor with distinct citrus notes. The Folonari was quite dull by comparison. The price difference between the two is substantial; the Folonari at $7.99 was one of the cheapest Pinot Grigios we could find, while the San Angelo at $13.99 cost almost twice as much. So far, we haven’t found any bargain wines.

 

There’s something different about this entry. It has a title as well as a "file under" destination. Some of the recent entries have been exceedingly geeky, and I think it only fair to warn people before they waste time reading it. No one really wants to read about making photo thumbnails with ImageMagick. I mean, really. Next time, you’ll be warned. It’s just another fine service of Homegrown Systems, the web site that uses blogging software with No Features[TM].

March 25, 2004

Korn Shell version p

It’s funny. With all the cool new software pouring into the market every second, why am I so interested in the humble shell? It’s not like I spend all day in the shell. Hardly. (Something to ponder...)

As of Panther, the default shell for OS X changed from tcsh to bash. Bash is a fine shell, but for a variety of vague, unexplored reasons I prefer the Korn shell. No version of OS X has even included the Korn shell, even though it was released under an open source license a few years ago.

A version of the Korn shell is available through Fink, but if you want the latest, greatest Korn shell (and you do, don’t you?) using Fink, you’ll have to “hack” the .info file (the .info file tells Fink where to get the source, etc), because the current Fink info file points to a download long gone. When this situation occurs, the FAQ recommends downloading the source to the default source location /sw/src/ and installing from there. I tried this, and it didn’t work for me, and besides, the Korn Shell has one dependency (something called INIT), so I decided it would be better to edit the .info file that Fink knows about.

Begin by checking for the latest version by consulting the release change log and look for the latest stable release (as of March 25, 2004, that is “ksh93p”). Grab the source for the darwin.ppc version of ksh93 and INIT from here and put it anywhere. Then run md5sum against the two .tgz downloads to note the checksums.

Open the .info file and look for these four lines:

 

Source: http://www.research.att.com/ \
~gsf/download/tgz/ast-ksh.2003-06-21.tgz
Source2: http://www.research.att.com/ \
~gsf/download/tgz/INIT.2003-06-21.tgz
Source-MD5: fbbcdcf490cb478f6fc2b9e0ed8d9fc4
Source2-MD5: 7f7d7eb4cfe25302a29dcce2761986f7

 

Change them to these values (I broke the URLs into two lines here):

http://www.research.att.com/ \
~gsf/download/tgz/ast-ksh.2004-02-29.tgz
Source2: http://www.research.att.com/ \
~gsf/download/tgz/INIT.2004-02-29.tgz
Source-MD5: fa91217bc99ccf9cc32b3250a2431185
Source2-MD5: cd4cc8fe24b040685451bea07f9bd163

 

Run fink install ksh93 as usual, and it should build the newest version from February 29.

March 24, 2004

No-Guilt Web Design

I felt a twinge of guilt when I read this entry on Andy Budd’s web site explaining how his CSS design sub:lime for the CSS Zen Garden was ripped off by a design firm in Akron, Ohio. Even though Andy claims that he is “not massively bothered about people using a version of sub:lime on their personal sites,” I still felt queasy for doing just that—until I remembered that it wasn’t Andy’s design that I had “used a version of,” as much as I liked it. It was Ray Henry’s design that this page is an homage to. In fact, I was so taken with it that for a short time, I re-did the whole site, but now all of the pages except for this one follow my own original “design.” It may not be pretty, but it’s all mine. I don’t think there’s any danger of it being ripped off.

Comments

Great article, thanks for sharing. I have bookmarked this post as it is something
i am very passionate about.

March 23, 2004

Building ImageMagick

I was successful building ImageMagick, but only after about eleventy-seven tries. After building the latest version (5.5.7) without any problems, I was somewhat surprised to discover that I was unable to work with JPEGs, because JPEG support is not built in. I got the source for the JPEG library libjpeg-6B (from the Independent JPEG Group) and built that a few hundred times. Either I put it in the wrong place or made some other blunder, because after each rebuild of ImageMagick, JPEG support was still denied me. I finally found a set of directions by “mud” that worked fine. Still working out the reasons why...

With ImageMagick working, I experimented with various settings and finally settled on this:

 

for img in "$1"/*[!T].jpg
do
   file=`basename "$img" .jpg`
   convert -filter Mitchell -resize 190x190 +profile "*" -quality 75 -unsharp 0x1.0+0.7+0.05 "$img" "${1}/${file}T.jpg"
done

 

What this does is call ImageMagick’s convert command using the Mitchell filter. It strips any embedded profiles to save space and adds a little unsharp masking for that extra sparkle. I wanted the thumbnails to be 190 pixels on their long dimension regardless of their orientation, and specifying 190 for both width and height does that. For the results, please feel free to visit the Photography section and look for thumbnails that are 190 pixels (not all are yet).

March 17, 2004

Making Thumbnails Programmatically

The last pages on this site to be updated after the redesign are the ones in the Photography section. (Don’t look; they’re a mess.) Among the many changes I wanted to make, one was to make the thumbnails larger. They are just too small. (What was I thinking?)

I don’t relish the idea of opening up all those pictures and saving out each one in a new and improved size. I knew there must be some kind of automated way to do it. Photoshop offers a way to create a "web gallery" with thumbnails, but I wanted all the thumbnails to have the same long dimension, and Photoshop doesn’t let you do that.

Apple’s Image Events looked promising. Image Events provides a way to use AppleScript to do just what I needed, but it only runs on Panther. ImageMagick is a powerful package that would work as well. The version available through Fink is rather old, so I am trying to build it from source. Most of the time, I rely on Fink to take the pain out of installing Unix software, so I don’t have much experience doing it the hard way. We’ll see how it goes.

March 16, 2004

Shopping for Hostas

A hosta from my in-laws’ garden. If the leaves don’t look green, please adjust your monitor. :-)

There’s nothing like a good blizzard to make you start planning the garden! Well, OK, it was only two inches, but with the warm weather we’ve been having, it was quite unexpected. It’s easy to forget that some of the worst snowstorms we’ve ever had have occurred in March.

With a crisp layer of snow outside, I spent some time inside surfing the Wayside Gardens site for hostas because they were having a hosta sale. After deliberating for a while, I made my decision. Of course, none of the hostas I chose (Northern Exposure, Paul’s Glory, and Fair Maiden) were on sale.

March 14, 2004

Some Comments on HTML Comments

At some point in the distant past, BBEdit added syntax coloring to its long list of useful features. For example, as I type this text, the words I’m writing are colored black, but all the HTML tags are displayed in contrasting colors.

There was one inconsistency about this coloring that puzzled me for years. I actually convinced myself it was a bug in BBEdit until yesterday, when I learned it’s not a bug at all; I just didn’t understand it. What about HTML could I possibly not understand? (A lot, but we don’t have time for that now.) It’s the humble HTML comment. When I write an HTML comment, BBEdit colors the comment text gray, but I noticed that if the comment text contained two hyphens (that’s an em dash in “typewriter”), then the text after the comment suddenly turned gray! It turns out I didn’t know how to write comments.

I always thought that comments began with <!-- and ended with -->, but it’s not that simple. A comment actually begins and ends with two hyphens, so when my text happened to contain two hyphens, BBEdit interpreted that as the end of the first comment, and the --> sequence as the beginning of the next comment, thus turning text after the --> sequence gray as well.

I had always considered the opening of the comment to be <!--, but this sequence is actually two tags. <! is a markup declaration, a kind of generic sequence that tells the browser, “Here’s a tag.” It’s the double hyphens that mark the beginning of the comment. There are documents all over the World Wide Web Consortium explaining this.

It’s interesting that now that I finally understand this, I’ve stopped using double hyphens for em dashes and started using the entity &#8212;. At least there’s nothing wrong with BBEdit. It’s also interesting that every browser got it “wrong” and closed my comments at --> instead of at the next closing tag. I’m thankful for that.

March 13, 2004

A Nice Used FM2n

I was in the camera store the other day picking up prints (Yeah, yeah, I still use film. You gotta problem wid dat?), and as I usually do, I nonchalantly drifted over to their cabinet of used equipment. For once, they had something interesting: a black Nikon FM2n in beautiful condition. Understand that I already have an FM2n, which was my first “real” camera. I bought mine used, and even though it was the nicest FM2n of the ones they had, it was in poor condition. I put some money into it, but it still has a few problems—the frame advance doesn’t travel far enough to fully advance the film, so you have to double-stroke it, and the frame counter only works intermittently.

Since I still use it, it would be nice to replace it with a body in better condition, but I don’t think I can justify it. For one thing, we are saving for our first digital camera, a Nikon D70. That’s $1000 right there, but the bleeding won’t end there, I’m sure. That body will need a lens. The lenses I own are all manual-focus “AIS.” They will physically mount on the D70, but they won’t work with it at all. There’s no autofocus of course, but the D70 can’t even meter with these lenses, so we’re assuming that we’ll be getting one modern autofocus lens. Which one, though? The perfect lens would be the new 17-55mm f/2.8 DX lens, but this lens will probably cost more than the camera. What we’ll probably do is get a 35mm lens, which on the D70 will act like a 50mm lens on a film camera. Since we both use 50mm lenses primarily (me on my Leica, and my wife on her Pentax K1000), that should be adequate.

So I don’t think a “new” FM2n is in my future after all. Besides, I’m not sure it even makes sense. For one thing, you can still buy a new FM2n for about $850 (complete with 50mm lens), but for the same money, I’d probably get an FM3A. As long as I’m just dreaming, I should pre-order the Epson R-D1, which is the closest thing to a digital Leica M we’ll see—until Leica itself introduces a digital M (if they ever do). The R-D1 is a real rangefinder camera that you focus optically; it just doesn’t use film. It will cost about what a Leica costs as well, reportedly $2700.

March 12, 2004

Quadra 610 Technical Specifications

I subscribe to Apple’s Support Updates email newsletter because I want the latest, most up-to-the-minute information on new documentation, software updates, etc. And I want it now.

In the newsletter dated March 10, I noticed that a few Knowledge Base documents had been updated. Let’s see... “Troubleshooting a cable modem, DSL, or LAN Internet connection” (good one!), “Using Unicode fonts with AppleWorks for Mac OS X” (I’m sure somebody will care)—Whoa!!! What’s this!? “Macintosh Quadra 610: Technical Specifications.”

I was nonplussed. The Quadra 610, while a very nice machine in its day, was discontinued, what, ten years ago? I checked out the article and was even more surprised to find that it had been created March 15, 2002, eight years after the last Quadra vanished forever from dealers’ shelves and passed into the history books. I was unable to discover why the document had been updated; I’m sure there’s a logical explanation.

I’d be upset about Apple wasting time updating documentation on ancient hardware (they’re not archaeologists), except that Apple has gotten a lot better in general at getting documentation finished and keeping it updated. At least I now know where to get the official (and updated!) specs for the venerable Quadra 610. Should I ever need them. I look forward to reading the updated specs of one of the Macs I actually owned. Ah, the Duo 230. Yeah, now that was a laptop!

March 11, 2004

Philadelphia Flower Show 2004

While the weather has been decidedly brisk this week, I can already feel the symptoms of Spring fever. We went to the Philadelphia Flower Show on Monday, and if the sight of all those blooms doesn’t put you in the mood for Spring, I don’t know what will. I really enjoyed myself this year. This was our first Flower Show since moving into our new house, and we bought some decorations to celebrate—a dried wreath to hang over the bed, and a framed arrangement of dried fern “fiddleheads” from Vermont Botanicals.

Anne forwarded an email to me from Wayside Gardens about a 40% off sale on hostas. At the old house, I had planned on planting a small hosta bed as my first foray into gardening, but never got farther than clearing the bed of sod. In our new yard, the bed is already cleared (no grass grows in the shade of our dogwood), so the hardest work is already finished. All I have to do now is decide what to plant. The trouble is, there are so many kinds! Last night I was surfing the sites of the American Hosta Society, the regional site, and the local club. It was all very inspiring. Seeing little green shoots all over the yard this week was also inspiring. We’ll have a mess of tulips soon.

I’ve Stopped Smiling for Now

After my initial enthusiasm for Smile, I haven’t had much luck using it for doing real work. Even working around the inconvenience of Smile not being able to step through “if” and “repeat” blocks or into handlers, I was still stymied by weird errors. As much as I like Smile’s unique features, I don’t think it’s practical to use on a script of any length or complexity.

March 9, 2004

Trying Smile

I’ve wanted to try Smile (the AppleScript editor) for a while now. Many people like it a lot because it offers some unique features, but every time I tried it, I gave up in frustration. I just didn’t “get” it. At the time, it didn’t really matter, because I have always been a very satisfied user of Script Debugger. The most recent version I own is 2, however, and since I haven’t been doing much scripting in recent years, I didn’t feel justified spending the money to upgrade to version 3. My needs were met by using Script Editor. I wasn’t happy about it, but I could get by. With some scripting projects to do, I took the opportunity to give Smile (2.5.9) another chance. After all, there was no risk involved—Smile is free!

I was pleased to find out that Smile is really cool, but I felt that the documentation (which consists of a Getting Started PDF and a few paragraphs of online help) was rather skimpy. I can see why I was frustrated. Herewith, then, are some notes to myself on using Smile.

My first project involved opening a script saved as text into a Smile “Text” window. “Text” windows are a unique feature of Smile. In a Text window, hitting the Enter key executes the current line or the selection (compiling first if necessary) instead of running the whole script top to bottom as would normally occur in other editors (or a Smile “Script” window). I’m sure this works fine for writing a script from scratch a line at a time—but I was starting with uncompiled text

When you reach a line containing a call to a handler later on in your script, you will get the error that <<script>> doesn’t understand the <<handler name>> message. That’s because the handler hasn’t been compiled yet. To fix this, select the handler and hit Enter to compile it. Another problem with “Enter-stepping” is that Smile can’t step through any part of a code block (examples: try, end try, with timeout, end timeout, if, end if, multi-line comment, etc.) unless the line is a complete statement, so every time you reach a block, hitting Enter throws an error. To get around this limitation, you need to select the entire block and run it as a unit. Even with these annoyances, I’ve discovered that Smile has a lot of potential, although from reading these criticisms, you’re probably wondering where it is!

March 6, 2004

OS X Annoyances: Setting the Default Browser

I have a number of Web browsers installed (there’s no perfect one, but I keep looking...) and the most recent one I installed was Firefox 0.8. I tried making Firefox my default browser by setting it in the Internet preferences pane (under Mac OS 10.2.8). Firefox 0.8 was included in the drop-down menu of browsers, so naturally I chose it. Silly me. What actually happened is that the system ignored this choice and actually selected Firebird, which was still installed. (Perhaps because Firefox was formerly called Firebird? Who knows.) That’s right, I selected Firefox, but when I closed and reopened the Internet preference pane, Firebird was selected, and that’s what the system used when I clicked URLs. I thought maybe if I manually selected Firefox instead of picking it off the menu, that would fix it. Uh, no. After fruitlessly searching through and subsequently trashing com.apple.internetpref.plist, com.apple.internetconfig.plist, and com.apple.iTunes.eq.plist, I gave up and trashed my copy of Firebird. That fixed the problem. Interestingly, if I have Mozilla open instead of Firefox, URLs are sent to Mozilla instead of launching Firefox. I guess the system thinks they’re “the same,” in a similar way that Firefox and Firebird are the same.

March 4, 2004

Expensive is Better

I’ve been drinking wine with meals for many years, and although I’m no connoisseur, I can easily distinguish the qualities of one wine compared to another, even between two of the same color! (I knew you’d be impressed.) What I’ve never done is kept any kind of record of my preferences. With our last purchase, we resolved to try to rate the wines we drink. Our plan is to buy two bottles of each type, compare like to like, and declare a winner. (Life can be so cruel.) It’s a naive plan perhaps, but we’ve got to start somewhere. As time goes on, I’m sure we’ll encounter pairs of wine where there is no clear "winner." Both wines are equally good--just different. One of the goals of this project is to identify cheaper wines that are "just as good" as the more expensive ones. Perhaps that goal is just as naive.

Earlier this week we opened two bottles of Shiraz, both Australian: a Wolf Blass 2001 ($9.99) and an Alice White 2003 ($7.99) for the first contest. We administered a blind taste test to each other, and there was no question which one we preferred--the Wolf Blass. Not that the Alice White was bad by any means, but it did suffer in every way compared to the Wolf Blass. (The next night, by the way, I drank the Alice White by itself, and tasted in isolation was perfectly satisfactory.) The Wolf Blass is $2.00 more expensive than the Alice White, but it’s also two years older. Is the difference in "quality" (as well as price) simply due to the age difference? I wonder. Either way, in this our first comparison, the more expensive vintage was the clear winner.

March 3, 2004

The Waffle House Project

I stumbled on this page the other day. It’s a photo diary of Waffle House restaurants "along I-95 between Durham, NC and Stuart, FL." Now, I could say, "Get a life!" or something like that, but, on the contrary, I am delighted to see another photo-obsessive with such impeccable taste in restaurants. Not like that Denny’s Project guy. I can relate to such a project (visiting every Denny’s), just not one devoted to Denny’s. Sheesh.

In 1994, Denny’s was sued by a group of African-Americans who claimed that Denny’s systematically discriminated against black patrons by making them endure long waits for a table. The alleged strategy was designed to encourage them to leave (and never come back, I presume). Not to trivialize the seriousness of the lawsuit, but I’ve gotta say, I must be African-American then! That long wait for a table (and the subsequent long wait for everything else) at one Denny’s store after another is the reason I gave up on the entire chain. Denny’s food was fine, but their service was peerlessly poor, and it was the same at every Denny’s I’ve tried. Nowadays, if I need a Denny’s fix (and there isn’t a Waffle House nearby), I look for a Perkins. They’ve never disappointed.

March 1, 2004

Mardi Gras in Philadelphia

I’ve added a little writeup of our Mardi Gras outing to The Troc with dinner before at Vietnam to the Concert section.