HNHacker News
TopNewBestAskShowJobs

cautious_int

73 karma · joined August 2, 2015

submissionscomments
cautious_int··on How Amazon Deleted Me and All My DRM Without a Second Thought
In this case the house was burned down by the owner( company ) because someone broke in.
cautious_int··on How Amazon Deleted Me and All My DRM Without a Second Thought
Here's to the crazy ones.

( Sorry, I couldn't resist. I found it funny in a sad/ironic way. )

cautious_int··on [dead]
It is, of course, entirely possible the FBI or some other agency was able to extract the password from Glenn while interrogating him – the man changed his plea to guilty halfway through the case, and may have sung like a canary.

In other words, the title is clickbait.

cautious_int··on How Amazon Deleted Me and All My DRM Without a Second Thought
Why do we have to resort to public outcries to get attention from a company?

If the user agreement really allows this, then it is time to stop supporting them.

cautious_int··on A deep look at BIND9 CVE-2015-5477
Looks like something that should have been caught with a unit test that would test all possible error paths.
cautious_int··on More Dirty Coding Tricks from Game Developers (2010)
That is why you should never learn from one exclusive source, especially if they don't provide valid arguments, and imply "trust me".

I saw a couple of his introductory videos and I think he is great to teach specifics about game programming, but should definitely not teach how to write C.

cautious_int··on Should I Use Signed or Unsigned Ints?
Oh, you are assuming someone actually wrote that code. That is circular reasoning.

It would be much better to write proper checks or just call functions that do so.

cautious_int··on Should I Use Signed or Unsigned Ints?
How would that fix existing code without modifying it?
cautious_int··on Project Euler has been hacked
But what information was even held on the website. Wasn't it just a public listing of usernames with the score.

According to this https://news.ycombinator.com/item?id=8181773 then don't even store emails anymore.

cautious_int··on Should I Use Signed or Unsigned Ints?
Of course you gain ability to check for overflow after performing the operation,

Using exceptions?

IMHO only very small fraction of overflow bugs would have been fixed by just wrapping result around.

Yes, switching to wrapping integers is not the solution to overflow. Rather check the operation beforehand. I still think using unsigned integers is always preferred if you don't need negative values.

cautious_int··on Should I Use Signed or Unsigned Ints?
1u/0u
cautious_int··on Should I Use Signed or Unsigned Ints?
Assume sizeof(int) == sizeof(unsigned int) == 4

g << h Well defined because 2147483648 can be represented in a 32 bit unsigned int

Even under those assumptions, it is implementation defined if unsigned int can hold the value 2^31. It is perfectly valid to have an UINT_MAX value of 2^31-1. In that case the code will cause undefined behavior.

The only guarantee for unsigned int is that it's UINT_MAX value is at least 2^16-1, regardless of its bit size, and that it has at least as much value bits as a signed int.

For example C allows these ranges:

int: -2^31 , 2^31-1

unsigned int: 0 , 2^31-1

← PreviousPage 2 of 2