6 ms·
The most common phone number: 214-748-3647
- statictype 16y agoYikes. People store phone numbers as integers? Why would anyone do that? Is there some use-case where being able to treat a phone number as an integer value has any usefulness?
- zck 16y ago"A string of characters acting as numbers? Hell no. People could put in anything. '234-fake-num' isn't a real phone number! This way we'll be sure the numbers are real. Besides, look how much space we'll be saving."
- pan69 16y agoBad idea as celoyd pointed out. Besides, to check whether a phone number is real or not we use regular expressions.
- j_baker 16y agoI think he was being facetious...
- reitzensteinm 16y agoI don't think zck was arguing for phone numbers as integers. I think he was just dissecting the broken thinking that would cause someone to make that decision.
- dalore 16y agoTo check if a phone number is real, it's best to call it.
- joshfinnie 16y agoMy google voice number is 786-J-Finnie... I really hate that I can't enter that on a vaild phone number on many websites! Since I specificially looked for that as a phone number, I haven't memorized the actual numers of JFINNIE, so I just put in a fake number.
- celoyd 16y agoWell, it will be smaller on disk. I know next to nothing about the phone system, but in some countries there are legitimate numbers starting with 0. So among the many problems with this practice, it puts an arbitrary technical limit on your market.
- bigbang 16y agoConverting the phone number to hex and then storing them as character bytes as opposed to long integers, might save even more space on disk at the cost of hex-decimal conversion :)
- dfox 16y agohexadecimal is used, because the conversion is almost free (as oposed to decimal) Also, phone numbers (for last 50 years or so) actually are hexadecimal strings (with extra characters - denoted ABCD*# - reserved for various special purposes).
- j_baker 16y agoThis sounds apocryphal to me. I mean, how would anyone build a system where no number above 2147483647 can be stored and not notice it? I mean, that excludes the vast majority of phone numbers. EDIT: Maybe I give mankind too much credit. Search for a non-Dallas city here: http://24hourplaces.com/search.php http://24hourplaces.com/search.php
- hartror 16y agoI am never surprised when code is written without decent testing good testing is the exception rather than the rule.
- j_baker 16y agoThis goes well beyond simply not having good testing though. It requires not testing and disconnecting the phone line and email so you can't get customers' bug reports. And never using the thing yourself.
- KaeseEs 16y agoI agree, it seems fishy to me that saturation rather than wrap is the integer overflow behavior in these systems.
- dfox 16y agoSaturation is standard behavior of C's atoi() and friends. Over/underflow is signalled by returning largest/smallest possible value and setting errno to ERANGE. Many applications dont check for this (as it is not exactly straightforward) and thus get saturation.
- mattmillr 16y agoMySQL does this too. I once found a bunch of Facebook User IDs that were all 2147483647 after someone missed the memo that Facebook was transitioning to BigInts.
- lysium 16y agoWow, that's unbelievable. Almost any phone number in 24hourplaces.com is that Dallas number. How come the owner of that website never noticed?
- hartror 16y agoConsidering I work with graduates who were 10 when the whole Y2K thing was news I am not surprised.
- j_baker 16y agoYup. If they were older, they'd realize just how little a deal y2k was.
- derleth 16y agoAnd if they were older than that, they'd remember that a number of people were employed to fix y2k bugs before they became problems.
- InclinedPlane 16y agoY2K was such a little deal because so much effort went into fixing it. It's hard to say how big the problem would have been but considering that many financial systems would have been affected it probably would have been fairly significant.
- deleted 16y ago[deleted]
- j_baker 16y agoWell yeah, they explain how numbers are stored in a computer and whatnot. It's just that for most software programming, it isn't a terribly interesting or difficult to solve problem. I suppose after so long working with graph algorithms and Turing theory, people might forget these things, but it doesn't take a great deal of training to remember that numbers have limits in computers. I think this is more a case of simple stupidity than lack of education.
- fabjan 16y agoYes, you are wrong. I study CS and the first year we learned about digital logic, how to build memory, clocks, ALUs, etc. in parallel with learning about loop invariants, operational and denotational semantics, computational complexity, algorithms and data structures, algebra, real logic, how to prove things formally, and emacs. There were some boring courses as well, mathematical analysis etc.
- j_baker 16y agoWhere do you go to school? Where I went, denotational semantics and code proofs were taught in a senior level class (I went to a public university though). I think you might be the exception rather than the rule. Still, you're correct to say that engineers are taught the things the grandparent mentions in CS courses.
- deleted 16y ago[deleted]
- j_baker 16y agoHow do you understand that a quicksort is faster than a selection sort at the core level without theory? I mean, I see what you're getting at. That does help you understand how to speed things up at a very low level and might be useful for embedded systems programming or kernel hacking. But most programmers work on a much higher level and need to understand a lot more concepts than that. For instance, it takes a lot more to build a scalable and reliable system (especially one that must scale to multiple systems) than simply knowing how the circuits are designed. You need to understand network protocols, how things are stored on disk by databases, a bit of graph theory, how caching works, and a whole slew of other things. Would it be beneficial to learn this all from the ground up? Probably. But I doubt many college students would be thrilled by the idea of spending 20 years finishing their degree.
- turbofail 16y agoIt seems like if this explanation were to make sense, whoever implemented the string-to-number conversion was careful enough to implement saturating addition, but careless enough to not use a numerical type large enough to hold every possible phone number. I don't know if I buy that.
- sthatipamala 16y agoPerhaps they just used strtoi() or some such equivalent in their language.
- forensic 16y agowhy wouldn't it wrap around?
- btn 16y agoInteger overflow behavior varies a lot between languages; it can be undefined, some wrap around, others promote to a larger integer type, others convert the type to something else, and some clamp to the largest (or smallest) value. For example, if you're using PHP, an integer will turn into a float when it overflows; if you then push the value into a MySQL databse, it'll be clamped.
- SerpentJoe 16y agoScary thought: this bug is nice and obvious when the data gets "clamped" to max_int, but what about when it doesn't and overflows to some value in the middle? No way to tell how many systems suffer from that flavor.
- ajarmoniuk 16y ago"Please press 1 now." Then, after a while: "Press press one now. If it is a person and not a computer calling, press 1 now.". Then, again after a while: "Press one of it will disconnect."
- KevBurnsJr 16y agohttp://www.yellowpages.com/phone/?phone_search_terms=214-748-3647 http://www.yellowpages.com/phone/?phone_search_terms=214-748...
- fedd 16y agointeresting fighting about computer science etc. i'd say, not to store phone numbers in integer field require just one advice of an experienced colleague, no need in 5 years course (assuming a guy doesnt put boots on his head in other parts of his work)
- austintaylor 16y agoIf you page through the Google results, there's actually less than 400 pages listed. See: http://blog.xkcd.com/2011/02/04/trochee-chart/ http://blog.xkcd.com/2011/02/04/trochee-chart/
- polynomial 16y ago> there are 1500+ websites with that phone number showing up. Just to note, article is from 2008. Current figure is: About 316,000 results (0.13 seconds) Also, he didn't even bother calling the number to see who owns it? Sloppy.
- arthurdent 16y agoi called it but couldn't figure out what the business actually was.