Article of the week

Converting tree to correct HTML list in PHP

Converting tree to correct HTML list in PHP

07 Jul 2017 22:48:43


Converting trees into correct HTML lists using tree traversal in pre-order algorithm.


Read full article »

Recent articles

Dissecting e-mail spamming hack based on PHP CGI

24 Jul 2020 18:27:44

Dissecting e-mail spamming hack based on PHP CGI

In this article, more out of curiosity than for a good reason, I look at one way of how e-mail spam gets sent by hacked PHP CGI setups. The scenario goes like this: a carefully crafted URL changes PHP configuration to enable a remote file inclusion into a script executed by a ...

Read more »

Using arrow functions for recursive post-order tree traversal

24 Jul 2020 00:31:31

Using arrow functions for recursive post-order tree traversal

JavaScript arrow functions are cool addition to the language. You no longer think about a good name for your function, are allowed to skip "function" keyword, and sometimes even drop parameter's enclosing parentheses. In this article I look at whether these ...

Read more »

Transforming range of variable to 0 to 1 and custom ranges

18 Jul 2020 00:39:07

Transforming range of variable to 0 to 1 and custom ranges

One useful skill when it comes to dealing with variables is to be able to change their range. One of the most useful and desirable ranges is [0,1]. Occasionally you might need a different range like [-1,1], too. This article describes a couple of methods of scaling and descaling ...

Read more »

Checking trees for sameness with recursion and spaceship operator in PHP

16 Jul 2020 14:51:53

Checking trees for sameness with recursion and spaceship operator in PHP

At some point in your adventure with programming you are likely to find yourself in need of determining whether two trees are the same or not. This article describes two methods to do it. First on them relies on a recursive algorithm, the other, shorter, simpler and more ...

Read more »