I've created this change password interface, but for some reason it doesn't seem to be updating the password in the database, which means something is wrong with my code. Could someone please take a look, thanks! The problem is not comparing strings, as I have corrected that and it is still not working, so can I please have this question reopened, thanks :)  ChangePassword.html  &lt;!DOCTYPE html&gt;  &lt;html&gt;  &lt;head&gt;  &lt;meta charset = "UTF-8"&gt;  &lt;title&gt;Change Password&lt;/title&gt; &lt;/head&gt;  &lt;body&gt;     &lt;form action ="NewPassword" method = post&gt;      &lt;h1&gt;Change Password&lt;/h1&gt;     &lt;b&gt;Enter Old Password:&lt;/b&gt;     &lt;br&gt;     &lt;input type = "password" name = "oldpassword" size = "20"&gt;      &lt;br&gt;     &lt;br&gt;     &lt;b&gt;Enter New Password:&lt;/b&gt;     &lt;br&gt;     &lt;input type = "password" name = "newpassword" size = "20"&gt;      &lt;br&gt;     &lt;br&gt;     &lt;b&gt;Confirm New Password&lt;/b&gt;     &lt;br&gt;     &lt;input type = "password" name = "confirmpassword" size = "20"&gt;      &lt;br&gt;      &lt;br&gt;     &lt;input type = "submit" value = "Update Password"&gt;     &lt;br&gt;     &lt;br&gt;     &lt;/form&gt;. &lt;/body&gt;  &lt;/html&gt;   NewPassword.java  import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*;  public class NewPassword extends HttpServlet {      protected void doPost(HttpServletRequest request, HttpServletResponse response)             throws ServletException, IOException {                  response.setContentType("text/html;charset=UTF-8");                 PrintWriter out = response.getWriter();                  String oldpassword = request.getParameter("oldpassword");                  String newpassword = request.getParameter("newpassword");                  String confirmpassword = request.getParameter("confirmpassword");                   HttpSession session = request.getSession(false);                 String employeeid = "";                   if(session != null) {                      employeeid = (String)session.getAttribute("employeeid");                  }                  boolean st = false;                  try {                      Class.forName("com.mysql.jdbc.Driver").newInstance();                      Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/payroll_system", "root", "");                      PreparedStatement ps = con.prepareStatement("SELECT pwd FROM payroll_system.employee_login WHERE employeeID = ?");                     ps.setString(1, employeeid);                     ResultSet rs = ps.executeQuery();                      st = rs.next();                      if(st) {                           String currentpassword = rs.getString("pwd");                          if((currentpassword.equals(oldpassword)) &amp;&amp; newpassword.equals(confirmpassword)) {                              PreparedStatement pd = con.prepareStatement("UPDATE payroll_system.employee_login SET pwd = ? where employeeID = ?" );                              pd.setString(1, newpassword);                             pd.setString(2, employeeid);                             ResultSet rd = pd.executeQuery();                              st = rd.next();                              if(st) {                                  out.println("successfully updated password");                             }                         }                       }                 }catch(Exception e)                  {                      e.printStackTrace();                  }                out.close();        }    }
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?
Which is correct: "the below information" or "the information below"? After upgrading to Windows 8, hard disk sporadically does not work; what's wrong? I dont know whether I can ask this question here or not. Please consider this if it not a proper place.  Here is my problem, I was using Windows XP previously and I changed it with Windows 8. After installation of Windows 8 when I booted it up, I found my HDD behavior changed. Sometimes it is running and sometimes it is not.  My system specification is :  Intel Motherboard (945 Express Chipset) Processor (Core 2 duo) RAM (2 GB) HDD(500 GB)   When I open my HDD for getting the cause of problem (I open that casing and check head  and disk). I did not find any hardware visible problem. Just it is stop rotating, before it can boot OS.  Can someone help me to fix this problem or recover data in this case.  NOTE : Warranty period expired, and I have my 5 projects in that and some important documents. Is it possible to have an ASP.NET MVC route that uses subdomain information to determine its route?  For example:   user1.domain.com goes to one place user2.domain.com goes to another?   Or, can I make it so both of these go to the same controller/action with a username parameter? Defining my own None-like Python constant If $|f(z)|\le |f(z^2)|$ then prove that $f$ is constant Let $\Bbb D$ be the open unit disc and $f:\Bbb D\to\Bbb C$ be an analytic function such that $|f(z)|\le |f(z^2)|$, for all $z\in\Bbb D$. Prove that $f$ is constant.   Here is my proof:   For any $0&lt;r&lt;1$, consider the closed disc $B=\{z\in \Bbb D:|z|\le r\}$. Then the given condition implies that $|f(z)|\le |f(z^{2^n})|$, for all $n\in\Bbb N$ and for $z\in B$. Since for $z\in B$, $|z^{2^n}|\le r^{2^n}\to 0\implies z^{2^n}\to 0$. So by continuity, $|f(z)|\le |f(0)|$, for all $z\in B$. So by the Maximum modulus theorem, $f$ is constant on $B$. By the uniqueness theorem, $f$ is constant on $\Bbb D$. Is this correct? Let me know if there is any fallacy. Find an explicit isomorphism of the map $h: \Bbb F_5[x]/(x^2+x+2) \to \Bbb F_5[x]/(x^2+4x+2)$  I take the question to mean showing the 2 rings are isomorphic by finding an explicit mapping of each element.   I think $x^2+x+2$ and $x^2+4x+2$ are irreducible over $\Bbb F_5$, so these are both fields.  Also $x^2=4x+3$ in the first case and $x^2=x+3$ in the second.  But beyond these basic facts I'm not sure how I should proceed. When water climbs up a piece of paper, where is the energy coming from? Take a glass of water and piece of toilet paper. If you keep the paper vertical, and touch the surface of the water with the tip of the paper, you can see the water being absorbed and climbing up the paper. This climbing up is intriguing me. Where is the energy coming from?  Supposedly, a lot of water molecules are moving up and gaining potential energy. This has to be balanced by something. I can think of a few possibilities, but I can't tell which one it is.   When the water molecules dilute into the paper, they are at a state of lower potential binding energy. Some molecular interaction (van der Waals?) is at lower energy when you have a water+paper solution, compared to a water-only solution. This compensates the gain in gravitational energy. The surface between the paper and the water is at lower pressure than the atmosphere. This causes the water to be pushed into the paper by the atmospheric pressure, up until the point that the column of water above the surface is heavy enough to counterbalance. The potential energy would be a result of work done by the atmosphere. Some water molecules climb up randomly and loose kinetic energy going up, and somehow get "stuck" up there. Something else? How did the Swooping Evil Venom infused rain affect the magical community? I didn't see any wizards drenched in the rain at the end of Fantastic Beasts and Where to Find Them (don't recall, actually). But would the rain equally affect the wizards as it did no-maj's?   This event is something that doesn't necessarily need to be forgotten by the Wizarding community. How would they avoid being obliviated by the rain?  (They could avoid the rain by Apparating, but what about the showers and drinking water?)  This question is picking at my brain. Is there a word for someone who has others do all their work for them? In a way like a slave master. More though like say someone who had robots do all their work and they were never themselves productive and had no drive. If you've read R.U.R. you'll understand the question better. I'm looking for a word with more definition than just lazy.  Update 1: It think I may actually go with drone if anything. I think that definition fits what I'm looking for the best. I also liked the definition of the British term layabout that one person mentioned, but I will probably use drone. Thanks for all the help and sorry if I was confusing or unclear.  Update 2: I needed this word for use in an essay I was writing which I have now handed in. Thanks for the help guys. No more suggestions needed. In email applications should the text of the cover letter be stated directly in the email or be attached in a separate file? How to "inverse match" with regex? Find and extract a number from a string Prove $\int\cos^n x \ dx = \frac{1}n \cos^{n-1}x \sin x + \frac{n-1}{n}\int\cos^{n-2} x \ dx$ I am trying to prove  $$\int\cos^n x \ dx = \frac{1}n \cos^{n-1}x \sin x + \frac{n-1}{n}\int\cos^{n-2} x \ dx$$  This problem is a classic, but I seem to be missing one step or the understanding of two steps which I will outline below.   $$I_n := \int\cos^n x \ dx = \int\cos^{n-1} x \cos x \ dx \tag{1}$$  First question: why rewrite the original instead of immediately integrating by parts of $\int \cos^n x \ dx$?  Integrate by parts with $$u = \cos^{n-1} x, dv = \cos x \ dx \implies du = (n-1)\cos^{n-2} x \cdot -\sin x, v = \sin x$$  which leads to  $$I_n = \sin x \ \cos^{n-1} x +\int\sin^2 x (n-1) \ \cos^{n-2} x \ dx \tag{2}$$  Since $(n-1)$ is a constant, we can throw it out front of the integral:  $$I_n = \sin x \ \cos^{n-1} x +(n-1)\int\sin^2 x \ \cos^{n-2} x \ dx\tag{3}$$  I can transform the integral a bit because $\sin^2 x + cos^2 x = 1 \implies \sin^2 x = 1-\cos^2 x$  $$I_n = \sin x \ \cos^{n-1} x + (n-1)\int(1-\cos^2 x) \ \cos^{n-2} x \ dx \tag{4}$$  According to Wikipedia as noted , this simplifies to:  $$I_n = \sin x \ \cos^{n-1} x + (n-1) \int \cos^{n-2} x \ dx - (n-1)\int(\cos^n x) \ dx \tag{5}$$  Question 2: How did they simplify the integral of $\int(1-\cos^2 x) \ dx$ to $\int(\cos^n x) \ dx$?  Assuming knowledge of equation 5, I see how to rewrite it as  $$I_n = \sin x \ \cos^{n-1} x + (n-1) I_{n-2} x  - (n-1) I_{n} \tag{6}$$  and solve for $I_n$. I had tried exploiting the fact that  $$\cos^2 x = \frac{1}{2} \cos(2x) + \frac{1}{2} $$  and trying to deal with $\int 1 \ dx - \int \frac{1}{2} \cos (2x) + \frac{1}{2} \ dx$  which left me with $\frac{x}{2} - \frac{1}{4} \sin(2x)$ after integrating those pieces. Putting it all together I have:  $$I_n = \sin x \ \cos^{n-1} x + (n-1) I_{n-2} x \left(-(n-1) (\frac{x}{2} - \frac{1}{4} \sin 2x) \right) \tag{7}$$  but I'm unsure how to write the last few terms as an expression of $I_{something}$ to get it to match the usual reduction formula of   $$\int\cos^n x \ dx = \frac{1}n \cos^{n-1}x \sin x + \frac{n-1}{n}\int\cos^{n-2} x \ dx$$ How to make ttf-mscorefonts-installer package download fonts, after it says it installed? When I install "Installer for Microsoft TrueType core fonts" (ttf-mscorefonts-installer) from the Software Center on 14.04, it gives a positive response--but after this I get a download error. It seems that the files actually providing the fonts are never retrieved. Is there any way to resolve this? how to prove $\mathbb Z_n$ has divisors of zero if and only if $n$ is not prime A non-zero number $a \in \mathbb Z_n$ is called a divisor of zero if there is a non-zero number $b \in \mathbb Z_n$ such that $ab\equiv 0\pmod n.$  How can I prove $\mathbb Z_n$ has divisors of zero if and only if $n$ is not prime.  I filled out the addition and multiplication tables for modulo 6 and 7 and tried to find out the relation, and it's definitely true. I know I need to prove it in both directions since it is an 'iff' question. But I still don't get it. I searched here and see mention of Clonezilla and Remastersys - but nothing I found answered my question completely, so I ask:  My home PC is just a generic one, and now that I changed it to Ubuntu I really love how it's come out and how it runs better !  My office PC is a different generic set of hardware, and I'd like to 'clone' the exact same setup to it but not have to repeat all the tweaking and such that I did already.  Is there a program that will allow me to replicate/install my already customized setup from one to the other, easily ? Are there certain steps I must make before doing something like that so it'll be compatible with different hardware ?  Thanks ! why does IE need for me to click twice What is the difference between 'located in' and 'located on'? An equality involving the mean value property I am trying to establish that  $$\frac2{\pi}\int_0^{2\pi} f(e^{i\theta})\cos^2\left(\frac{\theta}{2}\right)\;\mathrm d\theta=2f(0)+f^\prime(0)$$  for $f$ analytic on $|z| &lt; R,\; R &gt; 1$  I think I am making a mistake somewhere, please point it out to me.Here's what I've done unsing the mean value property and Cauchy's integral formula:  $$2f(0)+f&#39;(0)=2(\frac1{2\pi}\int_0^{2\pi} f(e^{i\theta})d\theta + \frac1{2\pi i}\int_0^{2\pi}\frac{f(e^{i\theta})ie^{i\theta}}{e^{i2\theta}}=\frac{1}{\pi}\int_0^{2\pi} f(e^{i\theta})d\theta\frac1{2\pi}\int_0^{2\pi}\frac{f(e^{i\theta})}{e^{i\theta}}\quad\text{(1)}$$  But when I develop the expression $\frac2{\pi}\int_0^{2\pi} f(e^{i\theta})\cos^2(\frac{\theta}{2}) d\theta$ I get:  $$\frac1{\pi}\int_0^{2\pi} f(e^{i\theta})d\theta+\frac1{2\pi}\int_0^{2\pi}f(e^{i\theta})[{e^{i\theta}}+e^{i-\theta}]d\theta \quad\text{(2)}$$  The second integral in (1) differs from the second integral in (2). Thanks. What is the name of the horizontal division line? What is the name of the horizontal division line? Is there a name for it other than "division line?