Atomic I/O letters column #67

Originally published 2006 in Atomic: Maximum Power Computing
Reprinted here March 2007
Last modified 16-Jan-2015.

 

Don't lick the power plug, either

If I stare directly at the laser of an optical mouse, can that cause blindness or any loss of sight?

Stephen

Answer:
In theory, yes. In practice, no.

The lasers that fancy optical mice use are the same little diode units as you get in cheap laser pointers. They don't have much light output at all - one or two milliwatts, tops. You can still damage your eyes if you stare at the beam from a cheap laser pointer, though, because a laser diode's light comes from a very tiny point. If you focus on it, your eye will obligingly focus that light down into another very tiny point on your retina, and that can damage the cells back there.

The brain does a lot of processing of data from your retina, so it can be hard to tell when you've damaged it. This can lead people to keep on damaging their retinas until they're legally blind, without even noticing until it's too late.

Most, if not all, laser-illuminated mice reduce the risk of this sort of thing by turning off the laser whenever they don't think they're sitting on a surface. So, as with LED-illuminated optical mice (which generally just dim their light when they're not on a surface), you can only actually shine the beam somewhere other than your mousemat for a brief moment at a time.

You probably could still manage to stare at the beam if you really tried, by pressing the mouse onto your face, or something - though the beam would be shooting into your eye at an angle then, not straight on at the retina.

In any case, just, you know, don't do that. There are more pleasant ways to become a statistic.

Brief exposure to these low-powered lasers, however, is harmless. High powered pointers can pose a significant risk with very brief exposure, but glancing at a 1mW laser beam will do your eyes a lot less harm than glancing at the four hundred million billion billion watt sun.

(Which, yes, is much further away, but the point remains.)

 

1+1= -16777215

You know those stupid error messages where some program says something like "You have 92785Mb of hard disk space free, I need 2.1Mb to install, please free -273162837Mb so that there will be enough space for all my big, big files, please press Cancel to exit or Retry to see this stupid error again"?

Why do they happen?

I've seen, like, 20 different ones in screenshots on different forums, and I've seen it myself several times. Is this a Windows problem?

Adam

Implausible error message
This error was old ten years ago. It's still happening.

Answer:
There are three ways in which these problems can arise.

One of them comes from old software that dates back to some time when there was a hard limit for some system resource, and no PC could possibly have more than that limit. The FAT16 file system, for instance, only supported 2Gb disk partitions, at most. Lazy and/or dumb programmers could therefore make a disk-space checker routine that freaked out in a silly way when it sees that you're trying to install the program on a partition with 200 times as much space free as the program believes is possible.

The second way to create a problem like this is with a particular kind of sloppy programming. It's a very elementary error, and quite easy for even non-programmers to understand - but as with buffer overflows, crummy coders keep on making this basic mistake.

When a program compares numbers, it should compare them as numbers. Duh. But if the program is instead written so that it compares them as strings, weird stuff can happen.

String comparison can be thought of as an ordinary alphabetic sort - the kind of sorting that gives the dude who owns Aaaaaaardvark Smash Repairs the first listing in the phone book.

A numerical sort of the numbers 33, 276, 4 and 8 will, of course, give you 4, 8, 33, 276. A string sort, though, just treats digits as if they're letters of the alphabet, all of which (usually) come before A. It'll thus sort those numbers by their first digit, as if they were words. So the result will now be 276, 33, 4, 8.

If a free-disk-space detector works this way, and the installer needs 7Mb but there's 2405Mb free, it will confidently report that there is not enough space. Because 2405 comes, alphabetwise, before 7, just as "fish" comes before "o".

After I put this page up, a reader pointed out that the third way in which this can happen is if the installer only has a 32-bit integer for the disk space, giving a maximum of four gigabytes it can see without going strange. Often, it's only two gigabytes, because one bit's used to indicate positive or negative - which means going off the top can wrap around to negative numbers, giving rise to fine examples of these goofy error messages.

Once you know about these problems, you can see them in most of the funny screenshots of these kinds of errors. Either it's obviously directly delivering a string-sort or 32-bit sort of number, or - as with the ancient WinBench error I include above - it's trying to get clever by calculating exactly how much more space it thinks you need, and thus looking even stupider.

String comparisons work just fine when all of the numbers are similar in magnitude - when everybody's CPU has a three-digit clock speed, for instance. But as soon as someone comes along with (say) a 1300MHz CPU, the stupid program (which shouldn't be checking dumbly for clock speed anyway, but that doesn't stop people from making installers that do...) will decide that 1300 is smaller than 233. So the CPU's not fast enough.

(That same program will also, of course, be quite sure that a 25MHz CPU is faster than a 233, or indeed a 2400.)

The example you gave - which I understand you just created by doing a Ratbert-dance on your number keys - wouldn't actually trigger the string-sort problem. 92785 comes after 2.1 in both string and numeric sorts.

In extremis, it is possible to get some of these dumb programs to install by, for instance, duplicating giant files on your hard drive until you've used up enough space that the initial digit of the free space number becomes suitable. You can, similarly, underclock your CPU to get a dumb clock-speed check to pass.

Any program that won't even install if it thinks your CPU's too slow is, of course, usually not something you want to be running anyway. But sometimes one must do things of which one is not proud.

 

Wanted: Mains to RJ45 cable

For the past couple of days I've been arguing with my mate about "Powernet", the newest lot who have been pushing broadband over power lines.

I'm of the inclination that they're crackpots and will never pull it off, but he's pretty sure it's legit. Would you be able to shed some light on it?

Dylan

Answer:
Well, broadband over power lines is perfectly technologically possible, but so are lots of things that don't work in the real world.

I don't know whether the power grid here in Australia is any more suited to broadband distribution than is our phone system. After all, if power line broadband only covers one person in a zillion who can't already get DSL or cable, there's not much point to it.

I do know that power line broadband is the most vaporous of all the broadband schemes. People have been talking about it forever, but most of the time, in most markets, that talk comes to nothing. The Powernet site is a better example of the breed than most - it makes perfectly clear that this is very early days (and, so far as I can see, it hasn't been updated at for something like a year). It's not making promises about zillion-home rollouts in the next six months, like some of these companies.

Local networking systems that use power cabling have been working for years. That's not a tremendously compelling technology, but it was attractive - in those countries where the electricity authorities allowed it - back when wireless networking was expensive and flaky.

High frequencies don't make it through low-frequency transformers, though, and the mains grid is full of transformers tuned to the 50-60Hz mains frequency.

This is a problem, because powerline networking operates by transmitting one or another kind of high frequency signal, way up in the megahertz, through the power wiring. There's no other way to do it - bandwidth and frequency are inextricably linked.

So if you want power line data to make it around a neighbourhood rather than just around a building, you have to start messing around with every single pole pig transformer out there, not just the substations.

 

Still plenty of 0s, but you're out of 1s

I've got four gigabytes of RAM, and I'm running WinXP, which is meant to have no stupid "system resource" limits, but I can't run several big programs at the same time.

If I've got lots of things running, and then try to run, say, Photoshop, it just goes "bong" and quits to the desktop with no error at all.

I'm really grateful to Mr Gates for making sure that all that memory of mine doesn't wear out, but obviously there's some kind of Windows resource that IS running out, even though XP isn't meant to have them.

What is it?

Peter

Task Manager with many many columns
The first step is to admit you have a problem.

Answer:
Yes, WinXP has some semi-secret resource limits which can cause this kind of impolite behaviour. This also explains why opening lots and lots of windows can leave you with the last ones all deformed, missing most of the stuff that should be in them.

The limits people usually encounter are handles, and the desktop heap.

Microsoft helpfully point out, in their support document 327699 (Google hit #1 when you search for that number!), that "There is a hard-coded limit of 10,000 NT User handles. This is designed to prevent "bad" (incorrectly behaving) programs from allocating too many NT User handles."

This is kind of like preventing kids from eating too many lollies by flushing most of the lollies down the toilet, but fortunately that document also tells you what to do in Regedit to increase the limit to 18,000. That's as far as Microsoft, in their wisdom, make it possible to go - but it solves many of these problems all by itself.

Microsoft have a page about embiggening the desktop heap, too. That fixes the mangled-window problems.

Note that you can tell Task Manager to display handle and object counts. Go to the Processes tab, then View -> Select Columns..., and pick the ones you want. This lets you see whether anything's using an inordinate number of one resource or other.

Free Download Manager, for instance, is a generally excellent piece of software. But it uses a handle for every file in its various lists, until you delete them (by which I mean delete their name from the list, not the actual file from your hard drive). FDM's got its own Recycle Bin, too, which you also need to empty.

FDM was using six thousand and something handles on my system when I last let its lists clog up. That dropped to 247 after I cleaned it up.

 

Other letters columns

I/O #1
I/O #2
I/O #3
I/O #4
I/O #5
I/O #6
I/O #7
I/O #8
I/O #9
I/O #10
I/O #11
I/O #12
I/O #13
I/O #14
I/O #15
I/O #16
I/O #17
I/O #18
I/O #19
I/O #20
I/O #21
I/O #22
I/O #23
I/O #24
I/O #25
I/O #26
I/O #27
I/O #28
I/O #29
I/O #30
I/O #31
I/O #32
I/O #33
I/O #34
I/O #35
I/O #36
I/O #37
I/O #38
I/O #39
I/O #40
I/O #41
I/O #42
I/O #43
I/O #44
I/O #45
I/O #46
I/O #47
I/O #48
I/O #49
I/O #50
I/O #51
I/O #52
I/O #53
I/O #54
I/O #55
I/O #56
I/O #57
I/O #58
I/O #59
I/O #60
I/O #61
I/O #62
I/O #63
I/O #64
I/O #65
I/O #66
I/O #67
I/O #68
I/O #69
I/O #70
I/O #71
I/O #72
I/O #73
I/O #74
I/O #75
I/O #76
I/O #77
I/O #78
I/O #79
I/O #80
I/O #81
I/O #82
I/O #83
I/O #84
I/O #85
I/O #86
I/O #87
I/O #88
I/O #89
I/O #90
I/O #91
I/O #92
I/O #93
I/O #94
I/O #95
I/O #96
I/O #97
I/O #98
I/O #99
I/O #100
I/O #101
I/O #102
I/O #103
I/O #104
I/O #105
I/O #106
I/O #107
I/O #108
I/O #109
I/O #109
I/O #110
I/O #111
I/O #112
I/O #113
I/O #114
I/O #115
I/O #116
I/O #117
I/O #118
I/O #119
I/O #120
I/O #121
I/O #122
I/O #123
I/O #124
I/O #125
I/O #126
I/O #127
I/O #128
I/O #129
I/O #130
I/O #131
I/O #132
I/O #133
I/O #134
I/O #135
I/O #136
I/O #137
I/O #138
I/O #139
I/O #140
I/O #141
I/O #142
I/O #143
I/O #144
I/O #145
I/O #146
I/O #147
I/O #148
I/O #149
I/O #150
I/O #151
I/O #152
I/O #153
I/O #154
I/O #155
I/O #156
I/O #157
I/O #158
I/O #159
I/O #160
I/O #161
I/O #162
I/O #163
I/O #164
Dan's Data letters #1
Dan's Data letters #2
Dan's Data letters #3
Dan's Data letters #4
Dan's Data letters #5
Dan's Data letters #6
Dan's Data letters #7
Dan's Data letters #8
Dan's Data letters #9
Dan's Data letters #10
Dan's Data letters #11
Dan's Data letters #12
Dan's Data letters #13
Dan's Data letters #14
Dan's Data letters #15
Dan's Data letters #16
Dan's Data letters #17
Dan's Data letters #18
Dan's Data letters #19
Dan's Data letters #20
Dan's Data letters #21
Dan's Data letters #22
Dan's Data letters #23
Dan's Data letters #24
Dan's Data letters #25
Dan's Data letters #26
Dan's Data letters #27
Dan's Data letters #28
Dan's Data letters #29
Dan's Data letters #30
Dan's Data letters #31
Dan's Data letters #32
Dan's Data letters #33
Dan's Data letters #34
Dan's Data letters #35
Dan's Data letters #36
Dan's Data letters #37
Dan's Data letters #38
Dan's Data letters #39
Dan's Data letters #40
Dan's Data letters #41
Dan's Data letters #42
Dan's Data letters #43
Dan's Data letters #44
Dan's Data letters #45
Dan's Data letters #46
Dan's Data letters #47
Dan's Data letters #48
Dan's Data letters #49
Dan's Data letters #50
Dan's Data letters #51
Dan's Data letters #52
Dan's Data letters #53
Dan's Data letters #54
Dan's Data letters #55
Dan's Data letters #56
Dan's Data letters #57
Dan's Data letters #58
Dan's Data letters #59
Dan's Data letters #60
Dan's Data letters #61
Dan's Data letters #62
Dan's Data letters #63
Dan's Data letters #64
Dan's Data letters #65
Dan's Data letters #66
Dan's Data letters #67
Dan's Data letters #68
Dan's Data letters #69
Dan's Data letters #70
Dan's Data letters #71
Dan's Data letters #72
Dan's Data letters #73
Dan's Data letters #74
Dan's Data letters #75
Dan's Data letters #76
Dan's Data letters #77
Dan's Data letters #78
Dan's Data letters #79
Dan's Data letters #80
Dan's Data letters #81
Dan's Data letters #82
Dan's Data letters #83
Dan's Data letters #84
Dan's Data letters #85
Dan's Data letters #86
Dan's Data letters #87
Dan's Data letters #88
Dan's Data letters #89
Dan's Data letters #90
Dan's Data letters #91
Dan's Data letters #92
Dan's Data letters #93
Dan's Data letters #94
Dan's Data letters #95
Dan's Data letters #96
Dan's Data letters #97
Dan's Data letters #98
Dan's Data letters #99
Dan's Data letters #100
Dan's Data letters #101
Dan's Data letters #102
Dan's Data letters #103
Dan's Data letters #104
Dan's Data letters #105
Dan's Data letters #106
Dan's Data letters #107
Dan's Data letters #108
Dan's Data letters #109
Dan's Data letters #110
Dan's Data letters #111
Dan's Data letters #112
Dan's Data letters #113
Dan's Data letters #114
Dan's Data letters #115
Dan's Data letters #116
Dan's Data letters #117
Dan's Data letters #118
Dan's Data letters #119
Dan's Data letters #120
Dan's Data letters #121
Dan's Data letters #122
Dan's Data letters #123
Dan's Data letters #124
Dan's Data letters #125
Dan's Data letters #126
Dan's Data letters #127
Dan's Data letters #128
Dan's Data letters #129
Dan's Data letters #130
Dan's Data letters #131
Dan's Data letters #132
Dan's Data letters #133
Dan's Data letters #134
Dan's Data letters #135
Dan's Data letters #136
Dan's Data letters #137
Dan's Data letters #138
Dan's Data letters #139
Dan's Data letters #140
Dan's Data letters #141
Dan's Data letters #142
Dan's Data letters #143
Dan's Data letters #144
Dan's Data letters #145
Dan's Data letters #146
Dan's Data letters #147
Dan's Data letters #148
Dan's Data letters #149
Dan's Data letters #150
Dan's Data letters #151
Dan's Data letters #152
Dan's Data letters #153
Dan's Data letters #154
Dan's Data letters #155
Dan's Data letters #156
Dan's Data letters #157
Dan's Data letters #158
Dan's Data letters #159
Dan's Data letters #160
Dan's Data letters #161
Dan's Data letters #162
Dan's Data letters #163
Dan's Data letters #164
Dan's Data letters #165
Dan's Data letters #166
Dan's Data letters #167
Dan's Data letters #168
Dan's Data letters #169
Dan's Data letters #170
Dan's Data letters #171
Dan's Data letters #172
Dan's Data letters #173
Dan's Data letters #174
Dan's Data letters #175
Dan's Data letters #176
Dan's Data letters #177
Dan's Data letters #178
Dan's Data letters #179
Dan's Data letters #180
Dan's Data letters #181
Dan's Data letters #182
Dan's Data letters #183
Dan's Data letters #184
Dan's Data letters #185
Dan's Data letters #186
Dan's Data letters #187
Dan's Data letters #188
Dan's Data letters #189
Dan's Data letters #190
Dan's Data letters #191
Dan's Data letters #192
Dan's Data letters #193
Dan's Data letters #194
Dan's Data letters #195
Dan's Data letters #196
Dan's Data letters #197
Dan's Data letters #198
Dan's Data letters #199
Dan's Data letters #200
Dan's Data letters #201
Dan's Data letters #202
Dan's Data letters #203
Dan's Data letters #204
Dan's Data letters #205
Dan's Data letters #206
Dan's Data letters #207
Dan's Data letters #208
Dan's Data letters #209
Dan's Data letters #210



Give Dan some money!
(and no-one gets hurt)