« Windows Screen Savers: Bullets Updated | Main | Reading List: The Party of Death »

Saturday, July 29, 2006

Windows Screen Savers: Slide Show Updated

The Slide Show screen saver has been updated, with Release 2.0 posted today. The previous 1.3 release, dating from February 2003, already supported dual screen configurations on Windows XP; the new release saves its settings in the Windows registry, so each user on a machine may have their own personal settings, and administrator privilege is no longer required to save settings.

The randomisation of images and sound files in “shuffle play” mode has been improved. Previously, it suffered from the flaw discussed in section 10.8 of Ferguson and Schneier's Practical Cryptography: when generating pseudorandom integers between zero and an upper bound which is not a power of two minus one, taking numbers between zero and a large power of two minus one modulo the upper bound creates a bias toward values in the lower part of the range. The degree of the bias depends upon the difference between the upper bound and the next greater power of two. The simplest solution to this problem is to generate pseudorandom numbers between zero and the next power of two greater than the upper bound, and if the result exceeds the upper bound, simply discard it and try again. This wastes some time (in the worst case, you may generate, on average, twice as many pseudorandom values as you require), but it eliminates the bias. That is the approach I took here, since I'm only generating permutation samples for the Moses/Oakford/Durstenfeld shuffling algorithm (Algorithm P in section 3.4.2 of Knuth's Seminumerical Algorithms), and only do this once for each traversal of the entire list of images and sound files, the additional overhead is negligible—much less than painting a single image on the screen.

A completely new feature in Release 2.0 is support for “Internet shortcuts” (.url files). One of the more obscure features of Windows is the ability to create a shortcut not just to a local or workgroup shared file (like a Unix symbolic link), but also to a URL on the Web. Clicking one of these shortcuts should display the page it links to in your browser. The Slide Show screen saver now looks for these Internet shortcuts in your designated slide directory and, if your machine is connected to the Internet when the screen saver starts, displays the images and sound files they designate. This allows you to include dynamic Web imagery in your slide show such as the Earth from the Sun, Moon from the Earth, Sun from the Earth-Sun L1 point, current cloud cover for the Eastern and Western Hemispheres, a view from the North Pole Web Camera, and real-time audio information like the Fourmilab text-to-speech toys I cobbled together with Perl and the Festival Speech Synthesis System which make your computer say the current Universal Time, Julian Day, or quotes for stock market indices. (What happens when you click these audio links depends upon how your browser is configured to handle downloads of .wav audio files; even if they don't play, or your browser wants to save them to a file, the screen saver should still play them correctly.)

Downloading of image and sound files from the Internet is mediated by the cache mechanism used by Internet Explorer and other Internet-aware Windows applications. Repeated requests for files which have not changed since the last time they were retrieved will generate minimal Internet traffic.

I should note one little gotcha I ran into whilst testing this screen saver on Windows 2000 (I don't know if this also affects Windows XP—it may). The screen saver's configuration dialogue contains two buttons which display “Internet help” by pointing the user's Web browser to relevant Web pages, using the facilities in the urlmon.dll API. “The buttons, they do nothing!”, however, if I have the default browser configured to something other than Internet Explorer. (The HlinkNavigateString call returns the informative error code E_FAIL to elucidate the precise circumstances of the difficulty.) Since in these days of persistent broadband Internet connectivity more and more applications assume they can pop up Web pages at will, users who find themselves deprived of this boon might try reconfiguring Internet Explorer as the default browser and seeing what happens. (This is not a recommendation to use Internet Explorer—just an observation about another possible attempt to deter users from choosing something better. As soon as I was done testing the screen saver, I reset my default browser to a proper one.)

Posted at July 29, 2006 22:15