I was helping a friend get the login part of their site working – including the setting of user variable cookies. The cookies wouldn’t set.

Brick wall bang, bang, bang (my head you understand).

“I’m not sending anything to the browser before calling the cookies!” Frantic checking of all includes for anything happening.

Brick wall bang, bang, bang!

Never had this trouble before. Google. Add to code:

if (!setcookie("example","value")) {
echo "Cookie not set";
}

You’ve guessed it “Cookie not set” go to manual page for setcookie() and the magic words including whitespace!

The page source reveals:

Cookie not set

Now we know why this has never happened before – my friend is addicted to white space in their code. I remove any blank lines in mine. I removed the lot and the cookies are happy! Told the friend that if they didn’t want any cookies to set just to put lots of blank spaces back into their code!

Job done but sore head!

Advertisements

…every now and then it makes you want to scream. Take commenting out code. I always find the hash # sign the easiest to use (saves having to remember which way round to get the star and slash let alone which slash it is in the first place). Search your Mac keyboard – can you find it? If you can you’ve not got the same one I have! Luckily I can now remember it; Alt 3. Yippy!

Then today I was having trouble with a payment screen and wanted to email a screen print to their support people. Print Screen, where is it? It tells its own story when google’s top autofill for “print ” is “print screen mac”! Though feel free to feel lucky – the top choice link was excellent and not only gives you screen capture (cmd shift 3) but the ability to capture a small section window using mouse drag (cmd shift 4) – this is thee one I used – but also claims you can choose a window to capture if you hit the space bar after the cmd shift 4 technique! Job done!

It’s like this – you’ve had this HP Laserjet 4M plus (insert your model here) networked for years and you’ve been printing with no problems in all that time until you buy a Mac. Now suddenly there are two copies of everything being spewed out and mountains of wasted paper.

Don’t go looking through the printer menus on the Mac it isn’t there. Go to your printer, take it off line. Hit the menu button until it says Printing Menu. Hit Item until it says Copies=2. Hit shift and +/- button until it says Copies=1 then hit enter. Put it back on line and if you don’t have an uncle called Bob then you should!

I was trying to write a MySQL stored procedure today that was crying out for the is_numeric function – the one that doesn’t exist. I wanted to select two different things depending on whether the value in a field was numeric or not.

Luckily trying to convert a non integer into an integer returns a 0 (at least in the version I am running it does). Hence testing for CONVERT(field_value,SIGNED INTEGER)>0 is pretty close to what I’d expect from the missing is_numeric(field_value). In my case it is good enough as I know that I am dealing with integers not decimals, and none of them are 0!

Job done!

NB: MySQL version 5.0.22.

What have you got me into Mark – how can you write eight random things you wouldn’t normally write on your blog on a blog as random as this? Well at least I can manage the random part OK!

1. My first full peel was of Superlative Surprise Major at Ss Peter and Paul Ewhurst, Surrey.

2. I’ve read Pride and Prejudice (Jane Austin) at least once a year since my Godfather gave me a copy in 1982 – I’d read my Mother’s copy a “Utility” paperback before that.

3. I hate playing Monopoly – and I have trouble spelling it too!

4. I know how to spell forward but have a tendency to type it without the first r.

5. I have an almost twelve year old black and white cat call Minstrel who isn’t as fat as he used to be – no where near as fat as the cat from Norway who got stuck in the doorway.

6. I adore Flanders and Swann, and Gilbert and Sulivan and can very well spot an allusion in the dusk with the light behind it.

7. I use Oxford commas sparingly; sometimes they are necessary to avoid confusion.

8. Recondite is the first word fully defined on page 922 of the Chambers Twentieth Century Dictionary 1959 revision, 1966 impression – and if that isn’t hidden: obscure: abstruse: profound. Don’t you just love a word for which the meaning is obscure?

We were ringing on five tonight as our tenor bell isn’t all that securely attached to its headstock! Just two bolts and those a bit wobbly and we weren’t going to ring it up to check the bolts inside!

Later at the pub we were thinking of thought provoking questions for the Year 2 children on their new portal (e.g. “What if vegetables had legs?”) – most of us have an interest in education (some teachers, some governors, some trainers and some mothers or all of the above!). I’m surprised one of the questions wasn’t “What if the Tenor had come unbolted while we were ringing?” but perhaps we had already covered that. The collapse of the Saxon arch was the most extreme consequence we came up with (and we were avoiding anything gruesome) the trajectory going through the tower wall and into the chancel roof…! That’s the arch described by Christopher Winn in I never knew that about England thus:

…three supreme Saxon arches built over 1000 years ago when Sussex was remote and savage. The chancel arch is the LARGEST SAXON ARCH SURVIVING IN BRITAIN, possibly the world, and an incomparably beautiful masterpiece.

Chances are of course that it would have gone the other way and taken out the 5 or just landed on the ceiling (which might bear its weight depending on the speed of fall) but that was less imaginative.

I’ve seen Kestrels before, and what might have been a Sparrowhawk having a feast in our back garden. Yesterday we were on the M40 and I saw several birds of prey. There was one Kestrel but the rest were larger, higher and a completely different shape – with a V shaped tail like some whales. I thought surely they can only be Kites that must be how they got their name.

Then I looked in my bird book only to find that it (published in 1981) has them only in Wales – so a long way from the M40. But the picture was the only one that fitted! So google for “Birds of Prey sighted in Oxfordshire M40” and lo and behold Red Kite on Wikipedia. They are frequently sighted over the M40 between Oxford and Wycombe – exactly where I saw them!