I'm working with an html file that sends and gets data from a Flask app. On this HTML, i have 2 scripts. The first one is something like this:  &lt;button class="search"&gt;search&lt;/button&gt; (...)  $(function() { $('.search').click(function() { var name_field = $("#search_field").val(); var my_data={name:name_field}; AJAX sends my_data to Flask function, which will return the response variable below  $('body').append("&lt;div class='new' id=\"empty\"&gt;"+response+"&lt;/div&gt;")   That result will contain html code, including buttons of the class "add1"  This HTML file that contain the script above also contain another script that is triggered when the user clicks a button of the class "add1". My problem is: These appended buttons will NOT trigger the second jQuery function. Any buttons previously present in the code (before the append) of the class "add1" will, however.  There must be a way to inform jQuery that new buttons will be added and that they are valid, i think
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.
List of PDOStatement::bindParam data_type parameters During self-study, I ran across the question of how many ways six numbers can be chosen from the numbers 1 - 49 without replacement, stipulating that no two of the numbers be consecutive.  I can obtain a simple lower bound by saying that, in the worst-case scenario, when you choose a particular number, there are now three numbers that cannot be chosen next.  For example, if I first pick 17, then I can't choose 16, 17, or 18 for the remaining choices.  This gives me the lower bound  $$\frac{49*46*43*40*37*34}{6!} = 6,773,770 \frac{8}{9}$$  This is about 48% of ${}_{49}C_6 =  13,983,816$.  The real answer must be bigger (and an integer).  I haven't found a way to calculate it, though.  The original problem asked to show that the probability of having non-consecutive integers when you choose six is greater than 50%, so if the problem is complicated to count exactly, better approximations that show the answer is above 50% would also be appreciated.   Of course, I can use a computer to do the counting, but I'm interested in learning what methods I'm missing. mysqli_fetch_assoc() expects parameter / Call to a member function bind_param() errors. How to get the actual mysql error and fix it? I've had at least one question featured as a "hot network question" and during that time it got thousands of views in the course of a few days. But if you look at that question now you won't have any way of knowing that that's where the bulk of its view count came from.  Is there a way to find out if an arbitrary question has been a "hot network question" or not? If a question is in all-uppercase or all-lowercase, our quality filters should automatically reject it Proposal If a question on an English-language Stack Exchange site does not contain at least one uppercase and one lowercase letter, our quality filter should reject it. (We can make exceptions for sites which don't use a mixed-case alphabet, such as .) Justification The quality filter currently rejects neither all-uppercase nor all-lowercase posts. I've checked. The best Stack Exchange users use mixed case. If an asker is too lazy to use their Shift key, their question tends not to be of very good quality. Don't take my word for it. You can see proof. Sam Saffron helped me write  which lets you see with your very own eyes that what I am saying is true. Single-case askers tend to ask poor-quality questions such as:      In addition, posts which use only uppercase or only lowercase — even if they aren't riddled with typos or grammatical errors — tend to be hard to read. Capitalization aids readability. Why is this proposal not a duplicate? This proposal is not a duplicate of the older proposal . This is because it also deals with all-lowercase questions. All-lowercase questions are 50 times more common than all-caps questions.  Stack Overflow gets only about 100 all-uppercase questions per year; see .  Yet it gets about 5,000 all-lowercase questions per year; see . (These statistics are for Stack Overflow only; the rest of our network wasn't considered.) I suspect that the older proposal was declined for two reasons:  All-uppercase questions are rare.  Therefore, the effort required to block all-uppercase questions is too much.   This proposal is better. For just a bit more effort, the Stack Exchange developers can get a much richer reward. Conclusion What do you think of my proposal? Agree? Disagree? Thoughts? PS: This idea is modified and adapted from  by Stack Exchange user Gilles. My dear sir Gilles, I thank you. Note There's even a  which automatically detects questions with all-caps titles and alerts interested users and moderators. How does the CS:GO ranking system work? Maximum length of tags Possible Duplicate:        Is there a maximum limit on the length of tags? I noticed that the tag for SQL Server Management Studio is truncated to sql-server-management-stu.  It seems like this should be an easy thing to correct, if not to allow the creation of new longer tags, but to correct existing tags that have been truncated. \mathcal(O) and font size I use the following mystic TeX so as to display the Landau's notations for big and small O.  There is one partial solution to improve the scriptscriptstyle so as to not use a small o : see the secund answer below. The problemen with \smallOBis is the wrong spacing, contrary to \smallO. How can I do this ?  % Sources : %     1) http://forum.mathematex.net/latex-f6/bonnes-commandes-de-base-t12278.html %     2) http://tex.stackexchange.com/questions/30944/mathcalo-and-font-size  \documentclass{article}     \usepackage{amsmath}     \usepackage{amsfonts}     \usepackage{amssymb}      \usepackage{graphicx}      \newcommand{\bigO}[1]{\ensuremath{\mathop{}\mathopen{}\mathcal{O}\mathopen{}\left(#1\right)}}      \newcommand\smallO[1]{         \mathchoice             {% \displaystyle                 \ensuremath{\mathop{}\mathopen{}{\scriptstyle\mathcal{O}}\mathopen{}\left(#1\right)}             }             {% \textstyle                 \ensuremath{\mathop{}\mathopen{}{\scriptstyle\mathcal{O}}\mathopen{}\left(#1\right)}             }             {% \scriptstyle                 \ensuremath{\mathop{}\mathopen{}{\scriptscriptstyle\mathcal{O}}\mathopen{}\left(#1\right)}             }             {% \scriptscriptstyle                   \ensuremath{\mathop{}\mathopen{}{o}\mathopen{}\left(#1\right)}             }     }      \newcommand\smallOBis[1]{         \mathchoice         {% \displaystyle             \scriptstyle\mathcal{O}\left(#1\right)         }         {% \textstyle         \scriptstyle\mathcal{O}\left(#1\right)         }         {% \scriptstyle         \scriptscriptstyle\mathcal{O}\left(#1\right)         }         {% \scriptscriptstyle         \scalebox{0.8}{$\scriptscriptstyle\mathcal{O}$}\left(#1\right)         }     }   \begin{document}  \[     \renewcommand{\arraystretch}{1.2}%     \begin{array}{llll}          \textbf{Style}            &amp; \verb!\bigO!         &amp; \verb!\smallO!                          &amp; \verb!\smallOBis!         \\ \hline         \verb!\displaystyle!      &amp; \displaystyle      \bigO{\frac{1}{n}}         &amp; \displaystyle      1 + \smallO{\frac{1}{n}} - 2 &amp; \displaystyle      1 + \smallOBis{\frac{1}{n}} - 2         \\         \verb!\textstyle!         &amp; \textstyle         \bigO{\frac{1}{n}}         &amp; \textstyle         1 + \smallO{\frac{1}{n}} - 2 &amp; \textstyle         1 + \smallOBis{\frac{1}{n}} - 2         \\         \verb!\scriptstyle!       &amp; \scriptstyle       \bigO{\frac{1}{n}}         &amp; \scriptstyle       1 + \smallO{\frac{1}{n}} - 2 &amp; \scriptstyle       1 + \smallOBis{\frac{1}{n}} - 2         \\         \verb!\scriptscriptstyle! &amp; \scriptscriptstyle \bigO{\frac{1}{n}}         &amp; \scriptscriptstyle 1 + \smallO{\frac{1}{n}} - 2 &amp; \scriptscriptstyle 1 + \smallOBis{\frac{1}{n}} - 2     \end{array} \]  \end{document} Create Java console inside a GUI panel How can I create an instance of the Java console inside of a GUI panel? When to use 'which' or 'in which' or 'that' (as relative pronouns)? tar and its key letters: is it a bug or feature? I am wondering to ask the difference of these two commands (i.e. only the order of their options are different):   tar -zxvf foo.tar.gz tar -zfxv foo.tar.gz   The first one ran perfectly but the second one said:  tar: You must specify one of the `-Acdtrux' or `--test-label'  options Try `tar --help' or `tar --usage' for more information.   And tar with --test-label and -zfxv said :  tar (child): xv: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now   Then I looked at tar manual and realised that all the example there are using switch -f in the end!!  AFAICT there is no need for this restriction, or is there?! because in my view switches should be order free. MWE:  \documentclass{minimal} \usepackage{commath, tikz} \begin{document} \begin{tikzpicture} \node {$:$}; \end{tikzpicture} \end{document}   When I compile this, pdfTeX enters an infinite loop. Why? Google Apps Script Javascript compatibility error I have successfully created . Handy to avoid multiple calls to GAS services whit ordinary getRange calls.  While the code perfectly works in javascript, it throws an error in Google Apps Script upon saving.  The offending code is:  return matrix.slice(startRow, endRow + 1).map(i =&gt; i.slice(startCol, endCol + 1))   GAS seems rejecting code in the .map function. How to get the last value of an ArrayList Have there been any recent attempts to falsify the  hypothesis alternative to the Doppler shift explanation for the red shift, or is it simply ignored like the pilot wave quantum mechanical hypothesis alternative to the Copenhagen hypothesis of quantum mechanics has been? What new evidence would it take to get the tired light hypothesis for the red shift reexamined as the recent fluid dynamics oil drop experiments have done for the pilot wave hypothesis of quantum mechanics? How to show that $|D_{2n}| = 2n$ via the presentation? I want to use  to display my CPU-Core temperatures (haswell i7). However the setting:  order += "cpu_temperature 1" #... cpu_temperature 1{         format = "T: %degree °C" } #   doesn't display the correct core temperature. The numbers it shows seem to correspond to the value xsensors shows for temp1, if I change the 1 to 2 above it corresponds to xsensors temp2. Trying 3 or 4 doesn't have any effect. However I want to get the true core temperatures of all 4 cores with i3 status. How can I do this? Is there a way to input particular sections of source code using \lstinputlisting (from the listings package) in a flexible way?  It's possible to use the firstline and lastline options to input particular line ranges, but this isn't robust to changes to the source file.  For example, suppose that the input source file is:  int square(int x) {   return x * x; }  int cube(int x) {   return x * x * x; }   In my LaTeX document, I can include the cube procedure using the command \lstinputlisting[firstline=5,lastline=7]{source.c}.  But suppose I later decide to rewrite the cube procedure.  The input source file becomes:  int square(int x) {   return x * x; }  int cube(int x) {   int x2;   x2 = square(x);   return x * x2; }   Now my LaTeX document will not show the final two lines of cube because the listing uses only lines 5-7.  I could manually update the line range, but this is tedious and error-prone.  Is there a way to mark sections of source code with some kind of label so that the listing will be robust to these sorts of changes?  For instance, perhaps the input source file would be something like  int square(int x) {   return x * x; }  /**\beginlabel{lst:cube} **/ int cube(int x) {   int x2;   x2 = square(x);   return x * x2; } /**\endlabel{lst:cube} **/   so that I could use something like \lstinputlisting[lines=lst:cube]{source.c} to include the section that I want and remain robust to changes.  I am open to using other packages for source code listings (e.g., minted) if helpful. “May I know your good name?” "May I know your good name” is a typically Indian way of honouring another person by asking their name using an adjective like sweet, good, beautiful, et cetera. Of course there won’t ever be any bad or sour name (unless we feel it such) when asking.   If this manner of asking someone’s name is incorrect or inappropriate, then how could I make it sound more polite and amicable without negotiating the basic principles of English? Entity Framework and SQL Server View