I created a form with checkbox + wrapper, i.e :  &lt;form&gt;   &lt;div class="input-wrapper"&gt;       &lt;input type="checkbox" name="item[]" value="1"&gt;   &lt;/dv&gt;   &lt;div class="input-wrapper"&gt;       &lt;input type="checkbox" name="item[]" value="2"&gt;   &lt;/div&gt;   &lt;div class="input-wrapper"&gt;       &lt;input type="checkbox" name="item[]" value="3"&gt;   &lt;/div&gt; &lt;/form&gt;   and this toggle check is working:  $(".input-wrapper").on("click", function () {         var $checkbox = $(this).find(':checkbox');        $checkbox.prop('checked', !$checkbox[0].checked);  });   But when I load other checkbox from ajax, i.e:  $.post(      '/my/url',      {...my data...},       function(data){            if(data != 'failed'){                //return new checkbox + wrapper too and append it at the end of the form                 $('form').append(data);            }       }  );   the Toggle check is not working just for the loaded/appended element.  How to fix this ? how to properly create a script that affect all the element even for the loaded one ?  thanks.
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.
The double cone is not a surface. Is there a way to prevent those pesky .DS_Store files from being ever created? Is there a way (eg. a binary hack into Finder) to stop it from creating .DS-Stores on LOCAL Volumes?   I am using Leopard, therefore these don't work:    (requires Lion)  (requires Snow Leopard)   Also,  slows down my computer. Calculate total sum of all numbers in c:forEach loop I have a Java bean like this:  class Person {   int age;   String name; }   I'd like to iterate over a collection of these beans in a JSP, showing each person in a HTML table row, and in the last row of the table I'd like to show the total of all the ages.  The code to generate the table rows will look something like this:  &lt;c:forEach var="person" items="${personList}"&gt;   &lt;tr&gt;&lt;td&gt;${person.name}&lt;td&gt;&lt;td&gt;${person.age}&lt;/td&gt;&lt;/tr&gt; &lt;/c:forEach&gt;   However, I'm struggling to find a way to calculate the age total that will be shown in the final row without resorting to scriptlet code, any suggestions? How can momentum but not energy be conserved in an inelastic collision? When should I use the subjunctive mood? In which cases should I use the subjunctive mood?     I suggest that every applicant fill out the form carefully.        If she were rich, she would live on Long Island. How is effect precedence determined? I was using  and my opponent has a . I attacked Sylvanas, fearing that the Deathrattle will take control of one Hyena. I feel lucky, because it did not happen.  I want to know if there are some general rules of effect precedence.   Has Blizzard published something about this?  Are there articles teaching about precedence?   Please note, I want guidance about effect precedence in general, not just about Deathrattle. Last upgrade crashes network manager (no internet connection, no applet) While upgrading today, something caused my wireless network manager to disappear. Not even connecting via wired connection.  This error is being shown by files:  **(nm-applet:2716): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files   (nm-applet:2716): nm-applet-WARNING **: Error connecting to ModemManager: Error calling StartServiceByName for org.freedesktop.ModemManager1: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Cannot launch daemon, file not found or permissions invalid   (nm-applet:2716): nm-applet-WARNING **: Could not find ShellVersion property on org.gnome.Shell after 5 tries   (nm-applet:2716): nm-applet-WARNING **: Failed to register as an agent: (2) The name org.freedesktop.NetworkManager was not provided by any .service files    Is there a patch I can download through windows and send through to my ubuntu, or is it a case of having to reload everything? I tried running two versions back but still no internet access. There are 'n' candies and 't' boxes. Find the number of ways to place the candies in the boxes for each of the conditions (given in the problem). There are 'n' candies and 't' boxes. Find the number of ways to place the candies in the boxes for each of the conditions (all the candies must be spread out) : (a) candies and boxes are different; (b) candies of the same diiferent boxes should not be empty cartons: (c) candies equally new, boxes are different; Edit :(d) candies are different, the boxes are the same, there should be no empty boxes; (e) candies of different boxes alike.(Edit : candies are different, boxes are equal) Specify the display type that matches the placement, if possible. My Answers : (a) Each layout is encoded with a word of $n$ letters from the alphabet of 't' letters $\implies$ possible $n^t$ variants. (b) Write, $n$ candies in the form of balls ina line, we need to put $(t-1)$ partition in $(n-1)$ place, but we can't put two partitions on one place, so we get : $^{t-1}C_{n-1}$. (c) First we need to choose a candy in a box (in the first box $n$ ways, in the second box $(n-1)$, $\cdots$ in the $t-th$ : $(n-t+1)$ ways $\implies$ total $n!/(n-t)!$ methods, and then we distribute the remaining $(n-t)$ candies into $t$ boxes, this is encoded with owrds from the alphabets (for each candy $t$ variants) $\implies$ $t^{n-t}$. The Answer is : $\frac {n!}{(n-t)!}*t^(n-t)$ Are my answers (a), (b) &amp; (c) are correct? For (d) &amp; (e) I don't know how to proceed? Please help me. How to extract Time from Date/Time field within formula A saying for something that's good but also has a downside I'm trying to transition from a list of pros to a list of cons, and would like to have some sort of transition quote. Something in the form of,  "But, alas, (((something something quote quote)))"  Everything that has a beginning has an end, something along the lines of that. My 5 year- old daughter is constantly defiant! My 5-year old daughter is very defiant.  It started getting bad about 6 months ago. She doesn't do what she is told, and any time she hears the word "no" she throws terrible, dramatic fits, screaming ridiculously loud, and in some cases hitting.  She refuses to make eye contact when I warn her to stop doing something even when I am down at her eye level and it takes multiple orders to finally get her to look at me. She constantly tells me no.  I feel like I constantly tell her no and that she feels this gives her the right to tell her father and I no.  I have tried time outs which are not effective at all; she only throws a fit the whole time, never seeming to run out of wind. Spankings are only effective until the shock of the action itself wears off and then she returns to the same behavior.  My husband and I recently took away ALL of her toys/ possessions being she is a pretty materialistic child (she loves getting toys and always wants something new). We told her that if she was good and listened and stopped telling us no and throwing fits, that after three days we would let her choose three boxes of toys to bring back in her room. This worked but as soon as she got those three boxes unpacked, we packed them back up because she went right back to the no's and fit-throwing within a few hours.  I am mainly the one disciplining her and I feel she is definitely the most defiant with me. I believe in explaining to her why things are not OK and why I tell her no, but I really don't feel it helps and I never feel as if she listens to what I tell her.  I am at my wits' end and feel like a failure of a mother. She is my first and only child, and the only grandchild on both sides of our family. She is an angel at school but home is completely different.  I need help figuring this out but nobody I talk to really has any advice for me. I am at the point where I am wondering if she or I need counseling because I feel out of options. Why does ( exit 1 ) not exit the script? I have a script, that does not exit when I want it to.  An example script with the same error is:  #!/bin/bash  function bla() {     return 1 }  bla || ( echo '1' ; exit 1 )  echo '2'   I would assume to see the output:  :~$ ./test.sh 1 :~$   But I actually see:  :~$ ./test.sh 1 2 :~$   Does the () command chaining somehow create a scope? What is exit exiting out of, if not the script? Number of Homomorphisms from $\Bbb{Z}_m$ to $\Bbb{Z}_n$ This question coutesy of Allan Clark's "Elements of Abstract Algebra" (60$\zeta$).   Find the number of homomorphisms from $\Bbb{Z}_m\to \Bbb{Z}_n$ as a function of $m$ and $n$.  This is stumping me, can anyone help? If $k=1$, we have \begin{align} \sum_{n\ge1}\frac{1}{\binom{2n}{n}}&amp;=\frac12\sum_{n\ge1}n\mathrm{B}(n,n)\\ &amp;=\frac12\int _{0}^{1}\sum_{n\ge1}n(t-t^2)^{{n-1}}{\mathrm  d}t\\ &amp;=\frac12\int _{0}^{1}\frac{1}{(t-t^2-1)^2}{\mathrm  d}t\\ &amp;=\frac13+\frac{2\sqrt3\pi}{27} \end{align} I wonder if there exists a general formula of $\sum_{n\ge1}{\binom{2n}{n}^{-k}}$ with $k\in\Bbb N^*$. This may involve some ${}_pF_q$ functions. Why quantum mechanics? Imagine you're teaching a first course on quantum mechanics in which your students are well-versed in classical mechanics, but have never seen any quantum before.  How would you motivate the subject and convince your students that in fact classical mechanics cannot explain the real world and that quantum mechanics, given your knowledge of classical mechanics, is the most obvious alternative to try?  If you sit down and think about it, the idea that the state of a system, instead of being specified by the finitely many particles' position and momentum, is now described by an element of some abstract (rigged) Hilbert space and that the observables correspond to self-adjoint operators on the space of states is not at all obvious.  Why should this be the case, or at least, why might we expect this to be the case?   Then there is the issue of measurement which is even more difficult to motivate.  In the usual formulation of quantum mechanics, we assume that, given a state $|\psi \rangle$ and an observable $A$, the probability of measuring a value between $a$ and $a+da$ is given by $|\langle a|\psi \rangle |^2da$ (and furthermore, if $a$ is not an eigenvalue of $A$, then the probability of measuring a value in this interval is $0$).  How would you convince your students that this had to be the case?  I have thought about this question of motivation for a couple of years now, and so far, the only answers I've come up with are incomplete, not entirely satisfactory, and seem to be much more non-trivial than I feel they should be.  So, what do you guys think?  Can you motivate the usual formulation of quantum mechanics using only classical mechanics and minimal appeal to experimental results?  Note that, at some point, you will have to make reference to experiment.  After all, this is the reason why we needed to develop quantum mechanics.  In principle, we could just say "The Born Rule is true because its experimentally verified.", but I find this particularly unsatisfying.  I think we can do better.  Thus, I would ask that when you do invoke the results of an experiment, you do so to only justify fundamental truths, by which I mean something that can not itself just be explained in terms of more theory.  You might say that my conjecture is that the Born Rule is not a fundamental truth in this sense, but can instead be explained by more fundamental theory, which itself is justified via experiment.  Edit:  To clarify, I will try to make use of a much simpler example.  In an ideal gas, if you fix the volume, then the temperature is proportional to pressure.  So we may ask "Why?".  You could say "Well, because experiment.", or alternatively you could say "It is a trivial corollary of the ideal gas law.".  If you choose the latter, you can then ask why that is true.  Once again, you can just say "Because experiment." or you could try to prove it using more fundamental physical truths (using the kinetic theory of gases, for example).  The objective, then, is to come up with the most fundamental physical truths, prove everything else we know in terms of those, and then verify the fundamental physical truths via experiment.  And in this particular case, the objective is to do this with quantum mechanics. How can I find hard links on Windows? I've created some hard links on my Windows 7 file system using mklink. It was some time ago and I can't remember for sure where, or which files. When I use Explorer, all files look the same. When I use the command line and type "dir", they all look the same.  How do I find hard links? Or how do I determine whether a specific file IS a hard link? What does "Baking" mean? I want to make some cool items for Dota 2 and I'm reading a guide. There are some tips about baking  etc. but I can't use them, because I don't even know what baking means. Can somebody explain this, please?  Thanks for all answers. Exposing database IDs - security risk? How can I simplify the use of flags with Views Bulk Operations? I have an administrative display (made with views) that lists content that is pending approval.  In the case of my site, approval means flagging with the approval_for_pub flag (which triggers a custom rule).   allows nodes to be flagged/unflagged all at once by clicking a handy button:    However, upon clicking this button, by default it shows all possible flags and the flag/unflag option:    This is a problem on my site because some of the people responsible for approval get confused by the names of the flags and select the wrong option.  So, what I would like to do is create a VBO option that, when the button is pressed, automatically flags all applicable content with the approval_for_pub flag.  How can I approach this?  It seems like a small detail, but this step happens several times a day, so the chance of making a mistake is quite high. I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal.