Catching Up

It’s been quite some time since I’ve written anything, so I figured that I needed to catch up.

We went on a family vacation to Honolulu over the holidays, and were there during the post-Christmas island-wide blackout, which was pretty crazy. Power was out for about half a day, but the outage continued to have an effect well into the next day – for example, many restaurants and coffee shops didn’t have baked goods or food produced off-site the next morning, because their suppliers were unable to make it without power! Honolulu was fun and interesting to see, although it definitely felt quite touristy – outside the city, though, that feeling diminished and it was much easier to enjoy the sights without feeling oppressed (for lack of a better word). It was interesting that most of the tourist infrastructure is fairly old – 60’s era – and some of it is starting to show its age. Unlike Vegas, however, developers are reluctant (or unable) to rebuild or drastically renovate their properties. I’ve read descriptions of Honolulu personified as an “aging star,” which seems pretty spot-on to me.

Another interesting observation was how dependent Hawaii is on Asian tourism, in particular the Japanese. In California, and in many other areas of the country, we’re accustomed to seeing Spanish as the standard second language on signs or paperwork. In Hawaii, that second language, at least in tourist areas, is Japanese. It will be interesting to see how the Japanese (and worldwide) recession affects Hawaii, but I can’t imagine that the tourism industry there will be doing well over the next couple of years.

We stayed through the New Year, and as a result, got to see what the holidays are like in an area where fireworks are legal. Practically the whole island was shooting off fireworks in a constant barrage that lasted about an hour. It was definitely pretty impressive, and, because we were watching from the 39th floor, we got a great view of much of the island celebrating. The funniest thing for me was that there were some people out there who were shooting off flare guns, including a simultaneous 5-shot finale at the stroke of midnight.

Life Imitates Hitman: Blood Money

The article: Actor Cuts Throat on Stage in Knife Mix-Up.

I immediately thought of the Curtains Down level in Hitman: Blood Money, where you can take care of one of your targets by swapping out a prop pistol for a real one. (The target is normally shot in the head with a prop pistol, as part of the opera.)

Fortunately, the actor in the article recovered, and the incident appears to have been the result of incompetence rather than malice.

CD Death Watch: Record Store Edition

I’ve made a few posts in the past about the ongoing death of CDs, and, after some haphazard Googling following a bout of watching ‘90s music videos, dug up some news that hits close to home. A music store where I spent a lot of time in college, CD World, recently closed both of its locations. The owner of CD World, which had been in business for 16 years, related the situation in an interesting fashion: “The stores had become like a lovable, old three-legged dog — it was still lovable, but old.”

It’s hard to underestimate the impact that stores like CD World had on my music tastes. For someone who wasn’t rich, but had a decent chunk of disposable income (thanks to the various jobs I worked) and free time on his hands, these stores were a great way to explore new music cheaply. The fact that they had listening stations meant that you didn’t have to buy albums blind – the healthy supply of used CDs and cutouts likewise encouraged musical experimentation. They also stocked tons of imports in an era before it was easy to buy them online, which, given my musical tastes, was fantastic. “Going CD shopping” was a legitimate way to spend an afternoon, because you could really spend time listening to the music and debating its merits with your fellow audiophiles. The music-buying experience at your average big-box retailer is geared towards letting you find exactly what you were looking for, and then getting you to buy other stuff at the store too, to justify the loss-leader CD that you bought. Music is grudgingly accepted as part of their business model – a necessary evil, unlike the record store where music is it’s raison d’être.

The experience was friendlier and more “social,” in a way, than even my later experiences in other music stores, ones with much bigger street cred and stock like Amoeba. Amoeba’s problem is that their stores are perfect for the übernerd who knows exactly what they want – Amoeba’s selection is legendary, and it is generally well-organized and well-maintained – but terrible for someone who’s just looking to explore on their own. The lack of listening stations really dampens my interest in just “going to Amoeba” for the heck of it – I can wander around and flip through the racks for hours, but I’m much less likely to actually buy new stuff (that is, from bands that I am unfamiliar with) unless I can listen to it, or it’s in the bargain bin.

Strangely, for a time even one of the bigger players in the music market understood my concerns. I remember the old Blockbuster Music that I used to go to (formerly Sound Warehouse) had a rather impressive rack of listening stations, manned by a store employee. (One nice thing about Blockbuster in this regard was that their listening stations were well-kept, the headphones were in good condition, and the headphone jacks weren’t always busted, in stark contrast to many of the indie stores. There was also never a wait to use the listening stations, because they had way more CD players than I ever saw customers in the store.) The prices there fell into the “fairly-to-ridiculously high” category (which would eventually doom music retailers like Blockbuster, Sam Goody and Tower Records), but at the very least they understood that providing this atmosphere could encourage people to spend more time in their store, and, sooner or later, buy more stuff.

It’s hard to imagine these kinds of stores ever making a comeback. “Going music shopping” sounds like an anachronism now – with portable digital music players becoming ubiquitous, it’s actually more work for someone to buy a CD and then listen to it on their MP3 player. The artistic significance of albums is gone – consumers frame the music buying discussion in terms of “why should I pay money for the songs I don’t like?”, as if it would make sense to just buy and watch movie trailers since “they contain all the best parts anyway.” It seems that most non-dying CD stores are either downsizing (and trying to subsist on true specialty items alone), or becoming one of a thousand flea market merchants on eBay. Even the infamous Bill’s in Dallas (home of the “no price tags” haggle system/tax dodge) relocated to smaller digs and Internet sales. It’s sort of strange that, on the one hand, the Internet (or digital distribution) has really crushed the traditional CD store model, but on the other hand, it is providing a way for them to survive (and a more “efficient” market for consumers). When life gives you lemons, make lemonade. Change is the only constant.

In the meantime, I’ll shed a tear in remembrance of a lot of “wasted” afternoons browsing the racks at CD World.

Optimization Tradeoffs

This recent post by Raymond Chen highlights some interesting memory optimization scenarios, and the wide-ranging impact of size optimizations. A quick summary:

  • Changing a structure definition such that a bunch of Win32 BOOLs use one bit each saves memory in the struct, because BOOL is typedef’d as an INT.
  • Accessing the bitfield data members requires additional work (a couple of shifts, in the example). This chews up a little time, and some additional memory for the expanded code. The break-even point for overall reduced memory usage depends on the number of struct instances and the number of locations in the code that access the data.
  • Packing data members in this fashion also prevents you from setting a data breakpoint on a particular packed flag or value.
  • The atomic read/write operations work on words, making it more cumbersome to manipulate the packed values safely in a multithreaded environment.

Changing data members to bitfields has other effects, as well:

  • When making this change, you might do a quick grep on your code (as part of your cost-benefit analysis) to see where the data member is touched. “Ah ha,” you say, “it’s only touched in one or two places! This change is a no-brainer!” Of course, if those one or two places are part of inlined functions, the impact of the higher instruction count might be much larger than you think. It’s important to dig a little deeper than a quick grep when making these sorts of changes, to make sure you aren’t psyching yourself out. (And, of course, being able to provide concrete before-and-after measurements is also of paramount importance.)
  • Depending on your struct packing size, you might not see any benefit to bitfield optimization unless you reduce the struct’s size below the next lower multiple of the packing size.
  • One potential positive effect is that reducing the size of your structs may help with cache utilization – if you can cram more data into the cache, the added cost of accessing the packed data may be offset.

The take-away from this exercise is that it’s important to consider many different factors and effects when optimizing. Most of the real-world cases where I made these optimizations were situations where the struct in question had hundreds, or thousands, of instances, and the tradeoff was definitely a win, but it’s still worth taking a moment to think about all of the consequences of such a change.

The comments on the post are amusing, running the gamut from “completely missing the point” (those who say you should always/never use bitfields – there are many of these comments), to those bringing up even more valid considerations (such as how bitfield layout is implementation-dependent behavior, and how trying to map bitfields to hardware structures is a potential endianness minefield). There’s also one rather insightful observation that made me laugh:

I must say: assembly language has no code of honor. Anything goes so long as it works.

So true.

Cuttino Mobley’s Heart Rate Goes to Zero As Mike Dunleavy Approaches Infinity

Here’s a link to the original story.

The source said Mobley would see a heart specialist on Tuesday. Normally players have 48 hours to report to their new teams and take a physical examination, followed by another 24 hours for all the test results to come in. Because this trade was completed after business hours on Friday, the teams agreed to an additional 24-hour period, which ends at 6:30 p.m. ET Tuesday.

When asked about’s report by reporters after the Clippers game on Monday, coach Mike Dunleavy said: "From the standpoint of Cuttino’s concern, there’s nothing they have or don’t have that hasn’t been known to us or hasn’t been approved by us and all the other teams he’s played for. Neither one of those guys has had any issues with any of the things that are even being talked about.

"All I know is that if Cuttino has anything, he’s been asymptotic," Dunleavy said. "He’s never had any issue with us. There’s never been one time that he missed a practice or missed a game or had any issues in any physical of any kind for us. I mean, I’ve been told by our doctors that the things that are under concern is not something that we haven’t known about or have had any issues with. So hopefully, it won’t be an issue."

That’s right – when the opportunity to make a math joke pops up in the world of basketball, I’m going to grasp it with both hands.

“Games” Versus “Experiences”

My wife completed The Legend of Zelda: Twilight Princess the other day, after starting it several months ago, and playing in sporadic but lengthy bursts (the kind that you tend to indulge in only on the weekends, and which usually leave you feeling guilty about “wasting time”). I was a spectator for a small, but non-trivial, fraction of the game, and an occasional co-pilot (when she got frustrated or bored). I saw bits from most parts of the game, admired the great art direction, and boggled at the ubiquity of highly-scripted or specialized gameplay. Yet, in spite of this, I’m left with no real desire to actually play the game myself.

Why is that? I hadn’t thought about it much before, or had ever really anticipated my lack of enjoyment in this way. I believe it has something to do with the lack of meaningful choices that can be made – there’s really nothing novel to which I can look forward on my own playthrough, now that I’ve seen the story play out. Furthermore, the minute-to-minute gameplay isn’t good enough to overcome that – it’s pretty standard action-adventure stuff that doesn’t distinguish itself.

Categorizing games by the criterion of “frequency of meaningful choices” is an interesting exercise, and there’s a strong correspondence between games that meet the criterion and games that I really enjoy. RPGs often feature lots of character customization and branching gameplay, and they’re certainly a favorite genre of mine. Strategy games, by definition, require meaningful choices. Even driving games (good ones, at least) have lots of choices and problems, on a moment-to-moment basis, to wrap your head around. By contrast, FPS games and action-adventure games that fall on the “spectacle” end of the spectrum tend to be one-shot deals for me. I rarely come back to them, and watching or seeing spoilers for them significantly decreases my incentive to play.

I guess another way to think about this is that:

  • Nobody wants to watch people play board games – people want to participate.
  • Similarly, it’s rare that you would get something new out of watching a movie by yourself, after having previously watched it with friends. (There are certainly cases where the passage of time might give you a different perspective on a film, but similar analogues exist for games as well. I don’t think that invalidates this point.)


Earlier this week, I packed my bags and drove out to Las Vegas, Nevada, to volunteer on the ground for the Obama campaign on Election Day. This was part of their “Drive for Change” campaign, which encouraged people from California (and other states) to volunteer in battleground states. I decided that, given the historic nature of the election, and the fact that Election Day happened to fall on my birthday, I would drive out and participate.

The organization of this was a little bit haphazard, perhaps owing to the extremely tight schedules the campaign was working under, and the fact that there were a lot of people participating in the program. Information about a meeting place wasn’t in my hands until a couple of days before I left, and I actually didn’t know specifically what I would be doing until I got there. The campaign representatives also seemed to be surprised at the level of turnout – the original intent was to use volunteers as poll watchers, but they weren’t sure that they actually had enough polling places for all the volunteers to watch. (Many people opted to do additional canvassing instead.) I was wondering if they would be seeking volunteers to drive people to the polls – the campaign, however, delegated that responsibility to the local volunteers (who know the local turf way better than the out-of-staters).


We estimated that there were probably 500-600 volunteers in the orientation session that I attended – there was an additional one later in the evening, as well. The couple sitting next to me had arrived as part of an organized bus trip, and got a bit of a surprise as they ran into their neighbor at the orientation. The session speaker, who would give us instructions on poll watching, was running late, and had gotten pulled over by the highway patrol on her way over for speeding. The orientation started almost an hour late, with some of that delay filled up by a short speech by Dina Titus (who ran for, and won, the 3rd congressional seat in Nevada). Later, the organizers’ attempts to herd people into manageable groups for giving assignments smacked of inexperience. The whole session was controlled chaos.

I drew an assignment watching a polling place near the Strip, at the Stupak community center. I arrived bright and early, about half an hour before the polls opened, and introduced myself to the team there. There was one other poll watcher from the Obama campaign – a lawyer who doubled as the ‘voter protection’ representative for the polling place. There were no poll watchers from the McCain camp – it’s not clear to me, though, if it was because my polling place appeared to be in heavily Democratic territory, or because of a sheer lack of volunteers on the ground for McCain. (The information packet I got at the orientation labeled the polling location as “tier 3” – I speculate that meant that it was fairly low on the list of anticipated trouble spots.) At any rate, the county as a whole went for Obama by 18 points.

To my surprise, a significant portion of the county election workers hadn’t worked the polls before. This inexperience was counterbalanced by the presence of several people who had worked the polls for many years. Various representatives from the county election board dropped by during the day, to ensure that things were running smoothly and that the polling place had adequate supplies. The polling process went smoothly – there were slight delays for voters in the morning (about 30 minutes, once the line built up), and a few voting machines that needed to be reset, but no major hiccups.

My main responsibility was to gather a list of voters who had voted that day, and relay that information to the campaign. The rationale for this is that, even on Election Day, canvassers can still go out into the field and get people out to the polls. By eliminating people who have already voted, the canvassers’ efforts can be focused on those who haven’t yet voted, saving time wasted calling and knocking on doors of people who have already cast their ballots.

The names of voters were supposed to be read off as they signed in, making it easier for poll watchers to record their data. However, due to the layout of the polling place, the poll watchers were stationed quite far away from the registration tables, so it was impractical to do this. Instead, at various times during the day, the master lists of who voted were made available to us poll watchers – we would transcribe the results on the master lists to our campaign-provided lists, and then submit that data.

The voter information databases were updated in real-time, by one of two methods: a phone hotline, or a website. (This is the “Houdini” system that has been mentioned in post-election wrapups.) The orientation speaker claimed that the phone system would be the easier way to go – it was simply a series of voice prompts, for which you punched in precinct and voter numbers, followed by confirmation. However, the phone system was inaccessible in the morning, ostensibly due to the large volume of callers. It’s not clear to me if there was a software glitch, or a lack of capacity. Fortunately, I had decided to bring my EEE PC along with me. I tethered my phone to my laptop, and used my phone’s data plan to get Internet connectivity. I then used the website (which was still working correctly) for punching in voter information. The phone hotline was restored later in the afternoon, but I felt it was easier for me to use my laptop anyway, so I continued to use that for the rest of the day.

There were no signs of disenfranchisement or any other bogeymen. The biggest surprise was that a street construction crew was digging a ditch just outside, blocking street access from one direction. However, following a short discussion with the construction crew, signs were put up indicating that voters needed to detour around to get to the polling place.

As a poll watcher, you’re not allowed to speak with voters, or have any sort of campaign paraphernalia with you (since it might influence or intimidate voters). Most of this applies to the poll workers as well, and both groups adhered to these principles without any trouble. However, this did result in an amusing “election vernacular” evolving between us, though, as I believe most, if not all, of the poll workers were also Obama supporters. There were frequent mentions of how excited one was about the election, how excited one was to see all of the new voters, whether or not you were going to the Rio party (I did not, bowing to incredible exhaustion and the desire to watch the election returns until the outcome was no longer in doubt), etc. Pretty funny.

All in all, it was a pretty interesting experience, even if it was mostly sitting, waiting, and watching. There were many people who were first-time or first-time-in-a-long-time voters, but who were clearly very motivated to come out and vote. Two Asian women had let their registrations lapse, not realizing that they would be purged after several years of inactivity. They waited patiently (and doggedly) while the poll workers confirmed with the county that they would be able to vote provisionally. One of them actually had to go home and come back to finish voting, as she had forgotten to bring her reading glasses, and needed them to fill out the provisional paper ballot. Another woman, who had one arm amputated at the elbow, said that she hadn’t voted in 30 years, but was tremendously enthusiastic about voting. Several voters came in, but were at the wrong polling place – the poll workers looked up their information online, and were able to redirect them to their appropriate polling locations. Many voters brought their kids with them, wanting them to be a part of the experience as well.

Vile (Yet Funny)

On the way home today, I saw a sign spinner at the corner of MacArthur and Fairview in Costa Mesa. Here is the sign:


“Vote for McCain. Obama is a socialist and a friend of terrorists ! (William Ayers)”

The “socialist” label is just ridiculous – I also like the grammatically bizarre parenthetical note on Obama’s terrorist sidekick. All of that isn’t why I find this really funny – this is:


This is the fellow who was holding the sign. I talked with him briefly, and asked him what the deal was with the sign. Apparently he was hired to stand on the corner and hold the sign by a man from Costa Mesa – he wasn’t sure if it was someone with the Republican party, but he thought that was likely. He is being paid $9 an hour for this work.

Why is this funny? Well, the minimum wage in California is actually $8 an hour. (This is likely under-the-table money anyway, which is common in the day labor market and not subject to state law.) While the Obama campaign has an enormous, enthusiastic volunteer base across the country, one which I have personally seen and been a part of, the McCain campaign has built little enthusiasm and has to pay “volunteers” to get out and spread their message. Not only that, they apparently had to raise their cash offer above minimum wage in order to get someone to work for them!

Tuesday is my birthday – I’m hoping for a good birthday present this year…


I recently picked up an ASUS Eee PC 900HA, after having seen and used one of the earlier EEEs when I visited my sister in September. I was pretty taken with the idea of having an inexpensive, lightweight PC. I’m actually writing this entry on it — touch typing on its smaller keyboard requires a little bit of an adjustment, but it’s still pretty feasible. So far I’m very impressed with its performance — I was expecting something more sluggish, but the apps I’ve used so far are running well.

I intend to split the hard drive such that I can dual-boot Linux and Windows — the hard drive on this thing is definitely big enough to accommodate both. When that’s accomplished, I’ll hopefully have a nice, portable netbook for both travel and (very) light development work.

Another thing that remains to be seen is how well games will run on this thing. I’m not expecting to run graphics-intensive games, but if I can run some decent strategy or turn-based games on this, I’ll be very, very pleased.