Just read the Design by Contract article on Wikipedia… a good read!
Monthly Archives: May 2014
MySQL INET_ATON and INET_NTOA
You can convert an IP address to an int, and vice versa, with these two MySQL functions. Of course I learned about this after I’d already implemented IP address support using BINARY(4) and my own parser/formatter… now that I have my own implementation I can’t bring myself to let it go, and I worry about support for signed/unsigned 32-bit ints (perhaps my concerns are unfounded..?)
Ackermann function
I was reminded today of the Ackermann function which is famous in computer science.
Robots HTML META tags
Today I added the Robots <META> tag with noindex, nofollow to my HTML error documents.
PHP HTTP response data
Today I learned about headers_list and http_response_code… yay! :)
Firefox: Open in Browser
Today I installed the Open in Browser Firefox extension which lets me open files in Firefox rather than having to download them… handy!
PHP fflush
spl_object_hash
Learned about spl_object_hash via Stack Overflow. Provides a unique object id in PHP.
PHP Traits and Grafts
Reading about traits and grafts in PHP: Request for Comments: Horizontal Reuse for PHP, PHP Traits, Using Traits in PHP 5.4 and PHP Traits: Good or Bad?. They mentioned the Diamond Problem.
I learned some new syntax too! E.g.:
return $_instance ?: $_instance = new $class;
The ternary operator as a ‘binary’ operator! Cool! See here for details: Since PHP 5.3, it is possible to leave out the middle part of the ternary operator.
Observe, and act with clarity
The trance mix I’m listening to at the moment is repeating: “Observe, and act with clarity.” — Great lyrics! The track is reported as “Dimension 5 – Radio Mix” on the goapsy channel on di.fm.