Im writing a class for a card that takes in two string parameters,   When I check the string if it's an "a" it throws the NumberFormatException error.  Card(String s, String  f)  {     suit = s;     if(f == "a")     {         value = 11;     }      else if (f == "j" || f == "k" || f == "q")     {         value = 10;     }      else     {         value = Integer.parseInt(f);     }     face  = f;  }
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 have a query going that gets data for an ID for the last 3 months.  I need to tweak it so I get the highest value for each of the three months.  I've tried a couple of things with the aggregate function MAX, but I'm not getting anywhere.  I'm trying to get the max value for each of the past months ....  Here's the data from the query, currently sorted by date (asc):   ID      Date               Value 12410   01/03/2017 12:17    0.000178 12410   01/10/2017 11:36    0.000186 12410   01/17/2017 11:27    0.000189 12410   01/24/2017 13:09    0.000182 12410   01/31/2017 10:37    0.000169 12410   02/07/2017 11:03    0.000214 12410   02/14/2017 11:52    0.000176 12410   02/21/2017 10:51    0.000200 12410   02/28/2017 12:29    0.000194 12410   03/07/2017 08:39    0.000206   Here's the query:   select AnalysisID as "ID" , AnalysisDateTime as "Date", AnalysisValue as "Value" from AnalysisValueTbl where AnalysisID = 12410 and DatePart(m, AnalysisDateTime) = DatePart(m, DateAdd(m, -3, getdate())) and DatePart(yyyy, AnalysisDateTime) = DatePart(yyyy, DateAdd(m,-3, getdate())) or AnalysisID = 12410 and DatePart(m, AnalysisDateTime) = DatePart(m, DateAdd(m, -2, getdate())) and DatePart(yyyy, AnalysisDateTime) = DatePart(yyyy, DateAdd(m,-2, getdate())) or AnalysisID = 12410 and DatePart(m, AnalysisDateTime) = DatePart(m, DateAdd(m, -1, getdate())) and DatePart(yyyy, AnalysisDateTime) = DatePart(yyyy, DateAdd(m,-1, getdate())) order by AnalysisValue desc Getting current date and time in JavaScript Identify cartoon about a set of fairy/demon twins in a far future where the demon uses propaganda to take over the world I'm looking for a cartoon from the 70's (I believe) which is about a set of twins; one plump "fairy" and a skeletal "demon". The "fairy" has magic powers and ends up living a life of pleasure, while the "demon" flees and turns evil.  When the "demon" finds his new weapon in the ruins of the ancient world (roughly modern day) he plots to enslave the world; the weapon in question is a set of propaganda movies with Adolf Hitler. Turning off "Update page numbers only" in Word When I update the fields document-wide (Ctrl + A, then F9) in a Word document that has a table of contents, a dialog appears asking if I want to update page numbers only, or update the entire table. I never want to update page numbers only if the document headings have changed, nor will I ever.  (Apparently this is given as an option in case someone has manually changed an automatically generated ToC, which is almost always a really bad idea.)   Unfortunately, "Update page numbers only" is the default selection in the dialog, which means that I have to select the other option every time. I update the fields all the time when I'm working in a document that has figures and cross-references, so this is an annoying extra step I'd really like to get rid of.   Is there any way to tell Word to stop asking me this stupid unnecessary question? I understand that the  is given by  $$F^{\mu\nu}\mapsto\begin{pmatrix}0 &amp; -E_{x} &amp; -E_{y} &amp; -E_{z}\\ E_{x} &amp; 0 &amp; -B_{z} &amp; B_{y}\\ E_{y} &amp; B_{z} &amp; 0 &amp; -B_{x}\\ E_{z} &amp; -B_{y} &amp; B_{x} &amp; 0 \end{pmatrix}$$  where $\mu$, $\nu$ can take the values {0,1,2,3} or {$t,x,y,z$}.  So, for example  $$F^{01}=F^{tx}=-E_x$$  My question is, what would the following expression be?  $$F^{t\rho}=?$$ or $$F^{z\rho}=?$$  where $\rho=\sqrt{x^{2}+y^{2}}$ is the radial coordinate in ?  And more generally, how can we construct the Electromagnetic Tensor in cylindrical coordinates? Where $\mu$, $\nu$ now take the values {$t,\rho,\varphi,z$}. Referring to unidimensional motion, it is obvious that it doesn't always make sense to write the speed as a function of position. Seems to me that this is a necessary condition to derive formulas like:  $$v^2=v_0 ^2 +2\int_{x_0}^{x}a\cdot dx$$  In fact, in the first step of the demonstration (the one I saw, but I think that this step is crucial) it's required to write $a=dv/dt=(dv/dx)(dx/dt)$, that doesn't make sense if $v$ isn't a function of $x$.   When can one rigorously write $v=v(x)$? I have 3 accounts that I am deleting - however, several hours after the 24 hour (+ grace period - end about 4-5 hours ago), the countdown completed, but disappeared and the accounts are still there.   I would rather not go through another 24 hours, and would like to have these accounts deleted (and yes, I have thought about it and this decision is not up for discussion).  Currently, the accounts are still there.  Could this please be seen to? Out-of-control starship results in some crew members landing in a rebirthed universe? Gauss's Law with Moving Charges What is the correct way to edit a crontab file? As a mod when should I vote to close content that is not flagged? I am reading through Folland's Real Analysis: Modern Techniques and Their Applications, and they have the following proposition and proof:     Proposition: If $\{f_{j}\}$ is a sequence of $\bar{\mathbb{R}}$- valued measurable functions on $(X, \mathcal{M})$, then the functions:      $$g_{1}(x)=\sup_{j} f_{j}(x)$$ $$g_{2}(x)=\inf_{j} f_{j}(x)$$ are   measurable.       Proof:      We have       $$g_{1}^{-1}((a,\infty])= \bigcup_{j=1}^{\infty}  f_{j}^{-1}((a,\infty])$$ $$g_{2}^{-1}([-\infty,a))=  \bigcup_{j=1}^{\infty} f_{j}^{-1}([-\infty,a))$$      Where the result follows from the fact that $g_{1}^{-1}((a,\infty])\in  \mathcal{M}$ for all $a \in \mathbb{R} \iff g$ is measurable, and   $g_{2}^{-1}([-\infty,a))\in \mathcal{M}$ for all $a \in \mathbb{R}  \iff g$ is measurable.   I understand the last part of the proof, but how do we know $g_{1}^{-1}((a,\infty])= \bigcup_{j=1}^{\infty}f_{j}^{-1}((a,\infty])$ and $g_{2}^{-1}([-\infty,a))=\bigcup_{j=1}^{\infty} f_{j}^{-1}([-\infty,a))$? I would appreciate any help with this. I plan to self-study linear algebra this summer. I am sorta already familiar with vectors, vector spaces and subspaces and I am really interested in everything about matrices (diagonalization, ...), linear maps and their matrix representation and eigenvectors and eigenvalues. I am looking for a book that handles every of the aforementioned topics in details. I also want to build a solid basis of the mathematical way of thinking to get ready to an exciting abstract algebra next semester, so my main aim is to work on proofs for somehow hard problems. I got Lang's "Intro. to Linear Algebra" and it is too easy, superficial.  Can you advise me a good book for all of the above? Please take into consideration that it is for self-study, so that it' gotta work on its own. Thanks. How and why do accelerating charges radiate electromagnetic radiation? Let's consider it case by case:  Case 1: Charged particle is at rest. It has an electric field around it. No problem. That is its property.  Case 2: Charged particle started moving (it's accelerating). We were told that it starts radiating EM radiation. Why? What happened to it? What made it do this?  Follow up question: Suppose a charged particle is placed in uniform electric field. It accelerates because of electric force it experiences. Then work done by the electric field should not be equal to change in its kinetic energy, right? It should be equal to change in K.E + energy it has radiated in the form of EM Waves. But then, why don't we take energy radiated into consideration when solving problems? (I'm tutoring grade 12 students. I never encountered a problem in which energy radiated is considered.) Is it possible to restart the unity panel without restarting compiz? I'm being hit (quite often) by that bug where you can't click on some indicators. It's easy to fix by restarting unity, but that usually also means running to the risk of upsetting some window on re-parenting (rare, but I'd rather avoid any such problems).  So, I know there is `unity-panel-service', and I'm guessing this might have something to do with the solution?  Is it possible to restart the unity panel (or the entire unity plugin) without restarting compiz itself? Color Transfer from colored image into grayscale image How to determine the most likely reading frame of a DNA sequence? This question is from a past exam paper for an introductory bioinformatics module. I'm a computer scientist doing biology for the first time.  "A short bacterial gene has been sequenced, giving the following DNA sequence. Write out the 6 possible reading frames for this sequence and indicate which is the most likely protein translation of this sequence. Explain your reasoning for picking the given translation, and write all the translations in single letter amino acid code form.  5' - ttattcatccgccagcgccatgcgcgccat - 3'  "  I think I understand the 6 possible reading frames: three from the 5' end starting tta, tat and att; and three from the 3' end starting tac, acc and ccg.  I could also write out the translations for a given reading frame with a codon usage table. It's the most probable reading frame part I don't get. I thought perhaps I was looking for the longest open reading frame. I can only see one start codon (atg). What is the correct way to recognize the most probable reading frame?  I can't find this problem exactly on Biology Stack Exchange. I did find:     It made me wonder if I'm getting confused between "reading frame" and "open reading frame", this question only asks or the former.  Thanks! Is the cardinality of the Cartesian product of two equinumerous infinite sets the same as the cardinality of any one of the sets? I couldn't find this explicitly stated in any handout or text. This certainly seems to be true from the examples I have seen:  The Cartesian product of two infinitely countable sets is again infinitely countable. The Cartesian product of two sets with cardinality of continuum again has cardinality of continuum. Problem with IMPORTRANGE function in Google Sheets I’m trying to get IMPORTRANGE to work for me with no success. I made two simple spreadsheets:  and . In the destination sheet I’m using the import range function:  =importrange(“1-5F1_zz0ZpGj7SfeQhewsCe0CsrA0eyPbjfmUrLBsyk”,”Sheet1!a1:a1”)   I tried already:   Replacing the , with ; Referencing just the key as well as the full URL in the first argument Switching from “ to ‘ With the sheet name and without it   Not sure what else to do.  Any ideas? Deriving Newton's Third Law from homogeneity of Space