Monday, January 10, 2011

Tip for testing database function performance

Suppose you've got a database function that's slow. You want to determine where the bottlenecks are, so you decide to pepper your function with RAISE NOTICE statements to output the current time at different points within the function. You try "RAISE NOTICE current_timestamp" and note that every time this statement is executed, the same timestamp is output. It's as if current_timestamp has been pre-set to be the moment in time when the function began executing. What to do? The solution is to use "RAISE NOTICE timeofday()" - this will reflect the actual time, not the time the function began executing.

(Please note that this applies to Postgres. I don't know if this post translates precisely for other DBMS's.)

Postgres performance considerations

A great article about Postgres performance considerations that the guys from thoughtbot have been so kind to share - read and enjoy!

Monday, December 27, 2010

Preserve the history while re-adding a file to Subversion

To re-add a file previously deleted in Subversion execute this command...

svn copy --revision [rev number] [path to file in repository] [path on local file system to copy to]

... then commit the file. This will retain the history of the file.

Here's an example:

(1) svn copy --revision 20471 http://tools.symposium.org/svn/smp/dev/config/classes/velocity/donor/feedback.vm config/classes/velocity/donor/feedback.vm

(2) svn commit -m "resurrected feedback.vm from rev 20471" config/classes/velocity/donor/feedback.vm

Monday, August 30, 2010

Type conversion: Spring 2 vs. Spring 3

To my dismay, there is no generalized String <-> Object conversion mechanism in Spring 2.0 unless you're using Webflow. Spring 3, however, includes it for non-Webflow situations.

Tuesday, July 20, 2010

Unlimited strong passwords in a flash

Ever needed to generate a bunch of strong passwords in a flash? Look no further than this amazing tool!

Friday, May 7, 2010

A great article on email deliverability

In today's world, due to spam's proliferation, ensuring that the maximum number of emails your organization sends ends up in your recipients' inboxes can be complicated.This wonderful article illustrates both the DYI approach and also lists some SMTP relay providers that will do the heavy-lifting for you.

Friday, February 19, 2010

Interesting Java tidbit

If you pass a number in String form, padded with spaces, like " 89.99 " for example, to Double.parseDouble(), no exceptions will be thrown. If you pass the same number to Integer.parseInt(), a NumberFormatException will be thrown.