Tuesday, June 29, 2010

12 years, 1 day

That's right - I've been married 12 years and 1 day.

I'm the one who likes to share my whole life; while she'd prefer if her name remained off the Internet altogether.

So I won't use this space to share intimate details and gush about what a wonderful wife I'm married to.

I'll just say this:

I sure am glad I didn't think long and hard about marrying you honey! Thanks for being the perfect partner to go through life with.

There, that wasn't so painful, was it?

Advertising with Chutzpah

The other day I'm reading e-mail in Google Apps and see the following ad:

I love it!

It's actually a similar philosophy that my own company takes (there are tons of low cost developers out there; we're all about happy customers and on time projects!) - but I've never quite put it that bluntly.

Kudos to them!

Get Your Daily Dose Of Wimbledon

Shira's a big fan of watching tennis and Wimbledon. I was curious about the best way she could keep up with the games (as they aren't included our Cable package), and it turns out there's a whole bunch of live streaming options. Specifically, we've found LiveScore Hunter to reliable.

Another option is to check out UStream.tv. I've found that whenever I want to track down an event being shown on TV, inevitably someone is streaming it there. And the best part? There's an Android App for watching UStream streams.

See, check out live Tennis on my MyTouch:

I'm sorry - but that's just amazing. Live TV being streamed to a website, which in turn is being streamed to a handheld. There's about 1000 places that could fail, and yet it works.

I suppose this same hack works for the World Cup or any other sport you want to keep up with.

Sunday, June 27, 2010

Seeing The Monuments and Cousins At Night

Last night, David and I ducked out of the house and met our cousins from NY down on the DC Mall. Last time I did the Mall at night, there was freezing rain and not a soul to be found. Last night, it was hot and muggy and the tourists were out in force.

It was awesome to get to see family, and the monuments continue to inspire and amaze. Especially at night.

David suggested seeing the Korean War Memorial at night - and boy was he right. As you can see from the statues of the soldiers, it's really gorgeous at night.

Friday, June 25, 2010

Two Android Swype Tips

My first impression of Swype, the keyboard input method where you drag your fingers between the letters you want typed, was that it would be slow and error prone. Still, out of curiosity, I tried the tutorial.

Turns out, it's nothing short of magic - and works remarkably well. In fact, I just used it to crank out my first mobile blog post.

Here's a couple of tips I've figured out:

  • Don't try so hard - Unlike your typical hunting and pecking on the virtual keyboard, accuracy isn't as important as you think it would be. You don't have to drag to each letter. With just about every word I enter, I'm impressed at how it correctly interprets my sloppy drawing. I thought this to be the case, but Christian Cantrell really emphasized this point to me.
  • Don't attempt to treat the Swype keyboard as a standard one - I didn't realize until a few minutes ago that there's a Swype keyboard on the system and a regular virtual keyboard. Apparently, when I got the phone I switched to Swype mode and stayed there. Trying to use the Swype keyboard as a typical hunt and peck style is a bad idea. I couldn't understand why when I slowly entered letters I was getting all sorts of strange behavior. To control which keyboard is in use do:
    1. Long press while in a text field
    2. Select Input Method
    3. Select the keyboard you'd like to use

Happy Swyping!

Who's having more fun?

The 10 month old or the "adult" who setup the zip line for his toys?

No wonder Shira gets nervous when our little one stays home from daycare and I'm in charge.

Thursday, June 24, 2010

Tracking myTouch 3G Battery Usage

I'm slowly but surely growing attached to my new myTouch. I love the faster processor on the phone, and continue to adapt to the keyboardless design (love that voice dialer!). But, I'm unimpressed with the battery life. After 11 hours of being unplugged, the battery was just about dead.

Compare that to Shira's BlackBerry which goes days and days on a single charge.

Rather than just kvetch about this problem (or buy an extended battery - which I'll no doubt eventually do), I was surprised to learn that I can actually diagnose what's chewing up my battery life.

From the home screen, I accidentally found that I can do:

  • Settings
  • About Phone
  • Battery use

I then see a breakdown of how the battery's being used. In my case, I was surprised to learn that 28% of my battery was being sucked up by the Weather.com Weather Widget. Now I love knowing the weather as much as the next guy, but it's certainly not worth sacrificing battery life over.

Checking it just now shows that Scanner Radio has used 19% of the batter life since my last plug-in. Thing is, I'm not currently running the Scanner Radio app - or at least I don't intend to. It must be still running as a background job.

Perhaps it's time to install an app to monitor and kill unneeded processes.

Even if the battery life isn't great -- being able to explain why is just huge.

So long myTouch Slide, Hello myTouch

I came back from our recent trip to find that when I closed the keyboard on my G1, it would turn off. This made using the phone just a little tricky. So I did the only reasonable thing - I went out and bought a myTouch 3G Slide. Out of curiosity, I gave T-mobile a call and asked about having my G1 repaired.

Shocker #1: My G1 was still under warranty.

Shocker #2: After describing the issue to T-mobile they said they would be glad to send me a replacement phone.

Shocker #3: The T-mobile rep explained that inventory was running low on G1's and if I'd like, they'd be glad to send me a replacement myTouch 3G.

While the myTouch 3G isn't nearly as fancy as the myTouch 3G slide, it's still leaps and bounds ahead of the G1. They made me an offer I couldn't refuse.

With a new myTouch, I decided it was in my best interest to go ahead and return the new Slide. The obvious reason of course is cost. If I can use the myTouch for just a few months, chances are the Slide will come down in price. Or, another possibility is that a follow on model to the Slide comes out, and I can go ahead and upgrade to that one.

I also had another reason for returning the Slide: I wanted to experiment with owning a phone that doesn't have a QWERTY keyboard. My expectation is that I'll hate this -- but I think it's important to at least give the approach a try.

In some ways, the experiment is working out. I've been using the voice dialer and voice search, and I'm very impressed by both. I've also been using swype - which is nothing short of amazing. From the description of it, I expected it to be a zero, but it actually works amazingly well. Turns out, the only type of input to the phone that I find gives me issues is the standard virtual keyboard.

All in all, I feel like I took 10 steps forward with the Slide and then 8 steps back with the myTouch. But, having an opportunity to play with a new phone, and knowing that an upgrade isn't too far off in the future makes it all worth it.

Tuesday, June 22, 2010

Listening in on the fuzz

There's something just a little bit exciting and naughty about listening to a local police and fire radio traffic. I suppose it's a form of voyeurism. Like all things naughty and exciting, you can do it on the web. I just found: RadioReference.com, which among other things has the live feed for Arlington County Police Dispatch.

See if your local area is covered.

I actually found the site while looking around the Android Marketplace. Scanner Radio turns your handset into a scanner. It works remarkably well.

It would be kind of freeky, at say a traffic stop, to listen in on the radio traffic as they check my tags. Hmm...maybe there is a functional use for this technology after all.

Maybe this will help me avoid an appearance on the TV show Cops...

Review: If You Walked In My Shoes

I picked out the audio book If You Walked In My Shoes, By Gwynne Forster using the 9 Month Method. That is, our 9 month old knocked it off the shelf while I was hurriedly picking out a book-on-CD, I grabbed it and fled the library.

I was almost immediately disappointed by the book. The book starts off with heavy and traumatic stuff - both rape and abuse. Yuck. But, I really don't like to quit a book without giving it a chance. And so slogged on. (Of course, it's not the author's fault the material was so heavy -- that's what I implicitly signed up for when I rented the book.)

As the book proceeded, I liked it less and less. Shira pleaded with me to return it, rather than here me complain about it. But, I stuck with it.

In the first few chapters of the book, the setup is complete: you've got a successful social worker who 30 years ago gave up a child after she was raped, and you've got her child being placed in an abusive home, who seeks revenge on the mother who gave her up for adoption. It contains exactly the misunderstandings and confusion you'd expect. Other than a moment where the whole setup clicked for me, there were essentially no other surprises in the book.

The message of the book is spelled out in the title -- if each of us were in the other's place, our behavior would make sense. Oh, and vengeance is a bad thing too.

While I could complain about the book at length, there really are only two egregious issues:

  1. The main character, the one who gave up the child, is supposed to be the world's greatest social worker (hence her rocketing to fame). Problem is, the way she behaves at work - especially to a rape victim she encounters - is reprehensible, and probably criminal. I could suspend disbelief for quite a few parts of the book, but the notation that this character was a word renowned social worker was too much to swallow.
  2. Perhaps the bigger issue is that it's written with a sort of Soap Opera style of writing. One of the marvels of a show like Days of Our Lives (and don't ask me how I know this) is that the plots are summarized every few minutes so that new viewers, or viewers who missed episodes, can come up to speed immediately. That's got to be one of the reasons Soap Operas are so addictive. You can always jump in and start following along. And so it was with this book. Every few minutes (remember, I'm doing the audio version), the author would restate the character's positions. It's as if she didn't trust her readers to read the entire book, or to be able to connect the dots. I get it -- the main character is scared of being exposed. You don't have to remind me of this every few minutes. I go it.

Bottom line -- this probably could have made a fairly novel short story. But as a full length novel, nope. It's got an interesting start, a long and exhausting build up, and a climax that just leaves you wondering why you sat through hours of the book.

Pass on this one.

Monday, June 21, 2010

Review: Game Theory: A Very Short Introduction

I stumbled on Game Theory: A Very Short Introduction while updating my wishlist. It was at the local library, so on a whim I checked it out.

I'm glad I did - the book was absolutely fascinating. Unfortunately, I needed to return it before I had a chance to complete it. But, from what I read, I can say with real confidence it's a winner.

Game theory, a topic I know nothing about, studies different scenarios to find out what the ideal strategy would be. I can vaguely recall studying the Prisoner's Dilemma in school - but I can't recall anything more than the question.

The book itself is, as the name suggests, an introduction to the topic. It's written with a mixture of history, humor and facts. My only regret is that I didn't read through it with a notepad and pen, trying to simulate some of the exercises discussed. I plan to check out the book again (or just bite the bullet, and buy it off Amazon). When I do so, I'll plan to go slow and really wrap my head around the topics discussed.

I have a sense that the outcome of studying Game Theory may be similar to that of my study of statistics. As a programmer, it totally opened my eyes to a new form of problem solving. In the case of statistics, I realized that there's ways to tackle problems which are too large and messy to compute in perfect detail.

This book definitely piqued my interest on the topic of Game Theory, and so while I didn't get through it all - I can say it accomplished its mission.

Sunday, June 20, 2010

Notes and Thoughts From The Garden

A few random thoughts/notes from the hack & slash weeding session I just did in our "garden":

  • Finally gave the Beast -- our 8ft+ rosebush* -- a real haircut. It's amazing how resilient it is. Even if a branch contained mostly dried up leaves, it would still find a way to sprout new growth. Hopefully, whatever I trimmed off wasn't essential to its growth (cause, naturally, I don't know anything about what I'm actually doing in the garden)
  • Thought: why don't I plant weeds? If they grow, then I'm a successful gardener. If they die, I'm still a success. Sounds like a win-win?
  • Thought: the vines that quickly grow and cover everything in the garden (from the rosebush, to the hose reel). They are truly flexible and amazing creatures. See the previous point -- could I raise vines in my garden?
  • We have our first official item of produce -- a single pepper! See the photo below - it's gorgeous, isn't it? I wonder if the plan will produce a single pepper. There's got to be a more economical way to get peppers...

Note: these photos were taken with my new myTouch Slide. Not too shabby, eh?

*As always, thanks goes to Teresa for planting the rosebush in the first place! It must have been her original green thumb that's been sustaining it all these years.

Thursday, June 17, 2010

myTouch 3G Slide -- Some Initial Thoughts

Yesterday, I bit the bullet, and went ahead and upgraded from my beloved G1 to a myTouch 3G Slide. I've been waiting for a more powerful Android handset with keyboard, and the slide seems to fit the bill.

Here are some initial reactions:

  • I feared the 4 line keyboard would be a dud. It isn't. I'm going to have to rewire my brain a bit to make it work, but the keyboard is expansive and has an OK feel to it.
  • I think the camera may finally be one that takes reasonably good photos. I've only been waiting the last 10 years for a cellphone that could do that. (Meanwhile, the BlackBerry's have been taking fine photos for years. Go figure.)
  • I find the contact organization especially confusing. With the G1, it had contacts and they sync'ed up with my Google account. Now, there's Google contacts, T-mobile contacts, and SIM card contacts. What the?
  • Compared to the G1, this phone is definitely snappier. App switching, and just general navigation are much more responsive. The upgraded processor is definitely a big win.
  • Holy smokes, this phone blows the G1 out of the water. I guess I'm used to my Sidekick days, when an upgrade meant different hardware and a few feature additions. Not so here -- there seems to be a whole lot more going on here than with the G1. I'm actually surprisingly disoriented, and feel like I've got spend some serious time with this phone before I'm productive with it. Heck, I accidentally put a call on hold when I was just trying to mute it. With the G1, I don't think I had this kind of confusion at first.

I think that about summarizes it for now. Now, I need to actually take step back and try to learn the ins and outs of what the Slide has to offer. While disorienting, it is a fun position to be in!

Parenting Hack: Loyalty Card as Time Occupier

This morning I took our little guy with me to Shul. All told, the service is about an hour. In the past few weeks, I've just stolen a few toys from the pre-school setup they have there, and between that, and wondering around while folks pray, he's usually quite occupied and content.

Today, though, he was getting a bit restless, as he had already mastered putting the plastic dinosaurs in his mouth at every possible angle. One of the fellow congregants came over, and suggested a hack she likes to use with her grandchildren: she gives them a brightly colored supermarket loyalty card to chew on.

She produced a red one from Giant, and sure enough, our little man went to town on it. Between examining it, chewing on it, and practicing picking it up (a challenging exercise), he was kept entertained for what was basically an eternity (say, about 20 minutes).

I, of course, like that the hack is totally portable, and seems to be safer than chewing on metal keys or other odds and ends I have in my pockets.

The congregant also suggested that you can punch a whole in the card and use links to attach it to the stroller or car seat so when it gets dropped, it doesn't go far.

Like all hacks, I guess this one is obvious in retrospect. But still, anything that can keep a baby occupied for a few minutes is worth spreading the news about.

Update: Shira mentioned tonight the obvious point that the loyalty card sitting in your wallet is probably pretty grimy and not baby friendly. What I was actually suggesting was that you have a special card just for kids to play with -- this card wouldn't be run through magnetic swipe machines, or handed around to random cashiers. Sure, it'll get dirty -- but no more so than any other toy taken out into the wild.

Wednesday, June 16, 2010

Punta Cana - Club Med - Recap

Our first Club Med experience is now behind us, and I've got say, overall, it was excellent. Here are a few specific areas of note:

  • Accommodations: our room was quite livable, with a storage area to park the stroller, and a small side room that served as the temporary baby's room. It wasn't luxury, but it was more than sufficient. And, it was close by to the Baby Club, so getting access to the childcare facilities was amazingly easy.
  • Food: I really liked the food. There was only one dining hall open, but it managed to walk the line between serving as convenient cafeteria and elegant dining experience. The selection of food was impressive, with always plenty of vegetarian or fish options. And the fresh fruit - yum! I'm not much of a foodie, so I can't really say the quality was amazing -- but I was certainly left satisfied after every meal.
  • Child Care: This is truly where Club Med shines. The child care was outstanding. The amenities like having a stroller in our room, or 24hr access to kitchen facilities for cleaning bottles was super. But what really impressed me was the staff on hand to run the Baby Club (the name for the baby sitting service offered during the day). Each one of them treated our little guy with such love and care, it's like they had known him for months, not hours or minutes. Our little one truly had a fun time with them, and they made sure he always had plenty to do.
  • Service: If there's one area where Club Med could use some work, it's in their general responsiveness. I think the key issue here was that of a language barrier. Apparently Club Med is a French organization, and Punta Cana especially attracts the French crowd. The result is that the natives speak Spanish, and the Club Med'ers mostly speak French. We had to ask 3 times before our request to have the Pack-n-Play exchanged for a new one actually happened. The first time we made the request, we got a knock at the door at 9pm (hours after we placed the request, and into sleeping time, of course) to provide us with materials to make up the sofa bed. Huh? Once the request was finally understood, it was taken care of beyond our expectations.

    Keep in mind, the language barrier isn't prohibitive. People still speak English, and at no time did we find ourselves truly limited. It was just odd to be in the dining hall and have to point and grunt to communicate with those serving the food.

  • All Inclusiveness: Our past experience with an "all inclusive" vacation was that of a cruise. Sure, the cruise was labeled all inclusive, but in reality, it wasn't. Daily gratuity charges, soda and other drinks, fancier dining options and pretty much any other area they can get you on, they would. Not so with Club Med. The one fee really did cover everything you'd need to have a complete vacation - including drinks (alcoholic and non) and activities. We only opened an account when we realized we'd need to buy another batch of sun block. There's definitely opportunities to spend money, but unlike a cruise, you won't have to.

All in all, the vacation was an excellent one. I really can't recommend it enough if you've got kids and are looking for a trip that the whole family can enjoy. After last week, returning to the real world is going to be tough. I sure will miss my daily guava smoothie!

Tuesday, June 15, 2010

Punta Cana - Club Med - Day 7

And so our trip has come to an end. I'm tapping out this blog post with a sleeping baby and wife, as we make the final leg of our journey from Charlotte to DC.

The last few days were enjoyable ones. Most of our time was spent around the kiddy pool and playground, so I don't have much in the way of new photos to post.

I did however, get in a solo-sailing adventure on one of the Laser's the Club has. What fun! What a rush! Given our brief lesson, and my sailing merit badge from years ago, you can describe my little sea excursion as 75% chaos, 24% luck, and 1% skill. I'm proud to say that not only did I capsize the vessel, but I was able to right it all by myself. Somehow I made it out to sea and back home again - the details of which are still cloudy to me. But I know I had fun.

Another highlight of the last few days was getting in a 3am walk through the resort thanks to a sleepless little boy. It really was a treat. The place was remarkably quiet -- with only a couple of security guards about. Compared to the heat of the mid-day sun, I'll take the perfect calm on the beach in the middle of the night any day.

Here are a few last photos:

Here we are - the boy is in day care, and we're chilling at the pool and playing some serious ping-pong. We really know how to live it up!

Here's a couple snapshots of the grounds taken around 3:30am.

Here I am, blindly leaving our bags at our door, assuming that someone will swing by and pick them up.

The Punta Cana airport is absolutely adorable. Half of it is open air, where there's nothing separating you from the hot tarmac and your gate waiting area. The other half is air conditioned, where we waited. Though, when boarding time arrived, we trudged along outside the length of the airport to stairs leading up to our jet. Below is a snapshot of us mid-boarding procedure.

Sunday, June 13, 2010

Punta Cana - Club Med - Day 6

Apparently, I'm allergic to paradise -- within the last 48 hours, I've managed to get covered head to toe in some sort of rash. Luckily, it's more humorous than anything else, and it's probably just a result of using different sun tan lotion than I'm used to.

Today was very much a chill day (I suppose, like every day here at the resort). We spent time at the pool, and our little man really enjoyed it. With his float, he was literally able to run around the shallow end of the pool. It was quite a sight to see.

Here are some photos from the past few days:

Here we are showing off our archery skills. I felt like I was back in Boy Scout camp with this activity.

Here I am in front of the world's largest luluv palm branch. Think of the etrog that goes with this sucker!

Ahhh, a view of paradise. The walk on the beach just never gets old.

Here I am in the Mystery Door. The door and door frame are randomly placed here and there's no sign explaining why. A couple guesses: (1) it's part of some sort of art exhibit (2) it's an original door to some important building which is no longer. Either way, it's funky.

Child care here at the resort really has been top notch. The staff are absolutely wonderful with our little guy. Though, there are some obvious differences between what we're used to and the European style child care they offer here. A few examples: (1) our pack and play has both a top sheet and blanket included in it (which the maid dutifully makes up every day, even though we take it away because of the Sids danger it presents) (2) dinner opens at 6:45pm -- early for the European crowd, but 15 minutes before our little man's bed time. And (3) below, you can see the food they offer in the baby room -- there's baby food, 4 sugared cereals and 1 "fitness" cereal and Oreos. Apparently, the health kick Americans are on doesn't extend to the other side of the pond. And how can they not offer the ubiquitous Cheerios?

Shira at the play ground, keeping a watchful eye on both myself and the little guy.

Friday, June 11, 2010

Punta Cana - Club Med - Day 4

The daily grind at club med continues. We're still having a blast, and almost have something resembling a routine. It occurred to me earlier that I haven't worn shoes, carried a wallet or touched a cell phone since we arrived. This is a lifestyle I could get used to. Here are some photos from our day.

They're all pretty self explanatory, except for the one of me drinking from the coconut. I was all proud of myself for scoring one of these from a table outside the dining hall. When I asked what was inside, I was told, "agua." I'd have to disagree. It was unlike any water I ever tasted. I'm not sure what the point was, but I'm starting to think that whatever it was, it wasn't meant to be drank. All part of the adventure.

Thursday, June 10, 2010

Punta Cana - Club Med - Day's 2 & 3

As you can see, life is really rough here in Club Med....

Shira taking a dip in the pool. The temperature was perfect - refreshing, but not chilly in the least.

Shira getting sailing lessons. She's a pro already!

Ben getting sailing lessons. His sailing merit badge, and Mr Smally's advice definitely came in handy!

Shira and the boy on the beach. I'll stop posting photos of the beach, once it stops looking like a little slice of paradise to me.

Fishies from a snorkeling adventure Ben had. The quality is pretty awful, but what do you expect from a $20.00 underwater digital camera.

We're off to have our next adventure!

Tuesday, June 08, 2010

Punta Cana - Club Med - Day 1

Whoo! We made it to Club Med in Punta Cana, Dominican Republic -- the site of our next travel adventure. The flights here were painless, even with our little guy.

On the 3 hour leg of the flight, the ticketing agent gave us 3 seats together, rather than the two we purchased -- and this turned out to be a gift bigger than an upgrade to first class. Having that extra seat to allow our little one to roam, made a huge difference. Him sleeping for an hour and a half didn't hurt either.

The Punta Cana airport was adorable. In theory you had to clear customs, though, I couldn't tell when we actually did so. It was just super laid back.

And as for Club Med -- well, to be perfectly honest, it feels tad bit overwhelming. I feel like a Freshman in college where I've missed the orientation, and everybody else knows what they are doing. But, the campus really is beautiful, the activities seem like they’ll be tons of fun, the baby sitting setup is quite impressive and I could really get used to this walk into a restaurant and eat and drink anything you want, and not pay a dime routine.

I’m excited to get into the swing of things tomorrow and hope we can really soak in some rays.

Some photos from the day...

Oh fooey, a bathing suite is required in the pool. Oh well, I'll have to come up with some new swimming plans.

This place really does look like a manicured paradise

A night shot taken right outside our room. This place is just so peaceful.

Punta Cana - Getting There

Our latest travel adventure has begun! So far, we've made it unscathed to Charlotte, where we are meeting our connecting flight.

Our little guy did great this last flight. He was quite active while on the taxiway, but finally succumbed to exhaustion once in the air. He then slept the entire flight, the landing, the deplaning, the walk through the loud terminal and finally to our next gate. Man, was he wiped this flight. And so was I.

Now, on our next flight everyone is going to be plenty rested. Gulp. I have a feeling Shira and I will be working overtime to keep him occupied.

All part of the adventure, I supposed!

Monday, June 07, 2010

Music Group Of The Day: Bajofondo

I'm not quite sure what inspired me to search for Tango music on YouTube, but of course there was no shortage of tunes to listen to. While bouncing from song-to-song, I came across a most unusual sound: Bajofondo.

The group was playing something definitely Tango'ish, but it was mixed with electronic music and other influences. It was an unlikley combination, but one that totally works.

Give them a listen, and tell me you don't want to go out and take dance lessons?

Listen to more songs by Bajofondo.

Friday, June 04, 2010

Friday Funny: Cheesiest 80's Music Video. Ever.

I submit to you my recommendation for the Cheesiest 80's Music Video Ever. How could such a sing-out-loud song have such a dreadful video?

Or, maybe I should be asking: was this cool in the 80's?

Anyone have any suggestions a music video that's cheesier?

The PHP Template Pattern -- PHP As Its Own Templating Language

A while back, I read PHP Templates: Smarter Sans Smarty, and was immediately impressed. The article makes the case that rather than using a separate template language (like Smarty), one should use PHP itself.

Or, put another way - don't use a Domain Specific Language, when the language itself will do the trick.

Even cooler than the argument put forth , is the code provided to make this functionality painless to use. The core apply_template function is so elegant, in fact, it deserves to be repeated here:

/**
 * Execute a PHP template file and return the result as a string.
 */
function apply_template($tpl_file, $vars = array(), $include_globals = true) {
  extract($vars);
  if ($include_globals) extract($GLOBALS, EXTR_SKIP);
  ob_start();
  require($tpl_file);
  $applied_template = ob_get_contents();
  ob_end_clean();
  return $applied_template;
}

Since reading this article, I've used the above templating patterning in a variety of scenarios, and I'm consistently impressed with how well it works. I love that the HTML templates give me access to not only simple variable substitution, but also the full power of PHP, such as conditionals and calling additional functions. I especially like how cleanly templates can nest within each other. All it takes is a call to apply_template from within another template. Templates even managed to leverage local variables well.

I just love pithy solutions like this one.

Review: Emergency: This Book Will Save Your Life

Emergency, track's Niel Strauss' attempts to prepare himself for TEOTWAWKI - or in laymen's terms: The End Of The World As We Know It. In doing so, he tries out every strategy he can get his hands on - from attaining dual citizenship, to learning wilderness survival. Heck, he even goes as far as attending a cryogenic freezing seminar.

For quite some time, this book kept me guessing where he was going with this quest. It became obvious in a hurry, that Emergency isn't a How To book. While Strauss learns all kinds of new skills, the book doesn't attempt to teach them in any depth.

My next thought was that the book was serving as a sort of introduction to the survivalist movement, and how you'd be a fool not to see the signs that society is crumbling. I got pretty frustrated with this theme, as I think much of the evidence he presents is pretty weak. For example - he suggested the retina scan behind Clear Card is some sort of ultimate government Big Brother program. When of course, it's just an accurate way to record your identity.

In the end, though, the book is really much more positive than that. I don't want to ruin the end of the story, so, suffice to say, the quest is a long one - but one that's worth following to the end.

Suffice to say, the book was a lot more thought provoking than I thought it was going to be. If you're looking for a guide to surviving the apocalypse -- this isn't it. If you're for a story about improving your life in unexpected ways, well, then, this book is worth a read.

Wednesday, June 02, 2010

Need a recommendation: Auto Mechanic in Norther Virginia

Howdy all - my brother is looking for a reliable auto mechanic in the Northern Va area:

Anyone know of a good mechanic in the Arlington/Northern Virginia area? I'm not looking for special deals (I know cars repairs can be expensive), I'm just looking for someone I can trust when they tell me it'll cost $X to fix my goblygook valve (or whatever).

Personally, we still take our Acuras to dealer we bought them from (I know, I know -- that's the expensive way to go. But, we're so happy with their service, have had few if any problems, and they're open till like 2am. If it ain't broke, we aren't fixing it.).

So, anyone have any suggestions?

Another Wishlist Hack - Amazon and your Local Library

A while back, I mentioned a new approach I was taking to keeping my wishlist up to date. Lately, I've added another dimension to this.

In the past, when I saw or heard about a book that interested me, I'd jump on Amazon and add it to my wishlist. It was a simple procedure that kept me from buying dozens of books, yet, made it so that if someone wanted to give me a gift, they'd know exactly what interested me. And if I ever did decide I really needed the book, I'd know exactly where to find it.

Lately, though, it occurred to me that the first thing I should be doing is searching my local library's catalog (in Arlington's case, it's here)*. If the book is found, I now pop over to Amazon and add it to a newly created At The Library wishlist. I keep this list private, and when I'm ready for something new to read, I can just consult it.

Using an Amazon Wishlist is nice because it let's Amazon do all the work of remembering the book, as well as recording all the details such as author, and title. Its also serves as a handy way discover related books, and which in turn, can be searched on the library site. Finally, if a book is worth buying, the wishlist functionality makes it trivial to move it to your public wish list.

In hindsight, this strategy is obvious. But, it can take a few minutes to setup the wishlist and the Amazon account -- it's definitely worth it. I also thought about automating some of this. But, given how quickly I can search in both the library and on Amazon, it just didn't seem worth it.

*You do have a library account, right? I can't think of a more useful government service. Talk about tax dollars well spent. Go get a card today if you don't have one. But of course, you do.

Tuesday, June 01, 2010

Gotcha Of The Day: Working with Namespaces in ActionScript XML

ActionScript 3's XML handling is pretty dang impressive. Gone are the days of manually iterating through nodes. Now, you can seamlessly access elements and attributes like any other variable.

So, you can imagine my confusion when this simple XML document wasn't behaving:

<?xml version="1.0" encoding="UTF-8"?>
  <tt xml:lang="en" xmlns="http://www.w3.org/2006/04/ttaf1"  xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling">
      <body>
           <div>
              <p begin="00:00:00.50" dur="500ms">Hello</p>
              <p begin="00:00:1.28" dur="500ms">World</p>
          </div>    
      </body>
  </tt>

I should have been able to execute:

 var doc:XML = new XML(...);
 trace("number of items: " + doc.body.div.p.length);

Instead, body was always null, causing the above expression failed.

The issue at hand turns out to be the XML namespace http://www.w3.org/2006/10/ttaf1. In order to access the various elements from the document, technically, I'd need to use their complete name -- which includes the namespace.

Some folks go as far as pre-processing the XML document and stripping out any namespaces. While tempting to do in the heat of the moment, I thought there had to be a better way.

And there is -- if you have a document with a single namespace, you can set your default namespace once and access it as you normally would.

So the above code became:

 var ns:Namespace = new Namespace("http://www.w3.org/2006/10/ttaf1");
 default xml namespace = ns;
 var doc:XML = new XML(...);
 trace("number of items: " + doc.body.div.p.length);

Problem solved, and I didn't have to do any regular expression hackery to get the job done.

Theodore Roosevelt Island - The Perfect Morning Oasis

They are calling for a hot and humid day, with thunderstorms in the afternoon. Which meant, if I wanted to get out of the house today with the little guy, it was going to have to happen first thing in the morning.

So, we jumped in the car and in a few minutes arrived at Theodore Roosevelt Island. We walked the perimeter of it in about 30 (or was it 45?) minutes.

I just love TR Island -- it's so calm, peaceful, and with perfect shade from the morning sun. You can get that wilderness hike feel, without actually having to go into the wilderness.

See, it was the perfect day to get outside:

Here's the Moby-eye-view of the trail.