Thursday, May 28, 2009

Going Out For Lunch. Way Out.

You could say that Shira and I went out for lunch today. Way out. Like, to the other side of the country out.

We're in Long Beach, CA - and as you might guess from the photos, the weather is perfect. I think I could get used to this...

5½ Strategies For Coming Up With Fresh Ideas

I found this article on coming up with fresh ideas to be an excellent read. I definitely liked the discussion about organizing your thoughts before bed and solving problems in your sleep - I've had good success doing this.

The article lists 5 approaches - you may be wondering where the ½ part comes from. Well, I'd like to submit an approach I've been using of late. I'm not quite sure how solidified it is yet, so I'll only count it as ½ a suggestion.

Here's what you do:

Pick a problem you'd like to solve, and ahead of time, commit to coming up with a fixed number of solutions (say, 3 for example).

Now, work through the problem and develop the ideal solution. Once you're done crafting this solution, you should feel like you've found The One True solution.

Now, throw this idea out. Banish it from the list of possibilities. Assume that it's a complete failure. Now develop another solution. If you've done the first part right, this should be hard to do. After all, you found the True Solution, why do you need to come up with another? But that's where the fun begins - you've got to develop a second solution that solves the problem completely differently than the first.

Keep doing this process of coming up with the perfect solution and throwing it out, till you've reached your goal number of solutions.

Now, put all the solutions back on the table and marvel at the novel ideas you've come up with.

There's probably a sexy name for this technique and I can't imagine I'm the first to employ it - but it sure does seem to be useful.

Wednesday, May 27, 2009

Books that make you go Hmmm...

Here are two books that I've stumbled across lately, and have been impressed with. I'd recommend checking them out if you have a chance.

Happiness by Rabbi Zelig Pliskin

Every since I read Finding Flow, I've been especially conscious about how being happy is a mental state, not merely a physical one. As such, it's far more useful to hack your brain to be happy, rather than say, try to accumulate lots of crap in the hope that the result will be a happier you.

Happiness, it turns out, is a nice little book to help in this effort. The book is organized as a series of short, readable chapters. Each chapter essentially provides a mind hack or strategy for being happy.

The book is written by a Rabbi and definitely makes reference to spirituality and The Creator. However, to me, the messages came across as universal, with the content being equally useful to Jews and non-Jews alike.

Perhaps the best part of the book is that it's so easy to experiment with. You just need to adopt a recommendation or two for a few days, and see if you like the outcome. Hey, it's way cheaper than buying a sports car or the latest Mac laptop.

Window Seat, Reading the Landscape From The Air by Gregory Dicum

Window Seat caught my eye as I was looking through the travel books at the library. The book is designed to brought along on your next flight and used to give you some appreciation for what you're flying over. The book is a fun mix of history, geography, geology and random facts. You also get an education as to how to interpret and aerial scene from 30,000 feet.

I like all of this. But, what I really like was the notion the author laid out in the intro of the book:

Taking a commercial passenger flight is one of the unheralded joys of life in the modern world. The food might be utilitarian, the seat cramped and your neighbor annoying, but the sheer pleasure of contemplating our planet from 30,000 feet in the air is worth any price. A century ago, nobody on Earth could have hoped to see this view, and it's yours-free-with every flight you take.

What an excellent point. How often do we have remarkable, even miraculous, scenery and events around us, yet we effective phase them out. Well, I for one, will try a little harder to appreciate the incredible opportunity to play planetary explorer, rather than kvetch about how little leg room I have.

Amazon Wish Lists Go Universal

You Need A Wish List

A wish list is a series of items you are interested in, and if friends and family bought them for you, you'd be overjoyed. Think wedding registry, but without the wedding part.

If you don't have wish list setup, then it's time to make one. And if you've got kids, then it's absolutely time they made theirs. Why do you need a wish list? Lots of reasons...

  1. People want to buy you stuff. They want to buy you stuff you want to have. Why the heck not make this easy on them? Give them a handy list of items that they know exactly what they can buy you to make you happy.
  2. A wish list will insure you'll get the exact model of gadget, or edition of book you want. Really, why make people guess if you want a 1GB or 10GB music player?
  3. A wish list will signal to people what you're interested in. Have a wish list full of photography items, excellent, people know it's safe to buy you photography stuff. This is especially important for kids - fill up your wish list with Legos, and your uncle will know that Legos are a safe buy, rather than say, Barbi like he stereotypically thought.
  4. A wish list can be a useful way to manage your impulse buying. While I don't claim to understand the psychology of why it works, for myself, adding an item to my wish list gives my brain a chance to stop dwelling on the purchase. This often saves me from making the purchase altogether. It's as I've done the research, picked exactly the item I want and can now step away from the whole process. If I still want the item a few days or weeks later, I'll go ahead and buy it.
  5. It resolves the "What do you want for your Birthday/Christmas/Purim?" question. My usual answer to this is "Nothing," which as I said above, doesn't do anyone any good. Even if I did have an answer, how would I know that I was suggesting items in the price range this person wants to buy? A well stocked wish list, with cheap books to fancy electronics, and everything in between is the perfect solution.

Amazon's Wish List Improvement

I've traditionally kept my wish list at Amazon. And for the most part, I've been happy about this. Amazon carries just about every item on the planet and is a reliable place to buy stuff. However, occasionally, I'd come across an item that I couldn't find on Amazon. This usually meant that I had to keep it off the Wish List.

Not any more - Amazon has added the ability to add any item on the web to your wish list. This Universal Wish List capability is drop dead simple - you just click a Bookmarklet on a page, and a window pops up asking you to confirm/fill in details about the item shown. You do so, click OK, and poof, it's now on your wish list.

Other sites have had this capability for quite some time, so Amazon is definitely lagging behind here. But, to their credit, they've caught up.

So go, create a wish list and start adding to it. You might actually enjoy getting the things you really want.

SnapPhoto - Doing it's part to improve the G1's camera

I have lots of things I like about my G1. It's a fantastic phone - but it has one major flaw: the camera is awful.

I know, I know, I shouldn't be depending on a cell phone camera for quality. Why not? The wifi and GPS work great. The web browsing is quite powerful. The camera is a 3+ megapixel camera, why can't it behave like one?

And here's the part that really gets me - Shira's Blackerry's camera does wondefully. Even the flash works well on it. Low light, inside, outside, whatever, it takes perfectly reasonable photos.

The G1, under perfect lighting does OK. But that lighting can't be outdoors, too low, etc. or you end up with junk.

My buddy Nick suggested a solution: buy the SnapPhotoPro app. Boy, was he right. Best 99 cents I've ever spent.

This app gives the G1's camera a fighting chance. You can tweak the color balance and color levels of the photos, which is huge. It also has better shutter control - at times, I find it frustrating just getting the built it camera to snap a photo. Any photo.

If you use the camera on the G1 you need this app.

Perhaps the next software upgrade, Cupcake, will fix all these issues. Though, I'm not optimistic. In the mean time, I'm going to continue to play with SnapPhoto and hope for the best.

Tuesday, May 26, 2009

The Map The Fallen Project

While technically no longer Memorial Day, it still seems quite appropriate to share this remarkable project: Map The Fallen. Map The Fallen is an attempt to collate data about casualties in Iraq and Afghanistan, and render them on Google Earth.

It's an impressive project and points to a variety of sites that provide this casualty data in other forms. I found Washington Post's Faces Of The Fallen project to be especially powerful.

Take some time and review these sites - it's so easy to look at these wars as statistics, when they are really made up of remarkable human loss. These sites do their part to help you appreciate that.

I'd like to send out a profound thanks to all those who have serve and sacrifice for our country.

Sunday, May 24, 2009

Riding The Duck

Tonight we had a real treat - we took a Duck Tour of Boston. A Duck Tour makes use of a WWII DUKW amphibious vehicle, which means we did a tour of the streets and then took a dip on the Charles river.

The tour was a good way to get an overview of the sites of Boson. Now, I can't wait to come back and check out some of the highlights I saw.

Chana and I even got to drive the Duck when it was out in open water. We were just two kids, having a great time.

A Walk Through Arnold Arboretum

The twins got their first trip to an arboretum today - and it was a wonderful one at that. I typed in my sister-in-law's address into Google Maps and zoomed out till I found an interesting landmark. That landmark was Arnold Arboretum. It's part of Harvard University, but we won't hold that against it.

The arboretum provided a nice main road and even some well groomed trails that the stroller was able to tackle. All the trees provided plenty of nice shade. If you're in the area, I definitely recommend you stop by and take a walk.

We finished off the adventure with a fresh round of diapers, a feeding and a rousing reading of One Fish Two Fish Red Fish Blue Fish - everyone had a great time.

Bye, bye manhood

Me, Chana and a baby sling.

I feel like such a liberated man.

The things I do for family!

Friday, May 22, 2009

A Long Weekend With The Twins

Shira and I are delighted that we were able to get up here for the long weekend to spend it with The Twins. Oh, and we're happy to see Shira's Mom, Sister and Shmuel, too.

We took a 6:00am flight to Boston, so we were able to spend the day playing uncle and aunt. As expected, we've had tons of fun - we took the kids for a walk (we walked, they slept), rocked out to Groove Salad and I even read Chana my first bedtime story. For the record, it was Where The Wild Things Are, and technically, she wasn't ready for bed. But we still had a good time.

And of course, there's photos. Lots and lots of photos - here are some of the highlights:

Cool Wordpress Plugin: Draw Comments

I'm not sure why you need it, but the Draw Comments plugin is too cool not to mention. The idea is that along with a textual comment, you can also leave a drawing.

Neat, eh?

Perhaps you could use this as a little whiteboard for each comment? Regardless, it's clever, and is a good demonstration as to how flexible WordPress plugins can be.

Chiming in on the MIT Scheme to Python Switch

So, by now you've no doubt heard - MIT is moving from Scheme to Python for their intro CS courses. I can't help but weigh in on the discussion.

I find the first part of the explanation rather puzzling. According to the post, the old way of writing the software was like so:

In 1980, computer engineering was based on starting with clearly-defined things (primitives or small programs) and using them to build larger things that ended up being clearly-defined. Composition of these fragments was the name of the game.

And the new way of writing software is described as:

However, nowadays, a real engineer is given a big software library, with a 300-page manual that’s full of errors. He’s also given a robot, whose exact behavior is extremely hard to characterize (what happens when a wheel slips?). The engineer must learn to perform scientific experiments to find out how the software and hardware actually work, at least enough to accomplish the job at hand.

Huh? Now perhaps I'm not a real engineer, so my experience doesn't apply. But, how exactly do you write software if you don't start with small working primitives (like unit tested classes, PLT scheme modules, or a PHP library script)? Isn't taking a complex problem and breaking it down into testable/reliable chunks a fundamental principal of writing software?

And yes, nowadays a programmer does typically start with a large API. But I'd hardly say that they are "full of errors." Sure, there may be some issues with the Google Finance API or JDK, but I'd hardly say that the main issue a programmer has is these errors. And besides, thanks to Forum Effect - any issue you have has most likely already been discussed on a forum somewhere, and is just a Google search away.

And yes, it's critical that a programmer learns to run little experiments - but that process is essentially debugging and has certainly been required since the 1980's, if not since the days of ENIAC.

The explanation continues to be a little whacky to me:

The new approach also has the big advantage that it combines computer science with electrical engineering, whereas the old one taught them as entirely separate disciplines. This way, students see how they interrelate.

Again, huh? How is computer science interrelated with electrical engineering? Computer science, to me, is the study of problem solving - not electricity whizzing through CPUs and RAM.

And finally we arrive at the point in the argument that I can appreciate:

There is extensive lab work, making robots and mobile applications.

Aha! By mixing EE and CS, you've put yourself in a position where you can program some hardware - the result is that you're doing something fun, like programming a robot. Instead of doing boring math, you're doing fun robotics.

The Ideal Education

If you ask me (and certainly, nobody in their right mind would), your ideal intro CS eduction should try to balance two competing goals:

  1. Make programming fun/relevant so folks will want to put up with the pain of learning how to do it well.

  2. Teach as many good habits, and as few bad habits in the process

MIT, it seems to me, has solved at least part of the above equation. They're doing fun lab work instead of traditional (read: boring) programming. I'm not sure why they think they need to justify the fun by associating it with EE, when you could easily mix programming with finance, music, biology or any other discipline. But hey, robots are cool. Along with the fun, I suppose you can learn good style with Python, so perhaps they have the second point nailed too.

The best example of teaching programming that I've seen to date is Moby Scheme + Project Bootstrap.

They accomplish goal #1 above by targeting the Android phone platform. Students can write games and apps that make use of the phone's GPS, accelerometer and networking capability among other items. Definitely no boring code here.

They accomplish goal #2 by using a modified version of the Scheme language known as the Beginning Student Language. Because of the rules of the language, students end up with small, easily testable procedures. This starts students down the path of learning important lessons about modularity and debugging, and avoids dependence on global variables or other habits to be unlearned later.

The Moby Scheme project is still in its infancy - but I think the team is really on to something.

So, you heard it here first: MIT went from Scheme to Python, and in a couple of years, will be back to Scheme.

Two Local Businesses That Deserve Another Shout Out

I've blogged about both these businesses before - but I continue to be so impressed by them, I can't help but mention them again.

Handy Ben

Handy Ben is guy / small business that does our landscaping and other odd jobs around the house (like the gutters). He's exactly what you'd want in a landscaper / handyman: proactive, reliable, does a wonderful job, and leaves the whole yard cleaner than when he found it. Oh, and he's affordable too.

I love that I get to support the little guy, rather than some big lawn company. If you need your lawn mowed, or other stuff around the house - give Ben a call 202-413-9292 or drop him a note at handyben@yahoo.com.

Flour Power Desserts

One of my birthday gifts was a selection of desserts by Flour Power Desserts. They're made with all Kosher ingredients, and the ones Shira got for me didn't have have any dairy products in them - so they were the perfect ending to a yummy meat meal. We bought enough of a selection that we decided to freeze a bunch of them before they went bad.

Over the last couple weeks, I'd occasionally go into the freezer, pull out a treat, and get to enjoy a little birthday happiness all over again.

Last night, when I went to pull out one of the last Woopie pies, I noticed it wasn't where I thought I had left it. I dug around, and sure enough, it was in the freezer. And still, it tasted delish.

This morning, I commented on the misplaced morsel - and wouldn't you know it, Shira specifically hid it from me so she could get to it first?

So there you have it, desserts so good, your own wife will hide them from you in the interest of getting first dibs. If that's not an endorsement for how good the food is, then I don't know what is!

Check out their website and give them a call at 240-426-7154 today - you're sure to be glad you did. Who knew supporting local small businesses could taste so good?

Thursday, May 21, 2009

Warming Up To log4j - Actually giving it a chance

The other day, I couldn't resist blurting out the following Facebook status:

Ben Simon is wondering if it's time to blog, yet again, about how much he dislikes logging in code? Yuck. Exactly how is a 42Meg log file going to help me solve anything?

As you may or may not know, I'm not a fan of logging. In past experiences, I've found it clutters the code, never seems to have quite the right info I need for debugging, is too loud on matters I don't care about and silent on matters I'm interested in. And then there's my favorite, when the log message is out of date and says one thing, but the code does another.

But enough about kvetching about logging - that's not the point of this post. The point of this post is that I've actually gotten some value from Log4j on a new project I'm working on. And I'd like to (a) celebrate (whoo!) and (b) document what I did so that perhaps future logging-cynics can get some value from this.

The Setup

In this particular case, I'm trying to debug a fairly large system (about 1000 Java files). The files have pretty extensive logging in them, though they suffer from the issues mentioned above.

If I turned on all the logging I ended up with a 42Meg log file that had so much chatter in it that meant nothing to me. If I turned off all the logging, I saw critical exceptions, but was left scratching my head wondering what the app was doing.

Finally, after I don't know how many years, I decided it was time to embrace Log4j and get a tiny bit fancy. I wrote up the following logging.properties:

# Setup the log handlers, which will be configured below
handlers=1con.java.util.logging.ConsoleHandler,2fh.java.util.logging.FileHandler

# Set the default logging level to SEVERE. In other words, by default,
# I only want to see the most urgent of messages.
.level=SEVERE

# Configure the logging to the screen. Set `level' to FINE to essentially
# catch all messages that are logged. But remember, above we set the 
# level to .SEVERE, so there shouldn't be anything to log
1con.java.util.logging.ConsoleHandler.level=FINE
1con.java.util.logging.ConsoleHandler.formatter=org.x4juli.formatter.PatternFormatter
1con.org.x4juli.formatter.PatternFormatter.pattern=[%t] - %d{MM/dd/yyyy HH:mm:ss} [%c{1}] %p: %m%n%throwable


# Same as above, but with logging turned on 
2fh.java.util.logging.FileHandler.level=FINE
2fh.java.util.logging.FileHandler.formatter=org.x4juli.formatter.PatternFormatter
2fh.org.x4juli.formatter.PatternFormatter.pattern=[%t] - %d{MM/dd/yyyy HH:mm:ss} [%c{1}] %p: %m%n%throwable
2fh.java.util.logging.FileHandler.pattern=output.log
2fh.java.util.logging.FileHandler.append=true

At this point, you've got a logging configuration which only generates the SEVERE messages. You also have log handlers ready to log any messages that are actually generated.

Now I got a little bit tricky. I'd find a class that I thought was central to the process I was studying and add the following to my logging.properties file:

com.foo.MailSender.level=INFO

Now when I run the system, I get a bunch of log messages - but they are ones that I actually have a chance of being interested in.

I also found that I can easily monitor a bunch of related objects, just by tweaking the logging at the package level. Consider this logging.properties change:

com.foo.mail.handlers.level=INFO

Thanks to the log messages in place and the structure of the code - the above tricks actually produce useful output. I do find myself using my programmer's scratchpad to write little scripts to parse the log file, but even without these scripts, the right level of logging makes all the difference.

Perhaps the real lesson I've learned about Log4j is that it works best when you use it in an iterative fashion. Turn on some logging, run the app, see what you can learn. As your needs change, tweak the logging configuration some more. It's not about finding the ultimate logging settings and never touching things again.

So there you have it, I'm actually thankful for Log4j. I'd keep an eye out for flying pigs, if I were you.

Geek Humor - A History Of Programming Languages

This history of programming languages post is absolutely hilarious. Take the description of C, for example:

1972 - Dennis Ritchie invents a powerful gun that shoots both forward and backward simultaneously. Not satisfied with the number of deaths and permanent maimings from that invention he invents C and Unix.

It's funny, because it's true.

Wednesday, May 20, 2009

Twitter Search As Sanity Checker

This morning I woke up to a whole stream of alerts about sites of mine being down. Ugh. Not a way to start the day. After some quick debugging, I noticed that all the hosts had their DNS with GoDaddy.

Was it possible that GoDaddy was having a major outage. Unlikely, but it's the best theory I had.

I picked up the phone and called GoDaddy, and their wait queue was something like 30 minutes. That's could be a sign of a major outage, or just an understaffed customer service center.

So I popped over to search.twitter.com and searched for GoDaddy DNS. And I quickly got my answer:

ntheory: Looks like GoDaddy is having serious trouble this morning. Web interface down, DNS down...

Here's the page full of results:

While Google and most news sites are fast at updating, finding this kind of real time information is surprisingly difficult on the web. Two support this you need a way to have a great many folks publish information, and a powerful search engine to sift through it all - and in this case, Twitter has both.

Tuesday, May 19, 2009

An Unexpected Booklist

The folks over at TPE have put together a fun list of unexpected entrepreneurial books.

There's plenty of interesting choices - time to fill up your wishlist with all sorts of goodies.

If I had to add one title to the collection it would probably be Make Your Own Damn Movie by Lloyd Kaufman. This motivational/how-to guide for aspiring film makers offers plenty of advice for entrepreneurial folks, too.

Of course, The Dip, Sun Tzu's The Art of War and The Tipping Point belong on your reading list - but those fall into the typical-business-book category.

What book surprised you with it's business value?

Monday, May 18, 2009

Yahoo BOSS - Freer Than Free

A client of mine asked me about the Yahoo BOSS API. I hadn't heard of it, so I poked around. It appears to be your typical search API, which has Google has been offering for for some time. But, with a key difference:

Search APIs are nothing new, but typically they've included rate limits, strict terms of service regarding the re-ordering and presentation of results, and provided little or no opportunity for monetization. These constraints have limited the innovation and commercial viability of new search solutions.

In other words, Yahoo wants to build your next app on their infrastructure, and will not only give you it for free, but let you customize it and take all the credit.

I think this is a really clever solution for dealing with a competitor (Google) that's giving away a product for free. Yahoo's taking the notion of free, and stepping it up a notch, to include more than one would expect.

And it seems like it would work too - if I'm building my startup on the cheap, why wouldn't I choose the Yahoo API that makes it look like I did all the development, versus the Google API that is plastered with Powered By Google.

To me, Yahoo looked at the rules (you have to give attribution to the search engine) and then broke them. Well played Yahoo.

Sunday, May 17, 2009

The 2009 Join Services Open House Air Show, Or, Guy Heaven

Today we made our way to the Joint Services Open House. Which is a really fancy way of saying, military air show. Not only did they have various planes and helicopters performing and folks jumping from the sky, they also had a a significant number of planes on the ground you could oggle and walk through. You could chat it up with the folks who flew the planes as well, which was definitely a treat. All in all, the 10 year old boy in me was in heaven. Big planes, big helicopters and guns - what else could a guy want?

The weather even behaved, and while a bit on the chilly side, didn't rain on us.

We didn't quite stay long enough to see the Thunderbirds perform, we did see one of my favorite planes - the A10 Thunderbolt do its thing.

I think Shira even enjoyed the day a bit. Though, I don't think she walked around with her jaw open like I did.

Friday, May 15, 2009

Syntax that cheats and a lesson for R7RS

Talk to any schemer and they will extol the value of prefix notation. The conversation might go like this:

Non-Schemer> Prefix notation is ugly

Schemer> What are you talking about? How are these two different? foo(a, b) and (foo a b)

Non-Schemer> Well, what about operators?
Schemer> It takes some practice, but having (+ a b c) means that your expressions are never ambiguous. Besides you can read the above as "add a b and c" - seems readable to me.

Non-Schemer> Oh yeah, what about conditional operations like <

Schemer> Oh you just don't get it, do you?

And the conversation goes downhill from there. But this last point is a good one. Even with years of Scheme practice, I find:

  (< i j)
clunkier than I would like to admin. The problem, partially, may have to do with the fact that < isn't so much a word as it is a graphic. Combine that with the fact that it's read as "less than i j" -- and you can see that it's not that natural.

A novel solution I've seen recommended is to do the following:

 (define increasing? <)
 (when (increasing? a b)
  (printf "~a is less than ~b\n" a b))

Cool, but then I have to think does increasing? correspond to < or >?

And then, yesterday, I saw a pretty solution to this. For some time, I've known that PLT Scheme offers infix type notation that allows you to say:

 (i . foo . j)

Which automatically is mapped to: (foo i j) (notice the two dots).

Well, it never occurred to me to use this for conditionals. I can now write:

 (cond [(i . < . j) ...]
       [else ...])

And the conditional reads just like I'm used to.

Now I have to decide, do I stick with the standard Scheme or give in to this nifty syntax? Oh, decisions, decisions.

A Lesson For R7RS

So what does this all have to do with R7RS, the next scheme standard? Well, I'm certainly not suggesting that this notation become standard. But I would say this feature captures part of the equation for a successful scheme standard.

Mainly, there are two goals that come to mind for R7RS:

  • Make it as brief as possible. Let's face it, the R5RS standard is a work of art. Compact enough to print and read, yet powerful enough to build great systems.
  • While it's easy to side for minimalism, try using PLT-Scheme for some time, and you'll quickly learn to appreciate the extensive set of features it offers. The infix notation is just one example of a cool feature that makes production programming more effective in a non-standard scheme.

So how do you reconcile these two, apparently contradictory goals? So far, my personal litmus test for a successful R7RS is as follows:

  1. Is it brief? Have we removed every possible feature that could possibly be removed?*
  2. Does it provide a path for developers to add the sophisticated features that a PLT-Scheme and other robust implementations offer? For example, to implement the infix notation above, R7RS may offer the ability to alter the reader, and leave it up to the developer to actually make such a heretical decision as to allow for infix notation.

If it can pass those two tests, R7RS will get my vote. Not that I won't change my mind by the time it's written.

Now I have to go off and ponder the value of infix versus prefix notation...

*This remove all functionality philosophy is standard in the schemers world. I wonder if the standards process should embrace this and specifically have a feature removal stage/vote? Just a thought.

My Must Have Traveling Tools

Peter Shankman, of HARO fame, recently published an insightful blog post on his favorite traveling tools. There's plenty of good advice and suggestions here.

I think my favorite suggestion has to be his taxi idea:

Final option, and a personal fave: If the cab line is long and you haven’t made alternate reservations, do what I do sometimes: Go up to the front of the cab line, turn to the line, and shout, “Anyone going to (my hotel name)? I’ll pay for it if I can join you! It’s almost guaranteed that someone will be, usually within the first ten people on line. You were going to pay for the cab anyway, why not avoid the hour on line, and as a bonus, do something good for the environment? And don’t give me crap about how that’s “not fair.” No one is preventing EVERYONE in that cab line from buddying up. I just choose to do it, they all choose to stay in line like business-travel lemmings. Choice. I haz it.

Here, in order of importance, are the items that I do my best to never leave home without:

  • A sleep mask. It's amazing how a $3.00 sleep mask can turn a nightmarish trip overseas trip into one where you can actually get some zzzz's. Works great in hotels rooms or sleeping in the car. This is a must have.
  • At least one safety pin. Trust me, you'll need this one day. Have it ready.
  • A device for playing music (a $15 mp3 player works fine), and a couple hours of recorded chill music, and some noise canceling headphones. Combine this setup with the sleep mask, and you can turn almost any traveling conditions into one that's relaxing and sleep-able. For bonus points, throw a podcast or two on the device for more entertainment.
  • A handful of energy bars. For longer trips, I like to stop by Whole Foods and pick up a nice variety of bars. Between airlines not serving food, and never quite having enough time between layovers to eat, having a compact source of nutrition is invaluable.
  • A notepad and pen. Genius might strike - you better be ready.
  • A guidebook to the area I'm traveling to. Typically, I just visit half.com and buy the Frommer's book. Or better yet, check it out from my library. At times, these books can be clunky to lug around, but they've more than earned their place in my carry on. Especially in a foreign country, that guidebook may be your best and only source quick of information. Need a restaurant in a hurry? Have a few extra hours to kill and want a site to see? What's the rules on tipping? Is there a town nearby to check out for an excursion? Oh, and I almost never read the book ahead of time. That would take away all the adventure.
  • A book to read for entertainment. Every once in a while, I think - I've got my phone, a computer, a music player - when am I going to actually need a book to read? And yet, every trip there's times like takeoff and taxiing where all the electronic gadgets have to go. Every time I leave a book at home, I vow never to do so again. The perfect traveling book is lightweight, related to the area you're traveling to, and hilarious.

I think that's about it. If I've got the above items, then I know I have a fighting chance at a restful and enjoyable trip.

What are your essential items for travel?

Tool Of The Day: LoadImpact.com

Load testing your web app is always one of those tasks that's really easy to push off. I find it's really hard to do well. On one hand, you can use tools like Apache's AB to easily stress your server. But, the stress your putting it under is pretty unrealistic.

And then there are tools like LoadRunner that will do the job right, but are an ordeal to setup and run. Oh, and they are expensive enough that they won't even list the price on the website. Though, in all fairness, my main experience with LoadRunner was watching the UI team of AmazingMedia wrestle with it to load test the AdVariant many years ago. Things must have improved since then.

Needless to say, I was not optimistic about finding a load testing tool for one of my clients. But, luckily, my fears weren't realized as I found LoadImpact.com.

LoadImpact is part of a new generation of load testing tools. They are built on cloud computing, and as such, have access to as much power as you'd like to hurl at your website. A few of the features that I like about LoadImpact in particular:

  • A free option that allows you to run a useful test.
  • Paid tests that are relatively inexpensive and you can pay by the day or month. There was just something reassuring about spending $9.00 to try out their service.
  • All tests get a permalink that's public and sharable. This makes sharing results a snap.
  • With a paid account, you can choose from among a simple 1 page tests, or you can choose to script multi page tests.
  • The scripts can be hand edited if you're into that sort of thing.
  • Tests a relatively realistic, downloading content off of the page as a browser would and providing think times.
  • The graphs are pretty.
  • There a nice little case study to read.
  • They have the chutzpah to list other load testing services in their knowledge base. Nice move, it shows confidence.

As for downsides - I did occasionally run into issues where tests weren't allowed to run unless I upgraded. But, I wasn't specific limits I was running into were. Also, I wish I knew more about the simulation of the client. For example, is it observing the expires or last-modified headers? Will it handle gzip encoding? But these were minor issues considering what I was getting.

Is the service perfect? Of course not. But for $9.00, instant access, and mostly realistic tests - I'll take it.

If you're doing the site testing thing, you should also check out WebsiteOptimization.com's Anazlyer and yslow.

Wednesday, May 13, 2009

Turandot Act 1

We just finished Act 1 of Turandot of my very first trip to the opera. Wow, am I impressed. The singing, the costumes, the story - it all works. Very impressive.

Shira and I were invited to watch a dress rehersal of the Kennedy Center's Turandot production. Always up for an adventure, how could we turn the invite down?

So here I am, surrounded by Opera pros, and me, taking this all in for the first time.

Like I said, I'm impressed.

As of act 1, Turandot is a winner and a great starter opera. OK, intermission will be ending soon...better pack it in.

Tuesday, May 12, 2009

DrScheme as Programmer's Scratchpad

These days, more and more, I find myself using DrScheme and it's underlying Scheme implementation PLT-Scheme, as the scratchpad of choice for capturing ideas. Consider these uses from today:

  • As glorified calculator - In this case, I needed to convert between Kbs and Gigs. I'm always forgetting a zero or something. Some trivial code like below is all it took to solve this one, once and for all.
    (define (kb->gigs n)
      (/ (/ n 1024) 1024))
    
  • As testing tool - I'm trying to optimize a website and I couldn't figure out why the GZip encoding wasn't being turned on for content. Rather than make do with wget and manually setting headers, I wrote up a quick function to test it out:
    (define (web-head url [headers '()])
      (let  ([lines (port->lines 
                     (get-impure-port (string->url url)
                                      (cons (format "User-Agent: ~a" (user-agent)) headers)))])
        (take-while (lambda (l)
                      (not (equal? l ""))) 
                    lines)))
    (define (web-compression-test url)
      (web-grep "Content-Encoding" url '("Accept-Encoding: gzip, deflate")))
    ;; To test, run:
    ;; (web-compression-test "http://someurl.com")
    
  • As Learning Lab - one of my clients has given me a Microsoft Exchange server account. I was curious how I could access it using IMAP. A few minutes of goofing around and I had the following test function to show me when new mail arrived:
    (define (imap-check host username password folder)
      (let-values ([(conn all-messages new-messages) (imap-connect host username password folder)])
        (for/list ([entry (imap-get-messages conn (seq all-messages) '(uid header))])
          (cons (first entry) (cdr (assoc #"Subject" (extract-all-fields (second entry))))))))
    
    (imap-check "some.server.com" "myusername" "mypassword" "Inbox")
    

I'm finding that this scratchpad code tends to go from basic calculation, to capturing the knowledge as a procedure, to the creation of a prototype system.

While any programming environment that offers an interactive REPL would do for the above work, I find DrScheme especially well suited for this. Consider:

  • Having modules means that you can create a file and give whatever names you want without worry that they'll be clashes later on. Go ahead, name some functions foo and bar. And if at any point the file actually becomes useful, you can always choose to export just the public names you want to share.
  • PLT-Scheme has a large library of code to choose from. Whether it's utility functions like taking n items from a list or libraries like POP3 support, chances are, the base for what you have in mind is already there. Many of the the functions are relatively high level too. For example, compare the unix wget command to the code for grabbing the contents of a URL:

      # Unix
      wget http://www.foobar.com/
    
      ;; scheme
      (port->string (get-pure-port (string->url "http://www.foobar.com")))
    
  • The help system is excellent. I find it especially easy to search around to find just the function I'm looking for. The help system also works offline too, which means that you can keep banging out code even without a net connection.
  • The system is cross platform. Back in the day, most of what I write now as Scheme code would probably have been written as shell scripts. Even though I've got Cygwin on Windows, I still find that Shell scripting can be clunky. Writing code in DrScheme insulates me from that.
  • The integration with the REPL is well designed. Often I'm using DrScheme as little more than a shell, and the REPL does its thing well. I especially like the command history that survives shutdowns of DrScheme.

More important than any language though, is that I find myself asking - how can I capture this information in a way that can be turned into a procedure. Once you've got something as a procedure, you've got a clear and unambiguous description of it. Now that's power. Even if only a small amount of my scratchpad code is ever referred to again, it's still paying dividends.

So, what tool are you using these days to capture information? Do you have a preferred environment?

Persuasive Writing in 140 Characters or Less

Liz, a Facebook friend, wrote a Facebook note where she mentioned a Twitter contest her cousin entered: convince people in 140 characters or less to support your "favored philanthropy." Here was her cousin's entry:

@RealHughJackman http://cff.org bc my 3yo works 3hr every day just to breath-bc he never gets a day off-bc a cure is right around the corner

I don't know about you, but I'm convinced. Now, go make a difference in a 3 year old's life.

Monday, May 11, 2009

Review: Square Foot Gardening

I was thinking of making the leap from trial and error gardening to the real thing. I think it would be both functional and rewarding to be able to have a real honest-to-goodness vegetable garden.

The first step in mastering any new skill is almost always the same - head off to the library and find a good book on the topic. Thankfully I found Square Foot Gardening by Mel Bartholomew.

It was exactly the book I was looking for. It offered practical advice, and a simplified method that would require both minimal space and cost. There was no need to convert my entire back yard to a field, or buy thousands of dollars worth of new tools (well, that part would have been fun).

Mel's strategy is to actually plant less, yet make each thing you plant count. I was amazed, you really could keep yourself in veggies using his approach, and save yourself serious trips to the store. While some of his advice was bit over the top (such as: find a place to pickup compost material on the way home from work, and get a couple buckets worth a couple times a week. Uh, don't think so.), most of it was quite reasonable. He spends considerable time trying to convince traditional gardeners his method works - as for me, I was easily sold.

Alas, even with this glowing review of the book, I have to admit, I won't be starting a vegetable garden any time soon. In the 3 weeks I had the book checked out, I didn't even have time to finish it. If I can't finish the book, how can I find time to actually tend a garden?

If you really want to grow your own food, and don't know where to start, give this book a try. It's clear, direct and has a minimum of fluff. Oh, and if it works out, feel free to send me some samples of your handy work.

That's So Texas

It's been a long day - so I don't know about you, but I could really go for a laugh. These got me smiling...

From a Facebook friend:

A very gentle Texas lady was driving across a high bridge in Texas one day. As she neared the top of the bridge, she noticed a young man fixin' (means 'getting ready to' in Texas) to jump. She stopped her car, rolled down the window and said, "Please don't jump...think of your dear mother and father."

He replied, "Mom and Dad are both dead; I'm going to jump."

She said, "Well, think of your wife and children."

He replied, "I'm not married, and I don't have any kids."

She said, "Well, remember the Alamo..."

He replied, ''What's the Alamo?''

She replied, ''Well, bless your heart, just go ahead and jump, you dumb ass Yankee!''

And how about this one-liner:

Superman owns a pair of Chuck Norris pajamas.

Ahhh, got to love Chuck Norris Facts.

Gotcha Of The Day: Adding Image Support To Emacs on Windows

The latest version of Emacs allows you to open up images, just like text. See:

However, when I installed the latest version of GNU emacs, the images just loaded as gibberish.

You can check to see if your emacs has image support by placing the following in the *scratch* buffer and eval'ing it:

 (image-type-available-p 'png)
 (image-type-available-p 'jpeg)

For me, the above returned nil. I knew I needed to install the extra image libraries, but which ones and where to get them?

After a bit of investigation, it turned out to be not all that tricky. I just headed over to the GTK+ download site and grabbed the following packages:

I unpacked these zip files. I then took the .dll files and dropped them into C:\Windows\System32. That's probably not the best place for them, but being a Unix geek stuck on Windows, it worked for me.

Now, there's one more catch - emacs is looking for a particularly named .dll files. So, make sure you name them as:

 jpeg62.dll
 giflib4.dll
 libpng12d.dll

These names are defined in the varaiable image-library-alist.

I kept putting off setting this up because I kept wondering which files to download and where to stash them. In the end, it was quite easy to do. So do it, and have a more functional emacs. And who doesn't want that?

Sunday, May 10, 2009

Review: Star Trek

My brother and I just finished watching the Star Trek movie - and I have to say, I was impressed. I can't remember the last time I saw a movie that had such history to live up to, that wasn't a flop.

I thought the movie found a good balance between action and giving us casual trekkies the one liners we came to hear. Sure, the story was a bit far fetched, but still, I found it was fun to watch. David brought up a good point - they didn't let the technology (yes, I'm looking at you Star Wars and the Matrix) steal the show. Sure, the effects were impressive, but they didn't eclipse the story or actors.

To me, a good Star Trek movie is all about parallel problem solving. What impossible mess do they get themselves into, and how do they figure it all out. And the movie delivered in this department.

I give it a 9.5/10.0 (sorry, it didn't feel like the Perfect Film) for being such a fun movie to watch, and for giving me a nice Star Trek fix. Go, see it.

The Perfect Sunday Afternoon Office

I had this excellent plan - David and I were going to have dueling laptops, as we worked from his backyard this Sunday afternoon. He provided the drinks, table, and even power.

I forgot my adapter at home and can't seem to get my laptop to join his wireless network.

So much for my plans of getting lots done in the cool breeze. Instead, I'm using his laptop to bang out a few blog posts and respond to e-mail. Not exactly what I had in mind.

Hmm...maybe the perfect Sunday office is the one you can't work from? In which case, this one is clearly perfect.

A Friendly Saturday Night

Pop quiz - it's 10pm in Brighton, NY and you want to take your parents out to eat. Where do you go? Why, Friendly's of course. And that's what we did. We had an impromptu Mothers Day Eve (or Erev Mother's Day) thing - not quite meal, not quite desert. Whatever it was, it was fun and it was great getting to be with the Moms at least the night before their big day.

I suppose we could have gotten together on Mother's day, but that would have meant waking up everyone at 5:00am, as Shira and I were out of Rochester by 5:30am. Yeah, we thought celebrating the night before would have been a tad less painful.

Mmmm...Friendly's ice cream and mozzarella sticks. Not exactly health food, but always tasty.

Friday, May 08, 2009

A Jog In The Poconos

We're headed back to Rochester to spend some time with the fam. On our way back, we stopped by a little town in the Poconos for the night. Here are some photos from a run I took earlier this morning. Note the no trespassing theme.

Every time I turned a corner, I ran into another chunk of property that no doubt housed a shot-gun wielding, half crazed maniac, just waiting for some guy in running shorts to come on his property. The target practice would no doubt commence.

But, I didn't give them the pleasure. Instead, I turned my butt around and kept running till I found this nice little nature area which provided some muddy trails to run on.

All in all, it was a good time.

I think we're setting a world record for the shortest trip to Rochester, with this one. We'll be in Friday night, and out by Sunday at 6:00am. Seriously, I should call Guiness for this one.