Inside the Black Box (Metamorphosis)

Metamorphosis_by_Almacan You learned in grade school that a caterpillar metamorphoses into a moth or butterfly. But what would you find if you were to cut open a chrysalis during that transformational stage? Would you find a half-caterpillar/half-butterfly hybrid? It’s a black box — you don’t know. Caterpillar goes in, butterfly comes out. We don’t ask what happens in between.

But we should.

What you would actually find would be little more than snot – a milky white mucous, with a few dark specs floating in it. The caterpillar dissolves itself into goo, and the cells of the goo reconstitute themselves into a moth or butterfly.

So what happens to the “personhood” of the being inside? Does one creature die while another is reborn, growing out of the mulch of its former self? Does the butterfly have any “memory” of the caterpillar it was? Here’s the really mind-blowing part: Scientists have figured out how to train a caterpillar (via subtle electric shocks) to turn and walk the opposite direction when a certain smell is introduced into their environment. When they later tested for the same learned ability in metamorphosed butterflies and moths, they found a 70% memory retention rate, which had lasted right through the goo phase. Turns out those little specks in the goo are clusters of brain cells, which save memories and then reproduce in the new being.

Monarch_chrysalis1 The biological weirdness continues: If we peel off the skin of a dead caterpillar, we find proto wings, laying in wait. They never emerge on the caterpillar itself, but when the rest of the insect dissolves to goo, the proto-wings cling to the walls of the chrysalis, and then attach themselves to the newly formed butterfly and continue their evolution. The caterpillar starts them, the butterfly finishes them.

The whole process is as spiritual as it is philosophical as it is scientific. Is there anything stranger or more magical in nature? (rhetorical question). Over dinner, as our family discussed this process, we wondered why it isn’t taught in grade school. Why do we just get the black box (input –> output) version? Always look behind the curtain.

Image above: Metamorphosis by Almacan

Inspired by this week’s “Black Box” episode of the always amazing Radiolab.

Miles’ First Poetry Slam

Felt so proud (and awed) by Miles at the New Years Day poetry slam when he pulled this out of his back pocket – not the usual kid/dada stuff he’s usually attracted to, but an honest-to-goodness heartfelt original poem, full of existential questioning. Forgot to record on NY day, so we re-created the reading at home yesterday so he could earn his Writer badge on DIY.org.

Photo365 for 2014

Family resolution: All three of us are doing Photo365 this year – one photo a day for an entire year. Easy when you’re out doing interesting things, a lot tougher when you settle back into the daily grind – everything starts to look the same and it’s on you to find new angles and lighting environments etc. I did the project back in 2011, and will be posting to Flickr again. Amy and Miles are also set up with Flickr accounts and empty sets, ready to go. Wish us luck!

You can track my 2014 progress here.

Servint vs. AWS

Note: This is an honest personal endorsement. I was not paid or offered any incentives for this post.

circuit I’ve been running Birdhouse Hosting for more than a decade now, and most of that time I’ve been hosting my services on a dedicated VPS at Servint.

I absolutely love the reliability and support I get through Servint, but every so often wonder whether I could reduce expenses by moving to Amazon Web Services, which lets you “pay as you go.” But every time I scratch the surface and try to do a real apples-to-apples comparison, I come to the same conclusion: Birdhouse is already in excellent hands, and I would not actually save money by moving, all things considered.
Continue reading

Mt. Tam Loop

Amazing day with family and friends, hiking a rigorous 6.5 mile loop through Mt. Tamalpais. Starting near Stinson Beach and working our way up to the (a) crest, through three distinct biomes (fern/rainforest/giant redwood, California Coastal, and dry rolling hills). Everyone worked for it, rewarded by more beautiful vistas around every corner. In the middle, a 15-foot ladder erected in the middle of Steep Ravine to accomplish the elevation. Kids talked and sung improvised songs and exhausted themselves and got stronger by the step. All of us appreciating yet another amazing trail in our own backyard.

tamalpais

Trail map

Flickr Set

DIY.org

diyorg diy.org is one of the best sites for keeping kids stimulated and engaged in the real world I’ve ever encountered. Beautifully designed and engineered, it breaks real-world maker skills into more than a hundred categories. When kids accomplish three tasks in a category, they get a virtual badge (you can purchase a real version of the badge for $5). This is the site I wish I had thought to build, dangit.

No idea what their monetization strategy is, but huge applause to the engineers and designers behind the project.

Miles (@Milezinator) is spending his Christmas break on a mad DIY badge quest (a blissful escape from Minecraft for us!).

django-allauth: Retrieve First/Last Names from FB, Twitter, Google

Of the several libraries/packages available for setting up social network logins for Django projects, I currently find django-allauth the most complete, with the best docs and the most active development. Doesn’t hurt that the lead dev on the project is super friendly and responsive on StackOverflow!

But not everything about it is intuitive. After wiring up Twitter, Facebook and Google as login providers, I found that first and last names were not being retrieved from the remote services when an account was successfully created. I also, frustratingly, could find only the most oblique references online to how to accomplish this.

There are a couple of ways to go about it – you can either receive and handle the allauth.account.signals.user_signed_up signal that allauth emits on success, or set up allauth.socialaccount.adapter.DefaultSocialAccountAdapter, which is also unfortunately barely documented.

I decided to go the signals route. The key to making this work is in intercepting the sociallogin parameter your signal handler will receive when an account is successfully created. I then installed a breakpoint with import pdb; pdb.set_trace() to inspect the contents of sociallogin. Once I had access to those goodies, I was able to post-populate the corresponding User objects in the database.

This sample code grabs First/Last names from Twitter, Facebook or Google; season to taste:


# When account is created via social, fire django-allauth signal to populate Django User record.
from allauth.account.signals import user_signed_up
from django.dispatch import receiver

@receiver(user_signed_up)
def user_signed_up_(request, user, sociallogin=None, **kwargs):
    '''
    When a social account is created successfully and this signal is received,
    django-allauth passes in the sociallogin param, giving access to metadata on the remote account, e.g.:

    sociallogin.account.provider  # e.g. 'twitter' 
    sociallogin.account.get_avatar_url()
    sociallogin.account.get_profile_url()
    sociallogin.account.extra_data['screen_name']

    See the socialaccount_socialaccount table for more in the 'extra_data' field.
    '''

    if sociallogin:
        # Extract first / last names from social nets and store on User record
        if sociallogin.account.provider == 'twitter':
            name = sociallogin.account.extra_data['name']
            user.first_name = name.split()[0]
            user.last_name = name.split()[1]

        if sociallogin.account.provider == 'facebook':
            user.first_name = sociallogin.account.extra_data['first_name']
            user.last_name = sociallogin.account.extra_data['last_name']

        if sociallogin.account.provider == 'google':
            user.first_name = sociallogin.account.extra_data['given_name']
            user.last_name = sociallogin.account.extra_data['family_name']

        user.save()

Spinning Burning Steel Wool

We did it! Inspired by this Mashable series, and using this tutorial, I built a little rig for spinning burning steel wool today, then took it out to the local park with Amy and Miles after dinner. Amy shot the images while Miles and I took turns spinning. Not nearly as scary as I thought it would be, but we still wore a protective hoodie and goggles, and brought along a gallon of water just in case (none of it needed).

These are all 30-second exposures. The hardest part is getting the distance right – tough to know in advance how far away the subject needs to be, so the tops/sides of several of these are off. More practice needed. Would also like to figure out how to change the color of the sparks. Any chemists in the house?

Flickr set

Thanksgiving Time Lapse, Leaf Fight

Hosted 24 people (including kids) in our little house for Thanksgiving this year. Set up a GoPro in a corner of the room, set to take one shot every 30 seconds until the battery ran out. Stitched the stills together later at 7.5 fps for this quick glimpse. Too bad you can’t see the kid’s table off in the living room – that’s where half the fun was!

Earlier, raked up a big pile of leaves, predicting the kids would find it and dive in. Sure enough, they found their joy – dove in and showered themselves, me, and each other with a hundred thousand maple leaves.

Flickr set

Open Message to Recruiters

Head_Hunters_Album Like many of my colleagues in the tech / web dev industry, my phone rings around 2-5 times per day with cold calls from recruiters wanting to convince me to leave the job where I am happily employed and move to some other job that they think I would be more suited to for some reason. Nowhere on the internet have I listed myself as being in need of work.

I struggle to find the best way to respond to these spammer/recruiters. My options are:

  • Politely explain that I’m not looking, thank you very much
  • Hang up without saying a thing
  • Try to explain why I think cold-calling people is unacceptable

I usually go for the last option, though I’m afraid I never seem to get through to them. For posterity, my argument is this:

When a marketer or recruiter calls a person without being invited to, they are a spammer – pure and simple. You (the recruiter) are stealing my time. If a person wants help from a recruiter, they will reach out for help looking for a job. There is no circumstance in which calling someone’s phone uninvited and for profit can be considered polite (or even acceptable).

Unlike email spam, phone spam steals our time. Refresher course on Kant’s Categorical Imperative:

Act only according to that maxim whereby you can, at the same time, will that it should become a universal law.

In other words, only do things in life that you would want everyone else to do in the same circumstance. Ask yourself what would happen if every person who had something to sell was allowed to call everyone who has a telephone, at any time. No one would be able to get anything done, since our phones would never stop ringing. If you don’t think everyone should be able to cold-call everyone else, then no one should be able to do it.

“Ah,”  you respond, “But I’m different because I’m trying to help!”

Sorry – you’re not helping. If I had posted somewhere that I was looking for a job and needed help, then you would be helping. But with me gainfully employed, your relentless calls are nothing but a nuisance – one that gets more annoying every day.

If you are a recruiter who cold-calls people, please stop. Just stop. When we need help, we’ll reach out to you. As long as you are in the business of cold-calling, you’ll just continue to generate ill will.