I am learning Regular expression for bash scripting. However, when I was testing string match, the lines always can't pass. Here is what I am testing:  I have a txt file contains a list of "songs":  $ cat soundtrack.txt Ludwig Van Beethoven - 01 - Allero.oog Ludwig Van Beethoven - 02 - Adag.mp3 Ludwig Van Beethoven - 03 - Beach.oog Ludwig Van Beethoven - 04 - Caven Adven.wmv   I would like to use Regex to get the "track number" which are the numerical ones.  Here's the script:  $ cat soundtrack.sh #!/bin/bash IFS=$'\n' for CD in `cat soundtrack.txt` do     if [[ "$CD" =~ "([[:alpha:][:blank:]]*)- ([[:digit:]]*) - (.*)$" ]]     then         echo "Found ${BASH_REMATCH[2]}"     fi done    However, the bash debug shows the string was unable to match the regex:  $ bash -x soundtrack.sh + IFS=' ' ++ cat soundtrack.txt + for CD in '`cat soundtrack.txt`' + [[ Ludwig Van Beethoven - 01 - Allero.oog =~ \(\[\[:alpha:]\[:blank:]]\*\)- \(\[\[:digit:]]\*\) - \(\.\*\)\$ ]] + for CD in '`cat soundtrack.txt`' + [[ Ludwig Van Beethoven - 02 - Adag.mp3 =~ \(\[\[:alpha:]\[:blank:]]\*\)- \(\[\[:digit:]]\*\) - \(\.\*\)\$ ]] + for CD in '`cat soundtrack.txt`' + [[ Ludwig Van Beethoven - 03 - Beach.oog =~ \(\[\[:alpha:]\[:blank:]]\*\)- \(\[\[:digit:]]\*\) - \(\.\*\)\$ ]] + for CD in '`cat soundtrack.txt`' + [[ Ludwig Van Beethoven - 04 - Caven Adven.wmv =~ \(\[\[:alpha:]\[:blank:]]\*\)- \(\[\[:digit:]]\*\) - \(\.\*\)\$ ]]   But, if I test directly in the shell with the same expression, it works:  $ if [[ "Ludwig Van Beethoven - 01 - Allero.oog" =~ ([[:alpha:][:blank:]]*)-\ ([[:digit:]]*)\ -\ (.*)$ ]]; then echo yes; else echo no; fi yes   What's wrong with my script? Do I have to add extra quotas or backslashes? Just doesn't make sense to me.  P.S.  $ bash --version GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
The following code  number=1 if [[ $number =~ [0-9] ]] then   echo matched fi   works. If I try to use quotes in the regex, however, it stops:  number=1 if [[ $number =~ "[0-9]" ]] then   echo matched fi   I tried "\[0-9\]", too. What am I missing?  Funnily enough,  suggests this should work.  Bash version 3.2.39.
If $a_0+\frac{a_1}{2}+\dots + \frac{a_n}{n+1}=0$ then $a_nx^n+\dots + a_0$ has a root in $[0,1]$ Let $P(x)=a_nx^n+a_{n-1}x^{n-1}+\dots +a_0$ be a real polynomial such that $a_0+\frac{a_1}{2}+\frac{a_2}{3}+\dots + \frac{a_n}{n+1}=0$.  Show that $P$ has a root in $[0,1]$. I would like proof verification and alternative proofs.  My solution:      notice that the antiderivative of $P(x)$ is $\frac{a_nx^{n+1}}{n+1}+\frac{a_{n-1}x^n}{n}+\dots + \frac{a_1x^2}{2}+a_0x+C$. From here $\int_{0}^1P(x)dx=a_0+\frac{a_1}{2}+\frac{a_2}{3}+\dots + \frac{a_n}{n+1}=0$. If $P$ had no roots then $P$ would be a strictly positive(or negative) continuous function, so its integral would be strictly positive ( or negative), a contradiction. Looking for the title of a gold heist movie involving the telekinetic son of an extraterrestrial/alien? Some 30 years back, I saw a film about the son of an extraterrestrial who gets involved in a gold heist.  The main character does not initially know that he is the son of an extraterrestrial and that has special telekinetic powers. The film opens, I think, with him being in some train yard, his foot getting stuck in a switch with a locomotive approaching. He stops it using his powers intuitively, possibly passing out (not realizing what he actually did). I think his mother subsequently reveals his heritage to him.  He somehow gets hired as a bodyguard for someone planning a gold heist. I think they know his abilities and use him to steal a million US dollars. Actually, that is just a distraction, covering that they steal 30 million dollars from the same location (through the air, not sure on that part).  The last part I remember is some underground tunnels where the thieves set up to melt the gold. The main character is locked in there.  Does anyone know the title of this movie? Searching for things like "sci-fi gold heist extraterrestrial etc." did not reveal anything to me. I also had a hard time picking proper tags (sorry). I can't get grub menu to show up during boot dpkg-divert: error: rename involves overwriting `/usr/lib/xorg/protocol.txt' with different file `/usr/lib/xorg/protocol-precise.txt', not allowed I have an odd error that I have been unable to find anything on this. I wanted to change the user comment with the following command.  $ sudo usermod -c "New Comment" user   This will work while logged onto a server but I want to automate it across 20+ servers. Usually I am able to use a list and loop through the servers and run a command but in this case I get a error.  $ for i in `cat servlist` ; do echo $i ; ssh $i sudo usermod -c "New Comment" user ; done  serv1 Usage: usermod [options] LOGIN  Options: lists usermod options  serv2 Usage: usermod [options] LOGIN  Options: lists usermod options . . .   When I run this loop it throws back an error like I am using the command incorrectly but it will run just fine on a single server.  Looking through the ssh man pages I did try -t and -t -t flags but those did not work.  I have successfully used perl -p -i -e within a similar loop to edit files.  Does anyone know a reason I am unable to loop this? Transforming geometry PostGIS column with unknown geometry type? Alternative to Adobe Illustrator Can you recommend a good alternative to Adobe Illustrator?   I am learning vector based graphic design, but I am not ready to make such a large investment as to purchase a copy of Adobe Illustrator. Also, Illustrator might be a little more power than I need at the moment. I am using a Macintosh. A formula for the roots of a solvable polynomial Let $F$ be a field and $p(x)\in F[x]$ a separable polynomial, denote $K$ as the splitting field of $p$ and assume that $K/F$ is Galois with a solvable Galois group.  I don't understand if this imply of any formula (in radicals) for the roots of $p$ (however, I do understand how a formula would imply that $p$ is solvable by roots).  Is there some kind of a way to obtain the roots of a solvable polynomial ? This question is about an efficient way to compute principal components.   Many texts on linear PCA advocate using singular-value decomposition of the casewise data. That is, if we have data $\bf X$ and want to replace the variables (its columns) by principal components, we do SVD: $\bf X=USV'$, singular values (sq. roots of the eigenvalues) occupying the main diagonal of $\bf S$, right eigenvectors $\bf V$ are the orthogonal rotation matrix of axes-variables into axes-components, left eigenvectors $\bf U$ are like $\bf V$, only for cases. We can then compute component values as $ \bf C=XV=US$. Another way to do PCA of variables is via decomposition of $\bf R=X'X$ square matrix (i.e. $\bf R$  correlations or covariances etc., between the variables ). The decomposition may be eigen-decomposition or singular-value decomposition: with square symmetric positive semidefinite matrix, they will give the same result $\bf R=VLV'$ with eigenvalues as the diagonal of $\bf L$, and $\bf V$ as described earlier. Component values will be $\bf C=XV$.   Now, my question: if data $\bf X$ is a big matrix, and number of cases is (which is often a case) much greater than the number of variables, then way (1) is expected to be much slower than way (2), because way (1) applies a quite expensive algorithm (such as SVD) to a big matrix; it computes and stores huge matrix $\bf U$ which we really doesn't need in our case (the PCA of variables). If so, then why so many texbooks seem to advocate or just mention only way (1)? Maybe it is efficient and I'm missing something? How do I get a selected vertex and it's corresponding uv vertex?  A vertex I can get with  bpy.context.active_object.data.vertices[0]   A uv vertex I can get with  bpy.context.active_object.data.uv_layers['UVMap'].data[0]   But the index is not the same for uv and mesh vertex. Can there be a function that's even and odd at the same time? Why does this stream return no element? All my properties are zero, and my array is zero, even though I have populated them with numbers and objects By definition a matrix representing a Lorentz transformation is orthogonal, so that its inverse is equal to its transpose.   Consider a pure boost in the t-x plane; $$\Lambda_x=\begin{pmatrix} \cosh(\gamma) &amp;&amp; \sinh(\gamma) &amp;&amp; 0 &amp;&amp; 0\\ \sinh(\gamma) &amp;&amp; \cosh(\gamma) &amp;&amp; 0 &amp;&amp; 0\\ 0 &amp;&amp; 0 &amp;&amp; 1 &amp;&amp; 0\\ 0&amp;&amp;0&amp;&amp;0&amp;&amp;1 \end{pmatrix}.$$ $\Lambda_x$ has inverse  $$\Lambda_x^{-1}=\begin{pmatrix} \cosh(\gamma) &amp;&amp; -\sinh(\gamma) &amp;&amp; 0&amp;&amp;0\\ -\sinh(\gamma) &amp;&amp; \cosh(\gamma) &amp;&amp; 0&amp;&amp;0\\ 0 &amp;&amp; 0 &amp;&amp; 1 &amp;&amp;0\\ 0&amp;&amp;0&amp;&amp;0&amp;&amp;1 \end{pmatrix}$$ but tranpose  $$\Lambda_x^T=\begin{pmatrix} \cosh(\gamma) &amp;&amp; \sinh(\gamma) &amp;&amp; 0&amp;&amp;0\\ \sinh(\gamma) &amp;&amp; \cosh(\gamma) &amp;&amp; 0&amp;&amp;0\\ 0 &amp;&amp; 0 &amp;&amp; 1&amp;&amp;0\\ 0&amp;&amp;0&amp;&amp;0&amp;&amp;1 \end{pmatrix}.$$ These are not equal. Where have I gone wrong? Disproving the statement "If $f(z)$ is not an entire function, then $g(z) = f^2(z)$ is not entire.” If $f(z)$ is not an entire function, then $g(z) = (f(z))^2$ cannot be an entire function.”  From this statement why would saying &quot;Let $f(z) = \sqrt z$, assuming that it is a branch that takes $−1$ to $i$. Then it is not analytic on the branch cut, but $g(z) = (f(z))^2 = z$ is obviously an entire function.&quot; Not be a proper example to disprove this statement/ be a incorrect counterexample? I understand that for $\sqrt z$ to be a incorrect counterexample means it is not analytic on the branch -1 to I, therefore not entire. However I thought $\sqrt z$ would be analytic throughout the whole branch cut from -1 to i. Since on the complex plane, $\lim_{z \to -1} \sqrt z$ exists as it would approach $i$ in that case, and in the other case $\lim_{z \to i} \sqrt z$ it approaches $\sqrt i$ meaning that at least on that branch cut in the complex plane it is continuous everywhere, therefore the partial derivatives exist everywhere on the branch cut meaning it is analytic, but this assumption seems to be incorrect. What am I missing or not understanding here. Precisely, I don't understand why $\sqrt z$ would not be a proper counterexample to the statement. The Complete Rate-Limiting Guide The intuition I have for why quantum computing can perform better than classical computing is that the wavelike nature of wavefunctions allow you to interfere multiple states of information with a single operation, which theoretically could allow for exponential speedup.   But if it really is just constructive interference of complicated states, why not just perform this interference with classical waves?  And on that matter, if the figure-of-merit is simply how few steps something can be calculated in, why not start with a complicated dynamical system that has the desired computation embedded in it. (ie, why not just create "analog simulators" for specific problems?) Difference between "little" and "small" Is there a difference between them? If so, how and when are they used?  For example:     I fixed a little/small typo. What is the difference between  and != Oracle 11g: increasing buffer cache with AMM On a 2-node RAC we have enabled Automatic Memory Management. The advisor views indicate that increasing the buffer cache by 4 GB will half the physical reads, and we have 4 GB to give.   How must we do this? By increasing memory_target and letting Oracle grab more memory for the buffer cache? Or by explicitly setting a value for db_cache_size (which now is zero)?