java.lang.NullPointerException: Attempt to invoke virtual method 'double android.location.Location.getLongitude()' on a null object reference
What is a NullPointerException, and how do I fix it?
Which is correct: "he don't" or "he doesn't"? Which one is correct in a sentence?        He don't    He doesn't      I guess "he doesn't" should be correct because he is third person singular but I've seen some people using do with he. Which one is correct? Bind application to a specific network interface I understand that there is an upper limit. But why do you have to type at least 15 characters to post a comment? It is easy to work around it anyway (like adding dots or other useless things). How to find max of amount of opportunity related to account? I have a below requirement : I need to find maximum amount on related opportunities and to display on account. Ex: suppose I have account A1 and A1 have 5 opportunities with amount o1=>100 o2=>500 o3=>300 o4=>1000 o5=>50 on my account i should have max_opportunity_amount =1000.  I have written below trigger ,but  I am not sure what to do further  trigger maxOppAmountonAcc on Opportunity(after insert){      map&lt;id,Opportunity&gt; oppMap = new map&lt;id,Opportunity&gt; ();     set&lt;Id&gt; oppId = new set&lt;Id&gt;();     for(Opportunity o : Trigger.new)     {         oppMap.put(o.accountId,o);         oppId.add(o.id);     }       List&lt;Account&gt; accList = new List&lt;Account&gt;();      for(Account a : [Select id ,MaxOppAmount__c,(select id,max(amount)  from opportunities) from Account where id in : oppMap.keyset()])     {      }  } I have a document divided into \part \chapter \section and \subsection. I have 3 parts and in each part I reset all the counters.  I want that, when I do a crossref to something that is in the 1st part, chapter 3 and section 5, that LaTeX prints something like I-3.5, but  I don't want that in the tableofcontents part that LaTeX prints the part number. For example, what I want is:     Part I      chapter 1 section 1.1 section 1.2      chapter 2   AND NOT     chapter I-1 section I-1.1 section I-1.2      chapter I-2   The command that I've tried   \renewcommand{\thechapter}{\thepart-\arabic{chapter}} \renewcommand{\thesection}{\thechapter.\arabic{section}}   does exactly what I've said  Can anyone help me? How to stop event propagation with inline onclick attribute? Consider the following:  &lt;div onclick="alert('you clicked the header')" class="header"&gt;   &lt;span onclick="alert('you clicked inside the header');"&gt;something inside the header&lt;/span&gt; &lt;/div&gt;   How can I make it so that when the user clicks the span, it does not fire the div's click event? What is the function of the "Sticky edges" on/off setting in displays? I have installed Ubuntu 12.04 (Precise Pangolin). If I open System Settings &gt;&gt; Displays there is a new (?) on/off button for a setting named Sticky edges.  Can someone tell me what this setting is supposed to control? Is there a standard delay for consumer ratings of apps on the App Store? I have an app that's been out for a couple of weeks. Its not exactly selling like hot cakes yet, but I'm pretty sure I've gotten a rating or a review by now. But nothing shows when viewing either in iTunes or directly on the AppStore on the iPhone.  Is there a standard delay as to when ratings/reviews show up, that Apple imposes, especially for new apps? Or do you think there is some problem with Apple's system? Whilst I understand how the RSA algorithm works, I don't understand how the CPU operates when it needs to use the mod function with a huge number $n$, for example.  $n = 8192$ bits; $c = m^e \mod n$;  In essence my question is how does the CPU deal with this huge modulus? Repeating (or not) "to" in a sentence involving infinitives set in parallel I googled it but I couldn't find the answer... maybe I didn't seek it in the proper way. My question is if &quot;to&quot; must be repeated in sentences such as the following ones:   In the past, women used to do the housework and to take care of children.  The aim of this meeting is to control their progress and to discuss the new working plan.    If I had to bet, I would omit the second to... But I am not sure about it. Title used for an autokrat in an Asimov story? VirtualBox 5.0.40 crashes the whole host since update to kernel 4.13.0-26-generic sed substitution with Bash variables How does ServerName and ServerAlias work? It's the following part of a virtual host config that I need further clarification on:  &lt;VirtualHost *:80&gt;   # Admin email, Server Name (domain name), and any aliases   ServerAdmin example@example.com   ServerName  141.29.495.999   ServerAlias example.com ...   This is and example config, similar to what I currently have (I don't have a domain name at the moment).  &lt;VirtualHost *:80&gt; - Allow the following settings for all HTTP requests made on port 80 to IPs that this server can be contacted on. For instance, if the server could be accessed on more than one IP, you could restrict this directive to just one instead of both.  ServerName - If the host part of the HTTP request matches this name, then allow the request. Normally this would be a domain name that maps to an IP, but in this case the HTTP request host must match this IP.  ServerAlias - Alternate names accepted by the server.  The confusing part for me is, in the above scenario, if I set ServerAlias mytestname.com and then made an HTTP request to mytestname.com, there would have to be a DNS record pointing to the server's IP for this to work? In which case, is ServerAlias just basically EXTRA ServerName entries?  Say I had a DNS entry such that foobar.com = 141.29.495.999 but then I had ServerName = 141.29.495.999 and ServerAlias was empty, would that mean that although foobar.com gets resolved to the right IP, because there is no reference to accept foobar.com in ServerName or ServerAlias?  Or something. Man I'm confused. Is it possible to find out reason of suspension for another user? A user on Stack Overflow was recently temporarily suspended.  Out of curiosity I read through their posts (both questions and answers) and found them to be of decent quality.  They answer far more than they ask (about a 10 to 1 ratio) and always provides lots of sample code in their replies.  They're polite too.  I can't see a reason for suspension.  So, now I'm curious, and maybe I can even learn something from their experience.  Can I find out why they were suspended or is that strictly between the moderator and the user? I have found this figure of a mode of operation using a triple AES with m||IV+ctr input:   I suppose it's a custom mode of operation since I haven't seen it anywhere else. My question is if it is IND-CPA, and how to prove it in an adversarial model? Mouse Pointer Locator Due to a stroke, I have had some vision impairment in that I sometimes have a hard time locating my mouse pointer on the screen.  I have tried making the mouse pointer larger which helps but is still not the solution.  I am new to the Mac world and would appreciate your help.  In Windows, there is an option where pressing the CTRL key will help to identify the mouse pointer using a temporary display of several radiating concentric circles around the mouse pointer.  Is there something like this on OS X? How do I fix these M4 macro errors? I am trying to compile  but when I run ./autogen.sh the script terminates with these errors  Checking for required M4 macros...   libtool.m4 not found   glib-gettext.m4 not found   intltool.m4 not found   pkg.m4 not found   gtk-doc.m4 not found   yelp.m4 not found ***Error***: some autoconf macros required to build mate-desktop   were not found in your aclocal path, or some forbidden   macros were found.  Perhaps you need to adjust your   ACLOCAL_FLAGS?   What do I need to do to get rid of these errors? I tired installing the latest versions of inittool, glib, gtk, yelp, etc... but I still get the macros errors. $x^{x^{x^{\dots}}}=2$, what is the value of $x$? I came up with this little simple exercise, stating:  $x^{x^{x^{\dots}}}$ infinite times is equal to $2$, find $x$.   As we're dealing with infinity, we can just separate the first $x$ and get $x^2=2 \implies x=\sqrt2$  But then I thought what if we change $2$ to $4$? Now we get $x^4=4 \implies x=\sqrt[4]4=\sqrt2$  Something went wrong, can someone explain? How to 'sum' a standard deviation? I have a monthly average for a value and a standard deviation corresponding to that average. I am now computing the annual average as the sum of monthly averages, how can I represent the standard deviation for the summed average ?  For example considering output from a wind farm:  Month        MWh     StdDev January      927     333  February     1234    250 March        1032    301 April        876     204 May          865     165 June         750     263 July         780     280 August       690     98 September    730     76 October      821     240 November     803     178 December     850     250   We can say that in the average year the wind farm produces 10,358 MWh, but what is the standard deviation corresponding to this figure ?