Over the past year, I scoured Google for an Eclipse plugin that would launch the terminal in a specific folder for me. I was picturing something that added a right-click context menu option for opening any folder in a project in the console so I could do command line stuff on it.

I would do a bunch of searches and find nothing, give up for a few months until I needed the functionality again, do a bunch of searches, give up, and so on…

…read the rest of this entry »

This is in the babble category tagged as

Add a comment »

Ever since upgrading to Firefox 3, I’ve been without my beloved LastTabfirefox It was but a simple extension: it allowed me to control-tab back and forth between tabs that I was working on.  With the many (many) tabs I like to keep open, well, being able to control-tab back through them in the order I last saw them was a real time saver.

Something better has finally come along: ctrl-tab.  It is as simple as LastTab…only prettier.  It apparently is slated to be included in Firefox 3.1.  Very nice.

(It appears that LastTab has been upgraded to work with 3.0 finally.  I’m a little disappointed I’m only finding out about this now.  I had added the writers blog to my Reader with the sole intent of being able to get the updated extension on its release date…but no!  No announcement was made by Timothy Humphrey on this blog.  For months now I’ve been reading his mumbo jumbo posts for naught!  Bah!)

This is in the babble category tagged as ,

Add a comment »

- 09 Aug 2008 -

When writing a dbunit test for the CohortServiceTest, I encountered this non-informative error:

org.dbunit.dataset.NoPrimaryKeyException: COHORT_MEMBER

In the Cohort mapping file the cohort_member table is mapped like any hibernate collection:

<set name="memberIds" cascade="none" lazy="true" table="cohort_member">
    <key column="cohort_id" />
    <element column="patient_id" type="integer" />
</set>

It looks normal enough.  Cohort.memberIds is a list of integers defined by the cohort_member table.

Hibernate automatically creates the schema in our test hsqldb because we have hbm2ddl set to “auto”.  The problem arose here because hibernate wasn’t creating a dual primary key on the member_ids table.  Digging through the code, I found that Hibernate only assumes the primary keys are the columns that set to “not null”.

The corrected mapping with both columns set to be not-null:

<set name="memberIds" cascade="none" lazy="true" table="cohort_member">
    <key column="cohort_id" not-null="true"/>
    <element column="patient_id" type="integer" not-null="true"/>
</set>

Now hibernate creates the table with primary keys and hsql is happy again.

This is in the openmrs category tagged as , , , ,

1 comment »

- 07 Aug 2008 -

Meghan’s laptop hard drive recently died.  It was a painful death.  One consisting of much clicking and clacking with no data retrieval.

Of course she didn’t have any backup solutions, so it was looking like her data was gone forever.

She cries, “Unacceptable!”

I retort, “But its expensive!”.  I cry.

So I do some googling for hard drive recovery reviews and companies.  I call a few and they all say it’ll be in the thousands of dollars.  So I turned to my trusty friend, ebay.  I found one company called Hard Drive Savers offering invasive recovery it for only $300.  (I had taken the top off my drive already and saw it was a hardware problem, so I knew I needed invasive).

I was skeptical, so I did some more googling to get some background on HDDSavers.  I found relatively few comments on them, but all were good.  So off went Meghan’s hard drive.

Lo and behold, a week later a dvd arrived with the contents of the folders she needed!  John over there at hddsavers came through!  I highly recommend them for anyone needing to recover data from a dead hard drive.

Disclaimer for all you doubters out there:
I am in no way affiliated or obligated to hddsavers.com.

Feel free to contact me via the comments (won’t be published) if you want any more information.

This is in the babble category tagged as , ,

Add a comment »

While migrating from JUnit 3.x to the new 4.x framework, one method I found that was missing was Spring’s getLoadCount() method on the
AbstractDepenpendencyInjectionTest. The value returned allowed us to tell whether a test was running by itself or in a group a tests (like with the ant junit-report target or right-clicking on /test/src and choosing run-as junit test).

Having this method was useful for two reasons:

  1. A test like CreateInitialDataSet that is meant to be configured and run alone.  If this test sees that its being run in a group, it returns early and doesn’t actually run the test
  2. The module tests needed to have the application context refreshed before running.  To do this, I made the previous test mark the context as “dirty” so that the test directly following it would have a fresh app context.

There were actually two separate solutions:

  1. All tests extend BaseContextSensitiveTest for convenience methods and setup.  Every junit class will invoke this class and its constructor.  By adding a static variable loadCount and incrementing that in the constructor, I am able to know how many tests have been run up to that point.
  2. The application context doesn’t need to be marked as dirty.  The dummy method could actually be removed without replacement.

This is in the openmrs category tagged as , ,

Add a comment »

« Previous Entries