I am trying to make a simple list using JavaScript and jQuery. I am using oops concept of JavaScript. I am able to add new element in list. I am facing one problem, I have two buttons to update and delete the row. I created an array in which I have all the objects. I wanted if user click on delete button it deletes from array, as well as from the list. Same if user update the item it should also get updated in the array and list   I tried doing like this     function Phonebook(){     this.phoneBookArray=[];     var defaultvalue= [{name:"abc",phonenumber:989123},{name:"pqr",phonenumber:9891462}]     this.phoneBookArray=defaultvalue;     console.log(this.phoneBookArray)    } Phonebook.prototype.addItem=function(username,phoneNumber){     this.phoneBookArray.push({name:username,phonenumber:phoneNumber})     this.displayItem(); }  Phonebook.prototype.displayItem=function(){     $("#phonelist").html('');     for(var i=0;i&lt;this.phoneBookArray.length;i++){         $("#phonelist").append('&lt;li&gt;&lt;span&gt;'+this.phoneBookArray[i].name+'&lt;/span&gt;&lt;span&gt;'+       this.phoneBookArray[i].phonenumber+'&lt;/span&gt;&lt;span&gt;&lt;button class="del"&gt;delete&lt;/button&gt;&lt;/span&gt;&lt;span&gt;&lt;button class="update"&gt;update&lt;/button&gt;&lt;/span&gt;&lt;/li&gt;')     } }  var phonedir=new Phonebook(); phonedir.displayItem(); $('#addItem').click(function(){      var name=$('#nameEdit').val();      var phone=$('#numberEdit').val();      if(name!=''&amp;&amp; phone!=""){        phonedir.addItem(name,phone);         $('#nameEdit').val('');         $('#numberEdit').val('');     }else{      alert('please enter number and name')        }  })   $('.del').click(function(){     //try to delete item from list as well as from phoneBookArray    console.log($(this).parent('li'))  })  $('.update').click(function(){     //try to update item from list as well as from phoneBookArray      // try to get selected item and fill on text field and update the list    //console.log($(this).parent('li'))  })
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.
Can internal forces do work? My Mechanics textbook claims that the sum of the work by internal forces is not generally zero.  translated to English the paragraph reads:     Notice about the work by internal forces: the work by the internal forces is in general not equal to zero although the sum of the internal forces is always equal to zero. Since the work also depends on the relative displacement of the two pointmasses in the material system, the work provided by these 2 internal forces will generally not be equal to zero.   Other sources claim that the work done by internal forces is always zero.  (answer by Mark Eichenlaub)     Then I didn't do any work on the system at all since, by definition, only external forces can do work.        the net work done by internal forces is zero since they do not cause motion of the object.   To me it would seem that these sources contradict eachother. Do they? If so, which one is correct? If not, please explain why they don't contradict eachother. Is it possible to skip releases during an upgrade? Possible Duplicate:          Is it possible to upgrade a 10.04 lucid installation to 11.04 Natty, without upgrading to 10.10 first? What about other versions? extract fields from bib bibliographic file I want to extract specific fields from a natbib/bibtex bibliographic file to construct a table similar to:  title ------------------------------------------------- authors ------------------------------------------------- journal, year, volume ------------------------------------------------- abstract -------------------------------------------------   is there a way to do this in latex?  Thanks Jorge In , it is established that Thieves' Cant is more of an encoding system built on top of a language than a language in its own right. According to the Basic Rules,  is:  ...a secret mix of dialect, jargon and code allows you to hide messages in seemingly normal conversation. Only another creature that knows thieves' cant understands such messages. It takes four times longer to convey such a message than it does to speak the same idea plainly. In addition, you understand a set of secret signs and symbols used to convey short, simple messages, such as whether an area is dangerous or the territory of a thieves' guild, whether loot is nearby, or whether the people in an area are easy marks or will provide a safe house for thieves on the run. (PBR, p. 27)  Can two creatures communicate using Thieves' Cant if they do not have a basic spoken language in common, or if they are speaking different basic languages? E.g. if one creature knows Orcish, Goblin, and Thieves' Cant, and another creature knows Elvish, Giant, Common, and Thieves' Cant, can they communicate with each other by embedding Thieves' Cant into their own languages? Hypothetically speaking, I can see how this could be possible in our own world, if we assume that Thieves' Cant depends on nuances of body language, emphasis, and tempo, e.g., one might say to a non-Spanish speaker:  Tenemos quEEEEEEE ir (wink) a la tieeeeenda de (shuffle left foot) armas para (twirl hair and giggle) comprar una espada (wink twice) para mi herMANO (wag right pinky and nod).  The literal message itself (&quot;We need to go to the weapon store to buy a sword for my brother.&quot;) would just be a carrier - the real message might be hidden within the gestures and the accented and extended syllables. Perhaps the drawn-out &quot;E&quot; vowel means &quot;robbery planned&quot;, the wink means &quot;bank&quot;, shuffling the left foot means &quot;be there at sunset&quot;, etc., and these are things that you wouldn't necessarily need to know Spanish to extract. Is this how Thieves' Cant actually works, or does it require actual comprehension of the literal message transmitted before the &quot;secret&quot; message can be extracted from it? Whenever I install vsftpd on centos, I only setup the jail environment for the users and rest is default configuration of vsftpd. I create user and try to connect with filezila ftp client, but I could not connect with passive mode. I always change the transfer settings to active mode to successfully connect to the ftp server otherwise I get        Error: Failed to retrieve directory listing   So is there a way to change any directive in vsftp.conf file and we can connect with passive mode to the server? Why does the order of the loops affect performance when iterating over a 2D array? How does Lucio's aura work vertically? If I play Lucio, can I heal the teammates located at a different height? (roof, upstairs, hovering Pharah... )  In other word is that aura strictly horizontal? Or does it work more like a bubble like Winston's barrier?  If it's horizontal, does it require Line Of Sight or not? (will I heal a nearby ally right behind a wall?) Can anyone explain precisely what IOWait is? Why was the universe in an extraordinarily low-entropy state right after the big bang? Let me start by saying that I have no scientific background whatsoever. I am very interested in science though and I'm currently enjoying Brian Greene's The Fabric of the Cosmos. I'm at chapter 7 and so far I understand most of general ideas he has talked about. Or at least, I think I understand them :-)  There is however one part, at the end of chapter 6 that I can't grasp.  It is about entropy and the state of the universe a few minutes after the big bang.  On page 171 he says:     Our most refined theories of the origin of the universe -our most refined cosmological theories- tell us that by the time the universe was a couple of minutes old, it was filled with a nearly uniform hot gas composed of roughly 75 percent hydrogen, 23 percent helium, and small amounts of deuterium and lithium. The essential point is that this gas filling the universe had extraordinarily low entropy.   And on page 173-174:     We have now come to the place where the buck finally stops. The ultimate source of order, of low entropy, must be the big bang itself. In its earliest moments, rather than being filled with gargantuan containers of entropy such as black holes, as we would expect from probabilistic considerations, for some reason the nascent universe was filled with a hot,   uniform, gaseous mixture of hydrogen and helium. Although this configuration has high entropy when densities are so low that we can ignore gravity, the situation is otherwise when gravity can't be ignored; then, such a uniform gas has extremely low entropy. In comparison with black holes, the diffuse, nearly uniform gas was in an extraordinarily low-entropy state.   In the first part of the chapter Brian Greene explains the concept of entropy with tossing the 693 pages of War and Peace in the air.  At first, the pages are ordered. The specific order they are in make sense and are required to recognize the pages as a readable book called War and Peace. This is low entropy. It is very highly ordered and there is no chaos.  Now, when you throw the pages in the air, let them fall and then pick them up one by one and put them on top of each other, the chances you get the exact same order as the initial state are extremely small. The chance you get another order (no matter what order, just not the one from the beginning) is extremely big. When the pages are in the wrong order, there is high entropy and a high amount of chaos. The pages are not ordered and when they are not ordered you would not notice the difference between one unordered state and another one.  However, should you swap two pages in the ordered, low entropy version, you would notice the difference.  So I understand low entropy as a highly ordered state with low chaos in which a reordering of the elements would be noticeable.  I hope I'm still correct here :-)  Now, what I don't understand is how a uniform mixture of hydrogen and helium can by highly ordered? I'd say you wouldn't notice it if some particles traded places. I'd say that a uniform mixture is actually in a state of high entropy because you wouldn't notice it if you swapped some hydrogen atoms.  Brian Greene explains this would indeed be the case when gravity plays no important role, but that things change when gravity does play a role; and in the universe right after the big bang, gravity plays a big role.  Is that because a reordering of the particles would change the effects of gravity? Or is there something else that I'm missing here? What is a good word to describe 'exceptional positive' research work? How to find solutions of linear Diophantine ax + by = c? I have added an mp3 file as a static resource, can someone please help me to call that resource in the lightning component so when I hit the button it will play that static resource  as per the Salesforce documentation I have tried below but instead of playing the sound it is displaying the message. Direct Link to a Comment The increase in the character limit of comments has led them to become as important as the questions and answers that spawn them. On several occasions (especially on meta) I've found reason to want to link to a comment directly. I'd imagine something as simple as making the date / time stamp an anchored link which mimics the behavior of the question link. I am performing a meta-analysis with 137 study arms. From each arm I have extracted a proportion of a disease. Here are my proportions:  [1] 0.002710027 0.000000000 0.000000000 0.000000000 0.017857143 0.000000000 0.010269576 0.000000000 0.000000000 0.000000000 0.000000000  [12] 0.010000000 0.053691275 0.052631579 0.070351759 0.000000000 0.108333333 0.262626263 0.013043478 0.000000000 0.007000000 0.000000000  [23] 0.000000000 0.000000000 0.240000000 0.000000000 0.033333333 0.000000000 0.000000000 0.000000000 0.000000000 0.013201320 0.000000000  [34] 0.005361930 0.002308403 0.000000000 0.000000000 0.000000000 0.030000000 0.046296296 0.000000000 0.020000000 0.045454545 0.161073826  [45] 0.000000000 0.000000000 0.000000000 0.095238095 0.007194245 0.001472754 0.000000000 0.000000000 0.000000000 0.000000000 0.012048193  [56] 0.000000000 0.048780488 0.000000000 0.086253369 0.033898305 0.011966701 0.004162331 0.062790698 0.005555556 0.004451039 0.287356322  [67] 0.083333333 0.000000000 0.000000000 0.014666667 0.006160164 0.023809524 0.000000000 0.000000000 0.000000000 0.001552795 0.102564103  [78] 0.030555556 0.000000000 0.000000000 0.000000000 0.000000000 0.029411765 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000  [89] 0.003231018 0.000000000 0.037500000 0.040247678 0.000000000 0.000000000 0.007299270 0.014598540 0.000000000 0.015118790 0.000000000 [100] 0.000000000 0.005555556 0.000000000 0.000000000 0.000000000 0.003039514 0.042145594 0.250000000 0.307692308 0.324444444 0.002057613 [111] 0.008333333 0.000000000 0.027522936 0.022598870 0.000000000 0.000000000 0.000000000 0.135278515 0.033333333 0.000000000 0.000000000 [122] 0.003690037 0.003412969 0.000000000 0.017391304 0.004237288 0.033210332 0.000000000 0.008928571 0.038834951 0.030303030 0.142857143 [133] 0.170000000 0.000000000 0.112903226 0.000000000 0.007299270   A majority of the proportions has zero value. I am struggling with whether I should go for logit or arcsine transformation. One source says that arcsine transformation should not be used . On the other hand, I several zero counts. With logit transformation values 0 and 1 are mapped to infinity, and according to another source I should go with arcsine transformation . Furthermore, I found another study close to my topic in which they used arcsine transformation. The default in R with metaprop function is logit.   Which one I should go with my data? I installed Ubuntu 12.10 and entered a password in SeaHorse. I would like to remove the password of "Default" but I get this error :  GDBus.Error:org.freedesktop.Secret.Error.NoSuchObject: The collection does not exist   Is there a fix or a way to bypass modify the password ? What happen if I install VirtualBox Guest Additions on a host? I have a bootable USB drive with Ubuntu installed.   This morning I Installed VirtualBox and booted my Ubuntu drive in a VM. I then installed the guest additions in Ubuntu.   My question/curiosity is, what would happen if I boot the drive again outside of the VirtualBox VM, using a physical computer?  Will my Ubuntu work normally or is something going to change? So, for fun, I am taking some of the data of calls from the call center I work at and trying to do some hypothesis testing on them, specifically the number of calls received in a week, and using a Poisson distribution to fit it. Due to the subject matter of my job, there are two types of weeks, let's call one of them on-weeks where I hypothesize there are more calls, and off-weeks where I hypothesize there are fewer.  I have a theory that the $\lambda$ from on-weeks (let's call it $\lambda_1$) is larger than that of the one from off-weeks (let's call it $\lambda_2$)  So the hypothesis I want to test is $H_0: \lambda_1 &gt; \lambda_2, H_1: \lambda_1 \leq \lambda_2 $  I know how to test for one parameter (say  $H_0: \lambda_1 &gt; 1, H_1: \lambda_1 \leq 1 $) but not so sure how to go about doing 2 given a data set. Let's say I take two week's worth of data from each one $X_1 = 2$ and $X_2 = 3$ for the off-week and $Y_1 = 2$ and $Y_2=6$ for the on-week. Can someone help walk me though this simpler version such that I can apply it to a larger data set? Any help is appreciated, thank you. Turning separate lines into a comma separated list with quoted entries I have the following data (a list of R packages parsed from a Rmarkdown file), that I want to turn into a list I can pass to R to install:  d3heatmap data.table ggplot2 htmltools htmlwidgets metricsgraphics networkD3 plotly reshape2 scales stringr   I want to turn the list into a list of the form:  'd3heatmap', 'data.table', 'ggplot2', 'htmltools', 'htmlwidgets', 'metricsgraphics', 'networkD3', 'plotly', 'reshape2', 'scales', 'stringr'   I currently have a bash pipeline that goes from the raw file to the list above:  grep 'library(' Presentation.Rmd \ | grep -v '#' \ | cut -f2 -d\( \ | tr -d ')'  \ | sort | uniq   I want to add a step on to turn the new lines into the comma separated list. I've tried adding tr '\n' '","', which fails. I've also tried a number of the following Stack Overflow answers, which also fail:      This produces library(stringr)))phics) as the result.      This produces ,% as the result.      This answer (with the -i flag removed), produces output identical to the input. Will Ubuntu get patched against Meltdown and Spectre? The following is a canonical post that attempts to cover a broad number of Meltdown and Spectre questions.  It is being maintained by Thomas Ward who is in contact with the Security and Kernel teams on this matter for other reasons as well.   I recently read about the  vulnerabilities.  I was wondering, will Ubuntu be patching against the vulnerabilities?  And is there an ETA on a fix? I have found that many USB wall chargers use a resistive voltage divider to set the D+ and D- pins to a specific voltage, usually between 2 and 3 volts.  Other USB wall chargers short the D+ and D- pins together with no connection to anything else.  From my experience some devices will not accept a charge rate above 500mA on the chargers using the voltage dividers, but will charge up to their max input on a charger with the data pins shorted. I have read things that suggest the opposite may be true as well, but have been unable to verify this. I am hoping to figure out which method provides the best compatibility with all USB devices.