Friday, April 24, 2015

Let's Measure That: Soil Moisture

I've got this great view of our X-Garden out my office window. And so far, it's the best looking pile of dirt I've ever seen. In fairness, planting from seed does mean that we've got to sweat it out for a few days to weeks before we'll see any sign of life.

In the mean time, I need to keep the soil most, but not too moist. And we've had a few days of heavy rains which is a good thing, but is it enough to keep the seeds happy? It occurred to me that rather than just worry about this, I could take some action. Surely there's a way to measure how water's in the soil and give me a definitive answer.

And there is. In fact, such a meter is all of $9.00 on Amazon. Today I gave it a try. And verdict is...

Yeah, we've still got some moisture in there, but it's getting on towards watering time.

I've always looked at everything gardening related as one big experiment. No matter the outcome, you learn something. So having more data is better. And everybody knows that experiments need meters. Of course, the next move is to use the meter data to automate watering, but for now, I'm satisfied with just watering the plants the old fashion way.

By the way: we did at least one good thing in our X-Garden. We planted milkweed. Good for us! (And for the butterflies!). Learn about the benefits of milkweed here.

Review: Containment

I'm about 3 years late on this book review. When I got word that the *sequel* to my good friend Christian Cantrell's book was out, I knew I better get off my butt and read the first book in the series. One click on Amazon and a few days later and I held Containment, a Sci-Fi novel, in my hands.

I won't lie. My first thought, given the heft of the book was: Really Christian, you couldn't stick with short stories? Within a few pages I couldn't help but announce to my wife: man, this is the real deal. The writing, the story, the characters, the futuristic details, it was all written so dang well. And by a little over halfway through the book I found I couldn't put it down. Every spare moment I had, I grabbed it and read away. I pushed through the final 40 pages by forgoing lunch because I simply had to know how it ended.

I suppose I should confess it's no surprise that I like the book, as ultimately the hero is a computer programmer. It's not only his coding skills that save the day, but it's his ability to think like a programmer that let's him reason his way out of whatever mess he's in. How could I not root for him? So this character in a well written story was going to be a no brainer for me to enjoy.

I found Containment to be a sort of playground of ideas. Whether it's clever suggestions for addressing global warming (End-of-Life Plans--I so want this), computing ideas or even relationship advice, I never really thought of fiction as being a vehicle for exploring a concept. But Christian shows that it can work. And it makes sense; authors often talk about how they'll start with a character and let them naturally evolve, why not try the same thing with an idea or concept?

At the end of the day, Containment was a fun read. It more than held it's own against anything Sci-Fi I've read and in many cases was better. Perhaps the best compliment I can offer is that I've ordered the second book, and won't be waiting 3 years before I read that one.

Wednesday, April 22, 2015

Slurping in Google Spreadsheet Data in 6 lines of Standard PHP Code

A data analyst and a coder walk into a bar... Actually, scrap that. A data analyst and a coder have to quickly solve a problem. The data analyst has the data in spreadsheet form, but the coder wants a programmer friendly solution. What do they do? The coder could build out a full blown app, first by importing the analyst's data into a database, and then developing a crude UI for the analyst to interact with, but that would be overkill. Remember Programmers should be lazy.

Recently I found myself in this sort of situation. The code I needed to write was basically some trivial PHP. But getting the data in and out was going to be a pain. So I turned to my Digital Swiss Army Knife: Google Spreadsheets for a solution.

I had the data analyst import the data into a Google Spreadsheet. I then used the old school Spreadsheets List API to access the data from within PHP. To make matters especially simple, I had the analyst publish the data to the web and then used the publicly accessible API. The result was that I spent no time worrying about authentication, and could test everything out on the command line using curl.

I used PHP's curl to grab the data and SimpleXML to easily pick through it. There were a couple of speed bumps to get over (like how to access the namespaced elements in SimplXML), but once I figured them out, the solution couldn't have been simpler.

Here's a trivial demo I put together which exercises all this. First, I've got a Sample Data Set, and then I've got some code which slurps in this data and spits out the max and average. Of course, if that's all the info I needed, I'd forgo this whole PHP script. Where this sort of solution really shines is when you need to access multiple tabs from the spreadsheet and either filter or aggregate data in complex ways.

Notice how the actual PHP for picking up the data from the spreadsheet is a measly 6 lines of code. SimpleXML's magic means that while no official API is used, accessing the document is painless.

Happy Hacking!

<?
/*
 * Demonstrate easy access to a Google Spreadsheet
 */

// Before getting into the code, you'll want to:
// (a) make sure the document is published to the web
// (b) figure out the worksheet URL by running something like
// 
//    curl -s 'https://spreadsheets.google.com/feeds/worksheets/[id]/public/full' | xmllint.exe  -format -|\
//       grep '2006#list' | sed -e 's/^.*href="//' -e '/".*//' 
//

$worksheet_url = 'https://spreadsheets.google.com/feeds/list/1IR4JAaJWcScBONP4R3O_IbO4ecyVF5kOBEBzoExjM7E/od6/public/full';

/*
 * OK, we've got our URL so slurp it in and make it an easily accessible
 * document.  Notice how the $gsx namespace is setup for easy use below.
 */
$ch   = curl_init($worksheet_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml  = curl_exec($ch);
$doc  = new SimpleXMLElement($xml);
$ns = $doc->getNamespaces(true);
$gsx = $ns['gsx'];

/*
 * Do something with the data.
 */

header("Content-Type: text/plain");

$nsamples = 0;
$max = false;
$avg = false;

foreach($doc->entry as $e) {
 $nsamples++;
 if($max === false) {
   $max = array('ts' => $e->children($gsx)->timestamp . "", 
                'val' => $e->children($gsx)->pressure);
 } else {
   if(($e->children($gsx)->pressure . "") > $max['val']) {
     $max['ts']  = $e->children($gsx)->timestamp . "";
     $max['val'] = $e->children($gsx)->pressure . "";
   }
 }
 if($avg === false) {
   $avg = $e->children($gsx)->pressure . "";
 } else {
   $avg = (($e->children($gsx)->pressure . "") + $avg) / 2;
 }
}

echo "Num Samples: $nsamples\n";
echo "Max: {$max['ts']} = {$max['val']}\n";
echo "Avg: $avg\n";

?>

Tuesday, April 21, 2015

Front Yard Tea: Surprisingly Good

Keeping on my tasting kick of late, I give you an entry in the Hot Drinks department.

Being an avid tea drinker, I can't believe I've never actually made dandelion tea. While you can get fancy and roast the roots, I opted for the simpler steep the flower heads version. The process couldn't be easier: grab a few dandelion flowers, trim off the yellow parts, drop in a tea filter bag, and let it steep for 5 minutes (I actually let it steep closer to 15 minutes due to a phone call mid-steep).

See:

And the verdict on the flavor: not bad to pretty dang good. The flavor isn't particularly strong, but it's definitely there. There's no bitterness, and it's not a typical black tea flavor. But still, there's *something* there. When you factor in that it comes from a common 'weed,' it's value goes up even further. I'd definitely drink dandelion tea again. For step by step instructions, check out this video.

See, the lawn is already providing tastiness even before the garden is fully planted. Hurray!

Buggy

Monday, April 20, 2015

Gardening Progress: Raised Beds Built, X-Garden Seeded

We've settled on a two pronged strategy for gardening this year. First, we're going to do it Right, and with the help of our friend Dawn, put in some Square Foot Gardens. Then, because I can't leave well enough alone, we're going to have an X-garden for me to play in.

I sent Shira and Dawn off to Home Depot for the Square Foot Gardening supplies and this is how they returned:

I helped pull the wood out of the car and organize it a bit:

I then went back inside and returned some time later to see this sight:

That's Dawn using her power drill, because mine is too small. I retreated back inside to save my manhood (and work on another project). When I returned, the building phase was complete! That wasn't hard at all. (Actually, the trip to Home Depot took far longer than the construction phase of the raised beds).

Later this week we'll pick up the right mix of soil, some plants and we'll be on our way!

Now it was time for the X-Garden. Previously, I had ordered a Big Bag Bed. which while pricier than the small bit of lumber needed for the raised beds, does require zero effort setup (and no mind-losing trip to Home Depot!). I filled it with 9 bags of Nature's Care Raised Bed Soil. It's what Home Depot had, and fit the low effort theme of the X-Garden.

I planted the following seeds: Milkweed (think of the butterflies!), Quinoa, Amaranth, carrots, beans, Borage, Wild Purslane and Golden Berry (aka: Cape Gooseberry).

Will anything grow? Who knows! For now I've got very low expectations. Here's how X-Garden looks once filled and seeded:

As long as we were at Home Depot, we could resist picking up some decorative flowers as we like to do every year. And as usual, it's T & E gardening all the way.

Definitely fun times, and I'm psyched to see the Square Foot Gardening approach coming together.

Friday, April 17, 2015

The Definitive Ranking of Quest Bar Flavors

Do the diet and exercise thing long enough and eventually you'll decide you need to strategically consume protein bars. At least that's what Shira and Dawn tell me. And when you do this, you'll need to find not only a bar that has the stats you're looking for, but ideally doesn't taste awful nor has an ingredient list that belongs in a chem lab. When you get to this point, I'd suggest trying Quest Protein Bars. Any bar that meets Shira and Dawn's high standards has to be good, right?

They tasted a number of bars from the variety pack, and here's how they got ranked. Note: they microwaved the bars a few seconds to soften them up.

And here's their tasting notes:

#1 - Peanut Butter Supreme: Yummy! (there you have it, high praise)

#2 - Peanut Butter & Jelly: Yummy! Whoa, that really does have a jelly taste. Amazing. (I agree. Where did that flavor come from?)

#3 - Chocolate Peanut Butter: Pretty good, but more chocolate than peanut butter tasting.

#4 - Banana Nut-Muffin: Uh, where's the banana flavor? Not impressed. (Though, I was. It's definitely got some banana flavor)

#5 - Apple Pie: Too sweet

While not in the above tasting session, Shira tells me that the Lemon flavor should be ranked #3, and Dawn tells me that Chocolate Chip Cookie Dough should also be ranked #3.

Apparently no flavor is breaking into the top 2 without a heavy dose of peanut butter.

There are more flavors in the variety pack with more tasting updates to come...

Thursday, April 16, 2015

A Simple Recipe for Amazing Adventures

If I squeeze in a 5 mile run and manage to find some pretty looking plants, I call that an overwheming success. But some people, Matthew Kirk in particular, think a little bigger. OK, maybe a lot bigger. Try 150 mile run over three days bigger. Apparently, he just ran from one side of Florida to the other.

This is the sort of craziness insanity impressive feat is normal for Matt who apparently holds the Appalachian Trail speed record of 58 days 9 hours and 38 minutes (not bad for 2,200 miles!).

He appears to have a sort of recipe for tackling this type of project: (1) have simple, yet tried and true, gear list, (2) document a route plan, (3) DO IT, (4), document the results.

The gear and planning is left the simple, so the emphasis is on the adventure itself.

The whole system seems repeatable, even by mere mortals like myself.

Now if you excuse me, I need to open up a new Google Spreadsheet and start planning out my next adventure...

Read the story of Matt's cross-Florida-run here and be amazed. This all fits in nicely with my microadventure theme of late. Or as Matt puts it, "think globally and adventure locally."

Wednesday, April 15, 2015

Evolution, Not Just For Life Anymore

It isn't often you read the following:

... watch this video, which features eleven solid minutes of engineering explanation and is not boring for even a second.

and it turns out to be 100% true. Seriously, Jason Kottke is right, this description of how the Aluminum Can is manufactured is just brilliant.

If that's not evolution playing itself out, I don't know what is. What a thing of beauty.

Watch the Video

Cashew Juice - It seemed like a good idea at the time

Let's say you finish a run and you're outside of a Latin supermarket, say, Food Star. And let's say you go in hoping to pick up a refreshing drink. And let's further postulate that you'd like to find a drink that's: (a) unique, (b) marked Kosher. You may eventually find yourself staring at this bottle:

Cashew Juice, you're going to think to yourself, how perfect!

All I can say is, proceed with caution.

I was in the above situation on Monday night. I came out of the supermarket proudly showing my purchase to Shira and Dawn, when Dawn saved me: you do realized that's marked as concentrate, right? I had not. My plan of cracking open the Cashew Juice would have to wait until I got home.

When I did, I carefully mixed up a glassful. As I went to take a sip I caught a whiff of the substance. Good Lord! It smelled...awful. Seriously, what the heck was I trying to drink? I tried again and took a sip. The the actual liquid tasted better than the smell, but not by a whole lot. I then, per the bottle's suggestion, added a whole bunch of sugar. That didn't improve matters much. As I made my way through the first glass I started to appreciate that I was indeed drinking a sort of citrus type drink. By the end of my first sample, I would almost describe the taste as watered down orange juice.

This begs the question, what I was I actually drinking? I mean, I've eaten cashews before, but this drink didn't taste anything like the nut (which technically isn't a nut). A quick search of Google and realized I was eating this guy:

Apparently that's a Cashew Apple. While I'm used to eating the nut part, apparently there's a big 'ol fruit to eat as well. Having a mental image of a fruit actually helped the drink taste better.

At the end of the day, Cashew Juice is what I'd have to put in the acquired taste department.* I'm apparently not alone in this feeling. I'm currently drinking my second glass, and slowly but surely, I'm beginning to like the taste of it. Who knows, maybe by the time I've gotten through the 14 more(!!) servings that I bought of this stuff, I'll actually like it.

*Or as one comedian put it: This taste awful! Let's eat some more of it!

LinkWithin

Related Posts with Thumbnails