Special case with ampersand (&amp;) with sed Want to replace string with &amp; character string in bash INPUT:   var1=''XXX&amp;XXX' Input : sed -i 's/WW/$var1/g' test  Output:  $cat test XXXWWXXX   expected output would be : XXX&amp;XXX PS: String would by Dynamic, So here i don't want to modify variable with escape character, Any solution in Shell ?
In my bash script I have an external (received from user) string, which I should use in sed pattern.  REPLACE="&lt;funny characters here&gt;" sed "s/KEYWORD/$REPLACE/g"   How can I escape the $REPLACE string so it would be safely accepted by sed as a literal replacement?  NOTE: The KEYWORD is a dumb substring with no matches etc. It is not supplied by user.
An instructor has an exam of 5 questions and a question bank of 50 questions. Are there $50\choose 5$ or $(50)_5$ possible exams? Where $(50)_5 = 50! / 45! $ and $50\choose 5$ $= 50!/(5!45!)$   I've narrowed it down to these two possibilities (though even these may be wrong), but I think I'm confusing myself as to which one I use. Can anyone suggest a good way of thinking of this problem that will make it apparent whether I need use use the falling factorial or the binary coefficient?   Edit: thank you for all the answers! Indeed, I meant $50!/45$ as the falling factorial. Also, the question doesn't specify whether it was meant to be ordered or unordered, but I think I understand my confusion now! How should I phrase an important question that I need to ask a professor? When needing to ask a professor about something important and potentially delicate, what is an appropriate way to phrase the question or write the email?  Examples include:   Requesting a recommendation letter Asking for exceptions to policy (e.g., ignoring a course prerequisite, rescheduling an exam) Asking if you can do research with them, join a group, get into a program Scheduling a meeting, exam, or defense Letting them know about a change of plans Letting them know about a life event affecting your work or studies (e.g., wedding, funeral, sickness, vacation) I'm having trouble finding something to clarify this. It's been mentioned in the Difficulty Class section of the DMG (238) that there should be a 50/50 chance that an average person can succeed at a DC 10 challenge, implying you have to beat it. However, I'd always thought that there's a 50/50 chance for an average person to hit another average person, but the chance is really 55/45, since you only have to equal their AC. A generic question across most board games: once a player has taken their turn (taken their finger off the piece they are playing), should they be allowed to change their mind?  Similarly, if a player forgets to take a privilege, such as an occupied building in Puerto Rico giving an extra worker, or plantation, if they remember a few moves later, should they be allowed to take the privilege?  Very few rules explicitly express how these events should be dealt with, so they are generally left up to the group. However, my group's rules will change depending on the personality of the players playing (not all members are available each time we play). I would like to make this consistent, and would appreciate feedback on how others deal with this scenario. How to show only date after the date of today in JCalendar How to spawn a Giant with equipment? I really want to spawn Giant with armor and swords. Because Giants are strong, and great challenge if spawned with enchanted diamond armor and a diamond sword. How do I run Python code as a script? Apply a string replacement on the citation as returned by \cite I was putting the following in /etc/sysctl.conf in Ubuntu 16.04 and ipv6 was disabled.  net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1   In Ubuntu 18.04 I have to add the following to grub.  GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"   Just wanted to have confirmation whether this is the new way in Ubuntu 18.04 to disable IPv6. LaTeX minted Error I receive the following errors:  ! Package minted Error: You must invoke LaTeX with the -shell-escape flag. ! Package minted Error: You must have `pygmentize' installed to use this packag   in TexMaker Settings i wrote:     LaTeX : "/usr/texbin/latex" -interaction=nonstopmode %.tex -shell-escape      PdfLaTex: "/usr/texbin/pdflatex" -synctex=1 -interaction=nonstopmode   %.tex -shell-escape   But the error still doesn't vanish ... Broken "Network profile" link when Area51 is their only account Showing that every field is an integral domain. I am typing a command, I remember I have to check something, if I press Ctrl+U the command disappears and I can type something else, but then the command I was typing is not in the history.  Is there a way to recover that command, or a different shortcut that I can press to save somewhere the command? Why is King Arthur female? Why is Iskander tall? I've watched both the Fate/Zero and Fate/Stay Night anime (including the Unlimited Blade Works movie), but none of the visual novels, so no spoilers from that unless they are light spoilers. One thing that bothered me was that despite the fact that heroic spirits are defined by the public opinion/view of them, some heroes had qualities that were in direct opposition of what the public thought.  We know that heroic spirits, being sealed on their Throne of Heroes, are meant to be completely unchanged. This is the entire point of the Throne of Heroes. But this seems to be in opposition of the previous fact that heroic spirits are defined by what others think they are. Then there are Counter Guardians who are completely different, I believe, in that they are not sealed on their Throne of Heroes.  One particularly important Counter Guardian of the series is Arturia, or Saber. Arturia is female, despite the fact that she was treated by even her contemporaries as male, and has gone done in history as male. In fact, there isn't even any small hint as to Arturia's gender being anything other than male in our history, or the history of the Nasuverse (I believe). This being true, shouldn't Arturia be male?  This not being the case shouldn't Arturia be erased, or else create instability in the World? Same with Iskander. In history he is known for being pretty short, even for a Macedonian. That he is very tall means there is an incongruity with human knowledge and true fact.  Furthermore, in the Unlimited Blade Works movie Archer is revealed to be Heroic Spirit Emiya. If Heroic Spirit Emiya is summoned before he is even a hero, or acquired his gift from the World, etc., then how is it that Heroic Spirit Emiya is even strong at all? The power of a Servant being based on their popularity at the time of their summoning, Emiya should be weaker than pretty much every other Servant, and then some.  Maybe I'm just over-analyzing things, or I have some misconception. In any case, answers are appreciated. Prove that $f'(0)$ exists and $f'(0) = b/(a - 1)$ Problem:   If $f(x)$ is continous at $x=0$, and $\lim\limits_{x\to 0} \dfrac{f(ax)-f(x)}{x}=b$, $a, b$ are constants and $|a|&gt;1$, prove that $f'(0)$ exists and $f'(0)=\dfrac{b}{a-1}$.   This approach is definitely wrong:    \begin{align} b&amp;=\lim_{x\to 0} \frac{f(ax)-f(x)}{x}\\ &amp;=\lim_{x\to 0} \frac{f(ax)-f(0)-(f(x)-f(0))}{x}\\ &amp;=af'(0)-f'(0)\\ &amp;=(a-1)f'(0) \end{align}  I will show you a case why this approach is wrong:     \[f(x)= \begin{cases} 1,&amp;x\neq0\\ 0,&amp;x=0 \end{cases}\]   $\lim_{x\to0}\dfrac{f(3x)-f(x)}{x}=\lim_{x\to0} \dfrac{1-1}{x}=0$   but $\lim_{x\to0}\dfrac{f(3x)}{x}=\infty$,$\lim_{x\to0}\dfrac{f(x)}{x}=\infty$   Does anyone know how to prove it? Thanks in advance! Is there a limit to the number of Power Armor sets you can keep? I've seen videos of some folks having several armor sets (4 is the most I've seen so far) standing about on their settlement. I'm wondering if having too many would cause some sets to disappear. They're not like guns/items that you can safely store in settlement crates, the suits kind of just... stand around. (I know there's the extra step of taking out the fusion cores, so that NPC's don't use them.)  Is there a limit to the number of Power Armor sets you can keep? What happens if my flight out of the Schengen area is cancelled on the last day of my visa? Meaning of convolution? show that Cov(X+ Y, X-Y)= Var(X) - Var(Y) $\sum (-1)^n/n$ fails the p-series test, but passes the alternating series test?