I am getting an error message when I try to run my code   Attempt to invoke virtual method 'android.view.Window$Callback android.view.Window.getCallback()' on a null object reference   Here is the code:  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_the_game);      Button l = (Button) findViewById(R.id.Edit);     l.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             Intent i = new Intent(theGame.this, EditWords.class);             startActivity(i);         }     });   And here is the code for EditWords.java:      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_edit_words);           Button l = (Button) findViewById(R.id.add);         l.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 Intent i = new Intent(EditWords.this, AddWord.class);                 startActivity(i);             }         });          Button x = (Button) findViewById(R.id.delete);         l.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 Intent i = new Intent(EditWords.this, DeleteWord.class);                 startActivity(i);             }         });          Button b = (Button) findViewById(R.id.Back3);         b.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {Intent i = new Intent(EditWords.this, theGame.class);                 startActivity(i);             }         });     } }
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?
Difference between $(this) and event.target? Typesetting Chemical Formulas Why does the reputation need to be publicly displayed? Possible Duplicate:          The idea of getting greater privileges with greater reputation is good, but what is the benefit of publicly displaying that reputation? Since SO claims to be about good questions and answers, that purpose is better served if the reputation is only visible to the account owner (and, of course, the site admins). This would better ensure that content gets pushed up solely by its merit, and not based on the author. (See )   Edit (copied from comment to an answer below): Once you have gathered high reputation, you can also gather more reputation with ordinary answers, especially from newbies (newbies on the topic, not on the site) who usually choose to accept or upvote an answer on the assumption that "since a high-rep user has posted it, it is probably right". Can you guarantee that doesn't happen often? The latest updates (4/1/2018) make my laptop constantly crash the GUI/Unity:  (Intel Pentium su4100 processor)  syslog:  Jan  5 11:38:53 1810 kernel: [ 1850.327738] compiz[11911]: segfault at 0 ip 00007f6c7baf0c16 sp 00007ffd5ec71c60 error 4 in i965_dri.so[7f6c7b513000+82d000]   After login I end up with an empty desktop, just a wallpaper, GUI/Unity are in a crash loop:   No panel.  No dash.  Can't start a program. Launcher disappears. Sidebar disappears. System crash. Windows key not working. The key combination Alt+Tab not working.   Simply, the computer is not usable. Same for guest login. The only thing working: open up a terminal CTRL+ALT+T to examine log files.  I somehow forced  to let me log in and file the bug, but still lots of problems:   Dash not working Alt+Tab not working Sometimes windows all disappear for a few seconds     Any ideas for a solution or workaround?   UPDATE     If you have the same/ very similar problems, follow the link to my    report and mark there that you're affected too. Or file your own. Please leave a comment   if you wish, or upvote - this is a nasty problem - but an answer should   offer a fix or a workaround so users can use their computer again.    Without , Ubuntu can't fix issues. We've had a number of instances over on Stack Overflow involving users who get to the reputation level where they can comment, then spam comments across the site. Due to the lack of community review around comments, these spammed comments can remain on the site for months before someone notices and flags one. Moderators then have to go and manually remove each of these comments. In the last few months, I've personally had to deal with two users who spammed their website across 200+ questions each.  This isn't just limited to people spamming comments with a URL in them. We've had a number of users spray the same nonsense comment or insult across tons of posts and have no one seem to notice for months.  What I'd like is some kind of system-generated notification when a user has posted a barrage of copied-and-pasted comments. This could possibly be triggered when a user has posted a set number of identical comments in a row (4 of them, maybe) or maybe even if they've posted the same comment multiple times. We receive similar system-generated flags when users post duplicate answers, edit many of their posts in a row, or delete many of their own posts at a time.  This system-generated flag should ignore comments generated by review (which have the same text in them). I'm thinking that it shouldn't ignore comments generated by custom off-topic reasons, because someone using the exact same close reason over and over again might be something we want to look into.  The flag itself won't do anything to a user, and would only appear to moderators. I imagine there will be a number of false positives, but it should be easy for us to check these and identify the well-intentioned stock comments from the problematic ones.   We currently have no means of detecting comment spam, so even if this didn't have a great hit rate it would still be beneficial on the balance. Running sample queries for this seems to indicate that it wouldn't have that much noise.  This would allow us to catch comment spam early, and prevent it from living on the site or developing into a more serious problem. Related questions with over 99 score display incorrectly I'm using LyX on Linux Mint 14 ...  Using BibTeX with the apalike style and some modifications in the preamble, I've managed to get the bibliography as it should be except for one thing. When I cite a work with multiple authors it gets printed with the separator "and" which isn't correct for my language (Danish). Curiously it's displayed correctly in the user interface of Lyx - for example "(Wittgenstein og Waismann 2003 - which led me to believe everything was ok but in the pdf the separator "and" is used both in the reference and in the bibliography.  Is there any way to fix this using BibTeX, or can it only be done with biber 1.5, as suggested in the last comment here:   I really hope their is because getting biber to work using the following guide has thus far proven to be impossible:   Help much appreciated ... I really hope I won't have to relapse into setting my master thesis up in LibreOffice. Callback after the record was created using e.force:createRecord Are there a way to add callback after the user created a record and clicked the Save button?  I am using a custom tab and custom components and open the Create a record modal window using e.force:createRecord, but I was not able to find out how to attach callback to the event.  I even found :     Currently force:createRecord event does not accept any callback method or any after save event to handle custom action. Current force:createRecord always redirects to the newly created record. But in case if you want to just close the force:createRecord popup after save and refresh some other related component using the refresh is not possible.    So, is it really impossible? If so, what are current workarounds here? Here is the quadratic matrix equation I've been looking at lately:  $$ Q_{r,r}=A_{r,r}X_{r,r}^2+B_{r,r}X_{r,r}+C_{r,r}=0_{r,r} $$  Note that $A, B, C,$ and $X$ are $r \times r$ matrices. $A$ contains known elements, $B$ contains known elements, $C$ contains known elements, and $X$ contains the unknown elements that you are solving for. $ 0_{r,r} $ is just the $r \times r$ null matrix.  Is there any solution for $X$ in terms of $A, B,$ and $C$ (making no easy assumptions)? (e.g. $X$ is a diagonal matrix, $A=B=C$, or anything of that sort.)  I have tried to solve this and nothing has worked out. I attempted solving it generally by manipulating the matrices in variable form (i.e. actually writing out the matrices $A, B, C,$ and $X$ in variables) and finding a unique solution for all of the elements of $X$ in terms of the elements of $A, B,$ and $C$. That didn't work out beyond the case of $r=1$.  Trying to solve it by looking at $r$ at different values did not work out either; I ended up with very abysmal equations at just $r=2$. I don't know exactly how to make this appealing to the denizens of math.stackexchange, but it (as far as I know) isn't a heavily studied problem.  There is a very high possibility that I've just been doing elementary techniques and nothing of note, so I hope someone or a group of people could shed light on this. How many generator has a cyclic group of order n? If there is a wizard that, by some means, has acquired proficiency in the use of shields, can said wizard use his shield in one hand and his arcane focus quarterstaff in the other and still cast somatic component spells?  Since the quarterstaff has been crafted to also be an arcane focus, and the Sage Advice Compendium states that you can provide the somatic components of spells with the same hand wielding the arcane focus, in this case an arcane focus quarterstaff, could that wizard still be able to perform somatic component spells while using a shield in the other?  I understand War Caster is the feat that allows you to cast somatic component spells even while using a shield and weapon or two weapons in each hand, but is this a simple way around those rules seeing as this "weapon" is your arcane focus? I would like to believe it is not, but I'm not fully fluent in the ways of spellcasting. Consider $\mathbb R^{[0,1]}$ the space of all functions from $[0,1]$  to $\mathbb R$  and the cylindrical sigma algebra $\mathcal B$  on it. The question is: how to prove that $C[0,1]\notin \mathcal B$. Repost it with a minimal working example for the amsmath must be loaded earlier than mathspec problem See the following mwe:  \documentclass{article} \usepackage{amsmath} \usepackage{mathspec} \usepackage{unicode-math}  \begin{document} \begin{equation*}   1 + 2 = 3  \end{equation*} \end{document}   Run the above code with xelatex will meet the following error:  ! Package mathspec Error: `amsmath' must be loaded earlier than `mathspec'.  See the mathspec package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.54 \RequirePackage{amsmath}  ?    $ xelatex --version XeTeX 3.14159265-2.6-0.999991 (TeX Live 2019)  Regards Under the U.S.'s Copyright Law, is it an act of copyright infringement if we changed the color of another artist's image to black and white? How to avoid the wrinkle at the poles of the UV sphere? How do I align the viewport to a face normal? I would like to align the view straight on to a face, perpendicular to the normal. How do I align the 3D viewport to the face of a mesh? I think this is just something I've grown used to but can't remember any proof.  When differentiating and integrating with trigonometric functions, we require angles to be taken in radians. Why does it work then and only then? Was this an oversight?  Or is it to do with the JVM? I have understood how ridge regression shrinks coefficients towards zero geometrically. Moreover I know how to prove that in the special "Orthonormal Case," but I am confused how that works in the general case via "Spectral decomposition." Does iOS support a built-in firewall like macOS does? I don't see anything about it in Settings.