I have a problem with my If statement. The code runs without any problems, but it does not show the outputs for my if statements. It runs through all my JOptionboxes all the way to the end. Until it goes through my if statements.   import javax.swing.JOptionPane;  public class CurrencyConversion {  public static void main(String[] args) {  int x = 0; double result,result1, result2; String THAI = "THAI", EURO ="EURO", JPY = "JPY";  String name = JOptionPane.showInputDialog("What is your name: "); String message = String.format("Welcome %s, to the Currency Exchange Program ", name); /*inputs name in %s*/  JOptionPane.showMessageDialog(null,  message); //displays the String format message String currency = JOptionPane.showInputDialog("Which currency do you wish to exchange: "+THAI+ ", "+EURO+ ", "+JPY); x = Integer.parseInt (JOptionPane.showInputDialog("Insert US Dollar Amount: ")); result = x * 32.57; //US TO THAI result1 = x * .86; //US TO EURO result2 = x * 117.50; //US TO JPY   if (currency == "THAI"){     JOptionPane.showMessageDialog(null,"US Dollar Amount of "+x+ " dollars to be converted to "+THAI+" is: ");     JOptionPane.showMessageDialog(null,result+ " BAHT"); }if (currency == "EURO"){         JOptionPane.showMessageDialog(null,"The Amount of "+x+ " dollars to be converted to "+EURO+" is: ");         JOptionPane.showMessageDialog(null,result1+ " EURO"); }if (currency == "JPY"){             JOptionPane.showMessageDialog(null,"The Amount of "+x+ " dollars to be converted to "+JPY+" is: ");             JOptionPane.showMessageDialog(null,result2+ " JPY"); }//end THAI if   }//end main
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?
Cooking away alcohol When you cook with wine or spirits, when does the alcohol cook away? Obviously high temperatures will do it, but how low of temperatures will work? Also, does it vary by the type of alcohol? My homework has this problem:     Prove that there exist irrational numbers $x$ and $y$ such that $x +  y$ is rational.   There is an easy solution that I found on mathbitsnotebook.com:     \begin{align} \left(2+6\sqrt{7}\right) + \left(-6\sqrt{7}\right) = 2.\end{align}   Can we prove the same without using subtraction? Inverse Fourier transform of Gaussian I need to calculate the Inverse Fourier Transform of this Gaussian function:  $\frac{1}{\sqrt{2\pi}} exp(\frac{-k^2 \sigma^2}{2})$  where $\sigma &gt; 0$, namely I have to calculate the following integral: $\int{\frac{1}{\sqrt{2\pi}} \exp(\frac{-k^2 \sigma^2}{2})} \exp(ikx) dk$.  How can I do that? If I am not wrong (in which case please correct me) the result should be $\frac{1}{\sqrt{2\pi}\sigma}exp(\frac{-x^2}{2\sigma^2})$...but I don't know how to get there! Is it common for native speakers to put a question mark at the end of declarative sentence? Making a recursive CTE like query, but for many records If you shine a light away from the center of a Schwarzchild black hole, will it stay still? $$ A $$  Light is travelling away from the absolute center of the Schwarzchild black hole (i.e. none of that spinning/stretching field) at $\ C $, and so shouldn't $\ \Delta C$ need to be greater than $\ C $ in order for the light to collapse into the black hole, therefore violating the relativistic limit of $\ C $?    It seems like light would just 'hover' right in the center of a black hole then. Because if it goes away from it, the event horizon pulls it back, and if it goes into it, the velocity change must be greater than $\ C $ which violates general relativity; so technically there's no way for the light to move away, and so it would just be still.  The thing is that the light must move at the speed of light or general relativity doesn't work. It's massless... But in the center of a black hole, if the above is true (it can't move or escape), then it is not travelling at the speed of light. So it cannot be still.  It cannot be spinning in a constant orbit either, because that would require velocity in an outward angle. And it cannot move in an outwardly fashion, only in an inwardly one.  Is it spinning in an infinitely decaying spiral towards the center?  If so what happens to it if and when it reaches the direct and complete center, i.e. The case of it being 'shot' from the center.    $$ B $$  If you shot light at an angle towards a black hole, but not directly to the center of it  then that light from the outside will eventually become the same as the light that I said was shot from the center to the outside; because in both cases, they end up in an infinitely decaying spiral.    If so it would end up exactly like the light in the above paragraph, so then we need to figure out what happens to that light to figure this one out, or vice versa.    $$ C $$  If you shot light directly towards the center of a black hole it would have no spiral to decay into, so therefore it must stop at some point in the center of a black hole. If it stops though, it loses it's momentum and violates general relativity again because it's energy "disappears".    If so then it violates conservation laws. So I'm assuming this simply is not true.    Is the light travelling into a black hole somehow still travelling at the speed of light, in every direction possible where that direction keeps it facing towards the center?  If so, why is there not a point at which the only thing left for the light to do is stay still, since all other paths would increase the distance between it and the black hole's center, and therefore become Case A. And if there isn't, what would happen if there was?  Also, if it's a time and observation answer where it supposedly takes and infinite amount of time for C to hit the center, wouldn't it be the case that the black hole is 'eating' all of the available light in the universe and keeping it in stasis?  Also, what happens in a Kerr black hole then? Does it just rip the field of time/gravity at an angle such that the light would never get closer than the center? I'm new to LaTeX and trying to understand the reason why I'm getting the warning:  `h' float specifier changed to `ht'   I'm not attempting to change the float property of anything - the warning is showing up if I attempt to simply encapsulate some words in quotation marks:  ``highly distributed''   As far as I'm aware, there's no open sections anywhere and the file seems to render properly. So realistically it doesn't matter if the issue gets solved or not; but I'd like to know the reason I'm getting the warning.  Thanks in advance. When writing my custom function I need to manually append node name to a taxonomy term link. To get the taxonomy term part done I use:    $link_uri = taxonomy_term_uri($term);   $path_alias = drupal_get_path_alias($link_uri['path']);   This works ok, now - I want to append node name ("/" . $node_name), but instead of raw string, I want the Pathauto transliterated output, as set in the URL alias configuration, for that node context.  What function should I use to mimic that output? I looked at hook_pathauto_alias_alter(&amp;$alias, array $context) but I'm not sure that's what I need. How to change/rewrite the lost password url? I used iThemes Security (formerly Better WP Security) hide back-end functionality to change the login url to /signin however clicking the lost password link /wp-login.php?action=lostpassword now generate a 404  Manually going to /signin?action=lostpassword works.  I came across the following code below which is suppose to make the change to however after some testing it doesn't seem to work  //******************************************************* //Function to change to lost password url //******************************************************** add_filter('site_url',  'wplogin_filter', 10, 3); function wplogin_filter( $url, $path, $orig_scheme ){     $old  = array( "/(wp-login\.php)/");     $new  = array( "signin/"); //this can be change to login or whatever or may remain there     return preg_replace( $old, $new, $url, 1); }   add to .htaccess  RewriteRule ^signin$ wp-login.php   How can i modify the above code in order to change the url for the lost password? How should I deal with becoming discouraged as a graduate student? I am a third year (starting fourth year in the fall) PhD student in mathematics. I've passed all qualifying exams and am currently doing research. As far as I can tell, I am not doing poorly. I have the good fortune of having a great advisor, being in a very supportive department, and having friends and family who genuinely care about my success.   The fact is research is hard. It appears to consist primarily of staring at a problem for days and days and days without getting anywhere. Sometimes, rarely, I do figure something out and that feels wonderful, but the overwhelming majority of my time appears to be spent banging my head against a mostly figurative wall. I am not complaining about the material being hard, and I am not averse to putting in hard work, but I get frequently discouraged when I realize the vast volumes of mathematics that I yet know nothing about (and probably never will). It's very hard to quantify progress - in particular, there are too few tangible returns after too many hours worked. I find myself thinking along the lines of "Oh, if only someone actually smart were thinking about this problem they would have solved it in moments" and so on.   I've talked about this to some number of people; here is some advice I have received:   Take a day off. Putting in hours upon hours of trying things doesn't magically lead to a solution, particularly if the brain is tired and just wants to sleep. Have a hobby. Since math research doesn't exactly provide instant gratification, a hobby might provide some instead.  Talk to other graduate students. Realize that many graduate students go through this.   I'm interested to know how other folks have dealt with being discouraged as a graduate student. Does it get better with time and experience? Is this a sign that research is not for me and that I should seriously consider a life outside academia? I have 3 old computers lying around right now running a P2 at 800 MHz(?), Intel Mobile 1.6 GHz, AMD Athlon XP 2000+ at 1.66 GHz, and (might not use this) P4 at 2.7 GHz, all with 512 MB Ram, and am considering clustering them together for fun/knowledge. They would be running an undecided version of linux, preferably ubuntu based.   The issue is what I want to use it for: general computing and occasional video encoding. By general computing I mean day to day tasks. However I'm not sure if every program started by a single X session is going to exist on the same machine, defeating the purpose of such a system. Will programs be split up or exist on one machine?  Second, assuming this is running 100baseT ethernet (not sure if the PCI slot itself could handle Gigabit), would the speed of having a program exist over the network be an issue? It seems that the constant asking of various things in RAM would be quite slow.  And before you say "buy another computer!", that's not the point of this question. I'm asking would it be usable, not necessarily practical. And yes I know, this is going to be extreamly power consuming. This is probably a dumb question. I guess what I'm trying to ask is if radio waves travel the same speed as gamma rays, how do gamma photons carry more energy than radio photons? Do they spin faster? What other energy sources could they carry if they are moving the same speed through space? I am notified about old comments instead of new ones I have three notifications pending but when I open the tab they were a month ago. When I refresh the page I see the correct three notifications. Pictures:  Here you see notifications from March but it is April:    Here I refreshed the page and recognized that there are indeed three unread notifications.    This behavior occurred already three times before, always with the spinlock question as first comment. Today I finally realized that there were indeed notifications pending.  Is this a bug to report? If this is not the right side to ask about this - where should I go to?  Edit 1  Browser: Firefox 28.0 (current version) Windows 7 on a Laptop  It only appears on the favourites side. When I open  I see the current comments.  Edit 2  On favourites I see the old issue    On meta and stackoverflow I see the new comment   Edit3  Still an issue on April 11th and April 16th. The question is more like: Can somebody remove this or show me a way to remove it or let it remove?  Edit4  April 20th at 14:00GMT the favourite tags turned into an error page: Why are there two different hats for "Where in the World"? I am wondering why some got a moon and others got a sun as Where in the World hat for the same action:   vs.   And is it possible two collect both e.g. from different sites? I only get moons…  I know that there has already been some spoilering . Fastest way to try all passwords Suppose you have a computer with a password of length $k$ in an alphabet of $n$ letters.  You can write an arbitrarly long word and the computer will try all the subwords of $k$ consecutive letters. What is the smallest word that contains all combinations of $k$ letters as subword? (i.e. the fastest way to hack the computer :) )  The smallest word that contains $n^k$ subwords of size $k$ has length $k-1+n^k$ and based on some easy cases, we would like to prove that it is in fact possible to find a word of such length that contains all possible passwords. The problem can be translated into a problem in graph theory, by taking as vertices all words of length $k$.  We tried $k=2$, where you can prove the conjecture by induction. For $n=2$ and small $k$ it also works. Evaluating $\int P(\sin x, \cos x) \text{d}x$ Homeomorphism is bijective Here is my question:  Is a homeomorphism, that is, a continuos function whose inverse function is also continuous, always bijective? Are all n-ary operators simply compositions of binary operators? Take for example $A \times B \cdot C$ = $(A \times B) \cdot C$ where $A, B, C$ are 3-component real vectors.  We can define a 3-nary operator $\times - \cdot$ that is a composition of the two common binary operators $\times$ and $\cdot$.  The same thing happens with most functions (operators) - the way we calculate them is by doing smaller binary problems and adding together.  Every time I try to come up with an $(n &gt; 2)$-ary operator my mind automatically looks for binary operators.  So, the question is, do there exist operators (of some weird kind in some branch of math) that cannot be decomposed into 2-ary and 1-ary operators?  Thanks. Counting buffer overlap in QGIS For my thesis I'm modeling the identification of recreation areas.  Therefore, there has been a survey where people were asked to specify where they recreate. They had to indicate this place on a map and give a radius. Now I have to analyse which areas were most visited, and afterwards use the data to give a weighted rating with the travel distance.  So, I use QGIS to Buffer the data points by using the given radius. Now, I want to calculate for every point in the country how many times it was visited.  Any thoughts how to do this in QGIS? Animations about a young man pulled into a fantasy setting with dragons? I'm looking for an animation (more likely a film not a series) that I watched as a kid, watched early 90's I'm sure it contained a book loving male main character (wears glasses might have even had an amulet) who gets pulled into a fantasy via a magic book  Setting with dragons and an evil wizard, I remember it being on TV as I never had it on VHS.  Same sort of animation technique as visionaries or thundercats.  Thanks.