I am passing data through a bean, but whenever I use the passed data in a if function it never passes the first check.  I will also post the result for just printing out the Get_Functions I am using.  The inputs I use are just admin and password.  JSP Code:  &lt;jsp:useBean id="user" class="User.GetInfo" scope="session"/&gt;  &lt;HTML&gt; &lt;BODY&gt; &lt;% if (user.getUsername() == "admin") {     if (user.getPassword() == "password" ) {         session.setAttribute( "LoggedIn", true );         response.sendRedirect("AdminPage.jsp");      } else {         session.setAttribute( "LoginError", "Wrong password." );          response.sendRedirect("AdminLogin.jsp");     } } else {      session.setAttribute( "LoginError", "Wrong username." );      response.sendRedirect("AdminLogin.jsp"); } %&gt; &lt;/BODY&gt; &lt;/HTML&gt;   Results for just printing out code:  You entered  Name: admin  Email: password
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?
Explanation of method for showing that $\frac{0}{0}$ is undefined I'm doing a bit of self study, but I'm uncomfortable with a certain idea. I want to show that $f(z)$ is analytic if and only if $\overline{f(\bar{z})}$ is analytic, and by analytic I mean differentiable at each point. Here $f$ is a complex valued function.  What I do is write $f(z)=u(x,y)+iv(x,y)$, where $u$ and $v$ are real functions of two variables. Then $\overline{f(\bar{z})}=u(x,-y)-iv(x,-y)$.  These two forms look very similar, in the sense the one function being differentiable should immediately imply the other is differentiable, since the only thing really changing might be a $-$ sign popping out due to the chain rule.   How can I more rigorously express that $f(z)$ is analytic iff $\overline{f(\bar{z})}$ using this? Many thanks. How can I undo git reset --hard HEAD~1? Is it possible to undo the changes caused by the following command? If so, how?  git reset --hard HEAD~1 In Triangle, $\sin\frac A2\!+\!\sin\frac B2\!+\!\sin\frac C2\!-\!1\!=\!4\sin\frac{\pi -A}4\sin\frac{\pi -B}4\sin\frac{\pi-C}4$ To prove  $$\sin\frac A 2+\sin\frac B 2+\sin\frac C 2-1=4\sin\frac{\pi -A}4\sin\frac{\pi -B}4\sin\frac{\pi-C}4$$  My approach :   $$ \begin{align} \text{L.H.S.} &amp; = \sin\frac{A}{2}+\sin \frac{B}{2}+\sin\frac{C}{2} -1 \\[8pt] &amp; = 2\sin\frac{A+B}{4}\cos\frac{A-B}{4}+\cos\left(\frac{\pi}{2}-\frac{C}{2}\right)-1 \\[8pt] &amp; = 2\sin\frac{\pi -C }{4}\cos\frac{A-B}{4} - 2\sin^2\left(\frac{\pi -C}{4} \right) \\[8pt] &amp; =2\sin\frac{\pi -C }{4}\left\{ \cos\frac{A-B}{4} - \sin\left(\frac{\pi -C}{4} \right)\right\} \end{align} $$  Unable to move further please help. thanks. Applying Zorn's Lemma to natural numbers Zorn's Lemma states that if every chain $C$ in a partially ordered set $X$ has an upper bound then there is at least one maximal element in $X$.  Let $n\in \mathbb{N}$, $C_n \subset \mathbb{N}$ be the set containing the natural numbers $\{1,\dots,n\}$. Then if $k\le n$, $C_k\subset C_n$, so $C_n$ is a chain. Also, $C_n$ has an upper bound, such as $n+1$. But what is the maximal element of $\mathbb{N}$?  There's something I don't get in Zorn's Lemma statement. Restored iOS 10 with broken Home button I restarted my iPhone 6 running iOS 10 and the home button is broken, so I was using Assistive Touch. But at the first launch, Assistive Touch is disabled. On iOS 10, we have to "Press home button to unlock".  What can I do? What is wrong with code snippets/blocks on Stack Overflow? I wasn't following Meta Stack Overflow too closely so maybe something was changed that I'm not aware of. But each time I paste a snippet from a Python console I'm getting wrong formatting. What I'm doing wrong? It seems that &gt;&gt;&gt; is confusing for Stack Overflow. I've tried to escape it with backslashes, and it was working fine in preview but doesn't work after the question is rendered.  I was able to observe that problem on: recent Chrome (Windows, Mac), Safari 4 (Mac).  Here is  I wasn't able to make right.  Funny, I think the snippets are rendered just fine on Meta Stack Overflow. Here is one:  &gt;&gt;&gt; def throw(): raise Exception()  ...  &gt;&gt;&gt; a=1 &gt;&gt;&gt; a=throw() Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt;   File "&lt;stdin&gt;", line 1, in throw Exception &gt;&gt;&gt; a 1 How do I install a fingerprint reader on Lenovo ThinkPad? I have a  with a fingerprint reader:    How to make Ubuntu recognise it and use it for login?  I already tried:  sudo add-apt-repository ppa:fingerprint/fingerprint-gui sudo apt-get update   ... but this GUI did not recognizes my device. Does anyone knows any other option? How is well-ordering in real line possible?  I know that the axiom of choice provides possible well-ordering, but intuitively, this does not seem to make sense.  How can you compare 1.111111.... and 1.111111... when we can never know the full digits of each number? Programming pattern to generate VGA signal with micro-controller? Hidden features of Python Batch renaming files I have a directory full of images:  image0001.png image0002.png image0003.png ...   And I would like a one-liner to rename them to (say).  0001.png 0002.png 0003.png ...   How do I do this? Let $k^p = k$, $K = k(x)$ and $F = k(u)$ for some $u \in K$. Show that $K/F$ is separable $\iff u \not\in K^p$. Let $K$ be the rational function field $k(x)$ over a perfect field $k$ of   characteristic $p &gt; 0$. Let $F = k(u)$ for some $u\in K$, and write   $u = f(x)/g(x)$ with $f$ and $g$ relatively prime. Show that $K/F$ is   a separable extension if and only if $u\notin K^p$.   There is already a post on this but it has not yet been answered :   The truth is that I am very confused with this problem, I would like someone please help me to understand what happens with this exercise and explain to me how it could be done by giving me a help or something. I already have an approach for the left-to-right implication, but I do not know very well how good it is. Could someone help me with the other implication please? Thank you very much. Ball motion with air resistance coupled differential equation for fourth-order Runge-Kutta I've created a MATLAB function for solving coupled differential equation with the fourth-order Runge-Kutta method based on what is provided  (Simultaneous Equations of First Order). Here the function:  function [y] = rk4_c(f, g, h, x, y, z, n) % Runge-Kutta % Implementation of the fourth-order method for coupled equations % h = dt % x is the time here  for ii=1:(n-1)     k1 = h * f(x(ii), y(ii), z(ii));     l1 = h * g(x(ii), y(ii), z(ii));     k2 = h * f(x(ii) + 0.5*h, y(ii) + 0.5*k1, z(ii) + 0.5*l1);     l2 = h * g(x(ii) + 0.5*h, y(ii) + 0.5*k1, z(ii) + 0.5*l1);     k3 = h * f(x(ii) + 0.5*h, y(ii) + 0.5*k2, z(ii) + 0.5*l2);     l3 = h * g(x(ii) + 0.5*h, y(ii) + 0.5*k2, z(ii) + 0.5*l2);     k4 = h * f(x(ii) + h, y(ii) + k3, z(ii) + l3);     l4 = h * g(x(ii) + h, y(ii) + k3, z(ii) + l3);     y(ii+1) = y(ii) + (1/6)*(k1 + 2*k2 + 2*k3 + k4);     z(ii+1) = z(ii) + (1/6)*(l1 + 2*l2 + 2*l3 + l4); end   I would like to use this function for solving motion equations for a ball with air resistance. So starting with the basic equations (I hope they are correct): $$md^2x/dt^2 = F_{D_x}$$ and $$md^2y/dt^2 = F_{D_y}-mg$$ with $$F_{D_x} = -Dvvcos(\theta)$$ and $$F_{D_y} = -Dvvsin(\theta)$$ where $D$ is a drag coefficient. From my understanding, and from what I read, both second-order equation can be converted to two coupled equations that could be used with my coupled Runge-Kutta method function. Can someone help me understand how to convert my equation to a set of coupled equations that could be used with my MATLAB function?  EDIT  I was able to use my rk4_c function, however it only works for solving the velocities. I'm now trying to see how I could solve for the positions x and y. I'm kind of learning about Runge-Kutta methods at the same time, so sorry for the questions that may sound trivials.  % Runge Kutta code to solve projectile motion with quadratic drag % dVx/dt = -(D/m)*vx*sqrt(vx^2+vy^2) % dVy/dt = -(D/m)*vy*sqrt(vx^2+vy^2) - g  clc clear all  % Constant D = 0.24; % m = 2; % kg g = 9.80665; % m/s^2  % Define function handles fVx = @(t,vx,vy) -(D/m)*vx*sqrt(vx^2+vy^2); fVy = @(t,vx,vy) -(D/m)*vy*sqrt(vx^2+vy^2) - g;  % Initial conditions v0 = 200; % m/s theta = 30*pi/180; % rad t(1) = 0; vx(1) = v0*cos(theta); vy(1) = v0*sin(theta);  % Step size h = 0.01; % s tFinal = 2; N = ceil(tFinal/h);  % RK4 simultaneous coupled loop for ii = 1:N     % Update time     t(ii+1) = t(ii) + h;      % Update vx and vy     k1 = h * fVx(t(ii), vx(ii), vy(ii));     l1 = h * fVy(t(ii), vx(ii), vy(ii));     k2 = h * fVx(t(ii) + 0.5*h, vx(ii) + 0.5*k1, vy(ii) + 0.5*l1);     l2 = h * fVy(t(ii) + 0.5*h, vx(ii) + 0.5*k1, vy(ii) + 0.5*l1);     k3 = h * fVx(t(ii) + 0.5*h, vx(ii) + 0.5*k2, vy(ii) + 0.5*l2);     l3 = h * fVy(t(ii) + 0.5*h, vx(ii) + 0.5*k2, vy(ii) + 0.5*l2);     k4 = h * fVx(t(ii) + h, vx(ii) + k3, vy(ii) + l3);     l4 = h * fVy(t(ii) + h, vx(ii) + k3, vy(ii) + l3);     vx(ii+1) = vx(ii) + (1/6)*(k1 + 2*k2 + 2*k3 + k4);     vy(ii+1) = vy(ii) + (1/6)*(l1 + 2*l2 + 2*l3 + l4); end  % Plot the solution figure(1) plot(t, vx, t,vy) xlabel('Time (s)') ylabel('Velocities (m/s)') legend('Vx', 'Vy') Is Dexterity overpowered compared to Strength? I have a problem understanding the proof of Rencontres numbers (Derangements) Unable to stylize raster data as pseudocolor render type on MAC OSX In a raster layer's Style Properties, I can choose pseudocolor render type, and choose a color ramp and classify the raster.      However, when I click the 'Apply' button, or click 'OK', the visualization of the raster never changes.  I was able to output a 'colorized' version of the same raster using GRASS plugin.  I also reinstalled QGIS 2.8, and was able to adjust and see a raster stylings using the steps I outlined above.  So, can anyone confirm this as an issue, or confirm that there's a mistake somewhere in my process?  I should note that I'm on a Mac, 10.10.4, and I'm using the QGIS provided by , 2.10.1-1 .  Update 1: Here's a screenshot of the rest of my settings.      I have Grayscale set to off in the Style setting.  Also, I don't believe grayscale/color-blind Preview is available on the Mac version of QGIS.  They're does't appear to be the option where it , in the Menu Bar under View / Preview / Photocopy (grayscale) etc.  Either way-- I added a shapefile to show color.  Update 2: I've experimented with setting color interpolation to discrete, linear, and exact, but still am not able stylize using Singleband pseudocolor.  I've also confirmed that the 'Render' box on the the main map view is checked.  Also, I am able to adjust Color Rendering settings, like Hue, Blending Mode, etc., and see the results when clicking 'Apply' or 'OK'.  Update 3: As other Mac users are confirming this, I think it may be a bug. I've created a bug report at the official . I am taking an abstract algebra course and I am really interested about the topic.  So much so that I spend most of my time reading supplementary materials.  I consequently know a lot more theorems than the ones covered in class.    In a recent quiz, I used a theorem in one of my proofs that was not mentioned in the lecture since.  My professor gave me partial marks for my answer for the reason that we didn't cover this theorem in class even though the proof was completely valid!  I can't really see where he is coming from.  How would someone be able to use a theorem correctly if he doesn't know its proof?  I was quite baffled by his comment.   Do you agree with this?  EDIT: The professor just Emailed me and said that after thinking for a while, he decided to award me the full mark for the question. He also mentioned that he didn't want discourage me from studying the subject (since he saw most of my previous quiz grades were full marks) and I was passionate about it, but kindly requested that I include any proof for a theorem that I cite from now on in his exams. He also sent a broadcast message to the whole class indicating this. Proof by Induction for inequality, $\sum_{k=1}^nk^{-2}\lt2-(1/n)$ Let $n$ be a positive natural number, $n\ge 2$. Then $\displaystyle\sum_{k=1}^n \frac{1}{k^2} \lt 2 - \frac{1}{n}.$   The basis step was easy but could someone give me a hint in the right direction as to how to do the induction step?  I tried this:  $\displaystyle\sum_{k=1}^k \frac{1}{k^2} + \frac{1}{(k + 1)^2} \lt 2 - \frac{1}{k + 1}$  But it's getting me nowhere or I am doing something wrong. I am no expert so a clear explanation would be appreciated. Thanks. I'm trying to do some scenes which use a mixture of 3D backgrounds with 2D animated characters.The best way I've figured this out so far is to use a plane with an image sequence of pngs which hold the frames.  The problem with this method is Blender seams to only load image sequences based on image numbering. If I wanted to do a sequence which loops say, frames 0-5, then repeats 4-0 for the 'return' of the animation, I would have to load frames doubled up.  Is there a way, maybe with a script, to change the sequence order? I can see it as a useful plugin but my python skills are pretty much non existent.