My issue: click handlers are not working after I redraw the HTML elements that activate these handlers.   I have a parent div with a list of child divs that are sortable via jquery's .sortable() method. These divs have a variety of click handlers that cause various actions to happen.   jsfiddle:   First I collect all the html in the parent div   var original_order = $('#sortable_groups').html()   and then on cancel, restore the HTML to it's original state  $('#cancel').click(function() {          $('#sortable_groups').empty().html(original_order); });   The redrawing works exactly like I want it to, but after I cancel and the html is redrawn, the click handlers aren't working.    After digging through SO, I found some outdated posts about 'live' events, which have merged into .on('click') events. I have updated the code to use .on() handlers instead of .click(), sadly this did not solve the problem.   My above fiddle simplifies (but shows) the issue I'm having. If you click the bold text, a sanity alert appears. After hitting 'cancel', the sanity alert triggered via a click no longer appears.   I have a feeling that this issue is likely to do my misunderstanding of some aspects of Jquery, but as everything appears to work well initially and no errors are present in the console, I'm not really sure what to try next.
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.
How do  methods compare in terms of model variance and bias?   My question is partly motivated by this thread: . The answer there suggests that models learned with leave-one-out cross-validation have higher variance than those learned with regular $K$-fold cross-validation, making leave-one-out CV a worse choice.  However, my intuition tells me that in leave-one-out CV one should see relatively lower variance between models than in the $K$-fold CV, since we are only shifting one data point across folds and therefore the training sets between folds overlap substantially.  Or going in the other direction, if $K$ is low in the $K$-fold CV, the training sets would be quite different across folds, and the resulting models are more likely to be different (hence higher variance).  If the above argument is right, why would models learned with leave-one-out CV have higher variance? Why do reputation drops not highlight the Achievements icon? The "Recent achievements" icon (looks like a bar graph in the top bar for signed in users) doesn't highlight when one only has recent reputation losses.  I'd like it to highlight whenever my reputation changes, positive or negative - in fact I'd suggest it's far more important for me to review posts that get a downvote than those that got an upvote.  Is there a reason negative reputation events don't cause it to highlight? I am looking to use Java to get the MD5 checksum of a file.  I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file.  How is it done? From io.Reader to string in Go Cubic polynomial with three (distinct) irrational roots I am looking for an equation     $$x^3+ax^2+bx+c=0, \qquad a, b, c \in \Bbb Z,$$   of degree $3$ that has $3$ different roots.  For an equation of degree $2$ it is easy---for example $x^2-2=0$---but I can't find an example for degree $3$.  if there is a method for finding this kind of Equation I will be grateful. Installing an HP Laserjet 1000 I've already installed hplip, it printed a test page, but it won't print from any program. It shows the printer in the list of printers, and it's checked as the default printer. I've restarted a couple times.   When I plugged the USB cable for the printer into the computer after installing hplip, it said printer detected. Then after a couple seconds it said the printer was ready for use.   When I send something to the printer, a pop-up shows that a document was sent to the printer - but there's a triangle with an exclamation point in it next to the message. A few seconds another pop-up indicates that the printer has completed printing the job but it didn't print anything. How to switch window controls to the left (Gnome Shell)? Is there a way to the switch gnome-shell window buttons to the left? I've gotten so used to them being on the left that them being on the right has thrown me way off.  (gnome shell has them defaulted to the right corner) Is it possible to have a 100% secure virtual private server? I am curious if it is possible to have a VPS that has data on it that is not readable by the hosting provider, but is still usable on the VPS.  Obviously there are some things that you could do to prevent them from reading anything...   You could change all the passwords, including root. But then, they could still use some alternate boot to reset the password, or they could just mount the disk another way. So, you could encrypt the disk or at least some of the contents on the disk. But then it seems that if you decrypted the content, they could still "peer in" to see what you were doing at the console, because after all, the virtualization platform should allow this. And even if you could stop that, it seems they could just read the RAM of the VPS directly.   Of course, the VPS can store data on it and as long as the key is not on the VPS and the data is never decrypted there, then the host cannot get the data.  But it seems to me that if any point the data on the VPS is decrypted...for use on the VPS...then the hosting provider can get the data.  So, my two questions are:   Is this correct? Is it true that there is no way to 100% secure data on a VPS from a host from seeing it, while keeping it accessable by the VPS? If it is possible to make it 100% secure, then how? If it is not possible, then what is the closest you can get to hiding data from the web host? I've been reading about a lot of different types of philosophies, religions, ways of thinking etc. I was wondering what are the most recently created philosophical ways of looking at the universe? Where can one find out about new cutting edge ideas?  Example: Before we had Marxism, Communism, Zen, Christianity etc. Now X,Y, and Z have been created building on and evolving the ideas of A,B,C.   Everything I read about are ideas that were created a long time ago. What is new and updated? Can we use an Android phone as a Wi-Fi repeater? Can we use an Android phone as a Wi-Fi repeater?  Imagine situation when you can access a weak Wi-Fi signal from a free hotspot (coffee shop) signal near window, but want to work in the middle of the room. Then we can put the phone on the window sill to spread the signal over the entire home.  Is it feasible? Print leading zeros with C++ output operator? I'd like to loop though each feature in a layer and calculate its ellipsoidal area using QgsDistanceArea() in PyQGIS 3.  Everything works fine on unprojected layers, but I get strange results when input layer is in projected CRS.  So far I have written this:  from qgis.core import *  def calculate_area(in_lyr_name, ellipsoid, units):     input_layer = QgsProject.instance().mapLayersByName(input_lyr_name)[0]      area = QgsDistanceArea()     area.setEllipsoid(ellipsoid)      features = input_layer.getFeatures()     feature_area = 0     error_features_counter = 0      for i, feat in enumerate(features):         geom = feat.geometry()         polygon_area = 0         try:             if geom.isMultipart():                 polygons = geom.asMultiPolygon()                 for polygon in polygons:                     polygon_area += area.measurePolygon(polygon[0])             else:                 polygon = geom.asPolygon()                 polygon_area = area.measurePolygon(polygon[0])              feature_area += polygon_area          except AttributeError:  # catches NoneType geometries (broken etc.)             error_features_counter += 1             pass      # calculated area is in sq. metres (see the "else" case)     if units == 'km²':         final_area = feature_area / 1e6     elif units == 'Ha':         final_area = feature_area / 10000     else:         final_area = feature_area     return final area, error_features_counter   How do I get a constant result that does not depend on the presence of projection? Can I see which seats are available on a British Airways flight before I book? I just wanted to know how to add "create node form" in a block  when i  copy the source code and make a block out of that code, only public could post from that. when i am posting as a user it says timeout and tells us to refresh the page. plz someone give me solution.  SO i tried to add the following code in page.tpl.php  $form = node_add('nodetype'); print drupal_render($form); How does tangzhong (water roux) make bread softer? As I understand it, tangzhong in relation to bread making is an Asian technique in which a portion of the flour in the recipe is pre-cooked with water to make a roux, before being cooled and added to the rest of the ingredients. It is supposed to make the resulting bread very soft, often for days longer than non-tangzhong breads. I thought maybe it works by binding the proteins so gluten development is restricted, but I'd have thought that would inhibit rise, which seems not to be an issue.  Disclaimer: I have not yet made a tangzhong bread, but I believe I have eaten a few... My first attempt is currently doing a bulk rise.  How does tangzhong work exactly? How does it actually change the dough to achieve the distinct softness for which it is so famous? Proving that the map from a topological space to a fiber bundle is open. How do I avoid the "S to Skip" message on boot? After upgrading my laptop from karmic to lucid, my fat32 partition won't mount automatically. I get the message:  The disk drive for /osshare is not ready yet or not present Continue to wait; or Press S to skip mounting or M for manual recovery   Funny thing is, if I skip, then /osshare/ is mounted once I log in.   I've a similar setup on my desktop, and it works fine. Fstab on desktop:  UUID=4663-6853  /osshare        vfat    utf8,umask=007,gid=46 0       1   /etc/fstab on laptop:  UUID=1234-5678 /osshare vfat utf8,auto,rw,user 0 0 When using the Text Editor, what is the best command to include inside a script which will abort the script at that line?  quit() and sys.exit() stop the script, but also kill Blender. So my friend has a USB flash drive that isn't working. I don't know a whole lot about "recovery" software so I figured I'd ask you guys.  What steps can I try (I have access to a Linux machine as well) to see....if I can get ANYTHING off the flash drive?  I've google'd around, but most of the stuff seems for windows. I had one batch class in which i am passing some data required for creating object record.But when i call that batch class from parent class variables are initialized but start method are not called as there is no record to query i also tried with iterable object but not able to do that.My code is as below  global class testBatchClass implements Database.Batchable&lt;SObject&gt;,Database.Stateful{     public List&lt;sObject&gt; sObjectList;     public string objectName;     public String dataList;      public testBatchClass(String objectName,String inputdata){          String listType = 'List&lt;'+objectName+'&gt;';         system.debug('list type value is'+listType);         List&lt;SObject&gt; castRecords = (List&lt;SObject&gt;)Type.forName(listType).newInstance();         this.sObjectList = castRecords;         this.objectName = objectName;         this.dataList = inputdata;      }     global Iterable&lt;SObject&gt; start(Database.BatchableContext batchableContext) {         return new sObjectList{};     }     global void execute(Database.BatchableContext batchableContext, List&lt;sobject&gt; scope){          List&lt;OpportunityRenewal__mdt&gt; mdtList = new List&lt;OpportunityRenewal__mdt&gt;([Select id,Api_Name_of_Fields__c,Sobject_Name__c from TestFileUploadCustomSetting1__mdt where Sobject_Name__c=:objectName]);         List&lt;String&gt; fieldName = new List&lt;String&gt;();         for(OpportunityRenewal__mdt md : mdtList){             if(md.Sobject_Name__c == objectName){                 fieldName = md.Api_Name_of_Fields__c.Split(',');                 break;             }         }         List&lt;String&gt; dataRowsSplit= dataList.split(',');         dataRowsSplit.remove(0);         for(String eachRow: dataRowsSplit){             List&lt;String&gt; splitString = eachRow.Split(',');             sObject sobj = Schema.getGlobalDescribe().get(objectName).newSObject();             for(Integer i=0; i &lt;= splitString.Size(); i++){                 sobj.put(fieldName[i],splitString[i]);             }             scope.add(sobj);         }         if(scope != Null &amp;&amp; scope.Size() &gt; 0){             upsert scope;         }     }      global void finish(Database.BatchableContext batchableContext) {} }   Thanks