News for hackers. Stuff that matters.
Re:9 truths that computer programmers know that most people ... by captn3m0 on Sunday March 08, 2015 @11:31AM (#9165863)
Could someone expand on this:

>How a single number can be used to represent the answers to a set of yes-no questions.

Re:9 truths that computer programmers know that most people ... by neilk on Sunday March 08, 2015 @12:39PM (#9166125)
Think about how everything in the computer is represented as binary ones and zeroes. That's kind of weird. When a non-programmer counts 5 items in the real world, they don't think of it as being equivalent to saying "101", or "YES NO YES".

Now imagine you have a set of questions like that, to be stored for kajillions of items. You can efficiently pack those yes-no questions into a single number for each item. Like, in the unix file permission system, 5 expands out to "let others read this; don't let others write this; let others execute this".

Re:9 truths that computer programmers know that most people ... by captn3m0 on Sunday March 08, 2015 @02:11PM (#9166479)
The unix perms bit made me understand it. Thanks.
Re:9 truths that computer programmers know that most people ... by untrothy on Sunday March 08, 2015 @12:23PM (#9166057)
Off the top of my head and according to what he meant by single number:

- As a single entity: I usually think in decimal so you could write a "single" decimal number (e.g. 234) and convert it to binary and the 1 and 0 character mean Yes / No.

- As a single character: You could just write a random character (e.g. ॐ ), specifying that is has to be interpreted as a number in Base N+1 and ॐ + 1 = 10. This is useless though.