I have a .wrapper with dynamically generated content(tasks). Each .task has a data attribute that I'm trying to use for allowing me to make this filterable with preset buttons but it doesn't seem to be working for new incoming data. Only works for the html on the page already on load.  &lt;div class="wrapper tasks"&gt;   &lt;div class="task" data-type="urgent"&gt;Call Bob&lt;/div&gt;   &lt;div class="task" data-type="very-urgent"&gt;Pay Bills&lt;/div&gt;   &lt;div class="task" data-type="very-urgent"&gt;Ship Package&lt;/div&gt;   &lt;div class="task" data-type="can-wait"&gt;Buy Groceries&lt;/div&gt; &lt;/div&gt;  &lt;div class="filters"&gt;   &lt;button id="filter-urgent"&gt;Urgent&lt;/button&gt;   &lt;button id="filter-veryurgent"&gt;Very Urgent&lt;/button&gt;   &lt;button id="filter-canwait"&gt;Can Wait&lt;/button&gt; &lt;/div&gt;   &lt;script&gt;  var htmlTaskFromExternalAPI = '&lt;div class="task" data-type="very-urgent"&gt;&lt;/div&gt;';   function addTask(theTask){     $('.wrapper').insertAdjacentHTML('afterbegin',theTask);  }   addTask(htmlTaskFromExternalAPI); &lt;/script&gt;  &lt;script&gt;  $('#filter-urgent').on( 'click', function(){     //hide all tasks    $('.task').hide();      //then show filtered tasks only    $('.task[data-type="urgent"]').fadeIn();   }); &lt;/script&gt;   The problem I'm having is as soon as new tasks come in(from external API in html format with data-type attributes already), all dynamically inserted tasks ignore the filtration.
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.
Why can't I capture my first Pokemon? I'm trying to just catch my first Pokemon and I can't for some reason. From what I've read I should be able to see the three basic Pokemon to choose from and catch one but I can't see them.  I can only see three pulsing circles and the app appears to be stuck on map view. I've tried clicking or walking over the circles but nothing happens.   Any suggestion on how to fix this? DES Initialization Vector in C# Is there a way to respec attributes? t-test for partially paired and partially unpaired data SQL Server nvarchar(max) vs nvarchar(n) affects performance I received a table template, which I'm intended to generate dynamically with data using Java. But when the table becomes to large, the compilation with LaTeX fails. The specific about this template is, that it stretches the table width into the maximal page width and has same column widths for all data columns (except the first column).  Here is a minimal version of the full template, that still works fine:  \documentclass[final,authoryear,3p,twocolumn]{elsarticle}  \usepackage{amssymb,amsmath} \usepackage{calc} \usepackage{array} \newcolumntype{L}[1]{&gt;{\raggedright\arraybackslash}p{#1}} \newcolumntype{R}[1]{&gt;{\raggedleft\arraybackslash}p{#1}} \usepackage{eurosym} \usepackage{microtype} \usepackage{needspace} \usepackage{fp}  \usepackage{graphicx} \DeclareGraphicsExtensions{.pdf} \input{pgfexternal}  \newcommand\tabt{\rule{0pt}{2.6ex}} \newcommand\tabb{\rule[-1.2ex]{0pt}{0pt}}  \begin{document}  \begin{table*}[t]     \footnotesize     \begin{tabular*}{\linewidth}{@{}L{2em}@{}*9{R{(\linewidth-2em)/9}@{}}}\hline\tabt $i$ &amp; $1$ &amp; $2$ &amp; $3$ &amp; $4$ &amp; $5$ &amp; $6$ &amp; $7$ &amp; $8$ &amp; $9$\tabb\tabularnewline\hline\tabt $1$ &amp;  &amp; $48.87$ &amp; $0.01$ &amp; $0.05$ &amp; $1.23$ &amp; $0.00$ &amp; $0.20$ &amp; $5.67$ &amp; $2.35$\tabularnewline     \end{tabular*} \end{table*}  \end{document}   But when extending this example by another column, so that the table would look like the following example, it fails:  \begin{table*}[t]     \footnotesize     \begin{tabular*}{\linewidth}{@{}L{2em}@{}*10{R{(\linewidth-2em)/10}@{}}}\hline\tabt $i$ &amp; $1$ &amp; $2$ &amp; $3$ &amp; $4$ &amp; $5$ &amp; $6$ &amp; $7$ &amp; $8$ &amp; $9$ &amp; a\tabb\tabularnewline\hline\tabt $1$ &amp;  &amp; $48.87$ &amp; $0.01$ &amp; $0.05$ &amp; $1.23$ &amp; $0.00$ &amp; $0.20$ &amp; $5.67$ &amp; $2.35$ &amp; b\tabularnewline     \end{tabular*} \end{table*}   This fails, no matter how many columns I add. So far, it seems for me to be a problem with the division by 10. May it be, that LaTeX isn't able to handle that properly by default? How can I solve this problem and make even larger tables work using this template. Or is that to any other problem I don't see yet? Thanks for any help! Is there any way to include an animated GIF directly in either PDFLaTeX or XeLaTeX? I realize the animate package can include animations in a PDF, but it doesn't support animated GIFs and you have to split them up manually into EPS or PNG files as far as I can tell. According to the documentation, they're pretty much interchangeable.  Is there a stylistic reason to use one over the other? How to ensure that string interpolated into `sed` substitution escapes all metachars I have a script that reads a text stream and generates a file of sed commands that is later run with sed -f. The generated sed commands are like:  s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g   Assume the script which generates the sed commands is something like:  while read cid fileid do     cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"     echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' &gt;&gt; sedscr done   How can I improve the script to ensure all regex metacharacters in the cid string are escaped and interpolated properly? Learning Regular Expressions I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them? Find conditional expectation from a 3-dimensional random vector? Good methods for density plots of non-negative variables in R? plot(density(rexp(100))   Obviously all density to the left of zero represents bias.  I'm looking to summarize some data for non-statisticians, and I want to avoid questions about why non-negative data has density to the left of zero.  The plots are for randomization checking; I want to show the distributions of variables by treatment and control groups. The distributions are often exponential-ish.  Histograms are tricky for various reasons.    A quick google search gives me work by statisticians on non-negative kernels, e.g.:  .    But has any of it been implemented in R?  Of implemented methods, are any of them "best" in some way for descriptive statistics?  EDIT:  even if the from command can solve my current problem, it'd be nice to know whether anyone has implemented kernels based on literature on non-negative density estimation Too much whitespace in "Thanks for the feedback" While attempting to downvote something on a site I don't have an account on, I see this message, which has too much whitespace:    The same thing happens with upvotes (and プラス票が):    (I think it's safe to say that this is a network-wide bug, since I took these all on different sites.)  However, it looks more reasonable when you are not logged into the network at all (e.g. in private browsing):    An earlier version of this issue was reported at , but the difference is that there is no newsletter UI on the right anymore. (The extra space could have been justified before given the height of the newsletter; now it's definitely a bug.)  Also, is newsletter supposed to be gone? Using the Fitch system, how do I prove $((p \implies q) \implies p)\implies p$? Using the Fitch system, how do I prove $((p \implies q) \implies p)\implies p$? I started with the hypotheses $(p \implies q) \implies p$ and $\sim p$. However, from these hypotheses I did not get the desired contradiction to solve the question.  Thanks sb45 What are the proper uses of:   static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value)   How does one decide which to use in which specific cases? Laptop using 14.04 won't get past login GUI Where can I get more favourable exchange rate, in general?changing baht to Canadian dollars in Thailand or Canada or make a bank transfer to my Canadian account I am trying to use a MERGE statement to insert or delete rows from a table, but I only want to act on a subset of those rows. The documentation for MERGE has a pretty strongly worded warning:     It is important to specify only the columns from the target table that are used for matching purposes. That is, specify columns from the target table that are compared to the corresponding column of the source table. Do not attempt to improve query performance by filtering out rows in the target table in the ON clause, such as by specifying AND NOT target_table.column_x = value. Doing so may return unexpected and incorrect results.   but this is exactly what it appears I have to do to make my MERGE work.  The data I have is a standard many-to-many join table of items to categories (e.g. which items are included in which categories) like so:  CategoryId   ItemId ==========   ====== 1            1 1            2 1            3 2            1 2            3 3            5 3            6 4            5   What I need to do is to effectively replace all rows in a specific category with a new list of items. My initial attempt to do this looks like this:  MERGE INTO CategoryItem AS TARGET USING (   SELECT ItemId FROM SomeExternalDataSource WHERE CategoryId = 2 ) AS SOURCE ON SOURCE.ItemId = TARGET.ItemId AND TARGET.CategoryId = 2 WHEN NOT MATCHED BY TARGET THEN     INSERT ( CategoryId, ItemId )     VALUES ( 2, ItemId ) WHEN NOT MATCHED BY SOURCE AND TARGET.CategoryId = 2 THEN     DELETE ;   This appears to be working in my tests, but I am doing exactly what MSDN explicitly warns me not to do. This makes me concerned that I will run into unexpected problems later on, but I cannot see any other way to make my MERGE only affect rows with the specific field value (CategoryId = 2) and ignore rows from other categories.  Is there a "more correct" way to achieve this same result? And what are the "unexpected or incorrect results" that MSDN is warning me about? X and Y are not correlated, but X is significant predictor of Y in multiple regression. What does it mean? X and Y are not correlated (-.01); however, when I place X in a multiple regression predicting Y, alongside three (A, B, C) other (related) variables, X and two other variables (A, B) are significant predictors of Y. Note that the two other (A, B) variables are significantly correlated with Y outside of the regression.   How should I interpret these findings? X predicts unique variance in Y, but since these are not correlated (Pearson), it is somehow difficult to interpret.  I know of opposite cases (i.e., two variables are correlated but regression is not significant) and those are relatively simpler to understand from a theoretical and statistical perspective. Note that some of the predictors are quite correlated (e.g., .70) but not to the extent that I would expect substantial multicollinearity. Maybe I am mistaken, though.    NOTE: I asked this question previously and it was closed. The rational was that this question is redundant with the question "". Perhaps I do not understand the other question, but I believe these are entirely separate questions, both mathematically and theoretically. My question is entirely independent from if "a regression is significant". Furthermore, several predictors are significant, while the other question entails variables not being significant, so I don't see the overlap. If these questions are redundant for reasons I do not understand, please insert a comment prior to closing this question. Also, I was hoping to message the moderator who closed the other question to avoid identical questions, but I couldn't find an option to do so. Improving "demonstrate a minimal understanding" close reason Note: the eventual outcome of this discussion involved dropping this particular off-topic reason, along with other changes. See:  &nbsp; &mdash;Shog     I was using the reason "demonstrate a minimal understanding" myself quite frequently, but the more I review, the more I have doubts about it and I think this reason can either be dropped entirely or at least rephrased, so I started to use "problems with code you've written must describe the specific problem" instead:     Questions asking for code must demonstrate a minimal understanding of the problem being solved.   So the poster has posted some description, maybe even a snippet of code and in his mind that already proves that he has that minimal understanding required. After all he described the problem and what he tried to solve. So telling him that he lacks that understanding is rather rude, and from the posters point of view doesn't even apply. What both version of the reason not emphasize is that a description of a problem is not various versions of     it doesn't work   but that we rather mean really specific details (see below). I can often see in the reopen review queue that the "improved" version just includes a more verbatim description, while what usually would be expected is some specific error message, a trace or a log, or whatever applies.  Then it continues with:     Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist   comparing it to:     problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.   Which says essentially the same, only in more detail.   So the "minimum understanding" reason is IMO a more rude version of the reason telling the user that an SSCCE is missing.  The intent of giving this reason is to tell the user that he needs to give exact details to be able to help him, so IMO a checklist would be much better. Something like:     Your question was closed because it may not provide enough details. Things you can do to improve your question to get an answer include:         Format the code in a way that makes it readable and easily understandable.   Provide the smallest working sample of code demonstrating the problem (link to SSCCE)   Include your input and output.   If applicable provide logs (i.e. Android debugging log, stack trace, etc.).   If applicable provide the exact error messages (compiler, etc.).      And something like this should be best included already in the banner that appears when a question is closed instead of being hidden in some pages you often enough have to actively looking for.  It might be helpful to adjust this, based on the tags or close reason, as I realize that I'm more focused on the programming area, and the above list may not apply to other areas of SO.  Update  Another thing I forgot to mention (but wanted to) is this:     Questions asking for code   Is IMO essentially an invitation of the type of questions     I have a problem, can you provide the solution? (with an optional please)   while     Questions concerning problems with code you've written   puts at least some emphasis on the fact that the poster has to put some effort himself in trying to solve the problem by providing the code which he used to attempt the solution.