Daily Archives: Sunday, 23rd Dec 2012

Oh dearie me, I’ve written a megaword

I’ve been expecting this to happen sooner rather than later, and it seems that contact form fixage post sent me over the edge. Yes, according to the General Stats plugin, I have now written over one million words on this site, or, as I’m inclined to call it, One Megaword.

Megaword

Megaword

According to various sources, that’s more than twice the length of The Lord of the Rings, though shorter than Neal Stephenson’s Baroque Cycle, which I need to mutter about at some point.

Or to put it another way, if I’d put all those words into a more coherent form, I might have written a few novels.

Another little fix

If you ever chanced to look at my Contact form, you might have noticed that it looked a bit, well, untidy. Something like this, in fact:

Bad

Bad

The lining up of the labels to the boxes was distinctly off, and the box for comments was a wee bit narrow. Well, it was ridiculously narrow, and I really wanted to fix that.

The form is a module of the generally very useful Jetpack plugin, which does lots of clever things, but seemed to be having a bit of bother with the form for some reason. Well, I did a bit of looking, and found that the Jetpack folder contains a modules folder, which in turn contains a contact-form folder. Looking inside that revealed a css folder, which contained a file called grunion.css. The name reveals the contact form’s origin as the Grunion Contact Form plugin, which I used to use before Jetpack came along.

Looking in that file revealed some quite sensible CSS that if it was being applied, would almost certainly make the contact form look a lot better. Now I could have spent some time trying to work out why the plugin wasn’t inserting the CSS, but that seemed like far too much work. Instead, I copied the entire contents of the file and pasted them into the Custom CSS module of Jetpack. That’s another really nice feature – if you’ve got some CSS you always want to use, even when you change themes, this is a great place to put it. Though it’s worth noting that when you change themes, you may need to revert to a previous revision of the CSS you’ve entered, as it appears to blank it when the theme changes.

Anyway, once I’d pasted in the CSS and saved the changes, my contact form looked like this:

Good

Good

And that, I think, is a lot better. Now if I could just fix that title problem, I’d be really happy….

1,227 QI Facts To Blow Your Socks Off

This is another fun book, which is currently available in Kindle form for just 20p, which may account for how well it’s been selling.

After an introduction by compliers John Lloyd, John Mitchinson and James Harkin which talks in a quite engaging way about the great Michael Faraday, they get straight on with a nicely random collection of facts. Well, I presume they’re facts. From the limited selection I’ve read so far, they all seem plausible enough, even the more bizarre ones. Well, come to think of it, I have my doubts about this one:

The center of the galaxy tastes like raspberries.

Err, what? But this one sounds both believable and alarming:

10% of all the photographs in the world were taken in the last 12 months.

And I’ve heard something like this one before:

In 1894, The Times estimated that by 1950 London would be nine feet deep in horse manure.

Which is as fine an example as I’ve ever seen of how not to predict the future. And there are loads more to enjoy, question, say “what??!?!?!?!?” to and all the usual QI type things. It probably helps if you imagine Stephen Fry reading them out.

A Billion Jokes (Volume 1) – Peter Serafinowicz

I think it’s important to emphasise that this is volume one, and therefore doesn’t contain the whole billion jokes that a casual glance at the title might lead you to think. There again, if you’re the kind of person who needs me to emphasise that, you’re probably not the target market for this book anyway, so you’d probably be better off looking at some of my pictures rather than continuing to read this post.

Still here? Then I’ll carry on. What this book does contain is a load of mostly one-liners, which are not too far away from the kind of thing you might encounter if you follow Peter Serafinovicz’s Twitter feed. Many are accompanied by what look like authentic 19th century engravings, but may well not be.

It’s probably in order to quote a few examples to give you the general idea:

I hope numbers never disappear. Think of the aftermath.

Or perhaps you’d prefer

Lif is too short.

No? How about

DINNER PARTY ERROR: The host could not be found. Also, there was no response from the server.

That should be enough[1] to give you the general idea. I enjoyed it, anyway.

[1] Waits for shouts of “more than enough” from the Loch Ness Monster and herd of unicorns regular readers.

Spell it Out – David Crystal

Subtitled The Singular Story of English Spelling, this is a lovely little book which covers its subject very well indeed. David Crystal is a well-known expert on the English language, and it’s good to see him writing something nicely accessible to the general reader.

He starts, sensibly enough with how scholars first tried to represent the sounds of Anglo-Saxon in the Roman alphabet, and moves on through scribes trying to standardise spelling, which is where some of the seeming oddities of our language come from.

Moving forward, you can learn why words light night and fright have that odd letter g lurking in them, and much more. It might not improve your actual spelling, but at least it can give you an understanding of how words came to be formed as they are, and to understand that English isn’t quite as irregular as it sometimes seems. Good stuff, comes with a suitably long index.

Stuff Report – 23 December 2012

As it’s been a somewhat drier day today, a short walk happened.

I took this picture of a local chapel on a previous visit to Pencoed, when the weather was much more pleasant:

Chapel

Chapel

Camera: FinePix X100
Aperture: ƒ/8
Shutter speed: 1/800s
Focal length: 23mm
ISO: 400
Taken: 30 November, 2012
Location: 51° 31.2363′ 0″ N 3° 30.1595′ 0″ W

They took my title away!

Update: I managed to work out a solution for this. See this later post.

No, I haven’t had some honour that I never had removed, that would be silly. And I haven’t been cast out of the House of Lords, never having been a member, strange as that may seem.[1] No, what I’m talking about is the Title attribute of the images I post here with monotonous regularity every day[2].

You might recall from my series of EXIF tales that I’d spent quite a lot of time tweaking some code to get the titles created in Lightroom to populate all the relevant boxes when I upload the images to WordPress. This all worked nicely, but after the upgrade to WordPress 3.5, I began to notice that the titles were going away. They were there in the media thingy, but images inserted into posts had lost the title attribute.

So what’s the problem with that? Well, the first thing is that most browsers put the contents of the title attribute in the tooltip thingy that you see when your mouse hovers over the image. Losing that wouldn’t be a big deal, really, but I found that in a rather random way, the title of the post was showing up when hovering over images, which looked a wee bit wrong. Now this might have been related to the problem I was having with a lightbox plugin, but it was still annoying.

A bit of searching explained all. For reasons that make sense to some people (but not to me), from WordPress 3.5 onward, the title attribute is not inserted when an image is added to a post. If you want the title attribute, then after inserting your image, you have to click the image edit button, then either type in a title, or copy and paste the alt or caption attributes into the title box:

Title

Title

This is a wee bit of extra work for every image I insert, which is mildly annoying. I’ve started investigating ways of automating this – it should be a relatively simple bit of programming, but it’ll probably take me a while to get my head around it. A quick and dirty method would be to edit the actual core WordPress files, but I agree with the general advice that doing that is not a Good Thing. It should be plugin territory, and with any luck someone more code-oriented than I am will do the work first.

Update 2: I couldn’t wait, so created the plugin myself.

WordPress Trac Ticket on the subject

WordPress Support Topic

[1] Or not
[2] Except when I don’t

The Case of the Duplicated Images

If you’ve been browsing this site lately, you might have noticed some oddness. Oh, OK. You might have noticed some more odd things than normal. Oh, alright, more odd things than normal for here.

In some posts with two or more pictures, like the recent Christmas tree one, the second image was appearing above the first, with a mangled caption, rather like this:

Oddness

Oddness

A closer view shows just how odd it was:

Even odder

Even odder

When I belatedly noticed this last night, I spent some time wondering what could be causing it. At first, I thought I’d done Something Weird in the affected posts, so I went back and edited one, removing the images, putting them back in, muttering a great deal as I went. But I was soon convinced that there was noting out of the ordinary in the posts, so it had to be some bit of code that affects how posts are displayed the the legions of regular readers[1]. Knowing that I have the coding skills of an intoxicated lemur[2], my first suspect was my EXIF displaying stuff. So, I disabled all that, and was pleasantly surprised to find it made no difference. While I still had a problem, it looked like it wasn’t my fault, which is much the best kind of problem to have.

I then tried switching to the default Twenty Twelve theme, in case one of the changes in my child theme were breaking it. And woo, hoo, etc, that didn’t make any difference either.

The next suspect was the Lightbox Plus plugin – that’s the thingy that makes the pictures zoom to full screen when you click on them. Sure enough, when I disabled it, the extra pictures went away. But that wasn’t a fix as such – I like having the zoomy pictures, so I needed another solution.

I did some fiddling on my test site[3] and found that there was a setting labelled Use WP Caption for LBP Caption that appeared to be the culprit. What this does is make sure that the zoomy picture window shows your carefully crafted caption for each image. Unfortunately, in my case, it was doing something a bit odd involving inserting an image tag and a few other bits into the caption, causing the messy duplication thingy.

Having checked for updates, and found that the plugin site shows it’s only listed as compatible up to WordPress 3.3.2, and the last version was released in January, I decided to look for another lightbox plugin.

There are a few of these in the WordPress plugin directory, so it was a matter of picking some recently updated ones and seeing how they worked. The first one looked OK, but stopped the nifty Jetpack Carousel feature working on my galleries, so that was no good for me. The next one I tried was Slenderbox, one of the newest releases. That appears to be working nicely without any obvious breakage.

Let me know if you do see any oddness. Other than the usual kind, that is.

[1] Or other such mythical beings
[2] Actually, I’ve no idea about how good lemurs are at coding while sober, never mind after a drink or three, but it seemed a suitable comparison
[3] Hint: if you’re in the habit of messing around with your site, get yourself another one which you can safely break. It’s much less traumatic than finding you’ve made your live site stop working…