Monday 17 June 2013

Free tools are appreciated but bugs are annoying

This morning I was trying to fix a problem where paragraphs aren't saved when editing a page in Wordpress' visual editor. In the visual editor the page appears formatted correctly, but when you save or preview the page / post, the paragraph spacing is stripped out, resulting in extremely long blocks of text.

Searching, it seems that this is a common problem. One solution said to install the TinyMCE Advanced plugin. So I did this, and in the settings it has the following:

Stop removing the <p> and <br /> tags when saving and show them in the HTML editor. This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently. Also line breaks in the HTML editor would still affect the output, in particular do not use empty lines, line breaks inside HTML tags or multiple <br /> tags.

So, unfortunately this fix isn't that great for me. It does work in making it so that paragraphs and line breaks in the visual editor are saved. But the fact that it adds <br /> tags to new lines in HTML is the problem. In HTML (Text) view I want what I type to be saved without being manipulated by WP. Still, it is the best fix I have found so far.

If you're wondering why I would want to use the Visual and Text views when editing, I like to only use the text view. But this particular site is meant for use by other editors as well, and they are unlikely to want to learn HTML, and so will want to use the visual view.

Another problem I had was that whenever I uploaded a file (using WP's page editor interface, not via FTP), the file would be put into an old date folder. The date folder it would go into was based on the date that the page the file was being added to was originally created. So, if I created a page in Oct 2005, and then uploaded a new file to that page (using 'Add media'), the new file would be placed in /wp-content/uploads/2005/10/filename.ext.

Obviously, when you have a page where you're regularly replacing old 'media' with new 'media', the new files being put into the old date folder isn't great. It makes it look like the file might actually be really old rather than current. One solution to this is to not upload media via the page / post editing interface. This isn't great though, as it involves a number of extra steps, and also means that you must remember not to upload media when editing a page.

The other solution is simply to turn off the option Organize my uploads into month- and year-based folders in Settings > Media. I decided to go with this solution.

Quite a bit of the afternoon I played on Animal Crossing: A new leaf, which we received today. Unfortunately Billy had already been on it and bought the tools, so I couldn't do much other than shake trees and talk to people. I got stung by bees twice when shaking trees, but also found quite a few 100 bell coins.

As part of the replacement for yuicompressor (which is now deprecated), I tried setting up CSSMin today. It took me some time to get it working, mainly because I wasn't quite sure on the exact syntax to get it working from the command line. When I did get it working, I found that it had a bug where it only removes the start and end of comment blocks (/* and */), and not the actual comment content.

Obviously not ideal, since the content of the comment is then no longer a comment, and will mess up the CSS. (It won't validate and could possibly cause other problems depending on the comment content). I checked if this is a known issue, and it is: CSSMin: Comments not completely removed. The bug was opened in April 2012, so is over 1 year old.

I tried to see if there were any recommended alternatives to CSSMin, but it seems that CSSMin is the industry standard. So until that bug is fixed, I will just have to stick with yuicompressor for my CSS minification.

Sunday 16 June 2013

Blogger is broken

The last few days I have been working on an article for my vis uv ir flower photos blog about the equipment used and how the photos are taken. But then yesterday when I finished it, I found that blogger refuses to link to it (the blog is on blogger). I published the page, and it is listed in the published pages, and I can edit it. But if you click the 'View' link, it just goes to the front page of the blog. Similarly, on the blog there is a link to the page in the top nav, but the link just points to the front page of the blog.

I did use the 'Send feedback' link (at the bottom right of every page in blogger dashboard) to let Blogger know of the problem, but given big G's track record on bug fixing it seems unlikely it will ever get fixed. If you check the blogger issues blog, you'll find lots of posts going quite far back from Google with notifications of issues with blogger they are aware of. Most of these posts say that they'll be updated with more info or when the issue has been resolved. Of course, they haven't been updated.

So today I tried various things to fix the problem. I tried editing the title (I thought maybe it was too long). I tried reverting to draft, then publishing again. I tried deleting the page and adding it again as a new page. This last technique thankfully worked.

Thursday 13 June 2013

Soup

Doing some research today I came across a page in Russian, which I used Google translate to translate into English. Google translate isn't great, but the resulting text indicates that the original Russian was probably a nonsensical spam post anyway. However, I think the resultant text sounds like the kind of poem that would win awards and people would try to derive the hidden meaning from the words:

Spiritual stone knocks spider. Triumphantly to move and dig performance because of a strained metal values. Brunette busy attracted the presence of residues, but the cat vomited music. Normally remember to self-esteem specific outfit. The remains of the ill-fated encounter as deep satisfaction to the selection. Drag delusional coat on criminal classes. Open air and leaned robot walked in the galaxy. A solid collection of stamps for Small assumptions. Any excitement darkened roaring compositions.

I spent most of the day uploading a few pics to various photo sharing websites. In the evening I watched the final episode of this year's Springwatch as well.

Monday 10 June 2013

Photo wing

I spent nearly all day today taking flower photos, and managed to get 5 shots done. When I say 'done', they still need descriptions, tags etc. adding, processing, and then uploading to the web. So, still a lot of work to do until they are really 'done'.

In the garden we had a family of Great Tits today. We quite often see just one adult on the peaunuts, so it was nice to see that they'd been raising a family and succeeded. I haven't seen any finches in our back garden or long tailed tits yet this year though. I haven't heard the cuckoo calling across the fields either.

When I tried adding some metadata to some of the pics I took in Bridge, it came up with the error message There was an error writing metadata to _DIR6044.RAF for each of the files I was trying to add metadata to. This error doesn't really make sense as Bridge doesn't write metadata to RAW files (RAF is the type of RAW file my camera takes). Instead, it writes the metadata to sidecar .xmp files. So it seems like Bridge was trying to write metadata to the RAW file (which it can't do) instead of the xmp file.

I did a quick search but the info seemed to be relating to this error with JPG files rather than RAW files. As a possible fix, I tried clearing Bridge's cache for the folder (Tools > Cache > Purge cache for folder N...). After Bridge had rebuilt the cache for the folder, then I could successfully add metadata to the files. (You can see black borders round the image thumbnails when the cache is purged, as Bridge rebuilds the cache the borders disappear. When all images have been cached it should be safe to try adding metadata again).

Saturday 8 June 2013

Blackbirds no more

This morning I heard the blackbirds making their clucking noise like they were annoyed, so I went out to see what was happening. I didn't see any magpies or crows, but the blackbirds were flying about quite a bit and very noisy. I waited for a bit, then Mrs Blackbird flew back towards the nest.

I went to see what she was doing, and she kept poking her beak down into the nest (I can't actually see inside the nest). Then after a bit she flew off with a pink blob, presumably a dead baby. I came back inside, and then the blackbird started up their alarm call again and I saw a Magpie fly off.

Clare came in shortly after and said she'd seen a Crow and Magpie fighting over a pink-brown blob. So it seems like the blackbird nest is probably finished. When I thought I was feeding a blackbird chick by proxy yesterday, I was actually feeding a Magpie chick by proxy.

Friday 7 June 2013

Feeding blackbird chicks by proxy

This morning I made some Gingerbread scones.

I went in the garden for a bit and Mr Blackbird looked at me like he wanted me to give him some food. So I gave him some sultanas, but he put them in his beak rather than eating them. Then he flew to the nest and put them in the nest. (I can only see up into the nest, so I can't actually see the chicks he was feeding - it looks like he is putting them in the nest, but presumably he is putting them in chick's mouths).

The sultanas were quite dried out, so I didn't think they were very suitable for baby food really. So I put sultanas in a bowl of water and heated them up in the microwave to help them puff up. Then later in the day (several times) I fed these to the blackbirds.

I also tried feeding Mr Blackbird a worm, but he didn't want it. Mrs Blackbird isn't as tame as Mr, and she sometimes wouldn't eat the sultanas I threw for her. Mr Blackbird isn't tame enough to eat out of my hand yet, but he will come within a few metres to pick up food.

I also saw my first Sparrow chicks of this year yesterday. And some mating red damselflies today. No dragonflies yet though.

In the afternoon I tried taking some flower photos. Unfortunately it was quite windy, making it difficult.

In the evening I played on Civ IV.

Thursday 6 June 2013

Going through emails

Most of this morning I was just going through my emails. I had an email from Zinio, which said:

It's time to renew your subscription to Popular Photography. And what a great time it is - you can renew today for $10.49 (30% off the standard Zinio Rate) as part of our Dads & Grads Sale.

Act now and you'll get one year of Popular Photography at a great savings.

I was pretty sure that my subscription was not due for renewal, so I logged into my Zinio account. Indeed, I have 58 issues remaining on my subscription. Since it's a monthly magazine, that means I have 4 years and 10 months before my subscription needs renewing. Silly Zinio.

For my photo tips website I sometimes use articles from articlesbase and ezine articles. Most of the articles on them are absolute rubbish, but there are a few well written articles with decent content that are worth republishing. Some of the older articles have links to websites that no longer exist. The terms and conditions of articlesbase say that you may not modify the article at all when republishing it, so I contacted their support about the broken links issue.

My message:

Is it okay to remove links from an article when republishing it if those links no longer work? There seems to be no point in keeping links in if they go to a website that no longer exists, it would just be confusing for readers.

Their reply:

No.You must keep the full author's credit with its respective links, a link to the article on our site, keep the article and author's credit intact and keep all link active.

You cannot edit the article in any way.

What a strange policy!