Posts Tagged ‘OpenSource’

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.

Presenting at the Great Indian Developers Summit

Wednesday, December 9th, 2009

I’m very excited to announce I’ve been selected to present at the Great Indian Developers Summit in Bangalore, India in April. I just found out that my NFJS colleagues, Scott Davis and Venkat Subramaniam will be joining me there as well. It will be great to have familiar faces at this venue and to present to such a distinguished audience.

200912091207.jpg

My latest DZone RefCard on the Google App Engine has been released

Tuesday, December 8th, 2009

I’m excited to announce that my latest RefCard for DZone has been released. In a Q&A session with Lyndsey Clevesy, I discuss the card’s focus on helping developers get started with the Google App Engine for Java.

The RefCard is intended to be a jumping off point and provides information about and links to the frameworks that now support GAE as well as external resources to help you dive deep if this new arena of cloud computing. Grab a copy and send me feedback.

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

Maven, OSS and iPhone: The Denver NFJS Audience Rocks

Monday, June 1st, 2009

Of all the cities I’ve presented in this year for both NFJS, private training, and user groups, two stand out so far as real gems: Minneapolis and Denver. The audiences are highly engaged and ask challenging questions. This is both scary and energizing as a presenter. You are being asked to call on not just your prepared slides, but your experience and catalog of knowledge to come up with a relevant answer. Sometimes, the audience will even help you with the answers, like on the defaults for Objective-C’s @property. It turns out, the answer is: atomic. Thanks Johnny Wey!

Sometimes things just don’t go perfectly in the open source world. There are times where it seems like a dot release cures many things, but then breaks/regresses several important ones as well. Like the XML parsing in the iPhone demo. Turns out, it was a Grails 1.1 issue (which I upgraded to from 1.0.3 to solve another bug) in which optional URL parameters are wrongly required. Grails 1.1.1 fixes it, which I validated at 11pm last night, but it would have been fun to live fix this with the audience. This reinforces the point in my talk though that you should always check your web services, possibly using curl, or SOAPui prior to connecting your iPhone application to them.

It’s amazing to see how many of the presenters and audience members are on Twitter and posting their experiences about the conference. That’s a real change from last year, where hardly anyone was live posting in that fashion. I hope to see you all again in the Fall at the next Denver NFJS, loaded with more difficult questions and an inquiring state of mind.

Using the Maven Command Line Interface Plugin

Thursday, February 19th, 2009

Maven 1.0 users were spoiled with the console plugin, and now Maven 2.0 users can get a nearly equivalent experience with a high-performance bootstrapped prompt via the Command Line Interface plugin. Watch this quick screencast for a tour of using this plugin and start saving even more time with Maven.

iTerm Screencast

Tuesday, February 17th, 2009

I’m a big fan of iTerm as a replacement for Terminal.app for developers. It offers a host of productivity boosts. To name a few:

  1. Named tabs
  2. Favorite location bookmarks
  3. Window, font, and background colors per-bookmark
  4. Transparency levels and blur of the underlying windows
  5. Middle click copy and paste
  6. URL launching from any URL recognized text

I’ve put together a quick screencast to show off a number of these features and how to configure them.



iTerm Developer Tips from Matthew McCullough on Vimeo.

RESTful Java Web Services must not return void to iPhone HTTP Services

Tuesday, February 17th, 2009

After many sessions of debugging and even memory inspection not yielding fruit, I’ve finally discovered what caused my previous RESTful demo apps to have sporadic behavior, in addition to the memory leak of the synchronous call.

Today’s problem solving summary:

  1. XCode projects cannot have commas anywhere in the path up to the location where they are stored or else you’ll get an error message of:
    ld: -filelist file not found: <Project Path>
  2. All RESTful web services called via the NSURLConnection APIs must return a non-null payload.

    This bit me because my “Add Contestant” function was adding the contestant and returning void. I now return a string of “Success” to satisfy this requirement. The observable failure is very quiet, which made it so hard to debug; every other web service call appears valid, but never actually makes a call across the wire. This was proven via TCPDump. All the web service call callbacks are properly called in the Objective C side of the program. It just silently failed and passed back a null payload in the response data structure.

All the code for this project is available on GitHub and will be updated with the results of the adjustments based on the above findings by tomorrow.

Clean your Git up to Pull successfully

Saturday, February 14th, 2009

Here’s a quick Git pulling & merging tip for those of you learning this awesome Distributed Version Control System.

Git Pull’s Double Duty

As you may be aware, the git pull command actually does two things under the covers. It does a git fetch to freshen your tracked remote branch and it does a git merge to merge it into the linked local branch. Sometimes this can go awry if you’ve been experimenting with files locally and forgot to return them to a checked-in state. Git errors out nicely, saying “I don’t know what you want me to do, but I’m going to be cautious here and just let you tell me exactly how to handle this.”

Error Message

One of the possible error messages you’ll see is:

error: Entry 'myapp/src/main/resources/scripts/launchapp.bat' not uptodate

Solutions

If your local changes are unimportant to you and you just want to get back in alignment with the remote branch, you have two options to apply depending on the state of your local files. First, you can reset any tracked files to their last committed state via the following command. This discards any local changes to any tracked files.

git reset --hard

Second, you can discard any untracked local files via the git clean command, in the case that they are colliding with files that the remote branch has actually added and is now tracking. You can purge your repository’s current branch of untracked local files by typing:

git clean -f

And in case you are paranoid about what this will remove, you can get a safe preview of what it would do by typing:

git clean -n

Which outputs a preview list like so:

[~/Documents/Code/myproj.git]: git clean -n
Would remove morecruft.java
Would remove unwatedfile.txt