Wednesday, November 14, 2007

Google Maps for iPod Touch!

When I got Mel an iPod Touch for her birthday, I knew that the awesome Google Maps app for the iPhone wouldn't be on there. But I didn't know how poorly the Google Maps website would work on the iPod Touch -- dragging the map doesn't work, and all the navigation controls were too small and hard to hit with my finger. It also didn't redirect me to a more appropriate mobile version, and after hunting around for the super-stripped down version, I found it was, err, not "cool" enough for the friggin' iPod Touch! Google Maps Mobile also unfortunately doesn't work on the iPod (no Java :'( ). So I set about writing my own Google Maps interface for iPod Touch with the Google Maps API and the Google AJAX Search API.

I really wanted to be able to drag the map around on the iPod Touch; otherwise, it seems like such a waste of the touch screen! Unfortunately, as I understood it, the webpage doesn't get the normal drag events at all. After hunting around for a while, I found Mihai's attempt at writing a scrolling game for the iPhone and learned that though you don't get the single-finger drag events, you do get two-finger drag gestures, intended to scroll scrollable divs within a page, as scroll events. I placed the Google Maps container inside a scrolling div half its size, so you can "kind of" drag the map around by actually scrolling the containing div. When you scroll to the edge of the div, it resets the scroll position and recenters the map (almost seamless with a fast wifi connection). That works pretty well. (I've also tried translating all scroll events to map.panTo, but it was way too jerky on the iPod to be useful)

I store recent geocodable addresses in a cookie. When you want to go somewhere, you can either type it out or pick it from a drop-down box -- the iPod Touch Safari browser has a pretty nice interface for picking an item from a <select>.

Anyways, here it is! Check it out at www.grapier.com/maps.html. Here's how to use it:


  • Drag the map around using two fingers
  • Zoom in and out using the buttons on the upper left
  • Switch map type, or toggle traffic overlay using the menu on the upper right
  • Go somewhere, get driving directions, or search for businesses using the menu on the lower left
  • Paginate through local search or driving direction results using the left and right arrows on the bottom right. Hit the "X" button to get out of the search.
  • Set a business result as current location by using the pin button on the lower right after you've done a local search. You can then get driving directions to there as usual.
  • Open a more detailed page on a business by using the pop-out button on the lowe right after you've done a local search.
  • See all directions or local search results at once by scrolling down below the map after you've done a search.

Tuesday, October 2, 2007

Radiohead releases new album!

Titled "In Rainbows", it will be available for download on October 10th, 2007. The track listing is amazing. Radiohead play-tested many of them on the road in a global tour last year; here are their videos.

CD 1

15 Step -- extremely groovy


Bodysnatchers


Nude, aka Big Ideas (don't get any) -- an old, cult-favorite that was first played live, twice, in 1998, and then never again. One of my favorite Radiohead songs!


Weird Fishes/Arpeggi -- the first song of this album that Radiohead started playing live


All I Need


Faust Arp -- no one has any idea what this is

Reckoner


House of Cards


Jigsaw Falling Into Place, aka Open Pick


Videotape -- super beautiful


CD2 (only available in the Discbox set)

Down is the New Up


Go Slowly


Last Flowers


Up on the Ladder


Bangers and Mash -- not such a big fan of this one


4 Minute Warning -- amazing

Wednesday, August 29, 2007

I'm search-engine optimized!

Wow. Try a Google search for "existential blogs". Scroll down the page. ZOMG I'M THE TENTH RESULT!!1

Now, try a Google search for "funny existential blogs". Chances are, this blog will come up as either the first or second result!

Amazingly, this blog is already search-optimized for the keyword "existential"! Holy shit. Incredible, considering how commercial a keyword "existential" is. You'd think all the merchants would be jumping on that.

In fact, this awesome placement on Google is so effective that, just LAST MONTH, the phrase search for "existential blogs" got me TWO referrals from Google! It's a wonder I'm not already a millionaire off of this extremely well-run and interesting blog.

Saturday, August 25, 2007

The Road to Cup-a-mochi-no

A few weekends back, a few of my Google friends held a dessert-making contest. I used to bake a little bit (way back in high school), and decided to take a shot. Armed with what little baking knowledge was left in me, and a manic devotion to all things mochi, I created the Cup-a-mochi-no. It is -- yes -- a normal cupcake wrapped around mochi wrapped around red bean paste. It is topped off with coconut frosting and another dollop of red bean paste. And it's delicious!



The idea came easily enough -- mixing mochi with other kinds of pastry has, in the past few years, been on the forefront of Chinese-American pastry in bakeries all over southern California. In certain bakeries, you can find bread with mochi and cream, red beans or taro paste in it. And some places even sell birthday cakes that have a layer of mushi mochi in the middle of soft pound cake. It was easy to imagine such a creation, but shrunk down to cupcake-scale (though it was difficult to persuade Mel that this was a good idea!)

The whole thing is pretty straightforward to make, though very time-consuming. First, you make the red bean mochis.



The easiest recipe that I found online for mochi dough -- using sweet rice flour and a microwave and taking little more than four minutes -- worked out pretty well. Instead of using 1 cup of water, I used 3/4 cup of coconut milk and 1/4 cup of water. I bought some red beans paste from 99 Ranch instead of making my own -- the dessert is already too experimental without that! I tried to fine one with as little sugar as possible, but it was still too sweet to my taste. Next time, I'll probably make the red beans paste myself to have more control over the sweetness.

Fresh out of the microwave, the dough will be very hot and very sticky. Cover your hands, a flat board and a round roller with corn starch. Take little balls of mochi dough, flatten into wraps, insert a dollop of red bean paste, and pinch the wrap together. The wrap can hold more red bean paste than you might think -- the mochi is very flexible, so just stretch it a bit when you're pinching it close.



Next, I made the cupcake. I took this reference recipe, but cut the sugar in half (out of necessity -- I was out of sugar at that point!). I also substituted coconut milk for milk (probably not all that wise, but it turned out okay). Lacking any electrical beaters, I had to cream the butter by hand, which was hard work.


I put a spoonful of cupcake batter into the cupcake holder, plopped a piece of red bean mochi into it, and covered the mochi with more batter. Be sure not to fill it up too high, or it will overflow!



While the cupcakes are baking, I made coconut-cream frosting from this recipe. I used only 1/2 cup of powdered sugar, which was plenty. Put the frosting on the cupcakes once they're nicely baked and cooled.



Finally, decorate the cupcake with some toasted sesame seeds and almond slices, garnish with more red bean paste and some hint, and you're good to go!



We didn't win the dessert contest, but it was very yummy nonetheless :-) Here's the full slide show of pictures I took in the process. Enjoy!

Wednesday, August 1, 2007

FUTURAMA IS BACK

One of the most brilliant shows ever created, and then brutally canceled by FOX, may have life left in it after all!

Friday, July 20, 2007

Travel photos!

Randomly! Some travel photos of my recent travels... EXCITING!

First, a trip to Hawaii's Big Island with Mel at the end of April:



and a cool My Maps to go with it!

Next, a trip to China with my family at the end of May:



Pretty cool! But mostly, I wrote this blog post to test embedding Picasa web albums :-)

Monday, May 7, 2007

while (true) break;

This is the saddest and, therefore, the most beautiful of code fragments:

while (true) {
break;
}

First it starts with the promise of forever, an infinite loop with no end in sight. And then, abruptly, rudely, and immediately, all hopes are dashed and the loop is no more. You are transported suddenly from nothing, to everything, and to nothing again.

Radiohead captured the same beauty eloquently in Nude:

Now that you found it, it's gone
Now that you feel it, you don't

It's beautiful not just because it's ephemeral (what isn't?). Rather, it's beautiful because it's destroyed just as elegantly -- in a single word, in a single line of code -- as it was created.

Saturday, December 23, 2006

Sausalito & Muir Woods trip with Parents

We took our parents to Sausalito and Muir Woods when they came up in October. Some highlights:








OMFG THE PIRATES ARE ATTACKING0RZ!!!!11






At Muir Woods, there's this awesome plank of wood that a lot of ladybugs are inexplicably attracted to...


Yum!

Rest of the album here:

new blogger... and now in colors!

Blogger is out of beta! All sorts of cool features are included, like post labeling and an awesome new widget/template system that gives you drag-and-drop layout editing for the layman, and pretty fine-grained control (by editing an xhtml document) for those who want it.

In the process, they invented their own widget language for defining how widgets work. I don't know how wise that is, but it works reasonably well (if rather difficult to edit in the tiny provided textarea). I was easily able to show a clip of my Google Reader shared items thus: first, add an HTML/Javascript page element. Go to Google Reader, click on "Shared Items", click on "Put a clip on your website", customize your look and feel (I took away all styles), and copy-paste that HTML snippet into your Blogger HTML page element content. There's actually also a Blogger Feed page element for displaying feeds, but it can only show at most five items at a time from the feed (what's up with that?!).

I'm a bit saddened that there's no page element for showing recent posts like you could before. And the Post a Comment page is still, inexplicably, in a pop-up that totally doesn't follow the blog's styles. And I still hate writing blogs in these tiny textareas, though maybe I should start publishing from writely instead...

In any case, after some obvious amount of sweat and labor, I was finally able to gut one of the new Blogger templates and strip it down to the bare essentials with the beautiful Courier New font we all love and enjoy! And, for a bit of holiday fun, I went all crazy and added red to all the headings. It's mad, I know, I know. But I can indulge once in a while. It is the holidays after all!

Wednesday, May 31, 2006

patrons

wrote this silliness in an hour on the flight to Taiwan... In the manner of Socrates (maybe) etc. Yuck.


Man: Look at this glass of water. Are you looking at this glass of water?

Woman: Yes, yes. It's a glass of water.

Man: Precisely. Now imagine, for a bit. Just for a while, stay with me here.

Woman: I'm with you.

Man: Pay attention now.

Woman: I'm paying attention!

Man: Imagine that everything, everything is contained in this cup of water. This house. That tree. Three branches of our government. Mount Everest. The sun. The moon. You, me. The universe. Everything.

Woman: Everything.

Man: What did I say?

Woman: Everything.

Man: That's right, everything.

Woman: In that glass of water.

Man: That's right. So then, suppose I turn this glass of water upside down. What do you suppose will happen?

Woman: The water will pour onto the kitchen floor.

Man: Will it? But...

Woman: Don't do it!

Man: I won't do it.

Woman: I just cleaned the kitchen floor.

Man: It's just water, what do you care.

Woman: Don't do it.

Man: I won't do it.

Woman: I'm warning you.

Man: I said I won't do it.

Woman: Okay then.

Man: Well, as we were, suppose I pour this water onto the kitchen floor.

Woman: Don't do it!

Man: I won't do it!

Woman: You always say you won't, but you do, you will.

Man: No I don't. I won't!

Woman: It's hard to believe you. You have a... a history.

Man: We all have history.

Woman: But it's yours I'm talking about.

Man: What's so special about my history?

Woman: You have one... Not a particularly good one. A history of going back on your words, of not doing what you promised.

Man: Please list your examples clearly and succinctly.

Woman: Last night you said you'd be back at 10, but you weren't back till midnight.

Man: I couldn't.

Woman: You said you would.

Man: But I couldn't.

Woman: Then why did you say you would?

Man: When I said I would I didn't know I couldn't.

Woman: Then why say it if you didn't know if you wouldn't know you couldn't?

Man: Uh, what?

Woman: I'm just saying, don't lie to me. Don't say anything you don't know is true.

Man: Okay okay. I won't promise anything anymore.

Woman: Nothing?

Man: Not anything. I promise.

Woman: [content] Okay.

Man: Great! Now where were we?

Woman: You were promising not to pour the water onto the kitchen floor.

Man: Ah yes, and I won't. Why would I, in any case?

Woman: Who knows why you do anything. Sometimes you really puzzle me.

Man: Well there are many reasons why I would, in fact. It's fun. It's fun to see water flow, to see it crash against the hardwood floor, to see it splash. It's dramatic. It'd make quite a show, quite a show! Much more of a show than what we have now.

Woman: But you won't do it.

Man: [signaling audience] I'm sure these good folks would appreciate a good show.

Woman: But you won't give it to them.

Man: Indeed I won't.

Woman: Because you promised.

Man: That's right, I promised.

Woman: Well, good.

Man: Funny thing, this glass of water.

Woman: Why's that?

Man: So oblivious to its own fate. Does it have any idea that it is being suspended five feet off the ground, by me and my will alone, and that with a flick of my wrist it could lose everything it had?

Woman: It doesn't have anything. It's water.

Man: Yes, yes I know it's water. But suppose it's something else. Suppose it's not just water, that it's everything. Your dog, my cat, everything in the universe. Then what?

Woman: Then the universe shatters into a million pieces as it hits our kitchen floor.

Man: Yes, well, but... But there is no kitchen floor. The kitchen floor is in the water too.

Woman: Ah, ah, I see. And the glass container as well?

Man: The glass container holding the water is also part of the universe, and as such, is in the water.

Woman: Then as it falls... but gravity, and earth, all are in the water already.

Man: That's right.

Woman: As are you, the person flipping the glass.

Man: Correct.

Woman: Then who will flip the glass?

Man: Ah, ah. Do you see?

Woman: No.

Man: It doesn't really make sense, does it?

Woman: Not really.

Man: The problem setup really defeats itself.

Woman: Yeah... So... What's your point?

Man: No point, no point. It just makes for a good show. [pours glass of water onto the floor. Blackout.]