Edd Mann Developer

AVL Trees in Clojure

An AVL tree is a self-balancing binary search tree, where-by the height of a node’s children differ by at most one. In the event that this property is violated a re-balancing process takes place.

Anagram Solver in Clojure

This past week discussion around solving anagrams was brought up - I thought it would be interesting to devise a couple of methods for computational achieving such a task. Providing an anagram string and a dictionary file, I wished to be returned all possible matching words from the dictionary.

Maybe in JavaScript

Recently I have been delving into the concepts of Functors and Monads. There are many good resources available online that will do a far better job of explaining these concepts than me, however, I do wish to document an example Maybe type I have implemented in JavaScript. Again, there are many good external resources which highlight the characteristics and power of using such a type, so I will direct your attention to those if you wish to learn more.

An 'array_column' re-indexing trick in PHP

The array_column function has been a welcome addition to the PHP language, allowing us to remove the need for common-place array_map invocations that just pluck specific values from arrays. However, I just found out that you can provide a third argument that allows you to define what the returning arrays keys will be. This combined with null for the value argument allows you to easily re-index an array based on a key value whilst maintaining the original arrays values and ordering.

Generating Podcast Stats in PHP

In the 100th episode of Three Devs and a Maybe I decided to generate some stats relating to the previous 99 episodes and formed a small quiz out of these findings. All information relating to each podcast is stored in separate Markdown files within YAML front-matter, which makes it easy to pull out and process. I thought it would be interesting to go over the code I used to achieve this.