This morning I discovered Mors Kochanski, an outdoor geek if there ever was one. I've seen one of his common quotes floating around the web, but never looked up who said it: The More you know, the less you carry.

Wednesday, August 29, 2012

I really loved Paul Theroux's overland adventure through Africa. One of the darker themes of his book, though, was how much damage he perceived Christian aid organizations were doing. Besides crowding out native traditions, they help keep the locals in poverty by not letting them solve their own problems. Aid organizations come in, provide impressive solutions that quickly fade and leave a worse off people.

With that outlook, you can imagine how skeptical I was of Wine to Water by Doc Hendley, the story of yet another American who was on a quest to save Africa.

I found myself pulled in to Hendley's story. Here was a lost soul bumping along, when he decides he's going to make a difference. It starts with the a clever phrase (Wine to Water, wonder what that could mean?), that turns into a curiosity (hmmm, I wonder if there's a water problem in the world?), that grows into a hobby (hey, I wonder if I can raise money to help get people clean water), that finally grows into a passion (I know, I'll go to Darfur!).

Before we know it, Hendley is in Darfur as part of a Christian aid agency trying to figure out just how to save the world. One of his first contributions: he takes a team to a camp where he helps resurrect a water pump which has been inoperable for 5 years. Imagine that, a location lacking fresh water for 5 years, and in an afternoon, he's restored it!

Aha! I got 'em, I thought. This is exactly what Theroux was talking about. Sure, he fixed the pump. But when he leaves, and it breaks, the locals will again be without water. 142 pages later, though, Hendley had this to say:

That got me thinking: if my greatest success resolves around the people, then the best way to really make a lasting difference in Darfur had nothing to do with fixing the most wells in the shortest period of time. It had to do with the people.

I realized that what I needed to do was to empower the locals, to give them the tools they needed to solve their own problems and become self-sufficient.

Even Theroux should be impressed, no? I realized that Hendley totally gets it.

It's exactly this sort of growth that makes Hendley's story so compelling. It's not a picture perfect adventure from bartender to world-saver. It's a store filled with stops and starts, ups and downs and lots of lessons learned. Hendley gets in over his head, but manages to come out on top. It's rare to get such an upfront seat to watching someone's world view change so dramatically, but Hendley is kind enough to take us along for the ride.

As an aside: his first person accounts of some of the horrors of Darfur really are powerful. They alone are probably worth the time to read the book. He manages to bring this massive humanitarian crisis down to a level that one's brain can actually process it.

Tuesday, August 28, 2012

I'm in Pohanka Collision getting an estimate on my car (short story: got into a fender bender, I'm not at fault, all's good) when I notice the following on their counter:

That would be a flyer about the Wounded Warrior Project. How smart, I thought: they give to a worthy cause, and in return, I get to feel a little better about spending the insurance company's money here. Then I read the fine print. I wasn't able to jot it down or get a clear photograph, but here's what it essentially said: (which appears in a press release from the company)

Currently, for each USAA vehicle customer satisfaction survey that receives all top ratings – or “10s” – this impressive Pohanka collision center will donate 10% of the deductable to the Wounded Warriors Project.

Got that? You have a choice: rate them all 10's and give to this charity, or give them any other rating, and miss out on the chance.

What the heck?

We get a similar schtick from Acura when we buy our cars there. The salesmen makes it clear: anything less than a perfect score on the survey means dire consequences for him, his family and his pets.

So, we usually play along -- after all, the experience has been essentially good, so why not make life easier for all and give the perfect score these companies are so desperate for.

But of course, the people who they are really losing out with these shenanigans is the companies themselves. They're going to great lengths to ace the test, yet it's only through getting a few questions wrong that they might realize where they can improve.

Wednesday, August 22, 2012

Earlier today, I was trying to install an app on Windows and it kept failing with an error saying a file could not be read. Of course, it didn't say *which* file had missing permissions. Nope, that would be too easy.

After a bit of Googling, I installed Process Monitor and tried the install again. After sorting through about a bazillion lines of messing I found the one permission denied error.

Turns out, the .msi file itself had permission for Ben to access it, but nobody else. Therefor, during the install when the Administrator was attempting to access the files, it failed.

I added read permission for the user Everyone and I was back in business.

But that's not all! Process Monitor delivered not just once, but twice today!

I was fiddling with UScreenCapture, and was having problems getting the required registry settings to take effect. The docs clearly said:

I fired it up, tweaked the filter settings so I'd be less overwhelmed by output and accessed my app that was using UScreenCapture. Wouldn't you know it, the registry path being accessed wasn't what was reported in the docs, but was as follows:

RegQueryValue HKLM\SOFTWARE\Wow6432Node\UNREAL\Live\UScreenCapture\MonitorNum NAME NOT FOUND Length: 144
RegQueryValue HKLM\SOFTWARE\Wow6432Node\UNREAL\Live\UScreenCapture\ShowCursor NAME NOT FOUND Length: 144
RegQueryValue HKLM\SOFTWARE\Wow6432Node\UNREAL\Live\UScreenCapture\CaptureLayeredWindows NAME NOT FOUND Length: 144
RegQueryValue HKLM\SOFTWARE\Wow6432Node\UNREAL\Live\UScreenCapture\FrameRate NAME NOT FOUND Length: 144
...

Apparently, the sub key Wow6432Node is required.

I set these keys instead of the ones in the documentation and all worked as expected.

For years, I've wondered what the equivalent of Unix's strace is, and I believe I've found it.

Today I needed to setup my PhoneGap app to produce a iOS version. No problem, I figured, PhoneGap provides a super geeky command line guide for building on both Android and iOS. The steps worked perfectly on Android so I'd figure they would work just as well on iOS.

The first command, bin/create silently ran, which I took as a good sign.

The second command, cordova/debug produced quite a bit of noise and then a big 'ol error:

I poked around on the web, and for the life of me, couldn't find anyone else who had the same problem. I tried tracing the build scripts a bit, but that didn't go anywhere. Finally, I just went for a run.

While out on my run I thought of a new plan: I'd build the app first using the GUI tools and *then* switch to command line mode.

I went ahead and slowly and carefully walked through the iOS Getting Started guide. I knew I was on to something when went ahead and installed Cordova-2.0.0.pkg as the instructions outlined. I was also pleased to see that the instructions for starting a new project are to run the same create script as the command line utility calls for.

In other words: to use the command line tools in Android, just follow the Command Line instructions. To use the command line tools in iOS, follow the Getting Started guide first, then switch over to the command line tool set.

Along with the PhoneGap docs, I also found this tutorial top be handy, even if it was a bit dated.

Tuesday, August 21, 2012

I was initially not very impressed with the kid friendly book on CD collection at the library. Though, for the sake of trying at least one, I rented Kaya: an American Girl. Our 7 year old and I almost immediately became wrapped up in the story. While we didn't have far to go to and from camp, we definitely looked forward to the drive as we'd get more Kaya time.

I'd hardly think that a doll maker would be the source of great historic fiction, but I'd also be wrong. The author found just the right balance between history, adventure and lessons learned.

The character of Kaya is loveable, and like any kid, has plenty to learn. We get to watch her fail, pick herself up, and grow from her mistakes. It's exactly the kind of lessons you want your 7 year old to listen to.

Some of the content is mundane - you get to watch Kaya's sister get courted by a boy, and she longs for her horse when she's separated from her. But much of it is quite serious - she gets abducted, and has to cope with the death of a loved one. Definitely heavy stuff. After each section, the CD goes through some purely historical information relating to Kaya's tribe (which is quite real), and as you can imagine, there isn't a happy ending.

As you might imagine a book by American Girl is going to put Women front and center. I think they did an excellent job of this. Men have their role and are given respect, but this is clearly a story about women. Kaya's grandmother plays a critical role, and she isn't just wise, but also skilled and physically strong. Women have roles that go far beyond cooking and cleaning. Again, these are exactly the kinds of role models I want our 7 year old boy to hear about.

Finally, it's worth mentioning that the book puts topics about adoption and other non-traditional family structures front and center. For a foster parent, I suppose this can go either way. From my perspective, the book does this well and actually serves to give us another set of tools to talk with our foster son about what he may be going through or feeling.

As you can see, I'm really quite impressed by these collection of stories. Then again, how often do you come across something so readable and yet filled with positive messages? I say rent it, I think you'll be hooked in no time.

Monday, August 20, 2012

No, these are not instragram creations -- these are the real deal. While visiting Rochester, my mother-in-law passed these photos onto Shira. Apparently she had developed a random single use camera, and these gems are what were found.

Even though I look like I'm about 10 years old, these were actually taken while I was in college (say, 16 years ago or so). I don't have any recollection of the trip(s?), but I can see in at lest one of them that Shira's wearing a shirt with "BISON" written on it, which if I memory serves, was University at Buffalo's information system.

Look at me sporting the Tevas and the hair that was about 4 weeks overdue for a hair cut. Guess this proves that Shira loved me for more than my looks.

Friday, August 17, 2012

We're driving to Rochester and Shira noticed the Catoctin Mountain
Orchard, which was just
too appealing not to stop at. While she was in
the store checking out the fruit and goodies, I shot about 60
pictures in their wildflower garden. The bees sure were working
hard, hopping from flower to flower doing their thing.

This is whacky because I'm obviously calling mysql_connect with credentials that most certainly not root and an empty password.

Most of the time, the system will have run a few queries before the query in question fails.

The problem popped up out of the blue, so my first strategy was to hope it would simply go away (with it happening so infrequently, and at off hours, what harm could it cause?). It didn't, and appeared to be getting worse.

My mind immediately conjured up some wickedly complex scenario where another PHP process was polluting mine, and therefore causing the credentials to be overwritten. I thought about contacting the hosting provider to try to explain the problem, but in my experience, anything involving PHP code is immediately written off as programmer error (which, in their defense is probably mostly the case - except when I file a bug, that is).

Tonight I was determined to figure the problem out. I knew I had to think simpler than a massive PHP bug involving corrupt address spaces.

And then it hit me -- what if the database connect was getting closed by the host? This happens all the time when I leave my command line mysql session untouched for a while. How would mysql_query react if the database connection was closed or invalid? The answer was promising:

If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments.

Aha! So now this was starting make sense. If the database connection was getting closed, then the next call to mysql_query would result in an invocation of mysql_connect() without any arguments. Which would no doubt result in some basic set of credentials, like root and empty password being sent.

That's so PHP - trying to find a default behavior that kinda sorta makes sense, rather than just throwing an exception and dying. It's too kind at times, which can lead to sloppiness.

Regardless, the documentation for mysql_connect mentioned that special INI settings could be used to provide default settings. As a result, I went into my database configuration and added:

Incidentally, last night Shira and I did a sworkit workout, which uses a similar strategy: it tells you an activity, times you for 30 seconds, and bings when you're ready to move on to the next one. It was surprisingly effective, and made a 30 minute workout more or less fly by.

So while I mention Jay's post as an homage to the programmer's spirit, I do believe it actually has practical value.

When you're a programmer, all of life's problems are just an algorithm away from being solved.

Tuesday, August 14, 2012

So here a business idea I've been kicking around for a while: front yard gardening. The concept is just like it sounds: form a company that helps people replace their unused lawns with a useful vegetable garden.

Rather than paying someone to cut your grass, you'd pay someone to help you grow crops. It would effectively put your lawn to work, providing you with fruits, herbs and veggies.

Like any good idea, there are lots of problems with this business: how do you deal with scorching temperatures and finicky soil? Would a team of a few employed gardeners be able to cover enough lawns to make it cost effective? Would a front yard garden look attractive enough to replace a cleanly manicured lawn?

Of course, I'm hardly the first to suggest that food should replace lawns (and if this company exists, which I certainly hope is the case, I'm in!). But, when I listen to folks like Pam Warhurst talk, it's easy to imagine that there are solutions to all these problems. Pam's talk is given from a community, not business perspective, but the lessons are definitely there to learn. Most importantly, she emphasizes how much progress can be made with little bureaucracy and relatively small funds.

Definitely inspiring stuff. I expect my business idea will stay in the thought stage, yet I'm delighted to see others making progress on making it a reality.

Sunday, August 12, 2012

This morning's exercise time was supposed to consist of Shira going to the gym, our 7 year old attending childcare at the gym, and me going for a run. As I was dropping the two off, my wife peaked in and confirmed there was child care today. Of course, the website was wrong - there wasn't.

I was just given a free hour with our little one. We could have gone to the park, or kicked around the soccer ball, but instead, I had an activity in mind that I wanted to try. I was hoping we could try our hand at geocaching, and today seemed like the perfect day to do it.

Geoaching is a sort of global hide-and-seek game. You register over at geoaching.com, look up where caches are found, find them, and then contribute back your success. The cache we were after today is located in Arlington Ridge, and apparently contains a coin which has made it way from Finland, and by hopping from cache to cache, needs to make its way back there.

We started off and I didn't try explaining to our 7 year old what we were doing. For one thing, I wasn't sure we'd make it to the park that held the cache, and for another, I wasn't quite sure how to explain what we were doing. About 15 minutes in, when he was starting to drag, and I thought we might actually make it to the park, I informed him of our mission: we were going treasure hunting! This, as you can imagine, boosted his spirits. He was psyched and on board. Of course, I was now worried I had oversold the whole project, for fear we would find nothing.

We made it to the park and I showed him on my phone a map of where we were headed. We walked through park, and followed the instructions which left off into the woods and down a fairly steep hill. By now, our time was up, and I really should have headed back to meet Shira. But, I couldn't resist looking around a bit.

The phone's GPS and c:geo app got us to the general vicinity of the cache. There was even a hint that mentioned something about a bench, which we found too. But, then it was up to us to poke around and see if we could find the actual cache. Having never found a cache, I wasn't actually sure what I was looking for. Was it something super tiny? Buried? In a tree? Our little guy totally got into it and found some suspicious objects, one of which was a mostly buried beer bottle - a clever place to hide a cache, if you ask me. But, it was nothing.

As we were just about to walk away, I noticed something a bit of place wedged in a nook. Sure enough, it was a Tupperware container covered in camo tape. To my sheer amazement, we actually found the treasure!

We cracked it open and found a log book and some random plastic trinkets. I was psyched to fill out the log, and our 7 year old was elated to take home one of the items in the cache. I explained to him that he'd have to put something in its place, and he bravely chose to leave one of his cooler matchbox cars there. It was a perfect exchange.

We took lots of photos, which I won't share here for fear of revealing too much about the cache (go search for it yourself!) and then we packed it up and booked it home.

What a thrill it was to go treasure hunting and actually find something.

Geocaching Hints

In the past, I've casually attempted some geocaching and failed miserably. Here are a few tips I'd suggest to avoid the false starts I had:

Pick "traditional caches" rather than the other options, like virtual, micro or unknown. These all have a place, but starting off with the classic style I'd think would be the easiest to find. The ability to pickup and drop off some plastic toy is just perfect for kids.

You can choose to "watch" a cache, which essentially e-mails you anytime someone logs some activity with the cache. This is key, as it lets you know you're going after a cache that actually exists, versus one that was there years ago but isn't now. I'm not watching a handful of caches, and when I think I've found one that's been frequented enough, we'll tackle it.

Come prepared. We were lucky, we had everything we needed. But you should plan to have: (a) a geocaching.com account, (b) a mobile app, (c) a pen, (d) a plastic item or two to leave in the cache, (e) a camera, (f) plenty of time! On paper, geocaching seems trivial, when you
get to the actual site, it feels dang near impossible (until you actually find the cache, that is. Then it's back to easy).

Look for caches which are secluded. If a cache is in a high traffic area it's going to be hidden extremely well and it's going to be hard to search for without attracting attention. The area we chose was off the beaten path enough that nobody was there to ask questions of us.

Thursday, August 09, 2012

You might be wondering about the FedEx Tyvek envelop. I’ve stuffed these with leaves before to make an improvised pillow, used them to collect kindling for a fire, and even carried almost a gallon of water in one once, but perhaps the most useful role is as a waterproof “mouse tarp” to sit on.

One of the more tiring aspects of being in the wilderness for me has always been standing around instead of sitting down when I stop to rest, due to everything being damp or filthy. Although it obviously wouldn’t be the end of the world to get your butt wet by sitting down on a damp log, for me it’s more a matter of dying a death from a thousand cuts.

This got me thinking that it was probably time to add Tyvek mailing bags to my list of usefulobjectslist.

I don't have a good "45 uses for Tyvek bags" list to link to, but here are some of my favorite uses:

As an easy to obtain dry bag while traveling. While we were traveling in Alaska, I realized with the wet conditions I should have brought along a dry bag for my camera. I stopped in at a local Post Office and picked one up. Sure, it's not as ideal as a real dry bag, but sure did the trick in a pinch.

As a giant lunch bag. I love how the video shows how you can create the bag with folds and a single piece of tape. Impressive!

As a stuff sack. You can go the fancy route that ITS Tactical demonstrates, or you can go the super simple route that I use: trim the bag down to a manageable size, drop items in, roll up the bag, seal with a binder clip. I've been using this approach to hold my EDC EDC when I need to put it in a large bag (like a gym bag). See:

Over the years, I've learned that there's often one or two tools that a geek should truly master to reign over a topic. Often the tools are cryptic and have a nasty learning curve, but once you're over it, the tool will pay you back for years to come.

I've got a project that requires some video manipulation, and I've learned that ffmpeg is my new best friend. You can use it to convert, trim, crop, slice video. Want to add a watermark? All you need is ffmpeg. And because you can do all these things from the command line, you can also do them in a shell script, on thousands of files or from within a PHP program.

Sure, the filter syntax is confusing, but it's nice and powerful too.

If you need to tweak videos, chances are, you need ffmpeg. I definitely haven't mastered it yet, but I'm glad to spend the time to try.

The whole thing seemed ideal to me: we could keep focusing on science and research, yet save a few dollars by not pursuing projects which we'd either proved out or completed. I think I may have been the only one pleased. When the policy was announced, confusion ensued, and claims ranging from the US giving up space dominance to the administration just plain shutting NASA down were swirling around. Or as candidate Rick Perry put it::

this administration has set a significantly different milestone by shutting down our nation’s legacy of leadership in human spaceflight and exploration, leaving American astronauts with no alternative but to hitchhike into space.

It's because of this confusion, that I think Curiosity is an especially powerful story. It proves out the notion that unmanned space travel can be just as challenging and riveting as the human variety. Who needs another shuttle launch people won't watch, or a trip to the moon that we've done before, when we can be tackling Mars and beyond?

Monday, August 06, 2012

The Legg Mason DC tennis tournament is no more. Apparently, Citi Group picked up the sponsorship, and named it appropriately enough the Citi Open. Other than the name change, everything else was pretty much the same.

The heat, sun and humidity were their usual extermem (though, at 95°, hardly the hottest we've had all summer). That is, until a storm rolled in and cooled everything off. This triggered an initial 17 minute rain delay (what seemed like 5 minutes of rain, and 12 minutes of court drying). After which, the players took to the court for a few minutes before the skies opened up again. This rain delay was long enough that Shira and I actually left early.

Like past years, we were provided with radios that tuned to a single station that let us listen in on commentary being delivered from the press box above. This definitely makes the matches more enjoyable, especially during the doubles match when the rules vary a bit from what I'm used to. And when I did want some pure tennis, I could just turn it off.

As for the actual tennis play, the doubles match featuring Treat Huey and Dominic Inglot vs. Sam Querrey and Kevin Anderson was fun to watch. Huey being relatively short, and the Kevein and Sam being huge, there was a sort of David and Goliath effect going on. The singles match between Alexandr Dolgopolov and Tommy Haas was also fun watch, especially considering that Haas is considered ancient in the sport (yet, he's younger than me, oy.) We only saw about an hour of play between the two before the rain kicked in.

We definitely had a good time. From what I can tell, though, the attendance at the event keeps shrinking. The rain didn't help this time, but this was far from a packed house event. I wish that would translate to cheaper tickets, but alas, I don't think that's how it works.

Wednesday, August 01, 2012

My usual approach to PDF generation in PHP is to create the document using FPDF. It's free, powerful and flexible enough to do whatever I want.

Yesterday, however, one of my clients came to me with a request where FPDF looked like it wasn't going to work: to fill in a Government PDF form on the fly. Sure, I could have tried to replicate every detail of the form using FPDF, but that was going to be time consuming to say the least. Nope, I needed an alternate approach.

After a bit of research, I found the tool that would save the day: pdftk: PDF Toolkit. This unix-style tool does a number of utility tasks with PDFs: merges and splits them, adds backgrounds and foregrounds, and for my purposes, fills in forms to generate a new PDF.

Installing pdftk would have been tricky, but I managed to find these CentOS instructions, so I was good to go.

The strategy for using pdftk to fill in forms on the fly that I used was this:

1. Use pdftk form.pdf generate_fdf to generate an initial FDF. The form filling process requires two things: (a) a PDF form and (b) the input data, which is provided in a FDF or XFDF format. FDF is a fancy way of packing name/value pairs. For this to work, you of course need to know the exact field names used in the PDF. By generating and examining an FDF document using the above command, you can learn just this.

2. Generate an XFDF file on the fly. I suppose you could generate an old school FDF document, but I think the XML based XFDF document is easier to understand. It should have the shape:

The optional 'flatten' argument turns controls whether the resulting form should be editable or not. This is a cool way to either leave the form tweakable by humans, or to make it appear as though it's a filled in PDF that can't be changed.

While I love FPDF, I've got to admit that the above approach really should be an easier route to take if the document allows for it. Rather than starting with a blank canvas and trying to build a sophisticated PDF, you can hand create one and just plug in the relevant bits on the fly. Definitely worth considering next time you've got a PDF to create dynmically.

When David Thorpe, writer for Something Awful and the Boston Phoenix noticed a contest where the Walmart location with the most new "Likes" on Facebook would win a visit from Pitbull, he found a store location in Kodiak, Alaska and started spreading the word through the Twitter hashtag #ExilePitbull. Soon, Kodiak's Walmart had over 60,000 new "Likes", making it the clear winner of the contest.

Though Walmart and contest cosponsor Energy Sheets had been in touch with Thorpe over email and invited him to attend Pitbull's appearance, they didn't want to shell out to fly him to Kodiak. Instead, Pitbull himself personally paid for Thorpe to come to Alaska. Because Pitbull is a cool nice guy, and knows how to take a joke.

Pitbull turned a potentially embarrassing snafu, into a feel good moment for all involved. When I think of modern entertainers and celebrities, terms like tantrum and spoiled brat come to mind - and here's one that's bucking that trend.