Friday, August 13, 2010

Has Oracle Destroyed JAVA?

If you hadn't heard Oracle has sued Google over the Dalvik. Dalvik is a knock off of JAVA. It's a clean room implementation but apparently there are some patents that Oracle is alleging that Google is infringing in addition to some other charges.

Since Bilski didn't clear up the patent mess it looks Google is going to have fight a pitched battle with Oracle. If Google rolls over and just pays off Oracle, it won't bode well for FOSS applications that rely on JAVA.

The irony in this situation is that everyone complained about Mono and the submarine patents that MS could potentially wield against any free implementations. Instead, we've now discovered that our new JAVA overlords aren't as friendly as Sun. It's not really surprising. Gates, Jobs, Ellison have the same basic business personalities. It's now holds barred and anything goes. Oracle is shooting itself in the foot just like MS and Apple has.

I wonder how much Oracle will start charging for either the JAVA runtime, SDK, or both. Oracle will probably squeeze as much money out of JAVA as they can. They bought it after all. It just seems sad that the nice ecosystem that has grown up around JAVA could be in trouble now.

Watch Patent Absurdity if you can.

Groklaw has a nice write up of the situation.

Saturday, August 07, 2010

Using RMagick to Resize Pics

I wanted to upload our beach pics to Facebook, but I didn't want the Facebook system to have to resize the pics. From what I could determine, Facebook has a limitation on photo sizes of 720 pixels on the largest side. Also some of the pics needed to be re-oriented.

The tool that I used to do accomplish this task under Linux is called ImageMagick. ImageMagick provides some nice command line tools for working with pics. However, I didn't want to have to write complex bash scripts to accomplish this task so I decided to use Ruby and RMagick. (Ruby, ImageMagick, and RMagick are available for Windows as well.)

Below is the script that I ended up using. It reads the name of the file to be resized from the command line. If the camera adds orientation information to the image, the script will orient it in the proper direction. After orienting the image, it will constrain the image to a maximum of 720 on each side while maintaining the aspect ratio. This means that it will stretch or shrink the side in a manner that distorts the image.


Name: resize.rb

#!/usr/bin/ruby

require 'RMagick'
include Magick

ARGV.each { |filename|
origpic = Image::read(filename).first

newpic = origpic.auto_orient
origpic.destroy!
newpic.resize_to_fit!(720)
newpic.write("lores_"+filename)
newpic.destroy!
}

Usage:
reseize.rb image.jpg
or
resize.rb *.jpg



Note that I'm using the destroy! option. This tells the libraries to release the memory that the image was using. Otherwise, running this script on a directory of images will quickly consume all of the memory and make the computer slower and slower. I discovered this the hard way. I had expected it to release the memory after each trip through the loop. It didn't work that way.

Wednesday, August 04, 2010

IT dept. reason for a new Job?

If your IT department sucks, is that a good reason to find a different job?