I'm trying to build my first "serious" webpage. I have just started and I stuck on applying old event listeners on new div section. I would like to apply all old listeners on $(".novo").append("new div ..")  I have tried to use on() functions but it doesn't seem to work.  And also I have issues when adding new list. It adds to every present div. I want to add it only on clicked div.  &lt;body&gt;   &lt;button class="novo"&gt;Novo&lt;/button&gt; &lt;div class="container"&gt;   &lt;div class="grupa"&gt;     &lt;h1&gt;To-Do List&lt;span id="form"&gt;&lt;i class="fas fa-edit"&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h1&gt;     &lt;input type="text" placeholder="Add New Todo"&gt;     &lt;ul&gt;       &lt;li&gt;&lt;span&gt;&lt;i class="fas fa-trash-alt"&gt;&lt;/i&gt;&lt;/span&gt; Sabah&lt;/li&gt;     &lt;/ul&gt;   &lt;/div&gt;   &lt;script type="text/javascript" src="Assets\JS\projekt.js"&gt;   &lt;/script&gt; &lt;/body&gt;   jS:  $("ul").on("click", "li", function(){   $(this).toggleClass("completed"); }); $("ul").on("click", "span", function(event){   $(this).parent().fadeOut(500, function(){     $(this).remove();     });   event.stopPropagation(); }); $("input[type='text']").keypress(function(key){   if(key.which === 13){   var todoText = $(this).val();   $("ul").append("&lt;li&gt;&lt;span&gt;&lt;i class='fas fa-trash-alt'&gt;&lt;/i&gt;&lt;/span&gt; " + todoText + "&lt;/li&gt;");   } }); $("#form").click(function(){     $("input[type='text']").fadeToggle(150); }); $(".novo").on("click", function(){   $(".container").append("&lt;div class='grupa'&gt;&lt;h1&gt;To-Do List&lt;span id='form'&gt;&lt;i class='fas fa-edit'&gt;&lt;/i&gt;&lt;/span&gt;&lt;/h1&gt;&lt;input type='text' placeholder='Add New Todo'&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;i class='fas fa-trash-alt'&gt;&lt;/i&gt;&lt;/span&gt; Sabah&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;"); });   Thank You!!
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.
Select first occurring element after another element How to open a particular port in ubuntu? My SoulSeek client Nicotine+ checks my open ports during initial configuration and promts that the one port number it needs is closed, cutting me off frmo about 50% of the users. Is there anyway I can open that particular port for the application to use?  RUnning ubuntu desktop 13.04. I have not manually installed any firewalls, but not sure if its included in the default installation. Do fluorescent lighting and shutter speed create a problem with color cast? I took a bunch of photos at my son's martial arts club using a D90 with a 50mm F1.8.  The club is lit with overhead fluorescent lighting, and I was getting some weird results where some shots are "white", others have an "orange cast", and still others are partly white and partly orange in the same shot.  I suspect it has to do with the combination of the frequency of the light flicker and with the camera shutter speed. Here is a sequence of 3 shots that show the problem.  The shots were taken with 1/500s at F2 and ISO-800 and with Auto-WB.  First shot ("white/normal"):    Second shot ("orange cast" at top):   Third shot ("orange cast" at bottom):   These were taken in burst mode within a second of each other.  Can anybody tell me what is going on?  And, how I can avoid this? How do I evaluate several n-th derivatives of a function at one point? How to count number of bases and subspaces of a given dimension in a vector space over a finite field? Let $V_{n}(F)$ be a vector space over the field $F=\mathbb Z_{p}$ with $\dim V_{n} = n$, i.e., the cardinality of $V_{n}(\mathbb Z_{p}) = p^{n}$. What is a general criterion to find the number of bases in such a vector space? For example, find the number of bases in $ V_{2}(\mathbb Z_{3})$. Further, how can we find the number of subspaces of dimension, say, $r$?   I need a justification with proof. I have a formula, but I am unable to understand the basic idea behind that formula. Given that $X,Y$ are independent $N(0,1)$ , show that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}}$ are independent $N(0,\frac{1}{4})$ It is given that $X,Y \overset{\text{i.i.d.}}{\sim} N(0,1)$  Show that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}} \overset{\text{i.i.d.}}{\sim} N(0,\frac{1}{4})$  I was thinking of making polar transformations $X=r \cos \theta, Y=r \sin \theta$  Then I am getting stuck at ranges of $\theta$ Example where schema are better than multiple databases In several database systems (e.g., PostgreSQL and MS SQL Server) there is a concept of schema. There are many questions out there asking what schema are and how they are used; here is a . Usually the answer boils down to "namespace" and "permissions". However, what remains unclear to me is why a schema has any advantage over just adding a new database. A different database allows one to have both separate namespaces and permission assignments.  Can someone provide an example in PostgreSQL where multiple schema in a single database provide an advantage over multiple databases without schema? From a purely organizational perspective they appear equivalent. I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. &lt;body&gt;     &lt;div&gt;Div to be aligned vertically&lt;/div&gt; &lt;/body&gt;  How can I center a div vertically in all major browsers, including Internet Explorer 6? Mac asking for password for some files when deleting This happens not for all files. When I move or delete some of the files on my external drive Finder will ask for password. Is it due to permission set on these files ? Can I use something like Sudo when running Finder to prevent these pop ups ? The reason I'm asking is that sometimes I leave the mac running to move some files from one disk to another, just to find it on the password prompt a few hours later. Thank you. How would you make a comma-separated string from a list of strings? What would be your preferred way to concatenate strings from a sequence such that between every two consecutive pairs a comma is added. That is, how do you map, for instance, ['a', 'b', 'c'] to 'a,b,c'? (The cases ['s'] and [] should be mapped to 's' and '', respectively.)  I usually end up using something like ''.join(map(lambda x: x+',',l))[:-1], but also feeling somewhat unsatisfied. Some mesh-edges in object-mode aren't displayed So I have been extruding a cube to make a low poly banana and when I go from edit to object mode half the edges don't appear as well as half is dark.      I tried looking for an solution couldn't find one and its making me feel like I am doing something wrong so I decided to come here. Why doesn't Normal[] work on GeometricTransformation? CSH - How to check if input is NOT number Need to apply it on csh.  to check if the inputted $2 is not number nor the word "all"  if ($#argv == 2 &amp;&amp; ($2 != all &amp;&amp; $2 != **any number**)) then    echo "wrong parameter" I am currently working through the problems in , with the goal of hopefully understanding how magnets work. At the moment I am a little stuck on one of the early problems in the first chapter. And I would like a Hint about how to proceed. The problem is to solve the time derivative of the expectation value of momentum of a particle. ie: $$ \frac{d\left&lt;p\right&gt;}{dt}. $$ My working so far Just prior to that question the text gives an expression for momentum, $$\int\limits_{-\infty}^{+\infty}{\Psi^*\left[-i\hbar \frac{\partial}{\partial x}\right]\Psi}dx, $$ (Where $\Psi$ is a function satisfying Schrödinger's equation, $i$ is the square root of negative 1, and $\hbar$ is Planck's constant divided by $2\pi$.) So my initial approach was to try and differentiate this with respect to $t$. $$ \frac{d}{dt}\int\limits_{-\infty}^{+\infty}{\Psi^*\left[-i\hbar \frac{\partial}{\partial x}\right]\Psi}dx. $$ However I didn't know how to do that, so I asked around in the maths chatroom, and got a lot of help. Specifically  from @RobJohn: $$ \begin{align} \int vv'\,\mathrm{d}x &amp;=vv-\int vv'\,\mathrm{d}x\\ &amp;=\frac12vv+C \end{align} $$ So I suppose it would follow that, $$ \begin{align} \int\limits_{-\infty}^{+\infty}{         \left(             \Psi^*                 \left[                     \frac{\partial}{\partial x}                 \right]             \Psi         \right)         }\,\mathrm{d}x &amp;=  \left[\Psi^* \cdot \Psi\right]_{-\infty}^{+\infty} - \int\limits_{-\infty}^{+\infty} {\Psi\frac{\partial \Psi^*}{\partial x} }\,\mathrm{d}x\\ &amp;= \frac{1}{2}|\Psi|^2 \Big|_{-\infty}^{+\infty}, \end{align} $$ And then, $$ \begin{align} &amp;\frac{d}{dt}\int\limits_{-\infty}^{+\infty}{\Psi^*\left[-i\hbar \frac{\partial}{\partial x}\right]\Psi}dx \\&amp;=-i\hbar \frac{d}{dt}\left( \frac{1}{2}|\Psi|^2 \Big|_{-\infty}^{+\infty} \right). \end{align} $$ But this feels wrong. I'm not sure exactly why. (Maybe it's just because it is the limits of my maths)  For reference, regarding what I understand, my maths is pretty low-level, I took a course in undergrad calculus over 10 years ago and only just passed that at the time, and my physics knowledge is not much further than that of an enthusiastic lay person. Is there a way to "hide" a normal windowed application in Windows?  I'm looking for something that removes it from the taskbar and possibly puts an icon in the system tray instead. How to show $A\times (B\cup C) = (A\times B)\cup (A\times C)$ How do I find the Arch-mage at the end of the quest "Under Sarhaal"? I'm trying to solve an exercise about first order stochastic dominance, and there is this one question that I'm not able to answer.  Here are the hypothesis of the exercise:  Let Y ∼ F and Y' ∼ G, that means Y (resp. Y') has a probability law given by the distribution function F (resp. G).  Assume that Y ≥ 0 and Y' ≥ 0 and E(Y) + E(Y')&lt; ∞.  Here comes the question:  -Show that if the survival function of Y first order dominates over the survival function of Y', then if Y and Y' are independent, we have P(Y ≥ Y') ≥ 1/2.  I don't see how to use that Y and Y' are in this case independant.  Maybe I should set X=Y-Y' and then use the convolution?  Any help, would be appreciated, thanks !  Alex Relationship between Partial Harmonic Sum and Logarithm. How to prove ${n \choose p} \equiv\left\lfloor \frac{n}{p} \right\rfloor\pmod p$ Prove ${n \choose p} \equiv \left\lfloor \frac{n}{p} \right\rfloor \pmod p$   ($n$ is natural and $p$ is a prime number)  How can i prove this statement?