Sunday, June 21, 2009

First reactions to Xcode 3.1.3

Code Sense seems to be much better. Acts intelligently and pressing Return on the suggestion selects the suggestion. It's been a while since I've been in Xcode, but I remember the Code Sense being somewhat odd. That doesn't seem to be the case now. BTW, I'm using Xcode from the iPhone SDK released last week.

Thursday, May 14, 2009

Learn IDE key mappings while pair programming

I'm a big believer in keeping the hands on the keyboard and minimizing the amount of mouse use when coding. Therefore, I tend to spend some time learning the keymappings for the IDE I am using. I'm most proficient with IntelliJ IDEA but I've also learned a good portion of the keymappings in Eclipse and Visual Studio+ReSharper.

I've been doing a fair amount of pair programming lately on my current gig, a good thing. One behavior that we have been practicing while pair programming is gently forcing the driver of the pair to use keymappings to activate various actions within the IDE. Neal Ford describes this in his book The Productive Programmer. Practicing this behavior while pair programming has proven very valuable to increasing our productivity while in the code base. Neal mentions the KeyPromoter plugin for IntelliJ; I've tried this plugin and I haven't become a big fan of it. Much easier if your navigator keeps you honest.

I've done this before with pair programming while working at Identix in 2004 with Hans Loedolff. Hans knew all the IntelliJ keymappings and could type at about 90 words per minute. He was an excellent pair programmmer.

nmon performance monitoring tool

One of the takeaways from yesterday's Tomcat Expert Series seminar was the use of nmon (Nigel's monitor), a curses-based performance monitoring tool. I had never heard of nmon before yesterday, so I was curious why I missed this tool in my IT travels. Seems the tool has originated out of IBM, originally on IBM's AIX Unix variant. The tool has been ported to Linux. More information here. If you're deploying onto Linux or AIX, it might be worthwhile to take a look at this tool and add it to your systems. Unfortunately it does not look like there's a version for Mac OS X yet. Hey, OS X is Unix too ;-)

Wednesday, May 13, 2009

Tomcat Expert Series here in Minneapolis

Attended the SpringSource Tomcat Expert Series seminar here in Minneapolis this morning at the Hyatt Regency. Filip Hanik of SpringSource presented. Filip is a major committer to the Apache Tomcat project. Excellent technical presentations on Tomcat and JVM performance tuning tips and debugging JVM memory and thread issues. Lots of good information around Sun's generational heap and garbage collecting the heap, If you get a chance to take this presentation in, you won't regret it. $75 USD for 3.5 hours and a nice lunch. Seemed like a nice turn out, probably 120 or so attendees. SpringSource seems to be picking up momentum in the JVM space with recent acquisitions of G2One (Groovy and Grails consulting and development) and Hyperic (web application monitoring and management tooling). Could be well positioned when the economy comes out of this funk it's currently in.

Friday, April 24, 2009

Adding GNOME to Ubuntu Server

I needed to add in an Xserver to my Ubuntu Server--Oracle 11g installer is graphical. I didn't want to play the redirecting of the X display back to OS X, so I did some searching and found this discussion. I'll reproduce the steps that I took. The forum posting has many different solutions.

Update your package system.
sudo apt-get update


Install the Ubuntu desktop package. This package seems to be a super package containing many package dependencies. It literally downloaded about 1.7 GB of software. Gdm is part of this install, so you don't have to do an individual install of that after the fact.
sudo apt-get install ubuntu-desktop



Gdm automatically starts the X system during bootup. To configure it to start, do the following:

sudo /etc/init.d/gdm start



You may need to reconfigure your video card, keyboard, etc. To do so, do the following:
sudo dpkg-reconfigure xserver-xorg


Thursday, April 23, 2009

Installing VMware Tools on Ubuntu Server

I'm brining up an Oracle 11g install on Ubuntu Server here at home, and I had a need to install VMware Tools on the server installation before I got hot and heavy into the Oracle installation. Here are some great instructions on how to do just that. I'm using VMware Fusion 2.0.4 on a Mac OS X 10.5.6 host system. Seems VMware has released the source for VMware Tools and you can now get it from an Ubuntu apt repository.

Saturday, April 11, 2009

Excellent Digg Dialogg with Trent Reznor

Excellent video with Trent Reznor of Nine Inch Nails. Kevin Rose of Digg hosts and the questions are from the community, voted up on Digg. Excellent content around Trent's efforts on alternative music distributions and business models. He also mentions his interactions with id Software and John Carmack. Has some nice comments about the programming profession. Well worth watching.

Sunday, April 05, 2009

Embedded domain components in Grails

The embedded component feature of Grails is not documented very well, in my opinion. Therefore, I thought I would create a blog entry so others don't have to spend the time trying to experiment with it to get it to work.


I recently spent some time working on a home project that I have implemented in Grails 1.1. Grails has a feature for embedding domain components into other domain classes. An embedded component participates in the domain class mapping to a database table; there is no join to an child embedded component table. In my domain object model, a TimeRecord is a domain component suitable for embedding. It doesn't live on its own, but is meant to be embedded as a reusable component throughout my domain object model. Grails has first-class support for embedded components, though it took me a bit of time to figure out how to get it to work. First the definition of the TimeRecord class:



class TimeRecord {
TimeRecordUnits units
BigDecimal value

static constraints = {
units(nullable: false)
value(nullable: false)
}
}

Nothing earth-shattering here. The reference to TimeRecordUnits is a Groovy enum. The TimeRecord class is not meant to be mapped to its own table in the database; it will become part of any domain object's table mapping whenever it is embedded in that domain object class. Thus, the TimeRecord class definition needs to reside inside some other domain object's Groovy file. Strange behavior, even for convention over configuration, but it does work.


Now embed the TimeRecord in another domain object class and that domain object's table mapping will also have TimeRecord properties mapped to it. Here is my Story class that has a TimeRecord contained in it:



class Story {

TimeRecord estimate

static embedded = ['estimate']

}

I've removed other Story properties to focus on the embedded component mapping. Grails has a static property named embedded that specifies the component object property that should participate as an embedded association. That's it. I put the TimeRecord definition in the Story.groovy file, directly after the Story definition. Everything maps correctly to the database and I don't get an extraneous time_record table being generated by GORM. Pretty cool.


I must say that domain object modeling in Grails is much, MUCH faster than it is in Java with Hibernate. I'm at least an order of magnitude faster with GORM in Grails than I was in Java and Hibernate. I'm hooked on Grails convention over configuration theme.


Powered by Zoundry Raven