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: var binarySearch = (function(internal) { function search(array, item, temp1, temp2) { array = 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): var unnamed = (function(a) { function b(c, d, e, f) { c = c[e = parseInt((f = c.length) / Read more…

By Chris West, ago
Blog

POW – Fill In The Blanks In SQL

One of the things I always find interesting is the fact that DBAs almost always use some type of auto-increment method in order to generate unique IDs for records. Sometimes, though, you may have a table in which you don’t want to use the default method of generating the next Read more…

By Chris West, ago
Blog

POW – Fixing Compilable JavaScript Code

Many JavaScript/JScript developers use Google Closure Compiler to compile their code. Even though this tool is a great way of minifying JavaScript code, believe it or not, it doesn’t always work (at least as of May 14, 2012). The following JavaScript code works fine when you run it without being Read more…

By Chris West, ago
Blog

POW Answer – Party Balloons

This is the answer to last week’s Problem of the Week: One thing that I like to do when solving these types of problems is determining what percentage of the work each participant will do. The problem stated that Tasheera takes 16 seconds for each balloon, whereas Omar takes 18 Read more…

By Chris West, ago
Blog

POW – Party Balloons

A group of friends are preparing for a party. Tasheera and Omar are in charge of preparing the balloons. Tasheera takes eight seconds to inflate each balloon, three seconds to tie each, and a five second break in between each one. Omar takes ten seconds to inflate each balloon, five Read more…

By Chris West, ago