Become a fan of Slashdot on Facebook


Forgot your password?

Comment: Re:Problems in C++ (Score 1) 385

by Jamu (#48861387) Attached to: Is D an Underrated Programming Language?

Dude, don't use square brackets with STL arrays and vectors, just to make your code more readable. The [] operator skips bounds checking, which is the main reason for using these classes in the first place. At() is the proper methodology to use in pretty much every case, unless you are so confident in your bounds that its worth the trivial speed increase in access time.

Bjarne Stroustrup's solution:

class Vec : public std::vector<T>; {
using vector<T>::vector

T& operator[](int i)
{ return vector<T>::at(i); }

const T& operator[](int i) const
{ return vector<T>::at(i); }

Page 97 of The C++ Programming Language.

Comment: Re:How about someone who groks the math, comment? (Score 4, Informative) 197

by Jamu (#48635159) Attached to: Quantum Physics Just Got Less Complicated

A quantum state of position can be written as a superposition of a momentum states; the position is certain and the momentum is uncertain.

A quantum state of momentum can be written as a superposition of position states; the momentum is certain and the position is uncertain.

That's the duality and the extremes of the uncertainty principle. The mathematics can also show more generally, that the uncertainty in position and momentum is always more that a certain value (Planck's constant).

These things follow directly from the axioms of Quantum theory, Hilbert spaces and any two non-commutative operators. So I really don't see how Quantum Physics "just got less complicated". It's the same as it's always been. Although I've not read the paper yet, maybe that makes more sense.

Comment: Re: Advertisement? (Score 1) 115

by Jamu (#48571927) Attached to: FreeNAS 9.3 Released

I tried both FreeNAS and NAS4Free for a home server, and they were both good for what they aim to do. The problem I had was when I wanted to run something other than a NAS on the same box, such as tvheadend. I consequently tried OpenMediaVault as this is based on linux. In the end, I concluded that these only work if you're running your box purely as NAS. After a look at virtualisation using docker, and concluding that this was overkill, if not a bad idea, I went with Ubuntu Server and webmin. The storage is using BTRFS. I could have used ZFS, but BTRFS seemed a better choice, for what I wanted, at the time.

Note that if you want proper NAS, you'll probably want to avoid everything I've done at home. :)

Comment: Re:All the Kindles are on sale... (Score 1) 43

by Jamu (#48476039) Attached to: Apple and Amazon Launch Black Friday Price War
I have a Nook. This has a passive screen. Great for reading in bed before going to sleep or in direct sunlight. It doesn't shine a light into your eyes keeping you awake. I believe the Kindle Paperwhite does have a light, but I guess you could switch that off. I'd probably just get the Kindle if I didn't already have the Nook. I can't see any advantage with the Kindle Fire over my Nexus 7 though.

Comment: Re:Nuclear weapons? (Score 4, Informative) 42

by Jamu (#48437443) Attached to: CERN Releases LHC Data
No. Even though it's called CERN. The research is very much sub-nuclear. And although the energies are higher, this also means the particles involved decay quickly. Similarly in nature, they're created with high energies, but don't last long. The A-bomb relies on the natural abundance of uranium or plutonium. These are unstable elements that can be triggered into decaying in a chain reaction. The particles at the LHC need a lot of energy to create, and they decay quickly. It's been suggested they could make an anti-matter bomb. You'd need to use a lot more energy making the anti-matter than would be released in the bomb. Anti-matter is hard to store: it will interact with any matter destructively. No one can make anti-matter in enough quantity. Even if they could, and despite the great energy efficiencies, plutonium and uranium is so much more practical, along with some fusion fuel, that the relatively low energy efficiencies of a nuclear bomb, isn't a problem.

Time-sharing is the junk-mail part of the computer business. -- H.R.J. Grosch (attributed)