Archive for July, 2008

Countable

Today I will look at the Countable interface, it has a single function that needs to be implemented: count(), by implementing this you can ensure that there is a count() function ready to use on any given class that implements it. The Countable interface is used in other places in the SPL as well: the ArrayIterator and ArrayObject classes implements this interface ( and SqliteResult if present )
Read more »

php testfest

Well, the testfest 2008 is wrapping up and a lot of the tests are now a part of the php distribution. php.no had a session where Hannes Magnusson introduced us to writing tests. I focused on some SPL areas that didn’t have coverage, and I got myself a elephant! ( check out the flickr group if you are unfamiliar with it)

The testfest is a great introduction to the internals of php and will teach you a lot when it comes to the behavior of the functionality you touch on, so next year: meet up at your local testfest and participate in getting the code coverage for php even higher ( or just digg into writing tests now! ).

Beitostøylen

Well, back from vacation out west at my parents house and a week at beitostølen. The first week was kinda bad with rain and really bad weather, but the final week I spent with some friends in a cabin doing some walking in the mountain area of Jotunheimen. Since I recently got a new Canon 450D and took a lot of pictures I’m posting some here.
Read more »

SplObjectStorage

In this post I will look at SplObjectStorage: a container that allows to store objects uniquly without the need to compare them one by one.
Read more »

Hammer throwing

Congratulations to Trude and Marte from my track & field team ( gfil ) with silver and bronze in todays national championship in women’s hammer throwing competition!
Ok: why this interest in hammer throwing? Some people might not know, but I have a history that might have eluded some: I’ve been throwing hammer since I was 15 years old, I have one gold medal in the Norwegian championship for boys 16yo and actually was on the under 23 national team on one competition!

This week was actually sort of a “comeback” when it comes to hammer throwing for me: I had a session on tuesday night then went to a competition in Hyen on wednesday afternoon! Of course: I threw 45.5 meters on tuesday and only just over 43 on wednesday, but I was so sore after the tuesday night session that I was not able to throw any further ( note to self: don’t do that again… ). If my hand behaves ( I’ve had RSI for a long time that have prevented me from throwing ) I will try to get to the national championship next year, shouldn’t be too hard.

This leads to another question: am I the only programmer that also enjoys a good hammer throwing competition? Let me know!

Firebug workgroup

Firebug is a tool I’m using on a daily basis, and the workgroup is now being built up. I was reading a post on ajaxian.com that John Resig will now spend 50% of his time on Firebug: Starting this week about half of my time at Mozilla is going to be spent driving the direction of the brand-new Mozilla Firebug team, he is also joined by Rob Campbell. With this team in place I think we will see a good improvement on Firebug and maybe even more extensions appearing in the near future.

Design Patterns

As a programmer you will after a time start to recognize certain patterns, or things you have been doing in the past repeating itself over and over. You are not the first: a design pattern is a general reusable solution to a commonly occurring problem and will help you when it comes to solving your day-to-day programming.
Read more »

SplSubject

The SplObserver class, together with SplSubject, provides a interface for implementing the Observer pattern.
To quote wikipedia: The essence of this pattern is that one or more objects (called observers or listeners) are registered (or register themselves) to observe an event which may be raised by the observed object (the subject). (The object which may raise an event generally maintains a collection of the observers.)
Read more »

SplFileObject

PHP5.1 introduced a new file object, the SplFileObject, an object that can be used with any streams and implements RecursiveIterator & SeekableIterator for easy access to the stream iteself.

The documentation at php.net has the full API for the class, but to see how it behaves we will look at how this class can help us out with our day to day code.
Read more »

welcome!

Welcome to eide.org!

I finally have updated the site with a new design and have started to update it with content, I will also, from now, blog here, and not on phpvolcano.com where I previously have kept a record of some sort. I will port some of the old stuff from phpvolcano.com and I will now keep a up-to-date blog here.

I have previously kept a wiki at wiki.cc, but will try to keep a list of those articles here instead ( too much spam and not enough time to manage a wiki ). So: I hope you will follow some of the articles I will write/port from the wiki here in the near future.