I would like to "parse" some list of web pages (html), the "parsing" is only about redirecting what's between &lt;title&gt; &lt;/title&gt; tags to some specific files. Firstly I did for cycle with wget, secondly came to conclusion (with time of course) that curl is a bit faster in this case.  So it looks like:  for page in $(cat source.txt) do  echo "$(curl -s https://somewebpage/some_sub_page/$page \  | grep '&lt;title&gt;' -A2 | sed -n '2p')" &gt; tmp/$page/index done    And all these subpages contain info I'm interested in on the line after &lt;title&gt; ,  like here   &lt;title&gt; ... &lt;/title&gt;   so I'm just applying common shell tools to reach the result.  What's my question. With ~400 pages it takes extremelly a lot of time to load the whole page, then to grep it and so on. Is there some more sofisticated solution to load for e.g. only first 10 lines of html document? I rely on classic bash utilities (curl, wget), but you can recommend what you think fits better in this issue.  UPD: maybe it's not the perfect solution, but adding head after curl decreased script's time in 2 times. (duplicate)
I am downloading the HTML source page of a website using cURL command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a way to stop the download of the page after first few lines?  Currently, I have the below command working but it does not seem to be time effective.   curl -r[0-1] "http://www.freebase.com/m/045c7b" &gt; foo.txt   I tried changing the value from 1 to .5 and .05 and still the entire web page is getting downloaded.   I am looking at time less than a second to execute the above command.    EDIT  From the man page of cURL, I see that "You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document." So if the server is not supporting the range querying, is there some other command in nix environment which will help me accomplishing what am trying to do?
I have an Android phone that connects with my computer via MTP. This works fine; I can see and transfer files with Nautilus. However, I often want to use the terminal to move large numbers of files, and I cannot seem to find the device anywhere in the filesystem tree. Nautilus reports the location as mtp://[usb:003,007]/, but it's not under /media or /mnt.  Does anyone know where it is? Google Analytics: How can I track between http:// and https:// profiles for a domain? Are the square roots of all non-perfect squares irrational? Differentiability of $g:=f(\sqrt{x^2+y^2})$ for a $C^1$ function with $f'(0)=0$ NBHM $2008$ Let $f:\mathbb{R}\rightarrow \mathbb{R}$ be a continuously differentiable function such that $f'(0)=0$.  Define for all $x,y\in \mathbb{R}$,  $$g(x,y)=f(\sqrt{x^2+y^2})$$ Pick out the true statements :   $g$ is differentiable on $\mathbb{R}^2$ $g$ is differentiable on $\mathbb{R}^2$ if and only if $f(0)=0$ $g$ is differentiable on $\mathbb{R}^2- \{ (0,0)\}$   I do not have much idea of differentiation of multivariable calculus.  I just tried out some examples to get some idea..  I have to take some function whose derivative at $0$ has to be zero.  for simplicity I would take $f(x)=x^2$ Then I would get :     $g(x,y)=x^2+y^2$ which is differentiable on $\mathbb{R}^2$   This would suggest me that second option has more chances as $f(0)=0$ in this case.  I would now take $f(x)=x^2+1$ then :     $g(x,y)=x^2+y^2+1$ which is differentiable on $\mathbb{R}^2$ though $f(0)\neq 0$   So, I would now eliminate second option and third option also...  So, It is now got confirmed that i have to work out to "Prove" that first option is correct.  Now, I have to prove that $g(x,y)=f(\sqrt{x^2+y^2})$ is differentiable.  I have to look for partial derivatives first :  $$\frac{\partial g}{\partial x}= f'(\sqrt{x^2+y^2}).\frac{2x}{2\sqrt{x^2+y^2}}=f'(\sqrt{x^2+y^2}).\frac{x}{\sqrt{x^2+y^2}}$$  $$\frac{\partial g}{\partial y}= f'(\sqrt{x^2+y^2}).\frac{2y}{2\sqrt{x^2+y^2}}=f'(\sqrt{x^2+y^2}).\frac{y}{\sqrt{x^2+y^2}}$$  I have used here that $f$ is differentiable on $\mathbb{R}$  As $f$ is continuously differentiable, we have $f'$ is continuous and I know that :  $\frac{x}{\sqrt{x^2+y^2}}$ and $\frac{y}{\sqrt{x^2+y^2}}$ are also continuous.     As $f'$ and $\frac{x}{\sqrt{x^2+y^2}}$ are continuous So is the product $\frac{\partial g}{\partial x}=f'(\sqrt{x^2+y^2}).\frac{x}{\sqrt{x^2+y^2}}$      As $f'$ and $\frac{y}{\sqrt{x^2+y^2}}$ are continuous So is the product $\frac{\partial g}{\partial y}=f'(\sqrt{x^2+y^2}).\frac{y}{\sqrt{x^2+y^2}}$   So we have continuous partial derivatives for $g(x,y)$..  So, I am willing to conclude that:     $g(x,y)$ is  differentiable on $\mathbb{R}^2$   I would be thankful if some one can confirm if the answer correct.  I would be much more thankful if some one can let me know if there are any gaps in my argument.  This is just a proof verification Question..  Thank you. How would I find a minimum weight spanning tree for W? If $\sum a_n$ converges and $b_n=\sum\limits_{k=n}^{\infty}a_k $, prove that $\sum \frac{a_n}{b_n}$ diverges Let $\displaystyle \sum a_n$ be  convergent series of positive terms and set  $\displaystyle b_n=\sum_{k=n}^{\infty}a_k$ , then prove that $\displaystyle\sum \frac{a_n}{b_n}$ diverges.   I could see that $\{b_n\}$ is monotonically decreasing sequence converging to $0$ and I can write $\displaystyle\sum \frac{a_n}{b_n}=\sum\frac{b_n-b_{n+1}}{b_n}$, how shall I proceed further? Multi-OS Portable TeX system I'm looking to treat myself to a totally portable TeX system and was wondering: is it possible to devise an installation scheme that would run on Windows, Linux and MacOS at the "same" time?  I think TeXLive is the best choice here, but I'd much rather avoid having to maintain three separate TeXLive installations. I'd like the three installations to share the package databases for instance.  I'll be using a 32Gb USB stick, in case it matters.  PS: I think I'm onto something here... will post back when I have a working prototype.  Edit: after reading  I managed to format a USB stick with UDF and have it read and written in Linux and Windows (need to perform some tests on Mac yet). This is the first step towards interoperability.  Edit 2: well, as it turns out, the previous note was useless (the partition table breaks under Windows), I've found  and it works like a charm. The only remaining step is writing a couple of scripts to set the environmental variables and we're done ;) Error: could not start the command in Texmaker when I run makeindex I'm trying to create a nomenclature but I'm getting the following error when I run makeindex:     Error: Could not start the command   This error appears even with this basic example:  \documentclass{article} \usepackage[refpage]{nomencl}  \makenomenclature  \begin{document} Example of nomenclature \nomenclature{A}{Area}  \printnomenclature \end{document}   In the Configure Texmaker editor I wrote: makeindex %.nlo -s nomencl.ist -o %.nls in the makeindex slot. Then I run:   PdfLaTeX MakeIndex   And the error appears... I also tried all suggestions , but nothing seems to work.  I have installed MacTex 2012 distribution, Mac OS X 10.7.5 Why isn't there a continuously differentiable surjection from $I \to I \times I$? I was asked this question recently in an interview. Why can't there be a a continuously differentiable map $f \colon I \to I \times I$, which is also surjective? In contrast to just continuous, where we have examples of space filling curves.  I have one proof which is direct via Sard's theorem. But the statement seems simple enough to have a proof using at most implicit (and inverse) function theorem. As of now, my desktop has begun showing the contents of my home folder (~) instead of the contents of ~/desktop. I must have changed something, but I have no idea what, or what I was doing exactly when it happened.  How do I re-point gnome to the right folder?  I'm running Ubuntu 11.04. "24 hours' notice" or "24 hours notice"? Which one is correct?  1: Well, you canceled on Tuesday and our policy is 24 hours' notice for all cancellations. 2: Well, you canceled on Tuesday and our policy is 24 hours notice for all cancellations.  To me personally, the first one makes more sense grammatically. But I've also heard that the second version is how they typically write it on paper forms at hospitals (that's what native speakers say). Could you please clarify my confusion? how many ways can the letters in ARRANGEMENT can be arranged How to login into PewDiePie's Tuber Simulator? I did one of the following and can't play PewDiePie's Tuber simulator with the progress linked to my account:   I logged out and can't login I logged out and tried to login in another device I tried to login on a second device without logging out My device broke and I can't login from another one I restarted my device / reinstalled the game and my progress didn't save   And possibly even:   I don't know how to login I forgot my login name and password   How can I fix each of these problems, and can I prevent them somehow? Is there a way to simulate a numeric keypad on apple wireless keyboard in OSX? I'm tempted to get an Apple Wireless Keyboard but the lack of a number pad is a concern. I'm interested whether there is some form of software you can use where for example you hold some control keys down and you can use a set of keys like the following as a substitute numeric keypad:   7890 uiop jkl; m ./ When I write something like this:     I am a man that is doing these things.   Is it correct to shorten it like this?     I am a man doing these things.   And does it require commas? How can I compute the distance between two coordinates in TikZ? Given two points (defined, for instance using nodes), I want to compute the distance between them.   Is there some build in functionality in tikz to do this? If not, how can it be done using the mathematical engine?   The application I have in mind is to draw an circular arc centered at (a) and passing through some second point (b), where only (a) and (b) are known. Why is $ \overline{e^z} = e^\overline{z} $? How can you conjugate an entire function? $ \overline{exp(z)} $ I need an equivalent.  I thought this is only possible with complex numbers.   What is the proof for $ \overline{e^z} = e^\overline{z} $ ? (Please don't involve a power series here.) Prove convergence of the sequence $(z_1+z_2+\cdots + z_n)/n$ of Cesaro means Prove that if $\lim_{n \to \infty}z_{n}=A$ then:  $$\lim_{n \to \infty}\frac{z_{1}+z_{2}+\cdots + z_{n}}{n}=A$$ I was thinking spliting it in: $$(z_{1}+z_{2}+\cdots+z_{N-1})+(z_{N}+z_{N+1}+\cdots+z_{n})$$ where $N$ is value of $n$ for which $|A-z_{n}|&lt;\epsilon$ then taking the limit of this sum devided by $n$ , and noting that the second sum is as close as you wish to $nA$ while the first is as close as you wish to $0$. Not sure if this helps.... I am trying to setup a trace flag to debug. When I select User in the dropdown and try to find System in there. It doesn't show up. What can I do ? While talking about ships and countries, is it a good practice to use the feminine form?  For example:  "Her economy" - while referring to a country's economy "Her flag (or deck etc)" - while referring to a ship  Is this practice common? Is it used today?