The sort method Collections.sort(list) works on the list even though I pass by reference. However, when I use the following method, the list does not get sorted.  public void getSortedList(ArrayList&lt;String&gt; currList) {     ArrayList&lt;String&gt; list = new ArrayList&lt;&gt;();      Cursor cursor = database.rawQuery(             "SELECT * FROM " + TABLE_NAME + " ORDER BY name DESC", null);      while (cursor.moveToNext()) {         String name = cursor.getString(0);         if (currList.contains(name)) {             list.add(name);         }     }     cursor.close();      currList = list; }
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
I am beginning with Abstract Algebra and I'm trying to understand Lagrange's Theorem. The theorem reads      For any finite group $G$, the order of every subgroup $H$ of $G$ should divide the order of $G$.   It seems simple and I've used it to solve some exercices but I believe I'm missing the essence of it. Is there an example that can help me understand it better, or visualize it? Is there a geometric interpretation? My daughter applied at the Italian Consulate in Philadelphia, and they gave her two entries for 20 days (we thought it was for 20 days each entry). She was in Italy 12 days, then went to England for 1 week and flew to Venice to take a 10-day cruise. She couldn't make it because they said she has only 8 remaining days, but she still has a land tour already paid this week.  What can she do? Can she extend the Schengen visa for 12 more days? Right now, she is in Madrid, but next week she has to fly from Barcelona to Paris to start with the tour. What would happen if she decides to take the tour with the expired visa? She is a US permanent resident. Ordering by the order of values in a SQL IN() clause Proving $a^2$ is even $\implies$ $a$ is even by contradiction Grey out all unused vote buttons on old elections I'm hoping this is a &quot;quick fix&quot;, but it's far from a priority. A small change might help a lot here. I got some egg on my face yesterday when I . A new user thought the same thing and had asked in chat. It turns out that's by design  Look at the candidates you voted for. The '1st', '2nd' and '3rd' choice buttons look different there; here are the buttons on the candidate I voted for as second choice:  Unless I get shown a candidate I did vote for, my screen looks like this  While voted candidates show like this (note 1st and 3rd are greyed out)  I would like to see all the buttons, save ones I used to vote for, shown as greyed out. It would make it visually obvious that one cannot cast a new vote. What safety precautions should I take when taking photos in the snow? I’m going to Queenstown, NZ in a couple of weeks and want to take my (very new, very precious) Canon 7D with me. I’ve done a little bit of research on how to protect my baby from cold climate (e.g. ) and found that the biggest problem is probably going to be condensation. Some suggestions have been to place the camera in a plastic bag or letting the camera gradually adjust to the new temperature or placing silica gel in the camera bag to absorb moisture. I am leaning toward the latter at the moment because it sounds like it’s the easiest, so I was just wondering if anyone has had any experience in this matter and could share their wisdom.  As an alternative I could take my Canon 350D, as I really wouldn’t care if that got damaged in the snow. However I’m a film student and tend to take just as many videos as photos – hence why I really want to take the 7D. But I would seriously regret it if it got damaged… dilemma!   So as I actually haven’t used a question mark in the body of text, I will specify that the question is: What safety precautions should I take when taking photos in the snow?  Cheers. I've tried other solutions, but none of them are specific to my setup. I just started using the new Linux subsystem featured in the recent Windows 10 update. I'm using WAMP x64 v3.0.6, and have successfully cloned my website and got it up and running. At the root of the Linux subsystem, I installed Drush globally with Composer, using the directions given on the .  Typing drush status returns the following when I run it in my default directory:  Drupal version         :  7.50  Site URI               :  http://default  Database driver        :  mysql  Database hostname      :  localhost  Database port          :  Database username      :  root  Database name          :  aerosphere  PHP executable         :  /usr/bin/php  PHP configuration      :  /etc/php5/cli/php.ini  PHP OS                 :  Linux  Drush script           :  /home/bob/.composer/vendor/drush/drush/drush.php  Drush version          :  7.1.0  Drush temp directory   :  /tmp  Drush configuration    :  Drush alias files      :  Drupal root            :  /mnt/c/wamp64/www/drupal-7.50  Site path              :  sites/default   But, as mentioned in the title, drush cc all returns No Drupal site found, only 'drush' cache was cleared.[warning] I assume it has something to do with adding a path to the .bashrc, but I don't know what to add. Any tips would be greatly appreciated!  My question is different from "", they're on a Mac and using MAMP, and I'm using WAMP on Windows. I've tried the solutions offered on that post, but the issue has not been resolved.  I'm obviously having issues connecting to MySQL as I get this when I run mysql command:     The program 'mysql' can be found in the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtradb-cluster-client-5.5      Try: sudo apt-get install .   So I've added these lines to my .bashrc file:  PATH="$HOME/.composer/vendor/bin:$PATH" export PATH="/mnt/c/wamp64/mysql/mysql5.7.14/bin:$PATH"   The top line was added to get drush working. I've checked multiple times, and I have the path correctly set, but it's still not working. My book (Concepts of Physics by H.C. Verma) writes:  It has been reported () that the force between two masses may be better represented by $$F = \frac{G_{\infty} m_{1} m_{2}}{r^2} \left[1 + \left(1 + \frac{r}{\lambda} \right) \alpha e^{-\frac{r}{\lambda}}\right]$$ where $\alpha \approx - 0.007$ and $\lambda \approx 200~\mathrm{m}$.  What is this? Such a horrendous formula! So, what about Newton's? And what's the difference between $G$ &amp; $G_{\infty}$? Zlib-compatible compression streams? Python: reload component Y imported with 'from X import Y'? event.returnValue is deprecated. Please use the standard event.preventDefault() instead I accidentally discovered () that a closing square bracket within an optional argument delimited by [ ] can cause problems.  Here is example code illustrating the issue:  \documentclass{article}   \begin{document}  \tableofcontents  \section[Square brackets ([ and ])]{Square brackets: [ and ]} % bad: the TOC now has "Square brackets ([ and", and the actual title is a mere ")".  Some text.  \section[{Square brackets ([ and ])}]{Square brackets: [ and ]} % good (works as originally intended)  Some text.  \end{document}   The text to be used as the optional (as well as the non-optional) argument contains a ], and this character is not supposed to function as the optional argument terminator but as a matching square bracket/parenthesis. Perhaps this is as it should be, but the question is how to best circumvent any potential problems. Enclosing this in a group works, but I don't know whether doing this has other side effects (perhaps not here in the case of \section but hopefully someone else has a better example of where grouping could lead to a problem). There is no (obvious) way other than writing [{ }] because [ and ] are not normally escaped. That [ and ] are normal characters and bear syntactic function (as optional argument delimiters) creates this potentially problematic situation.  Is simply enclosing the entire optional argument in a group ({ }) a good solution? Are there other/better ways? How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code? Is it true that a language is regular? Is it true that for every regular language $L \subseteq \{0,1\}^*$, language $\big\{ w^{|w|} \big| w \in L \big\}$ is regular? I don't know how to prove that.Could you give me a hint? Thank you How can I get CSS comments with jQuery? I am wondering how I can read CSS comments out of a linked stylesheet.  I have this sample CSS loaded via:  &lt;link rel="stylesheet" type="text/css" media="all" href="test.css" /&gt;   &nbsp;  #test1{ border:1px solid #000; } #test2{ border:1px solid #000; } #test3{/* sample comment text I'm trying to read */}   I'm testing this in FF3. The following javascript reads the rules but doesn't read the comments in#test3.  window.onload = function(){     s=document.styleSheets;     for(i=0;i &lt; s[0].cssRules.length;i++){         alert(s[0].cssRules[i].cssText);     } } I have a High poly mesh and I have decided to make the low poly by merging as it is easiest for me. Would it be possible to change the W Hotkey , so that it merges to the center automatically? It is time consuming pressing W > Merge > Center. Is static HTML the fastest? I have an account on Stack Exchange but when I try to login to  I do not see the option Login with Stack Exchange.       Why is this option now not available? Apple has introduced , also known as "rootless", with OS X 10.11, El Capitan. I understand this is a step for general protection against malware but as a developer I need write access to some of the files it locks away.  How do I disable this protection? I am considering attacks on Two-Key Triple-DES Encryption assuming $2^{32}$ known plaintext/ciphertext pairs (that's a mere 32 of ciphertext) by the method devised by Paul C. van Oorschot and Michael J. Wiener:  (in ), or another published method not requiring significantly more DES computations. As a synthetic information for decision makers, I am looking for an independent estimate of how much time this is expected to require, assuming all the RAM ever built by mankind to that day (of April 2012) was put to full use. Note: I'm purposely not asking when the attack could become feasible using all the RAM ever built by mankind, because estimates on the amount of RAM mankind will build, and when, are less falsifiable. Update: I am not considering cost; neither of RAM, power, logic including DES engines (as long as the number of DES operations remains within $2^{90}$). I am willing to assume that the amount of RAM used, and its effective speed, are the only factors to account for in determining the expected duration of the attack. This is similar to the hypothesis made by the authors of the linked paper, that their attack is limited by the amount (or cost) of RAM used, with all other factors of secondary importance. Update: sadly, nobody dared answer the question and the bounty period is over. Thus  is a first order answer to criticize.