Actually I have a file called test1.txt.  In that file I have the following five lines:   'test message1'  'test message2'  'test message3'  'test message4'  'test message5'   Now I want to add a new line 'testing testing' into test1.txt file, after the 'test message1' line. How to do that?
Right now I'm using echo &quot;Hello World&quot; &gt;&gt; file.txt  to append some text to a file but I also need to add text below a certain string let's say [option], is it possible with sed? EG: Input file Some text Random [option] Some stuff  Output file Some text Random [option] *inserted text* Some stuff
Let $p &gt; 3$ be a prime such that $p \equiv 2 \pmod 3$. Define the elliptic curve $E$ over $\mathbb{F}_p$ by $y^2 = x^3 + 1$. Prove that $E(\mathbb{F}_p)$ consists of $p+1$ points.  Using Fermat's little theorem you can prove that $x^3 + 1$ is a bijection on $\mathbb{F}_p$. Hence, $$\#E(\mathbb{F}_p) = \#\{(x,y) \in \mathbb{F}_p^2 : y^2 = x^3 + 1\} + \#\{\infty\} = \#\{(x,y) \in \mathbb{F}_p^2 : y^2 = x\} + 1.$$ But then I am stuck trying to prove that $y^2 = x$ has $p$ solutions $(x,y) \in \mathbb{F}_p^2$. Using processing.runandload in QGIS 3 Problem with sudo apt get update: The repository cdrom... does not have a Release file Every time I try update (using sudo apt-get update) my Ubuntu I get this problem:  W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   How can I fix it? I use Ubuntu 16.04 LTS Prevent specific sites from being overrepresented in the hot questions list Some sites appear far more often in the hot questions list than other sites. I don't have any hard data on that, as that kind of data is just not publicly available, but I'm pretty sure my subjective impression on that is reasonably accurate.  Those sites don't appear more often because they are inherently more interesting, but because they have certain voting and answering patterns that favor them in the hot questions algorithm. I would argue that the goal of the hot questions list is to present questions from a large variety of SE sites to the whole network, and to show possibly interesting questions to users that would not have found them otherwise.   To achieve this goal, the spots in the hot questions list should be distributed among all SE sites. The algorithm should try to get a good sampling of all sites, and it should try to normalize the results for varying voting behaviour. At the moment, sites that intrinsically get more votes and more answers per question seem favored in the algorithm.  So I think one part of the algorithm should try to identify questions that get an unusally high amount of votes and views for that site, and give the smaller sites a chance this way.  I'm not sure on how exactly this weighting should be done, as a complete normalization would likely not work across the huge difference in scale for all the SE sites.  As a specific example that the current algorithm is broken I'll present . I don't think any site should occupy a third of the whole list.   Here's another instance where one site is overrepresented at the top of the list: How do people come up with difficult math Olympiad questions? Abnormal behavior with iwlwifi driver: the device is shown as not working Recently I've installed Kubuntu in a newly bought laptop with an Intel WiFi 6 AX200 network card, I can connect to the wifi without apparent problems but when I open the driver manager in the settings I face this weird situation:  Intel Corporation: Wi-Fi 6 AX200 This device is not working.  [ ] Using iwlwifi driver backport in DKMS format from backport-iwlwifi-dkms (open source)  [ ] Continue using a manually installed driver  [x] Do not use the device   Note that "Continue using a manually installed driver" is the only voice selectable in the list.  Here is some additional information:  $ lspci -nnk | grep 0280 -A3 02:00.0 Network controller [0280]: Intel Corporation Wi-Fi 6 AX200 [8086:2723] (rev 1a)         Subsystem: Intel Corporation Wi-Fi 6 AX200 [8086:0084]         Kernel driver in use: iwlwifi         Kernel modules: iwlwifi  $ rfkill list all 0: hci0: Bluetooth         Soft blocked: yes         Hard blocked: no 1: phy0: Wireless LAN         Soft blocked: no         Hard blocked: no  $ dmesg | grep iwl [    2.888227] iwlwifi 0000:02:00.0: enabling device (0000 -&gt; 0002) [    2.945179] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-cc-a0-50.ucode failed with error -2 [    2.945217] iwlwifi 0000:02:00.0: Direct firmware load for iwlwifi-cc-a0-49.ucode failed with error -2 [    2.947244] iwlwifi 0000:02:00.0: TLV_FW_FSEQ_VERSION: FSEQ Version: 43.2.23.17 [    2.947250] iwlwifi 0000:02:00.0: Found debug destination: EXTERNAL_DRAM [    2.947252] iwlwifi 0000:02:00.0: Found debug configuration: 0 [    2.947697] iwlwifi 0000:02:00.0: loaded firmware version 48.4fa0041f.0 op_mode iwlmvm [    3.145585] iwlwifi 0000:02:00.0: Detected Intel(R) Wi-Fi 6 AX200 160MHz, REV=0x340 [    3.159226] iwlwifi 0000:02:00.0: Applying debug destination EXTERNAL_DRAM [    3.160060] iwlwifi 0000:02:00.0: Allocated 0x00400000 bytes for firmware monitor. [    3.336456] iwlwifi 0000:02:00.0: base HW address: 50:eb:71:d7:0b:40 [    3.353553] iwlwifi 0000:02:00.0 wlp2s0: renamed from wlan0 [    4.457920] iwlwifi 0000:02:00.0: Applying debug destination EXTERNAL_DRAM [    4.621843] iwlwifi 0000:02:00.0: FW already configured (0) - re-configuring [    4.629999] iwlwifi 0000:02:00.0: BIOS contains WGDS but no WRDS   Someone have idea why this happened? Why is $A^TA$ invertible if $A$ has independent columns? How can I understand that $A^TA$ is invertible if $A$ has independent columns? I found a similar , phrased the other way around, so I tried to use the theorem  $$ rank(A^TA) \le min(rank(A^T),rank(A)) $$  Given $rank(A) = rank(A^T) = n$ and $A^TA$ produces an $n\times n$ matrix, I can't seem to prove that $rank(A^TA)$ is actually $n$.  I also tried to look at the question another way with the matrices  $$ A^TA = \begin{bmatrix}a_1^T \\ a_2^T \\ \ldots \\ a_n^T \end{bmatrix}   \begin{bmatrix}a_1 a_2 \ldots a_n \end{bmatrix} = \begin{bmatrix}A^Ta_1 A^Ta^2 \ldots A^Ta_n\end{bmatrix} $$  But I still can't seem to show that $A^TA$ is invertible. So, how should I get a better understanding of why $A^TA$ is invertible if $A$ has independent columns? Where is the GRLESS key? If $\operatorname{rank}\left( \begin{bmatrix} A &B \\ C &D \end{bmatrix}\right)=n$ prove that $\det(AD)=\det(BC)$ Let $A,\ B,\ C,\ D \in \mathcal{M}_n(\mathbb{C})$. If $\operatorname{rank}\left( \begin{bmatrix} A &amp;B \\ C &amp;D \end{bmatrix}\right)=n$, prove that $\det(AD)=\det(BC)$. Is there a direct proof that $\pi$ is not constructible, that is, that squaring the circle cannot be done by rule and compass?  Of course, $\pi$ is not constructible because it is transcendental and so is not a root of any polynomial with rational coefficients. But is there a simple direct proof that $\pi$ is not a root of polynomial of degree $2^n$ with rational coefficients?  The kind of proof I seek is one by induction on the height of a tower of quadratic extensions, one that ultimately relies on a proof that $\pi$ is not rational. Does any one know of a proof along these lines or any other direct proof?  I just want a direct proof that $\pi$ is not constructible without appealing to transcendence. Sometimes, I notice the following message on the Questions tab in my profile on Stack Exchange site:  Have you considered accepting an answer or starting a bounty for this question?  When does this message get displayed? Is it based on time of non-availability of answers or inactivity period? How to run a complete GUI as root? In a few large projects i have been working on lately it seems to become increasingly important to choose one or the other (XML or Annotation). As projects grow, consistency is very important for maintainability.   My questions are: what are the advantages of XML-based configuration over Annotation-based configuration and what are the advantages of Annotation-based configuration over XML-based configuration? Non-existence of a bijective analytic function between annulus and punctured disk A "failed to fetch" error occurs when apt-get update is run. How do I fix this? Total of attribute field of point layer per polygon layer I have a polygon shapefile of many lakes, I also have a point shapefile of locations on those lakes where fish were caught.  The point shapefile contains the attributes: Fisherman_iD, Fish_Caught, Lat, Long.  The polygon shapefile contains the attributes Lake_name, Points_per_polygon(PNTCNT)  Each point obviously has differing entries under the fish_caught field.   What I want to get is the average fish caught per lake (polygon).  So I need to have a total number of fish caught, per individual polygon, and then I can divide that by the PNTCNT file I create using the Points in a Polygon tool.  Ideas? I am relatively new to QGIS. How to prove a matrix is nilpotent? Given an $n\times n$ upper triangular matrix $A$ with zero on main diagonal, show that $A^n = 0$.   I did some matrix operation and noticed that the diagonal moves up, ultimately all entries will be zero. Is there a nicer way to do it? Java multiline string Biblatex - capital names in references, regular in cites I am trying to achieve a biblatex style that would do the following:  in the case of \parencite{} I would get ...like that (Smith 2010).   in the case of \textcite{} I would get Smith (2010) says that...  but in References I would get SMITH, J. Bookname.  How can I achieve this?  I use \usepackage[style=authoryear, firstinits=true]{biblatex}  I tried \renewcommand*{\mkbibnamelast}[1]{\MakeUppercase{#1}} but that makes the name uppercase even in the text, which is undesirable especially with \textcite{} Consider an irreducible but possibly periodic Markov chain on a finite state space with transition matrix $P$. We know there exists a unique stationary distribution $\pi$. If the Markov chain were aperiodic, we would have $P^n_{ij} \to \pi(j)$ as $n \to \infty$. This fails if the chain is periodic, but we have convergence of the Cesaro averages: $$\frac{1}{n}\sum_{k=1}^n P^k_{ij} \to \pi(j) \text{ as } n \to \infty.$$ Can anyone point me to a reference that states this fact? Every reference I've seen only considers convergence for aperiodic chains, or "fixes" periodicity by considering a lazy version of the chain. Alternatively, is there a simple way to obtain this result using the result for aperiodic chains?