If you're wondering what the above is about,... it's poor APK, my personal cyber-stalker (he's *that* hosts file guy - the one who spams discussion boards advertising how his hosts file will prevent you from getting viruses).
Ever since I pointed out that his "solution" never worked (he only gets "one or two viruses a month" wasn't clue enough for him, for some reason), he's been cyber-stalking me.
Given his history of threatening to sue people who say his stuff doesn't perform as advertised, etc., I tell people that if they're going to tell him he's full of it, to do so anonymously (just like he posts anonymously since his account was banned).
The guy is an obese (as in BMI over 30) narcissistic obsessive paranoid misogynist. And those are probably his better qualities.
He's become quite obsessed with me. It's funny - he thinks he's bothering me, but I completely p0wn him. He can't help himself - I just have to post "JUMP, FAT BOY, JUMP" and he jumps. And jumps. And jumps. I figure at least it gives him some exercise, and keeps him off the streets where the sight of him would probably cause pregnant women to miscarry.
HOWTO: trolling the hosts file guy in one easy step
The next time you see a post by him, just reply anonymously. And to really mess with his head, reply anonymously to your anonymous post, disagreeing with your first anon post (extra points if you claim in the second post that you're him - that REALLY sets him off). He'll accuse you of being me, if you're a woman, he'll call you a c*nt and a b*tch (and he wonders why women don't like him), then start with the usual crap-floods of half-baked lies and innuendo.
Of course, it takes a while to lure him out of my journal space and into the regular threads, where google can index that obese wannabe "hacker" Alexander Peter Kowalski's host files are ineffective against modern viruses and trojans.
He's an obese (though he now claims he grew 2 more inches after he turned 30, in defiance of both gravity and biology, so he's now just very overweight if you believe him) mouthbreather. You've probably seen him spamming slashdot, claiming how his "hosts file solution" prevents viruses - "I only get one or two a month now!"
He wasn't happy that I pointed out that "one or two a month" is a failure. It's like AIDS or a fatal heart attack - so what if you stop 99% of the cases (doubtful) - it only takes one to ruin your day.
Anyone who dares point out that he's full of it can expect threats of lawsuits, and lots of crap-floods. That's why I advise everyone to reply to him anonymously. After all, he has to post anonymously, so why should most users have to put up with him harassing them. And since he can't attack them when they do so, he comes after me for warning them, and pointing out that he's such an idiot.
After crap-flooding my journal, calling me a b*tch and a c*nt, he offered a "truce". Of course I rejected it. He's the only one doing the stalking and crap-flooding, but he can't bring himself to stop. He has to see himself as some soft of "winner", even though it's obvious by now that he's obsessed with me, and that I totally p0wn him.
Maybe he needs some more tiger blood? That an a lobotomy...
Anyone looking at the time stamps can see you're the one doing the stalking, you moron.
This is the stupid nutter known as "the hosts file guy", aka Alexander Peter Kowalski. He follows me everywhere... in the last month, he's called me a b*tch, a c*nt, a russian botmaster... he's claimed to defy both gravity and biology by growing another 2 inches in his 40's, so he's now "overweight" instead of "obese", and of course, the usual threats to sue for libel, which he does to everyone, then always backs down. He can't help it - he's obsessed.
For those who are curious about just how retarded the "apk troll" is - just follow the magic linkies. The guy is a real nutcase. But you too can help keep him busy - just post something anonymously saying he needs to get a life, or that his hosts file doesn't work, and he'll spend the next few weeks stalking me instead of spamming about his "miracle hosts file". He is *totally* p0wned at this point, and doesn't even realize it.
If you follow the non-slashdot threads, you 'll learn that:
APK is 44 years old and really does live still with one or both of his parents (or another relative);
APK can't write software for shit;
APK stopped hosting it with download.com because he could use the $80 fee for buying better hardware instead (no wonder he posts on a 400hz computer),
His "programs" generally consist of nothing more than easy-to-code front-ends to edit ini files (his "graphic accelerators", for example) in Delphi, or "code that will remove duplicate entries from a hosts file" (never heard of cat/etc/hosts | sort | uniq > hosts.uniq)? Oops, my bad - Windows only - so grab a copy of cygwin instead:-)
After all, the hosts file guy (APK - Alexander Peter Kowalski) will be able to push his "My hosts file keeps you safe - I only get one or two viruses a month now" junk to a whole new market.
BTW - if you're going to tell this guy to stop spamming his hosts file crap, make sure you do it anonymously - not only does it drive him nuts, but he'll think it's me, and waste his time stalking me instead of you.
5/11 participants (P2, P3, P5, P9, P10, P11) crashed Unity during their hour of testing.
Participants 2, 3, 5, 9, 10, 11... that's 6/11, or a majority, not "almost half."
The funniest finding? One of the two testers who thought that Software Center was the recycle bin is an Ubuntu user.
Canonical should take the hint - move Unity to the recycling bin. It's not ready, and it never will be. Admit that the 4 years (this all started with the netbook remix spin) is wasted, that mobile is now between Android and Apple (and maybe HP if webOS takes off), that tablets are also going to be going the same route, and that trying to adapt an interface that was designed for small mobile and other touchscreen devices to a regular desktop because your original market plan is as gutted as a mafia stool-pigeon is a bad idea.
The real reason only 6 out of 11 crashed it... it's because the other 5 couldn't figure out how to log in...
Seriously, it was 6 out of 11 that crashed:
5/11 participants (P2, P3, P5, P9, P10, P11) crashed Unity during
their hour of testing. And towards the end of her test, P11 opened
a zombie quicklist that stayed on top of everything and didn't
respond to clicks.
Tester # 2, 3, 5, 9, 10, 11 == 6 testers, not 5.
Other facts:
Only half of those participants figured out how to reveal the launcher when the Window is touching the left of the screen and how to rearrange items in the launcher....
some of the participants thought that LibreOffice Calc is a calculator and that Ubuntu Software Center is the recycle bin. None of the participants could figured out what Ubuntu One is.
If you read the detailed results,
1. it's a current Ubuntu user who thought the Ubuntu Software Center was the recycle bin.
2. Not one user found where they put "system settings".
3. Only one person was able to add a game to the launch menu
4. Only half could delete a document - and about half of those who succeeded, didn't think they had actually deleted it.
5. Nobody was able to play a song stored on a USB key
6. Nobody seemed to understand what the Ubuntu button was for.
7. Less than half could rearrange items.
When KDE 4.6 broke temporarily, I switched to it for a while, and my old desktop, which was unable to run Eclipse (too gosh-darned slow), is now able to run it just fine. That makes me wonder just how much bloat there is in a "modern full-featured desktop" that removing it makes a heavy java app seem almost light-weight.
Alt+F2 (run command) is even cleaner, executes faster, and is a more minimalistic launcher.
It doesn't mean that it's what people want all the times. If you want lean and fast, you use xfce, lxde, or enlightenment (how times change. I remember when enlightenment used to be considered fair game for the bloatware title...:-). However, when you get fed up with mousing around, it sure is handy.
Canonical admits that Unity was supposed to be for netbooks (a dying market, eaten alive by low-end laptops, tablets, and smartphones) and "other touchscreen devices" - a market being divided between Android and Apple.
Unity is designed for netbooks and related touch-based devices. It includes a new panel and application launcher that makes it fast and easy to access preferred applications, such as the browser, while removing screen elements that are rarely used in mobile and netbook computing.
1. Remove the parts needed for a good desktop.
2. Make it the default desktop
3. FAIL!
But it's Ubuntu - the fanbois (mostly people who never tried another linux distro) will be along momentarily to "re-educate" anyone who points out the truth. The usual crap-flood warning is now in effect.
Um, there are conventions where no stack is used to pass parameters.
Not for objects in java, and that's what we're talking about. You cannot pass an object in java - only a reference to it. The object is allocated on the heap, and that's where it stays.
An when you get to the level of writing assembler, a stack is purely optional.
If the language didn't actually allocate an object pointer variable distinct from the object itself, I'd concede your point. In that case, the memory location aliased by a variable would be the actual object, and that would arguably be a pass-by-reference language. It would also be a noticeably different language.
I think you need to clarify what you wrote - it doesn't parse cleanly.:-)
Java works the same as c and c++. When you allocate a new object, it is allocated on the heap, and you only get a pointer (reference) to it, not an alias. You can never pass an object in java, (unlike primitives), just the pointer to it, so not everything is passed by value. Objects cannot be passed by value.
Let me fix your example:
// The compiler translates this to "Object s = new String("can't touch this");
Object s = "can't touch this";
// In your next line, you create a new instance of type Object - the base class, using the default (empty) constructor, not a null object.
Object t = new Object();
// at this point neither s nor t are null
foo( s , t );
You're free to set them to null inside of foo, if that floats your boat.
The original PS3 consumed 180 watts. No guessing. The numbers were published a few years ago. the PS3 slim obviously is less (smaller die process, less functionality).
Both the PS3 and the Xbox are energy gluttons in comparison to a Wii, or even a standard stand-alone blu-ray player. People who bought PS3s to play blu-rays got ripped off - the extra noise and the much higher energy consumption (stand-alone bluray player is typically under 20 watts while playing, and 3 watts on standby). You can play a week's worth of blu-rays on a stand-alone for what a PS3 will gobble in under a day..
No backpedaling. There is nothing in copyright law that says you can't lend your copy of a dvd to someone else - exactly contrary to the original claim.
There are conditions, same as anything else in life. And the example of "showing it before an audience of 100 people" is not necessarily a public performance, even though what that has to do with lending the physical dvd is beyond me - it's a red herring in this context.
Remember all those arguments that the MPAA/RIAA made that you own the physical media? There is nothing against lending the physical media to someone, and even the MPAA and RIAA claim that the license follows the physical media. That's why they're so opposed to such things as streaming, or single-copy-per-user-lock schemes on a server, or, for that matter, format shifting. They can't have it both ways.
Please cite the relevant section of the copyright act which states that physically transfering the media to another person temporarily is a copyright violation.
Please note - lending is not "distribution" within the meaning of the copyright act, since no copy is being made, which is a requirement for "distribution" under section 106.3.
My point was that the statements are in fact mutually exclusive - a reference to an object is not the object itself, so the statement that "everything is passed by value", when only a reference to it is passed, is simply not true.
No need to get into a long example. The reason for passing non-primitive values by reference has always been that it takes less space on the stack (Java's implementation is stack-based). You only need to place a copy of the memory location on the stack, not copy the actual data (which, with an array or an object, could be quite large).
Just because the object reference is automatically dereferenced in Java doesn't mean that we can get away with saying that "Everything is passed by value", since object never are passed by value. So:
Everything in Java is passed by value.
is simply not true. Objects are never placed on the stack - which is where parameter "passing" takes place. It's always been like that, even back in the days of assembler..
Depending on the circumstances, that may or may not be a public performance, which is different from lending the physical CD or DVD to another person (and which is also a different section of copyright). There is nothing in the copyright act that says you cannot lend your original physical copy.
It won't have a hard drive, and that's a good thing.
The Wii generates less heat than either of the other two consoles, because, at full bore, it consumes something like 14 watts. The others? 150 - 180 watts. They get HOT. And they're noisier.
If one person who legally posses a CD/DVD with copyrighted material loans it to another person that is quite different than some other person who makes an entire library of music available to everyone over an internet connection. The three strikes law seems to apply to file sharing sharing only, not copyright violation in general. Its not even certain there is a copyright violation in this case.
No, actually it's copyright infringement in both cases. They are exactly the same. The only difference is in the number of infringements.
Don;t be silly - if I lend someone a DVD, no illegal copy has been made. How is it copyright infringement? Next you'll claim that if I lend you a book or a newspaper, it's copyright infringement.
Again, copyright infringement involves violation of the limitations on the right to make a copy. No copy of the DVD made, no copyright infringement.
Fair enough, but I would suggest that the errors due to manual memory allocation and deallocation are programmer errors, not implementation flaws, and this can be fixed by proper design and always being aware (and wary) of who owns what pointers.
No language is perfect, and no language ever will be, because once we get the "perfect language", we'll then try to apply it to new problems, and find out it's not perfect any more:-)
But take a look at what everyone is so upset about - they don't like my statements that some of us would like the ability to use multiple inheritance, and to be able to overload operators. Why? Because the have encountered problems using them in the past. So what?
Same goes to my habit of writing my own classes in c++. I don't use the stl because it doesn't provide anything I can't do by hand, and I don't need to pull in another 200k of code just for a lousy string class or a stack or a linked list or a scatter/gather array or a ring buffer or whatever. These are basics that anyone who hopes to implement more complicated classes better have down pat.
But they then go on to say this doesn't make sense to write your own classes - and yet, that's what you spend most of your time doing in Java. Just because they're afraid of the "big bad wolf" of a dangling pointer doesn't mean that we should all eschew writing our own classes. Someone has to do it, and there was a time when this was a basic skill - if you couldn't do it, you weren't a real programmer, go to BASIC, do not pass GO, do not collect $200.
All this to try to justify their stand that nobody should dare ask for multiple inheritance or operator overloading in Java. Nobody would force them to use either, but their reaction is like the people who oppose same-sex marriage because somehow it "devalues" their marriage.
What is the big deal with asking for more flexibility in the language, and more ways to express oneself in code?
Sorry, but that's exactly what we HAD to do for a multi-threaded application to meet the guarantees of low latency and no loss of memory.
Besides, once you've done enough classes, the usual "gotchas" that result in memory leaks are easy enough to avoid.
It's also often quicker to write your own classes than it is to adapt a "standard" class. And by writing your own, you avoid a lot of problems (like all the people who are whining about the "diamond problem" wrt multiple inheritance. It won't happen when you write your own, unless you really screw up, and even then it's easy enough to fix).
The first thing I did was to remove the STL from all the core code (the people who had written the previous version wrapped everything in spartptrs - a real dumb move).
The next thing was simple -
1. server allocs the parameter struct.
2. server passes reference to parameter struct to thread.
3. for each loaded module...
4. thread allocs resources as needed. For results, it alloc()s them with a pointer to the appropriate portion of the parameter struct reserved for that. For internally-used processing, alloc() and free() in pairs, so there's nothing to keep track of locally. Sometimes, that takes a bit of planning, but it can be done.
5. when all modules are finished, the thread has no dangling alloc()ed pointers - the param struct has them.
6. the server processes the thread's results (from the param struct), then frees up all the resources pointed to by the various "slots" in the struct, and finally free()s the struct and allocates a new one.
Does it work? Well, 3 separate server processes on the same 512 meg box, with 400, 100, and 100 threads in their respective thread pools, running over a 4-day weekend continuously, 1000 requests per second test, and Tuesday morning still plenty of memory left. (we tested on low-ram machines so that any bugs became apparent quicker).
With proper design, there is no need for smartptrs, weakptrs, etc., and no need to kill off a thread after x number of requests to reclaim lost ram. The problem is, such design takes time - lots more time than people are usually willing to invest - not just in the server portion, but in the individual modules, because even a one-byte leak will kill it.
Now, a year after I left, the programmer who was left to do the maintenance did exactly that - it would crash every 4-6 hours. He had introduced a small memory leak, but even one byte, at 1000 requests a second, is still 1k a second. He had introduced a leak of 200k per request. Respawning each thread after it has served X number of requests would have "fixed" that (the cheat used by most threaded servers), but that was an unacceptable solution in this case - even the small delay in respawning a thread was a no-no..
Yes, you did. Sun tried to make a multiple-program jvm. They abandoned it (I posted the links elsewhere in the thread) because the ONLY way to guarantee that all resources are reaped is to terminate the jvm and let the OS de-allocate everything that the gc didn't get (such as the finalizers that never got called, or got called and threw an exception).
So dumping your class loader won't free up those resources, and you'll eventually end up starving for one resource or another. The jvm was originally only supposed to run a tv set-top box, not be a general-purpose runtime. For years, java was a "solution" in search of a problem.
Now, we finally have computers that are fast enough and with enough ram to run java decently (no, it's not the jvm and jit that are responsible - go and dust off that old 200mhz pentium with 16 megs of ram and see if the jit suddenly makes it usable...)
And javanistas are so sentitive to ANY criticism that pointing out that at least some of us would like operator overloading and multiple inheritance instead of a single-hierarchy class system makes them go nuts.
Nobody would be forcing them to adopt any of these features... but they are so defensive of the "one true way" that they take it as heresy that some people want the option of having more than one way to do things.
I did answer the diamond problem. It's a symptom of people designing class frameworks that are too ambitious for the project at hand, and can be avoided by proper design. It's also a solved problem in cases where people design too-deep class hierarchies and insist on always extending base classes - either use the scope resolution operator, or use virtual functions.
Also, it is you who needs to take off the blinkers - I never said anywhere, at any point in my life, that c++ "got everything right" - but java has definitely got some things wrong, as is evidenced by the response to the original article.
both malloc() and free() will execute when you call them. Finalized methods in java may be called on some runs, and not on others, depending on the state of the garbage collector. Nice way to turn code into unreachable, dead code, at random..
If you're wondering what the above is about, ... it's poor APK, my personal cyber-stalker (he's *that* hosts file guy - the one who spams discussion boards advertising how his hosts file will prevent you from getting viruses).
Ever since I pointed out that his "solution" never worked (he only gets "one or two viruses a month" wasn't clue enough for him, for some reason), he's been cyber-stalking me.
Given his history of threatening to sue people who say his stuff doesn't perform as advertised, etc., I tell people that if they're going to tell him he's full of it, to do so anonymously (just like he posts anonymously since his account was banned).
The guy is an obese (as in BMI over 30) narcissistic obsessive paranoid misogynist. And those are probably his better qualities.
He's become quite obsessed with me. It's funny - he thinks he's bothering me, but I completely p0wn him. He can't help himself - I just have to post "JUMP, FAT BOY, JUMP" and he jumps. And jumps. And jumps. I figure at least it gives him some exercise, and keeps him off the streets where the sight of him would probably cause pregnant women to miscarry.
HOWTO: trolling the hosts file guy in one easy step
The next time you see a post by him, just reply anonymously. And to really mess with his head, reply anonymously to your anonymous post, disagreeing with your first anon post (extra points if you claim in the second post that you're him - that REALLY sets him off). He'll accuse you of being me, if you're a woman, he'll call you a c*nt and a b*tch (and he wonders why women don't like him), then start with the usual crap-floods of half-baked lies and innuendo.
Of course, it takes a while to lure him out of my journal space and into the regular threads, where google can index that obese wannabe "hacker" Alexander Peter Kowalski's host files are ineffective against modern viruses and trojans.
Mission accomplished.
If you need more info ...
He's an obese (though he now claims he grew 2 more inches after he turned 30, in defiance of both gravity and biology, so he's now just very overweight if you believe him) mouthbreather. You've probably seen him spamming slashdot, claiming how his "hosts file solution" prevents viruses - "I only get one or two a month now!"
He wasn't happy that I pointed out that "one or two a month" is a failure. It's like AIDS or a fatal heart attack - so what if you stop 99% of the cases (doubtful) - it only takes one to ruin your day.
Anyone who dares point out that he's full of it can expect threats of lawsuits, and lots of crap-floods. That's why I advise everyone to reply to him anonymously. After all, he has to post anonymously, so why should most users have to put up with him harassing them. And since he can't attack them when they do so, he comes after me for warning them, and pointing out that he's such an idiot.
After crap-flooding my journal, calling me a b*tch and a c*nt, he offered a "truce". Of course I rejected it. He's the only one doing the stalking and crap-flooding, but he can't bring himself to stop. He has to see himself as some soft of "winner", even though it's obvious by now that he's obsessed with me, and that I totally p0wn him.
Maybe he needs some more tiger blood? That an a lobotomy ...
Anyone looking at the time stamps can see you're the one doing the stalking, you moron.
This is the stupid nutter known as "the hosts file guy", aka Alexander Peter Kowalski. He follows me everywhere ... in the last month, he's called me a b*tch, a c*nt, a russian botmaster ... he's claimed to defy both gravity and biology by growing another 2 inches in his 40's, so he's now "overweight" instead of "obese", and of course, the usual threats to sue for libel, which he does to everyone, then always backs down. He can't help it - he's obsessed.
For those who are curious about just how retarded the "apk troll" is - just follow the magic linkies. The guy is a real nutcase. But you too can help keep him busy - just post something anonymously saying he needs to get a life, or that his hosts file doesn't work, and he'll spend the next few weeks stalking me instead of spamming about his "miracle hosts file". He is *totally* p0wned at this point, and doesn't even realize it.
http://www.jeremyreimer.com/phpbb2/viewtopic.php?t=4128 The "I have a lawyer and I'm going to sue the Internets" thread - very funny. Thee are updates on subsequent pages mixed in with the comments. Warning - it's 22 pages.
http://arstechnica.com/civis/viewtopic.php?f=23&t=891505&p=16510422#p16510422 - a collection of apk (Alexander Peter Kowalski) spam.
http://arstechnica.com/civis/viewtopic.php?f=17&t=1046804http://www.thorschrock.com/2008/05/19/how-to-respond-when-people-threaten-to-sue-you-on-the-web/
http://arstechnica.com/civis/viewtopic.php?f=17&t=1046804
http://arstechnica.com/civis/viewtopic.php?f=23&t=453001
http://www.jeremyreimer.com/APKware/index.html screenshots
After getting kicked off a few other places (ntcompatible, etc) needs to find another place to push APK "toolkit" so he got himself an account on sourceforge with nothing in it - no projects, no code, and started
http://slashdot.org/comments.pl?sid=161862&cid=13531817 http://slashdot.org/comments.pl?sid=158310&cid=13263898&threshold=-1&commentsort=3&mode=nestedsecond sighting on slashdot
If you follow the non-slashdot threads, you 'll learn that:
After all, the hosts file guy (APK - Alexander Peter Kowalski) will be able to push his "My hosts file keeps you safe - I only get one or two viruses a month now" junk to a whole new market.
For those who aren't logged in ....
BTW - if you're going to tell this guy to stop spamming his hosts file crap, make sure you do it anonymously - not only does it drive him nuts, but he'll think it's me, and waste his time stalking me instead of you.
Participants 2, 3, 5, 9, 10, 11 ... that's 6/11, or a majority, not "almost half."
The funniest finding? One of the two testers who thought that Software Center was the recycle bin is an Ubuntu user.
Canonical should take the hint - move Unity to the recycling bin. It's not ready, and it never will be. Admit that the 4 years (this all started with the netbook remix spin) is wasted, that mobile is now between Android and Apple (and maybe HP if webOS takes off), that tablets are also going to be going the same route, and that trying to adapt an interface that was designed for small mobile and other touchscreen devices to a regular desktop because your original market plan is as gutted as a mafia stool-pigeon is a bad idea.
Seriously, it was 6 out of 11 that crashed:
Tester # 2, 3, 5, 9, 10, 11 == 6 testers, not 5.
Other facts:
If you read the detailed results,
1. it's a current Ubuntu user who thought the Ubuntu Software Center was the recycle bin.
2. Not one user found where they put "system settings".
3. Only one person was able to add a game to the launch menu
4. Only half could delete a document - and about half of those who succeeded, didn't think they had actually deleted it.
5. Nobody was able to play a song stored on a USB key
6. Nobody seemed to understand what the Ubuntu button was for.
7. Less than half could rearrange items.
"Unity" is a self-referential oxymoron.
When KDE 4.6 broke temporarily, I switched to it for a while, and my old desktop, which was unable to run Eclipse (too gosh-darned slow), is now able to run it just fine. That makes me wonder just how much bloat there is in a "modern full-featured desktop" that removing it makes a heavy java app seem almost light-weight.
Alt+F2 (run command) is even cleaner, executes faster, and is a more minimalistic launcher.
It doesn't mean that it's what people want all the times. If you want lean and fast, you use xfce, lxde, or enlightenment (how times change. I remember when enlightenment used to be considered fair game for the bloatware title ... :-). However, when you get fed up with mousing around, it sure is handy.
Canonical admits that Unity was supposed to be for netbooks (a dying market, eaten alive by low-end laptops, tablets, and smartphones) and "other touchscreen devices" - a market being divided between Android and Apple.
1. Remove the parts needed for a good desktop.
2. Make it the default desktop
3. FAIL!
But it's Ubuntu - the fanbois (mostly people who never tried another linux distro) will be along momentarily to "re-educate" anyone who points out the truth. The usual crap-flood warning is now in effect.
Not for objects in java, and that's what we're talking about. You cannot pass an object in java - only a reference to it. The object is allocated on the heap, and that's where it stays.
If the language didn't actually allocate an object pointer variable distinct from the object itself, I'd concede your point. In that case, the memory location aliased by a variable would be the actual object, and that would arguably be a pass-by-reference language. It would also be a noticeably different language.
I think you need to clarify what you wrote - it doesn't parse cleanly. :-)
Java works the same as c and c++. When you allocate a new object, it is allocated on the heap, and you only get a pointer (reference) to it, not an alias. You can never pass an object in java, (unlike primitives), just the pointer to it, so not everything is passed by value. Objects cannot be passed by value.
Let me fix your example:
You're free to set them to null inside of foo, if that floats your boat.
I hope this clarifies things. :-)
Making a public performance is held to be a form of copying. Satisfied? I didn't think so, but that's the interpretation of the law.
Both the PS3 and the Xbox are energy gluttons in comparison to a Wii, or even a standard stand-alone blu-ray player. People who bought PS3s to play blu-rays got ripped off - the extra noise and the much higher energy consumption (stand-alone bluray player is typically under 20 watts while playing, and 3 watts on standby). You can play a week's worth of blu-rays on a stand-alone for what a PS3 will gobble in under a day..
There are conditions, same as anything else in life. And the example of "showing it before an audience of 100 people" is not necessarily a public performance, even though what that has to do with lending the physical dvd is beyond me - it's a red herring in this context.
Remember all those arguments that the MPAA/RIAA made that you own the physical media? There is nothing against lending the physical media to someone, and even the MPAA and RIAA claim that the license follows the physical media. That's why they're so opposed to such things as streaming, or single-copy-per-user-lock schemes on a server, or, for that matter, format shifting. They can't have it both ways.
Please note - lending is not "distribution" within the meaning of the copyright act, since no copy is being made, which is a requirement for "distribution" under section 106.3.
My point was that the statements are in fact mutually exclusive - a reference to an object is not the object itself, so the statement that "everything is passed by value", when only a reference to it is passed, is simply not true.
No need to get into a long example. The reason for passing non-primitive values by reference has always been that it takes less space on the stack (Java's implementation is stack-based). You only need to place a copy of the memory location on the stack, not copy the actual data (which, with an array or an object, could be quite large).
Just because the object reference is automatically dereferenced in Java doesn't mean that we can get away with saying that "Everything is passed by value", since object never are passed by value. So:
is simply not true. Objects are never placed on the stack - which is where parameter "passing" takes place. It's always been like that, even back in the days of assembler..
Depending on the circumstances, that may or may not be a public performance, which is different from lending the physical CD or DVD to another person (and which is also a different section of copyright). There is nothing in the copyright act that says you cannot lend your original physical copy.
The Wii generates less heat than either of the other two consoles, because, at full bore, it consumes something like 14 watts. The others? 150 - 180 watts. They get HOT. And they're noisier.
They'll stick with flash - just more of it.
Don;t be silly - if I lend someone a DVD, no illegal copy has been made. How is it copyright infringement? Next you'll claim that if I lend you a book or a newspaper, it's copyright infringement.
Again, copyright infringement involves violation of the limitations on the right to make a copy. No copy of the DVD made, no copyright infringement.
Unfortunately, Java doesn't allow the programmer to define ANY operator overloading operations. The string overloading is hard-coded into Java.
Fair enough, but I would suggest that the errors due to manual memory allocation and deallocation are programmer errors, not implementation flaws, and this can be fixed by proper design and always being aware (and wary) of who owns what pointers.
No language is perfect, and no language ever will be, because once we get the "perfect language", we'll then try to apply it to new problems, and find out it's not perfect any more :-)
But take a look at what everyone is so upset about - they don't like my statements that some of us would like the ability to use multiple inheritance, and to be able to overload operators. Why? Because the have encountered problems using them in the past. So what?
Same goes to my habit of writing my own classes in c++. I don't use the stl because it doesn't provide anything I can't do by hand, and I don't need to pull in another 200k of code just for a lousy string class or a stack or a linked list or a scatter/gather array or a ring buffer or whatever. These are basics that anyone who hopes to implement more complicated classes better have down pat.
But they then go on to say this doesn't make sense to write your own classes - and yet, that's what you spend most of your time doing in Java. Just because they're afraid of the "big bad wolf" of a dangling pointer doesn't mean that we should all eschew writing our own classes. Someone has to do it, and there was a time when this was a basic skill - if you couldn't do it, you weren't a real programmer, go to BASIC, do not pass GO, do not collect $200.
All this to try to justify their stand that nobody should dare ask for multiple inheritance or operator overloading in Java. Nobody would force them to use either, but their reaction is like the people who oppose same-sex marriage because somehow it "devalues" their marriage.
What is the big deal with asking for more flexibility in the language, and more ways to express oneself in code?
Sorry, but that's exactly what we HAD to do for a multi-threaded application to meet the guarantees of low latency and no loss of memory.
Besides, once you've done enough classes, the usual "gotchas" that result in memory leaks are easy enough to avoid.
It's also often quicker to write your own classes than it is to adapt a "standard" class. And by writing your own, you avoid a lot of problems (like all the people who are whining about the "diamond problem" wrt multiple inheritance. It won't happen when you write your own, unless you really screw up, and even then it's easy enough to fix).
The next thing was simple -
1. server allocs the parameter struct. ...
4. thread allocs resources as needed. For results, it alloc()s them with a pointer to the appropriate portion of the parameter struct reserved for that. For internally-used processing, alloc() and free() in pairs, so there's nothing to keep track of locally. Sometimes, that takes a bit of planning, but it can be done.
5. when all modules are finished, the thread has no dangling alloc()ed pointers - the param struct has them.
6. the server processes the thread's results (from the param struct), then frees up all the resources pointed to by the various "slots" in the struct, and finally free()s the struct and allocates a new one.
2. server passes reference to parameter struct to thread.
3. for each loaded module
Does it work? Well, 3 separate server processes on the same 512 meg box, with 400, 100, and 100 threads in their respective thread pools, running over a 4-day weekend continuously, 1000 requests per second test, and Tuesday morning still plenty of memory left. (we tested on low-ram machines so that any bugs became apparent quicker).
With proper design, there is no need for smartptrs, weakptrs, etc., and no need to kill off a thread after x number of requests to reclaim lost ram. The problem is, such design takes time - lots more time than people are usually willing to invest - not just in the server portion, but in the individual modules, because even a one-byte leak will kill it.
Now, a year after I left, the programmer who was left to do the maintenance did exactly that - it would crash every 4-6 hours. He had introduced a small memory leak, but even one byte, at 1000 requests a second, is still 1k a second. He had introduced a leak of 200k per request. Respawning each thread after it has served X number of requests would have "fixed" that (the cheat used by most threaded servers), but that was an unacceptable solution in this case - even the small delay in respawning a thread was a no-no..
So dumping your class loader won't free up those resources, and you'll eventually end up starving for one resource or another. The jvm was originally only supposed to run a tv set-top box, not be a general-purpose runtime. For years, java was a "solution" in search of a problem.
Now, we finally have computers that are fast enough and with enough ram to run java decently (no, it's not the jvm and jit that are responsible - go and dust off that old 200mhz pentium with 16 megs of ram and see if the jit suddenly makes it usable ...)
And javanistas are so sentitive to ANY criticism that pointing out that at least some of us would like operator overloading and multiple inheritance instead of a single-hierarchy class system makes them go nuts.
Nobody would be forcing them to adopt any of these features ... but they are so defensive of the "one true way" that they take it as heresy that some people want the option of having more than one way to do things.
Also, it is you who needs to take off the blinkers - I never said anywhere, at any point in my life, that c++ "got everything right" - but java has definitely got some things wrong, as is evidenced by the response to the original article.
both malloc() and free() will execute when you call them. Finalized methods in java may be called on some runs, and not on others, depending on the state of the garbage collector. Nice way to turn code into unreachable, dead code, at random..
You're using the "new, improved" interface. Go into your account preferences and set the discussion to D1 - (Account -> Discussion -> Classic )
The new interface is useless.