Doesn't it depend on whether your machine uses two's complement, one's complement or some other representation? Some architectures would allow -32767 to +32767 inclusive, a range of 65535 values.
Agreed, when you need to optimize code and it becomes less obvious, comments are necessary. Maybe the rule is 'keep it simple, but if you can't keep it simple at least comment it'.
Yup, picking well-chosen and meaningful variable names does not mean making them as long and clunky as possible. Often 'i' is a good choice for a loop index, and 'msg' is probably better than 'message_string' (or worse, 'myMessageString' etc).
Yes, your code should read like a novel or at least like a well-written newspaper article or technical paper.
However, it should read like that _without_ comments! If you need to add long comments to make the code clear then fix the code first. In general, it is better to say something in code than in comments, for example 'const int x' is better than 'int x' plus a comment saying 'x will not be changed'. Well-chosen variable and subroutine names are also important. Finally arrange things in a sensible order: when writing you can either lay out the simple concepts first and use them to build up more complex things (like writing a mathematical proof) or you can start with a broad overview and then fill in the details. Either of these two styles may be appropriate depending on what your program does.
I remember the old reliability test of Unix commands which showed that GNU versions were much less likely to crash or do odd things when given random or pathological input. I would have expected the same sort of results with free web browsers. Still, well done to Microsoft for making their HTML parsing code robust against this kind of bug.
A conventional 24-bit image file will have eight bits for red, green and blue for each pixel. But very often digital cameras don't have separate sensors for each pixel; they have alternating R G B sensors in a kind of chessboard arrangement, and then interpolate the missing values. This interpolation happens when you go from raw format to the final output, and it can be done by the camera itself or by a photo manipulation program on a PC.
A raw format file, while still storing all the data that has come off the image sensor, can be one third the size of a PNG because it knows that the first pixel has only red channel information, the second only green and so on.
(FWIW, I usually make the effort to package obscure program X as an RPM myself, it's not hard. Then you keep the benefits of automated dependency resolution blah blah blah, and if the new package is added to a public repository then it's quickly available to everyone else, or to you on a different/rebuilt box.)
Why bother? Why not just mark the few bad addresses and stop using them? It doesn't matter if your one gibibit memory chip is actually 0.9999997 Gib because a few 4k pages have to be mapped out by the OS. See BadRAM.
Can you give examples of the 'surprising default settings and demonstrably anti-security minded UI features' in Firefox? I'd like to know what I need to turn off.
(There is that Password Manager thing which I never use...)
Timidity started off as a Unix program IIRC... it just takes a midi file and some samples and outputs some raw audio. I agree with the principle of getting away from software, but with today's CPUs it makes very little difference (I remember running timidity on a 35MHz ARM chip and it was nearly fast enough for real time playback).
I think you can use timidity, which is a software MIDI synthesizer, with a set of instrument samples ('patch files'). Gravis used to put their patch files on their ftp site, I don't know if they're still there.
I thought most laser printers of that era had m68k processors or thereabouts - not likely to be more powerful than a 386. Perhaps they just had better floating point support, or this PC didn't have the 387 FPU fitted.
How did the professor get the results back from the printer? An old style parallel port is one-directional.
I tried Scribus but the font rendering on screen was terrible. This was with Fedora 2, which I expected to have reasonable font support (most apps look okay). I am not blaming Scribus, the problem is most likely that I installed a version built with the wrong options - built without Freetype support or something like that.
Anyone know where to get a build (preferably RPM binary package or RPM source package) of Scribus for Fedora/RH-like systems that shows good-looking, outline fonts on screen?
If reiser4 operates in data=ordered by default and the benchmarks are taken in that mode, then it's very impressive. I believe that ext3 for example takes a big performance hit (for many applications) with data=ordered.
I like the idea of data=ordered because of its 'no lies' property - if the kernel says the bytes have been written to the file, they have been - and if reiser4 can support that while keeping reasonable performance it would be good to switch.
Suppose I want to be helpful to my next-door neighbour and let him share my network connection. If I do so deliberately I am breaking my ISP's terms of service. But if I just leave the wireless router at its default open setting and drop a couple of hints...
Indeed, if you have a wireless network and your outbound Internet link isn't congested, there is not much reason not to share it. You do of course use SSH and other secure protocols for your networking...
The quality of the picture is mostly determined by the lens and by the quality of the individual RGB cells on the sensor - not by whether there are 2 million or 4 million of them or whatever. A 2 megapixel image is still higher resolution than you can view on anything but an expensive display (at 3:2 aspect ratio it would be roughly 1731x1154 pixels).
Some people do try to attach decent lenses to disposable camera bodies; I am tempted to troll by saying that you would get better images by spending $20 on the body and $230 on the lens than by spending $250 on a 'decent camera', but I suspect that's not really true except for specialized applications. Still, it is worth emphasizing that the number of megapixels doesn't mean much if your images will be mostly viewed on screen. Even for making prints it doesn't matter if they are small ones.
What if (and i'm not saying it is true, but this should be checked into) it were the case that, where hash collisions do occur, that the original plaintext messages are necessarily of different lengths.
Not possible.
Suppose your hash function produces an output 100 bits long. There are then 2 ** 100 possible hashes. Now consider all files of length 200 bits. There are 2 ** 200 such files, so they can't all have a different hash value.
Doesn't it depend on whether your machine uses two's complement, one's complement or some other representation? Some architectures would allow -32767 to +32767 inclusive, a range of 65535 values.
You missed out the Doctor Evil voice and "quotation" gestures.
Agreed, when you need to optimize code and it becomes less obvious, comments are necessary. Maybe the rule is 'keep it simple, but if you can't keep it simple at least comment it'.
Yup, picking well-chosen and meaningful variable names does not mean making them as long and clunky as possible. Often 'i' is a good choice for a loop index, and 'msg' is probably better than 'message_string' (or worse, 'myMessageString' etc).
Yes, your code should read like a novel or at least like a well-written newspaper article or technical paper.
However, it should read like that _without_ comments! If you need to add long comments to make the code clear then fix the code first. In general, it is better to say something in code than in comments, for example 'const int x' is better than 'int x' plus a comment saying 'x will not be changed'. Well-chosen variable and subroutine names are also important. Finally arrange things in a sensible order: when writing you can either lay out the simple concepts first and use them to build up more complex things (like writing a mathematical proof) or you can start with a broad overview and then fill in the details. Either of these two styles may be appropriate depending on what your program does.
Remember: comment _how_ and _why_, not _what_.
I remember the old reliability test of Unix commands which showed that GNU versions were much less likely to crash or do odd things when given random or pathological input. I would have expected the same sort of results with free web browsers. Still, well done to Microsoft for making their HTML parsing code robust against this kind of bug.
I like mingw - fully native gcc on Windows (no Unix-emulation layer).
Liberty, fraternity, equality: pick any two.
A conventional 24-bit image file will have eight bits for red, green and blue for each pixel. But very often digital cameras don't have separate sensors for each pixel; they have alternating R G B sensors in a kind of chessboard arrangement, and then interpolate the missing values. This interpolation happens when you go from raw format to the final output, and it can be done by the camera itself or by a photo manipulation program on a PC.
A raw format file, while still storing all the data that has come off the image sensor, can be one third the size of a PNG because it knows that the first pixel has only red channel information, the second only green and so on.
There was a time when IBM's corporate motto was 'THINK!'.
Can you explain how the Cygwin installer works?
(FWIW, I usually make the effort to package obscure program X as an RPM myself, it's not hard. Then you keep the benefits of automated dependency resolution blah blah blah, and if the new package is added to a public repository then it's quickly available to everyone else, or to you on a different/rebuilt box.)
Why bother? Why not just mark the few bad addresses and stop using them? It doesn't matter if your one gibibit memory chip is actually 0.9999997 Gib because a few 4k pages have to be mapped out by the OS. See BadRAM.
Can you give examples of the 'surprising default settings and demonstrably anti-security minded UI features' in Firefox? I'd like to know what I need to turn off.
(There is that Password Manager thing which I never use...)
Stupid Slashdot HTML escaping: the URL is http://condorcet.org/rp/IRV.shtml
Please see for some reasons why IRV or STV is not a particularly good voting system, and a better alternative which is also easier to count.
Timidity started off as a Unix program IIRC... it just takes a midi file and some samples and outputs some raw audio. I agree with the principle of getting away from software, but with today's CPUs it makes very little difference (I remember running timidity on a 35MHz ARM chip and it was nearly fast enough for real time playback).
I think you can use timidity, which is a software MIDI synthesizer, with a set of instrument samples ('patch files'). Gravis used to put their patch files on their ftp site, I don't know if they're still there.
I thought most laser printers of that era had m68k processors or thereabouts - not likely to be more powerful than a 386. Perhaps they just had better floating point support, or this PC didn't have the 387 FPU fitted.
How did the professor get the results back from the printer? An old style parallel port is one-directional.
I tried Scribus but the font rendering on screen was terrible. This was with Fedora 2, which I expected to have reasonable font support (most apps look okay). I am not blaming Scribus, the problem is most likely that I installed a version built with the wrong options - built without Freetype support or something like that.
Anyone know where to get a build (preferably RPM binary package or RPM source package) of Scribus for Fedora/RH-like systems that shows good-looking, outline fonts on screen?
This seems to be the Linux equivalent of Trusted Computing.
Hmm I think I was confusing data=ordered and data=journal... never mind.
If reiser4 operates in data=ordered by default and the benchmarks are taken in that mode, then it's very impressive. I believe that ext3 for example takes a big performance hit (for many applications) with data=ordered.
I like the idea of data=ordered because of its 'no lies' property - if the kernel says the bytes have been written to the file, they have been - and if reiser4 can support that while keeping reasonable performance it would be good to switch.
Suppose I want to be helpful to my next-door neighbour and let him share my network connection. If I do so deliberately I am breaking my ISP's terms of service. But if I just leave the wireless router at its default open setting and drop a couple of hints...
Indeed, if you have a wireless network and your outbound Internet link isn't congested, there is not much reason not to share it. You do of course use SSH and other secure protocols for your networking...
The quality of the picture is mostly determined by the lens and by the quality of the individual RGB cells on the sensor - not by whether there are 2 million or 4 million of them or whatever. A 2 megapixel image is still higher resolution than you can view on anything but an expensive display (at 3:2 aspect ratio it would be roughly 1731x1154 pixels).
Some people do try to attach decent lenses to disposable camera bodies; I am tempted to troll by saying that you would get better images by spending $20 on the body and $230 on the lens than by spending $250 on a 'decent camera', but I suspect that's not really true except for specialized applications. Still, it is worth emphasizing that the number of megapixels doesn't mean much if your images will be mostly viewed on screen. Even for making prints it doesn't matter if they are small ones.
What if (and i'm not saying it is true, but this should be checked into) it were the case that, where hash collisions do occur, that the original plaintext messages are necessarily of different lengths.
Not possible.
Suppose your hash function produces an output 100 bits long. There are then 2 ** 100 possible hashes. Now consider all files of length 200 bits. There are 2 ** 200 such files, so they can't all have a different hash value.