Best of 2008

Tags:

Since the year is about to end, I think now is a good time to highlight some best things of 2008

Reusable “generic” actions in Zend Framework

Tags:

Sometimes you will need nearly the same functionality in many actions. This can lead to unnecessary code duplication if you aren’t careful, and there’s been a couple of occasions on #zftalk, where people have been asking for a good practice to avoid this. There are several ways to deal with this, such as moving the code into a separate function, …

Happy holidays

Tags:

Merry christmas to everyone, or if you don’t do xmas, happy <insert your holiday’s name here>! Also, here’s a small challenge for you: draw santa in mspaint (or something else) – but do it with your eyes closed!

What will you do during the holidays?

Tags:

I’ve been asked this a couple of times.. What will I be doing during xmas? Since the people asking that aren’t exactly computer people, the usual non-nerdy answer I give out is that I’ll probably take it easy and relax – you know, the usual stuff. But since this is the internet, and this is a programming blog… I’ll be …

JavaScript margin/block commenting system

Tags:

On Djangobook, they used to have this interesting commenting mechanism on their book’s pages: Each paragraph in the book could have comments, by use of a JavaScript commenting system which would display the amount of comments on each paragraph when you hovered over them with the mouse. You could also click on the little bubble which displayed the count, and …

The problems faced by a common model interface in frameworks

Tags:

You sometimes see people asking why the Zend Framework (or some others) don’t provide a library for the Model part in MVC. While ZF provides data access classes in the form of Zend_Db and related components, it doesn’t provide any concrete examples of how you would implement a model class. This often confuses especially beginners. Providing a common base model, …

Packageizer is fixed

Tags:

The packageizer had some problems determining the dependencies for the newly added Zend Framework 1.7 packages, but the problem is now fixed. The packageizer source-code has also been updated with the patch.

Scraping HTML with Python

Tags:

Have you ever had to write a script that scrapes data from an HTML page? Was the page horribly bad HTML too? If so, you probably know how annoying and time consuming it can be to write a script that reliably fetches data from such a mess. I was recently asked to write a script that scrapes an ASP.NET page …

Thoughts on unit testing and application design

Tags:

Here are some thoughts and observations regarding application design and unit testing in the quiz-project I recently wrote about. When I was writing the Amazing Programming Language Guessing Script, I didn’t first write any unit tests. Partially because I just wanted to test something quickly, partially because I didn’t think there was any point in doing it. When I later …

Programming language guessing game

Tags:

Some of you asked me about the “quiz” thing that showed up in one of the screenshots in my NetBeans review… Well, here it is: During that weekend when I was trying out NetBeans, I wrote a small Zend Framework + Doctrine application which attempts to guess a programming language the user is thinking of, based on a set of …