jQuery event run increasing on each event click I have the below HTML and jquery snippet, the new rows are added correctly and the the rows are deleted when clicked on which is expected but for the .delete_row click it isn't calculated the row count correctly after a row is deleted.  So say I have added 3 custom rows, I click to delete one row, it will delete and a alert box will display, if I click to delete a second row the process will alert twice and when I click to delete the third row the alert will pop up 3 times.  A single alert should only ever display when one row is removed but it's like the delete a row is incrementing by one on each run, cant see why though!?    $("#add_row").on("click", function(e) {   e.preventDefault();    var row_num = $(this).data("id");   var row_limit = 50;   var code_snippet = '&lt;div class="row"&gt;&lt;dd&gt;' + row_num + '&lt;/dd&gt;&lt;dt&gt;&lt;span class="delete_row" title="Delete Custom Row"&gt;&lt;i class="fas fa-times"&gt;&lt;/i&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/div&gt;';    if (row_num &lt;= row_limit) {     $("#count").val(row_num);      $(code_snippet).insertBefore("#base");      row_num += 1;      $(this).data("id", row_num);   }    if (row_num &gt;= row_limit) {     // Disable button once limit reached     $(this).attr("disabled", true).addClass("disabled");   }    $(".delete_row").on("click", function(e) {     $(this).parent().parent(".row").remove();      alert("Deleted Row");      $("#add__row").data("id", ($("#add__row").data("id") - 1));   }); }); &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt; &lt;fieldset&gt;   &lt;dl&gt;     &lt;div class="row row_header"&gt;Header Title&lt;/div&gt;      &lt;div class="row align_right" id="base"&gt;       &lt;input type="hidden" name="count" id="count" value="0" /&gt;       &lt;button id="add_row" data-id="1"&gt;Add New Row&lt;/button&gt;     &lt;/div&gt;   &lt;/dl&gt; &lt;/fieldset&gt;
Event binding on dynamically created elements? 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.
What is the proper way to re-throw an exception in C#? I have a question for you that stems from my partner doing things a different way than I do.  Is it better to do this :  try {     ... } catch (Exception ex) {     ...     throw; }   or this:  try {     ... } catch (Exception ex) {     ...     throw ex; }   Do they do the same thing? Is one better than the other? Is my Ubuntu vulnerable to SambaCry? I read these two threads:         And I got a little bit worried, is my Ubuntu machine safe? Or am I vulnerable to this vulnerability?  The second article mentioned that:     The flaw actually resided in the way Samba handled shared libraries.   The other thing that they say is all versions from versions 3.5.0 onwards since 2010 are vulnerable.     At that time, nearly 485,000 Samba-enabled computers were found to be exposed on the Internet, and researchers predicted that the SambaCry-based attacks also have potential to spread just like WannaCry ransomware widely.   .   I don't have a samba server however I've got samba-libs package installed.  What, if anything, should I do?  I'm running Ubuntu 16.04. Questions like looking for css templates, blog templates, icons ... In general, resources (let's leave the licensing terms aside for now) which you might need when building a project of your own. Where should those questions go?  They're definitely not on-topic on Stack', SuperUser maybe although I doubt it. Webapps? Hmm, probably not.  Is there a place where they would be on-topic on the SE network? I shall come, not will Native speakers, how can you comment such a sentence:  I shall come, not will  Can I use it for  I will definitely come, not maybe    Adding some information other people asked me about.  How I came to such a question.  Here   I asked about "Shall I win?" pointing that it could have some variants of understanding:  1) Shall I win? = Should I win? (suggestion)  2) Shall I win? = Will I win? (archaic with 1st person)  3) Shall I win? = is it 100% that I will win? (predestination\inevitability)  The excellent guy Mixolydian said either variant was possible, that it didn't matter what person you used "shall" with, it could have this "predestination\inevitability" anyway. Out of this we're getting that nowadays we can use "will" for simple future actions and "shall" for almost predicted (almost 100% surety of happening) future actions.  If I want to say to someone:  Don't be afraid, I will come anyway.  Don't get panicked, I will definitely come  Be sure, I will come in any case  I can use "shall" for it meanining an action into which I will put 100% effort:  I shall come!  And what if my original sentence is  Don't doubt, I will definitely come, not maybe or probably  Can I use  I shall come, not will  pointing that "shall" guarantees me putting all my strengths into it while "will" doesn't give any assuarance that I will do everything to finally come.  As I understood, it wasn't very easy to ask such a question because English was different everywhere - US, UK, Australie, Ireland etc. I heard it was acceptabse to use even "thee\thou" in Ireland or somewhere like that while all other world has already forgotten such words...  P.S. What I got from the answers ias that it was better to forget about the existence of "shall" cause it created so many misunderstandings:D How many digits does $2^{1000}$ contain? I tried this way, I only need to know if this is correct or if there are better ways to solve this:  $2^{1000}$ does not have a factor of $5$ obviously therefore we can assume  $$ 10^{m} &lt; 2^{1000} &lt; 10^{m+1}$$ for some  $m$   Assume $ k = 2^{1000}$, then take log on both sides $\log k = 1000  \log 2 \approx 301.02999 &gt; 301$  Therefore $2^{1000}$ has $302$ digits. Are positive real numbers $x,y$ allowed to be taken out during this proof? Prove $$\left(x^2 - y^2\right)\left(\frac1y - \frac1x\right) \ge 0$$ where $x$ and $y$ are positive real numbers.   Can I simplify $\frac{(x^2 - y^2)(x-y)}{xy} \ge 0$ and then $(x^2 - y^2)(x-y) \ge 0$ cancelling out the $xy$?  Is this valid because then  \begin{align} (x+y)(x-y)(x-y)&amp;\ge  0\cdot(x-y)^2\ge 0 \end{align}  which is always true and then prove backwards from here? Using principal component analysis (PCA) for feature selection Errors in matrix equation? I'm getting errors in a matrix equation. When I compile it looks fine, but I'd like to fix them so I don't have to press return for every error at compile time. The code for the equation is:  \begin{equation*}  \begin{bmatrix} U(1,t)  &amp; \cdots &amp; U(n,t) \\  \vdots &amp; \ddots &amp; \vdots \\ O_{n1} &amp; \cdots &amp; O_{nn}  \end{bmatrix} \times \begin{bmatrix} W(1,1)  &amp; \cdots &amp; W(1,n) \\  \vdots &amp; \ddots &amp; \vdots \\  W(n,1) &amp; \cdots &amp; W(n,n)  \end{bmatrix} = \begin{bmatrix}  D(1,t)  &amp; \cdots &amp; D(n,t) \\ \vdots &amp; \ddots &amp; \vdots \\ I_{n1} &amp; \cdots &amp; I_{nn} \end{bmatrix}  \end{equation*}   The errors I'm getting are related to missing $'s inserted. Decompose vector fields on product manifolds So, I know that tangent bundle of a product manifold $M \times N$ splits in a sum $$ T_{(x,y)}(M \times N) = T_xM \oplus T_yN, $$ so that is obvious that the sum $X \oplus Y$ of smooth vector fields $X \in \mathcal{T}(M)$ and $Y \in \mathcal{T}(N)$ is a smooth vector field of $M \times N$. I've been told that, though not every vector field in $\mathcal{T}(M \times N)$ is a sum, locally one can always find one such decomposition, which will in turn be unique due the fact the sum is a direct one.   How can I show that this decomposition exists locally? More than that, if $X = X_1 + X_2$ is the decomposition, is there a way the express the coordinate functions of $X_1$ and $X_2$ in terms of those of $X$?   First I thought about taking two frames that locally spam $TM$ and $TN$ and write down $X$ using them, but then the coordinate functions are of the form $X^i: M \times N \to \mathbb R$, and the vector field components in each subspace are not exactly fields of $M$ and $N$ because their coordinate functions don't have the right domains. Is there another better way to see this decomposition holds locally? After my lie down, I posted  on SO. As I suspected would happen, it got moved to programmers. Unfortunately, the kind of people I'm interested in getting answers from (litb,skeet et al - the top SO programmers in their respective disciplines) don't frequent Programmers much. So my question is, where to ask somewhat non-specific questions of high-powered users? Stuck at 0% [waiting for headers] On googling this error it seems that a lot of people are having this issue.  apt-get upgrade hangs at 0% [waiting for headers] apt-get install apache2 hangs at 0% [waiting for headers]. Some apt-get commands are working, but only certain packages.  Any ideas? I don't think this is an issue with slow repos because I've had it up for a long while and it hasn't budged from 0%. I have edited sources.list but I removed the lines I added when this issue presented itself and it hasn't made a difference.  Any clues would be really useful. How do I run two isolated instances of firefox? For testing purposes, I want to install two different instances of firefox on ubuntu - so that they don't share cookies. (I want to simultaneously login with both instances as different users to our website).  How do I do that? I do it with Firefox &amp; Opera, but I prefer Firefox (because of firebug). What is an "AppImage"? How do I install it? I just read . It talks about downloading an AppImage.     Yes, Linux; the Linux packages is distributed as an .appimage for 32-bit and 64-bit distributions, and should run across all major Linux distributions without any issues. The team currently have no plan to provide a native .deb (or .rpm) installer.   What are AppImages? How do they differ from snaps? How quickly is the desired state of curl of the Electric Field around a point achieved where a Magnetic Field Vector has just begun changing? My question and context with explanation are given below. Thank you in advance.   Faraday’s Law () states that a time-changing magnetic field vector induces a curl of the Electric field around that point. However it does not specify how quickly the necessary spatial gradient is developed in the Electric Field to satisfy that curl. Of course, the Electric Field vectors around that point cannot just jump to the required values instantaneously in accompaniment as soon as the magnetic field starts changing at a fixed rate, since it is required that the Electric Field has a sensible rate of change to in turn induce a curl of the magnetic Field and continue the propagation of the wave. It would seem the exact rates at which the Electric and Magnetic Fields are changing is critical in the mechanism of an EM wave’s propagation. How would I then calculate the rate of change of E somewhere along the wave given I know the rate of change of the B vector that began it, and given the wave is restricted to one dimension for simplicity? There should after all be some delay in how the EM wave moves from point to point in space, seeing as it moves at the finite speed of causality (3*10^8 m/s), as shown in the first image:    Some of my ideas so far have been that perhaps the rate of change of E is determined such that it exactly cancels the growth of the time-changing E vector that gave rise to a curl of B before, which developed at such a rate to induce a curl of E, which demands this rate of change of E which I am talking about now. In this way the wave might level out the growth of the fields in its wake and spread the change further outwards, in the same way smoothening out a crease spreads it elsewhere. However I am stuck on how to show this rigorously.  I am open to any difficulty of maths, so long as the answer provides the explanation. Below are some diagrams to help visualize what I am talking about:    Faraday's Law requires that a curl of E is developed, which under these restrictions requires a spatial gradient of E to appear across that point. Since the field across that point was previously in some other state, it is required that the Electric Field vectors that are infinitesimally close to that point undergo a rate of change through time to achieve the desired state of curl. The question is, how quickly is this desired state of curl achieved? If $f$ is continuous with $f(x) = f(2x),f(1) = 3$, then what is $ \int_{-1}^{1}f(f(x))\,dx$? If $f(x)$ is a continuous function such that $f(x) = f(2x)$ and $f(1) = 3\;,$ Then $\displaystyle \int_{-1}^{1}f(f(x))\,dx$   $\bf{My\; Try::}$ Here $-\infty &lt;x&lt;\infty$ and Given $f(x) = f(2x)$  So Using Recursively $$\displaystyle f(x) = f(2^1x)=f(2^2x)=..........=\lim_{n\rightarrow \infty}f\left(2^{n-1}x\right)$$   OR we can write it as $$f(x) = f\left(\frac{x}{2}\right)=f\left(\frac{x}{2^2}\right)=........=\lim_{n\rightarrow \infty}f\left(\frac{x}{2^{n-1}}\right)$$  Now How can i prove that $f(x)$ is a constant function.  Help me  Thanks Code   find / -name netcdf   Output  find: `/root/.dbus': Permission denied find: `/root/.gconf': Permission denied find: `/root/.gconfd': Permission denied find: `/root/.gnome': Permission denied find: `/root/.gnome2': Permission denied find: `/root/.gnome2_private': Permission denied Using OR comparisons with IF statements When using IF statements in Python, you have to do the following to make the "cascade" work correctly.  if job == "mechanic" or job == "tech":         print "awesome" elif job == "tool" or job == "rock":         print "dolt"   Is there a way to make Python accept multiple values when checking for "equals to"? For example,  if job == "mechanic" or "tech":     print "awesome" elif job == "tool" or "rock":     print "dolt" how to disable system apps without root? How to disable system apps without root?  My phone model is vivo x5 max+ and android 4.4.4  I have tried Debloater but it failed to connect (I am sure I've allowed USB debugging). How do you convert a byte array to a hexadecimal string, and vice versa? Regex: match everything but specific pattern