I am writing a program that asks the user to input his name, address and phone number. When the data is entered the program shall print the data and ask the user to verify the data by entering YES or NO. This process shall be repeated until the user is satisfied and answers YES to the question.  Now in my case I may have put a if-else statement inside the while loop in an inappropriate way. That's why it's not working as it is expected to be. How can I solve this?  Also I only have tried the promt asking to enter the users name. But if I want to add more prompt with different question in the similiar way then how could I do that?  Code:  package userinfo;     import java.util.Scanner;  public class UserInfo {      public static void main(String[] args) {             String name;         String yes = "YES";         String no = "NO";             Scanner userInput = new Scanner(System.in);          System.out.println("Enter your name:");         name = userInput.next();         System.out.println("Please varify your name by typing YES or NO");          while (true) {             String input = userInput.next();             if (input == yes) {                 System.out.println("Your name is: " + name);             }             if (input == no) {                 System.out.println("Enter your name again");              } else {                 System.out.println("Invalid input! Enter value again:");                 break;             }             }         }     }
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?
On webmail every user gets error "ERROR: Message not sent. Server replied: 354" while sending mails.   But mails are sent properly and reaches properly.  Can you tell me where is problem, and why it is occurred?  UPDATE: I found in some resources that this is not an error but standard information message. On the other side, it's annoying. Can you tell me if it is a true, and if it is how can I avoid it? What are the meaning and possible origin of "word!" and "word up"? Several times, I have had conversations, all over instant messenger, finish with "word" or "Word up G".  As it ends a conversation, I am guessing it is like "goodbye".  My question is what is the meaning of "word" and "word up g"? Also, what is the origin?  I am more interested in the meaning as that will help with understanding its usage. Let $A \times \emptyset = \{(x,y)| x\in A, y \in \emptyset \}$. We know there is no element in $\emptyset$. But how does it follow that $A \times \emptyset = \emptyset $? I have a question about the pattern "turn &lt;something&gt; on &lt;somebody&gt;" :     Then he allegedly turned the body-building equipment on his 44 year-old wife, identified by sources as Feng Liang, and his elderly mother-in-law, Feng Kun Zaehng,77, the sources said.     I understand the phrase "*turn the gun on &lt;somebody&gt;", am not sure about "turn the equipment on &lt;somebody&gt;".  Could the example be wrong? The Order of Modification in English Nouns, Preceding or Succeeding? As I don't know the exact linguistic terms, what I mean my "preceding" and "succeeding" in modifying nouns is as follows.  Preceding : delicious food, long way, kind person, et cetera Succeeding : faculty of science, land of despair, a book that changed my mind, et cetera  English seems to accept both ways of modification.  Sometimes, either way will not make a difference. department of science == science department a burning book == a book burning  At other times, changing the order will still make sense but be somewhat awkward or bizarre. Kentucky Fried Chicken ?= Chicken Fried in Kentucky free as in free speech ?= as-in-free-speech free  When writing English, I tend to use more the preceding modification style because my native language Korean is quite strictly precedingly modifying. "빠른 판단을 바탕으로 한 재치있는 응수" directly translates to "a quick-decision-based clever response" rather than "a clever response based on a quick decision"  French as well as other Latin-originated languages seems to be succeedingly modifying. Académie Française, Poulet Frit du Kentucky  while German and Dutch more often use preceding modification.  Well, this mixture in English allows rich style with various ways of expression, but it does often make a non-native English speaker be a little confused. Is there any subtle but general difference between these 2 ways? Or is it just simply case-by-case. Any guidance will help. How to find the joint PDF? Why is the result of a raster calculation integer when it should be decimal? I'm trying to calculate the NDVI using raster calculator, but the result is integer instead of decimal.  NDVI = (NIR - RED)/(NIR + RED)   The result is normally in the range -1 to 1, but when i tried to calculate de result is -1, 0 and 1, and it does not have have any number in between like, -0.9 or 0.1. And i need those values so i can classify the result in term of soil occupation I'd like to provide template implementation in my module and allow themes to override it. Basically, I add a suggestion by this simplified code:  function attach_preprocess_node(&amp;$vars) {   $vars['theme_hook_suggestions'][] = 'node__test'; }   (I don't want to use hook_theme to add a new theme because I want to reuse preprocess node functions. The theme name are awkward but I don't want to write node_attach_% to avoid confusion with node type.)  Then I use hook_theme_registry_alter() to add module path:  function attach_theme_registry_alter(&amp;$theme_registry) {   $path = drupal_get_path('module', 'attach') . '/themes';   $theme_registry_copy = $theme_registry;   _theme_process_registry($theme_registry_copy, 'phptemplate', 'theme_engine', 'node', drupal_get_path('module', 'node'));   $theme_registry += array_diff_key($theme_registry_copy, $theme_registry);   if (!isset($theme_registry['node']['theme paths'])) {     $theme_registry['node']['theme paths'] = array();   }   if (!isset($theme_registry['node']['theme paths'])) {     $first_element = array_shift($theme_registry['node']['theme paths']);     if ($first_element) {       array_unshift($theme_registry['node']['theme paths'], $first_element, $path);     }     else {       array_unshift($theme_registry['node']['theme paths'], $path);     }   } }   However it does not work. That means: the file themes/node--super.tpl.php is not used. It is used only if I copied it to the theme folder. Lightning:input type="date": how to change the date fomat - Summer'18 How to safely change OS name in grub boot menu? I have a system where I am dual-booting Ubuntu GNOME 15.10 and Ubuntu GNOME 16.04, however after installing Ubuntu GNOME 16.04, I have found that in the GRUB boot entry list it is called "Ubuntu", whereas the other one is called something like "Ubuntu GNOME 15.10", is there any way I can change the text of the "Ubuntu" one to "Ubuntu GNOME 16.04"? And also change the names of the other options so that instead of "Advanced options for Ubuntu" it says "Advanced options for Ubuntu GNOME 16.04" etc?  I rather do it manually if it is safe to do so, or a piece of software could be recommended, however nothing from a PPA or other untrusted not official source (I will only install software from the Ubuntu official repositories). Linearization of PDE: $0$ is an eigenvalue since all translates of travelling waves are also travelling waves Consider the following PDE: $$ u_t=u_{xx}+f(u)-w,~~~~~w_t=\varepsilon (u-\gamma w),~~~~~~~~~(1) $$ where $f(u)=u(u-a)(1-u), 0&lt;a&lt;\frac{1}{2}, \varepsilon,\gamma &gt;0, \varepsilon\ll 1,\gamma\ll 1$.  A travelling wave for (1) is a solution that is a function of the single variable $\xi=x-ct$, i.e., $(u(\xi),w(\xi))$ satisfies $$ -cu'=u''+f(u)-w,~~~~~~-cw'=\varepsilon (u-\gamma w)~~~~~~~('=d/d\xi).~~~~~~(2) $$  If (1) is recast in a moving coordinate frame, i.e., in terms of variables $\xi=x-ct$ and $t$, it becomes $$ u_t=u_{\xi\xi}+cu_{\xi}+f(u)-w,~~~~~~w_t=cw_{\xi}+\varepsilon (u-\gamma w).~~~~~~~~(3) $$  One can see by (2), that a travelling wave is an equilibrium solution of (3). So one nearby question is to ask whether a travelling wave is stable.    For a fixed $\varepsilon$, let $U_{\varepsilon}(\xi)=(u_{\varepsilon}(\xi),w_{\varepsilon}(\xi))$ be a travelling wave for (1), i.e., an equilibrium solution for (3).          A standard technique for determining stability of $U_{\varepsilon}(\xi)$ is to linearize: If the right-hand side of (3) is linearized along $U_{\varepsilon}(\xi)$, the resulting operator is     $$ L\begin{pmatrix}p\\r\end{pmatrix}=\begin{pmatrix}p_{\xi\xi}+cp_{\xi}+f'(u_{\varepsilon})p-r\\cr_{\xi}+\varepsilon (p-\gamma r)\end{pmatrix}, $$     where $\begin{pmatrix}p\\r\end{pmatrix}(\xi)\in\text{BC}(\mathbb{R},\mathbb{R}^2):=\left\{u\colon\mathbb{R}\to\mathbb{R}^2 | u\text{ is bounded and uniformly continuous}\right\}$.      (The linearized criterion for stability of the travelling wave is that the spectrum of $L$ (except for $0$) lies in a left half-plane and $0$ is a simple eigenvalue.)  Thats the background.  Now, there is a statement that I could not understand yet.          Note, that $0$ must be in the spectrum because the translate of a travelling wave is another travelling wave.      I know that a translate of a travelling wave is again a travelling wave. But why does this imply that $0$ is in the spectrum of $L$?  Edit  After some looks at definitions, I have an idea:  Consider a solution $U(\xi,t)$ that is a translate of the travelling wave $U_{\varepsilon}(\xi)=(u_{\varepsilon}(\xi),w_{\varepsilon}(\xi))$, i.e.  $$ U(\xi,t)=U_{\varepsilon}(\xi-k)=(u_{\varepsilon}(\xi-k),w_{\varepsilon}(\xi -k)) $$ for some $k$. Then $U$ is an equilibrium solution of (3), too.  If I am not totally wrong, then we have  $$ p=u_{\varepsilon}(\xi-k)-u_{\varepsilon}(\xi),~~~~r=w_{\varepsilon}(\xi-k)-w_{\varepsilon}(\xi) $$ and  $$ p_t=0,~~~w_t=0, $$ because travelling waves are equilibria for (3) and a translate of a travelling wave is a travelling wave.  Hence $$ L\begin{pmatrix}p\\r\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}, $$ meaning that $$ \text{ker}(L-0\text{ id })\neq\left\{\begin{pmatrix}0\\0\end{pmatrix}\right\}, $$ because for each translate of the travelling wave, $p,r\neq 0$ and  $\begin{pmatrix}p\\r\end{pmatrix}\in\text{ker}(L-0\text{ id})$.  Hence $0$ is in the spectrum (point spectrum) of $L$.  Is this what was meant? Flash/SWF Editor For Ubuntu 12.10 I just learned that some Lenovo laptops include a utility that offers to limit battery charging capacity to within 0–80% in order to slow the attenuation of the battery lifespan:    How can I do this in Ubuntu? Sometimes, when I upgrade a system via do-release-upgrade, the update process fails and the script tells me to finish the process manually via dpkg --configure -a. This is a not serious problem - after manually solving the dependencies problem and the finishing upgrade process all works well.  But the do-release-upgrade script has a cleanup process after finishing the upgrade:  Remove obsolete packages?   XXX packages are going to be removed.   Continue [yN]  Details [d]y   which removes some obsolete packages from old version of system.  Seems that this process doesn't execute when the automatic upgrade fails and I finish upgrade manually, so obsolete packages from old version remain installed in the system.  How I can run the "Remove obsolete packages" process manually after finishing the upgrade by hand? MiKTeX graphics version 1.3b bug on Windows 10 (\set@curr@file undefined) What is the probability that $x_1+x_2+...+x_n \le n$? Given that $X_1, X_2...$ are mutually independent random variables. For each $i$ with $1\le i \le n$   the variable $X_i$ is equal to either $0$ or $n+1$ $E(X_i)$ = $1$   also.. if $X_i$ is equal to either $0$ or $n+1$, doesn't that mean that all $X_i$ need to be $0$?  Thanks Are more megapixels good?  Are more megapixels bad?  Do more megapixels increase detail? Do they make my images sharper? On the other side, is there a point that is too much? Do megapixels cause increased noise and other problems? How does print and viewing size come into it?  Widespread Internet-forum wisdom used to be that 6 megapixels was the sweet spot — below that just wasn't enough, but above that, there wasn't much benefit. File sizes got larger, but detail was lost to noise and other problems. The arguments are that cramming too many pixels into a small sensor makes each pixel too small to provide any real benefit, and that higher-megapixel sensors outresolve cheap lenses anyway. (Substitute something like 12 instead of 6 if we're discussing APS-C DSLRs, or 24 for full-frame.)  By 2011,  was in the range of 12-18 megapixels. In 2016 most were are in the 16-24 megapixel range. Certainly none are at 6 anymore; even smartphones come with 8 megapixel cameras. Does this offer any real improvement over that old "sweet spot"? Has technology improved to the point where the "wisdom" needs to be updated, or are we all suffering for marketing? Or have we gone past the sweet spot in some ways, but it's okay because of previously-un-argued points. (For example: more noise, sure, but more detail as well.)  Within the 16-24 megapixel common-today range, for the same sensor size, is there any actual benefit to the higher end? How do megapixels directly affect image quality with today's technology? What are the benefits and when do they apply? What are the drawbacks, and when do they apply? How should I adjust my technique (and expectations) based on my camera's megapixel count? Why an abstract class implementing an interface can miss the declaration/implementation of one of the interface's methods? A curious thing happens in Java when you use an abstract class to implement an interface: some of the interface's methods can be completely missing (i.e. neither an abstract declaration or an actual implementation is present), but the compiler does not complain.  For example, given the interface:  public interface IAnything {   void m1();   void m2();   void m3(); }   the following abstract class gets merrily compiled without a warning or an error:  public abstract class AbstractThing implements IAnything {   public void m1() {}   public void m3() {} }   Can you explain why? Why must I wait two days before accepting my own answer? I got this message today while trying to accept my answer on my own question.  Why must I wait this time, if I am sure that the answer I answered is the right one, just want to understand the point of view?  I faced that just today on Super user and didn't get this message before. $\mathbb Q[x]/(x^2+1)$ is not isomorphic to $\mathbb Q[x]/(x^2+2)$