Sep 15, 2014

Equality

A: The equation has changed.
B: What do you mean? Equations don't change. They're equilibrated.

A: It is no longer equal.
B: You must be mistaken. Perhaps what you're trying to say is that you've changed the equation that you're using to solve the problem. The problem space changed.

A: It's the same equation. But it doesn't equal out any more. I'm putting in the same digits as last week. It's coming out differently.
B: That's impossible.

A: I know.

Sep 5, 2014

Dockumentary moments.

I went to see No No : Dockumentary tonight. Our CEO knew the film-maker, so he bought tickets for everyone that wanted to go.  As the director's first feature-length film, he knocked it out of the park.

I had never heard of Dock Ellis before our CEO gave us an opening to watch this film.  I was quite struck with how charming and full of life the man was, as a character.  Throughout the movie, and the stories that are told about him, we're told who he was, as a man.  He's alive, he's irreligious, he's a gifted ball player.  He was well loved, and his loss was a great one.  Watching Dock, we not only get an into his personal life, but also an rare peephole view to the culture that was the Major Leagues in the 70's.  The drugs, the management structure, the racial tensions, the 70's were a time of big changes to a classic American pasttime.  Dock Ellis was at the forefront of those changes.

Most of the film was constructed from footage of Dock from games, photos, and a long interview he did with HBO from 2005.  We see his life reconstructed through interviews with those closest to him - his ex-wives, his sister, his teammates.

Watching them reminisce I couldn't help but wonder about memories.  They're fleeting things.  Does pulling them back up into the present, as each interviewer did, re-write them not just as that moment in time that happened, but also forever defining the moment that was spent in remembering?  Those few seconds that you spent reliving the past, in a way, redefined the past by bringing it into the future, or your present, with you.  How much of future rememberings will, in some way, be influenced by the time that you spent remembering it now?  Pieces of experience that get mosaiced one, on top of the other, like tie die washes on the same heavy canvas.

When these people who knew Dock Ellis are gone, what will be left of him?

In a way, memories are temporal.  But the outcomes of those memories are what we live with.  The trajectory that we find ourselves on is in some way an outcome of the memories that we carry with us -- in a way our day to day is a reflection of the compounding of the moments that we have lived up until this very one.

Dock may be gone, but the lives that he has touched, they go on.  Forever with his memory built into the fabric of them.

Jul 24, 2014

Cognitive Fuel is a Myth, or an Alternative Explanation for Corporate Greed

There is a classic psychology experiment that theorizes that humans have 'cognitive' resources and that these resources can be consumed: either by doing mental work or self-restraint.  This blog post by Serious Pony sums up the research that has been done in this area very well, but here's my attempt to rehash the idea behind cognitive fuel.

The basic experiment goes as follows: two people come in for a psychology problem.  One person is asked to memorize 2 digits.  The other person is asked to memorize 7 digits.  At the end of the 'task', each subject is offered a treat: either a bowl of fruit, or a piece of chocolate cake.  More often than not, the test subject that memorized 2 digits will reach for the fruit.  The test subject that memorized 7 digits will reach for the chocolate cake.  With this as evidence, the researchers concluded that mental energy is limited, and that doing a more grueling cognitive task eats away at the amount of 'mental energy' you have available to resist temptation.

This conclusion is flawed.  There is another explanation.

My objections to this conclusion are rooted in a long running experiment I've been doing on myself.  It involves giving up sugar.  I've gone off and on of no-sugar diets for almost 3 years now.  I always go back to it, and I always go back to it for the same reason.**  That reason, I believe, is the same reason that the students tend to pick the sweet treat when they've done more cognitive work.[1]

In the United States[2] (and perhaps other countries), we are taught what is work and we are taught what is reward.  As students in school, we learn that memorization is work.  We also learn that math is hard.  We are taught, culturally by our parents and the implicit attitudes of most of our teachers, that numbers are not easy.  Given that these are true, then it follows that memorization of numbers is non-trivial work.

Further, as children, we are taught that sweets are a reward.  They are rewards for birthdays, for holidays, for finishing your supper.  For being good at the store.  For cleaning up your room.  We, in the United States, train our children to expect and to look for a reward after they have completed work.  It is a cultural norm that any amount of work or hardship will be rewarded.  That reward is usually (but not universally) something sweet.

Now to bring this back to the experiment. For the first subject, the task of memorizing two numbers is trivial.  This task is so simplistic that the task doesn't qualify as work.  Memorizing seven digits, on the other hand, is hard work.  In the experiment then, one subject did hard work, the other did not do much work (if any).

After completing the task, the subjects were then promptly presented with a choice of reward.  Perhaps it wasn't phrased that way, but that is how the situation is most likely to be interpreted.  The subjects were asked to complete a task, and then walk up to a box (which they cannot see into until they have reached it), and are asked to choose one of the snacks.  I can practically hear the subconscious of the 7 digit memorizers yelling "I've done work, here is my reward".  It's a simple pattern match for your brain: work, reward.  The experiment made me do work, here is my reward.

Seeing the experiment from the lens of work equals reward, the interpretation of the results changes.  Cognitive load is not a limited resource that gets spent.  Rather, our rationalization of what work deserves what reward is piqued.  The study participants, most of them, recognized 7 digits as work and the cake as their reward.  Even if they were on a diet, it's easy for them to rationalize that they had earned the chocolate cake - brains take energy, you know!

Under this re-interpretation, if you want people to buy your product, make them feel like they've earned it.  Or at least, deserve to be rewarded.  Give them some trivial task that we culturally have defined to be difficult or at least 'work', and they'll choose the best reward presented.

If we want people to lose weight, we need to either decouple sweets as a reward mechanism or stop telling ourselves that work deserves reward.  We need to declassify what work is, and what it means to be rewarded.


As a further corollary: Why is corporate greed in America so bad?  Because we all deserve it.


[1] Or a task that, at least culturally, is labeled as being a larger cognitive work load.
[2] Relevant because both of the researchers live and work in the United States*, and that all of the students (or at least a high percentage of them) are US undergrads.

* Baba Shiv [was] an assistant professor at the University of Iowa, Iowa City, IA 52242-1000, and Alexander Fedorikhin [was] an assistant professor at Washington State University, Richland, WA 99352.

** I go back to sweets because without sweets, I never get 'rewarded'.  Not eating sugar is hard, not just because it is addictive, but also because it feels like punishment for doing something wrong.

Jul 23, 2014

Why Hiring Women Is Hard

A lot of arguments around hiring and promoting women are based on their inherent value to the company, as an entity.  This website, hiremorewomenintech.com, strongly makes that case.  As the site points out, women are smart workers, they're competent managers, they are good for the bottom line.  I'll go one for further: they're also cheaper than men.  You can pay them less, in fact, if you're a company reading this, chances are good that you probably do pay them less. Women will bring much hard, paper and books success to your company, at a fraction of the cost of a man.  Why wouldn't you hire them?

This is a hard thing to write about, but it's the truth.

Here's another, harder truth.  It's hard to hear because it cuts at everything our neo-capitalist society tells itself about the point of a business or why we go to work every day -- that it's to make more money for our shareholders.  The hard honest truth about most day to day business workings (especially start up workings), is that we care about making money, and being profitable, but not if it means hiring a woman to do it.  Put in other terms, being profitable and successful in the monetary and business sense is not as important to us as hiring people that we want to be profitable and successful with.  Or rather, people that will by extension make us feel also profitable and successful, by the things that they do and just, maybe who they are.  Hiring and working with women will cheapen our success.  Think about it.  They're worth less. If you need proof of this, just look at our pay rolls.  We pay them less.  We employ them in portions of our company that are not as critical to our success.  That's because, as men, if we hire and promote women into positions that are critical to our success, and we are successful, our own success won't be worth as much, because we had to hire women to help us do it.

Men are worth more.  So if we hire and pay and promote more men, when we are successful, as a business, it will be because we are company of successful and worthful men. What's the point of making money if you can't belong to this club of worthful, successful men who make successful companies?

Jul 6, 2014

Tweak, Run, Repeat

One of the most frustrating things about Android development has to be the opacity around API interactions.  I'm having a lot of trouble at the moment getting a SearchView in the ActionBar to behave the way that I want it to.

Desired experience: The search bar appears as a search icon when you first open the app.  When you click the icon, it expands into a search text box which covers the entire ActionBar.  As you enter a search term, the list view contents update, magically.  If you rotate the phone, the state should be saved (search text box open with text in it, list view has the same results).

Keeping the search query around is rather trivial, but maintaining the open state of the search view has been frustrating.  And it's frustrating that it's frustrating.  There are 2 different methods I can call to show/hide the search view, one of which is called the unhelpful "setIconified".  Then there's the action modes for the ActionBar menu item, which all behave differently.  I'm not sure what's going on yet, but I'm just ... frustrated!  I can't be the first person to try to do this.  It'd be one thing if there was clear documentation around the different interactions between the different states and settings, or if the official documentation wasn't wrong or if it just worked as expected.

If you consider the time to develop a phone app as being a function of the number of times that you change the code, compile and then run the app -- debugging a problem in the Android source is developmentally expensive.  When it's my own code that I'm attempting to debug, or even not something so closely tied to the Activity creation loop, I can hit break points and spend a little more time thinking through the problem.  This bug has turned into a tweak and run time suck.

Things would be different if a re-run didn't take so long or if the API was better documented or had better control handles for manipulating the state of a collapsible action view.


*This post was written in between compile time loops*

Jun 7, 2014

General ideas about teaching programming : 'apps' vs. 'programs'

Apps are hard.  I wrote my first Appery.io app today*.  (It was a version of the homework we ask job candidates at work to complete.)

From a certain perspective, writing an app is rather easy.  You throw up some buttons, wire the data to the views, and ship it.  That wasn't so bad, right?  But the amount of knowledge you need to write an app is a bit daunting.

First, you need an idea.  You need to be able to clearly articulate the audience, the scope of what the app will and won't do.  Second, there's the layout and navigation flow of the app.  A poorly designed navigation experience can kill an application.  You need coding know-how.  What the classes are, how the different underlying APIs work together to make the views happen.  To say nothing of the necessary pre-reqs of understanding programming primitives, like variables, control flow, language syntax.  Finally, unless you're writing a local app, you need to know how the internet works.  What a RESTful API service is, how HTTP works with headers and params.  How to get an API key, how to authenticate.

Appery's a low entry point for building a very simple app, and maybe for copying tutorials you could get something a bit more dynamic, but the seams between knowing a very little to knowing pretty much everything there is to know about writing an app are close together and a bit rougher than you'd hope for a tool this simple.  There's a lot of places where you fail over into JavaScript, or where you need to know what a web proxy is (so that you're can get around making Cross Domain Requests**.)  Writing a mobile app in HTML, CSS, and JavaScript requires a surprising amount of web domain, app, and just plain networking knowledge.

That's asking a lot for new developers.  Admittedly, maybe the target market isn't new developers, it's companies that don't have the developers/time/money/inclination to create a native Android/iOS/Windows phone from scratch for each of the platforms.  It's significantly easier to throw an experienced dev at Appery and get a workable mobile app than to create a native app from scratch.  (Disclaimer: In no way is this an endorsement of Appery's product -- if anything, this experience has only deepened my belief that there's no substitute for a natively written app experience.)

But for a new dev audience (one without an experienced dev who can blunt corners and abstract away the rest of the considerable amount of knowledge that you need to write a native app), Appery seems like a terrifying and frustrating experience.  (Though if you know web development, well, then you know web development).

What would be better for young devs to spend a weekend doing?  Other than learning wire framing and writing very leakily abstracted apps?  They should learn programming.  They should write programs, not apps.  It could use quite a bit of set up to get going, but I really liked the challenge at the Hackette's Spotify Hackathon they held last year (https://github.com/pbos/spotify-hockey).  It basically involves writing a hockey team algorithm.  It's a good problem for a weekend project because a) the end product isn't about presenting your ideas (you just load up the different hockey teams and let them have a tournament style show down), b) it'd involve a non-trivial amount of programming, and c) it's kind of fun.

Or maybe that's a bit too advanced for completely new programmers.  Something like Scratch (http://scratch.mit.edu/) or even some format for writing text adventure games could be fun.  Basically, make it less about building a product, and more about writing a small program, with a code editor and a runtime environment.

/rant


* I work professionally as an Android app developer.

** If you clicked on this link, you just proved my point about needing massive amounts of previous knowledge.  Bonus points to you if you now get why CORS is a problem.  You're probably in the minority.

May 15, 2014

The Dust Mote

It was a small dark cabin.  I'm not sure how long I had been there, nor how long that he had.  Without a doubt, he had been there far longer.  There was a refrigerator stuffed full of bulky dark paper packages, with grease stains forming on the creases.  It was musty, as if daytime was an event that never happened inside the cabin.

We use everything, he said, gesturing downward at a grease stained sack, where charred bones had once sat.  It takes hours, he said, to skin a chicken, to de-feather it, to remove all the innards, and organs.  But we do it.  Not a thing is wasted.  At the end, all that's left is the bones.

What do you do with the innards? I asked.   The workshop was small.  He was talking massive amounts of slaughter, that would have filled the entire back room.There was nothing back there but an old crate, some dust motes, hazing the light from the gas lamp, and a rough hewn hickory trough filled with blackened bones and a greasy burlap.

We sell them, he said.  As he turned toward me, the light from the gas lamp pooled deep in his black eyes.  It takes a long time, he said.  To truly use a chicken.  It's hard work.  There's no stopping til it's finished, each one stripped down to just bones.  Used up.

Sometimes, he said gazing off at the wall as if at a thing unseeable, a speck of dust gets caught in my eye.  It gets caught deep -- it becomes a part of myself.  And in it, I know the creature that the dust came from.  I know it by that mote of dust, it's how I find them again in the dark, to keep at my work.  By that dust, that piece of the hen in my eye.  I can't wipe it free  until it's over, til they're nothing but bones.   By then they're old friends, familiars.  I know their stories, where they're headed next.

The dark pools turned toward me.  I shivered.

That's where I saw you, he said.


87 ways to die in brazil

There are an infinite number of ways to die. A good majority of those ways can be found in Brazil.  I was lucky enough not to directly encou...