A simple click event is not firing on my list items with the following line of code:  $("ol &gt; li").on("click", listItemClickEventHandler);   To break down the problem, I cached the reference to the query selector first and then called the on function on it.  The query selector does return an object but I can't tell if that's the right object to set the handler on except for the fact that I've done this a million times in the past and it has worked.    function showAllCookies() {   $("ol").empty();   let all = []; //getAllCookies();   if (all) {     for(let cookie of all) {       $("ol").append(`&lt;li&gt;${cookie}&lt;/li&gt;`);     }   } else {     $("ol").append(`There are no cookies to display.`);   } }  $(btnSave).on("click", function(event) {  // create cookie });  $("input[type='text']").on("keyup", function(event) {   // trigger save });  $("ol &gt; li").on("click", listItemClickEventHandler);  function listItemClickEventHandler(event) {   let key = event.target.id;   $("#txtCookieName").val(key);   // to do   $("#txtCookieValue").val(""); }  showAllCookies(); .header {   font-size: 1.4rem;   font-weight: bold; } input[type="text"] {   width: 200px;   margin: 10px; } #errorMessage {   color: red; } li:hover {   cursor: pointer; } &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.js"&gt;&lt;/script&gt; &lt;div&gt;   &lt;div class = "header"&gt;All Cookies&lt;/div&gt;   &lt;ol&gt;   &lt;/ol&gt; &lt;/div&gt;  &lt;div&gt;   &lt;div class = "header"&gt;Enter a key and value to create a new cookie or to update an existing one&lt;/div&gt;    &lt;div id = "errorMessage"&gt;&lt;/div&gt;   &lt;input type = "text" id = "txtCookieName" value = "" placeholder="cookie name"/&gt;&lt;br /&gt;   &lt;input type = "text" id = "txtCookieValue" value = "" placeholder="cookie value"/&gt;   &lt;button id = "btnSave"&gt;Save&lt;/button&gt; &lt;/div&gt;
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.
Is $v=\ (r_i)^{-1}\cdot z $, a uniformly random value of a field? We consider a finite field $\mathbb{F}_q$ where $q=2p+1$ and $q$ and $p$ are prime numbers.  Let $r_i$ be a value picked uniformly at random from the field such that $r_i&gt;\frac{q}{2}$. Let $z$ be a fixed field element.   Question: Is $v=(\ (r_i)^{-1}\cdot z) \bmod q$, a uniformly random value of the field? Getting an error in W3C Markup Validation when trying to get a whole  element as a link in a page Escape velocity from a rotating black hole Under Newton, the escape velocity is  $$v_{esc} = \rm c \ \sqrt{r_s/r}$$  where $\rm r_s=2 \ GM/c^2$. In the nonrotating relativistic case (the Schwarzschild case) the radial escape velocity is the same:  $$v^{\parallel}_{esc} = \rm c \ \sqrt{r_s/r}$$  which is the speed of light, $v={\rm c}$, at the event horizon at $\rm r=r_s$. Since the photon sphere, where an object with $v={\rm c}$ would not escape, but be captured into orbit, is at $r=3 \ {\rm GM/c^2}$, the transverse escape velocity is  $$v^{\perp}_{esc} = \rm c \ \sqrt{r_s/r}\div \sqrt{1-r_s/r}$$  and for the observed (shapiro delayed) velocity ${\rm v}$ the transformation is  $${\rm v}^{\perp}=v^{\perp} \ \sqrt{\rm 1-r_s/r} \ , \ \ {\rm v}^{\parallel}=v^{\parallel} \ (\rm 1-r_s/r)$$  so the observed angular motion is the same as with Newton, yet locally higher, while the observed radial motion is slowed down because of the radial length contraction and time dilation.  But what about the Kerr case where the rotation is significant and the event horizon is at $\rm r=(1+\sqrt{1-a^2}) \ {\rm GM/c^2}$ instead of $\rm r=r_s$?  A testparticle which is locally at rest and therefore corotating with the angular velocity of the frame dragging  $${\Omega = \rm d \phi/ {\rm d t} = {\rm 2 \ a \ r/((a^2+r^2)^2-a^2 (a^2+(r-2) \ r) \sin ^2(\theta ))}}$$  should experience the time dilation factor  $$\rm \dot t = {\rm d t}/ {\rm d}\tau = \sqrt{{\rm ((a^2+(r-2) \ r) (a^2 \cos ^2(\theta )+r^2))/((a^2+r^2)^2-a^2 (a^2+(r-2) \ r) \sin ^2(\theta ))}}$$  relatively to the far away observer, so multiplying $\Omega$ with $\rm \dot t$ should give the local frame dragging angular velocity, which, multiplied with the $\rm \sqrt{x^2+y^2}$ value of the Boyer-Lindquist to cartesian transformation should give the transverse velocity - this is slightly below $\rm c$ for a maximaly rotating black hole (with $\rm a = 1$ - at the edge of the outer equatorial ergosphere where $\rm r=1$ and $\rm R=\sqrt{r^2+a^2}$).  But how do I find the radial and total escape velocity, and what are the rules to convert the shapiro-delayed coordinate velocities $\rm d r/d t \ , \ d \phi/d t \ , d \theta/d t$ to the local 3-velocity components $v^{\parallel}$ and $v^{\perp}$ of a test particle (local meaning relatively to a frame dragged probe with contant $\rm r$)? The radial length contraction seems a bit different than in the Schwarzschild-case, where it is the same as the gravitational time dilation factor... Check if a class is derived from a generic class I have a generic class in my project with derived classes.  public class GenericClass&lt;T&gt; : GenericInterface&lt;T&gt; { }  public class Test : GenericClass&lt;SomeType&gt; { }   Is there any way to find out if a Type object is derived from GenericClass?  t.IsSubclassOf(typeof(GenericClass&lt;&gt;))   does not work. How to prove  $$\int_{0}^{\infty} \mathrm{e}^{-x^2}\, dx = \frac{\sqrt \pi}{2}$$ Spacing problem at List of Figures To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action.  So, what's the correct way of doing such a thing? I've tried  panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPanelBelongsTo.pack();   but this won't work. What would you suggest? Overfitting a logistic regression model What are some of the rule changes that Pathfinder brings in comparison to D&amp;D 3.5?  I am curious what changes were made so I can explain to my group what it has to offer. What is the difference between necessary and sufficient conditions? If $p\implies q$ ("$p$ implies $q$"), then $p$ is a sufficient condition for $q$. If $\lnot p\implies \lnot q$ ("not $p$ implies not $q$"), then $p$ is a necessary condition for $q$.   I don't understand what sufficient and necessary mean in this case. How do you know which one is necessary and which one is sufficient? What is the use/meaning of 'swap area' while linux installation? When i installed ubuntu in my x86 machine, I had to configure some memory as 'swap area'.  What is the use of this memory and what is the importance of this memory in linux file systems?  How can I determine the exact size of 'swap area' in a machine for the safe working of linux inside in it? What is the difference between Θ(n) and O(n)? Sometimes I see Θ(n) with the strange Θ symbol with something in the middle of it, and sometimes just O(n). Is it just laziness of typing because nobody knows how to type this symbol, or does it mean something different? 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? My office is a converted garage about 30 feet from my house.   I have a coaxial cable already running from my house to the office.   I want to attach a Ethernet cable from my DSL modem, in my office, to a computer in my house.   Since I already have the coaxial cable installed, I bought two coax to Ethernet converters (NVA-P-860-BP78 Video Balun), but when I hooked them up I am getting no signal. It was my understanding that an Ethernet signal could travel over a coaxial cable.   Is that wrong? Any ideas why this isn't working? Don't we have single sign-on for all Stack Exchange sites? I would like to use many sites in the Stack Exchange network, but I need to login to each site separately. Though it's easy, can't we solve this problem? I know each site has a different url :( but is there any way? I have a query pattern that must be very common, but I don't know how to write an efficient query for it.  I want to look up the rows of a table that correspond to "the most recent date not after" the rows of another table.  I have a table, inventory say, which represents the inventory I hold on a certain day.  date       | good | quantity ------------------------------ 2013-08-09 | egg  | 5 2013-08-09 | pear | 7 2013-08-02 | egg  | 1 2013-08-02 | pear | 2   and a table, "price" say, which holds the price of a good on a given day  date       | good | price -------------------------- 2013-08-07 | egg  | 120 2013-08-06 | pear | 200 2013-08-01 | egg  | 110 2013-07-30 | pear | 220   How can I efficiently get the "most recent" price for each row of the inventory table, i.e.  date       | pricing date | good | quantity | price ---------------------------------------------------- 2013-08-09 | 2013-08-07   | egg  | 5        | 120 2013-08-09 | 2013-08-06   | pear | 7        | 200 2013-08-02 | 2013-08-01   | egg  | 1        | 110 2013-08-02 | 2013-07-30   | pear | 2        | 220   I know one way of doing this:  select inventory.date, max(price.date) as pricing_date, good from inventory, price where inventory.date &gt;= price.date and inventory.good = price.good group by inventory.date, good   and then join this query again to inventory. For large tables even doing the first query (without joining again to inventory) is very slow.  However, the same problem is quickly solved if I simply use my programming language to issue one max(price.date) ... where price.date &lt;= date_of_interest ... order by price.date desc limit 1 query for each date_of_interest from the inventory table, so I know there is no computational impediment.  I would, however, prefer to solve the whole problem with a single SQL query, because it would allow me to do further SQL processing on the result of the query.  Is there a standard way to do this efficiently? It feels like it must come up often and that there should be a way to write a fast query for it.  I'm using Postgres, but an SQL-generic answer would be appreciated. Is there a way in photoshop to convert k values to alpha values? Basically, I would like to make it so that the lighter a pixel is (the more white it has) the more transparent it becomes. Black pixels would be opaque, white pixels would be transparent.  I currently use the slider in blending options on the first tab to get rid of the white and make it transparent but find it works slightly better if I use the magic wand tool with delete.  I figure that there is some blending option out there but there are so many and I'm not sure which to use to achieve my goal.  (Using Photoshop CS6) How do I install an individual package on a Linux system? I need to install a new TeX/LaTeX/ConTeXt package on my computer.  I'm running Ubuntu/Fedora/Slackware/Some-Version-Of Linux.  What are the possible ways to do this?    Note:&nbsp;&nbsp; We get a number of questions that essentially reduce to this one; it was felt a good idea to have one question-and-answer that can cover all the standard methods.  See  for the discussion.  The question-and-answer are CW so that more information can be easily added.  If you have information to add, please do so.  If you are unsure, leave a comment here or (preferably) in .  Comments on the question and answer will be periodically removed to ensure that the information is clear. Merge pdfs sequentially I would like to merge 4 pdfs, pdf1.pdf, pdf2.pdf, pdf3.pdf pdf4.pdf together so that the pdfs are spliced, i.e. the first page will be the first page of pdf1, the second the first of pdf2, the third the first of pdf3, etc.  The pdf files are with plain images, no table of contents.  How would I accomplish this? It would be nice to do it from Terminal as well. How do I install wine?