Thursday, July 24, 2008

Keyboard Shortcuts

Perhaps it was my use of emacs in college. Or maybe the fact I was using my trackpoint mouse so much that it was making my hand hurt. No matter the reason, I have recently been kindling a healthy obsession with keyboard shortcuts. For the most part, quality programs will ship with useful shortcuts. Mastering these can go a long way toward boosting your productivity.

One tell-tale sign that you may benefit from investing some time in learning keyboard shortcuts is if you find yourself using the mouse to perform the same tasks over and over throughout the day. In my case, I noticed that I was using the mouse for just about everything...even in the programs I use constantly (e.g. Eclipse and Firefox).

However, when I investigated the available shortcuts for these programs, I found the majority of shortcuts marginally helpful at best (obviously this would be the case given the diverse user bases for such programs). There are just too many, and staring at or even printing off the list of all shortcuts is quite painful. And the thing about shortcuts is that you really need to internalize them. If you have to look them up, if you even have to think about them, then they may be more of a hassle than they are worth. To cope, I have developed a little system for internalizing them (similar to many others I'd imagine)...each time I read/hear about a potentially useful shortcut (aka a shortcut for some task I often perform, or sometimes even for a new task that seems useful) I write it on the whiteboard above my desk. This way, each time I want to perform that task I can quickly glance up to see the shortcut...and after a few times, I find I no longer need to look up and can remove it from the board (and transfer the shorcut to my notebooks for when my memory fails next). Alternatively, infrequently used shortcuts (which I had mistakenly presumed useful) will waste precious space for a short time until I erase them (from both board and mind).

Although I believe this system is improving my productivity, I find myself getting frustrated while watching friends and colleagues use these same programs without the added benefit of shortcuts. In fact, particularly in Eclipse, I find that most users have a very limited subset of shortcuts which they have deemed worthy to internalize. Often times, these same users will be astonished at the power of a few commands which they haven't yet discovered. Even now, I will hear of some new shortcut (new to me that is), and a week later be wondering how I ever lived without it.

For this reason, I plan to document my favorite shortcuts here...hopefully without creating yet another long list of marginally helpful entries. Admittedly, a blog is probably not the proper forum for such a list, so my intent is to provide a bit more context/narration for each shortcut than you might otherwise find. Stay tuned...

Sunday, July 13, 2008

Bug Reporting

If you use open source software...its your duty.

As I have become more involved with open source, one of the largest revelations I've had is the usefulness of bug reporting. When I first started contributing, I was very nervous about opening a new bug...often neglecting to do so and sometime forgetting the problem altogether until I hit it the next time. For bugs which occur frequently, these annoyances tend to build up and significantly detract from my overall experience with the product.

I think there were a number of factors for this apprehension,
  • I assumed all the problems I hit were probably already reported
  • I didn't want to sound stupid for reporting something that wasn't really a bug, or had been dealt with in the past
  • I felt that opening a bug was like asking the developers for a favor
  • I assumed the amount of time it would take me to properly research the topic and investigate all similar problems would probably outweigh the limited loss of time/productivity from the bug in question
I realize that this issue likely varies by personality (I tend to be a bit shy before I have established relationships), but from talking with friends and coworkers I think that my feelings are shared by many.

One of the things which helped me most is the leadership I've received from coworkers at IBM. In particular, I recall one such coworker speaking with me on the importance of bug reporting...this was the first I had heard of this referred to as my duty. You are not asking for a favor when you open a bug, you are documenting a known limitation or problem and helping to make a better product for everyone.

Another important factor in my progress has been the ease with which I can produce high quality bug reports. For this reason, the Mylyn bug reporting feature (since Eclipse 3.3) has long been one of my favorites. I am not sure when they started including this in the main Eclipse Packages, but I am very happy to report it is included with at least the Ganymede JEE and RCP/Plug-in packages (I feel it should be in every Eclipse IDE package). If it isn't included in your build, you can get it from the Ganymede update site by installing Mylyn Connector: Bugzilla and Mylyn Bridge: Eclipse IDE.
When installed, the dialog can be found at Help->Report Bug or Enhancement...

Included with Ganymede, Mylyn 3.0 provides a nice improvement on this feature. Namely, when you create a new bug report, it will automatically be placed in the "Unsubmitted" category in your task list. This simple feature drastically improves my productivity and effectively lowers the barrier to bug submission (in older releases I don't think it was possible to save working drafts of bugs). In an open source community, I feel this 'lowering of the walls' is one of the most important keys to success. After all, this user involvement is one of the keys to cultivating a strong community (active users beget contributors beget committers).

With the latest feature I can open a new report every time I encounter a problem or think of a neat enhancement. If I do not have the time to investigate at present, the issue is at least documented for me so that I can finish my investigation when I do have the time. For me, this process usually looks something like:
  1. Hit a bug or think of a cool enhancement and open a new report
  2. Forget about it for a while
  3. Come back to my list of bugs/enhancements
  4. Try to reproduce the problem and document the steps in the bug
  5. Perform a google search for others with the same problem/workarounds
  6. Perform a bugzilla search on all open bugs for that component/project
  7. Search the list and open all related bugs in tabs
  8. Browse throught the tabs and copy the most relevent ones to my bug report
  9. Finish filling in the details and submit the report
  10. Respond to addition questions/responses on the bug report

Now that I have been able to get beyond my initial fears, I have been most impressed with the speed and quality with which most Eclipse projects (and most other high-quality open source projects for that matter) respond to my issues. This level of involvement has helped me to feel included in the Eclipse community and greatly improved my experience with the Eclipse Platform.

There certainly is a delicate balance between properly researching a suspected bug and blindly submitting every subtlety you find (otherwise committers would be hit with endless streams of duplicates and low-quality bugs). For me, this balance has trended toward submitting reports early and often...what process do you use to submit high quality bugs with minimal investment?

Thursday, July 10, 2008

Fun With p2

This walkthrough is intended chronicle my experiences with the Equinox provisioning platform Admin UI. I was able to glean most of the info needed from the Admin UI wiki at
I tried
first, but it wasn't very helpful.

Download the equinox p2 agent and unzip to a good location (I used /opt/p2). Note that due to p2 limitations it is painful to move the agent around after provisioning multiple profiles.
It seems to take a few moments [too long] to start up (and why does it add a workspace directory to my Desktop?!).
It is also possible to run the Admin UI from within Eclipse by installing the Equinox Provisioning Agent Feature.

Add Metadata and Artifact Repositories for at least and
Whoa, it looks like the first add gets displayed many times (see picture) [1].
Where is that nice drag and drop from the Software Update... feature [2]?

Drill down into the Metadata Repositories.
I find it nicer to group the Installable Units (IU) by category (Window->Preferences).

In the Profiles view there is an EquinoxProvisioningUI profile corresponding to the agent itself. Add a new profile for the Eclipse SDK and set the location and bundle pool location.
"/home/lee/user" seems like a poor default [3].
I would have like to set a global bundle pool for all users, but didn't want to run as root, so the bundle pool location I chose was /home/lee/.p2 [4].

Drag and drop the org.eclipse.sdk.ide feature from install list.
I tried installs with org.eclipse.platform.ide and org.eclipse.platform.sdk and they both installed but failed to start.

Approve the installations and proceed to Finish.
Check out some of the improved equinox security features at
I had some problems taking a screen shot of the downloads, possibly due to my humble AMD Sempron 2800+ 1.6GHz CPU being pegged.
After about 10 minutes (for my 6.6 Mb/s connection--according to the install should complete and the IU should be displayed in the profile.

Navigate to the install location and launch your new Eclipse instance.
If you select Help->About Eclipse and click the Configuration button, you will notice one of the limiting factors of the agent...for some reason each install points back to the p2 agent for their p2 metadata [5].

Create a new profile in the Admin UI with the same bundle pool location (/home/lee/.p2) and install the Eclipse SDK IU to this profile.
Notice that this time, the install is only 4KB and will take about 10 seconds.
Way cool.

Launch your new Eclipse instance and open Help -> Software Updates...
You will notice the only Installed unit listed is the Eclipse SDK itself.
Lets install a new feature (the SCA tools feature from the STP project looks pretty interesting).
Using the filter list to narrow down installable units would be useful but it seems very slow [6].
The SCA tools install took me about 4 minutes.
Looks like the install button is missing its uppermost pixels, but that seems to have gone away now.

Restart Eclipse and be sure the plugins were properly installed
If you installed the SCA tools like me, create a new SCA example project using the wizard and note that the errors will go away when you point the tooling at an apache tuscany distribution.

Next, install the same feature to your original Eclipse Profile instance and you should see that it finds the plugins from your bundle pool.
My SCA Tools install took about 15 seconds this time

Back in the Admin UI, you can refresh the Profiles view but for some reason it can't see the newly installed features (after a quick restart they will magically appear) [7].
Next, lets install another Ganymede IU for good measure.
This time I went with the JavaScript Development Toolkit

Notice that directly after the install, the new IU shows up under "Installed Software" from you Eclipse instance. However, like installing plugins normally, it may require a restart to take effect.
At least you can use File -> Restart now instead of a manual stop and start (I used Switch Workspace -> Other for this in previous releases).
If you open the other Eclipse Profile installation, you can verify that it does not contain the newly installed feature.

Now suppose we would like to remove the SCA tooling feature from one of our profiles. In the Admin UI, there is no way to uninstall features.
This was very annoying when I installed the org.eclipse.platform.sdk feature and it wouldn't work...basically I had to remove the whole profile and delete the files manually.

However, if you have a working Eclipse install, it should still be possible to revert to a previous configuration by selecting the Revert Configuration... button in the Update Software... dialog.
Once again, the Admin UI will require a restart to notice the change in profile.

Overall, the p2 experience is very promising, despite the numerous annoying bugs left to solve. I am impressed with how this all came together, especially given some of the p2 criticism I heard near the end game for Ganymede.


Tuesday, July 1, 2008

Eclipse Ganymede Review

The latest Eclipse release train, Ganymede, has arrived(on time as usual) and comes loaded with 23 projects and a whole host of improved features (even for the Platform project alone) that I have been looking forward to since EclipseCon. Tops on my list are:
  1. The OSGi and Eclipse run configurations are sporting a shiny new filter box. This alone was worth the upgrade for more hunting through the hundreds of bundles in my target to add a bundle that was missing and not "required" (target platforms are still the way to go to limit the number of bundles in this list).
  2. PDE has added a spiffy feature called the plug-in spy...simply click ALT+SHIFT+F1 over any active window and it will pop up with useful info like the active View class and the contributing plugin. This is so useful I retrofitted it to my 3.3 instance as well.
  3. The Plug-in Registry view now allows you to start/stop, enable/disable, and diagnose individual bundles (toggle the Show Advanced Operations menu item to turn them on).
  4. Improved String matching in Find/Replace dialog (esp. with newlines). That used to drive me nuts.
  5. Improved Share Project wizard. It was a real pain to share each of my projects individually in the past, and the addition of the "use the project name as the module name and place it under the selected module" option would have been really handy for me last month :-) update: I just tried this out and it wasn't that special...still have to share each project individually, you just have a nicer wizard to tell you that.
(I was hoping to add links from these items to their location in the New and Noteworthy doc, but it doesn't seem to offer anchors for that purpose)
update: this was an oversite on my part

Overall I have been very impressed with the stability of the new release...even after loading it with all kinds of Ganymede plugins it seems to be performing splendidly on my underpowered (1.6 Gh, 512MB) Linux box.

However, the project/feature I am most excited for is the new provisioning platform (p2). I have read an interesting review at Ekkes Corner and also began to play with the new "Software Updates..." feature. I was also able to set up a working pooled Eclipse install using the p2 admin ui agent (as apposed to the installer) to provision my SDK. I hope to document this experience here shortly...