Friday, August 28, 2009

Ready for the Desktop

I've been having issues on my Sony VGN TZ190 ever since I installed a certain operating system on it, shortly after I bought it in 2007(Yes, even I have computer problems I can't seem to solve):
  • About every seventh time I open a file window, the file browser crashes and complains that it was because of my Bluetooth driver, for which no update is available from Sony. Now it is stupid that Sony has not provided an update, but there is no good reason whatsoever why a Bluetooth driver should be crashing my file browser.
  • When I start my computer, and at least once a day, I get a message that says "Sony Vaio Services (sub-module) has stopped working." I have no idea what this is, really, or how it's affecting me.
  • The Fn keys for screen brightness do not work at all. The Fn keys for volume control work but do not provide any visual feedback.
  • After working for two years both the programs that play DVDs now crash when I try to play a DVD.
  • Printing to a network printer is essentially broken. If you try, the program from which you are printing will hang for a good 5-10 minutes before sending the job, and then it will only print half the time.
  • Wifi connnects easily to wireless routers, but every once in awhile will not allow connections all the way out to the internet. I have to run a command-line program to get it working again.

Looking at this list, you'd think I was running a Linux distribution from 2005. No, these are all problems I'm having with Vista, SP2 no less.

By contrast, I recently downloaded Ubuntu Netbook Remix (version 9.04) and gave it a shot, and guess what? Everything worked flawlessly with no configuration necessary, including all the Fn keys on my Sony Laptop's keyboard, which I would have thought would depend on some vendor-specific drivers. And it's speedy, even running off of a Sandisk USB flash drive.

I don't know how long it will take for Linux to be truly ready for the corporate world. But for private persons, Windows and Linux seem to have changed places while I was asleep. It's now Vista that's the haggle-draggle OS requiring command-line fixes and plagued with buggy drivers.

Saturday, August 1, 2009

Using LightBox with Image Maps

I ran across this while assembling the website for my brothers' new film The Little Red Plane. Don't ask why I needed to do use image maps in this day and age. But I did.

I decided to use the fairly awesome LightBox script (version 2.04) for certain aspects of the site, but the links that would trigger it were in an image map, which uses <area> tags instead of <a> tags. When I clicked on the links, the page would go dark but no image overlay was displayed.

The solution was found here. Apparently 2.03 worked fine with image maps but 2.04 has this regression.

To fix, open lightbox.js in a text editor, scroll down to the start() function and insert the line highlighted below:

//
//  start()
//  Display overlay and lightbox. If image is part of a set, add siblings to imageArray.
//
start: function(imageLink) {    
   $$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' });

   // stretch overlay to fill page and fade in
   var arrayPageSize = this.getPageSize();
   $('overlay').setStyle({ width: arrayPageSize[0] + 'px', height: arrayPageSize[1] + 'px' });

   new Effect.Appear(this.overlay, { duration: this.overlayDuration, from: 0.0, to: LightboxOptions.overlayOpacity });

   this.imageArray = [];
   var imageNum = 0;       
        
   imageLink.rel = imageLink.getAttribute('rel');
        
   if ((imageLink.rel == 'lightbox')){
      // if image is NOT part of a set, add single image to imageArray
      this.imageArray.push([imageLink.href, imageLink.title]);         
   } else {
      // if image is part of a set..
      this.imageArray = 
         $$(imageLink.tagName + '[href][rel="' + imageLink.rel + '"]').
         collect(function(anchor){ return [anchor.href, anchor.title]; }).
         uniq();
            
      while (this.imageArray[imageNum][0] != imageLink.href) { imageNum++; }
   }

Save the file. Now all you have to do is add rel="lightbox" to your <area> tags, just as you would with normal links.