it keeps saying   Exception in thread "main" java.lang.NullPointerException     at jframe.game.JFrameGame.main(JFrameGame.java:29) Java Result: 1   whenever I try ro run the code and I have no clue why. also ive been using this video tutorial series:   package jframe.game;  import java.awt.Canvas; import java.awt.Dimension; import java.awt.Graphics; import javax.swing.JFrame;  public class JFrameGame extends Canvas implements Runnable{     int height = 500;     int width = 500;      private JFrame frame;     private Thread thread;     private boolean running = false;      public synchronized void start(){         running = true;         thread = new Thread((Runnable) this);           thread.start();      }      public static void main(String[] args) {         JFrameGame thegame = new JFrameGame();          //frame = new JFrame();          thegame.frame.setResizable(false);         thegame.frame.setTitle("hello frame");         thegame.frame.add(thegame);         thegame.frame.pack();         thegame.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);         thegame.frame.setLocationRelativeTo(null);         thegame.frame.setVisible(true);          thegame.start();     }      public void run(){          while(running == true){             System.out.println("running the run method");         }      }      public JFrameGame(){         Dimension size = new Dimension(500, 500);         setPreferredSize(size);      }  }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Isomorphism between quotient modules Is it true for a commutative ring $R$ and its ideals $I$ and $J$ that if the quotient $R$-modules $R/I$ and $R/J$ are isomorphic then $I=J$? Prove that $\mathbb{Z}$ is not isomorphic to additive group of any vector space over any field. Prove $2^n-1$ is divisible by $(2^m-1)^2$ iff... Prove that for any $m,n\in\mathbb{Z}^+$, the number $2^n-1$ is divisible by $(2^m-1)^2$ iff the number $n$ is divisible by $m(2^m-1)$.  My work so far:  It's an if and only if statement, so the common approach is to split the proof into two "if then" proofs ($A\rightarrow B \text{ and } B\rightarrow A$).  Starting with $A\rightarrow B$, for a direct proof, I would assume $A$ and prove $B$. I can use the definition of divisibility:  Assume $n=m(2^m-1)k$ for some integer $k$  Then I need to prove that $2^n-1=(2^m-1)^2h$ for some integer $h$  So I'm thinking I need to start with the expression $2^n-1$ and transform it to $(2^m-1)^2h$, or vice versa, and I need to use the assumption $n=m(2^m-1)k$ somehow.  I notice that the LS of the equality contains the variable $n$ while the RS contains $m$, and the assumption relates $n$ to $m$, so that could be a way forward. For example, simple substitution gives $2^{m(2^m-1)k}-1$, but I'm not sure what I could do from here. Perhaps there's a divisibility theorem that could help?  Other things I notice: $2^n-1$ and $(2^m-1)^2$ are always odd. Also, the divisors in both cases are multiples of $2^m-1$.  Any help/hints appreciated. What is the physical meaning of commutators in quantum mechanics? This is a question I've been asked several times by students and I tend to have a hard time phrasing it in terms they can understand. This is a natural question to ask and it is not usually well covered in textbooks, so I would like to know of various perspectives and explanations that I can use when teaching.  The question comes up naturally in what is usually students' second course in quantum physics / quantum mechanics. At that stage one is fairly comfortable with the concept of wavefunctions and with the Schrödinger equation, and has had some limited exposure to operators. One common case, for example, is to explain that some operators commute and that this means the corresponding observables are 'compatible' and that there exists a mutual eigenbasis; the commutation relation is usually expressed as $[A,B]=0$ but no more is said about that object.  This naturally leaves students wondering     what is, exactly, the physical significance of the object $[A,B]$ itself?   and this is not an easy question. I would like answers to address this directly, ideally at a variety of levels of abstraction and required background. Note also that I'm much more interested in the object $[A,B]$ itself than what the consequences and interpretations are when it is zero, as those are far easier and explored in much more depth in most resources.    One reason this is a hard question (and that commutators are such confusing objects for students) is that they serve a variety of purposes, with only thin connecting threads between them (at least as seen from the bottom-up perspective).   Commutation relations are usually expressed in the form $[A,B]=0$ even though, a priori, there appears to be little motivation for the introduction of such terminology. A lot of stock is placed behind the canonical commutation relation $[x,p]=i \hbar$, though it is not always clear what it means.  (In my view, the fundamental principle that this encodes is essentially de Broglie's relation $\lambda=h/p$; this is made rigorous by the  but that's quite a bit to expect a student to grasp at a first go.) From this there is a natural extension to the Heisenberg Uncertainty Principle, which in its general form includes a commutator (and an anticommutator, to make things worse). Canonically-conjugate pairs of observables are often introduced, and this is often aided by observations on commutators. (On the other hand, the energy-time and angle-angular momentum conjugacy relations cannot be expressed in terms of commutators, making things even fuzzier.) Commutators are used very frequently, for example, when studying the angular momentum algebra of quantum mechanics. It is clear they play a big role in encoding symmetries in quantum mechanics but it is hardly made clear how and why, and particularly why the combination $AB-BA$ should be important for symmetry considerations.  This becomes even more important in more rigorous treatments of quantum mechanics, where the specifics of the Hilbert space become less important and the algebra of observable operators takes centre stage. The commutator is the central operation of that algebra, but again it's not very clear why that combination should be special. An analogy is occasionally made to the Poisson brackets of hamiltonian mechanics, but this hardly helps - Poisson brackets are equally mysterious. This also ties the commutator in with time evolution, both on the classical side and via the Heisenberg equation of motion.   I can't think of any more at the moment but they are a huge number of opposing directions which can make everything very confusing, and there is rarely a uniting thread. So: what are commutators, exactly, and why are they so important? I just read a description of CVE-2020-1971, which indicates that a patch was released today for openSSL, the patched version is 1.1.1i -- my version of Ubuntu 20.04.1 LTS is running openSSL version 1.1.1f.  From last March. Software Updater says that my system is up to date.  I am hoping that this openSSL update is released by Canonical by tomorrow... can anyone confirm they are working on this? Always when I'm going to travel to someplace, I book my hostel with precedence. Actually I look only for two Booking sites:      Is there a cheaper site than these two, which has the same service with same quality, with the same number or larger? Order of a homomorphism of groups How to disable Excel number autoformat I tried this in mysql:  mysql&gt; alter table region drop column country_id;   And got this:  ERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to './product/region' (errno: 150)   Any ideas? Foreign key stuff? Detecting current iPhone input language Missing whitespace in beta site statistics box So I'm working on this class that's supposed to request help documentation from a vendor through a web service. I try to name it DocumentRetriever, VendorDocRequester, DocGetter, but they just don't sound right. I ended up browsing through  for half an hour trying to come up with an adequate word.   Start programming with bad names is like having a very bad hair day in the morning, the rest of the day goes downhill from there. Feel me? What was the issue solved by the new "using" syntax for template typedefs? "Would" & " Used to" When I go to any github.com page in Chrome, I get a big ugly error:  You attempted to reach github.com, but the server presented a certificate issued by an entity that is not trusted by your computer's operating system. This may mean that the server has generated its own security credentials, which Chrome cannot rely on for identity information, or an attacker may be trying to intercept your communications. You cannot proceed because the website operator has requested heightened security for this domain.  The same thing happens (in Chrome and with curl) when I go to  too. This strange problem started about a week and a half ago. Here's what I see when I click the broken lock icon in the address bar:   But gist.github.com works just fine:   It doesn't work with curl either:  Everything works fine in Firefox. How can I fix my root CA problem? Here's what it looks like in Firefox:   Update: I noticed that the first certificate in the chain is different in my broken Chrome/Safari as compared to Chrome on my other computer.   (There's no nasty red X anymore because I trusted it in Safari.) See how the issuers are different? What can I make of that? I have joined corresponding Local Enterprise Partnerships table data into a polygon shapefile containing UK Local Authorities.      How do I Dissolve or Merge the the Local Authorities polygons by LEP_NAME as shown in the screenshot?   Ideally, I would like to retain the Local Authority attributes with the resultant merged polygons. I have zero scripting knowledge so am looking for a tool based solution. Any help or pointers much appreciated.    Additional Note: When attempting to use the dissolve tool the LEP_NAME field is not available as shown above. The LEP attribute data was created in Excel, saved as CSV format and joined to the Local Authority polygon shapefile. There are duplicate IDENTIFI0 fields as shown in the other screenshot - could this be the root of the issue? An integration question to be solved without using differentiation under the integral sign. problems using apa6e with biblatex-apa As in  I'm trying to use apa6e and biblatex-apa together and having problems.  Before I arrived at these problems, over the course of many hours of much reading, I first managed to get BibTeX working as expected in a simple input file (by modifying sample2e.tex). Then I managed to get apa6e working as expected based on the author's example in apa6e.pdf (which uses apacite). But when I try to get apa6e working with biblatex-apa, I end up with problems.  Here's my input file:  \documentclass{apa6e}  \usepackage[american]{babel} \usepackage{csquotes}  % biblatex \usepackage[style=apa]{biblatex} \bibliography{biblatex-apa-test-references}  \title{An Example Document} \shorttitle{Psychology: the end} \author{Silly Name}  \authornote{\dots} \abstract{\dots}  \begin{document}  \maketitle  This is an example input\cite{7.01:2} file.  Comparing it with the output it generates can show you\cite{7.01:3a} how to produce a simple document of your own.  \printbibliography  \end{document}   Attempting to typeset this in TeXShop by running LaTeX, then BiBTeX (which based on console messages, does seem to correctly call biblatex rather than BiBTeX), then LaTeX again, I get the following error message which I am having great difficulty (no doubt due to my lack of experience with TeX and co.) decoding.  (./test6.aux) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/ot1ptm.fd) *geometry* driver: auto-detecting *geometry* detected driver: pdftex (./test6.bbl) Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 An Ex-am-ple Doc-u-ment   Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 Silly Name   Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 Author Note  [1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 Abstract  [2] Underfull \hbox (badness 10000) in paragraph at lines 18--18  []\OT1/ptm/m/n/12 An Ex-am-ple Doc-u-ment   Underfull \hbox (badness 10000) in paragraph at lines 25--25  []\OT1/ptm/b/n/12 References  ./test6.tex:25: Undefined control sequence. &lt;argument&gt; \mkbibdateapalongextra  (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/ot1pcr.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/ot1ztmcm.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/omlztmcm.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/omsztmcm.fd) (/usr/local/texlive/2011/texmf-dist/tex/latex/psnfss/omxztmcm.fd) Overfull \hbox (8.03372pt too wide) in paragraph at lines 25--25 [][]  \OT1/ptm/m/n/12 Gilbert, D. G., Mc-Cler-non, J. F., Ra-bi-novich, N. E.,  Sugai, C., Plath, L. C., As-gaard, G., ... Botros,  ./test6.tex:25: Undefined control sequence. &lt;argument&gt; \mkbibdateapalongextra                                    {year}{month}{day}\iffieldundef {endyear}{... l.25   I tried many different sources in several different *.bib files before eventually trying the .bib database shown above and included with biblatex-apa. All trials gave a similar error.  Can someone help? I'm impressed that the poster above was able to do anything with apa6e and biblatex-apa, and if I only had her problem of having the reference page title show up in bold, I'd be really happy.  If you need to know, my tools are from a fresh installation of MacTeX that I immediately updated using the TeX Live Utility. I've checked my versions for apa6e (v0.3) and biblatex-apa (v4.2), and I think these are current. When you die, what contributes to your "Score"? When you die, 3 things happen.    You swear  A message appears in the chat log describing how you died A "You died" screen appears, with the options to quit or respawn, and a "Score".   What contributes to this score? Obtaining a formula for prediction limits in a linear model (i.e.: prediction intervals) Let's take the following example:  set.seed(342) x1 &lt;- runif(100) x2 &lt;- runif(100) y &lt;- x1+x2 + 2*x1*x2 + rnorm(100) fit &lt;- lm(y~x1*x2)   This creates a model of y based on x1 and x2, using a OLS regression.  If we wish to predict y for a given x_vec we could simply use the formula we get from the summary(fit).  However, what if we want to predict the lower and upper predictions of y? (for a given confidence level).  How then would we build the formula?