im trying to display an li via ajax, but the problem is when i clicked the link the container is not popping up. But when i tried to just display it simple html it's working. Can someone help me to find what's the cause of this why it's not working?  here's the output when i tried to run on a simple html. It worked.    the div.  &lt;div id="notificationsss"&gt;&lt;/div&gt;   ajax script  $(document).ready(function() {   loadnotif();   $("#notificationLink").click(function() {     $("#notificationContainer").fadeToggle(300);     $("#notification_count").fadeOut("slow");     return false;   });    //Document Click hiding the popup    $(document).click(function() {     $("#notificationContainer").hide();   }); });  function loadnotif() {   $.ajax({     url: 'getrecords.php',     method: 'POST',     data: {       "loadnotif": 1     },     success: function(data) {       $('#notificationsss').html(data);     }   }); }   getrecords.php   if(isset($_POST['loadnotif'])){            $output = '      &lt;ul id="main-menu" class="nav navbar-nav navbar-right"&gt;                      &lt;li class="dropdown hidden-xs"&gt;                         &lt;li id="notification_li"&gt;                     &lt;a href="#" id="notificationLink"&gt;&lt;i class="fa fa-globe"&gt;&lt;/i&gt;                              &lt;span class="notification-counter" style="background-color:red;border-radius:3px;padding: 1px 3px;position:relative;top:-9px;right:9px;font: 8px Verdana;;"&gt;1&lt;/span&gt;&lt;/a&gt;                      &lt;div id="notificationContainer"&gt;                     &lt;div id="notificationTitle" style="text-align:center;background-color:#ba4f46;color:#fff;"&gt;Notifications&lt;/div&gt;                     &lt;div id="notificationsBody" class="notifications"&gt;                         &lt;a href="index.php" style="display:block;color:black;margin-top:10px;background-color:#f6e9e8;" id="notifa"&gt;                           &lt;div&gt;                             &lt;img src="img/izuku.jpg" style="max-width:50px;max-height:70px;float:left;margin:0px 10px;"&gt;                              &lt;p style="display:inline;margin-top:20px;"&gt;&lt;strong&gt;Rommel Deauna&lt;/strong&gt; Uploaded a Lecture on &lt;strong&gt;&lt;br&gt;Computer Security&lt;/strong&gt;&lt;/p&gt;                              &lt;p style="font-size:12px;"&gt;November 12, 2016 5:06PM&lt;/p&gt;                                 &lt;hr&gt;                           &lt;/div&gt;                          &lt;/a&gt;                     &lt;/div&gt;                     &lt;div id="notificationFooter" style="background-color:#ba4f46;"&gt;&lt;a href="#" style="color:#fff;"&gt;See All&lt;/a&gt;&lt;/div&gt;                     &lt;/div&gt;                     &lt;/li&gt;             &lt;/li&gt;             &lt;/ul&gt;';            echo $output;     }
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.
Am I going to have trouble flying without my full name on the ticket? Why does my iPhone power off when the battery is down to 30%? Today I was walking using my iPhone 6S running iOS 9.3 as a pedometer and it shutdown.   When I got home and plugged it in, it said 30% capacity.   That seems strange. I would expect it for 2% or 5% to preserve RAM, but 30%? Maybe there is a setting I don't know about.   My question is: Why does my iPhone power off when the battery is down to 30%?   Edit: this is not a duplicate of the low battery crash as I witnessed the low power shutdown and it was not a crash. Remove specific duplicates (all but latest) When removing duplicate rows, using the below query from  tutorial, how would I go about forcing which of the found duplicates to remove?  DELETE FROM dbo.ATTENDANCE      WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _ FROM dbo.ATTENDANCE      GROUP BY EMPLOYEE_ID,ATTENDANCE_DATE)    And this works great. The reason why I am using this one is because the only unique id available is one in the IDENTITY column. And to determine if there are duplicate rows I have to look at a combination of multiple columns.    But if I have a set of duplicate rows how do I / how does SQL Server decide which to remove? And how would I force it to remove all but the one with the highest IDENTITY value?  EMPLOYEE_ID     ATTENDANCE_DATE     AUTOID A001            2011-01-01          1 A001            2011-01-01          2   If I would run the query now it happens to remove the second one, with AUTOID 2. But I am trying to remove all but this one (because this is the one latest added). I accidentally discovered () that a closing square bracket within an optional argument delimited by [ ] can cause problems.  Here is example code illustrating the issue:  \documentclass{article}   \begin{document}  \tableofcontents  \section[Square brackets ([ and ])]{Square brackets: [ and ]} % bad: the TOC now has "Square brackets ([ and", and the actual title is a mere ")".  Some text.  \section[{Square brackets ([ and ])}]{Square brackets: [ and ]} % good (works as originally intended)  Some text.  \end{document}   The text to be used as the optional (as well as the non-optional) argument contains a ], and this character is not supposed to function as the optional argument terminator but as a matching square bracket/parenthesis. Perhaps this is as it should be, but the question is how to best circumvent any potential problems. Enclosing this in a group works, but I don't know whether doing this has other side effects (perhaps not here in the case of \section but hopefully someone else has a better example of where grouping could lead to a problem). There is no (obvious) way other than writing [{ }] because [ and ] are not normally escaped. That [ and ] are normal characters and bear syntactic function (as optional argument delimiters) creates this potentially problematic situation.  Is simply enclosing the entire optional argument in a group ({ }) a good solution? Are there other/better ways? What would happen if I used regeneration on a creature that was the target of Annihilating Fire? For example, what would happen if a freshly cast  were to be regenerated in response to ?  My hypothesis is that it depends on whose turn it is. The regeneration being essentially a replacement effect, when two replacement effects were to be applied simultaneously, they are to be chosen in APNAP order. Is this correct?  I haven't thought this through to the end, though, so I'm not sure what would happen in the end. Can others in my party go through TSA PreCheck? If I have  (i.e. I have a KTN from TSA and the "pre-check" logo gets printed on my boarding pass) and a travel companion does not, can they go with me through the PreCheck security lines? This is assuming that the travel companion is booked in the same reservation on the same flights and is also a U.S. citizen and not on any no-fly or otherwise increased scrutiny lists.  I'm guessing the answer is no, but I haven't seen anything from TSA specifically addressing this. Monty hall problem extended. I just learned about the Monty Hall problem and found it quite amazing. So I thought about extending the problem a bit to understand more about it. In this modification of the Monty Hall Problem, instead of three doors, we have four (or maybe $n$) doors, one with a car and the other three (or $n-1$) with a goat each (I want the car).  We need to choose any one of the doors. After we have chosen the door, Monty deliberately reveals one of the doors that has a goat and asks us if we wish to change our choice.  So should we switch the door we have chosen, or does it not matter if we switch or stay with our choice?  It would be even better if we knew the probability of winning upon switching given that Monty opens $k$ doors. A line is drawn through the point $A(1,2)$ to cut the line $2y=3x-5$ in $P$ and the line $x+y=12$ in $Q$. If $AQ=2AP$, find the coordinates of $P$ and $Q$.  I found the lengths of the lines $AQ$ and $AP$ in terms of $x$ and $y$ and used $AQ=2AP$ to get this equation $11x^2-40x-16=0$  Working: $AP=\sqrt{(x-1)^2+(\frac{3}{2}x-\frac{9}{2})^2}=\sqrt{\frac{1}{4}(13x^2-62x+85)}$  $AQ=\sqrt{(x-1)^2+(-x+10)^2}=\sqrt{2x^2-22x+101}$  $AQ=2AP\Rightarrow \sqrt{2x^2-22x+101}=2\sqrt{\frac{1}{4}(13x^2-62x+85)}$  $\Rightarrow 2x^2-22x+101=13x^2-62x+85\Rightarrow 11x^2-40x-16=0$  Using the quadratic formula I found $x=4,x=-\frac{4}{11}$  I then substituted these values into the two equations in the question to get the coordinates $(4,\frac{7}{2}),(-\frac{4}{11},-\frac{15}{11})$ or $(4,8),(-\frac{4}{11},\frac{136}{11})$  But the answers in the book are $(4,\frac{7}{2}),(7,5)$ or $(\frac{2}{5},-\frac{19}{10}),(\frac{11}{5},\frac{49}{5})$  I don't know where I went wrong in my method.  Edit: Found some errors in my method and calculation.  Using $x=4$ in $2y=3x-5$ gives $P(4,\frac{7}{2})$  Line with points $AP$ has equation $y-2=\frac{\frac{7}{2}-2}{3}(x-1)\Rightarrow y=\frac{1}{2}x+\frac{3}{2}$  $Q$ lies on the same line. Therefore, the intersection between $y=\frac{1}{2}x+\frac{3}{2}$ and $y+x=12$ is the point $Q$. Working: $\frac{1}{2}x+\frac{3}{2}=-x+12\Rightarrow x=7$ Therefore, $y=-7+12=5$. Point Q has coordinates $(7,5)$.  But $x=-\frac{4}{11}$ is not the other $x$ coordinate of $P$ according to the answers in the book. I have no idea where I went wrong at this point. Allow converting comments to answers Allow converting comments to answers, so they can become accepted answers.  I asked a question. Someone commented on it, and it was an awesome comment that fully answered the question. As the original questioner, I would like to convert that comment to an answer in order to accept it.  Or, if you prefer, I would be okay with being able to simply mark the comment as accepted. MySQL Great Circle Distance (Haversine formula) I've got a working PHP script that gets Longitude and Latitude values and then inputs them into a MySQL query. I'd like to make it solely MySQL. Here's my current PHP Code:  if ($distance != "Any" &amp;&amp; $customer_zip != "") { //get the great circle distance      //get the origin zip code info     $zip_sql = "SELECT * FROM zip_code WHERE zip_code = '$customer_zip'";     $result = mysql_query($zip_sql);     $row = mysql_fetch_array($result);     $origin_lat = $row['lat'];     $origin_lon = $row['lon'];      //get the range     $lat_range = $distance/69.172;     $lon_range = abs($distance/(cos($details[0]) * 69.172));     $min_lat = number_format($origin_lat - $lat_range, "4", ".", "");     $max_lat = number_format($origin_lat + $lat_range, "4", ".", "");     $min_lon = number_format($origin_lon - $lon_range, "4", ".", "");     $max_lon = number_format($origin_lon + $lon_range, "4", ".", "");     $sql .= "lat BETWEEN '$min_lat' AND '$max_lat' AND lon BETWEEN '$min_lon' AND '$max_lon' AND ";     }   Does anyone know how to make this entirely MySQL? I've browsed the Internet a bit but most of the literature on it is pretty confusing. Can I install Android on my non-Android device? Many people want to try/use Android without buying a new Android phone.  How can I install Android on my current phone or device running Nokia Symbian, Maemo, or MeeGo; Microsoft Windows Mobile or Windows Phone 7/8/10; Apple iOS (iPhone); RIM's BlackBerry OS; Palm's WebOS; Samsung's Bada; HP's WebOS; Mozilla's Firefox OS; or other phone / operating system? We often see new users make offtopic, low quality posts, with broken English and cries for help. These questions look significantly different from most on SO.  When I worked in publishing, we would frequently receive documents that were incorrectly formatted. This was a major problem and we wasted a lot of time sending emails back and forth.  I made a small JavaScript quiz asking our authors about the formatting directions and the number of emails drastically dropped. I felt this was much nicer than simply rejecting them, additionally providing us a chance to make the directions more clear.  It is slightly unconventional but, would showing new users a quiz where they have to identify good and bad posts help to improve the quality of SO questions?  Edit (3/8/2017)  Recently a Norwegian website got some media attention for . How to disable SMS notification during phone call? I call somebody, or somebody calls me, we are talking. Now, during the call I got SMS and I cannot hear anything because the SMS notification is playing.  So how to disable this notification when call is active? Thank you in advance.  Samsung Galaxy Ace 2, Android 2.3.  Note: I am interested in setting this once and for good. Not something I have to remember to switch off each time I make/get a call. Was Voldemort a Better Wizard Than Dumbledore? Pursuant to , I have a somewhat related question. The majority of Harry Potter readers automatically assume that Dumbledore must be a better wizard than Voldemort, because Dumbledore is &quot;good&quot; and Voldemort is &quot;evil.&quot; However, would Tom Riddle's prematurely developed skills demonstrate that Voldemort was inherently a better wizard than Dumbledore? In chapter 17, The Heir of Slytherin, Harry challenges Tom Riddle when he claims to be the greatest sorcerer in the world, retorting that Albus Dumbledore is the greatest sorcerer in the world. Harry reminds Tom Riddle that Voldemort is frightened of Dumbledore. Conversely, in Half-Blood Prince, Dumbledore himself states that Voldemort knows perhaps more magic than any other wizard alive. Yet, as Harry is J.K. Rowling's most direct voice, do we conclude that Dumbledore was, in fact, the superior wizard? Who was the better¹ wizard: Voldemort or Dumbledore? ¹Better meaning on a technically skilled level. Cannot launch Minecraft: CertificateNotYetValidException What should I do when my Minecraft Launcher 1.3.11 wouldn't log me in? The console output is:                                              Sorry, but we couldn't connect to our servers. Please make sure that you are online and that Minecraft is not blocked. (CertificateNotYetValidException:NotBefore:Tue Apr 08 20:47:05 CST 2014) Cruise ship in the Schengen area: Do the days spent at sea count toward the limit for short visits? I am planning on spending 90 days in Schengen zone countries.  I will be taking a cruise between Lisbon and Barcelona.  Do the days at sea count against the 90 days allowed for staying in the Schengen zone? The page I'm trying to fetch is public.  The server logs show no request.  Google reports that any page on my site is "Temporarily unreachable". It won't even fetch the verification file, a static HTML file that was successfully used to verify with the webmaster tool application itself.   My site is running on the .  What is causing this? I have a question about the following passage on pg. 89 of Zee's QFT in a nutshell:     At first sight, what Dirac wanted does not make sense. The equation is supposed to have the form "some linear combination of $\partial_\mu$ acting on some field $\psi$ is equal to some constant times the field." Denote the linear combination by $c^\mu\partial_\mu$. If the $c^\mu$'s are four ordinary numbers, then the four-vector $c^\mu$ defines some direction and the equation cannot be Lorentz invariant.   The simplest equation I can construct that he is referring to is  $$(c^{\mu}\partial_{\mu}-m)\phi(x)=0, $$  for $m&gt;0$. Taking $\phi(x)\rightarrow\phi(\Lambda^{-1}x)$, and $c^{\mu}\rightarrow\Lambda^{\mu}_{\ \ \nu}c^{\nu}$. Then, the left term transforms like   \begin{align*} \Lambda^{\mu}_{\ \ \nu}c^{\nu}(\Lambda^{-1})^{\sigma}_{\ \ \mu}\partial_{\sigma}\phi(\Lambda^{-1}x) &amp;= \delta^{\sigma}_{\ \ \nu}c^{\nu}\partial_{\sigma}\phi(\Lambda^{-1}x)\\ &amp;=c^{\sigma}\partial_{\sigma}\phi(\Lambda^{-1}x). \end{align*}  Then, we have that   $$ (c^{\sigma}\partial_{\sigma}-m)\phi(\Lambda^{-1}x)=0.$$  But doesn't this show that the equation is Lorentz-invariant? computing the orbits for a group action Let $G$ be the Galois group of a field with nine elements over its subfield with three elements. Then the number of orbits for the action of $G$ on the fields with nine elements is   3 5 6 9   I have no idea how to compute the numbers of orbits for a group action. Anyone please help me. Thanks. Why does the classical path give the dominant contribution in the path integral?