Wikipedia:Reference desk/Archives/Computing/2016 May 9
Computing desk | ||
---|---|---|
< May 8 | << Apr | May | Jun >> | May 10 > |
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. |
May 9
editHttp/1.1 Service Unavailable
edit[1], normally a piece of US government paperwork (historic documentation for the Scribner House in Indiana), is currently giving me a message of Http/1.1 Service Unavailable. Google tells me that this message is similar to HTTP 503, so I understand the problem with the website, but I'm confused: what's the point of having two separate error messages when one would work? What's the difference between Http/1.1 Service Unavailable and HTTP 503 that warrants having two separate-but-compatible error messages? Nyttend (talk) 04:46, 9 May 2016 (UTC)
- If you look up HTTP 1.1 and search for "service unavailable" you will find that it corresponds to Server error 503. #edit, with links to current documentation. Vespine (talk) 05:06, 9 May 2016 (UTC)
- Didn't I just say that? Nyttend (talk) 11:03, 9 May 2016 (UTC)
- It's not two errors - it is a 503, and a human-readable explanation thereof. The HTTP result code is part of the HTTP protocol (and is intended for a computer to parse), whereas the Http/1.1 Service Unavailable is some HTML the server has generated for human consumption. The overall HTTP response looks like this:
HTTP/1.1 503 Service Unavailable Content-Length: 62 Connection: close Cache-Control: no-cache,no-store Pragma: no-cache <html><body><b>Http/1.1 Service Unavailable</b></body></html>
- where everything after the blank line can be pretty much anything the server fancies sending. -- Finlay McWalter··–·Talk 11:47, 9 May 2016 (UTC)
- Ok, here is the reference List of HTTP status codes. My point was, that HTTP/1.1 is the standard, within which the error "Service unavailable" is given the status code 503. Vespine (talk) 22:32, 9 May 2016 (UTC)
Interesting problem
editDo you know of any program where all 60 of the following combinations have valid functions:
Press any one of the function keys F1-F12, with any of the following modifications:
- Nothing (e.g. F1)
- Shift (e.g. Shift F1)
- Alt (e.g. Alt F1)
- Alt+Shift (e.g. Alt+Shift+F1)
- Control (e.g. Ctrl+F1)
Can you let me know all 60 (12 function keys times 5 possible modifier key combinations) of the actions that pressing such a combination can result in?? Please color-code the function key to indicate the modifier key combination using the above list's color code to indicate the modifier key combination used. For example:
F1=Help means F1 is the Help key for that program.
F4=Exit means that pressing simply F4 will exit, but F4=Exit means pressing Alt+F4 will exit. Remember, I want a program where all 60 combinations that meet the above criteria will do something. Georgia guy (talk) 17:59, 9 May 2016 (UTC)
- I'm going to guess there aren't any. Classic shortcut-heavy programs like Emacs and Vi don't even use them that much, even though they have hundreds of default shortcuts each- they have big unassigned chunks so that function keys are free for OS level (or terminal level) stuff or user reassignment, and the whole paradigm is not really based on function keys at all. Also even your example is not terribly clear, because alt+f4 is a Windows shortcut [2], not a shortcut in any given program. So in one valid interpretation, that rules out almost any Windows program right there, because Alt+f4 is almost always reserved for OS-level quit commands, and is not a program-level shortcut. SemanticMantis (talk) 18:25, 9 May 2016 (UTC)
- Alt+Shift (e.g. Alt+Shift+F1) does not appear in my list of key codes, so it appears to be not a valid code and can be eliminated, reducing the number of combinations to 48. Akld guy (talk) 18:39, 9 May 2016 (UTC)
- WordPerfect used a large percentage of the combinations, I think. I remember there was template you could get that fit over the function keys (if you had an original AT keyboard or one with a perfectly compatible geometry, that is) to help you remember all of them. —Steve Summit (talk) 00:11, 10 May 2016 (UTC)
- Ah, WordPerfect - the word processor that should have won. If they'd been consistent with their F-key mapping they might have pulled it off. Even they didn't use every combination, though; as this pic shows, F11 and F12 were single-use. But 42 out of 48 ain't bad! Matt Deres (talk) 00:35, 10 May 2016 (UTC)
- Damn, man, that's exactly the template I was talking about! —Steve Summit (talk) 00:40, 10 May 2016 (UTC)
- Also professional CAD-Software-Suites offers exessive Keyboard shortcuts. --Kharon (talk) 01:35, 10 May 2016 (UTC)
- Damn, man, that's exactly the template I was talking about! —Steve Summit (talk) 00:40, 10 May 2016 (UTC)
- See Space-cadet keyboard for keyboard will a silly number of modifier keys. LongHairedFop (talk) 20:57, 10 May 2016 (UTC)
What is "\K" in grep?
editI know that:
echo 'employee_id=12341234' | grep -oP 'employee_id=\K([0-9]+)'
will correctly output:
12341234
However, I don't know why it works. What is this "\K" and why it is not documented in grep man page or other docs?Llaanngg (talk) 23:06, 9 May 2016 (UTC)
- The
\K
will exclude the preceding portion of the regex from the result, while still requiring that preceding text to be present. It appears to be equivalent to the zero-width positive look-behind assertion(?<=pattern)
. See zero-width positive Look-Around Assertions in the Perl regular expression documentation. -- Tom N talk/contrib 23:27, 9 May 2016 (UTC)
- ....and it's not mentioned in the man page for grep because PCREs are used in many places and have their own man page. Try
man prelreman perlre and/or man pcre (which is in the "See also" section of the grep man page at least on my installation of OS-X with fink). --Stephan Schulz (talk) 23:37, 9 May 2016 (UTC)- Stephan Schulz, I believe you have a minor typo, and meant to write man perlre. (That one comes from perl, and is built into a "clean, vanilla" installation of OS X. The 'pcre' man page came from somewhere else, probably from fink's perl distribution). OS X also ships 'pcregrep', and its man page is available too, man pcregrep. That tool is "perl-5-like," and "grep-like," but it is developed independently and is not part of perl or grep.
- Lots of users - especially "power users" with complicated workstation set-ups - get their basic tools like grep from lots of various other sources - so all users would do well to check very closely to see exactly what versions are on their system. This is particularly important if they intend to use any of the variant- or extension- syntaxes.
- Nimur (talk) 23:51, 9 May 2016 (UTC)
- Yes, thanks. Typo fixed. --Stephan Schulz (talk) 06:03, 10 May 2016 (UTC)
- ....and it's not mentioned in the man page for grep because PCREs are used in many places and have their own man page. Try
- You didn't look hard enough; Section 3 of the info page tells you where to look for PCRE syntax. The info pages are the official documentation for GNU software. GNU only ships abbreviated man pages, so you should always look at the info pages for full reference for GNU software. Also note that both -o and -P are GNU grep extensions. They're not POSIX. Your command will only work with GNU grep. --71.110.8.102 (talk) 00:14, 10 May 2016 (UTC)