Extract several lines from large text file
What's the best way to take a segment out of a text file?
Why do we use the base form of verbs instead of the past form in past tense questions? In regard to this , my question is similar but that answer is not clear. I want to know why we use base form of verb, e.g. 'go' to form the past tense instead of past form such as 'went'?     Question: Did you go to a bank?  (Why we use 'go' here, rather than 'went'?)   Answer: I went to a bank.   Am I confusing verb forms with tenses? Please note that I'm not a native speaker so some clarification or reference on this would be helpful. I have a video clip of a car driving by from left to right. My goal is to add a decal (mask) to the car door.  Right now I am painstakingly moving the mask via X and Y. Delete all but the most recent n file for each group of files that share the same prefix in a directory My question is a bit different from some older questions simply asking for "deleting all but the most recent n files in a directory".  I have a directory that contains different 'groups' of files where each group of files share some arbitrary prefix and each group has at least one file. I do not know these prefixes in advance and I do not know how many groups there are.  EDIT: actually, I know something about the file names, that is they all follow the pattern prefix-some_digits-some_digits.tar.bz2. The only thing matters here is the prefix part, and we can assume that within each prefix there is no digit or dash.  I want to do the following in a bash script:   Go through the given directory, identify all existing 'groups', and for each group of files, delete all but the most recent n files of the group only. If there are less than n files for a group, do nothing for that group, i.e. do not delete any file for that group.   What is a robust and safe way of doing the above in bash? Could you please explain the commands step-by-step? How can Zeno's dichotomy paradox be disproved using mathematics? A brief description of the paradox taken from :     Suppose Sam wants to catch a stationary bus. Before he can get there, he must get halfway there. Before he can get halfway there, he must get a quarter of the way there. Before traveling a quarter, he must travel one-eighth; before an eighth, one-sixteenth; and so on.      This description requires one to complete an infinite number of tasks, which Zeno maintains is an impossibility. This sequence also presents a second problem in that it contains no first distance to run, for any possible (finite) first distance could be divided in half, and hence would not be first after all. Hence, the trip cannot even begin.      The paradoxical conclusion then would be that travel over any finite   distance can neither be completed nor begun, and so all motion must be   an illusion.   How can this be disproved using math, as obviously we can all move a walk from one place to another? How many combinations are possible in the game tic-tac-toe (Noughts and crosses)?  So for example a game which looked like: (with positions 1-9)  A1   --   B1  A2   --   B2  A3   --   --   [1][3][4][6][7] would be one combination Thats my . I loaded this to PostgreSQL DB using PostGIS shape file loader. I ran pgr_anlayzeGraph() on it and found it had a lot of isolated segments.  Next I ran pgr_nodeNetwork() to create a new table 'ways_ways'. I made the topology  for it and ran the following query in Qgis sql window.   SELECT * FROM ways_ways JOIN (SELECT seq, id1 AS node, id2 AS edge, cost FROM  pgr_astar('SELECT id, source, target, cost, x1, y1, x2, y2 FROM ways_ways',  1, 108, false, false) )AS route ON ways_ways.id = route.node;   Given below are the screenshots: Original floorplan and the prescribed route  query ouput   Clearly , I don't have a continuous output. I ran pgr_analyseGraph on ways_ways to find that it has no more isolated segments . It has 51 deadends, which is acceptable.   Did I miss any step in pgrouting? Is there anyway to see which node has id 1 and id 108 in qgis?  i ran the same query in another map(which i downloaded) and got output for all possible source and target ids. So how can i create a way(a route) that is completely noded? How to animate noise texture "seed"? It's possible to animate a change noise texture by animating the texture coordinates with a mapping node or by animating the texture space, however this only works on one axis at a time (on the other axes the texture will appear to be sliding across the object's surface).  For example, the top face has the desired effect but the other faces appear to be moving/sliding upwards:    Even with all three axes location and rotation animated it still appears to be sliding rather than statically changing.    Is there some way to make each face appear like the top face in the first gif but still be seamlessly blended with the other faces? This should work for other shapes as well.  In other words, I'm looking for a way to animate the "seed" of the texture. I am looking for a book about "advanced" classical mechanics. By advanced I mean a book considering directly Lagrangian and Hamiltonian formulation, and also providing a firm basis in the geometrical consideration related to these to formalism (like tangent bundle, cotangent bundle, 1-form, 2-form, etc.).  I have , but I would like to go into more details about the [symplectic] geometrical and mathematical foundations of classical mechanics.  Additional note: A chapter about relativistic Hamiltonian dynamics would be a good thing. Does visiting Canada from USA under ESTA reset the visa waiver? Consider a common proof of the uncountability of $(0,1]$, as presented  for example:  We assume that the reals can be arranged in a sequence $x_k$, represent every number in $x_k$ by its nonterminating decimal expansion, use the diagonal argument to create a sequence of decimal digits that differs from the nonterminating decimal expansion of each number in $x_k$ and then claim that this sequence of digits so generated must be the decimal expansion of some number not in $x_k$.  My problem is with this last step. Could it not be the case that the new sequence of digits is just the terminating decimal expansion of some number already in $x_k$?  Would it not be more correct to use the sequence $x_k$ to generate a sequence of all (both terminating and non-terminating) decimal expansion of all numbers in $[0,1)$ and then apply the diagonal argument? In what cases I should skip 's in possessive case? Duplicate id in list My service is working fine for single record insert when i send bulk records at that time it showing soapenv:ClientSystem.ListException: Duplicate id in list: 01ti0000002gUP1AAM Class.Sample.behaviourOfWebService: line 235, column 1  the error line is Database.upsert(pList)     p.productCode = pCode;    p.name =pName;    pList.add(p);  } I can't seem to find an answer to this simple question, which I need for some compliance documentation.    On a default install of CentOS 6.5 (OpenSSH 5.3p1-94.el6), after how long of being idle will a user's SSH session be terminated?  I believe the following can be set to increase the idle timeout, but they are commented out by default.  $ grep -i alive /etc/ssh/sshd_config #TCPKeepAlive yes #ClientAliveInterval 0 #ClientAliveCountMax 3   Also, is there a command to dump a list of the current sshd settings?  I don't see anything in man sshd. External Styles in JasperReports I'm working on a system that includes a large number of reports, generated using . One of the newer features is that you can define styles for reports.  From the available docs I believe there is some way to have an external file defining styles to use, and you can reference that in your jasper reports. This allows a single style to be used by multiple reports.  I can't find any concrete information on whether this is an actual feature, and if it is, how to use it. Does anyone know if it is possible to have external styles for jasper reports, and if so, how to do it? Why is the observable universe so big? The observable universe is approximately 13.7 billion years old. But yet it is 80 billion light years across. Isn't this a contradiction? . While the reasons for his doing this are not yet public, this is a real loss of a valuable service. Does anyone know of similar services available to the general public?  Edit:  is definitely relevant, but that approach is more appropriate for finding top journals rather than identifying bottom ones. I.e., following that method would probably exclude lots of valid, lower-tier journals. Are there any approaches to easily identifying a predatory publisher? I'm confused about the use of symbols $\vdash$ and  $ \models$. Reading the answers to  and  I see that:  the turnstile symbol $ \vdash $ denotes syntactic implication. Then $ S \vdash \psi$ means that $\psi$ can be derived from the formulae in $S$  the double turnstile $ \models $, denotes semantic implication. Then the notation $A \models B$ means simply that B is true in every model in which A is true.  So I understand that, e.g., $(ZFC+ A) \vdash B$ means that $A \Rightarrow B$ is a theorem in ZFC and, in this sense $\vdash$ is a mathematical symbol for a theorem. While $(ZFC+ A) \models B$ means that $ B$ is true in every model of ZFC in which $A$ is true, and, in this sense $\models$ is not a mathematical but a metamathematical symbol.  I understand correctly? And those are the only uses of the two symbols? Geometric intuition of improper integrals I am aware that the area under the curve of $\frac{1}{x}$ is infinite yet the area under the curve of $\frac{1}{x^2}$ is finite.   Calculus and series wise, I understand what is going on, but I can't seem to get a good geometric intuition of the problem. Both curves can be shown to converge to $0$ (the curves themselves, not the area), and on the interval from $1$ to infinity, the two curves have nothing intrinsically different. Can someone please provide me with an good geometric intuition of what's going on? I can't find anything on the web, people seem to not want to explain it geometrically. Is it correct that "etc." can not be used together in a sentence with "for example" and "such as"? I just read an article from a Chinese website for English teaching which mentions  that point. For instance, one can't say:     "I can play quite a few musical instruments, for example, the flute, the guitar, the piano, etc.".    The correct one should be:     "I can play quite a few musical instruments, for example, the flute, the guitar, and the piano."    Is it possible to find any references to prove that? What are good learning resources for a LaTeX beginner? Which book (free or otherwise) was the most useful to you when you started learning LaTeX?  I am frequently asked this question by friends who want to learn LaTeX, and I recommend the book which got me started, , but I feel that there might be better options around.  Also see .