Hello people here is my code below...              #ajax code after success             $.each(obj,function(index,Object) {                 ban_list += '&lt;div class="ban_n" id='+Object.To+'&gt;remove ban&lt;/div&gt;';              })          $('.b_list').html(ban_list).toString();   above code works fine by creating a div with the class=ban_n and id=get1_name get1_name is nothing but Object.To now i have to set onclick for ban_n  $('.ban_n').on('click',function(){ console.log($(this).attr('id')); })   why is the above code does not work.. anyway to fix this??
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.
I want to initialize a struct element, split in declaration and initialization. This is what I have:  typedef struct MY_TYPE {   bool flag;   short int value;   double stuff; } MY_TYPE;  void function(void) {   MY_TYPE a;   ...   a = { true, 15, 0.123 } }   Is this the way to declare and initialize a local variable of MY_TYPE in accordance with C programming language standards (C89, C90, C99, C11, etc.)? Or is there anything better or at least working?  Update I ended up having a static initialization element where I set every subelement according to my needs. How to get a normal application menu in the top- or titlebar in Gnome Differences between "however", "although","albeit", etc Getting the name of the currently executing method How long can cooked food be safely stored at room/warm temperature? If I leave fully-cooked food (particularly meat) out at warm temperature - say on the counter or in a crock pot that's been turned off -  how long will it stay safe to eat?  Does it make any difference if I re-cook the food afterward? I am typing a command, I remember I have to check something, if I press Ctrl+U the command disappears and I can type something else, but then the command I was typing is not in the history.  Is there a way to recover that command, or a different shortcut that I can press to save somewhere the command? How do you debug through a compressed JavaScript file? Unable to install any updates through update manager/apt-get upgrade What do *args and **kwargs mean? What exactly do *args and **kwargs mean?  According to the Python documentation, from what it seems, it passes in a tuple of arguments.  def foo(hello, *args):     print hello      for each in args:         print each  if __name__ == '__main__':     foo("LOVE", ["lol", "lololol"])   This prints out:  LOVE ['lol', 'lololol']   How do you effectively use them? I am looking for a device that can track my location (lat,long) and speed all day long. Perhaps, I need GPS and accelerometer data bundled together.  What I want to do is to log my daily activities. I spend time walking, running, driving, taking a bus, staying in a building, etc., just like any normal human-being :) I am willing to carry the device with me at all times and would like to see every place I go into and my speed at certain positions.  My requirements are that the location and speed data should be recorded at least every ~20 seconds. I would also like the device to timestamp (date+time) each record. It would be enough if timestamp is precise to nearest minute and the location can go off about a maximum of 10-15m. (30-50ft.)  What I want is a portable device so I can carry all day long for about 2-3 months. I will only use it during casual, daily activities.  I don't want real-time tracking. I can collect the data from a storage later on. Thought Experiment - Poking a stick across a Black Hole's Event Horizon Given a message and DES encrypted form of said message, is it possible to efficiently compute the key used to encrypt the data? I grew up learning that the comma must be placed there, but it seems like an unnecessary interruption in a phrase that isn't ever spoken that way. How can a question be tagged with a tag synonym? The question  seems to be tagged with , which, last I checked, is a synonym of . How is it possible that a question can be tagged with a synonym? Don't synonyms automatically get replaced on questions? How to get Url Hash (#) from server side How to fix infinite bash loop (bashrc + bash_profile) when ssh-ing into an ec2 server? I mistakenly have source .bash_profile in the bashrc file and vice versa. Now when I tried to ssh into the machine (ec2), it will stuck at loading bash and get connection closed in a second. Is there a way I could fix it? Could I mount the disk to another ec2 instance to fix the bash files?  Update 1: I tried the following: %  ssh -i &quot;my-pem.pem&quot; -t ubuntu@&lt;server_address&gt;.amazonaws.com &quot;/bin/bash --noprofile --norc&quot; Connection to &lt;server_address&gt;.amazonaws.com closed.  Nothing else showed up. Do you have any idea on what was going wrong? For sanity check, if I do ssh -i &quot;my-pem.pem&quot;ubuntu@&lt;server_address&gt;.amazonaws.com, the message will be ...  28 packages can be updated. 0 of these updates are security updates. To see these additional updates run: apt list --upgradable  New release '20.04.2 LTS' available. Run 'do-release-upgrade' to upgrade to it.   Last login: Mon Feb 22 23:17:41 2021 from ip Connection to &lt;server_address&gt;.amazonaws.com closed.  Solution Just ssh onto the machine and immediately do Ctrlc and fix the bash files. "At least one" - singular or plural subject? Simulating data to fit a mediation model I am interested in finding a procedure to simulate data that are consistent with a specified mediation model.  According to the general linear structural equation model framework for testing mediation models first outlined by  and described elsewhere such as , mediation models for outcome $Y$, mediator $\newcommand{\med}{\rm med} \med$, and predictor $X$ and are governed by the following three regression equations: \begin{align} Y    &amp;= b_{11} + b_{12}X + e_1                \tag{1}  \\ \med &amp;= b_{21} + b_{22}X + e_2                \tag{2}  \\ Y    &amp;= b_{31} + b_{32}X + b_{32} \med + e_3  \tag{3} \end{align} The indirect effect or mediation effect of $X$ on $Y$ through $\med$ can either be defined as $b_{22}b_{32}$ or, equivalently, as $b_{12}-b_{32}$.  Under the old framework of testing for mediation, mediation was established by testing $b_{12}$ in equation 1, $b_{22}$ in equation 2, and $b_{32}$ in equation 3.  So far, I have attempted to simulate values of $\med$ and $Y$ that are consistent with values of the various regression coefficients using rnorm in R, such as the code below:  x   &lt;- rep(c(-.5, .5), 50) med &lt;- 4 + .7 * x + rnorm(100, sd = 1)   # Check the relationship between x and med mod &lt;- lm(med ~ x) summary(mod)  y &lt;- 2.5 + 0 * x + .4 * med + rnorm(100, sd = 1)  # Check the relationships between x, med, and y mod &lt;- lm(y ~ x + med) summary(mod)  # Check the relationship between x and y -- not present mod &lt;- lm(y ~ x) summary(mod)   However, it seems that sequentially generating $\med$ and $Y$ using equations 2 and 3 is not enough, since I am left with no relationship between $X$ and $Y$ in regression equation 1 (which models a simple bivariate relationship between $X$ and $Y$) using this approach.  This is important because one definition of the indirect (i.e., mediation) effect is $b_{12}-b_{32}$, as I describe above.  Can anyone help me find a procedure in R to generate variables $X$, $\med$, and $Y$ that satisfy constraints that I set using equations 1, 2, and 3? Can I update an early Airport Time Capsule? apt-get autoremove wants to remove linux headers Today I ran apt-get autoremove to remove un-needed packages and it wants to remove linux-headers-3.2.0-37 and linux-headers-3.2.0-37-generic  Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be REMOVED: libglademm-2.4-1c2a linux-headers-3.2.0-37 linux-headers-3.2.0-37-generic ttf-umefont    ttf-unfonts-core 0 upgraded, 0 newly installed, 5 to remove and 0 not upgraded. After this operation, 67.6 MB disk space will be freed. Do you want to continue [Y/n]?    Is it safe to remove these? My installed kernel is a newer version than the headers that autoremove lists.  uname -r 3.2.0-38-generic