I want to create an click event for a dynamically generated button. How can I do that?  I thought that this code will work, but it doesn't. How can I add the function?    $(document).ready(function() {     $("#keyword_1").click(function() {       var keyword_js = document.getElementById("keyword_1").value;       $.ajax({           url: "list",           type: "POST",           async: false,           data: {             keyword: keyword_js.toString()           },           dataType: "json",           success: function(data) {             //button           }         }       },       error: function(request, status, error) {         alert("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error);       },       complete: function() {         // call back method       }     });   }); });  function insRow() {   var keyword_js = document.getElementById("keyword_en").value;   oTbl = document.getElementById("addTable");   var oRow = oTbl.insertRow();   oRow.onmouseover = function() {     oTbl.clickedRowIndex = this.rowIndex   }; //clickedRowIndex   var oCell = oRow.insertCell();    //Form Tag   var frmTag = "&lt;input type=button value=" + keyword_js + " id='keyword_1'&gt;";   frmTag += "&lt;input type=button value=‘del’ onClick='removeRow()' style='cursor:hand;'&gt;";   oCell.innerHTML = frmTag; }
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
Live in Florida & work remote for a New York company. Do I owe NY state income tax? I have been down in Florida for the past 3 1/2 years and continue to pay New York state taxes out of the money I earn for a company I work remote for that is in New York.  Should I be paying New York state taxes on this income?  Or do I not need to pay New York state tax because I live in Florida?  Our NY accountant says I need to continue to pay since company is out of NY, however others say I don't need to pay.  Pls advise which is correct. Thank you. What is the 'Badlock Bug'? A user on the Ask Ubuntu General Room posted a link to . After some googling around, all I can find is that it is a mysterious security bug, that uses the same website template as Heartbleed.  I manage Linux Servers, a mysterious security bug does not sit well with me. What exactly is it, and how can I protect my servers from it? $ \tan 1^\circ \cdot \tan 2^\circ \cdot \tan 3^\circ \cdots \tan 89^\circ$ How can I find the following product using elementary trigonometry?     $$ \tan 1^\circ \cdot \tan 2^\circ \cdot \tan 3^\circ \cdots \tan 89^\circ.$$   I have tried using a substitution, but nothing has worked. Should I not answer my own questions? I have a good intuition that $A$ is independent of $B$ if $P(A \vert B) = P(A)$, and I see how you can easily derive from this that it must hold that $P(A,B) = P(A)P(B)$.    But the first statement is not normally taken as a definition; instead the second is.    What is the intuition, or even derivation behind defining $A$ and $B$ as independent iff $P(A, B) = P(A)(B)$?    The kind of explanation I am looking for would be one similar to that given by Jaynes for the definition of conditional probability in the first chapter of Probability: The Logic of Science, or even a Kolmogorov axiomatic explanation would help. Where can I download Windows 7 (legally from Microsoft)? I just bought a serial for Windows 7 on-line from the Microsoft store (the most painful shopping experience EVER!). I selected that I wanted to download my version of Windows 7 after purchase. After payment, I have listed a Product Key but no download link in sight.   Where do I download my Windows 7 ISO to burn to disk?  Note: I'm not a Technet or MSDN subscriber. If a maximal subgroup is normal, it has prime index I'm having trouble with an exercise in "Introduce to the theory of group" book. This is problem:  Let $M$ be a maximal subgroup of $G$. Prove that if $M$ is a normal subgroup of $G$, then $[G: M]$ is finite and equal to a prime. What's the difference between mobile and desktop processors? I just read about the new Samsung Galaxy Note Edge having a 2.7&nbsp;GHz quad-core processor and 3GB of RAM.  The laptop I bought last year by HP is 4&nbsp;GB of RAM and 2.3&nbsp;GHz quad-core and my iMac is even older and is 2.5&nbsp;GHz i5.  Does this mean that the new Samsung gadget is more powerful than my desktop?  Is the 2.7&nbsp;GHz the same kind of GHz as non-mobile devices (is it scaled up, or compared, etc.)?  Why, in terms of power, do modern computers not have two of those Samsung quad-core processors running in parallel pushing out 5.4&nbsp;GHz processing power for the amount of electrical energy as two Galaxy Note batteries? Ratio test and the Root test What is the proper usage of "not only... but also"? I'm trying to figure out how to use "not only... but also" properly. Basically, my goal is to combine two clauses by using "not only".  For negations, I've figured out two styles that both sound correct:   He knew that if he fractures his finger, not only would he not be able to compete in the water polo tournament, he would not be able to take the SAT on Monday, either. He knew that if he fractures his finger, neither would he be able to compete in the water polo tournament, nor would he be able to take the SAT on Monday.   However, I don't know how to form a sentence that does not include a negation while using "not only". Here are a few possibilities that I've considered:   Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, but he was also given a full scholarship. Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, but he was given a full scholarship. Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, he was given a full scholarship. Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, he was also given a full scholarship.   In those four possibilities, I'm varying the usage of "but" and "also" in the last clause.  What is the proper usage of "not only"? Using CSS to affect div style inside iframe Show that every nonzero integer has balanced ternary expansion? Why does the $\sum_{n>1}(\zeta(n)-1)=1?$ While I was looking at the values of the zeta function for the first natural numbers, I noticed that the sum of the values minus $1$, converge to $1$. Better put: $$\sum_{n=2}^{\infty} \left(\zeta(n)-1\right) = 1 $$ Furthermore, if you use only the even numbers for the zeta function, the sum will converge to $\frac{3}{4}$, or $$\sum_{n=1}^{\infty} \left(\zeta(2n)-1\right) = \frac{3}{4}$$  Leaving $$\sum_{n=2}^{\infty} \left(\zeta(2n-1)-1 \right)= \frac{1}{4}$$  This is probably common knowledge among mathematicians, but I couldn't find much about it on the internet. Is there a proof of this or perhaps even a simple explanation why this is so? By the year 1582 vs in 1582 1.In 1582, scientists pointed out that the calendar was 10 days behind the sun      2.By the year 1582, scientists pointed out that the calendar was 10 days behind the sun.   I wanted to know the difference between "by the year 1582" and "in 1582". Ignoring accented letters in string comparison I need to compare 2 strings in C# and treat accented letters the same as non-accented letters. For example:  string s1 = "hello"; string s2 = "héllo";  s1.Equals(s2, StringComparison.InvariantCultureIgnoreCase); s1.Equals(s2, StringComparison.OrdinalIgnoreCase);   These 2 strings need to be the same (as far as my application is concerned), but both of these statements evaluate to false. Is there a way in C# to do this? I'm using R(3.1.1), and ARIMA models for forecasting. I would like to know what should be the &quot;frequency&quot; parameter, which is assigned in the ts() function, if im using time series data which is:  separated by minutes and is spread over 180 days (1440 minutes/day) separated by seconds and is spread over 180 days (86,400 seconds/day).  If I recall right the definition, a &quot;frequency&quot; in ts in R, is the number of observations per &quot;season&quot;. Question part 1: What is the &quot;season&quot; in my case? If the season is &quot;day&quot;, then is the &quot;frequency&quot; for minutes = 1440 and 86,400 for seconds? Question part 2: Could the &quot;frequency&quot;  also depend on what I am trying to achieve/forecast? for example, in my case, I'd like to have a very short-term forecast. One-step ahead of 10minutes each time. Would it then be possible to consider the season as an hour instead of a day? In that case frequency= 60 for minutes, frequency = 3600 for seconds? I've tried for example to use frequency = 60 for the minute data and got better results compared to frequency = 1440 (used fourier see link below by Hyndman)  (The comparison was made by using MAPE for the measure of forecast accuracy) In case the results are complete arbitrary, and the frequency cannot be changed. What would be actually the interpretation of using freq = 60 on my data? I also think it's worth mentioning that my data contains seasonality at every hour and every two hours (by observing the raw data and the Autocorrelation function) wrong numbering for subcaption in scrbook When using the scrbook document class in combination with the subcaption  package, the numbering of subfigures seems broken. Consider:  \documentclass{scrbook} \usepackage{xcolor} \usepackage{caption} \usepackage{subcaption} \captionsetup{%   format=hang,%   font=small,%   labelfont={sf,bf},%   aboveskip=0.2\normalbaselineskip,%   position=top } \pagestyle{empty}  \begin{document} \begin{figure}   \caption{Black}   \label{fig1}   \centering \rule{2cm}{2cm} \end{figure}  \begin{figure}   \caption{More figures}   \label{fig2}   \centering   \begin{subfigure}{.3\textwidth}     \centering     \caption{Blue}     \label{fig2a}     \color{red}\rule{2cm}{2cm}   \end{subfigure}   \begin{subfigure}{.3\textwidth}     \centering     \caption{Green}     \label{fig2b}     \color{green}\rule{2cm}{2cm}   \end{subfigure}   \begin{subfigure}{.3\textwidth}     \centering     \caption{Blue}     \label{fig2c}     \color{blue}\rule{2cm}{2cm}   \end{subfigure} \end{figure}  Figure \ref{fig1} shows a black box. Figure \ref{fig2} shows colored boxes, where Figure \ref{fig2a} shows a red box, Figure \ref{fig2b} shows a green box, and Figure \ref{fig2c} shows a blue box. \end{document}   This results in the following display:    Clearly, the figure numbering in the text references is off by one for the subfigures. Instead, if I change the document class to article, it looks fine:     Why does this happen, and how can I prevent it? Proof Check: Every Cauchy Sequence is Bounded How to minimize residual sum of squares of an exponential fit? I have the following data and would like to fit a negative exponential growth model to it:  Days &lt;- c( 1,5,12,16,22,27,36,43) Emissions &lt;- c( 936.76, 1458.68, 1787.23, 1840.04, 1928.97, 1963.63, 1965.37, 1985.71) plot(Days, Emissions) fit &lt;- nls(Emissions ~ a* (1-exp(-b*Days)), start = list(a = 2000, b = 0.55)) curve((y = 1882 * (1 - exp(-0.5108*x))), from = 0, to =45, add = T, col = "green", lwd = 4)   The code is working and a fitting line is plotted. However, the fit is visually not ideal, and the residual sum of squares seems to be quite huge (147073).   How can we improve our fit? Does the data allow a better fit at all?  We could not find a solution to this challenge on the net. Any direct help or linkage to other websites/posts is greatly appreciated. Currently, when flagging an off-topic question, the following choices are offered.   Questions about general computing hardware and software are off-topic for Stack Overflow. Questions concerning problems with code you've written must describe the specific problem and include valid code to reproduce it. Questions must demonstrate a minimal understanding of the problem being solved. Questions on professional server, networking, or related infrastructure administration are off-topic for Stack Overflow unless they directly involve programming or programming tools. Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. This question belongs on another site in the Stack Exchange network   However, there are some questions that fit in none of these categories.  For example, career advice questions are off-topic here (and on programmers.SE), questions like  are off-topic on pretty much any SE site.    Some questions might also be relevant on another SE site not listed when the "belongs on another site" option is selected.  How should those questions be flagged?  Why isn't there a "it's off-topic because it is" option?  EDIT: just to be clear, I don't have the "Other" option under Off-Topic.