public static Node deletion(Node head , int pos) {     if(pos==1) {         deleteAtHead(head);         return head;     }          Node temp=head;     int count=1;     while(temp!=null &amp;&amp; count!=pos) {         temp=temp.next;         count++;     }     temp.prev.next=temp.next;     if(temp.next!=null) {     temp.next.prev=temp.prev;     }     return head;  //      temp=null; } this is my code here and i'm not sure whats the problem here
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?
Induction Proof that $x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+\ldots+xy^{n-2}+y^{n-1})$ This question is from [Number Theory George E. Andrews 1-1 #3].     Prove that $$x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+\ldots+xy^{n-2}+y^{n-1}).$$   This problem is driving me crazy. $$x^n-y^n = (x-y)(x^{n-1}+x^{n-2}y+\dots +xy^{n-2}+y^{n-1)}$$  $(x^n-y^n)/(x-y) =$ the sum for the first $n$ numbers and then I added $(xy^{(n+1)-2}+y^{(n+1)-1})$ which should equal $(x^{n+1}-y^{n+1})/(x-y)$ but I can't figure it out    This is a similar problem in the book and I tried this method but it wasn't working out      $\quad$Thereom $\bf1$-$\bf2$: $\,\,\,\,$ If $\,x$ is any real number other than $1$, then $$\sum_{j=0}^{n-1}x^j=1+x+x^2+\ldots+x^{n-1}=\dfrac{x^n-1}{x-1}.$$    $\quad$Remark: $\displaystyle\sum_{j=0}^{n-1}A_j$ is shorthand for $A_0+A_1+A_2+\ldots+A_{n-1}.$     $\quad$Proof: Again we proceed by mathematical induction. If $n=1$ then $\displaystyle\sum_{j=0}^{1-1}x^j=x^0=1$ and $(x-1)/(x-1)=1$. Thus the theorem is true for $n=1$.  $\quad$ Assuming that $\displaystyle\sum_{j=0}^{k-1}x^j=(x^k-1)/(x-1)$, we find that $$ \eqalign{ \sum^{(k+1)-1}_ {j=0}x^j &amp; = \sum^{k-1}_ {j=0}x^j+x^k=\dfrac{x^k-1}{x-1}+x^k \\ &amp;= \dfrac{x^k-1+x^{k+1}-x^k}{x-1}\\ &amp;= \dfrac{x^{k+1}-1}{x-1}. }$$   Hence condition $(\rm ii)$ is fulfilled, and we have established the theorem.    $\quad$Corollary $\bf1$-$\bf1$: $\,\,$ If $\,m$ and $n$ are positive integers and if $m&gt;1$, then $n&lt;m^n.$ "invalid EFI file path" while booting Windows I just got my new working notebook with Windows 8 pre-installed. After installing Ubuntu 12.10 the grub menu says that there is an "invalid EFI file path" and it won't boot Windows. Ubuntu works fine...  Is there anything I can do about this? Is it true or false that $\lvert P([0, 1]) \setminus P((0, 1)) \rvert > \lvert P(\mathbb{N}) \rvert$ Is it true or false that $\lvert P([0, 1]) \setminus P((0, 1)) \rvert &gt; \lvert P(\mathbb{N}) \rvert$ ?  I need a hint because I don't see a way to solve this How do you take off body armor in GTA Online? It's kind of hard to shop for clothes with a big bullet proof vest on.  Is there a way to take off the armor after missions, or at least hide it? I have got this problem on limits  $$ \lim_{x \rightarrow 0}\left(\frac{\sin(x)}{x}\right)^\frac{1}{x^2}$$ What I am doing here is that taking log and then applying L-Hospital's Rule $$y= \lim_{x \rightarrow 0}\left(\frac{\sin(x)}{x}\right)^\frac{1}{x^2} $$ then $$\ln(y)=\lim_{x \rightarrow 0} \frac{1}{x^2}\ln\left(\frac{\sin(x)}{x}\right)$$ now it becomes $\frac{0}{0}$ type , but problem is how to take derivative here? when differentiating $\ln\left(\frac{\sin(x)}{x}\right)$ it will become $\frac{x}{\sin(x)}$ then we'll have to differentiate one more time like we do in case of $f(f(x))$ ? $\sin(x)$ and $x$ will be separately differentiated or together ? I've created main SELECT statement like below. For every row in Base table (base on IDKey I've added columns with values from result of INNER JOIN of few tables.  SELECT   IDKey,    Name,    (select Amount from Table1 INNER JOIN Table2 ... where ID=IDKey) AS AmountTypeX,    (select Amount from Table1 INNER JOIN Table2 ... where ID=IDKey) AS AmountTypeY FROM BaseTable   BaseTable:  IDKey Name  ---------- 1     Ian 2     John 3     Ann ...   INNER JOIN of few tables Table1, Table2... :   ID Amount Type -------------- 1  100    X 1  200    Y 2  300    X 2  400    Y 3  500    X 3  600    Y ...   Result looks like:  IDKey  Name  AmountTypeX  AmountTypeY ------------------------------------- 1      Ian   100          200 2      John  300          400 3      Ann   500          600 ...   Do you have any suggestion how to avoid this nested SELECT statements in the main query at the begining and made this query simpler and more effective ?  I wast thinking about PIVOTING of the INNER JOIN result to look like below (all data for particular ID in one row) and then JOIN with main query but Have no idea how to do this and is it possible.  ID  X   Y ----------- 1   100 200 2   300 400 3   500 600 ... New mobile chat doesn't follow the keyboard height The Japanese keyboard on iOS dynamically changes it's height to show suggestions and hides the input box of new mobile chat.        Additionally, third-party keyboards make the input box completely hidden. The chat seems to treat third-party keyboards as having no height.        iOS 9.2.1 / Mobile Safari  There is no problem in old (stable) design but it doesn't fix the input box to bottom! How can I use Photoshop to imitate a photo taken with a low-quality camera? How can I create an image in Photoshop that imitates a photo taken with a low-quality phone camera? Examples of qualities I want to simulate:   blurring in some areas caused by a dirty lens low quality exposure handling in the darkroom noise   Some examples: How to Setup GIMP 2.10 on Ubuntu 16.04 (Xenial Xerus) Failed upgrade from Ubuntu 19.10 to 20.04 "Please update the microcode" While installing the Ubuntu 20.04 updates during upgrade from 19.10 to 20.04, my screen suddenly went completely white and displayed a message saying  Please logout and try again.  But I could not locate my cursor and so I switched off my laptop. After restarting it again, it was showing an error message saying  Please update the microcode  Why did this happen? How can I solve this problem? How to finish current activity in Android Expectation values of the position operator is equal to zero in case of even potentials? Difference in meaning of "frustrated at" and "frustrated with" What is the difference in meaning of "frustrated at" and "frustrated with" used in sentences like     He is frustrated with me   or      He is frustrated at me   When is each of these sentences above are used? Suppose $a_n>0$ and $\sum_{n=1}^{\infty}{a_n}$ diverges. Determine convergence of $\sum_{n=1}^{\infty}{\frac{a_n}{s_n^2}}$, where $s_n=\sum^n a_n$. Internet through wireless hotspot, intranet through wired network - can I use both at the same time? Is there a standard place for placing custom Linux scripts? How can I install firmware-b43-installer driver if I can't connect to internet by wire? I know people prefer using CorelDraw or Adobe Illustrator, but I want to know if there is a technique I can follow to use Adobe Photoshop to make vector Images. The probability $P(X=n)$ that an event X takes place $n$ times in a fixed period of time follows the Poisson distribution with parameter $\lambda$ i.e.  $$ P(X = n) = e^{-\lambda} \frac{\lambda ^ n}{n!}$$  I have to evaluate the probability that the event $X$ takes place an even number of times. I know that:   $$ P(X \text{ is even} ) = e^{-\lambda} \cdot \sum_{k=0}^{+\infty} \frac{\lambda^{2k}}{(2k)!}$$  but I can't solve the series.  I guess that I have to use the fact that $e^\lambda = \sum_{n = 0}^{+\infty} \lambda^n/n!$, but I got stuck.  How can I evaluate $P(X \text{ is even})$ (alternative solutions appreciated). How to solve the following congruence equation? $$3n^3+12n^2+13n+2\equiv0,\pmod{2\times3\times5}$$ If $t_n$ be the $n$th triangular number, then  $$t_1^2+t_2^2+...+t_n^2=\frac{t_n(3n^3+12n^2+13n+2)}{30}$$ so if we solve this congruence equation we find the values of $n$ that $t_n$ divides $t_1^2+t_2^2+...+t_n^2$.