Brightness and Darkness

I’m trying to get my head around the electronics I have been building recently. I have put together a web page which I can use to compare the implementations of the brightness and darkness detectors from the Maxitronix 20in1 projects I have built lately: Brightness and Darkness.

To use mysqli or PDO?

I’m trying to make my mind up about whether I should be using mysqli or PDO for a project I’m just starting and I’ve found a few relevant articles:

And based on all of that I think I’ve decided to use PDO.

Don’t use memcmp to compare structs or classes

Structs and classes can be laid out with padding between the data members for alignment purposes, and this padding doesn’t get initialised unless you specifically zero it out yourself. So if you’re using memcmp and comparing memory at pointers to structs you might have a problem if you’re expecting structs with equal data members to always be equal.