I'm trying to do a two-lines-script to temporary set a specific nameserver. Therefore I just output 'nameserver XXX.XXX.XXX.XXX' to the /etc/resolv.conf file, because it gets overwritten next time anyways. The thing is, when I try to ask for the password via gksudo, I get an error because it tries to output the gksudo result to the file.  UPDATE:  My current file is now:  #!/bin/sh gksudo "bash -c \"echo 'nameserver XXX.XXX.XXX.XXX' &gt;&gt; /etc/resolv.conf\""   The command with sudo instead of gksudo and without the "" and \\ works as it should. Remains how to get it into the GUI prompt.
When using sudo to allow edits to files, I regularly get 'permission denied'.  For example, my mouse is jittery and sluggish, so I want to disable polling:  sudo echo "options drm_kms_helper poll=N"&gt;/etc/modprobe.d/local.conf   I'm prompted for a password, and then get:  bash: /etc/modprobe.d/local.conf: Permission denied   So I tried to do a temporary change to disable polling by using:  sudo echo N&gt; /sys/module/drm_kms_helper/parameters/poll   Yet again the system responded with:  bash: /sys/module/drm_kms_helper/parameters/poll: Permission denied   Any ideas?
Confidence bands for QQ line This question doesn't specifically pertain to R, but I   chose to use R to illustrate it.  Consider the code for producing confidence bands round a (normal) qq-line:  library(car) library(MASS) b0&lt;-lm(deaths~.,data=road) qqPlot(b0$resid,pch=16,line="robust")   I'm looking for an explanation of (or alternative a link to a paper/online document explaining) how these confidence bands are constructed (I have  seen a reference to Fox 2002 in the help files of R  but sadly I don't have this book handy).   My question will be made more precise with an example.  Here's how R computes these particular CI's (I've  shortened/simplified the code used in car::qqPlot)  x&lt;-b0$resid good&lt;-!is.na(x) ord&lt;-order(x[good]) ord.x&lt;-x[good][ord] n&lt;-length(ord.x) P&lt;-ppoints(n) z&lt;-qnorm(P) plot(z,ord.x,type="n") coef&lt;-coef(rlm(ord.x~z)) a&lt;-coef[1] b&lt;-coef[2] abline(a,b,col="red",lwd=2) conf&lt;-0.95 zz&lt;-qnorm(1-(1-conf)/2) SE&lt;-(b/dnorm(z))*sqrt(P*(1-P)/n)     #[WHY?] fit.value&lt;-a+b*z upper&lt;-fit.value+zz*SE lower&lt;-fit.value-zz*SE lines(z,upper,lty=2,lwd=2,col="red") lines(z,lower,lty=2,lwd=2,col="red")   The question is: what is the justification for  the formula used to compute these SE (e.g. the line SE&lt;-(b/dnorm(z))*sqrt(P*(1-P)/n)).   FWIW this formula is very different from the formula of the usual The successive difference of powers of integers leads to factorial of that power. Here's the formula:     $$\sum_{r=0}^{n}\binom{n}{r}(-1)^r(n-r)^n=n!$$   Can anyone give a proof of this result?  Note: The original question was to prove the more general     $$\sum_{r=0}^{n}\binom{n}{r}(-1)^r(l-r)^n=n!$$   for an integer $l$, which some of the answers address. Functions Which are non differentiable on a Given Set. I have recently read the famous Weierstrass Non differentiable function which is continuous everywhere but nowhere differentiable.     But now my question is:    Given a countable set $S (\subset \mathbb{R})$ , can we construct a function which is continuous everywhere but non differentiable only at points of S..?    My Attempt: If $S$ finite say, $S=\{c_1,c_2,...,c_n\}$ Then the following function is the desired one:$$f(x)=\sum_{i=1}^{n}|x-c_i|$$   But I cannot construct the function for a arbitrary Enumerable set $S.$     Can we generalize the question for an arbitrary set $S$? Please Help.  Thank you...!! have lived vs have been living Is it correct to say:     1) I've lived in London for five years.   Or      2) I've been living in London for five years.   I think second one is correct because we use present perfect continuous for actions started in past and is continuing in present. Create NSString by repeating another string a given number of times Map matching links and ideas? I'm using OpenStreetMap and its vectorial road network and I'd like to implement a map matcher algorithm.   Currently I'm able, for each GPS position, to retrieve the nearest road segment and calculate the projection of this position to that segment, like on this image (Red pin is the pure GPS position, in blue the mapped segment and in Green the mapped position):    However, due to the lack of accuracy of the GPS, sometimes the mapped position jumps from segment to another and can provide some inconsistent mapped position from time to time.  My current algorithm is very basic : from the pure GPS position, I get the nearest segment and decide that the mapped matched position is on this one. I know that this can be really improved.  I can imagine that taking the vehicle direction into account will improve the map matching but do you know any other approach that would enable me to improve my map matcher ?  I seek any link, and/or open source software? I'm creating a color object using the following code.  curView.backgroundColor = [[UIColor alloc] initWithHue:229 saturation:40 brightness:75 alpha:1];   How can I retrieve RGB values from the created color object? Prove $2^n-1$ is divisible by $(2^m-1)^2$ iff... Prove that for any $m,n\in\mathbb{Z}^+$, the number $2^n-1$ is divisible by $(2^m-1)^2$ iff the number $n$ is divisible by $m(2^m-1)$.  My work so far:  It's an if and only if statement, so the common approach is to split the proof into two "if then" proofs ($A\rightarrow B \text{ and } B\rightarrow A$).  Starting with $A\rightarrow B$, for a direct proof, I would assume $A$ and prove $B$. I can use the definition of divisibility:  Assume $n=m(2^m-1)k$ for some integer $k$  Then I need to prove that $2^n-1=(2^m-1)^2h$ for some integer $h$  So I'm thinking I need to start with the expression $2^n-1$ and transform it to $(2^m-1)^2h$, or vice versa, and I need to use the assumption $n=m(2^m-1)k$ somehow.  I notice that the LS of the equality contains the variable $n$ while the RS contains $m$, and the assumption relates $n$ to $m$, so that could be a way forward. For example, simple substitution gives $2^{m(2^m-1)k}-1$, but I'm not sure what I could do from here. Perhaps there's a divisibility theorem that could help?  Other things I notice: $2^n-1$ and $(2^m-1)^2$ are always odd. Also, the divisors in both cases are multiples of $2^m-1$.  Any help/hints appreciated. How does a fork bomb work? System settings is missing System settings is missing. I tried reinstall it as it mentioned , but it seems to be installed and deactivated. This problem occurred when I installed Elementary desktop environment and uninstalled it afterwards. Induced metric on a null hypersurface What is the best way to store fresh herbs like parsley or cilantro?  I find I have about the same luck with them whether they are left in a plastic bag or I put them in a cup of water. How to count the number of set bits in a 32-bit integer? Lock time not involved in MySQL slow query selection? I wish to analyze some read-write contentions problems on a very huge table where writes are very fast, less than 1ms in most case. The point is that the contention makes those write queries sometimes wait for the lock for a long time, i.e. hundreds of milliseconds. But the query itself remains very fast so it's not selected as a "slow query", which threshold is actually 10ms.  The only way to gather the information I need is to put à 0ms threshold so I can capture all queries, but it's not sustainable for more than 10mn on our production environment, where it would produce about 200MB of logs per minute.  In fact I can't understand why MySQL don't include the lock time, added to the execution time, for the slow query log selection process. At least, I wish there were an option for that.  Am I missing something ? Can I run Android apps on Ubuntu? Is it possible to run Android apps on Ubuntu? And I don't mean inside an emulator, but natively, as you would with any other application installed using the Ubuntu Software Center. My book uses the argument that the multiplicities of a few macrostates in a macroscopic object take up an extraordinarily large share of all possible microstates, such that even over the entire lifetime of the universe, if each microstate had an equal chance of being accessed, fluctuations away from equilibrium would never occur.  My question to this statistical proof is this: In the real world, is there really an infinitesimal but nonzero chance that macroscopic systems could access some of the more unlikely macrostates (e.g. heat transfer from a cold object to a hot object)? How to prove $n^5 - n$ is divisible by $30$ without reduction I am logging in to my Ubuntu Server using my username. Once I am logged in I am typing passwd command. Entering a new password but a second after getting following error messages:  passwd: Authentication token manipulation error passwd: password unchanged   What is wrong here? How can I change my password otherwise if I don't have access to that server physically, i.e. I am connecting remotely with ssh using terminal. Is there a word for the sadness over "What might have been"? Context: You made the decision not to see a person any more. The relationship was good, you were both happy with one another but the one main stumbling block (for you) in the relationship was never dealt with. It remained, a permanent fixture, that forced you to make that sad, and final decision.   Is there a word, an idiom, or a famous line that expresses the sadness for something that might have been; e.g. a rich and fulfilling relationship. It's not nostalgia, because that expresses a wistfulness for the past.   Instead, you are wistful for the future. Traditional search-as-you-type on newer Nautilus versions Until now I was using a "traditional" version of Nautilus: that that comes with Ubuntu 10.10. Now I'm using 3.6.3, included with Ubuntu 13.04 (most likely any recent version is equivalent for the scope of my question, anyway).  One major difference between the two is the search-as-you-type behavior: in classic versions of Nautilus, when you typed an input, the file with the closest alphabetical match would become the selected one, the eligible files/folders being restricted to the current directory.  The new behavior is to perform an optionally-global search instead.  Can one configure Nautilus to provide the previous functionality ?