according to the test(1) manpages:           -n STRING               the length of STRING is nonzero   so I expected this to run fine:  [ -n ${var} ] &amp;&amp; echo "var is not empty"   I used this logic in a real case, a script like this:  [...] dne() {     echo DEBUG: wc -c: $(echo -n $peopkg |wc -c)     echo DEBUG: pdir: $pdir     echo "Error: ${package}: doesn't exist in local repos"     exit 1 }   # packages are listed as such:  # p/pname/package-version-release-distrelease... # pname is inconsistent, but it is guaranteed that the first word in package # (all to lowercase) will match at least one pname. # NOTE: package-[0-9]* matches package-32bit. *-32bit is a subpackage we want # to match later, but not when it's not already in pcase. # So that must be negated too  pfirst=${pcase%%-*} for pdir in ${p}/${pfirst}* do     # check if the glob matched anything at all     [ ${pdir} = "${p}/${pfirst}*" ] &amp;&amp; dne      peopkg=$(find ${pdir} \         -name ${package}-[0-9]* \         ! -name *.delta.eopkg \         ! -name ${package}-32bit* |sort -rn |head -1)     echo DEBUG: in-loop peopkg: $peopkg     echo DEBUG: in-loop wc -c: $(echo -n $peopkg |wc -c)     echo DEBUG: in-loop test -n: $(test -n $peopkg &amp;&amp; echo true || echo false)     #------------------------------------------------------------#     # break on ANY match. There's supposed to be only one anyway #     [ -n ${peopkg} ] &amp;&amp; break # &lt;--- [issue here]                #     #------------------------------------------------------------# done [ -z ${peopkg} ] &amp;&amp; dne [...]   what matters here is that when I run this, I get these messages:  DEBUG: in-loop peopkg: DEBUG: in-loop wc -c: 0 DEBUG: in-loop test -n: true DEBUG: wc -c: 0 DEBUG: pdir: a/alsa-firmware Error: alsa-utils: doesn't exist in local repos   This makes zero sense to me.. DEBUG: pdir: a/alsa-firmware indicates that the loop exits always on the first iteration. Which can only happen if the glob pattern a/alsa* matched something AND peopkg was nonzero length.  PS: I'm trying to be POSIX compliant.
I understand test -n &lt;expression&gt; to return false if the expression evaluates to a string length of greater than 0.  Why then does the following happen?  Macbook:~ echo ${#undeclared_variable} 0 Macbook:~ test -n $undeclared_variable &amp;&amp; echo Foo Foo   Bash 4.x  My expectation is that since test -n $undeclared_variable should evaluate false, that Foo should not be echoed.  If I use [[  ]] instead of test, it works as expected.
Java Object Reuse Should Java Objects be reused as often as it can be reused ? Or should we reuse it only when they are "heavyweight", ie have OS resources associated with it ?  All old articles on the internet talk about object reuse and object pooling as much as possible, but I have read recent articles that say new Object() is highly optimized now ( 10 instructions ) and Object reuse is not as big a deal as it used to be.  What is the current best practice and how are you people doing it ? I need to prove that     $f_1 \in \Theta(g_1) \land f_2 \in \Theta(g_2) \implies f_1 + f_2 \in \Theta(\max\{g_1, g_2\})$    is relevant, but I have a slightly different case, so I don't know how to translate it into this one, because I need to turn the $f$'s into $g$'s.  Am I allowed to say $\max\{f_1, f_2\} \in \Theta(\max\{g_1, g_2\})$?  Or even $\Theta(\max\{f_1, f_2\}) = \Theta(\max\{g_1, g_2\})$? Anybody kindly help me to find how to calculate pressure in bar from flow rate. I have a pipe and from that I am transferring water at a constant flow rate of 5ml/min. At this flow rate, with a 0.5 cm diameter pipe, what will be the pressure generated by water? Add a time limit before you can vote on a post There needs to be a timer or something on upvoting/downvoting.  I posted an answer to a question and as soon as the page loaded, my answer was already down voted. There is no way someone had the time to read the answer &lt; 10 seconds after it was posted. Change the location of saved screenshot when screenshot taken by printscreen button in GNOME 3 I want to change the default location of "Save a screenshot to Pictures" to save it to Desktop.   If that is not possible, is there any other way to do it? I am using Ubuntu GNOME 17.04.  NOTE: I don't want to change the location with dconf-editor as it changes the location of screenshot applet and not of the shortcut I require. Adding execute permission in opt folder I am trying to install oracle database in Ubuntu 16.04 LTS. I had unzipped the oracle database file in opt folder,but now when I am trying to give execute right to the sqldeveloper file using chmod +x sqldeveloper.sh, it's throwing this error:  chmod: changing permissions of 'sqldeveloper.sh': Operation not permitted How can I disable the drag handle on the desktop? How to see download count of an Android app on Google Play store? I could have modifications ready for a specific question that was downvoted. I felt like the best thing to do was to delete the post first.  Is it possible to flag for moderator attention after you deleted the post ? I have a parent theme that uses correctly load_theme_textdomain() to load all the translated strings in many languages.  Then I created a child theme that uses load_child_theme_textdomain() to achieve the same thing for its strings.  There are certain translated strings for a particular language on the parent theme that I'd like to replace/override in the child theme.  I know if they were on a template file I could replace the file and simply change the textdomain for those strings, but unfortunately the ones I'm talking about are used in many places and also in the dashboard (so inside some filter/action functions).  So my question is: is there a way to replace those translated strings inside the child theme without having to replace parent template files or functions?  I don't know, maybe adding a parent-theme.mo file inside the languages folder of the child theme with only those strings translated, or something like that. GetFeatureInfo from Image WMS I'm not the most experienced person when it comes to commands. I worked out how to do stuff like when holding x you have y effect. I wanted to think of something that gave other people an effect when hit. Here is what I came up with but I got stuck when it said it couldn't execute the command.  /scoreboard objective add nokill dummy  /scoreboard objective add poi dummy  /scoreboard players set [player] nokill 1  /scoreboard players add @a poi 1 {SelectedItem:{id:minecraft:diamond_sword,display:{Name:{Poison sword}}}}  /execute @a[score_poi_min=1] ~ ~ ~ /effect @p[score_nokill_max=1,r=5] {HurtTime:1} minecraft:poison 10 1 Let $A\in M_{n\times n}(\Bbb R)$ so that $I\notin span(A,A^2,...,A^n)$. Prove that $\det(A)=0$. What's in a name: hyperparameters So in a normal distribution, we have two parameters: mean $\mu$ and variance $\sigma^2$. In the book Pattern Recognition and Machine Learning, there suddenly appears a hyperparameter $\lambda$ in the  regularization terms of the error function.  What are hyperparameters? Why are they named as such? And how are they intuitively different from parameters in general? I am working on refactoring some old code and have found few structs containing zero length arrays (below). Warnings depressed by pragma, of course, but I've failed to create by "new" structures containing such structures (error 2233). Array 'byData' used as pointer, but why not to use pointer instead? or array of length 1? And of course, no comments were added to make me enjoy the process...  Any causes to use such thing? Any advice in refactoring those?  struct someData {    int nData;    BYTE byData[0]; }   NB It's C++, Windows XP, VS 2003 Zero-pad digits in string Lost/Deleted dpkg (package manager for Debian). How do I get it back? Let , $\Delta = B(0,1)$.  If $f:\Delta \rightarrow \Delta$ is holomorphic, and $f(0)=0$, prove that $|f(z)+f(-z)| \leq 2|z|^2$.  My attempt so far:  $\displaystyle f(z) = \sum_{n=0}^{+\infty} a_n z^n = \sum_{n=0}^{+\infty} a_{2n} z^{2n} + \sum_{n=0}^{+\infty} a_{2n+1} z^{2n+1}$  $\displaystyle f(-z) = \sum_{n=0}^{+\infty} a_n (-z)^n = \sum_{n=0}^{+\infty} a_{2n} z^{2n} - \sum_{n=0}^{+\infty} a_{2n+1} z^{2n+1}$  Then, $\displaystyle f(z)+f(-z) = 2  \sum_{n=0}^{+\infty} a_{2n} (z^2)^n =: 2 g(z^2)$  If $g(\Delta) \subset \Delta$, as $g(0) = 0$, I can invoke Schwarz Lemma and I win. However, I don't know how to prove this. Could anyone help me? Thanks! number theory about index Given the congruence $x^3 \equiv a \pmod p$, where $p \geq 5$ is a prime and $\gcd(a,p)=1$, prove the following:   If $p \equiv1 \pmod 6$, then the congruence has either no solutions or three incongruent solutions modulo $p$ If $p \equiv5 \pmod 6$, then the congruence has a unique solution modulo $p$   Help me...  I don't know what I learn because Prof teaches so quickly.  So I need your help to organize my thoughts. connectedness of uniform topology