I need to use the 'checked' option in a radio button, but I want to use it dynamically. That is, either the right or the left button is pre-checked based on data from a database and the user can choose to accept or change it. To do this, I need the String "checked" as part of my radio button tag. I created two variables, chekR and chekL, with the plan that one of them would evaluate to "" while the other would evaluate to " checked". However, my IF condition fails to do the job. The value Right or Left comes from a form, and I tried printing it, which works fine, but the actual comparison is failing.  The variable passed from the form is stored as String D. If I try evaluating (D == "Right"), it returns a false every time. I tried two IFs (see code), I tried IF-ELSE, but no success.  String chekR = ""; String chekL = ""; if(D == "Left") { chekL = " checked";} if(D == "Right") { chekR = " checked";} &lt;form action = update3.jsp&gt;&lt;br&gt; &lt;input type="radio" name="PtEye" value="Right" &lt;%=chekR%&gt;&gt;Right &lt;input type="radio" name="PtEye" value="Left" &lt;%=chekL%&gt; required&gt;Left &lt;br&gt;&lt;input type="submit" value="Confirm"&gt;&lt;input type="reset" value="Restore to original"&gt;&lt;/form&gt;   I need the expression &lt;%=chekL%> to produce either a blank or the word checked, depending upon the value of D.
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?
How can I execute `date` inside of a cron tab job? I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use:  0 * * * * echo hello &gt;&gt; ~/cron-logs/hourly/test`date "+%d"`.log   Unfortunately I get this message when that runs:  /bin/sh: -c: line 0: unexpected EOF while looking for matching ``' /bin/sh: -c: line 1: syntax error: unexpected end of file   I have tried escaping the date part in various ways, but without much luck. Is it possible to make this happen in-line in a crontab file or do I need to create a shell script to do this? What causes javac to issue the "uses unchecked or unsafe operations" warning In my opinion the accepted answer should permanently stick as only the original question submitter has the ability to accept. What does "No bootable medium found" mean in VirtualBox? Why can't I connect to Ubuntu One? I have purchase new laptop from Dell with ubuntu 12.04 preinstalled. while connecting to Ubuntu One following occurs and I am not able to sync with Ubuntu One.   WebClientErr u'Error downloading https://one.ubuntu.com/api/account/ - server replied:Not       Found' u'&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;\n&lt;html&gt; &lt;head&gt;\n&lt;title&gt;404 Not Found&lt;/title&gt;\n&lt;/head&gt;&lt;body&gt;\n&lt;h1&gt; Not Found&lt;/h1&gt;\n&lt;p&gt;The requested URL /api/account/ was not found on this server. &lt;/p&gt;\n&lt;hr&gt;\n&lt;address&gt;Apache/2.2.22 (Ubuntu) Server at one.ubuntu.com Port 443 &lt;/address&gt;\n&lt;/body&gt;&lt;/html&gt;\n' format date in c# How can I format a date as dd/mm/yyyy or mm/dd/yy ?   Like in VB format("dd/mm/yy",now)  How can I do this in C#? I know I use them, and my peers use them, but how much does the average user actually use tooltips to figure out functionality? Simulating Key Press C# triggered my curiosity for this question. Why most of manga are black and white? Is this because of more cost if they add colors to it? Citation colour with Beamer + Hyperref + Natbib I'm using natbib for citation with a custom bibstyle. I'm working on a presentation using LaTeX beamer and for some reason the citation marker doesn't have the colour that is specified to hyperref. The citation marker is black instead of green. I'll give you a MWE:    \documentclass{beamer} \hypersetup{   colorlinks,   citecolor=green,   linkcolor=red }  \usepackage{filecontents} \begin{filecontents}{mybib.bib} @ARTICLE{Bar2011,   author = {F. Foo and F. Bar},   title = {Foo and Bar},   journal = {Journal of Foo},   year = {2011},   volume = {1},   pages = {1--3} } \end{filecontents}  \usepackage[comma,numbers,sort&amp;compress]{natbib} \bibliographystyle{plain}  \begin{document} Dummy referefence to~\cite{Bar2011} \bibliography{mybib} \end{document}   For the purpose of the MWE I have selected the plain bibstyle, however, changing that to something else (including the custom style I want to use) doesn't affect the label colour.    Is there any patch for this problem? Can you cast a 9th level spell if your multiclass spell slots have 9th level spell slots? Is it true that for algebraic sets $V,W$ we have $I(V \times W ) =I(V) + I(W)$? This is a follow up question to my previous question  Let $k$ be a field and $V \subseteq \Bbb{A}^n$ and $W \subseteq \Bbb{A}^m$ be algebraic sets. Then it should be true that $I(V \times W ) = I(V) + I(W)$ where by $I(V)$ here we mean the extension of $I(V)k[x_1,\ldots,x_{m+n}]$. Now I believe I have proven this (see the proof at the bottom of my question) but when I look at Martin's answer , it is instead claimed that we  actually have  $$I(V \times W )= \sqrt{I(V) + I(W)},$$  and for $I(V) + I(W)$ to be a radical ideal we need $k$ to be algebraically closed.           My question is: What's going on here? I believe my claim is true even without the assumption that $k$ is algebraically closed.           Here's a proof user Sanchez told me of, which I have simplified:       First it is clear that we always have $I(V) + I(W) \subseteq I(V \times W)$. For the reverse inclusion consider a polynomial $f \in I(V \times W)$. Then we can always write $$f = \sum_{i=1}^n f_ig_i$$ where $f_i \in k[x_1,\ldots,x_n]$ and $g_i \in k[x_{n+1},\ldots,x_{m+n}]$. Now take any $b' \in W$. If for all $i$ we have $g_i(b') = 0$ then since $b'$ is arbitrary, $g_i \in I(W)$ for all $i$. Then $f \in I(W) \subseteq I(V ) + I(w)$ and we are done. Otherwise suppose there exists $b \in W$  and $i$ such that $g_i(b) \neq 0$. Then wlog we may suppose that  $g_1(b) \neq 0$.   Next, $\sum f_ig_i(b) = 0 $ on all of $V$ by assumption of $f \in I(V \times W)$. So $\sum f_i g_i(b) = p$ for some $p \in I(V)$. Now write $$f_1 = \frac{ p - g_2(b) f_2 + \ldots g_n(b)f_n}{g_1(b)}.$$  Substituting this for $f_1$ in $\sum f_ig_i$, followed by taking things mod $I(V)$ we get an  expression with only $n-1$ terms $\mod{I(V)}$. Continuing this process we will finally get an expression with $0$ terms $\mod{I(V)}$ so that $f \in I(V)$. This shows $I(V \times W) \subseteq I(V) + I(W)$ which completes the proof. How do I install OpenStack? How do I install ? Is there an easier way other than official installation instructions? What causes the 'Connection Refused' message? This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ? Getting full JS autocompletion under Sublime Text In proof by induction, what does it mean when condition for inductive step is lesser than the propsition itself? My question is regarding the question posed at the end of the proof.  My answer is that the result does not hold for all $m \ge 7$ because when $m=7$, the result is $343 \le 128$, which is false.  Is there another way to answer this sort of question besides directly trying different values until you get a false result?  EDIT:  Another question I have regarding this solution is:  In the proof for the inductive step, we start by assuming $k \ge 10$. But along the way, the author mentions $k \ge 1$ and $k \ge 7$ to justify the inequality.  Why do we bother to do this instead of just sticking with $k \ge 10$? DXF file not to scale in Blender When I open the DXF file in LibreCAD, then it shows the correct size of an object, but when I import that file in Blender, then the size of that object becomes very large. Ubuntu 20.04 interface font too small after restart, even with high scaling factor Is it safe to travel to Miami Beach shortly after hurricane Irma? Two months ago my girl and I booked our vacation. We are from Berlin, Germany and wanted to see the U.S. Our first stop is Miami Beach at the 15th and we want to stay there for 3 days and continue to NYC. Later on we will go to Vegas and come back to Miami the 26th of September and stay there another 4 nights.  I expect the hurricane will be gone by the 15th, but I have no idea whether it will be okay. For me okay means that we can reach our hotel and sleep there.  What do you suggest? I know this question is primarily opinion based, but here in Germany we don't have hurricanes and I don't know how fast the state will recover. English (other than American English) has a clear differentiation between the two words. Both are about translocating something. In "bring" the something of somebody is moved to where the speaker is currently situated. "Take" is used to translocate something or somebody to a place that the speaker is not currently at.   You cannot “bring” your books to school if you are currently at home. You can only take them to school. Most of the time one can get the meaning from the context of the sentence but it can get very confusing when the other party is on the telephone and you do not know their location.   Why does American English not differentiate and when did it lose the differentiation?