Article of the week

Substituting file contents in place with BASH and sed

Substituting file contents in place with BASH and sed

05 Mar 2017 16:33:19


Article on substituting pieces of contents of a file in place with BASH and sed.


The problem of substituting file contents in place on the command line is an old one. Often it creeps out when dealing with configuration or other text files. You just need a quick substitution , perhaps with sed, but what you end up with is frequently either none or a wrong ...

Read full article »

Recent articles

Recursive implementations of some Maths sequences and series in PHP

28 Jul 2017 17:54:44

Recursive implementations of some Maths sequences and series in PHP

In this article I give a couple of PHP implementations of popular Maths sequences and series. Broadly, each piece of code given returns nth term of a sequence / series. Each of the implementations depends on linear recursion. Each of the functions a is a static methods of class ...

Read more »

Finding whether a UTF-8 encoded string is palindrome

27 Jul 2017 13:49:31

Finding whether a UTF-8 encoded string is palindrome

When recently entertaining myself with recursion in PHP I have come across a problem which asked to find whether a given word was a character-unit palindrome or not. I guess, a word of explanation on character-unit palindromes is needed in this place now. Basically, they are ...

Read more »

Converting tree to correct HTML list in PHP

07 Jul 2017 22:48:43

Converting tree to correct HTML list in PHP

From time to time, when doing coding for the web or otherwise, you might come across a tree of data to be turned into a correct HTML list (what "correct" means in this context will be explained in a minute). In order to meet the requirement, you have to be able to ...

Read more »

Traversing trees in pre-order recursively in PHP

03 Jul 2017 13:58:12

Traversing trees in pre-order recursively in PHP

Like in the real world, trees are ubiquitous in computer programming today. Frequently tree data structure turns out to be a perfect choice for modelling a naturally occurring phenomena and not only them these days. The bad news is, unlike one-dimensional arrays or other data ...

Read more »