November 2004 Archives

Java's implicit constructor invocation

|

I learned an interesting Java tidbit today that I'm surprised I never ran across before. It turns out that all object constructors implicitly call the superclass' no argument constructor. Quoting from Section 8.8.5 of the Java Language Specification:

If a constructor body does not begin with an explicit constructor invocation and the constructor being declared is not part of the primordial class Object, then the constructor body is implicitly assumed by the compiler to begin with a superclass constructor invocation "super();", an invocation of the constructor of its direct superclass that takes no arguments.

This, in a sense, provides constructor inheritance, and ensures that some form of the parent's constructor gets called be it explicitly or implicitly. For some reason I thought that a parent's constructor was invoked only if called explicitly. I'm fairly certain this is the way C++ works. But now I will have to write a little test code to verify this. I actually like the implicit super() behavior, and now that I know about it, I'm sure it'll be useful at some point.

SSH as SOCKS Proxy

|

I don't know why I didn't know this before, but OpenSSH has built-in support to act as a SOCKS proxy. All you have to do is use the -D option:

ssh -D 1080 user@example.com

And then setup your SOCKS proxy as "localhost:1080". Voila! Why would you do this? The main reason is that you don't trust whatever network you are on not to snoop where you surf. So while not something I will use every day, it is very good to know the option is there, if I need it.

One point to note if you try this on Mac OS X. The version of OpenSSH shipped with OS X 10.3.5 is 3.6.1. Unfortunately, this version only supports SOCKS4, and Safari uses SOCKS5. This is easily remedied by installing OpenSSH version 3.7.1 using Fink:

apt-get install openssh

Ah... easy as pie!

Free Pixies

|

And no, not the Pixies... Fannie May Pixies candies. Yup, that's right, they're giving away one-pound boxes to the first 500 customers when they open at 10am. When I walked past the store around 9:40 this morning, the line was over half a block long. That seems ridiculous... it's only $20 worth of candy, people! So... how long would you wait in line for $20 worth of free stuff? 15 minutes? 30 minutes? 1 hour? 2 hours? I think my threshold is somewhere around 15 minutes.

Pixies Sellout

|

I saw the Pixies last night at the Aragon Ballroom. It was really surreal to see them play. Their legendary status has been built up so much in the last 10 years or so, it was hard to know what to expect. They have aged a bit, and Black Francis' voice isn't what it used to be. They still rocked the house, though. They played all their good stuff at least once, playing "Wave of Mutilation" and "Gigantic" twice. As they were leaving the stage Black Francis was saying good night to the rest of the band... "Good Night, Kim", "Good Night Joe", "Good Night, David", Kim replied, "Good Night, Charles" referring to Black Francis', aka Frank Black's real name, Charles Thompson. Dunno why, but I found that rather amusing.

Sixteen Bit Voting

|

Some voting machines in Broward County can only count 32,000 votes per precinct. Translating this to tech terms, it could probably count up to 32,767 votes, which is a bit of a magic computer number. It's the largest number a 16-bit signed integer can hold. Why, oh why, is this an issue in this day and age? Are those extra two bytes so precious? 536,870,912 bytes cost only $95.99. I'm sure we could afford to spare a couple.

Election Statistics

|

Some interesting election statistics. In the City of Chicago, 81% voted for Kerry, and 18% voted for Bush. In Manhattan, 82% voted for Kerry, 17% for Bush. In the Bronx, 82% voted for Kerry, 17% for Bush. In Queens, 71% voted for Kerry, 28% for Bush. In Brooklyn, 74% voted for Kerry, 25% Bush. I find these statistics particularly interesting given that exit polls had "values" and terrorism as the top deciding factors of Bush voters. How is it that urban areas are so "out of touch" with the rest of America, given that they are the most likely targets of terrorism? Or maybe the rest of America is "out of touch" with cities.

Between these 5 regions, Kerry got 1,771,838 more votes than Bush. Given how close swing states such as Ohio were, perhaps the DNC needs to start a Democratic Relocation Program.

About this Archive

This page is an archive of entries from November 2004 listed from newest to oldest.

October 2004 is the previous archive.

December 2004 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Links

Powered by Movable Type 4.1