Im new to java. sorry if had made any mistakes in asking the question. How to compare 2 strings, This is my code. I appreciate everyone who tried to help me.  public static void displayLogin() {     System.out.println("\n****** Login Menu ******");     Scanner loginInput = new Scanner(System.in);     System.out.print("Enter Username: ");     String userName = loginInput.next();     System.out.print("Enter Password: ");     String password = loginInput.next();     if (userName == "admin" &amp;&amp; password == "admin123") {         displayMainMenu();     } else {         System.out.println("\n#Incorrect Username or Password, Please Try Again#");         displayLogin();     }     loginInput.close(); }
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?
My Ubuntu 12.04 was normally updated through the Update Manager, something about gtk. Then I rebooted and now all that shows after the splash screen is a blue screen that only shows the cursor. I need a robust and simple way to remove illegal path and file characters from a simple string. I've used the below code but it doesn't seem to do anything, what am I missing?  using System; using System.IO;  namespace ConsoleApplication1 {     class Program     {         static void Main(string[] args)         {             string illegal = "\"M&lt;&gt;\"\\a/ry/ h**ad:&gt;&gt; a\\/:*?\"&lt;&gt;| li*tt|le|| la\"mb.?";              illegal = illegal.Trim(Path.GetInvalidFileNameChars());             illegal = illegal.Trim(Path.GetInvalidPathChars());              Console.WriteLine(illegal);             Console.ReadLine();         }     } } Is Firefox 57 multithreaded? According to  on MDN, Firefox 57 finally runs things in different processes.  So is Firefox 57 multithreaded?  In particular, how many cores does it use at most? Say I open 20 tabs at once on a quad-core machine, will Firefox 57 launch as many threads, or at least as many as needed to max out my CPU?  (Chromium for instance spawns a number of sub-processes and very easily uses all the resources available. Firefox up to 56 in GNU/Linux is rarely seen going over 135 % of one core however many tabs I open.) How to discard unsaved changes to a view when editing it leads to a WSOD? What is the module/method used to get the current time? How to partition a list in a specific way Can sum of a rational number and its reciprocal be an integer?   My brother asked me this question and I was unable to answer it.   The only trivial solutions which I could think of are $1$ and $-1$.  As to what I tried, I am afraid not much. I have never tried to solve such a question, and if someone could point me in the right direction, maybe I could complete it on my own.  Please don't misunderstand my question.   I am looking for a rational number $r$ where $r + \frac{1}{r}$ is an integer. Why particle hole symmetry and chiral symmetry are called symmetries? $PHP^{-1}=-H$ (particle-hole symmetry) and   $\Gamma H \Gamma^{-1}=-H$ (chiral symmetry)   I understand why we get the negative signs but im just a bit confused as to why such equalities mean $H$ is particle hole and chiral symmetric.   When we say $H$ is symmetric under some operation, like time reversal,  don't we usually mean that $H$ is invariant under the said transformation?  $THT^{-1}=H$ if $H$  is time reversal symmetric.  On the contrary, we say $H$ is symmetric under particle hole and chiral operations when $H$ picks up a negative sign. This seems to contradict our usual convention of what we mean by $H$ being symmetric(invariant). when upgrading to a 200 amp service panel with service drop coming from bottom underground do I need southern California Edison to come disconnect and then reconnect or can I just do it on my own. I do have a permit. I am using tufte-latex package, which uses mathpazo with old style numerals. To make figures (plots) I would like to use lining numbers.  The problem is that the figures are converted from svg to pdf using inkscape and the numbers are not in mathmode (In math mode the numbers are lining numerals by default).  I think of two possible solutions:  a) Is there any command similar to \oldstylenums that does the opposite work?  b) inkscape put the text of the figure in \smash{-22.22} commands. Is any way,  using sed, awk, perl,... to change that to \smash{$-22.22}? Include sorting of accepted answer on profile I have few things on my mind:   I viewed my profile and I wanted to sort my answers by  "Accepted Answer, Votes" Wanted to know how many answers I've made that is marked as  the accepted answer. Sort by Most liked Question: I'm referring to my question who  have the most numbers of favorites. I wanted to sort the questions I created order by accepted or  unaccepted questions.    1 &amp; 2 seems useful to me but 3 &amp; 4 I don't think are that useful. But who knows, someone in this site might find it useful one day!  My POV: My answer is only sorted by Votes, I also want to see a list of accepted  answers on my profile probably not just to know how many accepted answers  I have but also to know what are the accepted answers that I have. Comma as decimal marker with siunitx (Spanish usage) I'm using siunitx to input some big numbers and units in my document.  Is there a way to make the output of \num{3.14} be "3,13" instead of "3.13"? In Spanish, we use the first one. How do I get list of all tables in a database using TSQL? I'm just going to throw this out there, but Google indexes Stack Overflow really quickly For example, I  after using Google to try to find an answer. I then turned back to Google and did a search for  and it was already the first result! Similar searches also put my question on the first page, usually in the top 5!  This is insanity. Did I get lucky and post just before an indexing? Is the popularity of SO leading to Google indexing extremely frequently? Or is Jeff using some kind of crazy SEO? Can anyone please give an example of why the following definition of $\displaystyle{\lim_{x \to a} f(x) =L}$ is NOT correct?:  $\forall$ $\delta &gt;0$ $\exists$ $\epsilon&gt;0$ such that if $0&lt;|x-a|&lt;\delta$ then $|f(x)-L|&lt;\epsilon$  I've been trying to solve this for a while, and I think it would give me a greater understanding of why the limit definition is what it is, because this alternative definition seems quite logical and similar to the real one, yet it supposedly shouldn't work. Why disable Fast Boot on Windows 8 when having dual booting? Techniques for modeling a network of blood vessels If you've ever seen anything like Body Worlds or the Bodies: The Exhibition you'll know how they dissect individual organ systems and put them on display with a technique known as . For instance, plastic can be pumped through the circulatory system such that when it hardens, acid can be used to dissolve the rest leaving the underlying network of blood vessels underneath.    I'm looking forward to modeling something as intricate as this, but my first attempts have failed. The initial idea was to generate a tree structure with the Sapling Tree add-on. Then I could do a Boolean modifier with my model, and touch up the end points individually by extruding to follow the contours of the model's surface. However, the Boolean modifier fails in this example.  Do I have to code this procedurally with a Python script or is there some other method I should try first? addSMA not drawn on graph when called from function Rounded corners in TikZ trees. No package php-imap available on CentOS 7 I'm running a dedicated server with CentOS 7 64bit, here is the output when trying to install IMAP:    yum install php-imap   Loaded plugins: fastestmirror   Loading mirror speeds from cached hostfile    * base: ftp.ciril.fr    * extras: ftp.ciril.fr    * updates: ftp.ciril.fr   No package php-imap available.   Error: Nothing to do       Also the same when disabling exclusions:    sudo yum install --disableexcludes=all php-imap Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile  * base: ftp.ciril.fr  * extras: ftp.ciril.fr  * updates: ftp.ciril.fr No package php-imap available. Error: Nothing to do