Normally, when we use a pipe, the operations on the left and right of the pipe are run in separate subprocesses. The outputs of the first command are transmitted as input to the second command. In this case, I thought that when I used the ampersand sign at the end of the pipeline, only the second operation would be started in the background. However, when I tested it, the entire command is launched in the background. In the following use, I expect the second command is started in the background, but the entire command is started in the background. I tested in bash. cmd | cmd2 &amp; What exactly did I know wrong or missed? What happens when we use ampersand &amp; at the end of the pipeline?
I have some conditions for some background job to run:  condition-command &amp;&amp; condition-command &amp;&amp; background-job &amp;   The problem is: I want the conditions to block until the job runs, as if I had run:  condition-command; condition-command; background-job &amp;   But it isn't a condition, if previous command fails I do not want the job to run.  I realised it is asynchronous, but it should not, in my mind the both following scripts should be the same, but they do not:  sleep 2; echo foo &amp; sleep 1; echo bar; wait   # prints foo, then bar: correct sleep 2 &amp;&amp; echo foo &amp; sleep 1; echo bar; wait # prints bar, then foo: bug   I know if I test $? variable it would work, or if I put the last one inside a subshell (but then I would lost job controls, I want to avoid daemons), but I want to know why bash make it this way, where is it documented? Is there any way to prevent this behaviour?  Edit: Chained ifs is disgusting, that is why I will not accept it as a alternative way. Edit 2: I know a subshell is possible, but it will not work for me, let us imagine I want to run a bunch of commands then wait in the end. It will be possible if i check the existence of /proc/$PID directory, but it would be a pain in the neck if there are several jobs. Edit 3: The main question is WHY bash does it, where is it documented? Whether or not it has a solution is a bonus!
I have a  for my phone, powered via a micro-usb port. The markings on it indicate that it will accept the typical 5V that nearly every USB port provides, or it will accept 9V for "fast charge".  I was under the impression that USB standards allowed for no more than 5V. My research shows that  has several profiles (up to 20V), and Revision 2.0 Version 1.2 includes a 9V profile.  Now I'm wondering: How can voltages above the usual 5V be provided without worry of damaging an expensive phone when connecting them directly (no wireless pad)? If things are running at different voltages, wouldn't that cause an issue?  In this example, 9V is used for fast charging, but could that 9V be sent to my phone? Do phones have a safeguard for this? The USB standard allows for up to 20V. That's a lot when expecting only 5V. Some "dumb" devices are powered directly off of USB, like cheap LEDs and fans that have no IC. Surely they would blow upon 20V!  I'm guessing there is data exchanged between the power source and the peripheral, ultimately telling the power source whether or not it's okay to provide more than 5V. Some USB charging cables don't have data pins though, which can allow for faster charging. In this case, it seems that not having data pins would be a restriction. Maybe the power source would have to default to 5V?. Unfortunately I cannot find an explicit protocol/explanation of how the different potentials are managed. How do I change the `enumerate` list format to use letters instead of the default Arabic numerals? I've seen documentation whereby an \alph command is put around the \begin{enumerate} somewhere, but I'm not entirely sure how that operates... How do I invoke a Java method when given the method name as a string? How to show that $\mathfrak{sl}_n(\mathbb{R})$ and $\mathfrak{sl}_n(\mathbb{C})$ are simple? App keeps crashing & rendering error since update to 1.0.68 density of $X^2$ when $X$ has uniform $[-1, 2]$ distribution Why are badges on per-site-metas separate? Badges earned on per-site meta sites are separate from the main site, but reputation is carried over from the main site (because you don't earn any on Meta).   I perfectly understand keeping the rep the way it is (meta votes are too subjective to integrate them with rep) but the badge split seems odd to me.  Multiple badges are in fact impossible on Meta; Mortarboard, Bounty related badges. In addition badges in general are much harder to earn due to the lower amount of users and content; badges like Great Answer are nearly impossible.   As a result of this, most users on Meta end up with the easy 5-10 bronze badges for basic participation on Meta and not much else; stuff like Supporter and Critic that are hard not to get.   I understand the want to drive more people to meta, so perhaps badges are separate to institute a reward system; however this doesn't seem to work well since Meta badges (mostly) don't appear on the main site. This in combination of the 0 rep gain makes Meta feel almost not real. It also makes part of your progress (badges) on the main site invisible on Meta, and vise versa.  IMO the badges should be the same on both Meta and main site, but more Meta-oriented badges should be added to encourage use of Meta. This way Meta badges feel "real" instead of "Meta".  Is there an official reason for per site metas having separate badges? $P(X<Y)$ where X and Y are exponential with means $2$ and $1$ Creating vimrc breaks vim I'm currently logged into a server via ssh with ssh -Y and running a tmux session. If I start vim and run :colorscheme elflord the color scheme is changed. (Although the colors are not exactly what I would expect although they are I think 256 color. If I create a ~/.vimrc file and put a single line colorscheme elflord  in it then when I run vim it shows no color (just white text) and I cannot change the color with the :colorscheme command. Let $G$ be a finite group and suppose there exists $f\in\text{Aut}(G)$ such that $f^2=\text{id}_G$, i.e., $f$ is its own inverse, and such that $f$ has no fixed points other than the identity $e$ of $G$, i.e., $f(x)=x\Rightarrow x=e$. Show that $G$ is necessarily abelian.   While trying to do this exercise I noticed two facts.  First, $g$ and $f(g)$ have the same order because $o(f(g))|o(g)$ and, applying $f$ again and using $f^2=\text{id}_G$, $o(f(f(g)))=o(g)|o(f(g))$ and, once the order of any element is $\geq 1$, it follows that $o(g)=o(f(g))$. Also, it's easy to see that $g$ and $f(g)$ commute.  Second, there cannot exist such an automorphism if the order of $G$ is even, because $f(e)=e$ and we can form pairs like $\{g,f(g)\}$ with $f(g)\neq g$ that are invariant under $f$, i.e., $f(\{g,f(g)\})=\{g,f(g)\}$. But once the order of $G$ is even, proceeding with the construction of the pairs, we'll end up with just one element $\neq e$, so we must have some $\gamma\in G\setminus{e}$ with $f(\gamma)=\gamma$, contradicting the hypothesis.  Let $n$ be the order of $G$ and let's fix an enumeration of the elements of $G$, say $G=\{g_1,\ldots,g_n\}$. My approach was the following. For each $\sigma\in S_n$, let $x_{\sigma}=\prod_{i=1}^ng_{\sigma(i)}$. Then we have that $f(x_{\sigma})=x_{\sigma^{\prime}}$. If it's shown that $f(x_{\sigma})=e\;\forall\;\sigma\in S_n$, then we'd have $x_{\sigma}=e\;\forall\;\sigma\in S_n$, which implies that $G$ is abelian. The problem is that $S_n$ has $n!$ elements while $G$ has $n$ elements, so there repetitions among the $x_{\sigma}$, and we cannot apply directly the reasoning of the last paragraph.  Is this the right way, or is there an easier manner to solve this? How does one show that $$\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}=2^{n}$$ for each nonnegative integer $n$?  I tried using the  but I guess I am applying it incorrectly. With the snake oil technique we have $$F(x)= \sum_{n=0}^{\infty}\left\{\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}\right\}x^{n}.$$ I think I have to interchage the summation and do something. But I am not quite comfortable in interchanging the summation. Like after interchaging the summation will $$F(x)=\sum_{k=0}^{n}\sum_{n=0}^{\infty}\binom{n+k}{k}\frac{1}{2^k}x^{n}?$$ Even if I continue with this I am unable to get the correct answer.  How does one prove this using the Snake oil technique?  A combinatorial proof is also welcome, as are other kinds of proofs. When working with an image in Photoshop, I'd like to have a simple keyboard shortcut, like in , that automatically does:   Export > Export As or Export > Save For Web  Resize to biggest dimension = 600px (either width or height) Add suffix _600.jpg to filename   How to do that?  I'm not sure how to edit a recorded macro to do that (add the suffix and choose 600px for the biggest dimension).  Example: you open myphoto.png, you press F6 and then you automatically get myphoto_600.jpg. Return to 1st image on slideshow I am trying to route a pic32 chip to a  chip and having a bit of a hard time getting all 17 address lines and all 8 data lines connected. I am trying to tie the first 16 address pins to portB pins 0-15 and the data pins to portD 0-7.  After thinking about it for a while I realized that I am probably making my life more difficult by trying to line up rb0 with a0, rb1 with a1, etc. All I really want to be able to do is write a 16 bit value to portB and have the majority of the address loaded and ready. If I make pin assignments based on ease of routing, the logical address will be different between the mcu and the ram, but it should at least be consistent. Since nothing else needs to communicate with the RAM, I don't think it will be a problem if the mcu asks for address 0x101 and the RAM gives it address 0x110.   However, I wonder if it is a good idea. If there is some structure internal to the RAM designed to make sequential reads more efficient, or something like that, then I may want to go to the trouble of routing them 1:1. The pins arrangement on both chips fees somewhat random to me, so it would make it a lot easier on me if I could ignore the particular numbers. Is there any good reason why I should or should not do that? PlotRange precision limit? SQL Server compatibility with New TLS Standards The major browsers are moving beyond SSL3.0 and TLS1.0 . The PCI Security Council has declared an end-of-life date for these protocols to be considered sufficiently strong encryption.   We need to move away from these protocols, to use newer and stronger ones. On Windows servers, you can very easily disable these old protocols, and instead offer only TLS1.1 or greater.  However, as noted , Microsoft SQL Server 2008 R2 and SQL Server 2012 (Standard, at least) both will not start if those lower protocols are disabled.  However, there are a growing number of versions of MS SQL Server.  There are SQL Server Standard, Business Intelligence, Enterprise, Express, Web, and Compact editions.  And of course there is SQL Server 2008, 2012, 2014, and (in pre-release) 2016.  Which of these editions support or will support the use of only TLS1.1 or greater protocols? How can I prevent my mail from being classified as spam? Proving that $f(x)$ is less than or equal to $1+\pi/4$ Suppose $f$ is a real valued differentiable function defined on $[1,\infty)$ with $f(1)=1$. Suppose also that $f$ satisfies $$f'(x)=\frac{1}{x^2+f^2(x)}.$$ The question is to prove that $f(x) \leq 1+\pi/4$ for every $x \geq 1$    I tried to solve the differential equation but could not bring it in some known form. I examined the derivative of $\tan^{-1}x$ which looks similar to that  in the question. However I could not get any idea with that. Any help shall be highly appreciated. Thanks. I want to buy a new notebook in the near future to play games on it. I'm looking forward for the new Steam for Linux client. My question is that where does the Steam install the games, on the home partition, or in the usr folder, or somewhere else? I do not use pre-release (i.e. beta) versions of either Steam or Ubuntu. Area of a quadrilateral proof