I'm new to JFrame buttons and I have two JButtons. The one with Submit works but when I try to use the other with a specific name it doesn't output a string into the console. In the end the second JButton (btn) will have different names but when clicked on the button doesn't do anything.  package schoolprgm;  import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Arrays;  import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants;   public class Jeopardy extends JFrame  {   static JButton btn = new JButton();static JButton Submit = new JButton(); static JFrame frame = new JFrame("Jeopardy");static JPanel panel = new JPanel(new GridLayout(7,5,10,10)); static JTextField textField = new JTextField(10); public  Jeopardy(){       frame.setDefaultCloseOperation(3);     frame.setVisible(true);      Submit.addActionListener(new ButtonListener());      btn.addActionListener(new ButtonListener());  }  public static void main(String[] args) {     // TODO Auto-generated method stub        frame.setPreferredSize(new Dimension(1000,400));            frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);          int Score = 0;        JLabel l2 = new JLabel("Score: "+ String.valueOf(Score));        JLabel l3 = new JLabel();        ArrayList question = new ArrayList();         JLabel l = new JLabel("Question: "+ question);          Jeopardy.Submit.setText("Submit");          l.setLabelFor(textField);          /*label1.setText("Label1");          panel.add(label1);         panel.add(label2);         panel.add(label3);         panel.add(label4);         panel.add(label5);         panel.add(label6);         *///panel.add(label7);           String words = ("Category 1,Category 2,Category 3,Category 4,Category 5,Category 6,Category 7,C1: 100,100,100,100,100,100,100,200,200,200,200,200,200,200,300,300,300,300,300,300,300,400,400,400,400,400,400,400,500,500,500,500,500,500,500,999,999,99,999,999,999,999,999,999,999,999,999");         ArrayList btnnames = new ArrayList();         String[] words2 = words.split(",");         btnnames.addAll(Arrays.asList(words2));       frame.add(panel);         for(int x=0;x&lt;42;x++){              if( x &gt;= 0 &amp;&amp; x&lt;=6){                 JLabel label = new JLabel(String.valueOf(btnnames.get(x)));                 panel.add(label);                 label.setText(String.valueOf(btnnames.get(x)));             }             else{            btn = new JButton(String.valueOf(btnnames.get(x)));           Jeopardy.btn.setText(String.valueOf(btnnames.get(x)));             panel.add(btn);         }}           panel.add(l);         panel.add(textField);         panel.add(Submit);         panel.add(l2);         panel.add(l3);            frame.setContentPane(panel);         frame.pack();         frame.setVisible(true);         frame.setResizable(false);      frame.getContentPane().add(new Jeopardy());  }   }  class ButtonListener implements ActionListener { @Override     public void actionPerformed(ActionEvent e) {        if (e.getActionCommand()=="Submit"){         System.out.println("submit");         System.out.println(Jeopardy.textField.getText());      } if (e.getActionCommand()==("C1: 100")) {       System.out.println("100 has been clicked");     }       } }
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 read a lot about the classical twin paradox recently. What confuses me is that some authors claim that it can be resolved within , others say that you need . Now, what is true (and why)? CW complex such that action induces action of group ring on cellular chain complex. Let $X$ be a space that satisfies the hypotheses used to construct a universal cover $\overline{X}$. Let $\pi = \pi_1(X)$ and consider the action of the group $\pi$ on the space $\overline{X}$ given by the isomorphism of $\pi$ with $\text{Aut}(\overline{X})$. Let $A$ be an abelian group and let $\mathbb{Z}[\pi]$ act trivially on $A$, $a \cdot \sigma = a$ for $\sigma \in \pi$ and $a \in A$.  Now, assume that $X$ is a CW complex. How do I see that $\overline{X}$ is a CW complex such that the action of $\pi$ on $\overline{X}$ induces an action of the group ring $\mathbb{Z}[\pi]$ on the cellular chain complex $C_*(\overline{X})$ such that each $C_q(\overline{X})$ is a free $\mathbb{Z}[\pi]$-module and$$C_*(X; A) \cong A \otimes_{\mathbb{Z}[\pi]} C_*(\overline{X})?$$ In the neural network literature, often we encounter the word "tensor".  Is it different from a vector? And from a matrix? Have you got any specific example that clarifies its definition?  I'm a bit confused about its definition. Wikipedia doesn't help and sometimes I have the impression that its definition depends on the specific machine learning environment used (TensorFlow, Caffee, Theano). every permutation is either even or odd,but not both How we can show every permutation is either even or odd,but not both......I can't arrive at a proof for this ..... Can anybody give me the proof...  Thanks in advance... Methods to find $\lim\limits_{n\to\infty}\frac1n\sum\limits_{k=1}^nn^{1/k} $ What would you suggest here?  $$\lim_{n\to\infty} \frac{1}{n} \sum_{k=1}^{n} n^{1/k} $$ What are the mechanics by which Time Dilation and Length Contraction occur? What are the mechanics of time dilation and length contraction? Going beyond the mathematical equations involving light and the "speed limit of the universe", what is observed is merely a phenomenon and not a true explanation of why time dilates or length contracts.  It has been proven to work out, but do we know why?  Is it something that happens at a subatomic level? Tried to add a comment to a post today, which ended up looking rather weird. What I had typed was:  On windows I believe you need to use `\` instead of `/`   As you can see in the first comment to this question, I don't exactly end up with what I thought I would... What's going on here?  Tried various combinations of double \\ and double `` (which seems to be impossible to have in an inline code thing...?), but couldn't get a good result. Ended up putting a space after the slash, which at least made it readable. Problem then was that the space between the inline code and the word "instead" seems to disappear O.o An excerpt from Introduction to Analytic Number Theory by Tom M. Apostol.      I have three main concerns regarding this proof:    What is the abscissa of convergence for $\frac{1}{F(s)}$ - why can we take the product of the two series. I only know this is true if the two series are absolutely convergent.  Why can we do term by term integration? I believe its suffices to show that the series converges locally uniformly - BUT is this true?  How does the proof show that $G(s)$ converges uniformly? I have a file with the lines like below.  title1:A1 title2:A2 title3:A3 title4:A4 title5:A5  title1:B1 title2:B2 title3:B3 title4:B4 title5:B5  title1:C1 title2:C2 title3:C3 title4:C4 title5:C5  title1:D1 title2:D2 title3:D3 title4:D4 title5:D5  How can I achieve this?   title1    title2     title3    title4 A1         A2         A3         A4 B1         B2         B3         B4 C1         C2         C3         C4 D1         D2         D3         D4 Code working in jsFiddle but not in browser How to trigger workflow from button in O365 I created a script editor webpart. I added a button which start a js function in the onClick event. I would like to start a workflow which is implemented on some list. Is this possible? Theorem environment with hanging indentation I would like to define a theorem environment with custom layout. In particular, I want the body of the theorem to be indented, like this  Text body. Text body. Text body.  Theorem 1 (Pythagoras).     Let a,b,c the sides of a rectangular triangle.     Without loss of generality, we assume that  a&lt;b&lt;c .     Then, the following equality holds:            a^2 + b^2 = c^2  More text. And even more text.   This is similar to the quote environment, I believe.  How can I do this?  Preferably, I would like to use the existing \newtheorem command, but that's not mandatory. How can I draw a graph like the diagram below? I'm trying, but something is wrong with my code in LaTeX: \begin{asy} pair dynkinMark(real x, real y, string s = &quot;&quot;, pen p = defaultpen, pair B = dir(45)) { if (s != &quot;&quot;) { dot(&quot;$&quot;+s+&quot;$&quot;, (x,y), B, p); }     else { dot((x,y), p); }     return (x,y); }  dynkinMark(0,1, &quot;1&quot;, dir(135)); dynkinMark(0,2, &quot;2&quot;, dir(135)); dynkinMark(0,3, &quot;3&quot;, dir(135)); dynkinMark(0,4, &quot;4&quot;, dir(135)); dynkinMark(7,1, &quot;1'&quot;); dynkinMark(7,2, &quot;2'&quot;); dynkinMark(7,3, &quot;3'&quot;); dynkinMark(7,4, &quot;4'&quot;); path p1 = (0,1)..(2,2.0)..(5,3.5)..(7,4); path p2 = (0,2)..(2,1.2)..(5,2.5)..(7,3); path p3 = (0,3)..(2,2.8)..(5,1.5)..(7,1); path p4 = (0,4)..(2,3.8)..(5,3.5)..(7,2); draw(p1, blue); draw(p2, heavycyan); draw(p3, mediumcyan); draw(p4, lightblue); dot(&quot;$12$&quot;, IP(p1, p2), dir(90), heavygreen); dot(&quot;$13$&quot;, IP(p1, p3), dir(90), heavygreen); dot(&quot;$23$&quot;, IP(p2, p3), dir(90), heavygreen); dot(&quot;$14$&quot;, IP(p1, p4), dir(90), heavygreen); dot(&quot;$24$&quot;, IP(p2, p4), dir(90), heavygreen); real y = 0.8; label(&quot;$s_1$&quot;, (IP(p1,p2).x, y), heavygreen); label(&quot;$s_2$&quot;, (IP(p1,p3).x, y), heavygreen); label(&quot;$s_1$&quot;, (IP(p2,p3).x, y), heavygreen); label(&quot;$s_3$&quot;, (IP(p1,p4).x, y), heavygreen); label(&quot;$s_2$&quot;, (IP(p2,p4).x, y), heavygreen); \end{asy} VS Code Setup - Create project with manifest error When I try to create project with manifest it is giving me this error:    Starting SFDX: Create Project  12:39:56.757 sfdx force:project:create --projectname Dev --outputdir c:\ --template standard --manifest { AssertionError [ERR_ASSERTION]: Trying to copy from a source that does not exist: C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\lib\templates\project\standard\ScratchDef.json     at EditionInterface.exports.copy (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\mem-fs-editor\lib\actions\copy.js:49:3)     at EditionInterface.module.exports [as copyTpl] (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:29:8)     at ProjectGenerator.writing (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\lib\generators\projectGenerator.js:57:17)     at Object.&lt;anonymous&gt; (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\yeoman-generator\lib\index.js:427:27)     at C:\Program Files (x86)\Salesforce CLI\client\node_modules\run-async\index.js:25:25     at new Promise (&lt;anonymous&gt;)     at C:\Program Files (x86)\Salesforce CLI\client\node_modules\run-async\index.js:24:19     at self.env.runLoop.add.completed (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\yeoman-generator\lib\index.js:428:13)     at runCallback (timers.js:705:18)     at tryOnImmediate (timers.js:676:5)   generatedMessage: false,   name: 'AssertionError [ERR_ASSERTION]',   code: 'ERR_ASSERTION',   actual: false,   expected: true,   operator: '==' } { AssertionError [ERR_ASSERTION]: Trying to copy from a source that does not exist: C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\lib\templates\project\standard\ScratchDef.json     at EditionInterface.exports.copy (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\mem-fs-editor\lib\actions\copy.js:49:3)     at EditionInterface.module.exports [as copyTpl] (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\mem-fs-editor\lib\actions\copy-tpl.js:29:8)     at ProjectGenerator.writing (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\lib\generators\projectGenerator.js:57:17)     at Object.&lt;anonymous&gt; (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\yeoman-generator\lib\index.js:427:27)     at C:\Program Files (x86)\Salesforce CLI\client\node_modules\run-async\index.js:25:25     at new Promise (&lt;anonymous&gt;)     at C:\Program Files (x86)\Salesforce CLI\client\node_modules\run-async\index.js:24:19     at self.env.runLoop.add.completed (C:\Program Files (x86)\Salesforce CLI\client\node_modules\salesforcedx-templates\node_modules\yeoman-generator\lib\index.js:428:13)     at runCallback (timers.js:705:18)     at tryOnImmediate (timers.js:676:5)   generatedMessage: false,   name: 'AssertionError [ERR_ASSERTION]',   code: 'ERR_ASSERTION',   actual: false,   expected: true,   operator: '==' } 12:40:03.206 sfdx force:project:create --projectname Dev --outputdir c:\ --template standard --manifest  ended with exit code 0   Can you please let me know what I am missing:   I have:   installed vs code, salesforce extension pack, salesforce cli, set the environment variable for my user, there is jdk installed (I have not set the path for it, not sure if it is required?)    What I am missing?   Thanks in Advance!! Is acceleration relative in relativity? Suppose a box A is moving relative to a Box B, then by time dilation equation if I take 1 sec passed for an observer in A then for an observer in B will be little longer. Now if I suppose that the box B is moving while A is stationary under the same condition, then by the time dilation equation time passed in B must be shorter than A. How is this issue resolved? In the twin paradox problem my book says that it's due to acceleration, but in my opinion acceleration is relative (please correct me if I'm wrong), but here it is not the case. Is mass converted into energy in exothermic chemical/nuclear reactions?  My (A Level) knowledge of chemistry suggests that this isn't the case. In a simple burning reaction, e.g.   $$\mathrm{C + O_2 \to CO_2}$$  energy is released by the $\mathrm{C-O}$ bonds forming; the atoms lose potential energy when they pull themselves towards each other, in the same way that a falling object converts GPE to KE. There are the same number of protons, electrons etc. in both the reactants and products. I would have assumed that this reasoning extends to nuclear fission/fusion as well, but one physics textbook repeatedly references very small amounts of mass being converted into energy in nuclear reactions.  So I just wanted to know if I was wrong about either of these types of reactions, and if so, what mass is lost exactly? Moving from HTTP to HTTPS in Google Search Console I'm moving from HTTP to HTTPS for my entire site. The site is currently added to Google Search Console (formerly Google Webmaster Tools) as www.example.com and all the pages are indexed without using SSL.  How do I go about moving to the new HTTPS URLs on Google Search Console?   Do I just submit an updated sitemap which has the HTTPS URLs or do I add a new site as https://www.example.com and submit the sitemap with HTTPS URLs? All current URLs are set to redirect to their HTTPS counterparts. Do I add multiple properties to Google Search Console? How would one create an iterative function (or iterator object) in python? An infinite Penney's game. Context: I need to solve one variation of the . Problem: Two players ($A$ and $B$) throw a coin until one of the victory sequences appears. For player $A$ the victory sequence is $HTT$, for player $B$ the victory sequence is $TTH$. What is the probability that $A$ wins and what is the expected number of throws given that $A$ won? My attempt: Intuitively, it seems that player $B$ is more likely to win. Basically, I reliase that we can use the Markov-Chains, but my idea is only draw a binary tree and consider the sequences on the n-th step. My another idea was to calculate the expected number of throws to get, say, $HH$ that would be equal to $r_{HH}$: $$r_{HH} =  \frac{1}{4}E(number|HH) + \frac{1}{4}E(number|HH)+ \frac{1}{4}E(number|TT)+ \frac{1}{4}E(number|TH) = \frac{1}{4}(9 + \frac{5}{2} r_{HH})$$  And get $r_{HH}$. My issues: I don't really understand how to join these ideas to get a proper solution. Joined pipelines Considering a routine such as this one:  alpha() { echo a b c |tr ' ' '\n'; }   which outputs a stream, I would like to take the output stream, transform it, and paste it with the original output stream.  If I take use upcasing as a sample transformation, I can achieve what I want with:  $ mkfifo p1 p2 $ alpha | tee p1 &gt;( tr a-z A-Z &gt; p2) &gt;/dev/null &amp; $ paste p1 p2 a       A b       B c       C   My question is, is there a better way to do this, preferably one not involving named pipes?