The value of s2 and s3 is "ab" and this string is stored in string pool. As per doc s2==s3 should return true but it is returning false. Why?   public class Sample {       public static void main(String[] args) {       String s="a";       String s1="b";       String s2=s+s1;       String s3="ab";       System.out.println(s2==s3);    } }
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?
How can I make a camera the active one? I have multiple cameras in a scene. What I want to do is to change which one is active. This way I can view the scene from different angles. How would I do this? I am trying to mimic our institute's PPt-template for presentation foils using the beamer-class. The corporate quidelines prescribe the use of Helvetica as the main font. However, package helvet does not provide a good mathematical font. Therefore I want to replace it with the math font from the cmbright package:  \documentclass{beamer}  \usepackage{lmodern} \usepackage[T1]{fontenc}  %main font Helevtica \renewcommand{\familydefault}{\sfdefault} \usepackage{helvet}  %prevent beamer from meddling with math fonts \usefonttheme{professionalfonts}  %following lines borrowed from cmbright.sty \DeclareSymbolFont      {operators} {OT1}{cmbr}{m}{n} \DeclareSymbolFont        {letters} {OML}{cmbrm}{m}{it} \SetSymbolFont      {letters}{bold} {OML}{cmbrm}{b}{it} \DeclareSymbolFont        {symbols} {OMS}{cmbrs}{m}{n} \DeclareMathAlphabet{\mathit} {OT1}{cmbr}{m}{sl} \DeclareMathAlphabet{\mathbf} {OT1}{cmbr}{bx}{n} \DeclareMathAlphabet{\mathtt} {OT1}{cmtl}{m}{n} \DeclareMathAlphabet{\mathbold}{OML}{cmbrm}{b}{it} \DeclareMathSymbol{\alpha}{\mathalpha}{letters}{11} \DeclareMathSymbol{\beta}{\mathalpha}{letters}{12} \DeclareMathSymbol{\gamma}{\mathalpha}{letters}{13} \DeclareMathSymbol{\delta}{\mathalpha}{letters}{14} \DeclareMathSymbol{\epsilon}{\mathalpha}{letters}{15} \DeclareMathSymbol{\zeta}{\mathalpha}{letters}{16} \DeclareMathSymbol{\eta}{\mathalpha}{letters}{17} \DeclareMathSymbol{\theta}{\mathalpha}{letters}{18} \DeclareMathSymbol{\iota}{\mathalpha}{letters}{19} \DeclareMathSymbol{\kappa}{\mathalpha}{letters}{20} \DeclareMathSymbol{\lambda}{\mathalpha}{letters}{21} \DeclareMathSymbol{\mu}{\mathalpha}{letters}{22} \DeclareMathSymbol{\nu}{\mathalpha}{letters}{23} \DeclareMathSymbol{\xi}{\mathalpha}{letters}{24} \DeclareMathSymbol{\pi}{\mathalpha}{letters}{25} \DeclareMathSymbol{\rho}{\mathalpha}{letters}{26} \DeclareMathSymbol{\sigma}{\mathalpha}{letters}{27} \DeclareMathSymbol{\tau}{\mathalpha}{letters}{28} \DeclareMathSymbol{\upsilon}{\mathalpha}{letters}{29} \DeclareMathSymbol{\phi}{\mathalpha}{letters}{30} \DeclareMathSymbol{\chi}{\mathalpha}{letters}{31} \DeclareMathSymbol{\psi}{\mathalpha}{letters}{32} \DeclareMathSymbol{\omega}{\mathalpha}{letters}{33} \DeclareMathSymbol{\varepsilon}{\mathalpha}{letters}{34} \DeclareMathSymbol{\vartheta}{\mathalpha}{letters}{35} \DeclareMathSymbol{\varpi}{\mathalpha}{letters}{36} \DeclareMathSymbol{\varrho}{\mathalpha}{letters}{37} \DeclareMathSymbol{\varsigma}{\mathalpha}{letters}{38} \DeclareMathSymbol{\varphi}{\mathalpha}{letters}{39} \let\upDelta\Delta \let\upOmega\Omega \let\upGamma\Gamma \let\upTheta\Theta \let\upLambda\Lambda \let\upXi\Xi \let\upPi\Pi \let\upSigma\Sigma \let\upUpsilon\Upsilon \let\upPhi\Phi \let\upPsi\Psi  %doesn't seem to have an effect %\DeclareMathSizes{12}{12.5}{10}{10}  \begin{document} \begin{frame}  Some Math E$E$ \end{frame} \end{document}   This works quite well, except that the math letters are somewhat smaller than the normal Helvetica text. Is there a way to scale the fontsize, say by 1.1, if the typesetter is in math mode? Why are the dineutron and diproton unbound? "Writ large", "Writ small", and others I have seen this used with other words besides "large" and "small".  What other words can be used? Can this structure be used more generally with other adjectives? filter the file type with the file upload control Wikipedia introduces the vector product for two vectors $\vec a$ and  $\vec b$ as $$ \vec a \times\vec b=(\| \vec a\| \|\vec b\|\sin\Theta)\vec n $$ It then mentions that $\vec n$ is the vector normal to the plane made by $\vec a$ and  $\vec b$, implying that $\vec a$ and  $\vec b$ are 3D vectors. Wikipedia mentions something about a 7D cross product, but I'm not going to pretend I understand that.  My idea, which remains unconfirmed with any source, is that a cross product can be thought of a vector which is orthogonal to all vectors which you are crossing.  If, and that's a big IF, this is right over all dimensions, we know that for a set of $n-1$ $n$-dimensional vectors, there exists a vector which is orthogonal to all of them.  The magnitude would have something to do with the area/volume/hypervolume/etc. made by the vectors we are crossing.  Am I right to guess that this multidimensional aspect of cross vectors exists or is that last part utter rubbish? Let $X$ be a smooth projective variety over $\mathbb{C}$, then the Neron-Severi group $NS(X)$ of $X$ is defined to be the Picard group of $X$ modulo algebraically equivalent relations.   On the other hand, by the exponential sequence, there is a first Chern class map  $$c_1: {\rm Pic}(X) \to H^2(X, \mathbb{Z}).$$ It is claimed that the image of $c_1$ coincides with $NS(X)$.   I want to know why this is true. Any suggestion or reference is greatly welcome! Any open subset of $\Bbb R$ is a countable union of disjoint open intervals Let $U$ be an open set in $\mathbb R$. Then $U$ is a countable union of disjoint intervals.    This question has probably been asked. However, I am not interested in just getting the answer to it. Rather, I am interested in collecting as many different proofs of it which are as diverse as possible. A professor told me that there are many. So, I invite everyone who has seen proofs of this fact to share them with the community. I think it is a result worth knowing how to prove in many different ways and having a post that combines as many of them as possible will, no doubt, be quite useful. After two days, I will place a bounty on this question to attract as many people as possible. Of course, any comments, corrections, suggestions, links to papers/notes etc. are more than welcome. Resizing an image in a post? Accessing UI thread handler from a service Dirac delta function and volume charge density I just got introduced to the Dirac delta function and one of the questions was to express volume charge density $\rho({\bf r})$ of a point charge $q$ at origin. I saw that the answer is related to Dirac delta function as: $$\rho({\bf r}) = q \delta^3({\bf r})$$ where $\delta^3({\bf r})$ is the 3-dimensional Dirac Delta function. Why is it so? Expressing using properties of vectors It is given in question that $x+a=(a.x)b$ and it is stated that a,b and x are vectors.It is also stated that $a.b$ not equal to $1$.The question ask to express $x$ in term $a$ and $b$,how do you this? sed - replace string with file contents I have two files: file1 and file2.  file1 has the following contents:  ---   host: "localhost"   port: 3000   reporter_type: "zookeeper"   zk_hosts:      - "localhost:2181"   file2 contains an IP address (1.1.1.1)  What I want to do is replace localhost with 1.1.1.1, so that the end result is:  ---   host: "1.1.1.1"   port: 3000   reporter_type: "zookeeper"   zk_hosts:      - "1.1.1.1:2181"   I have tried:  sed -i -e "/localhost/r file2" -e "/localhost/d" file1 sed '/localhost/r file2' file1 |sed '/localhost/d' sed -e '/localhost/r file2' -e "s///" file1   But I either get the whole line replaced, or the IP going to the line after the one I need to modify. Does magic missile hit silent image's illusory creature? How to use if-else option in JSTL How to split strings into text and number? I'd like to split strings like these  'foofo21' 'bar432' 'foobar12345'   into  ['foofo', '21'] ['bar', '432'] ['foobar', '12345']   Does somebody know an easy and simple way to do this in python? Pullback of locally free sheaves is locally free states that if $f:X \rightarrow Y$ is a morphism of ringed space, $G$ is a locally free $O_Y$-module, then $f^*G$ is a locally free $O_X$ module.     Suppose that $G$ is a locally free $O_Y$ module, hence it is a free $O_Y|_U=O_U$ module. We have an induced map  $$f^{-1}(U) \rightarrow U$$ given by restriction of morphism of ringed spaces.   Hence, as $\bigoplus O_U \simeq G|_U$, $f^*:Mod(O_U) \rightarrow Mod(O_{f^{-1}(U)})$ is functorial, $f^*(G|_U) = (f^*G)|_{f^{-1}(U)}$, we have isomoprhism,  $$ \bigoplus O_{f^{-1}(U)} \simeq (f^*G)|_{f^{-1}(U)} $$ Let $$f(x)=\begin{cases} \sin \tfrac 1 x &amp;\text{if $x\ne 0$}\\ 0 &amp; \text{if $x = 0$.}\end{cases}$$ I have to show that $f$ has the intermediate value property. That is, for any $a &lt; b$, if $y$ is any real number such that $f(a) &lt; y&lt; f(b)$ or $f(a)&gt;y&gt; f(b)$, then there exists a $c \in (a,b)$ such that $f(c)=y$.  I feel like I kind of know how to go about completing this. I just am curious as to if I have to create a bound such as letting $a = -1$ and $b = 1$, or keep $a$ and $b$ both arbitrary. I was reading . They are performing a logistic regression (with R). At some point they calculate the probability of getting a residual deviance higher than the one they got on a $\chi^2$ distribution with degrees of freedom equal to the degrees of freedom of the model. Copying-pasting from their website...   &gt; glm( cbind(using,notUsing) ~ age + hiEduc + noMore, family=binomial)  Call:  glm(formula = cbind(using, notUsing) ~ age + hiEduc + noMore,            family = binomial)   Coefficients: (Intercept)     age25-29     age30-39     age40-49       hiEduc       noMore       -1.9662       0.3894       0.9086       1.1892       0.3250       0.8330    Degrees of Freedom: 15 Total (i.e. Null);  10 Residual Null Deviance:      165.8  Residual Deviance: 29.92        AIC: 113.4        The residual deviance of 29.92 on 10 d.f. is highly significant:  &gt; 1-pchisq(29.92,10) [1] 0.0008828339       so we need a better model     Why does it make sense to compute 1-pchisq(29.92,10) and why does a low probability indicate that something is going wrong with their model? How can I download an older version of Xcode? I am trying to download Xcode from the App Store, but it says that I have to have a newer version of macOS. But I don't have enough space on my computer to upgrade. Its like 8 gigs or something like that and if I only could download Xcode that was compatible with macOS Sierra that would be nice.