Hi  I am using codemirror for textarea. I want to copy conent of textarea to clipbord, i want to javascript or jquery scipt support for all major browser.  &lt;textarea name="code" id="text_1" cols="30" rows="10"&gt;&lt;/textarea&gt; &lt;script&gt; $("#text_1").click(function(){      // required code for copy text in  clipbord  });
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 :
I want to show the IP address like below  lo : 127.0.0.1  eth0 : 192.168.5.123 eth1 : 192.172.0.212 wlan0 : 10.1.0.124   I'm able to print all IP address by ifconfig | awk '/inet addr/{print substr($2,6)}'. But it is only printing the IPs. Every system have their own interface names and addresses. So my script has to show their interfaces with respect to IP addresses. How to solve this recurrence $T(n) = 2T(n/2) + n\log n$ How can I solve the recurrence relation $T(n) = 2T(n/2) + n\log n$? It almost matches the Master Theorem except for the $n\log n$ part. How do I install Ubuntu to a USB key? (without using Startup Disk Creator) I work sometimes till 4 am and my friends and the rest of the world obviously don't know in advance that I don't want to be called at 8 am.  Is there an app or setting that can allow me to have an emergency override list of people I need to be woken up for if a possible emergency arises but ignore all other calls until I wake up?    I'm familiar with the Do Not Disturb option, but it has limitations that it blocks all calls. What if there is an emergency at night?  What if I want to allow certain callers during the Do not Disturb time? Is there a way to have an emergency list that allows calls during silent? Can anyone tell me the name of these sentences? "Heard me [infinitive]" vs. "heard me [present participle]" "Heard me [infinitive]" vs. "heard me [present participle]"             At that time, you wouldn't have heard me talk about it.   At that time, you wouldn't have heard me talking about it.         At that time, you wouldn't have heard me condemn it.   At that time, you wouldn't have heard me condemning it.         Which one of the above sentences are incorrect and why? How to determine an object's class? Making a private method public to unit test it...good idea? Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to  In [53]: namestr(choice) Out[53]: 'choice'   for use in making a dictionary. There's a good way to do this and I'm just missing it.  EDIT:  The reason to do this is thus. I am running some data analysis stuff where I call the program with multiple parameters that I would like to tweak, or not tweak, at runtime. I read in the parameters I used in the last run from a .config file formated as  filename no_sig_resonance.dat  mass_peak 700  choice 1,2,3   When prompted for values, the previously used is displayed and an empty string input will use the previously used value.  My question comes about because when it comes to writing the dictionary that these values have been scanned into. If a parameter is needed I run get_param which accesses the file and finds the parameter.   I think I will avoid the problem all together by reading the .config file once and producing a dictionary from that. I avoided that originally for... reasons I no longer remember. Perfect situation to update my code! How do I reference an alias in a WHERE clause? Order posts by tags count? I am trying to order posts by tag count. I want to order posts with no tags first and posts with highest count last.  I tried and got posts with no tags only.       $tags = get_tags();     $tag_ids = wp_list_pluck( $tags, 'term_id' );      $args1 = array (        'orderby'          =&gt; 'DEC',        'post_type'        =&gt; 'post',        'pagination'       =&gt; true,        'posts_per_page'   =&gt; '1',        'tag__not_in'      =&gt;  $tag_ids,        'meta_key'         =&gt; '_thumbnail_id',     );   How do I order posts based on the tags count? How do I rotate an object along it's own axis (windmill) I'm trying to rotate the blades of a windmill for an animation but the windmill is already at an angle. When I keyframe it on it's own axis (after pressing control + alt + space) and rotate it the blades spin inwards during the animation before coming back at the end. I've tried locking the other axis but that keeps the blades from rotating back to the right orientation. Also, whenever I rotate the object 360 degrees it turns the 360 into a really small number (0.0001) so it plays forward hallway then backwards (with a 180 degree keyframe halfway). Any help would be appreciated!. Characterize the groups $G$ for which the map $\iota: G \to G$, sending $x \mapsto x^{-1}$ for all $x \in G$, is an automorphism of $G$ I have trouble on this question: "Characterize the groups G for which the map $$\iota: G \to G$$ sending $$x \mapsto x^{-1}$$ for all $x \in G$, is an automorphism of $G$." From  post I have seen that $G$ must be abelian. Can anyone propose another characteristic of $G$ that I can derive from the given conditions besides abelian? Thank you so much!! Why doesn't the Enterprise use stealth/invisibility technology like the Romulans and Klingons? The stealth mode of starships plays a huge role in many Star Trek films and episodes and is a strong advantage in combat. I remember an episode revealing that the Federation developed a secret stealth technology (afair on Riker's former ship with another captain appearing in this episode) that even made it possible to fly with the ship through matter.   Nonetheless, while stealth technology seems standard for Romulans, Klingons (Ferengi, Vulcans?) and does not break any intergalactic laws (do these exist at all?), the Federation doesn't use it? How do I find the privileges I have earned and will earn in Stack Overflow? It used to be off the top bar, now its gone  Where has it moved?  EDIT:  It moved onto the profile page !  Right side same row as your name in profile:    Thank you Any way to see mail sent by other user through shared address? My wife and I have a "shared" email address, like thesmiths@example.com which we both use from Gmail when we both want to get replies or for signing up for certain websites.  When an email is received at that address, it gets forwarded to both of our personal Gmail accounts.  The problem is that when either one of us "sends as" that address, the other does not see the sent message. So we have to cc or bcc each other (and she usually forgets.)  Is there any automagic way to have those sent emails appear in BOTH of our Gmail accounts?  I've tried filters but I don't think they work on outgoing messages. Basically we want a filter that would automatically forward emails from that address to the other person.  I know this can be done with standalone mail clients, but neither of us uses those. Do I need swap space if I have more than enough amount of RAM? From what I understand, the purpose of a swap partition in Linux is to free up some "not as frequently accessed" information from RAM and move it to a specific partition on your harddrive (at the cost of making it slower to read from or write to), essentially allowing active applications more of the "high speed memory".  This is great for when you are on a machine with a small amount of RAM and don't want to run into problems if you run out. However, if your system has 16 GB or 32 GB of RAM, and assuming you aren't running a MySQL database for StackExchange or editing a 1080p full length movie in Linux, should a swap partition be used? Why would parametric statistics ever be preferred over nonparametric? Can someone explain to me why would anyone choose a parametric over a nonparametric statistical method for hypothesis testing or regression analysis?   In my mind, it's like going for rafting and choosing a non-water resistant watch, because you may not get it wet. Why not use the tool that works on every occasion? In Windows Vista, I have tried to set the setting 'the following number of lines at a time' to zero. I assumed my scroll wheel would not scroll anymore. But it still works.  I'm trying to disable the wheel because my RSI complaints worsen when using the scroll wheel often.  Does anyone have an idea on how to achieve this? What is the difference between logistic regression and Fractional response regression? As far as I know, the difference between logistic model and fractional response model (frm) is that the dependent variable (Y) in which frm is [0,1], but logistic is {0, 1}. Further, frm uses the quasi-likelihood estimator to determine its parameters. Normally, we can use glm to obtain the logistic models by glm(y ~ x1+x2, data = dat, family = binomial(logit)). For frm, we change family = binomial(logit) to family = quasibinomial(logit). I noticed we can also use family = binomial(logit) to obtain frm's parameter since it gives the same estimated values. See the following example library(foreign) mydata &lt;- read.dta(&quot;k401.dta&quot;)   glm.bin &lt;- glm(prate ~ mrate + age + sole + totemp,                 data = mydata, family = binomial('logit')) summary(glm.bin)  return,  Call: glm(formula = prate ~ mrate + age + sole + totemp,      family = binomial(&quot;logit&quot;),      data = mydata)  Deviance Residuals:      Min       1Q   Median       3Q      Max   -3.1214  -0.1979   0.2059   0.4486   0.9146    Coefficients:               Estimate Std. Error z value Pr(&gt;|z|)     (Intercept)  1.074e+00  8.869e-02  12.110  &lt; 2e-16 *** mrate        5.734e-01  9.011e-02   6.364 1.97e-10 *** age          3.089e-02  5.832e-03   5.297 1.17e-07 *** sole         3.636e-01  9.491e-02   3.831 0.000128 *** totemp      -5.780e-06  2.207e-06  -2.619 0.008814 **  --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for binomial family taken to be 1)      Null deviance: 1166.6  on 4733  degrees of freedom Residual deviance: 1023.7  on 4729  degrees of freedom AIC: 1997.6  Number of Fisher Scoring iterations: 6  And for family = quasibinomial('logit'), glm.quasi &lt;- glm(prate ~ mrate + age + sole + totemp,   data = mydata ,family = quasibinomial('logit')) summary(glm.quasi)  return,  Call: glm(formula = prate ~ mrate + age + sole + totemp,      family = quasibinomial(&quot;logit&quot;),      data = mydata)  Deviance Residuals:      Min       1Q   Median       3Q      Max   -3.1214  -0.1979   0.2059   0.4486   0.9146    Coefficients:               Estimate Std. Error t value Pr(&gt;|t|)     (Intercept)  1.074e+00  4.788e-02  22.435  &lt; 2e-16 *** mrate        5.734e-01  4.864e-02  11.789  &lt; 2e-16 *** age          3.089e-02  3.148e-03   9.814  &lt; 2e-16 *** sole         3.636e-01  5.123e-02   7.097 1.46e-12 *** totemp      -5.780e-06  1.191e-06  -4.852 1.26e-06 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for quasibinomial family taken to be 0.2913876)      Null deviance: 1166.6  on 4733  degrees of freedom Residual deviance: 1023.7  on 4729  degrees of freedom AIC: NA  Number of Fisher Scoring iterations: 6  The estimated Beta from both `family` are the same, but the difference is the SE values.  However, to obtain the correct SE, we have to use `library(sandwich)` as in this [post][1].  Now, my questions:  1. What is the difference between these two codes? 2. Is frm about to obtain robust SE?  If my understanding is not correct, please give some suggestions.      [1]: https://stackoverflow.com/questions/37584715/fractional-response-regression-in-r