Forgot your password?
typodupeerror

Comment: Re:Popular has a lot to do with installed base... (Score 3, Informative) 634

by Athrac (#46967689) Attached to: Why Scientists Are Still Using FORTRAN in 2014

Restrict keyword is not related to threading. C/C++ compilers have always assumed that data is not accessed from several threads without synchronization. It just wasn't standardized until the new memory model in C11 and C++11. So if you don't use mutexes, memory barriers etc, the compiler is allowed to assume a single thread of execution.

What restrict does is it guarantees that two pointers do not point to same area in memory (aliasing). Let's say a function takes two pointers (char* a, char* b). If you write to the data pointed by a, then the compiler has to emit code to re-read data pointed by b, because a and b might refer to the same location. With restrict pointers the compiler doesn't have to do this.

C/C++ have also always had the concept of strict aliasing, which basically says that pointers with different types may not be used to access the same memory location (char pointers are exception). It allows the same optimizations as the restrict keyword. However most compilers don't enforce the rule because programmers are stupid and use all kinds of noncompliant hacks with pointers.

Comment: Re:Something I've been ruminating about all day (Score 3, Interesting) 305

by Athrac (#45570947) Attached to: Bitcoin Thefts Surge, DDoS Hackers Take Millions

That is true. However, it is not really a problem in the long run unless every last bitcoin is lost. You can divide bitcoin in infinity and trade with micro-bitcoins or pico-botcoins instead. So at first though this seems like an issue but I argue it isn't.

You can't divide it infinitely. The smallest unit ("satoshi") is 10^-8 bitcoins, so in total, there will only be 2.1*10^15 units of money. For reference, the total M1 money supply in the world is equivalent to about $25 trillion, or 2.5*10^15 dollar cents. If bitcoin becomes a major world currency and we assume a currency loss rate of couple of percent per year, it's gonna become a problem within couple of decades.

There could of course be a change in the protocol so that let's say any bitcoins not used in 50 years could be remined. But it's something that requires acceptance from majority of miners.

Comment: Re:TFA does a poor job of defining what's happenin (Score 1) 470

by Athrac (#45275555) Attached to: How Your Compiler Can Compromise Application Security

It's not quite correct. a == b is not a use of the argument that has been invalidated. a was a variable containing an address of the object that was passed by value to the realloc() function.

I also thought this first, but the standard seems to be quite picky about it. It is undefined behavior if "The value of a pointer that refers to space deallocated by a call to the free or realloc function is used". I interpret this so that just using the address value is UB, even if the pointed memory block is not accessed.

Comment: Re:TFA does a poor job of defining what's happenin (Score 1) 470

by Athrac (#45275387) Attached to: How Your Compiler Can Compromise Application Security

Under C99 all machines must be both 2s-compliment and have 8-bit bytes. IIRC both fall out from inttypes.h. Word is this wasn't intentional, but it had been so long since anyone actually used other architectures that no one noticed that implication.

You are incorrect. C99 (and C11) still explicitly allow two's complement, one's complement and sign-and-magnitude repsesentation for signed types. You are probably confusing it with the type definitions int8_t, int16_t etc. which ARE required to be two's complement (if they exist). But the standard does not require those type definitions to exist.

Comment: Re:Everyone else uses H264/MPEG4 (Score 1) 336

by Athrac (#34849340) Attached to: Opera Supports Google Decision To Drop H.264

Well done for defeating your own point, smartass. AAC is superior, but people still want to use MP3. That's exactly what the GP was talking about.

And AAC isn't exactly a new codec either like you're implying, which even more emphasizes the fact that old codecs are still used even when better ones are available. There are better alternatives to AAC, and the only reason it's is still used is because alpha geeks like you can't "get their finger out their ass" and switch to modern codecs.

Comment: You forgot the most important (Score 1) 342

by Athrac (#34217830) Attached to: The Monopolies That Dominate the Internet

c) a company buys all the competitors

Of course you won't find perfect examples of that because we do have some regulation preventing that. But even with regulation, that's the direction we're going towards. Each year top 100 companies in the world make up a bigger and bigger part of the world economy. And the entry barriers in pretty much any business today is so high, that new competitors don't just magically appear out of nowhere.

Comment: I'm mostly interested in quality (Score 2, Insightful) 163

by Athrac (#34215850) Attached to: 80% of Daily YouTube Videos Now In WebM

Have they managed to improve the quality of the VP8 codec? Last time I saw a comparison, VP8 was way behind H.264.

And don't even give me that crap about "it's free, it doesn't have to be as good" or "it's only a web codec so who cares". If there's a number of big companies supporting the project and they plan on making WebM some kind of industry standard, anything less than state of the art is unacceptable. We'll be using this for years to come, so doing it right is in everyone's best interest.

Comment: I don't get the logic behind this (Score 1) 414

by Athrac (#33518594) Attached to: Scientists Cut Greenland Ice Loss Estimate By Half
If they previously didn't consider the rising of the crust, but now they are considering it, then my logic says that the estimates for melting rate should have increased. Ok, it says in TFA that in some places the ground is actually subsiding, but it seems weird that this would happen in more places than rising of the ground.

I'd rather just believe that it's done by little elves running around.

Working...