Android: Attempt to invoke interface method on a null object reference ( within builder.setView.setPositiveButton) AlertDialog
What is a NullPointerException, and how do I fix it?
Let $K\subseteq \mathbb{R}^{n} \times \{ 0 \}\subseteq \mathbb{R}^{n+1} $ and $v=(0,0,\cdots,1) \in \mathbb{R}^{n+1}$.      For every $x \in K$,  let $$Lx=\left \{ tv+(1-t)x \; | \ t \in [0,1] \right \}$$      Define    $$ \text{Cone}(K)=\bigcup_{x \in K}Lx. $$   namely the union of all segments from $v$ to every point of $K$.      According to all definitions that I see on books, Cone is defined:       However the exercise I'm working on  asks to find under what circumstances  $$\text{Cone}(K)=\bigcup_{x \in K}Lx$$ is isomorphic to $(K \times [0,1]) /(K \times \{ 1 \})$ (quotient space).   For example if $$K=\{(1/n,0):n\in\mathbb{N}\} \cup (0,0)$$ I can see both of sets form the same graph but I'm still unable to derive a homeomorphism between these two objets. How do I kill background processes / jobs when my shell script exits? I am looking for a way to clean up the mess when my top-level script exits.  Especially if I want to use set -e, I wish the background process would die when the script exits. To turn off my system, I can use one of these three commands:  sudo halt   Or:  sudo poweroff   Or:  sudo shutdown -h now   What are the differences between these commands, or are they all just aliases of each other? Need help recalling name of sci-if story about earth evolving into electronic life forms Read a story once about earth being abandoned for long periods of time. Upon the return of man to earth all life forms, flora and fauna, have evolved into intricate electronic forms of themselves.   Would like to find that story and it's name. Wilson and Fermat's Theorem Question!     Show that the pair of positive integers $n$ and $n+2$ are twin primes if and only if $$4[(n-1)! + 1] + n = 0 \ (\text{mod} \ n(n+2)),$$ where $n$ does not equal $1$. I know this question is asked a lot, but the solutions I saw didn't work for me.  I only have one virtual host enabled, and I'm trying to enable access to a folder that's not under the document root  ServerAdmin webmaster@localhost DocumentRoot /var/www/html  Alias /movies /home/username/Videos/Movies  &lt;Directory /home/username/Videos/Movies/&gt;     Options Indexes FollowSymLinks     AllowOverride None     Require all granted &lt;/Directory&gt;   I set /etc/apache2/envvars as follows  export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=public   I made sure that /home/username/Videos/ and its sub folders are owned by username:public, set the permissions to 777 (after 775 didn't work) and made sure that user www-data belongs to group public.  Now, when I browse to http://localhost/movies I get  [Mon Apr 21 11:28:14.971844 2014] [core:error] [pid 1385:tid 140067725104896] (13)Permission denied: [client 127.0.0.1:46603] AH00035: access to /movies/ denied (filesystem path '/home/username/Videos') because search permissions are missing on a component of the path   But when I set /etc/apache2/envvars to run Apache under username (my own username) everything works fine. The problem is permission related, but I don't see how in my case; especially when I set the permissions to 777. Any ideas?  P.S. Ubuntu version is 14.04, Apache is 2.4.7 and I didn't edit other configuration files. has been, have been , had been In Nginx, how can I rewrite all http requests to https while maintaining sub-domain? Electric Flux - What is the point? Electric flux is a defined quantity that is proportional to the no. of field lines passing through a given area element for a given electric field. It is not proportional to the relative density of field lines, which would supply information regarding the strength of the field at that point. Electric flux, it seems to me, does not supply us with any practical information. It seems to me that electric flux is a quantity defined and modeled specifically for Gauss' law, to introduce some kind of mathematical elegance to it and to introduce an additional visual aspect to the concept of electric fields. Perhaps this is why for symmetrical situations especially, Gauss' Law can be used to easily determine the electric field due to the given charge distribution. Am I wrong here? Is there a physical significance to electric flux that I do not understand? How do I disable the volume control overlay? When changing the volume on a Mac, you get a big ugly gray bezel showing the change in volume. This is super annoying when (say) watching a movie. Is there any way to disable this? This is solely a reference request. I have heard a few versions of the following theorem:     If the joint moment generating function $\mathbb{E}[e^{uX+vY}] = \mathbb{E}[e^{uX}]\mathbb{E}[e^{vY}]$ whenever the expectations are finite, then $X,Y$ are independent.   And there is a similar version for characteristic functions. Could anyone provide me a serious reference which proves one or both of these theorems? Is there a single word with the same meaning as "good moments" or "pleasant memories"? I'm looking for a word which describes good thing(s) that happened to someone. The only word I can think of is "joy".  Some examples might be:   Wayne has many pleasant memories of the days spent with the family. She could remember many good moments from the last weekend. When writing custom classes it is often important to allow equivalence by means of the == and != operators. In Python, this is made possible by implementing the __eq__ and __ne__ special methods, respectively. The easiest way I've found to do this is the following method:  class Foo:     def __init__(self, item):         self.item = item      def __eq__(self, other):         if isinstance(other, self.__class__):             return self.__dict__ == other.__dict__         else:             return False      def __ne__(self, other):         return not self.__eq__(other)   Do you know of more elegant means of doing this? Do you know of any particular disadvantages to using the above method of comparing __dict__s?  Note: A bit of clarification--when __eq__ and __ne__ are undefined, you'll find this behavior:  &gt;&gt;&gt; a = Foo(1) &gt;&gt;&gt; b = Foo(1) &gt;&gt;&gt; a is b False &gt;&gt;&gt; a == b False   That is, a == b evaluates to False because it really runs a is b, a test of identity (i.e., "Is a the same object as b?").  When __eq__ and __ne__ are defined, you'll find this behavior (which is the one we're after):  &gt;&gt;&gt; a = Foo(1) &gt;&gt;&gt; b = Foo(1) &gt;&gt;&gt; a is b False &gt;&gt;&gt; a == b True To use Windows and Ubuntu on one computer, which should I install first? Discontinuous functions with closed graphs I tried looking up a question regarding graphs of continuous functions on this site, but all the ones I found consider functions from $\mathbb{R}$ into $\mathbb{R}$. I have been pondering the following question: given a general topological spaces $X, Y$, and a function $f: X\to Y$, when does $Graph(f)$ closed in $X\times Y$ imply that $f$ is continuous. By the closed graph theorem, this is true whenever $X$ and $Y$ are both Banach spaces.   Also, it is fairly easy to prove that whenever $Y$ is a Hausdorff space and $f$ is continuous, then $Graph(f)$ is closed, but I do not think that the converse is true, so I am trying to find an example where $X$ is some topological space, $Y$ a Hausdorff space, $f: X\to Y$ a function with a closed graph in $X\times Y$, but who fails to be continuous. As of yet I have not been able to find such a counterexample, partially because I have no clue where to look for such a counterexample. I would really appreciate getting some directions to go in. Is is true &lt;h1&gt; tag should not have more than 1 on every page for SEO?   Every pages on the header, it includes and &lt;h1&gt; tag. Website Name which show an image from logo class, like this:  &lt;div id="header"&gt;   &lt;h1 class="logo"&gt;      &lt;a href="#"&gt;Website Name&lt;/a&gt;   &lt;/h1&gt; &lt;/div&gt;   and I also include &lt;h1&gt; on the contact page, help, etc and article page for example:  &lt;h1&gt;Contact Us&lt;/h1&gt; &lt;h1&gt;Name of the Article Title here&lt;/h1&gt;   On the homepage, it just has one &lt;h1&gt; for the logo Site Name... other pages have 2 &lt;h1&gt; tags How can I change media volume when no media is being played? Sometimes I want to play games in (near) silence, and don't like the background music to disturb people. If I use the volume buttons, the ringtone volume is changed instead of media volume. When I'm already in the game, the volume buttons do change the volume of background music, but it's kinda too late.  Is there a way for me to change the media volume to a level I like, from the home screen, before starting apps/games? my circuit is shown on the picture. the problem is the output of the mosfet does't work as desired. For example, If I use Vin=100V and the duty cycle is 50%, the output is Vout=19V.  Anyway, the output is not even near to the desired value. can you help, please? Let's say we have this code for a LWC:  &lt;!-- helloExpressions.html --&gt; &lt;template&gt;     &lt;div class="slds-m-around_medium"&gt;         &lt;lightning-input name='firstName' label="First Name" onchange={handleChange}&gt;&lt;/lightning-input&gt;         &lt;lightning-input name='lastName' label="Last Name" onchange={handleChange}&gt;&lt;/lightning-input&gt;         &lt;p class="slds-m-top_medium"&gt;Uppercased Full Name: {uppercasedFullName}&lt;/p&gt;     &lt;/div&gt; &lt;/template&gt;   and this is the JS file:  // helloExpressions.js import { LightningElement, track } from 'lwc';  export default class HelloExpressions extends LightningElement {     @track firstName = '';     @track lastName = '';      handleChange(event) {         const field = event.target.name;         if (field === 'firstName') {             this.firstName = event.target.value;         } else if (field === 'lastName') {             this.lastName = event.target.value;         }     }      get uppercasedFullName() {         return `${this.firstName} ${this.lastName}`.toUpperCase();     } }   firstName and lastName have been decorated with @track. Now as per the documentation, decorating a property with @track makes it private and reactive, while to mark a property public and reactive, use @api.  So if I just change the decorator to @api for both these variables, it should work. I am referring these from the same component only. But it's not working.  UPDATE: 27th Feb -------------------- Somehow it's working today. I just changed the decorator of the variables to api.  import { LightningElement, api } from 'lwc';  export default class HelloExpressions extends LightningElement {     @api firstName = '';     @api lastName = '';      handleChange(event) {         const field = event.target.name;         if (field === 'firstName') {             this.firstName = event.target.value;         } else if (field === 'lastName') {             this.lastName = event.target.value;         }     }      get uppercasedFullName() {         return `${this.firstName} ${this.lastName}`.toUpperCase();     } }   So it's working. Find the area of largest rectangle that can be inscribed in an ellipse The actual problem reads:      Find the area of the largest rectangle that can be inscribed in the ellipse    $$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1.$$   I got as far as coming up with the equation for the area to be $A=4xy$ but then when trying to find the derivative I don't think I'm doing it right.