Blog

A PHP Developer’s thoughts and feelings

CamelCase, Hyphens - Under_scores

February 22nd, 2010

It’s a question many people ask. It’s a question many people want an answer to. But if you try to find an answer to the question “What should I use in my programming?” then you’re bound to find conflicting answers from various corners of the software sphere.

It turns out, that there isn’t any one right answer. Usually, you should do what works for you. More often than not, when you join an agency, you’ll be asked to conform to the current pattern set by the existing team, which itself will likely have been introduced by the first developer in a much younger agency many moons ago.

So, I can’t tell you what to do. But I can tell you what I do and why, and maybe it’ll help you? Who knows. So, here goes…

PHP

You name it, I’ve seen it. People use everything in PHP. Underscores, camel-case, underscores, uppercase, hy… no. Not hyphens. I’ve never seen hyphens.

Why?

Because - Hyphens aren’t allowed in variable names. And, assuming you’re a php developer you should know why. $variable-name is interpreted by PHP as $variable minus name. And what’s in a name? Well, without a $, PHP will assume it’s a pre-defined constant. So, first off, don’t use hyphens.

So, what do I use? I used camelCase. For everything. When it comes to high-level languages, most people use camel-case or underscores. I don’t think there’s anything wrong with underscores - I just happen to find it faster to hold shift and press a key, rather than hold shift to make an underscore, then type the next letter. So my variables look $likeThis. Constants though, should always be capitalised - this is actually pretty standard across most industries. That’s because, in languages that don’t use prefixes, it makes it much clearer. $variable and CONSTANT. Easy to see isn’t it?

Training languages, such as BASIC encourage you to capitalise keywords: INPUT, PRINT, DIM etc. But these days, we have colour-coded editors and it’s very standard to make everything lower-case except constants. Get it?

MySQL

Ah. Well, that’s just blown myself out of the water. When you type a MySQL statement, you DO type the keywords in capitals. That’s because it makes it VERY CLEAR to see which statements are DOOERS and which are ACTORS. SELECT name FROM users WHERE password = ‘hackme’.

By the way - never store plain text passwords. Ever. If you’re ever unlucky enough to be my subordinate and I catch you doing it I WILL FIRE YOU. Storing plain text passwords are bad for many, many reasons.

  1. People generally use one password for everything, regardless of how you educate them. If this password ever gets revealed to the world from your site, you’ve just screwed them over in multiple ways and they will sue you for every penny you, your family and your whole ancestry has ever earned.
  2. Regardless of how secure your website is, you can never be sure that your developers have remembered to secure every entry point. One hole, and a hacker can dump your whole database, and as bad as that is for your company, it’s worse for your customers. And then worse for you, when they all sue you.
  3. My website is safe, I’ve secured all the entry points. Or have I? What about the server itself? All the hundreds of processes and protocols it runs? Can I guarantee the work of the developers of all of those too? No. Never assume you’re safe for a second. Always keep your (to use a terrible cliché) ‘eye on the ball’.
  4. Ok, So I’m a GOD and everything is so secure I’ll never be hacked. But, it turns out, one of my employees is dodgy, and sold the unencrypted password database to someone for £1,000. They convinced them, it was just a list of passwords and emails for our site which is just a newsletter signup - what could they even do with that info? Easy money! Except they just successfully logged into a range of websites across 100,000 customers and ‘hacked’ several million pounds of wealth for themselves. Well done.

So remember: Watch your code, watch your servers, watch your employees. And if the site is hosted by another company - their employees might not be all on the level too. More security is better. The only difference you’ll have to make by keeping only encrypted passwords is to change your forgotten password system - send people a link with a unique hash ID to change their password, rather than re-sending them their password, which you can’t. Simple. But I digress…

JavaScript

Much like PHP, I like to use camelCase for JavaScript. Simple eh?

HTML and CSS

Oh, where to start. This is often the area I take most issue with other developers. As it turns out, a lot of HTML developers use hyphens in their class and id names. But I don’t - I use underscores.

Why?

Well, remember, hyphens aren’t valid variable names. And I like to pretend that classes and ids are variables. Especially when you have to manipulate these things with JavaScript - hyphens just seem to fail a little. I often relate using it to starting a class or id name with a number. I’ve seen it done by several people. What’s the harm in using or starting a class name with a number? It’s easy to use JavaScript to do cool things like that! Except - you just failed. Numbers aren’t valid variable names. var 6 = 9 just wouldn’t make sense to anyone. If I said to you: ‘6!’. Would you think: ‘He means 6′ or ‘He means the contents of 6, which is 9′? But ids and classes aren’t variables, so why can’t I use numbers at the beginning of them? Well, to me it seems obvious - the people who developed it wanted to be consistent. So, stay consistent. Don’t use numbers at the beginning. And, I can’t stop you using hyphens, but I’ll respect you more if you use underscores.

Oh, and regardless of what you use, I won’t respect you at all if your sites don’t validate. There’s no excuse AT ALL to produce a website which doesn’t validate. Who cares? you ask. I care. And you’ll care when you do something dodgy that messes up in the next version of IE and you have 100 clients within their guarantee demanding a free fix!

Oh, and don’t go around using camel-case in your ids and classes. Because I said so. Generally, you’ll find all good sources of web tutorials will tell you to use lower-case for everything. It’s not good to mix case in HTML / CSS, because of the way some browsers can treat things (and why cause more preventable problems for yourself than you have to?) I know a lot of ASP developers do it. But, just don’t. The web elite web community is quite anal, and they won’t like you for it. And will tell you how ASP is a derivative of Visual Basic which is a derivative of BASIC which is a BABY language. And, I’ll join them in mocking you.

I think that’s everything. Did I miss something? Did I annoy you? Leave a comment!

iPad

January 28th, 2010

Apple iPad In case you’ve been living in a box for the past few months, you may have noticed that Apple announced details of their newest creation yesterday; the iPad.

Now, if you know me, you’ll know I’m not an Apple fan-boy, that is, someone who will buy every Apple product regardless. So, what are my thoughts on it?

It looks like a giant iPhone at first glance, and at second glance you realise that’s exactly what it is. It has the same power button, the same volume keys, the same silence option, the same dock connector, the same operating system and the same apps. Albeit, the built in apps have been tweaked for a bigger display.

So what is it for? The iPad is designed to fill a gap in the market. PCs and Laptops are inherently designed for production. You use them to create things and do work. Netbooks are the same to a lesser extent, but in the end they’re just miniature laptops. The gap I speak of, is for the casual consumer. Someone who wants to browse the web like a book from their sofa, someone who wants to read books without being away from their email, someone who wants a massive electronic map (for some reason, this makes me squee). For this purpose, it’s ideal.

But it has failures. Such a device could be considered a pseudo laptop and as such people have certain demands. The iPad, like the iPhone, doesn’t support multi tasking. This means if I want to chat to someone, I have to stay on one app, locking me into a venture of doing nothing else. The same for music, video or any other app. You can only do one thing at a time. This is frustrating, especially as the task is just so easy to do on a normal laptop. Another position where I believe it falls short is connections. As someone who doesn’t have many Apple products, the ‘dock’ connector is somewhat useless. A form of locking people into a bespoke connector so you have to buy the Apple brand, more expensive devices to use it. The connector itself is vertical, which is great if you have it plugged in whilst browsing the web at your desk, but what if you were watching a video? There’s no dock connector on the horizontal, meaning any need of charging at the same time will leave a big obtrusive wire coming out of the side.
A common feature of netbooks is built-in SD card readers, but again, the iPad doesn’t have one making transfer of any kind of data as tricky as an iPhone. On an iPhone, this is somewhat understandable (it is just a phone after all) but on a device such as this, it’s almost unthinkable to leave such a thing out. Sure, you can get Apple’s SD reading extension to plug into the dock connector, but it’s an annoying bulky lump I don’t want resting in my groin whilst reading something from the card vertically.
I’m also somewhat bemused about the lack of USB connectors, another very common thing which would have been an excellent feature to have. If I wanted to print something from an iPad, the printer better have wireless, ethernet or bluetooth support!

Even with all these failings, it’s a beautiful piece of design, but you wouldn’t expect anything less from Apple. Once the iBook store and 3G tech has been sorted out for us non-Americans, the age of the tablet may finally take off.

iPhone 3GS

October 17th, 2009

A few weeks ago I realised that it was time to renew my mobile phone contract. I say I realised, because O2 didn’t bother to let me know my time was up. But why would they, they had a sweet deal. I give them money evey month and they give me very little in return. So, off to the online upgrade centre I went.

First of all, it was obvious that not only had O2 upgraded the upgrade site since I had last used it, but they had in my own opinion, made it functionally worse. No longer was it easy for me to see all the upgrade options, no. Now I was forced to look at available phones by manufacturer with no view all option. Still, the choice was obvious: Nokia. I’ve used Nokia’s since I first started using mobile phones back in 2000. With the exception of one year when I got a Samsung - that was a mistake. Imagine my surprise when looking on the available upgrade options that there were no Nokia phones better then the one I was already using, a phone I’d had for 18 months. To make matters worse, none of the phones appeared to be any better from any manufacturer from the phone I was already using, an N95 8GB. None that is, except for Apple.

Now, O2 currently has en exclusive deal with Apple meaning only O2 can sell iPhones in the UK, at least until November that is. My iPhone options were limited - the only model in stock was a White 32GB 3GS. To make things worse, the phone was expensive. I’ve never paid money for a phone before, instead allowing the contract to provide me with a free phone. Selecting the most expensive contract still did not make the iPhone free. I was stuck.

The next day I went on again, determined to get a new phone. After looking at my options again, I went for the iPhone. It cost me £274 to upgrade to it. Ouch. However, I take solace in the fact that I now have a cheaper contract (£30 a month instead of £35) and I should get £150 for the old N95 8GB meaning overall, after the 18 month contract the iPhone will actually have cost me £34. Which isn’t actually too bad. Now I know what you’re thinking - such a cheap contract can’t give me many free minutes or texts and you’d be right - it barely gives me anything at all aside from the convenience of not having to top up. What it does do however, is give me access to the internet and importantly my email where ever I am (as long as O2’s moderate network coverage covers me that is)! As a web developer, I find this an invaluable addition to my life.

So, several days later the iPhone arrives. The first thing you notice is the box. It’s small. Very small. Much smaller than any other mobile phone box I’ve seen in the past. But don’t be fooled by this size - the box is made to a ridiculously high quality. Opening the box reveals more exciting goodies - and a very well arranged content. From the top there’s the iPhone, then a little pinch pull which reveals the lower compartment and contains the quick start guide. The lower compartment contains an iPhone connector USB cable, USB socketed power plug (beautifully designed) and the less exciting iPod headphones. The box doesn’t contain a manual - just a quick start guide. Although, the phones use is almost self explanatory.

Turning on the phone reveals its high value. Beautiful design, magnificent finger response on the touch screen - it really is a marvel of human ingenuity and progress. The oleophobic coating of the 3GS is an interesting addition. It certainly makes removing finger prints quite easy and if you have dry enough skin like I do, you don’t actually leave any finger prints at all (this makes you less willing to let other people have a play, as they’ll more often than not return it covered in their finger grease). One thing I did notice is that this coating has not been applied to the main press button - which is a shame.

Changing the settings of the phone is quite simple - just press the settings option and everything you need is right in front of you. The default selection of installed software is more than you’ve ever had on a phone before - maps with GPS being my favourite. And of course safari - browsing the web with a real web browser finally! It’s quite hard to fault the phone at all; the user interface is inspired, it’s very fast - at least compared to my old phone, apps. Apps. The app store - who’d have thought how good it was! Remember all those years ago at the back of magazines there were adverts for mobile phone game downloads, wallpapers, ringtones etc? Well, I never bought any. Ever. One week with the appstore and I’d already spent £20 - and most of that on 59p and free apps. Genius.

There’s an app for everything. Really. Have a look at all the apps I have installed at the moment - yes, they’ve even managed to put SimCity on the thing. And not the original PC version, no. It’s pretty much the latest SimCity 4. Amazing stuff. Gowalla is another game, based on world locations. Simply visiting a spot and checking in. All powered through the Global Positioning System. It’s all quite exciting! We can’t forget Peggle of course, that fantastic flash based web game - converted for iPhone (as the iPhone can’t use flash).

So there we go. The iPhone is amazing. Get one if you haven’t already.

But, I can’t let it end there. No sir. When I walked into work with the thing, people were set a gasp. But why? There are plenty of people with iPhones. Of course, they all Mac lovers and fanboys. So what’s so special with me? Well, I don’t really get on with OSX - it’s not my cup of tea. I much prefer Windows. Which, apparently means I shouldn’t like the iPhone in some peoples eyes. But you can’t deny the sheer quality and usability of the iPhone - they’ve taken years upon years of Nokia development and somehow just made it even better. So I don’t have to like Macs - the phone doesn’t suffer from the things I don’t like on macs - small window buttons, menus all over the place and a dodgy ‘finder’.

Are there any problems with it? Well yes. The biggest one being the battery. Now, it’s a powerful phone. Very powerful. I have more stuff going on than I ever did on the Nokia, and in a cleaner, crisper, faster more powerful way. So it’s obvious the battery will drain faster isn’t it. Yes, of course, so why complain? Well because of the slight oversight of the battery. The battery in the iPhone is of the same capacity as my old N95 - a phone with half as much processing power, less memory and less reason to use it constantly. Two or three times the capacity would have been much better even if it did add an extra 1mm to the thickness of the phone.

The camera could be seen as a problem, being only 3 megapixels. But then, I have a real camera for that so for me it’s not an issue. iTunes, as functional as it is, is a butt ugly grey square on my otherwise shiny, glossy Windows 7 desktop. It would have been nice if the iTunes developers had used the actual operating system windowing elements rather than forcing them to all look so ugly. Shame on you. And 9 minutes for snooze with no way to alter it? Boo!

That’s pretty much my round up - you can see from the pictures I have partially solved the battery problem though. An additional slot on battery pack called the MiLi which increases the overall battery capacity to 300%.

The full image set I took for this article can be seen on flickr.

A Holiday in Scotland

October 16th, 2009

Last weekend, well Friday through Sunday, I went on an epic voyage with my good friend Ben Dodson. It’s my first real holiday in quite a while, as short as it may have been it was very much appreciated.

Our story begins in Derby train station at 6:40am, where we boarded the “West Highland Statesman” weekend excursion train. We were sitting in a very posh premier dining carriage, made by Pullman in the 1970’s and named Apollo. This train would be our home for the next 13 hours until our arrival in Fort William.

Settling into such a nice, comfortable train was a very easy thing to do and reminded me of being a child, when the seats were big enough to fit my legs properly.

After an hour or so we were greeted by one of the train stewards who asked if we wanted breakfast now, or later when more people had joined the train. I should mention at this point, that we were practically alone in the carriage with only one other couple behind us. We opted for breakfast now.

Some time afterwards, breakfast was delivered to our table with a glass of bucks fizz. Sausage, eggs, bacon, potato, mushroom etc, it all made for a very happy eating occasion. We were offered some toast later on too, but I think the fry-up was probably enough to start with!

With breakfast gone and the light beginning to appear I began to turn my camera towards the great outdoors and photograph the landscape, rather than food and Ben! Sometime later it was announced to us that one of the carriages had developed a severe wheel flat (a flat tyre if you wheel), and so we’d be travelling a little slower than we were scheduled for and would have to swap the affected carriage out. A flat wheel isn’t as odd as it may seem - one side of the metal wheel becomes worn to a point where it stops rolling properly, and either drags along the rail or makes a bit of a thumping noise.

In Manchester we were joined by Ben’s parents and a couple of his old teachers. It was 11am by this point, and we were glad we’d opted for breakfast just after 8am! Breakfast was eventually served to the newcomers, followed by the dumping of the Buttermere carriage at Carnforth. With the wheel flat out of our way, we were free to chug on to Scotland.

As civilisation disappeared out of the window, food entered our bellies via canapés, several courses of food and Petit Fours. Not to mention the wine and champagne!

Because of the wheel flat earlier in the day, our train was delayed several times successively for sprinter trains to pass as we’d missed our station slots and charter trains are considered a lower priority on the rail network, regardless of delays. At one point, we would only have caused a delay of a few minutes to one train but because of the current system we were delayed by over half an hour instead. Thanks network rail! An extended leg stretch in Rannoch because of the delays meant that we eventually got our coaches from Spean Bridge to the hotel, rather than from Fort William.

On arrival at our hotel, The Ballachulish, we went straight in for dinner and some sleep!

Early next morning we came for breakfast and then were straight back on the coaches, heading for Fort William station. This days epic voyage was from Fort William to Malliag with a steam powered train. Not quite as posh as the previous days, but a nice train none the less. The route between Fort William and Mallaig is filled with scenic views and mountains, and there’s barely a piece of civilisation in sight.

One of the highlights of this trip is Glenfinnan, where we made a stop. The station has a little museum and shop, and we were treated to some bagpipe music on the platform by one of the train’s stewards! Glenfinnan is also home to the Glenfinnan Viaduct, a massive stonework bridge spanning a wide valley. If you’ve ever seen a Harry Potter film you’ll have seen this viaduct - it’s the impressive one the Hogwart’s Express travels over. I didn’t manage to get any photos of it, but I did get an HD video whilst we were going slowly over it on our return.

Now, as it turns out, riding on a train is quite tiring and poor Ben kept falling asleep. Luckily, I was there to capture the moments with my trusty camera.

Arriving in Mallaig, we headed for a fish restaurant where I had some very tasty scampi (and everyone else had haddock)! The harbour town of Malliag seems to be a fairly small and quiet place, at least until a train load of people turned up! We pottered about for the hour or so we were there, looking in various gift shops and occasionally getting wet in the random showers. The town itself isn’t a great highlight of the trip, more a place where we stop for lunch and wait to go back - the views from the train are what the people wanted to see.

My purchases from Mallaig consisted of a fridge magnet and a furry haggis. Now, a haggis is just a type of food - not an animal, but earlier that morning Ben’s parents had told me a funny story about Ben! Needless to say, the furry haggis purchase was apt and amusing.

Returning to Fort William, we had a little wander up the high street. Fort William is like any small town high street, albeit slightly cleaner and nicer although Ben didn’t seem too impressed with the place. Back at the hotel, it was time for dinner, preceded by a ceremony for the haggis and followed by some bagpipes and jokes, and a game of chess between Ben and his old Music Teacher. Ben of course, lost for my amusement.

The next day was another early start, with breakfast, coach trip to Fort William and then catching our nice Pullman train home. It was a much better day on the way back, and parts that were dark on the way up were now clear, providing some spectacular views.

We made a stop for an hour at Spean Bridge, for a ‘leg stretch’ and to check out the “Highland Soap Company” which we’d all been semi brain washed into visiting by the train manager. I ended up leaving with £9.50 worth of hand made soap, Ben faired much worse. The amusing thing about the soap shop trip, is that someone pinched the liquid soap from the loo on the train probably because they thought the soap was too expensive in the shop!

Continuing our journey home, brought more food, wine and gluttony. Not to mention games. 70’s peg based mastermind and Othello come to mind. I’m quite good at Othello, having played Reversi (the American version) many a lunch time at school, on Windows 3.1 (It’s up in Nebraska!) Needless to say, I won the game against Ben’s music teacher although I did a sloppy job - leaving two of her pieces on the board!

Seeing an easy win, Ben decided to play Othello against his music teacher too, only to be followed once again by defeat. Bad luck old chap!

It should be noted, that throughout our whole trip Ben and I played the iPhone GPS game gowalla - which really tested out my MiLi (iPhone external battery thing).

After Manchester on the way home, we were pretty much alone again and witnessed what some of the catering staff do when they’re bored - amusing if a little out of place.

For more photos of my adventure to Scotland see the flickr photoset of the occasion.

Battery Acid

August 20th, 2009

Back in the day

As a child, a certain time of year would come and I’d get excited. This wasn’t Christmas or my Birthday, this was a visit to the dentist. The dentist you see, was an exciting place; massive futuristic chair, toys I didn’t have in the waiting room and a cupboard full of sweets and stickers for the good kids. I you see, was one of the good kids. Let the dentist poke around in my mouth a bit and then be rewarded with a sticker and a sweet. Fantastic!

Growing up

As you grow up, you’re given more advice on how to care for parts of your body: Don’t eat fatty foods, don’t have too many sweets or sugary drinks etc. This advice is largely ignored, because the best things in life aren’t necessarily the most tasty. As a child and even as an adult, I will regularly go through large amounts of sugar in my diet.

Fizzy Drinks

One of these things you’re supposed to stay away from, is fizzy drinks. From about the age of 7, I started to drink coke pretty regularly. Not always coke coke, but some random brand of it. Now, luckily I always followed the advice of dentists: Brush your teeth twice a day for a few minutes at a time, never brush straight after eating or drinking something with sugar (as it’s abrasive) and don’t eat or drink anything after brushing your teeth before bed. This excellent advice has resulted in my total filling count, at the age of 27, as 0.

Complacency

Growing up, you realise that a lot of things people tell you are actually wrong or misinformed, or you simply haven’t heard of something because nobody ever told you. And so, my tale is a sad one. After 15 years of drinking coke, I decided I was fat. As the average 2 litre bottle of coke contains 800 calories from sugar (1/3 the daily recommended intake for an average male), and as coke was my main source of liquid (as I like neither tea nor coffee, and water is a little bland) I switched to diet coke. Diet coke after 15 years of coke tastes foul for a good couple of weeks. But within the first two months I had already lost a stone, and the horrible stickyness you’re left with on your teeth from normal coke was gone. 4 years ago I went to the dentist. For the first time in 8 years. I was expecting something, but no - once again my teeth were perfect, the dentist didn’t even believe I hadn’t been for 8 years. All I required was a scale and polish, and that’s what you usually get anyway. I left happy.

Realisation

Some things in life are obvious. Some are so obvious, you don’t even realise it until somebody tells you. Now, coke / diet coke contain an ingredient known as Phospheric acid. This acid is in a low quantity, and gives coke a tangy taste and helps to preserve it on the shelf. What you may not know, is that this acid is also more corrosive than battery acid. This kind of acid is undoubtedly, bad for your teeth. But it wasn’t until I saw the dentist last week that they filled in all the gaps…

Result

I hadn’t had a filling in 27 years of life, 20 years of drinking 2 litres of coke a day. Why? Quite simply, this acid had been sterilising my teeth. That part makes coke sound like a miracle cure for tooth decay. But then comes the bad news: Imagine a stone left in an ocean for hundreds of years. It turns into a nice smooth pebble. This is what drinking such a large quantity of coke for so long has done to my teeth - the acid has washed them away and left them fairly blunt. The reason I had no fillings - there was nothing left to fill.

Conclusion

The advice the dentist gave me, was to stop drinking coke. Or anything with acid in full stop. No more fizzy drinks, no more fruit juice, just water. If I absolutely have to, use a straw to avoid getting acid on my teeth and rinse with water as soon as possible. If I continue to drink coke as my main source of liquid, within the next few years all of my teeth will require root canals or crowns. At the same time.

So here it is kids: Don’t drink battery acid. It’ll make your dentist very rich before you get to 30.

iPhone app Development Collaboration

June 30th, 2009

Last Saturday was an interesting day. Mid afternoon my good friend Ben Dodson came over. He wanted some help (or some basic prodding in the right direction) to help make an app for his new iPhone 3GS. The app he wanted to make? A metal detector of course!

One of the things the new iPhone 3GS has is an internal geographic compass. This is achieved with a device known as a magnetometer - something which can give you a 3-dimensional X, Y, Z co-ordinate to the magnetic north pole. The great (and sometimes frustrating thing) about these devices is, that they’re influenced by nearby metallic object, albeit, not by much. Still, this ‘negative’ effect is one we wanted to exploit, and turn into the first visual metal detector app for the new iPhone.

My ’study’ is actually the largest bedroom in my house, consisting of a high end, 3 monitored PC, a sofa in-front of this, surround sound and a projector, which can display a 4th, 100″ screen from my PC (which I use for TV and DVD’s) or my Wii. Ben sat on the sofa with his Macbook, poking around with the iPhone developer SDK whilst I sat at my desk, seeing what physics were involved in making the app work. After some quick testing we discovered that this would be a fairly easy thing to achieve.

During tests I noticed that metals which tend to be more influenced by magnets were also the items most easily detected - Iron was found easily, but Aluminium barely registered. One of the other things I discovered was the influence of magnets on the 3GS - the stronger the magnetic flux, the higher the influence on the 3D geometrics. After this discovery, and our current lack of icon for the project I had an epiphany and said “Flux. This thing measures Magnetic flux too. How about a flux capacitor?”. Anyone who loves Back to the Future will know what that is! This remains my most significant contribution to the project.

Ben began to code the scale and graphics, whilst I created a mask to produce the curved effect, and generated 20 distinct square wave sounds, one for every 5 points of difference in our calculation of metalness / flux. Soon after finishing this whilst Ben was still coding, I began to work on the website. Ben had an idea in his mind of what the site could look like, which I largely kept to. You have to love the little South Park style versions of us (can you tell who is who?) It was decided that, due to IE6’s lack of position:fixed we’d instead have a little conditional message for IE6 users, informing them of some better browser choices.

After we’d finished producing the app and start of the site, we went to record the video in my dining room, with my Panasonic Lumix (The resolution on that thing isn’t too bad for a video). The final cut of this video features me swearing (sorry about that) and the sound of the doorbell, as a nice man delivers our Indian curry. Mmm.

Dinner over, Ben cut and uploaded our video and submitted our app, whilst I polished off the website. We also discovered at this point that it was gone midnight and Ben had missed the last train (bless). I very generously let him stay in my spare room.

Morning came, some more tweaking, and a special twitter feed for our new collaborative code site and that’s that.

So, go now and witness the fruits of our labour, achieved in one Saturday evening: philandben.com

Drivers

May 31st, 2009

It’s been a lovely sunny weekend and I’ve done many things. Progressed a little on my Peltier electronics project, succeeded in interfacing a Velleman K8055 (VM110) with PHP so I can control devices in my home anywhere in the world (blogs on those two to come) but right now I feel like a little rant.

Learners

I have a great respect for learners - people who are on the road to learn how to drive, most of us were there once. There’s always a few reckless people who’ll go out and drive without a licence, which is why I respect learners above most other road users - you know for sure they have a right to be there.

Everyone else

Soon after I passed my test and started driving on my own I noticed one very catching thing: Very few people seem to know how to drive properly. I’d had my suspicions, indeed it was already known that most people don’t know how to use their indicators. I recall standing on a pavement once, the rain coming down hard, no umbrella having been caught short, barely able to see through the rain on my glasses, waiting for a car approaching me at speed to pass, so I could cross. But it never did pass. After elongating my stand in the rain do you know what that driver did? Oh I bet you can guess. They flew around a corner, no indicators in sight. Could this have been because they didn’t see me so didn’t think they had to indicate? Could it be because they thought indicators are only for other cars, or perhaps all of their orange lights were broken? No, we know the sort of person that was. They’re the sort of person who doesn’t bother to indicate for anyone, the sort of person who kick babies for fun.

Of course, not indicating around a corner is a minor annoyance - it’s not often that failing to indicate at a junction will result in an accident. But there’s one other form of junction where this little flashing orange bulb has a great deal more importance, and it’s one of those places that people still can’t seem to navigate around properly: the roundabout. People drive straight over without indicating. People at junctions don’t know if you’re staying on or coming off, you hold up other traffic, thanks. But it gets worse: People who are indicating that they’re coming off, but are staying on - those cause real accidents. What about people who indicate to stay on but are coming off? That’s annoying for people at junctions, but it’s also annoying for people who follow the lanes of a roundabout properly - those that indicate incorrectly usually don’t. Going right? Right lane. Going left? Left lane. Coming off at the next exit? Cross to left lane after exit preceding the one you want and indicate left. Not hard is it.

Taxis

One thing I’ve noticed specifically is taxis. If they have a fare, they drive slightly under the speed limit, just enough to piss you off. If they don’t they usually up your backside. They also don’t keep to their lanes at roundabouts, in my experience this applies to all taxi drivers. There’s some dual carriage way in Bedford interspersed with roundabouts. Usually, I approach these in the outside lane, as everyone else is a little slow (you’re scared of roundabouts when you can’t drive properly, right?) The problem I have, is that entering a roundabout at the same time as a taxi in the inside lane will usually result in you being cut up. Because they drive straight over and don’t curve with the damn thing. I commuted from Luton to Bedford for 6 months and this happened a couple of times EVERY SINGLE MORNING. Learn to god damn drive you bastards.

Women

Women are known generally to men, to be poor drivers. The fact is, everyone is rubbish. Not just women, but men as well. There, I said it.

Road designers

Sometimes, these guys like to have a little fun. Such as putting a zebra crossing just the other side of a hilly, wide, 40mph roundabout. Generally, it’s not a good idea to put things on the road that a driver might not expect. Nice one Luton Council.

Country roads and villages

Oh dear. Deary deary. If there’s anything worse than someone who drives up your bum all the time, it’s someone who can’t decide if they want to speed, or drive too slowly. There’s quite a lot of country roads dotted about England which have a speed limit of 60mph. There are usually partitioned with small towns and villages where the speed limit is usually 30mph. Often, I’ll find myself come up to someone going annoyingly slowly, usually 40mph whilst in this 60 zone. On narrower winding roads the chances of passing are low. And do you know what annoys me even more? When we hit a 30 zone, but they carry on doing 40. You GOD DAMN BASTARDS. You drive through the 30 zone, a few minutes later than you would  have done whilst watching them disappear into the distance. They disappear over a hill. It’s a 60 zone again, you put your foot down. Just as you get to 60, there they are again. ARGHHHHHH.

Speeders

Now, I don’t generally have anything against speeders. Except when they pull up behind you flashing and bibing, because you’re not going fast enough, even when you’re at the speed limit. One such incident happened to me a while ago on the motorway. A caravan (doing about 68, which is illegal I might add) was overtaking an HGV. Naturally, I was in the 3rd lane attempting to overtake them both, at 70. A BMW pulls up behind me, just at the point where all 3 of us are in a line, HGV, Caravan and Me. Now, I only have a little Ka, it’s acceleration from 70 to anything higher is very poor. So, what does the genius do behind me? He flashes because I’m going too slowly. I made him wait. Next time I’ll brake test the bastard - their shiny BMW’s are more expensive than my Ka after all, and if he goes into the back of me whilst in everyone else’s blind spot, who’s to say he didn’t get impatient. That said…

BMW Drivers

Whilst it’s probably fair to say there are one or two good BMW drivers out there, I’ve never met one of them. Driving along at 70 on very rainy day, so rainy that even with the fastest setting of wiper visibility was poor - 30 metres at best, in the middle lane of the M25 you’d probably have thought to yourself, like me, that nobody would be stupid enough to go even faster - doing 70 was probably risky enough as it was. So guess how surprised I was when a BMW rushed past me in the outside lane - doing at least 20mph more than me. I spent a few seconds wondering how on earth he could see through the rain. Then I realised - he couldn’t. The next thing I saw was his face, as his car was facing mine in the middle lane, me still doing 70. It was all very quick, but he had spun in front of me, across the inside lane and then crashed into the barrier past the hard shoulder. I stopped on the hard shoulder myself as fast as I could, because that’s what you do right? About 10 other people did the same, including one that looked like he’d been clipped. Given the rain and traffic, I’d stopped a good 100 metres away from the scene and decided that with so many other people around there was no point waiting.

Conclusion

When you hit 70, you have to retake your driving test to make sure you’re still fit to drive. I’d quite like that to change - once every 3 years everybody should re-take their driving test. Maybe it’ll get some of these toss pots off the road.

Spam

May 17th, 2009

As a child, growing up in the 80’s when the Internet was unknown to the masses, spam was a good thing.

Not many people send you mail when you’re young. You’ll get a few cards at Christmas (if your family is of that persuasion) and some for your Birthday, but then there’s nothing. I used to absolutely love it when I was sent something random, whether is was an application to a credit card or a 50p coupon off tampons.

Growing older, you start to realise this junk mail is slightly annoying. Most of the things you’re sent don’t relate to you, are unnecessary or are something you’d never purchase anyway, and so you throw it away usually without reading it. This problem is escalated when you move into a rented house that has had a lot of tenants in a few years; the quantity of addressed junk is phenomenal.

But that’s not why I’m here to talk to you today. My issue is somewhat different - leaflet spam.

A couple of weeks ago, I put a little notice up on my front door that politely asks “No free papers or leaflets please”. This is because I have little time for random toilet paper being put through my door, and it usually ends up straight in my bin. Now, this has been partially successful, in that the child labour force who usually deliver the free papers are obviously well educated, can read the sign and don’t give me a paper. Unfortunately, this isn’t so for the normal leaflet deliverers. I’d always assumed that leaflet deliverers were students or ‘other’ who couldn’t find a real job. But given the amount of leaflets I’ve received post sign I must conclude that the people delivering them are illiterate.

Incidentally, the best way to stop people sending spam to your email address is not to give out your email address in the first place. Give it only to known contacts, don’t use it in websites you’re not familiar with (use a second, throw away email for those) and never publish it in plain text online. If you absolutely must then I’d recommend Google Mail who have a fantastic spam filter.

For your entertainment, here are all of the leaflets I have received so far; their deliverers willingly ignoring my polite request:

  • LA Fitness
  • Christian Aid
  • The Green Party
  • Choudhury Indian Restaurant (Yum!)
  • JS Cars (who have a lovely hotmail address - never tried emailing for a taxi before)
  • Mama Jan Pizza
  • Johns Car Wash (Under new management (!))
  • KHAN Cafe Rooje (heh, reminds me of Kirk: KHAAAAAAAN!)
  • Italian Express Pizza
  • The new unitary council - I’m taking control - I’m voting CONSERVATIVE (I will obey)

Playing with Maps

May 10th, 2009

I spent several hours yesterday enhancing something I made a few months ago to help me move to Beford. Rightmove is a fantastic resource when you want to find somewhere to live, but if you’d like to be close to something be it your job, your kids school or the local Tesco then it becomes quite a labourious task of going through each property you can afford and seeing where it is.

The mashup I made essentially scrapes all of the rental property from rightmove’s site, calculates the map position and draws it onto a Google map via the api. Yesterday I tidied up the code, improved the scraping and added some searching facilities, although there’s still some work to be done.

If you want to try it out, I’d recommend a browser with fast Javascript processing as it’s quite Javascript heavy, so either Safari or Chrome. It works well enough in the current release of Firefox too. Naturally, IE6 is like a dead horse, and IE7 isn’t much better.

Enjoy

Mashup of Bedford rental property

My Kinda Festival Site Launch

May 8th, 2009

A site I’ve been working on for the past few weeks at evolving went live today - mykindafestival.com

This is one of the fullest projects I’ve worked on there so far, apart from most of the HTML / CSS though, it’s all me baby!

The user side works fully without Javascript but with it there’s some nice progressive enhancement in use. I’ve even added a Mac style button shake when you enter some bad details on the contact / win tickets forms - give it a try! And then enter the promotions to win some free festival tickets, you might just be the lucky winner :-)