5 ms·
Funny this comes up! Dominoes used to use a single integer ID per order, and I wrote a tool to find out how many orders they process each day[1]. After contacti
by orf 10y ago
Funny this comes up! Dominoes used to use a single integer ID per order, and I wrote a tool to find out how many orders they process each day[1]. After contacting them (and receiving no reply!) they switched to a proper implementation involving GUID's.
Good work though, I had no idea the dominoes USA website lets you just enter a phone number to get order details. That's pretty poor
1. http://tomforb.es/counting-pizza-with-python http://tomforb.es/counting-pizza-with-python
- dogma1138 10y agoI'm actually surprised that they can fit their daily order number into a standard integer.
- OJFord 10y ago> I'm actually surprised that they can fit their daily order number into a standard integer. What's a 'standard integer'? The ID in the URL is just a string of digits, and you don't have to be that careful (in simple scripts like this at least) for Python not to care how high you go.
- dogma1138 10y agoCommonly 65535 (for uint) :) A string of digits doth not an integer make.
- OJFord 10y agoMy point is - where do you think the problem is? > A string of digits doth not an integer make. The URL contains a string of digits as the order ID, if that's not where you think the problem is, where? > Commonly 65535 (for uint) Not in Python, as I said: > ... you don't have to be that careful (in simple scripts like this at least) for Python not to care how high you go.
- dogma1138 10y ago>The URL contains a string of digits as the order ID, if that's not where you think the problem is, where? A string of numbers != an integer, saying an integer in an ambiguous settings where for many people it's +-32K or 65K for unsigned often creates some confusion. Not in Python, as I said: > ... you don't have to be that careful (in simple scripts like this at least) for Python not to care how high you go. Python cares very much how high you go, Python sets a limit to integers also which is 2^31-1 for 32 bit and 2^63-1 for 64 bit runtimes. So even with Python if once you commonly go above 2147483647 you'll get into problems ;)
- OJFord 10y ago> A string of numbers != an integer I'm well aware. I'm just trying to understand where you think the problem is. > Python cares very much how high you go, Python sets a limit to integers also which is 2^31-1 for 32 bit and 2^63-1 for 64 bit runtimes. Try this: >>> print(f'Are you sure dogma? {2**128}') Are you sure dogma? 340282366920938463463374607431768211456 > So even with Python if once you commonly go above 2147483647 you'll get into problems ;) I didn't claim it never goes wrong. I said 'in simple scripts like this', I had a quick look after you expressed surprise that their orders fit into 'standard integers', and I didn't see anything that would impose such a restriction.
- dogma1138 10y agoThe fact that you can print a multiplication doesn't mean it's an integer :P Use sys.maxint / sys.maxsize =) 2147483647 is the limit for 32bit systems as I said, 2^63-1 is for a 64bit run time.
- OJFord 10y ago> The fact that you can print a multiplication doesn't mean it's an integer :P I mean, we're circling back on it on 'what do you mean by...' - and my basic point which is a lot of the time, especially for simple stuff like this, it's completely arbitrary. >>> print(int(2**128)) 340282366920938463463374607431768211456 You can tell me it "doesn't mean it's an integer" all you like, it's integer enough. Perhaps this whole thread would have been better summarised if I'd initially asked Where is it being stored as what you're terming a 'standard integer'? Edit - actually, I did ask that, in my second reply: > My point is - where do you think the problem is?