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

 



Forgot your password?
typodupeerror
For the out-of-band Slashdot experience (mostly headlines), follow us on Twitter, or Facebook. ×

Comment: Re:Yeah, well... (Score 1) 126 126

I had a look at the question. It explains exactly what a sparse array is and even tells you how it wants you to implement one (essentially as a linked list). The question involves writing the functions to access elements of the sparse array. Given the details provided, I'd be really disappointed if any programmer familiar with the concept of a linked list failed to complete the exercise satisfactorily.

Comment: Re:Arrest (Score 1) 333 333

What illegal government actions are they protesting? It seems more like they are protesting the government's impotence.

And TFA contains an account of taxi drivers blocking access to stations and assaulting an Uber user in one case. Protest is fine, but beating the crap out of people? Nope.

Comment: Re:Idiot (Score 1) 1066 1066

Imagine a cruise control in a car. Let's say that speed is measured (this may be the way it is really done, but it is speculation) by monitoring a point on the wheel and every time it passes the vertical a subroutine runs that calculates the time difference by using the system clock time now and the last time the subroutine ran and then the speed by dividing the circumference of the wheel by the time difference.

If on two runs, the system clock reports the same time, I can think of two possibilities:

- the system clock is broken
- the wheel is rotating so fast that the system clock does not have enough resolution.

Would you prefer the subroutine to report the speed as 0 thereby causing the cruise control to put the pedal to the metal; "really really fast" thereby causing the cruise control to slam on the breaks, or at least cut all power; or "I don't know how fast we are going" thereby causing the cruise control to disengage, perhaps with a warning to the human driver?

Comment: Re:Sounds like a plan! (Score 1) 1066 1066

This is better because, if there are three investors, the extra cent won't mysteriously disappear into the void.

On the other hand, if the loop runs zero times, no division has occurred at all which is sort of what we mean when we say you can't divide by zero.

Comment: Re:Simple (Score 1) 1066 1066

Sales chart lists all sales broken down by department. Electronics, hardware, etc. It also breaks it down further, hammers, table saws, etc. Hardware sold nothing last month. What percentage of that was hammers?

100%? 0%? 53.7%? The question is meaningless if you didn't sell anything at all. If your code doesn't handle the case where itemsSold == 0, it is bad code.

Comment: Re:Idiot (Score 1) 1066 1066

They are regions of space-time from which even light isn't fast enough to escape. Einstein's General Theory of Relativity predicts a singularity at the centre of a black hole i.e. a non zero amount of mass is squished into zero volume. This seems impossible so most people think that GR breaks down in such extreme conditions and we need a new quantum theory of gravity.

i.e. the division by zero is an indication that the model is wrong.

Comment: Re:15 years in the embassy (Score 1) 262 262

Do you honestly think that would actually happen to a man who has had as much publicity as Julian Assange?

This is all about avoiding the rape charge, nothing else. Assange clearly thinks that there is a chance he might get convicted.

That last sentence is speculation, but it is a more credible story than that the UK or Sweden would collude in a CIA kidnapping of a public figure.

Comment: Re:Frustrating type conversions (Score 2) 337 337

Trust me, when I assign a double to an int, I know I lose the mantissa. .

Since it's actually the exponent you lose (and maybe also some or all of the mantissa depending on what the value of the exponent was), I really think you need to start using a language that gently reminds you that converting from a double to an int is not necessarily a trivial exercise.

Without life, Biology itself would be impossible.

Working...