In my logo quiz game I have to take the value written in text Field when the user press ENTER key and compare it with the correct answer.Which listener should I use. I used Action listener but it's not working. I am new to programming.   private JTextField textField=new JTextField("");  textField.addActionListener(new ActionListener() {         public void actionPerformed(ActionEvent e) {             result();         }     });      textField.setBounds(0, 241, 264, 31);     getContentPane().add(textField);     textField.setColumns(10);     private void result(){      answer=textField.getText();      if(answer=="apple"){         JOptionPane.showMessageDialog(this, "right answer");     }     else{         JOptionPane.showMessageDialog(this, "wrong answer");     } }}
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?
Virus added .mbed File Extension The files on my PC's 2 drives have been altered by a virus; all files on both drives now have an extra extension of ".mbed"  Here you have a screenshot to get my point:   So what is the shortcut way for me to correct all these file extensions? Group with order $pq$ has subgroups of order $p$ and $q$ Let G be a group with $o(G)=pq$, $p&gt;q$ are primes.  Prove that $G$ has a subgroup of order $p$ and a subgroup of order $q$.  Remark: I cannot find the topic with this problem.  I have tried different methods but no one of them did not bring result. Please show how to do that. Do not use Sylow's Theorem. My Windows 10 notebook died but fortunately I was able to rescue the hard drive and put it into another PC.   Unfortunately, the other PC can't open the C/Users/Joe folder. What do I have to do to open the folder? Decision Tree in LaTeX with TikZ Grid line doesn't have to be included     \documentclass[10pt]{beamer}  \usetheme{default}  \usepackage{graphicx}  \usepackage{amssymb,amsmath}  \usepackage{tikz}  \usetikzlibrary{matrix}  \usepackage{adjustbox}  \usepackage{caption} \ usepackage{subcaption}   \setbeamercolor{title}{fg=black}  \setbeamercolor{subtitle}{fg=gray}  \setbeamercolor{footlinecolor}{fg=white,bg=green}  \setbeamertemplate{footline}[text line]{% \parbox{\linewidth}{\vspace*{-10pt} \textit{Where Wall Street Goes to School} \hfill \insertpagenumber} } \setbeamertemplate{navigation symbols}{} –  \begin{tikzpicture}[&gt;=stealth,sloped][scale=0.8]  \matrix (tree) [matrix of nodes, minimum size=0.25cm, column sep=2cm, row sep=1cm, ]  { &amp; $C_{i+1,j+1}$ \\ $C_{i,j}$ &amp;$C_{i+1,j}$ \\  &amp; $C_{i+1,j-1}$ \\   };  \draw[-&gt;] (tree-3-1) -- (tree-1-3) node [midway,above] {};  \draw[-&gt;] (tree-3-1) -- (tree-3-3) node [midway,above] {};  \draw[-&gt;] (tree-3-1) -- (tree-5-3) node [midway,below] {};  \end{tikzpicture}  \end{adjustbox} – How to prove $\cos \frac{2\pi }{5}=\frac{-1+\sqrt{5}}{4}$? I would like to find the apothem of a regular pentagon. It follows from   $$\cos \dfrac{2\pi }{5}=\dfrac{-1+\sqrt{5}}{4}.$$  But how can this be proved (geometrically or trigonometrically)? What prevents photons from getting mass from higher order Feynman diagrams The Higgs boson and gluons have no electric charge and photons couple to charge, so there is no tree level interaction between them and photons.  But what prevents higher order diagrams from contributing a non-zero mass term to the photon, for instance    where a photon couples to some fermion (say an electron, or a top quark) which can interact with the Higgs field.   Or consider that same diagram but with quarks and a gluon interacting between them? Or any higher diagram with even more loops?  I have heard charge conservation depends on gauge invariance, which in turn depends on photons being massless.  So it appears the photon has no mass, and these diagrams must all cancel somehow.  So I'm hoping there is a very nice symmetry explanation for why they all disappear, but if I say "because of gauge invariance" that would be circular logic, so there must be another symmetry at stake here?     What prevents photons from obtaining a mass from high-order self-energy loop diagrams? Intuition for groups This is quite a non-standard question, certainly for mathematics, though I believe it is no less important (for me and my peers, i.e. grads).  The course I am reading so far introduced us to Groups, rings, fields, etc. in the first year, progressing to characters, reps etc in the latter years.  However, even with representation theory I still don't feel like I have a good intuition.  How do you gain intuition in such an area. I know there will be a response of doing examples, but this doesn't really help - I've done lots already.  Am I doomed. I'm looking to schedule 16 players to play a round robin tournament with each other such that there are 4 players at each table.  I'd like for each player to play with each other player exactly once over the course of 5 rounds.  I just took a look at this post:  , and I was wondering if anyone knows if the case n=m=4 has been solved, and if so what that solution is. How do the Planets and Sun get their initial rotation? Why do Venus and Mercury rotate so slowly compared to other planets?  Why does Venus rotate in a different direction to Mercury, Earth and Mars? Is there a reason the British omit the article when they "go to hospital"? Why do British speakers omit the article in constructions like "go to hospital" or "go on holiday"? Pretty much all American speakers would rephrase those as "go to the hospital" and "go on a holiday", I think. Is there any good reason, or forgotten sense behind those words that might explain why the articles are ommitted?  Are there other common constructions other than those two that the British use that drop the article?  EDIT: I just realized per Kosmonaut's comment that Americans do much the same thing with a few nouns, so this isn't all that special.   Do grammaticists designate nouns that can have their article dropped with anything, i.e. do they have anything in common? Quite often, the phrase "x for x's sake" is used in English, and so one could describe someone as being "argumentative for argument's sake" to describe someone who is arguing for the sake of arguing.  However, is there an adjective that means the same thing?  For example, it could be used in the context:     I don't want to be [X], but [argument...]   ... indicating that your argument is necessary and not intended to irritate. Visa for Istanbul trip during layover I am an Indian (Indian Passport) presently in Kano, Nigeria on a business visa. I am going back to Mumbai on 22 Sept by Turkish Airlines with a 12 hour layover time in Istanbul.  We plan to see the city during this time.  Can I get a visa on arrival? What's the blue pentagon for in Pokemon XY? On the Pokemon status screen, underneath the Pokemon and to the left of the custom markings, is a small blue pentagon:  This doesn't seem to be present on Pokemon obtained through the Pokemon Transporter from Gen V:  I've looked into it myself, and popular opinion seems to be that it's either some kind of &quot;Legitimate Pokemon&quot; mark or simply to indicate that the Pokemon originates from Gen VI. The latter seems far more likely to me, but do we know for sure what this blue hexagon means? What is the most ruby-ish way of accessing nested hash values at arbitrary depths? Denote by $M_{n \times n}(k)$ the ring of $n$ by $n$ matrices with coefficients in the field $k$.  Then why does this ring not contain any two-sided ideal?    Thanks for any clarification, and this is an exercise from the notes of Commutative Algebra by Pete L Clark, of which I thought as simple but I cannot figure it out now. Is there a "smallest" divergent sum? What's the difference between "uname -r" and "uname -v"? Why can't a normal user `chown` a file? Blurring/Feathering a Procedural Pointiness Mask I'm trying to create a procedural mask to affect the sharp edges of my model using the Pointiness output from the Geometry node, leading to the eventual idea of using it to create customisable weathering effects, such as .  This is the base setup that I've got so far.   How is it possible to blur/feather the black edges of the mask so that they would essentially expand across the object until the whole object is rendered black?   I've had a look at both of the go-to texture blur methods suggested for cycles found  and  however these seem to rely on there being a vector input/output for the texture, which is not the case in my example.  The Procedural Cracks tutorial by CGMasters came closest to what I was trying to achieve with the 'Worn Edges' section of the , but I didn't have any success trying to convert it to my situation.  Any ideas would be massively appreciated! :)  EDIT: Not sure if it was clear enough from the description but I'm trying to steer clear of baking/UV-Unwrapping/the Works on this one... Purely procedural :)  UPDATE: I've made a couple of updates to the shader which has given me slightly better results, although it's still not quite there and the mask blur/expansion issue is still not successful.  This is what it now looks like:   The issue is now coming from the grey values of the mask 'leaking' out across the whole mesh and not stemming from the black values... if that makes sense? :P   In researching weathering effects in blender, I stumbled across , which is exactly what I want to achieve?  UPDATE 2: Still no luck achieving the desired effect in the gif, however I feel I'm slightly closer from adding another colour ramp node after the previous ones.    Does anyone have any more ideas?  UPDATE 3: Found a working solution, added an answer below if people are interested :) This is a small exercise that I just can't seem to figure out. When I see it I'll probably go 'ahhh!', but so far I haven't made any progress.  I'd like to prove that any linear functional $\phi$ on $\ell^\infty$ that is positive, i.e. for any $(x_n) \in \ell^\infty$ such that $x_n \geq 0$ for all $n \in \mathbb{N}$ we have $\phi((x_n)) \geq 0$, is a bounded linear operator and has $\|\phi \| = \phi((1,1,...))$.  Nothing I have tried worked so far, so any hints would be appreciated, thanks!