Archive

Archive for May, 2009

Small update on NMT-Shoutcast

May 9th, 2009

I’ve updated NMT-Shoutcast to use cookies instead of sessions. I got some emails from people having problems with their favorites after listening to a station for a while, and I noticed a lot of favorites without userID in the database. This had to be something with a timeout on sessions (which would be 20 minutes by default) so I changed the sessions into cookies (which will expire somewhere in 2030) and all should be dandy right now.
If you still have any problems, please leave a message in the reactions-section (and pls mention what kind of NMT you’re using).

buTTon NMT ,

Coding-humour: the best comments in source code

May 3rd, 2009

If you’re a programmer and have any sense of humour, you really need to read this

My personal favorites:

//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 16
//
//When I wrote this, only God and I understood what I was doing
//Now, God only knows
# To understand recursion, see the bottom of this file
At the bottom of the file:
# To understand recursion, see the top of this file

buTTon Personal

Putting the Singleton-pattern to good use

May 3rd, 2009

I like the Singleton-pattern, it saves a lot of trouble on creating objects that you need throughout your code and need to keep their state. Though it’s very tempting, do not use the singleton too much; see here why.

There are some pretty good uses for a Singleton though; a registry and the database-connection;

Read more…

buTTon OOP, PHP , , , ,


Onze tip:SCDB.info – de meest actuele flitspalen in Europa voor uw GPS!