I was setting up a postgres server and I got the message “psql fatal role ‘user’ does not exist”. Found a solution over here, basically:
CREATE USER jj5 SUPERUSER; CREATE DATABASE dbname WITH OWNER jj5;
I was setting up a postgres server and I got the message “psql fatal role ‘user’ does not exist”. Found a solution over here, basically:
CREATE USER jj5 SUPERUSER; CREATE DATABASE dbname WITH OWNER jj5;
Everything you ever wanted to know about sorting arrays in PHP.
The problem is that is_callable and function_exists check a string to see if it’s a function. But I wanted to check to see if it was an anonymous function and not a string. Turns out you can do this by checking for an instance of Closure:
if ( $fn instanceof Closure ) { $fn( ... ); }
Just read the Design by Contract article on Wikipedia… a good read!
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..?)
I was reminded today of the Ackermann function which is famous in computer science.
Today I added the Robots <META> tag with noindex, nofollow to my HTML error documents.
Today I learned about headers_list and http_response_code… yay! :)
Today I installed the Open in Browser Firefox extension which lets me open files in Firefox rather than having to download them… handy!