I have a class that places a text into an arrayList. Then it makes all the variables into CharSequences, when I try to compare the variables to a String such as == "test"; it doesn't work here is my code that I use to get the variables  class Item {             String descs;              public Item (String descs){                   this.descs = descs;                   }               public CharSequence getDescs() {                 return descs;             }         }   This is the code that compares it to the String   if(p.getDescs().toString() == "trash"){            descsView.setVisibility(View.GONE);                              }            else{               descsView.setText(p.getDescs());                              }   I know for a fact that p.getDescs() is equal to trash because when it sets the text for descsView it is set to trash. SO why doesn't the first if statement work?
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?
Suppose we have $n$ covariates $x_1, \dots, x_n$ and a binary outcome variable $y$. Some of these covariates are categorical with multiple levels. Others are continuous. How would you choose the "best" model? In other words, how do you choose which covariates to include in the model?  Would you model $y$ with each of the covariates individually using simple logistic regression and choose the ones with a significant association? How to make traditional output for derivatives Why is the unit for capacitance so large? Do we know how Senju Hashirama died? Sum of Infinite Series $1 + 1/2 + 1/4 + 1/16 + \cdots$ Everyone knows about the classic  $$ \sum_{i=1}^{\infty} \dfrac{1}{2^i} = 1 $$ However, is there any way to find $$ \sum_{i=0}^{\infty} \dfrac{1}{2^{2^i}} = \dfrac12 + \dfrac14 + \dfrac{1}{16} + \dfrac{1}{256} + \cdots $$ Sometimes it's hard to search for older versions of macOS &amp; OS X  on the App Store.  This is an attempt to provide the canonical QA for this issue, as per the Meta QA -  I expect it to be modified over time to hopefully become a complete information resource.  How can I get any older version of a Mac OS to be able to run as a VM, or to reinstall on my Mac? echo "-e" doesn't print anything I'm using GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu). And this command:  echo "-e"    doesn't print anything. I guess this is because "-e" is one of a valid options of echo command because echo "-n" and echo "-E" (the other two options) also produce empty strings.  The question is how to escape the sequence "-e" for echo to get the natural output ("-e"). Why does the order of summation of the terms of an infinite series influence its value? I was looking through my lecture notes and got puzzled by the following fact: if we want to find the value of some infinite series we are allowed to rearrange only the finite number of its terms. To visualize this consider the alternating harmonic series: $$\sum_{n=1}^\infty(-1)^{k-1}\frac1k=1-\frac12+\frac13-\frac14+\frac15-+\dots=0.693147...$$  But if we rearrange the terms as follows the value of the series gets influenced by this action: $$1+\frac13-\frac12+\frac15+\frac17-\frac14+\dots=1.03972...$$  So commutativity of addition isn't true on infinity? How was it obtained and how can it be proved? Cann I use a 19.5V 4.62A laptop charger for 19V 4.74A laptop? Negative values for AICc (corrected Akaike Information Criterion) I have calculated AIC and AICc to compare two general linear mixed models; The AICs are positive with model 1 having a lower AIC than model 2.  However, the values for AICc are both negative (model 1 is still &lt; model 2).  Is it valid to use and compare negative AICc values? I have to figure out a way to count how many sequences are there s.t:   My alphabet is $1$ up to $49$. Each number that is chosen, is chosen only once. The sequence is $6$ digits long. The sequence is in increasing order.  e.g that is a valid sequence: $(1, 2, 40, 42, 43, 49)$  and this is not: $(1, 2, 40, 25, 25, 12)$   I know that for the first 3 rules the answer is: $\binom{49}{6}\cdot 6!$  How do I deal with the fourth? "Put me in touch with whomever created it"? He created it.  Put me in touch with him.   So which is correct and why:   Put me in touch with whomever created it. Put me in touch with whoever created it. Is it coherent to extend $\mathbb{R}$ with a reciprocal of $0$? I'm sure this is an obvious question, but I'm having trouble finding the right words to type into Google.  I know that the definition of a ring allows that the additive identity not have a multiplicative inverse, but is this a requirement?  Specifically, is something like $\mathbb{R}\!\left[\frac{1}{0}\right]$ such that $\frac{1}{0} \cdot 0 = 1$ a ring, or does some contradiction arise from allowing the additive identity to have a multiplicative inverse? How to prove that total number of non-isomorphic labelled trees of order $n$ is $n^{n-2}$? I predicted the formula by finding total number of non-isomorphic labelled trees of order 1 is 1 , order 2 is 1,order 3 is 3,order 4 is 16,order 5 is 125.But how do i prove it ? I am beginner in graph theory so i will be very thankful if i get some simple approach to solve the problem(Not by using some difficult theorems). Why is my Mac constantly trying to connect to another server? After logging on, I see this dialog box pop up. Whenever I dismiss it, it reappears 30 seconds later. (Stealing focus at the same time! Grrrr!)    "Slate" is my old iMac, which is sitting on the desk next to me, turned off. How can I stop my new Mac from constantly trying to connect to my old one? Both are running 10.7.1. Prove that $|f''(\xi)|\geqslant\frac{4|f(a)-f(b)|}{(b-a)^2}$ Let ${\rm f}:\left[a, b\right]\to\mathbb{R}$ be twice differentiable, and suppose   $$\lim_{x\to a^{+}} \frac{{\rm f}\left(x\right) - {\rm f}\left(a\right)}{x - a} = \lim_{x\to b^{-}}\frac{{\rm f}\left(x\right) - {\rm f}\left(b\right)}{x - b} =0 $$  Show that there exists $\xi \in \left(a, b\right)$ such that $\displaystyle{% \left\vert\vphantom{\Large A}\,{\rm f}''\left(\xi\right)\right\vert \geq \frac{4\left\vert\vphantom{\Large A}% \,{\rm f}\left(a\right) - {\rm f}\left(b\right)\right\vert} {\left(b - a\right)^{2}}}$.  I don't know how to start. Any hints ?. Details on how the Yearling badge works Jawa asked me this  and I didn't know the answer. So I present it to the meta SO community:     [To get the Yearling badge] Do you need to earn the 200 rep within that one year or is it enough to get 200 at some point after being a member for a year? And does 'a year' mean the very first 12 months or the last (sliding window of) 12 months?    I would assume that if you hit 200 reputation after you've already been around for a year, then you would get the Yearling badge. But I don't know. Why use a dedicated light meter instead of the one built into the camera? Is "I am sat" bad English? I believe it is incorrect and instead either the present continuous     I am sitting   or the predicate adjective     I am seated   should be used.  I hear this quite often, however, and ultimately usage overrules formality.  Does anybody know where this originated or how to describe it grammatically? Navigation page buttons are orange everywhere On a similar note to this question:  (which only covers two examples only on the profile page, this question mentions more places on and outside the profile page where this bug occurs).  I've noticed that whenever there are these page buttons now, for example, the profile page, /questions and tag pages they are orange.  Per the other post I'm assuming this is a bug but if it was intentional then this is a feature request to make them theme-able per site again.