The good news is, Flickr reached photo number 2147483647 yesterday. Go Flickr!
The bad news is that number 2147483647 is the limit for signed integer data type.
How did that affect us?
Well, we use an awesome open source library called Phlickr to communicate with Flickr's API. Phlickr was treating photo IDs as signed integers and in turn stopping at 2147483647. As a result, images were missing from the display because they would be assigned the wrong photo ID.
If you're using the Phlickr client library, you need to update your library so that the photo IDs are treated as string and not integer (hint: look for sprintf.)
39 RESPONSES To "FLICKR PHOTO STREAMING IS BACK UP"
I think you mean, "machine-imposed numbers". Alternatively, you could use proper tools with infinitely bound integral types. Ever looked at the Church Numeral Encoding?
Once the world's population reaches 9 billion, that would only let each person upload a billion photos!
Er, ok, point taken.
using unsigned int would just mean flickr would get the same problem when the nr of images doubles.
Actually, PHP doesn't support unsigned integers and I guess I could have used float instead of string to fix the bug.
Phlickr uses sprintf() to build the image URL and that function is a bit funky. For example, the type specifier (%u) supposed to indicate an unsigned integer but that doesn't really work since PHP doesn't support unsigned integers, so I opted to use string (%s) to be safe and solve the bug quickly.
I'll do my own testing with float and if that works I'll update the code.
On most modern machines, an int is 4 bytes, and a float is 4 bytes. Moreover, some of those 4 bytes in the float are used up with the exponent. A simple application of the pigeonhole principle will show that there is a problem here!
Specifically, just because a float will go up way past 2147483647 doesn't mean it will treat 2147483647 and 2147483648 as different numbers (it won't).
You might get away with this for a while if you use double-precision floats (8 bytes), but that's just a really lame version of using a partly-neutered long long int. (Which, I suppose, if you don't have long long ints, is maybe justifiable, but is nontheless still Wrong.)
If you didn't want to use strings for this, a workable option would be using a pair of ints -- one for the first 9 digits of the number, and another for the next 9, giving you an 18-digit range. (Since you're making strings, dividing them on a power of 10 is easier than using a power of 2; normally you'd represent the number as int1*MAXINT+int2 in this kind of scheme.) But, unless you're doing calculations or are really pressed for memory space, a string should be fine.
The point is, we are about to be joined here on Earth, starting already but booming in about a decade or so, by a vastly larger population of robotic devices that generate digital artifacts like photographs. After that point, it no longer will make sense to talk about things in terms of "so many photographs for each person in the world." When dust motes have IP addresses, on-board cameras, and wireless connectivity, human-scale numbers will no longer make sense.
Some of the software we build today will persist into that era, so we need to start to accommodate larger numbers.
sprintf("http://www.mysite.com/?id=%.0f", $large_integer);
I think we'll stick with string (%s) since it works great in this situation since the number value isn't really used in any calculation and only in the image URL build.
http://www.flickr.com/services/api/misc.overview.html
"Note: The Flickr API exposes identifiers for users, photos, photosets and other uniquely identifiable objects. These IDs should always be treated as opaque strings, rather than integers of any specific type. The format of the IDs can change over time, so relying on the current format may cause you problems in the future."
Phlickr should be commended for using type specifiers other than string as a form of input sanitization and type enforcement.
I do understand Flickr's logic, but I don't think it's good practice.
Fortunately, flickr told us clearly that it is not numeric. It's an opaque string. Converting them to ints isn't any kind of "type enforcement"-- you don't get to make the rules! At best it would be a space savings, but it's quite an inappropriate one here.
penis enlargement pills, penis enlargement patches, penis enlargement devices, penis enlargement exercises, penis enlargement gel, and penis enlargement treatments with FDA approroved guaranteed. www.gordoniihoodia.net
http://www.penisenlargementincs.com
http://www.nice-remedies.com
http://www.smart-herbals.com