Adding two ArrayLists to JTree everything seems to run fine apart from the if statement, comments in code explain most of it.  The aim is to add two ArrayLists to a Jtree. Arraylist containing whole numbers like (1,2,3,4 etc) and the second containing double number like (1.1,1.2,2.1 etc).  I want to add the first array to the JTree, which i have managed to do. But i then want to add the second arraylist so thats it is a child of the first.  So that 1.1 and 1.2 are a child of 1 and 2.1 is a child of 2 etc.  Any help would be appreciated.      DisplayTree.addActionListener(new ActionListener() {          @Override         public void actionPerformed(ActionEvent e) {              JFrame frameG2 = new JFrame("Cell Tree");             frameG2.setSize( 400, 900 );             frameG2.setVisible(true);              frameG2.setBackground( Color.gray );              DefaultMutableTreeNode root = new DefaultMutableTreeNode("cells");              int i=0;             //should through first array list and adds it to root             for (int n =0; n&lt;arrayList.size();n++) {                 DefaultMutableTreeNode cells = new DefaultMutableTreeNode(arrayList.get(n));                  root.add(cells);                  //should go through jtree elements                 Enumeration search = root.postorderEnumeration();                 while(search.hasMoreElements()){                       //should compare each element to a 2nd array                     //2nd array consists of double numbers like 1.1,1.2,2.1 etc                     //so i split it before the "." so 1.1 is 1                     //first array consists of whole numbers like 1, 2, 3                     //want to make 1.1 child of 1 etc.                     if (search.nextElement().toString()==(arrayList2.get(i).toString().split("\\.", 0)[0])) {                         DefaultMutableTreeNode NewCells = new DefaultMutableTreeNode(arrayList2.get(i));                         cells.add(NewCells);                          i++;                      }else{                     }                  }             }                   tree = new JTree(root);                 frameG2.add(tree);           }     });
How do I compare strings in Java? I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
Biblatex: URL-breaking not working in DVI-mode I'm preparing my bibliography and noticed that biblatex-printbibliography produces Overfull \hbox several times.  Examples (gray lines indicates text margins, red line is the physical page margin):        Why is hyperref line-breaking not working as expected using pdflatex or even latex -&gt; dvipdfm BUT not using latex -&gt; dvips -&gt; ps2pdf?  Also it would be great if someone could point out how I can raise the indentation of the second (and following) lines, as this might look better.  edit: Customized question, as the answer given by lockstep solved the third problem. The second problem seems to be identical to the first.  \documentclass[12pt]{scrbook} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ps2pdf]{hyperref} %\usepackage[ps2pdf,breaklinks=true]{hyperref} %This doesn't change anything. %\usepackage{breakurl} %That makes no difference either.  \usepackage[a4paper,twoside,showframe]{geometry} %show text margins  \usepackage[style=alphabetic,backend=biber,maxnames=4,minnames=3,maxbibnames=99]{biblatex} \bibliography{biblatex-issue}  \begin{document} \nocite{*}  \printbibliography[heading=subbibliography,type=article,prefixnumbers={A-}] \printbibliography[heading=subbibliography,type=book,prefixnumbers={B-}] \printbibliography[heading=subbibliography,type=online]  \end{document}   And the bib-file:  @online{GLS:datasheet,     title         = "GLS Datasheet",     organization  = "Optoelectronics Research Centre",     howpublished ="Website",     date = "2004-09",     urldate="2013-07-01",     url ="http://www.southampton.XXXX",     address       = "Southampton, United Kingdom" } @book {Lifante:Fundamentals,     title = "Integrated Photonics: Fundamentals",     author = "Lifante, Ginés",     publisher = "J.Wiley",     address = "Chichester",     year = "2003",     type = "text",     isbn = "9780470848685" } @article{Labadie:First_fringes,     author = {Labadie, L. and Mart\'{\i}n, G. and Anheier, N. C. and Arezki, B. and Qiao, H. A. and Bernacki, B. and Kern, P.},     title = {First fringes with an integrated-optics beam combiner at 10},     DOI= "10.1051/0004-6361/201116727",     journal = {A\&amp;A},     year = 2011,     volume = 531,     pages = "A48" }     P.S.: I noticed that the visiting-date of the GLS-datasheet is wrong ;-) Dynamic pivot: sum of sales per month My table is like this:  Sitecode    Month  Amount --------    -----  ------ XX          Jan     1000 XX          Jan     3000 XX          Apr     3000 XX          Apr     1000   What I want is, to show the result something like this:  Sitecode    MonthJAN   MonthAPR --------    --------   -------- XX          4000       4000 If we can construct lines of distance $1$ and $x$, then how do we construct a line of distance $x^2$? The author is trying to prove it is impossible to square a circle of radius $1$ under the assumption that $\pi$ is transcendental. Even with this assumption, the author explains that if the circle can be squared, then we could draw a line with distance $\pi^{1/2}$. Everything good at the moment. Then he claims that, if such construction is possible, we could also draw a line of distance $\pi$, and that the proof would, under the stated assumption, be complete.     The thing I don't get is how, from a line with distance $\pi^{1/2}$, we could create a line with distance $\pi$. where is `cd` located? If $a_0+\frac{a_1}{2}+\dots + \frac{a_n}{n+1}=0$ then $a_nx^n+\dots + a_0$ has a root in $[0,1]$ Let $P(x)=a_nx^n+a_{n-1}x^{n-1}+\dots +a_0$ be a real polynomial such that $a_0+\frac{a_1}{2}+\frac{a_2}{3}+\dots + \frac{a_n}{n+1}=0$.  Show that $P$ has a root in $[0,1]$. I would like proof verification and alternative proofs.  My solution:      notice that the antiderivative of $P(x)$ is $\frac{a_nx^{n+1}}{n+1}+\frac{a_{n-1}x^n}{n}+\dots + \frac{a_1x^2}{2}+a_0x+C$. From here $\int_{0}^1P(x)dx=a_0+\frac{a_1}{2}+\frac{a_2}{3}+\dots + \frac{a_n}{n+1}=0$. If $P$ had no roots then $P$ would be a strictly positive(or negative) continuous function, so its integral would be strictly positive ( or negative), a contradiction. I saw this in Basic Topology by M.A.Armstrong. It gives three descriptions of real n-dimensional  projective space $P^n$. Two of them are:  (a) Begin with the unit sphere $S^n$ in $E^{n+1}$ and identify its antipodal points.  (c) Begin with the unit ball $B^n$ and identify antipodal points of its boundary sphere.  I find it hard to imagine why these two descriptions lead to the same space.  Can you please help? Thank you. Am I Running as a Service Last night I was updating my Ubuntu 10.04 to either 11.04 or 12.04 (I'm not entirely sure which one it was, but I think it was 11.04) and I left it overnight to finish. When I came down in the morning, I noticed that the computer hadn't barely begun installing the updates! The update thing said that my computer was on the installation step, but it was still preparing the libc bin (or whatever its called) . It's like the first part of the step installing the upgrades. So, I stupidly restarted the computer, and when it rebooted, I got five options on a purple screen:  Ubuntu, with Linux 3.0.0-28-generic Ubuntu, with Linux 3.0.0-28-generic (recovery mode) Previous Linux versions Memory test (memtest86+) Memory test (memtest86+, serial console 115200)   Long story short, not matter which way I enter Ubuntu to try and reinstall the updates using the root thing (it's like terminal) after I enter sudo apt-get update it basically said it failed to fetch every url link, and it then says:  W: Some index files have failed to download. They have been ignored, or old ones used instead. W: Not using locking for read only lock file /var/lib/dpkg/lock E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.   So, I entered sudo dpkg --configure -a, and it says:  dpkg: error: unable to access dpkg status area: Read-only file system"   I'm left like wtf, and I really just some guidance here. I just got this laptop, and I can not afford a new one if I broke this one. I use time manager for a polygon layers with dates and it works. I would like to see the cummulative addition of my polygons. So I have 4 periods I want the poylgons from 1900-1950 to be added to the new ones in 1950-2000 etc in the next time step. How can I perform that or does another open source tool exist for that? Importance of Representation Theory Representation theory is a subject I want to like (it can be fun finding the representations of a group), but it's hard for me to see it as a subject that arises naturally or why it is important. I can think of two mathematical reasons for studying it:   The character table of a group is packs a lot of information about the group and is concise. It is practically/computationally nice to have explicit matrices that model a group.   But there must certainly be deeper things that I am missing. I can understand why one would want to study group actions (the axioms for a group beg you to think of elements as operators), but why look at group actions on vector spaces? Is it because linear algebra is so easy/well-known (when compared to just modules, say)?  I am also told that representation theory is important in quantum mechanics. For example, physics should be $\mathrm{SO}(3)$ invariant and when we represent this on a Hilbert space of wave-functions, we are led to information about angular momentum. But this seems to only trivially invoke representation theory since we already start with a subgroup of $\mathrm{GL}(n)$ and then extend it to act on wave functions by $\psi(x,t) \mapsto \psi(Ax,t)$ for $A$ in $\mathrm{SO}(n)$.   claims that if our physical system has $G$ as a symmetry group, then there is a correspondence between particles and representations of $G$. I'm not sure if I understand this correspondence since it seems to be saying that if we act an element of G on a state that corresponds to some particle, then this new state also corresponds to the same particle. So a particle is an orbit of the $G$ action? Anyone know of good sources that talk about this? Debugging a custom-bib bst file that crashes on book items I created my own bibliography file with custom-bib (makebst), but when I run it with a reference to a book I get:  $ bibtex PhD [...normal output] Database file #1: PhD.bib You can't pop an empty literal stack for entry oecd2001brc while executing---line 1504 of file wdsphd.bst   The only thing on that line is a high-level ITERATE call.   The style was created with these options:  %% merlin.mbs  (with options: `head,exlang,annote,seq-no,nm-rvvc,dt-beg,yr-par,xmth,tit-qq,qx,bt-qq,vol-bf,volp-sp,num-xser,pub-date,isbn,issn,doi,english,pp,ord,url,url-nl,nfss,,{}') %% english.mbs  (with options: `exlang,annote,seq-no,nm-rvvc,dt-beg,yr-par,xmth,tit-qq,qx,bt-qq,vol-bf,volp-sp,num-xser,pub-date,isbn,issn,doi,english,pp,ord,url,url-nl,nfss,,{}') %% merlin.mbs  (with options: `tail,exlang,annote,seq-no,nm-rvvc,dt-beg,yr-par,xmth,tit-qq,qx,bt-qq,vol-bf,volp-sp,num-xser,pub-date,isbn,issn,doi,english,pp,ord,url,url-nl,nfss,,{}')   The code for book items looks like:  FUNCTION {book} { output.bibitem   author empty$     { format.editors "author and editor" output.check     }     { format.authors output.nonnull       crossref missing$         { "author and editor" editor either.or.check }         'skip$       if$     }   if$   format.btitle "title" output.check   crossref missing$     { format.bvolume output       new.block       format.number.series output       new.sentence       format.publisher.address output     }     {       new.block       format.book.crossref output.nonnull     }   if$   format.edition output   format.isbn output   format.doi output   new.block   format.note output   fin.entry   write.url }   And this is the entry:  @book{oecd2001brc,  author = {OECD},  doi = {10.1787/9789264193550-en},  isbn = {9789264186903},  publisher = {OECD Publishing},  title = {{Biological Resource Centres: Underpinning the future of life sciences and biotechnology}},  url = {http://www.oecd-ilibrary.org/science-and-technology/biological-resource-centres\_9789264193550-en},  year = {2001} }   Is there a way to get a better stacktrace from bibtex? What I have now doesn 't really tell me what is going on. If it can be fixed simply, help would also be appreciated. What Sith Lords were turned to the Light Side? Equivalence of Categories and of Their Functor Categories Suppose $A, B, C$ are categories. If $A$ and $B$ are equivalent, is it the case that $C^A$ and $C^B$ are equivalent? Also, is it the case that $A^C$ and $B^C$ are equivalent.  I first conjectured that $C^A$ and $C^B$ are equivalent, but then as I tried to prove the conjecture, I started to realize that it might not be the case. So now I'm trying to find a counterexample. So far I have not been able to find one. Maybe I'm stuck with "too complicated" ideas. I strongly believe that there are very simple counterexamples. Please help. (For more detail, I got to the point where I have a cube that I want to be commutative, but I can only show that 4 of its sides are commutative squares. That's when I realize the other two sides may not necessarily commute.)  And of course, there is the second part to the problem that's not just the dual problem. I would like to know about the special case in which $A$ is a preorder and $B$ is a partial order which is the skeleton of $A$. This may have nothing to do with the validity of the statement in question at all, but it is the setting that originated this question. Do "twice as high xxxxx as" , "twice as high" and "twice higher" mean the same thing? Some one who is not good at keeping secrets. In my native language it is called "chugalkhor" but it's a slang. So I can't translate it.  What do you call such a person who can't keep secrets because his instincts don't let him. How can I get the DateTime for the start of the week? Problems with wifi range on laptop. Wifi card: realtek rtl8723be So I just started using linux/ubuntu today and I've been getting problems with my wifi, ive tried the solutions on this page:  When im really close to my router, its fine, i can see wifi signals, but when i go just a few steps back it disappears right away. Im using the latest version of ubuntu 17.10  Any suggestions would be nice! :) What's the best and quickest way to detect whether you're running a 32 or 64-bit version of Windows Server from the command line?  (Cygwin is installed) Preposition confusion - Do you learn somthing 'at' school OR 'in' school? I know that we use the preposition at to describe a place. I learned French at school is one of the examples I can think of.   I came across two examples that use the preposition 'in' with 'schools' in the context of 'learning'.   Example #1 from the  website:      Eleven things that you will never learn in school.   Example #2 from      Do you think the skills you learn in school will help you get the job you want?   The use that I had in my mind is here on      Should Parents Control What Kids Learn at School? Do I need Intel Smart Response when installing Ubuntu? With lots of guides and setup variations all over the internet, I find it confusing which is which to really follow. Normally, in Windows 8 my setup would be install everything in the HDD and use Intel Smart Response for a speedy setup. However as I am new to Linux I really don't know what to do.  My ideal setup would be something similar to this, but I know for a fact that IRST is not available in Linux so what I intend to do is keep the OS files in the SSD instead and keep my media on the larger HDD. A step by step procedure would be extremely helpful.     Edit: I want a system running solely on Ubuntu, with the SSD to speed things up but setting it in such a way that it does not hasten its lifespan.    # /etc/fstab: static file system information.  # # Use 'blkid' to print the universally unique identifier for a  # device; this may be used with UUID= as a more robust way to name devices  # that works even if disks are added and removed. See fstab(5).  #  # &lt;file system&gt; &lt;mount point&gt; &lt;type&gt; &lt;options&gt; &lt;dump&gt; &lt;pass&gt;  # / was on /dev/sda1 during installation  UUID=80289460-5983-4349-8afc-6f3119938ee9 / ext4 errors=remount-ro 0 1   # /files was on /dev/sdb5 during installation  UUID=c1678c88-5100-41bc-8090-7887f1622c7f /files ext4 defaults 0 2   # swap was on /dev/sdb6 during installation  UUID=608e3ec2-c76e-4657-af6d-80793b5f50f6 none swap sw 0 0