Friday, February 26, 2010

For The SciFi Fans: Containment, a just published novel

A little why ago I got a note in my in my inbox - my friend Christian had just officially published his first science fiction novel. Me, I consider that a pretty remarkable feat. Heck, I can't seem to find time to keep my inbox from overflowing, much less find the time to write a novel.

You can purchase an electronic version of book for $0.99 cents from Amazon, or read it for free on his website.

Here's the blurb of the book:

Containment

As the Earth's ability to support human life begins to diminish at an alarming rate, the Global Space Agency is formed with a single mandate: protect humanity from extinction by colonizing the solar system as quickly as possible. Venus, being almost the same mass as Earth, is chosen over Mars as humanity's first permanent steppingstone into the universe.

Arik Ockley is part of the first generation to be born and raised off-Earth. After a puzzling accident, Arik wakes up to find that his wife is almost three months pregnant. Since the colony's environmental systems cannot safely support any increases in population, Arik immediately resumes his work on AP, or artificial photosynthesis, in order to save the life of his unborn child.

Arik's new and frantic research uncovers startling truths about the planet, and about the distorted reality the founders of the colony have constructed for Arik's entire generation. Everything Arik has ever known is called into question, and he must figure out the right path for himself, his wife, and his unborn daughter.

Sounds like the real deal to me.

I know Christian from the programming universe and would razz him about when he was finally going to put his English degree to good use. Apparently he did.

Congrats Christian on the book! I wonder if I can use it as the reason I need to buy a Kindle?

Friday Funny: A Massive Government Effort We Can All Appreciate

Thanks to Milk and Cookies for highlighting this clever story from The Onion:

I wonder what an all day summit on this program would look like?

Baby's First Laptop - Coby TF-DBD7377

Being the computer geek that I am, I couldn't help but have the thought - My 5 month old so needs a Netbook. Of course he didn't really need one, but I thought it would be handy to have access to YouTube, internet radio, and other goodies. A Netbook made sense too because I could plop it down on the blanket where he was playing (more interested in chewing on the case, than watching the screen no doubt).

The idea pretty much evaporated when I realized that the cheapest, solid netbooks were still going to cost hundreds of dollars - and I just couldn't justify the expense. Especially when you consider our kid can be entertained with an empty Kleenex box and a plastic spoon.

The issue kind of popped up again when my mom and one of her friends, bought us some audio CDs. Of course we don't have a CD player in the house, so we were playing them on our laptops. It was a workable solution, but not ideal. As I considered buying a CD player, I thought again about having an all in one device.

That's when I decided to take a different tact - rather than buying a netbook, what if I bought one of those travel DVD players? I looked around realized that they would play DVDs, CDs and display photos. They also fit the portable and durable platform I was after. With a reasonable price tag (say around $100 - and a CD player alone was going to cost $30+), I was sold.

In the end, my Mother-In-Law came through and got our little one a Coby TF-DVD7377. It's relatively small with a 7" screen, but nobody's complaining. What I really liked about the Coby is that it not only reads DVDs, Audio CDs and CDs you make with your computer, but it also reads SD cards and USB drives. That means it's really easy to fill it up with content.

Having had the device a few days now, I can tell you that I'm pleased with it. It came with all the accessories one could ask for (a car adapter, case, remote, AC adapter and recharable battery - even a headset). And while the video / audio quality is nothing special, it more than works for our purposes.

Most importantly, I was able to flickr and download download photos of Firetrucks, burn them to a CD and create a slideshow. I was also able to drop MP3s on there too.

While the device is hardly as flexible as a PC, I think it'll meet the real goal - having a portable device that's full of entertaining media. Oh, and it plays those old fashion CDs that apparently folks can still buy.

Wednesday, February 24, 2010

Google Short Links - Give Your Google Docs A More Professional URL

A while back I discovered Google Short Links. This is an add-on for Google Apps that allows your domain to have a URL shrinking service like TinyURL.

Instead of creating a URL like http://tinyurl.com/1c2, you can create one that is based off your own domain name, like: http://u.ideas2executables.com/bokun.

Nifty, but this didn't strike me as particularly useful. First off, my domain is large enough that it's not really useful for shrinking URLs. Second of all, services like bit.ly actually provide a number of cool features (like real time link tracking) that make it more attractive than the Google app (which, to its credit, does have basic link tracking).

But Wait, Maybe It Is Useful

And then it hit my why this add-on is absolutely invaluable. Suppose I create a welcome presentation for new clients - the default URL for it is going to be pretty ugly. Something like:

http://docs.google.com/present/view?id=dgbdrzrd_47gg8pgdf3

Using the Google Apps Short Links plugin, I can create a named link like:

http://u.ideas2executables.com/welcome-demo

The result, of course, is a nice looking URL that feels like it belongs to my company. This is the difference in professional look one gets when comparing a @gmail.com e-mail and your own custom domain.

The Short Links plugin also works with any URLs, not just Google related ones. So you can link to eBay auctions, or Squidoo pages, or anything else you'd like. It's definitely powerful stuff.

Gotcha Of The Day: ActionScript ComboBoxes Swallow Keyboard Events

I've have a gnawing sensation that I've already blogged about this -- but for the life of me, I can't find the original post. So here goes what may be attempt #2.

I've been enhancing a flash app for a client of mine that responds to keyboard shortcuts. Recently I added a ComboBox to the UI, and all of a sudden they keyboard shortcuts stopped working.

Of course, they didn't really stop working. What was happening, after carefully examining the problem, was that once the ComboBox was used it held onto the keyboard focus. The ComboBox was now getting the keyboard shortcuts, and the Stage wasn't hearing any events to which it could respond.

A Partial Solution

I needed a way to have the ComboBox give up its focus. I looked around for the equivalent of the HTML blur method, but couldn't find one. After some research I leanred that instead of a method call to control focus, you set the value of the focus field on the Stage object. I found that setting the value of focus to null did the trick nicely.

Here's the code in action:

 cb:ComboBox = new ComboBox();
 // call addItem(...) and other methods as appropriate
 cb.addEventListener(Event.CHANGE,
                     function(e:Event):void {
                        // Logic to perform when the combo box is changed
                        // goes here
                        
                        // The fix: give up focus
                        cb.stage.focus = null;
                     });

Simple enough, right? Turns out there's a bug in the above code.

What happens if the user interacts with the ComboBox but doesn't change it? The ComboBox gets focus, and the Event.CHANGE handler is never run.

When this happened, I reviewed the events on the ComboBox and realized that I should put the cb.stage.focus = null, not in Event.CHANGE but in Event.CLOSE. That way, every time the ComboBox is closed (done being interacted with), focus would be given up.

Alas, this turned out to be too easy a solution. When I put the code in the Event.CLOSE handler, I got the error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
 at flash.display::DisplayObjectContainer/removeChild()
 at fl.controls::ComboBox/close()
 at fl.controls::ComboBox/onToggleListVisibility()

I believe I could fix this by setting focus to a valid DisplayObject rather than null. But, I didn't have a particular DisplayObject I wanted to get focus.

A Better Partial Solution

As most-of-the-way-there solution to the above issue, I added cb.stage.focus = null to the MouseEvent.CLICK handler. Between the CHANGE handler, and this one, focus manages to get unset in all the cases I needed it to be. Though, I'd really love to find a cleaner solution -- most likely one that uses the CLOSE event.

Still, a partial solution in this case did the job, so I'm a Happy Flasher.

Monday, February 22, 2010

Picaso Jr.

Today, we not only brought home our little boy from daycare but also his first piece of art! Check it out:

Look at the color! Look at the texture! I'm telling you, this boy has a gift. OK, maybe I'm a bit biased.

For now, it's being displayed in our kitchen, mounted on the fridge. But, I'm sure that's only temporary, I expect a phone call from MoMa any day now.

How To Sink The Health Care Reform Effort

I've got to admit, I'm pretty dang fired up about this health care debate. I can no longer watch John Boehner and Jim DeMint' talk about health care reform without screaming at the TV. I just can't help but feel that these guys are using sleezy tricks to undermine an amazingly important process.

As a therapeutic measure, I've gotten it all out of my system by ranting below. You'll notice that there aren't a lot of citations - yeah, that's not good. But, if I spent time filling in citations, I'd probably end up in the emergency room fuming. That, and my day, if not week, would probably be shot.

But I don't want to just rant, to rant. I'd actually like your input on this. Specifically, I'd like someone to calm me down and explain to me what I'm missing. How is the Republican leadership not acting in their own best interest (to fire up their base, and get more votes next election) - and how are their actions the best for the country?

Please, educate me.

OK, here's the rant...

How To Sink Health Care

Step #1: Create A Toxic Narrative

The first goal is to create a message that can be used to poison the debate from the very start. This message should be extreme, such as the Democrats want the government to take over health care or the Democrats want to construct death panels. You've got to be careful about crafting this message because it needs a slight shade of truth to it (but only a slight shade) - enough that the media is forced to wrestle with it on National TV. More importantly though, it needs to resonate with your constituency as obviously plausible. In other words, you've got to find a way to repeat back to them, something they want to believe in. It helps if the message is pithy.

As a bonus, if the idea is extreme enough, the folks who want reform will write it off as mere crazy ramblings. By the time they realize that your base is eager to believe it, it's too late.

No matter how many times your toxic narrative is refuted, or the other side addresses your points don't let up. No matter what you do, don't let logic and reason get in your way.

The only time it's OK to agree with the other side, is when they agree with you. If they say there's promise in tort reform - congratulate them on being bipartisan. If they differ from you, stick to your narrative.

Step #2: Keep Moving The Goal Posts

The other side of poising the debate is that you've got to always be just a few steps away from being ready to work with the other side. If only they'd drop the public option. Or include tort reform. Or put the negotiations on TV. Or started from a clean slate. Really, you want to work with the Democrats, but you just can't, because they're being unreasonable.

The key, here, of course, is being able to seamless shift from one concern to another, as they are addressed. Whatever you, never give up ground without gaining something.

So you want on TV and put your demands in stone, and then they were met - have no fear, you can still move the goal posts. People have short memories. And besides, you can always find that one more thing the other side needs to do.

Why It Works

These two steps compliment each other well. The toxic narrative, with its extreme accusations explain why you can't in good conscience compromise. The moving goal posts mean that you're just around the corner from a solution, and if only the Democrats would give even a tiny bit, we'd all win in the end.

Using this strategy, you can do more than kill health care. You can sour an entire nation towards its government.

Friday, February 19, 2010

Mystery Solved: SVN's Sparse Directories

A while back I mentioned a hack to pull down subdirectories on subversion that were stubbornly refusing to be pulled in. The hack works, but I couldn't explain why it was necessary.

Today, annoyed by yet another set of directories that wouldn't update, I did more Google and found the answer.

Turns out, subversion has a concept of sparse directories. These are directories that don't automatically recursively update.

Apparently, I'm a big fan of sparse directories. They allow me to keep a large repository of client code, yet not have to have it all checked out at one time.

Given my new found knowledge of sparse directories, here are a few key things to know:

  • When you checkout code in a non-recursive fashion, it sets the depth to be immediates - which means the directory won't recursively update.
  • The setting you get when you do a checkout is sticky. This is what was throwing me off - no matter how many times you svn update, the depth will still be immediates.
  • Running svn update --depth infinity does not reset the depth on the directory. In fact, it won't do anything.
  • Running svn update --set-depth infinity will reset the depth attribute, and will recursively grab all files. This is what I was looking for all along.
  • You can check the current depth of the directory by running:
    svn info . | grep ^Depth

Who even know there was a svn info command?

Subversion, you're just totally unappreciated. I wonder what other tricks you have up your sleeve?

DNS Tracing - A Critical Network Debugging Tool

The cool thing about DNS is how distributed it is. In theory, to view a single web page you might have to make dozens, if not hundreds of DNS lookups. This would be painfully slow. Luckily, DNS was built with this challenge in mind, and no single server needs to be contacted to do a name lookup. Better yet, the information can be cached locally so no lookup is needed at all.

The really annoying thing about DNS, though, is how distributed it is. Let's say you want to relocate a server - because the DNS address is cached in multiple places, it takes time for changes to propagate through. One user might see the new site, while another might see the old one - that's just life with DNS.

While this is annoying for server moves, what about when you have a potential DNS issue? A customer tells you they can't reach the website - is that because the DNS cache they are talking to is out of date? Or do they have a more updated copy of the DNS, and pretty soon, nobody will be able to reach the site? Untangling who's actually looking at the authoritative DNS setup (which the caches will eventually catch up to), is tricky to say the least.

The solution? DNS tracing.

Suppose you are going to a website for the very first time, and nobody on your network has gone their either. How is the domain name resolved? It's a multi-step process: first, a root name server is consulted. It won't know the specific host you're looking for, but it will know who you should ask. Behind the scenes, the information the root name server provided will be used to ask another DNS server, and perhaps another, till the exact host is found.

It's actually a remarkable system when you think about it - the large central authority needs to know just enough to point you in the right direction, and distributed, locally controlled servers can do the rest.

And how does this help you debug your client's connection issue? Simple - you can use Simple DNS Plus's tool to find out how your DNS is officially functioning. If the trace is correct there, then the problem is most likely with the customer's local network. When his setup gets fixed, he'll be back to normal. On the other hand, if your trace fails, then what your customer is seeing is reality - and the site is only working for you because it's cached locally.

When that cache expires, your site will be broken. My suggestion - learn how to use DNS tracing now, before you need it.

Wednesday, February 17, 2010

Dev Tool Of The Day: DNS Flusher

One of my clients was migrating servers this morning, and naturally we wanted to thoroughly test it before making it live. In this case, all we had was the hosting company's server domain name to access the site with. Something like:

 http://129-398-29-29-ip.hostingcompany.com

The site, however, is only accessible under its domain name - something like: http://www.clientsite.com.

A common solution to dealing with this temporary name mismatch is to add an entry to your computer's host file that overrides what's normally in DNS. For example, I edited: C:\Windows\system32\drivers\etc\hosts to read:

# Temporarily override clientsite.com
129.398.29.29       www.clientsite.com

Now, when I enter www.clientsite.com in my web browser, I'm directed to the new server with the correct hostname.

All of this works great. The tricky part comes into play when you want to switch between the old and new servers. Yes, you can easily comment out the entry in the hosts file, but you need to be sure to restart your web browser, otherwise its own DNS cache will come into play and you'll be sent to the wrong location.

Enter the slick little Firefox plugin: DNS Flusher. It does exactly two things:

  • It shows you the current IP address in the bottom right hand corner for the page you're looking at
  • If you click the IP, it will dump the cache, allowing you to get the latest address from your hosts file or DNS

It's simple, but made the sort of testing I describe above a real breeze. If you find yourself hacking your hosts file, you should definitely grab it.

Tuesday, February 16, 2010

A PHP Never Ceases To Amaze Moment

Did you know that PHP had an init variable named auto_prepend_file? The docs say:

Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the require() function, so include_path is used.

In other words, you can arrange for some code to be evaluate before any file is intepreted by PHP. It seems like a clever (and dangerous) hook to inject functionality that doesn't appear to be written into a PHP file.

I learned about this little goodie by stumbling on this article that talks about logging POST data.

I'm not sure when I'd use this, and I'd probably be pretty thrown off if I ever came across a codebase that was leveraging it -- but still, it makes me wonder.

How to make others love the sport of Biathlon

One of my favorite winter sports has to be Biathlon - a combination of cross country skiing and shooting. In high school, I got my varsity letter in cross country skiing and also learned an immensely valuable lesson: you can't be good at everything. As a corollary I learned that while there's almost always some poor schlub who's slower than you, and every once in a while, you're that schlub.

Rifle shooting is also near and dear to me, as it was one of my favorite activities at Boy Scout camp (got to give a shout out to Masawepie!). It was also an activity I started off poorly at, and managed to conquer thanks to a blending of learning technique and lots of practice (that and figuring out I'm right handed, and left eye'ed).

Finally, I love the tension that biathlon creates: if you ski your heart out, you'll be too exhausted to shoot well; if you focus just on shooting, you'll lose because of the time.

But, let's face it - Biathlon isn't exactly a big sport here in the US (and with our love of guns, you'd wonder why not?). Though, I know how to change all that - just rearrange the format so it's plays out like the video below. Am I right, or am I right?

A Most Unusual Day After Valentines Day

Ever since Shira and I were dating in college, we typically celebrate the Day After Valentines day, instead of Valentine's day itself. See, Valentine's day is a Hallmark holiday that begs the question: why should you love your sweetheart just on that day, shouldn't you love your sweetheart every day? On the other hand, you better as heck go out of your way to show your sweetheart she's special, so why not do it the day after Valentine's day?

Anyway, this year was different than all years in the past...

Let's see, I got Shira a little bling to add to her collection, and we did dinner at Cafe Asia. Hmmm, nothing unusual here. Oh yeah, we had to arrange for a baby sitter to watch over our little one.

Shira and I have left our little guy with a baby sitter before, but this was the first time we actually went out together and left him behind. Like classic parents, we did check our cell phones for messages a couple times when they obviously hadn't rang, and were relieved when we got the text message reporting that the little man was in bed and there were no issues.

The whole thing felt like a scene from a cliche sitcom.

And here's proof - a photo of the love of my life, as we take in a meal without wondering when feeding, diapering or play time is.

The Simons Versus The Snowbank

Could Dave and I managed to shovel out the 5+ feet of snow that had accumulated in the front part of our driveway?

Turns out, the answer is yes. Luckily, today's snowfall didn't really accumulate - if it had, I was pretty much going to go on snow shoveling strike.

Sunday, February 14, 2010

The Boy Gets New Digs

Today was a big day for our little man. He graduated from a pack-n-play to a real crib. If all goes well, tonight he'll be sleeping in a Graco Sarah Classic crib. It's your basic fixed side crib, with the ability to convert to a toddler bed. It took my buddy Nick and myself about 45 minutes to put it together - and that included me mounting one of the sides backwards. It's sturdy, and Shira and I are pleased with the quality.

We ended up buying it at Babies-R-Us mainly because we were able to turn in a 20 year old crib, and get 25% off a new crib. It's a slick promotion they are offering until February 20th, and it's definitely worth checking out.

So far the little guy has played a little bit in the crib and he seems to approve. At first he was a bit apprehensive about what was going on with this funky surface that's quite a bit more padded than his pack-n-play. But within about a minute, he was quite happy.

Here are some photos of us putting it together. Surprisingly, I didn't have any extra parts when I was finished. Strange, I can't remember that happening in the past.

Also, I used my girly Skil 2336-02 iXO screwdriver. It was perfect for the job, as it was able to drive in the screws without effort and even had the right Allen Wrench bit in the set it came with. Most importantly, the screwdriver was charged and ready to go, and didn't lose charge throughout the project. It gets an A on this project.

Friday, February 12, 2010

Getting Some Fresh Air

Today was yet another snow day in DC. Work, School and life was pretty much put on hold one more day. By now, however, the roads were cleared off, so getting around was possible. Not loving the idea of another day spent inside, we decided to get some fresh area. So we all bundled up, including our little one, and headed off to Gravelly Point for some traipsing around in snow.

It was beautiful day - the sun was shining and the air was nice and crisp. The wind off the Potomac wasn't great, but we made do.

Some photos below. Note: I've got to see if I can get permission from the wife to post a photo of her wearing our little guy in the Baby Bjorn. It was tricky enough walking through the foot deep snow, add in carrying a baby, and she really earned points this trip.

As long as we're talking about the topic of weather and the latest DC's storms, check out this awesome time lapse video. Thanks Dave for sending it my way!

Thursday, February 11, 2010

Another Day, Another Blizzard

We weren't even done talking about Snowmageddon, when his angry little sidekick showed up today. As promised, we got zapped with another winter storm. While the estimates of 7-14 inches of accumulation where on the high side, the storm was definitely a doozy. For hours, we had real blizzard conditions - with heavy snow and high winds mixing together to keep even the plows off the roads.

When the storm was finished, there wasn't a whole lot more snow to deal with (we shoveled what seemed like 8 fresh inches of snow from the drive way) - but the winds certainly did a number on the existing snow drifts. Walking through the neighborhood, it almost felt like a classic desert scene, as the snow drifts had a beautifully chiseled look to them.

All area schools are shut down, along with the Federal Government - that makes 4 straight days in a row. If you like snow days, this was definitely your perfect week.

Here are a couple photos - they definitely don't do the scene justice. The first one tries to capture the scene outside our house during the blizzard - trust me, it was a sight to see.

Wednesday, February 10, 2010

Can The GOP At Least Show Up?

I was actually pretty pleased to hear that a health care summit was proposed and that it would be televised for all to see. I think just getting all the parties in the room, and giving the American People a chance observe, is invaluable. Let's do it and see what happens!

And besides, this meeting seems like a no brainer. If the Republicans really want to fix health care, wouldn't a forum with the president be a good thing? Seems smart to me.

And yet, it looks like the very summit may not happen. The Republicans have listed their series of demands for the meeting, including:

"If the starting point for this meeting is the job-killing bills the American people have already soundly rejected, Republicans would rightly be reluctant to participate," Boehner and Cantor wrote.

Obama's answer to this question is pretty simple:

"This is not starting over," one White House official said. "Don't make any mistake about that. We are coming with our plan. They can bring their plan."

Yet, that suggestion may not be enough to get Republicans there. Oh my Lord, how ridiculous is this getting? Are they really going to sit out on event that gives them a chance to showcase their ideas?

And then I caught this clip from the Rachel Maddow show. Watch the first few minutes:

So there you have it - the very principles that the Republicans said were essential for a valid health care bill, are, in fact, in the bill. OK, I'll give the Republicans the benefit of the doubt - perhaps the provisions in the bill don't really meet their needs, or maybe there's extra junk in there they want to ditch. OK. But still, how can they call for a bill to be trashed that contains their views? Why not show up at the meeting and simply demand that those parts of the bill they like are strengthened, and the parts you dislike are removed?

I so want to believe that that the Republican leadership is doing more than just stalling and playing games. Yet, with these kinds of demands, how can you interpret it as anything else?

Tuesday, February 09, 2010

Gearing Up For Round Two

Although the snow estimates are shrinking (it was 10-20 inches), we're still supposed to get a sizable dumping. At least, as you can see from the photo, we're relatively prepared.

The two colored shovels are new - we picked them up at Ayers Hardware, my preferred hardware store. Home Depot and Target were out, but the little guy managed to come through for us.

Schools are already closed tomorrow - my guess is, they'll be closed all week. What an amazing, and sureal week this has been.

Stay warm y'all!

Monday, February 08, 2010

Stewart and O'Reilly Talk It Out

For the most part, I enjoyed Bill O'Reilly's interview of Jon Stewart. There's just something reassuring about having people with differing views sit down and talk civilly. We need more of this.

Whatever you do, make sure you watch the uncut version of the interview. It's worth the 45 minutes to do so.

I'm sure fans on both sides were hollering at the TV, wishing their guy could hear the sweet comebacks they had to offer. I myself found one section in particular where I wish I could have jumped into the conversation - that was with the whole discussion about Palin and Real America.

To summarize: Stewart explains that he's not comfortable with Palin implying that different parts of the country are more American or less American. O'Reilly explains that clearly parts of the country differ - just compare San Fransisco versus Charleston, SC. Stewart effectively responds that communities are more diverse than that, and you can't write off locations as being any one way or another.

I think they both missed the boat on this one.

O'Reilly is right - San Fransisco is different than Charleston. Go ahead, call one liberal and one conservative. But, here's the thing - one isn't more or less American. People in San Fran love the country as much as those in Charleston. People in Charleston want a good job, just like people in San Fran do. People in San Fran want their children to be safe, just like people in Charleston do. Different parts of the country may have different ideas of what will be best for the country and society - but that's what makes this country great, not flawed.

Enough armchair quarterbacking - here's the interview. Enjoy!

Sunday, February 07, 2010

The Recipe For An Instant Superbowl Party

Tonight I hadn't really planned to watch the Superbowl. I figured I'd just catch the best commercials and call it a day. But my Brother David was here, and he insisted that we do the Superbowl Thing Right. And what is Right? Well, I'm glad you asked. At a bare minimum, a super bowl party needs:

  • A minimum of 7 kinds of chips
  • Nachos
  • Pizza delivered after kickoff
  • A minimum of watching 4 hours of pre-game coverage
  • Guacamole
  • Dessert with whipped cream on top
  • Absolutely no regard for the number of calories consumed
  • Beer

We were able to hit all of these, with the exception of the fact that we only watched 2hrs of pre-game.

I've got to say, the above is a winning recipe. I really had a good time. The pre-game show turns out to be filled with just the kind of shmaltzy stories I can appreciate. Heck, it even included a little politics (for those of us in DC who can't live without it).

It probably doesn't hurt that the game was such a fun one to watch, with the underdogs proving victorious. And how about that surprise onside kick? You've got to love it.

As for the commercials, I wasn't really blown away. I think my favorite was Career Builder's Casual Friday spot:

Bud Light had a strong standing, with the Lost one being my favorite:

I've also got to give credit to Intel. Their Lunch Room Robot commercial kind of grew on me, and was one I enjoyed more the second time around.

The worst, by far and away, was the Super Bowl Shuffle commercial. I can't even bring myself to embed it on this page. How could they take one of my favorite childhood football memories and trash them so thoroughly? (Other memories include freezing my toes off at Bills Games - Thanks Ben G. for that one!)

All in all, this Superbowl thing was a real winner. Look at that, my little brother knows a thing or two.

Snowmageddon 2010

On Friday, they promised us that we were getting the storm of the decade. And sure enough, we got a doozey.

On Friday, the snow started and didn't stop till Saturday night. At around 1am on Saturday, we lost power. We dialed the automated information line, and they promised us the electricity would be on by 8am. Sure enough, at 8:45am, the lights came back on.

Unlike our last big storm, this snow was much heavier and a real pain to shovel. The Federal Government and Schools are closed on Monday, and my guess is, it'll be another few days before things get back to normal. Ahh, got to love DC in the winter.

And here's a few photos...

Friday, February 05, 2010

Gmail Multiple Inboxes - The Path To Inbox Sanity?

While I love using Gmail for my personal e-mail, I've always been stuck with my inbox falling into one of two extremes:

  • Scenario 1: Let all e-mail hang out in the inbox, waiting for me to manually review and archive it. Before too long, my inbox is overrun with chatter from various lists and junk I receive, and I can no longer see the forest through the trees.
  • Scenario 2: Get clever and label and filter e-mail that comes in so that it skips the inbox. The problem here is, if it skips the inbox, it skips me reading it. Out of sight, out of mind. So my inbox may be smaller, but I'm still missing out on messages I'd like to read.

There are my two extremes - a full inbox that's hard to manage, or a pristine inbox, that means you miss most of your mail. Either option doesn't really work.

While playing around with jotter, I followed the instructions and enabled multiple inboxes. After a couple days, it hit me - this add-on may be just the thing I need to tame my inbox conundrum above.

Multiple Inboxes work by allowing you define a search criteria, that when matched, will appear as a separate inbox on your main e-mail screen. That probably doesn't sound like something you need, but trust me it is. Here's an example:

Suppose I want to deal with all the incoming mail from PLT-Scheme mailing list. The first step is to setup a filter that makes all incoming e-mail from the list be tagged with a label (say: SchemeDiscuss), and have it skip the inbox. Next up, I define a multiple inbox with the criteria:

   label:SchemeDiscuss is:unread

And poof, next time I open up my e-mail, there is a mini-inbox with just my PLT-scheme mail in it.

Here's a sample of what I mean:

The result is that my primary inbox can stay pristine, while other less important messages can still be visible without me going to search for them.

Bottom line: if you're inbox is overrun with stuff that you kinda-sort-wanna-see, you need to try Multiple Inboxes.

Thursday, February 04, 2010

Shopping before a storm in VA

Yes, the line to the register really goes down the entire aisle to the back of the store. This better be a great storm.

Update: And here's a snapshot David took of the bread isle of the store. How classic is that one?

It's no surprise people are pretty ampped up about this storm. Here's the alert we got earlier today:

Another severe winter storm, with near blizzard conditions, is forecast to hit Arlington Fri., Feb. 5 through Sat., Feb. 6. Be prepared to shelter in place for 3 to 5 days . Please stay off the roads. Snow crews will plow primary and secondary roads first for emergency vehicles. After severe storms (more than 10”), it may take 36-48 hours after the snow stops before County plows can get to residential streets. Removal and treatment may take several days.

That's right - we're supposed to be ready to hang out for 5 days while the snow plows dig us out. Heck, not a snowflake has fallen, and we're already in a state of emergency. Not only that, but this event - which hasn't happened yet - already has a name: the snowpocalypse. Amazing.

Update: It's 7:30am, not a snow flake has fallen, and Arlington County Schools are closed for the entire day. Man, these kids have it good. Back in my day, the schools didn't close - nope, you just had to put up with arctic conditions as you walked back and forth to school, up hill, with no jacket.

Wednesday, February 03, 2010

The Joy Of Generators - Playing Around With Bing, Scheme and Yield

I've been a fan of generators for quite some time. But seeing that they were added to the core PLT scheme libraries, I thought they were worth another look.

What I like about generators is their ability to take potentially complex looping problems, and make them a lot simpler and more module. Consider this example that I whipped up in a hurry - I think generators solve the problem in an elegant way, where regular iteration would have gotten messy.

The Problem

I wanted to experiment with generators in a context that showed off their ability to work with large sets of data. And what larger set of data is there than the web? The little I challenge I worked up is this:

Suppose you want to find out how your website ranks for a given search phrase. That is, when you search the web, what page of the results your domain show up on? (if at all)

While I could have solved this with any search engine, Bing has a clever little feature - you can set the format of any search to be xml and instantly get back a well formed XML document you can work with. Google and Yahoo do this too, but they do it through fairly extensive APIs and for my toy example, I wanted something simpler.

The Solution

The first part of the solution was to add the ability to search the web using Bing and to return the results. This has nothing to do with generators, so I won't bother showing the solution here. Though you're welcome to download the code here. It's yet another example of using PLT scheme to grab an XML document off the web and parse it - a trick that every time I do, makes me smile.

With a quick bing library written I can move on to the fun part. What I want to do is to write a function that takes in a search term (aka keyword) and a domain (the website to check), and find the occurrences of when the search result mentions the domain. I wrote the core of the solution in a single function below. Notice that the name ends in /y - this is a hint to me that this function will yield results. I'm not sure this is an ideal standard, but for our purposes it will work. Here's the code:

(require "bing.ss"
         scheme/generator
         (only-in srfi/13 string-contains))

(define-struct  match (url page position) #:prefab)

;; Check for matches of domain when searching for keyword.
;; max-pages says how many results we should look through before we give up.
(define (keyword-check/y keyword domain max-pages)
  (define (offset p) (* p 10))
  ;; This nested function, 'check', does the real work. It checks
  ;; a given page for occurrences.
  (define (check page)
    (when (< page max-pages)
      (let ([results (search keyword #:offset (offset page))])
        (unless (null? results)
          ;; OK, if we made it this far, it means that bing has results for us
          ;; to look through. So let's look at each one.
          (for ([r results] [i (in-naturals)])
            (when (string-contains (doc-url r) domain)
              ;; At this point, our string-contains tells us we have
              ;; a match. Whoo! What do we do? yield the result.
              (yield (make-match (doc-url r) page i))))
          ;; This should look like an infinite loop. We just finished
          ;; checking one page, and are now going onto the next.
          ;; However, we'll only do this if we're asked to give another
          ;; result from our yield.
          (check (add1 page))))))
  (check 0))

The beauty of this code is that it's oblivious to the context that it's called within. When it finds a match, it invokes yield, and the continues looking for additional matches. It doesn't need to worry that the result set it's analyzing may be infinite.

I created a quick wrapper function for keyword-check/y that turns it into a simple generator:

(define (keyword-check/g keyword domain max-pages)
  (generator (keyword-check/y keyword domain max-pages)))

I can now make use of the solution. Say I want to see how my company's website is doing for the phrase Software Idea. I can do that interactive like so:

> (define idea-finder (keyword-check/g "software idea" "ideas2executables.com" 100))

;; idea-finder is now a function that I can invoke to get results from
;; my generator. Note, I'm willing to look through the first 100 pages of
;; bing results.
;;
> (idea-finder)
#s(match "http://www.ideas2executables.com/" 0 8)
> (idea-finder)
#s(match "http://www.ideas2executables.com/" 1 0)
> (idea-finder)
#s(match "http://www.ideas2executables.com/portfolio/" 6 6)
> (idea-finder)
#s(match "http://www.ideas2executables.com/portfolio/" 7 1)
> (idea-finder)
#s(match "http://www.ideas2executables.com/who-we-are/" 15 1)

You can see that it found the website on the first and second pages, then the 7th and 8th and finally on page 16 (notice the 0 indexing).

Finally, I can wrap up the generator in a neat little package like so:

(define (keyword-checker keyword domain)
  (for/list ([i (in-range 0 3)]
             [hit (in-generator (keyword-check/y keyword domain 100))])
    hit))

I can then invoke this function like any other:

> (keyword-checker "Software Idea" "ideas2executables.com")
(#s(match "http://www.ideas2executables.com/" 0 8)
 #s(match "http://www.ideas2executables.com/" 1 0)
 #s(match "http://www.ideas2executables.com/portfolio/" 6 6))

For large data sets, being able to just yield and continue searching for more data, really does make for an elegant programming model.

Gotcha Of The Day: Google Spreadsheets and Firefox Spell Checker

Suppose you're typing in Firefox in a Google Spreadsheet and you make a typo. Firefox is kind enough to report the spelling error to you like so:

Normally, you'd Right Click your mouse to get a list of possible spelling corrections. However, if you do this in Google Docs, you'll get the spreadsheet menu:

The fix? Hold down Shift and the Right Click your mouse button. The result is the built in Firefox menu pops up, along with the spell checker options:

Monday, February 01, 2010

Jotter: A Lightweight Notes, TODO and Reminder App For Android

I'm on a quest to install only critical apps on my G1. One need that keeps coming up since I've reset my phone is that of a notes app, and perhaps some kind of TODO list.

Instead of installing the slick AK Notepad app, or Astrid Task Tod List I've just been flipping over to the e-mail application and sending myself a message.

I like this approach because it puts all my reminders and notes in one place - my inbox, and more importantly, it's a place I'll actually maintain. The problem with this approach, though, is that it's clunky.

Enter: Jotter

The solution? Jotter. Jotter is a tiny application that allows you to enter in a bunch of text, and click a single button to have it sent off to your e-mail.

When combined with a keyboard shortcut (Search + J), it's as fast to use as native notes application, but stores the content in a better place: your inbox.

There's even an excellent recipe for having your Jotter notes show up separately in Gmail (hint: it leverages both filters and multiple inboxes). I've got to say, it really works.

I think you could even fancier if you took into account Gmail aliases like your.email+urgent@gmail.com and filters.

Jotter is currently free for the Android and definitely worth a try if lightweight apps are your thing.

A Real Discussion Between Obama and The GOP

If you're going to watch one political event from end-to-end, I say skip the State Of The Union and watch the Q & A session between Obama and The GOP. This is truly a remarkable discussion - Republicans get to voice their disappointment with Obama's polices, and he gets to respond directly to them. And nobody pulls an punches. It so beats the usual contest of who's talking points can be shouted the loudest.

A Strategy In The Making?

In the first few weeks of the Obama presidency, it seemed like the strategy he'd used to get stuff done was to try to work informally with Republican leadership - say, by having a Super Bowl party.

When his Stimulus plan landed no Republican support, it seems like he switched gears and decided to take his case to the people. For the last year, we've seen events like the Town Hall in Florida. Obama gives his stump speech, and then takes questions. While town halls sound great on paper, I can't imagine this strategy has had the effect the administration was hoping for. For one thing, they start to get very repetitive, so the news media stops covering them - so they are largely ignore. The result is that those in attendance may have been persuaded in one way or another, but the rest of the country isn't listening. Add to this the fact that the audiences are for the most part very friendly, and the events come across as campaign rallies more than meaningful discussions with the American People.

And now we have this move. Obama goes on GOP home turf to take their questions and respond. And as I said above, I like it. To me, this is far more effective a dialog than the Town Halls. The question is, can the White House turn this into a regular strategy, and one that keeps pressure on both them and the GOP to work together? I sure hope so.