else if (answer.equals("check value")){         System.out.println("Of what?");         System.out.println("Tax, Donations, Income, Profit, Expenditure, Services, Military, City or Economy.");         System.out.println("Do not use caps and spell it correctly otherwise it will not be recognised.");         String valueToCheck = scan.nextLine();         if (valueToCheck == "tax"){             System.out.println(tax);         }else if (valueToCheck == "donations"){             System.out.println(donations + "donations per turn");         }else if(valueToCheck == "income"){             System.out.println(incomePerTurn + " income per turn");         }else if(valueToCheck == "profit"){             System.out.println(profitPerTurn + " profit per turn");         }else if(valueToCheck == "expenditure"){             System.out.println(expenditurePerTurn + "expenditure per turn");         }else if(valueToCheck == "services"){             System.out.println(servicesBudget + " to services budget");         }else if(valueToCheck == "military"){             System.out.println(militaryBudget + " to military budget");         }else if(valueToCheck == "city"){             System.out.println(cityBudget + " to cities budget");         }else if(valueToCheck == "economy"){             System.out.println(economy  + " to total economy");         }         newTurn();}   Hello, whenever I run my program and type 'check value' I get no errors, in fact I get nothing. I am just wondering why nothing is returned. Thanks for any help!
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?
public class doublePrecision {     public static void main(String[] args) {          double total = 0;         total += 5.6;         total += 5.8;         System.out.println(total);     } }   The above code prints:  11.399999999999   How would I get this to just print (or be able to use it as) 11.4? Getting MTP enabled devices to work with Ubuntu? Since Ubuntu 13.04 storage access to external devices via MTP is supposed to work out of the box via a GVFS-MTP module.      While this question is about the Galaxy Nexus, other Android devices as well as Windows Phones and MTP enabled media players are also supported.      For troubleshooting see .     I am having quite a bit of problems getting file-transfers working over MTP with the Galaxy Nexus. I am using Kubuntu 11.10 64-bit, and this is what I have done and the results I get:   Added rule for device in /etc/udev/rules.d/51-android.rules. The rule is the following and works for adb:  SUBSYSTEMS=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="6860", MODE="0666", OWNER="leob" #Galaxy Nexus  Restarted udev (and computer just to make sure).   Adb works, and all methods for reading from the device via MTP seems to work (I have tried mounting with mtpfs, gmtp and using the mtp-tools package directly). When I try to write to the device however, nothing I have tried works.  As an example, running mtp-newfolder test_dir 0 0 gives the following output:  libmtp version: 1.1.0 Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1. Folder creation failed. ERROR: Could not close session!   If I run mtp-folders after a failed mtp-newfolder without re-plugging the device, I get the following output:  Attempting to connect device(s) Device 0 (VID=04e8 and PID=6860) is a Samsung GT-P7510/Galaxy Tab 10.1. PTP_ERROR_IO: failed to open session, trying again after resetting USB interface LIBMTP libusb: Attempt to reset device mtp-folders: Successfully connected Friendly name: (NULL) Error 1: Get Storage information failed. Error 2: PTP Layer error 02fe: get_all_metadata_fast(): could not get proplist of all    objects. Error 2: (Look this up in ptp.h for an explanation.) Error 2: PTP Layer error 02fe: get_handles_recursively(): could not get object handles. Error 2: (Look this up in ptp.h for an explanation.) LIBMTP_Get_Storage() : Resource temporarily unavailable OK.   Accompanied by the following in dmesg:  [ 1000.912082] usb 2-4: reset high speed USB device number 7 using ehci_hcd [ 1001.045877] usb 2-4: usbfs: process 3166 (mtp-folders) did not claim interface 0 before use   Does anyone have any idea about what to do?  EDIT:  I also tried the PTP mode. Again, reading works fine, but I cannot write anything to the device. adding a point in a manipulate command How to pin Eclipse to the Unity launcher? In what kind of rings a divisor of a product is a product of divisors? In a , if $a|bc$, then $a$ can be written as $a = a_1a_2$ so that $a_1|b$ and $a_2|c$.  Is this property of a commutative ring strictly weaker than the property of being a UFD?  If so, does it have a name, or is it equivalent to some other well-known property? How can I get two Xbox 360's to be in "open nat" mode behind the same router? I have two Xbox 360's, one WiFi and the other wired through the same Linksys E3000 router with DD-WRT (v24-sp2 (04/13/11) std-usb-nas firmware).   Mine (the wired one, though hers has been wired in the past and it didn't appear to help) always seems to be open (green), and hers is either moderate or closed (oj/red)  Even with the original router firmware I've never been able to get both consoles into "open nat" mode, and it makes playing certain games together almost impossible for me and my wife  because we can't seem to get into the same game.   I have uPnP enabled and the DMZ disabled, and some minor port forwarding to allow for a Minecraft server (Ports 25565 and 25566 for a testing copy of the server), but other than that the settings are mainly at their default, on the xbox's and the router.   Are there any settings I can configure to allow this to work properly? How to prove $\operatorname{Tr}(AB) = \operatorname{Tr}(BA)$? there is a similar thread here , but I'm only looking for a simple linear algebra proof. Can CBC ciphertext be decrypted if the key is known, but the IV not? Is the set of points in the plane whose coordinates are either both irrational, or both rational connected? Difference between "not equal" operators  and != in PHP Cortana Search is not finding applications on Windows 10 For the past several versions (since Windows Vista, I think), if you hit the Windows key and start typing, Windows will search for applications.  Since upgrading to Windows 10 with , she is only hit or miss at finding applications. And she doesn't do partial searches, either.  Some examples:   WinKey + type "Paint" does not find "mspaint". Instead it suggests some applications from the store. WinKey + type "Excel" does not find Excel. Nor does typing "Word" find Word. However, typing OneNote finds OneNote.   What is the reason for this behavior and how I can get Cortana to find the applications installed on my machine again? Is there a setting I am missing?    If I browse to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" I can see that the shortcuts for these applications all still exist. But Cortana is not finding them. Everything from the Microsoft Office applications to  to  to hundreds of other applications I have installed.  Where can I set which folders Cortana indexes?    As you can see in the screen shot below, this Start Menu folder is, indeed, indexed:    However, none of these applications are coming back as search results from the "start" menu.  It may be related to  as well.  I did a brand new install of Skype (for desktop), and it shows up nowhere in the start menu. And typing in "Skype" to search for the application does not find it. But the shortcut to Skype is definitely in this location:  C:\Users\Patrick\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Skype     EDIT  The latest Windows 10 update (Threshold 2) has solved this issue for me. Cortana now finds all my files with no issues. Previously my only solution was to use , I've been able to uninstall that now and use the standard Windows Start menu. Are there any synonyms for the noun 'crush'? I must clarify, when I say 'crush', I mean the subject of an unrealistic, one-sided infatuation. For example, it can be used in this sentence: 'My celebrity crush is David Beckham.'  Could that word be interchanged for another? Preferably, can it be a word which is not necessarily too formal/complex? I've searched online for a while but can't find any synonyms for this form of 'crush.'  I want the word for a novel which is set in an old-ish fantasy period so I don't think 'crush' would feel in-place.  The main character is a lower-class worker. I'm editing a book that includes about 25 papers written in LaTeX by different authors.  Since many of them use the same \label, to avoid collisions I redefined the \label command (and \ref and \pageref and \cite and \bibitem)  so that if the third paper has  \label{main_theorem} the aux file actually uses the tag "iii:main_theorem", and \ref{main_theorem} actually refers to the same tag.  I did a similar thing for \cite and \bibitem.  %*************** bib/cite hacks \let\TheReal@citex=\@citex \let\TheReal@bibitem=\@bibitem \let\TheReal@lbibitem=\@lbibitem \gdef\@lbibitem[#1]#2{\TheReal@lbibitem[{#1}]{#2\roman{chapter}}} \gdef\@bibitem#1{\TheReal@bibitem{#1\roman{chapter}}} \gdef\@citex[#1]#2{% \toks@={}\count@=0% \@for\@citec:=#2\do{% \advance\count@ 1 \ifnum\count@=1\edef\0{\the\toks@\expandafter\expandafter\noexpand\@citec\roman{chapter}}% \else\edef\0{\the\toks@,\expandafter\expandafter\noexpand\@citec\roman{chapter}} \fi% \toks@=\expandafter{\0}}% \TheReal@citex[#1]{\the\toks@}% } %************** label/ref/pageref hacks  %%%%%%%%%%%%% must be before ams pkgs \let\TheRealLabel=\label \let\TheRealRef=\ref \let\TheRealPageref=\pageref \gdef\label#1{\TheRealLabel{\roman{chapter}:#1}} \gdef\ref#1{\TheRealRef{\roman{chapter}:#1}} \gdef\pageref#1{\TheRealPageref{\roman{chapter}:#1}}   This all worked fine until I used hyperref, which seems to ignore the redefinition of \label, whether I load it before or after the above code.  Any suggestions?  It would be nice if the redefinition would work whether or not hyperref was loaded, so I don't want to just grab the defintion of \label out of the package and tweak it.  I'm also open to alternative methods.  Redefining \label and \ref just seemed the most straightforward (to me) solution.  Note that I also want to be able to refer to the inner labels from outside, as well.  For example, I might want to say "the main theorem of the third paper is  \ChapRef{iii}{main_theorem}  from within the introduction (a different chapter). How did the DeLorean travel to 1885? At the end of Back to the Future II, a lightning bolt hits the DeLorean which sends it back to 1885.  At the time though, the DeLorean wasn't moving; it was relatively stationary hovering in the storm.  Yet, it's emphasised repeatedly that the DeLorean must reach 88 miles per hour (which becomes a key plot point in Back to the Future III).  So, considering the DeLorean wasn't traveling at 88mph when the lightning struck the DeLorean sending it to 1885, what is the in-universe explanation of how it travelled there?  Some other factors to bear in mind:   If a lightning bolt was sufficient to send the DeLorean time traveling, then the 88mph business would be irrelevant Note that there are the firey tracks left after the DeLorean time travels in the '66' shape.  The thing to note about this though is that we never see these before the DeLorean disappears.  These tracks are always appearing after the DeLorean has traveled away.  This would seem to indicate that the DeLorean did move, but following the activation of the time circuits. Is a path the set of points from a to b?  And is the stroke the "definition" (i.e. the color, shape, etc.) of the path?  And, how can you have a path with no stroke?  Is this only because it is a computer drawing program?  In the real world you can't have a path without a stroke can you?  If it matters, I am using Inkscape. 2.8 Why are collections grayed out? How can I open them? I've bought Cup models from Internet.   When opening .blend file I get Blender's Interface changed. To avoid this I've unchecked "Load UI" on opening the file.   But now I cannot see the objects of the project (I can see and render them when opening the file and leaving "Load UI" checked).   "Collection 1" on the "Objects Panel" (Don't know if it is it's name). is grayed out.   cup-models.blend with LOAD UI:    cup-models.blend without LOAD UI:    Blender 2.8: In Windows I used command-line clipboard copy-and-paste utilities...      pclip.exe and gclip.exe     These were UnixUtils ports for Windows (but they only handled plain text). There were a couple of other native Windows utilities which could write/extract any format.    I've looked for something similar in Synaptic Package Manager, but I can't find anything.    Is there something there, that I've missed? ... or maybe this is available in Bash scripting?    The type of utility I'd like will be able to read/write via std-in/std-out or file-in/file-out, and handle Unicode, Rich Text Format, picture, etc. clipboard formats...    NB: I'm not after a clipboard manager. Using File Geodatabase coded domain with ArcGIS Online? I created a File GDB and set up a domain, and the domain was assigned to a field in a feature class. The domain behaves as expected on ArcGIS Desktop (dropdown list when editing the content of that field).  But if I zip up the FGDB and upload to ArcGIS Online to created a feature layer and edit the layer online, there is no dropdown when editing.  I don't see any additional step in this tutorial, other than a different mechanism of getting data to ArcGIS Online. I don't think I can do it the same way in ArcGIS 10.0:   Anyone has any idea what's going on? Convert line voltage heating system to use low voltage thermostats I currently have two line voltage ceiling radiant heating systems in my condo each with their own DPST thermostat. I'd like to use low voltage thermostats such as the nest. I found , but it only has 3 wires. Will this work with a system designed to use DPST thermostats? If not, is there something else out there that will allow me to use low voltage thermostats with line voltage heaters? I asked  that turned out to have multiple correct answers. How do I pick between them to determine which to accept?  All of the answers were different. They were not the same answer given multiple times.