Snow Leopard Chaos Subsides

Like a damn fool true fanboy I installed Apple’s Snow Leopard the day it came out. Sure, it was faster, and I liked the polishes they made to the user experience. But it broke a lot of things that made it possible for me to develop web sites on my laptop: MySQL, all my Perl modules, and the Ruby apps I use to track my To Do list (Tracks), and my projects (Redmine). I also lost the ability to print to my Canon laser printer, which I like cuz it does 2-sided printing. Also broken: Saft, iStatMenus, and Parallels, but I could get by without them (but did miss them).

Usually Google is my friend, but since it takes a few days for Google to catch up with people’s blog updates this time I turned to Twitter, and got up-to-the-second reports on people’s reactions to and fixes for Snow Leopard. MySQL turned out to be a quick fix, since it was just a broken symlink. After that my PHP scripts could once again connect to their databases, as could the Navicat app. But for the life of me I couldn’t get Perl’s DBI and DBD::mysql modules to work right, which meant a bunch of my older scripts weren’t working, and it made working on some of my older sites challenging in that I couldn’t test changes locally, I had to make them to the (gulp!) live site, which is hardly ever a good idea.

Every few days I’d search Twitter and Google for advice, and would try different things, but nothing would get Perl talking to the database :(

In the meantime I upgraded to Parallels 4.0 ($), which let me view my sites again under Internet Explorer. Since WinXP could still talk to the Canon printer I could print now if I saved to a PDF file, moved it over to Parallels and printed it there (ya, tedious, but at least it was possible). And new versions of iStatMenus (free!) and Saft ($) came out, so things were slowly returning to what we laughingly call normal here.

Labor Day (yesterday) was a down day that I used to finish digging the hole for the cob oven project (another post for another day), and I returned once again to my Perl/mySQL problem. Not a lot of people are using Perl anymore, or at least they’re not posting about their fixes for Snow Leopard, but all those hotshot Ruby kids kept saying they had to recompile the 64bit version of MySQL. Not wanting to break what was already working, I decided to try doing that on the family iMac and see if I could get Perl and MySQL working on it. Stock 64bit MySQL installed just fine, and I could talk to it over the command line. Good so far. I then installed the latest DBI and DBD::mysql modules using CPAN, which took a while but both installed with no problems (woohoo!). I created a small test table on the command line, then wrote a small Perl script to display all the records in it… and it worked!

Emboldened and embiggened, I then went over to the laptop, backed up all the mySQL databases, and removed all traces of mySQL from the computer. I then went thru the same steps as on the iMac; mySQL installed just fine, as did the DBI module, but DBD::mysql still refused to install. Desperate, I decided to copy the installed DBI and DBD::mysql modules from the iMac to the laptop, and after restarting Apache my perl scripts connected to mySQL just fine! Yes, it was a good day.

This morning for the heck of it I uninstalled all my Ruby Gems and reinstalled their 64bit versions, along with an updated passenger. After restarting Apache, Redmine once again started working! This is a very good thing, since I use it primarily as a GUI to the various Mercurial repositories I have for each of my web sites.

And a Google search for printer driver updates turned up a new driver which got my printer working again!

Jeezum, it’s like the morning of Aug 28, before I installed Snow Leopard! :)

Mac OS 10.5: Leopard

I’m really liking the new Mac OS after using it for three days now. Improvements include: the transparent menu bar, the Finder’s Quick Look and Cover Flow, Safari’s improvements, enhanced Spotlight, Spaces, and even the moving backgrounds in iChat and Photo Booth. It’s not noticeably faster or slower than the previous OS (10.4/Tiger).

With a file selected, hitting the space bar now opens up a Quick Look window that displays a preview of that file. Many file types are supported, including text files, JPEG and GIF images, PDF documents, and of course Apple’s Numbers and Pages documents. Since Quick Look opens instantly, this is far faster than opening a document in the application. The Finder’s new Cover Flow view, like its iTunes equivalent, makes it easy to flip thru a folder of files and locate a particular file “by look”. This is amazingly like opening a real life folder and looking for a page by look. Cover Flow is very fast, and altho you can get a little ahead of it when viewing a folder with hundreds of files it only takes a second for it to catch up with you.

Apple’s system-wide search tool is noticeably faster now, and includes some handy additions. The biggest new feature for me is the inclusion of recent web pages in the search. So many times in the past I’ve needed to go back to a web page I had seen a few days earlier. After a bit of googling (sometimes a lot) I’ve usually found the page again, altho not always. Spotlight now indexes all the words on the web pages you view, so they conveniently show up in its search results. Very nice. Spotlight also knows math now, so you can type 468/9 in its search box, and the top result shows “Calculator: 468/9 = 52” (you can even click on that line to open the Calculator).

They say that time is Nature’s way of keeping everything from happening at once. In a similar way, virtual desktops are a geeky way of keeping all your open windows and applications from being open on the same screen. So on my “main” desktop I have Safari and TextMate open, while on another desktop I have a couple Terminal windows open along with my FTP program. Switching between them is as simple as hitting control/right-arrow and control/left-arrow. I’ve been using different virtual desktop programs for the past few years, most recently the wonderful VirtueDesktop, and have gotten pretty -addicted- dependent on them. Leopard includes a built-in virtual desktop, called Spaces, which is pretty well done. I like how F8 now brings up an Exposé-like screen that shows all my virtual desktops, er, spaces, and that I can drag windows from space to another or even drag spaces around to swap them. I do miss being able to name my spaces (they used to be called Here, There, Everywhere, GTD and XP), and how those names would appear in the bottom right corner of the desktop so I could always tell where I was. Spaces numbers its desktops, and displays that number in the menu bar so you know where you are, but it’s not the same. There’s also a quirk with auxiliary windows like the Find dialog, which can pop up on the wrong space if you’ve moved windows around (this is a quirk that other virtual desktop programs didn’t have). I’m hoping Apple addresses that bug in a 10.5.1 update before too long.

*Other Stuff*
Safari tabs can now be dragged around to rearrange them, or even dragged out to become a new window. Searching on a page is so much easier now, and matches jump out (literally). You can turn a section of any web page into a widget that self-updates, so it’s easy to make your own weather widget, or keep an eye on the latest Digg headline. Downloads now go into their own folder instead of cluttering up the Desktop, and it’s easy to get to them using the new Downloads folder in the Dock. iChat and Photo Booth are improved and now support effects and animated backgrounds so it looks like you’re at Yosemite, or on a beach or a roller coaster. People have already started creating their own effects, yesterday I downloaded one from Mac Rumors that makes you appear as a ghost (do a Google search for _hologit_ to find it). PHP5, Ruby and Rails are installed by default, making web development that much easier.

As with any upgrade to the operating system, not all software is compatible, at least not immediately. Altho most of my programs are working just fine on Leopard, a few key programs are not, and I miss them. iKey -isn’t working- works just fine, it just needed to be reinstalled!_ And the Saft enhancement for Safari -no longer works- has now been updated to work under Leopard, and I can once again use shortcuts like _be_ to edit my blog entries, and _wiki leopard_ to lookup “leopard” on wikipedia or even _mu saft_ to search for “saft” on My remaining incompatibilities are minor (SlimBatteryMonitor, for instance).

*Perl and MySQL*
From a web developer’s point of view, it’s strange that Apple installs PHP5 but not MySQL. And their support of Perl is pretty lacking, altho they do include version 5.8.8. I’ve installed MySQL and got it working with PHP, but I still haven’t gotten it working with Perl so web development for most of my sites is severely hampered at the moment. Still, I’m hoping some alphageek figures out how to get DBD::mysql installed and working, and I’ll be a happy camper.

*_Update 10:25am_*
Aha! The trick to getting perl talking to MySQL is to install older modules rather than the latest. The magic modules are DBI::Mysql 1.47 and DBD::Mysql 2.9006. Woohoo! :)

GTD Update

So after trying out a bunch of different GTD apps, I’ve gone back to using “Thinking Rock”:1 as it’s the closest fit to how I imagine a GTD app should work. I can enter to-do items by project, then view them by date or by context. Thinking Rock automatically saves my actions periodically and backs them up, and even auto-saves a calendar file of my actions that iCal automatically imports. Finally, a short, custom perl script runs periodically to convert any action I haven’t set a time for into an ‘all day’ item for iCal.

With this setup I can see my list chronologically within Thinking Rock, which helpfully displays overdue items in red, today’s items are blue, while future items are green. I can sort the list by context, or just show a single context. I’ve got it set up so that it only shows me the next 7 days worth of items, thankfully hiding that March dentist appointment until the week before it happens. iCal gives me a calendar view, which I can look at by week, month or day. I usually leave it open to the current week, then periodically review the entire month and future months.

To capture items I use the kNotes widget if I’m at the computer, or a moleskine pocket notebook (with a slim bookmark pen inside that I discovered at Barnes and Noble). The moleskine is useful for capturing actions (pick up stamps soon) as well as notes to myself (books I need to research, or a word to be looked up).

For the most part this system works well for me, keeps me on top of the various things I need to do. I am far more organized than I was a year ago, and remembering meetings, commitments, milestones and other actions has never been easier.


A few months ago I noticed that Mail’s search was broken, because searches within “Entire Message” always turned up nothing, altho searching Subject, From or To seemed to be working fine. After a little detective work I found out that uses Spotlight when searching Entire Message, so maybe Spotlight wasn’t indexing the mail folders? I tried forcing the issue with various utilities and the command line, but nothing seemed to work.

Today I tried using mdutil to turn on indexing for the main volume, and it worked! The command I used was
> sudo mdutil -i on /

So now Spotlight is happily chugging away, and it says it will be done in about twelve hours.

I don’t remember turning off Spotlight, but I can easily imagine turning it off “temporarily” (because indexing was slowing down something or other) only to forget all about turning it back on again. Ooo look, shiny!

Update: It only took about an hour to update, not twelve.

TextMate: Can Text Editing really be this much fun?

Much of my Developer life revolves around working with text files: web pages, perl scripts, php scripts, SQL exports, javascript, log files, config files, time logs, and even plain ol’ text files.

BBEdit has been my text editor of choice since the late 90s, and it’s done a great job with pretty much everything I’ve thrown at it. It’s handled huge 30meg files with ease, displayed scripts with syntax coloring, let me convert between Mac, PC and Unix formats, preview web pages, given me a Jump command and a function popup that instantly transport me to the relevant section of long files, and even let me enhance it by adding my own scripts (for instance to total client hours in my time log).

Still, I passed on upgrading from version 7, as the new version 8 didn’t seem to offer much that was useful to me. BBEdit is a workhorse prduct and it’s certainly served me well over the years, but to be honest it just feels, well, stale.

I’ve been hearing about the new kid on the block, TextMate, for a while now. There’s even a cool video about Ruby on Rails that showcases TextMate as much as it does the ease of developing in RoR (the TextMate windows are the ones with colored text on a dark background; notice the hierarchy on the left, the tabs, and how stuff appears automatically).

In January I took advantage TextMate’s free 30 day trial, and bought it about a week later and have been using it ever since. TextMate is a joy to use; it looks and acts like an OSX app, and tailoring it to work like I do is far, far easier than BBEdit ever was. Things like text folding, language context macros, tabbed windows, smart snippets, tab completion, and one key “compare against saved version” make programming easier and more fun, and I’m more productive.

The TextMate community provides great support, many people have contributed plug-ins, themes, and bundles to enhance TextMate. It supports a number of programming languages as well as HTML, CSS, XML, Textile, Markdown and more. My little script to total client hours that I wrote for BBEdit ported over to TextMate in about two minutes, most of the time was spent figuring out where BBEdit had hidden it. TextMate’s built-in Bundle Editor saved it for me and call it back later — I didn’t have to save the file myself, nor did I have to read the manual to find out where I should save it (both of which I had to do with BBEdit).

Oh, I still keep BBEdit open while I work, but it’s pretty much just for doing multi-file searches (one of the few thing it does better than TextMate). BBEdit has served me well, but it’s time to be put that workhorse out to pasture.

Getting GD Module Working With Tiger

I always find it a challenge getting the perl module working whenever I upgrade or do a fresh install of the operating system. The GD module is perl’s interface to the gd graphics library, which itself requires various libraries installed in order to work with jpegs, truetype fonts, etc. GD lets cgi scripts create custom graphics on the fly, like the Who Owns Vermont map Robin and I created for the Snelling Center a while back. GD can composite and caption photos, watermark them, resize them, convert GIFs to JPEGs or PNGs (and vice versa), draw charts and graphs, and so on. Fun and geeky stuff indeed.

Ever since the hard disk crashed last January, I’ve been unsuccessful getting GD to install despite several attempts using Fink, and even going so far as hunting down the sites hosting the individual parts and trying to install them. No go. (Note: The following assumes you’ve installed the Developer Tools, know what GD is for, and have already installed and configured CPAN.)

Yesterday I decided to try something completely different, and use Darwin Ports to install gd and all its parts. Darwin Ports itself was an easy download and install, so I was encouraged by this good start. I found gd as well as gd2 on the Available Ports, graphics category page; feeling brave, I decided to install the newer gd2. The page reported that gd2 requires the jpeg, libpng, XFree86, and freetype libraries, and I used ‘port’ command (installed by Darwin Ports) to install each of these libraries, like so:
> sudo port install jpeg

Installing software can take a while to compile and, making it a great time to surf the web, catch up on blogging, or whatever. Not a good time to use PhotoShop or other processor-intensive applications, tho, or you’ll be there forever because your Mac is crawling along at a snail’s pace.

Well, the jpeg and libpng libraries installed just fine, and altho XFree86 to a very long time to compile, at the very end it complained that another X package was already installed. I remembered installing Apple’s X11 when I installed Tiger, so I decided to leave that alone and continue with my install (hoping that wouldn’t cause a problem).

The freetype library also installed just fine (and pretty quickly, compared to the behemoth that’s XFree86). I held my breath and installed gd2, the graphics library that ties all the other libraries together. Thankfully, gd2 installed without complaint. And at this point I’m really liking this Darwin Ports thang!

With the last piece in place, it was time to install the module, and of course CPAN is the best way to do that. It installed without a hitch, woohoo!

I ran a quick little test perl script that created a 100×100 gif, framed it with a red rectangle and drew some text in the center. And it worked! I was thrilled and pleased that Darwin Ports made installing gd so easy.

Tiger: The First Day

After using Tiger (Mac OS X 10.4) all day today, here are my first impressions. Apple’s official Tiger page with lots of screenshots and feature lists is “here”:1.

I’m pleased that just about every program I use works just fine under Tiger. Not just applications, but low level system additions like “MenuMeters”:2 and “iKey”:3. I did have to replace “Virtue”:4 with “Desktop Manager”:5, but I’m missing how Virtue let me tag each virtual desktop with a different “graphic”:6.

Safari displays web pages much faster than before, and Help is finally fast enough to be usable. Graphic effects (like the Expose effect) seem twice as fast. Scrolling in the Terminal is wicked fast, it just it about a second to scroll thru a 200k text file.

“Dashboard”:7 is cool and widgets like the Calendar and Dictionary are useful enough to be incorporated into my workflow. The Stickies widget is my new To Do list, always an F12 key away. I like that Dashboard is yet another virtual desktop for me, and that the widgets don’t clutter up my workspace or take much CPU power when they’re not visible.

I wasn’t so sure about “Spotlight”:8 at first, since it wasn’t finding the things I expected, tho it is amazingly fast. I know now that adding keywords to photos lets Spotlight find them, and that I can tag individual files by adding a comment to them. It would still be nice if there was a way to easily apply a tag/property (like “Final Project”) to set of files *[update: there is, see below]*, and I’m not sure if there’s a way to specify “all pictures with a height less than 100 and a width more than 200” in the Spotlight text box. I could do that by searching in a window, and clicking the plus icon a couple times, then choosing from a few popup menus; that seems like a lot of work however. Still, it’s nice that it’s possible, short of writing a little perl script I don’t know how else that would be possible.

There are some nice little improvements in Tiger: choosing Get Info when more than one item is selected opens up multiple Get Info windows, just like the old MacOS days. The Apple menu and Spotlight buttons work if you mouse all the way up to the corner, so you don’t have to click right on them. Icons are now updated immediately when files are created and deleted (no more having to click on the desktop or in a folder to force a refresh). Command-Control-D shows the definition of the word the mouse is over.

The cool factor is there for show-off Tiger demos. The RSS screensaver is very nicely done, and Dashboard’s widgets are brightly colored and showy. Spotlight makes for an impressive demo, like using it to find a set of photos that you then turn into a slideshow.

Tiger is fast and usable and useful, and a pleasure to use. I recommend it highly.

**Update May 11:** Giles Turnbull wrote an “excellent article”:9 describing how he made **@taggit** with Automator to add tags to selected files in the Finder. A cool introduction to Automator, it solves the problem of how to easily tag multiple files all at once.


Waiting for Tiger

A few weeks ago I ordered the new Mac OS X, codename Tiger, from Amazon. Tiger was released on Friday, and I’ve been checking my order status several times a day since then to see when it will arrive. Amazon makes it really easy to track your order, and I love being able to track packages on their way to my door. Delivery was promised by today, and I’ve been checking the order status obsessively from time to time since Friday, but the site has only reported a frustrating “This item will be shipped soon.” Yesterday I figured they’d send the package out for next-day delivery and (finally) show a tracking number, but that wasn’t the case. Not even right before I went to bed, dammit.

But this morning Amazon shows it was shipped out on the 29th after all, and that headed out from Chelmsford, MA at 4 this morning. Woohoo! Looks like their delivery estimate was right after all, and there was no need to panic worry.

To the Mac faithful, an update to the system software is a major event. As satisfying as buying a new computer, these updates not only add spiffy new features, but generally make computer life more pleasant **and** they usually make your computer run faster (contrast with Windows updates which require ever-more horsepower and memory). Tiger’s brings us Spotlight, which effectively adds a database to the file system and makes it possible to do things like instantly find photos of Julie’s graduation in June 2003 (turning them into a slide show if you wish). Did I mention instant? It’s like a wicked fast Google for your hard drive, results show up **as you’re typing**. I’m really looking forward to playing around with Spotlight.

Dashboard offers a lot of cool new “widgets,” little single-purpose programs. There’s a little calendar widget, a calculator widget, one that tracks flights, and one that shows you weather forecasts. Supposedly it’s easy to create new widgets with a little knowledge of HTML, CSS and JavaScript, so there’s something to play around with.

Automator puts a user interface on scripting, making it far easier to automate repetitive tasks like sizing a group of web images to a width of 155 pixels and saving them out to a given folder. This has the potential to bring out the geek in a lot of Mac users who (like me) find AppleScript too hard to deal with.

Oh look, my package just arrived at UPS in Williston! Woohoo!

GoodPage Review

I’ve been using Tari “GoodPage”:1 for the past week to redesign the House-Mouse site. Unlike other CSS editors, GoodPage edits a page’s style sheet **and** its HTML, which makes it easier to create a modern web site. It can also show a live preview of the web page you’re editing so you can see the results of your changes without having to switch to a web browser, thus it consolidates three major parts of web page design. With GoodPage you do have to edit your HTML and CSS code directly, but I prefer doing that anyway.

GoodPage offers many ways to view your web page, but the ones I’m finding most useful are:

* HTML source code
* style sheet CSS source code
* structure (a graphic, 2D hierarchical view of the web page contents)
* list of individual css selectors (handy to look at a specific selector, rather than being overwhelmed by the entire style sheet)
* brower preview of the web page

The main window can display any two of those views side by side, so you can preview your web page in the left pane while you edit the html (or the style sheet) in the right pane. Or edit the html source and the stylesheet side by side. Or whatever combination you need at the moment. It’s handy not having to switch between windows, or to switch between programs for editing or previewing.

GoodPage offers a bunch of handy little tools to make development easier. For instance you can select an element in the web page preview (like a div, a paragraph or an image), and view its CSS properties in the other pane, then edit them and immediately see the change. This is great for debugging things like figuring out why there’s too much space above an element: you can not only see that top margin (or top padding) is too big, but which style sheet and selector are setting that property. And from there you can just fix the problem. Another nice feature of the side-by-side views is that you can select an element in one view hit Command-L, and a blue arrow appears to point out the corresponding item in the other view. So you can select a paragraph in the page preview and instantly see the html source for that paragraph in the other pane. Nice, it saves scrolling thru the source looking for it.

The developers have sucessfully leveraged the features offered by Mac OS X, and the program is a pleasure to use and is visually pleasing as well. I’m a sucker for aesthetic and useful, which is why I use a Mac.

As nice as it is, my biggest frustration with the program is that it comes with no documentation. None. The developers feel that GoodPage is so intuitively obvious to use that a manual just isn’t necessary. Unfortunately they’re wrong, and it’s taken a bit of stumbled around the program to figure out how to use it. In addition to only using a fraction of its features, I also feel that I’m not getting the most out of the features I am using. Using the program is like using some piece of wonderful alien technology that does some really cool things, but you just have to puzzle it out yourself and learn how to think like the aliens. For instance I can’t see what the big deal is with Structure View, but I get the impression that with it you can edit a page without knowing HTML, but I’ll be darned if I can figure it out. Still, what I have been able to discover has made me so much more productive that even after using it for just a few days, designing CSS web pages without using GoodPage would be so much harder.

With a price of $99 (early adopter special), it’s more expensive than the shareware alternatives, but cheaper than Dreamweaver. At that price it should include decent documentation, a tutorial, and more than the minimal CSS reference it comes with. Some sample templates would be also be great.

GoodPage works they way I do (at least what I’ve figured out so far) and it lets me focus on design without the distractions of switching to other programs, or searching through various style sheets for a given selector. This is an early version (1.1), so now that Tari has released this solid and useful tool I’m hoping they put their energy into writing a manual and perhaps creating a tutorial to show people how to use it. After all, what good are all those wonderful features if nobody can figure out how to use them?