Edd Mann Developer

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.

Validating 32-bit Integers using PHP

Last week I was required to validate that a supplied integer would fit correctly into a 32-bit address space. The available size of an integer within PHP is platform dependent, and could either be 32 or 64 bits based on the architecture you are using. This function had to cater for these differences and as such I decided to explore a couple of different options for producing this validation.

Operations on a Deck of Cards in PostgreSQL

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.