Wikipedia:Reference desk/Archives/Computing/2017 March 3

= March 3 =

AJAX - A begginers question
Is it accurate to say that AJAX is called "XML HTTP-request object" (XHRO) because we request XML data in an HTTP-rquest object or "packet" ?

Or is the "object" is what we get in return (the XML data itself) ?

Thanks, 77.180.130.37 (talk) 01:21, 3 March 2017 (UTC)

A security system should work even when its operation is known - what is the name for this principle?
There is a principle in security, cryptography, and information tech in general that a well-designed system will be secure even when all components of its operation are known. That is, no secrecy regarding the mechanics of a system's operation is required to make it secure. This principle is especially pronounced, it seems, in encryption technology.

My question: what is the name for this principle?

(First time I have used *the reference desk* this, please let me know of any procedures I forgot or violated. Thank you!) — Preceding unsigned comment added by 2601:98A:4000:693A:117F:F15C:2FF1:30E0 (talk) 03:43, 3 March 2017 (UTC)

A few more minutes of searching revealed the answer: Kerckhoffs's principle. Apologies for I do not know how to remove/archive/etc this question, but it is solved. — Preceding unsigned comment added by 2601:98A:4000:693A:117F:F15C:2FF1:30E0 (talk) 03:51, 3 March 2017 (UTC)


 * Editing the last posting to make that a link and add "Resolved". --76.71.6.254 (talk) 05:06, 3 March 2017 (UTC)

scripting
I've noticed a strange thing:

when I do this in gawk (simplified example):

BEGIN{ cmd="seq 1 1e4|sort -gr | head -20" system(cmd) close(cmd) exit } then sort prints write failed: standard output: Broken pipe sort: write error This doesn't happen when I run an identical command directly from the shell ( bash and sh ). I get the reason for the error: head reads its 20 lines, prints them, exits, sort sees a broken pipe and complains. Why doesn't that happen in bash or sh, though? Moreso as gawk internally uses the system(3) call which uses sh. Most importantly, how do I get rid of the message without completely discarding sort 's stderr? Asmrulz (talk) 07:10, 3 March 2017 (UTC)
 * 1) !/bin/gawk -f

PS putting an explicit sh -c "..." in front of the command doesn't help and neither does adding an empty cat (I thought it might) Asmrulz (talk) 07:10, 3 March 2017 (UTC)


 * After looking into the source RPM for gawk and doing some experimenting, I find that this happens because
 * In order to avoid "broken pipe" messages from gawk itself, gawk ignores, and
 * if the C function  is invoked from a process that is ignoring , the processes that it starts will produce "broken pipe" messages when they otherwise wouldn't.
 * At least, this is true on my Linux system. For example, this little C program:

#include    #include     int main {       int r;        system("yes A | sed 3q"); signal(SIGPIPE, SIG_IGN); /* Ignore SIGPIPE */ system("yes B | sed 3q"); signal(SIGPIPE, SIG_DFL); /* Default handling of SIGPIPE */ system("yes C | sed 3q"); return 0; }


 * produces the output:

A   A    A    B    B    B    yes: standard output: Broken pipe C   C    C


 * Why does  cause this effect? I don't know. It doesn't happen on the UNIX system I have access to. How to stop it happening, within the code invoked by  ? I don't know that either.
 * Hope this helps anyway. --76.71.6.254 (talk) 09:23, 3 March 2017 (UTC)
 * thanks so much! I wasn't aware of SIGPIPE. that the sort process would have SIGPIPE set to SIG_IGN makes sense because signals are inherited. what apparently happens is that when writing to the pipe fails, write(2) returns -1 and errno is set to EPIPE. the default SIGPIPE behavior seems to be to silently terminate, but with the signal set to SIG_IGN, processing continues. sort then apparently goes on to check the return value of write and exits, but not before manually printing an error message with error. I had this idea:  but this doesn't work either, because apparently according to POSIX, "Signals that were ignored on entry to a non-interactive shell cannot be trapped or reset". there really doesn't seem to be a way of getting rid of the message short of patching either <tt>gawk</tt> or <tt>sort</tt>, or writing a wrapper. oh well, at least it now makes sense. thanks again! Asmrulz (talk) 12:54, 3 March 2017 (UTC)
 * Ah, that makes sense. Thanks for putting together the remaining pieces.  By the way, you didn't want your "trap" command to ignore the signal, but rather to catch it, so it wouldn't be ignored inside  .  But as you explained, POSIX specifies that it won't be trapped, so that won't work. --76.71.6.254 (talk) 22:56, 3 March 2017 (UTC)
 * And the original script does work under Cygwin with no errors, listing numbers fro 10000 down to 9981. Graeme Bartlett (talk) 01:47, 4 March 2017 (UTC)
 * odd Asmrulz (talk) 09:11, 4 March 2017 (UTC)

Disabling the Firefox infobar popup
Anyone know how to block Firefox from displaying infobars? As of the last update, my Firefox on Win10 is showing a nag to connect my phone to my Firefox account every time I start Firefox. This is actually spam rather than the useful messages which have appeared in the infobar up til now, and I'd quite like it to go away. A quick Google revealed a suggestion to flip a switch in about:config, but it doesn't seem to exist anymore. --87.18.123.67 (talk) 10:43, 3 March 2017 (UTC)


 * Try going to about:addons and uninstall any infobars/toolbars and other addons you don't like. If that doesn't work you may need a virus/malware scanner. Jahoe (talk) 12:25, 3 March 2017 (UTC)


 * Sorry, my above answer is not correct, as your infobar probably comes from using Firefox Sync. Stop using that may help, but is probably not what you want. Jahoe (talk) 12:51, 3 March 2017 (UTC)


 * I've noticed the exact same thing, and yes, I've confirmed it only happens in browsers using ff sync. I'll post here when I figure out how to stop it. They're likely to start getting a flood of complaints about it soon, and might fix it with an update. ᛗᛁᛟᛚᚾᛁᚱPants   Tell me all about it.  15:00, 3 March 2017 (UTC)