... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2007-02-27

Starting Oracle on Windows

Under Windows, to configure an Oracle instance to start automatically when its service starts, make sure that the following registry key is set:

HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID\ORA_INSTANCE_AUTOSTART=TRUE

where ID is the identification number of the Oracle home (typically '0') and INSTANCE is the name of the instance.  The corresponding service will be named 'OracleServiceINSTANCE'.

Also note that it is generally a bad idea to stop and Oracle instance by simply stopping the service.

2007-02-23

Growing Java Arrays

Here is a Java convenience method to append an element to an array (of any kind):

private static <T> T[] appendToArray(T[] array, T element) {
    @SuppressWarnings("unchecked")
    T[] newArray = (T[])Array.newInstance(array.getClass().getComponentType(), array.length + 1);
    System.arraycopy(array, 0, newArray, 0, array.length);
    newArray[array.length] = element;
    return newArray;
}

Hacking SVN Logs

I wrote a little Windows batch script, svnloghack,  that makes it easier to change the revision logs in a Subversion repository.  It takes a path to a subversion repository and a list of revision numbers as command line arguments.  It creates a file named zsvnhackrev.txt for each revision (where rev is the revision number).  Each file contains the corresponding log message.  It also creates a batch script named zsvnhack.bat that writes back all of the log messages to their corresponding revisions in the repository (presumably after you have edited them).

Also, the batch script pre-revprop-change.bat is a minimalist hook script for Subversion that will permit log changes (and other revision property changes) to take place.  You have to put it in the hooks directory of the repository if there isn't such a hook already there.

2007-02-20

JUnit Tear-down Assertions

In JUnit 4.1, if an assertion failure occurs in a tear-down method it will mask any failure that occurred in the test case itself.  There is no real work-around for this problem other than commenting out the assertion in the tear-down method.

Blog Archive