Below is my code, goal is to read instructions from a txt file to make java robot preform them. When changing any part of the if statement to != the robot portion works, therefore I have to think that the strings are in some way not equal.  public void interpretGoo() throws AWTException, FileNotFoundException,  InterruptedException{     Scanner scanner = new Scanner( new File("instruct.txt") );     String in;     String instruct = "";     while(scanner.hasNextLine()== true){         in = scanner.nextLine();         instruct+= in;     }     scanner.close();      String[] instructSet= instruct.split("-");     System.out.println("String: " + instruct);      String[] command= new String[10];     for(int i= 0; i&lt; instructSet.length;i++){         command= instructSet[i].split(" ");         System.out.println("Set: " + instructSet[i]);         System.out.println("Word: " + command[0]);         if(command[0].trim()== "key"){             keyboardHandler(command[1].charAt(1));             Thread.sleep(150);         }else if(command[0].trim()== "clickL"){             accuMouse(Integer.parseInt(command[1]),Integer.parseInt(command[2]), 1, false);         }else if(command[0].trim()== "clickR"){             accuMouse(Integer.parseInt(command[1]),Integer.parseInt(command[2]), 0, true);         }else{             System.out.println("FAIL");             continue;         }     } }   OUTPUT:  String: clickL 728 1062-clickL 540 382-key h-key e-key l-key l-key o- Set: clickL 728 1062 Word: clickL FAIL Set: clickL 540 382 Word: clickL FAIL Set: key h Word: key FAIL Set: key e Word: key FAIL Set: key l Word: key FAIL Set: key l Word: key FAIL Set: key o Word: key FAIL   According to the output the strings are identical but fail the checks, any help would be appreciated!
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?
How do I create my own URL protocol? (e.g. so://...) I have seen:   http://www... ftp://blah.blah... file://blah.blah... unreal://blah.blah... mailto://blah.blah...   What is that first section where you see http and the like called?  Can I register my own? Show that the set $\mathbb{Q}[\sqrt{2}] = \{a + b \sqrt{2} \mid a, b \in \mathbb{Q}\}$ is a field with the usual multiplication and addition. Prove that functions map countable sets to countable sets One of my homework problems asks to prove that if $f:X\to Y$ is a function and $A$ is a countable subset of $X$, then $f(A)$ is countable.  I believe I have a valid proof by partitioning the set A into equivalency classes based in image under $f$. Then using that partition as domain for a choice function $C_f$ back to $A$. So now the function $f$ restricted to the domain (range $C_f$) $f|_{range(C_f)}$ maps to $f(A)$ 1-1 and onto. Therefore  $$|f(A)|=|range(C_f)|\leq |A|=\aleph_0$$ $\therefore f(A)$ is a countable set. $\quad \blacksquare$  My problem is that I used the axiom of countable choice $AC_\omega$ in my proof but that isn't a part of the course I am taking. Does anyone have a simpler proof or one that does not involve Choice? Url rewriting in Amazon S3 I have a webapp hosted in Amazon S3, the webapp is build with jQuery Mobile and I use changePage lo navigate between pages, I'm not using the hash operator(#) when I change the page.  I'm having problems when the user copy the url and paste it in a new tab  For example:    loads the page page1.html that is in amazon s3 with only the jquery page structure...  The behavior that I want is that load index.html and with js read the url, detect the page and load the correct page.  With Apache I solve this with URL Rewriting... but for Amazon S3 I didn't find any similar...  NOTE: I know that if I activate the hash operator (#) in my urls the problem is solved but I need clean urls without #. How can I install more recent versions of software than what Debian provides? What does the typical workflow of a journal look like? What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question. induction with 2 recursive sequnces I'm having trouble solving this problem. I have relation for two sequences of natural numbers.   $$a(n)+\sqrt3\cdot b(n)=\left(1+\sqrt3\right)^n$$  and I have to prove that recursions:  $$\begin{align*} &amp;a(n+1)=a(n)+3b(n)\\ &amp;b(n+1)=a(n)+b(n) \end{align*}$$  will satisfy relation mentioned above. I tried solve it using induction but I failed. Can anybody help with some other ideas? When is $A- B = B- A$? Hello I am taking a Discrete Mathematics course and having some trouble with this question about sets:  Under what conditions is $A- B = B- A$  Diagram:   Diagram:   Maybe I'm understanding incorrectly, but how can A-B and B-A be equal if they contain elements that are not in each other? How can I convert a string to boolean in JavaScript? Application always show in the third position in Ubuntu 16.04 After I update my ubutu to 16.04, I got a problem with Unity launcher. Whenever I open an application which is not listed in launcher, it will take the third position instead of last position. Has anyone the same problem? Just like if we have any quadratic equation which has complex roots, then we are not able to factorize it easily. So we apply quadratic formula and get the roots.  Similarly if we have a cubic equation which has two complex roots (which we know conjugate of each other) and one fractional root, then we are not able to find its first root by hit &amp; trial.  So my question is like quadratic formula, is there exist any thing like cubic formula which help in solving cubic equations?  For example, I have an equation $$2x^3+9x^2+9x-7=0\tag{1}$$ and I have to find its solution which I am not able to find because it has no integral solution. Its solutions are $\dfrac {1}{2}$, $\dfrac{-5\pm \sqrt{3}i}{2} $, I know these solutions because this equation is generated by myself.  So how can I solve equations like these?  Also while typing this question, I thought about the derivation of quadratic formula, which is derived by completing the square method.  So I tried to apply ‘completing the cube’ method on the general equation $ax^3+bx^2+cx+d=0$ but it didn't help.  So please help me in finding a cubic formula or to solve the equations like given in example by an alternative method. How can I access the "Open command window here" option in Windows without holding shift? Every time I try update (using sudo apt-get update) my Ubuntu I get this problem:  W: The repository 'cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu xenial Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch cdrom://Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)/dists/xenial/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found E: Failed to fetch ppa.launchpad.net/kirillshkrogalev/ffmpeg-next/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.   How can I fix it? I use Ubuntu 16.04 LTS Redirect the output using `sudo` I have a small question regarding using sudo with output redirect &gt;. To enable IP forwrding, someone can use the command:  echo 1 &gt; /proc/sys/net/ipv4/ip_forward   Executing this command will give permission denied as it requires root privileges. However, executing the same command with sudo gives also permission denied error! It seems that output redirect &gt; does not inherit the permissions of the preceding command echo. Is this right?  As a workaround I do:  echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward   Is this the best way to do it? Am I missing something?  Please, note that this is an example and it applies to all commands that use output redirect. Is it time for Stack Exchange, Inc and the community to legally separate amicably? There's no need to  the  that have led to a lack of trust between  of  and . Suffice it to say that astoundingly they continue to assert that  and, instead of apologizing and reinstating Monica have demanded that she go through a process with no transparency, due process, or involvement from the community.   Has the time has come for Stack Exchange, Inc to spin off the community and all the data needed to keep the sites running to a separate non-profit, who would then in turn license the software from the company?  What's in it for the community?   The community can practice self determination for issues from as basic as the number of moderators they have to as fundamental as the policies they enforce. If the company development continues to be unresponsive to the community's needs, the community would be able to develop its own open source software that would meet its needs. They can find their own funding model instead of having ads imposed on them.   What's in it for the company?   Community actions will no longer reflect on the company. Interaction with the community as a customer may come more naturally to current leadership than the present paradigm. They don't have to worry about paying for the community's operating expenses. They can focus on doing one thing well. Electorate badge rules? I just got the  badge on StackOverflow, which is nice, but I noticed a number of top users aren't yet listed (inluding Jon Skeet and Marc Gravell, who would certainly qualify).  This made me wonder how the badges are retrospectively applied. Is it just that the display is heavily cached and the badge is awarded when the user logs in again or something? How to prove that the set of rational numbers are countable? Is any explanation offered for "hyper-sleep"? In Big Hero Six,      Callahan's daughter was found to be alive in the space between portals in what Baymax describes as "hyper-sleep".   I don't believe the movie offers any further explanation for this, or why Hiro isn't affected.  Are there any other sources that explain this? Clip tool gives ERROR 000732? What is the relationship between symmetry and degeneracy in quantum mechanics?