Tuesday, December 1, 2009

Custom hotkeys in IntelliJ IDEA

Three custom hotkeys I use quite frequently in IntelliJ IDEA:

alt-shift-L - Compare with latest repository version
creates a diff from your copy to the latest version of the current file from the repository

alt-shift-H - Show History
shows the version history of the file with who modified it, revision number, and comments

alt-shift-A - Annotate
annotates the current file with the revision number and who modified each line last - I love this one.

To create custom hotkeys, go to File->Settings->Keymap.

You can find those mappings under Version Control Systems.

Tuesday, November 24, 2009


So I've been on several teams that refer to themselves as agile. They do scrum meetings each day and get updates from individuals on the team. Presumably, the meeting is for coordination of effort among the individuals.

Scrum seems to work better in some groups - finding holes in requirements, promoting discussion about a data model, general communication to make sure everyone can deliver for the next iteration.

Sound good? Sound normal? Sound effective?

Well I've wondered lately about the cumulative time from all the individuals in the room - that's a lot of work time. That's a lot of disruption. That's a lot of "I'm working on bugs" on some days.

Then today I was reading a passage in the book Peopleware that warns of a balance.
The ultimate management sin is wasting people's time.
When you convoke a meeting with n people present, the normal presumption is that all those in the room are there because they need to interact with each other in order to come to certain conclusions. When, instead, the participants take turns interacting with one key figure, the expected rationale for assembling the whole group is missing; the boss might just as well have interacted separately with each of the subordinates without obliging the others to listen in.
He goes on to say that some ceremonial meetings are necessary, for project milestones, when new people come on, celebrating a release, etc. However, the authors in the same section of the book say:
A real working meeting is called when there is a real reason for all the people invited to think through some matter together. The purpose of the meeting is to reach consensus. Such a meeting is, almost by definition, an ad hoc affair. Ad hoc implies that the meeting is unlikely to be regularly scheduled. Any regular get-together is therefore somewhat suspect as likely to have a ceremonial purpose rather than a focused goal of consensus. The weekly status meeting is an obvious example. Though its goal may seem to be status reporting, its real intent is status confirmation. And it's not the status of the work, but the status of the boss.
Weekly status meetings?!? What about a daily status meeting?

Now I'm not saying that scrum is always a waste of everyone's time. However, I wonder if we in the world of agile are missing the point sometimes and ceremony trumps getting work done. I wonder if many of the same things could be accomplished by having a common work area online, like a campfire chat room or an IRC channel for work discussions. I thought a recent interview (links to page 2) with Jason Fried of 37 Signals was interesting - his take on meetings.

The excerpts from Peopleware come from chapter 33: "The Ultimate Management Sin Is ..." It goes on to talk about all sorts of ways to waste people's time.

I just thought it was interesting to contrast the need in agile for a scrum-like meeting with the need for uninterrupted work time. I think it just inspires thought about whether or not a given meeting, particularly a regularly scheduled meeting, is of value.

An Office Environment

Since I picked it up in grad school, I've been fascinated by a book called Peopleware and the different ways of thinking about the work place.

This morning I read a bit about how a work place or work space affects the productivity of a software developer:
"Staying late or arriving early or staying home to work in peace is a damning indictment of the office environment. The amazing thing is not that it's so often impossible to work in the workplace; the amazing thing is that everyone knows it and nobody ever does anything about it."
- Chapter 8, "You Never Get Anything Done Around Here from 9 to 5"
They went on to describe a study they did involving developer productivity. They found the normal 10:1 range of individual developer productivity. What was surprising was they also found that there was a 10:1 or so range for organizational productivity - with two developers from each organization. The two developers from each performed on about the same level.

It would seem that not only individual developer productivity matters, but also their working environment.

Thursday, October 22, 2009

Using firefox extensions in mozilla prism

Matt Gertner, creator of the Mozilla Prism firefox addon/SSB, just posted some basics on how to get a firefox extension working with prism.

Thought it was interesting for those messing with site-specific browsers...


Tuesday, October 20, 2009

A Pidgin plugin for Growl for Windows

I've been fond of Growl on the mac as a pretty standard notification mechanism.

Growl for Windows is a project that uses the same protocols to do notification on the windows side.

After a discussion in the forums, someone has finally implemented support for one of the last core apps that was missing for a long time: pidgin.


Previously there was a snarl->growl bridge called gnarly that would notify growl of messages, but it's nice to see that such a popular app is getting some attention :).

W00t for open source :).

Monday, October 12, 2009

FindBugs in IntelliJ IDEA

I was just perusing the plugin repository for IntelliJ IDEA plugins recently and came across the FindBugs plugin. It will analyze your code and give you a categorized list of potential problems in your code that links to the source. It bundles the latest FindBugs implementation so there is no need to download that as well.

It looks promising for catching things I may have missed in my code.

There is currently a bug where when you first use it, you need to go into the settings for FindBugs and click on Restore Defaults. That initializes the list of detectors that it uses.

http://findbugs.sourceforge.net - the findbugs home page
https://findbugs-idea.dev.java.net - the findbugs IntelliJ IDEA home page
http://www.jetbrains.com/idea - the IntelliJ IDEA home page

Friday, October 9, 2009

Additional stuff from Developing with Mozilla Prism

Yesterday in my presentation on Developing with Mozilla Prism, I had some difficulties getting an app to work because of an intermittent bug in prism right now.

I did want to post the webapp.js code for the Google Reader prism app that I was showing during the presentation:

* Google Reader web app script

function n(app, msg) {
window.platform.showNotification(app, msg, null);

* standard webrunner plugin api
function startup() {

function preload() {

function load() {

function shutdown() {

function error() {

var Reader = {
_timer : null,
_unreadCount : 0,
_window : null,

receiveMessage : function() {

n("Google Reader", "You have " + Reader._unreadCount + " unread item(s).");

_init : function() {
Reader._unreadCount = 0;
Reader._window = window;

run : function() {
if (Reader._unreadCount == undefined)
Reader._unreadCount = 0;

var title = Reader._window.top.document.title;

var matches = title.match(/Google Reader \((\d+)\)/);
if (matches) {
if (matches[1] > Reader._unreadCount) {
Reader._unreadCount = matches[1];

Reader._unreadCount = matches[1];

load : function() {
// kick off a polling timer to check for new articles
Reader._timer = Reader._window.setInterval(Reader.run, 5000);

shutdown : function() {
if (Reader._timer)

Also, the MIME type to add to your httpd.conf to allow prism webapp bundles to load properly by linking to them is:

AddType application/x-webapp .webapp

Talking with Matt Gertner a little about adding javascript to your own web page... He said that you could use the window.platform stuff in your webapp and that would, in many cases, simply replace the need for webapp.js since your web page would then essentially become prism aware. That's another option for trying to distribute a prism app.

For more information on prism - check out https://developer.mozilla.org/en/Prism

Thursday, October 8, 2009

Slides for Developing with Mozilla Prism

I just wanted to post my slides for my presentation this afternoon on Developing with Mozilla Prism.

It will be in the Auditorium at 3 PM. I hope to see you there!

I received a bag of stuff from Mozilla to give away - various fun mozilla/firefox stickers and mozilla firefox badge lanyards.

Slides (pdf through Google Docs)

Saturday, October 3, 2009

Utah Open Source conference 2009 - Developing with Mozilla Prism

I will be speaking at the Utah Open Source conference next Thursday at 3 PM on Developing with Mozilla Prism.

I'm excited because Mozilla Prism is nearing a final release of 1.0 - it's at 1.0 b2 at this point. I talked to a Mozilla employee, Mark Finkle, who works on Prism, in addition to Fennec, their mobile browser project. He talked to Mozilla HQ and it sounds like I'll be able to get some Mozilla swag to give away at the presentation!

I'm also trying to start a community around building a prism webapp bundle library that I'll talk about more in my presentation. I thought it would be nice to have some open source examples of Prism web application bundles that people could refer to and add to. So I created a Google Code project called prism-apps.

In any case, check out the Prism project and come to the presentation!

(I'll post my slides later in the week as I finalize them.)

Friday, October 2, 2009

Subtle difference - extending ListResourceBundle vs ResourceBundle

I've been mucking about extending ListResourceBundle and then just plain ResourceBundle trying to get things to work with a base case - a custom resource bundle.

Taking a look at the Java i18n tutorial, extending ListResourceBundle doesn't require subclassing the default bundle; see here.

Then taking a look at the ResourceBundle javadocs and their custom resource bundle example, you *do* have to extend the default bundle; see here.


public class MyListResources_it extends ListResourceBundle {

as opposed to:

public class MyResources_it extends MyResources {

Kind of a confusing inconsistency - maybe the ListResourceBundle is just smarter about its look up.

Friday, September 25, 2009

Internationalization - dynamic and in a database

So I've been tasked with doing some internationalization for a web application in a less conventional way. I thought it would be useful to put together some thoughts as I get started on what I think will be a decent solution.

From what I understood, internationalization in Java (the language I'm using) involves properties files and locales and such. In the project I'm on, there is a requirement to be able to update the translated texts on the fly, without a server restart. This complicates the using of properties files a bit, since writing to those files seems a bit hackish and then what do I do to reload them.

So we've decided to look into a database backing for the whole business since that's pretty dynamic and accessible to the people - either via some database interface or an admin tool - working on the text.

We were kicking around various options to do something custom, a custom map or something and redirect whatever framework we were using.

Then I found some methods native to Java - no framework required - which should handle it nicely.

  1. ListResourceBundle has been around for a while in Java-land, but it's a nice way of not using properties files, but classes as bundles for different locales. This seems like a great way to get those database backed properties into the mix.
  2. Java 6 also has some nice customization options for how resource bundles get loaded. Specifically, ResourceBundle.Control has some options to customize the time-to-live of the cache for the resource bundle, from no-cache at all, to specifying a timeframe in milliseconds for how long a cache is valid.

So going forward, it looks like I'll need to mess with both for making something that's as close to the wire as I can - which allows me to not have to re-code caching and other things specific to a system for i18n.

Wednesday, September 16, 2009

Having intellij + tomcat update web content without a restart

So I've had issues with intellij + tomcat updating web content without a tomcat restart - very painful.

I've found the magic that will allow for it thanks to a coworker.

There are three things to do:
  1. Make sure your webapp is an exploded directory instead of a war (not sure if this is required)
  2. Set Settings->Debugger->HotSwap->Reload classes after compilation to Always - if it can't do it, I'll have to restart anyway
  3. Set Settings->Compiler->Deploy web applications to server after compilation to Never
Then after updating a page, on Windows press ctrl-shift-F9 to "compile" the page or re-put it into the exploded directory.

My sticking point was number 3 - it would put the updated file out there, but when it deployed the web application, tomcat got all confused and required a restart - I think probably because everything was updated including the web.xml.

Sunday, September 6, 2009

Some basics on Mozilla Prism

Lately I've been working on getting Mozilla Prism working for me on linux. It's in the 1.0 beta stage and seems to me to be the most promising now among the cross-platform site-specific browsers.

Personally I use it for gmail, google docs, google calendar, outlook web access, and stuff like that.

Following are some helpful introductory links on prism:

Monday, August 3, 2009

IRC on windows with notifications

I wanted to document a few steps to getting IRC working on windows with notifications. Pidgin is a decent client to connect to IRC on Windows, though some prefer using mIRC. Unfortunately for windows, there's not a well established notifications framework like there is on the mac (growl) or linux (libnotify).

So to start, download and install the following:
Growl for Windows
Gnarly (Growl->Snarl bridge)
PidginSnarl (pidgin notification plugin)

Once all these have been installed, add an IRC server to your pidgin installation, such as irc.freenode.net.

Growl needs to be started and in the preferences, you'll likely want to load it at startup.

You'll likely have to restart pidgin after installing the pidginsnarl plugin. After restarting, go to Tools->Plugins. There will be two that you'll want to enable:
Message Notifications

Then configure MessageNotifications - enable notifications for Chat, and then if you'd like have it notify you only if someone chats to your username.

Then go into Growl into the Applications section, click on PidginSnarl. Configure the Chat Received notifications to how you'd like it.

You may want to configure other things like logins and logouts and status changes to not notify you as well (disabling them).

That's it. Whew, kinda complicated on windows, but that's it.

Friday, May 15, 2009

Steer for the deep waters only

A cool quote by Walt Whitman that I think about sometimes when I am learning new things and trying to adapt them for use...

"Sail Forth- Steer for the deep waters only. Reckless O soul, exploring. I with thee and thou with me. For we are bound where mariner has not yet dared go. And we will risk the ship, ourselves, and all."

This quote and other writings by Walt Whitman were used in Ralph Vaughn Williams' first symphony - A Sea Symphony, which is also really cool.

Wednesday, May 13, 2009

IRC - Internet Relay Chat

For those who don't know what irc is - it's basically a chat service where you can ask and answer questions and discuss technologies. There are several development oriented channels out there. On irc.freenode.net (more info), there are channels like #jquery, #hudson, #spring, #hibernate, #jsf, #oracle, #jython, #intellij, #eclipse, and many many others. Organizations like mozilla (irc.mozilla.org) have their own irc server. Sometimes you have to hunt down where a channel might live. For example the #maven channel is found on irc.codehaus.org (more info). Often, developers of that particular technology lurk in the channels as well.

For those used to a chatroom where people constantly monitor the goings on, IRC is a bit different. True there are often several people in a channel at a time. However, they often stay logged in at work and possibly while they are away from their computer. Therefore, depending on the channel, you might need to wait 10 or 20 minutes for a response to a general question. If you know who you would like to ask, then use their username in your question or comment. That usually triggers a notification in their IRC client and they are more apt to answer if they are around.

More information about irc and different clients can be found here:
http://freenode.net/faq.shtml#whatwhy - why freenode exists


Tuesday, May 12, 2009

Site-specific browsers (SSB)

Site-specific browsers are kind of a hobby topic for me because of their utility. I often find that there are things like GMail, Jira, and others that seem to fit a mold where they are kind of a world of their own, a self-contained web application. If I use something like that with any degree of frequency, I consider making it into a site-specific browser instance.

Some of the basic niceties that I've found for my use include:
  • - Ability to choose an icon for the SSB
  • - Modify the URL that is being used upon creation of the SSB
  • - Show/don't show navigation controls
  • - Hotkey support
  • - Show/don't show the status bar

A few of the SSBs that I've tried on various platforms include:


By far, fluid (mac only) is the best that I've seen for my needs. It is essentially a layer on top of the webkit browser on the mac. It has all of the basics and much, much more. It is the most configurable, almost to a fault interface-wise. It can integrate with Growl on the mac, which allows for desktop notification. It has greasekit support. That opens up tons of possibilities. That is part of the plugin support. It also has a few themes for the UI itself. One of the nicest features is to allow for regular expressions of which sites it allows within the SSB. Along with that you can default to another browser for external linking. This makes Google Reader or other web based RSS aggregator quite useful in fluid. You can configure it to open rss feed links in the external browser in the background, so you can scan all of the new items and then go to, say, Firefox (with adblock plus) to actually read the stories. Besides all that, it allows for tabbed browsing with the SSB if you wish. My rating for fluid is awesome, based on a scale from 0 to awesome.


Chrome is okay. It is essentially a beta SSB in my mind. It seems that currently, they're just throwing out the notion of using GMail, Google apps, etc. as their own app within Chrome on the desktop. However, it's still pretty clunky. There is no support for browser controls. There is no support for modifying the URL. There is almost no configuration of any kind. It makes it simple in a good and bad way. The only thing you *can* configure is where a shortcut can be placed. I think with the competition and the resources they're putting into it, it will improve. Google I/O is coming up and I'm thinking that they'll announce a pretty great roadmap for the browser. Cross-platform support and plugins seem to be foremost on their minds right now though, so SSB functionality/configurability might take a little while, depending on their strategy for Chrome. You never know with Google.


Mozilla started Prism, then it got to version 0.9.x in the Summer of 2008, then it fell off the face of the Earth. There was no real development again until they released version 1.0 beta recently with an updated site. Since I am currently using windows and linux, the latest prism update is my option of choice. Prism is kind of the middle ground between chrome and fluid. It allows for some configurability and with the Firefox plugin, it allows you to create a shortcut or prism application right from Firefox. Addons seem to be coming as there is a configuration option for them in each prism instance. The inclusion of addons would definitely set it apart. However currently, the list of available addons (and themes) for prism is empty. I do like the fact that it tries to integrate well with the platform too. You can have it minimize to the system tray on windows, leaving your task bar real estate for other things. One other new feature that I like is the auto-update functionality. Fluid has to update each instance individually, but it looks like prism allows for updating across all instances.


Bubbles is another contender that is based on the IE engine and is therefore limited to Windows. I don't personally like windows very much but I've found value in creating a "bubble" for Outlook Web Access. Its main goal, it seems, is to create a variety of pre-built bubbles for things like GMail so that people can just use them. It does a decent job and might be like a fluid for windows. However, I don't like the IE engine and I don't like windows. Besides that it has a central interface for your bubbles, which I don't particularly like. Updating is always a hassle with SSBs so I can see where a centrally managed set of SSBs is nice.


Safari 4.0 on Snow Leopard (Mac OS 10.6) supposedly will have SSB support, like is sort of does on the iPhone. It will be interesting to see how Apple approaches it. Generally I like many of their defaults, but I'm usually underwhelmed by what they provide with configurability with Safari. Come on Apple, let's see some plugin support.

I briefly also tried Mango SSB, but at that point I was kind of sick of trying new SSB engines...

Anyway, it seems like an interesting space that will see quite a bit of development over the next 6-12 months. I'm hoping that this blog entry will be quite ancient in SSB progress by then.

Tuesday, May 5, 2009

Virtual Box

I am currently trying out Virtual Box. It's an OSS virtualization product managed by Sun.

I come from having used a mac these last few years and had gotten used to the warring between Parallels Desktop and VMWare Fusion. Both of those progressed nicely over time and remind me why competition is so great for the consumer.

Virtual Box takes a different approach with its open-source codebase, with the option to utilize some proprietary extensions in the closed-source version.

My plan is to use it as a container for a winxp machine for testing and windows-necessary stuff like MS Office. Currently the host for that vm is winxp too, but when the vm is ready, I'm planning to move to Ubuntu (jaunty jackalope) as the host.

So far, Virtual Box has satisfied my needs. It has a seamless mode to sort of have the programs running in vm look like they are just programs running in the host. It's not as elegantly done as the other two I've used in the past, but it's functional. For example alt-tab, when in seamless mode, only switches between the vm's applications. The Virtual Box Guest Additions provide the mouse pass-through mode so you can more easily switch between host and vm. And from what it looks like networking and audio also appear to work (in winxp and ubuntu at least).

Things I wish it had were drag-and-drop file support and a better seamless mode. One other thing I found out from the IRC channel is that in order to move a vm from one platform to another, you need to make sure you export and import the vm. I was used to just copying the vm file in vmware fusion at least, but that's not a frequent operation. Features/enhancements like those may come in the future though and it's hard to argue with the price.

One thing that is quite nice about virtual box though is the community. If I have a question, I search online or I can check out the IRC channel (#virtualbox on irc.freenode.net). I had some questions earlier and they were quite friendly and responsive (on the IRC channel).

All-in-all, I am quite impressed with it thus far.

Friday, May 1, 2009

JPA composite key craziness (vs. SQL Alchemy)

I know that a framework generally isn't designed to handle edge use cases gracefully. The old saying goes that you make the common case fast and the rare case possible. That often turns out to be the case for frameworks as well.

I was trying to map a composite key that made up an Oracle view - two foreign keys. The JPA is sadly very complicated with its mapping of composite keys (hibernate doc link). I heard stories around the office like, "I think XXX tried to do one of those, but then he backed out those changes." and "I did one of those once (shudder)."

In response to my ranting, a python guru friend of mine who works on both python code and java code regularly, told me that SQL Alchemy has had support for composite keys since version 0.1. He said it's pretty simple... Too bad. Too bad the JPA standard isn't better. However, maybe now that Oracle is buying Sun, the JPA will get a shot in the arm.