Weekly Head Voices #132: Potato deadline.

Fragment of potato skin, taken with phone camera through GOU#2’s microscope at 100x.

We have a serious deadline coming up on Tuesday, so I’m going to make these few WHV minutes count.

BULLET LIST TO THE RESCUE!

  • Day zero has again been postponed, this time to June 4. We continue with our water saving efforts.
  • That unexpected side-project I mentioned in last week’s post did end up going live that very night. Armed with the Django Rest Framework and plenty of battle scars, it took about 17 hours from idea to fully deployed REST API, a large part of which was debugging the paper’s math and spreadsheets.
    • Django might be a slow runner relative to some of the other kids on the block (go with any of its web frameworks, nginx with openresty (lua right in your web server!), even apistar with uvicorn), but the completeness and maturity of Django and its ginormous ecosystem are hard to beat when it comes to development velocity.
  • There’s a whole blog on the nature of note-taking. I arrived there via interleave and org-noter, both emacs packages for keeping text (orgmode) notes synchronised with PDFs, both found via irreal, a great Emacs blog.
  • In the extra lessons I have with GOU#1, we studied electrical current from basic (atomic) principles. As I was getting all excited about the outer electrons being passed on from copper atom to copper atom (Khan Academy and I tag team these lessons), GOU#1 had to laugh at the goose flesh on my arms.
    • The Khan Academy lecture seemed to imply that Benjamin Franklin started us down the not-quite-correct path of conventional current (from positive to negative), whereas the electrons being passed on imply current flow from negative to positive, aka electron current. However, this physics StackOverflow answer more completely explains that current is defined as the flow of electric charge, with electron flow being one example, and hence both directions are correct.
  • To be honest, I became ever so slightly irritated with an episode of one of my favourite podcasts, CPPCast, as the guest said “like” so often that I had trouble following what he was actually like trying to say. This like led me to using Google’s machine-learning-based speech to text API one night to like transcribe the audio of the podcast to speech so that I could like count the number of like utterances. There were not as many as I thought, but still a whole lot. If you’re curious as to the stats, I wrote everything up in this nerdy vxlabs blog post.
    • On the topic of note-taking: Because I make lab notes of everything in my Emacs, including late night speech recognition experiments, publishing a blog post is a question of some copy pasting, and then telling Emacs to publish to the blog.
  • On Thursday, some dudes came to my house and, after somehow switching seamlessly from pick-axe to optic fibre splicer and back several times, left me with this (and more):
Two fibre strands into my house. They tell me one is for backup.
  • These are strange Gibson-esque times when there’s now permanently a laser transmitting all of these packets to you via the network of glass strands encircling the Earth, whilst many of us are still struggling to grasp the difference between fact and fiction.
    • “The future is already here — it’s just not very evenly distributed”, William Gibson, probably ’93.
  • We have a new president: President Cyril Ramaphosa! He was Mandela’s choice to become president of this country, but it was Thabo’s turn, and then things went pear-shaped with Zuma. Years later, the situation is quite dire, but so far there are many indications that Ramaphosa has the makings of a great leader (I have become convinced that we humans, all of us, need great leaders to advance as humanity; I hope to write a post about that some day). After Friday’s state of the nation (SONA) address by present Ramaphosa, I, along with many fellow South Africans, are hopeful for our future.

Ok peeps, have a wonderful week! I’ll see you NEXT TIME!

Weekly Head Voices #131: Function over form.

Do you know what time it is?

It’s Sunday, which means it’s time for a new edition of the WHV!

GOU #2 has made what will probably be the most significant contribution to this week’s edition. I am happy that it’s in the form of an art piece, although I am slowly also growing quite excited at the prospect of one of my GOUs popping up here one day with an acerbic comment.

Our family through the eyes and hands of GOU#2 (age 7), also known as My Most Favourite Middle Child.

It was one of those really high intensity work weeks.

This is probably because a deadline is approaching at high speed. We are in good shape, but we wil have to work with an even slightly higher intensity in the coming week and a bit to deliver.

Water

Day Zero has been pushed out further to mid May, due to the generous contributions by farmers of the Groenland Water Association, and due to new calculations based on agricultural use tapering off slightly in the coming months.

This has had a very welcome positive effect on our stress level.

We continue with our household water saving efforts. On Friday, we were surprised by about 15mm of rain. Our various rain harvesting systems did an excellent job at further bolstering our emergency supplies.

No Fibre For You!

Last year in July, magical elves starting digging up my neighbourhood to install green trunking everywhere. As you all know, green trunking is for optic fibre. Anyways, “fast” forward 7 months, and the online fibre coverage map finally turned dark purple over my house. As you also all know, dark purple means my house can be hooked up to the giant net of laser conducting fibres encircling the whole earth.

Whilst the jocks never got any further than reminiscing monosyllabically about how awesome they were in high school 25 years ago, the nerds were busy wrapping our whole planet in a net of optic fibres to send exabytes of information everywhere at light speed.

On Saturday a gentleman from the telco was here to hook me up. I was understandably vibrating with excitement.

Unfortunately it turned out that this specific gentleman was sent too early.

He had come to hook my house up to the fibre which by then should already have been pulled into the building from the termination point on the street outside.

Anyways, he promised to arrange for the extending-fibre-from-street-into-house lady or gentleman to swing by, before he himself would come back again to wrap the whole business up.

I guess that when you work with things moving at the speed of light, time travelling faux pas are bound to happen.

What a tool

Speaking of nerds, I have finally found a multi-tool that is small enough to disappear into one of my pockets, yet enables me to make myself more useful at least once a day. After a long search (I’ve been walking around with a pen-sized screwdriver with 4 interchangeable bits in my pocket for the past time) I settled on the Gerber Dime.

It looks like this:

They say the best camera is the one you have with you. The same goes for tools.

My Leatherman Wave, recently replaced under the 25 year Leatherman guarantee with a Wave 2 because they didn’t have Wave parts anymore, is a brilliant tool, but it’s bulky and so it usually sits at the bottom of my back-pack, until I run into a problem which requires its steely persuasion.

In contrast, I can have the Gerber Dime out and pulling teeth, Ron Swanson-style, in a few seconds. The bottle opener is best in class, the blade is sharp, and the package opening blade makes short work of those irritating blister packs. I have not yet been able to test more extensively the pliers, the scissors, the screw-drivers and the tweezers, but the mere fact that this is the tool I always have with me means they will probably win the suburban leg of this contest.

Tool belts for humanity

One day, when I care even less about what strangers think, I am planning to start wearing a tool belt. Tool belts don’t have the best reputation, especially in sartorial circles, but they are amazing.

Along with hiking shoes and bulky multi-tools, they epitomise the philosophy that many engineers are born with, and a philosophy that could benefit the world at large:

Function over form.

To me this is an echo, or perhaps a specific case, of reason over emotion. Feels are certainly important, but if we are to advance as a society, rationality has to win.

Ok kids, I am about to push an unexpected side-project into production tonight. I wish you increased utility, and an exceptionally deliberate experience of life, at least until we see each other again!

Weekly Head Voices #130-2: Direct experience dopamine.

Photogenic and non-camera-shy dragonfly I met in Paarl over the weekend.

As I went through my notes to extract material for this week’s post, I noticed a small discrepancy between the task description for the previous post and the published version: #129 in my notes versus #130 in the published post!

It’s too late now to rename #130, so in this reality I’m just going to have to deal with the fact that WHV #129 will never exist. I have decided to name this edition #130-2 so that eventually (well, in about a week), we will be back to uninflated post numbers. Nobody likes inflation. Except perhaps tyres. And balloons.

Your brain at work part 2: Dopamine and more mindfulness

Ironically, the incorrectly numbered post #130 dealt with the many ways in which our brains fail us every day. (Now that I’ve finally gotten around to installing the WP Anchor Header plugin, we can link directly down to any heading in any post, as demonstrated in the previous sentence.)

At least some clouds do seem to have a silver lining.

Your Brain at Work, the book I mentioned last week, has turned out to be a veritable treasure trove of practical human neuroscience, and I still have about 30% to go. My attempt at meteorological humour above was inspired by part of the book’s treatment of the important role of dopamine in your daily life.

For optimal results, one is supposed to remain mildly optimistic about expected future rewards, but not too much, which will result in a sharp dopamine drop when those rewards don’t crystallise, and a greater increase when they do. For optimal results, one should try to remain in a perpetual state of mildly optimistic expectations, but also in a state of being continually pleasantly surprised when those expectations are slightly exceeded.

More generally, the book deals really well with the intricacies of trying to keep one’s various neural subsystems happy and in balance. Too much stress, and the limbic system starts taking over (you want to run away, more or less), blocking your ability to think and make new connections, which in this modern life could very well be your only ticket out of Stress Town.

To my pleasant surprise (argh, I’ll stop), mindfulness made its appearance at about 40% into the book, shortly after I had published last week’s WHV.  In my favourite mindfulness book, Mindfulness: A Practical Guide to Peace in a Frantic World by Mark Williams and Danny Penman, two of the major brain states are called doing, the planning and execution mode we find ourselves in most of the time, also in the middle of the night when we’re worrying about things we can do nothing about at that point, and being, the mode of pure, unjudgemental observation the activation and cultivation of which is practised in mindfulness.

In David Rock’s book, these two states are described as being actual brain networks, and they have different but complementary names: The narrative network corresponds to the doing mode, and the direct experience network corresponds to the being mode.

The narrative network processes all incoming sensory information through various filters, moulding it to fit into one’s existing mental model of the world. David Rock describes it in the book and in this HuffPost piece as follows:

When you experience the world using this narrative network, you take in information from the outside world, process it through a filter of what everything means, and add your interpretations. Sitting on the dock with your narrative circuit active, a cool breeze isn’t a cool breeze, it’s a sign than summer will be over soon, which starts you thinking about where to go skiing, and whether your ski suit needs a dry clean.

This is certainly useful most of the time, but it can get tiring and increase stress when you least need it.

The much-more attractively named direct experience network is active when you feel all of your senses opening up to the outside world to give you that full HD IMAX(tm) surround sound VR experience. No judging, no mental modelling, just sensory bliss and inner calm. Rock sez:

When this direct experience network is activated, you are not thinking intently about the past or future, other people, or yourself, or considering much at all. Rather, you are experiencing information coming into your senses in real time. Sitting on the jetty, your attention is on the warmth of the sun on your skin, the cool breeze in your hair, and the cold beer in your hand.

Again, these two systems are on opposite sides of a neurophysiological see-saw. When you are worrying and planning, no zen for you! On the other hand, when you’re feeling the breeze flowing and and through each individual hair on your arms and the sun rays seemingly feeding energy directly into your cells, your stress is soon forgotten.

Fortunately, mindfulness gives us practical tools to distinguish more easily when we’re on which path, and, more importantly, to switch mental modes at will.

I hope you don’t mind me concluding this piece by recursively quoting David Rock quoting John Teasdale, one of the three academic founders of Mindfulness Based Cognitive Therapy (MBCT):

Mindfulness is a habit, it’s something the more one does, the more likely one is to be in that mode with less and less effort… it’s a skill that can be learned. It’s accessing something we already have. Mindfulness isn’t difficult. What’s difficult is to remember to be mindful.

(If the book has any more interesting surprises, I’ll be sure to report on them in future WHV editions.)

Miscellany at the end of week 5 of 2018

  • The rather dire water situation has not changed much, except that due to more citizens putting their backs into the water saving efforts, day zero (when municipal water is to be cut off) has been postponed by 4 days to April 16. We are now officially limited to 50 litres per person per day, for everything. Practically, this means even more buckets of grey water are being carried around in my house every day in order to be re-used.
  • I ran 95km in January, which is nicely on target for my modest 2018 goal. Although January was a long month, and Winter Is Coming (And Then We Run Much Less Often), I am mildly optimistic that I might be able to keep it up.
  • Python type hinting is brilliant. I have started using it much more often, but I only recently discovered how to specify a type which can have a value or None, an often-occurring pattern:
from typing import Optional, Tuple
def get_preview_filename(attachment: Attachment) -> Tuple[Optional[str], Optional[str]]:
    pass
  • On Wednesday, January 31, GOU #3 had her first real (play) school day, that is, without any of us present at least for a while. We’re taking it as gradually as possible, but it must be pretty intense when you’re that young (but old enough to talk, more or less) and all of a sudden you notice that you’re all alone with all those other little human beings, none of which are the family members you’re usually surrounded with.

The End

Thank you dear reader for coming to visit me over here, I really do enjoy it when you do!

I hope to see you next again next week, same time, same place.

 

Weekly Head Voices #130: TTAGGG.

Lovely summer’s day. Not much rain.

Water

On the water front (I see what I did there): Day Zero, that is the day on which the whole of Cape Town’s municipal water will be cut off, has been brought further forward to to April 12. Citizens will be able to fetch drinking water every day from 200 collection points. Judging by how quickly shelves of bottled water are currently disappearing from the shops and by panicky facebook posts, people are stocking up in advance.

The immortality of lobsters

Continuing with our watery theme, this past week I learned the very surprising fact that lobsters are sort of biologically immortal. In short, lobsters produce more of the enzyme telomerase than humans and other animals, which rejuvenates their telomeres, which means that their cells can in theory keep on dividing forever.

The telomeres are the genetic bits (feeling quite punny today; nucleotides TTAGGG in vertebrates, apparently) protecting the ends of your chromosomes. Every time cells divide, the child cells have slightly shortened telomeres. At some point, the telomere becomes too short, and that line of cells can’t divide anymore.

This is a large part of how most animals finally die: Our cells can only divide so many times, and then the telomere ends, and then someone switches on the bright lights, and then the whole party is over.

However, the enzyme telomerase is able to repair telomeres, thus extending the lifetime of the organism.

Lobsters naturally produce so much telomerase, that their cells can keep on dividing forever. In practice, lobsters apparently only grow in size, strength and reproductive ability as they age.

Unfortunately, their party also eventually ends. As they grow, they have to molt their suddenly too small exoskeleton. As they get bigger, this process takes more and more energy, until the day comes that they have grown so large (12 kg in one instance) so that the attempted molting, due to disease, is a fatal process.

Intriguingly, a 2013 study showed that lifestyle changes such as diet, exercise, stress reduction (including meditation) and social support, boosted telomerase activity and significantly increased telomere length in human subjects.

Your brain (not) at work

On the recommendation of a colleague who is most versed in these things, I am currently reading the book “Your Brain at Work: Strategies for Overcoming Distraction, Regaining Focus, and Working Smarter All Day Long” by David Rock.

While the author clearly has not yet read any books on Coming Up With Shorter Book Titles, he has put together a compelling piece on the extreme limitations of the human prefrontal cortex. These are the bits that we use for important thoughts and for solving tricky technical puzzles.

I thought that I just naturally had the attention span of a budgie (which I continuously try my best to compensate for by the gnashing of teeth, will power, and various other tricks), but it turns out it’s a basic human limitation.

A pretty budgie which will probably distract you from the contents of this post. FOCUS!

If all of the neuroscientists he has interviewed can be believed, we are severely limited both in terms of the number of thoughts / ideas we can handle at any one time, and, to me far more frighteningly, in terms of the total time we have available for this sort of complex work.

The prefrontal cortex is relatively-speaking quite inefficient, and gets exhausted really quickly. Remember the last time you spent the evening trying to figure out how to get all of your children to their various activities during the week, and how unexpectedly difficult that was? (if no children, please replace this example with something more familiar to you :) Your prefrontal cortex was probably already exhausted by 15:00 in the afternoon (if not earlier), and you were in effect beating a dead neural horse.

Sometimes you wake up the next morning, and you solve that exact same puzzle in 3 minutes, at which point you might have already exhausted your cognition quota, and might as well stay at home for the rest of the day.

Because the capacity and bandwidth of the prefrontal cortex can’t (yet?) be significantly improved, the book recommends that one carefully monitors oneself, taking breaks when necessary, single-tasking, and practising any often-occurring tasks until they become automatic, at which point the much more efficient basal ganglia take over.

Apart from this, the prefrontal cortex works at its best when you are slightly stressed, but not too much, and when you are slightly happy (with novelty and dopamine), but not too much. Too stressed, and it freezes up like a deer in the headlights of a rapidly approaching car. Too happy, and it just hangs around enjoying the vibes, not really producing anything.

I still have to finish the book, but it has already motivated me to continue on my quest to automate and script as much of my life and work as possible. For example, for the daily goals list mentioned in pro-tip #1 of WHV #126 I have a keyboard shortcut in Emacs which creates the relevant section in the correct part of my journal, correctly timestamped, and pre-filled with one or two habits I am trying to form, ready to accept the rest of the goals for the day. I used to think examples like this were perhaps going a little too far, but I now keep my eyes open for any task or activity that can be partially or fully automated. (Some even refer to Emacs Orgmode as their exocortex.)

On the topic of lists, the book mentions prioritisation as one of the more cognitively taxing activities we can engage in, so it makes even more sense to take care of it first thing in the morning, and to do this as efficiently as possible.

More broadly speaking, I think having instant access to documented and executable conventions for most of one’s tasks and projects would help greatly to free up the precious little prefrontal quality time we are allotted.

Even more broadly speaking, it seems we need to practise how to listen more carefully to our brain so that we are able to guide it through the treacherous waters of exhaustion, stress and happiness.

The part where I wish you a good journey

Thank you very much for reading this post. I hope you have a week filled with learning, challenges surmounted and a solid dose of contentment.

See you next time!

Weekly Head Voices #128: Water water everywhere, but not a drop to drink.

Hey friends, welcome back!

We have to talk about the water situation, seeing that Cape Town is now in the international news as being on track to be the first major city EVAR to run out of water.

In short, if it doesn’t rain in substantial amounts during the coming three months (which history and projections say it won’t), the municipal water supply will be shut off on April 21, a date festively referred to as Day Zero.

This means when we try to open any tap, no water will come out. This situation might continue for quite a while, which is pretty intense.

On that day, we will be celebrating by dressing up as Kevin Costner and running around barefoot shouting “NOTHING’S FREE IN WATERWORLD!”. Those who are not big fans of Kevin are allowed to dress up as Imperator Furiosa.

At my house, we stopped watering our garden with municipal water months ago. We installed a grey water recovery system: Shower and bath water ends up in the only remaining green corner of the garden.

We also installed a rain water recovery system three months ago, which has fortunately enabled us to collect a few thousand litres of rain water via the rerouted gutters and pipework from the roof. This water we will probably use after Day Zero to be able to wash and to flush a toilet now and then.

(Flushing frequency has necessarily decreased significantly. Around these parts we now have the saying: “If it’s yellow, let it mellow. If it’s br***, flush it down.” Please excuse the mental graphics.)

We have been managing to keep our use of municipal water under the requested 87 litres per person per day. Starting on February 1, we will have to stay consistently under 50 litres per person per day, including drinking, cooking and washing. I guess 2 minute showers were wasting too much of my time in any case.

I have to do more research and corroboration (fingers are being pointed in all directions), but it seems the fundamental issue is not so much the current drought alone, but to a large extent mismanagement by both local and national government. It’s complicated, and politics is involved, so read at least this (otherwise good piece, but author is a DA / local government apologist), this (DA / local government IS to blame) and this (a longer, more balanced piece) to start with.

That being said, I am happy that a large part of the populace has become much more water efficient. If we get through this, in spite of “this” being called “the new normal”, I hope that we retain our mad Dune-grade water saving skills.

With that out of the way, it would be sort of anti-climactic for me to talk extensively about what-I-did-last-week, so I’m going to limit it to a REAL bullet list (ping me in the comments if something interests you):

  • pipenv is the bee’s knees, I have switched my non-miniconda projects.
  • convincingly but fortunately only temporarily locked myself out of my one laptop due to TCG-Opal hardware encryption, UEFI32, UEFI64 and legacy boot incompatibilities. I’m getting old, I used to NOT lock me out of my laptop in my sleep.
  • A compulsive twitch made me fix years of old-style broken youtube shortcodes using the wordpress regex plugin. The regexp you are looking for is /\[youtube\](.*)\[\/youtube\]/ which you can replace with \1.
  • People dislike really smart leaders. See water crisis above for one possible reason why this is a bad thing.
  • In spite of having invested a significant amount of time in deciding on the Office UI Fabric React components for my most major side-project (#38465 if you’ll recall), I switched to Semantic UI React (which was also in the running, together with Palantir’s blueprint, HP’s grommet, Alibaba’s Ant Design of React and more) at the last minute. I am happier now.

That’s it from me for now. Have fun this week kids, I hope to see you soon!