Traffic this morning..

On my way to work this morning I managed to avoid most of the heavy traffic but eventually I got caught as I approached Victoria Cross. I usually come off College Rd on to Orchard Rd and then down to Victoria Cross. Unfortunately traffic is usually heavy at the junction of Orchard Rd and Victoria Cross. Today was no exception. As I waited at the junction, looking left and right I noticed a Flo Gas truck down the road with a large space in front of it and thought, “hmm, maybe if he goes forward I can get in behind him..”, but no, he wasn’t moving because a container truck on the inside lane was too large to overtake safely.

I continued to look left and right when suddenly out of the corner of my eye as I turned right I spotted a car plough straight into the Flo Gas truck! I can still see the back of the car raise itself up off the ground, see flying specks of paint and plastic, and hear the sound of the car crumpling under the impact.

Shocked, I watched for a few seconds before remembering my camera, grabbed it out of it’s bag and turned it on to find a full memory card, a quick change of the memory card later and I snapped a few photos of this unfortunate accident. Nobody was hurt, both drivers got out of their cars and a Garda was on the scene within moments.

The golden benefits of C'ing your PHP

John did more work on his PHP extensions. I find research into performance tuning and benchmarking fascinating. By using the C version of one of his PHP functions John gained a 75% increase in speed! Excellent!
John, can you try both PHP code and C code with PHP Accelerator or some other opcode caching tool? I guess the accelerator won’t affect performance of the C extension, but it may work well on your PHP loops. (but I doubt anywhere near the 75% you experienced with C!)

Rev Jim on b2/Smarty

Someone noticed our work here! Thank you Rev. Jim for the review!
Right now the code is ugly, I simply strapped Smarty on top of b2 in about a week of coding. My initial intention was to make my changes as non-intrusive as possible but that’s not really possible. Michel made a really good job of seperating a large portion of the PHP code from the templates and that made my job so much easier.
I hadn’t thought of the ugly url issue much, but that can be solved reasonably easily through mod_rewrite and/or php.
Making the templates more flexible should be easy too. I was originally going to do so, but I’m wary creating new files on the server so I just listed the ones that could be edited instead. Another requested feature was to go back to the default template, or maybe even offer multiple templates! A version-controlled templating system appeals to the developer in me too!
There’s a few major things to do:

  1. Make URLs nicer.
  2. Reintroduce “Team” logins again, and make it a configurable option in the options web page. I need to document the difference between Team logins and creating a new blog. That will confuse people.
  3. More flexible template system.
  4. Work out how to handle image uploads nicely. That’ll probably come through using a username/images/ folder or something.
  5. Finish integrating Smarty into b2.

perfection leads to mediocrity

A Long ago I stopped trying to make everything perfect. I think it happened when I realised that “good enough” really was good enough! Occasionally I will spend an extra ordinary amount of time trying to get some small facet of a program working just perfectly, but that’s common in every endevour. It’s so true that 20% of the work takes 80% of the time..

What am I reading?

I just finished Linus Torvald’s biography, “Just for fun” which was an enjoyable read and I saw a few parallels between his life and mine. He spent a summer in the early nineties coding and didn’t realise what the weather was like. I did the same coding a demo on the C64. At the end of the summer a shop assistant remarked that it had been a terrible summer. I still remember being dumb-founded when I realised I didn’t know. I mumbled an acknowledgement that, “yes, the weather’s been terrible” but I walked out of there in a slight daze. I’m a lot more aware of the weather now that I’m taking photographs, so at least that gets me out of the house!
Next in line in dead-tree format is “Mr. Nice” by Howard Marks. Good read, but I’m only 30 pages or so into it. He was an international drug smuggler and he’s led an interesting life!
Whenever I see “books on CD” going cheap I snap them up if I recognise the author or story. I picked up Roddy Doyle’s, “A Star Called Henry” for about 5 Euro a couple of weeks ago and I play it in the car in the evenings. It’s the story of Henry, a boy born into the squalor of Dublin tenements at the start of the 20th Century. His description of The Easter Rising in 1916 is brilliant and told well. I’m amazed at what the main character, Henry, got up to before his 15th birthday!
Finally, after downloading readM, the ebook reader for the Nokia 7650, I’m reading “In The Beginning was the Command Line” by Neal Stephenson on my phone. I have to admit I’m getting bored of it now because he’s preaching about the Apple Mac but I’ll stick with it. I particularly liked the description of the car dealers!

What We Lose When War Is Waged

What do we lose? Ancient history, ancient batteries that if they had been developed, “we’d be flying to the nearest stars by now” (read or heard that somewhere a few years ago).
I read a dog-eared copy of Eric Von Daniken’s “Chariots of the Gods” ages ago and enjoyed it but I knew of the controversy surrounding the book from reading another book.