Why is jQuery not Detecting Dynamically Added Classes on Click? Noob question I apologize, but I have been struggling with this for way too long jQuery(&quot;.mutiple_form_navigation_link &gt; div&quot; ).on( &quot;click&quot;, function() {         jQuery(&quot;#shipping_customer_details .validate-required&quot;).each(function(){             console.log(jQuery(this));                 if (jQuery(this).hasClass('wooccommerce-invalid')) {                     alert('invalid shipping');                 }         });  Looking at the raw html when clicking &lt;p class=&quot;form-row form-row-last validate-required validate-Select woocommerce-invalid woocommerce-invalid-required-field showErrors&quot; id=&quot;shipping_last_name_field&quot; data-priority=&quot;&quot;&gt;  It has the class woocommerce_invalid Looking at the console.log in my jquery it says p#shipping_last_name_field.form-row.form-row-last.validate-required.validate-Select.woocommerce-invalid.woocommerce-invalid-required-field.showErrors  Showing woocommerce-invalid is a class... yet hasClass is not triggering because apparently woocommerce-invalid was not there on DOM load, but rather after input validations? How do I modify my on(&quot;click&quot;) jQuery to detect the class in the DOM...?
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.
Shell scripting: Way to parse parameters from command line myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory   Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them? Setting-up SSH-tunnel for VPN? Python string.join(list) on object array rather than string array In Python, I can do:  &gt;&gt;&gt; list = ['a', 'b', 'c'] &gt;&gt;&gt; ', '.join(list) 'a, b, c'   Is there any easy way to do the same when I have a list of objects?  &gt;&gt;&gt; class Obj: ...     def __str__(self): ...         return 'name' ... &gt;&gt;&gt; list = [Obj(), Obj(), Obj()] &gt;&gt;&gt; ', '.join(list) Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt; TypeError: sequence item 0: expected string, instance found   Or do I have to resort to a for loop? Install Ubuntu, you can not continue Does there exist a matrix $\mathbf{A}\in\mathbb{R}^{3\times3}$ such that $\mathbf{A}^{2}=-\mathbf{I}$? When should you use a class vs a struct in C++? How to make left-right transition of overlay image ffmpeg In (non-relativistic) classical physics, if the temperature of an object is proportional to the average kinetic energy ${1 \over 2} m\overline {v^{2}}$of its particles (or molecules), then shouldn't that temperature depend on the frame of reference - since $\overline {v^{2}}$ will be different in different frames?  (I.e. In the lab frame  $K_l = {1 \over 2} m\overline {v^{2}} $, but in a frame moving with velocity $u$ relative to the lab frame, $K_u =  {1 \over 2} m \overline {(v+u)^{2}}$). Would Beetee's electrocution plan work and kill the tributes in the lake? In , the second episode of the Hunger Games trilogy, one of the characters (Beetee) proposes a plan to kill some of the remaining tributes. He proposes wrapping a special wire that he has designed to withstand the vast energy of lightning around a tall tree and running it down to a salt water lake. Then when lightening strikes the tree (which it does predictably every twelve hours) anyone in the lake will be killed. (N.B. This is not Beetee's real plan, but it is the one he wants his allies to believe.)  I don't think his plan would work at all. Assuming that his wire can carry the enormous current delivered by a lightening strike (this is fiction after all) surely the current would short to ground through the salt water rather than taking a path through anyone standing or swimming in the water. The analogy I have in mind is that of birds standing untroubled on live electricity wires. They are unharmed because they do not provide a path to earth. But another analogy might be dropping a mains electric heater into a bath when you are in it. I think that kills you (though I'm not sure why.) Splitting a semicolon-separated string to a dictionary, in Python Running this script on: "Red Had Enterprise Linux Server release 5.11 (Tikanga)"  Mail is: version 8.1 6/6/93 (appears quite old).  Have tried various things and cannot seem to get this to work..  echo "Email message" | mail -a /home/user/checks/notprocessed.txt -a /home/user/checks/dirlist.txt -s "Subject" recipient@company.com /home/user/checks   Resulting message:     mail: invalid option -- a   mutt is not installed and I have limited access to this system as it is owned by the company I work for.  I could add in other components, but has to go through change management, and related processes.  uuencode is not available either.  Here is what I am using today and I am trying to add a second file to:  if grep 'Not Empty' /home/user/checks/notprocessed.txt    then    echo "files were found";     SUBJECT="NIGHTLY DIRECTORY LISTING OF FILES SENT TO VENDOR";    FROM="SENDER&lt;sender@company.com&gt;"    # EMAIL="JOHN DOE&lt;recipient@company.com&gt;"    EMAIL="MARY DOE&lt;recipient@company.com&gt;";    /bin/mail -s "$SUBJECT" "$EMAIL" -- -f "$FROM" &lt; /home/user/checks/notprocessed.txt /home/user/checks/dirlist.txt     exit -20 fi   And..  /home/user/checks/dirlist.txt is not attached or included as part of the e-mail.  I would like /home/user/checks/dirlist.txt to be actually an attachment  This actually does work - but includes the notprocessed.txt as the body of the email..  if grep 'Not Empty' /home/user/checks/notprocessed.txt    then    echo "files were found";     SUBJECT="NIGHTLY DIRECTORY LISTING OF FILES SENT TO VENDOR";    FROM="SENDER&lt;sender@company.com&gt;"    # EMAIL="JOHN DOE&lt;recipient@company.com&gt;"    EMAIL="MARY DOE&lt;recipient@company.com&gt;";    /bin/mail -s "$SUBJECT" "$EMAIL" -- -f "$FROM" &lt; /home/user/checks/notprocessed.txt     exit -20 fi For an existing set of line features, I would like to generate a perpendicular line, of say 1km, at the midpoint of each existing line feature in ArcGIS.  I imagine that The methodology would be to:   create a tangent line at the midpoint of each existing line feature calculate the angle of the tangent line based on the angle of the tangent line, calculate the location of the endpoint of the new line create the new line with the calculated endpoint of the new line and the existing midpoint of the old line   Let's assume that we are in a UTM projection and can use coordinates to calculate distance and direction.  How would I do this with ArcGIS tools or with ArcPy? Which one is correct to say: "It's me" or "It's I"? I was taught at school that the following expression is not grammatically correct:  Who is there? It's me.  The correct one is:  Who is there? It's I.  Can you let me know which one is accurate? A coin is tossed $n$ times. What is the probability of getting odd number of heads?   I started this chapter sometimes ago and faced in front of a tough problem. At first I started considering cases. Case-I : The probability of getting 1 head.Case-II : The probability of getting 3 head and so on. But there are many cases. So how can I solved this . Please help me. Thank you! Induction with floor, ceiling $n\le2^k\implies a_n\le3\cdot k2^k+4\cdot2^k-1$ for $a_n=a_{\lfloor\frac{n}2\rfloor}+a_{\lceil\frac{n}2\rceil}+3n+1$ Counterexample: $G \times K \cong H \times K \implies G \cong H$ I am having a hard time finding a counterexample for the statement: $G \times K \cong H \times K \implies G \cong H$  I think this should be true for abelian, finite groups. But is this true in general? What would be a counterexample?  Any hints appreciated!  Thanks What should be the default title case for non-technical questions? As an example, this question is titled using sentence case. I've been going to lots of different meta sites (especially this one), and I think the needle bent on my oh-me-oh-my-my-ocd-oh-meter.  Can we please standardize on using either:   Sentence case Title Case AP Style Title Case   ... and then we can look at just converting titles automatically? This would be a switch, of course, but I'd only imagine turning it off on sites where program code or symbols might be present in titles. Or, it could just become part of editing guidelines.    Additionally, is this a horrible idea?   To see the differences between them, you can put any arbitrary title into  (we have no affiliation with them, it's just a tool I sometimes recommend to people).  We would also eventually adopt this for static routes, but I'm mostly talking about questions. How do I check the status of the CMOS battery? Can I leave the Schengen Area (and come back) while my non-eea spouse resident card application is being processed? My wife and I recently moved to Germany. She's a Swedish citizen, and I'm American. It'll be December before I can actually apply for my residence card, because my appointment to register our address is so far out - the local police station was all booked out and we didn't get an apartment right away.  I imagine that I won't be getting my residence card until well after Christmas, by which time my 90/180 days will be passed. What if I want to leave to, say, London for the holidays? Will I be allowed back in? I hit day 90 around the 21st of December. I could maybe leave on day 89 and come back on day 90 (with my wife and our marriage cert), or use this Polish solution: , since I can't be expelled from Germany for overstaying my visa while my application is processing.  Both of those seem a bit risky though. Am I reading too far into it, or is this a legitimate concern? Will I get some sort of documentation saying I have a residence card application processing? Foundational proof for Mersenne primes I know how to prove that, if $2^n-1$ is prime and $n&gt;1$, then $n$ is prime.  But how do we prove that, if $a^n-1$ is prime and $n&gt;1$, then $a$ must equal 2?