I'm having a hard time getting regex matches to work in a bash case statement.   Example code:  #!/bin/bash                            str='    word1 word2'  echo "With grep:" echo "$str" |grep '^\s*\&lt;word1\&gt;'  echo "With case:" case "$str" in     '^\s*\&lt;word1\&gt;') echo "$str" ;; esac   The example works with grep, but not with case... I'm confused, because some simpler regexes work with case. Does case use a different syntax for regex? Am I just not escaping things properly?
I wrote a regular expression which works well in a certain program (grep, sed, awk, perl, python, ruby, ksh, bash, zsh, find, emacs, vi, vim, gedit, …). But when I use it in a different program (or on a different unix variant), it stops matching. Why?
In Einstein's General Relativity, do the space-time dimensions curve? In Einstein's General Relativity, do the space-time dimensions curve according to the positions of stars, planets, and masses? How do I create an internet shortcut within a folder? How to permanently set environmental variables Let $E$ be a finite dimensional vector space over field $\mathbb R$ with $E^*$ as the dual space of $E$.($\dim E=n$)   $\Omega^P(E):=\{ \alpha\colon \overbrace{E\times\cdots\times E}^{p- times}\rightarrow \mathbb R\  \ , \alpha \text{ is alternating multilinear map}\}$ $\Omega^P(E^*):=\{ u\colon \overbrace{E^*\times\cdots\times E^*}^{p- times}\rightarrow \mathbb R\  \ , u \text{ is alternating multilinear map}\}$  I wish to prove that there exist an $\textbf{unique}$ bilinear form $B\colon \Omega^p(E^*)\times\Omega^p(E)\rightarrow\mathbb R$   such that for all $ f_i\in E^* \ , u_j\in E^{**}\simeq E \qquad  i,j=1,\cdots,p$, it has the following rule:  $B(u_1\wedge\cdots\wedge u_p,f_1\wedge\cdots\wedge f_p)=\det[f_i(u_j)]$.  $\wedge$ is wedge product between alternating maps i.e. $\alpha\wedge\beta(v_1,\cdots,v_{p+p})=\dfrac{1}{p! p!}\displaystyle\sum_{\sigma\in S_{p+p}}sign(\sigma)\alpha(v_{\sigma(1)},\cdots,v_{\sigma(p)})\beta(v_{\sigma(p+1)},\cdots,v_{\sigma(p+p)})$  How can I do this? How do I prevent directories mounted with 'bind' from appearing on 'Devices' on nautilus? I have these lines in the fstab   # binds /media/DataNtfs/Music           /home/can/Music                  none    rw,bind  /media/DataNtfs/Pictures        /home/can/Pictures               none    rw,bind  /media/DataNtfs/Downloads       /home/can/Downloads              none    rw,bind  /media/DataNtfs/Documents       /home/can/Documents              none    rw,bind  /media/DataNtfs/Backups         /home/can/Backups                none    rw,bind  /media/DataNtfs/Notes           /home/can/Notes                  none    rw,bind  /media/DataNtfs/Other           /home/can/Other                  none    rw,bind  /media/DataNtfs/Packages        /home/can/Packages               none    rw,bind  /media/DataNtfs/Photos          /home/can/Photos                 none    rw,bind  /media/DataNtfs/Videos          /home/can/Videos                 none    rw,bind  /media/DataNtfs/WorkSpace       /home/can/WorkSpace              none    rw,bind Our company would like to understand the effects:   If we have single table with Primary Key Identity column, int primary key IDENTITY(1,1),  and the Application is conducting multi-threading parallel processing, trying to conducts 1000s of simultaneous inserts on one table.   Would the identity primary key column fail, with a primary key violation in any way, for example: processors are trying to input the same identity number?  Or was SQL designed to be successful even in multithreading parallel insert?  Note: IDENTITY_INSERT is OFF Convert bytes to a string I'm using this code to get standard output from an external program:  &gt;&gt;&gt; from subprocess import * &gt;&gt;&gt; command_stdout = Popen(['ls', '-l'], stdout=PIPE).communicate()[0]   The communicate() method returns an array of bytes:  &gt;&gt;&gt; command_stdout b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2\n'   However, I'd like to work with the output as a normal Python string. So that I could print it like this:  &gt;&gt;&gt; print(command_stdout) -rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1 -rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2   I thought that's what the  method is for, but when I tried it, I got the same byte array again:  &gt;&gt;&gt; binascii.b2a_qp(command_stdout) b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0 Mar  3 07:03 file2\n'   How do I convert the bytes value back to string? I mean, using the "batteries" instead of doing it manually. And I'd like it to be OK with Python&nbsp;3. Missing dollar problem This sounds silly but I saw this and I couldn't figure it out so I thought you could help. The below is what I saw.  You see a top you want to buy for $\$97$, but you don't have any money so you borrow $\$50$ from your mom and $\$50$ from your dad.  You buy the top and have $\$3$ change, you give your mom $\$1$,your dad $\$1$, and keep $\$1$ for yourself.  You now owe your mom $\$49$ and your dad $\$49$.  $\$49 + \$49 = \$98$ and you kept $\$1$.   Where is the missing $\$1$? How do I change / spoof my MAC address and easily switch between multiple ones? My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager.  How do I change the MAC address for a network connection? I recently moved into an in-law unit of a large old house.  In the kitchen, there are two pipes coming out of the wall (one protruding out a little more than the other).  I had assumed they were gas lines to connect my stove.  But since the stove only connects to one pipe, I'm now wondering if they're actually water lines. Can anyone explain how I can tell the difference? On the other side of the wall is a large closet with the air conditioning system, water heater, and what I think is the gas shutoff valve. What makes SHA-256 secure? For example, RSA relies on a mathematically hard problem, factoring, while ECDSA or similar rely on discrete logarithm problem.  What makes SHA-256 and similar hash functions, of the same family, secure against pre-image and collision attacks? What's the math behind it? Why is it that logistic regression becomes unstable when classes are well-separated? What does well-separated classes mean? I would really appreciate if someone can explain with an example. Can I smoothly upgrade from one LTS to next LTS release? Question is about Ubuntu release process. Are migrations from n to n+1 releases expected?  Assuming we have server with installed Ubuntu 14.04 LTS. Will it be smoothly upgradable to Ubuntu 16.04 LTS via apt-get upgrade ?  Assumptions:   scope is software therefore we assume that given hardware is supported on both releases (upgrading from and to) that's why, always before upgrade you are asked to make backup to be able to revert in case of failure Product of invertibles in $\Bbb Z_n$ [Wilson's Theorem generalization] How can we compute the product of all invertibles in $\Bbb Z_n$?  In the special case $n=p$ where $p$ is a prime it is Wilson's theorem. By pairing inverses it reduces to computing the product of all $a$ such that $a^2\equiv 1\pmod{n}.\,$  How can we do that? How to design a command inquiring internally required packages? I believe it's a common practice in some communities to name children after their grandparents or parents or relatives and sometimes even friends and popular people. Places, roads, streets etc., get named after famous people, too. Many inventions and discoveries have been named after people who invented or discovered them.  But I am not yet aware of a term that refers to the person whose name is given to people, places or objects this way. Is there a suitable word to fill in the blank below?     They named their son after the famous football player, David Beckham.      David Beckham is .......... of their son. So I am running on Windows 7 (64-bit) Home Premium with 12 GB RAM (Intel Core i7 920).  I have restricted the Page File to 400MB since it was eating up a lot of space om my SSD (that is 80GB).   After that I sometimes get the "low memory"-warning, like this, except for the behold-comment:   When I get those warning I have usually a lot of RAM available; when I check Resource Manager I have over 2GB "Free" and over 2GB "Available" - usually more than that.  The diskspace on all my drives have over 10GB free.  So the question is - why does Windows complain? It actually restarted by computer (hard boot) when it happened, and as I said - lots or RAM available. Intuitive explanation of entropy I have bumped many times into entropy, but it has never been clear for me why we use this formula:  If $X$ is random variable then its entropy is:  $$H(X) = -\displaystyle\sum_{x} p(x)\log p(x).$$  Why are we using this formula? Where did this formula come from? I'm looking for the intuition. Is it because this function just happens to have some good analytical and practical properties? Is it just because it works? Where did Shannon get this from? Did he sit under a tree and entropy fell to his head like the apple did for Newton? How do you interpret this quantity in the real physical world? CPU Die temperatures reaches 90° C, is that normal? How do I join my partitions?