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.

Friday, January 29, 2010

A Meal To Sink Your Gums Into

We just finished a Well Baby Visit and were given the go ahead to give the boy solid food. Whooo!

We bought a variety of items for him to experiment with - from jarred food, to raw fruits and veggies - so I'm sure we're all in for an adventure.

Anyone have any first food suggestions?

Thursday, January 28, 2010

Running IE6 Under Windows 7 - Easier Than I Thought

I needed to test out a site on the dread Internet Explorer 6, and none of my laptops were old enough to do this. Back in the XP days, you could run multiple version of IE on your computer without an issue. With Vista, and Windows 7, this capability seemed lost.

Though, I learned this actually isn't the case with Windows 7.

Turns out, on the Start Menu of Windows 7 is an option to run Windows XP Mode. The first time you run it, you'll be asked to download two files here. After you've installed both files, running this shortcut kicks off a virtual PC.

After a fairly lengthy first boot, the PC comes and sure enough, by default, it's running IE6. Specifically, 6.0.2900.5522.xpsp_sp3_gdr.090206-1234. Got that?

So, IE6 testing on Windows 7 isn't the headache I thought it would be. Good to know.

Essential Android Apps

After I did my factory reset of my G1, I promised myself I'd be more selective about what apps I installed. The G1 is now an underpowered phone, and the surest way to make it even slower is to install lots of apps, some of which may be poorly written when it comes to conserving resources.

So here it is, my list of essential apps. I plan to keep it up to date as I install and uninstall items, keeping the list as lean as possible.

The main test here is: do I actually use the app. Sure, the Draw application was cool - but in the nearly 1 year I had it, I never once used it for anything remotely practical. Same goes for the compass, and most of the other apps I had installed on the phone.

Of course, what I really need is the new Nexus (or whatever comes after that) - which no doubt has a much faster processor, and can handle running whatever I throw at it. Until then, I'm going to try the frugal app lifestyle.

Wednesday, January 27, 2010

Using Textile for HTML E-mail Generation

These days, HTML e-mail is the norm for PHP apps I develop - which means I'm using PHPMailer instead of the old fashion built-in mail() function call. PHPMailer makes it easy to send HTML messages, you just set the Body property on the mailer object, and tell it that is in fact HTML:

 $mailer = new PHPMailer();
 $mailer->Body = "...HTML Formatted Message...";
 $mailer->IsHTML(true);

All easy enough. Though, I was wondering if there was a more concise way to manage the HTML messages themselves. While playing with Perch, I re-remembered the joy of using Textile - a lightweight markup language that reads like text, yet can be turned into HTML. Then it hit me, why I don't I maintain my messages in my code in Textile and then convert them to HTML on the fly?

This turns out to be super easy to do. First, you write some Textile:

$subj = "Thanks For Signign Up For Foo!.com";
$body = <<<EOF
Hello _{$username}_,

Thanks so much for signing up for "Foo!.com":http://www.fooexclamationpoint.com

Your account is just about ready for you to use. You just need to confirm the account.
You can do this by clicking "here":$confirmation_url or, you can click on the link below:

p=. "$confirmation_url":$confirmation_url

Thanks for joining up and have a Foo!tastic day.

Foo!.com(c)
EOF;

Now, you can transform the Textile to HTML and store the value on the mailer:

$t = new Textile();
$mailer = new PHPMailer();
$mailer->IsHTML(true);
$mailer->Subject = $subj;
$mailer->Body = $t->TextileThis($body);
$mailer->AltBody = $body;

You can see, in the last line, I store the textile input as the text version of this mail message. While not perfect, the Textile version should at least be a readable version of the message for the few folks out there without HTML capability.

So there you have it, concise messages to maintain, pretty HTML formatted e-mails, and a passable alt-version of HTML all in about 3 lines of extra code.

Tuesday, January 26, 2010

A Basement Heating Hack

Today we had our furnace/heating system inspected for the first time since the house was built about 6 years ago. To Shira's credit, she arranged this before there was any kind of emergency - it just seemed like a sane thing to do (and probably overdue). Luckily, the guy found no issues. We had been wondering if something was amiss because our basement was feeling especially chilly and we wanted to make sure something wasn't off.

While asking the tech about options for warming the basement he suggested an idea, which in hindsight was obvious:

If you close vents on the first floor, then heat will take longer to reach upstairs thereby causing it to stay on longer, thereby heating the basement. Additionally, with the vents closed, the heat will escape that much slower.

On the other hand, if you want to save money, keep the vents open so that the upstairs can get to the right temperature faster, and turn off sooner.

Like I said, this was obvious - though my first instinct was to make sure vents were open, rather than closed.

Besides getting a good heating tip I was reminded of an exceedingly important lesson: just because a system is big-and-unknown (say: your car or heating system in your house), doesn't mean you can't apply logic to the problem. I so totally should have been able to figure out the above strategy. Instead, I wrote the problem off as some mysterious issue that a trained tech would need to fix.

Monday, January 25, 2010

Conan Goes Out Like A Mensch

I haven't really been following the Conan/Leno/NBC debacle - but my brother David was kind enough to sit me down and watch Conan's parting address.

Go watch it here.

I have to say, I think Conan acted brilliantly. He had a chance to say anything he wanted, to let all the anger and disappointment bubble over - and instead he chose to take a step back, see the opportunities he's been given, and to appreciate that life isn't about fair.

I hope when I'm faced with these kind of disappointments, I'll have the piece of mind to behave like this.

Update: It's a crude video, and not as good as the whole speech - but if you just want a quick gist of what I'm talking about here's a sample of the above clip:

Sunday, January 24, 2010

Last Day With the Twins

The twins have gone home and the house is down to one baby, which makes it practically silent. We had such fun with the twins, and Mom, Dad and the au pair. We hope they come back and see us really soon. It was such a joy getting to spend the weekend with them. You can see from the pictures, that a great time was had by all.

Friday, January 22, 2010

Playing with babies

So... this is what running a daycare feels like? Yesterday and today have been baby crazy at the Simon household. The twins continue to amaze us with their newfound powers and our little one is such a champ taking it all in.

Here are some fun pics:

Dovid peruses the cookbooks, as he's thinking of his next meal, while Chana is getting a head start on acing Orgo.

They both love the swing Shira and David eating them up.

Friday Funny - Intergalactic Snack Tips

Just in time for the Super Bowl, Chad Vader has some most excellent snack tips. He even includes a hot dog recipe - oddly enough, it's one I haven't tried before.

Enjoy!

Getting That Brand New Phone Feeling With The G1

Over the last few weeks, I've noticed my G1's call quality is amazingly bad. At least once per phone call the person on the other end of the line would fade out for a few seconds, and fade back in - with the critical information uttered those few seconds lost forever. Usually this would happen a couple times a call, and always at the most inopportune times. As if that wasn't bad enough, every few phone calls, I'd managed to just have the call dropped.

Combine this with the fact that my G1 seemed to be getting slower and slower, and I felt like I had to do something. I knew I had a real problem when I found myself browsing T-mobile's phone selection, and wondering if I could ditch all this fancy smart phone technology and just by something basic. I know, crazy, crazy thought.

The Solution: A Factory Reset

Before I ran out and either upgraded to a Nexus One, or downgraded to a Motorola F3, I decided I'd give my G1 another shot by doing a Factory Reset. This would zap all the data on the phone and leave me with an effectively brand new phone.

It's actually not as an extreme an option as it sounds, as the phone's contacts, e-mail and calendar are all sync'ed through your Google Account, which means that you don't lose this data.

The actual reset procedure is here, and is eerily fast to complete. Note, the instructions mention the End Key -- this is the red key you press to hang up a call.

Initial Reactions To The Reset

Luckily, I didn't have to hold my breath too long - after the phone reset, and I plugged in my Google Account info, it immediately started to restore contacts, e-mail, etc. The memory card was also left untouched, and while I haven't checked, the list of apps I had installed is supposed to still be there too.

Gone however are all the apps I had installed as well as personal settings (like screen brightness and such). The other big item that was gone was my SMS messages - but I had been using TreasureMyText, so technically this information wasn't lost.

I have to say, with the stock G1 background, and no extra apps - the phone really did feel fresh and new. It was also definitely faster to use, though still not lightning fast.

Getting Reacquainted With The G1

Doing the factory reset allowed me to get a fresh perspective on the G1. I've made two promises to myself. First, I'm going to try to explore the built in features of the phone more. I've already discovered the power widget which allows for super fast toggling of the GPS and WiFi. Second, I'm going to try to install only apps I'll use. Sure, the compass was neat, and Google Night sky is a model of software engineering greatness - but I never used these and other apps. That's not to say there isn't room on my phone for fun apps, they just need to be ones I use regularly.

To get started, I settled on these three absolute essentials:

  • PhoneFusion - I'm never going back to old school voice mail. Ever.
  • Google Maps Upgrade - The Turn-By-Turn directions are too important to live without, and I've already used it as a backup GPS when our main one is sitting in Shira's car.
  • Contact Owner - This tiny app puts up a message on your lock screen saying who should be called if the phone is found. This information could mean the difference between a lost and found G1, so it's in.

That's it. To keep the apps under control, I'm planning to install them when I need them and even then, incrementally, so I can tell if one is slowing down the works.

I'm sure I'll break down and go back to my mad-downloading days, but just for the next few days, I want to pretend like I can be disciplined about this.

And The Call Quality?

So far, on the handful of calls I've taken today, I've had zero issues. No more fading, no more dropping. I'm not sure the track record will hold, but so far, so good. Looks like the Factory Reset was the way to go to solve this issue.

I have the feeling that even if call quality wasn't an issue, doing a factory reset yearly or maybe even a bit more frequently may be a good idea. It really does give you that Brand-New-Phone Feeling without that Oy-How-Long-Does-The-Contract-I-Just-Signed-Last Feeling we all dread. Not to mention, it's free.