JavaZone 2009 Open Source Debugging Talk

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

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.

What’s the big deal about font choices in presentations?

January 19th, 2010

Fonts and Presentations

Fonts, fonts, fonts. What’s this obsession? For those of us that share a passion for making presentation materials as comprehensible as possible for our students, sandwiched right between a great story and great delivery is a great font.

Reviewing the list

Once you’ve installed Microsoft Office, iWork, or Open Office, you’ll find that you’ve been granted a few (or possibly many) extra fonts installed into your operating system. This is a temptation you should approach carefully, just as you would the edge of a cliff. It is truly a time and design precipice you can fall off of into the abyss.

As you gradually approach this list of fonts, if you obsess over design like I do, you’ll let out an “Ooooooo” as if mesmerized by the quantity of selections you could make. A tool would be perfect here. Let me grant your wish with FontDoc for the Mac and WinFontsView for Windows.

Title versus Body

Now, you have a tool to whittle that list of massive fonts down to size. Let me give you two facets that will chisel it down even further.

First, use a maximum of two Font Faces per presentation. I’ll allow for three if you make judicious use of a handwriting font.

One font should be interesting and story-relevant. It should mesh well with your photography and choice of color in the slides. I’d suggest you primarily use it for titles, strong statements and short phrases. It adds spice to your presentation. Feel the freedom to have fun with your title fonts. I’ve recently styled a presentation on Hadoop with an African theme. I used the Tribeca font in the title and custom rhinoceroses for the bullet points (yes, I used some bullets).

The second (primary) font should be highly legible. I can’t stress that enough. For the portions of your slide deck that people will need to read (and quickly, so they can return mental focus to you), readability is the critical point. I always suggest sticking with a very legible Sans Serif font, as does Garr Reynolds of Presentation Zen Design.

I don’t always obey this rule of Sans Serif in the body, sometimes to my own peril. Fortunately, local audiences in Denver are kind, and remind me that I need to change it back.

Hello Verdana. Really, I didn’t mean to cheat on you! It was just that Aquiline showed up looking so stylish and I just couldn’t help it.

The finalists

The short list of Sans Serif fonts that I printed and put across the room is:

  • Agenda
  • Arial
  • Bitstream
  • Calibri
  • Century Gothic
  • Franklin Gothic
  • Futura
  • Geneva
  • Gill Sans
  • Helvetica
  • Optima
  • Heiti
  • Trebuchet
  • Verdana

I’d suggest you do the same. Also put them up on a projector if you have access to one. Do white font on black. Do black font on white. Notice the affect each font’s nuances have on legibility. Throw up some ranking numbers next to each. That’s precisely what I did. And I asked a few folks to give me their rankings too.

The winner

Helvetica, the Movie
The variant that I (and my scientifically font-polled friends) love the most, is Helvetica Neue. The beautiful part is that it comes preinstalled on many systems these days, but can also be purchased online if you are on a OS or office suite that doesn’t include it.

In the life of a font, you know you’ve arrived when a movie is made about you. Yes, a biographical movie about Helvetica, the font named after Switzerland’s classical name.

Lest you think this is a factor of Steve Jobs and his Apple design shop, I’ll let you in on the secret that this predates the personal computer by several decades. Max Miedinger was the designer behind this font all the way back in 1958!

Conclusion

Give any of these Sans Serif fonts a try (but lean towards Helvetica!) in your next presentation and be sure to gather design feedback from your audience. I think you’ll be pleasantly surprised!

Shameless plug: Keep an eye out in 2010 for the Presentation Patterns book from Neal Ford, Matthew McCullough and Nate Schutta for a complete recipe book with easily digestible presentation improvement hors d’oeuvres like this one.

Denver JUG Hadoop and Encryption Presentations

January 15th, 2010

Denver JUG January Meeting

I had the pleasure of hanging out with about 60 of my local friends at the Denver Java Users Group (DJUG to the locals) on Wednesday night and talking about Encryption on the JVM as well as Hadoop. I had the good fortune of having Andy Sautins of Returnpath.net, who’s an active user of Hadoop, field a few of the questions. I really appreciate the time a few of the folks spent giving me feedback on Speakerrate.com. For your future reference, below are the slides and sample source. Feedback and suggestions are always welcome at matthewm@ambientideas.com

Encryption Bootcamp on the JVM

Abstract

Does your application transmit customer information? Are there fields of sensitive customer data stored in your DB? Can your application be used on insecure networks? If so, you need a working knowledge of encryption and how to leverage Open Source APIs and libraries to make securing your data as easy as possible. Encryption is quickly becoming a developer’s new frontier of responsibility in many data-centric applications.

In today’s data-sensitive and news-sensationalizing world, don’t become the next headline by an inadvertent release of private customer or company data. Secure your persisted, transmitted and in-memory data and learn the terminology you’ll need to navigate the ecosystem of symmetric and public/private key encryption.

Intro to Hadoop

Abstract

Moore’s law has finally hit the wall and CPU speeds have actually decreased in the last few years. The industry is reacting with hardware with an ever-growing number of cores and software that can leverage “grids” of distributed, often commodity, computing resources. But how is a traditional Java developer supposed to easily take advantage of this revolution? The answer is the Apache Hadoop family of projects. Hadoop is a suite of Open Source APIs at the forefront of this grid computing revolution and is considered the absolute gold standard for the divide-and-conquer model of distributed problem crunching. The well-travelled Apache Hadoop framework is currently being leveraged in production by prominent names such as Yahoo, IBM, Amazon, Adobe, AOL, Facebook and Hulu just to name a few.

In this session, you’ll start by learning the vocabulary unique to the distributed computing space. Next, we’ll discover how to shape a problem and processing to fit the Hadoop MapReduce framework. We’ll then examine the incredible auto-replicating, redundant and self-healing HDFS filesystem. Finally, we’ll fire up several Hadoop nodes and watch our calculation process get devoured live by our Hadoop grid. At this talk’s conclusion, you’ll feel equipped to take on any massive data set and processing your employer can throw at you with absolute ease.

Presenting at the Great Indian Developers Summit

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

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.

Recorded Presentations – The “Lipsync” Pattern

December 7th, 2009

Presentation Recording, The Origins

This is a tidbit of insight about my radically revised techniques for assembling complex compelling presentations this year. I’m certain it will create a widely varied set of comments and feedback.

Earlier this year, Neal Ford, Nate Schutta and I were driving from the Des Moines No Fluff Just Stuff show in the pouring rain. Pouring hard enough to stop a dashboard GPS device from working. Hard enough to stop all outbound flights from the airport. Hard enough to cause us to lightly hydroplane. In short, a normal NFJS weekend.

This fury of nature would not deter us from our technical discussions and the subject of presentations with large quantities of moving parts came up. I said that “for a certain set of presentation demos that contain around 5 or more interwoven components — not JAR dependencies mind you — keeping this operational for the course of a year of presenting was more work than building it in the first place and highly crash prone.” We debated aggressively, but Neal interjected at one point and said “You should just try it.” And thus, I did.

Neal, Nate and I have a project that we’ll be able to tell you more about soon. Related to this project, we’re attempting to give names to these presentation patterns and anti-patterns. For example, Neal dubbed the above discussion’s output the “Lipsync Pattern.

Recording Tools

In terms of tooling, I’ve become very attached to Screenflow 2.0. I previously used iShowU HD, but its capabilities are now far exceeded by Screenflow in terms of seamlessly stitching together multiple pieces of footage in a meaningful way.

Feedback

Feedback from this technique for my Open Source Debugging talks have been overwhelmingly positive. Some examples are:

“Thanks for giving the great talk on open source debugging tools last night at BJUG. Specifically the part where you “played through” the typing/console. It sort of reminded me of prezi.com, with the way you were able to zoom into sections of slides, seemingly capture keyboard input, etc. Loved it.”

and another really captures the essence of why I feel this is a meaningful way of teaching:

“I liked that you used a recorded version vs. live coding. I felt like you were able to explain things better than other presenters I’ve seen who try and field questions while coding live. Also the spotlighting and highlighting really helped the flow.”

Applying this Technique

When using this approach, I’ve found, through the feedback of friends like Scott Davis, that it’s best to exaggerate the fact that you are not live coding. Joke about it. And lastly, make it a positive trade by discussing what’s happening in the playback in a dialogue with the audience.

Summary

I’m becoming so jaded that I (internal voice, not external) am having a hard time watching some live coding speakers now. It’s often swordplay showmanship on the level of Errol Flynn. It has nothing to do with teaching. And it usually bombs, at least in a minor way, somewhere, and we spend 2 minutes watching the speaker “clean it up.”

I hear that there’s going to be a “Presentation Patterns and Anti-Patterns” book with Neal’s name on it. Based on my positive experience, I can only say, “the sooner the better Neal.”

JPS and VisualVM on Windows

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.

Speaking at TSS Europe

October 3rd, 2009

I’m counting down right along with the TSS staff until October 27th where I’ll have the great opportunity to share my OSS Debugging talk with the developers gathered in Prague, Czech Republic. My Denver acquaintance, Tim Berglund will also be coming along to share the right way to be Agile in your Database with Liquibase. Join us for two days of development insights, tools, techniques and one on one time with the speakers.

Encrypted SCM Passwords in Maven

August 28th, 2009

A little late night hacking and I was able to get encrypted passwords to work in the Maven SCM plugin with Maven 2.2 based on the prodding of Kurt Tometich, an NFJS attendee, and his JIRA bug# SCM-495. Previously, this encryption feature only worked for Wagon providers (the connectors for uploading artifacts), not for SCM providers, contrary to some blog comments.

It was quite the effort. After a few minutes, I found the code in DefaultMaven.java that performed the decryption. Now, I thought, “just implement a similar call in AbstractScmMojo.java right?” I harbor a bit of angst for the fact that the JIRA isn’t Fisheye-connected to the source code repository, so finding the files changed for a given defect is much harder than it should be.

The Maven Mojo Developer Cookbook did offer a bit of insight (though syntactically off a bit on the container.getLookupRealm()) on how to get a handle to the container and look up the security provider, DefaultSecDispatcher.java.

SecDispatcher sd = null;

try {
  sd = (SecDispatcher)container.lookup( SecDispatcher.ROLE, &amp;amp;quot;maven&amp;amp;quot; );
}

There was even the fabled “java.lang.ClassCastException: org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher cannot be cast to org.sonatype.plexus.components.sec.dispatcher.DefaultSecDispatcher” at one point. Oh nuts. Not the classloader scoping issue, please…

The trick on the classloader is that the DefaultSecDispatcher class is available via a dependency to plexus-sec-dispatcher, but also included (repackaged) in the Maven core distribution maven-2.2.0-uber.jar. So the SCM provider project’s dependency on plexus-sec-dispatcher has to be scoped as <provided> for compilation of the maven-scm-plugin.

Lots of learning about the Maven code base occurred. The only interesting finding was how, instead of putting the decryption on the accessor (getter) of password from the settings data structure, it is put in each place it is attempted to be used (e.g. the Wagon “dispatcher”, and now the SCM “dispatcher”). I’ll bring up a refactoring of that with the Maven IRC folks…