Please help, this will be an easy and obvious problem but im new to coding and im teaching myself online. My program should ask the user to enter an amount, it should then ask the user to enter an account type, and it should then output the value of the amount with a years interest.   import java.io.IOException; import java.util.Scanner;   public class BankInvestment {      private static final String Account = null;      public static void main(String[] args) throws IOException {         // TODO Auto-generated method stub         int S = 3;         double D = 0.5;         double C = 1.5;         int L = 4;         @SuppressWarnings("resource")         Scanner input = new Scanner(System.in);         @SuppressWarnings("resource")         Scanner user_input = new Scanner( System.in );         int n = input.nextInt();         int Output = 0;         String Accounttype = null;          System.out.println("Please Enter Account Type(S,D,C,L): ");         Accounttype = user_input.next();          if (Accounttype == "S"){             Output = n / 100 * S + n;             System.out.println(Output);         }         else if (Account == "D"){             Output = (int) (n / 100 * D + n);             System.out.println(Output);         }         else if (Account == "C") {             Output = (int) (n / 100 * C + n);             System.out.println(Output);         }         else if (Account == "L"){             Output = n / 100 * L + n;             System.out.println(Output);         }     } }
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?
Theoretical proof of the constant of speed of light $c$ in vacuum in all frames of references Is there any theoretical proof for the constant speed of light in all frames of references? I know it is experimentally proven but just curious. Proof explanation $A\setminus B = A \setminus B \cap A$ $A\setminus B = A \setminus B \cap A$  Proof $A\setminus B \subseteq A \setminus B \cap A$:  $x\in A\setminus B \to x\in A \land x \notin B$  $x\in A \land (x \notin B \color{red}{\lor x\notin A})$  $x \in A \land (x\notin B \cap A)$  $x \in A\setminus B\cap A$  Proof $A \setminus B \cap A \subseteq A\setminus B$:  $x \in A \setminus B \cap A \to x\in A \land x\notin B \cap A$  $x \in A \land (x\notin B \color{red}{\lor x\notin A})$  $x \in A \land x \notin B$  $x \in A \setminus B $  Therefore $A\setminus B = A \setminus B \cap A$  I am confused how the stuff in the red is formed. Can we add an or statement to anything and ignore if its true or not if the first part of the or is true? Why can't I tame my ocelot? I'm trying to make a cat house for my zoo on Minecraft. I have some untamed ocelots and I also want a few tamed ocelots. Fish only puts them in breeding mode. When changing fields, should I focus more on describing past research or connecting it to the new area in my statement of purpose? I want to change my field from molecular biophysics to theoretical ecology. While they are basically required some same basic background (physics, math, programming), the rest is quite irrelevant. In my current draft of this part, about a half is about this the problem and the result of the work, another half is for my contribution and what I've learnt. Having said that, should I focus less on describing the work and leave space for the thing that will be useful for the next research?  Below is copy from .     What have you already done? What problems have you solved, or at least worked on? What independent projects have you been part of? What were your key contributions? What did you learn? What did you teach the world? How do your results compare to what was already known? What original ideas are you most proud of? Be specific, technical, credible, and confident (but not arrogant). Refer the reader to your web page for more details. Have a web page with more details: preprints, project reports, source code, videos, etc. Links in site profiles stripped from network profile I have a link in my profile, advertising a Stack Exchange question of mine (which I believe is acceptable use of the profile page). The link works fine on my individual profile pages. For example,  and . However, on  the links do not show.  The link is present on the GIF and on the text (two separate links, both to the same place). Both work fine on the individual profile pages but both are absent from the network profile page. The GIF and text are present, just without being linked.  Is there a reason for disallowing links from the network profile page, or is this a bug? Show that if $u$ is harmonic in $\mathbb R^n$ and $u=o(|x|)$, then $u$ is a constant.(Hint: use the solid version of the mean value property $u(x)=\frac{1}{\omega R^n} \int _{B_{R(x)}} u(y)dy$, and estimate $|u(x)-u(x')|$.)  Can anyone tell me how to use this hint? I would like to set a maximum execution time for sql queries like set_time_limit() in php. How can I do ? What is the lowest level of mathematics required in order to understand how encryption algorithms work? When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do? cgi and tomcat im trying to run a cgi script (.cgi) with tomcat. I am getting the below error and cant find out whats wrong. I know i should really use apache and mod proxy but this really isnt my area of expertise so im taking the easy way out!  Thanks for any help.   java.io.IOException: Cannot run program "perl" (in directory "C:\Java\tomcat\webapps\my_app_name\WEB-INF\cgi"): CreateProcess error=2, The system cannot find the file specified     java.lang.ProcessBuilder.start(ProcessBuilder.java:459)     java.lang.Runtime.exec(Runtime.java:593)     java.lang.Runtime.exec(Runtime.java:431)     org.apache.catalina.servlets.CGIServlet$CGIRunner.run(CGIServlet.java:1705)     org.apache.catalina.servlets.CGIServlet.doGet(CGIServlet.java:597)     javax.servlet.http.HttpServlet.service(HttpServlet.java:627)     javax.servlet.http.HttpServlet.service(HttpServlet.java:729)     org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)     org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416) I'm trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end.  I've got a good set of input/output message pairs so all I need to do is send the input messages in and listen for the XML message to come out the other end.  When it comes time to compare the actual output to the expected output I'm running into some problems.  My first thought was just to do string comparisons on the expected and actual messages.  This doens't work very well because the example data we have isn't always formatted consistently and there are often times different aliases used for the XML namespace (and sometimes namespaces aren't used at all.)  I know I can parse both strings and then walk through each element and compare them myself and this wouldn't be too difficult to do, but I get the feeling there's a better way or a library I could leverage.   So, boiled down, the question is:  Given two Java Strings which both contain valid XML how would you go about determining if they are semantically equivalent?  Bonus points if you have a way to determine what the differences are. Every time i publish a new post i want to display an icon like a badge (NEW) and after a specific time it will disappear.  Lets say i publish a new post and i want to display that it is a new post. So i want to insert an icon that for example a star, in each new post in the blog list view into the metadata of the posts. Also i want to be removed after a specific time will pass. Lets say in one day or 24 hours the icon should be removed automatically.  How can i do this? Eclipse menus are cut off or don't show I'm using Ubuntu 13.10 (with JDK 1.7.0_45).  I've downloaded and uncompressed Eclipse Kepler for Java EE Developers.  The software menus are messed up. I didn't notice similar problems in other software.  When I click any menu in Eclipse, the drop-down seems to be "cut". Sometimes the drop-down shows, but the options are invisible.  I tried Eclipse Indigo, but the same problem occurs. Alternative definition of hyperbolic cosine without relying on exponential function I have seen many folks doing this  concluding that shadow from point A on the Moon can travel to point B on the Moon faster than light.  What I fail to understand here (and I am sure I am wrong), is nothing can travel faster than light. I also read about Relativity where Einstein stated that every event happening for you depends on how fast the light gets from where the event is happening to you.  This is my particular problem with this Moon shadow experiment. You cannot make a shadow travel faster than light, because in order for the "disappearance" of light to get to the Moon, it has to travel at light speed.  Here is one way to understand my point. Consider we shine a flashlight on Moon, like the guy in the linked video did, we move the finger across the face of the flashlight, before we moved the finger it was casting the shadow at Point A on Moon, after we finish moving our finger, the shadow is at Point B on the Moon.  When the finger reaches the end of it's moving length, the light waves that have left the flashlight before the finger reached there will have to hit Point B and it will take them a second and a half to get there, and another second and half for us to see that shadow on point B, which makes it 3 seconds + finger moving time for us to actually see the shadow at point B. That means shadow traveled (say) across the diameter of the Moon in 3 seconds.   So. about 3000 Km in ~3 seconds make it 1000 Km per seconds which is very tiny compared to the speed of light. How can these experiments conclude that Shadow could be made to travel faster than light? What is the obvious clue that I am missing here? On September 29th, I created the  tag for  Today, while checking the tag description, I saw that the  seems to be .  Why is that? Why has the Community user "stolen" the spot as author of the tag? We have officially discontinued the Amazon book affiliate remnant ads, since despite our best efforts they don't perform well for our audience and cannot be made to perform well.  We've often wondered,   I'm thinking this isn't a problem; it has gotten lots of support historically. So we're going to go ahead and do it, so the company Amazon account is still getting some use, and we benefit a little.   To be clear: from this point on, all Amazon links posted on all sites will automatically be rewritten to add our affiliate link. We have a clever affiliate redirect that geolocates the IP address and redirects to the appropriate regional Amazon store (amazon.uk, amazon.ca, et cetera).  If you have any feedback on this, or suggestions, as they say &hellip; speak now or forever hold your peace! I have a small utility that I use to download an MP3 file from a website on a schedule and then builds/updates a podcast XML file which I've added to iTunes.  The text processing that creates/updates the XML file is written in Python. However, I use wget inside a Windows .bat file to download the actual MP3 file. I would prefer to have the entire utility written in Python.  I struggled to find a way to actually download the file in Python, thus why I resorted to using wget.  So, how do I download the file using Python? How does the Battle Booster work? I received the 80% battle point booster. It has 500 minutes on it and says the booster is only consumed when battle points are earned. Does this mean I can play 500 minutes of matches during a week and earning the bonus points? Or does it wear off in 500 minutes after equipping it?  Also it says my team is granted a 16% bonus. Does this stack? Do i get another 16% if I and another player wears it? Since it's a new item with the present chest it would be wise to use it later if the bonus does not stack. $f: \mathbb{R} \to \mathbb{R}$ that takes each value in $\mathbb{R}$ twice Does there exist a continuous function $f: \mathbb{R} \to \mathbb{R}$ that takes each value in $\mathbb{R}$ exactly two times?