It is well known that a command like this:  cat filename | some_sed_command &gt;filename   erases file filename, as the output redirection, being executed before the command, causes filename to be truncated.  One could solve the issue in the following way:  cat file | some_sed_command | tee file &gt;/dev/null   but I'm not sure this would work in any case: what happens if file (and the result of the sed command) is very big? How can the operating system avoid to overwrite some content which is still not read? I see that there is also a sponge command which should work in any case: is it "safer" than tee?
Is there any short way to save the pipe output to the same file that it's processed. For example, this is what I am actually doing  $ cat filename | sort | uniq &gt; result $ rm -f filename $ mv result filename   I was wondering if there was a way to do it in just one line (not appending those commands using &amp;&amp;)  This is not the way, but to get an idea  $ cat filename | sort | uniq &gt; filename
Find   $$\lim _{x\to \infty }x\Big(\ln\left(x+1\right)-\ln x\Big)$$  Here's how I do it:  $$x\Big(\ln(x+1)-\ln x\Big) = x\Bigg(\ln(x(1+\frac{1}{x}) - \ln x\Bigg)$$ $$x\Big(\ln x + \ln(1+\frac{1}{x}\Big)-\ln x =x\ln\Big(1+\frac{1}{x}\Big)$$ $$\ln\Bigg( \Big(1+\frac{1}{x}\Big)^x \Bigg) \rightarrow \ln 1^\infty = 0$$  What am I doing wrong? The answer is supposed to be $1$, but I get $0$. A function for which one-sided limits are zero and infinity tikz relative coordinates Suppose one defines coordinates a and b. One may draw a line connecting these two coordinates (\draw (a) -- (b)). Suppose one desires to draw a line that is shifted upward 1 unit relative to a and b. A first guess is the command \draw (a){}+(0,1) -- (b){}+(0,1). This command, however, connects the point a+(0,1) to the point b, presumably because addition is subsequent to the draw command. How does one obtain the desired result (drawing from a+(0,1) to b+(0,1)?  MWE:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}  \draw[fill] (0,0) circle (2pt) coordinate (a);  \draw[fill] (5,0) circle (2pt) coordinate (b);  \draw (a) -- (b);  \draw (a){}+(0,1) -- (b){}+(0,1); \end{tikzpicture} \end{document}     Edit: How does one draw coordinates at a point shifted relative to the arithmetic average of the coordinates of two points (something akin to \node at ($(((s1)+(s2))/2)+(0,1)$)). Who's at fault with this error concerning csquotes and LuaLaTeX? I ran into this with the package lilyglyphs but I'm not sure whose fault this error is.  When I compile the following with lualatex:  \documentclass{article} \usepackage{csquotes} \MakeOuterQuote{"} \EnableQuotes \begin{document} \directlua{print("hello")} \end{document}   I get an error saying   \directlua]:1: unexpected symbol near '\'. l.6 \directlua{print("hello")}    Now suppose that I do not directly write \directlua in my document, but I include a package that does it internally. Such as   \documentclass{article} \usepackage{fontspec, csquotes, lilyglyphs} \MakeOuterQuote{"} \EnableQuotes \begin{document} \wholeNote \end{document}   I have no knowledge why compilation fails, because the error now becomes   ! Missing number, treated as zero. &lt;to be read again&gt; \begingroup l.7 \end       {document}    From my user point of view I did nothing wrong, because I'm using the public API provided by the packages. The csquotes documentation specifically says:     Note that all characters are automatically checked for validity as they are allocated. This package will reject characters which are unsuitable as active quotes... In sum, the following   characters will be considered as reserved by this package:   A–Z a–z 0–9 . , ; : ! ? ' - # $ % &amp; ^ _ ` ~ \ @ * { } [ ]    So my question is whose fault is this error?   My fault, the user's fault, because I should have known (but how?) that even though the quote is not listed as unsuitable in the csquotes manual, it actually is? The fault of the implementation or documentation of csquotes for failing to mention " as unsuitable? The fault of the implementation of the \directlua command because it doesn't prevent LaTeX catcode changes/active characters from impacting its argument? A shortcoming of TeX itself because of its global state based architecture? Checking if Ubuntu package contains desired update In transformers, the ratio of the voltages equals the ratio of the turns - so double the output coil's turns and the output voltage doubles. Then, in order to conserve energy, current halves.  This makes perfect sense in terms of $\mathrm{P=VI}$, but what happened to $\mathrm{V=IR}$? Doubling voltage and halving the current seems to completely contradict this basic law. That is, of course, unless the resistance in the output circuit changes, with R proportional to $\mathrm{V^2}$ - but I don't see how this is possible.  So how can a transformer obey both laws? Can resistance change or am I missing something else? I wanted to left align a set of equations. I've tried the solution provided in  . It worked. But, I wanted to have a single equation number for the entire flalign in order to refer to it later. Like in case of equation+split. While using equation+align, I am able to get it. But, if I use equation+flalign the equations are still being centered. Is there a way to do it?  Example using equation+align,  \begin{equation}      \begin{align}       \mbox{Minimize } &amp; x_1+x_2+x_3 \\       \mbox{Subject to} &amp; \\        &amp; x_1+x_2 \leq 10 \\        &amp; x_2+x_3 \leq 8 \\        &amp; x_1+x_3 \leq 5       \end{align} \end{equation}   I would like to do this while the equations are left aligned.  It will be even better if the equations can be spaced a little (for example, 1 cm) from the left margin instead  of starting from the left margin.  Thanks in advance Let's say we are given a set of positive reals, and we're told that these are the edges of a convex  $n$-gon, and we must compute it's area.   For $n = 3$ there is the famous Heron's formula:  $$A = {1\over 4}\sqrt{4a^2b^2 - (a^2 + b^2 - c^2)^2}$$  For $n = 4$ there is Brahmagupta's formula:  $$A = {1\over 4}\sqrt{(a^2 + b^2 + c^2 + d^2)^2 + 8abcd - 2(a^4 + b^4 + c^4 + d^4)}$$  Is there a generalization for arbitrary $n$? Does it even exist? I've set up the physics of a swinging wrecking ball and set the animation to run for 240 frames.  This was not long enough for the entire "swing" of the ball-and-chain.   I'm unable to reset the timeline, but I can set the end frame to (say) 1000 frames, but when I try to play the animation, the animation progress halts at frame 240 and I cannot get it to go any further.   There are no markers or keyframes in the timeline.  What should I do to "force reset" the animation-timeline, to allow changes to the length? Can't save my render as an image I seem to be having issues when I try and save the output file as a .png, or .jpeg for that matter. I've set up my user preferences, File, Render Output to my desktop as well as render output in the editor window. What am I missing here? I'm obviously very new to this program and your help would be appreciated. Thanks for your time I'm working in Lee's book on topological manifolds and have gotten stumped on the first question in chapter 5, the chapter on cell complexes.  The problem is:   Let $D$ and $D'$ be two closed cells not necessarily of the same dimension.     Show that any continuous map $f:\partial D \to \partial D'$ can be extended to a continuous map $F:D \to D'$ such that $F(Int \; D) \subseteq Int \; D'$. Given points $p \in Int \; D$ and $p' \in Int \; D'$, show that $F$ can be chosen so $F(p) = p'$. Show that if $f$ is a homeomorphism then $F$ can be chosen to be a homeomorphism.   I proved the first part roughly as follows: First suppose $D$ and $D'$ are convex and each contain $0$ in their interior (in their respective ambient spaces).  Then every element other than $0$ in $D$ can be expressed uniquely in the form $\lambda q$ where $q \in \partial D$ and $\lambda\in (0,1]$ (an equivalence relation on the chords connecting $0$ to boundary points partitions $D- \{0\}$).  I then define the map $F(\lambda q) = \lambda f(q)$ which is continuous since if $\lambda_n q_n \to \lambda q$ in $D$ then $F(\lambda_n q_n) \to F(\lambda q)$.  Lastly $\lambda q \in Int \; D$ implies $\lambda &lt;1$ and so $\lambda f(q)$ is an interior point of $D'$ since $f(q)$ is a boundary point and $D'$ is convex.    Now if we suppose $D$ and $D'$ are arbitrary closed cells there are homeomorphisms $g_1: \overline{\mathbb{B}^n} \to D$ and $g_2: \overline{\mathbb{B}^m} \to D'$ (where possibly $m=n$) then we have that $g_2^{-1}\circ f \circ g_1$ is a continuous map between the boundaries of two closed balls and so by the first part can be extended to a continuous map $F:\overline{\mathbb{B}^n} \to \overline{\mathbb{B}^m}$.  The mapping $g_2 \circ F \circ g_1^{-1}$ is a continuous map that satisfies the desired claim.    My issue is that parts 2 and 3 don't seem (to me at least) to follow that easily from the proof I constructed.  Maybe my proof is wrong and I'm not seeing it, but more likely I think that I'm missing the spirit in which Lee is intending for us to approach this problem. Where to securely store API keys and passwords in WordPress? I'm looking to use a few APIs and many come with keys, secret keys and passwords required to work. Where in WordPress can you store that information? Assuming anyone can hack your DB is there anyway for WordPress to make saving that information more secure? Also, consider the ability to change these keys ever so often so I would need to update the keys on an options page.  UPDATE I've looked at the resumes of the type of candidates that get into computer science PhD programs at the top few universities (e.g. Stanford, MIT etc.) and a lot of them seem to have multiple publications (2-4) done during their undergraduate years. Is this representative of the entire pool? Or is this just a self-selected group that puts their resumes online.  I currently have one first-author workshop paper (5 pages), and I wonder how this might affect my chances at entry into these top universities. Rigor in quantum field theory Is the 'Tough' feat's additional health still added when Wild Shaped/Shapeshifted? Following on from this question:   It seems all feats carry over to your new form if your new form is capable of using them (so Mounted Combatant and Inspiring leader would usually be ruled as unusable in most circumstances). But what about Tough?     Your hit point maximum increases by an amount equal to twice your   level when you gain this feat. Whenever you gain a level thereafter,   your hit point maximum increases by an additional 2 hit points.   Would this increase your maximum HP by the same amount when in the form of a rat, or brown bear? How to cd into a directory with this name "-2" (starting with the hyphen)? I have a directory named:  -2   I want to cd into it but the cd complains:  bash: cd: -2: invalid option   With no success, I've tried:  cd "-2" cd '-2' cd \-2   Any solution?  Edit: no file browsers like mc, etc. available on the server. What causes latex.exe to be unable to import *.jpg, *.png, *.pdf directly? Internally, what causes latex.exe to be unable to import *.jpg, *.png, *.pdf directly? Should flour be thrown out past its expiry date? I came to think about some situations where it would be almost impossible to miss a melee spell attack (target is grappling you or vice versa, target is holding you or is close to you, your character already has it's hand on the target, etc.). How do you manage those situations?    Do you give an advantage to the caster? Does the spell automatically succeed? Or you just don't ask yourself the question and just play along with the base rules? How do I change login screen theme or background in Ubuntu 20.04? How can I change the Ubuntu 20.04 login screen theme or background?  In the previous version 19.10, I can change it from the CSS file under Yaru theme but now there is no CSS file.