Skip to content

www.rolfje.com

Tag: programming

Ibatis Inline Parameter Maps

Posted on 2010-02-16 By rolfje 3 Comments on Ibatis Inline Parameter Maps

Today I (re)discovered a feature in the Ibatis data mapper framework which was clearly documented, but for some reason was not being used in our project. The feature is called “inline parameter maps” and combined with a wrapper bean it can clean up a lot of clutter in the code and in the SqlMaps. Please feel free to share this example with your fellow Ibatis Data Mapper 2 framework users.

Read More “Ibatis Inline Parameter Maps” »

Uncategorized

Flow

Posted on 2009-12-22 By rolfje 3 Comments on Flow

Being “in the flow”. The nicest state of mind known to mankind. You act without thinking, and everyone of your actions is the perfect response to the situation. Riding a motorcycle on a beautiful road without a destination can easily get you into this state. With an empty mind, you see the next 2 corners, feel your bike as your brakes hit the disc, smell the forest, and hear the wind as you start accelerating out of the first corner while naturally placing the bike into position for the next.

Read More “Flow” »

Software

Sonar “Close Connection” warning workaround.

Posted on 2009-10-06 By rolfje 7 Comments on Sonar “Close Connection” warning workaround.

When you use Spring and Ibatis and SQLTemplates, you could have code in your project which looks somewhat like this:

Connection connection = DataSourceUtils.getConnection(getDataSource());
...<do connection stuff here>...
DataSourceUtils.releaseConnection(connection, getDataSource());

Sonar will report that you did not close the connection, while in fact, Spring did that for you. You can not just add a “connection.close()” to the code because the whole point of calling “releaseConnection()” is to have Spring handle all the smart stuff on committing, closing, and returning the connection to the pool if needed.

Read More “Sonar “Close Connection” warning workaround.” »

Software

Transactions and Isolation levels

Posted on 2009-08-29 By rolfje 2 Comments on Transactions and Isolation levels

Safety googlesAt work, we have two applications which connect to the same database. For all kinds of business reasons, we need to make sure that only one of the applications accesses certain data at the same time. To do this, we use a row in a table as a semaphore.

While working on the locking mechanism, we had a closer look at the Transaction Management and the Isolation Levels we were using. There is a lot of good documentation on Transaction and Isolation, but it tends to be over complete, elaborate and therefore hard to read. I’ll try to share our insights with you in a slightly more digestable form (I hope).

Read More “Transactions and Isolation levels” »

Software

Starting Java app from Applescript

Posted on 2009-06-11 By rolfje No Comments on Starting Java app from Applescript

Suppose you have a Java Swing application which you can start by typing the following on the command line:

java -jar myTerrificSwingApp.jar

If you want to make that application start from the Finder in OSX, there are a lot of options which range from ugly to convoluted. If you need a quick fix, here’s how to do it.

Read More “Starting Java app from Applescript” »

Apple, Software

Javascript Window Shake

Posted on 2009-03-12 By rolfje 2 Comments on Javascript Window Shake

This evening I came accross the window.moveBy() JavaScript function and thought it would be cool to shake the browser window when a user fails to log in. It turns out that I was not the only one thinking this, but none of the examples worked for me. Some had no proper delays, others only worked from the page header, and some were plain unreadable.

I’m no Javascript guru, but I hacked this together which is working pretty nicely. It is in fact almost undistinguishable from the Apple login window shake at a login failure:

<script type="text/javascript">
if (window.moveBy) {
	delay = 70;
	shakes = 3;
	window.moveBy(-10, 0);
	for (j = shakes; j > 0; j--) {
		setTimeout( "window.moveBy(20, 0)", j*delay );
		setTimeout( "window.moveBy(-20, 0)", 
					j*delay+(delay/2));
	}
	setTimeout( "window.moveBy(10, 0)", (shakes+1)*delay );
}
</script>

In my case, I surrounded this code with a Tapestry @Conditional and made it into a reusable Tapestry component so that I can make any window shake as soon as it contains an error.

The code will work anywhere on your page, but I advise you to put it at the bottom of the HTML. This will make sure that the content is shown in the browser before you shake it.

It’s visually much stronger than just adding an errortext to the page. If people log in a couple of times a day, they don’t even notice extra text on the screen. This will “shake” them awake 🙂

Have fun!

Fun, Software

Care vs Careless

Posted on 2009-02-03 By rolfje No Comments on Care vs Careless

 

simplicity

 

It’s frightening to realize how close to the truth Eric Burke is.

Fun

“Instruments” – Application monitor

Posted on 2009-01-02 By rolfje No Comments on “Instruments” – Application monitor

InstrumentsDid you know that your installation of Leopard comes with a built-in performance monitor? It’s called “Instruments” and you can attach it to any process currently running. In the screenshot you see here I attached it to an instance of Eclipse while running some unittests.

Instruments has some nice templates for you to choose from, and you can monitor CPU activity per thread, disk I/O, User Interface activity, Object allocations, and leaks. Just so you know, it might come in handy.

Apple, Software

How to add drivers to SQuirreLSQL.app

Posted on 2008-12-30 By rolfje 11 Comments on How to add drivers to SQuirreLSQL.app

SQuireL SQL on OSX with Oracle driversIf you’re a SQuirreL SQL fan like me, and you use a Mac, you probably also want to know how to add a driver to the OSX version of the application. Most people just point to an external jar file, but you can also add drivers to the application bundle.  There’s not much to it, but it took me some time to discover that I actually had to edit the plist file in the bundle after adding the driver.

As you can see on the left, my SQuireLSQL.app now comes with the Oracle OCI and Thin driver built in, and because they are part of the application bundle, I can’t wreck my installation by misplacing jarfiles or reconfiguring classpaths. Nice.

If you want to drivers to your SQuireLSQL.app yourself, here’s what you need to do:

Read More “How to add drivers to SQuirreLSQL.app” »

Apple, Software

Eclipse 3.4.1, OSX and Java 1.6

Posted on 2008-12-28 By rolfje 2 Comments on Eclipse 3.4.1, OSX and Java 1.6

Eclipse application icon

I recently downloaded Eclipse 3.4.1 for Mac OSX, and tried starting it using the eclipse.app icon. It did not work, and I noticed a message in /var/log/system.log telling me that the JVM could not be loaded.

Read More “Eclipse 3.4.1, OSX and Java 1.6” »

Apple, Software

Posts navigation

Previous 1 2 3 4 … 6 Next
           

Recent Comments

  • rolfje on Methode Buijs uitgelegd
  • LinkedIn is at Peak Enshittifaction – Will Chatham's Blog on Linked-In not really Opt-in?
  • Hans j on 1N4148 diode as RF switch
  • Roaming Rhonda on DLNA on OSX, done right
  • Frans on How to fix a Krups XN2001 Nespresso machine

Tags

Anonimatron Apple backup design DIY DRM eclipse environment Fun gmail google hacking hamradio Hardware helicopter iphone ipod iTunes Java Keynote maven modelling motorcycle music news opinion oracle osx photo photography programming repair review security Software Steve Jobs T-Mobile technology Time Machine Ubuntu usability Utilities vacation windows Workshop

Categories

  • Apple (105)
  • Divorce (1)
  • Electronics (3)
  • Fun (57)
  • Games (7)
  • Hardware (72)
  • Microsoft (18)
  • Racing (14)
  • Software (134)
  • Uncategorized (65)
  • Workshop (20)

Archives

Copyright © 2025 www.rolfje.com.

Powered by PressBook WordPress theme