Archive for March, 2013

A snowy Trinity

Friday, March 15th, 2013 | Thoughts

Last Thursday, the Trinity Leeds shopping centre opened. On Friday, it snowed. This presented quite a few problems for the new shopping centre, whose website claims it is the largest in the UK, even though we know that’s not the case (as if it wasn’t obvious to anyone who was walked around Meadowhall, that in itself is only the 8th biggest).

Snow settles on the roof
The large glass roof that covers the centre over will no doubt be magical in ideal conditions, but with a lot of it being fairly flat, the snow just settles on top of it. As a consequence, it almost felt a little gloomy over the weekend because all you could see when you looked up was a thick layer of snow.

It’s very cold
The centre isn’t actually enclosed, it just has a roof over it. The result is that when it is cold, it is cold inside as well because there is nothing to keep the heat in. This would be fine, but at least one of the restaurants has most of their seating outside, which is then rendered useless by our wintery conditions.

It snows inside the centre
Another rather unfortunate consequence of not having a sealed roof is that when it snows outside, it snows inside as well. Walking though the centre on Saturday felt like just being outside as as much snow seemed to be falling inside as it was outside.

Visiting The In-Laws

Friday, March 15th, 2013 | Public Speaking, Video

Speaking of speech contests, here is my area winning speech from the humorous speaking contest last September.

Selenium Cannot assign requested address

Friday, March 15th, 2013 | Life, Tech

If you’re using BDD (Cucumber or Behat for example) with Selenium, you may find you occasionally get an error where the framework is unable to communicate with the Selenium server.

Failed to connect to 127.0.0.1: Cannot assign requested address

This seems to occur when there are two many requests going to Selenium. This can be alleviated be rewriting your tests to ensure you are now sending too many requests at once.

For example, if you’re using Behat/Mink, then avoid using the wait() function on the Session object, as this can cause excessive requests to be sent to Selenium.

The Easy; and The Worthwhile

Thursday, March 14th, 2013 | Public Speaking

Last Thursday law the club level competition for the International Speech Contest.

I’m pleased to say I won the Leeds City contest and will be advancing on to the area level contest in April. I was looking forward to facing off against one of our club’s Distinguished Toastmasters, but he unfortunately dropped out. Never the less, Dinesh provided some tough competition.

If you missed it, don’t worry, the White Rose Speakers competition is happening on the 27th, so you can attend that one instead!

51% Bourbon

Wednesday, March 13th, 2013 | Friends

With Michelle back in town, we headed down to 51% Bourbon for some drinks.

IMG_0451 IMG_0452 IMG_0453 IMG_0458

A Blackhouse Birthday

Tuesday, March 12th, 2013 | Events

Where better to celebrate a birthday than Blackhouse?

IMG_0426 IMG_0430 IMG_0431 IMG_0435

Ponies

Monday, March 11th, 2013 | Photos

While up in the Dales, we found some ponies.

IMG_0364 IMG_0355 IMG_0351 IMG_0346 IMG_0341

Hollins Hall

Sunday, March 10th, 2013 | Life, Photos

Last weekend, we headed up to the Yorkshire Dales for Elina’s birthday. We stayed at Hollins Hall, which is part of the Marriot chain.

It was quite a nice hotel, they have a big pool, although there were people in it which was always annoying and their spa bath was a bit rubbish. It was nice to have a decent length pool though.

The service was excellent, and the staff were friendly.

We dined in their Heathcliff’s Restaurant, which was OK, though I was a little disappointed by the roast, as the Yorkshire pudding was a bit hard and crispy. The white chocolate sauce that came with the profiteroles was a winner though.

IMG_0321 IMG_0324 IMG_0329 IMG_0323 IMG_0322 IMG_0314

Class constraints in Symfony2

Saturday, March 9th, 2013 | Programming, Tech

Sometimes you need to put a constraint on a whole class, rather than a single value. Duplicate usernames are a good example of this – you don’t want to be able to set a username to one that is already in use – but if it is in use with the user you are currently working on, you don’t want to flag it up as an error!

Lets use that as an example. You have a Username constraint and a UsernameValidator object to do the actual validation. We need to supply the validator an object, so we need to put the following method inside the Username object.

public function getTargets()
{
    return self::CLASS_CONSTRAINT;
}

This will turn the first parameter in our isValid function in the UsernameValidator class to an object.

public function isValid($user, Constraint $constraint)

Finally, you can call the constraint from your YAML validation file.

User:
    constraints:
        - nocs:UniqueUsername: ~

Normally, under user you would have getters and properties – but here we’re adding a new section named “constraints” which lists all the class constraints.

Surfin’ Bird

Saturday, March 9th, 2013 | Thoughts

hawaii

Often, our society fails to give scientists the credit they deserve.

Take homo erectus for example. A lot of scientists have had a lot of laughs out of the fact that they managed to convince the world that homo erectus was the name of an evolutionary step (which it is of course) and not just a really silly name they thought they would try their luck with.

But nowhere is it more clear than the people who study using the many telescopes located in Hawaii.

At some point in human history, a scientist when to a grant panel, and the grant panel asked them where the best place to put a telescope would be. Said scientist must have then looked at them slowly and sensing they trusted their judgement, decided to try their luck once again.

“Hawaii!” the scientist would have said, trying to sound more confident than they really were.

“Hawaii?” the chair of the grant panel would have enquired. “Why would Hawaii be the best place to put a telescope?”

“Well…” replies the scientist, trying to think on their feet as fast as they possibly could. “It’s the altitude you see!” “The altitude? Hawaii is an island, surely it is at sea level?” “Yes… but those mountains are very tall! Very tall indeed!”

“Seems like there would be a lot of places at high altitude. Are you sure you’re not just making this up so you can go live on a tropical island and go surfing every day?” “No, no” replies the scientist, “Hawaii has the tallest mountains and the clearest skies – it has to be Hawaii.”

“Well then”, says the grant panel chair, slamming down his approved stamp, “I guess that is that.” Thus began a golden age for science…