Tuesday, November 11, 2008

Bash Search History

I'm kind of an old school command line hacker, but I've got to face up to the fact that the rest of the world seems to be moving on from the ksh. As such my previous super powers for editing command histories with vi commands (esc-k, /, etc) are going to have to be retired. As the rest of the planet has embraced bash, I've found myself struggling with the fact that crtl-r only lets me get the previous command.
The bask docs suggest that Meta-p will then scroll back through those commands, but esc, alt and apple keys are all major fail for meta on my mac.

However I have found an acceptable solution. If you create the following .inputrc file then you can start typing any command, then the up/down arrows will allow you to scroll through previous commands that started the same way.

i.e. type vi then up arrow, up arrow will find the last but 2 vi commands you typed.

# search history via arrows - .inputrc
"\e[A": history-search-backward
"\e[B": history-search-forward

Monday, July 28, 2008

Oracle 10g doubles and Hibernate

I needed to migrate a chunk of data from an example Derby database up to Oracle 10g today. I found a minor issue with the Hibernate mappings that I was creating. In Derby I could happily have double columns, and these needed to be converted to binary_double columns in Oracle.

However I kept having issues with the schema validation in hibernate :

Wrong column type: binary_double, expected: double precision

After looking into the source for the dialect mappings I've found that creating a new dialect that extends the Oracle 9 one as follows solves this problem :

public class Oracle10Dialect extends Oracle9Dialect


public Oracle10Dialect()



registerColumnType(Types.DOUBLE, "binary_double");



Then use this class in the persistence.xml file instead of the Oracle9Dialect.

Monday, March 10, 2008

Eclipse Mac Memory Settings

I always seem to forget this :

Edit the eclipse.ini in the Application package, not the one in the install dir.

Thursday, March 06, 2008

Parallels Update Problem

I've had a problem with upgrading Parallels the excellent tool for running VMs in OSX. For some reason that I could not initially spot the install would hang in the preflight check before applying all the files. I also had a similar problem trying to force an uninstall.

To cut a long story short it appears that the install/uninstall scripts try to shut down the InternetSharing and bootpd daemons.....in my case these would simply not die through the current script and I had to intervene manually - the install then ran fine.

NB - Turns out this was actually a symptom of a problem I really struggled to find. The internal script was failing to kill the processes because weirdly the 'awk' calls where causing Bus errors. I could reproduce this with the simplest print $1 style call. Turned out that this was actually a corrupt binary - no idea how this has occurred, but replacing /usr/bin/awk has fixed it all.

Thursday, February 28, 2008

Leopard - Spaces - Keyboard shortcut

I got frustrated with spaces on Leopard because moving windows around between active spaces didn't seem easy. Turns out it is - all you need to do is click on the menu bar for the window you want moved and then use CTL-LeftArrow/RightArrow to move the window to another space.