The following code tries to determine from which input field the user has filled via the getParameter() method:  protected void doPost(HttpServletRequest request, HttpServletResponse  response) throws ServletException, IOException {          System.out.println(request.getParameter("userinput"));          if(request.getParameter("userinput") != "userinput")             accessExampleView(request, response);         else             accessServletSubsidiary(request, response);      }   Visually, I am trying to find out whether the user entered a value in the first field, or the second:    However, each time this runs, it points to accessExampleView. I tried setting the if statement logic to:     if(request.getParameter("userinput") != null)   to no avail - the first line continues to be true and routes to the accessExampleView method.  Essentially, is there a better way to check what kind of value exists in request object?  Here is the JSP file that this utilizes:  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"     pageEncoding="ISO-8859-1"%&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="ISO-8859-1"&gt; &lt;title&gt;JSP HTML page&lt;/title&gt; &lt;/head&gt; &lt;body&gt;  &lt;form action="ServletHome" method="post"&gt; &lt;fieldset name="f1"&gt; This page communicates with the servlet page via input types. &lt;br&gt; &lt;br&gt; &lt;label&gt;Enter some text: &lt;/label&gt; &lt;input type="text" name="userinput"&gt; &lt;input type="submit" value="send"&gt; &lt;br&gt; Enter your age: &lt;input type="number" name="userAge"&gt; &lt;input type="submit" value="send"&gt; &lt;br&gt; &lt;/fieldset&gt; &lt;/form&gt;  &lt;/body&gt; &lt;/html&gt;
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?
Evaluate $\int_0^{\infty}\frac{\log x}{1+e^x}\,dx$ How to tell Google to crawl distinct part of the webpage? What approach should I take to make the website Google-friendly, .  The problem is that when a specific content is being requested (eg. ) user is taken to the page using scrollbar, though the surrounding content is still being loaded. How to tell Google that for this URL  only the #36 entry should be crawled.  Is there a tag or other way to select the surrounding content as irrelevant for the URL? What is a reliable method to locate floating islands in Terraria? What is the difference between new/delete and malloc/free?  Related (duplicate?): PyQGIS getting dictionary for each feature of layer with their attribute values The Safari Back Button Problem I do some minor programming and web work for a local community college. Work that includes maintaining a very large and soul destroying website that consists of a hodge podge of VBScript, javascript, Dreamweaver generated cruft and a collection of add-ons that various conmen have convinced them to buy over the years.   A few days ago I got a call "The website is locking up for people using Safari!" Okay, step one download Safari(v3.1.2), step two surf to the site. Everything appears to work fine.  Long story short I finally isolated the problem and it relates to Safari's back button. The website uses a fancy-pants javascript menu that works in every browser I've tried including Safari, the first time around. But in Safari if you follow a link off the page and then hit the back button the menu no longer works.  I made a pared down webpage to illustrate the principle.  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; &lt;html&gt; &lt;head&gt;&lt;title&gt;Safari Back Button Test&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt; &lt;/head&gt; &lt;body onload="alert('Hello');"&gt; &lt;a href="http://www.codinghorror.com"&gt;Coding Horror&lt;/a&gt; &lt;/body&gt; &lt;/html&gt;   Load the page and you see the alert box. Then follow the link off the page and hit the back button. In IE and Firefox you see the alert box again, in Safari you do not.  After a vigorous googling I've discovered others with similar problems but no really satisfactory answers. So my question is how can I make my pages work the same way in Safari after the user hits the back button as they do in other browsers?  If this is a stupid question please be gentle, javascript is somewhat new to me. Why did Eve die with Maelon's data available? I saved Wrex in ME1, I saved Maelon's data in ME2, the import screen in ME3 confirmed this.    When I get to the missions on Tuchanka, I completed every one of the side missions before starting the mission where they take down the Reaper and distribute the genophage cure.  Then when I finally get to the lab, Mordin tells me that Eve has died.    Yet every site I've been to says that keeping the data allows her to live.  So why did she die? At the end of . the author states that  Suppose we have $n \times n$ matrix $A$ having only positive elements and satisfying the property $a_{ij}=1/a_{ji}$ (a matrix satisfying this property is called a reciprocal matrix).  If its largest eigenvalue $\lambda_{max}$ is equal to $n$, then the matrix $A$ satisfies the property (consistency property) $a_{ij} a_{jk} = a_{ik}$ where $i,j,k=1,2,...,n$.  I'm not convinced this theorem is true. Could anyone help? How does Duff's device work? I've read the , and I don't get it. I am really interested, but I've read the explanation there a couple of times and I still don't get it how the Duff's device works.  What would a more detailed explanation be? Does a subsequent charm effect override a previous one? In a recent session, I was confused about how multiple charm effects would interact with each other:  A vampire used its 'Charm' ability to charm a PC. It reads (paraphrased):     The target must succeed on a saving throw or be charmed by the vampire. It takes the vampire's requests in the most favourable way it can. It can repeat the saving throw if the vampire or its companions harm it. Otherwise, the effect last 24 hours or until the vampire is destroyed, is on another plane of existence, or takes a bonus action to end the effect.   Another PC then decided to attempt to wrest control back from the vampire by casting crown of madness on their friend. it reads (paraphrased):     The creature must succeed on a saving throw or be charmed. The charmed target must use its action before moving on each of its turn to make a melee attack against a creature other than itself that you mentally choose. The target can act normally on its turn if you choose no creature, or none are within its reach.   At the time, I ruled that both effects would take place simultaneously. This meant that Crown of Madness took effect first, and the vampire's charm afterwards.  Was this the correct ruling? Can a creature be charmed twice? Or does one charm effect override the other? Would anyone can help me how to show that a finitely generated projective module over a local ring and PID are free?    What I know about a finitely generated projective module $M$ over a PID $R$ is isomorphic to $R^k\oplus R/(a_1)\oplus\dots\oplus R/(a_n)$, and for the local ring case I don't know how to start. Blog showing up as mobile, won't exit Stack Exchange blog is showing me the mobile site and won't let me exit on Chrome 21. Could someone take a look? Thanks. Edit I noticed it was with the special query string, that I can't exit it. My desktop look is empty so all I have is a nice wallpaper. My Windows taskbar has the "Taskbar Appearance" setting to "Auto-hide the taskbar". Although hidden, it leaves a thin top layer so you can still see it a bit, and where the pinned shortcuts are. Is it possible to totally have it hidden without a trace? This is a serious question. It really bugs m. How should I phrase an important question that I need to ask a professor? JSF doesn't support cross-field validation, is there a workaround? What is the most efficient way to concatenate strings in SQL Server? I have this code:  DECLARE @MyTable AS TABLE (    [Month] INT,    Salary INT );  INSERT INTO @MyTable VALUES (1,2000), (1,3100);  SELECT [Month], Salary FROM @MyTable;   Output:    I want to concat the Salary (grouping by month) so that it will be NVARCHAR like this: '2000,3100'  How would I do this efficiently? I want to show that if a function $f:[a,b]\rightarrow \mathbb R$ satisfies a Hölder condition of order $\alpha &gt; 1 $ then it is constant.  The way I think of it is as follows:  $$|f(x) - f(y)| &lt; K|x-y|^\alpha$$  $$\frac{|f(x) - f(y)|} {|x-y]}  &lt; K|x-y|^{\alpha -1}$$  $$\lim_{y\rightarrow x} \frac{|f(x) - f(y)|} {|x-y]} \le \lim_{y\rightarrow x}  K|x-y|^{\alpha -1} =0 $$ As the limit is $0$, we can remove the modulus, so we get:  $$\lim_{y\rightarrow x} \frac{f(x) - f(y)} {x-y} = 0$$ So $f$ is derivable and $f'(x) = 0$ for all $x$ in $[a,b]$. Note that the reason we can add the limit $y\rightarrow x$ is because $[a,b]$ is closed in $\mathbb R$.  However, the question gives as a hint using the mean value theorem. I am not sure why one should do that. You would first have to prove that $f$ is derivable in a similar manner to what I did, and then prove that $f$ is constant. Or is there a simpler way to do it and I am missing it?  Also please inform me of any mistakes I did in the proof (if any)/ Thank you! How do you measure pedal axle/spindle size?  Replacement pedals and accessories specify a size like 9/16" or 1/2".  How do I measure my current pedal to see what I need?  Is it just a matter of putting the pedal threads in a caliper and measuring the outer diameter of the threads across the axle/spindle?  Or do you need to measure the solid part, excluding the threads? Integer coefficient polynomial $p(x)$ has no integer roots of $\,p(0)$ and $p(1)$ are odd [Parity Root Test] This came up an a training piece for the Putnam Competition and also in Ireland and Rosen.  The question posed was basically:  Let $p(x)$ be a polynomial with integer coefficients satisfying that $p(0)$ and $p(1)$ are odd. Show that $p$ has no integer zeros.  I&amp;R give an example:  $p(x) = x^2 - 117x + 31$  and show (no problem) that for any $n$ whether even or odd, $p(n)$ will be odd. And claim that this shows $p(n)$ will never be $0$.  I can see, e.g., that $x^2 + 2x + 1$ will be odd substituting an even $n$ and even for an odd $n$.   But would appreciate help in understanding the underlying math and what is happening here.  Also, as a second part, can a general statement about the existence of an integer solution be made if $n$, even and odd, generates an even and an odd as in the last example.  I can see that if you look at these equations (mod $2$), you can distinguish whether there is an integer solution. And I would guess this is intimately connected with the question.  Thanks as always. No homomorphism from $Z_{16}\oplus Z_{2}$ onto $Z_{4}\oplus Z_{4}$. For some reasons, homomorphism is a very hard area for me to make improvements. I've been hitting the brick wall for almost 2 hours.   Prove that no homomorphism exists from $Z_{16}\oplus Z_2$ onto $Z_4\oplus Z_4$.  Assume a homomorphism $\phi$ exists from $Z_{16}\oplus Z_2$ onto $Z_4\oplus Z_4$. Then $\phi$ is an isomorphism.  Note that the $\left | \ker \phi \right |=2$ The $\ker \phi$ is also a normal subgroup for $Z_{16}\oplus Z_{2}$. We want possible normal subgroup of order 2. I.e., 2 elements in each normal subgroups.  By Lagrange's theorem, the order of each element in a group divides the order of a group so the possible order of the elements are 1 or 2. If the elements has order 1, then the Ker \phi cannot have 2 elements.  Hence, $\ker\phi$ = $\left \{ (0,0),(8,0) \right \}$ ,$\left \{ (0,0),(0,8) \right \}$,$\left \{ (0,0),(8,1) \right \}$, possibly.  By the First isomorphism theorem:  $\phi: Z_{16}\oplus Z_2 \rightarrow Z_2\oplus Z_2$  $\Psi: G/\ker \phi \rightarrow \phi\left ( Z_16\oplus Z_2 \right )=Z_2\oplus Z_2$  $g\ker \phi  \mapsto \phi(g)=\Psi(g\ker \phi)$  Any help is appreciated.  Edit: I know that $(2,0)$ has order $8$ in $Z_{16}\oplus Z_{2}$ but any elements in $Z_{4}\oplus Z_{4}$ does not have order $8$ which would have solved the question at the outset. But I would like a different route.