Weekly Head Voices #151: We are pleased to meet you.

The Weekly Head Voices number 151 are trying to tell you something about the week from Monday July 30 to Sunday August 5.

Prepare yourself for a slightly stranger than usual post. I have: two short programming ideas, a bad review of an outdoor security passive infrared sensor, using Jupyter Notebook for (GPU-accelerated) numerical computation when you only have a browser, computing device input latency, and an utterly unexpected bit of backyard philosophy from the gut.

Two random micro side-project ideas

I would like to start with two hobby / maker ideas that popped up in my head this week. There’s a high probability I will not get around to them, but perhaps they help you to spawn a new set of hopefully more worthwhile ideas.

Chrome or Firefox plugin to convert Spotify playlists to Apple Music using the new MusicKit JS API

I seem to see many more Spotify playlists shared than Apple Music playlists. For example, at this moment I’m listening to the official Lowlands 2018 playlist.

This is not ideal, as I am an Apple Music subscriber, but not a Spotify subscriber.

It turns out there are paid apps to convert Spotify playlists to Apple music playlists.

However, it also turns out that Apple has a new thing (still in beta) called MusicKit JS.

I briefly dissected the Spotify Playlist website.

It would be straight-forward for a Chrome or Firefox plugin (WebExtension, so same code. I’ve done this before) to go through this playlist, search for each track using the MusicKit JS API, and then recreate the playlist in the user’s Apple Music account.

This solution would be much cleaner and simpler than the current app-based ones.

An Emacs package for displaying your RescueTime productivity metric right on the mode line

I scanned the RescueTime API documentation.

I was just about to start working on it, when I came up with the bright idea to name the package ironic.el, and so I stopped.

On that topic: The struggle for practically sustainable focus is real, and it never seems to stop.

The Head Voices REVIEW(tm) the Optex HX-80 outdoor passive infrared security detector: AVOID AT ALL COSTS

From the Optex HX-80 outdoor passive infrared security detector’s web-page we have the following:

The most important element in reliable outdoor detector is accuracy to distinguish a human from a small animal. … In addition, the HX-80N’s dual PIR’s and 20 detection zones utilize the ‘AND’ detection pattern technology … This technology helps to prevent false alarms caused by a pet or small animal.

Well, I had two of these installed by trained professionals.

(There are of course interesting discussions to be had about the necessity of devices such as the HX-80, or its mythical actually working counterpart, down here.)

I can confirm that they excel at one fairly specific function: Triggering the alarm, and thus automatically calling my security company, at the most ungodly hours of the night, whenever a certain small grey cat, looking exceptionally unlike a human, decides to take a stroll outside of our house.

Oh yes, the cat is not even ours, but belongs to our neighbour.

The installation and subsequent repeated fine-tuning of our Optex HX-80 have only had the result of me having to punch in an additional key-sequence every evening to bypass the two ‘AND’-detection-pattern-technology-equipped HX-80 devices.

You will understand that the only reasonable Head Voices REVIEW(tm) of the Optex HX-80 is:

  • 100% NON-FUNCTIONING THROUGH INFERIOR DESIGN.
  • AVOID AT ALL COSTS.
  • DON’T TRUST THE MARKETING.
  • THE TRUTH IS OUT THERE.
  • JUST DON’T.

Image result for just don't meme

Some more odd but perhaps useful bits

Google Colaboratory for Numerical Computation when all you have is a browser.

I’m late to the party (again), but Google Colab is really great if you need a Jupyter Notebook with some GPU power behind it.

It comes with tensorflow pre-installed (being Google and all), but getting the GPU-accelerated PyTorch 0.4.1 (latest version of the most amazing deep learning tool at the time of writing) going was a cinch.

To repeat this experiment, create new notebook with File | New Python 3 Notebook, then change Edit | Notebook Settings | Hardware accelerator to GPU.

You can then install the correct version of PyTorch by executing

!pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp36-cp36m-linux_x86_64.whl

in a notebook cell.

What a time to be alive!

P.S. Remember, under normal (non-Colab) circumstances we keep our Notebooks as empty as possible. Prefer as much as possible of your code in Python modules. The notebooks are only there to act as glue, for visualization and sometimes for long-running jobs.

Dan Luu’s computer and mobile device input latency research

This most amazing work was recently brought to my attention by WHV reader Matthew Brecher in the comments under my 2017 Android vs iPhone performance post.

In it, Dan Luu measured the input latency of various devices, using the 240fps camera on his iPhone SE, or with the 1000 fps  Sony RX100 V camera if the device was too fast.

For the computers in his study, input latency was defined as the time between keypress and character appearing on the display. For the mobile devices, it was defined as the time between finger movement and display scrolling starting.

If you have any interest in this sort of technology and also in-depth technology journalism, the full article is definitely worth your time.

I wanted to mention two interesting points:

  1. The 1983 Apple 2e, with a CPU running at 1MHz, had significantly lower input latency (30ms between button press and character display) than any modern multi-GHz system. The comparison is of course not completely fair, but it’s still nice to see.
  2. Amongst the mobile devices, Apple dominates the fast / low latency end of the spectrum. Their devices, in terms of input lag, are ALL faster than all of the Android devices tested, including for example the 2017 Google Pixel 2XL.
    • Yes, this is me eating my hat, and some more of that yummy humble pie.
    • Android 9, code-name Pie, has just been (will soon be… err) released and has an amazing list of features. I still hope they manage they also manage to catch up with regards to some of the basics like input latency.

Yet another reason to eat more fibre

There are an estimated 100 trillion (10 to the power of 14; 100 with 12 zeroes) bacterial cells housed in each of our bodies.

Each adult human consists of on average only 37 trillion human cells, meaning there are on average almost 3 alien cells for every 1 of your own cells.

I find this a beautiful realisation: All aspects of our lives depend on this multitude of foreign visitors.

They help us digest our food, and, as it has been turning out more recently, they play a crucial role in our mood,  our behaviour and our thinking.

We (or at least the clever people) now talk about the microbiome-gut-brain axis, further underlining the importance that our bacterial visitors play in our lives.

Taking a few more steps back, thinking about the relationship between the 37 trillion human cells, and the 100 trillion visiting cells,  I ask the question:

Who am I really? Who exactly is thinking this?

I, or perhaps rather “we”, find this truly fascinating.

What I was initially planning to mention before going off on this tangent, was a recent paper accepted for publication in the Journal of Physiology, with the title Short-Chain Fatty Acids: Microbial Metabolites That Alleviate Stress-induced Brain-Gut Axis Alterations (click for PDF fulltext).

The Physiological Society press release is more digestibly (I had to) titled “Eat high fibre foods to reduce effects of stress on gut and behaviour“.

In short, fibre stimulates gut bacteria to produce short-chain fatty acids (SCFA), which, besides being the main source of nutrition for cells in this region of the body, also decrease levels of stress and anxiety, at the very least in mice.

The end

Thank you for sticking around friends!

I hope that you found something of value, even if not directly from this post.

I’ll see you next time! Until then, remember to eat your vegetables.

 

Weekly Head Voices #150: The Road not Taken.

Photo of a cotula lineariloba flower, taken by GOU#1, age 12.

This edition of the WHV covers the week from Monday, July 23 up to and including Sunday, July 29.

Running update

Strava says I’ve just passed the 300km threshold in my Luna Mono 2 sandals.

It also says I’ve done 27km in my Xero Genesis sandals, or as I have begun to call them, Xero Tolerance.

You make one mistake, and something will break. You do get to keep all the bloody pieces.

In any case, when I started on this barefoot-style / natural running adventure, I had subconsciously set myself the limit of 200km before evaluating the success of the experiment.

At 200km, the experiment was still unsuccessful (different parts of feet and ankles were taking turns complaining) so I moved the threshold to 300km, with the plan to move it to 400km if required.

I call this The Stubborn Scientific Method(tm): You keep running the experiment (harr harr) until it says what you want it to say.

To be fair, in this specific case an injury would have (and still can), stop the experiment. Most fortunately the muscles, bones and tendons in my feet, ankles and calves, although complaining quite audibly, have held up.

This past Sunday I did a long(ish) run where it felt for the first time like my feet and ankles had finally toughened up enough (and perhaps my form had also improved slightly) to just keep on propelling me forward quietly and efficiently.

Together with the brilliant sunny winter morning conditions, this conspired to reconfigure my face machine into a rather long-lasting grin.

I am carefully optimistic that I might be able to make this specific adventure a more permanent one, and that makes me really happy.

The Emacs Section

NERD-ALERT. SKIP TO THE NEXT SECTION IF YOU ARE NOT INTO TEXT EDITORS!

A friend from work sent me a ZIP file with research data.

I was super surprised that I could easily decompress the ZIP file using Emacs Dired (Dired is of course the file-manager built into Emacs, doh), but that there was no easy way to mark and extract specific files from the archive.

I found an SO answer with a piece of Emacs Lisp code that someone had put together and integrated it with my Emacs.

It worked, but it didn’t default to the opposite Dired file-list pane as all commander-style tools should do, and by default it re-created relative paths, which is the opposite of the default in most two-pane commanders I know.

As is the wont of Emacs users, I reshaped the code ever so slightly to work like I thought it should.

Shaping Emacs Lisp code has a pleasant fluid feeling to it. Code is data, code is configuration, data flows through code.

I’m telling you this story, because it was a nice little reminder of one of the reasons I like this software so much.

You can find my modified version of archive-extract-to-file.el as a github gist.

The Odd Bits of Interesting News Section

  • Differentiable Image Parameterizations, a beautiful machine learning article on Distill that surveys and showcases different techniques for generating beautiful images with deep learning. These networks sort of learn to see in order to solve specific tasks, but you can tickle them in different ways to get them to show you the insides of their visual circuitry, and it’s quite beautiful.
  • The Prophylactic Extraction of Third Molars: A Public Health Hazard is an article which was published all the way back in 2007. It makes the claim that at least two thirds of wisdom tooth extraction are unnecessary. One could say that their only function is to… extract your money. BA DUM TSSSSS! To that I would like to add: WHY DENTISTRY WHY? HAVE YOU NOT HURT US ENOUGH?!
  • A colleague at work emailed this TechCrunch post about a 3D printed neural network that diffracts light going through in order to do its trained inference work on incoming images. Although it’s a retro-futuro-mind-bending idea to do it with a whole neural network, and it smacks of hell-yeah-this-is-what-scifi-promised-me-that-AI-would-look-like, I could not help but recall a certain Very Flat Cat telling us about this sort of passive light-based computation almost 20 years ago.

The Poetry Section

GOU#1 had to select an English poem to recite for class.

From the depths of my memory bubbled up The Road not Taken by Robert Frost.

I had forgotten how much subtlety and recognisable human complexity this poem was able to pack into such a petite little frame. If you have the time, read the analysis linked above after spending some time with the poem itself.

Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,

And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.

I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I—
I took the one less traveled by,
And that has made all the difference.

Friends, no matter which paths you take this week, I hope that we may meet again.

Weekly Head Voices #146: You too can learn Kung Fu.

This post covers the period Monday June 11 to Sunday June 17. Read it to become rich, yawn at Lisp and Emacs, yearn to run free on the wide open plains and to learn Kung Fu. Not ambitious at all.

Front door nearby De Waal Park, in Cape Town. Photo taken on Sunday by GOU#1, age 12.

Social Democracy FTW

It turns out that your chances of becoming rich are the greatest if you had the good fortune to have been born in one of the Nordic social democracies, such as Norway, Sweden or Denmark.

The US trails these countries, at position 13, in terms of per capita individuals with net worth over $30 million.

Being a proponent of social democracy as the most humane form of currently practical human government, and often infuriating conservatives   by pointing out that many crucial aspects of social democracies can be described as socialistic, I really enjoyed the linked TEDx talk by Norwegian Harald Eia.

This material will serve me well as the source of future mischief.

Paradigms of AI Programming in Common Lisp

I am currently working my way through “Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp”, Peter Norvig’s famous 1992 book an artificial intelligence. Although modern AI has been transformed almost unrecognisably since then (THANKS DEEP LEARNING! Norvig’s PAIP retrospective) the way in which Norvig uses Lisp to model and solve real-world problems is inspiring and quite foundational.

It’s not only that though.

My inconvenient but uncontrollable infatuation with Common Lisp also seems to be pulling the strings. I should study a real language which is not 60 years old, like Rust or something.

What attracts me about Common Lisp is the liberated and pragmatic way in which it enables one to mix functional, object-oriented and procedural programming, and, perhaps most importantly, how it was designed from the ground up for iterative and interactive programming.

Tweak the defun, eval the defun, watch the system adapt. This is what I always imagined programming would be like. Except for the Lisps, it really turned out perhaps a bit more boring than it really needs to be.

interleave-mode for working through PDF books

For the fellow Emacs users, I also wanted to mention the utility of interleave-mode for working through such a programming book, if you can find it in PDF format.

In my Emacs I have the PDF on the left, and my interleave-mode-linked orgfile on the right. On any page of the PDF I hit the i-button to add a note in the orgfile, where I can of course insert and execute live code snippets.

The sections in the orgfile remain linked to the correct pages of the PDF.

For programming books this is an amazing combination. For studying other books, having your orgfile notes linked will probably also be quite useful.

On the topic of note-taking: This past week, on Friday June 15 (I made a note of that), I was able to help a colleague solve a technical problem by searching for and retrieving an org-file note, including detailed configuration settings, that I made on May 13, 2014.

Ether as currency

Although I acquired a small amount of the Ether cryptocurrency for the first time in July of 2016, I’ve never had the opportunity to actually transact with it.

Up to now, it has functioned solely as a pretty volatile store of value.

On Saturday, I used some ether for the first time to straight-up buy something on the internet, which was a pretty exciting but in practice an uneventful procedure, fortunately.

The vendor used a payment processor which presented me with an address and corresponding QR code. I scanned the QR code with the relevant mobile app (Luno in this case), paid the requested amount, and waited for a few minutes for it to be multiply confirmed by the blockchain. The sending fee was about 0.04% of the transaction.

Barefoot-style running update

On Sunday I went for a long(ish) run, bringing my total on the Luna sandals to just over 200km.

My feet, ankles and calves are much stronger than they used to be, but the barefoot conversion is clearly still has some ways to go. I have to take at the very least two rest days (instead of one) between runs to give my feet some extra time to recover.

What I have recently started doing, is that instead of trying to micro-manage my form (put your foot down like this, bend your ankle like that, let your achilles tendon shoot back like this, and so on), I am following the advice of some new random person on reddit/r/BarefootRunning who gave the advice, often echoed elsewhere by barefoot-runners, to try and maintain a cadence (steps-per-minute) of at least 180.

That sounds pretty high for a normal person like me, but it turns out that when I do that, and I try at the same time to run as silently as possible (I often just APPEAR right beside someone, hehe), my legs and feet figure out their elastic bio-kinematics all by themselves.

As yet another random reddit expert (I wish I could find the post) quipped:

You can’t overthink proprioception.

(that’s a running nerd joke)

I know Kung Fu

Do you remember this scene from The Matrix (1999)?

The other day at the Old People Reunion, friend T. Monster, a highly capable pragmatist but also backyard theoretician, talked about how often it happened these days that you had to deal with some DIY issue, tapped or spoke the question into youtube, watched a video or two, and then fixed the issue like a pro.

This, along with my recent pseudo-expert repair of a number of stripped cabinet hinge screw holes with tooth picks and cold glue (this works, I kid you not), made me think that, although The Matrix version was perhaps far more spectacular, we in fact now find ourselves in a real, shared reality where a large subset of skills can be acquired a la carte.

Some may take longer than a few minutes, but it still is pretty amazing how far YouTube has managed to democratise so many different forms of modern Kung Fu.

 

 

Weekly Head Voices #144: Eternal learner.

Welcome back friends!

(Right after the nerd news, there’s running and backyard philosophy. You can start wherever you like.)

Nerd News

The Weekly Nerd News Network (WNNN) wanted to bring the following points under your attention:

  • Emacs 26.1, the first major release since September 2016, when 25.1 came out, happened on May 28. Although Emacs reached perfection (and sentience, some say) a few decades ago, this new version does include improvements such as native line numbering for the VIM refugees and buttery smooth scrolling on X11 (read the very entertaining story behind this).
  • PyTorch (my favourite deep learning tool by far) and Caffe are merging. This is amazing because while PyTorch is some of the most dynamic and flexible deep learning software you can pay with, Caffe runs on your telephone. You’ll be able to fine-tune your deep network on PyTorch, and then click a button (or type some obscure incantation, probably) to get that network in a highly efficient compiled form on any embedded device or scaled up to run on your cloud. Although apparently not possible, this really does feel like free lunch!

Reunion

In Weekly Non Nerd News (WNNN), an old friend came to visit all the way from Omaruru, an occasion which served as the happy excuse for a mini-reunion at my place.

It’s strange to think that some of the university stories we recounted are now more than 20 years ago.

In that time, humans go from birth to fully formed adult human beings with opinions, and relationships, and stories of their own.

Thank you Omaruru Friend for bringing us all back together again.

Running mouse

The flu and/or cold virus that managed to enter through the cracks left by my immune system being under pressure from above-mentioned celebrations caused a week-long period of man flu, a period that I was only able to conclude today with a lovely winter morning run.

As one does, I continued searching until I found evidence confirming my belief that running with some remaining flu symptoms would not be irresponsible.

What I found was even better than that!

A 2005 study titled Moderate exercise protects mice from death due to influenza virus, published in the journal Brain, Behaviour and Immunity, found that in mice that had just been infected with a real influenza (i.e. not man flu) virus, moderate exercise had an additional protective effect relative to no exercise or strenuous exercise mice. The PDF full-text can be found on the sci-hub website, or via their telegram bot (the bot is really convenient, you can find and read fulltexts on your phone!).

Thanks to the internet, and lab mice, I had confidence that I was probably not going to die due to my run.

Confirmation bias aside, or not, based on more reading it looks like moderate exercise is not the worst thing you can do during or after cold or flu. The secret is to keep it relaxed, and to keep a very close eye on your heart and your temperature.

Mastery

I finally finished reading the book Mastery by George Leonard, a recommendation by LS that I am grateful for.

It can get preachy at times, but the core message is really good, and especially timeous in this era of hyper distraction.

Below is Leonard’s message, sent at least once through the old washing machine that is my brain.

Learning is a lifelong process.

More specifically, the path to mastery of any worthwhile skill usually consists of short bursts of novelty exhilaration (you often start with one of these) followed by long and seemingly boring plateaux of never-ending practice with no kick.

No kick means that many learners decide to quit, and switch to something exciting, only to repeat their cycle of not-mastery there.

If you are able to make peace with the plateaux, and keep on trudging along, you are on the path to mastery.

In a decidedly Buddhist twist, being on the path to mastery means that you are in fact an eternal learner, and you will never become a master.

The author of the book is an Aikido sensei. I especially loved the story he told of the beginners and the senseis.

When beginners practise, they ask the sensei for a new move to practice every few minutes. They try to get through as many moves as possible during their 2 hour training session.

When senseis practise, they practise the same basic move over and over for many hours, losing themselves in the universe of that single apparently straight-forward form.

The Buddhist Twist

From the Wikipedia page on Buddhism:

The Four Truths express the basic orientation of Buddhism: we crave and cling to impermanent states and things, which is dukkha, “incapable of satisfying” and painful. This keeps us
caught in saṃsāra, the endless cycle of repeated rebirth, dukkha and dying again. But there is a way to liberation from this
endless cycle to the state of nirvana, namely following the Noble Eightfold Path.

… and then later:

…. and finally passing through the gate of wishlessness (apranihita) – realizing that nirvana is the state of not even wishing for nirvana.

I can work with this.

Readers, I wish you wishlessness!

Weekly Head Voices #143: The rider and the elephant.

Pretty autumn sunset. A few metres below, the ritual weekend-starting braai was picking up speed.

Welcome back kids!

Besides this post, which somehow turned out to be longer than I expected, my more nerdy alter ego also wrote a post titled Interactive programming with Fennel Lua Lisp, Emacs and Lisp Game Jam winner EXO_encounter 667.

#DeleteFacebook, part deux

In an unsurprising (to me) turn of events, the Cambridge Analytica scandal has not even caused a dent in Facebook usage.

#deletefacebook, also discussed in a previous edition of the WHV, never really happened.

To the contrary, it seems people even increased their usage, post-scandal. FB share price is back where it used to be, and as an interesting data point, Deutsche Bank reports that their FB-based advertising reach was unaffected by the removable of more than 500 million fake facebook accounts.

Should we deduce anything more from this than the usual 1. humans, even outraged ones, have really short memories and/or 2. most people don’t have the energy to resist, or the presence of mind to avoid, the deeply-seated social desires that are being exploited to varying degrees by the large social networks?

My personal strategy for a while now has been to make liberal use of the unfollow and the mute functions. It’s far from perfect, but with this it is possible to reduce drastically the stream of incoming information, and to make sure that what does come through has to do with friends that you have made the deliberate choice to connect with actively.

Shorter focus blocks work better

In my eternal and sometimes decidedly Sysiphean quest for more and better work focus, I recently started using Focus App (see Pro Tip #2 in WHV #126).

In short, when you activate the app’s focus mode, it kills off and then blocks anything that is remotely fun or even slightly distracting on your computer. This includes websites and applications.

In the beginning, I was enjoying longer (1 to 2 hour) focus blocks.

However, more recently I started noticing a certain recalcitrance in my focus-starting hand.

Especially late in the afternoons (prefrontal cortex GONE by then, remember?) the knowledge of that mega-block of mental exertion would result in highly undesirable procrastinatory behaviour. (Big words for “oh, I can probably fit in one more /r/emacs post!”)

Anyways, it turns out there’s another really good reason that pomodori are only 25 minutes long.

It’s much easier to start a 25 minute block of no-fun-focus, and then get stuck in the zone, than it is to start what your brain expects to be a multi-hour block of mental exertion.

Friend PK introduced me to the tiny rider trying to control the giant elephant as a metaphor for the conscious and unconscious mind (this is from the book The Happiness Hypothesis). The shorter focus block idea seems like it could be filed away under “tricks to control your stubborn elephant”.

The evolving soul of Emacs

I came across this really interesting piece by Richard Stallman about the origin of Emacs, one of my favourite and probably most-used technical artifacts. It’s the multi-tool of computer software.

But, along the way, I wrote a text editor, Emacs. The interesting idea about Emacs was that it had a programming language, and the user’s editing commands would be written in that interpreted programming language, so that you could load new commands into your editor while you were editing. You could edit the programs you were using and then go on editing with them. So, we had a system that was useful for things other than programming, and yet you could program it while you were using it. I don’t know if it was the first one of those, but it certainly was the first editor like that.

When an experienced user interacts with Emacs, they change it, and it changes them.

The opposite of instant gratification

On Friday I started on a slightly longer than usual run.

It usually takes a kilometre or two before all of my running subsystems come on line, and I find my rhythm.

Not this time.

The acclimatisation discomfort in my ankles and calves didn’t fade away as it usually does. My breathing and running cadence stubbornly refused to lock on to their usual correct settings.

My legs felt tired.

It really felt like I was not supposed to be running at all, but I pressed on because at that point there was not much else I could do.

At the turn-around point (the bridge at the entrance to Vergelegen, with beautiful trees all around) I decided to try out some youtube advice from the evening before and do a few deep squats to freshen up my legs.

I started running back on legs and calves and feet which suddenly felt like they had all been replaced with brand-new rested versions of their 2-minute-ago return-to-manufacturer selves.

The rest of the run was of the floating over the ground how-is-this-possible my-smile-might-break-my-head variety.

Super strange.

I don’t think the squats did it. That was just a sort of thought-process punctuation which somehow distracted the mind-elephant for long enough to get me running again.

Anyways, as I was floating home, I could not help but see the whole occurrence as a fairly physical but in this case fortunately quite compact reminder that some of the most worthwhile experiences simply require perseverance with initially no gratification in sight.

Life is a marathon

… so sleep well, eat as healthily as you can, exercise, and try not to stress too much.

We’re in this for the long haul.