Why is the link not working if the link is created with javascript? It only works if I make the link without the html() output  Not working  $(".link").on('click', function(){     alert('Hello'); });  $("#link").html('&lt;a href="#" class="link"&gt;Link&lt;/a&gt;');  &lt;div id="link"&gt;&lt;/div&gt;   Working  $(".link").on('click', function(){     alert('Hello'); });  &lt;a href="#" class="link"&gt;Link&lt;/a&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.
How to export variable for use with sudo? On Slackware, using sbopkg permits one to build a package from source. Repos is not big as Debian, but it's nice.  Some software can use environment variables, for example on the VICE c64 emulator, if the variable FFMPEG is set to yes, it will enable ffmpeg recording the emulator.  I tried to use  $ export FFMPEG=yes; sudo sbopkg -B -i vice   but ffmpeg is disabled.  Instead I had to use  $ su - $ export FFMPEG=yes $ sbopkg -B -i vice   which works.  How to use environment variables with sudo? How to divide aleph numbers Recently, I was wondering how division of aleph numbers would work. First, I thought about how finite cardinality division would work. What I came up with was that the result of $A/B$ where $A$ and $B$ are both cardinalities, is the number of times that each element of $B$ had to be mapped to an element of $A$ in order to ensure that all elements of $A$ were mapped to.  Extending this to aleph numbers, specifically, I thought that $\aleph_1/\aleph_0$ would be $\aleph_1$. The reasoning behind this is that there are an infinite ($\aleph_1$) number of real numbers between any two natural numbers. As such, that mapping would need to be applied.  Can anyone validate this idea? Is this how division of aleph numbers actually works, or am I totally off base?  Thanks. strange character replacement on SO I added a comment to  but something strange is happening. The end code reads "); but SO decided to change that to ";);.    I did not add a ; in front of the ).  To further explain what's happening here, the following:  "http://example.com/." http://example.com/. "http://example.com." http://example.com. "http://example.com" http://example.com   renders as: Is the unit sphere in $\Bbb R^4$ path connected? Using continuous color band for raster legend in QGIS composer legend? I'm looking for a way to insert continuous colour legend for a raster layer.  I managed to create discrete symbols with values along the bar, but I would like to have a continuous bar with some values on the bar, similar to the old plugin "One-Band Raster", that it doesn't work with the QGIS version higher than 1.7  I tried to set in properties->style, where I selected the  Render Type "Singleband pseudocolor" and see the "generate new color ramp" box.  I tried both "Continuous" or "Equal interval". However, in the Composer the legend always is displayed with discrete symbols.  Is there any way that can make QGIS Composer to display a nice continuous band for a raster layer? I'm a bit confused on how extra damage works for critical hits. Let's take the following example: A thief with sneak attack rolls a crit. I'm under the impression he rolls double his normal attack damage dice AND double his Sneak Attack damage dice. Is this accurate? Another example, I finished DM-ing my first campaign recently. The Giant Spider enemy monster has an melee attack that causes a constitution saving throw. If the player fails, the enemy rolls an additional 2D8 of damage. In this situation, if there was a critical hit, and the player failed their saving throw, would I also roll double dice on the additional damage? Or is that considered a separate attack? I'm having trouble with this functional equation, to find all functions $f:\mathbb R \to \mathbb R$ for which the following is valid for all $x,y\in \mathbb R$: $f(x) + f(x+f(y)) = y + f(f(x) + f(f(y)))$ I haven't been able to pinpoint any solution, nor to prove surjectivity or injectivity. So 0 progress. Tried with $x=y=0, x=0, y=0, x=-f(y), y=f(x)$, and even with some assumptions on bijectivity, but nothing helped. I don't know the source but seems like a pretty difficult problem, maybe even impossible to solve. Convergence in Distribution in Order Statistics Let $X_1, X_2, \ldots$ be iid from Exp$(\theta)$ with density function $f(x) = \frac{1}{\theta}e^{-\frac{x}{\theta}}$. (a) Find the limiting distribution of $M_n = Y_1 - \theta\ln(n)$ and $T_n = nY_n$, where $Y_1$ and $Y_n$ represent the first and last order statistics (among $n$ observations) respectively. Answer: I have obtained the CDF of X to be: $$F_x(x) = 1 - e^{-\frac{x}{\theta}}$$ the CDF of $Y_1$ to be: $$F_{Y_1} = 1 = e^{-\frac{xn}{\theta}}$$ the CDF of $M_n$ to be: $$F_{M_n}(x) = \left[1 - \frac{1}{n}e^{-\frac{x}{\theta}}\right]^n$$ with limiting distribution $$e^{-e^{-\frac{x}{\theta}}}$$ the CDF of $T_n$ to be: $$F_{T_n}(x) = 1 - e^{-\frac{x}{\theta}}$$ which is also the limiting distribution. (b) Show that $M_n$ and $T_n$ are asymptotically independent. Answer: I've tried finding the joint PDF for ordered statistics by using the equation $$g_{ij}(y_i, y_j) = \frac{n!}{(i - 1)!(j - i - 1)!(n - j)!}[F(y_i)]^{i - 1}[F(y_j) - F(y_i)]^{j - i - 1}[1 - F(y_j)]^{n - j}f(y_i)f(y_j)$$ however, it is a mess based on my CDFs. Any suggestions on a different approach? Argument in "thebibliography" I was reading the explanation about  and was totally confused:     The thebibliography environment has an argument which should be a string at least the length of the widest entry label in the source list. Instead of using the numbers generated by the environment as entry labels, you can specify your own by using an optional argument to \bibitem, but remember to increase the length of the argument to the thebibliography command.    What does "widest entry label" mean? Practically, what should I put as the argument in   \begin{thebibliography}{?}   or is the argument not necessary? How to install h.264 decoder? I tried playing videos in movie player but only the audio could be heard. I tried playing the video with dragon player but here also only the audio could be heard.  A message box appeared showing the following message:     Python (v2.7) requires to install plugins to play media files of the following type: H.264 decoder   I tried installing the plugin but it couldn't be installed. It isn't available in the software center too. How can I get this plugin? Mixing and Distributing Qualifiers ($\forall x$, $\exists x$) Can someone confirm that its not possible to change the height of a dropdown that is shown when you click on a select box.   The size attribute of the select makes it look like a list, the height attribute in the CSS doesnt do much good either. I'm kind of curious what kinds of criteria other people go through when selecting the correct answer to their questions.  Here's what I consider when selecting the answer to my question:   Is the answer objective?  It's easy to pick out biased answers.  Usually they involve a statement along the lines of "x sucks, you should ALWAYS use y." Do other members seem to support the answer?  Has it gotten a significant number of +1 posts or has it been voted up a number of times? Is the answer the most thorough?  Does it have an example?   With that said, there are a couple of BAD reasons to choose an answer in my opinion:   The answer is what you want to hear.  My biggest pet peeve is when somebody asks what ostensibly appears to be a valid question, but is really just a thinly veiled attempt to get someone to agree with them.  Thus, the question usually ends up showing a certain bias.  And guess which answer gets selected?  The one that confirms that bias. Nobody posted a better answer.  If you don't see a good enough answer, don't select one.   I'm sure there are a few things I'm leaving out, plus some of what I've said may be arguable.  What is everyone else's take on this? I’m reading Shakespeare’s Henry IV (Part 1) right now and I’m noticing that Sir John Falstaff has a propensity of saying “If this, then I’m a this” sort of statements. A few examples to clarify:     … An I   have not ballads made on you all and sung to filthy   tunes, let a cup of sack be my poison      An I have not   forgotten what the inside of a church is made of, I   am a peppercorn, a brewer’s horse      if manhood, good manhood, be   not forgot upon the face of the earth, then am I a shotten herring      If I do not beat thee out of thy   kingdom with a dagger of lath, and drive all thy   subjects afore thee like a flock of wild-geese,   I’ll never wear hair on my face more   Is there a particular literary term for these sort of sentences? Elementary formula for permutations? If there was a black hole on earth, what would it look like? If an answer does exist, I'd love to hear it. I'm trying to incorporate a doomed earth story in something I'm writing, and the end of the world I'm going for is a black hole.  Let's say the black hole was created in the Philippines (I chose it because it's on the equator). Here's  for reference.  If I was standing 90 degrees of that, in Kenya, or if I was standing 180 degrees of that, in Mexico; what would I see in those two separate instances? What if I was standing in Japan above it, or in Australia below it?  Let's also say I was riding a boat towards the source of the black hole. Unlike most imagined scenarios where I am orbiting the black hole and slowly falling into it, this time I'm no longer orbiting it - I'm getting sucked into it instead. I'm imagining that the black hole will "half" be inside Earth and "half" will be in the atmosphere. But as it pulls me in, what will it look like to me (if I was massless, so no tidal forces)? It's probably not going to be a black hemisphere sticking out of the ground. Light will be lensed around it in some way so as to appear like a hole in the air.  Also, if the black hole was very small, it probably won't have a strong gravitational pull, and assuming it doesn't disappear, you'd be able to look at it (or at least, its effect on the light in its surroundings). Of course, as you approach it, it would still have an event horizon, so spacetime would still be warped if you're near enough and the surroundings will still experience tidal forces.  As the black hole gains mass, it will get larger, and so its event horizon will increase. If I was standing in Kenya and the event horizon "washes over me," (as in a water wave) what will I see?  I've so far imagined that, at least when seen from outer space, there will be a hole on the ground and light will be lensed around it. When you are on the ground, though, it becomes a bit harder to imagine.  I do hope someone can lend me a hand!  Edit: Someone had previously answered this question, but I'm not sure why it's been deleted. It was pointed out to me, though, that a black hole cannot stay in place. So an additional question for me is, does that mean it is impossible to be standing still, and the event horizon "washes over you"?  Edit2: Here's a guiding thought experiment that could answer the question. Imagine that you are in outer space directly above the black hole, looking at the black hole that is on the earth's surface. Can you imagine what it would look like? It would simply be a hole with the surrounding light gravitationally lensed around it (possibly lensing the entire earth if it's big enough - but let's say it's not).  Now imagine that you are on the direct opposite of where you were above - you're right behind the black hole this time, looking directly at the black hole but unable to see it because the earth is blocking your view.  Now try to imagine, from the second image, rotate the earth into the first image. I find it a bit hard to do. Just as the black hole is appearing as you rotate the earth, how would the light be lensed? How do I get the current date and time in PHP? Which PHP function can return the current date/time? Books to learn physics, being a math major An $n \times n$ matrix $M$ of integers has the property that $M_{ab} = M_{xy}$ iff $a+b=x+y$. How many distinct elements are there in $M$? What is the difference between a synchronized method and synchronized block in Java?