I have created a array of ArrayList but now I want to access its elements and sort them and print them, please help me to find out a way     ArrayList&lt;Integer&gt;[] lists = (ArrayList&lt;Integer&gt;[])new ArrayList[20] ;   for(int i=0;i&lt;20;i++){     lists[i]=new ArrayList&lt;Integer&gt;();     lists[i].add(i+i*2);     lists[i].add(i+i*3);     lists[i].add(i+i*4);     lists[i].add(i+i*5);   }      System.out.println(lists);   output:-   [Ljava.util.ArrayList;@15db9742
In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]
Are the decimal places in a CSS width respected? minitoc package adds extra page when used with float and lastpage packages The minitoc package adds extra page when used with float and lastpage packages. I figured out that this problem can be resolved by loading minitoc package before float and lastpage packages. In LyX the float package is loaded automatically and could not figure out how to force LyX  use minitoc package before loading float and lastpage packages. Thanks in advance for your help.  \documentclass[a4paper,12pt]{book} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{lastpage} \usepackage{fancyhdr} \usepackage{float} \usepackage{minitoc} \begin{document} \dominitoc \tableofcontents \mainmatter \chapter{First Chapter} \minitoc \section{Introduction} \blindtext[1] \section{Material \&amp; Method} \blindmathpaper \chapter{Second Chapter} \minitoc \section{Introduction} \blindtext[1] \section{Material \&amp; Method} \blindmathpaper \end{document}   Edited  It is also working in LyX 2.1.1 if I remove \includepdf[pages={1},scale=1]{Back.pdf} at the end of the document. However if I include \includepdf[pages={1},scale=1]{Back.pdf} at the end of the document it adds extra page. Any thoughts.   Updated  I've narrow downed the problem. My following MWE in .Rnw format adds extra page at the end of document when using minitoc package. Thanks again for your help.  \documentclass[a4paper,12pt]{book} \usepackage{minitoc} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{lastpage} \usepackage{fancyhdr} \usepackage{float} \usepackage{pdfpages} \begin{document} \dominitoc \tableofcontents \mainmatter  \chapter{First Chapter} \minitoc \section{Introduction} &lt;&lt; Test &gt;&gt;= 1:50 @  \blindtext[1] \section{Material \&amp; Method} \blindmathpaper \includepdf[pages={1},scale=1]{Back.pdf} \end{document} Split Data Based on Year in a Visual force Page PDF Sometimes I need to write text and then pipe that text into another command. My usual workflow goes something like this:   vim # I edit and save my file as file.txt cat file.txt | pandoc -o file.pdf # pandoc is an example  rm file.txt   I find this cumbersome and seeking to learn bash scripting I'd like to make the process much simpler by writing a command which fires open an editor and when the editor closes pipe the output of the editor to stdout.  Then I'd be able to run the command as quickedit | pandoc -o file.pdf.   I'm not sure how this would work. I already wrote a function to automate this by following the exact workflow above plus some additions. It generates a random string to act as a filename and passes that to vim when the function is invoked. When the user exits vim by saving the file, the function prints the file to the console and then deletes the file.   function quickedit {     filename="$(cat /dev/urandom | env LC_CTYPE=C tr -cd 'a-f0-9' | head -c 32)"     vim $filename     cat $filename     rm $filename } # The problem: # =&gt; Vim: Warning: Output is not to a terminal   The problem I soon encountered is that when I do something like quickedit | command vim itself can't be used as an editor because all output is constrained to the pipe.   I'm wondering if there are any workarounds to this, so that I could pipe the output of my quickedit function. The suboptimal alternative is to fire up a separate editor, say sublime text, but I really want to stay in the terminal. Is there any way to fix the wavy lines that appear when photographing a striped dress?   It's not just in viewing online: when it was printed at wallet size, the wavy lines showed up. YA novel about dystopian future with non-human overlords and teenage heroes How do I start Chrome using a specified "user profile"? I'm writing a set of course notes that has an appendix containing many activities.   I do not wish the activities to be shown in the Table of Contents, but I do wish them to be numbered. Here is the solution I was using:  In the preamble:  \newcommand{\activity}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}   and now my "activity" starts out with:  \newpage \activity\section{A Fun Educational Activity}   There is only one problem. The activity starts out indented, as opposed to not indented, as a section should be.   How do I make my activity start out without an indent?  I realize I could simply add \noindent but it seems to me that there should be a more elegant solution. How do I reset a lost administrative password? I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution? Package babel Error: Unknown option `francais' How to preserve custom number formatting after closing a workbook? I have created a custom format ##,##0.0,,, CTRL+J %% in Excel 2010 to display  10000 as 0.1 100000 as 1.0 1000000 as 10.0 10000000 as 100.0 100000000 as 1,000.0 and so forth.  The problem I am facing is that once I apply this format, save and close the workbook, the next time I open it the format gets changed by multiplying by 10 (100000 is displayed as 10.0).  I don't understand how it is getting changed automatically the next time I open it. However, when I apply other formats they remain unchanged. I am encountering two definitions of the special orthogonal lie algebra, and I would like to know if they are equivalent, and if there are advantages to working with one over the other.  If we begin with an $n$-dimensional vector space $V$ over a field $k$ and a chosen basis, we can define a bilinear form on $V$ by a matrix $S\in M_n(k)$, ie, let $\langle v,w\rangle=v^tSw$ for all $v,w\in V$.  Now $g\in GL_n(k)$ preserves the form ($\langle g(v),g(w)\rangle=\langle v,w\rangle$) if and only if $g^tSg=S$, so all such $g$ form a linear algebraic group $G$.  The tangent space at the identity of $G$ will be contained in that of $GL_n(k)$, so $T_eG\subset T_eGL_n(k)=M_n(k)$, and in fact, $T_eG=\{B\in M_n(k)\mid B^tS+SB=0\}$.  $T_eG$ becomes a lie algebra, $Lie(G)$, if we define the bracket to be the commutator of two matrices.  Now, if $S=I_n$, it follows that $G=O_n(k)$ is the orthogonal group of matrices satisfying $g^tg=I_n$, and $Lie(G)=\mathfrak{so}_n$ is the lie algebra of antisymmetric matrices.  In Humphrey's Introduction to Lie Algebras and Representation Theory, he defines $\mathfrak{so}_n$ to be all matrices $B$ satisyfing $B^tS+SB=0$, where $$ S=\begin{pmatrix} 1&amp;0&amp;0\\ 0&amp;O&amp;I_l\\ 0&amp;I_l&amp;O \end{pmatrix} \hspace{.5in}\text{or}\hspace{.5in} S=\begin{pmatrix} O&amp;I_l\\ I_l&amp;O \end{pmatrix} $$ depending on the parity of $n$.  The matrices obtained in this way are not antisymmetric, nor is the group $G$ preserving the form defined by $S$ the orthogonal group $O_n(k)$.  Are the two groups obtained from considering different $S$ isomorphic?  Are the two lie algebras isomorphic?  If so, why would one prefer one form to the other? How do I increase my code coverage, or why can't I cover these lines? This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered? Can I declare a duplicate page via javascript for google? Most sources of documentation state that one can declare a webpage a duplicate of another by applying this tag on the duplicate page:  &lt;link rel="canonical" href="(absolute URL to original page)"&gt;   I could generate the above tag via the script below:  &lt;script&gt; var l=document.createElement('Link'); l.rel='canonical';l.href='(absolute URL to original page)'; document.getElementsByTagName('head')[0].appendChild(l); &lt;/script&gt;   My question is, would google be able to process this javascript and believe I'm declaring the page as a duplicate page? or would I be forced to use the link tag in the header?  I ask because I'm trying to reduce the unnecessary bytes required to be processed before the actual user readable content begins. Current situation: I'm required to cite "normative" documents (read: standards and manuals) separately from articles and books etc. Using biblatex and biber with the numeric style I'm doing that by issuing multiple printbibliography commands like so:  \usepackage[style=numeric,backend=biber,bibencoding=utf8]{biblatex} %... lots of stuff \printbibliography[type=standard,title=Standards \&amp; Manuals] \vskip\baselineskip \printbibliography[type=manual,heading=none] \printbibliography[nottype=standard,nottype=manual]   which gives a heading Standards &amp; Manuals, prints a list of manuals, leaves a bit of space then the list of standards and finally, under a new heading Bibliography gives books and articles etc. Thus far everything is fine, enter:  The Problem: I'm using the shorthand field in my database for the standards and manuals which works perfect as far as output within the text is concerned and sets the shorthand as the label in the bibliography and prints the details to the right of it - problem is: my shorthands are considerably longer than the labels generated by the numeric style, but even though they're in three different \printbibliography commands, everything gets indented to the maximum width of the label, making the part for books and articles look quite ridiculous.  The following shows the problem with only two separate \printbibliography (and an obviously exaggeratedly long shorthand):   Now  what I would obviously want is for each of the \printbibliography commands to only use the indentation actually necessary to accommodate the largest label appearing within, i.e. rendering the Manuals section as above, but the Bibliography section like follows:   Can anyone help me to achieve this? Or give me some pointer where to look?  The above was produced with the following MWE on an up-to-date TeXLive 2014:  \documentclass[10pt,british]{scrbook}  \usepackage{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern}  \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @manual{HowTo,     title = {How to Make the World Go Round},     shorthand = {HowToMakeTheWorlGoRound},     publisher = {The Publisher},     year = {2000} }  @article{Article,     author = {Author, A. and Buthor, B.},     journal = {Journal Title},     pages = {113--126},     title = {The Article},     volume = {65},     year = {1900} } \end{filecontents*}  \usepackage[style=numeric,backend=biber,bibencoding=utf8]{biblatex} \addbibresource{\jobname.bib}  \usepackage[hidelinks]{hyperref}  \begin{document} \let\cleardoublepage\relax \chapter{The Document} Nothing to see here, but we refer to the \parencite{HowTo} based on a principle discovered by \textcite{Article}.  \printbibliography[type=manual,title=Manuals] \printbibliography[nottype=manual] \end{document} Starting eclipse from unity launcher Can file uploads time out in PHP? Hi im quite new to PHP, i have created a form for very large csv files to be uploaded to my server. Some one mentioned to me that the browser can time out due to the uploading file being to big, is this true? and if so, can it be prevented?  Thanks for your help! The minimum system requirements for 18.04 are "2 GHz dual core processor or better"; would a quad-core at 1.8 GHz meet (or approximate) this requirement? Sum of Cosine/Exponential Reverse (parse the output) of Arrays.toString(int[]) Is there in the JDK or Jakarta Commons (or anywhere else) a method that can parse the output of Arrays.toString, at least for integer arrays?  int[] i = fromString(Arrays.toString(new int[] { 1, 2, 3} );