Sed move line from n° 40 to 39 position
How do I move a line in a text file up or down by one line?
I'm totally new to Ubuntu/Linux, using Ubuntu Server at the moment. Just trying to  figure out something basic.   How can you tell where you are installing a program. For example I just installed Sphinx search engine by placing the tarball that I downloaded from their site to my:  /home/sphinx   directory. I created the sphinx directory to place that tarball in. Then I ran these commands:  tar xvzf sphinx-0.9.8.1.tar.gz cd sphinx-0.9.8.1/ ./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql   and then these:  make sudo make install   Now I have a lot of files sitting in the directory where I ran these commands. Is this my Spynx installation or did it install somewhere else?  In windows if you run an installer (.exe file) anywhere the program will still install in your C:\Program Files directory. Does something similar apply to linux where all programs are installed in a central place, or can you install programs anywhere on the system.  Questions   I would prefer to keep all my installed programs in one place so what is the right place for this in terms of best practice. In other words what is the Linux equivalent of C:\Program Files? And how does one always install at this location, is it just a matter of placing the tarball and running the install commands from this location? What about if I use sudo apt-get to install a package. How can I point to this location to tell apt-get to always install there? find examples of two series $\sum a_n$ and $\sum b_n$ both of which diverge but for which $\sum \min(a_n, b_n)$ converges Find examples of two series $\sum a_n$ and $\sum b_n$ both of which diverge but for which $\sum \min(a_n, b_n)$ converges. To make it more challenging, produce examples where $a_n$ and $b_n$ are positive and decreasing.  Edit: This problem is taken verbatim from Exercise 2.7.11 on page 68 of Abbott's Understanding analysis. I've recently run into a proof that claims that $1 - 1 + 1 - 1 + 1 - 1 ... = \frac{1}{2}$ that proceeds as follows:     Let $S = 1 - 1 + 1 - 1 + 1 - 1 + ...$. Then $$S = 1 - (1 - 1 + 1 - 1 + 1 - 1 ...) = 1 - S$$ Therefore, $2S = 1$, so $S = \frac{1}{2}$. QED   I was under the impression that this sum doesn't converge, and therefore this step of the proof is invalid:     Let $S = 1 - 1 + 1 - 1 + 1 - 1 + ...$   That is, it's not even valid to suppose that the sum is equal to some (implicitly real or complex) number $S$, and therefore the reasoning that follows is meaningless because $S$ doesn't exist and therefore has any properties we want it to have.  Is the reasoning I've given above correct? That is, is it correct for me to claim that the proof fails because $S$ doesn't exist?  (I've heard that there are techniques for evaluating divergent integrals by using complex analysis and Taylor series, so perhaps there's another way to prove that the summation is $\frac{1}{2}$; I just wanted to see whether my reasoning is sufficient to explain why this particular proof is incorrect. If the proof actually is correct, then I stand corrected!)  Thanks! JavaScript equivalent to printf/String.Format I'm looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() (IFormatProvider for .NET).  My basic requirement is a thousand separator format for numbers for now, but something that handles lots of combinations (including dates) would be good.  I realize Microsoft's  library provides a version of String.Format(), but we don't want the entire overhead of that framework. I would like to port Ubuntu Touch to a device that is currently not supported. What are the requirements for doing this and where do I begin? Javascript - Get Image height I need to display a bunch of images on a web page using AJAX. All of them have different dimensions, so I want to adjust their size before displaying them. Is there any way to do this in JavaScript?  Using PHP's getimagesize() for each image causes an unnecessary performance hit since there will be many images. Reprojecting MODIS Swath data to WGS84 using GDAL How to choose a circle for default stream in Google Plus? How can I choose a specific circle for the default stream in Google+ ? Many extensions don't work, and are not comfortable if using another PC. UEFI machine doesn't boot Ubuntu through NVRAM bootcatalog. How to fix? List comprehension rebinds names even after scope of comprehension. Is this right? Hyperref warning - Token not allowed in a PDF string Mclaurins with $e^{\sin(x)}$ To evaluate $e^{\sin(x)}$ I use the standard series $e^t$ and $\sin(t)$, combining them gives me:  $e^t = 1+t+\dfrac{t^2}{2!}+\dfrac{t^3}{3!}+\dfrac{t^4}{4!}+O(t^5)$  $\sin(t) = t-\dfrac{t^3}{3!}+O(t^5)$  $\therefore e^{\sin(x)} = 1+\sin(x)+\dfrac{\sin^2(x)}{2!}+\cdots+O(x^5)$  $\iff e^{\sin(x)}=1+\left(x-\dfrac{x^3}{6}\right)+\dfrac{\left(x-\frac{x^3}{6}\right)^2}{2}+\dfrac{x^3}{6}+O(x^5) = 1+x +\dfrac{x^2}{2}-\dfrac{x^4}{6} + O(x^5)$  In the last step, I only evaluate up to $\sin^3x$ term, everything above has a grade equal to or greater than $x^5$  However, I'm wrong. According to Wolfram, the series expansion for $e^{\sin x} = 1+x+\dfrac{x^2}{2}-\dfrac{x^4}{8}+O(x^5)$.  What did I do wrong? I can't seem to find what or where. "every" vs "each"? Would the latter be an issue with the funding body, when the project proposal and budget only covers the expenses for hiring one postdoc? Note: it is the supervisors who got the grants, not the postdocs themselves. Suppose I have a dataframe consisting of six time series. In this dataframe, some observations are missing, meaning at some timepoints all time series contain a NA-value. In R, one possible imputation package that can be used to impute time series data is Amelia. However, this package does not work for observations that are completely missing. Are there other ways to impute my data? For what it's worth, the amount of missing observations is less than 20% of all observations. Best Algebraic Topology book/Alternative to Allen Hatcher free book? Allen Hatcher seems impossible and this is set as the course text?  So was wondering is there a better book than this? It's pretty cheap book compared to other books on amazon and is free online.   Any good intro to Algebraic topology books?  I can find a big lists of Algebraic geometry books on here. On a very old thread on Maths overflow someone recommended that a person should read James Munkres Topology first, then you should read Allen Hatcher book.   It just seems like Rudin's book but crammed with ten times more material. I want to make some 3d models of pixel art. I started by adding a plane, adding a texture to it, added loop cuts to my plane, 15 loop cuts because it's a 16x16 texture, then I selected the blank faces and deleted them. As I extrude this plane, A &gt; E &gt; $0.1$, the texture messes up on the edge of the item, as shown below  Although not all faces mess up on the edge, a lot still do. I tried recalculating normals, unwrapping the object again, but I ended with the same problem, no change at all. Though I may have done it wrong, since I never did it before. I tried smart UV project and cube projection, but they just mess it up even more. Does anyone have a solution to this? "SELECT *" why is it an antipattern On multiple questions here and on stack overflow i saw people saying in the comments and answers that select * from table is almost always an antipattern without any explaination why. Althrough I can sort of deduce why it is an antipattern. I may be looking over a detail that someone else with better understanding of the issue noticed.  So here is my question, why people say that select * is an antipattern. How to show (or hide) a hidden file I wanted to add classpath to my JDK. While searching a way to do it I noticed everyone open .profile file using terminal. But when I want to open and edit it with a text editor I couldn't see that file in Home folder.  Can someone tell me why is this. And also if possible how can I access .profile in home folder the GUI way. I just posted on a closed question   How?  Side point:  I do not see any indication that the post is closed on the app