Jan 18 2012

Create Universally Unique ID in Java

For the longest time I’ve used java.rmi.server.UID to create a unique ID in a application. We enhanced the UID class to fit our needs and to format the ID to the standard format but unfortunately we found that within a process, we were generating duplicate IDs if we created more than a certain amount. It didn’t take much to remedy the problem since Java introduced java.util.UUID in Java 1.5.

To create a universally unique ID in Java 1.5 or greater just call the static randomUUID method on the UUID class.

UUID.randomUUID().toString()

UUID has a wider range of possible values that I’m not concern of duplicate values or collisions for my application.


Mar 1 2011

Random Thoughts February 2011

Can you create a forum with with nothing more than a set of links, headlines, and Disqus? It to me that this would be the simplest question and answer or forum site you can develop. All that Disqus needs is an link to the page where you embed some JavaScript and Disqus handles all the login and authentication for users to comment or answer a question and gives you a pretty good management system to maintain the comments.

There has been questions about having Al Jazeera in the US cable market. I think a better question is why doesn’t Al Jazeera, and CNN for that matter, live stream their broadcast online. The CNN website is indistinguishable from a news papers website. If I want to see news clips I go to YouTube and if I want to read news articles I go to the New York Times. I understand that CNN is an abbreviation for Cable News Network and that they are in part subsidized by cable subscribers but more and more people are looking for a online news outlet that has the same or better experience than your newspaper or television set. If Al Jazeera really wants to be in the American market, they should just stream their broadcast online.

I really hate Daylight Saving Time. I hate having to move the clock 1 hour back and then 1 hour forward each year. It really messed with my internal clock for at least a week when I we have to do the switch. It’s such partisanship to have to pick a side. Why don’t we compromise and meet in the middle. Instead of moving the clock forward an hour this March and the back in November, let’s move it up 30 minutes and keep it at the time the whole year forever or until next major solar event.