Patriotism jumps the shark?

April 30th, 2008

Free agency comes to the Olympics. This has probably been happening for a long time, but two recent articles on espn.com told of athletes acquiring citizenship in other nations for the sole purpose of playing on their Olympic team.

  • Becky Hammon , basketball player who has no Russian family connection whatsoever, signs on with a Russian club team to play professionally and with the side benefit of a Russian passport so she can play on their Olympic team. (Because she’s not good enough to make the American team)
  • Kathryn Bertine, has an ongoing series in ESPN magazine in which she searches for a sport in which she can make the Olympics, and then after settling on cycling, ends up sending emails to scores of countries in the hopes one will give her a passport before finally being taken in by St Kitts and Nevin. She actually makes a pretty good case for what she’s doing in the eight part of her series: “If being an Olympian means being part of something internationally positive, does it really matter what country I represent?”

I’m not sure what the takeaway from all this is. You decide.

This did teach me more about the ins and outs of dual citizenship though. As I’m both British and American at this point, my understanding was that America would frown upon going out of your way to acquire more passports (instead of getting one because you’re Jewish or have an Irish grandmother) but it turns out the law says doing so only revokes your US citizenship if you do so with the intent of renouncing one’s US citizenship, and the presumption is that one does not intend that unless otherwise stated. So there you have it, you’ve got the go ahead to stock up on passports just in case the dollar finally crashes.

Gas price holiday

April 30th, 2008

I’m pleased to see Thomas Friedman hit the nail on head in is op-ed “Dumb as We Wanna Be“. The idea of having a gas price holiday – rescinding the 18.4 cents a gallon gas tax for the peak driving season in the summer is ridiculous. The way forward is to increase these taxes, not decrease them. People need to start paying for the negative externalities of living hours away from work or driving across country on vacation. Dropping the per-gallon tax provides the most benefit to the drivers of the least efficient vehicles or who drive the most, which incents the opposite behavior this country needs to start tackling climate change and stop sending our money overseas.

We need leaders who will tackle issues like this head on, instead of leaders who will pander to the people. Look kids: no gas taxes, checks in your mailbox, shiny things!

If we’re going tax the oil companies, which we should, we shouldn’t waste that money on replacing the gas taxes, it should go to supporting long term incentives for alternative energies so that the private sector can invest for the long haul. It should go to expanding and electrifying a rail network to take oil guzzling trucks and cars off the road. And so on…

Huckabee’s Negative Countdown

April 28th, 2008

This dates from a few weeks ago – Mike Huckabee had a countdown on his web site to the launch of what turned out to be his political action committee. At the appointed time, the counter hit zero. Instead of the page reloading to unveil what we’d been waiting for, or just stopping at zero, the counter just kept on counting down into negative numbers. (Even the counters go negative this season?)

After refreshing the page myself, the countdown was still going negative, until the site finally launched a few minutes later, and for that I’m sure we can all breathe a sigh of relief.

Carrier

April 28th, 2008

Watched the first 2 episodes of Carrier, Life Aboard the Aircraft Carrier USS Nimitz last night. Its a reality-show style documentary about life at see on a carrier for six months in 2005. Its interesting because it shows the lives of a a core group of people drawn from all over the ship’s crew, rather than just the much more visible pilots that couldn’t do anything without the other 5000 people on board. Showing on PBS this week in HD, and episodes are available online too.

The short circuit article

April 10th, 2008

About three and a half years ago I co-wrote an article named “Increase stability and responsiveness by short-circuiting code” for IBM’s developer works site, and for some reason in the past few days it has repeatedly asked for attention (“hi this is 2004, your article is on the line, and its woefully dated”). First, the one page abstract we submitted fell out of a book on my bookshelf, then I was asked about it at at least one interview. Sadly, that was one of the top results for my name in google for a while and people still find it.
I figure its about time to revisit, and disavow, the implementation in the article, if that isn’t already obvious to anyone.

The idea was to provide a way to time-box operations that could take an unknown amount of time. In this way for example, a web page that must be displayed faster than a certain time can be guaranteed to run in that time, if it can do without the results of operations that take too long to execute.
One obvious flaw is that the code creates LOTS of new threads for a short period of time. It should have used a thread pool to reduce that churn.
The best reason not to use that code is that Java 1.5 introduced a whole set of Concurrency utilities. ExecutorService and Future. There are lots of examples about, so you can check them out.

The high level view is that you package your functionality in a Runnable or Callable (depending if you need to return a result), submit it to an instance of ExecutorService to run. It will return a Future object which can be queried to get the result. One can call get on the Future class, which will return right away if the task is done execuiting, or block until the sooner of a specified timeout or the task completing. Even better, one can submit multiple tasks at once with invokeAll(..) and that will return when all tasks are complete or the timeout has expired.

Lessig at the Berkman center

April 7th, 2008

I had the pleasure of seeing Lawrence Lessig unveil the next phase of the Change-congress movement last Friday at the Berkman center at Harvard. Lessig gives phenomenal presentations and could probably be compelling talking about just about any topic. The topic this time was the distorting (rather than corrupting) influence money has on politics and I thought it was eye opening and informative.

Lessig mentioned a study showing people stop reading or tune out of news as soon as political donations are mentioned as part of a story, so even without real corruption most of the time, the appearance of influence is enough to make large numbers of people disengage from the political process.

I wish I could link to the talk, but as far as I can tell its not yet online despite being webcase live. Check out the event’s page, hopefully a link to the video will appear there one day.

Update: theres a video posted on the change congress blog

Interviews on Trivia

April 7th, 2008

I’ve started interviewing again now that I should be finished with my Master’s degree in a month or so. I’m reminded again of the wide range of interview styles people use. My least favorite is the trivia test. This seems to happen more often with Java-related job interviews than Ruby-related ones.

I may never understand why any employer would value memorizing the Java API over being able to reference the docs and know where to find things.

I had such an interview just last week. Here are some of those questions

  • How do you execute a PL-SQL stored procedure from JDBC?
  • How do you import classes into the classpath of a JSP page? (apparently ‘no one in their right mind does that anymore’ isn’t a good answer to this one)

Who memorizes that stuff?

My favorite question of all was this : what are the two conditions under which a finally block is not called. I got one of them, (System.exit()) but the interviewer wouldn’t even tell me the other one (“You won’t learn that way”). I googled it later to find the answer not well defined. One of the ways I saw mentioned was the thread “dying” but Thread.stop() is severely deprecated so that shouldn’t ever happen. The other answer I saw floating around doesn’t really fit – when a exception is thrown from the finally block it doesn’t complete, but the finally block is still called.

I was talking about this with Frank and he came up with another way: infinite loop in the try block. I then thought of calling PowerSystem.getMainPower().setPosition(OFF).

Now I can’t wait to get that question again!

Olympic Torch Relay

April 7th, 2008

This morning I was reading about protests during the Olympic torch relay in Paris forcing the torch’s security team to extinguish the flame.
That got me to thinking: does anything say “committed to reducing carbon emissions” like carrying a glorified burning stick 85,000 miles around the world? That’s a lot of jet fuel, not to mention all the resources used by security teams in each site, as well as traffic jams caused by that kind of disruption. For reference, that’s more distance than the previous two torch relays, combined. In fact it’s only about 3000 miles more than the previous three torch relays combined.

Torch relay distances

(Stats from Wikipedia)

The carbon footprint of this endeavor has to be pretty large- measured against the problem its a drop in the proverbial bucket, but huge endeavors like this must signal some people that continued consumption is ok. Why trade in the SUV for a smaller car if this stuff is going on?

Astute graph readers may notice this tradition got its start in Nazi Germany in 1936.

Another fun fact is that the relay for the 1976 Olympics traveled only 775 physical kilometers, because it was transmitted by satellite from Greece to Canada by generating an electrical signal from the flame.

Here’s the torch tracker google gadget:

Google finance’s new stockscreener has sparklines

March 14th, 2008

I noticed this morning that google finance has a new stock screener feature that lets you choose stocks with features in a certain range by way of an interactive sparkline. These are miniature graphs that go inline with text. In this case the graph is a histogram that indicates how much of the stock market falls into each part of the range – this will give one a quick preview how inclusive their search parameters are.

googlefinance.png

Hacked!

March 14th, 2008

I’m really lax about updating my wordpress install. Turns out I got burned this time, and inadvertently hosted a bunch of links to various flavors of porn site.

I was on an ancient (and security hole ridden) version of Wordpress, and I wouldn’t even have noticed if the hack didn’t also break posting new entries. I was attempting to post my previous entry on Ruby programming, and the post wasn’t working. So I figured it wasn’t working because of the programming language syntax being rejected somehow, so I would update to a more modern version. Which I did, and that still didn’t work so I started poking around the log files. Lo and behold, my access log is full of requests for html files in a subdirectory of the site. They shouldn’t be there I thought!

So I’d been hacked- someone got remote access to my account using this hack in a file “ro8kfbsmag.txt” (more info). All cleaned up now (I think) but not how I’d meant to spend my afternoon.