It works (not as I wanted, the loop breaks if there is any 'x' present in the text like 'asdx') if I set condition as c=='x' but not if I put it as s=="x" (so loop breaks only if I type a single x only)  public static void main(String[] args) throws IOException {     InputStreamReader i = new InputStreamReader(System.in);     String z = "";     boolean bool=true;     while (bool==true) {         int x = i.read();         char c = (char) x;         String s = Character.toString(c);         z += s;         if (s=="x") {             bool=false;         }     }     out.println(z); }
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?
What are "schlieren" in English? The German word for these patterns is "Schliere, pl. Schlieren", and apparently this word has entered the English language as a loanword (cf. article  in Wikipedia or entry  in OED). But the German loanword is probably not something most native speakers of English understand without the help of a dictionary, so what would you call, or how would you describe, the following patterns?  Concrete:    Air:    Oil on water:    Coffee and milk:    Paint:    Smoke:    Rock:    Marbled paper:    And so on.    "Waves" is not applicable, because waves are vertical undulations of the surface, while these are a pattern on, or inside, the surface level, with no amplitude.  "Striæ" does not really fit either, because those refer more to the parallel layers, than to the curly forms. This was a 'young-adult' SF novel I read in the late 1970's, about the same time I was reading Voorloper by Andre Norton, Madeleine L'engle's Wrinkle In Time books and the Dragonfall 5 young adult novels. so I am not sure if it is actually one of the Dragonfall 5 stories, but I can't confirm it is or isn't by reading available synposes online.   As I recall, the story went something like this...    * SOME SPOILERS BELOW *  A young person and sibling - I think female protag and younger brother, but not sure - is scheduled to visit their aunt and uncle on another planet but to make the voyage in a timely fashion, must utilize this new consciousness transference technology to transmit their consciousness across the cosmos to a host replica body at the destination. After arriving at the destination the protagonist is impressed by their new body and is aware of the only way to tell they are in a replicant body is a small seam, scar or patch on their back, I think near the top of their spine, just below the collar of whatever clothing they wore.  The mystery begins when the protagonist realizes their hosts also sport the same scar when they should legitimately be in their real bodies.  The plot thickens when the protag or sibling finds a room of people in stasis when their replicant counterparts are roaming the same planet, and is subsequently caught in the act.  Sadly, I do not remember anything else, including the reasoning behind the deception.  I was quite young when I read this novel, so I probably got some of the details mixed up, but would love to know the name and author of the novel if anyone remembers. Are there guidelines on how much free RAM a phone should have - specifically Samsung Galaxy S? Will Stack Exchange 2.0 websites stay free of ads for the next 2 years? I would like to protect the formatting of a cell (or a range of cells) in a Google Spreadsheet, but still allow changing the data in that (or those) cell(s).  For example, I want to add a validation rule on a cell that says the cell has to contain a number between 1 and 10, and I would like others to be able to change the value in that cell, but not the validation rule itself.  How do I do that?  So far I was only able to completely protect the cell (content + formatting) or not at all (the user can change the content as well as the formatting).  To me this seems to be an important functionality when adding access rights to spreadsheets. Is it possible that it is completely missing from Google Spreadsheets? How to enable automatic update in wordpress running on IIS7 and Windows 2008? I have a dedicated server using Windows 2008 and IIS7 running 5 blogs with Wordpress. I can't use the autoupdate feature of the wordpress neither the automatic plugin instalation.  I believe I must set writing permissions in some temporary folder, the question is which one. Do you have any idea? Possible Duplicate:          I was thinking about making a pacman clone, I know there is a similar question here  , but I know i can't use the original art from the game because it belongs to Namco, so if I design a character that has the shape of the slice circle it will look exactly like pacman, maybe if I use green instead of yellow? Also if the game plays like the original pacman, it is wrong?  I just want to make the game as a personal project and and publish it in my site without getting in trouble Understanding the -exec option of `find` How do I change my update server in Ubuntu 18.04? The first thing I did after installing 16.04 LTS was to change my update server to Main Server. I can not find a similar option in Ubuntu 18.04.  How do I change it? Is just after your PhD a good time to switch your research area? I am finishing my PhD soon. The area in which I pursued my PhD is very challenging as I was only able to publish couple of papers even after spending many years. I want to switch into other research are due these reasons   to attract more students  to be comfortable to do research (along with teaching, I should be able to do research)   Even though I like the research I am doing right now, I seem to be isolated in my university. If ten students join my university for a PhD, hardly one student takes this area. My research area is not like machine learning or deep learning etc, so researchers of my domain are also not that much interested in my work.   The thing is I can work different research area but: Is this the right time? I am heading to a post-doc and learning a new area will probably take several months. Although my switch is not 180 degree, I am still worried. What is the result of $ \lim_{n \to \infty} \frac{ \sum^n_{i=1} i^k}{n^{k+1}},\ k \in \mathbb{R} $ and why? How do you fix a bad merge, and replay your good commits onto a fixed merge? Need help in the longtable with the figure Extension fields isomorphic to fields of matrices Suppose $K \subset L$ is a finite field extension of degree $m$. Is it true that there exists some natural $n$ such that $L$ is isomorphic to a subfield of $M^{n\times n}(K)$, the ring of $n\times n$ matrices with entries in $K$? What is the smallest dimension (as a function of $m$) for which an isomorphism exists?  The example I had in mind was the 2-dimensional extension $\mathbb{R} \subset \mathbb{C}$ with $\mathbb{C}$ being isomorphic to $\{ \begin{pmatrix}a&amp;-b\\b&amp;a\end{pmatrix} : a, b \in \mathbb{R}\}$. How do you auto resize cells in Excel? Beamer Bibliography Icon I want to list my references in a beamer presentation using thebibliography environment, with the nice little    book icon (\beamertemplatebookbibitems) and  article icon (\beamertemplatearticlebibitems)   in front of each source.  Is there an icon for websites too? something like \beamertemplatewebsitebibitems? If not, is there a way to implement this easily ? $ a+b+c+d=6 , a^2+b^2+c^2+d^2=12$ $\implies$ $ 36 \leq 4(a^3+b^3+c^3+d^3)-(a^4+b^4+c^4+d^4) \leq48 $ Let $a , b, c, d$ be real numbers such that $$ a+b+c+d=6 \\ a^2+b^2+c^2+d^2=12$$  How do we prove that $$ 36 \space \leq\space 4(a^3+b^3+c^3+d^3)-(a^4+b^4+c^4+d^4) \space\leq48\space$$ ? Let $B$ be a commutative domain and $A \subseteq B$ a subring. Suppose that the extension $A \to B$ is finite, i.e. $B$ is finitely generated as an $A$-module. If $I \cap A = \lbrace 0 \rbrace$ for some ideal $I$ of $B$, can we conclude that $I = \lbrace 0 \rbrace$?  I know that if $I$ contains a nonzero prime ideal, the statement holds since $A \to B$ is an integral extension, whereby no two comparable prime ideals of $B$ can have the same intersection with $A$. But does the statement still hold if $I$ does not contain a nonzero prime ideal? And what if $A \to B$ is only assumed to be an integral extension? Differences between hash- and encryption algorithms? There is a lot of confusion between hash- and encryption algorithms; I would like to understand:   When do we use a hash algorithm and when do we use an encryption algorithm (a cipher)? How difficult it is to reverse hash- and encryption algorithms? From the theoretical/mathematical perspective, what differentiates a hash- and encryption algorithm? Prove that $\text{rank}(X^TX)=\text{rank}(X)$ Prove, for real $X$, that $\text{rank}(X^TX)=\text{rank}(X)$.  Could anyone please help me with this problem? I've tried to use full-rank factorization and rank-related theorems mentioned in my book but still failed to solve this. I am learning linear algebra by myself and my book has no solutions manual so I find it really hard to get used to solve linear algebra problems.    Many thanks in advance for your help!