It has arrived, the official Google Chrome Beta for Mac is here. I’ve been regularly compiling the Chromium project for Mac for a while now and it soon replaced Safari as my default browser. I can honestly recommend it to anyone. Lightning fast with beautiful Webkit font rendering; give it a try, you won’t be disappointed!
Just to let everyone know: I just released my first public Wordpress plugin into the wild. Hope it comes in handy to someone.
It’s been very quiet on this blog recently, I’ve been swamped with work the last couple of months and have unfortunately found very little spare time to do anything aside from working. The only real bright spot was attending ZendCon in San Jose last week which I enjoyed a lot. I hadn’t been to California in like 16 or 17 years so it was great finally returning after such a long time. I plan putting some of the things I learnt into action in a new project which officially kicked off today (one that I’m very excited about due to the high amount of traffic the site generates which will mean some new challenges in terms of scaling the application..).
Anyways, I’m also planning a relaunch of the site sometime this year so that it better fits the needs of a programmer’s blog (more room for code!) and of course start posting some more soon. I should find time to properly take care of the blog again in late november december.
As outlined in the Zend Framework Documentation it’s possible to speed things up a little by removing (almost) all require_once calls from the Framework and relying solely on the autoloading mechanism. I haven’t benchmarked this and I’m fairly certain that it’s a case of micro-optimization but I thought I’d give it a try anyway. The snipped posted there has some minor problems on OS X however. For one the -wholename parameter for find isn’t implemented (can be replaced with -path) and although sed does work, you need to use gsed if you want to pass the arguments as described in the documentation. So here’s the OS X version of the snippet:
find . -name '*.php' -not -path '*/Loader/Autoloader.php' \ -not -path '*/Application.php' -print0 | \ xargs -0 gsed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'
Bruno Kammerl jumps. Whether it’s fake or not, it’s absolutely hilarious. Via Hi-ReS!
This is interesting, Google ist putting together a site about best practices on how to speed up websites. I’ve long been a fan of Yslow and using Steve Souders’ 14 rules for faster-loading websites so this is will be a very welcome addition. Evangelize, spread the message to your colleagues at work. From my experience there’s still a lot to be done!
Really interesting article about encryption by Matasano Chargen, well worth a read.
After upgrading to Zend Framework 1.8 earlier this week we’ve had a few more minor glitches that have surfaced since. The one which took me some time to figure out was 'Zend_Form_Element_Exception' with message 'No file decorator found... unable to render file element' To ease the generation of forms and get them all to look the same we use a class named Form_Static_Render that the Zend_Form gets pushed into and which takes care of styling, decorators, preview pages and display of form errors. It’s quite a clever little thing. To achieve the proper styling our extension to Zend_Form calls
$element->clearDecorators();
and then either adds the default ViewHelper or whatever gets passed to the method and that was the root of the problem. When clearing the decorators, Zend_Form_Element_File now explicitly requires you to add the File Decorator again before rendering. After discovering that, it turned out being a quick fix…
It’s been a while since my last post but I’ve been very busy the last couple of weeks. That’s what also kept me from updating to Zend Framework 1.8 (or 1.8.1 by now already) in our production environment. It has been very smooth so far, the only change that required some work was the deprecation of the old
Zend_Loader::registerAutoload( '...' );
However, upgrading everything to the new Zend_Loader_Autoloader_Interface actually worked quite a lot easier than expected:
class Webwerk_Autoloader implements Zend_Loader_Autoloader_Interface { /** * Autoloader */ public function autoload ( $class ) { // Custom autoloading of different classes // Each one has a return value // Fallback try { Zend_Loader::loadClass( $class ); return $class; } catch ( Exception $e ) { return false; // Nothing there } } }
And in the bootstrapper we have:
$autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader( true ); $autoloader->pushAutoloader( new Webwerk_Autoloader( ) );
So the only change was making Webwerk_Autoloader match the Zend_Loader_Autoloader_Interface as well as changing the bootstrap to use the default autoloader as fallback and registering the custom autoloader.
Wow, this is really cool. Ryan Campbell of Particle Tree just put up a post about a tool they developed and now released called PQP to help with profiling PHP code. We developed and use something similar on top of Zend Framework (just not as cool looking) and ours doesn’t come with the memory logging and timing features that PQP provides. Definitely going to give this a try and spruce up the own tool..
True to the Pragmatic Programmer manifest “Invest Regularly in Your Knowledge Portfolio” I’ve recently been reading up on Python again. I’ve made several attempts but due to time constraints never managed to make anything of the knowledge.
I quite enjoy the Python syntax and some of the string manipulation functions are super awesome compared to what PHP has to offer. I had a look at the different web frameworks available, Pylons was the one that appealed to me the most and having spent some time with it today I must say that it doesn’t disappoint. They also have a very cool ebook available called The Pylons Book. I’ll keep you posted on how the adventure continues.
Last week saw the quiet relaunch of webwerk.de. I’ve been working on that for the last couple of months now, happy to finally see it go live.
The Zend Framework 1.8 Preview Release is now available for testing! This latest release includes a new CLI for creating your initial project structure, adding resources to your project so no more rails envy:
$ zf create project theNewProject
This will create the initial project layout with directories, controllers and all. Brilliant.
The new Zend_Application has been added to handle the task of bootstrapping your application and other cool stuff, one of the most important features is the new way that modules are treated in Zend_Application which should help keep your application DRYer than ever.

Since Matthew Weier O’Phinney can explain this a lot better than I ever could, I’ll simply refer you to his excellent post about Zend_Form decorators, well worth a read.

ZOMG, I can only reinforce Peter Kirn’s thoughts over at Create Digital Music about the OP-1, this has to be one of the hottest looking pieces of music gear ever. Head over to Teenage Engineering to witness the awesomness first hand.

.. the open source way. I’m always amazed by the search results that come up for some additional functionality you need for Flash. Today I was trying to find a good way to convert a swf file to an flv (btw. Adobe, you’d think that something as simple as this should be possible out of the box, right?). What you end up with are some dodgy looking sites with ugly Windows-only software that always seems to cost either $49.99 or $99.99. Whatev’s I thought, there must be a better way. This is the story of how Python saved the day.
It’s been quite a while since the last release, today 006 has finally been released. The major changes include the addition of the Poco library, an event system and Glut abstraction and it can even run on the iPhone now. Yay! I’m really excited about this release and can’t wait to get my hands dirty.

Periodic tables seem to be all the rage these last couple of weeks but I actually quite enjoyed this one over at flickr.
Time for another little code hint. I really like the Zend-Framework and we’ve been using it very successfully on quite a large project for the last couple of months now. We’ve extended the basis quite a bit with plenty of wrappers to fit our client’s needs and the way the framework is put together all of this works very elegantly.
One of the shortcomings I find is the way layouts are handled. From my experience, Zend_Layout is one of the hardest parts to grasp for beginners anyway, the lack of a bulit in support for modules makes it even harder. Controller-Plugins to the rescue!

Sweet.. Google launched Chrome Experiments to coincide with the latest release of their Chrome Browser to show off some cool JavaScript effects. All the experiments warn you but they run fine in Safari as well. I have the feeling that apart from video, the Flash era is coming to a close.. of course there’s always stuff like Hobnox’ Audiotool but that caters for such a small niche and I honestly believe that in a couple of years time, JS will be able to do the same stuff.

Oh and erikbelowsealevel.com has been putting out some very solid work as well.

We Are DAG reminds me that I need to do less client work and start working on those visuals again.. damn.

Lovely work by Dutch design firm mainstudio.
After relaunching Nickel yesterday I today had a look at the site on the iPhone. I hadn’t bothered before because YAGNI. Unfortunately the iPhone doesn’t display any scrollbars for DIVs that have an overflow set (incidentally it won’t show any on iframes either). Lucky for us that we’re trying to get people to use their keyboards to navigate the projects anyway using the excellent jQuery scrollTo plugin. I added the scrolling functionality to the keyboard icons on the page and it all works nicely on the iPhone now as well.
We just relaunched our company website Nickel.
Jeff Atwood makes a very good point about validating your markup and if it really matters or not. One small addendum I have to make: I think validation can be useful when you try and rid your page of browser quirks. If your markup is valid and the page still misbehaves in, say Internet Explorer, you’ll know where to workaround which can often turn out to be a time saver in the long run.
Boy, I just learnt this the hard way (and after god knows how many years of developing in Flash..). Be careful when naming your TextField instances when placing them on the timeline. I called mine “name” since that’s what it is. First I only got a warning (which I dutifully ignored):
Error: Error #2078: The name property of a Timeline-placed object cannot be modified.
at flash.display::DisplayObject/set name()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
I could access this object on code fine, do everything with it but any other object placed on the timeline “after” this one simply returned a null pointer. What a nice way to spend a late afternoon.
Great little essay by Paul Graham about what it takes getting your startup off the ground.
I’ve recently made the switch to using jQuery after having been an ardent supporter of Prototype for the last couple of years. So what has brought on the change then? The usual argument for jQuery is it’s exceptional DOM traversal and I have already found that you really can write less code to get the same results as with Prototype (although Prototype has made quite a few advancements in the area with the 1.6 release) but I think it wins hands down when it comes to external libraries. Correct me if I’m wrong, but up to this day I haven’t found a good resource for classes built with prototype and even finding the basics like calenders etc. is a royal pain in the arse.
So, over the next couple of weeks I shall be porting the thousands of lines of Prototype code to jQuery and hopefully end up with a leaner code base that I can split up into smaller, reusable components.