Tuesday, April 29, 2008

Run unit tests before you commit!

Shafiek merged from my RD branch and some unit tests weren't working. I had released without running the unit tests.

Monday, April 21, 2008

Validate documents you give to 3rd partys

Jay from Maximas found one of my documents was invalid according to the schema. This could have been avoided if I had've run all documents I produce through a validator.

Sunday, April 20, 2008

mplayer

mplayer -noframedrop -dumpfile out.rm -dumpstream rtsp://url/to/file.rm

Tuesday, April 15, 2008

Getting jdbc connection from entity manager

org.hibernate.ejb.EntityManagerImpl emImpl = (org.hibernate.ejb.EntityManagerImpl) em;
Connection connection = emImpl.getSession().connection();

Monday, April 14, 2008

Wiring up bi-directional relationship can cause OptimisticLocking exceptions

Shafiek encountered problem whereby there was a bidirectional one-many relationship between LocationType and Location. When he created a location he added the location to the LocationType to "wire-up" the relationship. This adding of location to the locationType's collection caused version number of LocationType to change which then would cause OptimisticLocking exception.

In Hibernate 3.3 there is an enhancement to allow you to specify whether a property triggers an optimistic lock. But since the jboss we are using does not use this hibernate, as a work around we will just not wire up the relationship in the code that adds the location.

http://opensource.atlassian.com/projects/hibernate/browse/ANN-26

Tuesday, April 1, 2008

Non-greedy Quantifiers

Quantifier

Description
\{-}
matches 0 or more of the preceding atom, as few as possible
\{-n,m}
matches 1 or more of the preceding characters...
\{-n,}
matches at lease or more of the preceding characters...
\{-,m}
matches 1 or more of the preceding characters...
where n and m are positive integers (>0)

http://www.geocities.com/volontir/#Non-Greedy