Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
Get HideMyAss! VPN, PC Mag's Top 10 VPNs of 2016 for 55% off for a Limited Time ×

Comment Re:Arguing over the subjective (Score 1) 523

Yes, and that's the problem. Then flush() will throw an exception because (for example) the disk was full, your program will just exit and the user's data are gone. In reality, you should write something like

                ofstream myfile( "example.txt" );
                myfile -- "Writing this to a file.\n";
                ofstream flush(); // catch exception, warn the user, maybe try a redo
                ofstream close(); // catch exception, warn the user
                return 0;

Comment Re:Arguing over the subjective (Score 1) 523

For almost all kinds of problems, the fact that C++ destruction can automatically release resources, so you can safely return from anywhere in a function instead of having goto fail all over the place is a significant win for C++.

Too bad that that's not true. Dtors cannot throw exceptions, that means that dtors are only useful for releasing memory resources.
Dtors are useless for releasing anything else, because all other resources can throw an exception upon release.
For example, for the classical file stream example Dtors are useless.


    ofstream myfile;
    myfile.open ("example.txt");
    myfile

You see that the ofstream have a method close() and is not using the Dtors of C++. That's because see my point above.

Comment Re:Microsoft Java (Score 2) 115

I don't get your post. JNI was in Java since day one (or very early on), and via JNI you can access everything that is platform specific. MS or anyone else can just use JNI to bundle a Jar file for Java to allow access to DirectX and platform specific APIs. Java is not some magic, but it's basically a level above C/C++. The architecture is basically, Java>C>OS>Driver>Hardware. So, MS could have just bundled it's own Java+Windows specific modules.

And to put an browser in Java is also easy. https://www.teamdev.com/jxbrow...
What difference does it make if it's the Chrome engine or some engine written in Java?

Comment Re:License (Score 1) 255

You have cherry picked one comment from Richard Stallman, which was just his personal ideology. David Edelsohn replied this:
https://gcc.gnu.org/ml/gcc/201...

GCC is working toward re-factoring its code base toward a more
compositional approach for "toolification". One can look at
presentations from the recent GNU Cauldron 2013 for discussion of the
topic. David Malcolm also has created patches for the GCC backend to be used as a JIT.
The assertions that FSF policy prevents technical development and
innovation simply is not true.

Maybe GCC was "deliberately obtuse", but as I see it, steps are taken to change that and enhance GCC for tool chains and to be used a library just as LVMM is.

Comment My answers (Score 1) 208

"reverse a linked list in place,"
> use a double linked list. no need for any reversing.
"balance a binary search tree,"
> use self-balancing binary search tree
"find the missing number in an array"
> disallow empty slots in the array, throw a runtime exception if the caller passed null into the array

Comment Re: Causes cancer (Score 1) 428

That's why people who advocate healthy food are seen as dicks. Come down from your condescending high horse and maybe more people would listen to you. Do you really think you are going to help people by insulting them like "But go ahead and munch on Doritos and Mt. Dew if you prefer - a goatee should compensate."? Most people will just think that you are a dick. Or "experience real food.", like you are the expert who decides what is "real" food and what isn't.

Comment Re:Hate in 3, 2, 1... (Score 2) 128

Groovy is an example how to do it right. In Groovy, I don't need semicolons and even parenthesis are optional, but there is no pitfalls you can fall into like in JavaScript. That is because the Groovy compiler don't try to be intelligent and try to guess your intent.

In Groovy I can write
func "a", "b"
func "a" bar "b" baz "c"
func { closure }
return [func: "something"]

Comment Re: And we care because...why? (Score 1) 280

That's a no brainer. Because if a job is open people will take it. But woman have more options than man. For example, marrying a man who goes into STEM, or make money off looks (which includes everything from ads, to modeling, to porn, to marrying), or go into services or nursery or kindergarten or teacher jobs.

Comment Re:Their work is being wasted. (Score 0) 142

Utter BS. The user land of Linux gets better and better. I remember the time about 14 years ego when I had to put some obscure data of my monitor in the Xorg.conf to get any graphic output, and when I could only have sound from one application. PulseAudio, KDE and Gnome all improved my experience of Linux, and now systemd which also improves my experience. For example, to add the Emacs-Daemon I just had to put a 14 lines systemd-service file in .local/share/systemd/user/emacsd.service and run systemctl --user enable emacsd, without root privileges.

Just look what a mess Sysvinit scripts are for the same task:
http://www.emacswiki.org/emacs...
For the same task in systemd for Sysvinit I need an over 150 lines bash script, root privileges, and the Sysvinit have several bugs that needs to be fixed. And for what? Just to start a user daemon.

Comment Sensational article is sensational (Score 0) 747

Like I think all of the Systemd stories, sensational article is sensational. If you actually read what machinectl is, you'll see it has nothing to do with the su command, and it's also not suppose to replace it. Basically, from reading for about 1 minute, machinectl is to execute operations on VMs and containers. Last time I checked, the su command don't do that and have nothing to do with it. Probably someone asked Poettering, "Hey, would be nice to have root shells in a VM"

http://www.freedesktop.org/sof...

machinectl may be used to execute operations on machines and images. Machines in this sense are considered running instances of:
        Virtual Machines (VMs) that virtualize hardware to run full operating system (OS) instances (including their kernels) in a virtualized environment on top of the host OS.
        Containers that share the hardware and OS kernel with the host OS, in order to run OS userspace instances on top the host OS.
        The host system itself

Slashdot Top Deals

"I shall expect a chemical cure for psychopathic behavior by 10 A.M. tomorrow, or I'll have your guts for spaghetti." -- a comic panel by Cotham

Working...