at the moment I try to apply some jquery to html elements I created before with js. But it doesn't work.  This code works, so the reason can't be that I forgot something to import:    $(document).ready(function(){     $(".test").click(function(){         $(this).css("border", "5px solid #000");     }); }); .test{   width:100px;   height:100px;   background-color:red; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="test"&gt;  &lt;/div&gt;     But if I try the same on html I creat with js nothing happens:    document.getElementById('files').addEventListener('change', handleFileSelect, false);    function handleFileSelect(evt) {     var files = evt.target.files;      // Loop through the FileList and render image files as thumbnails.     for (var i = 0, f; f = files[i]; i++) {        // Only process image files.       if (!f.type.match('image.*')) {         continue;       }        var reader = new FileReader();        // Closure to capture the file information.       reader.onload = (function(theFile) {         return function(e) {           // Render thumbnail.           var span = document.createElement('span');           span.innerHTML =            [             '&lt;img src="',              e.target.result,             '" title="', escape(theFile.name),              '"/&gt;'           ].join('');                      document.getElementById('list').insertBefore(span, null);         };       })(f);        // Read in the image file as a data URL.       reader.readAsDataURL(f);     }   }  $(document).ready(function(){     $("img").on("click", function(){     $(this).css("border", "5px solid #000"); });}); //$(document).ready(function(){ //    $("img").click(function(){ //        $(this).css("border", "5px solid #000"); //    }); }); img{   height: 75px;   border: 1px solid #000;   margin: 5px; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;form id='test-form'&gt;   &lt;input type="file" id="files" name='input1' multiple/&gt;&lt;br&gt;   &lt;output id="list"&gt;&lt;/output&gt;&lt;br&gt; &lt;/form&gt;     I thought maybe the function .on() can help me but it doesn't work either.  But "Event handlers attached using the on() method will work for both current and FUTURE elements (like a new element created by a script)" is from , even if this is not the best reference.  So what do I wrong, and where is my mistake? I tried to apply classes and and did some other stuff to get it working, but nothing solved my problem.  Probalby its because the created new element in my opinion. Any hints and improvements are very welcome, thank you.
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.
Biblatex: nested citations with the \textcites command I'd like to type a citation within the text and another citation inside the parenthesis for the year, something like this:     The work of Author 1 (year; cited by Author 2, year)   For this, I've tried different options of the \textcite command but without results. Also I saw the solution posted , which works for multiple citations within parenthesis but not for in-text citations.  Any suggestion? How to access namespace which is part of different project? I am looking for a book about "advanced" classical mechanics. By advanced I mean a book considering directly Lagrangian and Hamiltonian formulation, and also providing a firm basis in the geometrical consideration related to these to formalism (like tangent bundle, cotangent bundle, 1-form, 2-form, etc.).  I have , but I would like to go into more details about the [symplectic] geometrical and mathematical foundations of classical mechanics.  Additional note: A chapter about relativistic Hamiltonian dynamics would be a good thing. Work done in adiabatic process How to fix slow wireless on machines with Intel wireless cards? I have looked through all the previous questions but turning power management off for the Wi-Fi card didn't work. This problem seems to be with the Lenovo Thinkpads. I switched to Ubuntu 11.10 from Windows 7 3 days ago so I'm new to the operating system. How to add days to current Date using JavaScript. Does JavaScript have a built in function like .Net's AddDay? Toy Line (Production) Run I am not sure about the meaning of this:          Transformers: Generation 1 (also known as Generation One or G1) was a children's toy line that ran from 1984 to 1991 and was produced by Hasbro.     Would the following rewrite be better?        Transformers: Generation 1 (also known as Generation One or G1) was a children's toy line the production of which ran from 1984 to 1991 and was produced by Hasbro. How does Newtonian mechanics explain why orbiting objects do not fall to the object they are orbiting? The force of gravity is constantly being applied to an orbiting object.  And therefore the object is constantly accelerating.  Why doesn't gravity eventually "win" over the object's momentum, like a force such as friction eventually slows down a car that runs out of gas?  I understand (I think) how relativity explains it, but how does Newtonian mechanics explain it? Windows wildcards with files having more than 3 characters extensions On Windows 7, I have a directory containing the following four files:   xxx.txt xxx.txt2 xxx2.txt xxx2.txt2   With the file have more than 3 character as a file extension, the behavior of the wildcard * seems odd:  dir *.txt  10/13/2014  04:14 PM                 6 xxx.txt 10/13/2014  04:17 PM                 6 xxx2.txt 10/13/2014  04:17 PM                 6 xxx2.txt2 10/13/2014  04:14 PM                 6 xxx.txt2            4 File(s)             24 bytes            0 Dir(s)   6,660,980,736 bytes free   I would expect to see only the two files with txt extension and not the ones with txt2 (like it would on a Linux machine). Does MS-DOS ignore the truncate the file extension to 3 characters or does it add automatically another wildcard at the end? If I want to delete only the files with txt extension and not the one with txt2, which command should I use? Thanks Removing the first line of CSV file So I'm at that step where I am finally ready to Render my first big project. Aaaaaand it's been stuck on the first 4 tiles for the last 2 hours?   I am using a MacBook Pro Processor: 2.5 GHz Intel Core i5 Memory: 4 GB 1600 MHz DDR3 Graphics: intel HD Graphics 4000 1024 MB  (I include these because I have no idea what affects a computers ability to render but I assume it's one of them, most liekly the graphics card).  So anyways here are the pictures, as you can see I played with changing the resolution, the sample size and the max steps to see if I got different results but it just keeps getting stuck at those 1st four tiles. I've rendered a few other small projects successfully but this was my first time changing some values. I assume i've managed to accidentally change the wrong values and thats causing some conflict thats either stopping the render itself or is making it just too much for my computer.  My goal was the render this particular picture at a good enough resolution and clarity that it could then be made into a poster. So i wanted the resolution to be good and the sampling to be high.       Since writing this there has been no change to any of the numbers at the top of the render result (the time left, etc) I would like to know where to find the source code of Ubuntu. I'd like to see how far it is "open source". Windows Activation FAQ: How do language, version, 64-bit or 32-bit, and source affect ability to install and transfer Windows licenses? We get a lot of questions on Super User about Windows activation and licensing. This question is an attempt to answer the most common questions in one place with a .   When reinstalling Windows, the following questions often come up:   Can I transfer the copy of Windows from my old computer to a new one? Does the license key on the sticker on my computer work on any computer? If I have a 32-bit version, can I install a 64-bit version? I have an OEM version of Windows, but only a retail disk. Can I still use it? I want to install Windows with a different language. Do I need a new license in that language? I changed some hardware. Will I be able to reactivate my computer? Can I back up my activation before doing a reinstall? How many computers can I install my license on? Do I have to deactivate my old installation before transferring a license? If so, how? How does licensing work in Windows ? What are the restrictions on transferring, reinstalling, and changing versions of Windows? $\lim_{x\to 0} \frac{\sin x - x}{x^2}$ without L'Hospital or Taylor Explanation of unpredictable behaviour of tee I encountered a behaviour that I don't understand while testing a script that sums the outputs from repeated executions of a program. To reproduce it create the text files out, which represents the output of my program, and sum, the file that holds the sum of the values returned on previous executions and which starts out as a copy of out,  cat &gt; out &lt;&lt; EOF 2 20 5 50 EOF cp out sum   The strange thing happens on running  paste out sum | awk '{$1 += $3; $2 += $4; NF = 2; print}' | tee sum   several times (15-20 times might be needed). Each time it runs, this command should add to the values in sum the corresponding values in out and write the results back to sum. What I get is that it works an unpredictable number of times, then sum reverts back to  2 20 5 50   I have later learned that  and solved the issue using a temporary file, still, this behaviour baffles me:   why does … | tee sum work at all (even if only for a limited number of iterations), while … &gt; sum never overwrites sum? why doesn't it work a predictable number of times? (Sorry to re-post this, I have lost access to my original account.)  I've recently installed Kubuntu 18.04.3 on a new AMD Ryzen 3000-series-based system. The system is installed on a SATA SSD, specifically on an Ext4 partition, with a SATA HDD formatted in NTFS mounted for storage. The system has been in use for a few days, with a maximum uptime of two days (so far).  My issue is this: the HDD indicator light on the case flashes every 1-3 seconds, even when the system is idle, and there is no obvious reason to access the disk. The flashes are not regular: sometimes the light is dark for as long as 3 seconds (obviously it is difficult to time such short intervals -- I am approximating), sometimes there are a few quick pulses less than a second apart. The flashes seem to vary in duration as well -- sometimes very brief, sometimes nearly a second. Unmounting the secondary HDD does not appear to have any effect.  Some searching lead me to try iotop. I ran sudo iotop -Pao, and waited until 10 flashes of the HDD light had occurred. This is the result:   6887 be/4 root          0.00 B      0.00 B  0.00 %  0.02 % [kworker/u64:1-events_power_efficient]   433 be/3 root          0.00 B      0.00 B  0.00 %  0.02 % [jbd2/sda2-8]  6302 be/4 root          0.00 B      0.00 B  0.00 %  0.01 % [kworker/u64:0-events_unbound]   The "kworker" processes seem to switch between various states, such as "events_power_efficient", "events_unbound", and "events_freezable_power_". The jdb2 process does sometimes write to disk, though that was not observed here (even though, as I said, 10 flashes of the HDD light occurred). The computer was otherwise idle during this test.  My searches also lead me to check /var/log. The result of ls -lth | head is as follows:  -rw-r-----  1 syslog adm             951K Aug 27 19:49 kern.log -rw-r-----  1 syslog adm             594K Aug 27 19:49 syslog -rw-r-----  1 syslog adm             528K Aug 27 19:49 ufw.log -rw-r-----  1 syslog adm              53K Aug 27 19:48 auth.log -rw-r--r--  1 root   root             40K Aug 27 19:15 Xorg.0.log -rw-rw-r--  1 root   utmp             79K Aug 27 18:29 wtmp -rw-r--r--  1 root   root              55 Aug 27 16:28 prime-offload.log -rw-r--r--  1 root   root              30 Aug 27 16:28 prime-supported.log -rw-r--r--  1 root   root            1.2K Aug 27 16:28 gpu-manager.log   I have no experience interpreting log files, so I don't know if anything here is out of the ordinary.  If the kernel version is relevant, the output of uname -r is 5.0.0-25-generic.  My questions are, 1. Why is my HDD light flashing, even though there is no obvious disk activity, 2. Does this indicate some kind of problem with my system that needs to be fixed, and 3. If so, how do I fix it? The light itself does not bother me -- if this is just a sign of a normal, healthy Ubuntu install, then no problem. My concern is that something is wrong, and if so, I would like to fix it.  Thanks in advance for your time.  In response to heynnema (in the original posting of this question), the issue occurs even at the log-in screen, before I log in. So, it is not tied to my user account. However, it does not occur in the BIOS, suggesting that it is specific to Kubuntu (or at least, to the SSD Kubuntu is installed on). What does [param: NotNull] mean in C#? Most commented post should be the first post in the blog WordPress default setting is, most recent post is the first post of the blog.  But, I need to "Most commented post should be the first post in the blog". ( Categories page as well as home page) Can I nohup/screen an already-started process? I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in screen.  Is there any way to "retroactively" nohup a process, or do I need to leave my computer online all night? If it's not possible to attach screen to/nohup a process I've already started, then why? Something to do with how parent/child proceses interact? (I won't accept a "no" answer that doesn't at least address the question of 'why' -- sorry ;) ) Repeat the same reference in footnote on different pages