I added content by html() function. The contents have elements like images and links, but I can't use click or any function for the added content using its id.  Example:  $("#container").mouseover (function(){     $("#container").html('&lt;a id="button1" href="#"&gt;&lt;img src="images/button1.gif"&gt;&lt;/a&gt;'); }); $("#button1").click(function(){     $("#container").html ('any content'): });
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 to view the user's status? I have a lightning component that displays Knowledge Articles based on Topic IDs that it is configured for. This works great so I went to create my test coverage for it and discovered that the inserted test Knowledge Articles can only ever be 'Draft' making my tests fail since the apex class only looks for 'Online'. Instead of rewriting my component I decided to overload the apex method so that when called without the status parameter it passes in 'Online' allowing my tests to pass in 'Draft' instead. However, the first method signature does not get called from the component resulting in null for the status parameter.  Here is the component controller:  ({     "retrieveArticles" : function(component, event, helper) {         var action = component.get("c.returnArticlesWithTwoTopicIds");         action.setParams({             mainTopicId : component.get("v.mainTopicId"),             secondaryTopicId : component.get("v.secondaryTopicId"),             limitAmount : component.get("v.limitAmount")         });          action.setCallback(this, function(response) {             var state = response.getState();             if (component.isValid() &amp;&amp; state === "SUCCESS") {                 // handle SUCCESS             }             else if (component.isValid() &amp;&amp; state === "ERROR") {                 // handle ERROR             }         });         $A.enqueueAction(action);     } })   Here is the apex class:  public with sharing class KnowledgeArticleVersionCtrl {     @AuraEnabled     public static List&lt;KnowledgeArticleVersion&gt; returnArticlesWithTwoTopicIds(String mainTopicId, String secondaryTopicId, Integer limitAmount) {         return returnArticlesWithTwoTopicIds(mainTopicId, secondaryTopicId, limitAmount, 'Online');     }      @AuraEnabled     public static List&lt;KnowledgeArticleVersion&gt; returnArticlesWithTwoTopicIds(String mainTopicId, String secondaryTopicId, Integer limitAmount, String status) {         // build query string         List&lt;KnowledgeArticleVersion&gt; articles = Database.query(query);         return articles;     } }   Is there something about the component that would cause it to not use the first signature, the one it should match, in place of the second one, which it shouldn't match? How to combine two jQuery results How do you combine two jQuery search results? eg:  var $allFoos = $('.foo'),     $allBars = $('.bar')     $allFoosAndBars = $allFoos + $allBars;   Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, and it could be any arbitrary sets i'm talking about, so $('.foo, .bar') is not what I'm after. After having read various articles on this site about WWW or Non-WWW website setup, ,  and , and after having setup a correct redirection rule in .Htaccess to at least eliminate duplicate contents (currently the non-www solution (e.g. http://example.com) I have a feeling that my site rank less since I changed this.   My confusion was strengthened by these two opponents:     &amp;     Could the change of www.example.com >> http://example.com have a factual impact on ranking?  say either is better or worse. Are they holding information back?  I am confused fellow folks...  As much as I would like to separate facts from fiction, I am aware that not all the good valid information is written. Not on google webmaster site and perhaps not elsewhere. If so it seems out of date!  Does or does not a WWW domain impact SEO/rank better than its NON-WWW version? (Given that you have setup a proper redirect to avoid duplicates and go with one) I used to have an icon on the Windows Vista taskbar showing the battery amount remaining (laptop). It has mysteriously vanished.  How can I get it back?  I followed the Windows  (see How can I hide the battery icon in the notification area? - hoping to reverse the instructions) but the Power checkbox on the Notification Area tab was greyed out and could not be checked or unchecked (it is currently unchecked). Use of very as an adjective is (in my experience) most frequently attested in phrases like     ...the very person I was looking for.   To use adjective very with the indefinite article sounds quite bizarre in this case:     ?...a very person I was looking for.   But consider this sentence, where indefinite a is used:     Visualizing a very transformation of the master-slave relation, Thomas presses further: the slave is brother to the master, even doubly a brother.   OED treats the two uses as separate senses of the word, with the following definitions:           (first use):&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With limitation (usually expressed by the or a possessive) to particular instances      (second use): Really or truly entitled to the name or designation   Here are two respective examples quoted in OED:     What would you say to me now, and I were your verie, verie Rosalind? (1616)   Thence we went into Queen Mary's room, and saw that beautiful portrait—that very queen and very woman. (1857)   Clearly, the difference in meaning between the two senses is quite light, and it seems to me like a kind of difference which is recurrent enough to have its own term. What is the proper term? Are there other English words having similarly related pairs of senses? And lastly, is OED jumping the gun in treating these as two senses? Could the difference in meaning instead be due to the choice of determiner? How to fix Footnote position at the bottom of the page \footnote[1]{\nameref*{8.1.16} is an अधिकार सूत्र it goes upto \nameref*{8.3.55}} \&amp; अङ्गाधिकार (अङ्गस्य)\footnote[2]{\nameref*{6.4.1} is an अधिकार सूत्र it goes upto \nameref*{7.4.97}}  I am using footnote as shown above. However the footnote appears to be floating and when I don't have much in the page it appears in the middle of the page. I got by so far with \vspace{} but I think there must be a way to position this at the bottom of the page despite whats in the page. Thanks for your help How to set timeout for web service call I want to call out my web service after the insert process of a custom object with a delay of 2 minutes. But i am getting that exception FATAL_ERROR|System.CalloutException: Read timed out How can i fix that problem ? Here is my implementation.  Callout class:  public class HttpCallout{     @Future(callout=true)     public static void getContent(String url){         Http h = new Http();          HttpRequest req = new HttpRequest();         req.setEndpoint(url);         req.setMethod('GET');         req.setTimeout(2000);          HttpResponse res = h.send(req);         String response = EncodingUtil.urlDecode(res.getBody(),'UTF-8');         System.debug('***response****'+response);     }      public void serviceCaller(){         getContent(url);     } }   Trigger:  trigger AfterInsertOrUpdate on Sales_Order__c (after insert) {     System.debug('Making future call to update account');     HttpCallout httpCallout = new HttpCallout();     httpCallout.serviceCaller();     System.debug('After Insert'); }   Any help would be appriciated. pattern of moving electrons in wire under AC I want to quantify the relationship between two variables, A and B, using mutual information. The way to compute it is by binning the observations (see example Python code below). However, what factors determines what number of bins is reasonable? I need the computation to be fast so I cannot simply use a lot of bins to be on the safe side.  from sklearn.metrics import mutual_info_score  def calc_MI(x, y, bins):     c_xy = np.histogram2d(x, y, bins)[0]     mi = mutual_info_score(None, None, contingency=c_xy)     return mi Edit source differs from question view? Or are we each other's friends now? Cleaning Circuits with Compressed Air I've been arguing with a colleague whether it is a sensible solution to clean dusty PCBs with compressed air. While I think this is the best solution (nothing touches the PCB), he claimed that spraying off the dust can cause ESD, because the charges that may have accumulated in the dust win't bleed off in the process (and it's better to leave everything as it is). I'm not really convinced by this argument and my (limited) knowledge of ESD production doesn't help getting peace of mind in this matter. What is your input? Short story where time is accelerated and characters have to get back to ship? Looking for a short story where time is accelerated on a planet.  The characters are actually born at the beginning of the story and then grow up quickly and inadvertently learn that their forebears came from a rocket ship nearby.  After having aged to "teenagers" they try to reach the ship?  At some point there is a war between confused aging survivors.  I think it was in a compilation which included a story called "Cousins". jQuery appended table adds closing tag at the end of the text automatically. Why? Connection pools being reset with Error: 18056, Severity: 20, State: 46. & Perfmon Counters not showing We are using SQL Authentication (to reduce the number of connection pools) &amp; .NET 4.0 connection strings to connect to SQL Server Enterprise Edition 2012 SP1 on a Windows 2008 R2 Enterprise Server:     Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64)   Oct 19 2012 13:38:57   Copyright (c) Microsoft Corporation   Enterprise Edition (64-bit) on Windows NT 6.1  (Build 7601: Service Pack 1)   We use about 50 servers split into 8 different groups different parts of a website.  Our website is using this SQL Server to log visit tracking data. Over the last few days it has spat out the following messages about the resetting connection pools:     The client was unable to reuse a session with SPID 1327, which had been reset for connection pooling. The failure ID is 46. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.   Error log reads:     Error: 18056, Severity: 20, State: 46.   The client was unable to reuse a session with SPID 959, which had been reset for connection pooling. The failure ID is 46. This error may have been caused by an earlier  operation failing. Check the error logs for failed operations immediately before this error message.   Login failed for user 'xxxx'. Reason: Failed to open the database 'xxxxxxxx' configured in the login object while revalidating the login on the connection. [CLIENT: 10.xx.xx.xxx]   After some digging, I found this document on the CSS blog:  and this one by Aaron Bertrand: . I know the error number is different but the failure ID is the same with a number of the messages are identical).  Failure ID 46 suggests that the login did not have permissions. Our logins default to the master database and the db name is specificied in the connection string.  I wanted to check the number of connection strings pools, etc. and checked all the counters in Perfmon for .Net Data Provider for SqlServer. It only gave me the option of defaultdomain9675 for the instance, so I selected that assuming that is a system generated ID name for our Datacentre network. Unfortunately all of the counters are reading zero. On one of our other main servers the connection pools are hovering around 10 which is what I expected to see on a healthy server with that kind of load.  My question is 3 fold   Can anyone suggest why the Windows 2008 R2 Server is not showing .Net Data Provider for SqlServer? Has anyone experienced this as I obviously believe that the login not having permissions is a red herring ? If different groups of web servers have the same connection string syntax but with slightly different whitespace, would this cause the server to use another connection pool?   Min &amp; max memory settings are 20GB &amp; 58GB respectively. The server is a dedicated database server with 64GB of RAM. I don't think memory is the issue as the box seems to have a decent page lfe expectancy. Auto close is not enabled. The server is always up: this is a 24x7 website with heavy usage. Set title for each terminal tab in gnome-terminal using a bash script I'm using Ubuntu 16.04  I want to open multiple terminal tabs, run commands and set title. I can open multiple tabs with this command:  gnome-terminal --tab -e "command1" --tab -e "command2"   but cannot use --title option as it is not available in this version.   I know mate-terminal can do this, but I want to use gnome-terminal.   I've applied solution posted  and it worked but when i run  gnome-terminal --tab -e "bash -c 'set-title 99;ping 192.168.7.99'"   It shows:  bash: set-title: command not found PING 192.168.7.99 (192.168.7.99) 56(84) bytes of data. 64 bytes from 192.168.7.99: icmp_seq=1 ttl=128 time=0.425 ms 64 bytes from 192.168.7.99: icmp_seq=2 ttl=128 time=0.353 ms 64 bytes from 192.168.7.99: icmp_seq=3 ttl=128 time=0.335 ms   I also applied   I've also read this post  but the accepted answer did not solve my issue in 16.04 os or gnome-terminal version 3.18.3 and other solution provides to use other terminal xterm and I want to use gnome-terminal. Applying an ellipsis to multiline text Find the equation of a plane containing a point and passing through a line Find the general form equation of a plane that contains the point $(2, -2, 1)$ and passes through a line $(x, y, z) = (1, 2, -3) + t(2, -3, 2)$.  I managed to use the fact that it contains a given point to write the equation of the plane as $A(x-2) + B(y+2) + C(z-1) = 0$ but got stuck there. Why does k-means clustering algorithm use only Euclidean distance metric? Is there a specific purpose in terms of efficiency or functionality why the k-means algorithm does not use for example cosine (dis)similarity as a distance metric, but can only use the Euclidean norm? In general, will K-means method comply and be correct when other distances than Euclidean are considered or used?  [Addition by @ttnphns. The question is two-fold. "(Non)Euclidean distance" may concern distance between two data points or distance between a data point and a cluster centre. Both ways have been attempted to address in the answers so far.] How to programmatically click a button in WPF?