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

Square pyramidal numbers and implementing them in PHP

19 Aug 2017 14:24:59

Square pyramidal numbers and implementing them in PHP

Square pyramidal numbers and implementing them in PHP Imagine a couple of boxes standing on a table. In each of these boxes there is one or more balls. Boxes are sorted according to the number of balls they contain. When you look into these boxes, you notice, that in the first ...

Read more »

Comparing two arrays or objects with a function in PHP

17 Aug 2017 16:07:40

Comparing two arrays or objects with a function in PHP

In this article I look how to compare two arrays against one another in PHP. For the purpose, I provide a flexible PHP class, which allows for comparisons of both arrays and objects whose internal working is based on array. The class, I called it SWWWArrayCompare, carries out ...

Read more »

Formatting array of numbers recursively in PHP

12 Aug 2017 15:57:38

Formatting array of numbers recursively in PHP

If you have ever tried to obtain a formatted value in PHP, it is likely you did so with one of printf, sprintf of vsprintf functions. In general, these utilities accept a formatting string and one or more arguments. php.net has some good examples and descriptions on how they ...

Read more »

Recursive min and max functions in PHP and speed test

05 Aug 2017 15:03:39

Recursive min and max functions in PHP and speed test

This article provides two more examples of PHP functions which employ linear recursion. They are min() and max(). I wrote them partly for fun, but also to carry out a basic speed test on a piece of interpreted PHP code, results of which I hoped, would give me some insight into ...

Read more »