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


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment It's undefined in C/C++ (Score 1) 1067

In C and C++ it's not defined to throw an error. It's undefined behaviour and the compiler is free to do whatever it wants.

Typically that means doing nothing special, and on x86, the instruction itself traps when zero is the denominator. On powerpc, there's no trap and you get zero. Each processor has a different, defined behaviour.

However, if the compiler can prove that, along any particular path, the denominator is guaranteed to be zero, it's allowed to delete that entire path, as the program is undefined if that path is followed, so it can assume it isn't followed. It's not guaranteed that your program will execute normally up to the divide by zero. A soon as the divide by zero becomes inevitable, the program is undefined and the compiler is free to do absolutely anything.

If any of the above scares you, C and C++ aren't the languages for you. It always amazes me how many people write non performance critical code in C. But when you need speed/efficiency, there's no replacement for C or C++ and a good optimising compiler.

Also, to the original poster, no, defining it to be zero doesn't make sense. PowerPC did indeed do that. But the number desired isn't always zero. It's undefined in mathematics for a reason: in different situations, it logically should be a different value, and there's no way to resolve the contradiction. Hence if you do divide by zero, your program is seriously flawed.

Comment Re:Replace English with English! (Score 1) 626

The core problem with spelling english phonetically is that english has multiple dialects and we all pronounce the same words differently. What is phonetic for one accent is not phonetic for all the others. And before you say "screw you, only America matters", the same holds *within* the US.

Comment Re:"Undead" doesn't mean vibrant, though. (Score 1) 283

Sure... the only use for pass is to allow an empty block. But outside of canned examples and temporary debug hacking, empty blocks are not exactly used very often. Hence in the vast majority of cases, python has no "end-brace". Claiming that the pass keyword is a closing brace is disingenuous as it implies that it is always required. It *is* a no-op. You can use the pass keyword absolutely anywhere you want, and it will do nothing. It's only "useful" however in the largely useless case of empty blocks.

Comment Re:Cool but probably not feasible... (Score 5, Insightful) 533

The problem I see with this is while it's nice to dream about 800 mph travel, I can't imagine that it would be feasible to construct a track or tube that could follow the terrain at that speed and still maintain passenger comfort. If you are building above-ground supports, you don't want them to be 500 ft tall as would probably be required in order to keep the tube straight enough for passenger comfort and safety.

Luckily, advancement doesn't have to wait for the average guy's imagination to catch up. Have you actually read the proposal or are you just doing the usual slashdot thing?

The guy runs two companies, one in the space business and one that makes electric cars. I'm sure he'll need to ask a construction company for advice about the pillars, etc, but is there any reason to suppose he hasn't run this past the best engineers in those two companies? I'm sure his cost estimates are off, they can only be estimates this early in a design study, but it's not like he doesn't have engineers that know aerodynamics and vehicle design.

I'm willing to give him the benefit of the doubt until real rebuttal arrives, say from someone who can point out actual errors in the proposal.

Comment Re:balancing the scales (Score 1) 307

Why should you get decide If I'm using a camera at a pub you don't own? Sure, I think it is reasonable to demand cameras off in change rooms and similar places, but if I'm in a place were it would be socially acceptable to take picture with my phone why I should have to turn off my future tech constantly running camera?

Because there's a difference between occasional photos and continuous video? From a couple of photos, you know i was there. With a critical mass of people with always on video recording, you know *everything* I did while there, *every time*.

Just because a little of something is acceptable doesn't mean everyone's keen on the idea of an increased amount of it. It's the same logical fallacy as arguing that because you like a pinch of salt on food that you'd be happy with 1 kg of salt dumped on it.

I don't want every aspect of my life documented. Especially by the likes of google. Do not track?

Comment Re:one word! (Score 1) 678

Except that you need far less, because you eliminate the ridiculously poor efficiency of ICE engines and the Carnot cycle they're based on. Carnot-cycle engines are maximum 35% efficient; electric motors are in the 95+% range.

ICEs aren't based on the Carnot cycle (although carnot is the most efficient possible cycle). Carnot cycle engines are *not* maximum 35% efficient. Why you quote the efficiency of the motor by itself is bizarre (and also excessively high for modern electric motors over a normal drive cycle). Electric cars are not 95% efficient when you start from coal being burned to generate the electricity, and include battery, inverter efficiencies etc. Especially when you consider that coal power stations, also being heat engines, are bound by the same carnot maximum theoretical efficiency formula (although their practical efficiency is generally higher than ICEs).

I don't actually disagree with the thrust of your rebuttal, GP is an idiot.

Comment Re:What really happened... (Score 3, Informative) 371

I've heard this repeated several times but it's a load of misinformed crap. It's one of those "makes sense to someone who knows nothing but is totally false" myths.

When a central bank creates money through a loan and it is later paid back, it is only the principal of the loan that is created and destroyed. The interest portion is considered the bank's profit and is paid out to the bank's shareholders (whoever that may be, it differs depending on which country you're talking about, but usually member banks and/or the government). That money is not destroyed and re-enters circulation. How would it even make sense for the interest to be destroyed as well?? That would totally break the concept of double-entry accounting (which central banks do still follow).

I don't know where this myth started but it's 100% false. I realise the financial crisis has made everyone interested and out for easy answers, but "the only thing it can possibly end in is debt and the enslavement of entire nations... Exactly as designed"? Please. I hate bankers as much as the next person but i wish we could focus on the real problem (outright, unpunished fraud) rather than this kind of fairytale crap.

Comment Re:10% Ethanol (Score 1) 556

What do you thing pinging/knocking is? It is detonation of the fuel in a non-optimum premature way. I said simple version in my answer, not 100% factually correct version.

Pinging/knocking occurs *after* the spark plug has fired and is the premature ignition of parts of the mix before the flame front reaches them. If the mix self-ignites before the spark plug fires, that's pre-ignition. Two different phenomena with two different forms of characteristic damage (the latter is usually way more damaging). Backfiring has nothing to do with either.

Obligatory wiki link.

You may think you gave the simple version, but in fact you gave the wrong version.

Also, octane ratings are not obtained by the pressure at which the fuel spontaneously combusts, or at least that is a misleading explanation (makes it sound like you put it in a pressure chamber and up the pressure until it pops). The two primary measures, RON and MON, are both obtained using a combustion engine with a variable compression ratio. It's a much more real-world measure than you make out.

Comment Re:California wants to split off (Score 1) 552

California is having budget issues mostly because the federal government is raping it, so that its wealth can be redistributed to Republican owned southern and midwestern states. Californians pay far more in federal tax than they receive back in federal benefits. If California was on its own and took those federal taxes itself, its debt would be gone almost immediately.

There is just so much wrong with this statement that it hurts to think about it.

1. Do you know for sure how much of California's state budget goes to the federal government? I do. It is $0. No state pays the federal government for anything (except for fines for various things). State governments haven't paid the federal government since the Articles of Confederation. This is a fact.

That may be a fact (I'm an Aussie, what do i know), but it doesn't address what he said. His claim was that if you took all the federal taxes the people and companies in california currently pay and instead gave it to the newly created national government of california, it'd be better placed financially than it is now. He never said the state itself paid money to the federal government. The contention is that there is a net outflow of money from california (taxes paid vs benefits received). If this is the case, then it sorta does make sense for California to break away. In financial terms anyway.

Comment Move (Score 3, Insightful) 948

Seriously, if the picture in the US is as bad as some of you are painting, move. Seriously. I mean to another country. The rest of the western world is just no where near as fucked up. At the very least, drop any delusions that this is something we are all suffering under. No, it's just you. We don't know why you put up with it, but you really don't have to.

I'm an Australian engineer. My boss is always kind and courteous to me (and would be in trouble if he wasn't). He isn't out to screw me, he is part of the team. We are encouraged to take the 4 weeks of leave we accrue annually (it rolls over if you don't take it and there are thresholds where they start whinging at you to take it). We get paid overtime, and any doctoring of timesheets to work past the overtime caps is strictly discouraged. Actually, in truth, getting overtime as an engineer is fairly rare, but there is usually a TOIL system or equivalent such that you are only working the hours you are paid for on average. There are constant campaigns reminding people about work-life balance. There is even one day of the week where overtime is basically not approved and you get in trouble if you stay back to work on a project (meant so that even in busy times, you see your family occasionally). Work on weekends, while not totally prohibited, is extremely rare (i've never done it in 3 years). It requires special approval and they have to pay 1.5x your hourly rate.

I'm not trying to boast here, just trying to counter the hopeless view some of you have that it is the same everywhere and you should just cop it.

Slashdot Top Deals

"It's when they say 2 + 2 = 5 that I begin to argue." -- Eric Pepke