How to use Read command in shell script while run script on remote machine
Select Command not working while run shell scripts on remote machine
My iPhone 5 won't boot anymore and when I plug it in my MacBook, it goes to recovery mode (cable logo => iTunes logo).  So I tried to restore it using iTunes but I keep getting this error    Any idea how to fix it?  While it was plugged in I tried holding power + home, it reboots the device and goes back to recovery mode and then any restore attempt results in a 2001 error as well. When it's not plugged in nothing will make it boot. How to apply custom headers/footers on pages with new chapters? I'm writing my final report in LaTeX for my bachelor's degree. I'm aiming at having a document similar to the .doc template used normally.   I want to have my customs headers and footers applied on pages when I'm starting a new chapter.  I'm using documentclass report with fancyhdr and lastpage packages.  My headers are defined like this:  \lhead{\myTitle} \rhead{\today} \cfoot{\thepage\ of \pageref{LastPage}}   My chapters are created using standard \chapter{title} macro.  On pages with new chapters, the only headers/footers I see is the standard page number at the bottom.  What should I do?  EDIT: I've finally gone with Peter Breitfeld's solution. I'Ve gone a step further and created my own chapter command:  \newcommand{\myChapter}[1]{     \chapter{#1}     \thispagestyle{fancy} }   Thanks for the help! Why do we notate the greatest common divisor of $a$ and $b$ as $(a,b)$? In my textbook on elementary number theory from a class last year, as well as elsewhere through my academic experience and even posts here, I often see the greatest common divisor notated as $(a,b)$ (where this represents the greatest common divisor of $a,b$).  My question is, why is such an unusual notation used? I say it's unusual (if not a bit absurd), for a couple of reasons:   It is unintuitive. It does not grant the reader an immediate knowledge of what it means. In particular, I can easily see it being misinterpreted as an ordered pair of points, and not as a function (which it basically is and I touch on in a second) or representing a single value. Good notation would be immediately understood, no? One should not struggle with parsing through the context or meaning. A clearer notation is often used, and just three letters away. You could certainly think of $(a,b)$ as an ordered pair, if we consider it a function. I often see the alternate $gcd(a,b)$: a function, which takes in two inputs ($a$ and $b$), and outputs their greatest common divisor (or factor, if you prefer). Merely adding the three letters makes the notation clearer by clarifying it is  a function, and using a relatively well-accepted acronym. (Or, at least, I often hear it abbreviated "g.c.d." in school.)   I've mulled this over for a while and I can't think of much without borrowing inspiration from other "unusual" notations. For example:   Common understanding in context: consider the $\log(x)$ function. Depending on context, without a base stated as seen here, it can be presumed to mean whatever is most "appropriate." It could be base $e$ (common in mathematics), base $10$ (common in engineering), or base $2$ (common in computer science). The ambiguity is essentially resolved by context in other words - personally, not a fan of that (I like the explicit stating of bases for full clarity), but if such a motivation holds elsewhere, it might stand to reason that $(a,b)$ could just be taken as a shorthand and "understood" in the context of number theory to simply be the greatest common divisor. That it is in fact used despite $gcd(a,b)$ being clearer and somewhat common also does seem to suggest this playing a role. Perhaps it just started that way and it kept being used. For example,  (based on a ) regarding how logarithms, roots, and exponentiation can be unintuitive from a notation perspective, and proposes an alternative, easier to understand notation. I haven't been in middle school in nearly a decade, but guessing from discussions online, that obviously hasn't really picked up too much. In that sense, perhaps it's like that for $(a,b)$: like we still notate exponentiation, etc., the same way today despite how counterintuitive it is (at least for students), perhaps it just "stuck" and proliferated?   I wasn't able to easily find any reason why online, and it bugs me a bit, so I ask:     Why do we so unintuitively notate the greatest common divisor of two numbers $a,b$ as $(a,b)$?   I of course recognize that this is somewhat moot in light of how easily it's made clear - as established above, all I have to do is append the front of the parenthetical by $gcd$ or $gcf$ to make it way better. And of course, people do that. But I'm more curious in where this ambiguous former notation arose and, in light of a better notation, why it is still used today. Generics and inheritance: need a complex Map instance How do I label equations without the chapter number? Word for a male that prefers female companions (no slang such as "pimp") Simpler proof - Non atomic measures Suppose that $(X,\mathcal{E},\mu)$ is a non-atomic finite measure space (i.e. for every $E \in \mathcal{E}$ with $\mu(E)&gt;0$ there exists $F \subset E$ measurable such that $0&lt;\mu(F) &lt;\mu(E)$.)  a) Prove that for every $ \varepsilon &gt;0$ there is a finite partition of $X$ in measurable subsets $X_1,..,X_n$ such that $\mu(X_i)\leq \varepsilon$.  b) Prove that for every $\alpha \in [0,\mu(X)]$ there exists $E \in \mathcal{E}$ with $\mu(E)=\alpha$.    I guess that a) is given to prove b) more easily. I have the following idea of solution for a) (inspired from , which proves b)  )  Denote  $$ \Gamma = \{ (X_1,..,X_n) : n &gt;&gt; \mu(X)/\varepsilon, X_i \text{ are disjoint }, \mu(X_i)\leq \varepsilon \}$$ ordered by componentwise inclusion. Totally ordered parts $(Y_\alpha)$ of $\Gamma$ have an upper bound element $(\bigcup Y_\alpha^i)_{i=1}^n$ which is still in $\Gamma$.   By Zorn's lemma $\Gamma$ has maximal elements. If a maximal $(X_1..X_n)$ element is not a partition, then we can replace it with something better, of the form $(X_1,..,X_n\cup A)$ where $A \subset X \setminus (X_1 \cup..\cup X_n)$ and $\mu(A)&gt;0$.     My questions are:  1) Is my solution of a) correct? I feel that the part with the upper bound element may not work, since there might be noncountable unions.  2) What is a simpler solution of a)? I've allocated an "array" of mystruct of size n like this:  if (NULL == (p = calloc(sizeof(struct mystruct) * n,1))) {  /* handle error */ }   Later on, I only have access to p, and no longer have n. Is there a way to determine the length of the array given just the pointer p?  I figure it must be possible, since free(p) does just that. I know malloc() keeps track of how much memory it has allocated, and that's why it knows the length; perhaps there is a way to query for this information? Something like...  int length = askMallocLibraryHowMuchMemoryWasAlloced(p) / sizeof(mystruct)   I know I should just rework the code so that I know n, but I'd rather not if possible. Any ideas? What should a rational person accept as a miracle? This is question 2.9 #9 from Topics in Algebra by Herstein:     If $o(G)$ is $pq$ where $p$ and $q$ are distinct prime numbers and if $G$ has a normal subgroup of order $p$ and a normal subgroup of order $q$, prove that $G$ is cyclic.   Let $N$ denote the normal subgroup of order $p$ and $M$ denote the normal subgroup of order $q$. Here are a couple things I noted while exploring the problem:   $N$ and $M$ are cyclic, since they have prime order. $G = NM$ [1].   Any hints where to look next?    [1] Since $N,M$ are normal, $NM \le G$. Then $o(NM) \mid o(G)$, so $o(NM)$ is either $1$, $p$, $q$, or $pq$. The first three don't work because they force one of $N$ or $M$ to be $(e)$, so we have $o(NM) = pq$. Therefore, $NM = G$. I'm searching a way to append a group in Python.  It should behave exactly like the Append function (ShiftF1) works, all objects should be local and editable. The idea is to append a character (with rig etc.) via Python and not Link it (to be able to modify it without making everything local one by one).  Thanks Number of combinations of dice having different number of faces that add to $10$ A function $\textbf{face}_{\mathrm{sum}}$ that takes a vector  $f$ that represents the number of faces of each die, and a positive integer  $s$ , and returns the probability that the sum of the top faces observed is  $s$ .  For example, if $f=[3,4,5]$  and  $s≤2$  or $s≥13$ , $\textbf{face}_{\mathrm{sum}}$ returns $0$, and if  $s=3$  or  $s=12$ , it returns  $\frac13*\frac14*\frac15=\frac1{60}$  $\textbf{face}_{\mathrm{sum}}([2,4,4,6], 10)$  I tried to solve this but I can't find the formula to calculate the number of combination of die faces that add to $10$, as the number of faces are different for each die.  Since max no of possible combination is $6*4*4*2=192$, all I need to find is the number of combination of die faces that add to $10$.  Thanks in advance. Conjugation: Do we cite authors or papers? When referencing to another work in a scientific paper, do we cite the paper or its author(s)?  This question is intended to clarify the conjugation of the verb that follows the reference -- especially in these cases:   One author, two papers:     Jane Doe (2015a, 2015b) list-s the very specific conditions under which...   -> lists (singular: referencing to Jane Doe) or list (plural: referencing to both papers) Several authors, one paper:     John Doe, et al. (2015) claim-s this and that.   -> claim (plural: referencing to the multiple authors of the paper) or claims (singular: referencing to the single paper). \nameref breaks for the star versions of section, paragraph when titlesec is loaded. I have a document that numbers paragraphs by default, but I have a few I do not want to number but would like to refer to. These are marked with \paragraph*, however, if the titlesec package is loaded at the same time, it causes nameref to display an empty string (the link box of hyperref is still visible).  MWE:  \documentclass[12pt]{article} \usepackage[sf]{titlesec} %comment this out and it works fine. \usepackage{hyperref} \begin{document} \section{Sections} \label{sec} This is \nameref{sec} \paragraph{A named Paragraph} \label{par} This is \nameref{par} \paragraph*{A starred named Paragraph} \label{par:star} This is \nameref{par:star} \end{document}   I suspect titlesec causes this defect for ALL star variants of sectioning commands but have not tested this. For me only paragraph* is relevant however a fix for all variants would be the best.  I have a hunch it might be related to this:  however this happens to go way beyond my latex knowledge and is just "magic" for me. How to get the caret column (not pixels) position in a textarea, in characters, from the start? How do you get the caret position in a &lt;textarea&gt; using JavaScript?  For example: This is| a text  This should return 7.  How would you get it to return the strings surrounding the cursor / selection?  E.g.: 'This is', '', ' a text'.  If the word “is” is highlighted, then it would return 'This ', 'is', ' a text'. Factorial Inequality problem $\left(\frac n2\right)^n > n! > \left(\frac n3\right)^n$ I met an inequality, I ask, do not mathematical induction to prove that:     Prove \[ \left(\frac n2\right)^n > n! > \left(\frac n3\right)^n \] without using induction How do I install nVidia graphics drivers from “X-Swat” ppa? How am I supposed to install nvidia drivers from xorg-edgers? I try  sudo add-apt-repository ppa:xorg-edgers/ppa -y sudo apt-get update sudo apt-get install nvidia-graphics-drivers-331   and I get  E: Unable to locate package nvidia-graphics-drivers-331   The   nvidia-graphics-drivers-331 for trusty, why wouldn't it install? How do I boot into recovery mode? Reproject GeoJSON from EPSG:3857 to EPSG:4326 Unable to format internal drive as APFS on 2018 MacBook Pro I’ve recently ran a semi-routine clean install on my 2018 MacBook Pro. This involves the following steps (in the given order):   Creating a USB installer with the latest macOS Mojave 10.14.2. Booting into the USB (Pressing Option key on boot). Using the Disk Utility, erasing the Disk and formatting it as APFS with a GPT Partition scheme. Using the Terminal, unmounting the disk diskutil unmountDisk disk0, where disk0 is the internal NVME drive. Using the Terminal, running gpt destroy disk0 where disk0. Using the Terminal, running diskutil zeroDisk disk0. Once that process is complete, I use the Disk Utility application to reformat as APFS, and install macOS.   Nothing super crazy, maybe a little redundant in steps, maybe a little overkill, maybe a little unnecessary.  Recently, however, on the final step where I format it as a APFS drive, it fails in creating the APFS container and says Internal State Error. It appears to first format as Mac OS Extended (Journaled) then create an APFS container, then add a APFS Volume. It fails when adding a Volume with An internal error occurred.  I have tried many things, including:   Securely erasing the drive diskutil secureErase 0 disk0. Simply zeroing the disk again diskutil zeroDisk disk0 (I’m not sure what the actual difference between these two are). Reformatting the drive as other things, such as ExFAT / FAT / MacOS Journaled, then trying to format as APFS. Reformatting the drive through the command line instead: diskutil eraseDisk JHFS+ NAME disk0 → diskutil apfs createContainer /dev/disk0s2 → diskutil apfs addVolume disk0s2 APFS NAME (It fails here with Error starting APFS Container creation: The given disk is not an APFS Container Reference (-69630), even though I just made a container there. Also, trying to add a volume to where it actually made the container (i don't know what it does this) diskutil apfs addVolume disk24 APFS NAME also fails with Error: -69624: Unable to add a new APFS Volume to an APFS Container Reformatting the drive using this: diskutil eraseDisk APFS NAME disk0 Restarting and trying these again. Using a different installer than the USB (The one from Command + R, Command + Shift + R, and whatever the other combo is), and trying these again.   All end up at the same thing - the final step fails. I would expect especially after a secure wipe that the drive would be removed from whatever state it was put in, or that if it was a bug with the 10.14.2 installer, that it still wouldn’t happen again in the High Sierra installer. In Disk Utility, I’m left with the following structure:  - APPLE SSD AP(...) // “Container disk24” takes up all space      - Container disk24 // or some other number. “Used” is 207.2MB and “Free” is 1TB.   Please note even though I can format as JHFS+, it won’t let me install the OS to such a formatted volume. The installer tells me this computer forces me to only install on APFS formatted volumes.  Any direction is greatly appreciated. I have never had such a silly problem before. Also, note that I have no Time Machine backup.