Archive for October, 2013

Testing select fields in Mocha

Thursday, October 10th, 2013 | Programming

Recently I spent a good twenty minutes tearing my hair out over a JavaScript unit test I was trying to write. The answer turned out to be a difference in the way our Mocha-based DOM differs from how it would running JavaScript in a browser.

For example, let’s say you have a select field.

<select name="test" id="test">
	<option value="">Select an option</option>
	<option value="1">Option 1</option>
	<option value="2">Option 2</option>
</select>

In a browser, the top option would be selected by default, so if you had the following code:

jQuery('#test').val();

It would output a blank value as you would expect. However, run this in Mocha and you will get an undefined or a null. The reason is Mocha doesn’t select the top option by default unless you manually specify it to. So your HTML would have to look like:

<select name="test" id="test">
	<option value="" selected="selected">Select an option</option>
	<option value="1">Option 1</option>
	<option value="2">Option 2</option>
</select>

In which case, it would then return the value as it should.

Granary Wharf

Wednesday, October 9th, 2013 | Photos

Photos from around Granary Wharf and the canal.

IMG_2782 IMG_2783 IMG_2784 IMG_2788 IMG_2789 IMG_2794 IMG_2798

Yarndale

Tuesday, October 8th, 2013 | Life

A few weeks ago we headed up to Skipton for Yarndale – a festival of yarn. It was huge. They had rented out a sheep auction warehouse and most of it was full of people selling wool and wool related products.

IMG_2698 IMG_2702 IMG_2709 IMG_2713 IMG_2721 IMG_2723

Urgent notice

Monday, October 7th, 2013 | Photos

lift-notice

This notice was in a broken lift in Manchester. It was clearly broken due to the number of signs around it and the fact that the doors were held open. But they also felt the need to post an “urgent” notice.

I’m not quite sure what was urgent about it. Though they have put it in quote marks, so maybe they don’t know either.

Umbrella

Sunday, October 6th, 2013 | Photos

umbrella

After the last series of desk moves, I’ve found myself facing into the sun. There are blinds, but they’re ineffective, so to prevent myself from behind blinded I’ve had to carefully erect my umbrella to provide a sun screen. Feels like such a stereotype.

Area 15 Humorous Speech & Table Topics Contest

Saturday, October 5th, 2013 | Public Speaking

On the last Sunday of September, we held the Area 15 contest for humorous speaking and table topics. The competition was tough and all competitors did a great job – congratulations to all that took part!

Despite having lost at the club contest, only to win through at White Rose, I somehow came out on top in humorous speaking. Two contestants go through to Division so Jamie will be joining me with a speech entitled “The TM 2 1 3 1” as well.

Chanaka once again stormed through the Table Topics and will be going to the division contest alongside Michael who also gave an excellent speech. I’m also pleased to say Michael took home the Toastmaster of the Year award for his ever-present hard work for the area.

IMG_2749 IMG_2754 IMG_2757 IMG_2758

Alice’s Adventures in Wonderland

Friday, October 4th, 2013 | Books

When I read the Wikipedia page on this novel, it described it as being on of the greatest works of literary nonsense ever written. High praise indeed.

The title is often shortened to Alice in Wonderland, which lets be honest, is a far snappier title. Though not technically a correct one. The film adaptation released a few years ago also chose to shorten the name.

As a children’s book, it was a relatively short read and kept the pace moving along at a good pace so even I didn’t get too bored any any point. It does leave you thinking that real life is rather boring though.

alices-adventures-in-wonderland

A Game of Thrones

Thursday, October 3rd, 2013 | Books

Having been watching the TV series, I’ve also been reading the book as well.

It’s not been a bad read, but I really think it speaks highly of the TV series that actually includes most of the details.

Sadly, I can’t think of a better example than Harry Potter. But if you take Harry Potter, the novels are great because they contain large story arcs and extra details that are entirely missing from the films. I didn’t find this to be the case with A Game of Thrones – the TV series has covered pretty much all the book.

As I’ve said, that isn’t really a fault of the book though, which was definitely worth a read.

AGoT

Leeds Business Week

Wednesday, October 2nd, 2013 | Life

As part of Leeds Business Week, the Leeds Toastmasters clubs came together to put on an event “Pitch Perfect”. It turned out to be a huge success with positive feedback from many of our participants and lots of interests in the clubs. Congratulations to Pierre and everyone else involved in bringing it together.

IMG_2689 IMG_2676 IMG_2691 IMG_2696

Ian Bushfield at Leeds Skeptics

Tuesday, October 1st, 2013 | Foundation, Humanism

For our September meeting, Ian Bushfield presented a talk entitled “Skeptics with an Eh: A view of the Canadian Skeptical movement”.

IMG_2661 IMG_2665 IMG_2667 IMG_2668