Oh well, I spent the last evening moving my blog from Serendipity (s9y) over to WordPress. The reason for this is that after Christer and I talked a bit, we discovered that something wasn’t working as it should with the trackbacks and pingbacks. As every good programmer does, I headed into the source instead of reading anything sensible about the subject, and well.. I wasn’t really impressed. As s9y is still catering to those who need PHP4 support, the code was a mess of functions here and functions there and no real separation, including Global variables and other messy things. WordPress isn’t much better in the “silly amount of functions” area, but I’ll leave that for the next blogpost or two about WordPress issues that’s getting on my nerves.
Anyways, after seeing their XML-RPC implementation .. which was a couple of large preg_match statements trying to look for the XML-RPC request, I called it a day and decided this wasn’t fixable to bring it up to my need. I’d very much like to patch it up and submit my own XML-RPC server for them to use, but it’s based on PHP5 and the reflection API, so no go there. All that frustration ended in installing wordpress yet again, so here we are, after spending the night of getting everything up to speed and looking like it was again. I’ll create a post later for those who want to take the same route, and I’ll include the RewriteRules to make all your old links still work in WordPress.
Travelhacker has an ingenious list with 77 alternative things to do with that old iPod you’ve just been ignoring for a while. If you’ve ever wondered how to convert your iPod into a sex toy, create an iPod Taser (iTaser?) or create your own iPod based pirate radio station, this guide is for you.
Marco has a neat list up with five different features about PHP5 which people are still not quite catching on to , and I agree with every single item that made it to the list. I’ve been using SimpleXML myself, and except for a few cryptic issues regarding namespaces and iterators (SimpleXML does quite a bit of magic..) it’s a breeze to work with. For simple .. XML .. parsing, it’s ingenious.
Mikko is quite active with the development of the Imagick-extension in PHP, possibly the best thing to hit PHP since it’s birth over ten years ago. There’s nothing like the Imagick-extension to make you realize how much you’ve been missing from the GD extension (kindly reworded for Pierre) :-) Anyways: Mikko has a new post up about how to use an image as a fill pattern in Imagick under PHP . Well worth a read!
You should also check out all the other interesting Imagick related posts Mikko has made.
I’m not sure how much sugar Christer got into his system today, but he’s been completely on fire with his blog posts. This one shows how to write a custom Zend_Form_Decorator_Label , which he wrote after someone asked a question about how to do something in particular on the Zend MVC mail list. That guy is amazing.
XRPC_Server is a simple as possible XML-RPC server component I wrote for a project a year or two ago, and is a good alternative if you want to try to stay away from large frameworks or complex components. The component is license under the MIT License, so you’re pretty much free to do whatever you want with it. All patches are welcome! The server requires PHP5 and reflection enabled.
Usage is as simple as requiring the php-file into your "gateway" page (the URL you’ll be calling from your XML-RPC clients), and then creating the server object with the functions you want to expose as the argument to the constructor:
$server = new XRPC_Server(array(
'multiply' => 'test_xmlrpc_multiply',
'dateTest' => 'test_xmlrpc_date_test',
'assoc' => 'test_xmlrpc_assoc',
'array' => 'test_xmlrpc_array',
A simple file illustrating the usage is also included, XRPC_Server_Test.php.
You can see the source code of the server at XRPC_Server.phps .
The class can be downloaded from this site: XRPC_Server.tar.bz2
A simple question popped up on IRC today: How to get Firefox to show the source of a webpage given by the URL instead of having to show the page and then selecting "View source". The solution is to use the view-source:-qualifier: view-source:http://en.wikipedia.org/wiki/ to see the HTML source for Wikipedia’s front page. The solution was presented over at Stuart Langridge’s blog where he also presents a simple bookmarklet for swapping source view on and off in the current window.
Christer has obviously been having a good day today too, as he’s actually made yet ANOTHER blog post about something related to Zend Framework: Using Objects with Zend_View’s PartialLoop Helper. This time he’s examining why some methods suddenly has disappeared in his PartialLoop. I’m a bit surprised his father hasn’t helped him with his view scripts, tho. It’s probably just something he’s saying to don’t appear too incompetent.
«Estimate» stumbled across this awesome page with different string metric algorithms earlier today. Here you’ll find descriptions and implementations of Hamming distance, Levenshtein distance, Needleman-Wunch distance, Smith-Waterman distance and dozens other. Invaluable if you’re ever going to need to compare strings against each other and need some way to measure their similiarity.