In a recent tweet from Adam Wathan highlighting one of the examples in his upcoming book, he demonstrated breaking down the process of converting from binary to decimal representation using a pipeline of transformations.
I thought it would again be interesting to see how I would go about performing this process in JavaScript.
Recently I have been looking more into SQL and in-particular how RDMS’s work under-the-hood.
I thought it would be interesting to use some of the lesser-known features that PostgreSQL has to offer, concentrating my efforts on operations performed on a deck of cards.
In a recent Full Stack Radio podcast, discussion around the application of transpose and zip on collections made me wonder how I would go about implementing such a feature in JavaScript.
In a recent SQL statement I stumbled upon an issue in-regard to handling NULL values within a given predicate.
Coming from languages (such as PHP) which are very liberal in their type coercion (NULL can be treated as a falsey value), I was surprised to find how the inclusion of such a value resulted in a sort of predicate short-circuiting.
Following on from my discussion on Mapping, Filtering and Reducing in PHP, over the past couple of months I have been using a little trick I would like to discuss.
Although a map-filter combination can be achieved in a single reduce, reading the PHP documentation I found out that array_filter supplied without a predicate function will remove all false values from the collection.
This means that you can simply map over a collection and return false if the desired predicate does not match - leaving the filter to do the clean-up.