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

 



Forgot your password?
typodupeerror
×

Comment Re:We need a long-term solution (Score 1) 233

Some people can actually think past the next quarterly report.

High frequency traders are busy looking at the next 1 second's report. If they can buy AFTER they sell by taking advantage of the fact that two different trading platforms do it two different ways, then there is a serious risk that the dollar will be toast

No one cares if it takes one second longer to log in to a .NET system.

Quite a few people care that there are traders who probably have devoted weeks to figuring out how to sell the entire content of Fort Knox, and buy it back one second later (or earlier, according to which time standard you are using) at half price.

Comment Re:Doesn't matter, so why do it? (Score 1) 233

It won't matter when you get scammed by the market traders who use the discrepancy to steal your entire pension fund/house/car or anything else tied to "the system". Yes, planes may crash becaose of a 1 second error in interpreting GPS signals, and possibly even ships run aground.

I care about these things. It seems like some other people do too.

The solution is, of course, "international agreement" on how to handle the issue. Does not matter which approach, so long as everyone agrees on it. Good luck with that one.

Comment Re:You are Doomed (Score 1) 50

If you're old enough to remember the micronova [I'm a former DG software engineer and I wrote code for it], you can probably remember the PC "turbo" switch. When IBM realized that PCs were outperforming their mid-range business systems (AS400???), they changed the BIOS to prevent boot if the PC ran too fast. Hence, the turbo switch: Run slow until BIOS is done, push turbo switch to get faster clock speed.

That was IBM's first attempt to control [PC] turf. The second came with the micro channel architecture (MCA). Their proprietary licensing caused clone mfgrs to revolt and form a standards organization that produced the ISA bus. Eventually, IBM lost control of a market it created.

Same thing is happening with MS. Tried too hard to map everything back to Win*, even for mobile. Now, they're late to the party and are open sourcing .NET--but it's too late. Mindshare [among developers] has already headed to Android/IntelliJ/etc.

Comment Re:Give it some hints ... (Score 1) 424

Google needs to implement a "nerdsearch" feature, where they actually do what you ask, with quotes and -/+ operatore, etc

They also need a "Do not put any commercial results in here - I am not planning to buy anything, and have no intention of clicking on anything that looks like an advert - and I AM SERIOUSLY CONSIDERING SWITCHING TO BING" option.

Comment Re: Infinity (Score 1) 1067

If I have a cake, and share it between zero people, how big is each person's slice?

The answer is "that was a dumb question"

You cannot share a cake between zero people. The cake may be still whole, but no person has a part of it of any size. Maybe they "could" have a part of almost any size, but that was not the question. (Maybe it should have been, but in that case, you have to provide for different max and min answers, and should have asked the question differently ).

What is the answer to x/0? The answer is "you have got the question wrong!" - otherwise known as Error: divide by zero.

How you report a divide by zero error, is of course somewhat context dependent. Silently ignoring it could well be the right approach if decoding VoIP. If controling a driverless truck - probably is not .

Conclusion: Yes, after rather more than 70 years of computing, we actually have got this one right!

Comment Megaharm (Score 1) 1067

System wide setting? Most other programs don't want it. What you want is a function you can call at the start of your program: no_div_by_zero_exceptions_in_this_program().

But, that is a bad idea (tm) because the programming language/system doesn't know the context. That is, what you intend if div-by-zero occurs on a line-by-line basis. That's why you have to have explicit checks:

if (y != 0)
    z = x / y;
else
    z = ...; // what you want: x, 0, inf, -1, throw exception, abort program, whatever

But, this is just a single check out of the things a program has to check for:
- null pointers
- array bounds
- insane/wrong values (e.g. a person's age shouldn't be a negative number)
- object in wrong state for operation to be performed (e.g. trying to do a database operation when the DB handle isn't locked)
- ...

Also, drawing on the recent Linux raid0 problem [where FS corruption was happening], they had something akin to:
    sector_offset = absolute_byte_position / sector_size;
If sector_size happened to be zero (a programming mistake), silently returning zero here would corrupt the disk/file.

You've been programming for 20 years? Well, junior [I've been programming for 43--sigh], you've still got a lot to learn. And the fact that you didn't see the harm before you posted proves that.

Comment Re:I want my division by zero errors to be errors (Score 1) 1067

Sanity check before averaging. If the number of items in a set to be averaged = 0 then don't run that code as it is useless.

I prefer preemptive sanity checks before processing to avoid errors in the first place. You check for 0 BEFORE you divide, as it usually points to some other problem (besides math), in the case above, a null set.

Comment Re:Infinity (Score 1) 1067

I actually recall someone bemoaning that it is undefined, and thus causing confusion. The proposal, was to create a definition, a symobol/word, to describe a result that is x/0, and leave it at that. Because it does have meaning, we just haven't quite figured out how to wrap it up nice and neat.

MY example is (1+(x/0))*2 is what? Does the fact that x/0 mean that it is not solvable? We have other terms for other numbers that seem impossible. SQRT(-1)

Slashdot Top Deals

Suggest you just sit there and wait till life gets easier.

Working...