I'm taking an AP Computer Science course, and I'm having a problem with this code. We're to make a method that converts Roman Numeral Strings into decimal values.  So far, we've only gotten to if/else statements and while loops. I've seen a few answers here using switch, but our class hasn't gotten there yet. I need a way to do this without using switch. I've only written code assuming that the Roman Numerals are in non-ascending order, but whenever a string like "MM" is used, the method returns "0" as a value. Anyone know why this happens here?  Any tips on subtracting the numerals would also be appreciated.     public int decimalValue ( String roman ){      //given a Roman Numeral      int decimal =0;      int a = 0; // a and b used as to check each letter in String roman      int b = 1;       // Assuming in non-ascending order. Need to make for ascending      while ( (a &lt;= (roman.length() - 1) ) &amp;&amp; (b &lt;= roman.length() ) ) {         if ( roman.substring(0,1) == "M") {            decimal = decimal + 1000;         }         else if ( roman.substring(0,1) == "D") {            decimal = decimal + 500;         }         else if ( roman.substring(0,1) == "C") {            decimal = decimal + 100;         }         else if ( roman.substring(0,1) == "L") {            decimal = decimal + 50;         }         else if ( roman.substring(0,1) == "X") {            decimal = decimal + 10;         }         else if (roman.substring(0,1) == "V") {            decimal = decimal + 5;         }         else if (roman.substring(0,1) == "I") {            decimal = decimal + 1;         }         a++;         b++;         }    return decimal;   }
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?
Can a new save withdraw from the pokemon bank? I've been considering restarting my save and replaying the story with access to the entire National Pokedex (Minus a few Event-only Pokemon I'm missing) from the start. But I would first like to confirm: Can I withdraw my stored Pokemon from the bank if my game is reset? It seems that the only contributing factor is that I end up signed in with the same Nintendo Network ID, so as long as my network ID remains the same, I can withdraw stored Pokemon regardless of what save-game or cartridge is in my system, correct?  While I'm reasonably confident it works the way I think it does, past experience (My Pokemon Ranch being tied to specific trainer IDs, and something about the dream world being tied to the game's wireless settings) has made me just cautious enough to ask before attempting. Is "Five dollars is all I have" correct? Disable storage of invisible files "._" on my cfs or smb network storage I want to upgrade the hard drive in my 2012 Macbook Pro to an SSD. I have the parts, but had a question about how to clone the contents of my current drive so I can install it onto the SSD.  I've seen tutorials where people suggest connecting the new SSD to the Macbook prior to installation and using a Carbon Copy Cloner to clone the drive, and then installing the SSD drive.  My question is, can I do a Time Machine backup of my current hard drive on an external hard drive, install the SSD, and then use the Time Machine backup from the external to transfer it onto the newly installed SSD? Is this the same as using the clone program above? How can I exclude API keys, passwords, and so on from configuration management? I am using Drupal 8 and drush cex to commit my configuration to my repository.  However, I want to keep passwords and API keys out of the repository.  How do I do that? (selectively exclude sensitive information from configuration management).  For example, I'm using the  module, but I noticed that in addition to the SMTP server and sender's name, etc., it also exports the API key to code, which should not be exposed.  I want to manage module configuration with configuration management, but I don't want to commit the key. i have a usb wifi adapter Tp-Link model: wn725n  it works very well on windows but i can't find any drivers for linux/ubuntu i tried everything online but nothing work so far  i'm using   Ubuntu 14.04.3 LTS  3.19.0-28-generic  laptop: hp probook 4540s  can you please help me install this adapter? What is the best way to represent show and hide in icons? I have a web page that has a list of columns of information.  All columns have names and then some of the columns have items in them.   I want to have an icon to represent   Hide all empty columns Showing all columns   All of the icons i see for hide look like "delete" so i want to see if there are any representations of "hide" icons that don't look like delete.  And for "show" the only thing i see is an eye graphic which doesn't seem very intuitive to me.  Does anyone have any recommendations for good "hide" and "show" icons? I have heard a few times that one way of describing quantum computers is that they essentially use the computing power of their counterparts in alternate realities that they access through superposition. My first question is, of course,    is this actually an accurate description of how quantum computers work, or just a misrepresentation?   Also, if it were to be assumed true and taken literally, then presumably all the possible outcomes of any given computation done would be experienced by each of these alternate realities. I have a few questions regarding the implications of this:   Would it be correct to say that our universe essentially "spawns" these alternate realities to use for each computation, or that they all exist simultaneously in a higher dimension and only come into contact via the initiation of superposition by each computer at the same time? Would it be possible to create contact between universes via this connection? I'd expect that, if it was, it would be entirely random, and so not only would not cause any information transfer, it also would be completely undetectable, because the deviations would be within the expected probabilities of error rates - but is there any way to circumvent this? Invert "if" statement to reduce nesting When I ran  on my code, for example:      if (some condition)     {         Some code...                 }   ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and suggested the following correction:     if (!some condition) return;    Some code...   I would like to understand why that's better. I always thought that using "return" in the middle of a method problematic, somewhat like "goto". Is there an alternative to Cantor's cardinalities that makes proper subsets smaller than their sets? Cantor defined an infinite set as a set whose subset can be placed in a one-to-one correspondence with its subset. That is, take the set of all natural numbers: {0, 1, 2, 3, 4,...}. From that set, you can form a subset of all even numbers: {0, 2, 4, 6,...}. There is a one-to-one correspondence between both these sets. After all, you can multiply each member in the set of all natural numbers by 2, and you’ll get the set of all even numbers. Because of this one-to-one correspondence, the two sets have the same cardinality, despite the set of even numbers being a subset of the set of natural numbers. This is counter-intuitive to me. How can a subset of a set be as big as the set itself? To make the intuition more concrete, consider the set of multiples of 1,000,000: {0, 1,000,000, 2,000,000,...}. There is a one-to-one correspondence between this set and the set of all natural numbers. So they have the same cardinality. This is really counter-intuitive.  From as far as I can tell, there are basically two axioms at play here:  A1: If all members of set A can be placed in a one-to-one correspondence with all the members of set B, then both sets have the same cardinality.  A2: If set A is a proper subset of set B, then A has a smaller cardinality than set B.  How Cantor defined infinite sets is that he accepted A1 and rejected A2. That is counter-intuitive to me. But mathematicians might say that my intuition is just wrong. So my question is whether we can define infinite sets in another way, i.e. accept A2 but reject A1. That is, the set of even numbers is smaller than the set of all natural numbers, even though both sets have a one-to-one correspondence. If you think this is counter-intuitive because sets with one-to-one correspondence with each other should have the same cardinality, and thus think this is wrong, why can’t I say the same when Cantor accepted A1 and rejected A2? Either way, there is something counter-intuitive and paradoxical.   So, my questions are:   Can we accept A2 and reject A1 for the definition of an infinite set? What arguments, if any, are given for accepting A1 and rejecting A2? Where in the file system are applications installed? I have installed a few Android applications both with the adb install MyApplication.apk command and via a webserver (like an alternative to Android Market).  But where in the Android file system on my phone is the MyApplication.apk file placed? Are applications installed with adb install not placed in the same directory as applications downloaded from the Market?  I found some applications on /system/app but I can't recognize them as some downloaded from Android Market or the one I have installed with adb install.  Where on the system is applications that I have installed located?  My phone is not rooted, and I am running Nexus One with Android 2.2.1. I'm wondering if it makes a difference in interpretation whether only the dependent, both the dependent and independent, or only the independent variables are log transformed.  Consider the case of  log(DV) = Intercept + B1*IV + Error    I can interpret the IV as the percent increase but how does this change when I have   log(DV) = Intercept + B1*log(IV) + Error   or when I have   DV = Intercept + B1*log(IV) + Error   ? List all files in all subfolders In windows, is there any way to get a list of all files in a folder, including all the files within all the subfolders? I have installed nodeJS on Ubuntu with following code   sudo apt-get install nodejs   Since I am a new user for ubuntu I also ran this code too  sudo apt-get install npm   Now when I type    nodejs --version   It shows   v0.6.19   I checked and saw latest nodeJS version is 0.10.26   How can I update my version of nodeJS to 0.10.26?  I tried with    sudo apt-get install &lt;packagename&gt;  sudo apt-get install --only-upgrade &lt;packagename&gt;   but no luck. In  Deathly Hallows, when Harry, Ron, and Hermione are at No. 12, Grimmauld Place, Harry summons Kreacher from the kitchens at Hogwarts where the elf has been working on Harry’s orders given a year previously.  When the trio’s heist in the Ministry of Magic ends with Hermione inadvertently bringing Yaxley inside the perimeter of the Fidelius charm that protects Grimmauld Place, the trio leg it and dare not return there for fear that it’s now crawling with Death Eaters.  Before they leave for the Ministry in the morning, Kreacher is talking about making a stew or pot roast or something for dinner. After the trio go on the run and camp out in the tent, Harry thinks of poor Kreacher preparing a dinner they’ll never return to eat, but they dare not summon him lest a Death Eater tag along (like how Dobby ‘tagged along’ with Kreacher when Harry called him to have him follow Draco in Half-Blood Prince).  The next time we see Kreacher is during the Battle of Hogwarts where he leads the house-elves from the kitchen with battle-cries of “For Master! For Harry Potter!” (or something like that), so he’s clearly lost none of his new-found loyalty to Harry.  Harry is still Kreacher’s master throughout the book, and since he does not communicate at all with Kreacher after their escape from the doorstep, he cannot have ordered Kreacher to return to Hogwarts to work there again.  We know that house-elves can go against their masters’ wishes, but this usually entails them punishing themselves rather brutally, and Kreacher does not seem to have been constantly injuring himself for the better part of a year at Hogwarts.  So when and how does Kreacher leave his master’s house without orders and return to Hogwarts? I'm putting some type on a path, a circle; but when I do it, the type is upside down. How can I flip it so it reads the right way up? See image below: Why is the notation $\frac{\partial f}{\partial x}$ used? Why doesn't backpropagation work when you initialize all the weight the same value (say 0.5), but works fine when given random numbers?   Shouldn't the algorithm calculate the error and work from there, despite the fact that the weights are initially the same? Computation of a limit involving factorial $\lim_{n \to \infty} \sqrt[n+1] {(n+1)!} - \sqrt[n] {(n)!} = \frac{1}{e}$ Load jQuery from Stack's CDN if Google's CDN is blocked (or always)