## PostgreSQL – Recursively Query Hierarchical Data

I recently wrote a post about how to query hierarchical data without recursion in PostgreSQL. Now it is time to talk about how to do it with recursion. ðŸ˜Ž CTEs (Common Table Expressions), AKA WITH clauses, provide us the ability to not only use a query as if it were Read more…

## Embedding Stylesheets in JavaScript

Now Available in YourJS One of the cool things about JS is that you can do almost anything with it! The only thing is that you need to have the tools to get that “anything” job done. Recently, I had the desire to embed HTML, CSS, and JS all in Read more…

## JavaScript – Getting All Text Nodes

I have been working on something I am calling JS-Proofs (or jPaq Proofs). While working on the menu I was faced with the annoying issue of either not having whitespaces between my elements in the markup or removing them some other way. Since my favorite language is JS, I decided Read more…

## JavaScript – Euclidean Algorithm

One of the things that you often have to learn early on in school after multiplication and division is how to find the GCD (Greatest Common Divisor) of two numbers. It is possible that you know the GCD as the GCF (Greatest Common Factor) or the HCF (Higest Common Factor). Read more…

## POW Answer – Explain That SQL #1

To answer last week’s POW, the purpose of the SQL was to generate a random string of letters and numbers. I actually wrote two different JavaScript function that can produce the same results. The following is the slightly more straight-forward solution: The next version is a bit harder to follow Read more…

## JScript – Recursively Call A Script

Have you ever wondered how you can recursively call a JScript? Here is an example which shows how it can be done: It is important to note that the above example will not pass any variables that were passed to it. If you want to try this out on your Read more…

## 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:

## POW Answer – Unnamed Function #1

The answer to last week’s Problem of the Week is that the following definitions represent the factorial of the given non-negative integer: Mathematical Definition Function Definition Condition unnamed(n) = 1 if n = 0 n Ã— unnamed(n – 1) if n > 0 JavaScript Definition Although it may have been Read more…

## Forcing A Constructor In JavaScript

Did you know that you can force a function to only act as a constructor? The following is an example of a Person pseudo-class which can be defined with or without the new keyword: One of the things that you may have noticed is the fact that I am throwing Read more…

## Deep Copy of Arrays

With jPaq and many other JavaScript libraries, it is very easy to do a shallow copy of an array. On the other hand, it isn’t as easy to do a deep copy of arrays. For this reason, I plan on replacing the Array.prototype.clone() function with the following: The above code Read more…