Friday, February 28, 2014

Forget the Distance, It's the Navigation that's the Thing

I've been thinking more about my latest arm-chair discovery, the Albatross. What initially struck me about this bird is the remarkable distances it's able to cover (it can fly thousands of miles without flapping it's wings!). But I've decided that's not really the most impressive feat, what's truly miraculous is their navigational abilities.

I can imagine how a bird, or any object, could potentially cover long distances. That's just physics. But how does an animal leave a random point on Earth, fly thousands of miles, and make its way back to that point to feed its young? Tern island is an itty bitty spec (holy smokes, there's street view! And of course, reviews), and yet birds leave there for weeks at a time, and manage to get back to feed their particular chick. That, my friend, is magic.

Ahhh, but I can hear you already. You've watched enough movies to know that birds use the Earth's magnetic core to navigate with. Not so fast. A bunch of scientists assumed the same thing:

After making foraging flights of several thousands of kilometres, wandering albatrosses (Diomedea exulans) are able to pinpoint a specific remote island where their nests are located. This impressive navigation ability is highly precise but its nature is mysterious. Here we examined whether albatrosses rely on the perception of the Earth's magnetic field to accomplish this task. We disturbed the perception of the magnetic field using mobile magnets glued to the head of nine albatrosses and compared their performances with those of 11 control birds. We then used satellite telemetry to monitor their behaviour.

The birds, it turned out, were not impressed:

We found that the ability of birds to home to specific nest sites was unimpaired by this manipulation. In particular, experimental and control birds did not show significant differences with respect to either foraging trip duration, or length, or with respect to homing straightness index. Our data suggest that wandering albatrosses do not require magnetic cues to navigate back to their nesting sites.

So there it is, a mystery waited to be teased out. In the mean time, I'm just going to stand back and be very, very impressed.

Thursday, February 27, 2014

Need a Silversmith? I've got just the company

I just finished up a little project for my shul: having the silver items that decorate the Torah be polished and repaired. Not knowing anything about silver (except that it tarnishes and should therfore be avoided at almost all costs), this little project turned into quite the education.

Thanks to Yelp and their proximity to where I live, I ended up bringing the silver items to Lawrence Miller & Co in Old Town Alexandria. The process, driven by a committee wasn't the fastest one. It included one trip to get items quoted, another to get one piece cleaned and finally we got a whole batch of items serviced.

The folks at Lawrence Miller couldn't have been nicer to work with. They came across as wonderfully knowledgeable, patient and willing to go the extra mile to give us great service.  And when they weren't the best fit for part of the job, they made that clear too (versus spending big bucks to have them do something another company could do for a much better price). Most importantly, the silver looks as shiny as can be.

I'm still planning to avoid silver at all costs, but now I have pros I can turn to when I've got questions or work needing to be done.

Wednesday, February 26, 2014

The Agony and Ecstasy of Skateboarding

I more or less randomly tripped over this documentary on skateboarding: Freeling. The video consists of a number of kids talking through what skating means to them. Not only is the movie visually stunning, but the dedication and passion of these kids is downright amazing.

Perhaps my biggest take away is this: if you haven't found something that brings you community, flow and utter joy, then you need to keep searching. Maybe it's skateboarding, maybe it's basket weaving, maybe it's programming. Who knows. But your passion is out there. And when you find it, you'll be able to sit in front of a camera and wax on like these guys do.

Enjoy! I'm off to eBay to look up prices on used skateboards for old people.

Freeling from Andrew Lovgren on Vimeo.

(Watch the Video)

Update: Oh, and if you're a parent who's got a kid interested in skating, the above should be mandatory watching. Your child may be on to something huge here; something you may truly want to nurture.

This Bird was Built for Flying

I'm making my way through Empire Antarctica: Ice, Silence, and Emperor Penguins by Gavin Francis, and really enjoying it. I was pretty much blown away when I came across a discussion of one of the animals the author encounters on his trip down to Antarctica (by ship): the albatross.

I have to admit, a picture of these birds doesn't do them much justice. If you ask me, they look like especially determined (or maybe angry?) sea gulls.

But have they got skills. Mad flying skills.

The book mentions the following an anecdote (p35):

A wandering albatross taking off from Bird Island was tracked by a satellite; in one year it circumnavigated the globe flying to Brazil, across the Pacific, past the southern coasts of New Zealand and Australia, and back across the Indian and Atlantic oceans twice without touching land.

While the bird probably did land on the surface of the water at some points, that's still an amazing journey for one animal to make. And this sort of long distance coverage isn't unique to one bird.

Apparently, an albatross uses a flying technique known as dynamic soaring that allows it to fly thousands (yes, thousands) of miles without flapping its wings. That's astounding, no?

For more information, check out this narrative describing the life times of one particular albatross (appropriately named Amelia). The author used flight data and observation to put a storyline behind the bird's behavior. And it's just amazing.

Tuesday, February 25, 2014

The Concealed Handgun Manual and Two Pro-Gun Voices

Ever since earning my Rife Shooting Merit Badge at Boy Scout Camp, I've enjoyed trips to the gun range. Over the years, I've considered getting a concealed permit, but haven't ever gotten around to it. On one the forums I follow, the book The Concealed Handgun Manual by Chris Bird was recommended to an individual looking to learn about the topic. Sure enough, our library had it in circulation so I was able to rent it.

The book opens with a whopping 132 pages of pro-gun advocacy. Some of the arguments presented make a lot of sense, and some practically made me gag (because so many people are on welfare, they've lost the will to defend themselves. Uh, yeah, right). I had to flat out skip the section on TSA, as I couldn't stomach hearing many of the standard talking points again.

And then on page 133 the book flips. It gets into the nuts and bolts of concealed carry; covering topics from choosing a handgun to different drills you should be practicing at the range. This section of the book definitely delivers. While it's no substitute for an extensive class, it opened my eyes up to techniques and ideas I'd never thought about before. The section on what happens after a shooting was perhaps most enlightening, as it's the ramifications of a shooting that I've probably thought least about.

Perhaps the biggest take-away I had from the book was the juxtaposition between two pro-gun stances. You've got The Advocate, which makes his argument in the first 132 pages, and you've got The Realist who speaks for the rest of the book (until the last chapter when The Advocate makes an appearance again.).

To The Advocate, every gun law serves the same purposes: to disarm the American people. To The Realist, laws requiring extensive training (including non-gun topics like hostage negotiation) and ideas such as Gun Insurance are of real value.

To The Advocate, people choose not to fight back with a gun because they are brain washed by the government or liberal polices. To The Realist, pulling a gun should be the last option, and avoiding a fight is considered most ideal.

To The Advocate, all within-the-law shootings are righteous. To The Realist, it's not so simple. Shootings frequently happen under times of intense stress when decision making skills are at their least effective. And it's these decisions that one has to live with for the rest of their lives.

To The Advocate, the concealed carry holder is a hero in waiting, ready to swoop in and save the day. To The Realist, this notion of jumping into other people's fights is an awful idea. As the author states, that scruffy looking man running down the street carrying a gun may be a bad guy, or he may be an undercover copy chasing the bad guy.

To The Advocate, there's no excuse, other than laziness or mental-weakness for not carrying a firearm. To The Realist, there are personality types that simply don't make themselves a good fit for concealed carry.

In short, I read the advocacy section of the book and couldn't help but have the urge to run out and buy a gun. After reading the functional part of the book, I'm not so sure. With great power comes great responsibility, and handgun offers both of these things.

I understand there's a time and place for the simplistic view of The Advocate. Though, I wish when it came to matters of policy, the loudest voice was that the of The Realist.

Monday, February 24, 2014

Running the US National Arboretum: All The Nature, None of the Mud

This past weekend the weather was ideal for some trail running, but with all the snow we've had, we were worried about the amount of mud we'd find along the way. Lately, our trail runs have been especially muddy, which means that we have to slow our pace to a crawl rather than risk ending up on our behinds.

So we wanted the joy of nature without the hassle of goopy trails. Our solution: Run the US National Arboretum in DC. Inspired by this article, we knew that we could log about 4~5 miles in the park without much difficulty.

And sure enough, the Arboretum delivered. The grounds were beautiful, yet for the most part we were on paved roads. Mud problem solved. While most of the trees were bare, the Magnolias and Bamboo were especially green and alive and the sunny and 60°F temperature was absolutely perfect.

I didn't log the specific route we took, but essentially we looped around the park twice. Just pick up a map of the roads and go for it.

Nearing the end of our run we even hit a geocache in area (apparently the one in the Arboretum). It wasn't a trivial find, so that made it all the more impressive when we did finally discover the cache. We also stepped into the Bonsai display, and were awed by the amazing specimens there. The oldest tree appeared to be from the 1700's, which is staggering if you think about it.

All in all, it's an absolutely wonderful location. It's definitely one we should make a habit of running ever few months to see the various changes the scenery has to offer.

Below Dawn and Shira pose in stand of Dawn Redwood Trees. They were considered "one of the greatest botanical finds of the 20th century" -- the trees, not Shira and Dawn.

Yum! That looks like sumac.

Yuck.

See the cache peeking out there? Now go find it.

Random Neighborhood Pic

Seen while strolling through our neighborhood:

Friday, February 21, 2014

Song of the Day: Join Together

So I'm watching some online content and this Sony ad comes on. The ad is interesting enough, but the music, man that music is terrific. It's so good that I find myself willing to play out the entire ad to hear where it's going.

So, what young buck recorded said music? Probably some hip boy band that I would know if I was a 12 year old Girl. A quick Google search for some of the lyrics brought me to this page. The song that so resonated with me? Join Together by the Who. It was released in 1972.

There's just something powerful about a song that you can hear once and be pulled into.

Without further ado, I give you Join Together:

See the Video

And checkout this playlist to get your The Who fix.

The Power of Ancient Thinking

There's no doubt that the Nomad ChargeKey is a clever idea (as is their ChargeCard). My cell phone may have dozens of uses, but once the battery is run down, it's little more than a flimsy paperweight. By having a USB cable, even a short one, I've got a fighting chance at recharging the phone (of course, I'd have to find a USB power source, but that's getting easier and easier).

However, reading about this ChargeKey giveaway, it wasn't the cable itself that impressed me, but this short statement:

They cost only $25 ($2 off for sharing on social media). Or, in the nomadic spirit, they also accept barters as a way for people and businesses to exchange their goods for theirs! Yes, you read that right. So far, they’ve been offered anything “from custom bikes and die-stamped office furniture to wall art and artisanal popcorn”.

And it's true, you can head over to this page and request a barter.

I love this concept for so many reasons. First, it shows that innovation doesn't have to mean fancy tech. In this case, they've added a totally new way to purchase their products using little more than a web form.

Second, it primes their business for serendipity. Sure, they may get a bunch of bogus requests, but they may also get some truly unexpected and wonderful offers.

Finally, I love how it shows a level of trust of their customers. They are assuming the best of people: if I give you the option, you're going to suggest a fair trade with me. Compare that stance to companies who refuse to put up a support phone number or require you go through an automated process before talking to a human. I read that as: "I'm assuming that you'relazy and just want to waste our precious support resources, so let me put as many barriers in your way as possible."

As for the ChargeKey itself, I've fallen in love with my Anker AStro 3E charger, so I think I'm good in that department.

Get Your Soothe On: Relieving Chapped Lips without ChapStick

While in Boston, one of the kiddies had pretty chapped lips and they were bothering her while we were eating out (ahhh, the joys of living in Arctic conditions). Our solution was to swing by CVS afterwards and to pick her up some ChapStick. But, I got to thinking: surely there's an Internet Recommended Workaround for when you don't have ChapStick handy.

And of course, there is: Olive Oil.

I should totally have known this, as Olive Oil is one of those multi-use cool tools. Actually, any vegetable oil, or even butter, would have probably provided some relief.

Another option, in theory, is green tea:

Keep a green tea bag in your purse or desk drawer at work. When lips feel dry or chapped, soak the tea bag in warm water and apply to chapped or dry lips or press between your lips for a few minutes. Green tea contains polyphenols that aid in calming inflamed tissues so that your lips feel instant relief.

Tuesday, February 18, 2014

Boston, President's Day Visit

Shira and I took advantage of our long Presidents' Day weekend to zip up to Boston to visit with our nieces and nephew. As a bonus we'd get a taste of Real Winter; crazy cold temperatures and a foot of snow on the ground.

Given the weather, spending time outdoors wasn't really an option. So we looked around for kid friendly indoor activities.

On Monday we hit up Kids' Fun Stop, a sort of indoor playground. Sure, it was a bit of a mob scene because other Boston parents had the same idea we did, but it truly was perfect. Dovid spent what felt like an eternity playing with the trains, Chana worked away on a large puzzle with Shira, and once Tzipora got an initial run on the big slide under her belt, she couldn't get enough of it.

The reviews of Kids' Fun Stop were mostly good, with a couple really negative ones. I can report that claims of the place being dirty or having no functional toys are way off. It's just what we needed, a wide open space where kids could move and play. It's also not so large that we couldn't keep track of all kids at one time.

For our adventure today we hit up another indoor activity: Jump On In. This spot consists of two large gyms filled with bouncy-house type structures. Unlike like Kids' Fun Stop, this place requires reservations. Our 9am to 11am time slot was perfect.

The structures in Jump On In are actually quite large, so it took the kids a few minutes to acclimate to them. But once they did, the fun really began. Chana and Shira (yes, adults are encouraged to play on the structures) were slide buddies, and tackled some slides that frankly were too scary for me. Dovid had a blast in the air-cannon room, where he got to launch little foam balls at other unsuspecting kids. And Tzipora just loved to bounce away.

It was all super fun, even if the trip was over in a flash.

As we headed out of town the snow started to fall. It was the real deal, coming down in thick white flakes. And unlike in DC, the city didn't appear to panic and come to a screeching halt. As we arrived at the airport, the weather didn't appear to be letting up. Still, this is Boston, weather like this shouldn't phase them. Shira had been tracking our flight, and all day long it said it was on time. As our flight was about to pre-board the announcement finally came: our flight and all others to DC tonight were cancelled. D'oh.

Guess Boston isn't impervious to winter after all.

View Photos

Sunday, February 16, 2014

Our Hot and Sweaty Valentine's tradition

Some couples mark Valentine's Day with a candle lit dinner and extravagant gifts. And every once in a while, we do that too. But not this year. This year we continued the tradition we started last year of doing a couple's kickboxing class at Nova MMA.

Nothing says you're my true love like slugging it out together, right?

Last year, the class just about killed me. The first 20 minutes of it were great. Unfortunately, it was a 60 minute class.

This year I was feeling a lot more confident. With a number of Krav Maga classes under my belt, I figured I could handle a single ladies kickboxing class.

Again, I found that about 20 to 30 minutes in I was really enjoying the class. I was wailing on that bag, and while I'm sure I looked like an uncoordinated oaf, in my mind I was Bruce Lee.

But, of course the class didn't stop after 30 minutes. While I managed to keep pounding away for the entire class, there was no denying that by the end I was mush.

The class was cleverly setup so that Shira and I would alternate a technique. At one point Shira had to throw jab-crossses while I had to do burpees, and then vice versa. I knew I was cooked when doing the burpees was easier than the punches.

Fun fact: after punching away for 45 minutes, the 14oz boxing gloves I was wearing felt like they weighed 20lbs each. Man, was I humbled.

In the end I survived and am totally in awe of the fact that Shira does this sort of routine once or twice a week. I'm fairly certain I don't want to up it to twice a year.

Happy V-Day babe; I've always said you're a knockout!

Friday, February 14, 2014

Gotcha of the Day: Calculating an SHA1 hash of a binary file on iOS in PhoneGap

Calculating an SHA1 hash of a binary file is usually pretty trivial. In PHP, there's a single function call that does all the work. Doing this in JavaScript, within PhoneGap (or Cordova) while on iOS, is non-trivial. At least it was non-trivial to me. Turns out, all the pieces are there, but be careful, there's a nasty bug lurking behind the scenes.

First off, you need to get access to the data within the file. While its tempting to use File.readAsBinaryString, don't bother. Using this method caused the data be encoded when I sent to my server using jQuery's ajax method. You want to use File.readAsArrayBuffer. You can pass this array buffer directly to ajax's data property and it will be passed to the server untouched.

Next, you'll want to use the very impressive CryptoJS library. I was originally thinking that I'd need to write some native plugin to access an Objective-C implementation of SHA1. But, CryptoJS does this and a whole lot more in pure JavaScript. It's truly a thing of beauty.

So now you're thinking you can just do:

function win(file) {
    var reader = new FileReader();
    reader.onloadend = function (evt) {
      var bytes = evt.target.result;
      var hash = CryptoJS.SHA1(bytes); // [1]
    };
    reader.readAsArrayBuffer(file);
};

var fail = function (error) {
    console.log(error.code);
};

entry.file(win, fail);

But you'd be wrong. With a bit more research you'd figure out that you need to convert the ArrayBuffer to a typed array. And CryptoJS's WordArray can be instantiated with just such a type:

 var hash = CryptoJS.SHA1(CryptoJS.lib.WordArray.create(new Uint8Array(data))); // [2]

OK, now we're getting close. There's no JavaScript error, but the checksum of the file will be wrong.

Further analysis will tell you that WordArray doesn't actually work out of the box with typed array buffers. Apparently it treats all typed array as 32 bit ints, instead of the 8 bits we are passing to it. Luckily, you'll find this discussion on the topic and realize that CryptoJS has a special, not particularly well documented, add-on that allows for use with typed Arrays:

To make CryptoJS aware of Uint8Array's, you'll add the following to the top of the file:

<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/core.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/lib-typedarrays.js"></script>

And here's where things get really, really wicked. In Firefox, the above code now works (using [2] instead of [1]). But in your PhoneGap application, it won't work. In fact, in any version of Safari it won't work. Why? Because of this bug:

TypedArray support is broken in Safari due to the initial check in lib-typedarrays.js. In Safari, typeof ArrayBuffer is an 'object'. Here is a patch that works for all browsers.

You'll go ahead and edit lib-typedarrays.js and change:

 typeof ArrayBuffer != 'function'

to:

 typeof ArrayBuffer === 'undefined'

And now your code will work. Here it is all together:

<!-- ... other imports, including the SHA1 implementation ... -->
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/core.js"></script>
<script src="http://crypto-js.googlecode.com/svn/tags/3.1/build/components/lib-typedarrays.js"></script>

function win(file) {
    var reader = new FileReader();
    reader.onloadend = function (evt) {
      var bytes = evt.target.result;
      var hash =  CryptoJS.SHA1(CryptoJS.lib.WordArray.create(new Uint8Array(data)));
    };
    reader.readAsArrayBuffer(file);
};

var fail = function (error) {
    console.log(error.code);
};

entry.file(win, fail);

See, nothing to it, right?

Yeah, what he said! NFL Edition

I know almost nothing about the NFL, it's players or the latest drama going on at any moment. I do, however, know when I hear an opinion I can stand behind and echo. I give you Dale Hansen's statement on Michael Sam, the first openly Gay NFL player:

Chances are, you've already seen the video. But, if you're like me, and apparently living under a rock you may not have. So watch it. And keep in mind, you can replace "openly gay" with any minority, and "NFL" with any job/position.

Wednesday, February 12, 2014

The Ultralight, Zero Cost, Trail Running Cup

About a month ago, I was nearing the end of a trail run and started getting thirsty. Our runs haven't been long enough to justify carrying water, so I knew I'd just have to suck it up. Still, I was running adjacent to a stream and I got to thinking: just how bad would it be if I hopped over and took a drink? Heck, some folks hike the entire Appalachian trail and never treat the water.

In the end, I played it safe and just kept running. But it got me thinking: what if I carried a small cup in my pocket and used it opportunistically to grab a drink? Said cup would need to be pretty compact to justify carrying it on a run. The Sea to Summit folding cup looks intriguing, but is overkill for this half-baked experiment.

While running last night, I hit on an alternate plan: what if made an origami drinking cup from aluminum foil or parchment paper, and then coated the sucker in duct tape to make it more durable? The result would be a free, super light, stick-in-your-back-pocket cup, right?

Right.

Check out this set of instructions for making a cup from paper. The results are gorgeous. Then cringe at what I created:

(I need to get my Sister-in-Law on the case; she'd made me a flawless one, I'm sure.)

Both the aluminum foil and parchment paper versions were water tight, or at least water tight enough to hold a cup of water for a minute or so. And the duct tape means that these shouldn't be all that fragile. And who cares if they last more than one use, as I can always create more.

So now I need to bring one on my next run and find a clean looking stream, an go for it, right? What could possibly go wrong with that plan?

Tuesday, February 11, 2014

A Suit and Tie Pocket Dump

Ahhh, the Pocket Dump, one of my favorite Internet pastimes. I usually have bulging pockets (and sometimes a man bag) overflowing with goodies. But, a couple of nights ago, I was headed to an event in a suit and tie, so I had to go all minimalist.

Here's what was in my pockets:

  • Handkerchief. With the frequency that I blow my nose, this guy is absolutely required. In fact, as I sit at a keyboard in my pajamas and type this blog entry out, it's the only thing I have in my pockets.
  • Cash, Credit Card and a Driver's License all wrapped up in a binder clip. It's the world's slimmest wallet.
  • ChapStick? Nope, it just looks like ChapStick. It's actually ChapKit, a super tiny utility kit.
  • Galaxy S3 minus the case. Man I forget how sleek a phone this is without the bulky bulky I usually use.
  • Schrade Tactical Pen. A pen and self defense option. You never know when these shul-related parties are going to get out of hand. (Actually, I do know when they get out of hand: never.)
  • Not shown: keyfob for the car

So that's the bare bones, don't look like an over-prepared Boy Scout setup.

What's in your pockets?

Moscato is the new Manischewitz

I was surprised to see Trader Joe's is carrying a new (heck, any) Kosher Wine: Sara Bee.

What didn't surprise me is that it's a Moscato. Seems like anytime I find a random bottle of Kosher wine these days it's this variant. The blue bottle of Bartenura being the original in this genre. What can I say, Jews like wine like they like their New Year: sweet and easy to drink.

At $5.99, the Sara Bee is also quite the bargain. Go Trader Joes! You may not be Wegmans, but I love you anyway.

Check out Bartenura.com's Mixology section for Moscato based drink ideas.

Monday, February 10, 2014

Caption Me: Construction Edition

Today on my walk, I snapped a bunch of pictures of the bridge constrution by our house. Google Auto Awesome'd the photos into this:

So, nu, what's a good caption?

A Little Arlington Geek Pride

I was psyched to see that middle school kids, just down the street from us, were getting a chance to learn to program in Scratch. Way to go Arlington Schools, consider me impressed:

With Scratch, the world of programming is just a few clicks away. Instead of just playing games, your kid can make them.

Friday, February 07, 2014

Where The Bridge Ends

They are still finishing up the tear down of the bridge near our house and it continues to be awesome. OK, maybe the jack-hammering at all hours can get old. But who doesn't love watching big machines make a big mess?

And poof, the bridge is gone:

Thursday, February 06, 2014

The Kinder, Gentler version of Microsoft and Apple

First Microsoft was evil. And then they were dead. And now, if their Super Bowl ad is any indication they've been reborn as a force for good:

Thing is, I really liked the ad. You can keep your cute little horsies and puppies, I'll take ground-breaking-life-improving innovation any day. (Though my favorite Super Bowl ad has to be the Duracell one).

And have you seen this video celebrating 30 years of Apple? Apparently it was shot in a single day on iPhones and is also quite impressive.

Perhaps as tech companies grow older they turn into big softies? Or maybe it's me that's grown older and turned into the softie.

I do have one beef with Microsoft's advertising of late. Check out this ad suggesting you buy laptops for your kids:

Let's ignore the premise for a moment and focus on the fact that they are using the song Brave by Sara Bareilles. A fine choice, in theory. But ever since I've seen this heart tugging version create by the U of M Amplatz Children's Hospital, I can't help but look at the song differently. Here, give it a watch:

Now, how can you use that song to sell laptops to kids? At the very least, Microsoft should embrace the video and get laptops to kids in children's hospitals (that's right, I'm suggesting they give to every children's hospital in the country. Why not?).

Wednesday, February 05, 2014

Gotcha of the Day: XCode Refuses To Refresh Provisioning Profiles

Today I needed to add a device to one of the provisioning profiles I'm using for iOS Development. How hard could this be, right?

I headed over to developer.apple.com and added the device to my provisioning profile. Being especially clever, I decided tp change the name of the profile to reassure myself I was using the latest one. I then shut down XCode, opened it up again, and went through the refresh process:

  1. Menu: XCode » Preferences
  2. Accounts Tab
  3. Clicked on my Apple ID
  4. Clicked on my company name
  5. Clicked on View Details
  6. Clicked the little refresh icon

And....nothing. My newly renamed profile wasn't there.

I then tried everything in the book I could think of to get XCode to pull this bad boy in. I renamed the profile back to what it was called before. I restarted XCode multiple times. I rebooted. I was done.

My guess is that there's some sort of time delay between when profiles are changed on the website and they are available for download. But, that's just a guess. All I know is that I wanted to move on with my life and get this app built with the right profile.

I read somewhere that profiles are found on disk at: ~/Library/MobileDevice/Provisioning Profiles, so I decided to go all brute force on this problem.

I manually downloaded the updated provisioning profile to disk. Then moved all the files out of the above directory and put this newly downloaded one in it.

To my great surprise, when I opened up XCode it detected the new certificate. Apparently it didn't mind me going around its back.

Personally, I'm happier working with files on disk than crossing my fingers and hoping that the synchronization logic they have in place for profiles is going to work. Still, after my latest Apple development discovery, I'm in too good a mood to complain about them.

The Greatest Gift Apple Has Ever Given Me

The other day I'm hacking away on my Mac Mini, working on an iOS Phonegap App, when I notice an odd submenu under the "Develop" menu in Safari. It read "Ben's iPad."

Well, isn't that personal, I thought. Drilling down into that menu I then saw the following:

Whoa! That menu was displaying the current web page that was open in my app. I clicked on the menu and a Web Inspector (aka, Firebug like app) popped up. To my absolute amazement, I was able to use the Web Inspector just like I would expect, though instead of accessing my desktop machine, it was accessing my iPad.

There's a name for this: Magic.

Seriously, I set none of this up and am not using Xcode (emacs + eshell + make Baby!). It Just All Worked.

This is astounding. Way to go Safari, count me as extremely impressed!

Tuesday, February 04, 2014

ImageMagick: An App Builder's Best Friend

ImageMagick is one of those must learn tools for every programmer. In the past, it saved my butt while creating a custom Google Map. Tonight I put the package to use to assist in some PhoneGap development I'm doing.

Between the different screen sizes and resolutions, Android and iOS seem to call for an endless number of resized images to fully implement the icon and splash screen requirements. Luckily, ImageMagick makes the image generation a walk in the park, compared to manually updating all these files.

First off, I created a 150x150 pixel image which would serve as the source for my icons and splash screen. I named this bad boy icon.png.

Next, to replace the default PhoneGap icon images with my custom one I ran the following in both the www/res/icon/android and www/res/icon/ios directories:

for f in *.png ; \
 do dim=`identify -format "%wx%h" $f`; \
 convert  -size $dim  ../../icon/icon.png $f ; \
done

That one-liner loops through every image in the directory, determines the target size and then resizes the source icon.png file to the specific dimensions.

Creating a set of splash screens is a tad bit trickier. The icons are all square, so it's trivial to size them down from the large source image. Splash screens, on the other hand, vary in size, as well as orientation.

My solution was to take my large icon image and overlay it on a gray'ish white gradient that was sized to the splash screen dimensions. Here's what that looks like as a bash command:

for f in *.png ; \
  do dim=`identify -format "%wx%h" $f`; \
  convert -composite -size $dim \
     -gravity center gradient:'#a7a7a7-#e4e4e4' \
     ../../icon/icon.png $f ; \
  done

The above code was inspired by this example. ImageMagick allows you to get much fancier than this trivial example, but for my purposes this was all I needed.

One Gotcha I discovered along the way was that my icons weren't updating for iOS. I'd update my www's iOS icon directory, and yet the old icon would still be in use. I fixed this by explicitly resizing the images found in: platforms/ios/MyApp/Resources/icons. I'm not sure this is the cleanest way to solve this problem, but given that it takes only a single command and a few seconds to resize the images, this worked well for my purposes.

Discovering Hallowed Ground

A few days back, my Brother and I are running through Rosslyn when we turn the corner and see this sign:

The sign states that from 1970 to 1975 the ARPANET project was developed at this location. ARPANET is essentially the first version of the Internet.

For a computer programmer who's life is basically made possible by the Internet this is sacred ground.

Just imagining the code that got written, the design decisions that were made and no doubt the deadlines that were missed in that spot practically gives me the chills.

Monday, February 03, 2014

When You Absolutely Positive Must Have Nutella Now

After finishing a trail run I figured I had earned myself a hit of Nutella. Luckily, I had a single serving pack in my man-bag. What I didn't have was a spoon.

Not a problem. I had paper clip, which along with picking locks and disarming bombs can also be fashioned into a perfectly usable eating utensil.

All I did was wrap the foil-top of the Nutella packet around the paper clip and I had a semi-sanitary way of eating the chocolate goodness:

Behold! The motivational properties of chocolate!

It's For the Birds (and Walkers, Hikers and Runners): Mason Neck State Park

Yesterday, we did a relatively short trail run through part of Mason Neck State Park. I hadn't really heard much about the park, but I'd spotted it on Google Maps and have been curious about it for some time now.

The park's claim to fame is birding. A number of the trails lead to bird blinds, and there are active Bald Eagle nests in the park. Confusingly, there's also a Mason Neck Wildlife Refuge, which is located right outside the park, and also offers some trails and birding opportunities. In fact, the wildlife refuge is free, whereas the state park is $5.00 to get into.

What the state park trails lack in mileage they make up for in quality. Seriously, it's among the best marked and maintained trails I've ever been on (and it had one of the nicest and well informed park rangers I've ever met at the gate). You can put all the trails together for 5+ miles of hiking or trail running if you get creative. In theory, you can also add in the trails from the neighboring wildlife refuge. The short and well marked trails make this an excellent spot to take kids or non-hikers.

Yesterday we did the Meadow Trail, which was quite muddy. This made for an adventure that was about half running and half slogging through slippery slop. But the scenery was gorgeous and more than made up for the impeded progress.

Our plan is to head back to the park and cover more of the trails. I'd also very much like to head to this park on a day when I can just plop myself in a bird blind and wait. I'm absolutely positive that given an hour or two, I'd be see and or hear some amazing things.


View Mason Neck - Meadow Trail in a larger map

Bye, Bye Bridge

This weekend they tore down the remaining section of bridge by our house. Here's what the bridge looked like last Friday:

And here's what it looked like Sunday morning:

Pretty awesome, right? And here's some close up shots of the destruction.

Sunday, February 02, 2014

Making Art out of Nothing At All

Shira and I are always a little stumped about what to put on our walls. Sure, we love putting up pictures of family, but shouldn't we expand our horizons? And then one day it hit me: what if we put up pictures from our past travels that didn't include us? You know, if we took all those pictures of clouds and birds and such, and picked out just a few great ones and put them on our walls. Sure, they might not be as nice as a professional photographer's work, but they'd be ours.

Shira went to work combing through hundreds of past photos. It didn't take long before my hopes began to waiver: while we had plenty of pictures to choose from, none seemed worthy of being hung as art. On a whim, we decided to call in a professional. We asked our friend Erin (of Gala picture fame) if she could help us out. She was glad to, and asked only that we send her our favorite pictures and a photo of the space they would be hung in.

By this point, I was pretty sure this was a fool's errand. After all, the pictures were OK, but not great.

A few days later we got back a couple of mockups that displayed the photo layouts on the wall in our dining room.

I was absolutely floored at the results. Erin had cropped, touched up and arranged the pictures in such a way that the sum of them was far greater than the individual parts. I began thinking this project may just work after all!

This weekend, Ryan, Erin's husband, came by to install the photos. I can't tell you how thankful I am for this, as I would have no doubt spent hours measuring and re-measuring, and generally driving myself crazy getting all the pictures in place.

Here's the finished product:

Impressive, no? It's hard for me to believe that I actually took all those photos, as they look so polished.

I'm sure Erin would love to work her magic for you. Just drop her an e-mail asking her about her design services. You can say that I sent you.

Here's what each of the photos are (starting at the top left, and going down, row by row):