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