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

 



Forgot your password?
typodupeerror
×

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

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:Idiot (Score 1) 1067

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:Simple (Score 1) 1067

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) 1067

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

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

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.

Slashdot Top Deals

"A car is just a big purse on wheels." -- Johanna Reynolds

Working...