Hi I am creating some dynamic  elements here   function loadApiData(){ var url, jqxhr, url2, jqxhr2, status; for (i = 0; i &lt; 11; i++) {     url2 = document.URL + 'status/' + i;     jqxhr2 = $.getJSON(url2, function(data) {         console.log('API response received');         //console.log(url2);         console.log(data);         status = data['status'];         //console.log(status);         if (status == false) {             //$('#false').append('&lt;p class="p2" id="' + data['phone'] + 'on"&gt;' + data['phone'] + ' phone Status: ' + status + '&lt;p&gt;');             $('#false').append('&lt;p class="p2" id="' + data['phone'] + 'on"&gt;' + data['phone'] + ' phone Status: &lt;input type="button" id="' + data['phone'] + 'off" value="' + status + '" /&gt;&lt;p&gt;');         } else {             $('#true').append('&lt;p id="' + data['phone'] + 'off"&gt;' + data['phone'] + ' phone Status: ' + status + '&lt;p&gt;');         }     }); }  };   However when I then try loading them later   function loadWindowSystem() {  $('#Nimoff').click(function() {     alert('hi'); }); };   I find that it doesn't actually register the click event.   My document.ready() looks like this.   $(document).ready(function(){ loadApiData(); loadWindowSystem(); });   Any help would be greatly appreciated.  Thanks  Resolved by using   $( document ).on( 'click', '#Nimoff', function () { // you code });
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.
Windows Phone ReverseGeocoding to get Address from Lat and Long Error: Can't open display: 0 I installed WSL2 and I want to access WSL2 GUI apps from Windows 10. For this, I installed Xming and start it in "No client" mode. Xming startes, ok. After I open the WSL2 terminal and there execute these commands  export DISPLAY=:0   And after  xeyes   And get error   Error: Can't open display: :0   X11Forwarding checked, yes. Does metric signature affect the stress energy tensor? If one were to derive the stress-energy tensor for a metric with $(+,-,-,-)$ signature would it be different from the stress-energy tensor derived from the same metric but with $(-,+,+,+)$ signature? Essentially, I have a csv file that contain multiple columns, called cols.csv  1,a,100 2,b,200 3,c,300 4,e,400   and I have a new csv file that has one column, called col.csv  f g h i   I want to copy the items in col.csv and append them to the end of each line in cols.csv so that, cols.csv now contains those  1,a,100,f 2,b,200,g 3,c,300,h 4,e,400,i   is that possible at all? i tried join, paste, nothing worked Understanding dummy (manual or automated) variable creation in GLM Is it possible to copy an object in Illustrator so that if you make a change in any of them the changes will apply in both? Actually I have this situation where I have a lot of instances of the same object and I need to be faster on changes and copy-ing again and again is not a proper solution, but consumes a lot fo time.  Thank you for your time! Is it possible to reintegrate a Horcrux? As anyone who is familiar with Harry Potter knows, a horcrux is made when someone commits murder and stores a piece of their soul in something. Would it be possible for this someone to later recover and reintegrate their soul piece(s), should they want to? Ubuntu 20.04 on DualBoot fail 90% of tries - Initramfs unpacking failed: Decoding failed I just installed Ubuntun 20.04 on a Dell Latitude 7400 on DualBoot. I had to remove the RST as mentioned on this post :  It works but now I need to test 5 or more times to boot. After the grub screen, most of the time i have a black screen. Sometimes I have this error : Initramfs unpacking failed: Decoding failed And then it starts.  here is a file called initramfs.conf cat /etc/initramfs-tools/initramfs.conf MODULES=most  BUSYBOX=auto  COMPCACHE_SIZE=&quot;&quot;  COMPRESS=lz4   DEVICE=  NFSROOT=auto RUNSIZE=10% induction proof: $\sum_{k=1}^nk^2 = \frac{n(n+1)(2n+1)}{6}$ I encountered the following induction proof on a practice exam for calculus:  $$\sum_{k=1}^nk^2 = \frac{n(n+1)(2n+1)}{6}$$  I have to prove this statement with induction.  Can anyone please help me with this proof? How to show that Klein four-group is a normal subgroup of the alternating group $A_4$ I want to show that the Klein four-group is a normal subgroup of the alternating group $A_4$.   I am using the information in , that shows explicitly $A_4$, and Klein four-group as a subgroup.  I know that there is the direct way, by definition, but is there a way that does not require actually multiplying so many permutations ? What is the meaning of speed of light $c$ in $E=mc^2$? is the famous mass-energy equation of Albert Einstein. I know that it tells that mass can be converted to energy and vice versa. I know that $E$ is energy, $m$ is mass of a matter and $c$ is speed of light in vacuum.   What I didn't understood is how we will introduce speed of light?  Atom bomb is made using this principle which converts mass into energy; in that the mass is provided by uranium but where did speed of light comes into play? How can speed of light can be introduced in atom bomb? Is osmosis a kind of thermal machine? The hyperphysics article defines osmosis as a process driven by internal energy and internal energy is defined as energy associated with random,disordered motion of molecules. Osmosis develops pressure and lifts weight so it has the output of a machine.  But what drives osmosis? Is osmosis driven at the expense of thermal energy although there is no temperature gradient? Posts linked in deleted answers still show up under "Linked" E.g. see . After hours of banging my brain against my skull, I narrowed down an issue I'm having to the fact that \makeatletter doesn't work inside \newcommand. Commands that I call after \makeatletter are registered as undefined, as if \makeatletter didn't do anything.  Why is this the case?  In the example below, I define two commands. Calling one of them from the document body causes the undefined error, while the other doesn't.  \documentclass[11pt]{book} \usepackage{kvsetkeys}  \newcommand{\commandThatFails}{     \makeatletter \comma@parse{}{} \makeatother }  \makeatletter     \newcommand{\commandThatWorks}{         \comma@parse{}{}     } \makeatother  \begin{document}  Hi there.  \commandThatFails \commandThatWorks  \end{document} By accident, I used rm on a file I didn't want to delete. Is there a way that I can get it back under Linux? If I have a sentence that starts with additionally, finally, consequently, etc. do I always have to put a comma after it? Or is there a different rule? I'm using MySQL's AUTO_INCREMENT field and InnoDB to support transactions. I noticed when I rollback the transaction, the AUTO_INCREMENT field is not rollbacked? I found out that it was designed this way but are there any workarounds to this? Trying to plot the sin(x) function, I get this result:    The MWE is here:  \documentclass{standalone} \usepackage{ pgfplots} \begin{document} \begin{tikzpicture} \begin{axis} \addplot[samples=500]{sin(x)}; \end{axis} \end{tikzpicture} \end{document}   cos(x) looks like an inverted parabola and tan looks just like sin.  I'm using pdflatex and MiKTeX. Any ideas? Typesetting a full citation whose title ends with a word in braces I am using Biblatex and need to typeset full citations in my document text, so I'm using .  While it works correctly most of the time, it has trouble with Biber/BibTeX entries where the last word of a field is enclosed in braces (to force capitalization).  In these cases, \longfullcite may fail to properly capitalize the following word.  Take the following example:  \documentclass{article}  \usepackage{biblatex} \makeatletter \newcommand{\tempmaxup}[1]{\def\blx@maxcitenames{\blx@maxbibnames}#1} \makeatother \DeclareCiteCommand{\longfullcite}[\tempmaxup]   {\usebibmacro{prenote}}   {\usedriver      {\DeclareNameAlias{sortname}{default}}      {\thefield{entrytype}}}   {\multicitedelim}   {\usebibmacro{postnote}}  \usepackage{filecontents}  \begin{filecontents}{test.bib} @inproceedings{blow2015,   author       = {Blow, Joe},   title        = {{GNU} loves me},   year         = 2015,   booktitle    = {Proceedings of Some Conference}, }  @inproceedings{blow2016,   author       = {Blow, Joe},   title        = {I love {GNU}},   year         = 2016,   booktitle    = {Proceedings of Some Conference}, } \end{filecontents}  \addbibresource{test.bib}  \begin{document} \nocite{*} \noindent \longfullcite{blow2015}\\ \longfullcite{blow2016} \printbibliography \end{document}   Here is the output:    Note the inconsistent capitalization of the word "In" produced by the two \longfullcite commands.  By contrast, the citations emitted by \printbibliography correctly capitalize "In" for both entries.  What is causing this inconsistency and how can I fix or work around it (preferably by changing the definition of \longfullcite rather than changing the .bib file)? How do I read / convert an InputStream into a String in Java? If you have a java.io.InputStream object, how should you process that object and produce a String?    Suppose I have an InputStream that contains text data, and I want to convert it to a String, so for example I can write that to a log file.  What is the easiest way to take the InputStream and convert it to a String?  public String convertStreamToString(InputStream is) {     // ??? }