NullPointerException java android
What is a NullPointerException, and how do I fix it?
I started to read about Diffie-Hellman exchange and I encountered a problem which I don't know how to solve.  Given $g=3$, $p=131$, $g^x\bmod p=112$, $g^y\bmod p=74$, compute $g^{xy}\bmod p$   $113$ $110$ $112$ $111$   How could I compute $g^{xy} \bmod p$? Or at least verify which one is correct. Any idea? I tried to make a crouch system. In my script I changed .height and .center properties of collider in CharacterController component. But there are some problems. First, once I press "crouch button" collider is changing its height and center position but when I release the key the collider isn't returning to its previous state. Secondly, if I change its height and position by hand when collider is under a block, it's just stuck. How can I fix this problem?   Here's my script:  using System.Collections; using System.Collections.Generic; using UnityEngine;  [RequireComponent(typeof(CharacterController))] public class PlayerController : MonoBehaviour {      public float moveSpeed;     public float jumpForce;     public CharacterController controller;     public GameObject myCamera;      private Vector3 moveDirection = Vector3.zero;     public float gravityScale;      public Animator anim;      // Use this for initialization     void Start () {         transform.tag = "Player";         controller = GetComponent&lt;CharacterController&gt;();            }      // Update is called once per frame     void Update () {         Vector3 forwardDirection = new Vector3 (myCamera.transform.forward.x, 0, myCamera.transform.forward.z);         Vector3 sideDirection = new Vector3(myCamera.transform.right.x, 0, myCamera.transform.right.z);         forwardDirection.Normalize ();         sideDirection.Normalize ();         forwardDirection = forwardDirection * Input.GetAxis("Vertical");         sideDirection = sideDirection * Input.GetAxis("Horizontal");         Vector3 directFinal = forwardDirection + sideDirection;          if (directFinal.sqrMagnitude &gt; 1)         {             directFinal.Normalize ();         }          if (controller.isGrounded)         {             moveDirection = new Vector3(directFinal.x, 0, directFinal.z);             moveDirection *= moveSpeed;             if (Input.GetButtonDown("Jump"))             {                 moveDirection.y = jumpForce;             }              if(Input.GetButtonDown("Crouch"))             {                 controller.height = 1f;                 controller.center = new Vector3(0f, -0.5f, 0f);                 moveSpeed = 3f;             }         }         moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale * Time.deltaTime);         controller.Move(moveDirection * Time.deltaTime);          anim.SetBool("isGrounded", controller.isGrounded);         anim.SetFloat("Speed", (Mathf.Abs(Input.GetAxis("Vertical")) + Mathf.Abs(Input.GetAxis("Horizontal"))));     } }   Thanks for any help! Should “two weeks vacation” be written “two weeks’ vacation” with a possessive apostrophe? I’ve always understood that the phrase two weeks usually turns into two weeks’ when used as a modifier as in   I’m giving my two weeks’ notice.  I get two weeks’ vacation. (“two weeks’ holiday” for Brits)   with an apostrophe on the word weeks’, indicating that the vacation “belongs” to the weeks.   One way to explain this is the phrase “two weeks of vacation” being contracted to “two weeks’ vacation” – the vacation is “of” the weeks; that is, it is possessed by them.  But I’ve seen a lot of people omit the apostrophe in casual writing, and thinking about it, it seems plausible that the noun vacation would be plainly modified by the adjectival phrase two weeks.  But on the other hand, shouldn’t adjectival phrases be hypenated, namely two-weeks vacation?  Yet that seems wrong, too: the hyphenate should be singular, two-week vacation (like two-tone shoes) because .   touches on this (and references a good ) but doesn’t explain why the plural must be possessive in this case.   suggests that two weeks might be adverbial rather than adjectival, and thus resists being used attributively. But that still doesn’t quite explain this particular muddle of pluralization, possession, and attribution.  Given all this, why should “two weeks vacation” be written “two weeks’ vacation” with a possessive apostrophe? MySQL Case problem I am trying to run a SQL code (I use MySQL). What I want to do is to set DATE_REACT a value when the first condition is satisfied, and a different value when the first condition is not satisfied. The problem is that the first condition is executed always, even when it shouldn't. What I am doing wrong?  UPDATE BILLS SET STATE = 2, DATE_REACT = CASE  WHEN (DATE_EM &lt;= CURTIME() &lt;= ADDTIME(DATE_EM, '00:02:00')) THEN ADDTIME(CURTIME(), '00:13:00') ELSE ADDTIME(DATE_REACT, '00:13:00') END WHERE STATE = 1; Can this intuition give a proof that an isometry $f:X \to X$ is surjective for compact metric space $X$? A prelim problem asked to prove that if $X$ is a compact metric space, and $f:X \to X$ is an isometry (distance-preserving map) then $f$ is surjective. The official proof given used sequences/convergent subsequences and didn't appeal to my intuition. When I saw the problem, my immediate instinct was that an isometry should be "volume-preserving" as well, so the volume of $f(X)$ should be equal to the volume of $X$, which should mean surjectivity if $X$ is compact. The notion of "volume" I came up with was the minimum number of $\epsilon$-balls needed to cover $X$ for given $\epsilon &gt; 0$. If $f$ were not surjective, then because $f$ is continuous this means there must be a point $y \in X$ and $\delta &gt; 0$ so that the ball $B_\delta(y)$ is disjoint from $f(X)$. I wanted to choose $\epsilon$ in terms of $\delta$ and use the fact that an isometry carries $\epsilon$-balls to $\epsilon$-balls, and show that given a minimum-size cover of $X$ with $\epsilon$ balls, that a cover of $X$ with $\epsilon$-balls could be found with one fewer ball if $f(X) \cap B_\delta(y) = \emptyset$, giving a contradiction. Can someone see a way to make this intuition work? Trying to run a Ubuntu server for the first time... But everything is in a terminal. Is there a way to switch to a GUI? Installing older iOS for device testing MacBook [Pro] - how many displays, what resolution/frequency? Book ID: Astronauts and Lab Students can create portals through space Desperate to locate and re-read exceptional book/series, but cannot remember the title. The high concept: The U.S. has just sent the first successful expedition to Mars, and it has just landed. As the astronauts make their initial exploration outside their ship, a tear in the fabric of space opens up right in front of them, and they look through to the insides of a laboratory (at a California university?) and two students who just figured out how to create arbitrary portals between two points in the Universe. The rest of the novel/series is a consequence of this breakthrough. But I can't remember the author and title(s). Surely someone reading this forum will remember it well! TIA.  (Reposted .) Show:$$\lim_{n\to\infty}\frac{\sqrt[n]{n!}}{n}= \frac{1}{e}$$  So I can expand the numerator by geometric mean. Letting $C_{n}=\left(\ln(a_{1})+...+\ln(a_{n})\right)/n$. Let the numerator be called $a_{n}$ and the denominator be $b_{n}$ Is there a way to use this statement so that I could force the original sequence into the form of $1/\left(1+\frac{1}{n}\right)^n$ Replace unknown reference (?) with the tag from \ref or \cite how many semantically different boolean functions are there for n boolean variables? In short, this is an assignment question for a course I am taking - the exact wording is this:  "Given n Boolean variables, how many 'semantically' different Boolean functions can you construct?"  Now, I had a crack at this myself - and got pretty stuck. The question doesnt state how many boolean operators there are (and, or, xor, nand, nor, iff, implies, not) nor does it state whether brackets should be used, i.e. a ^ (b v c) is different from (a ^ b) v c.  So, my question for you is - is this question possible given the limited information available?   Is it going to be something like ${n^x}$ where x is the number of boolean operators.  Any direction here would be greatly appreciated. Identify a book with a social engineering theme I originally read this book in the mid- to late '70s.   The premise was a bureaucracy whose job it was to manipulate events in human history by making the smallest possible change that would effect the desired outcome. Not time cops in the sense of going after law breakers.  The intent was to maintain a policy of non-interference as much as possible but when interference was warranted then to make the least possible change and to do so invisibly.  For example, they might take someone's keys off the dresser and put them just out of sight underneath the dresser where they plausibly might have fallen.  The subject would never know of the manipulation but would then be delayed getting out of the house and the ripples grew from there to avert a war or otherwise affect events on a large scale.  After reading that, whenever I would lose something - especially in an improbable way such as dropping a screw at my feet and then finding it on the other side of the room half an hour later - I would take some consolation in the thought that I had just averted some global catastrophe.  I was pretty scatterbrained as a kid (we call that ADHD nowadays) so I experienced this a lot.  Given that I've spent so much time pondering the ideas from the book, I'd love to re-read it. How to treat English questions which have code in a foreign language? Reading Photoshop PSD Files with Layers (There are a few existing questions on Photoshop alternatives, but none seem to focus on reading PSD files specifically)  Say I'm a programmer working with a web designer and would like to implement a design she's produced as a PSD file using Photoshop. It's a fairly complicated design using overlays/animating layers, so the ability to examine the PSD file and turn individual layers on and off is necessary.   Is there an app available in Ubuntu that can read PSD files created by Photoshop?  Alternatively, is there a more linux-friendly file format that Photoshop can export to and still preserve layers? Interpretation of p-value in Mann-Whitney rank test I am testing Mann-Whitney rank test with two vectors a and b. Vectors are almost similar so I expect a p-value near 0, but the returned p-value is near 1. What is the reason? I read  and also run the code with different parameters, but don't get anything near to what I expect.  from scipy.stats import mannwhitneyu import operator import numpy as np  a = [1000,100,10,1,10,100,1000,10000,1000,100,10,1] b = [999,100,10,1,10,100,1000,10000,1000,100,10,1]  print(mannwhitneyu(a, b))   The output of the code:  MannwhitneyuResult(statistic=73.5, pvalue=0.95291544831453867)   Edit:  Let's formalize the problem to eliminate any misunderstanding (please edit the question if something is wrong):  What I try to prove is that rank distribution of data are approximately equal,   Null hypothesis ($H_0$)= "ranked distribution of a and b are approximately equal"  Alternative hypothesis ($H_a$)= "ranked distribution of a and b are not equal"  significance level (alpha) = 0.05  p-value= 0.95  (p-value > alpha) so there is no sufficient evidence that $H_a$ is correct, but we cannot also conclude that ($H_0$) is true.   Instead if (p-value &lt; alpha) was true, then we would have enough evidence against H0 and Ha can be accepted.  So what happened here is that I could not disprove the null hypothesis. However, it doesn't mean that null hypothesis is false. It is like an investigation to accuse MR X of being guilty:   $H_0$=" MR X guilty" $H_a$=" MR X not guilty"  We guess he is not guilty, but we don't have enough proof against him: (p-value > alpha), but that doesn't mean that ($H_0$) would not be true. If we could obtain enough evidence and state (p-value &lt; alpha), then we disprove $H_0$ and we can conclude that Ha is true and he is not guilty. Differences between no child vs no children a) They have no child. b) They have no children.  Are both a) and b) correct? Though b) seems more common. phpmyadmin doesn't connection with true data Can I apply for a Schengen visa at a country where I'm not a citizen? If so, under what conditions? I'm a citizen of country A who would like to apply for a Schengen visa at a consulate in country B. When is this possible? How do I free up disk space? My Ubuntu cloud server has left only 900MB of disk space.   I'll just empty the directory /tmp and wondering if there is any other location to clean up.