Sunday, May 3, 2009

Switching to Mac

After a couple of years of thinking I should get a Mac laptop for myself, I finally bought a MacBook Pro. Of course, the first thing I needed to do was copy my music over. This was way more annoying than it needed to be, and the various instructions on the Internet all disagreed with each other. It eventually took up most of Saturday, and it's fairly lame iTunes doesn't support better cross-computer syncing. What ended up working:

1. Turning on remote login on the Mac, and using WinSCP to copy the files over. (The Mac couldn't find the PC's Samba server, and the last time I tried PC copying to a Mac samba share, a bunch of file names with extended characters caused trouble). The copy was also insanely fast connecting the laptops directly with an Ethernet cable.
2. Run iTunes once on the Mac but don't import anything, then quit.
3. Export library... on the PC and then copy Library.XML over to the Mac
4. Open Library.xml in emacs and replace all the file://localhost/C:/My%20Documents.... paths with file://localhost/Users/kushal/Music
5. Overwrite iTunes/iTunes Music Library.xml with my Library.xml file
6. cat /dev/null > iTunes Music Library
7. option-click on iTunes icon so that it lets you Choose library...
8. Choose iTunes Music Library
9. Because the file is corrupt, it restores from the XML file
10. Voila! Playlists, ratings, and play counts are all there. The only things that didn't make it were my podcasts, not really sure why, but I just did Add to library... and then resubscribed. There may or may not be a few other songs missing.

I think this might have been smoother if I had done "Consolidate music" in iTunes on the PC before copying, but it claimed to not have enough hard drive space? I think as long as the consolidate/organize settings are consistent, things work out okay.

(Thanks to Mihai and Dolapo for walking me through this! :) )

Monday, April 27, 2009

Japan in no particular order: Manners

Vending machines are everywhere.  So you're never far from a Pocari Sweat or Amino Supli.

Late in the game, Emma and I discover that the following things are considered rude:

  1. Blowing your nose or sneezing in public
  2. Wearing sandals barefoot without socks
  3. Eating or drinking while walking

Good thing we are doing them constantly. Oops! Sorry Japan!

The second of these is pretty unfortunate given how hot it gets. And the third is super-strange given the ubiquitous soda vending machines. It explains the lack of trash cans, though.

Saturday, April 25, 2009

Japan in no particular order: Baseball

IMG_0232

After Lonely Planet tells us that there are "beer girls with kegs strapped to their backs," there is no question we are going to the game. Luckily, the Yakult Swallows suck, so the ticket prices are cheap. (ticket girl: "You want to sit on the *home team* side?"). On the way in, we pick up sake and edamame, which you are allowed to bring in. The game starts out normally, and (phew!) there really are keg girls.

Then crazy things start happening. The other team has carefully-coordinated cheers involving sitting down and standing up and colored shirts and singing. The third batter comes out to Toto's Africa (homage to the Japanese toilet manufacturer?). The next batter opts for Carmina Burana. When the Swallows score, every other fan busts out a pink or blue clear plastic umbrella and thursts it into the air. There are cheerleaders, but in conservative outfits. There is a mascot dressed as a Swallow. When the Carp finally score, they inflate thousands of balloons shaped like sperm and release them all at once.

The Swallows pull off a surprise victory, due no doubt to our keg-girl-beer-fueled cheering.

Monday, February 16, 2009

More fun with TGUPT

I've been meaning to hack up a quick straight men-vs-straight women comparison, and I figured there was no better way to honor our Presidents than by finally getting around to it. enjoy! and take the test if you haven't already!

New digs!

Fwd: apartment pics!

I've failed to post about my new apartment, or about how awesome life has been since Emma moved in with me. This is probably because we've been so busy unpacking and furnishing and painting. Some things have gone well: the new neighborhood is much better for eating and subwaying than the LES, the view is amazing, the kitchen is a pleasure to cook in (garbage disposal!), Elfa shelving is relatively easy to install. Some things have been tricky: Wells Fargo freaked out at the last minute, Oz Moving ripped me off with charges for boxes, painting is way harder than anybody told us, brand-new apartments have kinks that require working out.


Fwd: apartment pics!


Last weekend, we had a housewarming at which copious amounts of alcohol were presented and consumed, much of it by people who bravely ventured across the bridge from Manhattan (or New Haven!). Luckily, this party was on Friday, leaving me well-rested to run the Bronx Half-Marathon on Sunday. 1:59:13 was slower than Brooklyn (and much slower than Brian and Monzy), but not bad considering how little I've been training. Later in the week, I purchased a bag of candy hearts and ate all 900 calories of them, undoing any potential benefits from the training.

Saturday, December 27, 2008

The Grown-Up Purity Test!


During the company ski trip last year, we somehow found ourselves taking purity tests, something we hadn't done since college. Much fun was had (at least until Akshay turned off the Internet in a fit of rage, and we had to score the tests using the Firebug console). Many, many drinks later, we somehow decided that what the world really needed was a hip web-2.0ish purity test, with keyboard shortcuts and big fonts and statistics comparing you to other test takers and fewer "have you ever held hands with a MOS?" type questions. So I registered tgupt.com for The Grown-Up Purity Test (pronounced tee-gupt) and figured it couldn't take more than a weekend of hacking to do.

Since it's now a year later, it's clear I severely underestimated what was involved. Writing the questions was surprisingly hard, and took a lot of feedback and help from various folks, especially David. I'm still not 100% happy with them, but this project has dragged out much longer than anything this frivolous and puerile ever should.

<technical details>
Also tricky was figuring out how to work around the limitations of the App Engine data store. In a relational database, it would be pretty easy to go from normalized data to selecting the mean score for some demographic group. But App Engine doesn't offer aggregation functions, doesn't do joins, and doesn't fetch more than 1,000 rows. I ended up doing several writes on each answered question and each finished test. If a 27-year-old male answered yes to Question 1, I write the following:

AggregateQuestion
Question 1, Yes: 1, Total: 1
Question 1, Gender: male, Orientation: straight, Yes: 1, Total: 1
Question 1, Gender: male, Orientation: straight, Age: 27 Yes: 1, Total: 1

Initially, I thought I would have to store all combinations of gender, orientation, and age as separate aggregates to future-proof myself for any graphs I might want to make. This was really slow, especially with atomic writes. Then I realized that for attributes with few possible values, like gender and orientation, I could fetch, say, both the male and female values from the datastore and combine them in the application code to create a gender-neutral statistic as needed. For overall scores, I updated both a global mean as well a set of score buckets in order to make histograms easier to generate. There's more discussion of these sorts of solutions here and here. You can check out the TGUPT code at code.google.com
</technical details>

Anyway, go take the test and let me know what you think.

Sunday, October 12, 2008

Animals in streets

I've been up to various exciting things lately, like Austin City Limits and running a half-marathon this morning (albeit verrry slowly). But at the moment I really want to discuss pictures of animals in streets. So far I only have two of them. But they make me giggle. Please share more.