Wikipedia:Reference desk/Archives/Computing/2017 February 2
Computing desk | ||
---|---|---|
< February 1 | << Jan | February | Mar >> | February 3 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
February 2
[edit]Integer overflow?
[edit]One of the first computer games I played was Railroad Tycoon, in which it was easy to go into negative money. If this happened, you couldn't build new lines, but you could replace existing locomotives with new ones, build industries, and do a few other things that would increase your debt. Being a young child, I sometimes amused myself by building tons of industries just because it was fun to go farther into debt — but at some point I discovered that going far enough into debt would cause you suddenly to go into the black! Go about $32M into the hole, and the liability seamlessly transforms into equity. It made it easy to retire with an immensely high score, since the balance sheet showed an increase of tens of millions of dollars in a single reporting period.
How is this possible in the first place? Is there a potential of an integer overflow because the amount of debt overwhelms the numbers of digits required to store it? I never found out whether the opposite effect (get too much money, and it becomes debt) were true, because as a little kid I didn't understand how to play the game particularly well. I'm not seeing anything useful on Google; a search for <"railroad tycoon" "integer overflow"> finds mostly pages addressing Civilization (produced soon afterward by the same company), in which an integer overflow would cause a very passive civilization to become extremely aggressive. Nyttend (talk) 01:06, 2 February 2017 (UTC)
- I don't know the game but I guess it used 16-bit signed integers to represent how many thousand dollars you had. They go from −215 to 215 − 1. Addition and subtraction work modulo 216 so −215 − 1 = 215 − 1, i.e. −32768 − 1 = −32768 − 1 + 216 = +32767. See Signed number representations. PrimeHunter (talk) 01:26, 2 February 2017 (UTC)
- It should maybe be noted that cpu's will usually set an overflow bit when arithmetic overflow happens. It's up to programs to check whether the bit is set after an operation. If they ignore it then strange results may happen. Programmers may choose to deliberately accept strange results if it's too much work to handle overflow properly, or the results are fairly harmless and may even amuse the user. Ariane 5 Flight 501 may have amused some people but probably not the users. PrimeHunter (talk) 18:19, 2 February 2017 (UTC)
- Yes, it's overflow, or rather, in the example you give, underflow. Such things are quite common in older video games. (I'm a big gamer with an interest in older games.) For instance, all well-versed NetHack players know that it's possible to over/underflow many counters in the game, with the appropriate effort. And since NetHack is free/open source, you can look at the source code to see how it works. If you don't mind some spoilers if you're not a NetHack veteran, check out the 1-turn ascension. --47.138.163.230 (talk) 04:06, 2 February 2017 (UTC)
- And I must mention kill screens, many of which are caused by over/underflow. --47.138.163.230 (talk) 05:21, 2 February 2017 (UTC)
- If you search youtube you can find loads of videos of people proudly display how hey have overflowed some counter in a game. It is the easiest thing for the game to do if the score reaches 999999 for instance and overflowing makes the player happy. Dmcq (talk) 16:54, 2 February 2017 (UTC)
A book from Google Books disappeared
[edit]Here. I certainly remember I read the book in December. But in early January I couldn't. I hoped they would fix the error, but no. What could have happened?--Lüboslóv Yęzýkin (talk) 11:49, 2 February 2017 (UTC)
- A Google search on pUghrDokKpsC shows the book is American and British English preferences: Spelling, grammar, punctuation, prepositions, vocabulary. I don't know why Google Books removed it. PrimeHunter (talk) 12:14, 2 February 2017 (UTC)
- I've noticed that when online sources remove something, they often erase all signs that it ever existed, because that's easier than explaining how they messed up and lost content. StuRat (talk) 20:47, 3 February 2017 (UTC)
- Given that the book had extracts significant enough that you could "read the book", Google presumably had permission to host it; there's always a chance that the copyright owner instructed Google to remove it. The same book is available on Google Play (although my American IP address receives a message of "This content is not available in your country yet"), so perhaps they decided to sell it without providing free access to it. According to its WorldCat page, this is a 1982 book by Nancy Salama and Mary Ghali that was published by an Egyptian firm, "Arab Renaissance Publisher" out of Cairo. Nyttend (talk) 03:04, 4 February 2017 (UTC)
- @Nyttend: Yes, but Google Books have had a lot of, tens of thousands of books with no access to the content whatsoever, but still it is always shown that such and such a book exists. As for this book, its content was openly and fully accessible, and in the copyright page it was said the book is copyleft for fair use, the book even, if I remember it right, was available for downloading (a very rare possibility for such a relatively recent book). I just regret that I did not download, I always thought that books never disappear from Google Books in such strange and mysterious ways, so I did not bother. It seems the book had appeared very recently and was available just for a few months until it disappeared. This books is really worth to pursue, I discovered it by an accident and I've never seen such a good and comprehensive work on the matter and, most importantly, with a full access. At least they could say the context is no longer available, but not to have wiped it entirely like it never existed. Still, probably it has nothing to do with copyright and this is just a technical error? How could I inform them? I have no Google Mail or Google Plus account or something. P.S. As for Google Play, it shows that message for any IP of any country (checked it with various proxies).--Lüboslóv Yęzýkin (talk) 11:49, 4 February 2017 (UTC)
- With Google's massive size, sometimes they make inaccurate decisions about content — I've seen republications of 19th-century books be unavailable because the reprints were from the late 20th century (so their algorithm said that the book was under copyright), and there's always a chance that this was the other way around: they mistakenly made it available, and instead of the publisher withdrawing permission that was initially given, it's possible that they unintentionally made it available initially and then took it down entirely when given legal notice by the publisher that it was a mistake. I've never really seen ways to inform Google of technical issues; I guess they're so huge that they'd be overwhelmed by such notifications if they provided a way to give them. Interesting your point about Google Play; you've proven me wrong there :-) Nyttend (talk) 12:45, 4 February 2017 (UTC)
- @Nyttend: Yes, but Google Books have had a lot of, tens of thousands of books with no access to the content whatsoever, but still it is always shown that such and such a book exists. As for this book, its content was openly and fully accessible, and in the copyright page it was said the book is copyleft for fair use, the book even, if I remember it right, was available for downloading (a very rare possibility for such a relatively recent book). I just regret that I did not download, I always thought that books never disappear from Google Books in such strange and mysterious ways, so I did not bother. It seems the book had appeared very recently and was available just for a few months until it disappeared. This books is really worth to pursue, I discovered it by an accident and I've never seen such a good and comprehensive work on the matter and, most importantly, with a full access. At least they could say the context is no longer available, but not to have wiped it entirely like it never existed. Still, probably it has nothing to do with copyright and this is just a technical error? How could I inform them? I have no Google Mail or Google Plus account or something. P.S. As for Google Play, it shows that message for any IP of any country (checked it with various proxies).--Lüboslóv Yęzýkin (talk) 11:49, 4 February 2017 (UTC)
- Given that the book had extracts significant enough that you could "read the book", Google presumably had permission to host it; there's always a chance that the copyright owner instructed Google to remove it. The same book is available on Google Play (although my American IP address receives a message of "This content is not available in your country yet"), so perhaps they decided to sell it without providing free access to it. According to its WorldCat page, this is a 1982 book by Nancy Salama and Mary Ghali that was published by an Egyptian firm, "Arab Renaissance Publisher" out of Cairo. Nyttend (talk) 03:04, 4 February 2017 (UTC)
The network I am currently accessing the internet from is public wi-fi at a hospital. Certain websites will not allow access from this network because it is listed in blacklists. The The Composite Blocking List says that the network's IP has been listed due to a Conficker infection. Everything on the internet about Conficker seems to be ancient; apparently at one point it was used to send spam, but supposedly it stopped doing that a long time ago. Does anyone know what Conficker actually does in 2017? 66.192.139.82 (talk) 12:38, 2 February 2017 (UTC)
- These aren't new, but in terms of the lifespan of Conflicker I wouldn't say they are ancient although they don't actually say what Conflicker is being used for [1] [2] [3]. This [4] which actually is recent enough to be called new, claims it was and is used for spamming or to distribute scareware but both that source and [5] suggest it was basically abandoned by the creator many years ago. The later source in particular suggests it was never really used for anything, perhaps because the creators were afraid they'd reveal their identities if they tried and the great success of the malware meant there was sufficient interest that this was too risky, even if they came from places which tend to turn a blind eye to these sort of things. This source suggests something similar [6]. More importantly to your question, whatever it's doing now, it's likely just a legacy of anything that was hardcoded into it. However I assume it's possible that some variants were modified by other parties into doing stuff for them. Nil Einne (talk) 13:18, 2 February 2017 (UTC)