Compare/Difference of two arrays in Bash
Intersection of two lists in Bash
Earth moves how much under my feet when I jump? If I'm standing at the equator, jump, and land 1 second later, the  Earth does NOT move 1000mph (or .28 miles per second) relative to me,  since my velocity while jumping is also 1000mph.   However, the Earth is moving in a circle (albeit a very large one),  while I, while jumping, am moving in a straight line.   How much do I move relative to my starting point because of this? I  realize it will be a miniscule amount, and not noticeable in practise,  but I'd be interested in the theoretical answer. I'm unable to update nodejs, and I can't see why.  If I were to make a guess, I'd say that I have two repositories listed in apt-get, that both contain a nodejs package.  Here's what I've done:  Remove old version:  sudo apt-get remove --purge nodejs npm   Then, going by , I've run:  curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -   And then:  sudo apt-get install -y nodejs   I then run:  nodejs -v   Which returns:  v0.10.25   Can anyone explain what's going wrong? And how I can remedy this situation?  Many thanks. How do I test asynchronous Apex? This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  I'm testing asynchronous code - like Batch Apex, Queueable Apex, @future methods, or Scheduled Apex - and I'm getting unexpected results. It seems like portions of my code aren't running, or I'm getting confusing errors about batch invocations. How do I effectively test this kind of code? I'm writing a script and I would like to pass the results from bc into a variable. I've declared 2 variables (var1 and var2) and have given them values.  In my script I want to pass the results from bc into another variable say var3 so that I can work with var3 for other calculations.  So far I have been able write the result to a file which is not what I'm looking for and also I've been able to echo the result in the terminal but I just want to pass the result to a variable at moment so that I can work with that variable.  echo "scale=2;$var1/var2" | bc How to urlencode data for curl command? I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site.  I need to url encode the value to make sure that special characters are processed properly.  What is the best way to do this?    Here is my basic script so far:  #!/bin/bash host=${1:?'bad host'} value=$2 shift shift curl -v -d "param=${value}" http://${host}/somepath $@ Strange book where teen protagonist is sent to a warzone, uses illusory magic to grow male genitalia Open Attachment on Create of Child Record Revision history & community wiki links show the same page Often when I edit one of my answers, it's because I want to better address the original question. The only problem is that I can't see the original question while I'm editing my answer!  I'd love to see the original question text beneath the "answer edit" form. This way I could scroll down slightly to read it if I wanted to, or just ignore it if not.  Current workaround is to click the 'return to answer' link and hope that you remember to launch it in a new tab/window, then tab back and forth.    Imported from this uservoice item: Passing a varible from jQuery to PHP Are 7 hours enough time to leave the Brussels airport and go to the city center? Theorem:   If $x$ is a positive integer and  $x^3$ is even, then $x$ is even.   My Proof by Contrapositive:  I. Assuming that $x$ is odd, then I will show that $x^3$ is odd.  II. $x$ is odd, so $x$ can be expressed as $2k+1$  III. $(2k+1)^3$  IV. $2k(4k^2 + 6k + 3) +1$  V. Since $2k(4k^2 + 6k + 3) + 1$ is an integer, we can conclude $x^3$ is odd.  Did I go about this correctly? Should step V say "$2$ multiplied by an integer and added by $1$ is odd therefore we can conclude $x^3$ is odd"? Order of nested random effects in lme4 I just fit a model in lme4, and I'm wondering what the heck I fit...  I have individuals id, and each is measured pass/fail on items that can be described using two factors, f1 and f2. My theory says that id and f2 can interact. So I want to compare these models:  # f2 doesn't matter m1 &lt;- lmer(pass ~ f1 + (1|id), family="binomial")  # f2 is a fixed effect, doesn't interact with individuals m2 &lt;- lmer(pass ~ f1 + f2 + (1|id), family="binomial")  # f2 is a nested random effect, interacting with individuals m3 &lt;- lmer(pass ~ f1 + (1|f2/id), family="binomial")   First, am I right that there's a random effect of each level of f2, and each individual's level of f2 is partially pooled, depending on the number of observations for that individual?  Second, does it make sense to fit f2 as a fixed effect with random individuals nested within each level of f2? How does one write that?  Third, what's this, with f2 and id reversed in the formula? I typed it by accident, but now I want to understand it.  m3weird &lt;- lmer(pass ~ f1 + (1|id/f2), family="binomial") What is the most efficient way to deep clone an object in JavaScript? Let $b_n$ be a sequence which decreases monotonically to zero, prove $\sum b_nz^n$ converges for $|z|\leq 1$ and $z\neq 1$.  So I was able to prove it converges on the open unit disk in the complex plane, but except for a few special points on the boundary, such as $-1$ and $i$, where I was able to use the alternating series test, I can't seem to prove it converges in general on the boundary minus $z=1$.  I feel I have to somehow use the fact that all the numbers on the unit circle except $z=1$ rotate around and around as you raise them to higher and higher powers, thus you get the real and imaginary parts of your series to alternate between sets of positive and negative terms, but in a very irregular way for most initial angles.  I tried to simplify the problem by breaking the series into its real and imaginary parts, and then trying to prove they each converge separately, but I still can't prove either converges:  $$\sum_{n=0}^{\infty}b_ne^{n\theta i} = \sum_{n=0}^{\infty}b_n\cos(n\theta) +i\sum_{n=0}^{\infty}b_n\sin(n\theta).$$ Order of the Rubik's cube group Associated to the Rubik's cube is a group as described in this : $G = \langle F, B, U, L, D, R\rangle$. For example, the element $F$ corresponds to rotating the front face clockwise by $90$ degrees.  According to the article the order of the group is: $2^{27} 3^{14} 5^3 7^2 11$.  I have come across several places (for example ) where this order has been found by just counting various ways to arrange edges and such. Is there a nice way to compute the order by appealing to more "group theoretic" tools? Let's say I have code like this:  $dbh = new PDO("blahblah");  $stmt = $dbh-&gt;prepare('SELECT * FROM users where username = :username'); $stmt-&gt;execute( array(':username' =&gt; $_REQUEST['username']) );   The PDO documentation says:     The parameters to prepared statements don't need to be quoted; the driver handles it for you.   Is that truly all I need to do to avoid SQL injections?  Is it really that easy?  You can assume MySQL if it makes a difference.  Also, I'm really only curious about the use of prepared statements against SQL injection.  In this context, I don't care about XSS or other possible vulnerabilities. How to tell which row number is clicked in a table? Suppose that we do not know anything about the complex analysis (numbers). In this case, how to calculate the following integral in closed form? $$\int_0^\infty\frac{\cos x}{1+x^2}\,\mathrm{d}x$$ Ubuntu 17.10 Keyboard not working after login following upgrade from 17.04 (Gnome version)