| Computing desk | ||
|---|---|---|
| < October 28 | << Sep | October | Nov >> | October 30 > |
| 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. |
what is suggested groups in facebook and how is the suggested groups list created , what is the algorithm behind it .I see that a person whose timeline i am frequently visitng and who was never my friend on fb and do not share any common friend with me that is a member of public but the groups to which that belong are appearing in my suggested groups list how and why is this happening.I have graph search enabled or turned on.Can that person sense somehow directly/indirectly that i am very frequently visiting that guys page whenever i type the first letter of his name in search box on top i am getting his name with profile and pic as suggested searck although he is a member of public in fb terms whats the reason for this and how is it so what is the significance. — Preceding unsigned comment added by 117.194.240.19 (talk) 03:15, 29 October 2014 (UTC)
Hello everyone, if i can use the command test instead of [ i test to use the former. The problem arise with composite expressions. For example if i want to negate test "a" != "b" && test "a" != "c" && test "a" != "d"
i have no idea of how can i do that. I tried, of course, to write
! test "a" != "b" && test "a" != "c" && test "a" != "d"
or test ! "a" != "b" && test "a" != "c" && test "a" != "d"
but it negates just the first test (as expected).
How can i group and negate the entire result? With the [ version i would just use
[ ! \( "a" != "b" -a "a" != "c" -a "a" != "d" \) ]
or in an equivalent way test ! \( "a" != "b" -a "a" != "c" -a "a" != "d" \) .
I appreciate suggestion of other way to evaluate conditional expression but i would like to ask you if you are kind enough to provide a solution that involves a combination of test one_expression and shell operators (as i wrote at the start, with 3 test commands with && shell operators).
Pier4r (talk) 15:18, 29 October 2014 (UTC)
if test whatever complicated expressionthen : do nothingelse whatever I wanted to dofi[ ! -e ~/foo.txt ] && echo foo.txt not found can be written as [ -e ~/foo.txt ] || echo foo.txt not found. as to the OP's question, I can't say I understand it Asmrulz (talk) 19:37, 29 October 2014 (UTC)diff <(cd foo; find|sort) <(cd /backup/2014-10-29/foo; find|sort)). I don't know either language, sadly, but if it's anything like (pseudocode and API) x=createProcess("find");x.stdin=...;x.stdout=...;x.workingDir=...; x.run(); x.wait(); - well, that's fine as programming goes but one will tire typing that everytime into the interpreter Asmrulz (talk) 23:53, 29 October 2014 (UTC)system("commandname", $file1, $file2); will do the right thing no matter what funny characters may be in the two filenames. --174.88.134.249 (talk) 04:05, 30 October 2014 (UTC)As for the original question, I suggest using de Morgan's Laws to rewrite the expression. To negate
test "a" != "b" && test "a" != "c" && test "a" != "d"
you can just use
test "a" == "b" || test "a" == "c" || test "a" == "d"
That is, reverse each of the tests and swap "and" for "or". --174.88.134.249 (talk) 04:05, 30 October 2014 (UTC)
A and B or C (!A or !B) and !C main_test=test "a" != "b" && test "a" != "c" && test "a" != "d" ;
let main_test_toggled=1^${main_test}
test ${main_test_toggled} -eq 0
test and [ ("With the [ version i would just use")—aside from having to type ] to close the latter?test ! \( "a" != "b" -a "a" != "c" -a "a" != "d" \) (or the [ version) you provided work?test invoked multiple times rather than once with its operators? (But see below about arbitrary strings; I could also see it if the latter tests involved some expensive shell substitution or so…)[ \( "(" = "(" \) ] (where the quotes are meant to suggest that those arguments might have come from variables), while test 7.4 accepts that but rejects [ \( "(" = ")" \) ] which bash interprets as two nested parenthesizations of the single argument = which, being non-empty, is true. Using fewer than 5 arguments can help in that the parsing is not based so much on keywords: for example, [ "(" = ")" ] is a comparison rather than a parenthesized single-argument test.! to a compound command: ! (true && false) or ! { true && false; } (note the semicolon and spaces). --Tardis (talk) 13:56, 30 October 2014 (UTC)See Wikipedia:Reference_desk/Archives/Computing/2014_October_23#AT.26T_behavior. They've just been charged with illegal data throttling, so apparently I'm not the only one they did this to. StuRat (talk) 15:34, 29 October 2014 (UTC)