I am using Eclipse to run the following code.   I am trying to compare what I'm entering in the TextView to what I have in my string array. I even went as far as to set the TextViews text and the string arrays value that I'm comparing to the same thing before the if statement runs. I feel as though I'm missing something simple here so maybe someone could point me in the right direction. Here is some sample code:  public class StartActivity extends Activity {  String[] keyWord = {"cow", "hour", "trial", "active", "purpose", "cat", "route", "laser", "fresh", "success" };  Random randWord = new Random(); int secretWord = randWord.nextInt(10);   This is where I am comparing the values  public void SubmitClick(View v){     TextView TV = (TextView)findViewById(R.id.txtAnswer);     keyWord[secretWord] = "the";     TV.setText("the");     if(keyWord[secretWord] == TV.getText().toString()){      Toast.makeText(getApplicationContext(), "Correct guess!",                Toast.LENGTH_LONG).show();     } }   When I select the submit button on my device the code never runs. I tried adding an else in there which is what I wan't and it always comes back as not equal so I have no idea what I'm missing here.  Thanks
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?
Where can I find some guidance on index strategies? I read that it makes a difference whether you calculate $\frac{dE(\lambda) }{d \lambda}=0$ or $\frac{dE(\omega)}{d \omega}=0$ in the sense that the maximum energy density with respect to the wavelength does not coincide with the frequency maximum that one would assume to be at $\omega_{max} = \frac{c}{\lambda_{max}}$. Actually, I do not understand why this is so ( Now, I am only interested in a pure physical explanation, mathematically this is clear and due to the chain rule). Does anybody know how to explain this odd thing?  Somehow I feel that the core of the question has not been completely answered. Although I can easily look up wikipedia, where the need for the chain rule is explained, I am rather interested in understanding where the following argument breaks down, which seems to be why this question has caused some confusion in the past(as you can see by googling this question):  So we have $E(\omega)$ the energy radiated at a given frequency. Now this function has a maximum somewhere, so there is a frequency where a maximal amount of energy is emitted. In other words: If you add the sum of the photon's energies at each frequency that are emitted, you will notice that the maximum is reached at this frquency. Now $E(\lambda)$ tells you basically the same for the wavelength, but again: We know where at which frequency the maximal amount of energy is radiated, so we know the corresponding wavelength.   I think there is a need to explain this.   If anything is unclear, please let me know. How long do seasons last? In the Kittens Game, how long (in real life minutes) do seasons last? Can I send in for repair a lens that has a shattered front element?     UPDATE: The front element was not shattered, it was the UV filter. Factory diagnosis: Lens assembly had been impacted; cleaned and checked.  Helpful notes by Crowley, David Richerby (x2), Michael Clark (x2), and   mattdm (on element price vs UV filter).      Canon cleaned and checked my lens back to like new quality for $179 labor, no parts, not including shipping.      Jim Garrison answered my question, but Crazy Dino has the best info all around for a lens element shatter.   Original Question:  I recently opened my camera bag to find a shattered front element on a Canon EF 16-35mm f/2.8 L II USM lens.   There are a lot of micro glass shards on the second element.  Does anyone have experience with this sort of thing?  Some of the following are questions I have:   Can I get it repaired? What will the cost be roughly? Will the lens ever work the same and have a good image quality? Should I ship it as is, or attempt cleaning it with air? Where is the best place to cry a little?   Thanks, any good info on this would be appreciated.  I will never rest a lens on another lens, I nearly lost a 24-70mm L that shattered a UV filter also.   Good reason to have a UV always, never thought it could happen to me.  Update: Looking at it more it looks like maybe just the front ring came undone and the UV filter broke?  I can't remember what it looked like exactly before.  I threw away the glass shards (polished sand) in the Nevada desert.      UPDATE: Primary reason for thinking more than just the UV was broken,   UV filter split into two rings, depositing the locking collar into the   lens barrel. Holmby Hall is a landmark site in Los Angeles. The Wikipedia page doesn't use "the" before Holmby Hall, but has used the before The Fox Theatre. Question  The test scores of three groups of people are saved as separate vectors in R.  set.seed(1) group1 &lt;- rnorm(100, mean = 75, sd = 10) group2 &lt;- rnorm(100, mean = 85, sd = 10) group3 &lt;- rnorm(100, mean = 95, sd = 10)   I want to know if there is a significant difference in the medians between these groups. I know that I could test group 1 versus group 2 using the Wilcoxon test, like so.  wilcox.test(group1, group2)   However, this compares only two groups at a time, and I would like to compare all three simultaneously. I would like a statistical test that yields a p value at the 0.05 significance level. Could someone please help?  Edit #1 - Mood's median test  Following user Hibernating's suggested answer, I tried Mood's median test.  median.test &lt;- function(x, y){     z &lt;- c(x, y)     g &lt;- rep(1:2, c(length(x), length(y)))     m &lt;- median(z)     fisher.test(z &lt; m, g)$p.value }  median.test(group1, group2)   However, this approach allows me to test for a significant difference between the medians of only two groups at a time. I am not sure of how to use it to compare the medians of all three simultaneously.  Edit #2 - Kruskal-Wallis test  User dmartin's suggested answer appears to be more or less what I need, and allows me to test all three groups simultaneously.  kruskal.test(list(group1, group2, group3))   Edit #3  User Greg Snow helpfully notes in his answer that the Kruskal-Wallis test is appropriate as long as it makes strict assumptions that make it also a test of means. What are the limits on how I can cast, change, and retract votes? What limits are there on how I can vote?  How often can I vote? How do my votes become locked/unlocked? Is it possible to set keyboard shortcuts on a webpage? How to disable a USB port in Windows (XP) and make it available only for charging? With biblatex, the author can be replaced by a dash (or “idem”) in the bibliography. Is it possible to have this replacement also if there are multiple authors, and the first of these multiple authors is the same as the author of the book listed before? (It is somewhat difficult to describe, see the attached example instead, where “Buchautor, Hans-Wilhelm” should be replaced in book3 as well.)   I assume that it should be possible by customising \DeclareNameFormat, but I don’t know how.  Minimal example:  \documentclass{scrartcl} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage[english]{babel} \usepackage{csquotes} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @BOOK{book1,   author = {Buchautor, Hans-Wilhelm},   title = {Irgendein Buch},   location = {Buch am Wald},   date = {2000} } @BOOK{book2,   author = {Buchautor, Hans-Wilhelm},   title = {Ein anderes Buch},   location = {Berlin},   date = {2001} } @BOOK{book3,   author = {Buchautor, Hans-Wilhelm and Zweitautor, Zoran},   title = {Noch ein Buch},   location = {London and New York},   date = {2010} } \end{filecontents}  \usepackage[ style=authortitle, backend=bibtex8 ]{biblatex} \bibliography{\jobname}  \renewcommand*{\bibnamedash}{%   \bibstring[\mkbibbold]{idem\thefield{gender}}}  \begin{document} \nocite{*}  \printbibliography \end{document}   Edit 15/02/2011 17:14   I should have added that there was a feature request for biber which pointed back to biblatex. See .  Edit 21/06/2011 9:26  Is this somehow possible now with biblatex 1.4/1.5? I played a bit with uniquename/uniquelist, but I could not get it to work. Why do circuits work so fast? Drift velocity (explained to me as how fast the electrons are moving) is really slow. My book says the electrons move at around 10 mm/ s.  If electrons move so slowly how do circuits work so fast? If you make a basic circuit with just a light bulb, the bulb lights up almost immediately after you connect the wire to the positive terminal. Is globbing a feature of the shell? StructureMap error when invalid controller I am using Structure map like the MVC storefront by Rob Conery does and I have an AdminController and so to get to it I just type:  website/Admin/action   however if I miss spell the controller name I get the error below:  Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: key  There error occurs on this line:  Controller controller = ObjectFactory.GetInstance(controllerType) as Controller;   Does anyone have any ideas on how I can handle this error or not allow it to happen at all and maybe just goto a 404 page??  Cheers in advance I know that the gravitational interaction of antimatter is expected to be the same as normal matter.  But my question is, has it ever been experimentally validated?  I think it would not be a trivial experiment, because electromagnetic effects have to be eliminated, so neutral particles would be needed. Maybe diamagnetically trapped antihidrogen atoms could be examined as to which direction they fall? What is the default root password? I installed  (Precise Pangolin), 64 bit. Nowhere was I asked to set password for root.  I just installed  software. It was installed under the /root folder by default. Now I try do something on that folder. I tried with su to switch to root, but I don't know its password.   Should I always use sudo or get the default root password, if any?  How do I create a  for software installed inside the /root directory? Add existing ssh key for git Terminal not opening up after upgrading python to 3.7 I have upgraded python to version 3.7 and now my terminal is not opening up.  I followed this post   Commands I ran are as follows,  sudo apt-get install python3.7 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 sudo update-alternatives --config python3   Entered 2 for python3.7  I can't open terminal and run commands.  My ubuntu version is, Ubuntu 18.04.2 LTS Why does switching to the tty give me a blank screen? After booting to the GUI in 12.04, I attempt to move to the virtual terminal (or shell, or tty) via Ctrl-Alt-F1 (F1 through F6), and the screen remains blank. I have tried all 6 tty instances and the results are the same. Ctrl-alt-F7 brings me back to the GUI without a problem. Any thoughts? How to create a hole in a polygon in QGIS? I'm trying to use the tool "delete ring" in order to create a hole in a polygon. The geometry of the hole is another feature of the same shapefile   I cannot manage to delete the part of the polygone. Does someone have a tutorial or some explanation? Looking for a short story about a robot evolving to have supernatural powers