I am a beginner in Java and I'm currently facing a problem that I'm not sure how to qualify. I'm trying to do a login in my app. Here's part of my code:           PreparedStatement statement = connect.prepareStatement("SELECT `userName`,`password` FROM `member` ");          //creating a variable to execute query         ResultSet result = statement.executeQuery();          //while (result.next()) {          if (result.next()) {              if  (result.getString("userName") != getUserNameTextField()) {                 System.out.print("DB " + result.getString("userName") + " TF " + getUserNameTextField() + "\n");                 System.out.print("Incorrect username");                 //break;             } else if ...... }   There are no compiler errors, the project is built and run successfully in Eclipse. I was initially only testing if both username and password match, then successful login; else unsuccessful login. Since I was receiving the unsuccessful login output, I then tried to determine if it was the username or password that was incorrect. The output pointed out that it was the username, and since I couldn't figure out what I was doing wrong, I decided to print both the username retrieved from my DB and the one I entered in the textfield. The result of the print statement in the console in Eclipse is as follows:  DB Smith TF Smith  Incorrect username  The username retrieved from my DB is Smith and the one entered in the textfield is also Smith, and there are no errors in Eclipse, so now I'm even more confused.   I was using  while (result.next()){...login validation code..} first; after some research, I also tried if (result.next()) { do {..login validation code..} while (result.next()} - but everything I tried results in the same output in Eclipse.   I have a vague impression that I should be using the while (result.next()) itself and that this problem may have to do with the Java memory model (heap and stack), but I'm not sure. Can anyone point me in the right direction? Thanks.
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?
I am trying to show that $X^n-Y^m$ is irreducible in $\Bbb{C}[X,Y]$ iff $\gcd(n,m)=1$ where $n,m$ are positive integers.    I showed that if $\gcd(n,m)$ is not $1$, then $X^n-Y^m$ is reducible. How to show the other direction. Please help. Drift velocity in Drude model I am trying to assign an image texture to an Image Texture node in 2.80. Very simple script - I'm just starting to learn how this stuff works.  This is what I have. It creates an image and and IT node, but it doesn't assign the one to other. Can anybody help? I've searched around, but can't find it in another question.  import bpy  #create blank image bpy.ops.image.new(name="TestImg", width=1024, height=1024)  #add image texture to object, to hold baked lighting mat = bpy.context.view_layer.objects.active.active_material image_node = mat.node_tree.nodes.new('ShaderNodeTexImage')  #assign image to image texture node image_node.image = "TestImg"   Thanks in advance. Earlier I asked a question about  and got the answer that while it is only necessary for anonymous types, that it is used nonetheless to make writing code 'quicker'/easier and 'just because'.  Following  I saw that var gets compiled down to the correct type in the IL (you will see it about midway down article).  My question is how much more, if any, IL code does using the var keyword take, and would it be even close to having a measurable level on the performance of the code if it was used everywhere? I realize this is a long shot, but my phone was lost or stolen a few hours ago.  At the time it was stolen, I didn't have any specific applications installed to track it or wipe the data. So... my bad. I'm hoping the fact that I have a pattern lock will at least prevent anyone from accessing my data.  My question is, do I have any options for tracking or data wipe after the fact? (I'm more interested in tracking.)  Note: I have read similar questions, but unless I'm mistaken, they all address the question in terms of preparation before losing the phone. I'm asking about fallback options after losing the phone. table of contents no word separation Is it possible to have in the toc no word separation but have a word separation in the chaptername:  For example:   Contents  1. max Mustermann   Chapter  Max Muster- mann What's the bad magic number error? What's the "Bad magic number" ImportError in python, and how do I fix it?  The only thing I can find online suggests this is caused by compiling a .py -> .pyc file and then trying to use it with the wrong version of python. In my case, however, the file seems to import fine some times but not others, and I'm not sure why.  The information python's providing in the traceback isn't particularly helpful (which is why I was asking here...), but here it is in case it helps:  Traceback (most recent call last):   File "run.py", line 7, in &lt;module&gt;     from Normalization import Normalizer Command for argmin or argmax? How can you get the argmin or argmax in Latex? Two solutions I found are:  \underset{x}{\operatorname{argmax}}   \DeclareMathOperator*{\argmin}{arg\,min}   Any other ideas?  [1]   [2] My wife has a Canon EF 100-400 f4.5-5.6L IS USM Telephoto Zoom Lens. Price is not that important to me, but I am unsure which of the four extenders I should purchase.  Canon has four extenders that I have found:    1.4x EF MIII  1.4x EF MkII 2x EF MkIII  2x EF MkII   Logic would state that the 2x units should give the benefit of much further distances to be accessible, however the 2x units seem to get a much worse press than the 1.4x. Again logic states that the Mk IIIs should be better than the Mk IIs but again I am left confused by the reviews I have found.  It appears that with most of these lenses autofocus may be lost, we tried a non expensive lens from the store(£80) which had the same problem, however the image on the camera appeared good.  I am a complete amateur. I am asked to determine if a series converges or not:  $$\displaystyle\sum\limits_{n=1}^{\infty} \frac{(2^n)n!}{(n^n)}$$  So I'm using the $n$th root test and came up with $\lim_{n \to {\infty}}\frac{2}{n}\times(\sqrt[n]{n!})$ I know that the limit of $\frac{2}{n}$ goes to $0$ when $n$ goes to infinity but what about the $(\sqrt[n]{n!})$? How to make a vf page with the same look &amp; feel as salesforce1, any ideas? Question about preposition -of- Sentence:      A set of deer antlers lying on a flat stone just inside [of?] one cave reveals more recent visitors.   Should we use preposition -of- in that case?  I have checked Corpus of Contemporary American English and have found examples of both usages:        ...to plant another 20 acres of vines, finish building the inside of   an on-site cave, and work on building a retail tasting room (Fiction)   However, opened and remained blue as the inside of an ice cave, paler   than the shell of a robin's egg (Fiction)   It looked like the wall on the inside of a cave: flat and kind of   scale (Fiction)   ...-To protect the inside of the cave. " // He stepped inside, leaving   the gate open.  (Fiction)     Views outside and inside of Wind Cave in South Dakota (Magazine)   Above, Black Hills grasslands and, right, boxwork inside of the cave   (Magazine)   You can see Bill Elliott's great photos of what you can see inside a   cave. (Spoken)   So, when I am asked, what was your feeling inside the cave? (Spoken)   At some point, we found a small river running through the inside the cave (Spoken)   We were gathered around a small fire inside the cave (Fiction)   About 700 feet inside El Sidrn cave, a research team including   Lalueza-Fox excavated 1,700 bones (Academy)      I still cannot come up with a clear pattern why we are using -of- in some cases but are not using it in other. Is it more a question of style rather then a grammar? Or it has something with how speaker/writer sees things around and perceives a reality? Does absence of -of- make things sound weird/wrong for native speaker? Thanks. Scanner issue when using nextLine after nextXXX What determines which frames are inertial frames? Creating all possible line segments between all points using QGIS I want to connect all points in a point feature with every possible line segment using QGIS. For example, how a pentagon has five points with ten line segments connecting them all to form a pentagram inside. Alternatively phrased: How do I make spokes when all the points are hubs? I don't care about the order, I just want every connection between two points as one line each. Is there a tool or script that can do this in QGIS? This topic () is the closest to what I want but the plugins are no longer supported. How do I delete multiple rows in Entity Framework (without foreach) What is the structure in "as best you can"? I instinctively translate it "as best as you can", however this makes no sense.  What is the real structure behind this phrase?  I'll include an  to illustrate the historical presence of this phrase:    Whatever the structure is, I'm guessing that it has something to do with 19th century grammar. Flash drive .docx disappeared files Illustrating op amp feedback without control theory We are teaching op amps in a high school class, before calculus.  So we can't use control theory to teach how op amps respond.  All the same, I would like to have an intuitive explanation for how a feedback circuit works.  Take the negative feedback, for instance.  Is there a clear way to show how an initial difference of delta between V+ and V- leads to a very large (G(V+ - V-)) difference in the output, which then leads to ...  I'd like to be able to take that argument and show how the voltage of the output converges in addition to the standard virtual short argument.  Can anyone explain it clearly? How to create a table with long text and which packages use