Definition of int64_t

a) Can you explain to me the difference between int64_t and long (long int)? In my understanding, both are 64 bit integers. Is there any reason to choose one over the other? The former is a signed integer type with exactly 64 bits. The latter is a signed integer type with at least 32 bits. … Read more

The maximum string content length quota (8192) has been exceeded while reading XML data

The bindingConfiguration needs to have the name you assign to the netTcpinding element – “LargeBuffer” or “LongFields” won’t mean anything unless there is a binding element in the config file with that name. That is why your service won’t start when you put that in – you most likely got a configuration error message of … Read more

How to convert a hexadecimal string to long in java?

Long.decode(str) accepts a variety of formats: Accepts decimal, hexadecimal, and octal numbers given by the following grammar: DecodableString: Signopt DecimalNumeral Signopt 0x HexDigits Signopt 0X HexDigits Signopt # HexDigits Signopt 0 OctalDigits Sign: – But in your case that won’t help, your String is beyond the scope of what long can hold. You need a … Read more

Java: random long number in 0

Starting from Java 7 (or Android API Level 21 = 5.0+) you could directly use ThreadLocalRandom.current().nextLong(n) (for 0 ≤ x < n) and ThreadLocalRandom.current().nextLong(m, n) (for m ≤ x < n). See @Alex‘s answer for detail. If you are stuck with Java 6 (or Android 4.x) you need to use an external library (e.g. org.apache.commons.math3.random.RandomDataGenerator.getRandomGenerator().nextLong(0, … Read more