Sunday, September 06, 2009

Sleepless in Boston

Well, I just got back to Boston last night. And after a long day of wanting to sleep and trying to doze off in cars, airport sofas, and airplanes, I finally have a bed and I can't sleep. My mind is full of songs, scenes from my favorite shows, and other miscellaneous thoughts. So be warned that the rest of this entry may feel a bit like a stream of consciousness, like it's been lifted out of some first-person narrative.

What have I tried so far? Counting sheep? Nah, that never really worked for me (not even electric sheep). I did try to sing myself a lullaby, but no dice. Maybe it's just jet lag and I still think it's Pacific Time? (it is after all, only around 10:30 back in the Bay) But, hrm, I did stay awake for most of the previous night to catch my flight. And while I did catch some Zs in aforementioned airport and airplane, shouldn't I be more drowsy around now?

So now I'm trying to write. Maybe if I just put some of my thoughts on paper, it'll clear my mind. That makes sense, right? You know, maybe it'll work like a Pensieve and allow me to siphon my thoughts into paper? I'm thinking of this quote by Dumbledore:

"I sometimes find, and I am sure you know the feeling, that I simply have too many thoughts and memories crammed into my mind... At these times... I use the Pensieve. One simply siphons the excess thoughts from one's mind, pours them into the basin, and examines them at one's leisure."

Ah, yes, I know the feeling only too well. I could certainly do with a Pensieve.

You know what? I think the effort required to write coherent sentences is starting to have a soporific effect. I may not even have to write down all my thoughts. That probably saves you from tons of Buffy/Angel spoilers as that's my show of the moment.

What was I thinking about again? Smurfs come to mind. Yes, there's a particularly funny moment in Bones when Brennan wants a Smurfette doll, but Booth gives her a Brainy Smurf doll instead. I don't really know what made me think of that. Sometimes scenes from some of my favorite TV shows, books, or movies, just pop into my head and make me smile for a few seconds.

Weren't there some songs in the mix too? Oh yeah, I was listening to XM radio 20on20 on the flight. And you know what I realized? My life would suck without Kelly Clarkson. And I can apparently find God on the corner of channels 2 and 3 on the inflight radio. Also, I finally found out the name of this song that I can't get out of my head. And wow, Coldplay covered it? Well, here we are now, entertain us.

Ok, perhaps I ought to give this sleep thing another try. I think I've already filled this post to the brim with enough cultural references. How many did you find?


Saturday, August 01, 2009

Take Me Out The Ballgame

Another first last night. I tagged along with a bunch of interns and went to watch the Phillies play the Giants at AT&T park. It was not only my first ballgame, but also my first sports game.

Back in middle school, I used to be a big sports fan and remember avidly following the Giants in the early 2000s, those blissfully innocent pre-steroid scandal years. Those were the seasons Barry Bonds hit home runs 500, 71, and 73; Rob Nenn was a star closer with an unhittable slider; Eric Gagne was the Dodger's pitcher I most loved to revile; A-Rod was not an overpaid Yankee, but a Texas Ranger; Livan Hernandez and Jeff Kent were Giants; Randy Johnson was not (he was, and always will be, the DBacks Ace); and, oh, there was a little thing called the World Series that we got within 7 outs of winning before blowing it (to the Angels of Anaheim, not Los Angeles).

But going into yesterday's game, I honestly couldn't name a single player on the Giants roster. (Though I am shocked to learn that the Big Unit plays for SFO now!) I didn't know any of the fan favorites (who's "Kung Fu Panda"?) and had very little knowledge of the standings.

And while I don't remember too much about the game (Giants lost 5-1 and didn't play too well), it was still a very interesting experience. What I do remember instead are the sights, smells, shivers, and surprises.

The hustlers on the corner of King and 3rd Street peddling tickets as we walked up to the entrance of the ballpark. The long winding ramp leading up to the bleachers. The view out to the bay from behind right field. The tickling sea mist. The shock that the players looked much closer than I'd imagined from watching games on TV. The pungent smell of the garlic fries. The absurdly expensive diet coke. Feeling really thirsty after having some especially salty popcorn. The really silly games they would play on the big Jumbo-Tron ("Is Barry Zito's jersey number higher or lower than 42?"). The infamous seventh inning stretch. And more that I can't remember now...

We were sitting out in left field just below the big catcher's mitt and the prominent Coca-Cola bottle. I could just make out home plate from there, but as nothing really happened for most of the game, I didn't really pay much attention to the plate. Instead, I chatted up some of the people sitting around me. I met some old friends and some new ones. A couple people behind me didn't really know the rules of baseball, so I had fun translating some of the game's events.

"It's a full-count. That means there's 3 balls and 2 strikes. Another ball and it's a walk. And another strike and he's out." I hope the rules didn't seem too arcane to them. At the very least, I never had to explain what a balk was. Most unfortunately, I can't say the same about my first experience with watching a baseball game on TV. Randy Johnson was pitching and kept throwing back to first base to check the runner there. This happened for at least five minutes while the commentators talked about whether Johnson was balking and explained the concept. It's a miracle that I kept watching... I imagine I must have been quite bored.

After the seventh inning stretch, I began to realize there was little chance the Giants would come back to win. Several of us pulled out our iPhones and consulted the Caltrain schedules. After some debating over whether we could make the next train that would leave in 10-15 minutes, we decided to make a run for it.

Ten minutes till the train leaves. Down the stairs to the ballpark's exit. Now rounding the corner around the ballpark's exterior, the bay to the left. Seven minutes. Leaping past the statue of Willie Mays at the front of the park as we arrived at the intersection. A quick sprint, two blocks down. Wind in my hair, pure exhilaration. Four minutes. Another block across. Three minutes. Hurry into the station, fumbling with my wallet, quickly purchase a ticket from the kiosk. One minute. Flash my ticket at the conductor. And yes, aboard the train with seconds to spare.

And we're speeding away, back home, back to Hogwarts... No wait, I mean the South Bay, sigh... T'was a fun night.


Thursday, July 16, 2009

Half-Blood Prince Movie

I just saw the new Harry Potter movie last night. I had not planned to go on opening night, but I wound up with a free ticket and went on a whim. While it was pretty good, it wasn't quite what I expected. In the interest of full disclosure, I'll admit that my expectations were sky-high given the early Tomatometer ratings in the astronomic range of 98%.

Additionally, book 6 was probably my favorite of the series (a close call with book 3, Prisoner of Azkaban). Unlike the previous two books which were high on the action and thrills, book 6 slowed down and spent more time on character development. Also, it helped that book 6 also had a very poignant cliff-hanger of an ending. I'd thought the death at the end of Order of the Phoenix had been sad, but it hardly compared to how I felt about the death at the end of Half-Blood Prince (in contrast, I wasn't really as deeply impacted by any of the deaths in the last book).

That said, the ending of the movie wasn't able to evoke quite the same feeling for me; indeed it was over quite quickly and the effect didn't linger. Though, perhaps, it wasn't realistic for me to expect the same reaction given that the end was now longer a surprise or such a shock. There's also the knowledge of what happens in the last book which probably factors into the experience too. Maybe the death would have hit me just as hard in the movie if I were watching it before reading the last book.

The ending aside, the movie had tons of excellent scenes. The opening attack on the Muggle world was a good touch. Jim Broadbent as Professor Slughorn was quite good and the memories of Lord Voldemort were chilling. Even the romance wasn't overly sappy; I particularly liked the scene where Harry and Hermione comfort each other after she's saddened to see Ron snogging Lavender. I must note, however, that the Harry/Ginny kiss was quite weak and didn't have any of the spontaneity or passion that was evoked in the book; it was especially disappointing given how much they kept hinting at the relationship.

But my biggest gripe was that the film often appeared to be a string of scenes rather than a cohesive story. This was probably a casualty of the fact that there was no single large plot thread, but several subtle ones. While it worked fine in the book, it may have been less appetizing for movie audiences.

Nonetheless, I can't complain too much about a free show. And I'll still probably go see it again when it finally comes out on IMAX.


Tuesday, July 14, 2009

Viva la Vida!

Last night, I went to my first (to be precise, I went to a Ben Folds & Sara Bareilles Concert during MIT's Spring Weekend, but I'm counting this as my first real one since it was outside of school) concert: Coldplay at the Shoreline Amphitheater. Needless to say, it was quite mind-blowing.

As this was my first concert, I should first note a few lessons for posterity:
  1. The main act doesn't start until a couple of hours into the show. So while I hurried to the Amphitheater after work to make the 7 p.m. start time, I needn't have. This is only true if you have reserved seats, probably not true for lawn seats. On the other hand, the opening acts weren't too bad, so it might be worth it to show up early.
  2. I forgot to bring any pocket money, but it was probably just as well. There are concessions, but they are absurdly over-priced. The only thing that was tempting was Ben & Jerry's, but at more than $5 for a scoop, it was best that I didn't have any money.
  3. You will be standing for most of the main act and probably singing along if you're a big fan. I luckily brought in a bottle of water which saved me from becoming hoarse before Viva la Vida. But I might have been better served with two bottles.
  4. It probably goes without saying, but concerts are extremely loud. They don't lend themselves well to carrying on cell phone conversations. Indeed, I often found myself grateful that I wasn't too close to the stage. I was in the 26th row and it was still quite loud.
Coldplay burst onto the stage a little before 9 p.m. playing Life in Technicolor in the dark. A few seconds in, a spectacular array of lights illuminated the stage and the band. The concert had begun!

Coldplay started off with a series of hit singles such as Violet Hill, Clocks, In My Place, and Yellow. During the latter, they released several large yellow beach balls into the audience to add to the excitement.

After the singles, Coldplay relocated to the lawn to play a couple of numbers. And then at the 10 p.m. mark, Chris Martin and Company bounded back to the stage and launched straight into Viva la Vida with a flourish. I think I'd already drained my bottle of water by this time and my voice was starting to grow hoarse. But I still sang along :)

By the end of the concert, Coldplay had played every song from the album (except Yes for some reason; I guess it wasn't concert-friendly?) and also covered Michael Jackson's Billie Jean. Chris Martin came back for an encore and played The Scientist very soulfully on the piano. And the concert ended as it had begun: playing Life in Technicolor II (the one with the words) as the band faded into darkness.

Overall, quite an amazing experience for my first concert. The band also gave away free copies of a live album LeftRightLeftRightLeft containing some of the songs they played that night (also available for free download from Coldplay's site).

I think I have the concert bug now... would love to go to a U2 concert next! :)


Thursday, June 18, 2009

The Multi-threaded Cabinet

Last week, I had some trouble with my desk cabinet at work. I seemed to have inadvertently locked my top drawer. After fiddling around with the cabinet a bit, the drawer had magically opened. This behavior left me puzzled and it wasn't until today that I figured it out. The cabinet is multi-threaded!

The cabinet is small, black with two drawers. Open either drawer alone and everything's fine. Now, try to open both of them at the same time. Race condition!

It turns out if you have one drawer open, you can't open the other drawer! It's locked, literally :P

I can't fathom what merited this particular design choice. Did the designer think something catastrophic would happen if I had both my drawers open at the same time? Nonetheless, it certainly isn't an intuitive feature, nor easily discoverable. But my mind is just a bit more at ease now that I've solved this particular conundrum. :)


Wednesday, June 17, 2009

Pandora Pause Indicator

A few months ago for a 6.813 assignment, I'd suggested Pandora as an example of a good user interface. But I'd noted that one thing that annoyed me was that it was hard to tell whether the player was playing or paused. There was a single play/pause button with one function highlighted in orange. Take a look at this snapshot from the old version of the UI and try to guess if the player is playing or paused:

Does the highlighted function showed the current state or the action that would happen if you pressed the button? (Highlight to reveal answer: current state) I'd always mix this up.

Now, it's true that most of the time, the auditory feedback of hearing the song play would tell you which state the player is in. But when your internet connection is flaky and you're trying to figure out whether Pandora doesn't have a connection or is just paused, the lack of state visibility was very annoying.

I later noticed that there was a hidden indicator in the form of a dynamic url change. When you click pause, the url is appended with a #/paused.

This of course isn't too visible, so I'm glad that Pandora just updated their interface to have a very visible pause indicator: a big black paused icon shows up on top of the song's icon. An incredible improvement in visibility -- well done, Pandora! :)

As an added bonus, the big paused indicator does double-duty as a button. It can be clicked to resume playback.

It is worth noting however that Pandora continues to show the current state (paused) rather than the action that will happen if you press the button (play). Contrast this to Hulu whose video player also displays a big black button when paused, except it displays the action (play).


Wednesday, May 27, 2009

Cool Music Sites

I love listening to new music, so I drew up a list of some cool music sites. I stumbled upon the first two a couple days ago. I've used the others for a couple of years now and am including them for completeness.
  • Just Hear It: type in any artist, song and get a quick list of youtube clips and music videos. The membership component is in private beta, but the search is still very handy.
  • Musicovery: pick a mood, a decade or two, and some genres and it will start playing that type of music. It also shows a nice visual graph of the songs its playing and similar songs it will be play next.
  • Pandora: create a personalized station by entering a favorite artist or song and it'll play similar songs on that station. Say thumbs up/down to make the station home in on the songs you really like.
  • a music social networking site, has good suggestions for music and presents several useful charts and other visualizations of your listening habbits. You can "scrobble" songs (i.e. have track them) you listen on your desktop or stream through their online radio.
  • Pandora-FM: this bridges Pandora and together allowing you to scrobble your Pandora listens to your profile. This was pretty useful since I'm often listening to music on Pandora and would like to track my listening habits (e.g. my most popular artist/track in the last week) with
I hope to get around to writing up a longer post comparing some of these services. And I'll update this entry with more links as I find them. Happy Listening :)


Wednesday, January 28, 2009

Silly PHP, Trix are for Python

I just discovered that when calling a PHP function, you can't specify functions by parameter name. This is really annoying when you're calling a function with several default parameters and you just want to change the last one. Since you can't just specify the one you want to change by name, you need to include all the other default parameters in order and just change the one parameter you care about.

Case in point, if you want to call htmlentities with $double_encode set to false and the other default parameters unchanged, you have to write

htmlentities("myhtmlcode", ENT_COMPAT, "ISO-8859-1", false).

This is phenomenally absurd. Makes me miss Python... :(