PSY’s Gangnam Style Breaks YouTube’s View Counter

PSY’s Gangnam Style Breaks YouTube’s View Counter

PSY’s Gangnam Style Breaks YouTube’s View Counter

PSY’s Gangnam Style Breaks YouTube’s View Counter :

Gangnam Style fell out of the public eye a while ago (thank god) but people haven’t stopped watching it. It’s been seen so many times that it actually broke YouTube’s view counter, in the nerdiest possible way by busting the code behind the scenes.

THE popularity of the “Gangnam Style” video by Psy, a South Korean pop star, is beyond all reckoning. Or at least it was, until a change was made in YouTube’s programming. The singer’s video was poised to exceed 2,147,483,647 plays, at which point YouTube would have been unable to count any higher. But the boffins made some tweaks, and now Psy is safe until his rousing anthem passes over nine quintillion views: 9,223,372,036,854,775,808 to be precise. Why couldn’t YouTube count high enough?

The answer involves zooming in to the very building blocks of computing. All numbers in digital computers, whether stored in silicon memory chips or on rapidly rotating magnetically charged hard-disk platters, are represented in binary digits, or bits. In base ten, numbers are represented using ten digits (zero to nine); in binary, or base two, they are represented using two digits (zero and one). For example, in base ten, the digits of a three-digit number correspond to hundreds, tens and units, and the largest number that can be represented is 999; in binary, the digits of a three-digit number correspond to fours, twos and ones, and the largest number that can be represented is 111 (in other words, seven). An eight-digit binary number, which can represent values from 0 to 255, is called a byte; larger numbers are represented using multiple bytes. Two bytes (or 16 bits) can represent numbers from 0 to 65,535; four bytes (or 32 bits) can represent numbers from 0 to 4,294,967,295; and so on. When YouTube was set up, its programmers decided to use a 32-bit number to store the number of views, which seemed a very reasonable choice at the time.

Yet an observant reader will note that the limit on YouTube’s view count was 2,147,483,647, not 4,294,967,295. What explains the discrepancy? The answer is that the 32-bit value is in fact a signed integer: the leftmost digit in a 32-bit binary number ought to be the “2,147,483,648” column (just as the leftmost digit in a ten-digit base-ten number is the “billions” column). But if that column is instead given the negative value -2,147,483,648, it becomes possible to use a 32-bit binary number to store numbers from -2,147,483,648 to 2,147,483,647, rather than 0 to 4,294,967,295. YouTube has no need to count negative views, but some programming languages and databases require the use of signed integers, because it is useful to be able to store either positive or negative values. As a result YouTube ended up with a view-count limit of a little over 2 billion, because that is the largest number that can be represented with a 32-bit signed integer. To fix this problem, its programmers have now switched to using 64-bit signed integers instead. That means the maximum view count is now 9,223,372,036,854,775,807, or a bit over 9 quintillion.

PSY’s Gangnam Style Breaks YouTube’s View Counter

YouTube isn’t alone in facing this kind of problem: other systems built years ago also run into numerical-overflow problems. The Unix operating system and all its offshoots and derivatives—which power Android and Apple phones, Macintosh computers and most internet servers—will run out of time on January 19th 2038, at 03:14:07 GMT. By default, Unix counts time in seconds from midnight GMT on January 1, 1970, using a 32-bit signed integer, which means it cannot count more than 2,147,483,647 seconds past that time, thus creating what is known as the “Year 2038 Problem”, akin to the Millennium Bug. Modern versions of the operating system have solved this problem by moving to a 64-bit signed integer to count seconds, but some ancient devices or those running ancient software may fail unpredictably. And perhaps by then, Psy’s video count will have crossed the 9 quintillion mark, too.

PSY’s Gangnam Style Breaks YouTube’s View Counter

As of now, Gangnam Style’s count looks to be heading ever upward, so it seems YouTube has fixed the problem and gotten ready for even higher view counts. But it still leaves the important questions of who the hell is still watching Gangnam Style.

PSY’s Gangnam Style Breaks YouTube’s View Counter

For More Information Visit Our Website : ViralsPro.com

Leave a Reply