Blog

POW Answer – Unnamed Function #2

This answers the Problem of the Week from May 8, 2012. The identity of this well-known computer science function is the binary search. The following is the same code from before with the variables more properly named: To tell you the truth, after using the real names in the function Read more…

By Chris West, ago
Blog

POW – Unnamed Function #2

This Problem of the Week involves determining the identity of a well-known computer science function and renaming the variables so that the definition makes more sense.  The following is the function definition (obfuscated by me): What I can tell you is that this function takes in a sorted array (in ascending order) as the Read more…

By Chris West, ago
Blog

OpenKM Scripting – Creating Folders

We recently had the need to create hundreds of folders but didn’t want to do so manually. Unfortunately, this wasn’t as easy as simply going into the database and adding them. Fortunately, it was as easy as using the following script: That script creates the following folders with the same Read more…

By Chris West, ago
Blog

JavaScript – Binary Search

The following is an implementation of a binary search for arrays which gives you the ability to do fuzzy matches (default), exact matches, or specify your own comparison function: I used the following to test the normal execution of this binary function:

By Chris West, ago