Learning every week – 10th and 17-Apr-2020

Empty pathway with a cityscape in background

It happened again. I missed sharing my learnings before last week and almost missed again. But better late than never. Staying at home all the time has, ironically, made it more difficult for me to get things done. On one hand, I am making time to do more of other things like cooking and video editing. But I am also finding less and less time to consume knowledge like I did before to actually share learnings. That is fine. I do think we need to have a bit of both–reading and doing–to actually learn.

Using Forks on GitLab

GitLab is an excellent tool which seems very similar to Github in many ways. While it is similar, there are some key differences which surprise us occasionally. In this case, I found another reason why I avoid using forks on GitLab. When a merge request is created from a fork, the CI runs in the context of the fork, not the main repository. The problem is that the fork doesn’t have environment variables and other settings which may be required to run the CI jobs (such as keys, runners, etc). If the job needs access to environment variables or specific runners, the merge requests would always report as failed.

There are various issues I found (some of them closed) talking about this but it essentially comes down to this–GitLab handles CI runs differently than Github, for example, and it’s not changing anytime soon. As of this writing, there is an open issue discussing approaches but no resolution as of this writing.

Memory and Learning

This is from an episode on one of my favourite podcasts. They discuss what is memory, how memories are formed, the role of paying attention in forming memory, and more. The key thing with which I identified in this discussion was the role of attention. It was summed up in the phrase (and I am paraphrasing) “The harder you pay attention, the better you remember.” It just struck me how true it is. For example, I have trouble remembering names and matching them to faces. I have no shortage of stories of embarrassing situations I have been in because of this. Whenever I met someone, I usually said something to the effect of “I’m poor at remembering names.” Now, I realise that I need to make more of an effort to actually remember names. I owe it to those who influence my life in many ways.

“The harder you pay attention, the better you remember.”

I was also reminded of a research finding in another podcast on management. They measured retention of points from a meeting depending on how someone took notes. They found that the person who took notes on a laptop actually performed worse than someone who did not take notes at all. The best results were from people who used pen and paper to take notes. We need to apply more of an effort when using pen and paper which means we pay more attention.

The secret principles of genius

This came up when talking to a colleague. He brought up a book called The secret principles of genius which is a collection of observations of various prominent personalities (geniuses). One of the observations (as raised by my colleague) was that most of these people took impeccable notes. I can see that. I think we all have the potential to create wonders but we are stopped by the organisational mess in our own brains. Putting those in notes and removing them from your brain gives us that space we need to think about our problems and what we learn in a different context. I often say that we only need a third eye to solve a programming problem most of the time. I think this is a very similar notion where we externalise some of what we do to get another perspective.

The power of showing up

This is from another episode from my favourite podcast on leadership. They discuss challenges in parenting and the power of just showing up. The key point is that just showing up is one of the most important things we can do. And showing up is not just being physically present, but make sure they are seen.

Drupal 8 and PHP 7.4

While looking at adding some features to one of my Drupal projects, I thought of a use case of arrow functions which are available in PHP 7.4. Drupal 8 does not yet support PHP 7.4, or so I thought until I found that the issues were fixed in Drupal 8.8.3. I was happy and upgraded the stack to PHP 7.4 when I hit another bottleneck. Platform.sh does not support the Redis extension for PHP 7.4 via configuration. It was not too hard to set up the alternate way to use the Redis extension using the documentation on platform.sh.

Relationships at work

On a bonus episode of WorkLife by Adam Grant, he discusses relationships at work with Esther Perel. Of all the conversations, the one that stood out to me was the discussion on trust and accountability. It’s strangely shocking that accountability doesn’t beget trust. In fact, if you seek accountability, you don’t trust. If you trust, you don’t need to know. This branched into many discussions such as open calendars and visibility bordering on totalitarian systems need to spy.

Moving a deep neural network to a Chrome extension

This is from an interesting post on how Krisp built their Chrome extension and moved their neural network to work in Chrome. The post covers various aspects of the whole process including building the audio filter in a Chrome extension using WASM and challenges to get the model to respond in constraints set by Chrome for audio performance.

Python modules and packages

I wanted to write a script to automate certain parts of our workflow. I chose to write this in Python because of the simplicity it offers in writing scripts like these. The challenge was to distribute this script easily. The script needs a bunch of files to work and the only choice was to make it a package. I started learning to package Python scripts but was soon confused on which was the standard way to package. After some research, I found a guide to package Python modules. Particularly, I found guides in configuring setup.py for packaging scripts and using MANIFEST.in to package additional files. With some experimentation, I was able to release axl-template package on PyPI.