Thanks for the clarification, but you didn't need to be belligerent him. I didn't know that stuff about sand, and I bet 99% of the readers didn't either. This illustrates exactly why those signs are so meaningless: they are put up there, but nobody really knows what they refer to or why.
If you visit Palm Springs, CA there is a trolley car that rides a steel cable up to one of the mountains. It's picturesque: woods, an old lodge, hiking trails, snow. The narrator in the trolley even tells you to take a deep breath and take-in the cleanest air you will ever smell. Inside that trolley, is a Proposition 65 sign "WARNING THIS AREA CONTAINS A CHEMICAL KNOWN TO THE STATE OF CALIFORNIA TO CAUSE CANCER OR BIRTH DEFECTS OR OTHER REPRODUCTIVE HARM"
My guess is that some material used to build the trolley itself is a carcinogen. The trolley driver didn't know what it was. Since I don't spend 18 hours a day eating parts of the trolley, it probably doesn't really matter to me. But if I were working in there I would want to find out. My second guess is that the window washing fluid or some other cleaning fluid contains a carcinogen. But is that really important enough to put up a sign?
It is incredible how far some go to defend apple in every aspect.
I didn't defend the iphone. I didn't think it was attacked. My post was making fun of Nokia.
So now even the scarcity in models and functionality is a good thing?
I didn't mention anything about functionality. From all that I read, I doubt the functionality is scarce.
Would it also be better if every car brand would have only a single model, and every TV producer or computer producer would have only 1 model in order not to confuse the poor customers?
No.
Once I intended to buy an apple mini, but remarks like this make me really hate apple.
You decided not to buy something because people had too many good things to say about it?
oh, yes, about about the atoi example. I know you will say to use a stringstream, and that is somewhat better. But it is still ugly and is much slower (I've benchmarked it on MSVC and GCC - string streams were orders of magnitude slower than using sprintf, which is dumb since one of the theoretical benefits of string streams was to efficiency.)
You are correct. I made-up that example off the top of my head, and the foo = 7 example is bad. My point was to show that there is no easy way to concatenate various types on to a string easily. It happens with scalar types, as well as classes. Java and C# get around this with toString(). I don't like the idea that toString() is somehow built-into the language: There's no toInt() or toFloat(), but the concept that the compiler would use such conversion operators is a good one. (I don't think an operator string would work here, would it? If so, maybe my whole point should change. No I'm gonna have to go try it...)
A stringstream is a pain. A programmer should be able to do something like:
call_some_fn("Error number " + errNumber + " when passed a value of " + parm1 + "," + parm2);
Not: std::ostringstream foo; foo C++0x will address the copying issue via the move constructor
Thanks, I will look into that.
Really, your post comes off as an ill-informed swipe at C++. For example, "I could go on with other examples of things that the super-powerful C++ can't do". Why the petty attitude?
Really? I've been coding C++ for 15 years, and I code in a dozen other languages. My "petty attitude" comes from the fact that C++ has all but vanished in corporate software since.NET 2.0, and for darned good reasons. It takes twice as many lines of C++ to do the same thing C# does, is more error prone, and unless you are coding something really low-level, it is just as fast. Often times it is much faster because I spent lots of time in C++ converting from one string format to another to another, when I combine code from 4 different libraries that use 4 different types of strings. (That's also why I cited the example of copying strings.)
The "other examples" I didn't even mention really are too numerous. The next biggest one on my list is the usage of pointers. Something wants a int*: So is that a single integer, or an array? How big is the array? Does the caller deallocate it, or the callee? Boost addresses this by replacing pointers with a template class that specifies these types of things within the pointer. But it is really dumb that there is no standardized way to pass such information in C++. Maybe if everything used stl, we could just pass vector instead of pointers most of the time, but nobody wants to invoke that overhead. So we need something else in the language. This is probably the #1 source of memory corruption and deallocation errors in C++, and it is simply not an issue at all in other languages.
I believe that it is possible to alter C++ to have somewhere between none, and immeasurable, performance overhead, while addressing all of these issues. But it will rankle a lot of people to add a construct of pointer + length. And some people really like doing:
Because it makes them feel powerful and efficient. But it isn't - it just wasted stack, introduced potential overflows, required more lines of code, and required the programmer to explicitly pass things that the compiler already knows (length of buffer).
This is the kind of stuff that makes C++ unapproachable, and error prone. I'm sorry if I came-off as obnoxious - I did my best to show my point within the limited scope of a Slashdot post. These are real issues, and I find that the language is vanishing, and I am becoming more and more to giving-up cross-platform development because it just isn't worth the hassle. I really liked it when the most powerful O-O language was also the most efficient and x-platform. But today, it seems like the language is being abandoned. And Bjarne doesn't care about the fact that in 5 years, nobody who writes software for Windows will be using C++. Even game studios are talking about writing their code in C# because most of the performance is handled by the graphics layer. So why even write in C++ for them? What will be
As a few posters replied, some of my quickly thought-out examples were wrong. Ex: foo = 7 really wouldn't work, and shouldn't. But I disagree with you about what is possible in c++. I listed about a dozen libraries all with different string classes, and none of them can do what even the most basic string class in almost any other language can do. Pick one: Javascript, Python, PERL, Visual Basic, Java, C#. If you think you can make a string class with all the functionality that those languages offer, then please post it because I've never seen one, and I've read articles on why it is just darned near impossible.
A property is only "useful" when you've really used the wrong type.
A property is the most popular implementation of the O-O concept of encapsulation AKA Information Hiding. It can be used for many things, such as caching values, monitoring when the variable changes, setting a dirty flag, serializing the value, logging it to disk, etc. C++ provides a way to do it, but it is just ugly.
C++ does have shortcomings -- but your understanding of it appears to be sufficiently limited that you don't know them yet.
STFU. I wonder if brain surgeons get into high-tech discussions of the inner workings of neurobiology, and then end their replies with "You are obviously an uneducated fool." I doubt it, I think it is just on Slashdot. I appreciate your reply, but this Slashdot nonsense of debating complex topics then ending it with insults about how the other person obviously knows nothing is just lame and makes people look childless.
File a complaint with the FCC. If that doesn't work, contact the attorney general of your state and ask them to file charges. If they don't, then you do it.
You should expect two things: 1) Multiple DSL providers (over the same phone lines) 2) Multiple cable ISPs providers (over the same cable lines)
If you remember back to the days of dial-up, one phone line could connect you to any one of thousands of ISPs. There's no reason that DSL and Cable can't be the same way. The only reason we are in this situation is because the bureaucrats don't understand technology. They granted two monopolies to the same company: one monopoly to lay the cables, and another to run the content on the lines.
The idea isn't just to give read/write to a specific variable.
Wikipedia files it under Information hiding but I usually hear the terms accessors, or encapsulation.
A public variable does not give you the ability to monitor when the variable changes, or to set a dirty flag, serialize the value, log it to disk, etc. In many cases, there is no value "x" at all - it is a derived value that is calculated from some other state. In theory, you want nothing to be public, and everything to go through an accessor. Normally, the accessor does nothing. But when the time comes that you need to modify the code to do one of the aforementioned items, you don't have to change any of the calling code.
This is where phone calls and follow-ups are important. One email is not sufficient. People are not perfect, forget things, become disorganized. It's too easy to throw something over the wall then just wait for a while and blame the other person.
You are right about unit testing in both respects - unit testing solves this problem (somewhat) and it is also hard to do with Javascript.:( If you can make a unit testing framework for
How are prototyping and OO mutually exclusive concepts? I've written lots of prototypes, and most of them were OO.
I'm not sure if you post was supposed to be informative, funny, or both. I'm glad to know that Nokia has some underlying system. But there's no way in heck I would have figure that all out from looking at the phones.:)
Even if Apple did the iPhone Sprint and the iPhone Verizon, etc. -- it still would not be the clusterf*ck that most manufacturers have now.
I've worked at a few computer stores and it was common for vendors to intentionally munge the model numbers so that people couldn't compare across stores. Ex: The Packard Bell G1000, G1100, and G1150 were sold at CompUSA. The Packard Bell 9XV, 9XR, and 8XL were sold at Circuit City. Etc. Sometimes the same - sometimes with a component different, just so they weren't comparable. That's how the mobile phone arena seems to me.
C++ was once thought to be a language that was powerful enough that it could be used to express most features that other languages had. With things like operator overloading, multiple inheritance, and templates, you could pretty much make a class behave however you want. But years later, we have seen that C++ failed at that mission. There are simple and common OO constructs that C++ is unable to represent. Rather than focusing on improving the template functionality, I want the OO syntax fixed.
Let me cite some examples: 1) It is impossible to make a string class that behaves "normally"
Plenty of people have tried. QT, Boost, STL, Gnome, WxWidgets, all have their own string classes. Years ago, when VB developers touted how easy it was to use strings compared to C++, I told them it was merely because nobody had made a good string class. After 10 years of trying to write one, and using dozens of other ones people created, I realized that C++ is simply too weak and too loosely typed to do this.
Suppose I make a string class, kinda like the STL string: string foo; 1) foo = "whatever"; 2) foo = foo + "bar"; 3) foo = 7; 4) foo = foo + 7; 5) foo += 7;
Take a look at these. The first one is no problem. That can call an assignment operator to copy the char * contents to the string. The second one can also be done with a + operator. The third one can also be done via assignment. But what if you forget that? Well, the compiler will see that as foo = foo(7) which will call the constructor that allocates 7 characters, and then assign that. So instead of the string "7" you get a blank string. The next example is a problem too. If the string class can be converted to a const char *, as is common, then does this mean to use the + operator on string and an integer? Or did it mean to convert foo to a const char *, then move 7 characters ahead, then assign it? That can result in a crash. This is because pointer arithmetic is intrinsic in C++, but it is inherently type unsafe.
Then how about a function that returns a string? A simple case in most languages, but in C++ it results in redundant copies across the stack. So people revert to funny things like auto_ptr and other wrappers, or complex mechanisms for doing shallow copies to prevent that. Other languages just avoid the problem entirely by not allocating things on the callee's stack. It's just an intrinsic problem in the old everything-goes-on-the-stack-by-default mentality of C++. It just doesn't always work.
Properties are another one. This is something that various libraries try to do, and is free in most new OO languages. But just cant be done in C++// C# class Foo {
private int _x;
public int x
{
get { return _x; }
set { _x = value; }
} }
So in the above class, I want to access _x via a property get/set. C# has a built-in construct for this. In C#, I could do:
etc. The compiler knows how to get/set x, and it can even be inlined! This allows me to do things like log when x changes, or see what accesses the variable. Now, let's try that in C++.
class Foo { private:
int _x;
public:
int x();// Get X
void x(int);// Set X
int &x2();// Another way to get/set X };
MyFoo.x();// Gets x, no problem MyFoo.x(7);// Weird syntax, but that is fine MyFoo.x()++;// Does not modify the value of x, hmmm... MyFoo.x2()++;// Modifies x, but only lets you track the get, not the set. MyFoo.x()/=7;// Same exact issue MyFoo.x(MyFoo.x()/7);//
Upon a cursory glance, Javascript seems like a good language. It takes elements from some of the most popular and well-known languages (C,C++,Java) and makes it into something appropriate for scripting. But with experience, I've found that Javascript really only borrowed the most trivial features of those languages, and forgot everything we learned about computer science in the last 20 years.
The most awful example is the concept of "undefined." Javascript is the only language I know of where it is legal to say:
if (MyObject.NonExistantVariable == 7) {// Do some work }
(BTW: This expression returns false)
That is the source of most Javascript errors in a large project. A property was removed, a variable renamed, or misspelled, or never initialized. The value of the non-existant variable is "undefined" which is the bane of Javascript. There's even a special === operator for specifically comparing to undefined! And people thought NULL was bad!
It gets worse because Javascript is a glue language between other things like the HTML DOM or XML/SOAP/JSON so those object definitions can change at any time, and you won't know it broke your Javascript until you hit the right line of code in the right order.
Javascript is a language with totally dynamic typing and scoping. So it is impossible to compile, or type check. Even most scripty languages like PERL can detect more errors at load-time of the file than can be detected in Javascript.
I work from the east coast, for a company on the west coast. I can tell you it isn't as glamorous as people think. It is tough on the employer, and tough on the employee.
Employee: Your work will encroach upon your personal time, and you will miss that commute time as a way to separate your personal life from your work life. If you work in the same space you play, you will have a hard time separating work stress from your home life. How do you handle design meetings? Code reviews? Staff meetings?
Employer: Some companies just don't know how to handle telecommuters. How do you know someone is not happy with their job, or is having personal problems, if you can't see them on a daily basis? Another hint: Staff meetings over IM are not highly productive!
-- 11:45 (Manager) Joe, what is your status on Project X? *crickets* 11:50 (Joe) Sorry, I went out to get the mail....45 minutes later, the 15 minute staff meeting continues... --
Does the company pay for separate work and home licenses for software? Or do they give you a laptop? These are all expenses the company needs to consider.
Overall: Both the employer and the employee need to spend more time communicating and collaborating, and more time on tools and licenses than when someone is working from the office. Beware.
Apple also doesn't release 50 different models of something all at once, with seemingly random numbers identifying them. At any given moment I can find 10 models of Nokia phones in any store. They all have completely different designs, and it is unclear which ones are better than others. There's no iPhone 7649, iPhone 5486, iPhone 8764e, etc. And Apple won't completely redesign the iPhone and release 10 more models in 3 months. And they won't sell the same models under 3 other names with yet different model numbers: an AT&T version, a Sprint version, and a Verizon version.
Birds, in general, recognize individuals. They also recognize that a particular individual can have particular knowledge. For example, many species of birds tend to hide food. If another individual sees them hide it, they will be cautious of them. They know that a particular bird, or human, or hyena and grant that it has knowledge of the hidden location.
They also associate personality traits with individuals. Birds in the wild will hunt along side animals who are "nice" enough to let them eat along side of them. And they tend to play with a particular animal to get that animal used to them being around, to make them friendlier to them.
It isn't just them. 2/3 of the movies I've seen in the lst few years are sequels or remakes to old comics or magazines. Video games are doing the same thing.
I think you are both wrong, and I think I now see what you are misunderstanding.
When we think of a 3D model, we imagine that we have a series of coordinates for a head, and then some joint that connects to a neck, and some coordinates for that. Then a torso, with coordinates, etc.
But if we extract 3D images from cameras, we have none of that. Firstly, we have a scene, not a model. We have only points and textures. So first, we don't know what is the person and what is the floor, or the wall, or the table. Assuming we use movement to figure that out, and assuming we can tell one moving object from another and make a separate model, we have new problems.
So we have a series of coordinates. Now, if the original model had 1000 points on the head, we might have 100 for the head in this scene. Or 100,000. It would vary based on position of the person relative to the cameras. And we don't know it is a head. I don't even think anyone has ever made an algorithm to say "this part of this model is a sphere" given the points. Nevermind realizing it is a head.
Then you have joints. Given a 3D model of a person, and a scene of the person bent over sitting down, I don't think anyone has ever even TRIED to correlate those models. I don't see how that is easy.
I think people are imagining a 3D model with all the nice data points, and another 3D model in the exact same position and you just match-up points. But remember the number of points varies, the relative positions of the points varies, and we don't have all the meta-data that a normal 3D model has. We don't know the joints, we don't know which parts are even part of the model we are searching.
In doing a google search, I see that it has been attempted that, given a static model with no joints and all details previously known, it has been attempted to recognize that object in a photo. But that is only a fraction of what must be done to do any of the above things. I don't think the research even generalizes.
This problem is not a rendering issue. It is not an issue of generating a 3D model. It is an issue of matching multiple 3D *different* 3D models against each other. I say different because from one frame to another the model will not be the same. It isn't like I rendered the person into the scene with the model, then the model out again.
I don't think you even read my reply. Furthermore, I don't think you know anything about what you are talking about.
All your points were that doing it in 2d was hard
I actually said the opposite. All of the things you listed can be done in 2D, except for object recognition. Which cannot be done in 2D or 3D. So having 3D data does not help.
The rest of your reply was just rambling about how more cameras = better. Doesn't address any of the fundamental issues. Meh, why am I bothering to reply.
The greatest example of the commercial creep is the TV Guide channel. 15 years ago, it was a dedicated station that showed all the channels and programming. Then they went to 2/3 of the screen and had the weather at the top. Then it was 1/2 the screen and it was sponsored by The Weather Channel. Then it had ads. Now, it's barely 2 lines tall and completely unusable. With 80% of the screen dedicated to the trashiest TV ads you'll ever see. I just use TitanTV online to get listings.
I think this would make fabricating evidence much *harder*.
Today, if you want to add a gun into the photo you just have to make it look right from one set of lighting, and one photo, with a limited resolution. If you had multiple cameras generating a 3D model, you must now Photoshop the evidence in so that it looks right from multiple angles, PLUS the software could tell if the gun was shaped differently from different viewpoints. So your pixels must produce a perfect 3D model of the object that is consistent across viewpoints. That's going to be a pain. Now, perhaps a "3D Photoshop" could be used to insert the object into the 3D model, then regenerate the images. But that's more work, and more potential for mistakes.
I'm not sure a 3D model is going to help most of these things.
3D models are not necessary to do any of these tasks. Object recognition can be done in 2D, and it is very very hard. I will speculate that doing it in 3D is going to be even harder. Plus, using human brains as a model, we don't do it that way.
--
Change detection - Change detection can be done in 2D, and the person viewing the image can see where the object is anyway. No need to have the 3D model. As for object recognition, that is machine vision and we don't yet have the technology to do it. Maybe a 3D model would help, but I'm not so sure.
Change observation - This can also be done in 2D Same thing.
Weapon systems - I don't think we need 3D models for this either. A laser distance finder and a camera can track an object and hit it dead on. Detecting eyes on a person is a problem that is already solved in 2D anyway, since that is how facial recognition works.
Home interaction - I think hand gestures can already be done in 2D. The real issue with this is that you would need cameras all over the place to do it since you might be obscured.
Office monitoring - This comes back to facial recognition, which is a 2D task. Besides, RFID tags can do this even better. "Computer, locate Commander Data." "Commander Data is not aboard the Enterprise. Oh wait... he was hiding inside a jeffries tube and I couldn't see him. Plus he now has a beard."
Thanks for the clarification, but you didn't need to be belligerent him. I didn't know that stuff about sand, and I bet 99% of the readers didn't either. This illustrates exactly why those signs are so meaningless: they are put up there, but nobody really knows what they refer to or why.
If you visit Palm Springs, CA there is a trolley car that rides a steel cable up to one of the mountains. It's picturesque: woods, an old lodge, hiking trails, snow. The narrator in the trolley even tells you to take a deep breath and take-in the cleanest air you will ever smell. Inside that trolley, is a Proposition 65 sign "WARNING THIS AREA CONTAINS A CHEMICAL KNOWN TO THE STATE OF CALIFORNIA TO CAUSE CANCER OR BIRTH DEFECTS OR OTHER REPRODUCTIVE HARM"
My guess is that some material used to build the trolley itself is a carcinogen. The trolley driver didn't know what it was. Since I don't spend 18 hours a day eating parts of the trolley, it probably doesn't really matter to me. But if I were working in there I would want to find out. My second guess is that the window washing fluid or some other cleaning fluid contains a carcinogen. But is that really important enough to put up a sign?
My god man! I don't even own an iPhone!
It is incredible how far some go to defend apple in every aspect.
I didn't defend the iphone. I didn't think it was attacked. My post was making fun of Nokia.
So now even the scarcity in models and functionality is a good thing?
I didn't mention anything about functionality. From all that I read, I doubt the functionality is scarce.
Would it also be better if every car brand would have only a single model, and every TV producer or computer producer would have only 1 model in order not to confuse the poor customers?
No.
Once I intended to buy an apple mini, but remarks like this make me really hate apple.
You decided not to buy something because people had too many good things to say about it?
oh, yes, about about the atoi example. I know you will say to use a stringstream, and that is somewhat better. But it is still ugly and is much slower (I've benchmarked it on MSVC and GCC - string streams were orders of magnitude slower than using sprintf, which is dumb since one of the theoretical benefits of string streams was to efficiency.)
You are correct. I made-up that example off the top of my head, and the foo = 7 example is bad. My point was to show that there is no easy way to concatenate various types on to a string easily. It happens with scalar types, as well as classes. Java and C# get around this with toString(). I don't like the idea that toString() is somehow built-into the language: There's no toInt() or toFloat(), but the concept that the compiler would use such conversion operators is a good one. (I don't think an operator string would work here, would it? If so, maybe my whole point should change. No I'm gonna have to go try it...)
A stringstream is a pain. A programmer should be able to do something like:
call_some_fn("Error number " + errNumber + " when passed a value of " + parm1 + "," + parm2);
Not:
std::ostringstream foo;
foo C++0x will address the copying issue via the move constructor
Thanks, I will look into that.
Really, your post comes off as an ill-informed swipe at C++. For example, "I could go on with other examples of things that the super-powerful C++ can't do". Why the petty attitude?
Really? I've been coding C++ for 15 years, and I code in a dozen other languages. My "petty attitude" comes from the fact that C++ has all but vanished in corporate software since .NET 2.0, and for darned good reasons. It takes twice as many lines of C++ to do the same thing C# does, is more error prone, and unless you are coding something really low-level, it is just as fast. Often times it is much faster because I spent lots of time in C++ converting from one string format to another to another, when I combine code from 4 different libraries that use 4 different types of strings. (That's also why I cited the example of copying strings.)
The "other examples" I didn't even mention really are too numerous. The next biggest one on my list is the usage of pointers. Something wants a int*: So is that a single integer, or an array? How big is the array? Does the caller deallocate it, or the callee? Boost addresses this by replacing pointers with a template class that specifies these types of things within the pointer. But it is really dumb that there is no standardized way to pass such information in C++. Maybe if everything used stl, we could just pass vector instead of pointers most of the time, but nobody wants to invoke that overhead. So we need something else in the language. This is probably the #1 source of memory corruption and deallocation errors in C++, and it is simply not an issue at all in other languages.
I believe that it is possible to alter C++ to have somewhere between none, and immeasurable, performance overhead, while addressing all of these issues. But it will rankle a lot of people to add a construct of pointer + length. And some people really like doing:
wchar_t buffer[50];
wtoi(buffer, 1234, sizeof(buffer)/sizeof(*buffer));
Because it makes them feel powerful and efficient. But it isn't - it just wasted stack, introduced potential overflows, required more lines of code, and required the programmer to explicitly pass things that the compiler already knows (length of buffer).
This is the kind of stuff that makes C++ unapproachable, and error prone. I'm sorry if I came-off as obnoxious - I did my best to show my point within the limited scope of a Slashdot post. These are real issues, and I find that the language is vanishing, and I am becoming more and more to giving-up cross-platform development because it just isn't worth the hassle. I really liked it when the most powerful O-O language was also the most efficient and x-platform. But today, it seems like the language is being abandoned. And Bjarne doesn't care about the fact that in 5 years, nobody who writes software for Windows will be using C++. Even game studios are talking about writing their code in C# because most of the performance is handled by the graphics layer. So why even write in C++ for them? What will be
As a few posters replied, some of my quickly thought-out examples were wrong. Ex: foo = 7 really wouldn't work, and shouldn't. But I disagree with you about what is possible in c++. I listed about a dozen libraries all with different string classes, and none of them can do what even the most basic string class in almost any other language can do. Pick one: Javascript, Python, PERL, Visual Basic, Java, C#. If you think you can make a string class with all the functionality that those languages offer, then please post it because I've never seen one, and I've read articles on why it is just darned near impossible.
A property is only "useful" when you've really used the wrong type.
A property is the most popular implementation of the O-O concept of encapsulation AKA Information Hiding. It can be used for many things, such as caching values, monitoring when the variable changes, setting a dirty flag, serializing the value, logging it to disk, etc. C++ provides a way to do it, but it is just ugly.
C++ does have shortcomings -- but your understanding of it appears to be sufficiently limited that you don't know them yet.
STFU. I wonder if brain surgeons get into high-tech discussions of the inner workings of neurobiology, and then end their replies with "You are obviously an uneducated fool." I doubt it, I think it is just on Slashdot. I appreciate your reply, but this Slashdot nonsense of debating complex topics then ending it with insults about how the other person obviously knows nothing is just lame and makes people look childless.
File a complaint with the FCC. If that doesn't work, contact the attorney general of your state and ask them to file charges. If they don't, then you do it.
You should expect two things:
1) Multiple DSL providers (over the same phone lines)
2) Multiple cable ISPs providers (over the same cable lines)
If you remember back to the days of dial-up, one phone line could connect you to any one of thousands of ISPs. There's no reason that DSL and Cable can't be the same way. The only reason we are in this situation is because the bureaucrats don't understand technology. They granted two monopolies to the same company: one monopoly to lay the cables, and another to run the content on the lines.
In my area, Comcast is the only ISP. That's half the problem.
The idea isn't just to give read/write to a specific variable.
Wikipedia files it under Information hiding but I usually hear the terms accessors, or encapsulation.
A public variable does not give you the ability to monitor when the variable changes, or to set a dirty flag, serialize the value, log it to disk, etc. In many cases, there is no value "x" at all - it is a derived value that is calculated from some other state. In theory, you want nothing to be public, and everything to go through an accessor. Normally, the accessor does nothing. But when the time comes that you need to modify the code to do one of the aforementioned items, you don't have to change any of the calling code.
This is where phone calls and follow-ups are important. One email is not sufficient. People are not perfect, forget things, become disorganized. It's too easy to throw something over the wall then just wait for a while and blame the other person.
I've said almost the same thing many times. I don't get the obsession over IM. Some of the desks in the office don't even have phones!
You are right about unit testing in both respects - unit testing solves this problem (somewhat) and it is also hard to do with Javascript. :( If you can make a unit testing framework for
How are prototyping and OO mutually exclusive concepts? I've written lots of prototypes, and most of them were OO.
I'm not sure if you post was supposed to be informative, funny, or both. I'm glad to know that Nokia has some underlying system. But there's no way in heck I would have figure that all out from looking at the phones. :)
Even if Apple did the iPhone Sprint and the iPhone Verizon, etc. -- it still would not be the clusterf*ck that most manufacturers have now.
I've worked at a few computer stores and it was common for vendors to intentionally munge the model numbers so that people couldn't compare across stores. Ex: The Packard Bell G1000, G1100, and G1150 were sold at CompUSA. The Packard Bell 9XV, 9XR, and 8XL were sold at Circuit City. Etc. Sometimes the same - sometimes with a component different, just so they weren't comparable. That's how the mobile phone arena seems to me.
C++ was once thought to be a language that was powerful enough that it could be used to express most features that other languages had. With things like operator overloading, multiple inheritance, and templates, you could pretty much make a class behave however you want. But years later, we have seen that C++ failed at that mission. There are simple and common OO constructs that C++ is unable to represent. Rather than focusing on improving the template functionality, I want the OO syntax fixed.
Let me cite some examples:
1) It is impossible to make a string class that behaves "normally"
Plenty of people have tried. QT, Boost, STL, Gnome, WxWidgets, all have their own string classes. Years ago, when VB developers touted how easy it was to use strings compared to C++, I told them it was merely because nobody had made a good string class. After 10 years of trying to write one, and using dozens of other ones people created, I realized that C++ is simply too weak and too loosely typed to do this.
Suppose I make a string class, kinda like the STL string:
string foo;
1) foo = "whatever";
2) foo = foo + "bar";
3) foo = 7;
4) foo = foo + 7;
5) foo += 7;
Take a look at these. The first one is no problem. That can call an assignment operator to copy the char * contents to the string. The second one can also be done with a + operator. The third one can also be done via assignment. But what if you forget that? Well, the compiler will see that as foo = foo(7) which will call the constructor that allocates 7 characters, and then assign that. So instead of the string "7" you get a blank string. The next example is a problem too. If the string class can be converted to a const char *, as is common, then does this mean to use the + operator on string and an integer? Or did it mean to convert foo to a const char *, then move 7 characters ahead, then assign it? That can result in a crash. This is because pointer arithmetic is intrinsic in C++, but it is inherently type unsafe.
Then how about a function that returns a string? A simple case in most languages, but in C++ it results in redundant copies across the stack. So people revert to funny things like auto_ptr and other wrappers, or complex mechanisms for doing shallow copies to prevent that. Other languages just avoid the problem entirely by not allocating things on the callee's stack. It's just an intrinsic problem in the old everything-goes-on-the-stack-by-default mentality of C++. It just doesn't always work.
Properties are another one. This is something that various libraries try to do, and is free in most new OO languages. But just cant be done in C++ // C#
class Foo
{
private int _x;
public int x
{
get { return _x; }
set { _x = value; }
}
}
So in the above class, I want to access _x via a property get/set. C# has a built-in construct for this. In C#, I could do:
MyFoo.x = 7;
MyFoo.x++;
MyFoo.x = MyFoo.x + 3;
MyFoo.x/= 7;
etc. The compiler knows how to get/set x, and it can even be inlined! This allows me to do things like log when x changes, or see what accesses the variable. Now, let's try that in C++.
class Foo
{
private:
int _x;
public: // Get X // Set X // Another way to get/set X
int x();
void x(int);
int &x2();
};
MyFoo.x(); // Gets x, no problem // Weird syntax, but that is fine // Does not modify the value of x, hmmm... //
MyFoo.x(7);
MyFoo.x()++;
MyFoo.x2()++;// Modifies x, but only lets you track the get, not the set.
MyFoo.x()/=7;// Same exact issue
MyFoo.x(MyFoo.x()/7);
Upon a cursory glance, Javascript seems like a good language. It takes elements from some of the most popular and well-known languages (C,C++,Java) and makes it into something appropriate for scripting. But with experience, I've found that Javascript really only borrowed the most trivial features of those languages, and forgot everything we learned about computer science in the last 20 years.
The most awful example is the concept of "undefined." Javascript is the only language I know of where it is legal to say:
if (MyObject.NonExistantVariable == 7) // Do some work
{
}
(BTW: This expression returns false)
That is the source of most Javascript errors in a large project. A property was removed, a variable renamed, or misspelled, or never initialized. The value of the non-existant variable is "undefined" which is the bane of Javascript. There's even a special === operator for specifically comparing to undefined! And people thought NULL was bad!
It gets worse because Javascript is a glue language between other things like the HTML DOM or XML/SOAP/JSON so those object definitions can change at any time, and you won't know it broke your Javascript until you hit the right line of code in the right order.
Javascript is a language with totally dynamic typing and scoping. So it is impossible to compile, or type check. Even most scripty languages like PERL can detect more errors at load-time of the file than can be detected in Javascript.
I work from the east coast, for a company on the west coast. I can tell you it isn't as glamorous as people think. It is tough on the employer, and tough on the employee.
Employee:
Your work will encroach upon your personal time, and you will miss that commute time as a way to separate your personal life from your work life. If you work in the same space you play, you will have a hard time separating work stress from your home life. How do you handle design meetings? Code reviews? Staff meetings?
Employer:
Some companies just don't know how to handle telecommuters. How do you know someone is not happy with their job, or is having personal problems, if you can't see them on a daily basis? Another hint: Staff meetings over IM are not highly productive!
-- ...45 minutes later, the 15 minute staff meeting continues...
11:45 (Manager) Joe, what is your status on Project X?
*crickets*
11:50 (Joe) Sorry, I went out to get the mail.
--
Does the company pay for separate work and home licenses for software? Or do they give you a laptop? These are all expenses the company needs to consider.
Overall:
Both the employer and the employee need to spend more time communicating and collaborating, and more time on tools and licenses than when someone is working from the office. Beware.
Apple also doesn't release 50 different models of something all at once, with seemingly random numbers identifying them. At any given moment I can find 10 models of Nokia phones in any store. They all have completely different designs, and it is unclear which ones are better than others. There's no iPhone 7649, iPhone 5486, iPhone 8764e, etc. And Apple won't completely redesign the iPhone and release 10 more models in 3 months. And they won't sell the same models under 3 other names with yet different model numbers: an AT&T version, a Sprint version, and a Verizon version.
The mobile phone business is a mess.
Birds, in general, recognize individuals. They also recognize that a particular individual can have particular knowledge. For example, many species of birds tend to hide food. If another individual sees them hide it, they will be cautious of them. They know that a particular bird, or human, or hyena and grant that it has knowledge of the hidden location.
They also associate personality traits with individuals. Birds in the wild will hunt along side animals who are "nice" enough to let them eat along side of them. And they tend to play with a particular animal to get that animal used to them being around, to make them friendlier to them.
It isn't just them. 2/3 of the movies I've seen in the lst few years are sequels or remakes to old comics or magazines. Video games are doing the same thing.
I think you are both wrong, and I think I now see what you are misunderstanding.
When we think of a 3D model, we imagine that we have a series of coordinates for a head, and then some joint that connects to a neck, and some coordinates for that. Then a torso, with coordinates, etc.
But if we extract 3D images from cameras, we have none of that. Firstly, we have a scene, not a model. We have only points and textures. So first, we don't know what is the person and what is the floor, or the wall, or the table. Assuming we use movement to figure that out, and assuming we can tell one moving object from another and make a separate model, we have new problems.
So we have a series of coordinates. Now, if the original model had 1000 points on the head, we might have 100 for the head in this scene. Or 100,000. It would vary based on position of the person relative to the cameras. And we don't know it is a head. I don't even think anyone has ever made an algorithm to say "this part of this model is a sphere" given the points. Nevermind realizing it is a head.
Then you have joints. Given a 3D model of a person, and a scene of the person bent over sitting down, I don't think anyone has ever even TRIED to correlate those models. I don't see how that is easy.
I think people are imagining a 3D model with all the nice data points, and another 3D model in the exact same position and you just match-up points. But remember the number of points varies, the relative positions of the points varies, and we don't have all the meta-data that a normal 3D model has. We don't know the joints, we don't know which parts are even part of the model we are searching.
In doing a google search, I see that it has been attempted that, given a static model with no joints and all details previously known, it has been attempted to recognize that object in a photo. But that is only a fraction of what must be done to do any of the above things. I don't think the research even generalizes.
http://en.wikipedia.org/wiki/3D_single_object_recognition
This problem is not a rendering issue. It is not an issue of generating a 3D model. It is an issue of matching multiple 3D *different* 3D models against each other. I say different because from one frame to another the model will not be the same. It isn't like I rendered the person into the scene with the model, then the model out again.
I don't think you even read my reply. Furthermore, I don't think you know anything about what you are talking about.
All your points were that doing it in 2d was hard
I actually said the opposite. All of the things you listed can be done in 2D, except for object recognition. Which cannot be done in 2D or 3D. So having 3D data does not help.
The rest of your reply was just rambling about how more cameras = better. Doesn't address any of the fundamental issues. Meh, why am I bothering to reply.
The greatest example of the commercial creep is the TV Guide channel. 15 years ago, it was a dedicated station that showed all the channels and programming. Then they went to 2/3 of the screen and had the weather at the top. Then it was 1/2 the screen and it was sponsored by The Weather Channel. Then it had ads. Now, it's barely 2 lines tall and completely unusable. With 80% of the screen dedicated to the trashiest TV ads you'll ever see. I just use TitanTV online to get listings.
But that is multiple choice, so it is easier to make a program that can guess the result.
I think this would make fabricating evidence much *harder*.
Today, if you want to add a gun into the photo you just have to make it look right from one set of lighting, and one photo, with a limited resolution. If you had multiple cameras generating a 3D model, you must now Photoshop the evidence in so that it looks right from multiple angles, PLUS the software could tell if the gun was shaped differently from different viewpoints. So your pixels must produce a perfect 3D model of the object that is consistent across viewpoints. That's going to be a pain. Now, perhaps a "3D Photoshop" could be used to insert the object into the 3D model, then regenerate the images. But that's more work, and more potential for mistakes.
I'm not sure a 3D model is going to help most of these things.
3D models are not necessary to do any of these tasks. Object recognition can be done in 2D, and it is very very hard. I will speculate that doing it in 3D is going to be even harder. Plus, using human brains as a model, we don't do it that way.
--
Change detection - Change detection can be done in 2D, and the person viewing the image can see where the object is anyway. No need to have the 3D model. As for object recognition, that is machine vision and we don't yet have the technology to do it. Maybe a 3D model would help, but I'm not so sure.
Change observation - This can also be done in 2D Same thing.
Weapon systems - I don't think we need 3D models for this either. A laser distance finder and a camera can track an object and hit it dead on. Detecting eyes on a person is a problem that is already solved in 2D anyway, since that is how facial recognition works.
Home interaction - I think hand gestures can already be done in 2D. The real issue with this is that you would need cameras all over the place to do it since you might be obscured.
Office monitoring - This comes back to facial recognition, which is a 2D task. Besides, RFID tags can do this even better. "Computer, locate Commander Data." "Commander Data is not aboard the Enterprise. Oh wait... he was hiding inside a jeffries tube and I couldn't see him. Plus he now has a beard."