I have some text file (for example json). I can use head order for the reading of the first lines. For example:  head -n 100 file.json   get me 100 first lines back. What is Linux order, which I can use to read some general lines somewhere in file? For example from the line 500 to the line 700.
Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).  From what I understand I can do this by piping head into tail or viceversa, i.e.   head -A /path/to/file | tail -B   or alternatively  tail -C /path/to/file | head -D   where A,B,C and D can be computed from the number of lines in the file, X and Y.  But there are two problems with this approach:   You have to compute A,B,C and D. The commands could pipe to each other many more lines than I am interested in reading (e.g. if I am reading just a few lines in the middle of a huge file)   Is there a way to have the shell just work with and output the lines I want? (while providing only X and Y)?
While I was looking at the values of the zeta function for the first natural numbers, I noticed that the sum of the values minus $1$, converge to $1$. Better put: $$\sum_{n=2}^{\infty} \left(\zeta(n)-1\right) = 1 $$ Furthermore, if you use only the even numbers for the zeta function, the sum will converge to $\frac{3}{4}$, or $$\sum_{n=1}^{\infty} \left(\zeta(2n)-1\right) = \frac{3}{4}$$  Leaving $$\sum_{n=2}^{\infty} \left(\zeta(2n-1)-1 \right)= \frac{1}{4}$$  This is probably common knowledge among mathematicians, but I couldn't find much about it on the internet. Is there a proof of this or perhaps even a simple explanation why this is so? How to change LCD brightness from command line (or via script)? To work around  (changing LCD brightness via hotkeys impossible), I'd like to have one command line query for increasing and one for reducing the brightness of my LCD. I could then map a hotkey to each one of this queries.  The problem is: I don't know how to increase and reduce the LCD brightness on the command line. Do you? When I click the bounty info icon on the iOS app. The added bounty description and reason is not shown.  For example: What does "$$" mean in the shell? How to convert a single char into an int PDF of product of variables Could anyone please indicate a general strategy (if there is any) to get the PDF (or CDF) of the  product of two random variables, each having known distributions and limits?   My particular need is the following: Let $w :=u \cdot v$. The PDF of $u$ is $$\frac{1}{\pi u}\frac{1}{\sqrt{u^2-0.25}},$$ for $z&gt;0.5$ and the PDF of $v$ is $$\exp\left(-\frac{v}{v_0}\right),$$ for $v_1&lt;v&lt;v_2$. What's the PDF of $w$? Install suspension forks on non-suspension bike I have a 1990s Saracen PowerTrax. Is there a way I can install a suspension fork, or will that muck up the bike somehow? I'm actually interested in ways to raise the bars with respect to the seat, so that wouldn't be a problem. My toes rubbing in the wheel, in the other hand, would definitely be a problem. Limit of the geometric sequence $\{r^n\}$, with $|r| < 1$, is $0$? Prove that the $\lim_{n\to \infty} r^n = 0$ for $|r|\lt 1$.   I can't think of a sequence to compare this to that'll work.  L'Hopital's rule doesn't apply.  I know there's some simple way of doing this, but it just isn't coming to me. :( Tracking down where disk space has gone on Linux? Sci Fi action movie where an elite group of people control business through a game they play online I saw a movie where people are running from a group of powerful killers or a naughty company/organization.  A woman was hired to find the entity/company. A very overweight Asian man talks to them on line at one point. (When I say overweight, I mean 400 pounds plus)  He talks to a virtual dolphin and tells it he is sorry but he cannot play with the dolphin that day. Eventually, the people find the fat guy in real life. He is sitting on a Chinese style boat in a river (I think it was a river). (He is sitting in the rear of the boat. The boat is rather small. He is wearing a loin wrap like a sumo wrestler. In fact, I should most likely call him a sumo wrestler to describe the look.)  He had implants and wires coming out of his head like the Borg Queen did.  There is another part in the movie, where he replies to someones concern, saying, "I live a life of wonder..." (or something similar).  By the time the movie is over, the evil force has caused his death. A team of Yakuza style (might actually be the Yakuza) commandos tear through everything trying to stop the truth from being discovered. The huge Asian man ends up leaving little messages, like parts of himself, to guide the woman to the truth. The ending reveals the naughty company/organization is a group of elite power brokers that control business by playing a game. Corporations lose or gain ground over nothing more than the turn of a game. (Including totally going out of business or making a fortune from nothing.)  Do you have any idea what movie this was? Adding related resources or hyperlinks in edits So, I've been rejecting the addition of resources/hyperlinks to posts simply because I had no idea that this was an acceptable practice.  Today, I was browsing through the edits page and saw:     Some common reasons to edit are:         to fix grammatical or spelling mistakes   to clarify the meaning of a post without changing it   to correct minor mistakes or add addendums / updates as the post ages   to add related resources or hyperlinks      Why is this an acceptable practice?  I can see adding links to official documentation, but the quality of outside resources is (potentially) subjective.  I see the merit in adding resources, but it seems to me that these additional resources should be placed in comments, not inserted into the post via an edit.  Anyone have thoughts on this? Let $f: \Bbb C \to \Bbb C$ be an entire (analytic on the whole plane) function such that exists $\omega_1,\omega_2 \in \mathbb{S}^1$, linearly independent over $\Bbb R$ such that: $$f(z+\omega_1)=f(z)=f(z+\omega_2), \quad \forall\,z\in \Bbb C.$$Prove that $f$ is constant.   The intuition seems clear to me, we have the three vertices of a triangle given by $0$, $\omega_1$ and $\omega_2$. All points in the plane are one of the vertices of that triangle under a suitable parallel translation. The constant value will be $f(0)$, fine. Throwing values for $z$ there, I have found that $$f(n\omega_1) = f(\omega_1) = f(0)=f(\omega_2) = f(n\omega_2), \quad \forall\, n \in \Bbb Z.$$  I don't know how to improve the above for, say, rationals (at least). Some another ideas would be:   Checking that $f' \equiv 0$. I don't have a clue of how to do that. Write $w = a\omega_1+b\omega_2$, with $a,b \in \Bbb R$, do stuff and conclude that $f(w) = f(0)$. This approach doesn't seem good, because I only have a weak result with integers above. Finding that $f$ coincides with $f(0)$ on a set with an accumulation point. This seems also bad: the set on with $f$ coincides with $f(0)$ by which I found above is discrete.    Nothing works and this is getting annoying... And I don't see how analyticity comes in there. I'll be very thankful if someone can give me an idea.  (On a side note.. I know that this title is not informative at all. Feel free to edit if you come up with something better.) Which side of wave-particle duality to choose in a given situation Converting a list of tuples into a dict I have a list of tuples like this:  [ ('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('c', 1), ]   I want to iterate through this keying by the first item, so, for example, I could print something like this:  a 1 2 3 b 1 2 c 1   How would I go about doing this without keeping an item to track whether the first item is the same as I loop around the tuples? This feels rather messy (plus I have to sort the list to start with)... I would like to see my review audit history why could a check if (document.addEventListener) returns false Why is a subgroup with the index of 2 normal to the group?  I believe it has something to do with it being half and having nowhere to go. We know that if a finite field $F$ has characteristic $p$ (prime), then $F$ has cardinality $p^r$ where $r = [F:\mathbb{F}_p]$.   I'm now trying to say something about the possible cardinalities of subfields of $F$. I can see that there is a subfield of cardinality $p^s$ for each $s$ that divides $r$, given by the fixed field of the group generated by $\phi^s$, where $\phi$ is the Frobenius automorphism.  Now suppose $K$ is a subfield of $F$. Then (since both are additive groups), Lagrange gives us that $|K|$ divides $|F|$, so $|K| = p^t$ for some $1 \leq t \leq r $ (alternatively, $K$ contains $\mathbb{F}_p$ and so is a vector space over $\mathbb{F}_p$ and is thus isomorphic to $\mathbb{F}_p^t$, where $t = [K:\mathbb{F}_p]$). By considering the multiplicative group of units of $K$ and $F$ respectively, we get that $ p^t - 1$ divides $p^r -1$. I want to make the leap to $t|r$, but I'm failing to see why this needs to be true. Any help would be appreciated. What’s the rule for using “who” and “whom” correctly? Extract date from a variable in a different format Let me explain you the problem   $ date +%c -d "$d" Tue 31 Dec 2013 01:13:06 PM CET $ date +'Today is %F' -d "$d" Today is 2013-12-31   This solution corresponds to current date.  But I have one variable which stores date other than current date  $Prev_date="Wed Dec 25 06:35:02 EST 2013"    I am looking for solution to read this date as 2013-12-25 and store it in a variable.  I have tried this:  a=`date --date=$Prev_date '+%y/%m/d'` echo $a   It's giving this error:  date: illegal option -- date=Wed usage: date [-u] mmddHHMM[[cc]yy][.SS] date [-u] [+format] date -a [-]sss[.fff]