PHP: (Ab)using the For-Loop

22 07 2017

Flickr:  by mald

This blogpost draws inspiration from a similar one exploring ways to use or abuse loops in the C Programming Language Read the rest of this entry »

Advertisements




A Recursive Exercise in C

20 07 2017

By Photo: RK812, Doll carved by Zvezdochkin, painted by Malyutin

Recently someone asked an interesting question at StackOverflow about using recursion  in the C Programming Language to achieve the same result as code relying on a loop structure.  The question pertained to outputting a geometric pattern. Read the rest of this entry »





The Travails of Traversal

13 07 2016

Flickr: By JacobDavis

The venerated foreach-loop may seem to have formed a part of PHP from the outset, but it actually entered the language starting with PHP 4, apparently appropriated from Perl. While nowadays, this control structure provides a convenient way to iterate over an array or object without the complication of conditional looping inherent in for, while, and do-while loops, it was originally intended to provide a way to easily traverse arrays (see PHP Manual published 3-6-2003). Read the rest of this entry »





Comments on Algorithm Season

27 07 2010

Someone sent me recently not one but two lengthy comments on Algorithm Season which unfortunately lacked a valid email address. However, I think it is worthy Read the rest of this entry »





Math: Factorials and PHP

18 06 2010

What is up with the technical questions based on an understanding of math? When was the last time I actually worked for a client who needed me to find factorials using PHP? Oh, well, instead of procrastinating by dwelling on past glories, let’s consider the following technical question: Read the rest of this entry »





PHP and Numbers Divisible by Three

16 06 2010

The recent technical test also had a fun sort of question in which one needs to write some code Read the rest of this entry »





Rabbits and Numbers

2 04 2010

This is a post I’m resurrecting from my old blog because it deals with an interesting mathematical subject, Fibonacci numbers. Apparently, the acclaimed 13th century mathematician Leonardo Fibonacci applied the numerical sequence in solving a problem involving the growth of a hypothetical rabbit population. Read the rest of this entry »








%d bloggers like this: