The Dark Clouds of Choice

I enjoy Go (the programming language/tooling). It rapidly facilitates efficient, concise solutions. Whether it’s processing some data, building a simple connector web service, hosting a system monitoring tool (where I might layer it on some C libraries), it just makes it a joy to bang out a solution. The no-dependency binary outputs are a bonus.

It’s a great tool to have in pocket, and is fun to leverage.

I recently pondered why this was. Why I don’t have the same feeling of delight building solutions in any of the other platforms that I regularly use. C# or Java, for instance, are both absolutely spectacular languages with extraordinary ecosystems (I’d talk about C or C++ here, using both in the regular mix, but while there are usually very practical reasons to drop to them they don’t really fit in this conversation, despite the fact that from a build-a-fast-native-executable perspective they’re the closest).

Goroutines? Syntactic sugar over thread pools. Channels? That’s a concurrent queue. Syntactical sugar is nice and lubricates usage, but once you’ve done it enough times it just becomes irrelevant. A static native build? A bonus, but not a critical requirement.

There is nothing I build in Go that I can’t build at a similar pace in the other languages. And those languages have rich IDEs and toolsets, while Go remains remarkably spartan.

The reason I enjoy it, I think, is that Go is young enough that it isn’t overloaded with the paradox of choice: You throw together some Go using the basic idioms and widely acknowledged best practices, compile it, and there’s your solution. Move on. A lot of strongly held opinions are appearing (about dependencies and versioning, etc — things Go should have gotten right in v1), and an evolutionary battle is happening between a lot of supporting libraries, but ultimately you can mostly ignore it. Happily build and enjoy.

Doing the same project in Java or C#, on the other hand, is an endless series of diverging multi-path forks. Choices. For the most trivial of needs you have countless options of implementation approaches and patterns, and supporting libraries and dependencies. With each new language iteration the options multiply as more language elements from newer languages are grafted on.

Choices are empowering when you’re choosing between wrong and right options, where you can objectively evaluate and make informed, confident decisions. Unfortunately our choices are often more a matter of taste, with countless ways to achieve the same goal, with primarily subjective differences (I’ll anger 50% of C# programmers by stating that LINQ is one of the worst things to happen to the language, and is an inelegant hack that is overwhelming used to build terrible, inefficient, opaque code).

We’re perpetually dogged with the sense that you could have gone a different way. Done it a different way. I actually enjoy C++ (I admit it…Stockholm syndrome?), but with each new standard there are more bolted-on ways to achieve existing solutions in slightly different ways.

I of course still build many solutions on those other platforms, and am incredibly thankful they exist, but I never have the completely confident sense that it is optimal in all ways, or that someone couldn’t look at it and ask “Couldn’t you have…” and I could firmly retort. I continue an internal debate about forks not taken.

The Best of the Best of the Best…Maybe?

I’ve talked about the consulting thing on here a lot, and the trouble involved with the pursuit. While I’ve been working with a fantastic long-running client, and have primarily been focused on speculative technology builds (still seeking a firm investment for something amazing — the single hint is “swarm”), I considered keeping skills diverse and fresh by mixing things up and working occasionally through a freelancing group that purports to have the best of the best. Doing this would theoretically remove the bad parts of chasing engagements, pre-sales, badgering for payments, etcThe parts that are a giant pain when you hang your own shingle.

If it was just challenging engagements with vetted clients, cool. Just the fun and rewarding parts, please.

Freelancing groups almost always end up being a race to the bottom, generally becoming dens of mediocrity, so the notion of a very selective group made it more interesting. I like a challenge, and if someone wants to build a collection of Boss Levels for me to battle, the barriers yielding a group that customers would pay a hefty premium for, maybe it’d be interesting.

So I took a look to find that one of their requirements, of a sort, is that you post on your blog how much you want to work with them. This is before you know anything about the credibility of their process, rates, the quality of peers, etc. And this isn’t something you can easily find: they demand that you don’t talk about their process or virtually anything involved with working with them, so in the absence of any information about them (beyond some very negative threads I later found on HN, primarily posts by throwaway accounts), you need to talk about how eager you are to join them.

This is a profound asymmetry of motives. Write a public blog post about how you want to invest in my initiative, and if it’s good enough I’ll let you lend me $800K and then I’ll tell you what’s in it for you.

Who would do that? It is an adverse selection criteria, and it instantly deflated my impression of their selectivity and had me clicking the back button: The sort of desperation where someone would pander like that — while certainly possible among fantastic talents in bad situations — is not a good criteria. To try to harvest cheap link and namespace credibility like that itself makes the service look lame, like a cheap 1990s long distance carrier.

I still want those challenging smaller efforts, however — variety keeps me fresh and loving this field, and some extra cash and contacts is always nice — so instead I’m going to start offering micro-consulting via yafla, pitching it on here as well: Pay some set amount (e.g. $500), describe your problem and supply supporting data, and I’ll spend from four to ten hours on your problem, offering up appropriate deliverables (utility, shell of a solution, decision input, etc). Going for the smaller chunk efforts, of the sort that someone with a corporate credit card can easily pay for, should prove much more tenable than seeking significant engagements that just lag on forever.

Paid For Solutions, Not The Pursuit

A fun read via HN this morn – You Are Not Paid to Write Code.

I’ve touched on this many times here, including an entry a decade ago where I called SLOC the “Most Destructive Metric in Software Development“. A decade of experience has only made me double (neigh, quadruple) my belief in that sentiment: outside of truly novel solutions, SLOC often has a negative correlation with productivity, and high SLOC shops almost universally slow to a crawl until they hit the rock bottom of no progress. Eventually a new guard is brought in, a giant volume of code is trashed, and the same futile pursuit started fresh again.

This time, you see, it’s a giant node.js codebase instead of that silly giant python codebase they pursued the last time, replacing the giant Delphi codebase that replaced the giant Visual Basic codebase that…

This time it’s different.

An entry on here that gets a number of daily visitors is one from 2005 – Internal Code Reuse Considered Dangerous (I’ve always wondered why, and my weak assumption is it’s coworkers trying to convince peers that they need to move on from the internal framework mentality). That piece came from firsthand observations of a number of shops that had enormous volumes of internal frameworks and libraries that were second-rate, half-complete duplications of proven industry options. But it was treated as an asset, as if just a bit more code would give them the swiss army knife that would allow them to annihilate competitors. Every one of those shops eventually failed outright or did a complete technology shift to leave the detritus in the past.

It isn’t hard to figure out how this happens. If someone asks you to process a file from A to B — the B is the part they care about, not particularly how you do it — and you present a solution including some free and appropriate ETL tools and options, there is no glory in that. If, on the other hand, you make a heavily abstracted, versatile, plug-in engine that can (hypothetically and in some future reality where it ever gets finished) process any form of file to any form of output with a pluggable reference engine and calculation derivative, you can pitch the notion of IP. That instead of just providing a solution, you’ve also built an asset.

This is a lie almost all of the time. There is incredibly little code theft in this industry. That giant internal framework, when uncoupled from the internal mythology of a shop, suddenly has negligible or even negative value to outsiders. A part of that is a not invented here syndrome endemic in this industry (I’ve been in the business of trying to sell completed, proven solutions, and even then it’s tough to find customers because everyone imagines that they can build it themselves better), but a larger part is simply that broadly usable, generalized solutions don’t happen by accident.

This is one of those sorts of entries where some might contrive exceptions, and of course there are exceptions. There are cases where the business says “turn A to B” and you discover that you really need to turn A to B-Z, and 0-9, and… There are many situations where novel solutions are necessary. But so many times they simply aren’t.

Some of the most fulfilling consulting engagements I’ve taken on have been fixed deliverable / fixed price contracts. These are a sort that everyone in this industry will tell you never to do, but really if you have a good grip on your abilities, the problem, and you can obtain a clearly understood agreement of scope and capabilities and deficiencies of the proposed build, it is incredibly liberating. Being literally paid for the solution leads to some of the most frictionless gigs.

Things You Probably Don’t Know About Your Digital Camera

Another periphery post about imaging as a recent project brought it into my thoughts. It’s always nice to have broadly interesting, non-confidential material to talk about on here, and while this is well known to many, I’ve discovered in some projects that many in this field aren’t aware of this magic happening in their devices.

To get right to it.

Your Camera’s Imaging Resolution is Lower Than Advertised

The term “pixel” (picture element) is generally holistic — a discretely controlled illumination of any visible shade of color, whatever the mechanism of achieving that result. Your 1080p television or computer monitor has ~1920 by 1080 pixels, or about 2 million “pixels”. If you look closely, however, your monitor has discrete subpixels for the emissive colors (generally Red-Green-Blue, though there is a display technology that adds yellow as well for an RGBY subpixel arrangement). These might be horizontally oriented, vertical, staggered, in a triangle pattern…in any order.

At appropriate combinations of resolution density and viewing distance, your eyes naturally demosaic, blending the individual colors into a discrete full color representation.

The vast majority of digital cameras, however, use the term pixel in a very different way.

To visually explain, here’s a portion of RAW sensor data taken directly from a Nexus 6p. The only processing applied was source color channel gains and scaling from the original 100 by 63 to a more visible 600 by 378.

car_bayer_closer

In the digital camera world, each of these discrete colors is a whole pixel.

If you inspect the pixels you’ll notice that they aren’t full color (though that is obvious just by eyeballing the image). Each unique location is one of either red, green, or blue, at varying intensities. There are no mixes of the colors.

The imaging sensor has pits that can measure photons, but they have no awareness of wavelength. To facilitate color measurements a physical color filter is overlaid over each pit, alternating between the three colors. This is generally a Bayer color filter.

There is another type of sensor that layers wavelength sensitive silicon (much like the layers of classic film), capturing full color at each site, however it is very rarely used and has its own problems.

Green is most prevalent, comprising 50% of the pixels given that it’s the color band where the human eye is most sensitive to intensity changes and detail. Red alternates with green on one line, while Blue alternates with green on the next.

The functional resolution of detailed color information, particularly in the red and blue domains, is much lower than many believe (because of which many devices have physical and processing steps — e.g. anti-aliasing — that further reduce the usable resolution, blurring away the defects).

The Nexus 6P ostensibly has a 4032 x 3024 imaging resolution, but really, courtesy of the Bayer filter, has a 2016 x 3024 green resolution, a 2016 x 1512 blue resolution, and a 2016 x 1512 red resolution. For fine hue details the resolution can be 1/4 expectations, and this is why fully zoomed in pictures are often somewhat disappointing (also courtesy of processing and filtering to try to mask the color channel information deficiencies).

Your Camera’s Imaging Sensor Has Many Defects

Due to defects in silicon, the application of the physical bayer filter, and electrical gain noise, many of the photo sites on your digital sensor are defective.

Some read nothing, while many more see ghosts, reporting some or significant false readings. Readings of a constant brightness target will vary, sometimes significantly, across pixels (yielding a grainy, noisy output image).

falsereadings

This is a random 150 pixel wide reading from the 6p when taking a 1/10s picture of pure darkness. These defective readings cover the entire capture in varying densities, comprising up to hundreds of false data points. Most are permanent, often with new ones appearing as the device ages. Some defects temporarily worsen when the sensor is warm. Most SLRs have a special mode where it will take a full darkness picture and then catalog and remove all hot pixels from the output material. Android also has the notion of remembering hot pixels.

This is the case with every digital sensor, from your smartphone to your high end SLR. I remember being somewhat horrified first looking at a wholly unprocessed RAW image from my SLR, seeing hundreds of fully lit pixels scattered across the image.

Algorithms Saves The Day

The solution to all of these problems is processing, but it does have consequences.

Hot pixels are eliminated both through prior knowledge (a hot pixel database for a given sensor), and through simply eliminating pixels that shine a little too bright relative to her neighbors. They get replaced with an interpolated average of neighbors.

The Bayer pattern source is turned into a full color image via a demosaicing algorithm, and there is considerable academic research into finding the optimal solution. In that case I linked to an army research paper, the military having a significant interest in this field given the broad use of Bayer imaging sensors, and a need to know that the resulting images/data are the highest fidelity possible (especially given that machine vision systems are then analyzing that resulting heavily processed output, and with the wrong choices can be triggering on algorithm detritus and side-effects).

The choice of demosaicing algorithm can have a significant impact on the quality of the resulting image. Do you know what algo your device is using?

After demosaicing, color corrections are applied (both to move between color spaces, and to provide white point corrections), and then the image is de-noised — those fine grainy variations are homogenized (which can yield unique results if the subject itself has a grainy appearance — the algorithm can’t discern whether variations are from the source or from the sensor).

The resulting image is generally close to perceptually perfect, but an enormous amount of human knowledge and guesswork went into turning some very imperfect source data into a good result. The quality of an image from a digital device is as significantly impacted by software as the hardware (many devices have terrible color fringing courtesy of poor demosaicing). Which is why many choose to shoot RAW photos, saving those source single-band pixels as is before destructively applying corrections. This allows for improvements or alterations of algorithms when the magic mix didn’t work quite right for a given photo.

If you look closely at the results, you start to see the minor compromises necessary to yield a workable output.

Election Results

Touchscreen Mania

Just an aside about the US election.

In elections past there was usually some media group with a clear technology advantage (e.g. the NY Times), offering a better, more data-is-beautiful presentation, faster results, predictive analysis that would call states accurately quickly, and so on. That wasn’t the case this election, with even media groups from the UK (the world pays attention to US elections, for obvious reasons) offering timely online tracking and granular and macro visualization. No one seemed to have much in the way of a predictive advantage, though I suppose it really doesn’t matter (nor do county by county results — only the State as a whole matters, outside of Nebraska and Maine. Far too much attention was paid to this when the purpose can only serve to divide): The counted results are all that matters.

It is, in essence, technology becoming a commodity and no longer offering a competitive advantage. It becomes a baseline. An up to the minute, auto-updating real-time feed of every jurisdiction’s results, powerfully charted and graphed and mapped? Eh, big deal.

Nonetheless it was humorous watching the network news coverage as they all plied variations of the same touch bigscreen coverage style, endlessly zooming in and out while making banal observations. Worst of all was CNN where they really wanted to get their money’s worth out of this thing, spending the bulk of their coverage watching someone navigate while making often thoughtless commentary (if the vote count numbers for a county are past a million, it’s highly unlikely your 5% precincts reporting count is accurate. There aren’t another 20 million votes waiting to roll in for Miami-Dade).

And Fox News…. I should caveat that like most of the world now I don’t watch television news, so I’m not up on the biases and opinions about the various networks. Nonetheless, NBC, CNN, CBS, even PBS offered up aesthetically pleasing, subtle and classy but informative displays. I switched to Fox while jumping around and I thought they were playing a flashback to an election decades ago or so. Gaudy graphics, an excess of contrasted colors gave an appearance of a visual time capsule.

But it turns out that this is their current appearance. Amazing.

How Polls Can Be Wrong

Here in Canada we have this notion of a majority government (at the federal levels we elect MPs, and the leader of the party with the most MPs becomes the PM, though the party can turf him or her, replace them, etc. We don’t elect the PM) — basically that the government now needn’t have the cooperation of any other party and can push through their agenda essentially unchecked.

During a period of time a particular party that was usually on the outside looking in – the NDP – saw a resurgence, but a recurring pattern kept occurring: Whenever polling numbers showed them hinting anywhere towards majority levels, support would immediately wane. It was their psychological threshold, polling results providing the feedback loop that constantly shifted the votes of people somewhere in the middle.

People liked some of their ideas, saw it as a protest vote, wanted to be different, etc. But they didn’t want them actually having power.

I certainly don’t intend for this to dismiss people’s legitimate reasons for voting, or intentioned, purposeful choices, of which there are countless in every camp, but we keep seeing these sorts of polling feedback loops where votes don’t align with expectations. Where we wonder what did the pollsters get wrong.

On the day of the Brexit vote, many UKers went to the polls certain that it wouldn’t pass, as that was what all of the polls told them. That there would be, so to speak, no consequences to voting some outrage, etc. The polls absolutely influenced voting.

I suspect the same thing occurred in the US. Many critical states were decided by relatively small counts, and the day began with virtually every media group predicting a Clinton landslide.

If you’re really feeling poorly about the Democratic Party, feel that Bernie was unfairly ousted, and the polls are telling you that Clinton is going to win…why not vote for the alternative? And if you are going to vote for Clinton but have better things to do, why go to the voting box?

She’s going to win anyways, right? The pollsters told you.

Writ large.

Let me repeat that this is not to diminish the real reasons a lot of people voted with purpose and intention and for a variety of reasons. But in a close contest, those many undecided voters are what shift the outcomes, and in this case I suspect the polls weren’t “wrong”, per se, but that they were a perfect example of the observer effect, changing the very thing they’re measuring.

Many Trump supporters have been writhing in outrage about the “MSM” declaring the loss of their candidate before the votes were cast, and are now enjoying a sweet dose of told-you-so. Yet that MSM may have been the key ingredient to this win.

Polls are a bit like the stock market — in an idealized, naive world share price is set only by external events: Earnings, new products, etc. But in the actual world the share price itself has a significant impact on the share price, in a recursive feedback loop: Is it near recent high/lows? How does it compare to other shares on the market, or the market as a whole? Is it nearing thresholds and limits where people are changing positions?

The bizarre and repeated notion like polls are scientifically detached from the thing they measure is bizarre and wrong. They are an output and an input.

Canadian Risk Aversion / Canadian Anti-Innovation

I love my country.

My admiration for Canada isn’t at the expense of other countries — there are many wonderful countries and peoples and cultures, nature is just as beautiful in countless places around the globe, etc — and it is certainly just a lazy convenience of place of birth.

I harbor no Canadian superiority complex (and am thoroughly embarrassed when I see it plied by others, and nationalism is fundamentally an unpleasant thing), but I’ve always had a bias to take worse jobs for worse companies in worse situations if it kept me in Canada.

But Canada is profoundly and self-destructively risk averse, and still clutches onto a hewers of wood, drawers of water mentality. When innovation in Canada happens you’ll likely find a first or second-generation immigrant as a primary ingredient of the mix1. People who have yet to succumb to this native inability to do anything outside of the box.

Research In Motion was founded by a duo including Mike Lazaridis, who was born in Greece. ATI was founded by K. Y. Ho, who was born in mainland China. Magna by Frank Stronach, born in Austria. Flickr/Slack were founded by a pair including an American, and a Canadian child of a unique American and his Canadian wife. To go back further, Alexander Graham Bell was born in Scotland.

Canada is a nation of immigrants, so it isn’t surprising that many success stories include relatively recent immigration, but the correlation is so incredibly high that it vastly outnumbers simple proportional representation.

The same traits — reservedness, equality, normalization — that yield some heralded Canadian traits are also, I suspect, the reason why innovation in Canada is an anachronism. Why many in the technology field migrate elsewhere for funding, opportunities, and peers. Why any notion of “Silicon Valley North” is mostly rhetoric.

Canadian innovation is largely imported, and when it falters here it’s often exported.

Canadian companies frequently exercise a variation of “take something being done elsewhere…and do it in Canada”. That’s the innovation. The Canadian variation of Dragon’s Den is a bit surreal at times because many of the inventions or initiatives are literal clones of existing, successful businesses in the US and elsewhere, but the elephant goes unmentioned. It isn’t necessary to mention that something is a sad PayPal clone with zero hope of success, because Canadian.

This is something that I’ve noticed throughout my career as an employee. When I worked at a massive Canadian financial group my pay was literally off their charts (but would be absolutely banal, if not entry-level at any US peer), because being a reserved Canadian company the belief was that anything novel or valuable or unique — the sort of things that higher pay employees do — surely must be bought from the outside, likely from a US supplier. I was recruited by a rogue manager, and then had to endlessly deal with new company reps trying to parse how a software architect could make more than their pay grades allowed.

We’ll stick to the easy, simple stuff, or the tried-and-true, thanks. We’re Canadians.

It’s triply obvious in entrepreneurial efforts. When making pitches to many Canadians, the pitch has to be completely vanilla (nothing outside of the box), and the product must be something that is nothing more than an easily parsed clone of an already successful product. But Canadian.

Canadian Facebook. A Canadian LinkedIn. A Canadian Messaging Platform. A Canadian search engine. All of these are doomed ideas, of course, but literally that is the key to getting interest.

These aren’t the things I’m interested in building. Recently I’ve been pitching a very innovative, low (or even negligible) risk initiative with relatively low funding needs, and it’s just remarkable comparing the responses of different nationalities, and it further confirms all of my worst suspicions about Canadian risk aversion (and innovation blandness/myopia).

Responses from UK, US and German hopeful investors — Some variation of “interesting…How will you/what will you/how does it/what is the revenue…?“. They seek out more information, ask questions and get responses, offer counter-proposals. I’ve had people forward me to other people who would be interested in hearing about it.

Canadian hopeful investors — “I wouldn’t be interested in this, nor would anyone I know, and in fact I’ve polled six of my peers and they all say that your proposal is outrageous” (note that this aggressive style of response is based upon essentially no information, just a simple feeler query. It’s the Canadian crab mentality at play).

Getting investments, especially as a solo innovator, is tough sledding, and trepidation, hesitation, a drawn out process, etc, is a given and fully understood. But simple dismissal, often with hostility, is surreal.

I don’t write this observation out of spite or anger or anything of the sort (and ultimately only solicit Canadian options because it would make the legal aspect easier with slightly less friction, but will focus on options in other countries — it’s a world-targeting solution, so there’s no homeland predisposition) but this difference among nations has always amazed me. It isn’t really burning bridges given that the sort of people who write the type of response I mentioned above are the last person I would want to work with, so if it self-selects those sorts out, all the better.

And this is not some new observation based upon that funding experience, or even a career observing this (my best career situation was working with an American company that remained largely American despite a Canadian presence — the crabs had yet to start pulling at legs). Many years ago I remember marveling as an absolutely terrible auction site was hyped by the Canadian industry and press (like Ebay…but Canadian and B2B and B2C or whatever else is cool. You know…not that a Canadian migrated elsewhere to build something innovative, but that it’s maple syrup and beaver Canadian), investors all falling over themselves for a piece of the action. I believe it was started by Rogers Communications, and it might have been bid.com (though I may be remembering wrong). It just left me astonished at the excitement over such a doomed product, but it got attention because it could be framed as a half-rate, incomplete clone of something done elsewhere, and didn’t push the boundary of risk aversion. It was laughably bad, but that was still good enough to take home top honors in the incestuous, boundary-building Canadian tech industry.

One of the recent best examples of the height of Canadian innovation was a flurry of media reports about this company. I mean them no disrespect, but it is the perfect example of what innovation in Canada entails much of the time: Take what that Musk guy is doing, and drop a couple of Canadian city names in. Innovation. And of course every Canadian knows that even these relatively minor ambitions have little chance of actually breaking ground — we’ll wait until it has proven itself for 30 years everywhere else.

Is this really the best we can do?

1 – Remarkably the bit on people who haven’t been indoctrinated with Canadian cultural risk aversion yielded an angry email by someone who apparently read it as a promotion of heightened immigration levels, pro-immigration, etc. It has nothing to do with that discussion2. It is an observation that a part of the Canadian identity is serious risk aversion and a follower mentality, and while it serves well in some aspects of society, it is anathema to technology and innovation.

2 – Despite being born and raised in a small Ontario town populated largely by crabbish leg-grabbers, I gained a rather unique perspective courtesy of a very atypical childhood.

Optical vs Electronic Image Stabilization

The recently unveiled Google Pixel smartphones features electronic image stabilization in lieu of optical image stabilization, with Google reps offering up some justifications for their choice.

While there is some merit to their arguments, the contention that optical image stabilization is primarily for photos is inaccurate, and is at odds with the many excellent video solutions that feature optical image stabilization, including the competing iPhone 7.

Add that video is nothing more than a series of pictures, a seemingly trite observation that will have apparent relevance later in this piece.

This post is an attempt to explain stabilization techniques and their merits and detriments.

Why should you listen to me? I have some degree of expertise on this topic. Almost two years ago I created an app for Android1 that featured gyroscope-driven image stabilization, with advanced perspective correction and rolling shutter compensation. It offers sensor-driven Electronic Image Stabilization for any Android device (with Android 4.4+ and a gyroscope).

It was long the only app that did this for Android (and to my knowledge remains the only third-party app to do it). Subsequent releases of Android included extremely rudimentary EIS functionality in the system camera. Now with the Google Pixel, Google has purportedly upgraded the hardware, paid attention to the necessity of reliable timing, and offered a limited version for that device.

They explain why they could accomplish it with some hardware upgrades-

“We have a physical wire between the camera module and the hub for the accelerometer, the gyro, and the motion sensors,” Knight explains. “That makes it possible to have very accurate time-sensing and synchronization between the camera and the gyro.”

We’re talking about gyroscope data triggering 200 times per second, and frames of video in the 30 times per second range. The timing sensitivity is in the 5ms range (that the event sources are timestamped within that range of accuracy). This is a trivial timing need and should need no special hardware upgrades to be accomplished. The iPhone has had rock solid gyroscope timing information going back many generations, along with rock solid image frame timing. It simply wasn’t a need for Google, so the poor design of the timing insanity was the foundation of data on Android (and let me be clear that I’m very pro-Android. I’m pro all non-murdery technology, really. This isn’t advocacy or flag-waving for some alternative: it’s just an irritation that something so simple became so troublesome and wasted so much of my time).

Everyone is getting in on the EIS stabilization game now, including Sony, one of the pioneers of OIS, with several of their new smartphones, and even GoPro with their latest device (their demos again under the blazing midday sun, and still they’re unimpressive). EIS lets you use a cheaper, thinner, less complex imaging module, reducing the number of moving parts (so better yields and reliability over time. Speaking of which, I’ve had two SLR camera bodies go bad because the stabilized sensor system broke in some way).

A number of post-processing options have also appeared (e.g. using only frame v frame evaluations to determine movement and perspective), including Microsoft’s stabilization solution, and the optional solution built right into YouTube.

There are some great white papers covering the topic of stabilization .

Let’s get to stabilization techniques and how EIS compares with OIS.

With optical image stabilization, a gyro sensor package is coupled with the imaging sensor. Some solutions couple this with some electromagnets to move the lens, other solutions move the sensor array, while the best option (there are optical consequences of moving the lens or sensor individually, limiting the magnitude before there are negative optical effects) moves the entire lens+sensor assembly (frequently called “module tilt”), as if it were on a limited range gimbal. And there are actual gimbals2 that can hold your imaging device and stabilize it via gyroscope directed motors.

A 2-axis OIS solution corrects for minor movements of tilt or yaw — e.g. tilting the lens down or up, or tilting to the sides — the Nexus 5 came with 2-axis stabilization, although it was never well used by the system software, and later updates seem to have simply disabled it altogether.

More advanced solutions add rotation (roll), which is twisting the camera, upping it to a 3-axis solution. The pinnacle is 5-axis which also incorporate accelerometer readings and compensates for minor movements left or right, up and down.

EIS also comes in software 2-, 3- and 5-axis varieties: Correlate the necessary sensor readings with the captured frames and correct accordingly. My app is 3-axis (adding the lateral movements was too unreliable across devices, not to mention that while rotational movements could be very accurately corrected and perspective adjusted, the perspective change of lateral movements is a non-trivial consideration, and most implementations are naive).

With an OIS solution the module is trying to fix on a static orientation so long as it concludes that any movement is unintended and variations fall within its range of movement. As you’re walking and pointing down the street, the various movements are cancelled out as the lens or sensor or entire module does corrective counter-movements. Built-in modules have a limited degree of correction — one to two degrees in most cases, so you still have to be somewhat steady, but it can make captures look like you’re operating a steadicam.

An OIS solution does not need to crop to apply corrections, and doesn’t need to maintain any sort of boundary buffer area. The downside, however, is that the OIS system is trying to guess, in real time, the intentions of movements, and will often initially cancel out the onset of intentional movements: As you start to pan the OIS system will often counteract the motion, and then rapidly try to “catch up” and move back to the center sweet spot where it has the maximum range of motion for the new orientation.

The imaging sensor in OIS solutions is largely looking at a static scene, mechanically kept aligned.

With an EIS solution, in contrast, the sensor is fixed, and is moving as the user moves. As the user vibrates around and sways back and forth, and so on, that is what the camera is capturing. The stabilization is then applied either in real-time, or as a post-processing step.

A real-time EIS system often maintains a fixed cropping to maintain a buffer area (e.g. only a portion of the frame is recorded, allowing the active capture area to move around within the buffer area without changing digital zoom levels), and as with OIS solution it predictively tries to infer the intentions of movements. From the demo video Google gave, their system is real-time (or with a minimal number of buffer frames), yielding the displeasing shifts as it adjusts from being fixed on one orientation to transitioning to the next fixed orientation (presumably as range of movement started to push against the edge of the buffer area), rather than smoothly panning between.

A sensor-driven post-processing EIS system, which is what Gallus is, captures the original recording as is, correlating the necessary sensor data and using attributes of the device (focal length, sensor size, field of views, etc) in post processing can evaluate the motion with a knowledge of the entire sequence, using low-pass filters and other smoothing techniques to make a movement spline within the set variability allowance.

Let’s start with an illustrative sample. Moments before writing this entry, the sun beginning to set on what was already a dreary, dim day, I took a walk in the back of the yard with my app, shooting a 4K video on my Nexus 6p. Here it is (it was originally recorded in h265 and was transcoded to h264, and then YouTube did its own re-encoding, so some quality was lost) –

This is no “noon in San Francisco” or “ride on the ferry” sort of demo. It’s terrible light, subjects are close to the camera (and thus have a high rate of relative motion in frame during movements) and the motions are erratic and extreme, though I was actually trying to be stable.

Here’s what Gallus — an example of sensor-driven post-processing EIS — yielded when it stabilized the result.

I included some of the Gallus instrumentation for my own edification. Having that sort of informational overlay on a video is an interesting concern because it conflicts with systems that do frame-v-frame stabilization.

Next up is YouTube and their frame-v-frame stabilization.

YouTube did a pretty good job, outside of the random zooming and jello effect that appears in various segments.

But ultimately this is not intending to be a positive example of Gallus. Quite the opposite, I’m demonstrating exactly what is wrong with EIS: Where it fails, and why you should be very wary of demonstrations that always occur under perfect conditions. And this is a problem that is common across all EIS solutions.

A video is a series of photos. While some degree of motion blur in a video is desirable when presented as is, with all of the original movements, as humans we have become accustomed to blur correlating with motion — a subject is moving, or the frame is moving. We filter it out. You likely didn’t notice that a significant percentage of the frames were blurry messes (pause at random frames) in the original video, courtesy of the lower-light induced longer shutter times mixed with device movements.

Stabilize that video, however, and motion blur of a stabilized frame3 is very off-putting. Which is exactly what is happening above: Gallus is stabilizing the frame perfectly, but many of the frames it is stabilizing were captured during rapid motion, the entire frame marred with significant motion blur.

Frames blurred by imaging device movement are fine when presented in their original form, but are terrible when the motion is removed.

This is the significant downside of EIS relative to OIS. Where individual OIS frames are usually ideal under even challenging conditions, such as the fading sun of a dreary fall day, captured with the stability of individual photos, EIS is often working with seriously compromised source material.

Google added some image processing to make up for the lack of OIS for individual photos — taking a sequence of very short shutter time photos in low light, minimizing photographer motion, and then trying to tease out a usable image from the noise — but this isn’t possible when shooting video.

An EIS system could try to avoid this problem by using very short exposure times (which itself yields a displeasing strobe light effect) and wide apertures or higher, noisier ISOs, but ultimately it is simply a compromise. To yield a usable result other elements of image capture had to be sacrificed.

But the Pixel surely does it better than your little app!” you confidently announce (though they’re doing exactly the same process), sitting on your Pixel order and hoping that advocacy will change reality. As someone who has more skin in this game than anyone heralding whatever their favorite device happens to have, I will guarantee you that the EIS stabilization in the Pixel will be mediocre to unusable in challenging conditions (though the camera will naturally be better than the Nexus 6p, each iteration generally improving upon the last, and is most certainly spectacular in good conditions).

Here’s a review of the iPhone 7 (shot with an iPhone 7), and I’ll draw your attention to the ~1:18 mark — as they walk with the iPhone 7, the frame is largely static with little movement, and is clear and very usable courtesy of OIS (Apple combines minimal electronic stabilization with OIS, but ultimately the question is the probability that static elements of the scene are capturing the majority of a frame’s shutter time on a fixed set of image sensors, and OIS vastly improves the odds). As they pan left, pause and view those frames. Naturally, given the low light, with significant relative movement of the scene it’s a blurry mess. On the Pixel every frame will be like this under that sort of situation presuming the absence of inhuman stability or an external stabilizer.

I’m not trying to pick specifically on the Pixel, and it otherwise looks like a fantastic device (and would be my natural next device, having gone through most Nexus devices back to the Nexus One, which replaced my HTC Magic/HTC Dream duo), but in advocating their “an okay compromise in some situations” solution, they went a little too far with the bombast. Claiming that OIS is just for photos is absurd in the way they intended it, though perhaps it is true if you consider a video a series of photos, as I observed at the outset.

A good OIS solution is vastly superior to the best possible EIS solution. There is no debate about this. EIS is the cut-rate, discount, make-the-best-of-a-bad-situation compromise. That the Pixel lacks OIS might be fine on the streets of San Francisco at noon, but it’s going to be a serious impediment during that Halloween walk, in Times Square at night, or virtually anywhere else where the conditions aren’t ideal.

The bar for video capture has been raised. Even for single frame photography any test that uses static positioning is invalid at the outset: It doesn’t matter if the lens and sensor yield perfect contrast and color if it’s only in the artificial scenario where the camera and subject are both mounted and perfectly still, when in the real world the camera will always be swaying around and vibrating in someone’s hands.

Subjects moving in frame of course will yield similar motion blur on both solutions, but that tends to be a much smaller problem in real world video imaging, and tends to occur at much smaller magnitudes. When you’re swaying back and forth with a fixed, non-OIS sensor, the entire frame is moving across differing capture pixels at a high rate of speed, versus a small subject doing a usually small in frame motion. They are a vastly different scale of problem.

The days of shaky cam action are fast fading, and the blurry cam surrogates are the hanger-ons. The best option is a stabilized rig (but seriously). Next up is 5-axis optical image stabilization, and then its 3-axis cousin. Far behind is sensor-driven EIS. In last place are post-processing frame versus frame comparison options (they often falter in complex scenes, but will always be demoed with a far off horizon line in perfect conditions, with gentle, low frequency movements).

Often on-camera OIS will be augmented with minimal EIS — usually during transition periods when OIS predicted the future wrong (to attempt to resolve the rapid catch-up), and also to deal with rolling shutter distortion.

To explain rolling shutter distortion, each line of the CMOS sensor is captured and read individually and sequentially, so during heavy movement the frame can skew because the bottom of the scene was pulled from the sensor as much as 25ms after the beginning line of the scene (as you pan down things compress to be smaller, grow when panning up, and skew left and right during side movements). So during those rapid transition periods the camera may post process to do some gentle de-skewing, with a small amount of overflow capture resolution to provide the correction pixels. Rolling shutter distortion is another interesting effect because it’s a pretty significant problem with every CMOS device, but it didn’t become obvious until people started stabilizing frames.

And to digress for a moment, the hero of an enormous amount of technology progress in the past ten years are the simple, unheralded MEMS gyroscopes. These are incredible devices, driven by a fascinating principle (vibrating structures reacting to the Coriolis effect), and they’re the foundation of enormous technology shifts. They’re a very recent innovation as well. Years ago it was stabilized tank turrets that had this technology (okay, some murdery technology is pretty cool), courtesy of giant, expensive mechanical gyroscopes. Now we have cheap little bike mount gimbals doing the same thing.

For the curious, here’s the unzoomed original corrections as applied by Gallus. It was a fun, technically challenging project, despite the frustrations and sleepless nights. It began with some whiteboard considerations of optics and how they work, then field of view, sensor sizes, offset calculations, and so on.

1 – Developing Gallus presented unnecessary challenges. Android lacks reliable event timing, though that has improved somewhat in recent iterations. A lot of the necessary imaging metadata simply didn’t exist, because Google had no need for it (and this is a problem when sharecropping on a platform). As they got new interests, new functionality would appear that would expose a little more of the basic underlying hardware functionality (versus starting with a logical analysis of what such a system would consist of and designing a decent foundation). The whole camera subsystem is poorly designed and shockingly fragile. The number of Android handsets with terrible hardware is so high that building such an advanced, hardware-coupled application is an exercise in extreme frustration.

And given some cynical feedback, note that this post is not a plea for people to use that app (this is not a subtle ad), though that should be obvious given that I start by telling you that the very foundation of EIS is flawed. I go through occasional spurts of updating the app (occasionally breaking it in the process), and having users bitching because an update notice inconvenienced their day kind of turned me off of the whole “want lots of users” thing, at least for an app as so “edge of the possible” as Gallus.

2 – While this post was ostensibly about the Pixel EIS claims, I was motivated to actually write it after seeing many of the comments on this video. That bike run, shot with a “Z1-ZRider2” actively stabilized gimbal (not a pitch for it — there are many that are largely identical) is beautifully smoothed, so it’s interesting to see all of the speculation about it being smoothed in post (e.g. via some frame-v-frame solution). Not a chance. If it was shot unstabilized or with EIS (which is, for the purpose of discussion, unstabilized) it would have been a disastrous mess of blurred foliage and massive cropping, for the reasons discussed, even under the moderate sun. Already objects moving closer to the lens (and in a frame relative sense faster) are heavily blurred, but the entirety of the scene would have that blur or worse minus mechanical stabilization.

There is an exaggerated sense of faith in what is possible with post-process smoothing. Garbage in = garbage out.

3 – One of my next technical challenge projects relates to this. Have a lot of cash and want to fund some innovation? Contact me.

Bill Belichick And The Uselessness of Unreliable Systems

During the normal press call with the head coach of the New England Patriot (an NFL American football team), Bill Belichick, he stated-

As you probably noticed, I’m done with the tablets. I’ve given them as much time as I can give them. They’re just too undependable for me. I’m going to stick with pictures as several of our other coaches do as well because there just isn’t enough consistency in the performance of the tablets, so I just can’t take it anymore

Given that Microsoft paid the NFL $400M to use its Surface hardware, this has become quite a debacle as everyone points and laugh at the Microsoft Surface.

Yet read the rest of Bill’s statement (it’s the final question and answer, and irritatingly has been called a “rant”, a “diatribe”, etc, as our ADD society trends towards being incapable of anything more than a tweet of content #tabletSoBad #paperBetter).

Any rational analysis of his statement yields the conclusion that it isn’t the tablet, but rather the whole that’s the fault: Cameras feed screen grab encoders that populate servers that host plays that are accessed by tablets, all with seconds of leeway. If anything in the stack fails, has congestion or connectivity problems, it’s a critical issue.

The app they currently use is nothing more than a slideshow viewer, so unless Microsoft Consulting was extraordinarily incompetent, if the dependencies are there (reliable wireless, the image server on the other side, etc), any tablet could do this while hardly leaving sleep mode.

Countless pieces can fail, most obviously the enormous risks of wireless technology in a hyper-congested location, and NFL teams have had serious wireless issues for years. Add production deploys of an entire hardware and software stack literally hours before the big event.

This is a recipe for technical failure. This is technical nightmare material.

And to counter another common narrative — Bill is the smartest coach in football (his commentary and affiliations off the field are not quite so notable), so any retort that relies upon criticizing his technical skills, especially given that we’re talking about an image gallery viewer, rings hollow: A common anecdote is about Bill not setting the clock on his Toyota, which to me means “guy has more important things in life than figuring out where the implementation team at Toyota decided to put the clock settings” (which was the same reason most VCRs blinked 12:00 — it just didn’t matter enough for people to waste even minutes of their life).

NFL coaches need information immediately, and if a hardwired printer and legacy system can give it and a tablet can’t, the tablet loses. In our field we often have a hubris that we think the means justify the ends — it’s technology, and it’s new and cool and fresh, so if it doesn’t work too bad you just need to deal, Luddite.

But they don’t have to just deal. Users can reject your system, which is what Bill did. Go back and make a better solution (Microsoft’s reply, as an aside, is about the worst possible response, and is a cliche of the sort of lame retort when users have issues with bad platforms).

This whole debacle is courtesy of the fact that the NFL seriously restricts technology on the sidelines or in the booth, yielding the whole cloak and dagger last minute availability of locked-down, limited use hardware and accessories. In a future variant of the game I expect teams will have their own information systems, expert and statistical engine analysis, etc. It’ll get there.

Everything You Read About Databases Is Obsolete

Six and a half years ago I wrote (in a piece about NoSQL) –

Optimizing against slow seek times is an activity that is quickly going to be a negative return activity.

This time has long since passed, yet much of the dogma of the industry remains the same as it was back when our storage tier was comprised of 100 IO/second magnetic drives. Many of our solutions still have query engines absolutely crippled by this assumption (including pgsql. mssql has improved, but for years using it on fast storage was as exercise in waste as it endlessly made the wrong assumptions around conserving IOs).

There are now TB+ consumer storage solutions with 300,000 IO/second (3000x the classic magnetic drive, while also offering sequential rates above 3.5GB/s…yes, big G) for under $600. There are enterprise solutions serving 10,000,000 IOPS.

That’s if your solution even needs to touch the storage tier. Memory is so inexpensive now, even on shared hosting like AWS, that all but the largest databases sits resident in memory much of the time. My smartphone has 3GB, and could competently host the hot area of 99.5%+ of operational databases in memory.

For self-hosted hardware, TBs of memory is now economical for a small business, while tens of GBs is operationally inexpensive on shared hosting.

I totally made up that 99.5% stat, but it’s amazing how relatively tiny the overwhelming bulk of databases I encounter in my professional life are, yet how much so many fret about them.

Obviously writes still have to write thru, yet when you remove the self-defeating tactic of trying to pre-optimize by minimizing read IO — eliminating denormalization, combined-storage (e.g. document-oriented), materializations and trigger renderings/precomputing, excessive indexes, etc — in most cases writes narrow to a tiny trickle1.

When writes reduce, not only does practical write performance increase (given that you’re writing much less per transaction, the beneficial yield increases), the effectiveness of memory and tier caches increases as the hot area shrinks, and the attainability of very high performance storage options improves (it’s a lot more economical buying a 60GB high performance, reliable and redundant storage tier than a 6TB system. As you scale up data volumes, often performance is sacrificed for raw capacity).

Backups shrink and systems become much more manageable. It’s easy to stream a replica across a low grade connection when the churn of change is minimized. It’s easy to keep backups validated and up to date when they’re GBs instead of TBs.

Normalize. Don’t be afraid of seeks. Avoid the common pre-optimizations that are in the whole destructive to virtually every dimension of a solution on modern hardware (destroying write performance, long-term read performance, economics, maintainability, reliability). Validate assumptions.

Because almost everything written about databases, and from that much of what you read, is perilously outdated. This post was inspired when seeing another database best practices guideline make the rounds, most suggestions circling a very dated notion that every effort should be made to reduce IOs, the net result being an obsolete, overwrought solution out of the gates.

1 – One of the most trying aspects of writing technical blog entries is people who counter with edge cases to justify positions: Yes, Walmart has a lot of writes. So does Amazon, CERN and Google too. The NY Taxi Commission logs loads of data, being in a city area of tens of millions.

There are many extremely large databases with very specialized needs. They don’t legitimize the choices you make, and they shouldn’t drive your technical needs.

The Dead End of The Social Pyramid Scheme

This is a random observational post while I take a break from real work (you’ll hear about that in a big way shortly). I’m revisiting a topic that I touched upon before, and ultimately this is really just a lazy rewriting of that piece.


A few days ago I saw a new commercial for Toronto’s SickKids hospital.

The commercial is powerful.

“This is new and fresh and important, so I’ll share it with the people I know on Facebook”, I thought.

It isn’t original content, obviously, but I thought it was something they’d find interesting.

So I shared it. Seconds later I deleted the post.

I don’t post on Facebook (or Google+, or Twitter) outside of the rare photo of the kids limited to family. By deleting I was returning to my norm.

Most of the people among my contacts have trended toward the same behavior, with a small handful of social feeders alone among the whole. Most now use Facebook for discussion groups and as a feed aggregator: If a site (e.g. Anandtech) shares on Facebook, I just rely upon it appearing in my feed rather than visiting their site. It’s also a great feed for game day news as well.

Individual sharing is trending way down on Facebook. Many other sites are showing the same trend. LinkedIn feels like a graveyard of abandoned profiles, and “celebrities” who have assistants post various self-promotional pieces occasionally (I recently deactivated my LinkedIn profile after realizing that I have gotten zero value from it over my career, yet have gotten a lot of negative consequences including just unnecessary exposure of information random people don’t have any need to know).

We have like, share and retweet fatigue. It sits there as a little judgy footer on every post, each reaction carefully meted out and considered. As a social obligation both on our own posts, and on the posts of our friends and family.

So if I post something and it sits un-liked, should I be offended? Should I fish for likes, building a social crew? If my niece posts something interesting, should I like it or is that weird that I’m her uncle liking her post? If a former female coworker posts an interesting recipe, should I like it or is that going to be perceived as an advance?

If I get a pity like from a relative, should I reciprocate?

Some will dismiss this as overthinking, but what I’m describing above is exactly what this service, and every one like it, is designed to demand as your response. It is the gamification of users, used masterfully, and the premise is that if you make the social counts front and center, it obligates users towards building those numbers up. Some shared blog platforms are now plying this tactic to entice users to become essentially door to door pitchmen to draw people to the platform (as they sharecrop on someone else’s land, repeating a foolish mistake we learned not to make well over a decade ago), lest their blog posts get deranked. People aren’t pitching Avon or Amway now, they’re trying to get you to help them make a foundation for their medium blog or pinterest board or Facebook business group or LinkedIn profile or…

Sometimes it works for a while as a sort of social pyramid scheme. Eventually the base starts to stagnant, the “incentives” lose their luster if not rusting and becoming a disincentive for newer or more casual users. If it isn’t carefully managed, the new users will cast the old guard as obsolete and irrelevant.

I made a Soundcloud account purely to access a personal audio recording across multiple devices, so why do I keep getting notifications of spammy followers, all of whom are front and center on my profile that I don’t want? I don’t want followers or hearts or likes or shares.

Let me qualify that statement a bit: I love when readers think that these blog posts are interesting enough to share on various venues, growing the circle of exposure. That happens organically when readers thinks content is worthwhile, and it’s very cool. But that is something that the reader owns, and doesn’t sit as a social signal of relevance on this page: There are no social toolbars or tags on this post trying to act as a social proof that this is worth reading, beyond that most of you have read these missives for a while and I assume find some value in them.

Users should absolutely have these curating inputs (training the system on the things that they like and dislike), and the feed should of course adapt to the things the user actually enjoys seeing: If zero users find anything interesting that I post, zero people should see it. But by making it a public statement it becomes much more than that, losing its purpose and carrying a significant social obligation and stigma that is unwanted.

Virtually every social site follows the same curve as we all dig the social well, and when it runs dry we simply chase the next experience. Facebook has done well by pivoting the use of the service, but other services (Flickr, Twitter, and others) that attempted the same strategy peaked and then hit a period of stark decline: if someone with less than 100 twitter followers are perceived as “angry and disenfranchised”, new users find more benefits simply waiting out this generation, or moving to something new — a sort of ground zero where everyone goes back to the beginning again — than to try to gain some namespace among established users.

Back in the early days of the Internet, MUDs (definition varies) saw the same curve. Each instance would start as fresh greenfield full of opportunity and excitement. As the initial euphoria settled, soon it was a small set of regular users, maxed out in every regard. Now that the pyramid scheme of fresh meat was exhausted — new users knew that there was little fun or benefit to be had, and went to newer, fresher sites, leaving the existing users with their blessed armor and no skulls to smash — malaise set in. Eventually the universe was wiped and begun anew.

There’s no real aha or “what to do” out of this. I don’t know what to make of it. Clearly the tactic is fantastically successful in the ascent part of the curve, and has been leveraged masterfully by a number of sites, but if you don’t pivot at the right time it ends up turning a site into Slashdot or Kuro5hin — a decayed remnants of a yesteryear internet.

Where Do You Find Your Zen?

We’re All Buddhists Here

Most software developers are Buddhism idealists (in parallel with any other theistic or atheistic beliefs or traditions they may have).

buddha-525883_640

I don’t mean the four noble truths, reincarnation, or any of the theological or even philosophical underpinnings of the dharma, but rather that we like the idea of meditation and zen.

We aren’t trying to achieve a state of mindfulness or being at one with your breathing or heightened sense of self. Instead most are seeking nothing more than “thinking without distraction for a short while” (which, I should state again, is not at all the traditional meaning of meditation, which more accurately could be called “clearing your mind of thought”, but when discussing this idea with developers it is the simple ability to think clearly that is the goal).

Committed, focused thought is remarkably hard to achieve when we’re a click away from Facebook and Reddit and Hacker News and learning how to create a library in Rust and fixing that minor bug we just remembered that suddenly is a shameful pox on our very existence

The ability to actually think, with focus and dedication, for any period of time is an extremely rare event for most of us. If you try to force yourself into it, the gnawing distraction of all of the things we could and should be doing clouds any attempts at thought.

Take a moment and clear your mind and think with clarity and purpose (tough, right?): Where do you find your zen? Where do you actually spend more than a fleeting moment thinking about anything?

The Thinking Hour

My moment of Zen used to be during the commute. Driving took so little mental effort, the routine so robotic, that the drive saw me processing through personal and professional relationships, project quagmires and technical complexities, opportunities, life plans, etc. It brought a certain clarity to the day, and gave actions a sense of planned purpose that otherwise was missing.

I could only achieve this effect if I was driving, by myself, and the commute was long enough. Add a passenger, or make me the passenger (including on public transit or conceptually a self-driving car), and instantly the options of distraction, even if purposefully shunned, eliminated all clarity of thought benefits.

It had to be an exercise that took long enough, where distractions weren’t possible and where some minimum level of focus was required. If I could read email and respond to texts during the drive — if it weren’t irresponsible and dangerous for other people on the road, say if my car were self-driving — it would have ruined it.

The radio morning shows were terrible, and I’ve yet to hear a podcast that isn’t ten seconds of content fluffed up to sixty minutes, so I often drove with just some classical music on CBC Radio 2 playing quietly in the background.

I hated the time wasted commuting, and the guilt about the environmental consequences, but I always enjoyed the period of thought. The concept of spending that time being angry listening to sports radio (Ebron did not commit an OPI) or an audiobook sounded terrible to me.

Then I started working at home and lost the benefits of the commute. I tried to find surrogates by forcing myself, but laying in a hammock, in a warm bath, etc, always ended up being an exercise in focusing on things I should be doing instead. It was futile.

I, like probably all of you, poured over Tricycle articles on meditation, deep thought, and so on, to no avail. All of the singing bowls and gongs couldn’t relieve my brain.

Unintentional Zen

We have a very large lawn and a long driveway. Mowing the lawn is about an hour long exercise on a riding lawn tractor. I put on the ear protection, fire it up, and for the next hour I’m Hank Hill driving in concentric squares. When the winter rolls around I’m pushing a snowblower 180 feet down a lane, back and forth and back and forth, followed by shoveling accessory areas.

These were my zen. I didn’t realize it, or their importance, at the time, but I did know that I liked doing them. That I always finished the exercise feeling relaxed and relieved.

Occasionally I’d try listening to music during the process, however the feeling that I needed to be alert for screaming voices as I operated dangerous equipment had me revert to nothing more than ear protection.

I hadn’t realized just how important this was to my mental well being until this summer rolled around. We had an extended drought, and for a good three months there was barely a dribble of rain.

The grass went into hibernation. Mowing wasn’t necessary.

I had no Zen. Stress levels rose. The sense that I was operating without a plan increased. A panic of time flooding away rose. Months passed.

But the rains returned (spoken as Morgan Freeman). The grass grew again.

On my first outing back on the (15) horse(power) it hit me like a tree branch in the face, the relief as pent up considerations were processed and prioritized was enormous. I was thinking through family considerations, personal projects, considering career moves and options, etc.

I hadn’t done this in literally months, and the sense of purpose with direction was overwhelming.

This was my zen. It was a period of time where I was essentially captive with no options for distraction, and where I didn’t have to focus on social niceties or with any deep concentration on the physical activity. It was the only time during an entire week when a thought continued for more than a few seconds. I’ve briefly achieved something similar before while cooking (during time intensive periods where focus and attentiveness was required, but complexity is minimal), and even in online first person shooters where my play is essentially autonomous.

I realized just how critically important this is to my progress and well being.

Disconnected Manual Labour

There is a glorious segment in the third season of House of Cards where some Tibetan Buddhists are creating a mandala. A mandala is a sand or coloured stone paint-by-numbers where you use a chak-pur as the implement.

It’s a beautiful practice, and one of the most appealing aspects of the exercise is that it’s then destroyed (sometimes prematurely), treated as a philosophical (if not mystical) representation of the transitory state of life. It isn’t kept as a fingerprint or ego exercise to shackle the future.

I imagine that being involved with creating a mandala, at least after you’ve achieved the basic skills of performing the task and using the chak-pur, is much like mowing the lawn: A time of just the right amount of focus (neither too much or too little, the chak-pur slowing the process enough that it isn’t just shaping some sand into an area) to have the ability to really think. It’s something I’ve always wanted to do.

I find the same meditative benefit to other manual tasks. Chopping firewood, for instance. Long hikes on trails I already know. When I was a teen I would get up before the sun rose and ride my bike 20km to a beach, and then home again. I’ve always imagined this is the draw for people who run regularly, using it as a period of thought and contemplation.

Knitting and other tasks, once some level of competence is achieved, must fulfill the same purpose as well.

Seven Tips For A Better You

So here’s where I provide the easy solutions and trite pablum to make it seem like I’ve soundly wrapped everything up and made you better person for having read this.

I’m not going to do that. Instead I offer up that you should consider your own hobbies and activities, and determine what your thinking time is, and whether you’re robbing yourself of it.

And if you don’t have one, pick up some sort of hobby or pursuit to provide it (there’s a whole potential business domain around this, as an aside. There are many people who would pay for the privilege of doing manual labor just to give them a purposeful reason to do something and retain the mental capacity for deep thought). I’ve worked in several offices with “quiet thinking areas”, but no one ever actually used them to think (they universally became “make cell phone call” areas), and even if people tried, for most simply having no distractions does nothing to aid focus and might actually impede it.

Sitting with your eyes closed simply doesn’t work for most of us.

EDIT: A timely post appeared on Wired today – What Gives With So Many Hard Scientists Being Hard-Core Endurance Runners?  And to avoid the appearance of following a herd, my post went up at 5:37am (the dog woke me early), while their’s went up at 7am.