Note I said that if monkeys can't distinguish the colours, they can't _have_ a preference. Not that a badly designed experiment with a too-small data set might not _see_ a preference that doesn't really exist.
Since the experiment did find monkeys have a preference, and we assume the scientists were not stupid and applied the normal statistical tests to make sure their result was real and not an artefact of a small sample size, we can conclude the monkeys can distinguish between the three kinds of M&M. (That doesn't prove they used colour vision to do so; perhaps the red food dye smells a bit different to the green one. But they are certainly able to distinguish somehow.)
If monkeys were unable to reliably distinguish red, blue and green M&Ms, then they would have no systematic preference for one colour over another, and the experiment would not have found statistically significant evidence for such a preference (whatever its cause). However the experiments did find the monkeys have preferences about which colours they like.
You could equally well run the experiment with three types of treat - say peanuts, brazil nuts and pecan nuts - as long as individual monkeys have preferences among them and not all monkeys have the same preference. Whether these preferences exist you can check beforehand with a simpler experiment, before you waste valuable monkey-hours on running the psychology one.
You might argue that Frauenhofer would not have done the R&D to develop the MP3 encoding without the expectation they could get software patents and charge people for them. Then again, other formats like Ogg Vorbis were developed freely (even if MP3 came first).
Even if such cases do exist, they are more than outweighed by the cases where innovation is blocked, not promoted, by patent minefields.
6 bit panels (as opposed to 8 bit panels) do not lose the 2 MSB; they lose the 2 LSB.
I don't see the difference; either way you can display only 64 grey levels instead of 256, and whether you choose to number them 0,1,2,...,63 or 0,4,8,12,...,252 is just a difference of notation.
256 grey levels is more than the human eye can normally distinguish, so you can see a smooth grey scale with no 'jumps'. 64 grey levels is respectable, but not quite a match for the eye's power. I agree that most of the time someone viewing such a display will not notice; still given Apple's traditional customer base in graphics-heavy industries where good colour reproduction is essential, I'm surprised they would cut corners like this.
By convention, the 'colour' of a pixel on a computer display is the sum of the three R,G,B components. So you can talk of a 256 colour image, a four colour image, and so on, even though at a low level they're just different intensities of the three primary colours. This is certainly the definition Apple and other manufacturers rely on when they say 'millions of colours'. By this reckoning a 6-bit RGB display has only about a quarter of a million colours.
I expect it's just a mistake by someone clueless in the advertising department, who thought that 'millions of colours' was the standard marketing word for any colour display, without bothering to check it. But still, companies' claims about their products need to be accurate, so I hope the suit succeeds in getting some kind of redress.
I don't have a Mac, but I do sometimes buy computer monitors. I can understand specifications like the physical size, resolution, viewing angle and (just about) contrast ratio. But do manufacturers publish specs on what colour depth is supported? Is there some quantitative measure of how well a display shows different colours and how wide the gamut is? How can I avoid getting caught out like these hapless iMac buyers?
The data cannot be subpoena'd if it does not exist. Why does his system keep records of who said what to whom? And if it needs the records, why doesn't it delete them after a short period? And if the system does keep an archive, why didn't he delete it manually before now, if people's privacy is so important?
Way too slow... you know that a program that gives the wrong answer twice as fast is no use. Of course for speed-critical numerical code you'd give a pragma to the compiler to enable unchecked arithmetic. But personally I'd prefer the default to be something sane. You're right though that much existing code may stuff ints into unsigned ints and back again.
For fun I hacked up a bounded_int class that checks at compile time that arithmetic operations are safe. For example
bounded_int<0, 10> a = 5; bounded_int<0, 20> b; b = a; b = 2 * a; b = 3 * a;// compile time error - you need to use an explicit cast, which might throw
This could be useful if you want to be completely anal about the ranges of your numbers (I believe Ada has something similar). And it has no run time cost (there is also an unsafe, unchecked conversion you can use if you really want).
Way too slow... you know that a program that gives the wrong answer twice as fast is no use. Of course for speed-critical numerical code you'd give a pragma to the compiler to enable unchecked arithmetic. But personally I'd prefer the default to be something sane. You're right though that much existing code may stuff ints into unsigned ints and back again.
For fun I hacked up a bounded_int class that checks at compile time that arithmetic operations are safe. For example
bounded_int a = 5; bounded_int b; b = a; b = 2 * a; b = 3 * a;// compile time error - you need to use an explicit cast, which might throw
This could be useful if you want to be completely anal about the ranges of your numbers (I believe Ada has something similar). And it has no run time cost (there is also an unsafe, unchecked conversion you can use if you really want).
signed integer overflow is undefined behavior in C++ (and C)
In that case, why on earth don't C++ compilers generate code that throws an exception when signed overflow occurs? They'd be conforming to the standard by doing so, since any behaviour is allowed, and it would avoid a whole class of bugs, gotchas and security holes.
Others pointed out the size_t versus int problem. gcc -Wsign-conversion will catch it; I am surprised that this isn't included in -Wall.
In general, I agree that silent signed/unsigned or integer overflows are the biggest problem with C++ (and with C). The standard library really needs to include a safe integer type that throws an exception on overflow rather than silently giving the wrong answer.
Does any of the code in Stroustrup's book have this bug I wonder?
One example that comes to mind is version control; something like darcs or git has no equivalent in proprietary software. Most of the Internet's infrastructure has a good implementation available as free software (the BSD TCP/IP stack, Apache, postfix, etc.) and proprietary alternatives are indeed inferior copies.
BTW, don't confuse for-profit with proprietary. Red Hat and Novell are for-profit companies but they write a lot of free software. The important thing is freedom, not price.
I think the EnterpriseDB extensions are for companies currently using Oracle who want a cheaper alternative. They do not affect the core Postgres development.
Note that MySQL AB is also free to distribute proprietary extensions to MySQL, since they own the copyright. And this is much more likely to affect MySQL core development, since you have the same company maintaining the free version and trying to sell proprietary addons.
it may be of value to briefly discuss the essential concept of regular expressions,
Before you say this, make sure you know what that concept is.
A regular expression can be thought of as a program which generates a set of strings - or recognizes a set of strings, which is the same thing. Regular expressions correspond to finite state automatons, so just as a FSA cannot recognize the set of all palindromes, neither can a regular expression. Also languages like perl have extended the capabilities of their regular expression string matchers to include things like backreferences, which cannot be done in a true regular expression, so we tend to use the word 'regexp' nowadays.
Or perhaps I'm just playing the grumpy computer scientist here.
They have their code but they can no longer install it on the devices because the manufacturer has retrospectively revoked their access. As has often been pointed out, just having the source code doesn't mean you have control over the computer you bought. This is exactly the issue GPLv3 is designed to deal with.
Note I said that if monkeys can't distinguish the colours, they can't _have_ a preference. Not that a badly designed experiment with a too-small data set might not _see_ a preference that doesn't really exist.
Since the experiment did find monkeys have a preference, and we assume the scientists were not stupid and applied the normal statistical tests to make sure their result was real and not an artefact of a small sample size, we can conclude the monkeys can distinguish between the three kinds of M&M. (That doesn't prove they used colour vision to do so; perhaps the red food dye smells a bit different to the green one. But they are certainly able to distinguish somehow.)
If monkeys were unable to reliably distinguish red, blue and green M&Ms, then they would have no systematic preference for one colour over another, and the experiment would not have found statistically significant evidence for such a preference (whatever its cause). However the experiments did find the monkeys have preferences about which colours they like.
You could equally well run the experiment with three types of treat - say peanuts, brazil nuts and pecan nuts - as long as individual monkeys have preferences among them and not all monkeys have the same preference. Whether these preferences exist you can check beforehand with a simpler experiment, before you waste valuable monkey-hours on running the psychology one.
Yeah, I'm sure the standards of government competence and honesty in China, India and Russia easily outstrip those in backward countries like the USA.
You might argue that Frauenhofer would not have done the R&D to develop the MP3 encoding without the expectation they could get software patents and charge people for them. Then again, other formats like Ogg Vorbis were developed freely (even if MP3 came first).
Even if such cases do exist, they are more than outweighed by the cases where innovation is blocked, not promoted, by patent minefields.
A fab is not an acronym, unless you are one of the Tracy brothers.
Who cares about movies? I want a complete Fedora install for all supported architectures, with source code, on a single disc.
How thoughtless of them! What could possibly be more important than a multiplayer online game?
256 grey levels is more than the human eye can normally distinguish, so you can see a smooth grey scale with no 'jumps'. 64 grey levels is respectable, but not quite a match for the eye's power. I agree that most of the time someone viewing such a display will not notice; still given Apple's traditional customer base in graphics-heavy industries where good colour reproduction is essential, I'm surprised they would cut corners like this.
By convention, the 'colour' of a pixel on a computer display is the sum of the three R,G,B components. So you can talk of a 256 colour image, a four colour image, and so on, even though at a low level they're just different intensities of the three primary colours. This is certainly the definition Apple and other manufacturers rely on when they say 'millions of colours'. By this reckoning a 6-bit RGB display has only about a quarter of a million colours.
I expect it's just a mistake by someone clueless in the advertising department, who thought that 'millions of colours' was the standard marketing word for any colour display, without bothering to check it. But still, companies' claims about their products need to be accurate, so I hope the suit succeeds in getting some kind of redress.
I don't have a Mac, but I do sometimes buy computer monitors. I can understand specifications like the physical size, resolution, viewing angle and (just about) contrast ratio. But do manufacturers publish specs on what colour depth is supported? Is there some quantitative measure of how well a display shows different colours and how wide the gamut is? How can I avoid getting caught out like these hapless iMac buyers?
The data cannot be subpoena'd if it does not exist. Why does his system keep records of who said what to whom? And if it needs the records, why doesn't it delete them after a short period? And if the system does keep an archive, why didn't he delete it manually before now, if people's privacy is so important?
Way too slow... you know that a program that gives the wrong answer twice as fast is no use. Of course for speed-critical numerical code you'd give a pragma to the compiler to enable unchecked arithmetic. But personally I'd prefer the default to be something sane. You're right though that much existing code may stuff ints into unsigned ints and back again.
// compile time error - you need to use an explicit cast, which might throw
For fun I hacked up a bounded_int class that checks at compile time that arithmetic operations are safe. For example
bounded_int<0, 10> a = 5;
bounded_int<0, 20> b;
b = a;
b = 2 * a;
b = 3 * a;
This could be useful if you want to be completely anal about the ranges of your numbers (I believe Ada has something similar). And it has no run time cost (there is also an unsafe, unchecked conversion you can use if you really want).
Way too slow... you know that a program that gives the wrong answer twice as fast is no use. Of course for speed-critical numerical code you'd give a pragma to the compiler to enable unchecked arithmetic. But personally I'd prefer the default to be something sane. You're right though that much existing code may stuff ints into unsigned ints and back again.
// compile time error - you need to use an explicit cast, which might throw
For fun I hacked up a bounded_int class that checks at compile time that arithmetic operations are safe. For example
bounded_int a = 5;
bounded_int b;
b = a;
b = 2 * a;
b = 3 * a;
This could be useful if you want to be completely anal about the ranges of your numbers (I believe Ada has something similar). And it has no run time cost (there is also an unsafe, unchecked conversion you can use if you really want).
Just like any other day of the year then?
Others pointed out the size_t versus int problem. gcc -Wsign-conversion will catch it; I am surprised that this isn't included in -Wall.
In general, I agree that silent signed/unsigned or integer overflows are the biggest problem with C++ (and with C). The standard library really needs to include a safe integer type that throws an exception on overflow rather than silently giving the wrong answer.
Does any of the code in Stroustrup's book have this bug I wonder?
Or indeed Paint.NET on Linux.
One example that comes to mind is version control; something like darcs or git has no equivalent in proprietary software. Most of the Internet's infrastructure has a good implementation available as free software (the BSD TCP/IP stack, Apache, postfix, etc.) and proprietary alternatives are indeed inferior copies.
BTW, don't confuse for-profit with proprietary. Red Hat and Novell are for-profit companies but they write a lot of free software. The important thing is freedom, not price.
I think the EnterpriseDB extensions are for companies currently using Oracle who want a cheaper alternative. They do not affect the core Postgres development.
Note that MySQL AB is also free to distribute proprietary extensions to MySQL, since they own the copyright. And this is much more likely to affect MySQL core development, since you have the same company maintaining the free version and trying to sell proprietary addons.
A regular expression can be thought of as a program which generates a set of strings - or recognizes a set of strings, which is the same thing. Regular expressions correspond to finite state automatons, so just as a FSA cannot recognize the set of all palindromes, neither can a regular expression. Also languages like perl have extended the capabilities of their regular expression string matchers to include things like backreferences, which cannot be done in a true regular expression, so we tend to use the word 'regexp' nowadays.
Or perhaps I'm just playing the grumpy computer scientist here.
They have their code but they can no longer install it on the devices because the manufacturer has retrospectively revoked their access. As has often been pointed out, just having the source code doesn't mean you have control over the computer you bought. This is exactly the issue GPLv3 is designed to deal with.