Complete Error:     "Attempt to invoke virtual method 'bolts.Task com.parse.ParseUser.signUpInBackground()' on a null object reference"   I am trying to make a login and sign up button, on clicking it the user must be signed in and if failed then signed up.  Here is my source code:  public void onClickLogInSignUp (View view) {     EditText editTextUsername = (EditText) findViewById(R.id.editTextUsername);     EditText editTextPassword = (EditText) findViewById(R.id.editTextPassword);      username = editTextUsername.getText().toString();     password = editTextPassword.getText().toString();      ParseUser.logInInBackground(username, password, new LogInCallback()     {          @Override         public void done(ParseUser user, ParseException e)         {             Log.i("Parse","Trying to log in ");              if ( e == null )             {                 Log.i("Parse","Log In Successful");                 Log.i("Parse","Redirecting as "+ ParseUser.getCurrentUser().getUsername());                 Toast.makeText(MainActivity.this, "Logged In", Toast.LENGTH_SHORT).show();                 startActivity(new Intent(getApplicationContext(), UserList.class));             }             else             {                 Log.e("Parse","Log In Failed Error - "+e.toString());                 isLogInSuccessful = false;                 ParseUser.getCurrentUser().signUpInBackground();                 ParseUser.getCurrentUser().saveInBackground(new SaveCallback()                 {                     @Override                     public void done(ParseException e)                     {                         ParseUser user = new ParseUser();                         user.setUsername(username);                         user.setPassword(password);                         user.signUpInBackground(new SignUpCallback()                         {                             @Override                             public void done(ParseException e)                             {                                 if (e == null)                                 {                                     startActivity(new Intent(getApplicationContext(), UserList.class));                                     Log.i("Parse","Sign Up Successful");                                     Log.i("Parse","Redirecting as "+ ParseUser.getCurrentUser().getUsername());                                     Toast.makeText(MainActivity.this, "Signed Up", Toast.LENGTH_SHORT).show();                                 }                                 else                                 {                                     Log.e("Parse","Can't log in as well as signup.");                                     Toast.makeText(MainActivity.this, "Can't log in as well as signup.", Toast.LENGTH_SHORT).show();                                 }                             }                         });                      }                 });             }         }     }); }
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?
Matrix representation of linear transformation Cannot start XAMPP on Ubuntu 11.10 How to serve static files in Flask What approach should I take to establish this logical proof? I need to design a logical math proof:  Write a detailed structured proof to prove that if m and n are integers, then either 4 divides mn or else 4 does not divide n.   Hint: Think about the form of the statement.   I was thinking about first proving that either 4 should divide m or n in order for the first part to be true, then use proof by cases to prove what happened when m was 4, and another case when n was 4...  But I got stuck, what do you recommend:    This is what I got so far: Claim: (m ∈ Z ∧ n ∈ Z) => (4 | mn ˅ 4 ∤ n)  Negated claim: (m ∈ z ∧ n ∈ z) ∧ ( P(n) ∧ ¬P(mn) )  Proof by contradiction  Assume m , n ∈ z:    Assume P(n) ∧ ¬P(mn):       Then ∃ q ∈ R, n = 4q       Let q0 be such that n = 4q0       Then mn = m(4q0)       Then mn = 4(mq0)       Then ∃ q ∈ R, mn = 4q        Then 4 | mn     Then P(n) ∧ P(mn) Then (m , n ∈ z) ∧ P(n) ∧ P(mn))    I know that is wrong, how can I fix it? Let $(a_n)$ be a sequence of positive terms and suppose that $\sum_\limits{n=0}^{\infty} a_n$ converges. Show that $\sum_\limits{n=0}^{\infty} a_n^2$ converges.   This is in the section on the Comparison Test so that must be what I'm supposed to use.  But I don't see how.  $(a_n)^2$ might be smaller or larger than $a_n$ depending on $a_n$.  And I can't use the Comparison Test with some other series because there's no info here about how fast $\sum a_n$ converges.  Hmm.  Any hints? Use central limit to solve a problem I am asked to solve the following question using central limit theorem. In an election between two candidates, A and B, one million individuals cast theirvote. Among these, 2000 know candidate A from her election campaign and vote unanimously for her.The remaining 998000 voters are undecided and make their decision independently of each other byflipping a fair coin.Approximate the probability pA that candidate A wins up to 3 significant figures.  It's easy to solve directly. PA = $\frac{0.5(10000-2000)+2000}{10000}$ = 0.501. However, I am quite confused about how to solve this problem by central limit theorem. Can newsletters take into account a user's favorite tags on that site? Stack Overflow is huge and varied. Wouldn't it be great if I could just subscribe to a newsletter with a list of my favorite tags? If I love dealing with , I think it would make sense for my version of the newsletter to focus more on Android questions.  Or, if I sign up for the  newsletter, but don't own a Mac, it would be nice if I my newsletter would focus on the part of the site I do follow (i.e., iOS).  So I would like to suggest that the newsletters for each site (optionally) take into account the user's favorited and ignored tags for that site.  I know that you can receive emails about specific filters, but I don't think that's a good solution for users who already receive the newsletter. Most of the questions it highlights cover topics that I have no interest in. It would be much better if I could filter out all the noise and get down to my likely favorites. I am working on a proof about Dedekind cuts on the positive rational numbers. I have been stuck for a while on the following point and would appreciate any help.  Given $x\in \mathbb{Q}^+$ such that $x^2&lt;2$, how to find $y\in \mathbb{Q}^+$ such $y&gt;x$ and $y^2&lt;2$? Setting up SFTP to log in to server with Filezilla I have an ec2 instance on AWS which already installed a few Wordpress-es in it.  I want to set things up to let more people handle their own projects, with me also being able to go into the server using terminal if I still want to.  I have been following tutorials such as  and a few others.  I figured all of them just teach users how to sftp into their own home folder, also the steps keep saying addUser but some users already existed and removing them might cause some issue.  How can I give existing users the permission to use SFTP for Wordpress projects?  Let's say all my Wordpress projects are already under /var/www/ which has already been set up with www-data:www-data.  Really new with setting things like this.  Thanks in advance for any help. Writing C# debug output to .txt file Approximating a $\sigma$-algebra by a generating algebra Theorem. Let $(X,\mathcal B,\mu)$ a finite measure space, where $\mu$ is a positive measure. Let $\mathcal A\subset \mathcal B$ an algebra generating $\cal B$. Then for all $B\in\cal B$ and $\varepsilon&gt;0$, we can find $A\in\cal A$ such that $$\mu(A\Delta B)=\mu(A\cup B)-\mu(A\cap B)&lt;\varepsilon.$$  I don't think there is a proof in this site. It's a useful result for several reasons:  We know what the algebra generated by a collection of sets is, but not what the generated $\sigma$-algebra is. The map $\rho\colon \cal B\times\cal B\to \Bbb R_+$, $\rho(A,A')=\mu(A\Delta A')$ gives a pseudo-metric on $\cal B$. This makes a link between generating for an algebra and dense for the pseudo-metric. We say that a $\sigma$-algebra is separable if it's generated by a countable class of sets. In this case, the algebra generated by this class is countable. An with the mentioned result, we can show that $L^p(\mu)$ is separable for $1\leq p&lt;\infty$, which makes a link between the two notions. In ergodic theory, we have to test mixing conditions only an a generating algebra, not on all the $\sigma$-algebra. If a PIC MCU provides multiple Vdd/Vss should you provide power to them all? Take a look at this example schematic:  The chip in question is the  and as you can see power is provided on both sides (with a 100nF cap to smooth noise I guess). Is this strictly required or could you put power into one side and just ignore the other? I know that I have just put power in one side and everything still seems to work fine but I feel uneasy with doing that. I feel that they would not waste pins that could be doing something useful by having an extra pair of power in/out pins. For what purpose does this PIC MCU (and others like it) have multiple power pins? Why is travelling around the speed of light a problem? I don't fully understand what would happen if we could travel at the speed of light. But I saw somewhere here that it would mean events happen out of order. But why is this a problem. It is said that cause has to happen before the effect, but why does this have to be linear?   And why is it that the speed of light is the maximum? I take it that light (photons?) are massless, so why can't they travel faster? Polygamma reflection formula I was naively validating my binomial logit models by testing on a test dataset. I had randomly divided the available data (~2000 rows) into training (~1500) and validation (~500) datasets.   I now read a post in another thread ( Frank Harrell) that causes me to question my approach:     Data splitting is not very reliable unless you have more than 15,000   observations. In other words, if you split the data again, accuracy   indexes will vary too much from what you obtained with the first   split.   How serious is this worry and what are ways around it? The OP speaks of "resampling" but not sure how that works here for validation.   Edit: Adding context as per @Bernhard's comment below: How to make traditional output for derivatives Asking similar questions - process? How to shut down the computer safely by pressing the power button? So this is pretty simple: when I press the power button whilst the machine is on, it comes up with a menu (of which one of the options is to shutdown)  However, I just want it to just start shutting down once I press the power button without any further interaction!  How do I accomplish this? Is it possible to delete multiple elements from a list at the same time? If I want to delete elements at index 0 and 2, and try something like del somelist[0], followed by del somelist[2], the second statement will actually delete somelist[3].  I suppose I could always delete the higher numbered elements first but I'm hoping there is a better way. How do I access the terminal without logging in to the desktop?