Friday, August 31, 2012

Just standing around praying

At least that's what this guy looks like he's doing. Caught this on the way into the Dr.'s office, hardly the place I'd expect to see an unusual insect.

Still, an impressive specimen.



The Mors Kochanski Survival Kit

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.

Even though his Wikipedia page has a photo that makes him look like an 19th century woodsman, he's actually alive and well and on YouTube.

I really dig his idea of a survival kit. It's a nice blend of minimalism, low budget and novelty. Here's a graphic describing it:

And here's a video of him walking through the kit.

The kit is bigger than my day hiking kit, but certainly more versatile. I'd certainly consider carry that kind of weight if I was trampling around the some frozen forest in Norther Canada.

Definitely fun stuff for any outdoor gear head.

Wednesday, August 29, 2012

Review: Wine to Water

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.

More information: winetowater.org

Tuesday, August 28, 2012

An Excellent Way To Get Customers To Lie To You

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.

Monday, August 27, 2012

Mazel Tov!

Apparently our signage worked! Guests made their way to the venue, and yesterday evening, Greg and Mer got hitched!

Such a perfect wedding! Good food, music and friends -- what else could you ask for?

Here's to many years of happiness and adventure to the new couple!

Sunday, August 26, 2012

Come hell or high water Greg and Mer are getting married

A snapshot of Greg and I putting out some signs for his nuptials which begin in a couple of hours.

The rain has since passed and everything is a go for this wonderful occasion!



Thursday, August 23, 2012

Photo Project: Let Strangers Do The Work

I absolutely love the simplicity behind this photography project. Jay over at The Plug crudely attached a disposable camera to a park bench and added the following note:

Good afternoon,

I attached this camera to the bench so you could take pictures. Seriously. So have fun. I'll be back later this evening to pick it up.

Love, Jay / The Plug

The setup looks like this:

The result are fun photos.

This makes me wonder how else a disposable camera could be put to use? Perhaps by leaving one in a geocache?

And as if I needed proof, I just got my hands on some photos from a disposable camera that prove that quality of the shots don't make a bit of difference. It's all about context.

Via: Photojojo.

Wednesday, August 22, 2012

Tool of the Day: Process Monitor -- X-Ray Vision For Windows

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:

The following are configuration registry settings:

HKLM\SOFTWARE\UNREAL\Live\UScreenCapture
DWORD: MonitorNum
DWORD: Left
DWORD: Right
DWORD: Top
DWORD: Bottom
DWORD: FrameRate
DWORD: ShowCursor
DWORD: CaptureLayeredWindows

Yet, setting these values had no effect.

Process Monitor to the rescue, again!

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.

Gotcha of the Day: PhoneGap + iOS: Failing to build from the command line

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:

Build settings from command line:
    ARCHS = i386
    CONFIGURATION_BUILD_DIR = /Users/user1603/dt/bar/foo/app/ios/cordova/../build
    SDKROOT = iphonesimulator5.0
    VALID_ARCHS = i386

=== CLEAN NATIVE TARGET FooApp OF PROJECT FooApp WITH CONFIGURATION Debug ===
...trimmed...

** CLEAN SUCCEEDED **


=== BUILD NATIVE TARGET FooApp OF PROJECT FooApp WITH CONFIGURATION Debug ===
Check dependencies

ProcessInfoPlistFile cordova/../build/FooApp.app/Info.plist FooApp/FooApp-Info.plist
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    builtin-infoPlistUtility FooApp/FooApp-Info.plist -genpkginfo /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app/Info.plist

PhaseScriptExecution "Touch www folder" build/FooApp.build/Debug-iphonesimulator/FooApp.build/Script-304B58A110DAC018002A0835.sh
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv ACTION build
    setenv ALTERNATE_GROUP _developer
    ...about 298 setenv's removed...
    setenv YACC /Developer/usr/bin/yacc
    /bin/sh -c /Users/user1603/dt/bar/foo/app/ios/build/FooApp.build/Debug-iphonesimulator/FooApp.build/Script-304B58A110DAC018002A0835.sh

CpResource /VERSION cordova/../build/FooApp.app/VERSION
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /VERSION /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app
error: /VERSION: No such file or directory

CpResource FooApp/Resources/icons/icon-72.png cordova/../build/FooApp.app/icon-72.png
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/user1603/dt/bar/foo/app/ios/FooApp/Resources/icons/icon-72.png /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app

CopyPlistFile cordova/../build/FooApp.app/Cordova.plist FooApp/Resources/../Cordova.plist
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    builtin-copyPlist --convert binary1 --outdir /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app -- FooApp/Resources/../Cordova.plist

CpResource www cordova/../build/FooApp.app/www
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/user1603/dt/bar/foo/app/ios/www /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app

CpResource FooApp/Resources/icons/icon.png cordova/../build/FooApp.app/icon.png
    cd /Users/user1603/dt/bar/foo/app/ios
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/user1603/dt/bar/foo/app/ios/FooApp/Resources/icons/icon.png /Users/user1603/dt/bar/foo/app/ios/cordova/../build/FooApp.app

Verify exit code of build task 'CpResource icon.png'
Build task failed without generating error messages.

Huh?

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.

Once I installed the required pkg file and re-ran create my application effortlessly built.

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

Review: Kaya - An American Girl

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

I Think This Couple Just May Have Staying Power

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

Stopping To Photograph The Flowers

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.

Of all my photos, these 3 came out the best.

Thursday, August 16, 2012

Gotcha of the Day: PHP Generates Random MySQL Access Denied Errors

Over the last few weeks, one of my PHP + MySQL apps has suddenly started issuing random access denied errors. The timing and query involved seem to change, but the general message is something like:

Error Message:  SQL exec failed: [ ... SQL trimmed ...]:
  Access denied for user 'root'@'localhost' (using password: NO)

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:

 ini_set("mysql.default_host", DB_HOST);
 ini_set("mysql.default_user", DB_USER);
 ini_set("mysql.default_password", DB_PASS);

Then came the big test. I wrote up a quick test that worked as follows:

 <?
  /* Assume the DB connection is ready to use */
  $x = mysql_query("SELECT COUNT(*) from foo");
  var_dump($x);
  mysql_close(); /* Shut her down. */
  $y = mysql_query("SELECT COUNT(*) from foo");
  var_dump($y);
 ?>

Without the ini_set(...)'s in place, the above code failed on the second query. But, with the ini_set(...)'s in place, invoking mysql_query worked because I gave MySQL the recipe for reconnecting.

I was pleased to see that even though there's no ini setting for choosing a default database, the invocation to mysql_select_db() was remembered even after I closed the connection.

Time will tell if my fix above works. But, it certainly feels like its on the right track.

Wednesday, August 15, 2012

Marriage Hacking, Finding The Optimal Shower

Jay McCarthy had a problem: his wife didn't like how long it took him to shower. His solution? Write some code to optimize the process.

But I knew I could do better [than previous attempts]. I just needed some technological help to keep me focused.
Here’s the concept:

Plan out every activity that you’re going to do. I came up with 22 things on days I washed my hair and 15 for other days.

Give yourself 10 seconds per activity.

Have a music file that “announces” what activity you should be doing at each time.

Make it exciting by playing intense music (different music for each activity) during the activity.

End with a horrible alarm so you will get /out/ of the shower immediately.

With this procedure implemented, he's managed to get his showers down from 20 minutes to about 3.

Bravo! I'm impressed! This is exactly the kind of stunt I'd like to pull, though I'm sure I would spend way more time working out a solution than the actual solution would fix.

You can read the code that generates the music file here.

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

Small, But Tasty Action - Pam Warhurst: How we can eat our landscapes

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.

A Blog Worthy Breakfast Sandwich

One of the first rules of blogging: don't blog your meals. And, if you're going to blog your meal, at least have a great photo of it. Well, I'm about to break both rules.

This afternoon, our 7 year old came home from camp and reminded me just how yummy the sandwich he invented this morning was. I agreed, in fact, it was so impressive, I've decided it was blog worthy.

The last few mornings we've been making sandwiches for breakfast instead of the usual cereal and milk. We keep running out of ingredients, so we have to improvise. Here was today's sandwich:

  • Start with a whole wheat burrito style tortilla
  • Add shredded colby jack cheese
  • Add a slice of tomato
  • Microwave till the cheese melts
  • Add herring in wine sauce
  • Add Cholula hot sauce to taste

It's sort of a Mexican meets Brooklyn combination.

And it worked.

Apparently no told him he was supposed to recoil at the thought of eating hearing in wine sauce!

OK, enough blogging about food, I'm getting hungry...

Monday, August 13, 2012

Sunday, August 12, 2012

Finding Treasure in Arlington - A First Geocaching Adventure

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.

If you've got a GPS, you've got zero excuses for giving this game a try. Heck, I bet there's a cache right by where you live, work or play.

Thursday, August 09, 2012

Useful Object of the Day: Tyvek Mailers

A few days ago, I came across this wilderness kit description and found the use of a Tyvek bag to be a novel one:

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 useful objects list.

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:

  • As a Bike bag
  • To build a kite!
  • To create a wallet from. This is perhaps the oldest and best known Tyvek craft projects, and youtube has plenty of examples for you to watch.

Wednesday, August 08, 2012

Arlington's Micro Stonehenge

OK, calling this tiny rock piles Stonehenge is probably a little overkill. Though, they are unexplained and unexpected - so they have that in common. They definitely appear to be tiny carins.

Oh, and there was this clever bit of graffiti near by:

All this seen along 4 Mile Run trail.

ffmpeg - Discovering a new Swiss Army Knife Software Tool

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.

Here's a few examples that come to mind:

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.

Update: Just found 19 ffmpeg commands for all needs - definitely looks like a handy resource for learning some common/useful ffmpeg commands.

Update: I just added AutoHotKey to the above list. It definitely belongs: it's cryptic, yet amazingly powerful.

Tuesday, August 07, 2012

Power, Please?

I'm sitting at my desk, typing away, when the lights dim once, then twice, them click - they all go off. It's 2:20pm, a beautiful day outside, and we just randomly lost power at home.

I took a walk down to the end of the street and confirmed that the stoplights near us are out, too. Also confirmed with a neighbor.

My first guess was that this was due to bridge construction going on near us -- but they didn't seem to be working when I glanced down the street.

Any guesses?

Curiosity Doesn't Disappoint

Having a landing nicknamed the 7 minutes of terror meant that the NASA Mars Rover known as Curiosity was going to be spectacular. Either a spectacular success, or failure, that is.

Monday, they made it official: it was a success, and a spectacular one at that. Seriously, I dare you to watch this video and not be proud:

BuzzFeed has a number of articles on the topic, especially if you're looking for lots of smiling geeks.

About 2 years ago, Obama announced a new space strategy. It involved continuing the plan by Bush to scrap the shuttle and scrapping the moon project scheduled to come next. It focused instead, on some big fetes like going to Mars and landing on an asteroid. Of course, these massive goals would be quite far off in the future, and our immediate focus would be on unmanned missions.

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.

2 years later, this claim is still going strong.

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

Legg Mason becomes the Citi Open - Still Hot and Wet

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.

Thursday, August 02, 2012

Gotcha of the Day: Finding trace statements generated by Adobe AIR's adl.exe

For the most part, I'm quite happy doing mobile AIR development using the Flex 4.6 SDK. I can trivially test the application using adl.exe.

My only complaint? trace statements refuse to show up on the console.

I've double checked to confirm that my framework XML file has debug set to true, and that I'm kicking off mxmlc with -debug=true.

I did manage to get trace statements to appear briefly by running adl.exe -nodebug foo.xml - but, as the option suggests, that turns off debugging and means that stack traces don't appear.

After much poking, I finally found the answer. The trace statements are being generated, and rather than being sent to the console, they are being stored in a log. Specifically:

C:\Users\USERNAME\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt

Apparently this can be tweaked, but that's the first place you should look for it.

Man, it's nice to have trace() to use again - my all time favorite debugging tool.

Wednesday, August 01, 2012

An Even Easier Approach to PDF Generation in PHP

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:

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
  <fields>
    <field name='Name1'>
      <value><![CDATA[Value1]]></value>
    </field>
    <field name='Name2'>
      <value><![CDATA[Value2]]></value>
    </field>
    ...
  </fields>
</xpdf>

Note: to turn on a checkbox, set the field value to 'Yes.' To turn it off, leave it blank.

3. Call pdftk using shell_exec with the right arguments. Something like the following chunk of PHP should do the trick:

  $command = A(PDFTK_CMD, $pdf_path, 'fill_form', $fpf_path, 'output', $out_path);
  if($flatten) {
    $command[] = 'flatten';
  }

  $cmd = join(' ', $command);
  $output = shell_exec($cmd);

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 A Celebrity Behaves

I love this story from buzzfeed about the artist named Pitbull:

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.

Well done.

LinkWithin

Related Posts with Thumbnails