So I've created this program which manipulates a word that the user gives as input, by taking the moving the first character to the end of the word, spells the rest of the word backwards, then checks if the original word and the new word are the same. It's designed to run until the user enters the word "quit" as the chosen word. I've managed to get the majority of the code working, except, instead of looping back to ask the user for a new word after its checked the previous one, it just continues running forever. The code I've currently got is below:  package uploadTask9_wordPlay;  import java.util.Scanner;  public class wordPlay {      public static void main(String[] args) {         // creates scanner object to get a name from the user input         Scanner userInput = new Scanner(System.in);              System.out.println("Enter a name to be tested, or 'quit' to exit  program: ");             // stores the user input into string testedName             String testedName = userInput.nextLine();              // if the user input is "quit", program exits             if (testedName.equals("quit")) {                 System.out.println("Thanks for using the program");                 System.exit(0);             }              // else, do the rest of the code with the given word             else {                  while (testedName != "quit") {              // takes first character from userInput             char firstLetter = testedName.charAt(0);              // removes first character from testedName             StringBuilder removeChar = new StringBuilder(testedName);             removeChar.deleteCharAt(0);              // adds first character of testedName to the end of removeChar             String newString = removeChar.toString() + firstLetter;              // prints newString backwards             String reverseWord = new  StringBuffer(newString).reverse().toString();              // if statement - far simpler way to carry this task out than loops             // if statement to check if the words are the same             if (testedName.equals(reverseWord)) {                  System.out.println(testedName + " is the same as " + reverseWord); }              else {                   System.out.println(testedName + " is not the same as " + reverseWord); }          }        }        } }   Does anyone know why the program doesn't loop back to the start each time its checked a word?
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?
Why do some questions not start with an auxiliary verb? When I learned English, my teachers told me that all questions must have an auxiliary verb at the beginning, just like Are you mad? or Is she playing? do.  But when watching some movies or talking with people who speak English, they just ask using things like You mad? and She’s playing?   Of course, the kind of intonation let me know they are asking a question, but why this happen? Where did Harry's parents get all of their money from? So, at the beginning of Harry Potter, Harry is found to have a large vault of gold at Gringotts. Where did all of that money come from? What did James (I assume it came from him, as Lily was muggle-born, and they were both young) do to get all of that cash? Beamer -- not indenting itemize in a single environment The output in the MWE posted at the end of this post is shown below. Notice how the default indentation from itemize gives an asymmetric slide w.r.t the spacing to the left and right of the itemize environment. How can I push the bullet points to the left so that the spaces to the left and right are the same? Such a solution would ideally be:   implementable on a one-off basis, so that it is applied when necessary (since some itemize environments should be given the default indentation) independent of the margin size, so that the solution doesn't need to be changed when the margin size is changed     \documentclass{beamer}   \begin{document}  \begin{frame}{A title} \begin{itemize} \item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \item tempor incididunt ut labore et dolore magna aliqua. \item Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi \item ut aliquip ex ea commodo consequat. \begin{itemize} \item Duis aute irure dolor in reprehenderit in voluptate velit esse \item cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat \end{itemize} \end{itemize}    \end{frame} \end{document} Why don't the White Walkers take the sea route to Westeros After watching 6 seasons of Game of Thrones, we know that the only roadblock for White Walkers is "The Wall" to stop them from attacking Westeros. However, we see that King Stannis attacked wildlings through a ship route without crossing the Wall.  What is stopping the White Walkers from doing the same? They can ask wights to make Ships or rowboats. They have a lot of forests to get wood for making ships. They can simply land at the coast of the North and attack Winterfell or whatever they want. How to move an element into another element? Proof or disproof that every integer can be written as the sum of a prime and a square. I'm refreshing some algebra and in the beginning chapters of my book I'm presented with the following simple looking problem that I got stuck on:      Prove or disprove: If $n$ is a positive integer, then $n=p+a^2$, where $a$ is an integer and $p$ is prime or $p=1$.   At first I thought $n=13$ would give a nice counterexample, but then I noticed my book defines primes to include the negative primes. Now $13=-3+4^2$ is a solution.   I am allowed to use the fundamental theorem of arithmetic and the division and euclidean algorithms. I tried to express $n$ and $a$ by their prime factorizations, but I didn't get anywhere from there. I would like a hint which direction to take. Am I just missing something silly? Resonances in high energy physics I still do not understand what a  precisely is. Is it exactly the same as a particle? Or only an excited state?  And why does it make a peak in some diagrams? And which diagrams? I want to learn more about hopf algebras but I am having trouble finding a down to earth introduction to the subject with lots of motivation and examples. My algebra knowledge ranges from Dummit and Foote, Atiyah-Macdonald commutative algebra, and Hartshorne level algebraic geometry.  What are good places to look at for a hopf algebra beginner? My main motivation is for studying groupoid schemes from an algebraic point of view. I see more and more servers that have no domain defined in the /etc/resolv.conf file.  Only a search entry. In what cases is this setup used ? Are there any cases where it must not be used ?  nameserver xxx.xxx.xxx.xxx nameserver yyy.yyy.yyy.yyy nameserver zzz.zzz.zzz.zzz  search domain1 domain2 domain3 ... How to show the transfer progress and speed when copying files with cp? Otherwise, is there any alternative command line utility that can achieve this? Understanding Group Permissions I'd appreciate help with a couple questions regarding standard file permissions. Assume that I'm not using access control lists.     If a file is associated with multiple groups, must all groups have the same permissions?   If the group permission includes write access, can any member of any group the file is associated with change the file permissions? Can such a person change the file owner?   Say now the file permission is rwxr----- (owner can do everything, but group members can only read). I am in the group associated with the file. I am also the file owner. Which permission am I granted? Read-only, or rwx? Recovering added/staged file after doing git reset --hard HEAD^? What is the difference of closing for duplicate and flagging for duplicate? When I encounter a duplicate, I have two choices: Vote closing because it is a duplicate, or flag it as a duplicate. What is the difference and should I do both? How to send array with CURL? Should I `urlencode` it? I'm having a problem with author display for a statute - the author is 'City and County of San Francisco' but the output (using the apalike.bst style file provided by Elsevier) gives the author as 'City and San Francisco', missing the 'County' in the authorname.  Any suggestions? Is it possible to remove a terminal command? For example, if there was a command call lookup (not an alias), how would I go about removing it? Checking if file is checked out through CSOM Is there a way to check if a file is checked out by another user? I am going trhough a list file by file and would like to avoid the "file is opened by another user" error. Something like this would be nice:  Guid id = new Guid(slideLibrary); // ID of Slide-Library. List list = ctx.Web.Lists.GetById(id); ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery()); ctx.Load(items); // Loading all the fields System.Security.SecureString pwd = new System.Security.SecureString(); foreach (char c in "pwd".ToCharArray()) pwd.AppendChar(c);  ctx.Credentials = new SharePointOnlineCredentials(login, pwd); ctx.ExecuteQuery();  // Iterating through all the entries. foreach (var item in items) {     String currentID = item["ID"].ToString(); // Getting the ID of the current item.      if (!item.IsCheckedOut()) // This is the part I am looking for.     {        // Do stuff     }     else     {        Console.WriteLine("Item is blocked, skipping it.")     } }   I have yet not been able to find something fitting. Order of keys in dictionary Space which is connected but not path-connected Is it possible to check out subdirectories of a repository in Git?  Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization:   wordpress/wp-content/plugins/myplugins/  wordpress/wp-content/themes/mytheme/   I want to maintain these directories via Git. In Subversion, I would accomplish this by having trunk/myplugins/ and trunk/mytheme/ directories and checking out subdirectories. Does Git have a way to accomplish the same task using a single repository?  I could just be missing the boat on some Git paradigm, as a long time SVN user with little exposure to Git.  Edit:  storing different content is an interesting way to handle this.