I just discovered that in bash,[[ -d foo-* ]] returns false ($? set to 1) even if a directory named foo-bar exists while [ -d foo-* ] returns true ($? set to 0)  I have to admit that I was surprised as I expected both versions to return true.  What is the rational behind this differing outcome?
Stupidly, I had been using a condition like this as part of a script:  if [ $(ls FOO* 2&gt; /dev/null) ] # if files named "FOO*" were downloaded  then     echo "Files found"      # ... process and email results else     echo "Not found"     # ... email warning that no files were found (against expectations) fi   That works for zero and one files named FOO*, but fails if there are more than one. From logs I found several different error messages stemming from this:  [: FOO_20131107_082920: unary operator expected [: FOO_20131108_070203: binary operator expected [: too many arguments   My question is: what is the correct way to check, in a Bash if condition, whether one or more files whose name begins with FOO exist?  GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)
Can I define keyboard shortcuts using the Super key? Proving that $\mathbb{Z}[\sqrt{2}]$ is a Euclidean domain We're proving that $\mathbb{Z}[\sqrt{2}]$ is a Euclidean domain, using the norm function $$\nu (a + b\sqrt{2} ) = |a^2 - 2b^2|$$ and the first part says that since $\nu (a + b\sqrt{2} ) = |(a + b\sqrt{2})(a - b\sqrt{2})|$ it's clear that $\nu (xy) = \nu(x) \nu(y)$? ... Can someone please explain to me how this is clear? Are there any practical implementation of a homomorphic hashing or signature scheme? A  is a function $H : A \to B$ between two sets with some algebraic structure $(A, *)$ and $(B, \star)$ such that   $H$ is collision resistant, i.e. it is hard to find $x \neq y$ such that $H(x) = H(y)$ and $H$ is a homomorphism, i.e. $H(x * y) = H(x) \star H(y)$.   Are there any practical realizations of such a homomorphic hash function, or even a homomorphic signature scheme (i.e., where we can "add" valid signatures to get a signature of the "sum" of two messages)?  Even better, are there even any libraries implementing this? How to change the default fonts in Windows 10 I have read the entries for other OS versions.    Changing the MS Shell Dlg (2) entries in FontSubstitues registry key doesn't seem to work (in Windows 10), or it works in two minor places.  I don't have access to a Windows 95/98/etc. machine, the "earliest" I have is Windows 8.1, so I can't use the Plus directory trick either (directory doesn't exist). For the WindowMetrics registry entry, I seem to have all the *Font keys to be set to the font I want, but that doesn't seem to be doing the trick (on Windows 10). For Windows 8/8.1, there was a program called Windows 8 Font Changer, which worked like a charm, but doesn't seem to on Windows 10 (though it was probably that program run that changed the fonts in the WindowMetrics).   Thanks.   Update: One more method that came out that is perhaps still not the solution: Winaero Tweaker (winaero.com), as it has some issues, the biggest two of which seem to be:   If you have changed the size of text etc. from: "Settings –> Display –> Advanced display settings –> Advanced sizing of text and other items –> set a custom scaling level (not recommended)", the changes do not stick upon a logoff-login or restart. You need to have changed it, if at all, only through "Settings –> Display –> Change the size of text, etc." (which goes up to only a certain percentage, depending on the maximum resolution of your device – 125% on a tablet of mine, which I was able to set to 175% or even 200% with the other, older method that is now apparently listed as not recommended).  Even though it lists a number of items to change the font and size of, not everything gets changed. A typical example of this is the right click menu on the desktop, which still shows the View, Sort By, etc. items in the default font, however much it has a clear 'Change menu font' item. How to remove a watermark from a PDF file? I thought this would be a simple task, but it turned out the other way.  The watermark is the very same (overlapping, but transparent) image on every single page. I created the PDF file myself (so no copyright worries here) using PDFCreator 0.9.8.  I have already tried my friend's Adobe Acrobat Pro, but it didn't work. It tries to remove it, but it can't. I tried to remove header/footer, etc., but the watermark just won't disappear.    How can I remove the watermark? How to migrate a WordPress installation from one site to another, including all images? I found this heart while exploring the crimson biome - what is it? disable comments if array exists This is the code which is registering the function for rewrite_endpoints():   function wpa121567_rewrite_endpoints(){  add_rewrite_endpoint( 'comments', EP_PERMALINK );  add_rewrite_endpoint( 'stats', EP_PERMALINK );  }  add_action( 'init', 'wpa121567_rewrite_endpoints' );   NOTE  I don't know if this matters but I will write it.   I have single-CPT.php which is calling  /inc/post-format/single-CPT.php like this:      &lt;?php while ( have_posts() ) : the_post(); ?&gt;  &lt;?php   get_template_part( 'inc/post-format/single-debate');      ...   This is the code which is checking if array key exists, which is  inside my /inc/post-format/single-cpt.php:   ?php if( array_key_exists( 'comments', $wp_query-&gt;query_vars ) ){  the_field('comments_section');   } elseif( array_key_exists( 'stats', $wp_query-&gt;query_vars ) ) {   the_field('stats_section');   } else { // the request is for the main post  }   ?&gt;   This is my comments.php :       &lt;div id="comments" class="comments-area"&gt; &lt;?php // If CPT and not logged in, display a message: if ( 'debate' == get_post_type() &amp;&amp; ! is_user_logged_in() ) { echo '&lt;p class="must-log-in" style="padding-left:20px; font-size:20px;"&gt;You must be logged in to post a comment.' . '&lt;/p&gt;';  echo do_shortcode("[upme_login]");   } ?&gt;     &lt;?php if ( have_comments() ) : ?&gt;         &lt;h3 class="comments-title"&gt;              &lt;?php                 printf( _n('%d comment', '%d comments', get_comments_number(), 'outbox' ),                     number_format_i18n( get_comments_number() ) );             ?&gt;         &lt;/h3&gt;             &lt;ol class="commentlist"&gt;              &lt;?php                 wp_list_comments( array( 'callback' =&gt; 'outbox_comment' ) );             ?&gt;         &lt;/ol&gt;&lt;!-- .commentlist --&gt;          &lt;?php if ( get_comment_pages_count() &gt; 1 &amp;&amp; get_option( 'page_comments' ) ) : // are there comments to navigate through? If so, show navigation ?&gt;         &lt;nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation clearfix"&gt;             &lt;div class="nav-previous"&gt;&lt;i class="icon-left-open-1"&gt;&lt;/i&gt;&amp;nbsp;&lt;?php echo get_previous_comments_link( __( 'Older Comments', 'outbox' ) ); ?&gt;&lt;/div&gt;             &lt;div class="nav-next"&gt;&lt;?php echo get_next_comments_link( __( 'Newer Comments', 'outbox' ) ); ?&gt;&amp;nbsp;&lt;i class="icon-right-open-1"&gt;&lt;/i&gt;&lt;/div&gt;         &lt;/nav&gt;&lt;!-- #comment-nav-below .site-navigation .comment-navigation --&gt;         &lt;?php endif; ?&gt;      &lt;?php endif; // have_comments() ?&gt;      &lt;?php         // If comments are closed and there are comments, let's leave a little note, shall we?         if ( ! comments_open() &amp;&amp; '0' != get_comments_number() &amp;&amp; post_type_supports( get_post_type(), 'comments' ) ) :     ?&gt;         &lt;p class="nocomments"&gt;&lt;?php _e( 'Comments are closed.', 'outbox' ); ?&gt;&lt;/p&gt;     &lt;?php endif; ?&gt;     &lt;?php  // Don't output the comment form if CPT and user isn't logged in if ( 'debate' != get_post_type() || is_user_logged_in() ) {  comment_form(); }  ?&gt;  &lt;/div&gt;&lt;!-- #comments .comments-area --&gt; &lt;?php } ?&gt;    This is how the comments template is included  inside my single-CPT.php :  if ( comments_open()  )  comments_template( '', true );   I want to disable comments if if( array_key_exists( 'comments', $wp_query-&gt;query_vars ) ){  How can I do this? Brie Cheese and expiration date I have a Brie Cheese that has not been opened. It shows an expiration date that is 6 weeks ago. Is it still safe to eat? How can we run a command stored in a variable? $ ls -l /tmp/test/my\ dir/ total 0   I was wondering why the following ways to run the above command fail or succeed?  $ abc='ls -l "/tmp/test/my dir"'  $ $abc ls: cannot access '"/tmp/test/my': No such file or directory ls: cannot access 'dir"': No such file or directory  $ "$abc" bash: ls -l "/tmp/test/my dir": No such file or directory  $ bash -c $abc 'my dir'  $ bash -c "$abc" total 0  $ eval $abc total 0  $ eval "$abc" total 0 Apache doesn't log remoteIP when RemoteIPHeader X-Forwarded-For is present I know that like is a preposition but why not using it as conjunction?  Examples:        It's as if I'm walking on air   It's like I'm walking on air      What is the difference? On , the accepted answer doesn't float on top. Apart from that, the display is correct (i.e. the V mark and the green border)  If I sort by "vote", I've got the following answer order:   Jezell Marc Gravell chilltemp (Accepted) Shaun Bowe   By "oldest":   Marc Gravell Jezell chilltemp (Accepted) Shaun Bowe   and by "newest":   Shaun Bowe chilltemp (Accepted) Jezell Marc Gravell     I'm using Firefox V.3.5 : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)  Feel free to ask for more debug information if needed. I want to see all my Questions and Answers in a particular SE site -  - profile page through Stack Exchange Android App. How can I see that? When I tried to see that I found only Top Posts(5) and Top Tags. Is there a quasistatic process that is not reversible? I have seen several questions and good answers on the link between reversible and quasistatic processes, such as  or . However, these questions only adress one side of the problem : a reversible process is necessarily quasistatic.  I am interested in the other side of the equivalence : is there a process that is quasistatic, yet not reversible ? It looks to me that an irreversible process cannot be made perfectly quasistatic.  The  article about quasistatic processes takes as an example the very slow compression of a gas with friction. As the compression occurs very slowly, the transformation is quasistatic, and the friction makes it irreversible. I am not convinced by this example : if you press on the piston with a vanishingly small force you will have to reach the threshold of the Coulomb law for solid friction before moving the piston anyway. It makes the process non-quasi-static, however small the Coulomb threshold might be.  Another example I've heard of is the reaction between a strong acid and a strong base. It is always an irreversible process, and you could make it quasistatic by adding very small drops of base into acid at a time. But by trying to do that, you would inevitably reach a limit to the size of the drop imposed by surface tension.  Even if "reversible" and "quasistatic" mean very different things, is it true to consider that in practice, a reversible process and a quasistatic process is essentially the same thing ? May someone help me? I am trying to use induction to prove that the formula for finding the $n$-th term of the Fibonacci sequence is:   $$F_n=\frac{1}{\sqrt{5}}⋅\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}⋅\left(\frac{1-\sqrt{5}}{2}\right)^n.$$  I tried to put $n=1$ into the equation and prove that if $n=1$ works then $n=2$ works and it should work for any number, but it didn't work. I need to prove that this formula gives the $n$th Fibonacci number. From the command line is it possible to open a package installer window (not install the application).  I understand I could run the application using sudo installer -pkg ..... -target ....... Instead i would like to open the package in a similar way to if I double clicked the package within the Finder. What does it "they like me for me" mean? Is Using Digital Signatures to prove identity a zero knowledge proof? Suppose Alice publishes a book with a public key in it, and later wants to prove that she wrote the book. She could sign challenge messages with her private key, and others could verify those signed messages. Alice is proving she knows a private key without revealing anything about it.  Is this an example of an interactive zero knowledge proof?   Or does this example somehow not apply to zero knowledge proofs? How to find out what's accessing a particular hard drive on Windows? Possible Duplicate:          My HDD on a dock just started making noises like it's being accessed but I don't see any program accessing it.  Is there a program that shows which HDD is accessed by which program in percentages similar to how the task manager shows which programs use the most CPU?