Posts Tagged ‘Debugging’

JavaZone 2009 Open Source Debugging Talk

Wednesday, January 27th, 2010

Open Source Debugging in Norway

My Open Source Debugging talk that I gave at JavaZone, Oslo, Norway last September is online and can be watched in Flash format or downloaded as an M4V file. If you were not able to catch this talk at either this venue, or any of the many NoFluffJustStuff.com stops that I gave this talk at last year, give it a try and let me know what you think of it.

AppleScript to Re-Apply Finder Comments

Monday, January 25th, 2010

Finder Comments Lost

When restoring from a backup, depending on the Mac-specific intelligence of your backup solution, or when copying files written by a 10.4 Mac, your Spotlight (Finder) Comments stored in the .DS_Store files might not survive the round trip. You’ll first notice this by the fact that your comments field or column is completely empty for files you know you previously tagged or made comments on.

Leopard, Snow Leopard Comment Storage

Tiger and previous editions of Mac OSX store Spotlight comments in the .DS_Store file exclusively. Leopard and Snow Leopard on the other hand, claim to maintain backwards compatibility by storing the Spotlight Comments in both the .DS_Store and the new Extended File Attributes. I question this thinking though, because Mac OSX developer Steve Gehrman of the awesome PathFinder team says that Finder, while it writes both formats, still only reads back the .DS_Store ones. It seems to me that Apple would have changed Finder to read from the newer Extended Attributes as soon as they started writing to those in duplicate.

“On Mac OS X 10.4 Tiger, for example, .DS_Store files also contain the Spotlight comments of all the folder’s files, whereas Mac OS X 10.5 “Leopard” stores this information in Extended file attributes.”

Script Research

Giving a tip of the hat to the similar-but-not-quite-what-I-wanted script that helped me get enough of the syntax working (using type alias instead of type file was tricky) get my own authored, I give you:

A MacOSXHints article, and the corresponding code

The Solution

To solve this extended attributes vs. .DS_Store discrepancy, we only need to read (from the extended attributes) and reapply (thereby recreating the .DS_Store) the same comment. The solution is this AppleScript. Just highlight the files needing the treatment in Finder, then execute this script from the AppleScript Editor.

The result is that Finder (which reads only the .DS_Store files) and PathFinder (which only reads the extended attributes) can both now see the Spotlight Comments.

Extras

If you would like your Mac to automatically clean up the .DS_Store files it writes out to flash sticks and network drives, check out BlueHarvest, an interesting little utility app that fills this need.

JPS and VisualVM on Windows

Sunday, October 4th, 2009

At several stops on the NFJS tour, I’ve been asked about some of the minor issues in running JPS and VisualVM on the Windows platform. The primary problem is that the processes in JPS and VisualVM are listed as:

<Unknown Application> (pid ###)

I have been successful in working around this by renaming the hsperfdata temp directory as noted in a separate thread on the Sun forums.

BTrace in VisualVM on the Mac

Tuesday, July 21st, 2009

The BTrace plugin for VisualVM, a tool that I love to showcase at No Fluff Just Stuff and user group events, has been updated to version 0.2.2. This solves an issue that prevented it from working on a Mac. Be sure to uninstall any prior version from your VisualVM prior to installing 0.2.2 to get the full benefit of the fix.

Btrace2.png

BTrace1.png