Thursday 28 November 2013

Looking for pics

I spent all of today looking for photos to illustrate a couple of articles I'd already written. Seems amazing it can take so long, but it did.

In the evening I also went on Animal Crossing New Leaf as it was Harvest Festival.

Tuesday 26 November 2013

Getting annoyed by IE

Lately I have still been working on my currency conversion plugin for wordpress. I'm slowly getting there with it. Today I was testing in IE8, which was extremely annoying.

The first issue was that clearing cache via the IE developer toolbar didn't clear the cache (both the for domain and general clear cache options). After clearing the cache I'd reload the page, but the js I was trying to debug would still be the cached js file. (The js was included in an iframe so refreshing the enclosing page doesn't force a fresh fetch of the iframe's content).

To actually clear the cache, I had to go to Tools > Delete Browsing History... in IE's menu. That did work. But it does take an extra step compared to (not) clearing through the Developer's toolbar.

Next, the ability to highlight elements on the page by clicking on the elements in the DOM view didn't work. Nor did the ability to click an element on the page to select it in the DOM.

Finally I did manage to debug the issue. Whether it was actually due to IE8 or an issue with TinyMCE in IE8 I'm not sure. But I don't think it's much of a stretch to say that IE was probably causing the problem. Luckily I managed to work around it quite easily.

The issue was that I was dealing with a TinyMCE pop up window, and adding a function to be called on init, like so:

tinyMCEPopup.onInit.add(myfunc, scope);

This code was wrapped in a jQuery document ready function, and while the code would be run, the 'myfunc' added as an init callback would never be executed. Removing the jQuery document.ready wrapper fixed the problem. So it seems that in IE jQuery document ready only triggers after the tinyMCEPopup init has already triggered. And so the init callback is only added after init has already fired.

I didn't have this problem in Chrome or Firefox, but thankfully the code modified for IE compatibility works in those too.

Another issue I've had with IE is that when inserting text into WP's editor using a quicktag, the inserted text would be selected (though not highlighted, so you can't tell it's selected). So if you used a quicktag to insert a tag, then carried on typing, the first character that you type would replace the selected tag you'd just inserted. I had tried for quite a while to find how to resolve this issue with no result.

However, today I found a way round it that seems to work (in IE8 at least). It is just a case of calling

var selTextRange = document.selection.createRange();
selTextRange.text=replacement;

To create a text range based on the current selection and then replace this with your tag. Then:

selTextRange.collapse(false);
selTextRange.select();

To deselect and move the caret to end of the selection.

Friday 22 November 2013

Igloos

I spent all of today just getting my website updates ready for the weekend.

For my photo tips website article I already had the article written. I already had the photos taken to illustrate it as well (minus one, which I had to search out a suitable flickr photo for). But it still managed to take me most of the morning and quite a bit of the morning to get the images ready for the article and insert them into the article.

Sunday 17 November 2013

Illing again

Lately I've been doing more work on my wordpress plugin, but hit a couple of snags. So I've decided to take a break from that for a bit and read Sitepoint's Wordpress Anthology. A lot of my time writing the plugin is spent trying to find out how to do something. So I'm hoping that by reading up on Wordpress now, it will save me time in the future. Of course, there's no guarantee that the book will cover anything I didn't already know / couldn't find out easily though.

So far I've read the first couple of chapters, which are just very basic. I haven't really learnt anything useful, though I did learn that wordpress has a links section (similar to pages and posts). I can't say I'd ever really noticed it before. Probably because it's not useful to me.

I've also had a bad cold the last few days. It is very annoying because the weather on Friday was very nice and the trees are very nice and autumnal. But I couldn't go out because I was feeling too ill (had a bad headache) with my cold. (Plus I probably would have to have taken a roll of tissues and bin bag with me for my snotty nose).

A couple of things I've been watching on eBay I might as well mention here. A pair of (very slightly used) Mammut T Aenergy Mens GTX Walking Boots sold for £93.50 + £7.99 P&P. Yet a quick Google search shows them for sale new from HillAndDaleOutdoors.co.uk for £112.00 with free postage. About a tenner more, but I'd rather pay that for a new pair.

Another item was a lens titled 'Lens Cerco 1,5/9cm ????'. The only part of the description relating to the actual lens (the rest was about shipping and VAT) was:

Dimensions 86x68x41mm Lens not iris Glass .No fungus,separation,haze minimal scratches .

Now the lens looks like those pictured in the header image on this page of Cerco's website: DEFENCE OPTRONICS. Around the centre of the lens barrel it has a large cog. I don't know what mount it has, possibly M42? I did bid for the lens, but not much since I don't know anything about the lens, e.g. if it can be used with a camera. I ended up getting outbid by a couple of dollars and it sold for $35.25 + $33 P&P (plus VAT if the buyer was in the EU). So someone possibly got a very good deal.

Wednesday 13 November 2013

Cleaning and tidying

This morning I did some Korean learning, and processed a photo I took last night. Unfortunately the photo doesn't look great when viewed at 100% as I had to mess around with my other camera on the same tripod during the 'exposure', which created a bit of movement. My D200 ran through each of its fully charged batteries in about 10 minutes of exposure time last night, so it seems I am unable to do night photography with that camera now.

I could buy a new battery for it, but I expect a 'new' battery would actually be a few years old. Would it be any better than my current batteries? And I don't really use the D200 much now anyway.

I spent quite a bit of the rest of the morning and part of the afternoon trying to clean my camera sensors. My 5D2 seems to have a sensor that is impossible to clean. Eventually I managed to get it clean enough so there are just a couple of dust spots near the edge of the sensor. And they aren't really visible unless you look for them (or apply a strong curve tone).

My other cameras were all relatively dust free, so I didn't clean their sensors at all. No point in trying to clean them and risking them ending up with more dust spots.

After that I did some tidying and vacuuming.

On HFM Moley mentioned about Facebook doing something with passwords due to the Adobe hack, so I looked up what he was on about. I found this article on the BBC Website: Facebook protects users following Adobe hack attack. The article is a bit unclear as it states:

Hashing involves using an algorithm to convert a plaintext password into an unrecognisable string of characters. Utilising the tool means a service does not need to keep a record of the password in its original form.

Although the process is designed to be irreversible - meaning a hacker should not be able to reverse-engineer the technique to expose the credentials - it does have the same effect each time, meaning the same original entry would always result in the same hashed code.

Facebook took advantage of this to scan through its own records to see which of its users' hashed passwords matched those of Adobe's and had overlapping email addresses.

If Facebook was comparing hashed passwords from Adobe with the hashed passwords on their own system, that would indicate that both Facebook and Adobe were using the same hashing algorithm and not using any salt. That would be quite a security lapse on the parts of Facebook and Adobe. However, I don't think this is actually the case. I think the wording of the article is just a bit confusing, since earlier in the article it states:

It works by taking the Adobe passwords that third-party researchers had managed to unencrypt and running them through the "hashing" code used by Facebook to protect its own log-ins.

Thursday 7 November 2013

Stats checking

This morning I had an email from Facebook to say that they were removing a privacy setting to do with timelines, so I thought I had better check my privacy settings. There is a useful 'view your profile as... ' option, so I used that and found various stuff showing up that I didn't want to be public. So I went through the privacy settings to change that.

But one thing that was very difficult to change was my profile picture. Your profile picture is always public, and you can't change the privacy setting for it. If you click on the profile picture there is a remove option, but clicking this, and then clicking OK on the 'are you sure?' message didn't do anything. I did try multiple times with no success. The page reloads when you click OK, but the profile image is not removed.

So, I uploaded a blank image instead. That worked. Then I tried removing my new profile image, and this did work - I now have a default facebook profile image that looks a bit like Tintin.

Today I was checking my web stats again. One thing I noticed when looking at 404s was that I have an image named like "640px-image.jpg". And I had received requests for non-existing images like "1280px-image.jpg". There were a number of different requests, all for this same file, but with the pixel size at the start of the filename changed to various amounts, all the way up to 7680px. I checked the logs, and the requests were all one after another from the same 'user'. The requests had a proper UA string (Chrome) though, so it didn't appear to be a bot.

In Bing Webmaster Tools, one of my sites only had two URLs listed. So I thought I would have to try and submit the URLs manually if Bingbot couldn't spider the site / read the sitemap. But I couldn't see any way to submit URLs manually. I searched the web and found their help (Submit URLs to Bing), which says you can use The Submit URLs feature in the Configure My Site section in Bing Webmaster Tools. Well, that would be helpful, but I didn't have a Submit URLs feature in the Configure My Site section in Bing Webmaster Tools.


The Configure My Site section in Bing Webmaster Tools - note there is no Submit URLs feature

Bing Webmaster Tools help, which says you can use The Submit URLs feature in the Configure My Site section in Bing Webmaster Tools. What looks like a form in the page is just an image of a form.

Now, in another site I did have the Submit URLs option in the menu. Back on my problem site, I tried Fetch as BingBot on one of the pages, and received a message that I didn't have permission to do that. I checked the verify site details, and it was listed as verified. The meta code was in the page I was trying to fetch, and the value was the same as the one given in Bing Webmaster tools to verify the site. So it seems that Bing just thinks most of the pages on this site don't contain the verification meta tag, even though they do.

Honestly, with all the other bugs and lack of information in Bing Webmaster Tools, it's very difficult to pull out useful information from it. I did manage to get one bit of useful info from it though, some of my sites were missing meta description tags, which was just a case of changing a setting in the Yoast SEO plugin to fix.

And of course, Google Webmaster Tools, while much better than Bings, is hardly perfect. It seems that they're having issues with structured data again at the moment. The structured data tool will parse a page correctly, but Google's internal indexing processes will not, resulting in the amount of pages with structured data being reported dropping to zero (or near zero). They fixed this before, so I hope they'll fix it again.

So, I didn't get any work on my wordpress plugin done today. The other thing (not) worth mentioning that I did today was to go on a walk. We had some not rainy weather, but unfortunately it wasn't really suitable for photos as the sun was behind clouds and set behind a bank of cloud.

Wednesday 6 November 2013

Were depressing

Today I spent quite a bit of time working on my ebay wordpress plugin. I was trying to the EPN custom Banner in a page, but loading it after the page had loaded. As it is the custom Banner code relies on document.write, which delays the rest of the page loading until all the javascript has been downloaded, parsed, and executed.

The actual javascript file being called contained just one reference to document.write, so I was hoping that I could just pull the file contents in as a string (rather than js), strip off the document.write, and then insert the contents of the document.write into the page as HTML.

Unfortunately Same Origin Policy meant that this was impossible. I tried a large number of different things, even looking at external services such as YQL. But I couldn't work out anything that would work. One solution that should work, and I didn't try, was using the host site as a proxy. Possibly I will try that in the future.

Ebay had rejected my request to use "eBay" as part of the plugin name, so I spent quite a while renaming all the files, classes, database records etc. to do with the plugin. When this was done, I had another plugin that the eBay plugin partly relied on. So I decided to work on that and make sure that was working before I did any more work on the eBay plugin.

The other plugin is a lot smaller and simpler in scope, so I should hopefully be able to have the plugin up and running properly a lot quicker than it will take to finish off the ebay plugin. I did still have quite a few issues with this plugin that I was debugging today, and that will have to continue tomorrow now.

Tuesday 5 November 2013

Having a headache and TinyMCE plugging

I spent quite a bit of today in bed with a bad headache.

I also started work on a javascript version of my ebay listings plugin for wordpress. The first thing I wanted to do was to add a button to the editor screen for generating the shortcode. I found a tutorial on how to do this: Guide to Creating Your Own WordPress Editor Buttons. But no matter what I tried, I just could not get my button to show up.

Eventually I downloaded the source files provided as part of the tutorial, and they did work. After doing some debugging (change a bit of their code to be more like my code, refresh the page and see if the buttons still show up or not, repeat), I found the problem. I was using a dash (-) in my TinyMCE plugin's name, and it doesn't like this for some reason. Replace it with an underscore, and it works fine.

Another issue I had was that the tutorial is for an old version of TinyMCE. However, when I tried the code example for the current version of TinyMCE (TinyMCE: Creating a plugin), I received the javascript error message:

editor.addMenuItem is not a function

So it seems that Wordpress (as of version 3.7.1) must still use the old version of TinyMCE. I did try earlier to find info on what version Wordpress does use, but was not successful. I could probably find the actual file included, which might have a comment in it to say, but I would have thought that this sort of info would have been included in the Wordpress codex (docs).

I did actually post the above as a comment to the NetTuts tutorial, but after typing out the answer I was forced to sign in with Disqus before the comment could be posted. And after signing in, the page just reloaded with the comment box empty and no sign of my comment having been posted. So I'm including it here in my blog instead for reference for myself in the future and anyone else.

Hmm... I just had an email from Disqus to validate my account. (I had to sign up for an account to post the comment on the NetTuts article, though I signed up in a different tab so as not to loose my carefully written comment which then got lost when signing in anyway). When I clicked the link, I was asked to sign in. After signing in, I was then greeted by a message that I needed to validate my account and should have received an email with the validation link I need to click!

I don't think I'll ever understand why people implement useless commenting systems like Disqus. Although the facebook commenting system used on many sites is awful, at least it gives your site some exposure as their comment will appear on their timeline and might encourage their friends to visit your site. Disqus has no such benefits, only disadvantages. (Difficult to use, buggy, comments can't be crawled by Google, loads extra js and is slow).

Sunday 3 November 2013

Co. Ding

This morning I updated my pog website and went to Church.

I spent quite a bit of the afternoon playing on Animal Crossing New Leaf.

In the evening I looked into a Wordpress issue someone was having.

I also tried to fix a problem I was having with XMP File Info panel. When hierarchical keywords were converted into standard keywords, if the keyword was already present as the start of another keyword, then it wouldn't be added.

I looked at my code for the panel, and I was using keywords.indexOf(keyword), where keywords is an array of keywords, not a string. According to the Adobe docs, this uses a strict equality check. So I shouldn't be seeing this behaviour. I added some debugging to my code, and then ran a few tests.

This actually took quite a while since I couldn't remember how to build the panel or where the panel needed to be placed to be available in Bridge.

When I ran the tests, the panel worked properly. So I can only think that I had previously used some different code that didn't use Array.indexOf, and had then modified my code to use Array.indexOf but hadn't actually updated the compiled version of the panel.

A couple of random things.

I had an email from Canon advertising their Project 1709 cloud image hosting service. When I clicked on the link, I received a page saying that the service was down for maintenance. That makes it look good!

The actual article about why you should use the service is here: Secure cloud storage: 7 promises Project1709 makes (and keeps). To be honest, all of those reasons are pretty weak. They may put it above facebook and Imageshack, but the vast majority of image hosting services targeted at photographers will support those points, and have other functionality that Project 1709 is missing.

From the start I've never understood why Canon developed Project 1709. What does it do that existing services don't? They still haven't answered this question.

Another thing was I noticed an eBay auction for a complete collection of Aafes, NAAFI, EFI, Startex, The Blue and Supreme Pogs from 2001 to 2013. The auction ended at £1,220.00 plus £10 for P&P. Who ever knew people would pay so much for pogs?

Saturday 2 November 2013

Male monarch of chefs

This morning I prepared my pog website update and photo tips website article for tomorrow.

In the afternoon I made some Breakfast Cookies and Pumpkin Cake. (Carrot cake but with pumpkin instead of carrot. I also used plums instead of raisins.)

In the evening I watched an episode of Power Rangers Zeo with Billy. Tommy and whatever the yellow ranger's name is get struck with a spell that makes it so they have to sing instead of speaking. Extremely maniacal.

After that we watched 'The Little Convict', a Yoram Gross (of Blinky Bill TV series fame) film starring Rolf Harris. The film blends live action and animation. It's not a really good film, but it was pretty decent. I gave it 7/10.

For the rest of the evening I made the topping for the cake and also listened to K.K. performing.