I am new to Java and I am trying to code a calculator. The numbers are not calculating and I am not sure why that is happening.  Here is my code:  import java.util.Scanner;  public class Calculator {     public static void main(String[] args){          System.out.println("Type in any 2 numbers: ");         Scanner math = new Scanner(System.in);         int number = math.nextInt();         int num2 = math.nextInt();          System.out.println("Which operation would you like to use? (+,-,*,/)");         String oper = math.next();          if (oper == "+"){             int total = number + num2;             System.out.println(total);         }         else if (oper == "-"){             int total = number - num2;             System.out.println(total);         }         else if (oper == "*"){             int total = number * num2;             System.out.println(total);         }         else if (oper == "/"){             int total = number / num2;             System.out.println(total);         }     }  }
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?
'find' utility does not output all files when using wildcards Running:  $find . -name *.exe   gives:  ./MakeItSo_1.2.2/MakeItSo_1.2.2/MakeItSo.exe ./MakeItSo.exe   but those are not the only exe files in the directory. For example, running  $find . -name ATLTester.exe   gives:  ./Debug/ATLDmoVexaTester.exe Does a family of a distribution have a different definition for statistics than in other disciplines?  In general, a  is a set of curves, each of which is given by a function or parametrization in which one or more of the parameters is varied. Such families are used, for example, to .  For statistics, a family according to  is the result of varying the shape parameter. How then can we understand that the gamma distribution has a shape and scale parameter and only the generalized gamma distribution has, in addition, a location parameter? Does that make the family the result of varying the location parameter? According to @whuber the meaning of a family is implicitly A "parameterization" of a family is a continuous map from a subset of ℝ$^n$, with its usual topology, into the space of distributions, whose image is that family.  What, in simple language, is a family for statistical distributions?  A question about relations among of the statistical properties of distributions from the same family has already generated considerable controversy for a  so it seems worthwhile to explore the meaning.  That this is not necessarily a simple question is born out by its use in the phrase , which has nothing to do with a family of curves, but is related to changing the form of the PDF of a distribution by reparameterization not only of parameters, but also substitution of functions of independent random variables. Count the number occurrences of a character in a string Why are only certain shutter speeds or apertures available? For the exposure control function DSLRs there are specific shutter speeds available. For example there are 1/4, 1/100, 1/500. Why, even in high end DSLRs, is there no option to use a custom shutter speed (such as 1/19)?   If the camera can do 1/4000, why can't it do 1/33?  Similarly, why are the aperture choices limited?  Why is it a technical challenge to add extra shutter speeds or aperture settings? I have a scene below where I am wanting to get an HDRI image to come in through the windows and light the scene in the window areas and have a god ray like effect.  I want to do this with a volumetric effect and have the HDRI lighting create throw patterns in the scene.  Is this possible?  To have volumetric lighting where the HDRI creates throw patterns?  Thanks for the help As a follow up to my other , I would like to know whether the following is possible:  I have $20,000 in my brokerage account The price of a call option with $300 strike price is $5.00 (1 contract = 100 shares) I buy 20 contracts of these $300 calls (cost is 20 * 5 * 100 = $10,000) The price of the underlying goes up, making my option in-the-money  I decide to exercise my options. Exercising my calls means that I buy 20 * 100 = 2,000 shares of the underlying at $300 per share. However, I only have $10,000 left in my brokerage account and am unable to pay for the shares (2,000 * 300 = $600,000). What now? How does this work? Do brokers recognize that my position is profitable, and buy and sell the underlying for me as soon as I exercise my calls? In other words, do I need to worry about being able to pay for the shares of the underlying if I decide to exercise my options? Can I just take my profit without bothering with the shares at all? Find the number of solutions of $a_0+a_1+a_2=17$ if $2\le a_0\le 5$,   $3\le a_1\le 6$, $4\le a_2\le 7$.   This is an exmaple given by my professor, and his solution is:       The number of solutions to this equation satisfying the given   constraints is equal to the coefficient of $x^{21}$ in the expression   $$\left(\sum_{n=2}^5x^n\right)\left(\sum_{n=3}^6x^n\right)\left(\sum_{n=4}^7x^n\right)=x^9\left(\sum_{n=0}^3x^n\right)\left(\sum_{n=0}^3x^n\right)\left(\sum_{n=0}^3x^n\right).$$   This must be 3, since the coefficient of $x^8$ in $(1+x+x^2+x^3)^3$ is   3.   I understand actually nothing here. The expression of summation just pops up, and then comes the answer. What I only know that the idea of generating function is used here. Can someone help explain how the steps in the solution come? TeX Live 2016: minted doesn't work with LuaLaTeX (bug fixed in June 2016) I've installed TeX Live 2016 as it was released today (thanks to the developers for that).  Now I have the following MWE:  \documentclass{article} \usepackage{minted} \begin{document}  \begin{minted}{ruby} class Foo   def init     pi = Math::PI     @var = "Pi is approx. #{pi}"   end end \end{minted}  \end{document}   When running pdflatex --shell-escape test.tex it runs through the file and produces the PDF as expected. Doing the same with lualatex --shell-escape test.tex fails with  This is LuaTeX, Version 0.95.0 (TeX Live 2016)   system commands enabled. (./test.tex LaTeX2e &lt;2016/03/31&gt; Babel &lt;3.9r&gt; and hyphenation patterns for 1 language(s) loaded. (/opt/texlive/2016/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/opt/texlive/2016/texmf-dist/tex/latex/base/size10.clo)) (/opt/texlive/2016/texmf-dist/tex/latex/minted/minted.sty (/opt/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty) (/opt/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty) (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/etexcmds.sty (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))) (/opt/texlive/2016/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix  &lt;2008/02/07&gt; (tvz)) (/opt/texlive/2016/texmf-dist/tex/latex/float/float.sty) (/opt/texlive/2016/texmf-dist/tex/latex/base/ifthen.sty) (/opt/texlive/2016/texmf-dist/tex/latex/tools/calc.sty) (/opt/texlive/2016/texmf-dist/tex/latex/ifplatform/ifplatform.sty (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/luatex-loader.sty (/opt/texlive/2016/texmf-dist/scripts/oberdiek/oberdiek.luatex.lua))) (/opt/texlive/2016/texmf-dist/tex/generic/oberdiek/catchfile.sty) uname -s &gt; "test.w18"  ! Package catchfile Error: File `test.w18' not found.  See the catchfile package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.93     \CatchFileDef\@tempa{\ip@file}{}  ?    As mentioned, it's a freshly installed TeX Live 2016; I've also checked the installed Pygmentize version, which is 2.1.3 (installed via pip). Testing with TeX Live 2015, the above code, however, works without problems with both pdflatex and lualatex.  Does anybody have a hint for me on how to fix this, or is it a bug in lualatex or minted (or whatever other package) that should be reported?  Update: With minted version 2.2 (2016-06-08), the package loads the shellesc package automatically, as mentioned by @David Carlisle and @egreg in the comments; therefore, the problem should not occur any more, if you have this version installed. What problem does oversampling, undersampling, and SMOTE solve? Tikz, Tree without overlaps Entity Query field condition for Webform submissions How do Natures work? In at least some Pokemon games there are modifiers called "Natures" which affect pokemon stats. What do they do and how do it work? Also, what specific games possess it? How can I do unit testing in Unity? How to implement Unit Test at Unity3D.   I wonder if it would be possible to extend the Unity editor to have some sort of testing framework in it.    Is there any guideline to implement it? Any reference like book, blog? Any working example or project? Why do backslashes appear twice? Best practices for storing UI settings? we're currently planning a larger WPF LoB application and i wonder what others think being the best practice for storing lots of UI settings e.g.   Expander States Menu orders Sizing Properties etc...   i don't like the idea of having dozens of stored values using the delivered SettingsProvider (i.e. App.config file) although it can be used to store it in an embedded database using a custom SettingsProvider. being able to use some kind of databinding is also a concern. Has anyone had the same problems?   What did you do to store lots of ui user settings? Counterexamples to the avoidance lemma for arbitrary ideals Let $A$ be a commutative ring with $1$. Let $I$ and $J_k$, $k=1,\dots,n$ be ideals of $A$ with $I\subseteq \cup _{k=1}^n J_k$. Then I have obtained the following:  (1) If $J_k$, $k=1,\dots,n$, are prime ideals, then there exists some $j$ such that $I\subseteq J_j$.   (2) If $A$ is a principal ideal ring, then there exists some $j$ such that $I\subseteq J_j$.   I want some counterexamples that for all $k=1,\dots,n$, $I$ is not contained in $J_k$. How to get the counterexamples? How would I implement a realistic stock market? If $A$ is a non-square matrix with orthonormal columns, what is $A^+$? If a matrix has orthonormal columns, they must be linearly independent, so $A^+ = (A^T A)^{−1} A^T$ . Also, the fact that its columns are orthonormal gives $A^T A = I$. Therefore,  $$A^+ = (A^T A)^{−1} A^T = (I)^{-1}A^T = A^T$$  Thus, $A^+ = A^T$. Am I correct? Thank you. Using special auto start servlet to initialize on startup and share application data Change Linux Mint to Ubuntu