Monday 30 November 2009

Having a headache again

Me, L, and Moccle all have colds at the moment, so Moccle was off work today, and L was off school.

In the morning I updated my Pog Website, and listened to a bit of Gauher Chaudhry interviewing Robert Grant and Ian David Chapman on Free Traffic Strategies Using facebook. It was about how you can create a fan page on Facebook, and how when one person becomes a fan of your fan page, it shows up in their newsfeed, so all their friends can see, making them more likely to check it out and beome a fan too, and so on (so called 'Viral Marketing').

I found the interview quite good and interesting, though of course there's quite a lot they don't tell you, as they want you to buy the full course that they sell on marketing via facebook.

The main problem I think I would have, is that they suggested that when you first set up your fan page, to get it going, you invite everyone on your current mailing list to become a fan of it. Unfortunately, if you're starting off with a brand new website like me, you don't have a mailing list to invite to become fans.

After listening to the Free Facebook Traffic Strategies interview for a bit, I went to bed as I wasn't feeling very well.

I got up for lunch, then went to bed again after lunch. Then after an hour or two I was feeling a bit better, and my headache had subsided, so I finished listening to the Free Facebook Traffic Strategies interview, and also played on New Super Mario Bros Wii with Moccle and L for a bit.

After that I did a bit of website work, adding robots.txt files to my site roots, getting my url shortener service online (and getting the log archiver/awstats scripts set up for it), and upgrading Wordpress on my Ubuntu Virtual Machine.

After upgrading Wordpress, I had the problem with it using named entities instead of numeric entities again. I was hoping that knowing a bit more about Wordpress now than when I first set it up, that I would be able to filter the functions that were printing named entities, to convert them to numeric entities, rather than just doing a find and replace on the core files, as I had done before.

The first place in the page where it was printing named entities was the RSS feed links in the <head> that are generated by wp_head. I did lots of googling to try and see how to filter these so that I could convert them to be XML compliant. Unfortunately, I only found one bit of info about filtering, and that was a filter on the link URL rather than the actual <link>, and lots of info on how to remove the links from the header, most of which didn't work.

After dinner I eventually came across Removing wp_head() elements (rel=’start’, etc.), which tells you how to remove the various feed links from wp_head, and actually works. The only problem is though, that I didn't want to remove the feed links, rather just to filter them. But I couldn't get a filter on them to work.

So I just ended up doing the same thing I did before and doing a find and replace on the core files, replacing &laquo; &raquo and &nbsp with their numeric entity equivalents.

I looked at trying to fix the stack overflow problem with my slideshow javascript in Internet Explorer. I had thought the problem was that I was storing the images in a javascript object, and that was taking too much memory. But thinking about it, I didn't understand how this could be since really I would be storing a reference to the object - the javascript wasn't storing copies of the images, but rather it was storing the actual images.

So I did a test by loading a html page with the same images that the javascript would normally load, and the page worked fine, with no stack overflow. So I changed my javascript not to store the images, but rather their ids, but I still got a stack overflow, pointing to it not being storing the images in a javascript object that was causing the stack overflow.

Next I looked at my function again, and thought maybe jQuery was making copies of all the images or something and causing the problem. But with the relevant jQuery section of code commented out, I was still getting a stack overflow in IE.

I tried replacing new Image() with document.createElement('img'), but that didn't make any difference.

Then I realised what the problem probably was - In the image onload function I was calling a function to load the next image. So what I guess was happening is that image 1 would load and call the function to load image 2, this would load and call the function load image 3, etc. and so the function wouldn't start ending (returning) until it had reached the last image, and there were no more to load. So to fix this, I just put the call to load the next image in a timeout. This meant that the current function could finish okay before the function to load the next image was called.

I still need to do some more testing to check this has solved the problem, but it seemed to be working okay in IE8.

I also watched a couple of episodes of Uylesees with L in the evening.

The weather was sunny most of the day, and there was a good sunset with a large cloud above the horizon being lit up orange underneath by the setting sun.

Food
Breakfast: Grapefruit marmalade toast sandwich; mug of honey & lemon drink.
Lunch: ½ Sausage, mayonnaise, lettuce, and sliced cherry plum tomato sandwich; Bag of Smoky Bacon flavour crisps; Clementine; Cup o' tea.
Dinner: Spaghetti Bolognaise; Tomato ketchup; Ground Black Pepper; Italian Grated Hard Cheese. Pudding was a slice of home-made flapjack. Coffee.
Dupper: Mug of honey & lemon drink; Shortbread finger; dark chocolate digestive.

No comments: