I have a comp sci project:  Prompt the user to enter a word.     If the word is “Neil,” then ask the user to enter a letter. If the letter is a or b, display “Peart.” If it’s another letter, display “Xanadu.” If the word is “Geddy,” then ask the user to enter a number. If the number is odd and divisible by 9, display “Lee.” If the number is negative or equals 2012, display “YYZ.”   I typed the code for this and everything works except one thing. After I write Neil and it asks me to write a letter, if I type a or b it doesn't output Peart it outputs Xanadu.   import java.util.Scanner;  public class Rush  {      public static void main()      {        Scanner myReader = new Scanner (System.in);        System.out.print("Enter a word:" );        String word = myReader.nextLine();         if (word.equals ("Neil"))        {            System.out.print("Enter a letter: ");            String letter = myReader.nextLine();            if  (letter == "A" || letter == "a" || letter == "B" || letter == "b")            {              System.out.println("Peart");                        }            else             {              System.out.println("Xanadu");              }        }        if (word.equals ("Geddy"))        {            System.out.print("Enter a number: ");            int number = myReader.nextInt();            if (number % 2 != 0 &amp;&amp; number % 9 == 0)            {               System.out.println("Lee");             }            if (number &lt; 0 || number == 2012)            {                System.out.println("YYZ");            }        }      }  }
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?
Why don't I hear any sound after calling the Beep function in Windows 7? Given 4 integers, $a, b, c, d > 0$, does $\frac{a}{b} < \frac{c}{d}$ imply $\frac{a}{b} < \frac{a+c}{b+d} < \frac{c}{d}$? Given two date ranges, what is the simplest or most efficient way to determine whether the two date ranges overlap?  As an example, suppose we have ranges denoted by DateTime variables StartDate1 to EndDate1 and StartDate2 to EndDate2. Having line color vary with data index for line graph in matplotlib? Ubuntu does not offers me "install alongside Windows" Let $\mathbb{F}$ be a finite field.  Let $a_1,\dots,a_n \in \mathbb{F}$ be given.  I want to know whether there exists $x_1,\dots,x_n \in \mathbb{F}$ such that  $$a_1 x_1^2 + a_2 x_2^2 + \dots + a_n x_n^2 = 1.$$  My question: Can we characterize when this equation has a solution, i.e., by some criterion on $a_1,\dots,a_n$?  Is there a clean characterization, in terms of $a_1,\dots,a_n$ and the properties of $\mathbb{F}$?    Here's what I can see immediately.  First, if $n=1$, there is an easy answer (the equation has a solution iff $a_1$ is a square in $\mathbb{F}$).  Second, if any $a_i$ is a square in $\mathbb{F}$, the equation has a solution (set all other $x_j$'s to $0$), so we can assume that all the $a_i$'s are non-squares and that $n \ge 2$.  Third, if $-1$ is a square in $\mathbb{F}$, then the equation has a solution: we can take $x_2 =  \sqrt{-a_1/a_2} \cdot x_1$.  But what about the case where $-1$ is a non-square in $\mathbb{F}$?  Is it always guaranteed to have a solution in this case? Accepting an answer should automatically upvote it as well Is there ever a case where you would want to accept an answer, but not upvote it?  I can't think of a single situation where this would be the case.. So would it not make sense to have the "Accept" button upvote the answer too? "like I" or "like me"? In high school we learned to say "than I" and "as I" because you could potentially add an "am" to the end of the sentence.  Examples:  "She is smarter than I."  (Think: "...than I am.") "He is as tall as I."  (Think "...as I am.")  So analogously, shouldn't it be "like I" as well:  "He is sincere, just like I."  (Think: "... like I am.")  But universally, it seems that we use "like me".  Where does this reasoning break down?  Is there history here? Is there any way to import a .json model into Blender? I need to find a way to import some .json models into Blender, and it seems I can't just import them the same way I can import a .obj model. So is there some way to convert a .json model to a .obj model, or another file type Blender can import? I've tried using Blockbench for this, but I think it only works with Minecraft recourse pack .json models, as those are the only models that will ever actually load in it. Thank you to anyone who can help me figure this out. A friend offered me a brain teaser to which the solution involves a $195$ pound man juggling two $3$-pound balls to traverse a bridge having a maximum capacity of only $200$ pounds. He explained that since the man only ever holds one $3$-pound object at a time, the maximum combined weight at any given moment is only $195 + 3=198$ pounds, and the bridge would hold.  I corrected him by explaining that the acts of throwing up and catching the ball temporarily make you 'heavier' (an additional force is exerted by the ball to me and by me onto the bridge due to the change in momentum when throwing up or catching the ball), but admitted that gentle tosses/catches (less acceleration) might offer a situation in which the force on the bridge never reaches the combined weight of the man and both balls.  Can the bridge withstand the man and his balls? Graph editor for shape key animation I have animation where object changes his shape using shape keys, and I want to make some animation smoothing with graph editor. Is there a way to use graph editor for shape key animation? When should I add another answer? I have been member of SO for 4 months. I have a question regarding some functionality. Whenever I give an answer to a question, there is functionality given Add Another Answer. I can comment on my answer at any time and also able to edit answer. Then   Why this functionality given on SO to add another answer?  When should I add another answer?  Why there is requirement of multiple answers? What is limit of adding answers to single question? Difference between "Should" vs "ought to" It's essential that the documents (should)/(ought to) be destroyed immediately.   Which one is more suitable one as I know "ought to" and "should" are synonyms. How do I get an animated gif to work in WPF? X and Y are not correlated, but X is significant predictor of Y in multiple regression. What does it mean? X and Y are not correlated (-.01); however, when I place X in a multiple regression predicting Y, alongside three (A, B, C) other (related) variables, X and two other variables (A, B) are significant predictors of Y. Note that the two other (A, B) variables are significantly correlated with Y outside of the regression.   How should I interpret these findings? X predicts unique variance in Y, but since these are not correlated (Pearson), it is somehow difficult to interpret.  I know of opposite cases (i.e., two variables are correlated but regression is not significant) and those are relatively simpler to understand from a theoretical and statistical perspective. Note that some of the predictors are quite correlated (e.g., .70) but not to the extent that I would expect substantial multicollinearity. Maybe I am mistaken, though.    NOTE: I asked this question previously and it was closed. The rational was that this question is redundant with the question "". Perhaps I do not understand the other question, but I believe these are entirely separate questions, both mathematically and theoretically. My question is entirely independent from if "a regression is significant". Furthermore, several predictors are significant, while the other question entails variables not being significant, so I don't see the overlap. If these questions are redundant for reasons I do not understand, please insert a comment prior to closing this question. Also, I was hoping to message the moderator who closed the other question to avoid identical questions, but I couldn't find an option to do so. I believe I have solved a famous open problem. How do I convince people in the field that I am not a crank? I am very new to LaTeX and I am writing my thesis. In a chapter, I want to show my codes, which are in Mathematica.   I use the listings package as follows:  \documentclass{article}   \usepackage{listings}   \begin{document}   \lstset{language=Mathematica}    \begin{lstlisting}   Do[i^j,{i,1,10},{j,1,10}]   \end{lstlisting}    \end{document}   However, the output is much different to what the code looks like in the Mathematica IDE (even if I use other languages in \lstset{language=&lt;name&gt;}):    I read some questions on the site but, in some of them, the font or color of the codes were not the same. Could you please help me to display something like the picture below in LaTeX?  If it is important, I am using the BiDi package. Can anybody please help me to prove this:  Let $p$ be greater than or equal to $1$. Show that for the space $\ell_p=\{(u_n):\sum_{n=1}^\infty |u_n|^p&lt;\infty\}$ of all $p$-summable sequences (with norm $||u||_p=\sqrt[p]{\sum_{n=1}^\infty |u_n|^p}\ )$, there is an inner product $&lt;\_\,|\,\_&gt; $ s.t. $||u||^2=&lt;u\,|\,u&gt;$ if and only if $p=2$. Outcast boy meets girl underwater Singular to plural noun Many nouns that end in ‑f are made plural by changing the ‑f to ‑v‑ and adding ‑es.  +----------+-----------+ | Singular |   Plural  | +----------+-----------+ |  half    |  halves   | |  leaf    |  leaves   | |  shelf   |  shelves  | +----------+-----------+     But some nouns that end in ‑f are made plural simply by adding ‑s.  +----------+-----------+ | Singular |   Plural  | +----------+-----------+ |  chief   |  chiefs   | |  roof    |  roofs    | |  cliff   |  cliffs   | +----------+-----------+   Some nouns that end in ‑f can be made plural in two ways, either by adding ‑s or ‑ves:   +----------+--------------------+ | Singular |      Plural        | +----------+--------------------+ |  scarf   |  scarfs or scarves | |  hoof    |  hoofs or hooves   | |  dwarf   |  dwarfs or dwarves | |  wharf   |  wharfs or wharves | +----------+--------------------+   Now my question is how to determine whether to use only ‑s or to change the ‑f to ‑v‑ and add ‑es?