"This just seems unsafe to me. Imagine something goes wrong and the train is stuck up at that altitude?"
"It also comes at the same time that the number of Chinese people living in extreme poverty rose by 800,000 last year"
These comments at least aren't reserved for China. Look at many NASA stories, and most about the shuttle. The debate if space travel is worth it, both for safety and economic issues, shows up quite a bit.
"Let me tell you a true story about immunization. When i was a little boy in New York City in the 1940s, we swam in the Hudson River. And it was filled with raw sewage. Okay? We swam in raw sewage! You know, to cool off.
"And at that time the big fear was polio; thousands of kids died from polio every year. But you know something? In my neighborhood no one ever got polio. No one. Ever! You know why? 'cause we swam in raw sewage! It strengthened our immune systems. The polio never had a prayer; we were tempered in raw shit!
"So, personally, I never take any special precautions against germs. I don't shy away from people who sneeze and cough, I don't wipe off the telephone, I don't cover the toilet seat, and if I drop food on the floor, I pick it up and eat it! I eat it! Yes I do! Even if I'm at a sidewalk cafe. In Calcutta. The poor section. On New Years morning during a soccer riot."
And you know something? In spite of all of that so-called risky behavior, I never get infections. I don't get 'em, folks. I don't get colds, I don't get flu, and I don't get food poisoning. And I don't get headaches or upset stomachs. And Ya know why? Because I have a good, strong immune system, and it gets a lot of practice.
"My immune system is equipped with the biological equivalent of fully automatic, military assault rifles with night vision and laser scopes. And we have recently acquired phosphorous grenades, cluster bombs, and anti-personnel fragmentation mines.
"So, when my white blood cells are on patrol, reconnoitering my blood stream, seeking out any strangers and other undesirables, if they see any - any - suspicious-looking germs of any kind, they don't fuck around. They whip out the weapons, wax the motherfucker, and deposit the unlucky fellow directly into my colon! There's no nonsense. There's no miranda warning, there's none of that three-strikes-and-you're-out shit. First offence, BAM! Into the colon you go."
-George Carlin
Re:15 Reasons to boycott IMDb
on
IMDb Turns 15
·
· Score: 1
Since the acquisition by Ama$on, IMDb has started using Flash-laden banner ads throughout their site. Some of these ads even include sound; these ads are not acceptable.
Block 'em. I know it'd be better if they didn't use them, but sounded ads are why I installed Flashblock.
To insert data into this database, such as photographs of my favourite actors, costs money. This was supposed to be a free site.
So that people don't submit bogus photos or ones they don't have licences for. Probably this is a liability decision more than anything.
(And, perhaps, a storage/bandwidth one.)
IMDb does not use proper HTML
You have a/. ID around the same value as mine. It's only about 15K higher. I don't know how long I've been registered, but it's been at least a few years.
Until recently,/. didn't validate. Did you register a long time ago, realize that/. doesn't use proper HTML, and leave for a couple years only to return a few weeks ago?
Are you arguing that switching or not doesn't matter? I assure you that it does.
Your mistake lay in assuming that all cases are equally likely.
You pick door 1, he removes 2 has 1/6 chance of occuring (1/3 chance of picking door 1 * 1/2 chance of him picking door 2) You pick door 1, he removes 3 has 1/6 chance You pick door 2, he removes 3 has 1/3 chance (1/3 chance of you picking door 2 * 1 because he's forced to remove 3) You pick door 3, he removes 2 has 1/3 chance
In the first two cases, switching makes you lose, and there's a 1/3 chance total of that happening. In the last two cases, switching makes you win, and there's a 2/3 chance of that happening.
The only thing it does is generate really wierd exceptions when you pull from a generalized class. For example.
In Java's defense here, I don't see any real way around that. Not allowing you to implicitly cast an Integer to an int breaks the autounboxing bit of sugar, and prohibiting you from putting null in a container is just wrong.
I'd say that Java has the best option here, with the possible exception that it might be nice to have a little nicer exception type or message.
In C++ you have to fiddle w/ virtual inheretance and can't make arbitrary inheretance.. If you get a 3'rd party library, it's possible that you physically can't composite multiple classes (due to collisions and lack of declared virtual inheretance).
Is this what you're talking about:
struct B1 { int foo() { return 0; } };
struct B2 { int foo() { return 1; } };
struct D: public B1, public B2 {};
Because if it is, that doesn't really present a problem; you just have to specify which foo D should use.
The requirement to declare a method as virtual is both a positive and negative.. Great for explicit definition of an OO heirarchy
I think from a pure OO standpoint, I like methods to be implicitly virtual rather than implicitly non-virtual, but that's just me.
I don't recall if C++ has the equivalent of Java's final modifier
No, it doesn't.
But, if you have a class that isn't in a heirarchy of your own, you can go along ways toward preventing effective reuse by making a public, non-virtual constructor. Deriving from such a class can open up a can of worms for anyone who does it without being careful.
Thanks to heavy use of interfaces... you get all the advantages... . The ONLY thing MI provides (and you correctly pointed out) is the lack of code-reuse.
Seems you contradict yourself there a bit.;-)
Also, it can in some sense lead to cleaner code and cleaner design. Look at all the places in Java where there is a class you can extend to get some functionality OR an interface you can use in case you're subclassing something else. Like if you want to make a thread, you can subclass Thread or implement Runnable. If you're writing Swing you can extend DefaultWindowListener or implement WindowListener. (I don't know if those are actual names, but you get the idea.)
Finally, the prevention of code-reuse can, in some cases, be a decent drawback.
I think I already mentioned this, but MI prevents you from defining a top-level Object class.
And again, I don't understand why. You might have to sort out if it inherits virtually or not (though if the object doesn't have state I think that's a meaningless bit anyway!), but I see no reason it can't be done.
If you want to have a function that accepts any type of data, you are forced to accept a void*.
In what case would you want to do this? I can only think of two. The first is if you're writing something like the sort of thread start methods you see in some languages where you can pass a void* parameter with information for the thread about what it should do. (Java doesn't do this for threads as you can store stuff in the Thread object's fields beforehand, but such a situation is certainly concievable.) The second is if you were writing something to deal with, say, JavaBeans and were using the reflection API to figure out what the methods are in the object.
In the former case, Java's method is admittedly a lot superior because it typechecks instead of causing massive explosions. In the latter situation you just flat out can't write something like that in C++ because of the lack of reflection.
(And reflection is perhaps at the top of my wish list for C++.)
I'm very confused as to how you could say this.. java.util.Hashtable is a java 1.0 feature.
Sorry, I worded my original statement pretty poorly. It should have said
But I'd argue they are an important bit of syntactic sugar for writing nice code. Again, a+b (to me) is A LOT nicer than add(a,b).
Java isn't very consistent in it's core API method naming conventions. map.add(.) mutates the object which stringBuffer.add(.) returns an immutable value-object. This is SUNs fault and hasn't been corrected yet.
Not to mention the ways of getting the size of a collection. Collections have a size() method, Strings a length() method, and arrays a length read-only property. Go consistancy!
Sorry, dated. System.out.printf("[%i,%s]\n",var1, var2); has worked since verion 1.5
Very interesting. I don't think I ran into that when I was reading about 1.5. Thanks for the correction.
(My experience with Java has been exclusively with 1.4. I've now done two projects with it; one was started before Java 5 was released, and one was written for a platform that hasn't yet had the Java 5 SDK ported to it. I have seen some things about 1.5 and have liked what I see, but I wasn't aware of this.)
Done! And thanks to auto-boxing, works with ALL primitives
See above with my (lack of) Java 5 experience. I was aware of autoboxing, I just didn't put it together to be used in that way.
Thanks to the foresite of java 1.0, the need for generics has not existed until only recently
In what manner? I haven't seen any benefits besides the lack of a need now to cast.
(And I'd say that it WAS needed before, because having to cast from object on every get or whatever leads to sloppy code and errors that can't be detected until runtime if you screw up the type. It was just that Sun took their time to get the implementation right and probably do higher priority things first.)
Something that was severely lacking in C++ (due to multi-inheretance)
Multiple inheritance shouldn't have anything to do with it.
(Oh, and MI is another thing I miss in Java. I have almost never used it, but when I have it's been a Godsend. I'd have really liked to have had it for my second project; there was one place it would have saved a couple hundred lines at least of duplicated code. (It wouldn't have been a good use from an OO design standpoint, but I'm reminded of the error-handling idiom of using gotos in the Linux kernel. Not good from an acedemic standpoint, but it gives much cleaner code and is good from an engineering standpoint.)
Any specific capabilities use interfaces or interface markers (like clone or serializable)
Stuff that C++ mostly doesn't need because of templates.
Moreover, the Collections is INSANELY useful.. Pretty much providing an open-source hand-book to almost all computer science class problems. The bane to any CISC teacher. sort, binarySearch, shuffle, min,max, reverse and others.
Most of which is in the STL. The only major thing in Java.Util that's missing (which, admittedly, is a pretty big omission) is a hash table. Other things that are missing (e.g. regular expressions, threads) are available in other free, high quality libraries like Boost. (With a BSD style, not copyleft license.)
Sorry, my opinion is that Java is one of the most pleasant languages to program in for just about any sized project. I grew up on C++ and C.. Later in perl
To each his own. I don't really like programming in Java because I feel like the language is boxing me in, preventing me from doing things that I think I should be able to coming from a C++ background.
It's getting better, but I still prefer C++.
(I'm not trying to dis you by the way, it really is a personal preference.)
Similarily, I think the debate over operator overloading comes down to preference. I think the readibility benefits gained outweigh the potential for abuse. You feel that the problems of abuse outweigh the readability benefits. Whatever.
First, it's not "far" above; it's only a couple kHz. 20 kHz is the number that I most often see for human ranges. The first link in a Google search for "hearing ranges" even gives 23kHz as an upper bound, which is above your Nyquest frequency for CDs and barely below the 48kHz that the X-Fi resamples to. (Not that I think that frequencies that high would add much.)
I have a sine wave generator program and can clearly hear 17 kHz. Above that there's not a clean sound, and it sounds like there may be artifacts being introduced. (For instance, 18 kHz fades in and out in volume. 20kHz sounds like a buzz at a LOT lower frequency.) Thus I can't give you my personal upper range.
Second, a couple other posts I've seen say that a higher sample rate simplifies the design of a low-pass filter. I don't know if this is true because I don't know enough signal processing stuff, but I didn't see any rebukes.
Upsampling a crappy mp3 will theoretically give you exactly the same crappy mp3. Not more accurate. Whoever did Creative's marketing should be fined for false advertising practices.
Ah, and there's the rub. They don't say it's more *accurate*, they say it's *better*.
My friend was going through a bunch of photos of relatives. One would have been a pretty good picture if it weren't so dark. Playing with the levels in photoshop for a bit brightened it up, but it was grainy in places. Blurring it relieved some of the graininess. Both of us thought it looked BETTER after blurring, despite the blurring being an irreversible process.
It's the same deal with sound; it's perfectly conceivable that it'd be possible to filter the sound so that the subjective quality improves for most people despite the accuracy going down.
Look at java's "toString" function.. It's identical in inception to a 1'st class operator
Um, except for the whole operator part.
Something defined for all objects and can be overloaded
Operators needn't be defined for all objects. In C++, vector<int> a, b; a = a + b doesn't work. That's because + isn't defined on vectors.
Java could have had operator overloading if they merely implemented in the Object class something called Object.add(Object o);
No, then there'd be a method called add. Java could have had operator overloading if you could write a + b if a had an add method that could take b as a parameter. You should review what operator overloading is. It provides an alternate syntax for method calls; a + b gets translated to a.operator+(b). (Assuming operator+ is a member function and not a free function yadda yadda yadda.)
You could easily create a base interface for all your worker objects. interface Mathable { E add(E); E sub(E);... } Then you'd have identical functionality to operator overloading...except for the whole operator overloading bit. Again, review above. Operator overloading would let me write Complex a, b, c;... a = b + c;
The bottom line: Operator overloading is a tool. It can be misused. There's even a proposal before the C++0x standard committee to allow the following: vector<int> v; v += 1, 2, 3; to add 1 2 and 3 to the vector. This is (IMO) an abuse of OO. It doesn't make sense. Your example of giving generic widgets an add method doesn't make sense. So it shouldn't be done.
But if I'm writing a complex number class, or a rational number class, I sure as heck would like to be able to say a + b instead of a.add(b), especially as the latter to me seems more like a += b than returning the sum without a side effect.
It also allows a lot of other nice things. I'm a fan of cout in C++. I think cout << a << b; is a lot more readable than out.print(a); out.print(b);. You can't write an equivalent to printf in Java because you can't have a variable length parameter list.
Finally, admittedly, operator overloading in Java would be little more than syntactic sugar. However, in C++ it's very important to generic programming. Operator overloading allows you to write, for instance, the valarray template class so that it will work with any data type. Or std::max: template <typename T> T max(T const & a, T const & b) {
return ( a>b ? a : b); } Without operator overloading, you could write that and have it work for primitive types but not classes or you could replace the > with a method call and have it work for class types but not primitives, but you couldn't have it both ways.
(Actually, that's not true. You could combine the two with some auxilary functions and template total specialization, but does that sound like fun? No way, and you'd wind up with a lot more duplicated code.)
Oh, and deligates are another "beyond-syntax" feature that C# has and Java doesn't that IMO leads to MUCH cleaner code for stuff like interface design.
"Too much syntactic sugar leads to code cavities", but C# has a LOT of syntactic niceties that Java doesn't. (Operator Overloading being a prime example.) Some benefits go beyond mere syntax, for instance generics support in.NET 2.0 is superior to Java 5's.
Your comments directly contradict the NY Times article...
The system works even when cellular calls do not because text messages are small packets of data that are easy to send, and because the companies transmit them on the high-priority channel whose main purpose is to set up cellphone calls.
Good luck designing a computer system that can safely land a extremely heavy aircraft at several hundred MPH
It's been done! For years!
Read the other comments in this thread, or something about autopilots. For instance, the Wikipedia entry, which states that "Modern autopilots generally divide a flight into taxi, take-off, ascent, level, descent, approach, landing, and taxi phases. Autopilots exist that automate all of these flight phases except the taxiing, and some incorporate automated collision-avoidance, as well."
(Oh, and BTW, your "several hundred MPH" is greatly overstating. For instance, the typical landing speed of an A340 is 140 knots, or 160 MPH. This says the landing speed of a 747-400 with full flaps is about 120 mph. (Another site said 160.) The 767 lands at 150 mph.)
Sadly, diesel's particulate emissions have recently been related to increased risks of asthma in children
Is this true even for recent engines?
I've heard that recent innovations in both diesel engines and fuel have mostly the drawbacks of diesel. (In fact, the linked CNN article has a link to another article about diesel that more or less says this.) Did I get the wrong idea?
But then of course, the only way they could (reasonably) do this, is to download a copy of the song from that person. But then, doesn't that mean they're committing the same crime as they are charging the person with? Is it legal to steal something back if it was stolen from you to begin with? (of course, this is a bad example; copyright infringment isn't theft, and it certainly isn't tangible, along with a civil action, not a criminal one.. yet).
Yes, it is a bad example, and flat out wrong on a couple points.
First, in the matter at hand, it would be perfectly fine for them to download from someone. They own the copyright, and have full rights to it.
Second (and much more shakily), I think that in most jurisdictions it IS legal to reclaim stolen property provided you don't break any other laws in the meantime. Perhaps SWIAL (someone who is a lawyer) can shed some light?
If judges were required on the other hand to impose upon a losing plaintiff the defendant's legal fees, the number of frivolous suits on both sides would fall dramatically -- perhaps to 5% of today's levels.
You'd also see a sharp falloff of risky but legitimate suits, and that's a bad thing.
What judges need is the leeway to order payment of the defendant's legal fees if the suit is particularily absurd; the requirement to do so makes the situation worse.
You can do both of those things in Word or OO too. It's just that most people don't.
And you can combine formatting and content in LaTeX. It's just that most people don't.
The only thing that you can say about LaTeX is that doing it the "right" way is often easier and rarely more than slightly more difficult than doing it wrong, whereas in Word/OO doing it the "right" ways is often slightly more difficult than doing it wrong.
"This just seems unsafe to me. Imagine something goes wrong and the train is stuck up at that altitude?"
"It also comes at the same time that the number of Chinese people living in extreme poverty rose by 800,000 last year"
These comments at least aren't reserved for China. Look at many NASA stories, and most about the shuttle. The debate if space travel is worth it, both for safety and economic issues, shows up quite a bit.
"Let me tell you a true story about immunization. When i was a little boy in New York City in the 1940s, we swam in the Hudson River. And it was filled with raw sewage. Okay? We swam in raw sewage! You know, to cool off.
"And at that time the big fear was polio; thousands of kids died from polio every year. But you know something? In my neighborhood no one ever got polio. No one. Ever! You know why? 'cause we swam in raw sewage! It strengthened our immune systems. The polio never had a prayer; we were tempered in raw shit!
"So, personally, I never take any special precautions against germs. I don't shy away from people who sneeze and cough, I don't wipe off the telephone, I don't cover the toilet seat, and if I drop food on the floor, I pick it up and eat it! I eat it! Yes I do! Even if I'm at a sidewalk cafe. In Calcutta. The poor section. On New Years morning during a soccer riot."
And you know something? In spite of all of that so-called risky behavior, I never get infections. I don't get 'em, folks. I don't get colds, I don't get flu, and I don't get food poisoning. And I don't get headaches or upset stomachs. And Ya know why? Because I have a good, strong immune system, and it gets a lot of practice.
"My immune system is equipped with the biological equivalent of fully automatic, military assault rifles with night vision and laser scopes. And we have recently acquired phosphorous grenades, cluster bombs, and anti-personnel fragmentation mines.
"So, when my white blood cells are on patrol, reconnoitering my blood stream, seeking out any strangers and other undesirables, if they see any - any - suspicious-looking germs of any kind, they don't fuck around. They whip out the weapons, wax the motherfucker, and deposit the unlucky fellow directly into my colon! There's no nonsense. There's no miranda warning, there's none of that three-strikes-and-you're-out shit. First offence, BAM! Into the colon you go."
-George Carlin
Since the acquisition by Ama$on, IMDb has started using Flash-laden banner ads throughout their site. Some of these ads even include sound; these ads are not acceptable.
/. ID around the same value as mine. It's only about 15K higher. I don't know how long I've been registered, but it's been at least a few years.
/. didn't validate. Did you register a long time ago, realize that /. doesn't use proper HTML, and leave for a couple years only to return a few weeks ago?
Block 'em. I know it'd be better if they didn't use them, but sounded ads are why I installed Flashblock.
To insert data into this database, such as photographs of my favourite actors, costs money. This was supposed to be a free site.
So that people don't submit bogus photos or ones they don't have licences for. Probably this is a liability decision more than anything.
(And, perhaps, a storage/bandwidth one.)
IMDb does not use proper HTML
You have a
Until recently,
Are you arguing that switching or not doesn't matter? I assure you that it does.
Your mistake lay in assuming that all cases are equally likely.
You pick door 1, he removes 2 has 1/6 chance of occuring (1/3 chance of picking door 1 * 1/2 chance of him picking door 2)
You pick door 1, he removes 3 has 1/6 chance
You pick door 2, he removes 3 has 1/3 chance (1/3 chance of you picking door 2 * 1 because he's forced to remove 3)
You pick door 3, he removes 2 has 1/3 chance
In the first two cases, switching makes you lose, and there's a 1/3 chance total of that happening. In the last two cases, switching makes you win, and there's a 2/3 chance of that happening.
x^2 = x * x = x + x + ... + x (x terms)
d(x^2)/dx = 2x
d(x^2)/dx = d(x+x+...+x)/dx = 1+1+...+1 (x terms) = x
2x = x
2 = 1, provided x != 0.
The only thing it does is generate really wierd exceptions when you pull from a generalized class. For example.
... you get all the advantages ... . The ONLY thing MI provides (and you correctly pointed out) is the lack of code-reuse.
;-)
In Java's defense here, I don't see any real way around that. Not allowing you to implicitly cast an Integer to an int breaks the autounboxing bit of sugar, and prohibiting you from putting null in a container is just wrong.
I'd say that Java has the best option here, with the possible exception that it might be nice to have a little nicer exception type or message.
In C++ you have to fiddle w/ virtual inheretance and can't make arbitrary inheretance.. If you get a 3'rd party library, it's possible that you physically can't composite multiple classes (due to collisions and lack of declared virtual inheretance).
Is this what you're talking about:
struct B1 { int foo() { return 0; } };
struct B2 { int foo() { return 1; } };
struct D: public B1, public B2 {};
Because if it is, that doesn't really present a problem; you just have to specify which foo D should use.
The requirement to declare a method as virtual is both a positive and negative.. Great for explicit definition of an OO heirarchy
I think from a pure OO standpoint, I like methods to be implicitly virtual rather than implicitly non-virtual, but that's just me.
I don't recall if C++ has the equivalent of Java's final modifier
No, it doesn't.
But, if you have a class that isn't in a heirarchy of your own, you can go along ways toward preventing effective reuse by making a public, non-virtual constructor. Deriving from such a class can open up a can of worms for anyone who does it without being careful.
Thanks to heavy use of interfaces
Seems you contradict yourself there a bit.
Also, it can in some sense lead to cleaner code and cleaner design. Look at all the places in Java where there is a class you can extend to get some functionality OR an interface you can use in case you're subclassing something else. Like if you want to make a thread, you can subclass Thread or implement Runnable. If you're writing Swing you can extend DefaultWindowListener or implement WindowListener. (I don't know if those are actual names, but you get the idea.)
Finally, the prevention of code-reuse can, in some cases, be a decent drawback.
I think I already mentioned this, but MI prevents you from defining a top-level Object class.
And again, I don't understand why. You might have to sort out if it inherits virtually or not (though if the object doesn't have state I think that's a meaningless bit anyway!), but I see no reason it can't be done.
If you want to have a function that accepts any type of data, you are forced to accept a void*.
In what case would you want to do this? I can only think of two. The first is if you're writing something like the sort of thread start methods you see in some languages where you can pass a void* parameter with information for the thread about what it should do. (Java doesn't do this for threads as you can store stuff in the Thread object's fields beforehand, but such a situation is certainly concievable.) The second is if you were writing something to deal with, say, JavaBeans and were using the reflection API to figure out what the methods are in the object.
In the former case, Java's method is admittedly a lot superior because it typechecks instead of causing massive explosions. In the latter situation you just flat out can't write something like that in C++ because of the lack of reflection.
(And reflection is perhaps at the top of my wish list for C++.)
I'm very confused as to how you could say this.. java.util.Hashtable is a java 1.0 feature.
Sorry, I worded my original statement pretty poorly. It should have said
Operators are pure syntactic sugar.
Yes, I know. You'll notice I said that.
But I'd argue they are an important bit of syntactic sugar for writing nice code. Again, a+b (to me) is A LOT nicer than add(a,b).
Java isn't very consistent in it's core API method naming conventions. map.add(.) mutates the object which stringBuffer.add(.) returns an immutable value-object. This is SUNs fault and hasn't been corrected yet.
Not to mention the ways of getting the size of a collection. Collections have a size() method, Strings a length() method, and arrays a length read-only property. Go consistancy!
Sorry, dated.
System.out.printf("[%i,%s]\n",var1, var2);
has worked since verion 1.5
Very interesting. I don't think I ran into that when I was reading about 1.5. Thanks for the correction.
(My experience with Java has been exclusively with 1.4. I've now done two projects with it; one was started before Java 5 was released, and one was written for a platform that hasn't yet had the Java 5 SDK ported to it. I have seen some things about 1.5 and have liked what I see, but I wasn't aware of this.)
Done! And thanks to auto-boxing, works with ALL primitives
See above with my (lack of) Java 5 experience. I was aware of autoboxing, I just didn't put it together to be used in that way.
Thanks to the foresite of java 1.0, the need for generics has not existed until only recently
In what manner? I haven't seen any benefits besides the lack of a need now to cast.
(And I'd say that it WAS needed before, because having to cast from object on every get or whatever leads to sloppy code and errors that can't be detected until runtime if you screw up the type. It was just that Sun took their time to get the implementation right and probably do higher priority things first.)
Something that was severely lacking in C++ (due to multi-inheretance)
Multiple inheritance shouldn't have anything to do with it.
(Oh, and MI is another thing I miss in Java. I have almost never used it, but when I have it's been a Godsend. I'd have really liked to have had it for my second project; there was one place it would have saved a couple hundred lines at least of duplicated code. (It wouldn't have been a good use from an OO design standpoint, but I'm reminded of the error-handling idiom of using gotos in the Linux kernel. Not good from an acedemic standpoint, but it gives much cleaner code and is good from an engineering standpoint.)
Any specific capabilities use interfaces or interface markers (like clone or serializable)
Stuff that C++ mostly doesn't need because of templates.
Moreover, the Collections is INSANELY useful.. Pretty much providing an open-source hand-book to almost all computer science class problems. The bane to any CISC teacher. sort, binarySearch, shuffle, min,max, reverse and others.
Most of which is in the STL. The only major thing in Java.Util that's missing (which, admittedly, is a pretty big omission) is a hash table. Other things that are missing (e.g. regular expressions, threads) are available in other free, high quality libraries like Boost. (With a BSD style, not copyleft license.)
Sorry, my opinion is that Java is one of the most pleasant languages to program in for just about any sized project. I grew up on C++ and C.. Later in perl
To each his own. I don't really like programming in Java because I feel like the language is boxing me in, preventing me from doing things that I think I should be able to coming from a C++ background.
It's getting better, but I still prefer C++.
(I'm not trying to dis you by the way, it really is a personal preference.)
Similarily, I think the debate over operator overloading comes down to preference. I think the readibility benefits gained outweigh the potential for abuse. You feel that the problems of abuse outweigh the readability benefits. Whatever.
First, it's not "far" above; it's only a couple kHz. 20 kHz is the number that I most often see for human ranges. The first link in a Google search for "hearing ranges" even gives 23kHz as an upper bound, which is above your Nyquest frequency for CDs and barely below the 48kHz that the X-Fi resamples to. (Not that I think that frequencies that high would add much.)
I have a sine wave generator program and can clearly hear 17 kHz. Above that there's not a clean sound, and it sounds like there may be artifacts being introduced. (For instance, 18 kHz fades in and out in volume. 20kHz sounds like a buzz at a LOT lower frequency.) Thus I can't give you my personal upper range.
Second, a couple other posts I've seen say that a higher sample rate simplifies the design of a low-pass filter. I don't know if this is true because I don't know enough signal processing stuff, but I didn't see any rebukes.
Upsampling a crappy mp3 will theoretically give you exactly the same crappy mp3. Not more accurate. Whoever did Creative's marketing should be fined for false advertising practices.
Ah, and there's the rub. They don't say it's more *accurate*, they say it's *better*.
My friend was going through a bunch of photos of relatives. One would have been a pretty good picture if it weren't so dark. Playing with the levels in photoshop for a bit brightened it up, but it was grainy in places. Blurring it relieved some of the graininess. Both of us thought it looked BETTER after blurring, despite the blurring being an irreversible process.
It's the same deal with sound; it's perfectly conceivable that it'd be possible to filter the sound so that the subjective quality improves for most people despite the accuracy going down.
FlashBlock with Firefox. I didn't used to block anything but popups, but when they started to use sound in ds, I was fed up.
You could combine the two with some auxilary functions and template total specialization
Partial, not total. My bad.
Oh yeah, and, for instance, VC++ hasn't supported that until the latest version. Good luck writing a proper max function without.
Look at java's "toString" function.. It's identical in inception to a 1'st class operator
... } Then you'd have identical functionality to operator overloading ...except for the whole operator overloading bit. Again, review above. Operator overloading would let me write ...
Um, except for the whole operator part.
Something defined for all objects and can be overloaded
Operators needn't be defined for all objects. In C++,
vector<int> a, b;
a = a + b
doesn't work. That's because + isn't defined on vectors.
Java could have had operator overloading if they merely implemented in the Object class something called Object.add(Object o);
No, then there'd be a method called add. Java could have had operator overloading if you could write a + b if a had an add method that could take b as a parameter. You should review what operator overloading is. It provides an alternate syntax for method calls; a + b gets translated to a.operator+(b). (Assuming operator+ is a member function and not a free function yadda yadda yadda.)
You could easily create a base interface for all your worker objects. interface Mathable { E add(E); E sub(E);
Complex a, b, c;
a = b + c;
The bottom line:
Operator overloading is a tool. It can be misused. There's even a proposal before the C++0x standard committee to allow the following:
vector<int> v;
v += 1, 2, 3;
to add 1 2 and 3 to the vector. This is (IMO) an abuse of OO. It doesn't make sense. Your example of giving generic widgets an add method doesn't make sense. So it shouldn't be done.
But if I'm writing a complex number class, or a rational number class, I sure as heck would like to be able to say a + b instead of a.add(b), especially as the latter to me seems more like a += b than returning the sum without a side effect.
It also allows a lot of other nice things. I'm a fan of cout in C++. I think cout << a << b; is a lot more readable than out.print(a); out.print(b);. You can't write an equivalent to printf in Java because you can't have a variable length parameter list.
Finally, admittedly, operator overloading in Java would be little more than syntactic sugar. However, in C++ it's very important to generic programming. Operator overloading allows you to write, for instance, the valarray template class so that it will work with any data type. Or std::max:
template <typename T>
T max(T const & a, T const & b)
{
return ( a>b ? a : b);
}
Without operator overloading, you could write that and have it work for primitive types but not classes or you could replace the > with a method call and have it work for class types but not primitives, but you couldn't have it both ways.
(Actually, that's not true. You could combine the two with some auxilary functions and template total specialization, but does that sound like fun? No way, and you'd wind up with a lot more duplicated code.)
Oh, and deligates are another "beyond-syntax" feature that C# has and Java doesn't that IMO leads to MUCH cleaner code for stuff like interface design.
C# is just java like syntax for .NET.
.NET 2.0 is superior to Java 5's.
"Too much syntactic sugar leads to code cavities", but C# has a LOT of syntactic niceties that Java doesn't. (Operator Overloading being a prime example.) Some benefits go beyond mere syntax, for instance generics support in
Do you have a source?
Good luck designing a computer system that can safely land a extremely heavy aircraft at several hundred MPH
It's been done! For years!
Read the other comments in this thread, or something about autopilots. For instance, the Wikipedia entry, which states that "Modern autopilots generally divide a flight into taxi, take-off, ascent, level, descent, approach, landing, and taxi phases. Autopilots exist that automate all of these flight phases except the taxiing, and some incorporate automated collision-avoidance, as well."
(Oh, and BTW, your "several hundred MPH" is greatly overstating. For instance, the typical landing speed of an A340 is 140 knots, or 160 MPH. This says the landing speed of a 747-400 with full flaps is about 120 mph. (Another site said 160.) The 767 lands at 150 mph.)
3. Pilots, confused and unable to acknowledge warning in time, watch in horror as their plane descends into other traffic at lower flight level.
I have an alternate ending even if this takes place.
4. After regaining composure after being thoroughly embarassed by their lack of training, pilots disable autopilot descent.
You don't have to make it so that it's only overrideable at the start...
Sadly, diesel's particulate emissions have recently been related to increased risks of asthma in children
Is this true even for recent engines?
I've heard that recent innovations in both diesel engines and fuel have mostly the drawbacks of diesel. (In fact, the linked CNN article has a link to another article about diesel that more or less says this.) Did I get the wrong idea?
But then of course, the only way they could (reasonably) do this, is to download a copy of the song from that person. But then, doesn't that mean they're committing the same crime as they are charging the person with? Is it legal to steal something back if it was stolen from you to begin with? (of course, this is a bad example; copyright infringment isn't theft, and it certainly isn't tangible, along with a civil action, not a criminal one.. yet).
Yes, it is a bad example, and flat out wrong on a couple points.
First, in the matter at hand, it would be perfectly fine for them to download from someone. They own the copyright, and have full rights to it.
Second (and much more shakily), I think that in most jurisdictions it IS legal to reclaim stolen property provided you don't break any other laws in the meantime. Perhaps SWIAL (someone who is a lawyer) can shed some light?
If judges were required on the other hand to impose upon a losing plaintiff the defendant's legal fees, the number of frivolous suits on both sides would fall dramatically -- perhaps to 5% of today's levels.
You'd also see a sharp falloff of risky but legitimate suits, and that's a bad thing.
What judges need is the leeway to order payment of the defendant's legal fees if the suit is particularily absurd; the requirement to do so makes the situation worse.
Holy cow. Just when you thought you were already amazed at what the brain does, it goes and pulls another trick out of its bag.
(It amazes me how amazing the brain is at some things but how sucky it is at others, like keeping things in short term memory.)
And, on a only slightly related note, your grammar checker can't use LaTeX. At least I know of none that can.
Sure, Word's is, uh, less than ideal, but I still think it's better than nothing.
You can do both of those things in Word or OO too. It's just that most people don't.
And you can combine formatting and content in LaTeX. It's just that most people don't.
The only thing that you can say about LaTeX is that doing it the "right" way is often easier and rarely more than slightly more difficult than doing it wrong, whereas in Word/OO doing it the "right" ways is often slightly more difficult than doing it wrong.
this is why Windows has, since at least Windows 2000, supported "hard links"
Which are oh-so-easy to use.
I had to d/l a third party tool to be able to do that effectively...
Now you can't create a link across different partitions, but you can create links across the same partition
You can link directories across partitions.
Wait... wait...
Why iexplore.exe?
Why not add an ID3 tag to itself?
What will happen then?