I want to copy the text from function parameter, with other text after it  I tried making textarea element for only read and hide it,and put text in it but it didn't work    function Copy(str) {   const AllWord = str + "&lt;br&gt;&lt;br&gt;Copied From HERE";   var el = document.createElement('textarea');   el.value = AllWord;   el.setAttribute('readonly', '');   el.style = {     position: 'absolute',     left: '-9999px'   };   document.body.appendChild(el);   el.select();   document.execCommand('copy');   document.body.removeChild(el); }  Copy("CopiedText");     I expect it to copy "CopiedText"
What is the best way to copy text to the clipboard (multi-browser)? I have tried: function copyToClipboard(text) {     if (window.clipboardData) { // Internet Explorer         window.clipboardData.setData(&quot;Text&quot;, text);     } else {         unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege(&quot;UniversalXPConnect&quot;);         const clipboardHelper = Components.classes[&quot;@mozilla.org/widget/clipboardhelper;1&quot;].getService(Components.interfaces.nsIClipboardHelper);         clipboardHelper.copyString(text);     } }  But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined. A nice trick without using :
remove numbers from filenames in Mac OS X I have a directory full of files with names in this format (with numbers as the start of each filename):  102_file.txt 104_list.txt 242_another_file.txt   I would like to rename them as follows (i.e. removing the numbers):  file.txt list.txt another_file.txt   Can anyone suggest a way to do this (presumably from the terminal)? When I have a query that checks if a column of type uniqueidentifer does not exist in a table that has a null value then I get no results back. If the subquery does not return a null it works fine and it only happens when using not in.   I know I can just do a not null check in my subquery, but I am curious why this does not work.  Query Example:  select a.guid from tableA a where a.guid not in (select b.guid from tableB AS b)   Working Test:  select 1 where newid() not in (select newid())   Broken Test:  select 1 where newid() not in (select null) Probability Interval for Gamma Distribution There is something that I am doing wrong in the exercise below and I would appreciate some help figuring it out.  Let $X_1, X_2, \ldots, X_5$ be a random sample from a $\Gamma \left(3,3 \right)$ distribution . Define $W=\sum_{i=1}^5 X_i $.    Obtain the distribution of $W$ and of $2W/3$ Find $c_1$ and $c_2$ such that $P \left( c_1 &lt; W &lt;c_2 \right)=0.95 $     Since $W$ is the sum of iid gamma variables, $W \sim \Gamma \left(15,3 \right)$ and now a straightforward transformation argument shows that $Y=\frac{2}{3} W \sim \chi^2 \left(30 \right) $. This completes question 1.  Now for question 2, my thoughts were to transform these probabilities using the result from question 1, namely that $\frac{2}{3} W \sim \chi^2 \left(30 \right) $. Hence, unless I have made a horrible mistake here:  $$P \left( \frac{2}{3} c_1 &lt; Y &lt; \frac{2}{3} c_2 \right)=0.95 $$  We can find the constants from a chisquare table for $30$ degrees of freedom. In my case, they are $16.791$ for the lower bound and $46.979$ for the upper one.   Then if we equate $\frac{2}{3}c_1=16.791$ and solve for $c_1$ we should be able to find the constant for the above gamma confidence interval, right?   The problem is that according to $R$, $P \left( W&lt;c_1 \right) =1 $, instead of  the desired $0.025$ which means I have gone wrong somewhere. I do not think it is in question though $1$ as I have verified the result many times.   Thank you. Create an instance of a class from a string Adding a script to the page dynamically with jQuery never uses the cached file How can I change PulseAudio port priorities? I list sources and sinks as follows:  pactl list sources pactl list sinks   The output I get is:  ...     Ports:         analog-input-internal-mic: Internal Microphone (priority: 8900)         analog-input-headphone-mic: Microphone (priority: 8700)         analog-input-headset-mic: Headset Microphone (priority: 8800) ...     Ports:         analog-output-speaker: Speakers (priority: 10000)         analog-output-headphones: Headphones (priority: 9000, available)    How do I change the priorities listed above and have them fixed at what I change them to? Note that I am not looking to set a default source and sink or to delete unwanted sources or sinks, I just want to be able to assign them different priorities. While browsing Stack Overflow, I noticed that I lost a lot of reputation:        Is this serial downvoting? Will it be corrected by a rep-recalculation? How often are those done?    Here's a second instance: The  spell says time stops for other creatures.  What all is affected by the spell? Is gravity affected? Air movement?  I know that the spell only does what it says, and nothing else, but just wondering.   In addition, is it saying that the other creatures are not affected by environmental effects and the like while time is stopped?  For instance, if a wind blew really hard at one of the creatures you're fighting, would it affect that foe while time stop is active? If you were to place a bear trap behind the person, and a hard wind blew enough to tip them, would they then fall over onto the bear trap and be damaged without the spell ending?  This is a very curious spell... Thesis running problem in KILE I'm using  editor. There is no problem when I run others  .tex article in Kile. But problem is when I run a thesis article in KILE. This thesis article is running fine in      \documentclass[12pt,a4paper]{thesis}     \usepackage{amsmath}\usepackage{amssymb}     \usepackage{graphicx}   Is there anything need to add in KILE setting to run the Thesis .tex in KILE?  This is the log file:  This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=latex 2013.3.7)  25 AUG 2013 23:37 entering extended mode  %&amp;-line parsing enabled. **Thesis-Aug24-2013.tex (./Thesis-Aug24-2013.tex LaTeX2e &lt;2009/09/24&gt; Babel &lt;v3.8l&gt; and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, loaded.  ! LaTeX Error: File `thesis.cls' not found.  Type X to quit or &lt;RETURN&gt; to proceed, or enter new name. (Default extension: cls)  Enter file name:  ! Emergency stop. &lt;read *&gt;   l.2 \usepackage                {amsmath}\usepackage{amssymb}^^M *** (cannot \read from terminal in nonstop modes)   Here is how much of TeX's memory you used:  10 strings out of 495062  226 string characters out of 1182645  45108 words of memory out of 3000000  3285 multiletter control sequences out of 15000+50000  3640 words of font info for 14 fonts, out of 3000000 for 9000  28 hyphenation exceptions out of 8191  10i,0n,7p,80b,8s stack positions out of 5000i,500n,10000p,200000b,50000s No pages of output. I have the two PGF nodes foo and bar positioned in a row.  \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \begin{document}   \begin{tikzpicture}[node distance=0.2cm,mynode/.style={rectangle,draw}]     \node[mynode] (foo)                {foo};     \node[mynode] (bar) [right=of foo] {bar};   \end{tikzpicture} \end{document}   How can I create a third node below those two nodes with the width of foo, bar and the node distance between them? Is there a way to do this with the fit library or is this the wrong approach? From question . You have to use \r when replacing text for a newline, like this  :%s/%/\r/g   But when replacing end of lines and newlines for a character, you can do it like:  :%s/\n/%/g    What section of the manual documents these behaviors, and what's the reasoning behind them? Similar to , what's the best way to stay up to date with the latest stable releases of Thunderbird? proof relating to limit definition of e I'm studying the book A Primer for the Mathematics of FinancialEngineering, along with it's solution guide. I've ran into trouble with the solution to question 7 in chapter 1.    The problem is:  Show that $(1+\frac{1}{x})^x &lt; e &lt; (1+\frac{1}{x})^{x+1}$ .   Specifically, I'm having trouble with one step in the solution.    It says that  $$x\ln\left(1+\frac{1}{x}\right)&lt;1&lt;(x+1)\ln\left(1+\frac{1}{x}\right)$$  can be written as   $$\frac{1}{x+1} &lt;\ln\left(1+\frac{1}{x}\right)&lt;\frac{1}{x}, \forall \ge 1.$$  How can the first equality (or is it inequality?) be written as the second? Let $G$ be a finite group and $N$ a normal subgroup of $G$ of index $4$. Prove that $G$ has a subgroup of index $2$ (hence normal) and if $G/H$ is not cyclic then $G$ is equal to the union of three proper subgroups.   I understand that $G/H$ is isomorphic to $\mathbb{Z}_4$ or $\mathbb{Z}_2\times \mathbb{Z}_2$. Let $K^*$ be a subgroup of $G/H$ of order $2$. Then $K^*\cong K/H$ for some $K$ such that $H$ is normal in $K$ and hence $[G:K]=[G/H:K/H]=4/2=2$.  If $G/H$ is not cyclic then $G/H\cong \mathbb{Z}_2\times \mathbb{Z}_2$. I don't know how to prove $G$ is the union of three subgroups. Could it be true that as $G/H$ is the union of three proper subgroups $K_1^*,K_2^*,K_3^*$ then the corresponding groups $K_1,K_2,K_3$ have union equal to $G$? Would anyone give me a hint to prove this?  Thank you. Prove $ \forall c \in \mathbb{R^{+}}, \forall B \in \mathbb{N}, \exists n \in \mathbb{N}, (n \geq B) \wedge (\sqrt{2n} > c \ln(n+2)) $? How to install TP-LINK Archer T4U driver? the converse of Pythagoras Theorem I have recently submitted a paper to arXiv, but the arXiv moderators put my paper in status "on hold", because they have to make a decision on the right classification for the paper.   To those who have experienced a similar situation, how long did it take before they made a decision and published the paper on the arXiv? I just want to have an idea of how long I will have to wait. I have some questions regarding suspended users:   Why do suspended users have a reputation of one? According to the default reputation of a new user, he/she will have reputation of one and he/she has the privilege of posting questions. When comparing this, this is getting violated when compared to suspended users' reputation. Even though they have one reputation point, they cannot post questions. As suspended users do not have privilege of posting questions, there is no use of making "Ask Question" visible. This is an unnecessary server hit. Am I right? As suspended users do not have the privilege of answering questions, there is no use of making "Answer Question" visible. How do I install Waterfox?