My Favorite Eclipse Shortcuts
Many Java developers use Eclipse as their IDE. When you spend so much of your day in the same application, you start picking up keyboard shortcuts to save time. I use most of these without thinking any more.
(These are the Mac versions of the shortcuts. Most are slightly different on Windows).
- Control-Space: Auto-complete what you are typing in the editor.
- Command-Shift-R: Open Resource dialog. After opening this dialog, you can easily open a file in any of your projects by typing and then pressing Return.
- You can type the beginning of the file name and it will narrow down the list of results.
- You can use * as a wildcard. For example, *DaoTest will find files such as “CategoryDaoTest.java”. There is always an implicit wildcard at the end of your search.
- You can type (in uppercase) the initials of the file. For example, for CategoryDaoTest you could type “CDT”.
- If the initials search still finds too many results, you can type the beginning of each word. For example, “CatSerBea” would find “CategoryServiceBean” and not “CodeStyleBot”
- Command-Shift-T: Very similar to the previous, but the dialog that opens allows you to choose any “type”, including classes in dependent JAR libraries.
- Command-O: Open a quick outline of the current file being edited. You can then type the first few letters of the method, class, or variable you want to jump to.
- F3: Open the class or variable currently selected.
- Command-F11: Debug
- Command-Shift-F11: Run
- Option-Up, Option-Down: Move the selected line(s) up or down. This is nice because (if the editor supports it), the indentation is automatically fixed for you.
- Command-Option-Up, Command-Option-Down: Copy the selected lines up or down.
- Command-D: Delete the selected line.
- Command-/: Comment out the selected line.
Templates
One final thing. Templates. Templates in Eclipse are a wonderful thing. They allow you to easily insert oft-used code. For example, open a Java file and find a line where you want to insert a print-line statement. Rather than typing out the full “System.out.println(…)”, try typing “syso” then auto-complete (Command-Space). Here are a few more:
- foreach: The Java “for(String val : stringsList) {}” loop
- syserr: System.err.println();
- syso: System.out.println();
- try: Try-catch clause.
Fred Brooks
If you are involved in software development and have not read Fred Brooks’ The Mythical Man-Month, you ought to. It’s old but contains a lot of great material. Also, he makes for a lot of great quotes. Here are a few I thought were great:
“How does a project get to be a year late? … One day at a time.”
“The bearing of a child takes nine months, no matter how many women are assigned.”
“Brooks’s Law: Adding manpower to a late software project makes it later.”
“Einstein repeatedly argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer. Much of the complexity he must master is arbitrary complexity […] because they were designed by different people, rather than by God.”
Realism in UI Design
Great article by Lukas Mathis:
The goal is not to make your user interface as realistic as possible. The goal is to add those details which help users identify what an element is, and how to interact with it, and to add no more than those details.
Read the whole thing: Realism in UI Design
(via Gruber)
iTerm vs Terminal
As a developer, I use command line tools all the time. In fact, at any given time during the workday, I have three tabs with different terminals open.
Given that I use them so heavily, it’s important that I use the best application for the job. On the Mac, that’s usually either Terminal, included with Mac OS X, or the open-source iTerm. They are relatively similar in their current iterations: both support tabs, are relatively customizable, and have a bookmarking system. So when it comes down to it, there is one small difference that makes a world of difference to this efficiency-infected nerd: word boundary definition for double-clicking behavior. Allow me to demonstrate the difference between the two terminal emulators when double-clicking a file path.
Terminal:

iTerm:

That’s about it. When double-clicking a path, Terminal selects the “word” (usually letters), while iTerm selects the whole path (with a few exceptions – it has trouble when it encounters paths with spaces or other special characters). Additionally, iTerm (if enabled via preferences) copies text upon selection.
In practical use, this gives the user the ability to double-click anywhere in a path that he encounters while editing files, perusing logs, or working with other commands such as “locate” or “svn status”. He can then immediately act on that path as needed in a new command.
Beautiful!
Twitter’s Down
I started using Twitter a while ago and stopped using it for various reasons – not the least of which was Twitter “follow spam” from various pornographic or sleazy marketing bots.
However from time to time I like to search Twitter to see what the current vibe is on a particular news item (or non-news item). And all too often, including this morning, I run into the Fail Whale.
When will they get their act together? Twitter, start generating revenue so you can pay for the servers you need. Personally, I would like to see Twitter move to a model more similar to the web, or XMPP, where one server’s outage will only affect the users of that server – and could encourage them to move to a more reliable service.
Nice Google Chrome UI
When typing “Amazon.com” into the Google Chrome addressbar/search field, I expected it to autocomplete both because it was in my recent browsing history, and it is a fairly common search term. What I didn’t expect was the following:

I pressed Tab, typed my search terms:

And Chrome takes me to the Amazon.com search results.
A very nice way to allow searching via multiple engines without an annoying dropdown menu. This works with any of the search engine’s set up in Preferences -> Basics -> “Default Search – Manage”.
jQuerify Bookmarklet
jQuerify is a bookmarklet that can dynamically add jQuery to any page, in case you wanted to use it through FireBug or a different JavaScript console. I found this useful for debugging an application that didn’t use a nice JavaScript utility library; using jQuerify, I could easily select and manipulate DOM elements to get to the root of the problem.
Google Chrome for Mac
I have been using Google Chrome for Mac as my primary web browser this past week.
It seems fast. I am not citing any hard numbers, I just think it feels a little zippier than Safari.
Secondly, it initially felt like a Windows application to me. I inexplicably switched into my Windows mode, doing things like pressing Control-C instead of Command-C.
I used to work on a project building a DoD software collaboration community, Forge.mil. That website requires a special smart card called “CAC” (Common Access Card) in order to authenticate yourself securely. Unfortunately Chrome supports neither these hard tokens nor the software-based versions (commonly called PKCS#12). However, this issue has been fixed in Chromium, and will eventually make it to a major release.
It integrates nicely with the Mac OS X keychain which means I don’t need to store passwords separately, like Firefox does. This is excellent – the Keychain is the ideal place to store passwords and such. *
On Safari, I use the free plugin ClickToFlash to prevent Adobe Flash files from loading automatically (this saves memory, battery power, and other resources). This plugin does not work with Chrome. Eventually, however, Chrome Extensions will work on the Mac version and there is a similar Chrome extension called Block Flash.
Summary
I’m excited to see how Google Chrome grows. The intense competition among web browsers today has spurred a lot of innovation in this space such as Apple building SquirrelFish, and has also discouraged browser-specific extensions and hacks.
So that’s that. I’m using Google Chrome full-time. I like it.
UPDATE 1: I just came upon a missing feature that bugs me. Chrome for Mac does not display PDFs in the browser, instead it downloads them, forcing you to open them in Preview or Adobe Reader, and then delete them afterwards. Considering most PDFs I browse to are kept around only long enough to glance at or print, this is a big shortcoming.
UPDATE 2: * The usernames do not autocomplete – only the passwords. I can’t tell if this is a feature or a bug. It’s a feature if you want to force potential snoopers from simply visiting your bank website and logging in without knowing the username. However I think that’s a lousy defense especially since the baddie could easily find the username in the Apple Keychain.
Domino’s New Commercial
Yesterday, I saw Domino’s new TV commercial regarding their new pizza. I couldn’t find the 60-second version online, but you can view the short film at their website www.pizzaturnaround.com.
It’s a smart move: people value transparency, even when the company is only admitting failure after it has made the improvements!
I didn’t have anything against the old pizza, and the commercial makes me interested to try out the new one.

