Edd Mann Developer

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.

Understanding De Morgan's Laws to simplify propositions

Yesterday I watched a conference talk about Formal Logic and De Morgan’s laws were discussed. Wikipedia does a very good job of explaining the laws in-depth, but essentially they are transformation rules that allow you to simplify certain propositions. Whilst programming, predicate logic of this form appears very frequently, and it is very useful to know how you can rewrite a predicate to better describe its intent.