Undocking from an Apple Thunderbolt Display

Sep 23, 2011 | 6 Comments

Apple finally has a “dock” for its notebook computers. That dock is the Thunderbolt display. The Thunderbolt display has its own power cable for charging your Apple notebook, as well as a Thunderbolt cable to serve as the single connection for display, ethernet, sound, USB, and Firewire connectivity. This means you can connect your Firewire, USB, and Thunderbolt drives into the back of the display and have them all “dock” when you plug in the single Thunderbolt cable.

Unfortunately, unplugging the monitor may not be so easy if you have several external drives. By using Applescript, you can basically create an “undock” application that you can simply open when you want to unplug the display. I’ve also provided the app for you: Undock.app

  1. Open “AppleScript Editor.app” found in the Applications -> Utilities folder
  2. Paste the following code into “Untitled” applescript window:
    tell the application "Finder"
    	eject (every disk whose ejectable is true)
    end tell
  3. Go to File -> Save. Name the file “Undock” and choose “Application” as the file format. You can now run this from Spotlight or create a shortcut in your dock if you prefer; just as with any other application. Your external drives will be ejected after running this script.

Agile iPad Part I: Taskpaper and User Stories

Sep 14, 2010 | One Comment

When I recently purchased an iPad, I thought it would be something that I could use to poke around the web from the couch in the evenings. I’m finding that I use it just as much at work and it is becoming an integral part of my toolkit.

One of the most heavily used apps on my iPad is Taskpaper from HogBay Software. I previously dabbled with TaskPaper on my Mac, but I had to drop it because it didn’t have any type of cloud based syncing with the iPhone. HogBay recently added support for syncing via a Google App Engine based app called SimpleText.

Neat, but how does Taskpaper and an iPad help me be more Agile? A picture is worth a thousand words here:


As you can see, I have an Inbox project for tracking incoming tasks. I borrowed this from the GTD methodology. I also have an “ABC Company” project for my client. I have a high level task for the current story I’m working on and underneath it I break down underlying tasks that I need to get done in order to complete the story.

The nice thing about TaskPaper is that it has become ubiquitous. My list is with me on my mac, on my iPhone, on the web, and on my iPad. All are kept in sync.

You’ll notice in order to complete the “Add ORM to Villian table” task, I need to ask Captain Caveman a question. Captain Caveman doesn’t always come through clearly, so I capture exactly what he said just in case there is any question later. I capture this as a note shown in light grey.

I also add other questions as I think of them to the underlying tasks. As soon as I save the document on my Mac, the SimpleText client syncs with the web site and the notes are available on my iPad. When I need to correspond with the users, I can simply pickup my iPad and take my list with me. I can even add notes on the iPad and I’ll have them when I’m back at my computer, pounding out code.

Each day during the daily scrum meeting, I take my iPad and bring up my list. I’m able to see exactly what I completed the day before, so it makes it a bit easier to keep track and burn items off of our sprint planning wall. I also add tasks I’m planning to work on today, so that I’ll have those available to mention as well.

Taskpaper is simple. It mimics paper and lets one organize lists however he pleases. If you have an iPad, I encourage you to try it on your Mac and if you like it, then buy it for your iPad/iPhone. It has greatly simplified my day to day task tracking and helps me stay focused when things get hectic.


In Uncategorized

Spring Roo 1.0.2 Selenium Fix

Mar 16, 2010 | No Comments

If you are jumping into Spring Roo and you have downloaded the latest 1.0.2 release in order to follow the ten minute test, then you will encounter an issue if you are running Firefox 3.6 on Mac OS X Snow Leopard.

The step that executes “mvn selenium:selenese” will fail due to an incompatible version of sqlliblite3.dylib in the Firefox. After searching the forums and finding various solutions that didn’t work for me, I went into the pom.xml in my “ten-minutes” Roo project and updated the Selenium version to 1.0.1. After this update, Selenium was able to execute Firefox correctly. A snippet of my pom.xml maven file is below.

<plugin>
  <groupId>org.codehaus.mojo</groupId>
     <artifactId>selenium-maven-plugin</artifactId>
     <version>1.0.1</version>
     <configuration>
      <suite>src/main/webapp/selenium/test-suite.xhtml</suite>
      <browser>*firefox</browser>
      <results>
            ${project.build.directory}/target/selenium.txt
        </results>
      <startURL>http://localhost:4444/</startURL>
     </configuration>
</plugin>

Of course, this is only a temporary fix until the Roo project updates the referenced Selenium version.

Mail Archiving With Snow Leopard Services

Sep 13, 2009 | No Comments

After upgrading to Snow Leopard, I quickly learned that I had been using a free beta version of Mail Act On. Mail Act On basically allows you to trigger rules based on keyboard shortcuts. I used it for one task, moving emails to an archive folder using a keyboard shortcut. This feature is crucial to my implementation of David Allen’s Getting Things Done personal productivity methodology.

Mail Act-On costs $25.95, which seems steep to me for what it does. I had no luck fishing around on onmacupdate.com for alternatives, so I decided to replace this program with a Snow Leopard contextual service and keyboard shortcut.

Step 1: Creating a Service in Automator

Starting in Snow Leopard, a new template for Automator workflows exists called “Service.”


After selecting this template, you’ll notice that you can select the context for the service at the top of the Automator workflow. You don’t need to specify any input since we’ll be using Applescript to do all of the work. You do need to select Mail.app as the context so that this service doesn’t appear in other applications.


Your service only needs one action, Run Applescript. Drag a Run Applescript action to the workflow. Assuming you have a single archive mailbox, your script will be similar to below. The script takes the selected items and moves them to an Archive mailbox of a MobileMe account.


Save the script. Automator automatically saves it in the ~/Library/Services folder.

Step 2: Assigning a Keyboard Shortcut

Next, you need to assign a keyboard shortcut to this service. Just open System Preferences, clickKeyboard, and then select the Keyboard Shortcuts tab. Under the Services category, you should have aGeneral section and the script should appear. My script is highlighted below. Now, just click on the area right of the script and you can add a keyboard shortcut.


You should now have a contextual based service under your Mail --> Services menu. Hitting the hotkey should invoke the automator action and execute the Applescript on the selected mail messages.


For some reason, the execution is a tad slow. It is manageable for me, but I’m hoping a future update to Snow Leopard will help speed the execution on Automator services.

Snow Leopard Upgrade Notes

Aug 29, 2009 | No Comments

Snow Leopard arrived at my door yesterday and I was chomping at the bit to get it installed. I had work to finish, so it was a few hours before I could get started.

Process

  1. backed up my current Leopard Java 1.5 directory.
  2. I created a compressed image of my current disk using Leopard install disk and an external drive. This is to ensure that I can quickly get back to business if Snow Leopard breaks something in my development environment.
  3. Went to the grocery store.
  4. Popped in the Snow Leopard disk and performed the upgrade.
  5. Fired up the Thursday’s epsiode of Big Brother from my DVR.
  6. Spent a couple of hours fixing issues.

Issues

My install didn’t go without a few issues. I got hungry, then sleepy, and then angry because Russell was being such a jerk to cute-as-a-bug Jordan on Big Brother. I pulled it together and managed to persevere. Overall, it was pretty painless and I have not regrets at this point. Below, I’ll summarize a few of the issues and resolutions.

Applescripts

I use Applescripts daily for task automation. I have several scripts saved as applications so that Spotlight can index them. When trying to run these scripts Snow Leopard prompted me to install Rosetta. To solve this issue I simply reopened the scripts and saved them again as applications.

DB2 Express-C 9.5.2 for OS X

Antonio Cangiano reported that DB2 on Snow Leopard was working without a hitch. This wasn’t completely true in my case.

I tried to start DB2 and received the following message: SQL5043N Support for one or more communications protocols failed to start successfully. However, core database manager functionality started successfully.

I checked my service name using the db2 command line utility:

MacGruber:~ shawn$ db2 get dbm cfg | grep SVCENAME
TCP/IP Service name                          (SVCENAME) = db2c_shawn

After opening /etc/services, I found that “db2c_shawn 50001/tcp” was missing. Added it to the end of the file, saved the file, then did a db2stop and db2start and the error was gone.

OmniFocus Clip-a-tron

After updating OmniFocus I had to remove and add the clip-a-tron from Omnifocus preferences and restart mail.

Mail Act-On

I somehow got the beta of this plugin many moons ago and have since used it to quickly archive read email to a separate folder. Mail complains and disables the plugin on startup. An update is available but at the cost of $24.95. I’m not feeling that generous so I’ll have to find another program to replace this functionality.

Various Programs

Many programs are being released with updates, so if you have trouble I would check the Mac OS X 10.6 Snow Leopard Compatibility List on wikidot. A few that I had to upgrade are OmniFocus, 1Password 3, OmniGraffle, Neatworks, Wiretap Studio, Speed Download.

I am happy to add that SpringSource Tool Suite 2.1.0SR1 Carbon is working just fine even though Java 5 no longer exists. So far, I have not restored Java 1.5 from Leopard. I have yet to try the Cocoa version of STS since upgrading. I doubt its memory leak issues have been fixed by the upgrade.

Finally, my Canon PIXMA MX860 WI-FI printer connects to my Mac only via USB now. Reports from various other owners mention that Canon will have a new driver in 2 to 3 weeks.

So, I’m up on Snow Leopard. Amazingly, I feel taller and more buff today.

Back up Java 5 on Leopard Prior to Snow Leopard Upgrade

Aug 29, 2009 | No Comments

One of my biggest concerns about Snow Leopard is that Java 5 would not be included. Reports from the Apple’s java-dev mailing list today confirm this. While most apps should work with Java 6 by now, there will always be a few stragglers.

tar -czvf Java15Leopard.tar.gz -C \
>/System/Library/Frameworks/JavaVM.framework/Versions/ 1.5.0

Now, put this file in a safe place and back it up before you upgrade. Once you have upgraded if you have an app that just won’t work on Java 1.6 then you can perform the following steps to hack in Java 1.5 on Snow Leopard.

Extract the file:

tar -xzvf Java15Leopard.tar.gz

Move it to your Java Frameworks folder.

sudo mv 1.5.0 \
>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard

Recreate the symbolic link:

cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm 1.5.0
sudo ln -s 1.5.0-leopard 1.5.0

Now open Java Preferences.app and change the “J2SE 5.0 32-bit” to be the default Java Virtual Machine for the “Java Applications” section at the bottom of the screen. Alternatively, you can just change whatever app that needs Java 5 to point to /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0.

There you go, party like it’s 2004!

In Uncategorized

Spring FormTag CommandName vs. ModelAttribute

Aug 25, 2009 | No Comments

While using the <form:form> tag in Spring 3.0, I came across two confusing attributes. One is “commandName” and the other is “modelAttribute.” More recent api docs mention modelAttribute as the correct attribute for setting the name of the form context object to what is placed in the model by a controller. However, the Spring Reference manual still mentioned commandAttribute at the time of writing.

The beauty of open source is that it always serves as the most correct document. From the current 3.0M4 source you can see. This is a concrete example of why I prefer open source software.

	/**
	 * Set the name of the form attribute in the model.
	 * <p>May be a runtime expression.
	 * @see #setModelAttribute
	 */
	public void setCommandName(String commandName) {
		this.modelAttribute = commandName;
	}

I traced this back to revision 15285 in Spring Maintainance (https://src.springframework.org/svn/spring-maintenance/trunk/src/org/springframework/web/servlet/tags/form/FormTag.java). ModelAttribute supersedes CommandAttribute.

Here is the correct usage of the tag:

<form:form modelAttribute="user">
  <table>
    <tr>
      <td>First Name:</td>
      <td>
        <input path="firstName"/>
      </td>
    </tr>
    <tr>
      <td>Last Name:</td>
      <td>
        <input path="lastName"/>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <input type="submit" value="Save Changes"/>
      </td>
    </tr>
  </table>
</form:form>
In Uncategorized

Staying Motivated

Aug 24, 2009 | No Comments

During my ten years of software development, motivation has often been a key factor of project success or failure. I have seen projects, which were relatively simple, fail due to some cause of demotivation. Often the disease originated externally in an organization. Some people were demotivated by limited compensation, long work hours, and some were just bored. The point is, no matter how many high-performance (read highly paid) developers or employees you have, if they cannot find motivation, the project will likely be over-budget, overdue, or simply fizzle out.

Agile software development methodologies, including Scrum, rely on motivated individuals. Take this quote from the Principals behind the Agile Manifesto:

Build projects around motivated individuals.

Give them the environment and support they need,

and trust them to get the job done.

This reminds me a bit of the Serenity Prayer. It is very easy to say, it is very encouraging, but it can be very hard to implement. The “motivated individuals” that you place on your project may be derailed for any number of reasons. One person’s motivational environment might be another’s jail cell. Trusting developers to get something done can also be challenging for a manager. Fortunately, Agile does support this with frequent feedback as a requirement. The problem arrises if things don’t get done. Any number of excuses exist since software development is an empirical process.

I use the term “excuses,” which may sound harsh. Professional, motivated individuals will almost always admit they could have done something better to lessen the amount of work carried over to the next iteration. Most developers, however, have been jaded by too many gestapo managers who don’t understand that software is empirical. In turn, it is almost a reflex to work up an excuse. Even new developers can pick this up from a jaded colleague. Maybe something wasn’t quite as complex as we made it out to be. It doesn’t make the developer a liar, it is simply a product of bad process and developers must be trained to tear down the wall.

So what does it take for a developer to be motivated, or any person doing work for that matter? My inspiration for this article comes from a book I recently read. Outliers: The Story of Success by Malcolm Gladwell is the first book that I’ve read that helped me understand the roots of motivation. The book hits it right on the head for me. Gladwell states:

Those three things–autonomy, complexity, and a connection between effort and reward–are, most people agree, the three qualities that work has to have if it is to be satisfying.

Exactly! My whole career I’ve tried to figure this out. I’ve seen motivation suffer due to lack of just rewards for effort, vapid maintenance development with no business growth, and everyone’s favorite, blatant micromanagers that are in your cube at least 6 times a day asking the same question, and the opposite which is managers who were so uninvolved that people had no sense of accountability. On the other hand, I’ve also seen motivation skyrocket from something simple as allowing a developer to learn something new, empowering them to make technology decisions, and performance based rewards.

Most developers need to be autonomous. Does this mean a developer needs to be a large, war-fighting Autobot as in the autonomous robots of transformers? Not quite. A developer simply needs to be able to make decisions within his realm of expertise. Did you hear that devs? I’ll repeat, within his realm of expertise. We are developers and not always businessmen. Aspire to be both, but realize when you are in over your head regarding business. Rely on the business side of your team for help. Likewise, business analysts must understand that if a developers is saying no, there might be a deeper meaning that might not be understood. Simply inquire and determine the root cause. What may appear to be obtuseness might simply be a developer trying to save you some time and frustration. Developers should also communicate a hurdle in a professional manner. Many times it is important to put the hurdle in terms of time and cost to have management realize its implications.

A developer should see his role on the team and learn to play that role. As developers we provide a technical service to businesses and should advise on those boundaries. You can step over that line once you learn more about a given business, as long as you are adding actual value from the business standpoint. If you are able to do this as a developer, then consider yourself autonomous. Autonomy doesn’t mean developers can choose to fly to conferences 6 times a year on company dimes. Autonomy for developers doesn’t mean you will choose your compensation, every hardware decision, or even every software decision. There are external motivators such as cost and compliance that could influence any of these decisions. You should expect to have plenty of independence on how you complete a given task within the bounds of what is good for your organization or customer. Autonomy doesn’t mean you can pick your projects unless you are an independent contractor or you own your own company. Even then external motivators such as economy and demand might force you to go with a project that is less than perfect.

A developer must be responsible with this gift.  What causes managers to not allow developers to be autonomous? Maybe our feedback loop wasn’t tight enough and the project manager thought we were further along that we were. Maybe and addition feature snuck in and delayed the implementation, but only the developer and the BA knew about this. If you are going to be autonomous, ensure you are communicating effectively and think like a businessman.

This brings me to the second point, complexity. There was a time in my career where if I wasn’t working on the most newsworthy or challenging project, then I wasn’t motivated. I hated maintenance and debugging, I still don’t like long term maintenance, some do and that is fine. As a developer, we must look through any lack of marketing on our project and assess the actual value a project is adding to a company. If you have a project that has sputtered along because of bugs and technical debt, then my friend, consider yourself a refactoring/debugging rockstar. Yep, I used the word, rockstar, and you know you like to hear it.

As an example, troubleshooting is one of the most complex tasks developers will encounter in a project. All too often, debugging is considered maintenance and somewhat of a chore. Consider it a puzzle and a challenge. I’ve realized that I can learn more about coding via refactoring than by writing a new framework or learning to implement the latest and greatest open source widget. On the other hand, I’ve seen developers be resistant to learning new technology. A bonus to new technology is that learning it is often complex. Consider complexity to be fulfilled if you encounter a new technology. Don’t get caught up in the politics of the decision, simply go with the flow and make the best of it for you and your career.

Unfortunately, complexity isn’t the same across the board for all developers. Dave Thomas gives a presentation on Herding Racehorses, Racing Sheep. What seems complex to one developer may be overwhelming for another. A developer should have a good enough relationship with his manager to ask for help, and a manager should also realize that a developer might need some assistance with the current task if they are struggling. It is not an opportunity to beat down the ego of a developer or any employee, that should be handled separately if it is an issue. Teams should assess the skills of each member and assign work accordingly.

The third ingredient from Gladwell for making a big bowl of satisfaction soup is a “clearly defined relationship between effort and reward.” The first time I read this, I only thought about it from the viewpoint of monetary compensation. Fresh college graduates, including myself early in this decade, see dollar signs. They want to leave behind the taste of ramen noodles or macaroni and cheese for something more refined, and rewarding.

Due to the stresses and unknowns of software development, I believe that developers should be non-exempt employees or hourly contractors, because inevitably if you are motivated you will work more than 40 hours a week. Actually, the organization doesn’t even need to pay overtime, just pay for every hour. In an organization which pays hourly, there is a clearly defined relationship between effort and reward. If you work 80 hours a week, you get paid for 80 hours. Down the road you’ll be rewarded with an early retirement if you plan wisely. I would gladly cover my own insurance, benefits, and accept that any time off would be at a cost to me and not the company if developers can be hourly employees with a market hourly rate.

Unfortunately, it can’t always be that way. Developers are mostly exempt from overtime and are salaried employees. So, how do you establish a relationship between effort and reward? Did that night of extra work help you learn something which will further your career down the road? Will your employer compensate with extra time off? Can you have a flexible schedule to get back some of those hours? How about a bonus or a promotion? These are all options.

Often, these traits of satisfaction tie together. Maybe your reward for extra effort is to get promoted onto a shiny new project that will improve your skill set and resume, indirectly leading to monetary increases down the road. Some employers might allow you to contribute some on the clock hours to an open-source project if that is your passion. The best thing here is to find out what you consider a just reward for great effort. Work with your manager and always negotiate with new employers to ensure a good work/life balance or just reward in times when you are giving extra effort. Just as with complexity, you have to be a business man when negotiating a work/life balance.

Conversely, if you are cruising along at 35 hours a week, consider yourself blessed, and consider it “a clearly defined relationship between effort and reward” in that you spend less time at work and get paid to do so. Your reward is an excellent work/life balance. Of course, if that 35 hours a week isn’t the cultural norm at your company, then don’t expect a bonus or anything extra outside of your current compensation.

Due to geographical location and lack of choice in employers where I lived in my early career, often developers found themselves working 60 hour weeks for 3% raises, no external training, and often only received a raise when they threatened to jump ship. If you have experienced this, you cannot carry baggage. Live and learn. Once your move on to a new employer, ensure you won’t make the same mistake twice. Unfortunately, what we didn’t realize is that we all had a great deal of autonomy at this company, as well as complexity. Our boss said, “I need this” and the rest was in our hands. Having more of one trait might be satisfying enough to make up for a shortcoming in monetary compensation.

Whatever it may be, we must dig deep as developers and strive to be professionals, and strive less to be treated like rockstars. We must always remember that we provide a service that not everyone can do. That doesn’t mean the business-analysts have to wash our feet and bring us ice cream to get something done. It means that each developer is running his own mini-company and must do well to ensure that customers are happy, even if your customers are those coworkers around you.

Next time you find that your motivation has diminished, revisit the principals from Gladwell. Assess the root cause and determine if you can change it or at least admit it. Sometimes just breaking down and admitting to ourselves that we have been unmotivated can be a break through. If possible, find a new source of motivation to help push through a tough task. Who knows, you might help motivate others around you. Just as demotivation can be a communicable disease, progress can heal a whole team.