Tuesday, September 29, 2009

Java vs java

In the way of a more light-hearted language post, here is my comparison of Java (the language) with java (the beverage).

To begin with they are both dark voids from which no light can escape and quite bitter in flavor. Both gained popularity for primarily political reasons. One often must add (syntactic) sugar to make them palatable. Looking on Wikipedia for symptoms of overuse, we find even more similarities. Prolonged use can lead to dependency, nervousness, irritability, anxiety, twitching, insomnia, headaches, heart palpitations and ulcers. In addition, acute overdose results in similar effects to prolonged use with the addtion of: a rambling flow of thought and speech, mania, depression, lapses in judgement, disorientation, disinhibition, delusions, hallucinations and psychosis. In fact, the primary difference I can find between the two is that overdoses of one lead directly to death, while overdoses of the other will only do so indirectly.

Tuesday, August 11, 2009

Phish - The Gorge 2009

Phish was incredible. The entire trip was a blast. It started off by meeting up with Becky and some long-time friends of hers from the east coast (Aishi, Adnaan, Sal and Gina) and cramming into the RV they had rented for the trip. I can't thank them enough for letting me tag along, I only wish I could have done more than just trying to stay out of the way. Eventually, we headed out to the venue, meeting up with three more RVs along the way. Less than a mile from the venue, we managed to get pulled over for running a stop sign (whoops), but were let off with a warning. Still, it was excitment we didn't particularly need.

Finally at the venue, our initial plans were foiled by the parking folks who insisted we 1) not arrange the RVs in a square and 2) move to a different area. Despite some initial irritation and reluctance to comply, it worked out for the best. Our eventual camping spot was right near the entrance as well as a cluster of Honey Buckets; not close enough to smell, but close enough that it wasn't a hike. Through the heroic efforts of Bob, the RVs were arranged in two rows of two, with all of the awnings facing inward. It made for and excellent semi-secluded spot with some much-needed shade during the day. It proved significantly better than the initial plan which would have found us immediately at the end of Shakedown St where we would have been bombarded with tweakers until the wee hours and left us with a much longer walk to the venue. After relaxing around the table briefly and having a few beers, it was time for bed. Which was interrupted by a car alarm. That went off for 15 minutes. Twice. Hippies are, by and large, a tolerant bunch but the second time that alarm went off a lynching was imminent. I'll get back to those neighbors later.

The first day on the lot was relatively uneventful. Sit back, eat, drink, relax, and watch the cars roll in. Talk about the set list, maybe make a wager or two. Before long, it was time to take the long-ass walk to the venue itself. The first night, we stumbled across an excellent spot just in front of the VIP box seats and set up "camp" while we waited for Phish to start. Shortly after posting, we noticed that there was a nice little ledge in front of the railing to the box with just enough room to stand and rest your posterior for a beautiful view of the stage.


Finally, as the sun went down, Phish took the stage. The first set was amazing:
  1. Down With Disease
  2. Ocelot
  3. Pebbles And Marbles
  4. Possum
  5. Sleep
  6. Destiny Unbound
  7. Stash
  8. Sneakin' Sally
  9. Cavern
I'll leave the detailed reviews to others, but the entire first set was amazing. Ocelot, Stash and Sally into Cavern; just breathtaking.
During the set break a bunch of us moved into the actual VIP booth. This was facilitated by our wonderful waitress Robin who served (some of) us drinks all night and neglected to kick us out. I suspect this was greatly helped by the fact that those of us paying for the $9 Coors tipped very well. I, however, was content to perch on the railing. It gave me excellent support and a perfectly valid excuse not to be a more "active" dancer ;-).

I found the second set to be amazing as well, although some of our party (who had seen the Red Rocks shows as well) were underwhelmed (to put it mildly).
  1. The Moma Dance
  2. Light
  3. Taste
  4. Fluffhead
  5. Joy
  6. Bathtub Gin
  7. Harry Hood
  8. Slave to the Traffic Light
Joy was a particular ... um, Joy. Otherwise the set was very solid, with a lot of improvisation throughout. I'm looking forward to listening to it again, especially as I managed to party a wee bit too hard this night and my recollections of the second set are a bit fuzzy.

After the encore, we hung around a while hoping the choke points on the walk back would clear a little. That was a vain hope indeed. Trudging back to the lot was challenging, particularly as several of us were less than sober and not entirely enthusiastic about dealing with crowds of people all struggling to wedge themselves onto a narrow path or particularly capable of finding the campsite on our own. Fortunately, the buddy system proved effective and we all made it back safely to find our little corner of the lot ... thudding with bad techno from our favorite neighbors. Yes, the very same one of car alarm fame. After a wee bit more partying, I went to bed and, after several more hours of thumping bass managed to find a state somewhat resembling sleep.

During the night, our favorite neighbors were setting off fireworks (mortars) and managed to knock over the stand and shoot one right into the open hatch of a nearby tent. Did I mention fireworks at festivals are stupid? No? Well, they are. Fun to watch, but there's no one sober enough to set them off and the entire lot is a powder keg of inflammable tents and dry grass. Brilliant. But I digress. I also have to thank Margaret (again) for watching our for me while I was vulnerable in my tent. Without her efforts I would have, no doubt, been stumbled or fallen upon far more than I was :-P

  1. The Mango Song
  2. Chalk Dust Torture
  3. Middle Of The Road
  4. Tweezer
  5. Driver
  6. Twenty Years Later
  7. Ya Mar
  8. It's Ice
  9. Wolfman's Brother
  10. Character Zero
  11. Run Like An Antelope
  1. Rock & Roll
  2. Makisupa Policeman
  3. Alaska
  4. The Wedge
  5. You Enjoy Myself
  6. Backwards Down the Number Line
  7. Piper
  8. Grind
  9. Good Times Bad Times
  10. Tweezer Reprise

At some point the next day, we repeated it all again. Only to a slightly lesser extent. The second night was more sedate (for me) but we managed to nab the VIP box right off the bat this time, which was good. There were significantly more people that night and the venue was pretty diligent about scooting people out of where I had sat the night before. Which was very nice as now they were blocking my view ;-) On the whole, the second night was the stronger of the two. I don't think there was a weak song all night. The 23-minute "Rock and Roll" second set opener was simply unparalleled and was an excellent answer to the question of what could possibly follow the "Antelope" closer. Finally, the "Good Times Bad Times" encore put Zeppelin to shame. Just an all around excellent show.

After that, the weekend slowly fades out. I made it back to my tent and promptly fell asleep. Woke up the next morning, packed up and fell asleep again. At some point we made it home and I continued the periodic sleeping. I think I'm mostly recovered now. Mostly. An excellent vacation, even if it didn't exactly leave me "well rested".

Wednesday, July 15, 2009

Escape

Mostly, I don't mind being oncall. Secondary is a relatively minor intrusion and primary makes me feel useful. But on days like today where all I want to do is drive into the distance and well out of cell range, it's truly an anchor weighing me down, dragging me under. It is a resplendent day; given my druthers I'd play hooky and take the dog for a hike. As it is, I'm sitting at work trying desperately to pass the time with anything unrelated to actual work (or thought). Sadly, people have not been terribly forthcoming with CLs for review. And I can only play so many games of table tennis and Rock Band (tm).

Thursday, May 28, 2009

Places

First, a few places I've been, in no particular order:

  1. Portland, OR
  2. Mumbai, India
  3. Sydney, Australia
  4. Vancouver B.C.
  5. Seattle, WA
  6. Hastings-on-Hudson, NY
  7. Houston, TX
Next some places I'd like to visit:
  1. Kyoto, Japan (The Anagram Lover's Tokyo)
  2. Tierra del Feugo
  3. New Zedland
  4. Antarctica
  5. The Moon
Finally some places I'd rather avoid:
  1. The Midwest
  2. Texas, the non-Austin/Houston parts
  3. Florida
  4. The South
  5. Juarez, Mexico
  6. Florida
  7. Wyoming
  8. The Middle East
  9. Africa
That is all.

Friday, April 3, 2009

The Surveillance State

I've long been a vocal opponent of wide-spread surveillance cameras, as are all the rage in London. Even basic red-light cameras have been repeatedly demonstrated to be ineffectual at best to down right dangerous at worst. Most studies of CCTV cameras have shown little to no decrease in violent crime and are rarely useful for ex-post facto apprehension and conviction. So the reasons most often cited by supporters are largely bupkis. On balance, they appear to provide a slightly increased feeling of security, but little in the way of actual protection.

But recent events have convinced me otherwise. The one thing they do, however, is often catch police in the act and provide invaluable evidence of their malfeasence. Several recent cases have gone from a citizen's word against that of the officer's (which rarely turns out well for the citizen) to cases of clear-cut abuse and subversion of the legal system based on CCTV evidence. Similarly, cell phone cameras have also demonstrated their utility in demonstrating the bald-faced lies of those in power. But there aren't always other citizens and their phones to come to your aid. The CCTV footage belongs to us all. It might be Orwellian and ineffective at reducing crime, but it has already proved itself quite good at uncovering official misconduct that would otherwise go unrevealed. And we are all safer because of it.

Monday, March 23, 2009

Blathering About Gerrymandering

While frequently decried as an abuse of the political system leading to the disenfranchisement of voters and poor representation, gerrymandering is the solution to the problems it creates. In the current practice, districts are divided based on demographics, typically grouping majorities of one with minorities of another to maximize one party's "safe" votes. This leads to some truly bizarre arrangements, such as the districts surrounding Houston, TX where relatively liberal Houston is cut into very thin pies and bundled with huge swathes of the surrounding rural areas. This leaves the liberal residents of Houston underrepresented and disenfranchised.

I maintain that the solution to this particular problem is more clustering by demographics and ideology, regardless of the resulting district shape.

One of the fundamental flaws in our system of apportionment is the geographical bias. In all things, votes are assigned based on population in a particular geographical area. This inevitably leads to the "tyranny of the majority" so reviled by the founders. Liberal voters in Texas have basically no federal representation. Conservative voters in Washington are in a similar situation.
Conversely, voters whose opinions are in line with that of the majority have a voice, but little choice. The result of a typically gerrymandered district is one in which the incumbent seat is safe because the majority is a relatively narrow one. Not so narrow as to be at risk, but narrow enough to discourage ideologically similar (same-party) candidates from running a credible primary challenge.

To overcome these problems, voting districts should be arranged with minimal regard to geography. Rather, census data should be used to cluster ideologically and demographically similar voters. As people with similar ideologies tend to cluster geographically, the resulting districts would likely be non-contiguous, but more representative overall. As a Software Engineer, such a solution would be readily implementable in software. Of course, as politicians like to appear to be "doing things" that won't happen anytime soon. Regardless, the end result would be that demographically, but not necessarily geographically interests would be better represented. The cost to the majority party would be relatively minor as they would give up some seats in the legislature, but gain in that the existing seats would be even more safe than
they were previously.

As the districts would now favor one party overwhelmingly, it would certainly increase the "pandering" in campaigns. But this would now be a good thing. Rather than completely disregarding the views of the disenfranchised minority, candidates would be speaking to the whole of their selected electorate. Since the national parties wouldn't have to worry as much about the result, this scheme would counter-intuitively lead to an increase in the overall
competitiveness of elections as same (or similar) party candidates would be free to challenge the incumbent. Sadly for the likelihood of implementation, this would reduce the power of the national parties and incumbents who would be charged with taking the first steps.

Ultimately, doing away with primarily geographical constraints would lead to increased representation among all voters and a decrease in national party (and corresponding "big money") influence. The increased competition at a local level would trickle up to Congress as a whole and lead to less intra-party cohesion and greater bipartisanship as individual representatives would be more beholden to the voters than the national party.

Saturday, April 26, 2008

code without free() is code without freedom

Programmers are lazy. If we weren't, we'd choose to do the repetitive task by hand rather than automating it. But programming takes discipline to do correctly. Garbage collection is a wonderful invention that can vastly reduce bugs and increase productivity. But combined with that laziness, it's a dangerous thing.

Memory allocation is intimately connected with another topic: ownership and lifetime. Being freed from releasing memory, programmers create references willy-nilly, assuming they'll be released "when they are no longer needed". What is missing is the realization that "no longer needed" is a semantic decision that no environment is in a position to make. The only deterministic decision to be made is that a particular chunk of memory is no longer referenced. By ignoring memory management issues, programmers create huge webs of references that lure unsuspecting pointers into their clutches, never to be released. Java programmers have a wonderful euphemism for this: "unintentional object retention". The rest of the world calls this a "memory leak".

More insidious than simple object retention, is the API decisions. Or, more precisely, lack thereof. Ownership issues are ignored in both interface and documentation. So even if a conscientious coder comes along and attempts to properly manage lifetime, they find themselves without sufficient information and ability to do so. Before long, they too become ensnared. Faced with this problem, programmers have three paths they can take: ignore it and write unmanagable code with no rhyme or reason to its memory usage, rewrite the offending code with clear ownership and lifetime semantics, or move to New Zealand and raise sheep. Of the three, New Zealand is the most appealing solution.

Similarly, memory allocation is a potentially expensive operation. Hiding it from the programmer eliminates awareness of an important behavior in any program and adds a dangerous amount of nondeterminism to memory usage and performance. Frankly, these are often somewhat less important than the poor design decisions. With a little bit of extra work, implementations can be fixed to avoid allocations. Often repairing faulty designs is much more difficult. Different languages provide different levels of support for this. Java provides more visibility into allocations (typically) than, say, Python. Conversely (and somewhat unexpectedly) Python provides significantly more support for lifetime management, particularly with 2.6. The 'with' keyword provides RAII-like semantics and weakrefs provide support for releasing related or non-memory resources when the owning class goes away. In contrast, Java provides only finalize() methods (which are fundamentally broken). It's weak references provide no notification when the referrant is released.

Remember those three decisions I mentioned above? Want to write reliable, deterministic code? Yes? Want to rewrite Java? No? That just leaves sheep.