I'm trying to understand how the String pool works and what are the rules for a string to be equal to another String.  For example this snippet :  public static void main(String[] hi){     String s1 = "lol";     String s2 = "lol";     String s3 = new String("lol");     System.out.println( s1 == s2 );// true     System.out.println( s2 == s3); // false     s3.intern(); //line 1     System.out.println( s1 == s3); // false     testString(s1);  }  private static void testString(String s1){     String s4 = "lol";     System.out.println( s1 == s4); // true }    At //line 1: the string is added to the string pool. Since it's not equal to s1 I assume there is a duplicate in the string pool. Correct ? What is the rule for having a duplicate in the pool ? In other words when does someString == someString return false even though both string have the same char sequence ?   PS: I use string1.equals(string2) everywhere no matter what. I just want a deeper understanding of the underlying mechanism.
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?
What is the penalty for dual US citizens who lie on the ESTA form in order to enter under VWP using their second passport? We've heard it many times, nothing can escape the gravity of a black hole, even light once it's past the event horizon.  If this is true, how can a black hole emit anything?  are massive black holes that have consumed enormous amounts of matter and energy, and then blasted it back out into the universe.  How is this possible?  Time stands still in a black hole, that in itself should stop anything from moving. I would like to see a breakdown of reputation by post type on the user summary page.    This would help show, at a glance, how much someone actually knows vs. how good they are at asking questions.  For instance:     Reputation from Questions - 10,015 from 1024 posts   Reputation from Answers - 110 from 11 posts   Reputation from Edits - 400 from 1000 edits     I would take any answers the above person gave me with a grain of salt instead of assuming they were knowledgeable because they have 10k rep.  We already have a multitude of other readouts on the new page, so this shouldn't up the clutter factor too much either. How can I transition height: 0; to height: auto; using CSS? Surface area inside cylinder Find the surface area of the part $\sigma$: $x^2+y^2+z^2=4$ that lies inside the cylinder $x^2+y^2=2y$  So, the surface is a sphere of $R=2$. It looks there should be double integral to calculate the surface, but how, which way? Function always continuous in a Sobolev Space? Hy everybody got a quick question. I know that all function F in a Sobolev Space has a continuous representative called U such as U=F almost everywhere.  Lets take for example: The Sobolev space on ]-1,1[    the function F(x)=0 on x&lt;0 and F(x)=1 x>0  we can't find a continuous representative because it would be on a larger interval let say ]-eps ,eps[ so not in a Sobolev space the function F(x)=x on x&lt;0 and x>0 and F(0)=1 where we could find the representative U=x   My question is: if F isn't continuous is it sure that it isn't an element of a Sobolev Space? It was given was given as a necessary condition in my course.  Thanks for the help. Create longer arrows Bug with Excavator Badge I edited this post today  on stack overflow. I was approved of the edit, so I waited a few minutes to get my  badge because this answer was posted on Jan 28 '10 at 1:06, but it never came. I have read multiple articles on meta that there have been bugs with this badge, but they have been about winning it multiple times (), or earning it then losing it (). Am I missing something here? How does a cell phone charger work? I remember watching this one show when I was a kid in the 80's/early 90's in Canada. It was a live-action show about these two kids and had some puppet/muppet-like characters, but it kind of had a dark/mysterious element to it. I can't remember too much about it except portions of some episodes, but the main characters were kids, and they had some mysterious artifact (kind of like a compass?) that took them to this other world where there were giants and other mysterious beings that we rarely saw. The two kids weren't the only one's going to this place either, they find out kids from all around the world that also had this same artifact (and they all fit together like a round puzzle?). I seem to recall that the giants in this other world were the ones who made the artifacts, and were dying/or in desperate need of the help of the kids.  A couple episodes I remember:   There was one where the leaves were falling, and the world was doomed to end as soon as the last leaf touched the ground, so they're trying to figure out how to prevent all the leaves from falling, but after a long and suspenseful episode (for a kid) the last leaf dramatically falls, but out of no where the main girl catches the leaf and saves the world (it was very exciting for my young self, and I remember being very impressed with the pretty girl for thinking to catch the leaf).     There was another episode where the kids meet these two old guys with long white hair (muppets) sullenly working in a mine/tunnel, they're in tattered old clothes working away with their pick axes or hammers and they are connected to each other at the beard. This long old white beard grows out of one of their faces right into the other's. The kids save the day by cutting the old guy's beard in the middle, freeing them from each other. They celebrate being free from their bonds and excitedly thank the kids, but after the kids leave they continue to work away, this time in much brighter spirits. Seemingly unbeknownst to them though, as they work, their beards slowly and subtly grow back together.   Anyone else remember this show? I've never really thought about how the shell actually executes piped commands. I've always been told that the "stdout of one program gets piped into the stdin of another," as a way of thinking about pipes. So naturally, I thought that in the case of say, A | B, A would run first, then B gets the stdout of A, and uses the stdout of A as its input.    But I've noticed that when people search for a particular process in ps, they'd include grep -v "grep" at the end of the command to make sure that grep doesn't appear in the final output. This means that in the command ps aux | grep "bash" | grep -v "grep" it is implied that ps knew that grep was running and therefore is in the output of ps. But if ps finishes running before its output gets piped to grep, how did it know that grep was running?   flamingtoast@FTOAST-UBUNTU: ~$ ps | grep ".*" PID TTY          TIME CMD 3773 pts/0    00:00:00 bash 3784 pts/0    00:00:00 ps 3785 pts/0    00:00:00 grep Is it possible to kill Ulfric after joining the Stormcloaks? So I've been thinking if it's possible to join the Stormcloaks only to realize Ulfric's an ass and kill him after that at some point of the game (I know you can't just go and kill him at first because he's an important NPC for the main story quests).  I don't want to join the Empire and - in my mind - what would make sense in my character's storyline would be him joining the Stormcloaks at first (because of how the game starts and my character being a Nord and having escaped with Ralof), but later realizing how Ulfric is only after power and how his fight against the Empire might even benefit the Altmers by weakening both forces (Empire and Rebellion). His Talos talk is just an excuse for his actions, as I see it. I really don't like this guy (he's a crazy racist who would do anything for power), but I also don't like what the Empire has become.  Please note that I don't really want spoilers about the plot, I just want to know if it is possible to challenge Ulfric to one-on-one combat "in the Old Nord Way" or just take the Rebellion for myself by assassinating him. The Boolean modifier is not working I'm trying to model an , but it's not going so well when it comes to the magazine of the weapon.   Next to the magazine is a mesh. I want to cut holes in the mag with that mesh. But the magazine just goes invisible or connects with the mesh when trying to execute the Boolean Modifier. I have tested to invert the normals and some other stuff, but it isn't working. How can I change pdf page size? I would like to split pages in pdf so that each page would be divided into 2 pages ( e.g. form 100 pages I would go into 200 but smaller - exactly half size).  I need this to read pdfs on my ebook reader.  Anybody knows how can this be done ? Windows 10 update broke my MBR / GRUB After I ran Windows 10 update this afternoon my partition table broke... I had dual boot with Windows 10 and Ubuntu 14 with Grub as the boot loader. The error that came up was "Error no such partition, Entering rescue mode... grub rescue>". I googled it,  about the boot-repair ISO, installed it on a USB, ran the repair, got this report, but still no luck:    Now the boot skips Grub entirely and goes to Windows boot manager which fails with "The boot configuration data for your PC is missing or contains errors". So now instead of dual boot I have zero boot. Thanks Microsoft.  Anyway can you guys help me interpret the disk info in the pastebin link? I don't remember my partition configuration but I believe Ubunut had slightlty less disk space than Windows. Questions I have:   Is the Ubuntu partition still there? Could it be the one named "Extended"? (sda4) Where would GRUB be? Gone? Can it be reinstalled? how?   I don't really care about the Windows partition anymore, but it would be nice to rescue Ubuntu. Intersection Number of $B = Y^2 - X^3 + X$ and $F = (X^2 + Y^2)^3 - 4X^2Y^2$ using the fact $I(P,F \cap B) = ord_P^B(F) $. I just installed Ubuntu 13.10, and I can't configure my wi-fi Epson TX430W printer.  Using the Settings-&gt;Printers interface, I can detect the printer. When I click add, I briefly see a "Searching for drivers" dialog. It dissapears, and then I'm left with the printer forever in "Installing" status.  If I close the window and reopen Printers, it doesn't show up on the list.  How can I solve, or at least diagnose the problem? The error: "mount: only root can do that" while mounting a partition In a 2D top-down game, how can I create projectiles that have a height? How to make text aligned left/center/right in the same line? I am trying to align some text to left/center/right in the same line. For example, I want to put my phone number on the left, my name in the center, and my email on the right, how do I do that?