Tag Archives: Control flow

JavaScript Performance: for vs. while

JavaScript Loops If you have read some preformance tests on JavaScript loops, you may have heard that “while” is faster than “for”. However the question is how faster is “while”? Here are some results, but first let’s take a look … Continue reading

Posted in javascript | Tagged , , , , , , , , , , | 3 Comments

Computer Algorithms: Binary Search

Overview The binary search is perhaps the most famous and best suitable search algorithm for sorted arrays. Indeed when the array is sorted it is useless to check every single item against the desired value. Of course a better approach … Continue reading

Posted in algorithms, PHP | Tagged , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Using PHP’s array_diff in Algorithm Development

array_diff can be really powerful. Once you’ve to find the different elements between two arrays you’ve to use array_diff. Here’s a case when you can use it while coding a simple algorithm. The Task You’ve one array with tickets of … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , | 1 Comment

Friday Algorithms: A Data Structure: JavaScript Stack

Algorithms and Data Structures Instead of writing about “pure” algorithms this time I’ve decided to write about data structures and to start with a stack implementation in JavaScript. However algorithms and data structures live together since the very beginning of … Continue reading

Posted in algorithms, javascript, micro tutorial, web development | Tagged , , , , , , , , , , , , , | Leave a comment

One Form – Multiple DB Records

I’ve the impression that even it’s a simple technique it remains quite misunderstood! What’s the Goal? You’ve a simple HTML form with several groups of form elements. Imagine the situation with title and link groups. You can have 1, 2 … Continue reading

Posted in PHP, web development | Tagged , , , , , , , , , | Leave a comment