Posts

Showing posts from November 29, 2018

How to represent a integer by a chain of 8 bit numbers [closed]

Image
up vote -2 down vote favorite I am wondering how you can represent an integer as a chain of 8-bit numbers. That is, (and I don't know how to actually calculate this so the example is wrong, but should demonstrate the basic idea), say you have an integer of arbitrary size , meaning it can be extremely large like Math.pow(100, 100) ≈ 1e+200 or some small number like 1 or 0 . You want to be able to compute that number by using a chain of 8-bit values. The question is how to do that. For example, I can represent 255 like this: [ 255, 1 ] That is, our representation has the first value be 8-bits, and then the second value is also 8-bits, and we multiply them together as 255 * 1 = 255 . Another case would be 256 . We could represent that like this: [ 255, 1, 1 ] Meaning (255 * 1) + 1 = 256 , but now we don't neces

Naming - Is “a log” a single entry or a book of entries?

Image
up vote 0 down vote favorite This comes up often enough that I want to have a consistent answer with a source. It seems that some programmers (and that is what I care about here, the programming context - not so much the English usage) think that "a log" is a complete record (like one book) of things that have happened and it contains several entries. These programmers would name a database table something like "ContentChangeLog" and call its rows "entries." They wouldn't typically use the term "logs" to describe anything. There are other programmers who think that "a log" is a single entry inside a collection of logs. They would name a database table something like "ContentChangeLogs" and call its rows "logs." Is there a non-opinion-based, consistent answ