Wikipedia:Reference desk/Computing

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

The Wikipedia Reference Desk covering the topic of computing.

Welcome to the computing reference desk.
Want a faster answer?

Main page: Help searching Wikipedia

How can I get my question answered?

  • Provide a short header that gives the general topic of the question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Post your question to only one desk.
  • Don't post personal contact information – it will be removed. All answers will be provided here.
  • Specific questions, that are likely to produce reliable sources, will tend to get clearer answers.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
 
Choose a topic:
 
See also:
Help desk
Village pump
Help manual


November 7[edit]

Standard chess notation for nonstandard starting positions[edit]

Does any de facto standard exist for extending algebraic notation so that games of chess that start with a nonstandard position (such as Chess960 and historical games played with the handicap of a missing piece) can be replayed and analyzed? NeonMerlin 03:36, 7 November 2019 (UTC)

First you would need to record the starting positions, which would require as many notations as pieces on the board. You could use codes like A1-bB for "square A1 contains black player bishop". Then, each turn could simply use the from and destination squares, like A1>B2 or A1xB2 (for the piece on A1 takes the piece on B2). This wouldn't be as easy to read directly, without moving pieces around on the board, but it would get the job done. The algebraic notation wouldn't be as reliable, say if the "queens bishop" may be one of 2 (or even 3) bishops starting on the queens side. Additional notations could be made for check, castling (if allowed), en passant pawn capture (if allowed), promotions (if allowed), and draws/stalemate/mate. SinisterLefty (talk) 03:47, 7 November 2019 (UTC)
OK, I will bite. SinisterLefty, when you have to use that amount of conditionals in your "answer", it usually means you make too much speculation for too little information, and should refrain from posting altogether.
Your post re-discovers long algebraic notation but with different symbols (it's "a1-b2", not "A1>B2"), and incorrectly says "queen's bishop" is part of algebraic notation (it is not: that would be descriptive notation, and even so, you could still use the existing square names even if it is a bishop that starts on Queen's Knight 1). As for "additional notations could be made..." - yes, they are already made, and the same are the in use in Chess960.
Notice that gadfium's answer below, although shorter by a factor of 5 or so, is correct and answers the question (which was "is there a standard", not "how would I go about designing a standard"). TigraanClick here to contact me 09:59, 7 November 2019 (UTC)
I've stricken most of my answer (although I stand by my assertion that you need one notation for the starting position and another for each subsequent move). As for gadfiums, it's good as far as it goes, but it doesn't say what to do after the starting position is noted. You obviously can't just denote the current board position in that way, as that wouldn't allow replaying the game, up to that point, because there are many ways a given board position could have been achieved. I suppose that notation (actually you'd need a modified version, X-FEN) could be used for both the initial position and every move made, but that would be both inefficient and ugly, if anybody has to look at it all. So, some notation for each move is also needed. The answer by 173.228.123.207 addresses some of this. SinisterLefty (talk) 13:34, 7 November 2019 (UTC)
Forsyth–Edwards Notation (FEN) is the standard notation for recording a board position.-gadfium 05:53, 7 November 2019 (UTC)
...and Portable Game Notation (PGN), which codes moves, can include a FEN indication for the starting position. TigraanClick here to contact me 12:51, 8 November 2019 (UTC)

For chess960, Fischer_Random_Chess#Coding_games_and_positions discusses notation. 173.228.123.207 (talk) 11:22, 7 November 2019 (UTC)

November 8[edit]

Why use SELECT ... FOR UPDATE in MySQL?[edit]

While transaction has ensured the ACID properties, so what is the point of using SELECT ... FOR UPDATE within a transaction like START TRANSACTION ... COMMIT? Can we replace SELECT ... FOR UPDATE within the transaction by SELECT ... (without FOR UPDATE)? - Justin545 (talk) 07:23, 8 November 2019 (UTC)

Presumably you plan to do an UPDATE on the selected records, within the transaction block, in either case. Then, yes, it does seem rather redundant, as far as locking those rows. I suppose it might still be a good programming practice, though, in case the SELECT and UPDATE are ever taken out of the transaction block. SinisterLefty (talk) 07:32, 8 November 2019 (UTC)
Indeed, I don't see the point of using SELECT ... FOR UPDATE within transactions. Transactions would be implemented with lock-free mechanisms, but according to the document SELECT ... FOR UPDATE sets lock on rows, which seems to incur performance issues by reducing concurrency. - Justin545 (talk) 07:54, 8 November 2019 (UTC)
The transaction block may override the row-level locking. SinisterLefty (talk) 08:10, 8 November 2019 (UTC)

Is the Common Gateway Interface getting less common?[edit]

Was the CGI protocol more used/useful 10 years ago? — Preceding unsigned comment added by 31.4.157.64 (talk) 23:06, 8 November 2019 (UTC)

Don't know, but here's our article: Common Gateway Interface. SinisterLefty (talk) 01:42, 9 November 2019 (UTC)
I have already looked into it. There's little in it about how widespread it is. Might be a good addition though. 31.4.141.27 (talk) 02:29, 9 November 2019 (UTC)

November 10[edit]

Win 10 Long date format[edit]

With my new Win10 PC, I am trying to set the long date format to "dddd, yyyy-mm-dd", but the options appear preset and do not include that. I managed it ok with Win7. Anyone know how to do this? -- SGBailey (talk) 08:23, 10 November 2019 (UTC)

You should be able to do it from the 'Control Panel'. (But not the new 'Settings' app AFAICT.) Open it, click on 'Change date, time or number formats'. Under 'Formats' click on 'Additional settings...'. Then select the 'Date' tab. While an increasing amount of stuff is in the 'Settings' app, it's always worth checking out the 'Control Panel' if you want to do something that doesn't seem to be available in the 'Settings' app. Nil Einne (talk) 14:59, 10 November 2019 (UTC)

Confused by borrowing from internet archive[edit]

I am confused with the borrowing process do you need a library membership to borrow a e book from the internet archive or do you need to pay money to them because the website says you can borrow for 14 days but not sure how it works — Preceding unsigned comment added by 71.169.165.175 (talk) 12:13, 10 November 2019 (UTC)

You definitely do not need to pay money. Surprisingly they don't really seem to properly explain anywhere I could find, [1] [2] but AFAICT nearly anyone can just create an account [3] and borrow books. You do need to provide an email address (and password of course) and agree to their terms of service [4]. By default you also agree to receive various announcements from them, but these can be turned off. It's also possible, although I didn't see anywhere that you're forbidden if subject to US sanctions (e.g. from North Korea, Cuba) although I didn't see anything.

Note that from what I can tell, most (or all?) of the books for borrowing are scanned image books meaning what you will receive are ePubs or PDFs with images of each page of a physical book. (You can see this in the previews.) So even for simple fiction books, there can be no automatic reflow etc.

Also what you will receive if you download the books are protected by Adobe Digital Editions DRM, so you will need that software or something compatible to be able to view borrowed books outside your browser. This means any ePaper Kindle devices are out, although Kobo and similar devices are fine albeit as I said before the book is likely to be a scan. (I'm assuming no deDRM as that's not something we can help you with on wikipedia, although maybe apprentices called Alf can.....)

Also, as is typical with libraries, they may only have limited copies of their books available and so you may find the book you wan to borrow is already checked out and need to go on a wait list. You are limited to borrowing up to 5 books at a time. (No idea if there is a waitlist limit.)

If you have a disability that intereferes with reading printed text, you may be able to apply for a special membership [5] to download books in Digital accessible information system format and possibly with different or fewer limits, not sure. The books available for this may also be different.

Nil Einne (talk) 14:47, 10 November 2019 (UTC)

BTW, I think most of their books may have been OCRed, this is possibly how they work with DAISY. But I suspect there has been little or no proof-reading or checking probably partly why they still rely on the images for others rather than trying to covert them into proper reflowable ePubs even for simple adult fiction books. Nil Einne (talk) 16:17, 11 November 2019 (UTC)
They actually do offer reflowable ePubs like they have for the always-available books for (at least some) loaned books now (labeled "Smaller File, May Contain Errors"), if you're willing to deal with the proprietary DRM and have a system that works with it. Some books aren't OCRed though, particularly when IA's OCR setup doesn't work with the writing system, although there is also more ongoing work on this mentioned in this blog post. —{{u|Goldenshimmer}} (they/their)|TalkContributions 03:28, 12 November 2019 (UTC)
Thanks for the correction. I made a mistake in testing. I tried a children's picture book and I somehow thought the ePub and PDF were both images when I opened them in ADE but I see now I was mistaken. I think I must have opened the PDF twice by accident. (As a children's picture book the ePub is obviously not very good.) After that when checking stuff like if it had been OCRed (it had, the text could be copied), I just opened the PDF because it was easier. I actually tried an adult fiction book as well, but the ePub had some weird error when ADE tried to retrieve it and so is now checked out for 14 days with nothing I can do. (Although you can return the book in archive.org, if you check it out in ADE you need to return it in that too or it's still marked as borrowed even if it doesn't seem to be borrowed to you.) In retrospect it was a mistake to only test the borrowed children's book ePub anyway since it was possible the children's book ePub would still be a scan, but the adult fiction book would not be. And the distinction between the PDF/online version and ePub makes some sense. Nil Einne (talk) 04:00, 14 November 2019 (UTC)
BTW, "borrow" may not be the right term. That implies that they are deprived of a copy until you "return" it. It's possible they may have licensing which limits the number of copies out at any time, in which case "borrow" would be the right term. But, if it's unlimited, then it would be more proper to say you can "view" the ebook for a given period. SinisterLefty (talk) 03:40, 12 November 2019 (UTC)
SinisterLefty: It is borrowed — each digital copy of a book corresponds to a physical book they hold in storage, and can only be read by one person at a time. That way, they don't get the copyright owners or their lawyers mad at them, since it's no different than a paper library (albeit with teleportation powers) for copyright purposes, or at least that's my understanding (I'm not a lawyer; this is not legal advice etc. disclaimer). —{{u|Goldenshimmer}} (they/their)|TalkContributions 03:52, 12 November 2019 (UTC)
I see, thanks. SinisterLefty (talk) 03:53, 12 November 2019 (UTC)

November 12[edit]

What does Android `fastboot erase` command do?[edit]

Almost all Android tutorials recommend that command before applying a fastboot flash partition path_to_image without explaining what it does. Those which do explain just say that it "erase" the partition, which is totally meaningless. In the world of computing, there is no such thing, you only write (and overwrite) to a location. The manual page does not help either. From `man fastboot`:

fastboot erase partition
     Erase a flash partition.

Does anyone know what does that command actually do at low level? Why do we just flash the new image over? -- Livy (talk) 12:59, 12 November 2019 (UTC)

I would assume that "erase" means to overwrite with zeroes. SinisterLefty (talk) 13:49, 12 November 2019 (UTC)
The official documentation states that "erase" will "Erase the indicated partition (clear to 0xFFs)".
It's actually very unlikely to that this writes 0xFF data to the storage media. On a modern software/hardware device - especially an Android instance running on a mobile device with NAND "flash" storage - an "erasure" of a storage partition is more likely some form of key invalidation procedure.
Have a look at our Wikipedia article on flash file systems, and data encryption from the official Android documentation - specifically the hardware backed keystore.
And for the gory technical details, read fastboot.cpp from the master Android open source repository. fastboot erase runs code in the fastboot file system generator, which is probably implemented in your device-specific board support package - probably by interacting with some vendor-specific hardware features. If you're running the reference open-source implementation, it looks like the officially-supported file system is backed by OpenSUSE-style ext2 from the genext2fs project.
Nimur (talk) 20:21, 12 November 2019 (UTC)
In the world of computing, there is no such thing, you only write (and overwrite) to a location. Actually, there is a difference between erasing and writing in Flash technology. Using NAND Flash, you can only write to a block of Flash that has previously been erased. You cannot just overwrite data like you can on a hard disk. A complicating factor is in most devices the "erase block size" is larger than the "write block size", so you must erase a large block (say 256K) and then you can write smaller subsections of it (say 16K blocks). This is why Flash filesystems are different than filesystems on overwritable media. I'm not sure exactly how fastboot works; I would expect "fastboot flash" to erase the partition before writing it, but if for some reason it does not do that then the "fastboot erase" command would be mandatory. CodeTalker (talk) 21:21, 12 November 2019 (UTC)

Oracle SQL Substring function[edit]

I have a text field that I need to extract two values out of. That usually requires a SUBSTR function but, in this case, the position of those values is variable. The field looks like this: PO#1-123456 Lines:19 Pieces:182 however it could just as easily look like this: PO#1-654321 Lines:312 Pieces:4832, which obviously complicates things. I'm currently extracting the values after the entire field is passed into Excel, but I'd prefer to do it within the query so that I can SUM them up in there and reduce the data footprint in my file. I know the first value will begin at the 21st character and I know the second value will end with the last character, so in Excel I'm doing this for the first one: =VALUE(MID([@REFERENCE],21,FIND("Pieces",[@REFERENCE])-21)) and this for the second one: =VALUE(RIGHT([@REFERENCE],LEN([@REFERENCE])-FIND("Pieces",[@REFERENCE])-6)) Is it possible to do the same thing within SQL - or do I need to figure out some kind of wild regex statement? Matt Deres (talk) 21:00, 12 November 2019 (UTC)

I'm not quite following what you are looking for. The word "Pieces" is apparently part of both strings. So:
  • For the first string, does it start at character 21 and end in first occurrence of the word "Pieces" ? If not, how do you know when it ends ?
  • For the second string, does it start after the last occurrence of the word "Pieces" and continue to the end of the record ? If not, then how do you know where it starts ? SinisterLefty (talk) 21:42, 12 November 2019 (UTC)
@SinisterLefty: My feeling is that the 'first string' is the contiguous block of digits starting just after the first colon, similarly the 'second string' is a digits-only substring after the second colon. If I'm right, that calls for regex, alas I don't know if SQL supports it. --CiaPan (talk) 22:37, 12 November 2019 (UTC)
Sorry, I should have been more explicit. The field has a PO# and the number of lines and the number of pieces on that PO. I want to extract the number of lines and the number of pieces, but they're not always at the same position in the string since the number of lines could be 1 or 2 or more characters - and so could the number of pieces. Because I know the lengths of all the other areas of the field, I can use Excel's LEN, FIND, RIGHT, and MID functions to do the operation in Excel. What I'd like to know is whether SQL can do the same kinds of operations. In answer to CiaPan, yes, Oracle SQL supports regex, but I don't even qualify as a beginner at regular expressions. So, I'd prefer a purely SQL answer, but I'll take whatever I can get. :-) Matt Deres (talk) 13:28, 13 November 2019 (UTC)
Please tell us exactly what search you are doing now. That is, what delimiters you are searching for, etc. We don't so much need the high level info of what the data represents, as we need the nuts and bolts of how you currently extract it. We don't all know how to use those Excel expressions. Some examples would help, too, showing the most extreme cases (longest and shortest). SinisterLefty (talk) 16:36, 13 November 2019 (UTC)
I provided that in my initial post. As I said, I'm doing all the work within Excel right now; today, the SQL is literally just a select statement from the transaction table where the field in question (called REFERENCE) sits. That field is exactly as I've described above: an alphanumeric field with a variable length of text containing two chunks that I'd like to extract (and sum, but that's the easy part). As a practical thing, the number of lines could run from 1 to 9999 and the number of pieces is maybe 1 to 99999. If I limit my query to a week, I may get a few hundred lines returned (because a few hundred purchase orders meet the other criteria of the query) and those go directly into Excel via MS Query. Those Excel formulas in the OP get me what I need today, but the amount of data returned bloats the file, so I'd like to do the parsing and summing within the query. Matt Deres (talk) 18:10, 13 November 2019 (UTC)
OK, those ranges help. Are you sure the purchase order won't ever have another digit ? You could easily have the query only return data from the 21st character on, and do the rest of the processing using Excel. That would help a bit. Or else use a regular expression to parse it in SQL. Another possibility is that you could select a range that would include the number you want and also some text, and then convert that to an integer with SQL. Character ranges might be 21-24 and 26-EOL, or (EOL-5)-EOL. I suspect that this would have the effect of discarding the non-numeric portion, but, depending on the SQL implementation, it might also produce an error. Worth a try, though ! Be sure to test with all 4 combos of min and max length. SinisterLefty (talk) 18:57, 13 November 2019 (UTC)
I'll give that a go when I'm back at that computer. When you say to convert the range to an integer, do you mean to use a TO_NUMBER function or something else? Matt Deres (talk) 20:35, 13 November 2019 (UTC)
@Matt Deres: As the page you linked describes (but does not explain), a regular expression like [0123456789] is a list that matches any character being a decimal digit. With a range operator (being a dash) we can shorten it to [0-9]. When we append a one-or-more quantifier (which is a plus) we get an expression like [0-9]+, which matches any, non-empty string of digits. Browse through sections Metacharacters Supported in Regular Expressions and Constructing Regular Expressions for more definitions and examples.
Accordnig to the subsection 'Matching Character List' in the linked Oracle manual page, POSIX character classes are allowed in character lists. If so, you could also use longer, but more descriptive expression [[:digit:]]+ (the inner pair of brackets, together with colons, make a reference to a digit character class, the outer pair of brackets defines a list). Possibly you can also replace it with a \d shorthand, as described in Regex Tutorial - POSIX Bracket Expressions. That would look like [\d]+, but I do not know if it would actually work in Oracle SQL.
Once we're ready with our regexp, we need to search it in your data string str. See the Oracle Database SQL Functions for Regular Expressions section of the manual page – it describes the REGEXP_SUBSTR function as returning the actual substring matching the regular expression pattern you specify. See the detailed description of REGEXP_SUBSTR linked there. You will need an SQL expression like REGEXP_SUBSTR( str, '[0-9]+', pos, N ) to retrieve an N-th substring of digits from the value of str, found starting from position pos. The position to start the searching can be defined as the position of the first or the second colon, respectively, and calculated with the INSTR function: INSTR( str, ':', 1, 1 ) finds the first colon, and INSTR( str, ':', 1, 2 ) finds the second one (both starting the search from the first character of str). Now, to retrieve the first value you need try using REGEXP_SUBSTR( str, '[0-9]+', INSTR( str, ':', 1, 1 ), 1 ) and for the second one try REGEXP_SUBSTR( str, '[0-9]+', INSTR( str, ':', 1, 2 ), 1 ).
TBH, I never used Oracle SQL, and all above is based on the Oracle page you linked and my experience with regular expressions. Anyway... hope that helps. Face-smile.svg --CiaPan (talk) 21:44, 13 November 2019 (UTC)

November 13[edit]

Google SEO.[edit]

If I have a website www. domain-name. com/PageFile, and create a new domain name www. PageFile .com, and just use it as a forward or redirect to that page, will that affect it's place in Google search? 67.175.224.138 (talk) 13:33, 13 November 2019 (UTC).

I don't think so? Google generally doesn't publicize much about their search algorithms. MoonyTheDwarf (Braden N.) (talk) 16:41, 13 November 2019 (UTC)

Why are emails I am receiving dated 2038?[edit]

The inbox folder doesn't show these, and the dates there are correct, but when it shows me new emails, they have this date.— Vchimpanzee • talk • contributions • 19:24, 13 November 2019 (UTC)

Vchimpanzee, What Email client are you using? MoonyTheDwarf (Braden N.) (talk) 19:26, 13 November 2019 (UTC)
The URL starts with https://navigator-lxa.mail.comVchimpanzee • talk • contributions • 19:33, 13 November 2019 (UTC)
Vchimpanzee, I have no clue then, sorry. You'll have to wait for someone else to help. MoonyTheDwarf (Braden N.) (talk) 19:36, 13 November 2019 (UTC)
I do have a sneaking suspicion it may be related to the Year 2038 problem MoonyTheDwarf (Braden N.) (talk) 19:37, 13 November 2019 (UTC)
I clicked where it said "help". Maybe someone will respons. If they do i'll post their answer.— Vchimpanzee • talk • contributions • 20:17, 13 November 2019 (UTC)
Are these spam emails? (Hint, if these emails are telling you that you won $100,000 in a lotto you never specifically entered, or that they are from someone poor corrupt tyrant who's illegitimate money is being held by the evil authorities, or the best place to buy prescription medicine especially Viagra cheap, or how you can increase your penis size, or that there is a parcel you never ordered held up for some reason, or that your PayPal/bank/whatever account is compromised and you should click here, it's spam.) And if they are is there some reason you care so much about spam emails to ask us? Anyway the answer to this is most likely that someone has intentionally dated the emails in the future to try and ensure they always show up on top so they get the recipient's attention. The reason for 2038 in particular likely arises due to something related to MoonyTheDwarf's answer. Email, designed in a world where people weren't thinking of spam or anything like that mostly just relies on trust. The date: header [6] is set by the sender and may not be re-written even if it makes no sense. Some clients may choose to display this date, again even if it makes no sense. Other clients may choose to display some other date, probably the date the email was received especially in cases where this is before the sending date. Some clients may choose to do both depending on the situation. See also: [7] Nil Einne (talk) 03:32, 14 November 2019 (UTC)

the more desktop icons = the slower the computer is?[edit]

Is that true that the more desktop icons the slower the computer is? If it is, then what's the reason for that? ThePupil (talk) 21:00, 13 November 2019 (UTC)

Nope.
Although there is a non-causative correlation between "more stuff" and "more stuff which makes it slow". Windows is rather infamous for slowing down with age by a process of cruft accretion. Surplus icons would also tend to accumulate at the same time. Andy Dingley (talk) 22:01, 13 November 2019 (UTC)
Perhaps this could apply to the systray icons. Any icon appearing in the systray typically has a service or background task associated with it, and this consumes resources. It would typically be recommended to retain only the systray items that you recognize, understand, and require. Elizium23 (talk) 23:18, 13 November 2019 (UTC)
Well, historically, the desktop needed to be redrawn whenever you move a window over it, and with a lot of icons, that might take a while. I think with modern windowing architectures and graphics cards, this should not be noticeable, but for older machines it might definitely make the machine feel slow, in particular since it directly affects user interaction. --Stephan Schulz (talk) 00:06, 14 November 2019 (UTC)

November 14[edit]