articles

TV is...

Tele values - a means by which values can be disseminated to a wide audience for synchronisation. visual conditioning - a means of training your intuition to trust on visual appearance. By its very scarce nature presentation on tv goes through a very strict selection process leading to an extreme …

The Essence of Testing

“Code without tests is broken by design.”Jacob Kaplan-MossI love that quote. It captures it all. Lacking tests is not just bad practice but effectively bad design. Bad design means that something is wrong with the product. A badly designed umbrella is not fit for purpose and could even …

Bad Design...

... is like taking the wrong road. It doesn't matter how fast you travel if you're going the wrong way. It is always cheaper to pause, reorient yourself then proceed than barrel down the wrong path with armfuls of zeal.

Your JD

As a writer of software your primary task is to hide complexity. Think about it: by writing code you employ various abstractions (functions, classes, modules, commands, API etc.) which represent functionality for some user. You would do well if the user never, ever needs to know anything about the …

"Show me your hands"

This is a great ideal to aim for: that at any time you can be asked to step away from your code and, not only does it continue to function superbly, but those who carry it forward want to reach out and hug you for the fabulous work you've done. …

Hacking Is Like Drafting

All the revision in the world will not save a bad first draft: for the architecture of the thing comes, or fails to come, in the first conception, and revision only affects the detail and ornament, alas!T. E. LawrenceI've previously talked about the three stages of writing software …

From A Physical to Logical Economy

There are two parts to our natural human experience*: the physical and logical. The physical relates to our tangible selves and the logical to our mental selves. Our interactions between these two worlds are so tight that they appear largely seamless, especially given the prevalence of logical tools such as …

Your Secret Weapon Is Your Intuition

Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.Proverbs 4:7 (KJV)One of my teachers fascinated me at his ability to make lightning fast assessments. I was blown away by his snap assessments even without crunching through the details - just a …

Types of Refactor

Name refactor - rename an entity (variable, function/method, class) for clarity in order to reduce logical tensionExtract variable - if a sequence of logic starts repeating itself it's time to create an entity from the snippetExtract method/function Extract class - inheritanceExtract module - when you begin to …

Bugs Make You Strong

Bugs make you strong.Photo by Harish Shivaraman on UnsplashIt sounds counter-intuitive but every bug you find is one step close to making your code base stronger and more reliable. Naturally, we try to avoid any unpredictability in our code almost as if we want to snip all the …

Think Like A Gardener

Great code is grown not built.It is dangerously incorrect to think of code in the same way we think of physical products; that once built they are complete. Software is never complete. The correct metaphor for a programmer is a gardener, who endlessly tends to his garden to bring …

Layers are Good

Photo by Annie Spratt on UnsplashI find that, invariably, code that has been thoroughly pondered over tends to organise itself into layers. For example, for most of the code I write, which runs in the shell, there will be:a presentation layer, which handles commands and options and returning …

Reading: The Part of Writing Great Software

Writing great software is 99% reading documentation.I've previously written about the stages of software development. They are the hack, refactor and integrate stages. The reason the first stack is called 'hack' is because it's usually a representation of a hurriedly put-together product - something you've hacked, …

Your Team: Which Image Best Describes It?

The team of wild horses on the left are not without strength. They are obviously heading in the same direction, which is a good thing. The problem is that they have not been harnessed effectively so that, while they might be producing individually they are not really working as a …

Emergent Design in Software

It is easy to just get going in writing software which is designed for a narrow feature scope. Usually, we can even get away without employing any pen and paper. However, as the feature scope expands it gets harder and harder. Under the waterfall approach the solution was to rigorously …

So, what is computer programming?

A great understanding is transformational. With it your vision is clear and the vista plain. Understanding what computer programming is will amplify your effectiveness at it. In this brief post I will outline the essence of computer programming.A Computer Is A MachineComputers are machines. In the early days …

Successful Software

Software is successful is useful softwarew. Software is primarily successful if it meets the users' needs. Period. Anything else is bonus material. If a software tool has everything else but lack usefulness then it has failed.There are two type of users: consumption users and production users. Consumption UsersConsumption …

Entropy in Software

The simplest way to describe entropy is a measure of disorder in a system. A system with a high level of disorder is said to have high entropy. A more software-relevant way to describe entropy is the additional information required to describe a software system. The task of writing software …

The Dark Side of Object Orientation

Object oriented software design is praised for the fact that it provides an easy mental handle by which a developer may reason about a software entity. However, the bit that is often ignored is the fact that the easy mental handle requires work in order to be teased out. I …

Stages in Software Development

When producing any software you will ordinarily go through three stages in order to deliver excellent value. These are hack, refactor and integrate. The quality of output will depend whether and how well you perform each of these steps. Poor quality software is marked by most if not …

On Roman Numerals

OK. Quick note. I've just come across a Python package for converting Arabic to Roman numerals. Great! But I think it can be improved in several ways.Add documentation even if just in the README file to show how to use it.Add an entry point for users to run …

Keep It Up!

The Google Way to Site Reliability Engineering - https://landing.google.com/sre/

The Value is in the UI

I've just been watching an interesting YouTube video in which a guy solves a sudoku puzzles starting off with very little. It's quite an interesting watch because you're given a front-row seat into observing someone making a discovery of something quite magical. I've always been fascinated with sudoku not least …

Listing of Important Software Tools

Apache Beam (https://beam.apache.org/get-started/quickstart-py/)Used for running pipelines such at extract, transform and load (ETL) in a parallel fashion.Redis (https://redis.io/)In-memory data structure store for DB and cacheMemcachedMongoDBHadoopClusterFSRabbitMQNode.jsCeleryNginxApacheChefPuppetAnsibleTerraformGunicornFluend - https://www.fluentd.org/Unified logging/streaming logsZipkin …

Diminishing Returns

Decrease the size of your web images for all browsers using Google's WebP image format that is supported on all major browsers. They report that you can gain savings of roughly a quarter of a PNG file. PNG files are typically tiny therefore to save even more is very attractive. …

The Business of Science: Model Building

I think it is safe to state without any contradiction that science is in the business of validated discovery of new knowledge. This enterprise primarily consists of appending to the volume of what is known (generally referred to as publishing) through a process that is objective for the …

Searchable list of keyboard shortcuts for Mac OS X 10.5+ (IntelliJ IDEA)

Rider's top keyboard shortcutsOpen Solution or Project   Ctrl+Shift+OShow Action List   Alt+EnterSearch Everywhere   Double-ShiftNavigate To…   Ctrl+Shift+NFind Usages   Alt+F7Select In...   Alt+F1Settings...   Cmd+,Find Action...   Cmd+Shift+AGenerate...   Cmd+N Ctrl+EnterBuild Solution   Cmd+F9Debug...   Ctrl+Alt+DView Breakpoints...   Cmd+Shift+F8Attach to Process...   Alt+Shift+F5VCS Operations Popup...   Ctrl+VRefactor This...   Ctrl+TInspect This...   Cmd+Alt+Shift+AFinding everythingSearch Everywhere   Double-ShiftFind...   Cmd+FFind Next / Move to Next …

Automatic Segmentation of Audio by Speaker

ProblemI recently attended a meeting in which I had to write notes from the discussions. I was feeling lazy so I decided that I would record the audio on my phone then make notes from that. That part worked really well until I sat down to make the notes. …

Using metaclasses to use domain-specific protocols

In Python (3+) it is impossible to create a class which is not a subclass of object. This means that the protocols associated with the class and instances of the class are tightly bound to object. Metaclasses provide a way to extend this so as to have additional …

Class attributes

Here's an exploration of some weird Python functionality: how do we intercept class attribute access?The following won't work.class A: x = 1 def __getattribute__(self, name): print('{}.__getattribute__({})'.format(self, name)) return super().__getattribute__(name) print('A.x =', A.x) # A.x = 1 What about setting __getattribute__ to be a classmethod?class A: x …

Interesting and useful links

Emoji Cheat Sheet (view in private tab - might plant tracking cookies) https://www.webfx.com/tools/emoji-cheat-sheet/ Git Documentation https://git-scm.com/

Last will and testament...

Here is an example code snippet that executes 'last rites'. My current use-case is to handle final tasks on a cluster job management system when the script violates some execution criterion e.g. exceeding memory quota. It's helpful if the job could perform some task(s) that indicate that it had to …

Simple Tool to Perform Custom OCR

I'm going to use OpenCV 3.0.0 (https://github.com/Itseez/opencv/archive/3.0.0.zip) though I haven't decided whether I'll use C++ or Python. I might start with Python to build the prototype then move on to C++ for the actual production code. The library documentation can be found at http://docs.opencv.org/3.0-beta/modules/text/doc/ocr.html.In order to …

Africa's False Start

Nearly all African countries began self-rule on the wrong foot. By the time they were 'in charge' of their own destiny they had already developed a healthy appetite for the colonist's produce. Tragic. And no one had the wherewithal to realise the long term implications.Over fifty years on and …

Recipe for Adding Users to Linux

Create the [email protected] ~$ sudo adduser <username> I like to use a default password that is easy to remember 'Password01' for first log in.Add the user to any additional groups [email protected] ~$ sudo adduser <username> <group> Enforce change password on first [email protected] ~$ sudo chage -d 0 <username> …

The Recolonisation of Africa

I'm getting a bit concerned about how Africa is being overrun by foreigners to the extent that very little room is being left for the locals to develop their lives. Foreigners are far more competitive and better-placed to take advantage of resources and this presents a difficult situation. On the …

matplotlib Plot Compute Model

I'm not a great fan of matplotlib despite how central it's become in data science. This is because of its API: I find it difficult to learn which suggests to me that it's counterintuitive. As long as I'm working with it I can do a lot but the moment I …

SSH Tunnelling or TCP Forwarding

This has to rank as the most confusing topic in using the Linux command line. It is even confusing using Fugu because there are three user, host and ports that can be used leading to a lot of possibilities to get it wrong. To the best of my understanding, SSH …

What is Object-Oriented Programming (OOP)?

Before I tell you about OOP I have to tell you a few other things that you will understand very easily. Then when I tell you about OOP you will just get it.A programmer is someone who write instructions that direct a computer to perform a desired task. The …

Over-explanation and Teaching

There exists an explanation boundary beyond which an explanation seeks to supplant the listener's responsibility to apprehend the subject matter. It seems to me that most ideas are constructed from a finite set of thought motifs. Our reasoning capacity is designed around these motifs. Therefore, explanations should be made in …

Chama 2.0

Banks are private institutions that determine how national economies develop. They are largely private. The result is that private holdings determine national outcomes. Since banks set interest rates and effectively determine the availability of usable capital they throttle production and prevent the realisation of ideas. At any single point in …

Installing Scipy: You're likely to waste your time if you try using ATLAS

Having grown up on a diet of Ubuntu life has always been so easy. Any time I need to install a library Canonical have done their duty and availed a sanitised version that I can snap on with a quick 'sudo apt-get' or 'sudo aptitude'. However, it's not a bed …

Words from the past: Doctor

It struck me some days back that my current pursuits are more suited to my intentions than I earlier thought. See, I'm a teacher at heart. I derive exceeding joy in seeing the lights go on in people's minds. I've been a beneficiary of some of the best teachers on …

Our present opportunity for self-indoctination

We are experiencing something new in the history of Mankind.At no other time has knowledge been available for the asking as it is today. Just twenty years ago the Internet did not exist, mobile phones were in their early forms and the only access to a self-prepared curriculum was …

The Impediment of Terminology

I find statistics hard. Unnecessarily hard. Is it becomes I'm low on neurons? Hardly! It has more to do with the nature of the discipline and how it has evolved.One of the biggest qualms I've had against both probability and statistics disciplines is the fact that they are mostly …

Working with SSH Public Keys

This post is meant to be more of a sign post than anything else...For any fresh installation, a connection via SSH to a remote machine results in the request to store the public key. You have to respond with the letters 'yes' in order to allow the connection to …

The Forbidden Fruit

"And the LORD God commanded the man, saying, Of every tree of the garden thou mayest freely eat: But of the tree of the knowledge of good and evil, thou shalt not eat of it: for the day that thou eatest thereof thou shalt surely die."- Genesis 2:16,17 (AV) …

Javascript and the DOM

The DOM now makes sense! For the longest time I was completely perplexed as to the rationale behind Javascript. In object-oriented design, the fundamental concept is that of a data structure referred to as a class from which objects ('classes at work') are instantiated. The class is the abstraction - …

Pointers (References) in Programming (especially C/C++)

While learning how to write computer programs in C is quite straightforward for the first few miles, it is not until pointers are conquered that a whole new world opens up. This is not to say that pointers are complicated and hard to learn. Rather, much of the power in …

My Argument for Intelligent Design

How do we test for intelligence? Well, suppose that we make an observation of an ordered repeatable event. Since the event is ordered it is not random and since it is not random there exists a causal pathway that it takes to produce the observed result.We can study this …

Where's the Problem?

I repeatedly encounter this situation. It is a very innocent problem but one that, to me, makes a world of a difference.Some technical books have mastered the art of giving explanations. They can describe any algorithm, process or mathematical model with incredible detail but they forget the most important …

It's OK to Re-Discover

I had a heated debate with a friend yesterday. It centred on something I consider quite sensitive yet immensely pivotal. We had previously touched on it in another argument but yesterday's argument brought things to a head.My argument is that Africa needs to discover things for herself. When I …

Compiling and Linking with GSL

Command-line arguments for GSL compilation. Very important!in reference to: "2.2 Compiling and Linking"- Compiling and Linking - GNU Scientific Library -- Reference Manual

Using random number generators in C from GSL

Very useful information about using the GSL in generating pseudo-random numbers with a uniform distribution.in reference to:"18.4 Sampling from a random number generator"- Sampling from a random number generator - GNU Scientific Library -- Reference Manual

Fallacies of Economic Development and Simple Development Formulae

The one notion that repeatedly comes up in development debates is that the government has a central role in creating both the impetus and oil for the development machinery to function. While superficially sensible, I think it fails miserably for the primary reason that the government cannot be held accountable except, …

Breaking the Rut of Africa's Poverty

If you're plumply tucked against your Korean sofa and expect Africa's liberation to arise from Africa's present leadership then you'll die a cold death. The African Union, while the de facto representation of Africa's political will, cannot be relied upon to bring to her what she needs. It's like high-brow …

Path to the World

Internet is like the butter of computers. If you are running a stand-alone computer you are sorely missing out. But given that we are still awaiting a fiber link at the coast to link us to everyone else at blinding speeds the challenge is to find a reliable and cost-effective …

Ports: at last!

Now, I don't want to seem like a block-head but I'm sure that's what anyone who reads this will think. It has taken the longest time to finally grasp the idea of what ports (in TCP/IP) are. If you are like me you will probably gain; if not, you might …

The Pivotal Role of Modelling in Education

It has just distinctly come to my mind that the education systems we deploy are designed with a built-in weakness.Most disciplines are structured in such a way as to require understanding of several fundamental phenomena. While I was at the University of Nairobi, I took what, at the time …

Where Education Systems Fail: Immediate Relevance

I think understanding is enhanced by starting with examples and I'll do just that.Yesterday, I finally appreciated recursion. For those of you who are not into programming and logical problem solving, recursion is defined as applying a series of steps used in solving a problem (algorithm - applying an …

Passive Learning

Extreme frustration!!! I'm not making any headway in French. i can't put my finger on what I have learned at the end of every class. So, what's the point? There has to be a better way... or no way at all!I think the human mind is amazing in the …

Mind Mapping

The learning process is a sacred process: an opportunity to construct in one's (self or others') a model that will facilitate their interaction with the real world. Irrespective of the application domain, the teacher's task can be more successfully achieved if the right mental map is built - it is …

The Fear of the Unknown

I think the reason we fear the unknown is that we are left at the mercy of 'no information' and so we easily replace the object of our fear with our greatest fear, or we find a way of creating a relationship between our greatest fear and the subject at …

The Learning Process

It has just occurred to me how many times we make the learning process unnecessarily complicated. I recently read an article about Database Design. Wonderful article! In fact, quite a number of concepts clicked in place. However, I had the patience to endure terminology. Quite a bore. I think there …

The Rigors of Learning a New Language

What are the challenges that one will face when learning a new language? Given that I am presently learning (or relearning) French, I have put some thought to the matter and I would like to now put them down on paper (on e-ink).I have identified three main challenges. I …

Principle of Extension

I know that I will need to put this in more precise words but I think it is an interesting idea.Most computational devices run on an interesting principle which I think is the one reason we shall not be able to build Artificially Intelligent Systems that are as intelligent …