Interviews on Trivia

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

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

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!

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.

Ruby operator precedence (the ors and ands of it)

I found out (by introducing a bug into the application I’ve been working on) that “or” and “||” do not have equal precedence in Ruby.

More importantly, the assignment operator “=” has higher precedence than “or” so that means that while the expression


>> foo = nil || 2
=> 2
>> foo
=> 2

results in foo being assigned the value 2 as you might expect, the following expression leaves foo assigned the value nil.


>> foo = nil or 2
=> 2
>> foo
=> nil

This is well covered ground online (see this post) but I was surprised that this oddity didn’t warrant an explicit mention in the operator precedence section of the Pickaxe book.

U23D – Even better than the real thing!

We saw U23D last night at the Imax and it was great! I love 3d movies, and since I saw one like 10 years ago, I don’t know why all movies aren’t 3d yet, but I digress. They made great use of the “one” additional dimension, at times Bono or the Edge are all up in your proverbial “grille” with the crowd unfurling behind them.
Between the great visual effects, which at time moved the stage’s background visuals into the foreground, and the great sound system of the Imax, this was a fun experience. So if you like U2 at all, check out www.u23dmovie.com to find it near you.

Old stuff lurking at the library

I get a kick out of seeing some of the really old stuff at the Tufts library. There’s something about the permanence of these objects; they’ve been hanging out on this planet for longer than me and will probably continue to do so. Tufts weekly issues from 1943, scientific journals from the 60s. I saw a few journals that had lost their bindings and were shelved with just twine holding them together, like a gift from the past.
Last weekend I wanted to pick up some books on signal processing and time series analysis, and I dragged Kristi along with me so that we could get some groceries while we were out. While I scanned the math books the find the easiest to understand, she happened upon a book called Great American Liberals, edited by Gabriel Mason and published in 1956. The most fascinating thing for me about this book is how infrequently it has been checked out of the library. The due dates are:
July 7 1959
December 3 1971
March 13 1988
April 17 2008
At this declining rate of readership, the next time it leaves the library will be in 23-25 years!

How special, special interest money?

Oil change international put together a great tool to visualize the flow of money from oil companies to presidential candidates and congressional representatives. The graph view of the presidential race is sort of what you expect, with republicans soaking up more oil money than democrats.

What interests me about the data though, is what makes a donation from someone who works at an oil company “oil money”? Where do we draw that line? It would seem that a matched pair of max $4600 donations from the CEO and (homemaker) spouse are on one end of the special-interested donation spectrum, but what of a $500 donation from someone who owns a gas station, or a pair of $500 donations from a research scientist?

For me, I think the inclusion of some of the donations as oil-money are disingenuous, but its hard to say which donations are or are not to be included.

Maybe one day we’ll see public campaign finance and no one will have to figure that out?

Primary Day in New Hampshire

I come late to being passionate about politics – I don’t know that I can blame it all on not being an American citizen until last Spring, but it’s become obvious that there are a lot of pressing issues facing the country and this is my time to do a little something to make a difference. I’ve had a soft spot for Obama since his great 2004 speech at the DNC, and I gave some money after reading an article from the Atlantic (previous mentioned here ) and then some more for a ticket to see Obama in Boston soon thereafter. Being at this rally touched me more than I expected; I got a little teary eyed at the national anthem and then Obama’s speech made me ready to run off to New Hampshire.

So we did; one day in December we worked the phones in Concord, and then again on Tuesday we joined a few hundred others from the Boston area to drive up to New Hampshire to get out the vote for Barack Obama in the democratic primary. It was a long but great day.

Below is my very long account of the day with a few pictures here and there.

Pre-dawn rendezvous

6:30 AM – We join the mass of people huddled in the pre-dawn darkness outside Alewife T station to join carpools and get directions. After some time on organization, the group shrinks as people are dispatched northward a car load at a time. Crucial to the driver-passenger matchup process is willingness to go to the rally in Nashua at the end of the day. Fortunately for the volunteers from the Boston area, Nashua is on the way home, right on the border with Massachusetts.

7:00 AM – I’m driving to Concord, about 70 miles north with Kristi and our companions for the day, Cole and Andy. Cole is an undergrad at Emerson, and Andy works in technology but remains something of an enigma. Kristi and I have already been to Concord a couple of weeks prior, so we don’t have to learn how bad the google maps directions are in this case again.

Visibility

8:15 AM – Arrive in Concord. I slip on a still-frozen curb cut, twist my ankle and fall. I see my day of volunteering cut tragically short, but fortunately I’m still able to walk. We head over to the Obama for America office and join the swarm of volunteers. After a short time we’re handed some Obama signs and told to go and do “visibility”, that is to stand on a street corner and wave the signs around. We’re sent to a certain corner, and told to return at 9.
Visibility is kind of fun – the corner we’re at has supporters from most of the candidates, and people drive by honking, waving and yelling to their favorite supporters.

9:00 AM – Back at the office, drinking one of the donated smoothies that were staying cold in a pile of snow outside. Although the day will top out in the high 50s, there is still lots of snow around New Hampshire, lots more than in the Boston area. At this point volunteers are being assigned to staging centers in the towns around Concord that will be our home bases for the day. We’re assigned to the town of Bow, just south of Concord

10:00 AM – Arrive at a house in Bow – this host family has opened their home for 5 days as the town’s base for Obama supporters participating in get out the vote (GOTV) operations. The hosts are great people, and they keep the scores of volunteers that traipse in and out well fed and watered. We are directed to a dining(war?) room where some people are working the phones. We’re given two sets of “turf” consisting of lists of names and address (“walk lists”) of likely Obama supporters that we are to visit and remind to vote, along with door hangers (“lit”) with some information including the address of the local polling place.

10:30 AM – We attempt to organize the walk lists into chunks that make sense to split up among the four of us (clearly some room for improvement in walk-list visualization tools), and then I drop everyone off at various locations and park my car halfway in a snowbank in a residential street. (There’s lots of snow).
Now the fun begins. First, live free or die apparently includes freedom from a house numbering scheme that makes sense. Some mailboxes and most houses are missing numbers, the mailboxes are in clusters by the side of the road, and the odd and even sides of the street have curiously offset numbers. Second, the houses are pretty far apart, and then as far again back from the road. I wonder again and again if anyone has ever done a study on drive way length versus the intensity of the feeling that you’re trespassing and will get chastised for being in someone’s yard?
Turns out almost no one is home (it’s a nice neighborhood in the middle of a workday, imagine that!). There are a few instances where I think someone might be home and chooses not to answer the door, which is understandable considering how many times these people have been called and had their doors knocked over the previous months. People here seem nicer in general than in Boston, but clearly there’s a lot of primary fatigue and people are getting fed up. Someone even calls the cops because of all the people walking through neighborhoods that clearly never see walkers – Kristi is asked if she’s with the Obama canvassers by an officer, and another Obama canvasser is detained while his ID is run.
After a group trip to the Bow community center (where the polls are) for a bathroom break, we finish up. At the center, I notice a sample ballot on the wall, and there are a LOT of people on the democratic presidential ballot, more than twice as many as you might expect. Check it out

12:30 PM – We’re back at Bow-HQ filling up on Turkey Chilli, White Bean soup and Turkey sandwiches.

1:00 PM – Doing visibility at the Bow community center where polling is taking place. The local selectman comes out and tells all the supporters that vote counts at that point in the day have already exceeded the full-day totals from the previous primary. A Huckabee supporter engages Kristi to ask why she supports Obama while a Clinton-supporter’s kid plays in the melting snow.

2:30 PM – Back at the house, waiting for the go-ahead to head out and re-canvass our route so we’re talking to our fellow volunteers about this and that; a lawyer talks about the questionable legality of being asked for identification by the police for walking through a neighborhood.

3:30 PM – Headed out to canvass again – it will be great walking on unlit roads with no sidewalks to ask for votes! We should have brought flashlights or safety vests. Lots of people still aren’t home from work yet. I see one guy on my route, and he’s voted Obama – the rest of the houses still have my door hangers where I left them.

6:00 PM – The polls close in an hour, so we call it a day and head back to hand in our walk lists. Now the discussion begins – will we go to Nashua for the Obama rally to close out the day? The word is that all the tickets are gone. We head south and make calls to the Obama hotline to find out more information and get directions. The rally is at a high school gymnasium.

7:00 PM – We get to Nashua South High School (go panthers!) where there are lots of cars and lines of people. There’s a couple of lines of ticket holders and then the line of people with no tickets which we join after some deliberation.

Waiting outside

8:00 PM – We’re still in line, no lines have moved. Is it worth it to stay? I reason that it’ll probably our last chance to see Obama in person, but at that point the day feels like its been a week long. At least it’s not very cold out. Some pigs from PETA visit the captive audience, along with some enterprising vendors selling (counterfeit?) Obama merchandise.

Kristi and James

8:45 PM – We’ve made it into the gym now, it seems they’ve let more people in than originally estimated. There’s a screen set up with MSNBC on so we can watch the returns trickle in, and trickle they do. The race is, as we all know now, unexpectedly close and no winner is declared until much later. The crowd cheers every time the couple thousand vote gap between Clinton and Obama shrinks, and is silent when it grows. Its easy to think of it as a race at this point, as if momentum on closing the vote gap is more real than just the random order in which towns are reporting.

9:45 PM – still waiting. At this point people are coming and going, fetching books and newspapers to pass the time. Kristi and I find a place near a wall to sit. The republican race has been called for a long time now, and we’ve seen all the speeches.

10:30 PM – Networks start to call the race for Clinton, and soon Obama aides are distributing signs for the faithful to wave

10:45 PM – Some local congress-folk are up to introduce Obama, and then there he is. The speech is good, but due to tv lights directly behind him looking at him is like peering into the sun. “Yes we can!” The tingles I get when Obama speaks are muted a bit by fatigue, but its great to be here as a bookend to our time in New Hampshire.

12:00 AM- After a surprisingly fast exit from the parking lot, we’re back at the Alewife T station, where the day began, bidding farewell to Cole and Andy, and on our way home to bed.