public  boolean equals(Object o) {     boolean result = false;     if(o!=null &amp;&amp; o instanceof Person)     {          Person anotherperson = (Person) o;         if(this.getName() == anotherperson.getName() &amp;&amp; this.getCal() == anotherperson.getCal())         {             result = true;           }      }     return result; }  public int hashCode() {     return getName().hashCode() ^ getCal().hashCode(); }   } /////////////////////// what I need to happen is the equal method will compare if the inputed values are identical or not identical, right now it shows not Identical no matter what I change, It seems theres a problem comapring 2 objects in boolean equals.
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?
Baby Rudin Theorem 1.20 (b) Proof I have a question about Rudin's proof of Theorem 1.20 (b) in his book Principles of Mathematical Analysis.  Theorem 1.20 is stated as follows:     (a) If $x\in R, y\in R$, and $x&gt;0$, then there is a positive integer $n$ such that $$nx&gt;y.$$   (b) If $x\in R, y\in R$, and $x&lt;y$, then there exists a $p\in Q$ such that $x&lt;p&lt;y$.     I understand Rudin's proof of (a).  The beginning of Rudin's proof of (b) is given below:     Since $x&lt;y$, we have $y-x&gt;0$, and (a) furnishes a positive integer $n$ such that $$n(y-x)&gt;1.$$  Apply (a) again, to obtain positive integers $m_1$ and $m_2$ such that $m_1&gt;nx$, $m_2&gt;-nx$.  Then $$-m_2&lt;nx&lt;m_1.$$  Hence there is an integer $m$ (with $-m_2\leq m\leq m_1$) such that $$m-1\leq nx&lt;m.$$   I don't understand the justification for this last sentence beginning "Hence...."  How is $m$ found, and why are $m_1$ and $m_2$ needed to find $m$? Changes to parameter not showing on Report Server after deployment Let's consider it case by case:  Case 1: Charged particle is at rest. It has an electric field around it. No problem. That is its property.  Case 2: Charged particle started moving (it's accelerating). We were told that it starts radiating EM radiation. Why? What happened to it? What made it do this?  Follow up question: Suppose a charged particle is placed in uniform electric field. It accelerates because of electric force it experiences. Then work done by the electric field should not be equal to change in its kinetic energy, right? It should be equal to change in K.E + energy it has radiated in the form of EM Waves. But then, why don't we take energy radiated into consideration when solving problems? (I'm tutoring grade 12 students. I never encountered a problem in which energy radiated is considered.) Kernel panic after update to 4.4.0-108-generic htdigest file format Last not empty cell (column) in the given row; Excel VBA How can I randomise the output of a redstone circuit? How do I cherry pick packages from a PPA? Is there a way to cherry pick packages from a ppa repository you add? That is, to exclude some from updating while including others?  For example, I want just the chromium-browser package from  but not the others. So I don't want my sudo apt-get upgrade to have that ppa's other (besides chromium-browser) packages install over my existing ones, just that one.   I realize this is a license to shoot myself in the foot if I misread dependencies and exclude ones that are needed to ones that I included, but I know for a fact in this case that the other packages are not dependencies for that one.  Is this at all possible? Maybe there is some whitelist/blacklist file or something? Using a Sprite image with input I try to solve this problem. I seems to come close to the end but I can't get the conclusion. Can someone help me complete my proof. Thanks          Show that the polynomial $h(x) = (x-1)(x-2)\cdots(x-n) + 1$ is irreducible over $\mathbb Z$ for all $n\ge1$ and $ n\ne4$.      Suppose $h(x) = f(x) g(x)$, then we must have $f(i)g(i) = 1$ for all $i = 1,2,...n$. So both $f(i)$ and $g(i)$ are $1$ or $-1$. In either case, $m(x) = f(x) - g(x)$ has degree smaller than $n$ and have $n$ different roots ($1,2,...,n$). So we must have $m(x) = 0$. Then $h(x) = f(x)^{2}$. So $n$ must be even. Let $n = 2k$. Because $f(x)$ has degree $k$, there are $k$ values from $\{1,2,...,2k\}$ at which $f(x)$ is $1$ and $k$ values at which $f(x)$ is $-1$.  This is where I got stuck. Hope some one can help me solve this. Thanks. Suppose that $f$ is a function defined in $[a;b]$ to $[a;b]$ and continuous on $[a;b]$. The problem is I haven't the definition of the function, this is more abstract, but even if how can I prove that $f$ would have a fixed point? Why didn't Gollum grow old and die after he lost the One Ring to Bilbo? Why isn't my String comparison working in iOS 6? What happens when a field turns on or off? Short Setup  I am curious about the the mechanics of fields, whether , , etc.  So as a specific example in order to simplify (hopefully) how to ask this question, consider  or , specifically interactions between .  My specific curiosity is in how we handle the "sudden" creation or loss of a source and how the source then creates its associated field.  My naive guess is that the loss of a source (e.g., annihilation) might be easier to handle, but let's focus on creation of a source for now.  Questions  The specific example of pair production interested me because I was wondering:   How does the field arise from the sources?   Meaning, is it delayed until after the source  fully "condenses" from the , for instance? Or does the field slowly "turn on" as the source "condenses"?   Perhaps I should have asked whether it we know if it takes time for sources to form (I assume it does).  If so, can we describe this from first principles or is it empirically based?  Am I asking that in a very uncomfortable manner?  If so, I would appreciate any suggestions.  For instance, is there a better word than "condense"?  I was thinking about water condensation as a very loose analogy to the purpose of the Higgs field in the formation of massive objects.  Why can they be produced without immediately recombining?   That is, how "close" are the two sources spatially after formation and what energies are needed to overcome the associated potential?  Does the field emanate/propagate as if from a point source?   I ask because I am trying to determine whether this is a simple  issue (i.e., far away it's just like a point source) or if the field emanates only from the "surface" of the source (e.g., ). If it starts from "within" the source as the source forms, do we know how to handle this mathematically?   My concern arises from the "similar" problem of bubble formation, where the bubble starts with zero radius which would require an infinite energy.  Perhaps the analogy is not appropriate?     Purpose  I ask these questions because it struck me this morning, while driving to work, that I did not know how and when a field "turned on."  I started to think about pair production and then quickly became confused (not difficult to do) and thought many of the quantum whisperers on this site would be much better at explaining these nuances than any of my failed rummaging through Wikipedia or scholarly articles and old text books. You are a pie maker and you are holding a fair to display your pies. You have 1000 pies. You have 10 workers to help you. The fair is in two hours. Unfortunately you discover that a rival pie maker has poisoned one of your pies with a form of norovirus that makes people violently ill one and a half hours after even consuming a tiny bit of it. You know if any single person who visits your fair gets ill, your business will collapse but you need all the non poisoned pies for the fair. You can take small samples from the pies without spoiling them and your workers are prepared to do anything to help you. How do you find the poisoned pie? PUA.Phishing.Bank Found How can I make a dispenser that has unlimited arrows? What is the relationship between Guide Number and flash power level? From this , I understand that the flash guide number (GN) is given by the following formula:  Guide Number = Shooting Distance × f-number ÷ ISO factor   I'm assuming that the GN calculated via the equation above will be based on a flash that is firing at full power. Am I correct to assume that if I set the flash to fire at half power, that the guide number is effectively halved? i.e. the equation will now be:  Guide Number = Shooting Distance × f-number ÷ ISO factor * Power Level   where power level can be the following 1, 1/2, 1/4, 1/8, ... 1/64, etc? Why are the solutions of polynomial equations so unconstrained over the quaternions? Can an observed event in fact be of zero probability? Can an observed event in fact be of zero probability?  Of course, I know that there exist non-empty events of zero probability. Mu question is the reverse: given that we have observed an event (and we have no other information about it, just the fact that it has been observed), is it possible that the event has in fact zero probability? Or does an observation necessarily mean that the probability is strictly positive?    Example context for the question:  Suppose $x_i$ (countably many) are i.i.d on $[0,1]$, but we do not know the distribution they come from. It may be uniform on $[0,1]$, may be discrete, may be any legitimate distribution (discrete or continuous). Just imagine we have some sort of a machine that shows us one by one a list of randomly drawn numbers between $0$ and $1$. We are comparing the observed numbers one by one to some special number chosen beforehand, for example $\frac12$. Now, given that at some iteration we have observed that special number at least once, does that mean that $\frac12$ has some positive probability under that (unknown) distribution? And if the probability can be zero, can we nevertheless say that we will necessarily observe $\frac12$ again later, if we continue the experiment ad infimum?  Also, disregard the "real world limitations" such as an inability to produce truly uniformly distibuted numbers, or rounding errors or any such thing.