Forgot your password?

typodupeerror

Comment: Re:Confused (Score 1) 160

by Old Wolf (#43672407) Attached to: Integer Overflow Bug Leads To <em>Diablo III</em> Gold Duping

"unsigned int x = -3;" generates no compile errors or warnings.

This supports the point of the poster you were referring to. The code is correct, predictable, and generates no warnings.

If you don't believe me, listen to the creator of C++

C and C++ are different languages. The implicit conversion rules and the promotion rules are different in C++ to C. In C, unsigned types always promote to unsigned types. But in C++, unsigned types may promote to signed ones, if the value fits in the signed range.

Comment: Re:Confused (Score 1) 160

by Old Wolf (#43672375) Attached to: Integer Overflow Bug Leads To <em>Diablo III</em> Gold Duping

In general, it's a good idea to used signed ints whenever possible.

Says who?

In C, signed ints have a whole lot of problems associated with representation and overflow. But unsigned ints have well-defined behaviour in every circumstance. They wrap around in case of overflow or an out-of-range assignment. You can safely test, set and reset individual bits.

With signed ints, you can raise a signal (triggering a signal handler, or aborting the program if there is no handler) if there is overflow or underflow. Using '^', '|' or '&' on signed values can trap due to creating an invalid representation (e.g. negative zero, or parity error).

Test: what is wrong with this code snippet (assuming the appropriate furniture)? Hint: it doesn't always print 0x82.
    char ch = 130; /* é in the traditional code page */
    printf("0x%x\n", (unsigned int)ch);

Comment: Re:Then why the cooling? (Score 1) 367

by Old Wolf (#43637569) Attached to: Observed Atmospheric CO2 Hits 400 Parts Per Million

As a former Alaskan I can tell you that glacialization has come back the last 3 years and summer temperatures are rapidly falling year after year. So climate != weather but 13 years of data is starting to make a case for a cooler climate regardless of increased CO2.

"global warming" doesn't meant that every point on the globe will warm up by the same amount. It could be that Alaska gets colder, but Brazil gets hotter by a larger amount, for example.

Comment: Re:I suspect their simulation is flawed (Score 1) 509

by Old Wolf (#43585263) Attached to: Cracked Game Released To Get Back At Pirates

Interesting question is - if they haven't released the pirated copy, how many people would have downloaded it (assuming anyone would even bothering cracking it)?

It has no DRM so it is not possible to crack.

If the developers really want to mess with the pirates, now they will start seeding dozens broken copies with various titles like "Game Dev Tycoon - FULL VERSION", so that the pirates can't tell the real one from the broken one.

Comment: Re:tell me again (Score -1, Troll) 1105

by Old Wolf (#43456019) Attached to: Explosions at the Boston Marathon

For what it's worth, bombings are happening every day elsewhere in the world. But in the US, granted, it's an uncommon sight. Quite sad. (That it happened, not that it's uncommon!)

I was watching coverage of the Boston incident and the news ticker said "Explosions across Iraq leave 24 dead". But it's only brown people, right? The priority of those stories should have been reversed.

Comment: Re:Not your time, ALL OUR TIME (Score 3, Insightful) 197

by Old Wolf (#43241451) Attached to: Ask Slashdot: Dealing With Electrostatic Contamination?

You, and the Slashdot editors that posted this, are wasting everyone's time with this question. What's next, an Ask Slashdot for shaking crumbs and pubes out of your keyboard?

Don't be an ass. The question is whether cleaning dust out of a PC actually makes a difference or not. (or even whether it's harmful). Since most people don't do it and their PCs continue to work; and it's possible to give a component a static shock while trying to clean it, the question is reasonable.

Comment: Re:Musk isn't doing himself any favors here (Score 1) 841

by Old Wolf (#42904957) Attached to: Elon Musk Lays Out His Evidence That NYT Tesla Test Drive Was Staged

Let me get this straight: I can't drive 65 or turn up the heat without having to worry about getting stranded?

If your petrol vehicle had a very accurate range finder, you'd notice the range going down when you sped up or turned up the heat.

You don't have an accurate range finder, so you assume that those things make no difference; and if you even do notice that your vehicle varies a bit in how many miles you get to each tank, you just put it down to randomness because you don't understand the actual factors that go into vehicle range.

Comment: Accuracy of newspaper articles (Score 1) 841

by Old Wolf (#42904919) Attached to: Elon Musk Lays Out His Evidence That NYT Tesla Test Drive Was Staged

We know the facts in this case and can see how far the news article diverges.

Think of all the times you read a news article about some topic you don't know much about besides what the article tells you - and yet we tend to take those articles at face value.

The handful of times I have known people involved in an event which got reported on in a newspaper, the article often diverged wildly from reality. One time, a murderer was reported as "having been tracked down after a 3-day manhunt" when in reality once he came off his meth high he walked to the nearest police station and handed himself in.

Comment: Re:Remove keys from ignition? (Score 1) 1176

by Old Wolf (#42904505) Attached to: Driver Trapped In Speeding Car At 125 Mph

That's a phenomena specific to diesel engines. Diesel's don't use a spark to ignite the fuel mixture like gasoline engines do, they use the heat from piston compression. Thus, so long as vacuum pressure and fuel supply is maintained, a diesel can continue running without electrical power.

Fuel pumps are driven electronically too (for the last N decades) , normally turning the key off will also kill power to the fuel pump. In fact I once owned a car where the owner had installed a hidden switch under the seat to turn the fuel pump on and off, purely as an anti-theft measure - although I'm sure this French driver wishes his car had one of those.

Also (I'm sure you know this but some readers may not, judging by the number of "why didn't he just use the handbrake" comments), petrol engines continue to run without the battery being connected - the engine's mechanical output drives the alternator which powers the spark plugs. Turning the key off normally interrupts the flow from battery/alternator to relevant part(s) of the ingition system.

They have been at a great feast of languages, and stolen the scraps. -- William Shakespeare, "Love's Labour's Lost"

Working...