I have taken what some might consider a retrograde step: I added code to insert my blogroll directly below the widgets section of my left-hand sidebar. The reason for this is reuse of the same ID; it causes my Firefox HTML Validation add-on to issue warnings and so can hardly be standards compliant. Ironically, in its native state, the blogroll functions take panes to ensure that each category has its own ID, only for the widgets functions to go and disregard all of this and assign the same ID for each category. To change this in the widgets code involves ploughing through loads of arrays (and functions) and is not something for which I have time when an easier solution is very much possible.
Archive for June, 2007
An unexpected side effect
I recently posted about using mod_rewrite to block access to your images from all but the websites to which you want access to be available. Following so doing, I discovered that my FAVICON had disappeared from Firefox’s address. As it turned out, it was easy to fix and that is covered in another recent post.
Ditching PC Plus?
When I start to lose interest in the features in a magazine that I regularly buy, then it’s a matter of time before I stop buying the magazine altogether. Such a predicament is facing PC Plus, a magazine that I been buying every month over the last ten years. The fate has already befallen titles like Web Designer, Amateur Photographer and Trail, all of which I now buy sporadically. Returning to PC Plus, I get the impression that it feels more of a lightweight these days. What Future Publishing has been doing over the last decade is add titles to its portfolio that take actually from its long established stalwart; Linux Format and .Net are two that come to mind and there are titles covering Windows Vista and computer music as well. Being a sucker for punishment, I did pick up this month’s PC Plus and the issue is as good an example of the malaise as any. Reviews, once a mainstay of the title, are now less prominent than they were. In place of comparison tests, we now find discussions of topics like hardware acceleration with some reviews mixed in. Topics such as robotics and artificial intelligence do rear their heads in feature articles and I cannot say that I have a great deal of time for such futurology. The tutorials section is still there but has been hived off into a separate mini-magazine and I am not so sure that it has escaped the lightweight revolution. All this is leading me to dump PC Plus in favour of PC Pro from Dennis Publishing. This feels reassuringly more heavyweight and, while the basic format has remained unchanged over the years, it still managed to remain fresh. Reviews, of both software and hardware, are very much in evidence and it manages to have those value-adding feature articles; this month, digital photography and rip-off Britain come under the spotlight. Add the Real Word Computing section and it all makes a good read in these times of behemoths like Microsoft, Apple and Adobe delivering new things on the technology front. I don’t know if I have changed but PC Pro does seem better than PC Plus these days.
Another Olympus E-system review

I don’t buy Amateur Photographer much these days but sight of a review of Olympus’ E-410 and E-510 SLR’s got a copy into my possession. Amateur Photographer review features are usually comprehensive and this was no exception; there was none of the vitriol directed towards the Live View feature by Practical Photography, a defining feature of what i consider a lop-sided and none too useful review. The verdict was a positive one in the main with the E-510 getting the nod over the E-410 because it fared better on the usability side of things. Image quality, my major concern, was said to be impressive with only dynamic range counting against the results. The Live View feature didn’t attract the harsh commentary devoted to it by Practical Photography. Following this review, I have to say that the E-510 does tempt me with its combination of good image quality, dust removal and image stabilisation.
Trouble with my Canon CanoScan 5000F
I have had my Canon CanoScan 5000F scanner for nearly four years now and it has until yesterday performed faultlessly. However, it has now developed a fault that may hasten its replacement and I have to say that my eye is on Epson’s Perfection V350 Photo. Looking on the web, I did find scanners hidden away and that the selection available wasn’t what I might have expected it to be. Maybe, the digital photography revolution has made the humble scanner a less essential item. And the fault? Scan results are featuring an unacceptably strong magenta cast. In fact, the first scans result in nothing but pitch black but allowing things to stay on for a while does improve things. That suggests a hardware fault to me. I have raised the issue with Canon and will await their reply even though it is stopping me from adding any new photos to my online photo gallery. If Canon comes back to me with the "uneconomical to repair" response, I will be ready to go out and buy the Epson. Time will tell with this one…
Update 1: A spot of further exploration has left me wondering if it is the lamp that’s on the way out. If that’s replaceable at a reasonable price, then the CanoScan might live on after a spot of repair.
Update 2: Canon’s advice included reinstalling the scanner driver and, surprisingly given the symptoms, that seems to have helped. I’ll continue to keep an eye on things but it looks like I’ll be hanging onto my money for now.
More on mod_rewrite
Today, I caught sight of an article on anti-plagiarism tools at The Blog Herald and among the tricks was to use mod-rewrite to stop people "borrowing" both your images and your bandwidth. The gist is that you set up one or more conditions that exclude websites from the application of a rule forbidding access to images; the logic is that if the website referencing an image is not one of the websites listed in the conditions, then it doesn’t get to display any of your images.
RewriteCond %{HTTP_REFERER} !^http://(www\.)?awebsite.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]
The wonders of mod_rewrite
When I wrote about tidying dynamic URL’s a little while back, I had no inkling that that would be a second part to the tale. My discovery of mod_rewrite, an Apache module that facilitates URL translation. The effect is that one URL is presented to the user in the browser address bar, and the exact same URL is also seen by search engines, while another is passed to the server for processing. It might sound like subterfuge but it works very well once you manage to get it set up properly. The web host for my hillwalking blog/photo gallery has everything configured such it is ready to go but the same did not apply to the offline Apache 2.2.x server that I have going on my own Windows XP box. There were two parts to getting it working there:
- Activating mod-rewrite on the server: this is as easy as uncommenting a line in the httpd.conf file for the site (the line in question is: LoadModule rewrite_module modules/mod_rewrite.so).
- Ensuring that the .htaccess file in the root of the web server directory is active. You need to set the values of the AllowOverride directives for the server root and CGI directories to All so that .htaccess is active. Not doing it for the latter will result in the an error beginning with the following: Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden. Having Allow from All set for the required directories is another option to consider when you see errors like that.
Once you have got the above sorted, adding this line to .htaccess: RewriteEngine On. Preceding it with an Options directive to ensure that FollowSymLinks and SymLinksIfOwnerMatch are switched on does no harm at all and may even be needed to get things running. That done, you can set about putting mod_write to work with lines like this:
RewriteRule ^pages/(.*)/?$ pages.php?query=$1
The effect of this is to take http://www.website.com/pages/input and convert it into a form for action by the server; in this case, that is http://www.website.com/pages.php?query=input. Anything contained by a bracket is assigned to the value of a system-named variable. If you have several bracketed sections, they are assigned to sequentially numbered variables as follows: $1 for the first, $2 for the second and so on. It’s all good stuff when you get it going and not only does it make things look much neater but it also possesses an advantage when it comes to future-proofing too. Web addresses can be kept constant over time, even if things change behind the scenes. It means that returning visitors will find what they saw the last time that they visited and surely must ensure good karma in eyes of those all important search engines.
Forcing FAVICON.ICO to appear on the browser address bar
Here’s a piece of code that should really be unnecessary when you put the favico.ico into the root of your website directory:
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
The favico.ico should automatically appear there and in your browser bookmarks (favourites in IE) but there are occasions when the above has to sit in the header section of your web pages. I know because I am doing it for this blog.
More useful WordPress plug-ins
Apart from a widget that puts a login form onto a blog sidebar, I am not really on the lookout for WordPress plug-ins but here are two that came to my attention recently. I have found them to be useful; maybe you will too.
The first is WordPress Admin Themer. This allows you to store wp-admin.css in your blog’s theme folder, out of harm’s way from future upgrade cycles. A neater way of otherwise storing your customisations of admin pages - I keep changing the logout destination to the front page of my blogs - would be a bonus but the style plug-in is a good step forward.
One use to which I was going to put WordPress Admin Themer was to hide some elements of the WordPress dashboard page but I happened accross another plug-in that does just this kind of thing: Dashboard Editor. Activating this gets you an extra admin page where you can select the components that you want to see using the tick (check) boxes. You can even take things further by having your very own dashboard instead of what WordPress offers or by activating widgets for using with your dashboard. It’s all good stuff and I have got rid of extraneous pieces such as Planet News and the getting started section (I have using WordPress long enough that I should know my way around by now…).
IE6 and JavaScript performance
Having been exposed to an application at work that uses a lot of JavaScript, I fully appreciate what some mean when they talk about IE6’s inefficient handling of JavaScript. After seeing a web page taking an age to reload and your CPU taking a hammering because of JavaScript processing, the penny does tend to drop… Needless to say, this very much impacts the world of AJAX-driven web applications with their heavy dependence of client-side JavaScript. While IE7 does come to the rescue, there remain plenty of IE6 users still out there and this is reflect in website statistics. This reflects a certain level of inertia in the browser market that not only afflicts the uptake of IE7 but also the likes of Mozilla, Opera and Safari. It also means that anyone developing AJAX applications very much needs to continue testing in IE6, especially if the product of their labours is for wider public use. An example of such an application is Zimbra, an open source web application for messaging and collaboration, and the people behind it have generously share the results of their browser performance benchmarking. They did comparisons of IE6 vs. IE7 and Firefox 2 vs. IE7. IE6 easily came out as the worst in these while Firefox 2 was the best. I suppose that the next question to be asked centres around the type of code that is processed inefficiently by IE6. I wouldn’t be at all surprised if a list emerged but here’s one: using Microsoft’s proprietary innerHTML object to update the DOM for a web page format. Having a quick trawl on Google, this came up for mention as a cause of memory leaks. It is also a Microsoft innovation that never got taken up by those overseeing web standards, hardly a surprise since a spot of DOM scripting achieves the same end. It may be faster to code than any alternatives, and it does have some support from other browsers, but it does seem to have got a bad name and so should be avoided if possible. That said, it would be interesting to see a performance comparsion between innerHTML and DOM methods in IE6.
Tags
Adobe Apache Blog Blogging Books Canon Command Line CSS Drupal DSLR Firefox Google Hardware HTML IE7 Installation Internet Explorer JavaScript Linux Microsoft MySQL openSUSE Opera Operating System Oracle Perl Photoshop PHP Safari SAS SQL Ubuntu UNIX Virtualisation Virtual Machine Vista VMware VMware Workstation Web Browsers Windows WordPress WordPress.com WordPress plugins XHTML XP