Here's a simple code, where I create nested ArrayList that contains ArrayList of String. I found a weird thing: when I clear the inner ArrayList, sizes of inner and outer ArrayLists decrease to 0.  public static void  main(String[] a) {     ArrayList&lt;ArrayList&lt;String&gt;&gt; arrayLists = new ArrayList&lt;&gt;();     ArrayList&lt;String&gt; element = new ArrayList&lt;&gt;();     element.add("1");     element.add("2");     arrayLists.add(element);     System.out.println(arrayLists);      element.clear();     element.add("3");     element.add("4");     arrayLists.add(element);     System.out.println(arrayLists);      element.clear();     element.add("5");     element.add("6");     arrayLists.add(element);     System.out.println(arrayLists); }   The output of that code is:  [[1, 2]] [[3, 4], [3, 4]] [[5, 6], [5, 6], [5, 6]]   I found out how to solve the problem and make output like:  [[1, 2]] [[1, 2], [3, 4]] [[1, 2], [3, 4], [5, 6]]   Instead of clearing inner ArrayList, I initialize it again. Here's the code:  public static void  main(String[] a)     {         ArrayList&lt;ArrayList&lt;String&gt;&gt; arrayLists = new ArrayList&lt;&gt;();         ArrayList&lt;String&gt; element = new ArrayList&lt;&gt;();         element.add("1");         element.add("2");         arrayLists.add(element);         System.out.println(arrayLists);          element = new ArrayList&lt;&gt;();         element.add("3");         element.add("4");         arrayLists.add(element);         System.out.println(arrayLists);          element = new ArrayList&lt;&gt;();         element.add("5");         element.add("6");         arrayLists.add(element);         System.out.println(arrayLists);     }   So the question is: is this intended to be like that (and what's the mechanism behind that) or is it a bug that needs to be reported? I've checked this code step by step using debugger, and I checked that outer ArrayList gets size 0 after element gets cleared.
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?
How to understand Cauchy's proof of AM-GM inequality(the last step) How does one find which files are taking up 80% of the space on a Linux webserver? The drive is constantly filling up. You've hunted down all the spare and random files you can. grep'd for coredump files and even removed some of the un-needed backups...  What would be your next move.  The actual server in question has 10GB of website files and the OS shouldn't take any more than 10GB so how do you track down what's filling a 50GB (virtual) drive? How do I autohide the top panel in Unity? When windows are not maximized, the top panel is basically wasted space for me in Unity.  Is there a way to make it autohide? i.e. make it appear on mouse over. I have a polygon layer in QGIS, and would like to represent the polygons like in the below image:    I have tried two different approaches, none of which are satisfactory.    Using a line pattern fill, the entire polygon is filled with the line pattern. I need a blank area in the middle which is not filled in.    Using a marker line fill, I am able to keep a blank area in the middle, but the markers are rotated to align with the edges of the polygon. I need the markers to preserve the same rotation along all edges, like in the example above.  Any ideas? "Pandora's Box" metaphors The majority of definitions give the same meaning - "Pandora's box" is a synonym for "a source of extensive but unforeseen troubles or problems."  Are there any other metaphors with the same meaning? Gradient Boosting for Linear Regression - why does it not work? I want my Java code to be typeset in a monospaced font, so I am using the verbatim environment. LaTeX commands are highlighted in Eclipse, but as soon as I use the verbatim environment everything inside and the color of the environment itself becomes gray.  \begin{verbatim}   public class main {  public static void main (string[] args){      for(int i = 0; i &lt; arg.length; i ++){          System.out.println(args[i]);      }    }  };  \end{verbatim}   I'm using the verbatim and alltt packages.  Update 1.  MWE.  \documentclass[xcolor=dvipsnames]{beamer}  \mode&lt;presentation&gt; { \usetheme{CambridgeUS} \setbeamercovered{transparent} }  % Поддержка русского языка \RequirePackage[utf8]{inputenc} \RequirePackage[T2A]{fontenc} \RequirePackage[russian]{babel}  \RequirePackage{amsfonts}  \usepackage{algorithmic} \usepackage{mathptmx} \usepackage[scaled=.90]{helvet} \usepackage{courier} \usepackage{pst-node} \usepackage{pst-tree} \usepackage{auto-pst-pdf} \usepackage{color} \usepackage{colortbl} \usepackage{pstricks} \usepackage{verbatim} \usepackage{alltt} \usepackage{listings} \usepackage{animate} \usepackage{multimedia}  \title{Title}  \author{Name}  \institute{}  \date{\today}  \begin{document}  \begin{frame} \titlepage \end{frame}  \begin{frame} \frametitle{Outline} \tableofcontents \end{frame}  \section{Introduction}  \begin{frame}{Классификация по поколениям}  \begin{itemize}  \item Третьего поколения (высокоуровневые языки) - последовательность высокоуровневых конструкций (циклы, условные выражения, классы, интерфейсы, методы, процедуры, \ldots) \pause  \begin{exampleblock}{Пример}  \begin{centering}  Fortran, C, C++, C\#, Java, Lisp.  \begin{verbatim}  public class main { public statiс void main (string[] args){ for(int i = 0; i &lt; arg.length; i ++){ System.out.println(args[i]); } } };  \end{verbatim}  \end{centering}  \end{exampleblock}\pause  \item Четвертого поколения (для конкретного применения) - последовательность инструкций конкретной предметной области \pause  \begin{exampleblock}{Пример} SQL, Postscript, XML, Mathlab. \end{exampleblock} \pause  \end{itemize}  \end{frame}  \end{document} Detect which TeX engine is used How can I detect inside a TeX file which engine (pdftex/xetex/luatex) is used to compile the file? Is there a LaTeX package that provides this functionality? Can we use CAPITAL LETTERS to indicate actions? While designing for the web or the mobile applications, a natural free flowing text can be used for the general content, but when it comes to actions... can we use CAPITAL LETTERS. How do I solve $$x'=e^{it}\overline{x}?$$  This is a complex differential equation, but I don't see how to solve it.  Edit: the original ODE is given by $$(x', y')=\begin{pmatrix}\cos t&amp; \sin t\\ \sin t&amp;-\cos t\end{pmatrix}(x,y)$$ I want to show that solutions of this ODE do not remain bounded for all $t$, and the idea was to solve the complex equation. How to print results in SQLcmd window How do you override page.tpl.php in Omega 4? I am using the  base theme, and am trying to override page.tpl.php.    This file is in the base theme in sites/all/themes/omega/templates/system.  When I copy it into my theme, edit it, clear caches, I don't see my changes?  Why can't I override this template? How to dump a man page? R-squared: X "explains" the percentage of variation of the Y values. Does axis order matter? Badges loading broken in election statistics We have an  and I noticed the badges are not loading in the election statistics like they should be. It just hangs forever loading badge information:    Unfortunately I blew off reporting this for a couple days figuring it would resolve itself, but it doesn't seem to be a temporary problem. If Z is a square integrable random variable such that $E[Z]&gt;0$, then prove that  $$P(Z\geq k) \geq \frac{(E(Z)-k)^2}{E(Z^2)} \forall k \in [0,E(Z)]. $$  This is a homework question and I don't even understand why the inequality is reversed comparing to Markov/Chebychev inequality. Should Cauchy-Schwartz inequality be used? If yes, then how to begin? Thanks a ton! is the Turkish version of mancala, with its own set of rules.  I am planning on doing a project in it. Are there any game engines that either specifically play it, or universal Mancala players that plays it after supplying the options?  EDIT:  I am not looking for an app, but for a game engine. For example in chess,  is a playing app, while  is an open-source engine. I can't remember the gender of the main character.  I remember bits and pieces from different books, but I think they're all part of the same series. The pieces may not be in order or from multiple books.   Boy somehow ends up in a mirror universe that's darker and seems to have no people. He has to travel to a certain office(?) building and steal a book. I think this is towards the end of the book (I can't remember the events leading up to it). I think he finds the portal in a forest or something behind his school. He goes into the ocean with mermaids or something and has to save the ocean from pollution. Aliens exist and are observing Earth, because they think it's undeveloped and are waiting for them to be advanced enough. His mother ends up in hospital and he does something to save her. He goes to Ireland(?) and enters a mountain or something to find a race of people. I can't remember who showed him how, but I'm pretty sure she used magic. He goes to Mars and saves a race from war with themselves(?). This place was hidden inside an illusion. He's also grouped with a linguist that learned their language. He travels to another world where there's a prince. I can't remember, but I think it might've been part of a tournament. His sister goes to a robot planet through a portal. I think the actual planet was a robot/AI and had lots of little robots on it. Can't remember what happens here, but he goes there and saves her from something.   It was set a few years ago, when computers weren't common (his family got one early in the first book, I think).  Thanks in advance if someone finds it. The continuity of $f(x,y) = \frac {\sin (xy)} {\sqrt {x^2 + y^2}}$ at $(0,0)$ I got a function:       $f(x,y) = \frac {\sin (xy)}  {\sqrt {x^2 + y^2}}$ if $(x,y) \not =  (0,0)$, otherwise $f(x,y) = 0$,   and I should look at its continuity in $(0,0)$   I tried the sandwich theorem but got slightly stuck unfortunately  $ 0 \le \left|\frac {\sin (xy)}  {\sqrt {x^2 + y^2}}\right| \le 1$   I was thinking that $\sin (xy)$ is a restricted function, but not sure what to with $\sqrt {x^2 + y^2}$ if $x,y$ are too small so I think my idea doesn't work. Then it would look like:  $ 0 \le \left| {\sin (xy)} \right| \le \sqrt {x^2 + y^2} = 0$  Any other idea please? Why does the x86-64 / AMD64 System V ABI mandate a 16 byte stack alignment?