sed: unterminated `s' command The following sed command gives a sed unterminated `s' command. It has to do with the variable that I put in ($header): sed -i &quot;1s~^~$header~&quot; $1&quot;/main.cpp&quot;  The following is the contents of $header: // // Pacman.java // etc // // Created by ayman at 12/06/2021 // Copyright (c) 2021 Google. All rights reserved. //  In the sed command, I've used a different delimiter (~), but that still gives the error. Does anyone see what the problem is?
How to insert text before the first line of a file? I've been looking around sed command to add text into a file in a specific line. This works adding text after line 1:  sed '1 a\   But I want to add it before line 1. It would be:  sed '0 a\   but I get this error: invalid usage of line address 0.  Any suggestion?
Similarity of real matrices over $\mathbb{C}$ $A  \underset{\mathbb{C}}{\sim} B \overset{\text{def}}{\iff} A=C^{-1}BC, \space C\in M_{n}(\mathbb{C})$ and similarly for $\underset{\mathbb{R}}{\sim}$.     I want to prove that $ A \underset{\mathbb{C}}{\sim} B$ for $A,B \in M_{n}(\mathbb{R})$ therefore $A \underset{\mathbb{R}}{\sim} B$.   My idea is that elementary divisors of $A,B$ over $\mathbb{C}$ are the same, and if $(x-z)^k$ is elementary divisor than $(x-\overline{z})^k$ is also elementary divisor $\implies$ $A,B$ have same elementary divisors over $\mathbb{R}$. But i think it's not clear. How do I specify a pointer to an overloaded function? Mathematica creates a huge eps file Multiple workspaces on Ubuntu 18.04.1 LTS and later with GNOME Shell Any idea how to have more than 2 workspaces on Ubuntu 18.04.1? I just saw now that a new build had rolled out in which the comment upvote and flag options are always visible. Previously, one had to mouse over the area in order to see them.  Why was this just changed? Is it to support touch screens? I'll admit, it was difficult to find the flag button using my touchscreen laptop running Microsoft Edge.  Cross-site duplicate on MSO: Everywhere I get to read statements like EM radiations and EM fields carry "energy as well as momentum " . I wonder if energy and momentum are inalienable . Is it possible for a field to carry only energy without having any momentum term ? I mean isn't it sufficient to say that fields or EM waves carry energy or Doesn't the ability to transfer energy, of the fields, automatically imply that they can change the momentum of another particle while transferring energy to them? Is there a single word that expresses "music end-users / enthusiasts"? To help a soon-to-be sister site out , I was thinking English.SE perhaps could lend a helping hand as this is the best place for "word choice and usage".  I'm not looking for "naming", but rather want to see what shorter words exist for expressing "music end-users/enthusiasts", these could be "journalists, reviewers, music fans and listeners".  I've tried, but can't come up with something... . From Urban Dictionary I have  which is another word for a Music enthusiast of the Modern age; but yeah, it's UD and I don't think selvyn is really English to begin with...  So... do you know of a single word to express "music end-users/enthusiasts"? What is the best way to explain how to choose between "its" and "it's"? Probably one of the most frequent grammar mistakes in the English language is:     The dog sat on it's mat.   Since spelling checkers don't catch it, and it is even logical, since you would correctly write:     The dog sat on Fluffy's mat.   What is the best way to explain to a learner of English how to choose between it's and its? Prove that: area of triangle $S_{ABC}=p \cdot R$, where p is half perimeter of triangle $DEF$ Prove that: area of triangle $S_{ABC}=p \cdot R$, where p is half perimeter of triangle $DEF$. $AD,CF, BE$ are altitudes. Is there a simple way? How can I escape special HTML characters in JSP? I am Haitian, and traveling with a Haitian passport. I have to go to London with a work permit (tier 2 visa) on the 29th of July but I have 2 hour transit in Dublin.  Do I need a transit visa? Can I get it at the airport?  I also have a valid US visa. bash aliases equivalent for powershell? By default my Windows PowerShell starts in C:\Users\Santosh, my XAMPP installation is in D:\ so the htdocs folder is located at D:\xampp\htdocs. If I have to edit something in htdocs folder then I have to type full cd D:\xampp\htdocs\ (autocompletion is not so kind) then edit that file.  If this PowerShell were a Bash I would do this in .bash_aliases file:  alias htdocs='cd D:\xampp\htdocs'  Is it possible to maintain Bash aliases like file and alias any command in PowerShell? Why do we need multiple approvers for suggested edits? I already have the "Edit Questions And Answers" privilege. Yet, if I approve someone else's edit, I'm told that more votes will be required before the edit is accepted.  This seems a bit peculiar to me, since I could just copy the edited version and paste it myself. I have read many post about updating an iPad 1 (iOS 5.1.1) to iOS 8 but all I need at the moment is to update my iPad 1 to at least iOS 6. Is there any way I can update it to iOS 6? No jail breaking or anything, just a normal way of updating. I am on a Mac with MacTex 2020 and ran into a strange problem with Biber. Working on a document all was fine, I did not change the bibliography (says my git) and only fixing typos (not even adding cites) and suddenly latexmk stopped working after a Biber run, while that looked like  INFO - This is Biber 2.14 INFO - Logfile is 'doc.blg' INFO - Reading 'doc.bcf' INFO - Found 31 citekeys in bib section 0 INFO - Processing section 0 INFO - Globbing data source 'literature.bib' INFO - Globbed data source 'literature.bib' to literature.bib INFO - Looking for bibtex format file 'literature.bib' for section 0 INFO - LaTeX decoding ... INFO - Found BibTeX data source 'literature.bib'   so harmless in my view. Then with --debug I additionally get in the end.  INFO - LaTeX decoding ... warning: overriding existing definition of macro "jun" warning: overriding existing definition of macro "jul" warning: overriding existing definition of macro "sep" warning: overriding existing definition of macro "jan" [...] warning: overriding existing definition of macro "nov" INFO - Found BibTeX data source 'literature.bib' Unicode::UCD: failed to find unicore/version in /var/folders/hm/gt63cn0j2r7bwbzw7c1hww1r0000gn/T/par-626572676d616e6e/cache-2f8a664c3c933a44d096bcc8d018a5e92bced897/inc/lib /var/folders/hm/gt63cn0j2r7bwbzw7c1hww1r0000gn/T/par-626572676d616e6e/cache-2f8a664c3c933a44d096bcc8d018a5e92bced897/inc CODE(0x7fd026aeb5a8) CODE(0x7fd026aebb90) at /var/folders/hm/gt63cn0j2r7bwbzw7c1hww1r0000gn/T/par-626572676d616e6e/cache-2f8a664c3c933a44d096bcc8d018a5e92bced897/inc/lib/Biber/Input/file/bibtex.pm line 1011.   It seems unrelated to the library itself since deleting a few entries (going through deleting one half, then the other), the problem persists. It does not happen for an empty literature, but as soon as a first entry is added (just author/journal/title/year/volume/pages - no utf8-only chars) this error message appears.  what does this last error message mean?  How can I solve this? Fully charged MacBook Air turns off when power cord removed I have a MacBook Air, 2009, with a recently replaced Apple battery in December 2012. Recently, when power cord comes off, the computer shuts down. Also, it usually will not restart unless power cord is attached. How to assess the similarity of two histograms? Given two histograms, how do we assess whether they are similar or not?  Is it sufficient to simply look at the two histograms? The simple one to one mapping has the problem that if a histogram is slightly different and slightly shifted then we'll not get the desired result.  Any suggestions? Converting mobi files to pdf files I have a Hanlin V3+ e-book, unfortunately it crashes too often when reading mobi files, so I want to convert them first into pdf, and then read pdf on V3+. Is there any tool for converting mobi files to pdf files? Thanks. Q&A blank in Stack Exchange Android app v1.0.95 - S10e/Android 10 Proving the summation formula using induction: $\sum_{k=1}^n \frac{1}{k(k+1)} = 1-\frac{1}{n+1}$ I am trying to prove the summation formula using induction:  $$\sum_{k=1}^n \frac{1}{k(k+1)} = 1-\frac{1}{n+1}$$  So far I have...  Base case:   Let n=1 and test   $\frac{1}{k(k+1)} = 1-\frac{1}{n+1}$  $\frac{1}{1(1+1)} = 1-\frac{1}{1+1}$    $\frac{1}{2} = \frac{1}{2}$   True for n=1   Induction Hypothesis:   Assume the statement is true for the n-th case   $\sum_{k=1}^n  \frac{1}{k(k+1)} = 1-\frac{1}{n+1}$  Inductive Step:   Prove, using the Inductive Hypothesis as a premise, that   $$\sum_{k=1}^{n+1}  \frac{1}{k(k+1)} = \sum_{k=1}^{n}  \frac{1}{k(k+1)} + \frac{1}{(n+1)(n+2)} = 1-\frac1{n+1} + \frac{1}{(n+1)(n+2)} = \frac{(n+1)(n+2)}{(n+1)(n+2)}+\frac{-2-n}{(n+1)(n+2)}+\frac{1}{(n+1)(n+2)} = \frac{(n+1)(n+2)-2-n+1)}{(n+1)(n+2)} = \frac{(n+1)(n+2)-n-1}{(n+1)(n+2)} = \frac{n^2+2n+1}{(n+1)(n+2)} = \frac{(n+1)(n+1)}{(n+1)(n+2)} = \frac{n+1}{n+2}$$  To prove $$ 1-\frac{1}{n+2} = \frac{n+1}{n+2} $$ Multiply both sides by $n+2$ to get an equivalent expression. $$ (1-\frac{1}{n+2}) * (n+2) = (\frac{n+1}{n+2}) * (n+2)  $$ $$ n+1=n+2−1 $$  Does this all make sense? How can this be improved upon?