Nej's Natterings

Thursday, January 31, 2008

Title = NULL

Why do people not understand the meaning of NULL, in databases?

It's simple. NULL is nothing. It is a complete absence of data. But this does not mean it is the same as a defined, but empty piece of data. That would not be NULL.

NULL is NULL. Except that it isn't. Nothing can be equal to NULL, not even NULL itself. Nothing can be compared to NULL, as nothing is equal to NULL. If you try and add NULL to a number, you get NULL. If you try to add NULL to a string of data, perhaps a name or address, you get NULL.

You've heard that computers deal in 1s and 0s - binary logic. This is true. All computer expressions are boolean, so they resolve to either true (1), or false (0). IF name="Neil" would resolve to true or false, depending on whether name did indeed contain the word "Neil". Except NULL. NULL is both true, false, true and false and neither true nor false all at the same time. It turns the 2-state logic of computers into a 3-state system. Consider this:

name = "Neil"
IF name = "Neil" <--- True

name = "Fred"

IF name = "Neil" <--- False

name = NULL

IF name = "Neil" <--- NULL - all your code dealing with true/false values will fail.

name = NULL
IF name = NULL <--- NULL. This will not return True, because NULL is not equal to NULL. Again, all your code dealing with true/false values will fail.

The reason for writing this is that I've just explained this for at least the 3rd time to a colleague who should probably know it by now. So, to set the record straight. To test for equality with NULL values in SQL (i.e. IF name = NULL) you need to use IS NULL.

name = NULL
IF name IS NULL
<--- True. Hurrah! Everything works again!

Got it now?

Wednesday, January 30, 2008

Book 'em, Dano

Holiday plans are well underway. Flights and the accommodation (via Ele's colleague's timeshare) have been booked and paid for. We are flying to Atlanta, Georgia, and will be driving down to Orlando. Having never driven in the US before (or on the other side of the road at all, for that matter), I thought I'd ease my way slowly into it with a small 7 hour, 400 mile journey. Seems like the sensible thing to do.

Having been investigating car hire prices, all I can conclude is that they vary wildly. We want a 4x4 so that we are higher up for Jess & Joe, and hopefully have a bit more luggage space. The quotes seem to vary from £320 to £600. We have to be careful to book one that includes all the relevant insurances, though. Still, plenty of time yet.

We are probably going to take Joe's car seat on the plane. According to BA the seat is 18.5" wide, and according to mothercare.com, his car seat is 18.7" wide... I'm sure it'll fit... It'll be much better for him on the plane, because he'll be able to lie back and sleep. He'll also be more inline with the TV screen in the seat back and unable to stand up on the chair, which he'd be doing otherwise. He's usually quite comfortable in his seat, and he can always come out for a bit here and there. It'll also save hiring a seat when we get there.

I also appeared to underestimate the theme park entry cost. I think it's actually more like 2 arms and 1 leg per person. We did look at going to a place called Discovery Cove where you can swim with dolphins, but that costs a staggering amount of money. For us to go in (Joe being free), it would cost about £300, and then dolphin-swimming is another £50 each. So £350 for just Jess to swim with a dolphin. Oh you get lunch and get to wade with some rays and feed some birds, but I can spend £100 per person in better ways, frankly. So we're giving that a miss.

Looking forward to it, but it's still a long way off...

Thursday, January 24, 2008

The President of London

Apparantly, Rudy Giuliani is languishing in the polls in his presidential campaign.

If he loses, I have the perfect idea for him: Come to London and run for Mayor here. What an improvement this man would make over the farce that is Ken Livingstone. This is a man with genuine leadership - look at his actions after 9/11 - and a man with zero tolerance to crime.

As London degenerates more into such a bad place that even our Home Secretary - the very person who is responsible for our safety - is too scared to walk its streets at night, an approach such as the one he gave New York is exactly what we need.

Police on the street, not behind desks. Break the law and you're in jail. Job done. What's so difficult about that?

It's not like it'd be difficult to win, either. The competition consists of Ken Livingstone, who exists purely to extract money from car drivers, and even more from 4x4 drivers, and Boris Johnson, who exists purely for people to laugh at. I'll be voting for Boris given the current choice, as I'm sure he'd be a far more interesting and entertaining mayor than Ken Bloody Livingstone. But I'd rather have a proper mayor.

Come on, Rudy, if you don't succeed over there then please come over here and sort this place out.

Friday, January 18, 2008

It's the way yooh tell 'em

I despair for the future of the English language.

The latest violation comes from a friend of Jessica's, who sent a text message that include the phrase "have yooh got it?"

Now, this is just ridiculous on every level. Traditionally, the usage of you has simply been u in text messages. This is because it's quicker and saves space to represent a word that, when pronounced, is merely a single letter. All well and good.

But, to make the word longer - including a double-character which takes far longer on a phone keypad than two different characters because of the wait for the cursor to move on - is just completely pointless and unforgivable.

It is parents' evening soon. I shall bring it up there. Incidentally, what would be the correct way of using the apostrophe in this case? My thoughts are that it is as I have written it, with the apostrophe at the end, because it is surely plural possessive? They are implying many parents and that it is their evening. Moving the apostrophe to before the s would imply a single parent. If the entire evening is being held for the benefit of one parent from the hundreds who have children at the school, that would seem a horrendous waste of resources. And if we were to remove the apostrophe altogether, surely that would imply many parents but then the evening would not be properly possessed? So why do I never see it written this way?

Thursday, January 17, 2008

Flying along

I may have found a solution to my holiday flight woes, and it's delightfully simple: Fly somewhere else.

By this I mean fly somewhere else nearby (using "nearby" in the American rather than English geographical sense) and drive. This seems to be a lot cheaper.

For instance, we could fly to Miami for a total of £500 less. It's then a mere 3 or 4 hour drive to Orlando.

Or, we could fly to Atlanta for about £800 less. It's a longer drive - 7 or 8 hours - but a bigger saving. Although if we did that I think we'd go a day earlier, stay overnight somewhere in Atlanta (this will not be expensive) and then drive the next day. And at least we'd get to see a bit more of America, albeit mostly Interstates.

For saving £800 I think I'll happily do an 8 hour drive - it's like being paid £100 per hour to drive there (Ok, £50 per hour including the return journey but still rather worthwhile). The law of diminishing returns does kick in though, as I'd save £500 for a 4 hour Miami drive, compared to £800 for an 8 hour Atlanta drive, meaning that in terms of pounds per hour Miami wins out, but still the overall saving is obviously bigger.

I've also found that rather then renting a GPS over there, I can take my TomTom and buy a US map, which conveniently TomTom have got on offer at 50% off at the moment. That should also save a few pounds. Or dollars. Whatever.

I'll still gladly take any offers of financial support though. This will be by far the most expensive holiday we've been on. The last big holiday we did was to Malaysia and Thailand for three weeks. There was only three of us then, and we stayed with Saff in Malaysia so didn't have any accomodation bills there, and we could use her car. When we went on our road-trip to Thailand, we didn't pay more than about £10 per night for a hotel, except once or twice. So after the flights all we needed was spending money, and stuff is cheap out there. This time we need 4 flights, car hire, accomodation, theme park entry and spending money. Funny how the "exciting, adventurous, exotic" holiday cost about half of what the "normal touristy" holiday will cost. And it was 3 weeks, not 2.

Monday, January 14, 2008

How much??

Holidays are an expensive business.

We're going to Florida this year for our holidays, and it's turning into a rather expensive exercise. We've booked a villa via a colleague of Ele's at a reasonable (but not brilliant) cost; we could get a package flight + hotel for far less, but would be cramped into a single hotel room for 2 weeks.

Then there is the theme park entry. I've not got the exact prices, but the going rate seems to be one arm and one leg per person for entry to Disneyland. For some reason you can buy a 7-day pass. Why would you want to goto Disneyland every day for a week? Or even if it doesn't have to be consecutive days, why would you want to go that many times? Even if it's too much to do in one, two or three days, can't you find something better to do than standing in huge queues all day for 5 minutes on a ride? Certainly we'll go to Disney and, I expect to a couple of the others like Universal Studios, but I'm not spending my entire holiday in them. The only must-see on my list is the Kennedy Space Center, actually. If there happens to be a shuttle launch whilst I'm there I'll be as happy as - well - a kid going to Disneyland, I suppose. I am, of course, assuming there are other things to do in America. I may well be wrong.

But it's the flights that are doing me in. I had assumed that I could use my collection of airmiles to help soften the cost a bit. Indeed, a month or two ago, that seemed to be the case. Then I got some post from them about how they've simplified things (always - ALWAYS - a bad sign). And now I can't pay part-cash, part-miles for the flights I wanted. The option simply isn't there. I can fly two weeks later - and get a really really good deal like this - but Jess would be back at school by then and that wouldn't be allowed. Missing 2 days of school to save the parents thousands of pounds is not important to them, even if all they will learn on those 2 days is how to claim benefits, speak Polish and how to upload happy-slapping videos.
So, we're having to look around to pay full price. The Virgin Atlantic website helpfully gives you a "fare breakdown", so I clicked on it. It then tells me the price of £811.50 is made up of £633, plus £178.50 in "Taxes, fees, charges & surcharges". Hardly a breakdown, is it? What charges? What taxes? What surcharges? What fees? Why is a fee different from a charge? Why is a charge different from a surcharge? Why does the whole lot come to nearly 180 bloody pounds? I bet a lot of it goes to various governments, and some of it is fuel costs. For some reason airlines seem to think that if the price of their (seriously subsidised) aviation fuel goes up that they can charge us more. Bus drivers don't demand you stick 10p in a jar when you wave your Oyster card at them when you get on a bus, so I don't see why airlines need to do it.

So now we're looking at about £3000 for flights (instead of half that), plus the villa, plus a hire car (not looked at that yet but I think it's fairly cheap), plus passport renewal for me and a passport for Joe, plus multiple limbs for theme park entries.

Can anyone spare a few quid?

Monday, January 07, 2008

Obligatory holiday blog

Ok, so here is the obligatory Christmas/New Year blog. It's not very exciting, but nevertheless, here it is:

We both finished work on the 21st December, so we had something like 16 days off. Unfortunately, Ele was very ill for much of it.

Christmas Eve was spent doing less than normal, as we weren't doing a Christmas dinner the next day. We had a traditional take-away pizza and as we had already wrapped everything, had a fairly stress-free evening.

Christmas Day was quite hectic. Jess was too excited to sleep so came and lay on the end of our bed at some point. Ele then stretched her feet out and kicked her off onto the floor. When Joe woke up they all got to work on presents, and everyone had a wonderful time and liked what they got. I didn't have any suprise presents to give out this year, like last year's Wii, which of course we no longer have... After we finished we went to Ele's parents' house to do more presents, and then over to my parents' house to do even more and to have Christmas dinner. It's the first time we've been to my parents for Christmas in a few years, so I think they quite appreciated it.

Boxing Day didn't go according to plan. The plan was that Ele's mum and dad would drive to Peterborough to visit relatives in their car, as they were staying up there for a few days. I would drive up in our car carrying the four of us, plus Saff, Anise and Mick, as we were only visiting for the day. It started badly, then got worse. To begin with I didn't pay any attention to the route as I would have driven it, and just blindly followed the sat nav. This was not good as it took us up the M1 which had a) Roadworks and b) Accidents. Just as we cleared the last of the accidents, Anise piped up that she needed the loo. Of course, because of the stupid SPECS cameras I couldn't go above 50 for fear of points on my license, so I had to dwadle along until the roadworks came to an end. Then I could put my foot down a bit and get to Toddington services. Whilst we were there the phone rang, and it turns out Arthur & Chris had broken down at South Mimms services. And by broken down I mean the head-gasket had gone so they were going nowhere. So we drove back down to the M25 and went across to South Mimms to pick up Chris. Arthur had gone back with his car. We finally made it to Peterborough with 8 people in the car and had a nice afternoon. Saff and Anise decided to stay, so Mick did too, and then Jess also decided she wanted to stay. We weren't too keen on it as it was for a few days and we would have liked her home but she insisted so we relented. In the event, I think she got a bit bored after a couple of days! So after taking 8 people up, we came home just 3 of us.

The 27th we ended up driving to Peterborough again to drop Arthur off and bring Mick back home. And to take clothes for Saff, Anise & Jess. This didn't go too well either, as the M25 was completely solid all the way around and it took us ages.

For the next couple of days, Ele was ill and we didn't really do anything. On the 30th Mick went up to Peterborough again and brought back Chris, Saff, Anise and Jess. Arthur and the rest of the Peterborough contingent came on the 31st, and stayed with them for a few more days.

New Year's Eve we all went to a party at Ele's parents. My parents came too. It was a fun evening, although Ele still wasn't very well.

On New Year's Day we went into Sutton in the afternoon, and it was completely deserted. About half the shops were open but I've never seen it so empty. Since then we went into Sutton again, Croydon, Kingston and Bluewater. We've spent a fortune on car parks (and a fortune in the shops).

And now we're back at work. Boo. Because Arthur's car is so broken he's had to borrow mine for a while and we're having to juggle things around with me dropping Ele off at work, and him picking her up and so on.

On burglary related news, Ele has found some new rings to replace her stolen engagement and wedding ones. She went for a completely different design in the end, and it will never be the same as the original ones, but they are very nice and we both like them. We should get them within a week or so. The rest of the companies dealing with replacement goods (Jessops and PowerPlay) have not been in touch at all. Well, Jessops called on Christmas Eve then within about 10 seconds realised he had to get authorisation and hasn't been heard from since. Powerplay have not so much as made a phone call. Extremely poor service. I have asked the Loss Adjusters to chase them up but I don't know if they have or not. LMG (who were in charge of valuing and replacing the rings) were superb and sent a card through to cover the items within about 3 days. I'll chase the Loss Adjusters again tommorow, as the woman dealing with our claim wasn't available today. I want them to hurry up (Jessops especially) as I know they are giving us vouchers or some kind of store credit and I want to take advantage of the sale!