graham.reeds/

So where is the background?

February 28th, 2009 :: graham.reeds
Categories: Leisure ::Life ::Programming ::Web

I’ve just run into one of jQuery’s thornier issues.

While creating a map viewer for the S:GTC I found my code worked in FireFox and Chrome perfectly but refused to budge in IE7. Some of you may know that the map in Space currently only works correctly in IE6 – not good when most of the planet uses something other than. I thought with standards being pretty much standard these days and the bits that are not yet standardised being abstracted away by jQuery (and the ilk) I thought it would be plain sailing.

Until I tried to get the value of background-position. Turns out that IE doesn’t support background-position for getters but supports background-position-x (and -y obviously). So you can suppose that concatenating the strings would get us to the point where we want to be. Yes? No.

In my humble program I need values. Pixel values. I don’t want em, %ages and I certainly don’t want it as a string. What use is that to me? Okay I can create a big switch statement for top, bottom, left, and right but what about center? To cope with that I’d have to check ahead to see what it is and then convert accordingly. So much for ‘Write less, do more’.

There is a whole raft of information on the Net about this very issue and I’ve ran into it after a couple of weeks but amazingly no one has offered a viable solution. There’s a handy test to see it in action. View it in your favourite browser and then check it out in IEx. That’s right Microsoft hasn’t fixed IE8.

Personally I am so frustrated with the whole situation that I feel like browser-sniffing for IE and banning them outright – not just inform them that they have a substandard browser.  If all devs did that then MS would have no option but to fix it. Sod backwards compatibility – if you rely on a bug to work then expect the fix to ‘break’ your mark up. Eventually standards really would be standard, people would learn to write compliant code and dirty hacks be a thing of the past.

1 comment.

I am now a member of the great unwashed

February 26th, 2009 :: graham.reeds
Categories: Life ::Work

With effect of Friday the 27th of March I will be unemployed by reason of redundancy.

2 comments.

Graham needs

February 25th, 2009 :: graham.reeds
Categories: Leisure ::Life

Following on from Steves post about what he needs, I’ve followed suit.

  1. Graham needs help
  2. Graham needs help
  3. Graham needs Help!!
  4. Graham needs Ginola to meet the German challenge
  5. Graham needs a donor
  6. Graham needs You!
  7. Jane Graham on the final of the Eurovision talent show
  8. Zombies
  9. Graham Taylor: Walcott needs a sharp brain
  10. Sometimes your website needs to be complicated – not simple

Even with the search in quotes it doesn’t improve – I get M4 crashes and all sorts.

The only conclusion you can take from this is the fact that all the Grahams out there have everything they can ever want/need and all Stevens are materialistic bastards:-)

0 comments.

Less power

February 23rd, 2009 :: graham.reeds
Categories: Leisure ::Life

Just checked my new HTPC for power usage. At boot it tops out at 143.3 watts which is 50 less than the original machine only slightly more than what the original did at idle. At idle this machine only uses a (comparitely) tiny 106. Not as low as Jeff Atwoods, but I have 4 hdd’s, one of which is a SSD. Do SSD use more power than regular HDD? I was hoping for about 80 watts but it is still good.

The S3 standby mode is considerably more hovering around 6.6-7.5 but I do have a remote control sensor attached drawing current at all times. Recovery from it is considerably quicker too.

0 comments.

Economic downturn…

February 23rd, 2009 :: graham.reeds
Categories: Life ::Work

…has hit the Bear palace. There has been an order passed down from on high in the company heirarchy that there is to be a 15% reduction in head count – regardless of rank or role.

The fact that the office where we work lose money – as we don’t manufacture anything directly – won’t help our cause.

What would normally be a plus for us we are less than six months away from releasing the next generation of our controller hardware and while it won’t reignite the market place it will enable us to be in a better position when the global economy stablises and begins to grow.

Less than 5 days will determine whether we get to release this product or whether it will be mothballed perpetually.

0 comments.

The second worst game show on Earth

February 11th, 2009 :: graham.reeds
Categories: Leisure ::Life ::Misc ::Work

Being off for a week I’ve experienced the dubious pleasure of watching Golden Balls, the second worst game show on Earth – the worst being Deal or No Deal.

The premise for Golden Balls is similar to Deal or No Deal in so far as much as you don’t have much say in the proceedings.

There’s a large amount of balls, all of which are golden, in a large rotating drum. These have a monetary value attached to them from £10 to £2,5000. They have a Clamshell/catch affair so you can open them and read the value, but they won’t open at by accident. 12 of these balls are released and roll down into another spinning drum into which a lovely assistant puts 4 ‘killer’ balls.  These random balls are then released down chutes to each player. They then position them how they choose on a 2-tiered rack and then open the front tiered balls for the world to see. Only they can see what they have.

So no player interaction so far. Now the contestants get to ‘play’. The idea for the players to discuss what balls they have and bluff about what they have. After the bluffing they decide which person to drop. This bluffing is pointless. You have no way of telling whether they are lying or telling the truth. The only logically way is to total up the values on show and make your choice based on that. Obviously killers override all other values and must be removed.

So now you have 3 players. The remaining balls are returned to the spinning drum. An additional 2 value balls are added as well as a killer ball. So they now each have 5 balls instead of 4. Again they display the front 2 balls and try to bluff about what they have on the back shelf. You have a little more information than before – you know what balls were there before. However you don’t know who has them. The best you can do is save the player with the most and drop the player with the least.

Now you have the head-to-head. This is where the true intelligence of the players shines through. The remaining balls are closed and placed at random on a field. The contestants pick one ball to bin and one ball to win. The balls are opened to reveal what the contestants would of won – like that makes a difference. If you get a killer, the value is divided by 10. So if you have 10,000 on the board and get a killer your prize fund is now 1,000. Another killer would reduce it to 100.  So killers at the start doesn’t make much difference.

But where does the player intelligence (or lack thereof) come into this? The players were going with their feelings whether a ball felt right or not. Eh? It’s a featureless golden ball – it looks like every other ball on the table. How can it feel of anything?

Okay. Now fast forward to the they end game. You have a prize fund. It can be of any amount. You have to decide whether to split (S) or steal (K). Your opponent has the same choice. There are 4 possible patterns SS, SK, KS, KK. What are the outcomes (with you first):

Recognise this? It’s a bastardized version of the prisoners dilemma. However, this version of game theory it rewards for stealing.

The correct way of doing this is to tell the opponent you are going to steal and offer them a fixed value of less than 50%. Point out that they have no chance of winning any money unless they accept your offer. Tell them what they can buy with the money. If they point out you’d be getting more, point out that my winning is irrelevant. They will be getting zero or the amount you have offered. Always make it about them. And steal.

Nice guys finish last.

0 comments.

Mass Murder? Fantastic!

February 10th, 2009 :: graham.reeds
Categories: Leisure ::Life

There was an article on the BBC One Breakfast News regarding the wildlife organisation (can’t remember which one) have decided to protect the dwindling red squirrel population from the marauding greys. So what happened?

[Pictures of a branch in Scotland with a Red Squirrel ]

Bill Turnbull: We reveal plans for saving the Red Squirrel [dramatic pause] by culling the greys.

[Cut back to Studio]

Louise Minchin: [Excitedly]Fantastic!

0 comments.

jQuery for Dummies

February 9th, 2009 :: graham.reeds
Categories: Programming ::Web

In an attempt to create cross-browser support for S:GTC I thought that learning jQuery would help in making the map work in more than IE6. So instead of getting frustrated at the abysmal PHP code I have to work with I decided to sit down with jQuery and de-stress.

Or so I thought.

I did what anyone does: Skim read the documentation and immeadiately attempt something they have already done in another language. The project I attempt was the map viewer I created in GWT which was based upon the one in Pragmatic Ajax. The Pragmatic Ajax code was simple in it’s design, but refused to work in FF if you enabled any DocType. My GWT version worked with any DocType (admittedly I only tried with XHTML 1.0 Trans, but it should of worked with any of the HTML 4.01 DocTypes.) and also supported scroll wheel zooming to boot.

So with something to aim towards, progress should of been quick. Unfortunately things didn’t go to plan. I scaled back. That didn’t work so I read the docs closely. I then scaled back even further. I now have the same code as the docs. Still it doesn’t work.

Gah.  I feel like giving up and stacking shelves for a living.  Why doesn’t it work!?!

0 comments.