Scatter/Gather thoughts

by Johan Petersson

Generic guide to software editions

The last few years we have seen an increased proliferation of software product "editions": the same version aimed at different user segments. A somewhat recent example is the latest version of Microsoft's operating system, Windows Vista, which comes in no less than six different editions.

People often ask me what differentiates editions of particular products. I could direct them to the manufacturer's web site, which invariably offers "comparison matrices" outlining the differences, but there's really no need to do so once you understand the general pattern. The names of editions for specific products may differ, but the following should serve as a useful guide whenever you are faced with a choice of editions:

The Home edition
This relatively affordable edition is for people who have no idea how to use the software and have no intention of ever learning. It's functionally identical to last year's version of the product but features a colorful and horribly user-unfriendly interface with big shiny buttons to push and "wizards" that helps you do the wrong things fairly quickly.
The Professional edition
The Pro edition is for people that will actually use the software. It is expensive enough to make professionals and small businesses think twice before investing in it, but at least it has a semi-usable user interface and includes all features that matter. This is the edition trade magazines will review and the one always meant when a particular product is recommended.
The Standard edition
The edition for people who want to use the software but can't afford the Professional edition. Basically the same as the Home edition except that you can turn off some of the more obnoxious elements of the user interface, which unfortunately only serve to make its severe limitations all the more obvious. The price point is somewhere between Home and Pro.
The Premium edition
This edition is for people who probably should have bought the Home edition but have more money than common sense. It combines the user interface of Standard with the features of Professional and includes five additional "multimedia" applications, none of which have any practical use. This edition costs a bit more than Professional.
The Enterprise edition
This edition has a price tag one or two magnitudes over that of the Pro edition. It is similar to Professional but has a number of nebulous enterprise features, most notably a suite of poorly designed and buggy multi-user programs and support for machines with ridiculous amounts of RAM and CPUs. Presumably for scalability reasons, it's performance while doing common tasks is considerably lower than any other edition so you really need such a machine to run it.

5 May, 2007 | feedback (1)

Copley's Law of Boxes

Today's cute cat moment is brought to you by Padraic Connelly. His parents were taking out some recyclables when a few old cardboard boxes fell off the stack. By the time they got back from the end of the driveway, this is what they saw:

three cats in cardboard boxes

6 September, 2006 | feedback

Safely removing a Safely Remove Hardware notification

I have found a fix for a niggle with the Opteron box I built last year. One of my drives is incorrectly detected as a removable device, causing the Safely Remove Hardware icon to appear in the Windows notification area:

Safely Remove Hardware notification icon shown for non-removable hard drive

I know for a fact that this particular WD Raptor hard drive is securely fastened inside the chassis with four screws; I installed it myself. I suppose it's removable in the strictest sense of the word, but it's certainly not what you'd normally call a removable storage device.

It looks like the SATA drivers for my nForce4-based motherboard causes Windows to believe that it is some kind of hot-swappable device, and it was by investigating the Nvidia driver files I finally found the solution. If you're experiencing the same problem with your nForce board under Windows XP or 2003 I'd expect one of these registry changes to fix it. To convince Windows to treat my SATA devices as non-removable I located the key

HKLM\SYSTEM\CurrentControlSet\Services\nvata64

in the registry and created a DWORD value named DisableRemovable with value 1 under it. For the 32-bit version of the Nvidia drivers, you'd create the same value under

HKLM\SYSTEM\CurrentControlSet\Services\nvata

Yes, I know I could have gotten rid of the notification area icon simply by instructing the taskbar to hide it. As far as I'm concerned using this taskbar feature is never a solution, it merely hides the symptoms of a problem. Besides, I still want that notification icon to appear when attaching devices that truly are removable.

5 August, 2006 | feedback (7)

Kitten status

I'm happy to report that the kitten seems to be out of any immediate danger. Thanks to everyone expressing their support during this ordeal. Primary concerns leading to the veterinary's initial pessimism were that the kitten wasn't showing much interest in food and was unusually inactive – bad signs for any cat, but especially problematic for a growing kitten.

Maybe the kitten got as scared as everyone else by the dire news from that vet visit, because pretty soon after that he started eating ferociously. He has been putting on a lot of weight (gaining 300 grams in a week) and is also much more active, playing and fighting with his brother.

The vet was very impressed by this change and couldn't find any major health problems in a recent, more thorough, examination. The kitten is obviously still somewhat behind in development, but if he keeps this pace up the coming weeks he should be fine.

Attack kitten honing his skills

3 May, 2006 | feedback

Kitten pictures!

I've wanted to get a cat for many, many years. I grew up loving the Siamese cat our family had and I was initially planning on getting one of those. Although coming close to it a couple of times, the right opportunity never seemed to appear. Taking in a new family member is not a responsibility I take lightly; it has to feel exactly right.

However, it looks like the moment has finally arrived. A while back I was browsing Swedish cat breeders and stumbled upon S*Junglespots, a small cattery with these irresistible creatures in need of a home:

Kitten with brother

Originally the serendipitous result of the crossing of an Abyssinian with a Siamese – both prized as unusually intelligent, playful, and affectionate breeds – the Ocicat is a beautiful spotted cat with lots of personality. A breed with plenty of desirable qualities that should make for a great pet for the dedicated family or owner.

How could I resist? This is the kitten I look forward to having as my feline companion in coming years (picture from when he was three weeks old and almost unbearably cute):

My kitten

He's now about nine weeks old and still with his mother at the cattery, but assuming all goes according to plan he'll get to familiarize himself with the Petersson residence in just a few weeks. Hopefully he will be as happy and excited about this arrangement as I am. Here's a more recent picture of him in his favourite spot, enjoying the warmth in front of the stove:

Kitten in front of stove

Update: I have just received the very sad news (on my birthday, no less) that the vet thinks the kitten has a congenital health problem and is highly unlikely to reach adult age. If true, it will be put down. I guess it was too good to be true, after all.

Update 2:The kitten has been showing fairly strong signs of improving lately. There will be a more thorough veterinary examination soon. I don't dare hope for too much at this point, but I'm not giving up either.

19 April, 2006 | feedback (1)

An occasional C++ copy confusion

The standard C++ library contains std::copy which is the generic equivalent to the C memcpy function. There's nothing stopping you from using std::memcpy in C++ as well – but why would you do that when there's a replacement that's capable of working with all kinds of iterators while being just as efficient as memcpy for built-in types?

Indeed, once you start std::copying there should be no need to look back. However, if you're familiar with memcpy you must also be aware that it cannot be used if the source and destination memory areas overlap. Let's take a look at the std::copy description to see if it has a similar limitation:

template <class InIt, class OutIt>
OutIt copy(InIt first, InIt last, OutIt result);

Aha! That requirement could certainly prove to be a problem when we're copying overlapping ranges. In C we're supposed to use the memmove function if the source and destination overlap. Surely C++ must offer us something for when std::copy can't do the job? Yes, of course it does:

template <class BidIt1, class BidIt2>
BidIt2 copy_backward(BidIt1 first, BidIt1 last, BidIt2 result);

Hey, std::copy_backward has the exact same requirement of result not being in the source range! How am I supposed to copy overlapping ranges? Where is my generic memmove?

It's easy, especially for a someone with a strong C background looking for memmove, to draw the wrong conclusion from the iterator requirements. Read the descriptions again carefully. Nothing is said about overlapping ranges, only that result can't be in the source range. When there is overlap at the start of the source range, std::copy will work fine:

|result    |first        last|

True to its name, std::copy_backward will copy backwards, so result actually marks the end of the region when you call this function. That covers the case where overlap occurs at the end of the source range:

|first        last|    result|

Both std::copy and std::copy_backward can in fact deal with overlap, you just have to call the correct one depending on the situation. Typically you don't even need to compare iterators to determine which function to call because you already know what kind of overlap you have at the call site.

There is no std::move that does the right thing automatically. Such a function could be written, but it would be less general as well as less efficient than the two existing copy functions; it would have to compare destination and source range iterators every time.

14 February, 2006 | feedback

Puncturing balloon tips

New computer, new problems. Going from an old Windows 2000 installation to a fresh install of Windows 2003 means that I have to deal with a number of new annoyances in addition to applying the changes I'm already familiar with. I'm not entirely sure if this annoying message is new for Windows XP/2003 or one I removed early on in Win2k:

Local Area Connection is now connected

I do know that balloon tips were introduced in Windows 2000. In fact, one of the very first things you saw after logging in for the first time was a balloon tip urging you to Click on the Start Button. Back in 1999, writing about a Windows 2000 release candidate, I half-jokingly remarked that talk bubbles did not look particularly Professional (the new name given to the workstation edition of NT 5).

I still stand by that sentiment, but I also believe usability trumps looks in user interface design. Are balloon tips useful? The idea behind this UI element is to allow for a textual notification that calls the user's attention while being less intrusive than a message box. There are two situations in which a balloon tip (or an equivalent UI element) might be appropriate:

The balloon tip about the start button is arguably an example of the former. To ensure that the user has time to read the text, such tips should be displayed until dismissed by a click on the balloon or associated part of the user interface and then never shown again. As a designer your goal should be to make the user interface intuitive enough that such hints are never needed, but this ideal can be hard to reach in practice.

Very few events fit the second description, and correctly identifying such situations can be difficult due to different expectations and use patterns. A balloon tip is too intrusive if the event could be considered part of normal operation or if it can be resolved without user assistance. When immediate user action is needed, the information is critical and a message box or dialog is the proper choice. In most other cases, a log file message or a small status indicator is preferable.

Neither of these criteria allow for the network connection balloon tip in the screenshot above. It's an event that happens every time I start or reboot the computer and most definitely part of normal operation. Finally, the network connection status is already shown through the notification area icon. (I enabled it specifically for this purpose.)

Having justified my reasons for considering this an annoyance I went looking for a way to remove it. There does not appear to be any way to get rid of only this balloon tip, although you can disable all balloon tips in Explorer's notification area through a registry modification. If that sounds like a good idea, locate the following key in the registry:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

Create a DWORD value named EnableBalloonTips under that key; set it to zero to disable the balloon tips. Alternatively, you may download disable-balloon-tips.reg and import it directly into the registry.

2 November, 2005 | feedback (1)

The sound of SilverStone

Long time no post. Among other things I've been tinkering with my new computer and revisiting the fantastically addictive World of Warcraft. I have a few half-finished journal entries queued up and will hopefully get around to posting them soon.

If you're building a system with similar components, you'll definitely want to find some way to mitigate the noise. Since I prioritized performance over silence I was prepared for some noise, but this computer is way too loud for comfort as it is. Although it's a bit difficult to tell all the different fans from each other, I strongly suspect the prime culprit to be my SilverStone power supply.

To be fair, the Zeus ST65ZF is a solid PSU and it's virtually impossible to find silent units with similar or better specifications. I wanted to avoid having to buy a new power supply for future upgrades; in hindsight it might have been a better idea to get a reasonably silent PSU in the range around 550W (which should be enough for now) and wait for the more powerful units to mature.

I am however very satisfied with the SilverStone chassis, which I find good-looking as well as roomy. Its four fans certainly contribute to the noise level, but not by much. A minor but annoying problem is that the chassi power LED cable can't be connected to the motherboard: there's a 3-pin connector and two pins. Is there a standard for this?

This is the first motherboard I own with its own fan site. After reading about all the problems people have experienced with the Tyan Thunder K8WE I was cautious, but so far I have found no major problems with it. The board requires 4-pin fans in order to be able to control fan speed, which doesn't exactly help with the noise situation (all CPU and chassi fans are of the more common 3-pin variety).

24 October, 2005 | feedback (2)

Million Dollar Homepage

On The Million Dollar Homepage you can buy pixels for $1 each. It's a brilliant idea, and frankly I'm surprised someone didn't think of this earlier. Pixel pushing creator Alex Tew has already sold more than 100,000 pixels (basically permanent ad space), so he's making good progress on making that million he seems to think he needs for university studies:

It was a muggy summer's night late in August, the time around midnight, and there I was, lying on my bed with a notepad, brainstorming ideas to make money for uni. I think I'm quite a creative person, so I wanted to come up with an idea that was unique and would hopefully capture people's imagination, but with the whole purpose of making money. No point being shy about it! I think we brits can sometimes be too shy about money. Well bugger that, I DO NOT want to be a broke student!

A dollar per pixel too steep for you? This is the web, we demand a free alternative for everything! In this case you need look no further than The Zero Dollar Homepage!

23 September, 2005 | feedback (5)

Why you may want that superfluous meta http-equiv

One of Michael Kaplan's readers point out that his blog lacks a a meta tag specifying the character set to use. There are a lot of "deadly sins" being committed on the web, but this is not one of them. Character encoding should always be specified explicitly for web pages, but doing so through the HTTP Content-Type header is sufficient. Actually, it's a superior way.

The appropriate header field can be set in your web server configuration (e.g. through Apache's AddDefaultCharset or ForceType directives), or on a page-by-page basis in CGI programs and server side scripting languages. For PHP you use the header function:

header('Content-Type: text/html; charset=UTF-8');

In ASP, you set the ContentType and Charset properties of the Response object:

Response.ContentType = "text/html"
Response.Charset     = "UTF-8"

I could give more examples, but your favorite web application platform will have a mechanism for doing this. In the unlikely case that it does not, I strongly advise you to find a new favorite. Failure to set the content type with an explicit charset parameter is one of those deadly sins referred to earlier and a common source of problems.

Needless to say, I take care to set an accurate Content-Type in the HTTP header on all my sites. However, if you take a look at the HTML code for this site, you'll probably see the following:

<meta http-equiv="Content-Type" 
      content="application/xhtml+xml; charset=UTF-8"/>

If you use Internet Explorer you might see something different. That is because Internet Explorer doesn't deal with XHTML properly, and visitors using IE currently gets served a pseudo-XHTML tagsoup as if it was HTML. It's an embarrassing hack that I hope to fix soon, but it's not relevant for the issue being discussed.

Question is, why bother with this meta element if it's not strictly needed? Removing it would save almost 100 bytes per page as well as make my site maintenance marginally easier. The HTTP header field should always be set, but I know of two good reasons for adding the corresponding meta element as well.

One reason is that doing so makes it possible to view a HTML document stored as a local file and be sure to get the correct character encoding. The HTTP header is conceptually part of the web page but not part of the HTML document. If a HTML file not labeled with a character encoding is viewed locally, the browser will be forced to either use a default or guess, with unpredictable results.

The second reason you may want to do this is to work around a somewhat obscure Internet Explorer bug. Under certain circumstances, Internet Explorer will fail to use the character encoding from the HTTP header when showing a page from cache. It's similar to the situation with local HTML files, because IE will then attempt to autodetect the character encoding unless you help it along with a meta element.

When you run into this particular bug, you may find that everything is displayed correctly the first time the page is viewed but that the text is garbled on subsequent visits (until the cached page expires or the browser cache is cleared). I'm not sure if this affects all versions, but I have seen it happen with Internet Explorer 6. The bug could be fixed by the time you read this, but there are an awful lot of old browsers out there and webmasters will generally want to cater for all reasonably recent IE versions.

You'd think that any problems with character sets and encoding affecting Sorting It All Out would have been discovered – especially so for an Internet Explorer bug. Michael works at Microsoft and since he writes about internationalization issues his pages frequently feature exotic characters. Surely someone would have noticed any character encoding problems by now?

Well... you are not likely to experience the Internet Explorer bug on Michel's site because it's only seen for cached pages and neither Community Server nor its predecessor .Text generate cache-friendly pages. But that's a web sin I'll have to deal with another time.

23 September, 2005 | feedback (1)