Weekly Head Voices #134: SCARF.

Untitled artwork by GOU#2 (age 7), who is also known as My Most Favourite Middle Child.

I somehow forgot to take photos this past week. At the very last moment, GOU#2 delivered, as if commissioned, the piece shown above.

The WHV visual element lives to fight another day!

The rest of this post is divided into three parts: One for the programming nerds, one for the running nerds and one for the arm-chair psychologists. Feel free to pick and choose!

C++ quo vadis?

This week, we spent more than a day chasing an elusive memory-related access violation (big words for “crash”) in the software we recently released.

In the end, the bug was only really reproducible on Windows 7 (not on Linux, not on macOS, and only with great difficulty and infinite patience on Windows 10). It turned out to be hidden deep in a well-tested, industry-backed open source C++ library.

This and the specific nature of this bug again demonstrated to me that C++, although I love it dearly, simply has too many well-disguised flaws (let’s call them foot-guns) which will eventually lead to even the most experienced and sharp programmer making mistakes.

In spite of the recent language renaissance (C++11, 14, 17 with 20 imminent) and a slew of improvements, it’s still too easy to write unsafe code.

With contenders like rust (rustlang AJ, rustlang!) which enable programmers to write programmes which have C++-level performance but are by default safe, could C++’s days be counted?

Run

It was time to retire my trusty pair of Asics Cumulus 18 shoes.

They had clocked just over 900km, which is perhaps a little too much. By the end, I could feel the bones in my big toe’s main joint (apparently also known as the big-toe’s MTP or metatarsophalangeal joint) crunching down with each strike.

Normally not prone to these types of visits, I had no choice but to pop out to the Run Specialist Store in Edward street on Thursday to get a new pair of activity-proof foot covers.

They let me run on a treadmill (whoohooo running!) with a high-speed video camera. In the footage, we could see that indeed my conversion to forefoot running had been successful (which was good to hear, because it had cost me about 100km of pain), but that I tended to land on the outsides of my forefeet.

The minimal shoes I had had in mind were not (yet) to be.

Instead the run doctor prescribed a pair of Saucony Kinvara 8s, which make my old Asics look like previous generation gardening shoes. I’ve since taken these out on two runs. They are super light, and super springy (everun FTW?), but I have to say that I have my doubts about the durability of the outsole. I’ll report back.

In February, I’m pretty happy that I managed to squeeze in just over 110km of running, which is not too shabby (by my standards, as always!) for the short month.

SCARF

Yes, winter is coming, but this, although also quite useful, is not that type of SCARF.

I am still reading David Rock’s book Your Brain at Work, and SCARF is his mnemonic for Status, Certainty, Autonomy, Relatedness and Fairness.

These are five social needs, the threat or confirmation of which can have profound effects on humans.

If you feel that you are being unfairly treated, for example, this triggers a low-level threat response which fundamentally complicates dealing rationally with a situation.

Conversely, if for example an interaction grants you more certainty or even better autonomy, you are magically able to contribute significantly more cognitive capacity and creativity to that interaction.

Both the fundamental threat and reward responses go for all five of these qualities. Once you know what to look for, it’s easy to go through some of your memories and to see where one or more of the SCARF needs played a role.

Although one (hopefully) mostly intuitively integrates this in one’s daily dealings, I think it’s super useful being able to enumerate the SCARF social needs like this. It helps when managing oneself in any situation (especially when your prefrontal cortex is exhausted, which is just about always), and it certainly helps when you might find yourself in position where you are able to contribute to another human’s well-being.

The end

Have a great week friends, I hope to see you again soon!

P.S. if there are any arduino uno -> hardware serial -> xbee experts in the audience, I would like to have a word. (sparkfun shield. with software serial can talk to xbee. with hardware serial, and sparkfun switch in the right position, xbee won’t respond. uno is a robotdyn clone.)

Weekly Head Voices #123: A semblance of a cadence.

Yes, we ended up in the mountains again.

In the period from Monday June 12 to Sunday June 25 we were mostly trying to get through the winter, fighting off a virus or three (the kind that invades biological organisms you nerd) and generally nerding out.

One more of my org2blog pull requests was merged in: You can now configure the thumbnail sizes your blog will automatically show of your uploaded images. Getting my own itch scratches merged merged into open source projects never fails to makes me happy, even although in this case there can’t be more than 5 other people who will ever use this particular functionality.

Anyways.

ASP.NET Core SURPRISE!

For a work project I was encouraged to explore Microsoft’s brand new ASP.NET Core. While on the one hand I remain wary of Microsoft (IE6 anyone?), I am an absolute sucker for new technology on the other.

You may colour me impressed.

If I had to describe it in one sentence, I would have to describe ASP.NET Core as Django done in C#. You can develop and deploy this on Windows, Mac or Linux. You model and query your data using Entity Framework Core and LINQ for example, or Dapper if you prefer performance and don’t mind the SQL (I don’t), or both. You write controller classes and view templates using the Razor templating language.

C# 7.0 looks like it could be a high development velocity language. It has modern features such as lambdas with what looks like real closures (unlike C++ variable capturing), as well as the null coalescing operator (??) and the null conditional operator (?.), the latter of which looks superbly useful. Between Visual Studio on Windows and the Mac, or the new Intellij Rider IDE (all platforms) or Visual Studio Code (all platforms), the tooling is top notch.

Time will have to tell how it compares to Python with respect to development velocity, a competition that Python traditionally fares extremely well at.

Where ASP.NET Core wins hands down is in the memory usage department: By default you deploy using the Kestrel web server, which runs your C# code using multiple libuv (yeah, of lightning fast node.js event loop fame) event loops, all in threads.

With Django I usually deploy as many processes as I can behind uwsgi, itself behind nginx. The problem is that with Python’s garbage collector, these processes end up sharing very little memory, and so one has to take into account memory limits as well as CPU count on servers when considering concurrency.

The long and the short of this is that one will probably be able to process many more requests in parallel with ASP.NET Core than with Django. With uwsgi and Django I have experimented with gevent in uwsgi and monkey patching, but this does not work as well as it does in ASP.NET Core, which has been designed with this concurrency model in mind from the get go. My first memory usage and performance experiments have shown compelling results.

Hopefully more later!

A cadence of accountability

Lately my Deep Work habits have taken a bit of a hit. At first I could not understand how to address this, until I remembered mention of a cadence of accountability in The Book.

Taking a quick look at that post, I understood what I had forgotten to integrate with my habits. Besides just doing the deep work, it’s important to “keep a compelling scoreboard” and to “create a cadence of accountability”.

Although I was tracking my deep work time using the orgmode clocking commands (when I start “deep working” on anything, I make an orgmode heading for it in my journal and clock in; when I’m done I clock out; orgmode remembers all durations) I was not regularly reviewing my performance.

With orgmode’s org-clock-report command (C-c C-x C-r), I can easily create or update a little table, embedded in my monthly journal orgfile, with all of my deep work clocked time tallied by day. This “compelling scoreboard” gives me instant insight into my weekly and monthly performance, and gives me either a mental kick in the behind or pat on the shoulder, depending on how many deep work hours I’ve been able to squeeze in that day and the days before it.

The moment I started doing this at regular intervals, “creating a cadence of accountability” in other words, I was able to swat distractions out of the way and get my zone back.

This is an interesting similarity with GTD (which I don’t do so much anymore because focus is far more important to me than taking care of sometimes arbitrary and fragmentary tasks) in that GTD has the regular review as a core principle.

Us humans being so dependent on habits to make real progress in life leads me to the conclusion that this is a clever trick to acquire behaviour that is not habitual: Work on an auxiliary behaviour that is habitual, e.g. the regular review, that encourages / reinforces behaviour that is perhaps not habitual, e.g. taking care of randomly scheduled heterogeneous tasks (GTD) or fitting in randomly scheduled focus periods (Deep Work of the journalistic variant).

As an aside, cadence in this context is just a really elegant synonym for habit. I suggest we use it more, especially at cocktail parties.

 

Weekly Head Voices #108: Gaga.

I was reminded that future me really enjoys having written these things. (Present me knows about extrapolation.)

interested in time travel

Actually present me also enjoys this, but creating sufficient amounts of time to do so is often challenging. I have most recently convinced myself that I should see this as practice so that I will later be able to write really entertaining posts in minimal time. Until then my two readers, I hope to compensate with edification.

Genetic Offspring Unit (GOU) #3, the rapidly glowing cellular mega-city that first made contact with extra-wombular (I made that up) light slightly more than three months ago, suddenly started babbling a few weeks ago. To be honest, I thought that she was going to be really quiet to compensate for the immense amount of continuous talking in my house. It turns out that her reaction has instead been one of taking this bull by the horns. SHE WILL BE HEARD. (GOU#1 and #2 are able to produce speech with an intensity that is to be heard to be believed. I have no idea where they got that from.)

Speaking of babbling, I sometimes make videos of me trying to explain nerdy programming-related tricks, and then I upload them to YouTube. My most recent creation is about using the conan.io C++ package manager to get a small SFML-based GLSL example going (that’s GPU programming). It has a soundless explosion at the end!

I came across a really interesting bit of research performed at the Vienna University of Economics and Business (WU) on how really small, seemingly inconsequential rewards, can actually ignite people’s intrinsic motivation. This is interesting exactly because it has long been thought that extrinsic rewards diminish intrinsic motivation, a phenomenon called the overjustification effect.

In the recent study by researchers at the WU, students were encouraged to do extra homework assignments. However, this was done by allocating an amount of extra credit which was perceived by the students as being trivial (this was measured in a separate study). Lo and behold, this perceived trivial extra credit still jump-started that group’s extra assignment submissions, and the students in that group then showed evidence of autonomously (intrinsically) motivated behaviour.

The researchers hypothesise that this could be due to the fact that the students being jump-started could not internally explain their behaviour on the basis of the negligible reward, and hence automatically came up with more intrinsically-oriented motivations, such as personal importance, interest or enjoyment).

South Africa is a really strange and wonderful place. I don’t write about it that much, because in that respect it is my place to be quiet here in the background. However, sometimes someone else writes something that, if you’re interested in the perspective of South Africans who’ve lived abroad for a significant amount of time, and have then returned, somewhat the wiser, because the country in their blood called them back, you really should read. Disco Pants, or rather her blog, helped me a whole lot when we had to decide whether we would be coming back or not. She has a new post out titled “On Surviving the Madness of South Africa”, and it’s a beaut.

On the topic of beauty, Flume has new album out. It’s called Skin, and it gets the highly coveted but completely unknown Weekly Head Voices Album of Right Now award! Here’s the first track to whet your appetite (or not):

Have a fun week listeners!

Weekly Head Voices #105: There will be tears.

Congratulations, you have successfully completed the week of Monday February 8 to Sunday February 14, 2016!

About 4 seconds after posting previous edition WHV #104 to Facebook with the “When you’re a vegan <boy with bulging veins> and haven’t told anyone in 10 minutes” meme image included, friend Ivo T. zinged me with this reply:

12651073_10153234132252035_804640390912092906_n

So much truth. I have been put back in my place. Sorry vegans. Sorry MBA students. Not sorry Ayn Randers.

This is currently my favourite lager ever (at least until next week):

Jack Black Brewers Lager

It is indeed a craft beer. If we’ve ever chatted more than 10 minutes in the past (or in the future), you’ll know everything about my braai, and you probably also know that I find craft beer to be one of the greatest inventions ever, along with fire, and the internet.

Here’s a another beer which I recently had the pleasure of enjoying, at a secret networking meeting (yes, we have secret meetings where we in fact do manage a large number of aspects of your daily life, and where we also orchestrate it so you’ll never suspect that we are behind everything, subtly manipulating reality) where, when the beer arrived at the table, everyone who looked vaguely hipster-like claimed vocally not in fact to be even remotely hipster-like:

Tears of the Hipster Beer

META-HIPSTER CRAFT BEER! At first I was confused, but then I realised it was just another case of WHAT A TIME TO BE ALIVE!

(By the way, I stripped the EXIF GPS data from the Jack Black photo, because privacy, but I left it hidden in the tears of the hipster. First one who tells me in the comments where the secret meeting was held gets a free craft beer!)

Nerd tip of the week: It’s somehow not prominent enough on their site, but GitLab, the open source GitHub alternative, also offer free hosting of an unlimited number of private repositories with an unlimited number of private collaborators. In other words, if you’re on a budget, you can host your commercial and proprietary project git repositories (and bug tracking and wikis) there at no cost. This is cheaper than github ($7 for the smallest subscription for 5 private repos) and better than bitbucket (private repos for free, but if you have more than 5 team members you have to pay). I pay quite gladly for the online services I use, but in this particular case, such a level of free is hard not to like.

Nerd tip #2 of the week: The Clang static C++ analyser is brilliant. If you program in C++, and you need to up your game, integrating this into your workflow is a solid step in the right direction. I’ve been using this via the scan-build method. Let me know in the comments if you’d like to know more about this!

After some professional ethernet cabling down to the sort-of basement of our new house, I have checked off another item from my non-existent bucket list: We now have a lab at our house. So far there are computers, all kinds of DIY supplies and art stuff for the genetic offspring units, and all of this to create. I spent some of the best times of my life in labs of some sort of another. It’s really great bringing some of that back home to my clan.

Have a great week kids, see you on the other side!

Weekly Head Voices #104: Let me update you.

This post is about things that I noticed in the week of Monday February 1 to Sunday February 7, 2016.

I dug up an email I wrote to Alex Stepanov and Meng Lee, authors of the C++ Standard Template Library on Monday August 3, 1998, to ask them if they would have written a matrix template, if they would have derived it from the vector template. Stepanov answered, the next day (!), that he had never found much use for inheritance. In those days, nerd celebrities mailed you back. Also, poor old C++ inheritance…

A few years later, but still back in the day, @gerwindehaan and I wrote a time management web-app which could automatically schedule all of your tasks. In other words, it would decide exactly what you needed to do when in order to hit all of your deadlines, your appointments and your priorities. It had an ugly UI (story of my life), but it worked (story of my life?). That whole adventure marked the start of our downward spiral away from academia and into the sea of money and debauchery we currently find ourselves in. In any case, I resurrected the old TimeScapers website and wrote a short little retrospective blog post if you’re interested.

I got tired of waiting for the OTA (over the air) update to Marshmallow (that’s Android 6.0) for my LG G3, so I booted into Windows 10 (yes, I have a partition with that also), and used LGUP with the 8974 DLL  (very important to use this and NOT the 8994, else you WILL FAIL) and the official LG G3 Marshmallow KDZ (1.3GB md5sum 711d91254f5e3e02536395b35e1d534f) to upgrade the phone. After one day I can say the following: Looks mildly prettier and feels slightly smoother, but battery life has improved phenomenally. Let me know in the comments if you need help with doing this on your own phone.

The graphical warning below is why I’m not ready to shave my beard quite yet (click for imgur source):

what happens when you shave

As you might or might not have heard, our currency has recently taken quite a serious knock. Fortunately, it’s still extremely good for exchanging for meaty pleasures, such as the almost 2.5kg of rib-eye and t-bone you see in the photo below. Prepared and enjoyed with good friends, this was as beautiful as it looks. The hand you see in the picture belongs to my friend, who is a giant.

rib-eye t-bone yum

Don’t worry, I don’t eat that much meat every day. Also, when I grow up, I want to be a vegan:

bmyBQBE - Imgur

(It’s almost just like when someone is doing their MBA! Have I offended enough people yet? I was also planning to insult people who manage to take Ayn Rand seriously, but they’re not very good with multi-syllabic words, or reading in general. Furthermore, my beef with vegans (I’m on the roll here) and with MBA students is actually just good-natured teasing, a tone I would prefer to maintain. For now.)

Have a great week kids, I hope to see you on the other side!