I have a menu which works perfect for 1st and 2nd level only, but I need to go deeper and show all sub levels. Maybe it's better to use JQuery function, but I don't know how!  The menu is something like this when it loads:  UPDATE The code that generates sub levels:  foreach ($categories as $category) {     $data['x'] .= '&lt;li&gt;&lt;a class=' . $category['category_id'] . ' id=' . $category['category_id'] . ' data-id=' . $category['category_id'] . '&gt;' . $category['name'] . '&lt;/a&gt;&lt;/li&gt;'; }   The code which generates ROOT categories:  &lt;ul id="mnav" style="padding-top: 80px; background-color: #337ab7;"&gt;     &lt;?php foreach ($categories as $category) { ?&gt;     &lt;li&gt;&lt;a id="&lt;?php echo $category['category_id']; ?&gt;" class="list-group-item active"&gt;&lt;?php echo $category['name']; ?&gt;&lt;/a&gt;&lt;/li&gt;     &lt;?php } ?&gt; &lt;/ul&gt;   Compiled PHP - HTML:  &lt;ul id="mnav" style="padding-top: 80px; background-color: #337ab7;"&gt;     &lt;li&gt;&lt;a id="24" class="list-group-item active"&gt;Machinery&lt;/a&gt;         &lt;ul class="sub" id="sub1"&gt;             &lt;li&gt;&lt;a class="2420" id="2420" data-id="2420"&gt;Agriculture Machinery Equipment&lt;/a&gt;&lt;/li&gt;             &lt;li&gt;&lt;a class="2407" id="2407" data-id="2407"&gt;Apparel Textile Machinery&lt;/a&gt;&lt;/li&gt;             &lt;li&gt;&lt;a class="2409" id="2409" data-id="2409"&gt;Building Material Machinery&lt;/a&gt;&lt;/li&gt;             &lt;div class="list-group"&gt; &lt;/div&gt;         &lt;/ul&gt;     &lt;/li&gt;     &lt;li&gt;&lt;a id="29" class="list-group-item active"&gt;Packaging &amp;amp; Printing&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a id="26" class="list-group-item active"&gt;Mechanical Parts &amp;amp; Fabrication Services&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;   To achieve this, I'm using such a script:  &lt;script type="text/javascript"&gt;      $(document).ready(function(){          $('ul#mnav &gt; li &gt; a').on('click', function(e) {              console.log("Level 1");              e.preventDefault();              var cat = $(this).attr('id');              var url = 'index.php?route=test/categoryx/child&amp;category_id=' + cat;               $('#mnav #sub1').remove();              $( $("&lt;ul class='sub' id='sub1'&gt;").load(url + "#myContainer") ).insertAfter( '#mnav #' + cat );         });           $('ul#sub1 a').on('click', function(e) {              console.log("Level 2");              e.preventDefault();              var cat = $(this).attr('id');              var url = 'index.php?route=test/categoryx/child&amp;category_id=' + cat;               $('#sub2').remove();              $( $("&lt;ul class='sub' id='sub2'&gt;").load(url + "#myContainer") ).insertAfter( 'ul#sub1 #' + cat );         });  &lt;/script&gt;    I tried different ways to get access to 2nd level but it's not successful, I tried many different things.
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.
Yesterday I upgraded my Ubuntu 18.10 to Ubuntu 19.04, and after the restart, the trash icon and my Desktop files have disappeared from the UI. If I go to the Desktop folder from my personal folder, I can see the files, but my Desktop is empty.  How can I show my files in the Desktop again? How can I check if my computer's powerful enough to run a certain game? Is there a service that I can use to check if my machine will be able to run a certain game? What are the rations Rey eats? In The Force Awakens, we see Rey pouring some flour-like polystarch rations into water so that the flour amazingly transforms into something that looks like bread. What are these rations? Is there any documentation of the fictional chemistry and biology that makes the starch rations behave as they do? Why are new sites classified as "uncategorized"? How do I set the default program? How do I set the default program that I use?  I have tried to open System Info → Default Program → change my program, but it won't work,  Any idea? Or should I use Terminal?   I want to replace the default movie player with VLC media player, because the current movie player is useless to me. How to prove $\int_{-\infty}^{+\infty} f(x)dx = \int_{-\infty}^{+\infty} f\left(x - \frac{1}{x}\right)dx?$ If $f(x)$ is a continuous function on $(-\infty, +\infty)$ and $\int_{-\infty}^{+\infty} f(x) \, dx$ exists. How can I prove that $$\int_{-\infty}^{+\infty} f(x) \, dx = \int_{-\infty}^{+\infty} f\left( x - \frac{1}{x} \right) \, dx\text{ ?}$$ What is a complete book for introductory quantum field theory? There's a fairly standard two or three-semester curriculum for introductory quantum field theory, which covers topics such as:   classical field theory background canonical quantization, path integrals the Dirac field quantum electrodynamics computing $S$-matrix elements in perturbation theory, decay rates, cross sections renormalization at one loop Yang-Mills theory spontaneous symmetry breaking the Standard Model   What is a good, complete and comprehensive book that covers topics such as these? Foreign key constraint on array member? Computer wont boot to windows I recently installed a Linux operating  system (backtrack 5 r3) I couldn't connect to the internet with it so I removed the partition manually. After that, whenever I turn on my computer it goes to a command line that says "error no File-system found" "Grub Rescue/"  I have tried f12 and booted into all the options. I also put Ubuntu 12.04 on my flash drive and tried installing it on the computer, the installation failed saying "No Available Space"  My hard-drive is 500g with about 250 left. I put the hard drive in another computer (as a secondary just to see the files. It had 2 partitions a main and one with 1 gig. I formatted it with no difference.  My Problem: I can't boot into Windows Dynamic LINQ OrderBy on IEnumerable / IQueryable I found an example in the  for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable&lt;T&gt;. Is there any way to get this functionality on IEnumerable&lt;T&gt;? I have a WordPress website that I recently discovered had this error on the login page:     ERROR: Cookies are blocked due to unexpected output. For help, please   see this documentation or try the support forums.   I can only access the login page from wp-login.php, since /wp-admin/ displays a blank white page.  I've searched the web and tried many things with no success:   Removing ?&gt; and space at end of the functions.php Ensuring both functions.php and wp-config.php had no spaces at beginning or end of file Opening wp-config.php and functions.php in Notepad++ and converting to UTF-8 (people recommend 'without BOM' but that is only an option in the newest version of Notepad++ - I'm guessing UTF-8 does that now) I've set WP_DEBUG to true and have received no errors in debug.log,  except for 2 that relate to when I hadn't fully uploaded some files. That particular error mentioned nav-menu.php; this confirmed that it is reporting errors, just not related to my login issues I renamed each plugin folder with _tmp at the end to try and rule out any plugins causing the problem I also renamed the plugins folder to rule out all plugins at the same time   Given these things I've tried, and that I'm not receiving any PHP errors, what else could I try? How can I lock a folder so that it CANNOT be erased? On my computer running Windows XP Pro SP3 I have a folder on my desktop that is very important. How can I lock it so that I can alter anything in it, but the folder itself cannot be removed without resetting a (lock/unlock?) switch? How to use SSH to run a local shell script on a remote machine? How to detect if a variable is an array Decrypt all RSA ciphertexts if you can break 1% of them I was given a cryptography question during an interview the other day.   Imagine you are given an efficient algorithm which for a given RSA public key (n,e) is able to decrypt 1% of the messages encrypted with that key.   1% means that the algorithm will deterministically decrypt 1% of all possible ciphertexts on the first call, and will never decrypt the other 99% of all possible ciphertexts with any number of invocations.   Figure out an algorithm that uses this one and can decrypt any message. Any ideas? Denote by $\mathbb{N}$ the set of natural numbers and by $2^{\mathbb N}$ the set of all subsets of $\mathbb N$. Let $E$ be some subset of $2^{\mathbb N}$ such that for  every pair of elements in $E$, one is a subset of the other. Clearly, $E$ could be countable by considering $E=\big\{\{1,\cdots, n\}, n\in\mathbb N\big\}$. My question is the following: could we find an example that $E$ is uncountable? Many thanks for the answer! Floating sidebar can get too long and obscure footer How to know that your machine learning problem is hopeless? Plot $|z - i| + |z + i| = 16$ on the complex plane Plot $|z - i| + |z + i| = 16$ on the complex plane   Conceptually I can see what is going on. I am going to be drawing the set of points who's combine distance between $i$ and $-i = 16$, which will form an ellipse. I was having trouble getting the equation of the ellipse algebraically.  I get to the point:  $x^2 + (y - 1) ^2 + 2\sqrt{x^2 + (y - 1)^2}\sqrt{x^2 + (y + 1)^2} + x^2 + (y+ 1)^2 = 256$  $2x^2 + 2y^2 + 2\sqrt{x^2 + (y - 1)^2}\sqrt{x^2 + (y + 1)^2} = 254$  It seems like I'm and doing something the hard way. show that a distance function is continuous