I  have a list of saved items that the user can delete if he wants. They are inside a #div, a delete button next to each item. If I press the delete button after the favorite items list page is loaded, it works fine.  But, if I want to delete another item, as I press on the delete button, the delete function would not run.  There is my AJAX:  $(".substitut").on('click', function(event) {     event.preventDefault();           var product = $(this).val();                    var url = '/register/delete/';        $.ajax({                 url: url,                 type: "POST",         data:{             'product': product,                         'csrfmiddlewaretoken': $('input[name=csrfmiddlewaretoken]').val()         },         datatype:'json',         success: function(data) {           if (data['success'])                         $("#fav_list").load(" #fav_list &gt; *");                }     });  });   and my HTML:  &lt;button type ='button' class=' btn substitut' value='{{ saved.id }}'&gt;{% csrf_token %}&lt;i class='fas fa-trash-alt'&gt;&lt;/i&gt;&lt;/button&gt;    One quick trick I found was to add location.reload(true); after the div refresh but the point of all of this is not having my page refreshing.
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.
Make a momentary switch control a toggle What are the simplest, cheapest, smallest ways to make a momentary switch produce a 2-state toggling output (latching momentary switch)?  In other words, the output is continuously low, and when you momentarily press the button/tact switch, the output changes to continuously high, and then when you press it again, it switches back to low. Number of ordered pairs $(a,b)$ such that $ab \le 3600$ Find number of ordered pairs $(a,b)$ such that $ab\le 3600$ and $a,b \in N$  My attempt : Well, all $a,b \leqslant 60$ are solutions. These 3600 solutions. After that I have no idea how to count the number of remaining solutions...   I have a feeling that my approach is $very$ bad. But I had to give as it would be marked as off-topic. In Finder when I type something in the textbox the default is to search the whole mac in the contents of the files. I was able to change the default to search the current directory, but didn't see an option to change search for contents to search for file name. How can that be changed? I have seen only the first three movies, so I don't know whether the other movies/TV series deal with this question or not. My main point is that in the movies, the terminator that travels back furthest in time is of the worst quality, and the quality increases with the time travel (meaning they travelled from a later time). What is a good explanation for this?  Note: I am not interested in the obvious not-in-universe explanation that they wanted something better and bigger for each new movie. Remove default ID attribute from HTML helpers in ASP.NET MVC "Open shaming of anyone..." Open shaming of anyone who spoke out discouraged responsible dissent.   How does open with shaming work, grammatically and meaningfully?   Is discouraged modifying "responsible dissent? Proof of uniform limit of Continuous Functions The uniform limit of Continuous Functions is continuous.   Proof Let $\varepsilon &gt; 0$. There exists $N$ in natural numbers such that $n&gt;N$ implies  $|f_n(x)-f(x)| &lt; \frac{\varepsilon}{3}$ for all $x$ in $S$. In particular $|f_{N+1}(x)-f(x)| &lt; \frac{\varepsilon}{3}$ for all $x$ in $S$. Since $f_{N+1}$ is continuous at $x_0$ there is a $\delta&gt;0$ such that, $x$ in $S$ and $|x-x_0| &lt; \delta$ imply $|f_{N+1}(x)-f_{N+1}(x_0)|&lt; \frac{\varepsilon}{3}$ Now we conclude $x$ in $S$ and $|x-x_0| &lt; \delta$ imply $|f(x)-f(x_0)|&lt; 3 \cdot \frac{\varepsilon}{3} = \varepsilon$.  Can someone explain what is happening here? I don't follow it all. How should artwork be setup for T-shirt printing? What does it mean to colour separate the artwork for T-Shirt printing? It is normally suggested to use Pantone colours for T-Shirt printing. Is it the Pantone Coated or the Pantone Uncoated? The Uncoated one has more subtle colours and we can't choose brighter shades if the design requires that. What is more appropriate for printing? Can we use gradients in T-Shirt printing or is it suggested to stick to flat colours only?   The reason for asking if gradients were ok was to use it as an option for this design:    I was considering it an option, as it will be difficult to colour separate since the textures are clip masked inside the lion. Using regex inside if clause in bash Look at this if block:  #!/bin/bash  str="m.m" if [[ "${str}" =~ "m\.m" ]]; then     echo "matched" else     echo "not matched"     exit 1 fi  exit 0   This should print "matched", but it doesn't. Where am I going wrong? To seek the maximum value of $S=x_1x_2+x_2x_3+\cdots+x_nx_1$ on this domain:  $x_1+x_2+\cdots+x_n=0$ and  $x_1^2+x_2^2+\cdots+x_n^2=1$.  I have made some trivial observations:  1) $S\in[-1,1)$ by the rearrangement inequality.  2) We can make $S$ arbitrarily close to $1$ by increasing $n$.  3) An equivalent problem is to minimise $(x_1-x_2)^2+\cdots+(x_n-x_1)^2$.  But does the maximum have a meaningful closed form  for each $n$? When and how did "pretty" enter English as an intensifying adverb? What are C++ functors and their uses? I keep hearing a lot about functors in C++. Can someone give me an overview as to what they are and in what cases they would be useful? Count and use the number of items in advance I have always taken these kinds of things for granted. Well of course $a(b+c)=ab+ac$! But why? The thought randomly popped in my head, and I realized that I could not prove it.  Perhaps we should take some time to prove these "obvious" things. I feel like if I cannot prove it, then I do not fully understand it. I would really like a proof of this most basic law, because I have been pondering over it for quite a while. Thanks!  Edit: This proof is for real numbers. I notice that the space between each column of a table in LaTeX is not quite wide (at least for me). Is there any way to set this? I found the \hspace, but I don't get how to use this in the table. One-byte-off pointer still valid in C? How do I get Gmail to ask me to be a mailto handler again? Difference between force.com and salesforce.com? What the difference between the two?  This description seems to be a bit out of date and underspecified. Can't clean a full /boot because of unmet dependencies I got an error message explaining my /boot is full. trying to clean up old image files always seems to fail because of disk full errors or dependency errors. Could someone explain where I’m going wrong.   $ sudo apt-get autoremove Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run ‘apt-get -f install’ to correct these. The following packages have unmet dependencies.  linux-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed  linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not installed  linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not installed E: Unmet dependencies. Try using -f.  $ ls /boot abi-3.13.0-32-generic         initrd.img-3.13.0-43-generic abi-3.13.0-36-generic         lost+found abi-3.13.0-37-generic         memtest86+.bin abi-3.13.0-39-generic         memtest86+.elf abi-3.13.0-40-generic         memtest86+_multiboot.bin abi-3.13.0-43-generic         System.map-3.13.0-32-generic config-3.13.0-32-generic      System.map-3.13.0-36-generic config-3.13.0-36-generic      System.map-3.13.0-37-generic config-3.13.0-37-generic      System.map-3.13.0-39-generic config-3.13.0-39-generic      System.map-3.13.0-40-generic config-3.13.0-40-generic      System.map-3.13.0-43-generic config-3.13.0-43-generic      vmlinuz-3.13.0-32-generic grub                          vmlinuz-3.13.0-36-generic initrd.img-3.13.0-32-generic  vmlinuz-3.13.0-37-generic initrd.img-3.13.0-36-generic  vmlinuz-3.13.0-39-generic initrd.img-3.13.0-37-generic  vmlinuz-3.13.0-40-generic initrd.img-3.13.0-39-generic  vmlinuz-3.13.0-43-generic initrd.img-3.13.0-40-generic   I used   kernelver=$(uname -r | sed -r 's/-[a-z]+//') dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver   to get   linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic linux-headers-3.13.0-36 linux-headers-3.13.0-36-generic linux-headers-3.13.0-37 linux-headers-3.13.0-37-generic linux-headers-3.13.0-39 linux-headers-3.13.0-39-generic linux-headers-3.13.0-40 linux-headers-3.13.0-40-generic linux-headers-3.13.0-44 linux-headers-3.13.0-44-generic linux-headers-3.13.0-45 linux-headers-3.13.0-45-generic linux-image-3.13.0-32-generic linux-image-3.13.0-36-generic linux-image-3.13.0-37-generic linux-image-3.13.0-39-generic linux-image-3.13.0-40-generic   Then picking the first image to remove   $ sudo apt-get purge linux-image-3.13.0-32-generic Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies.  linux-image-extra-3.13.0-32-generic : Depends: linux-image-3.13.0-32-generic but it is not going to be installed  linux-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not going to be installed  linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed  linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). How do I disable the guest session? How do I disable the guest session in Ubuntu 11.10 or higher? I don't want people to be able to use my computer without using a password to log in!