Don’t Use Easyspace!

12.01.2010

A friend recommended me to Easyspace (a web hosting company based in Glasgow, Scotland – part of the iomart group). Their prices looked good, they were UK based, and I could handle almost everything online…
Read the rest…

Dawn Ascends! Ready Your Swords!

21.12.2009

I absolutely love coding in PHP. Sometimes I get distracted by the glitz and glamour of some of the more popular languages (and their associated frameworks) – and I agree, they have their place. But PHP is in a class of its own.
Read the rest…

I Hate Google Ads

02.11.2009

I officially hate Google Ads. Like me, you probably ignore them so easily. They’re the bane of a web designer’s life… and don’t even start talking about the UX!

The simple fact is they’re hated all round. But quite clearly they work otherwise Google wouldn’t be stinking rich (enough to offer a free GPS satellite navigation product). So who the heck is clicking on these stupid ads?

Well, I don’t care to be honest, because it’s getting to the point where I could do with a bit of the money that Google get. So unfortunately I’m bringing ads back to this blog :( I know, it’s a sad day. Rather than asking for donations (I’m certainly not doing anything worthy of donations), if you feel the urge to click on an ad, don’t quash it with your educated supremism – support a poor blogger and give in to the click. Thanks :)

Putting My DBA Hat On… Again

06.10.2009

It’s not often I have to worry too much about the minutia of database administration… well, I try not to. But this question on StackOverflow got me intrigued, so I put on my trilby.

labratmatt was having a bit of a problem with inserting data into a MySQL table with field defined as DECIMAL(3,2). Can you guess what his problem was? That’s right…. 9.99! How did you guess?
This has got to be one of the most popular MySQL-related Google searches. The initial problem is easy to solve… correct the presumptuous field definition.
However, the underlying problem is really why his data was being truncated, even inserted incorrectly. You may notice the same if you run MySQL (v5.0+) from a default setup on other field types: VARCHAR for example, where you set a maximum field length. When you INSERT data that is too long it simply gets truncated.
Not hugely worrying you may think, especially in development and testing phases. True. But this wasn’t enough for me, so I went on a hunt.
I found this interesting article by Robin Schumacher on MySQL Data Integrity.
It seems that there is a configuration variable in MySQL (v5.0+) called ’sql_mode’ that determines exactly how strict MySQL should be when writing data to tables. The problem is that, by default, it’s unset, which means MySQL uses its standard mode… fudged SQL.
It has a vast array of options, so read through and choose wisely.
The default MySQL setup essentially turns all of your INSERT and UPDATE statements into INSERT/UPDATE IGNORE statements. It is an unexpected “gotcha” for many… any self-respecting software developer would want the INSERT query to fail and for the DBMS to tell you why it failed, not automatically munge the data for you.
To achieve this, the general option to use for ’sql_mode’ is STRICT_ALL_TABLES… but even this has some gotchas (VARCHAR and TEXT expect only string values etc…) and may need to be combined with other options.
Of course, if you write your programs to send MySQL the correct datatypes, changing this option shouldn’t cause any problems :)
The annoying thing is that I’ve only just found about this now after nearly 6 years of database development.

You followed, you RT’d, then you clicked the link

01.10.2009

Well it turns out we want the same thing. And chances are neither of us is going to get it. So stop fretting about Google Wave and get on with some work.

Or if you really must procrastinate, watch my video from yesterday’s post

If It Ain’t Broke, Don’t Fix It

10.08.2009

There have been literally dozens (if not hundreds) of articles on the latest CSS3 styling techniques that you can use right now to “enhance” your web designs. I have a problem with them.

(I found this one this morning and this roundup from the other week is also very good.)
Some of these articles openly state that there’s a good chance that you will find these new features unsupported by a number of browsers – most notably, of course, is Microsoft’s latest version of Internet Explorer as well as stable releases of Opera.
So my first problem is the lack of universal support for these shiny CSS styles. Why is this a problem? Chances are, in order to use some of the newer styles found in CSS3’s draft you will have to use vendor-specific code where those vendors apply the draft.
In order to achieve a fully backwards compatible design, your stylesheet(s) will need:
  • one set of instructions as a backup (for non-supporting browsers),
  • the current draft recommendation standards compliant code (for when it goes to official recommendation), and
  • each individual browser’s vendor-specific code.

All of that for each style. This results in a bloated stylesheet and to a smaller extent, breaking the DRY principal.

Then there’s the obvious differences in how the browser vendors interpret the draft recommendations from W3C and even in certain cases creating options that aren’t a part of the draft. It can be hard to see which way is the right way to go from a design point of view at this early stage, especially if you’re like me and you don’t want to have to come back and fix broken designs later on.
We’ve come a long way in web design. Thanks to standards support in browsers like Firefox and Safari, Internet Explorer and others have had to adapt quickly to keep up. And they have.
However we’re starting to tread over old ground. In the bygone eras of the web—when Netscape and Internet Explorer vied for supremacy—each had an array of browser-specific HTML. And we hated it. For example, if you wanted the benefit of layers in Netscape and you used it to the full, IE visitors were quietly asked to leave. Or you could hack around and find a solution that made your designs cross-browser.
That’s why the W3C took over the evolution of HTML and defining an open forum for standards. Those days should be over, but it seems we’re heading back down that old road.
The browser vendors will always put their own code in place, but it’s only when we use it in the mainstream that problems start to occur. Then we blame the vendors for dangling that chocolate-covered banana in front of us when things get out of hand.
I’m not saying you shouldn’t try all these new toys out, just go easy on the less well-supported ones. You’ll save yourself a lot of hassle down the line when everything changes again.
Remember: If it ain’t broke, don’t fix it!

The Problem With Twitter

21.07.2009

An innocent prank? Not really. I think Ryan will not be pleased. It seems becoming even remotely popular on Twitter draws unnecessary attention from silly people.
Sad times. Perhaps I should only use Twitter-based apps that have successfully implemented OAuth

Progressive Ehancement, Graceful Degradation and Legacy Support

30.10.2008

Are we still supporting browsers that have had their day? It seems the simple answer is “hell yes!” I ask why…
Read the rest…

Unfinished Business

07.07.2008

I just wanted to write a quick post (as it’s late and my Mrs wants me to come to bed) about lingering jobs. We all have them. Washing up that’s starting to grow its own ecosystem, that lightswitch that’s still hanging off the wall (but it works!)…

For me it’s a plethora of oddjobs for old clients. In my case they come back for more, usually at the most inconvenient times. This time however it’s all my fault. In desperation I have offered to do work in the hopes that I will finally get these people off my back.

It’s not that they’re begging me to do things, but more for my own sanity. I guess I have some mild form of OCD. I just want things tidy. Is that so bad?

I find that eventually there are so many things on my mind that I can do none of them. So I suffer silently in a corner somewhere waiting for the light to come on. Ultimately it’s a crippling fear of failure that grips me most. Of course it is that very fear that breeds itself.

I’m sure you understand…

So follow my changing mental state on Twitter. You’ll catch some of my mini rants and you may even witness my entire nervous breakdown (reality TV eat your heart out!)

When “Can I…” or “I’m going to…” becomes “I want you to…”

26.06.2008

Dear Audrie,

Today I have been mostly making “final tweaks” to a fairly simple project that I’ve been working on. It’s a content site with a Flash gallery.
It’s quite easy, but we’re not dealing directly with the client. We’re dealing with a go-between art studio who produced the design. They’ve basically done the whole rebranding and needed someone to put the site together.
This sounds great from a programmer’s point of view: No designing, just programming… more like this please.
There is a major problem with this though. The design studio tend to get their own “ideas” of how the copy should go and what goes where. All within their power? ‘Yes’ you might say.
However, it becomes a little silly when as the programmer you are providing a product to a client that allows them to update their website themselves and you end up making all the changes.
I’m not going to name drop because that may enlighten the client a little too much for the studio’s liking. It may also highlight how this particular studio stays in business.
I know this sounds like I’m just getting at the studio in question, but rather I’m trying to portray just how difficult a programmers life tends to be. You sign up for one thing and do 101 other tasks.
In my experience the following rules apply:
Is it possible to… means … Do that…
Can I…                   means … Do that…
I’m going to…       means … Do that…
And so I find that instead of one person to answer to, I have hundreds all vying desperately for my time. And all increasing in their requests.
Why can’t people tell you all of the things that need doing and just let you get on with it? I much prefer that as opposed to this ‘do this and get back to me’ approach.
Ah well.
Until next time!