Home

What I sort of look like

Just in case you ever want to scratch your eyes out: here's sort of what I look like when I look in the mirror.

Read more...

My advice on how to vote

I don't normally tell people how to vote in the US - just to vote - but by gum, I'm as mad as I can be. I'm not going to tell you for whom to vote, nor can I tell you who I'll vote for, but I'll tell you this: my vote is for sale to any politician who'll meet these requirements.

Read more...

Tags :

Spring changes its license structure

The reason SpringSource's license change bothers me so much is not the specific change. It bothers me because Spring has done a good job embedding itself in successful projects, and now they've shown that they're willing to change the license, and I have no guarantee or confidence they won't change it to something more onerous in the future.

Read more...

I have seeeeeeen the light, brothers and sisters!

Okay, that's a little hokey - but one test with OpenSpaces opened my eyes.

I spent a lot of time on a specific architectural piece on an application I'm writing, only to run up against some thorny concurrency issues. I've always said that you should measure before optimizing; I didn't follow my own advice. Here's what I found when I decided to use completely unoptimized code... man, was I dumb.

Read more...

Filtering characters from a Reader

It's an occasionally legitimate question: "How do I filter content from a Reader?" There're related questions for Streams, too. Here's an example of a simple Reader class that shows how to remove specific characters from a Reader.

Read more...

How can I create a maintenance window for my web app?

Every so often, web applications need maintenance. Yes, even web applications. It's okay - no need to reach for your security blanket. The problem that's come up is: What's a good way to redirect requests during a maintenance window to an error page? As usual, there are multiple answers.

Read more...

How can I automatically expire data from a database?

Another fairly common question: how can I expire data from a database? This is a case of applying lipstick to a pig: there are ways, to be sure, but the real problem is that you're using a database - a permanent datastore - to handle data that's short-lived.

Read more...

My data structures have changed - how can I migrate my data model?

Sometimes, people design data structures, persisted entities, only to find that - gasp! - their data structures are more fluid than they expected. When all of your data is transient - meaning that it can be destroyed safely - that's no big deal, because you just drop the tables in question (or the whole database) and start over. (Sound familiar, Rails fans?) Sometimes, that's not enough - so what do you do?

Read more...

How do I send mail with Java?

You send mail in Java with one of two APIs, basically: JavaMail and Commons-Email. People who use JavaMail fit in one of three categories: they don't know about Commons-Email, they are doing bulk mail and know what they're doing, or they're gluttons for punishment. Here's a class that shows how to send mail with both JavaMail and Commons-Email, for the case of sending to a single address.

Read more...

Tags :

How do I parse or format dates? Dates are hard!

Well, Barbie, dates are really pretty easy. Here's a class with a number of formatting and parsing examples.

Read more...