Useless BBC Technology article

Posted on January 1st, 2009 in Rants, Technology | Comments Off

Posted a couple of weeks ago, is this “Shopping online for blind people” article on the BBC News Technology pages. As per usual, the BBC’s technology team have done some excellent research to use in this article.

The first site we see, confuse.com (not to be confused with confused.com – hah), is shown as a price comparison site….. which it blatantly isn’t. It’s an ad site, which has the same standard layout as all other ad sites, and if you click on any of the supposed comparison links, all you see is a page of adverts. Excellent work BBC.

Re-setting CSS Styles

Posted on December 18th, 2008 in Programming, css | Comments Off

Having had some proper developers come in and work on our code, it’s backed up my cosntant moaning that our code base is in a pretty bad state. Lots of duplication of code all over the place, and lots of pages across multiple sites, which could be common.

The other thing, which one of my developers claims to be very good at and knows almost all there is to know about it, is CSS.

The contractors however, have pointed out many many problems with our css, and have recommended resetting the styles on the sites, before doing anything. I don’t claim to be good at CSS, I know the basics but apart from that, I get my hands dirty with the backend code – so this link proved very useful and insightful when it was given to me. Explains style resets very well, and I now know what we need to do…. the question is will it ever happen?!

Left 4 Dead – Versus Difficulty

Posted on December 10th, 2008 in Games, Rants | Comments Off

In the latest patch for Left 4 Dead, Valve have decided to fix the difficulty under Versus mode to Normal.  I didn’t think much of this, having played on Expert and finding it ridiculously difficult, until I played it a few times.

What is now evident, is that people are just trying to rush through each level, instead of having to take it slow and steady and think about what they are doing.

Last night, 8 of us experienced gamers, on our own server, had to play it on Normal…. and it was boring. Too easy to fight off a rush of horde, too easy to kill Hunters, too easy to kill a Tank. Expert was too hard, Normal is too easy.

From the various threads I’ve read elsewhere it looks as if this is because people have been voting to change the difficulty mid-game – well here’s a novel idea – why not just disable that functionality?! Once a campaign has started, the difficulty can’t be changed. Let it be specified at the Lobby. That way all players know what they’re about to play. Don’t completely restrict the setting. I hate to think what an organised clan/team match will be like on Normal setting. It will be more like a sprint than a tactical team game.

JavaScript bra size calculator

Posted on December 1st, 2008 in JavaScript, Programming | Comments Off

Not sure that I would ever need this, however I would most certainly have liked to have been involved in creating it ;)

JavaScript bra size calculator

jQuery – Show and Hide Input Box & Highlighting

Posted on December 1st, 2008 in Programming, jQuery | Comments Off

As part of a recent project, I had to make a payment page clear, user friendly and intuative.  One of the key things was to only display fields when certain options were selected – in this case, when a radio button had a certain value.

<input type=”radio” name=”payRemainingBalance” value=”true” checked=”checked”/> the full amount ($amountDue).
<input type=”radio” name=”payRemainingBalance” value=”false” /> another amount. (Enter the amount you wish to pay in the field below)</td>
<div id=”anotherAmount”>
Another Amount: <input type=”text” name=”paymentAmount” id=”paymentAmount” maxlength=”8″ />
</div>

Using jQuery, this is very simple to do:

<script type=”text/javascript”>

$(document).ready(function(){
$(“input[@name='payFullAmount']“).click(function(){
$(“input[@name='payFullAmount']:checked”).val() == ‘false’ ? $(“#anotherAmount”).show() : $(“#anotherAmount”).hide();
});
});

</script>

As we don’t have an id on the radio button, we use the name of the input as the identifier, and a simple one liner to establish what the new value of the radio button is.

Due to the focus being on making it clear what is happening, it could be quite easy when you select the radio button, to miss what has changed on the page (a new input box appearing), so I decided to try and highlight the newly displayed input box by fading the background colour of the input box, in and out.  In order to do this in jQuery, you need the jQuery Color plugin.

<script type=”text/javascript”>

$(document).ready(function(){
$(“input[@name='payFullAmount']“).click(function(){
$(“input[@name='payFullAmount']:checked”).val() == ‘false’ ? $(“#anotherAmount”).show() : $(“#anotherAmount”).hide();

if ($(“input[@name='payFullAmount']:checked”).val() == ‘false’) {
$(“#paymentAmount”).animate({ backgroundColor: “#EFB559″ }, 1000).animate({ backgroundColor: “#FFFFFF” }, 1000).animate({ backgroundColor: “#EFB559″ }, 1000).animate({ backgroundColor: “#FFFFFF” }, 1000);
}

});
});

</script>

Our starting background colour is #FFFFFF, we fade to #EFB559 in 1 second, back to #FFFFFF in 1 second, to #EFB559 in 1 second, and finally back to #FFFFFF in 1 second.  This gives the effect of highlighting the field in an orange colour twice, hopefullyhelping the user notice what has changed on the page.

Squid with ‘elbows’ caught on camera

Posted on November 26th, 2008 in Science | Comments Off

Some clever fancy remote controlled submersible owned by an oil company, has spotted and filmed a Squid…. with elbows.

http://news.nationalgeographic.com/news/2008/11/081124-giant-squid-magnapinna.html

That looks way too much like the alien from the Independence Day film for my liking. Thankfully it lives at silly depths in the Gulf of Mexico, and it can stay there!

Velocity – Looping through a TreeMap

Posted on November 26th, 2008 in Programming | Comments Off

I had trouble finding any real information on this to pass on to the developers here, so I had to document it myself, to help them move on from their PHP background to understand things other than simple multi-dimensional arrays.

So here, our TreeMap structure is….

TreeMap tMap = new TreeMap();
tMap.put(1, “London”);
tMap.put(2, “New York”);
tMap.put(3, “Paris”);
tMap.put(4, “Sydney”);
tMap.put(5, “Geneva”);

Looping through this in Velocity and getting the values OR the keys is easy enough to do, and can be found through searching on Google, but pulling out both is hard to find. Presuming we’re passed the above TreeMap to the Velocity layer as$cities

// loop through the keySet of our TreeMap and assign
// the key to $cityKey
#foreach ($cityKey in $cities.keySet())

// using the current $cityKey, get the value assigned
// to that key and set it to the variable $city
#set ($city = $cities.get($cityKey))

Key: $cityKey
City: $city

#end

Very basic example, but hopefully it’s useful to someone!

Developers and AJAX

Posted on November 26th, 2008 in Programming, Rants | Comments Off

I do wish people would stop spouting rubbish about AJAX. Clicking a link and making a div appear/disappear is not AJAX – how many times do I have to explain this to these people?

AJAX refers to not interfering with the display and behaviour of the existing page, whilst communicating with the server in the ‘background’. Once it’s received a response, then the page can be updated.

Yes clicking a link and making things appear/disappear might be done with Javascript, but it is not making an asynchronous call to the server for anything, which is quite a key part of the whole concept of AJAX!

Another Pointless Study – “Bad bosses may damage your heart”

Posted on November 26th, 2008 in Rants | Comments Off

http://news.bbc.co.uk/1/hi/health/7745324.stm

In Summary….

a causes b, b causes c, therefore a causes c.

Do you know what causes your bosses stress? Stupid employees. Stupid employees cause the Manager to be grumpy, which is why the employees become stressed. Therefore it is the employees fault that they are stressed. Study complete.

Left 4 Dead – A (very) quick review

Posted on November 25th, 2008 in Games | Comments Off

Let me start by saying “epic game”. The Demo was fun, but the full version is even better.

The differing types of zombies, create a fun and, if someone doens’t have their wits about them, intense and fast paced gaming experience. When you first experience someone next to you getting jumped by a Hunter and tagged by a Smoker, the adrenaline kicks in as you desperately try to save them, knowing that you are shortly going to be confronted by an insane number of zombies round the next corner. When you’re first thrown up on by a Boomer, and the rush of zombies ignoring the other players and race straight for you find it funny, as your screen blurs and you can’t actually see how many there are. The first experience of a Tank – where you think you can run, and hide from it – but it follows you everywhere, and begins picking pieces of the world up and throwing them at you.

CoD4 provided an excellent game for both fun and competitive team-based gameplay, and so does L4D…. but it’s so much more exciting. The audio complements what is happening in the game, and adds to the experience. It’s intense, but sometimes hilarious as each person is simply swamped by zombies and you all know that you are shortly going to be starting the level again.

I am going to be losing many hours of my life to this game – and it’s going to be worth every minute.