I'm doing a calculator, in which is asked to the user to put two numbers, and then an aritmethical operator, so a set of IFs will understand what operator it is and do the operation required: public class Calc {    public static void main(String args[]) { Scanner input = new Scanner(System.in);   System.out.print(&quot;First number: &quot;); double num1 = input.nextDouble();  System.out.print(&quot;Second number: &quot;); double num2 = input.nextDouble();  System.out.print(&quot;Artithemtical operator(-, +, :, x): &quot;); String segn = input.nextLine();   if(segn == &quot;+&quot; ) { System.out.println(num1 + &quot; + &quot; + num2 + &quot; = &quot; + (num1 + num2)); } else if(segn == &quot;-&quot;) { System.out.println(num1 + &quot; - &quot; + num2 + &quot; = &quot; + (num1 - num2)); } else if(segn == &quot;x&quot;) { System.out.println(num1 + &quot; x &quot; + num2 + &quot; = &quot; + (num1 * num2)); } else if(segn == &quot;:&quot;) {    System.out.println(num1 + &quot; : &quot; + num2 + &quot; = &quot; + (num1 / num2)); }      } }  as you can see if the input is a specific operator it will perform the specific task. It works well, it makes you put the two numbers, the operator but then it does nothing, what shall I do?
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?
Searching by user id in Android app only shows questions, no answers I have a Samsung Galaxy S3. Android version 4.3  I downloaded the official StackExchange app today. I am not able to view post related to android tag from my profile. I tried refreshing also  Snap     Edit:  However i am able to see one post for the relevant from the drop down list    Edit 2:  I tried what Steven V suggested. However it's the same.    I tried for a different user its the same. MySQL returns only one row Why could centering independent variables change the main effects with moderation? Bluetooth earphones work fine until sleep. After resuming from sleep however, they appear to connect for a brief moment before disconnecting. On blueman, the error given is Resource temporarily unavailable. This issue arose only after updating to 18.04 LTS.   Here's the terminal output for lsusb:  Bus 001 Device 002: ID 8087:8001 Intel Corp.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 004: ID 1bcf:0002 Sunplus Innovation Technology Inc.  Bus 002 Device 003: ID 04f2:b477 Chicony Electronics Co., Ltd  Bus 002 Device 002: ID 0a5c:21f1 Broadcom Corp. HP Portable Bumble Bee Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Meaning of Conditional sentences with 'should' and 'happen to' Choosing my name as an author when publishing a scientific paper, can I use my "unofficial" first name? I have one official first name which appears on my ID card. I have another first name which friends call me by. Is it possible to use my unofficial first name and official family name to publish scientific papers? How can I prove to someone that I am one of the authors? Intuition for $\,c\mid a,b \iff c\mid \gcd(a,b)$ What's the full-form & significance of USS & ISS prefixes in name of Star Trek starships? $\mathbb Q[x]/(x^2+1)$ is not isomorphic to $\mathbb Q[x]/(x^2+2)$ Change rep required to downvote on MSE To make your opinion known on MSE you need both up and downvotes. Given at the moment you need 125 rep to downvote on this site, the voting patterns will be skewed positive because not everyone is active on the site.   This is to be expected for regular Stack Exchange sites as you are expected to be involved in the community before you are deemed knowledgeable enough to be part of the community voice. However, MSE is different because you are voting for the entirety of the Stack Exchange network and you shouldn't need to be active on MSE itself to have a voice on changes to the entire network.  This is especially important for questions like  because it will effect every network to do with coding at all. This was brought up in .  I would suggest reducing the rep required to downvote on MSE down to 100 (or 101) rep. This is the amount you get for the site association bonus. This is given once you achieve 200 rep on any network site and shows that you are active in at least one community. I think this would be the perfect use of the association bonus in showing that you are a member of the Stack Exchange community. I'm trying to make a liquid simulation with Mantaflow where the flow of the liquid respects the flow object's local rotation, so it looks like water spraying in different directions. It looks like the options on the flow object only work for 'world' coordinates and doesn't take into account the coordinates of the object. How do I make the water 'fire' (like a hose) into a specific direction that uses local coordinates instead of world ones? Archimedes' principle for two liquid layers Problem: I have a cylindrical vessel of height $H$ and radius $R$. There are two liquid layers in the vessel. The first has density $D_1$ and height $h_1$, the second has density $D_2$ and height $h_2$. The second liquid is floating on the first liquid (thus $D_2 &lt; D_1$) and they are both entirely within the vessel ($h_1+h_2 \le H$). Now I have a cube of density $D$ and edge length $n$. The cube fits into the vessel ($n \le \sqrt2R$) but it might not be completely inside it ($n&gt;H$ is possible). I place it into the vessel such that one side is horizontal (the cube is not lopsided). Some liquid might overflow as a result. How do I use Archimedes' principle to calculate the topmost liquid level after placing the cube? I can ignore damping and other physical effects. EDIT: Note that the only values I know are $H, R, D_1, h_1, D_2, h_2, n$ and their abovementioned constraints.  My workings: I tried using the formula directly, where $\text{weight of cube}=\text{weight of displaced liquid}$. I first get $Dn^3=D_2n^2s_2$ where $s_2$ is the height submerged in the second liquid. If $s_2 \le h_2$ then the cube is only submerged in the second liquid. So the answer is $\min(H, h_1+h_2+{n^2s_2\over\pi R^2})$, accounting for overflows. This case is simple. But if $s_2&gt;h_2$ then the cube can be submerged in the first liquid too. I thought of subtracting the weight of the second liquid displaced to obtain the height submerged in first liquid, but realize that I don't know that. The weight displaced depends on the final liquid height, which can be affected by overflows, whether the cube fits totally within the two liquids, etc. In fact, it can be the case that after the liquid level rises, the cube now displaces more of the second liquid, causing it to not be submerged in the first (is that even possible?) It seems very messy and I have no idea how to start. :( Does anyone have a nice solution to this problem? I've heard that you need to get a Mac if you want to develop iPhone apps. Is this true?   Is it possible to develop iPhone apps using Linux? If yes, what do I need and where do I download the necessary tools? t-test or z-test: assume normality or s≈σ? Let's say I have a large sample ($n&gt;30$) with mean $\bar{X}$ and standard deviation $S$. I can calculate only: $T=\frac{\bar{X}-\mu}{S/\sqrt{n}}$.  If I want to use t-test for a hypothesis, then I have to assume normality of the population. If I want to use z-test for a hypothesis, then I have to assume that $\boldsymbol{s\approx\sigma}$.  What is the less important assumption? What test should I do? Should I do t-test, z-test or doesn't matter? In which situations is it OK to omit articles in short sentences? Recently, in many new online software I often see that developers omit articles in short sentences, especially on action buttons or tooltips.     For instance: "Add new task" (not "Add a new task"), "Create project" (not "Create a project"), but often in the same software I can see "Make a copy". What are situations it can be justified? Metric is continuous, on the right track? Let $X$ be a metric space with metric $d$. Show that $d:X\times X\rightarrow \mathbb{R}$ is continuous.   The problem is taken from Munkres Topology second edition, Section 20.  I know that if $d$ is a metric on $X$ then $d:X\times X\rightarrow \mathbb{R}$. My thinking is that the topology that is on $X$ is the topology induced by the metric $d$, and that the topology on $X\times X$ is the product topology on that space where we take the basis to be $$\mathcal{B}=\{ U \times V \mid \text{ $U,V$ both open in $X$}\}.$$ Am I on the right track to say that we define some new metric on $X\times X$ and show that this metric induces the same topology as the product topology and then work with the function $d$ as a function between metric spaces to show continuity? The question doesn't mention anything about defining some new metric and I've tried to solve the problem by looking at $X\times X$ as having the product topology, but in picking some point $(x,y) \in X\times X$ and some neighborhood around $d(x,y)$ in $\mathbb{R}$, I haven't yet found the way to make a neighborhood around $(x,y)$ which maps into the neighborhood around $d(x,y)$. Counting traversed arcs on routes to write attributes using ArcGIS for Desktop? I have number of persons located on a road network and I have calculated their shortest distance to a particular location.  From the routes output created from Closest Facility can I   break the routes down into the individual arcs traversed by each person? assign each arc a count attribute indicating the number of individuals who use that arc to get to their destination?   I am using Network Analyst in ArcGIS 10.2 for Desktop. Local server updates for the network I have setup one computer on our network as the file server. Because Internet here in Tanzania is both slow and expensive I would like that one system to download all the updates and then the other 10 computers on the network to get those update files from the server. I'm a bit of a noobie to Ubuntu, but really want to learn how to get this working smoothly so as to help other NGOs and schools here in Tanzania. Brendon Why is it dangerous to initialize weights with zeros? Is there any simple example that demonstrates it? I have a question about the following passage on pg. 89 of Zee's QFT in a nutshell:     At first sight, what Dirac wanted does not make sense. The equation is supposed to have the form "some linear combination of $\partial_\mu$ acting on some field $\psi$ is equal to some constant times the field." Denote the linear combination by $c^\mu\partial_\mu$. If the $c^\mu$'s are four ordinary numbers, then the four-vector $c^\mu$ defines some direction and the equation cannot be Lorentz invariant.   The simplest equation I can construct that he is referring to is  $$(c^{\mu}\partial_{\mu}-m)\phi(x)=0, $$  for $m&gt;0$. Taking $\phi(x)\rightarrow\phi(\Lambda^{-1}x)$, and $c^{\mu}\rightarrow\Lambda^{\mu}_{\ \ \nu}c^{\nu}$. Then, the left term transforms like   \begin{align*} \Lambda^{\mu}_{\ \ \nu}c^{\nu}(\Lambda^{-1})^{\sigma}_{\ \ \mu}\partial_{\sigma}\phi(\Lambda^{-1}x) &amp;= \delta^{\sigma}_{\ \ \nu}c^{\nu}\partial_{\sigma}\phi(\Lambda^{-1}x)\\ &amp;=c^{\sigma}\partial_{\sigma}\phi(\Lambda^{-1}x). \end{align*}  Then, we have that   $$ (c^{\sigma}\partial_{\sigma}-m)\phi(\Lambda^{-1}x)=0.$$  But doesn't this show that the equation is Lorentz-invariant?