All posts tagged with 'Code Snippets'

JDBC: Autogenerated keys revisited.

02-Apr-08

Some months ago i wrote about retrieving auto generated values with JDBC from an Oracle Database: JDBC: Get autogenerated keys on a Oracle DB. The solution i presented in the previous article doesn’t run in a Oracle Java Stored Procedure. To accomplish this, use a callable statement like this: final String sql = "BEGIN INSERT […]

Read the complete article »

Handle EXIF data with ruby (and style…)

09-Mar-08

I use rmagick when it comes to deal with images. I’m not that disappointed like Zed Shaw with rmagick (but Zed is totally right when he points out on page 4: “[…] and is difficult to install (unless your computer is nearly exactly the same as the author’s).”), but when it comes to deal with […]

Read the complete article »

Turning off x_send_file in development mode

23-Jan-08

I just discovered the great x_send_file plugin and technique and use it extensivly for daily fratze. I replaced the majority of send_file calls with x_send_file but not all (the in memory thingies i serve cannot be send through apache). This works great in production mode but in development mode, it fails as there is no […]

Read the complete article »

Using rubyzip to create zip files on the fly

21-Jan-08

In my Daily Fratze project the users should be able to download their faces as a zip file backup. Until now they have been able to upload zip files. For that, i used rubyzip which worked quite well. As a starting point i found a nice article on the joy of rubyzip, but this has […]

Read the complete article »

A fistfull of readers

23-Oct-07

After presenting a working InputStream on a ByteBuffer, i have to more readers for you out there. First, the StringBufferReader to efficient read data from a StringBuffer. One can use new java.io.StringReader(sb.toString()) but that would convert the whole StringBuffer (sb) to a string, loosing a whole lotta memory if the string is just big enough. […]

Read the complete article »