Can't get Python regex backreferences to work
Issue with regex backreference in Python
Consider a text file with the following entries:  aaa bbb ccc ddd eee fff ggg hhh iii   Given a pattern (e.g. fff), I would like to grep the file above to get in the output:  all_lines except (pattern_matching_lines  U (B lines_before) U (A lines_after))   For example, if B = 2 and A = 1, the output with pattern = fff should be:  aaa bbb ccc hhh iii   How can I do this with grep or other command line tools?    Note, when I try:  grep -v 'fff'  -A1 -B2 file.txt   I don't get what I want. I instead get:  aaa bbb ccc ddd eee fff -- -- fff ggg hhh iii How do I install software using the Ubuntu Software Center? The title says it all. I'd like to know how I can install software - an example is the Chromium web browser. How to delete (invalid) files with colon in their name under Windows? Adding a comment should not make me fail the review audit Casting two cantrips, both modified by metamagic? Can you cast one cantrip, modifying it with "Twinned Spell" (Fire Bolt) to target 2 creatures, and then cast another cantrip as a Bonus Action (Fire Bolt), using "Quickened Spell" to target one of the previous creatures or another creature? How to Install Octave in El Capitan? Installing Cygwin packages from the command-line How do American English and British English use the definite article differently? I decided to make sure that I know this important difference between American and British English, so I wrote what I have found out so far and I would be grateful to anyone who reads this and tells me whether I am wrong, or not.  In British English when people say  to hospital or in hospital when  talking  about somebody being there as a patient they don't use the definite article : "I had to go to hospital", "She spent two weeks in hospital". And the meaning is that somebody was there as a patient.   If then for some other reasons British English speakers  will use the definite article which will change the meaning itself, I noticed that, in American English, native speakers often use the  the and if they need to show that somebody is in church to pray,  in school as a student, in hospital as a patient, in prison as a prisoner, they use 'in' and not 'at'. Do American English speakers use 'at' like British English speakers use 'the' to give the sentences a different meaning?    Are my sentences correct? Do they show American English usage?   He is in the school. (enrolled as a student) He is at the school. (for some different reasons) He is in the hospital. (as a patient) He is at the hospital. (visiting somebody) He is in the church. (to pray) He is at the church. (for some different reasons) He is in the university. (as a student) He is at the university. (not as a student) He is in the college. (as a student) He is at the college. (Not as a student) He is in the prison. (as a prisoner) He is at the prison. (not as a prisoner) "Stack Overflow requires external JavaScript from another domain" message is error 404  Well, it seems that Wget picks it up so the last statement is false and the exact message is:  Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.   and it loads in Chrome once after I clear the cache but not after. Radial Schrodinger equation with inverse power law potential Recently I read a  about solving radial Schrodinger equation with inverse power law potential.  Consider the radial Schrodinger equation(simply set $\mu=\hbar=1$):  $$\left(-\frac{1}{2}\Delta+V(\mathbf{r})\right)\psi(\mathbf{r})=E\psi(\mathbf{r}).$$  A  gives a one-dimension equation:  $$-\frac{1}{2}D^2\phi(r)+\left(V(r)+\frac{1}{2}\frac{l(l+1)}{r^2}\right)\phi(r)=E\phi(r),$$  where $D=\dfrac{d}{dr}$, and $l$ is the azimuthal quantum number.  If we only consider the ground state, then $l=0$, so  $$-\frac{1}{2}D^2 \phi(r)+V(r)\phi(r)=E\phi(r).$$  We want to find eigenvalue $E$ such that $\phi(0)=\phi(+\infty)=0$.  The central potential discussed in the paper is of this form:  $$V(r)=\alpha r^{-\beta}.$$  It states (see page 4) that if $\beta&gt;2$ then the potential is repulsive (i.e. $\alpha&gt;0$).  My questions are:    Is this conclusion (i.e. If $\beta&gt;2$ then we must have $\alpha&gt;0$) generally valid in physics? What would happen if $\alpha&lt;0$ and $\beta&gt;2$? Is there 'ground state' in this condition? What about the condition $\alpha&gt;0$ and $\beta=1,2$? I have tried to solve the equation numerically with $\alpha=1,\beta=1,2$, and the ground state energy in this two conditions seem to be $0$, is my result correct?   P.S. When I try to find ground state when  $\alpha=-1,\beta=2$, the energy seem to be $-\infty$, which is qualitatively different from $\alpha=-1,\beta=1$. Definition of Statistic I keep seeing conflicting definitions of a statistic. Is a statistic a random variable such that it is a function of the random variables of a random sample? Or is it the value of the function of the random sample, after each random variable of the random sample has taken on a specific value?   $$(1) \ S=f(X_1,X_2...X_n)$$  $$(2) \ s=f(x_1,x_2...x_n)$$  I haven't been able to get any clarification for this and I've seen the term statistic describe both situations What is Deviance? (specifically in CART/rpart) What is "Deviance," how is it calculated, and what are its uses in different fields in statistics?  In particular, I'm personally interested in its uses in CART (and its implementation in rpart in R).   I'm asking this since the  seems somewhat lacking and your insights will be most welcomed. If $[\cdot]$ denotes greatest integer function, then what is the value of natural number $n$ satisfying the equation $$[\log_21]+[\log_22]+[\log_23]+\dots[\log_2n]=1538 ?$$   My try:  Note that  $$0+1\times2+2\times2^2+3\times2^3+4\times2^4+5\times2^5+6\times2^6+7\times2^7=1538$$  But the answer is $$n=\sum_{i=0}^72^i=255.$$  How is it derived? I'm creating a model for a 3D game that will eventually be exported using a custom Python script. This model makes heavy use of UV textures.  However, the project now references a bunch of images that are not used by any objects in the project. Example:    I don't want the first two, or the red_bubble.png image. However, I have no idea how to remove them from the project. Selecting one of them reveals that there are "2 users of the data" although I am not using it anywhere.  How can I get rid of these excess images? Solving Hardy Weinberg problems I really fail to understand Hardy-Weinberg equilibrium and can't find an easy enough source of information.  Can you help me to understand Hardy-Weinberg equilibrium?  My goal is to be able to solve the following kind of problem     In a population with two alleles for a certain locus, B and b, the allele frequency of B is 0.7. What is the frequency of heterozygotes if the population is in Hardy-Weinberg equilibrium? Why AUC =1 even classifier has misclassified half of the samples? I am using a classifier which returns probabilities. To calculate AUC, I am using pROC R-package. The output probabilities from classifier are:  probs=c(0.9865780, 0.9996340, 0.9516880, 0.9337157, 0.9778576, 0.8140116, 0.8971550, 0.8967585, 0.6322902, 0.7497237)   probs shows probability of being in class '1'. As shown, the classifier has classified all of samples in class '1'.  True label vector is:  truel=c(1, 1, 1, 1, 1, 0, 0, 0, 0, 0)   As shown, classifier has misclassified 5 samples. But, AUC is:  pROC::auc(truel, probs) Area under the curve: 1   Could you please explain to me why it happens? Why is surface charge distribution uniform for a conducting sphere? Can't it be arbitrary? If the charge $q_1$ has to repel the charge $q_2$, the electric field has to go inside the conductor which contradicts the fact that electric field inside conductors is zero. Then why do the charges distribute themselves in a particular manner? Why can't they be distributed over a small place on the conductor? Euclidean geometry in non-inertial frame Does the command pwd in a shell script output the directory the shell script is in? I have 16GB RAM. Do I need 32GB swap?