## Sunday, May 1, 2016

### More Vegan Than Vegan: Baked Vegan Donuts with Espresso Glaze and Brown Sugar Streusel

While you chumps and chumpettes were furiously refreshing various Radiohead webpages today and obsessing about varying opacities and phantom Twitter accounts, I earned +5 vegan cooking skill by making .... donuts!

Yep, vegan donuts. The author of Minimalist Baker is truly a woman after my own heart and this seemed like a perfect recipe for me to try for a few reasons. Number one: donuts! Number two: you've got to admire the refusal to buy overly specialized equipment like a donut pan. Plus, these donuts only require baking, which (as far as donuts go) is significantly more calorie friendly (i.e., we can spend the calories saved on the ridiculous espresso glaze and brown sugar streusel ... mmmm).

I followed the above linked Minimalist Baker recipe very closely, except for a few minor points. First, I needed a lot more flour than the recipe calls for. I'll make a note of this at the relevant steps below. Second, you can see from the photos that the Minimalist Baker version creates almost a thick icing, rather than a donut glaze, and that's not really what I wanted. I thinned out the glaze by mixing some almond milk in and it turned out perfectly, just like the glaze from a donut shop. Finally, I did not add as much brown sugar to the streusel topping and I added extra flour to help dry it out and give it the crumbly texture. As a result it is not quite the deep brown color as in the Minimalist Baker photos. Apart from these differences, I was very happy with how straightforward the recipe was and how well the donuts turned out (and the 4 non-vegans here definitely agreed!).

First I placed the oil (I used coconut oil), almond milk (instead of soy), agave and sugar into a saucepan and brought it to a light boil (this will boil over quickly if you're not careful).

While that was heating, I mixed the flour and salt in a large mixing bowl

and I also went ahead a prepared the streusel, first by heating up some vegan butter substitute

and then mixing it with the brown sugar and flour in a smaller mixing bowl

Note: I used quite a bit of extra flour, close to a whole extra cup, to aid in drying out the mixture. At first it was very buttery and runny, so the flour was needed to get the crumbly texture. Preparing this early on and letting it sit to dry out further was also a good idea.

After the boiled mixture cools according to the recipe, you add a packet of active dry yeast. If you're not familiar with baking, be careful here. If you add the yeast while the mixture is too hot, you'll kill them, and if you add it when the mixture is too cool, they won't become activated and your dough won't rise. I simply followed the recipe and it worked without any trouble.

If you are nervous though, you can heat up a small amount of water in a separate sauce pan until it is lukewarm, and then pour in the yeast and let it sit for 5-10 minutes to activate, then pour the water into the oil/sugar/agave mixture.

Finally, you add the wet mixture to the large bowl of flour and mix very, very well

Cover the mixture and let it sit for an hour at least. I actually let mine sit for closer to two hours because it did not seem to be rising at first. I added another cup of flour after it had been sitting for 20 minutes and mixed it well again. Basically, when you're mixing it, it should clump into a ball in the bottom of the mixing bowl about half the size of a bowling ball, and when you stop mixing it, the mixture will settle and look a bit like the bottom of the bowl is full of slightly liquid cookie dough.

I also preheated the oven to 350F and let the covered mixing bowl rest on top of the oven, since the recipe calls for a warm place. After the dough rose it looked like this

At that point, I added the remaining flour (again exceeding the amount called for by the recipe) and formed it into balls and placed them on a baking sheet. I added a lot of flour to the counter top and really rolled the sticky dough around to coat it well. I stopped to add flour several times since the dough was especially sticky.

The balls will take a shape more closely resembling a biscuit, but without a special donut pan, there's not a great way to avoid this. Like the Minimalist Baker recipe, I chose not to poke holes in them.

Here they are after baking for about 15 minutes. Not much change in appearance, but they solidified and filled up the whole room with the delightfully sweet scent of donuts.

Finally, I put four cups of powdered sugar in a bowl and added the espresso and a bit of almond milk to thin out the glaze so that it resembled icing less than in the Minimalist Baker recipe:

Dunk the donuts (both sides) in the glaze

and sprinkle on the streusel topping for the finished product:

My crappy camera doesn't do them justice. I was really impressed by how well they turned out. Radiohead can keep their little LP. I'd rather have the donuts :)

## Tuesday, April 26, 2016

### The Patricia Principle

In management theory there is a gem called the Peter Principle: once promoted to the managerial level, managers tend to keep on getting promoted until they hit the first level at which they are incompetent. Of course it is an exaggeration, but the general idea holds reasonably well.

This is bad because in the steady state it means all managers are by definition incompetent.

Recently Amilia St. John provided a breathtakingly powerful scorched earth destruction of some of her own father's views about millenials and women in tech, views that are patently ridiculous and which make me, a white male in tech, cringe with embarrassment at my profession and fill with Pulp Fiction style righteous, indignant rage ("Say victimology one more time...").

One of the most critical aspects of Amilia St. John's rebuttal is also an issue that is extremely difficult to speak about, especially for brass tacks Aspergersy people like me (and no, I'm not referring to Amilia's father's absurd remarks about how to effectively enslave workers with Asperger Syndrome ... I've learned how to deflect that shit long ago).

Instead I am talking about the idea that women in tech are promoted because of soft skills instead of their actual tech skills. Amilia St. John describes this:
So let’s say a woman does successfully complete a CS degree and enter the career pipeline in the first place, and let’s pretend that her “self-imposed victim complex” doesn’t weed her out early. What happens to her next?
Unfortunately the prognosis remains bleak. After entering the field, women begin to get weeded out of engineering roles in favor of client-facing roles that “perfectly suit” their “stronger social skills”. In my father’s recruiting slides, he advocates for this exactly, quote,
“Technical women are often quickly promoted for a variety of reasons. Stronger social skills often make them better architects, technical writers, QA, or technical support people.”
I want to henceforth refer to this as the Patricia Principle [or other Peter Principle alliterative analogue :)] so we can give it a name and promptly shame that shit out of existence.

The Patricia Principle is frightening in its subtlety.  For one, it involves promoting women in technology, which means if you criticize it, you automatically get a standard whack-a-mole bashing for being a backward, bigoted neanderthal for criticizing something that elevates women in a field in which they have been disadvantaged for too long. What an ingenious defense mechanism for the corporations who rely on this sort of patronizing promotion scheme to balance out gender quotas and create puff pieces spotlighting women in tech leadership roles. It's sort of like seeing an unfamiliar religious service: you can't say anything or else you're automatically insensitive and uncouth, not even when they start with the human sacrifices...

One of the most significant negative externalities of the Patricia Principle is that actually skilled women are passed over for promotions. It's like taking the well-known double-standard whereby assertive women are labeled bitchy and multiplying it by a million because it's not merely based on a tangential attribute like assertiveness, but is in fact based on your core competency that makes you good at your job in the first place! It sends a signal to young women in tech that the road to success is not by being technical, but instead by being technically vapid and channeling all their effort into soft skills that would be more appropriate for human resources. Not even Joseph Heller could have scripted it better. And very smart women will pick up on this sooner rather than later and either jump ship to different career paths in which their competence will be rewarded, or else will give themselves over to the soft skills Dark Side since that's the best way for them to advance their careers. Either way we all lose because of the attrition of tech-skilled women.

Another negative externality, similar to that of the Peter Principle, is that the majority of female tech role models end up being soft skilled managers. Look, there's nothing wrong with being a soft skilled manager and the world needs good ones. But when I grew up as a scientist and programmer, I got to read great stuff by Feynman, Dijkstra, Hamming, and a whole host of entrepreneurial computer scientists -- all men! Yes, there's Emmy Noether, Ada Lovelace, and Grace Hopper ... but even they are often just trumpeted out once a year by various institutions desperate to swear to us that they totally, absolutely respect female contributions to tech, for real. Even if I think about various modern influences, there are amazing plain talkers like Steve Yegge and Pieter Hintjens (whose post I linked to recently). You can dig around and find good programming blogs by women, sure, but the point is that the significant technical role models are always men. Young women are not given the opportunity to read the same kinds of mind-altering awesomeness from tech-focused women, precisely because such women are actually punished for their very skill! A merciless career catch-22.

(And let me also say that as a young (at heart anyway) man, I too feel that I have been done a disservice. It's not just women going through their professional formative years who benefit from the perspective of technical women, but men too entirely miss the chance to hear the female perspective (let alone the perspective of people identifying with other forms of gender). I don't want all of the inspirational quotes and anecdotes tucked away in my brain cache to come from old white men.)

Ok. Rather than belaboring what we already know (e.g. this problem exists and sucks) let us think about what we can do about it. Sometimes it can be helpful to start with some examples of what not to do about it.

Do not vilify women already in leadership tech roles just because this effect exists. Some of those women really got there through technical merit and not every institution seeks to treat female tech leaders like human resources personnel who happen to sit in a technical or business position in the firm. Turning on the female leaders we already do have is nuts. We need them because they are a vital source of diversity that our dysfunctional industry craves. Yes, we may prefer that a different outcome had happened in those cases where soft skills won out over tech skills, but riding someone out on a rail doesn't solve anything, and fosters the kind of unfocused fuming that lets these companies get away with the obfuscational tactics (e.g. whack-a-mole "any criticism of female leaders is automatically misogyny") that are the whole basis of this problem in the first place.

Do not assume women who have chosen to work in soft skills capacity did so because they had to abandon a technical career. Surprise, some women just enjoy working in a soft skills capacity. Nothing wrong with that.

Stop proliferating the idea that women are somehow intrinsically better at soft skills than men, or that men are somehow better at hard/tech skills than women. Neither stereotype is true and neither is decoupled from feedback pressures of the very societal problems contributing to them. Men who take up soft skills roles are often put down for doing so and treated as if their labor emasculates them.

This reinforces the problem as much as anything else and is also a major source of the incompetence problem from the Peter Principle: technical men elevated to levels of management have often been pressured to enact "tough love" styles of management, focused on pragmatism and brutal market economic thinking, and so they often hit that first level of incompetency precisely because they have never been encouraged to develop the soft skills needed to manage a diverse team. If instead, men were treated as though their natural abilities to negotiate soft skills should be celebrated, developed, and enhanced, we wouldn't end up with as much Peter Principle incompetence and brogrammer tech cultures full of self-selling and devoid of compassion.

What are some things you can do to help?

A Liz Lemonism comes to mind: "... all anyone really wants in this life is to sit in peace and eat a sandwich." Replace 'sandwich' with 'meritocracy' and it covers the tech world accurately (well, we don't want to eat a meritocracy but you get the idea). What a shocking thought: that people want to be treated fairly according to their effort and talents. If you are a manager capable of influencing promotions, don't fall prey to stereotyped thinking about female subordinates and their soft skills or about male subordinates and whether their soft skills lower their status.

Instead, focus on being objective. State the needs of the position without subconsciously shaping them to suit some politically-motivated hire or promotion. If you can build a success spiral in this manner and accurately match a tech-skilled female to a leadership role requiring her tech skills, you'll gain a reputation for being fair and for putting the gender politics bullshit to the side in order to more objectively reward workers. The more you build this kind of reputation, the easier it becomes to keep it going. And, like a person papering over their nutritional deficiencies with some homeopathic knockoffs, the companies you work for will be weary and desperate for the substance and vitality that comes from real gender equality instead of the empty calorie equivalents they regularly enact. The real thing tastes better to your soul and even odious corporate types are refreshed by it.

Provide positive feedback for female technical accomplishments. I actually just had to deal with this myself when I was helping my 12-year-old sister with her science fair project. Briefly, she did a project collecting survey data in which she asked people to smell a variety of perfumes and to estimate a price they would be willing to pay based on the smell. The survey data was then correlated to the true prices in order to see if the price of perfume reflected consumers' actual appraisal of the quality (as opposed to buying more expensive perfume for status or branding effects).

I helped her to learn about statistical significance -- a concept that not even statistical scientists are good at explaining -- and to my sister's credit she did a great job. She explained what statistical significance was, how it related to null hypotheses, and how statistical hypotheses are different from traditional experimental hypotheses. And it promptly fell on deaf ears at her science fair, where she was judged by 3 old white men and 1 young professional woman.

And in fact, of the lot of them, only the female judge had technical credential -- she was a researcher at a nearby university studying cognitive and behavioral science and so she knew about statistical significance and how remarkable it was for a 7th grader to explain it (as opposed to making a battery from a potato or a baking soda volcano ... like everyone else). Even though my sister didn't win the science fair, she was thrilled to receive her comment card from the judges, on which the female judge had written glowing praise for my sister's ability to tackle such statistical concepts at such a young age. That's exactly the kind of technical feedback that women venturing into tech need to hear. All the better that it came from another technical female!

Basically, use common sense. Reward and praise technical workers when their technical skills solve the problem -- be they male or female. Make sure they know that they are valued for their effort to cultivate their competence and not because they are stereotyped into roles that are "better suited" for their gender. In this manner, we can reverse the Patricia Principle, and take a big bite out of the Peter Principle while we're at it. We can reduce and hopefully reverse the attrition of women from tech-focused roles by showing them that it is their considerable brain power that makes them valued, and not superficial compliance with the kinds of "female approved" roles they have been pigeonholed into for too long.

## Friday, April 22, 2016

### Mind Blown

Few things are capable of blowing my mind. This is one.
"My kids are twelve, nine, five. Tragic, etc. etc."

## Sunday, April 17, 2016

### The Function Instance for Monad

The Haskell function-type instance for Monad is a bizarre creature. It's deceptively short, superficially simple. Here's the whole thing:

return x = \_ -> x
h >>= f = \w -> f (h w) w

What? Let's break this down.

First, recall that in order for a type to be eligible for creating an instance of Monad, it must be a parametric type with a single parameter. This is why for some multi-parameter types, like Either a b, the Monad instance is actually for the type inclusive of its first parameter, so "Either a" can be a Monad (parameterized over b), but "Either" and "Either a b" cannot.

In the case of the function operator, what is the parameter? For a simple function that takes one argument, it will have a type signature something like "fun :: a -> b". If we re-write that with prefix notation for the operator "->", it would look like "fun :: ((->) a b)". So the input parameter is referenced by "a" and whatever the output type is (even if the output type is itself a function), it is parameterized by "b".

Looking back at the first line of the Monad instance declaration, we can see immediately that the curious "((->) r)" is really just a harmless prefix application of the function operator to a single parameter "r". So "r" represents some input type. It could be any input type, but for functions to be used with the Monad operations, they will have to share the same input type.

This also tells us that "((->) r)" has another parameter -- namely, whatever is the output type. So in the classic Monad type signatures, such as for ">>=" where we have "(>>=) :: m a -> (a -> m b) -> m b", the "a" parameter will actually be the function's output type, and the "b" parameter will be the output type of whatever function results from the monadic operation.

This is a bit tricky because we are always used to thinking of "m a" in the monadic signatures as relating to some kind of "input" type. For the List type, for example, "m a" means "List containing values of type 'a'". You have to exert some mental effort to keep things correct when thinking about the function type, because it means "functions having common input type r, and having some unspecified output type." The different possible output types is what you are parameterizing over, just as the different possible base data types contained in a List is what you're parameterizing over with the List instance for Monad.

Next let's turn our attention to the actual Monad function implementations. First there is return. The job of return is to take any old value and place it into a minimal context that satisfies the parameterization of the Monad. In our case, the parameterization is some function type taking some particular (but as yet unknown) input type. To take a naked value and produce a function from it, we do the simplest possible thing: we make a function that takes an argument (whose type we don't care about) and returns the value. This is actually equivalent to the Prelude function const.

Finally, we come to the meat and potatoes: the definition of bind (">>="). This one is super tricky, so let's peel it back by first stating the type signature of bind: (>>=) :: m a -> (a -> m b) -> m b.

What does this spell out for the function type? In verbose English it's like this:
(>>=) :: m a     Some function with input type "r" and output type "a"
-> (a -> m b)  A function that takes something of type "a" and turns
it into a function that has input type "r" and output
type "b"
-> m b         Some function with input type "r" and output type "b"
Looking back now, when we see "h >>= f" this means "h" must be the "m a" part, just some function with input type "r" and some output type "a." And "f" must be a function with input type "a" (so it can consume the output of "h") and output type "m b" (which means "function of input type "r" and output type "b").

Finally, let's look at the implementation: >>= f = \-> f (h w) w

Whatever "w" is, we know it must be any value of type "r". That means we can apply "h" to it. When we do that, because "h" was an "m a", we know that "h w" will be of type "a", and thus it can be passed to "f". When "f" hits that output type, it is responsible for producing something of type "m b" which is itself a whole function, accepting input of type "r", and produce some output type "b". This means that "f (h w)" has to be a function that can also be applied to "w" if we want to.

And in fact, we do. The specialization here is that whatever appears as the right-hand side operation ("f"), will be applied to the output of the left-hand side operation's result  "h w", and also to the original argument "w".

In a way, function bind is saying to take a given input argument and split into two operations: (1) apply "h w" and (2) keep "w" as-is ... after that, then apply "f" to those two operands, "f (h w) w".

Here is an example to hopefully make it clear:
Prelude> let f = (+3) >>= (*) :: Int -> Int
Prelude> f 2
10
Notice how the right-hand side function is just "(*)", which can take a single argument (the output of "(+3)") and produce a whole function from it that can be further applied. So when we apply "f 2", we are saying, add 3 to 2 and make a function that multiplies by this, so "(*5)", and then actually apply this to the original input as well, so "(* 5 2)" which is 10.

To see a slightly more complicated example, consider this:
Prelude> let f = (+3) >>= (\m n -> replicate m 'a' ++ replicate n 'b')
Prelude> f 4
"aaaaaaabbbb"
In this case, the overall output type is different than the input type. This function accepts some integer and adds 3 to it. That number will be used to replicate 'a' into a string of all a's. Finally, the original number will be used to replicate a string of all b's, which will be concatenated.

What's important is that the right-hand side function, when used only with its first argument "m," produces a function that maps from integers to strings, specifically by replicating a new all-b suffix and concatenating it to a predetermined all-a prefix string.

## Monday, April 11, 2016

### Hollywood Handbook Comedy!

I don't generally write about my favorite podcasts, but today I can't resist. Are you looking to have a nice, good, funny, smart and cool time? Do not miss Sean and Hayes on Comedy Bang Bang this week. It surely will be a contender for the 2016 Best Ofs.