Rumblings from the keyboard of Pete Eveleigh,
a web designer and developer based in Gloucester, UK

Why the UK voting system is wrong.

Posted: May 6th, 2011 | Author: | Filed under: General, Social Comment | Tags: , , , | No Comments »

Can’t believe that the Conservatives have won Gloucester. But then again only around 40% of the electorate bothered to vote here.

What’s wrong with people? I’ll be honest, there was no candidate that really struck me as being worth my cross but I weighed things up and voted for who I wanted to win, knowing that they would not. Did I Waste my vote? Perhaps. But surely one should vote with their convictions rather than try to manipulate the least undesirable result? I voted with my head and heart and a blind faith in the system – just in case miracles happened.

So you get splits like this, for Barnwood, with 5 candidates standing. Resulting in 66% of those that bothered to vote NOT voting for the winner:

Trade Unionists 115 (3.6%)
Cons 1,086 (34.07%)
UKIP 209 (6.55%)
Lib Dem 1,059 (33.22%)
Lab 718 (22.52%)

Or this for Quedgeley Severn Vale, with just 3 candidates standing, in which 60% voted AGAINST the winner.

Lab 477 (25%)
Lib Dem 750 (39%)
Cons 670 (35%)

When you have more than 2 parties the system doesn’t work especially when there is no real difference between the candidates (i.e. they are all as bad as each other). So one candidate gets very slightly more votes than the others and is deemed the winner but in reality they have fairly low overall support.

If no candidate gets over 50% of the support then how is that democratic?

If you support the winning party then great. You got the result you wanted but don’t you still question the fairness of a system in which the majority of people voted against the eventual winner? It’s nothing to do with which party you support. It’s about having a system that represents the majority preference.

Too late now, but if you didn’t bother to vote or voted No in the AV campaign then shame on you.


Custard Slice birthday cake

Posted: December 17th, 2010 | Author: | Filed under: Food, General | | No Comments »



Custard Slice birthday cake

Originally uploaded by foamcow



Death to wasp scum

Posted: October 6th, 2010 | Author: | Filed under: Drunken Ranting, General, Humour, Social Comment | | 2 Comments »

I had a minor problem with a wasp infestation during the summer so I went to the local Homebase to get something to deal with it.

No problems there. I forgot all about it to be honest.

Just now though, I received and email from Homebase asking me to review my recent purchases. Curious as to what it was I may have recently bought from Homebase I took a closer look.

They wanted me to review the can of Wasp killer and the tub of Ant powder I’d bought in the summer.

Well, after a prompt from a Tweeter, I obliged.


Death to Wasp Scum.

With a can of wasp spray in my left hand and the ant powder in my right, I had a glimpse of what it felt like to be Hitler.

I didn’t like it, but it had to be done.

I approached the wasps at dusk to catch them unawares. Creeping up on their stronghold I let rip with the can of spray, deploying choking death directly into the wasp nest’s entrance. And but few seconds later I heard many tiny, buzzy coughs coming from inside.

Unfortunately they must have had some special suits or had developed a resistance because within 30 seconds I was being pursued by what was probably in excess of 1000 rather annoyed, coughing wasps.

I did a pretty good job keeping ahead of them but eventually I started to flag and they caught up with me. Once I’d endured a couple of hundred stings I found it very hard to keep up the pace and they brought me down.

Not to give up without a fight I chose this moment to deploy the powder – at the very least it might provide a smokescreen so I could effect a getaway. Alas, the wind took the puff of noxious powder straight into my face.

It was shortly after this point that I must have passed out as I woke up a couple of days later in hospital. It’s ok though, I was back home within a week or so and all the wasps were dead. Got them! Great product!

**** 4 stars

The Waspinator.

Hope I win the 100,000 Nectar points on offer but I somehow doubt it.


Football, Football, Football!!!!

Posted: June 11th, 2010 | Author: | Filed under: General | Tags: , , , , | 1 Comment »

I think Mitchell and Webb got it about right.


How To Create a Facebook Style Password Field with jQuery

Posted: May 20th, 2010 | Author: | Filed under: design, General, How to | Tags: , , , , | No Comments »

Note: This is a pretty old demo I made for someone on a forum somewhere. Since there is never one way to skin a cat I may well do it slightly differently if I did it today.

OK. Facebook, and probably many other sites, employ a method by which they put a form field’s label inside the field itself. This is no biggie, and quite easy to accomplish but what about password fields. By default, in every browser I can think of, the password field type is masked – that is to say the characters you enter are hidden by asterisks or bullet points. This presents a problem since if you shift your label into the field it will be masked.

The solution, therefore, is to change the fieldtype to a plain text field before putting the label into it, then switching to a password field when the user enters something.

Demonstration

Note: this won’t work until I can work out how to include Javascript in a WordPress post.


Why can’t you just make it a plain text field to start with?

For users that are browsing with agents that don’t use Javascript or those that have just blocked it, the password field must still be a password field – so it has to start out that way and be changed by Javascript.

Where my method beats Facebook’s is that if you empty the password field and leave it, the label is restored. Facebook’s effort leaves it blank.

The Code

Let’s start with a simple login form.

<form action="#" method="get" accept-charset="utf-8">
	<p><label>Password</label><input type="password" name="password" id="password" /<p>

	<p><<input type="submit" value="Continue"></p><
</form>

There, told you it was simple.

Now a little sprinking of jQuery. (of course you’ve already included the jQuery library)

$(function(){

	// first we remove label tags from dom
	$('#password').siblings('label').remove();

	// then we add a faux-label inside the field (there's a neater way to do this)
	$('#password').replaceWith('<input type="text" name="password" id="password" value="Password" />');

    // capture the initial click and bind a custom function to it
    $('#password').bind('click',fieldcheck);

	function fieldcheck(el){
		if($(this).attr('type')=='text'){
			$(this).val('');
			$(this).replaceWith('<input type="password" name="password" id="password" />')
			$('#password').focus();
			$('#password').bind('blur',fieldcheck);

		}

		if($(this).attr('type')=='password'){
			if($(this).val()==''){
				$('#password').replaceWith('<input type="text" name="password" id="password" value="Password" />');
				$('#password').bind('click',fieldcheck);
			}
		}
	}

});

And there you have it. A neat, degradeable and, I hope, accessible method to tidy up a password field.

There are a few ways you could improve or expand this, the obvious being to create the text field and faux-label dynamically rather than hardcoding it as I have done for this example.