The ?js_string doesn’t work quite right for JSON since it ends up escaping single-quotes. This isn’t quite right for JSON since it only allows Strings to be specified using double-quotes. Therefore, in order to properly escape Strings in FreeMarker for JSON, you need to write a custom method and add it to the model. Here’s […]

I’m surprised that Friendster is even still around, but today I got an email from their CEO and it had the entire MIME body in the message. These guys can’t even figure out how to send email. X-Campaign-ID: 8002 X-Campaign-Type: 1 X-Message-Ref: 19lGRwmaJkSjEf8FZP7XSCijJOJhOejGu832ySW13bA* Content-Type: multipart/alternative; boundary=”—-_=_FSter_001_3251309519900466″ MIME-Version: 1.0 This is a MIME email, the first […]

I recently had a requirement to insert a few hudred rows into a relational database ever couple of seconds. Generally this could be accomplished during the request, but I didn’t want to introduce issues if there were spikes. Therefore, I figured I would cache the data and then write it out in a background thread […]

I’ve been meaning to do this comparison for a while now, but this morning I decided to just jump in and do it. A lot of people are constantly complaining about how expensive Macs are and I’ve long held the notion that they are quite reasonably priced. Here’s my break down: CPU (i7 2600K 3.4GHz […]

I got an email from Oracle about the Java Road Trip. Looking over the website I wasn’t immediately excited to attend the event here in Denver. But even more than that, I looked at the profiles for the speakers and the staff and all I can say is, “Where have all our heroes gone?” I […]

I’m writing some REST WebServices that return JSON and wanted to ensure that my JSON was correctly formatted and parsable. Since the JDK ships with a JavaScript engine built into it now, I figured it would be simplest to just use that and avoid any external dependencies. Here’s my code: ScriptEngine se = new ScriptEngineManager().getEngineByExtension(“js”); […]