I have made two activities. Main activity and  a second activity having a textview. My main activity is having a button and on button click i switch from this activity to other activity and just after that i call the method from main activity below the Intent part method named show() which changes the text of textview which is in second activity but as soon as i do so the application crashes.  03-23 01:33:44.791  26520-26520/com.dubey.abhishek.myapplication E/AndroidRuntime﹕ FATAL EXCEPTION: main     Process: com.dubey.abhishek.myapplication, PID: 26520     java.lang.NullPointerException             at com.dubey.abhishek.myapplication.Recipe.Showdetails(Recipe.java:43)             at com.dubey.abhishek.myapplication.MainActivity$1.onClick(MainActivity.java:54)             at android.view.View.performClick(View.java:4467)             at android.view.View$PerformClick.run(View.java:18776)             at android.os.Handler.handleCallback(Handler.java:808)             at android.os.Handler.dispatchMessage(Handler.java:103)             at android.os.Looper.loop(Looper.java:193)             at android.app.ActivityThread.main(ActivityThread.java:5292)             at java.lang.reflect.Method.invokeNative(Native Method)             at java.lang.reflect.Method.invoke(Method.java:515)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)             at dalvik.system.NativeStart.main(Native Method)
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?
Non-ASCII characters in external links antonym for beneficiary Is there an antonym for beneficiary that is not simply "giver" or "payer"? I'm looking for a word that roughly mean someone who loses financially in the case of an event. This applies to all d20 systems, but with an example from the from the Pathfinder  (emphasis mine):  Stonecunning: Dwarves receive a +2 bonus on Perception checks to potentially notice unusual stonework, such as traps and hidden doors located in stone walls or floors. They receive a check to notice such features whenever they pass within 10 feet of them, whether or not they are actively looking.  In this case, does the GM roll the check in secret or ask the player roll the check? If the GM asks the player to roll for the check, what stops situations like:  GM: (interrupting) &quot;Gimli, Roll a perception check.&quot; Dwarf player: &quot;Oh, it's a natural one, I guess I don't see anything.&quot; Human player: &quot;Okay, I'll roll a perception check for anything unusual in this room. Nice! 19. How about 19, does 19 work for you?&quot; GM: &quot;Gimli, everything looks kosher to you. Aragon, you notice a rock coloured tarp on the ground here, covering what looks like a pit trap.&quot;  In this case, by telling the dwarf to roll his &quot;free&quot; perception check, he's telegraphed to the players that there is something to notice. How can this be fixed, without bluffing checks for nothing in particular to throw off the signal to noise ratio of similar checks? Create Random Number Sequence with No Repeats Duplicate:    I want an pseudo random number generator that can generate numbers with no repeats in a random order. For example: random(10) might return 5, 9, 1, 4, 2, 8, 3, 7, 6, 10 Is there a better way to do it other than making the range of numbers and shuffling them about, or checking the generated list for repeats?  Edit: Also I want it to be efficient in generating big numbers without the entire range.  Edit: I see everyone suggesting shuffle algorithms. But if I want to generate large random number (1024 byte+) then that method would take alot more memory than if I just used a regular RNG and inserted into a Set until it was a specified length, right? Is there no better mathematical algorithm for this. Why the interior of $\mathbb{Q}$ in $\mathbb{R}$ is empty? How to set systemwide "XP style DPI scaling" in Windows 8.1? I run my ThinkPad with a system DPI setting of 140%. In Windows 7 and 8, I enabled the "Use Windows XP style DPI scaling" checkbox in the Custom DPI Setting dialog. When this setting is off, non-DPI-aware applications get DPI virtualization via bitmap stretching, which results in large but fuzzy text. Turning on the checkbox disables this bitmap stretching, so non-DPI-aware apps get smaller text but without the fuzzy stretching. I find most apps to be more readable with the smaller crisper text, so I enable XP style scaling (i.e. disable DPI virtualization).  Windows 8.1 RTM has removed this option completely. After upgrading, all of my non-DPI-aware apps are running with ugly bitmap stretching. I'm able to fix this by going into the Properties for each app and setting the "Disable diplay scaling on high DPI settings" box in the Compatibility tab, but that is a bit of a pain.  Is there any way to restore the systemwide XP-style DPI scaling in Windows 8.1? How to call child component controller function/helper from Parent Component Controller What is LookDev/Material Preview mode for in 2.8? How do I calculate the power consumed by a lightbulb? I'm studying a lightbulb and its variable resistance, given by the expression:  $R(T) = Ro[1 + α(T-T_0)]$, where $R_0$ is the resistance of the lamp at $T_0$.  In this case, $R$ is not given by Ohm's law ($V=Ri$). So, which expression can I use to calculate the power consumed by a lightbulb?   $P = R\cdot i^2$ $P = \frac{V^2}{R}$ $P = V\cdot i$ (I don't think I can use this one)   I have measured the current and the e.p.d. at the bulb using instruments. How can I find out if someone really holds a doctoral degree? We're currently interviewing candidates at my company and I'd like to verify if some of them really have the academic degrees they claim. One in particular claims a doctoral degree from a German university.  I've contacted the university, and the dean wrote back saying that they could not provide this information without the written consent of the individual.  I found this policy rather odd; I would have thought that the granting of a doctoral degree was public information. Is this normal? Is there anything else I can do to find out?  I obtained from the library a copy of the thesis in question but it was in German. I also found through Google  which appears to be a list of dissertations published by that university, but it is unclear whether these are doctoral dissertations or not. The person in question and his dissertation are in that list. I'm trying to write a page that calls PHP that's stored in a MySQL database. The page that is stored in the MySQL database contains PHP (and HTML) code which I want to run on page load.  How could I go about doing this? Dimension of Dirac $\gamma$ matrices While studying the Dirac equation, I came across this enigmatic passage on p. 551 in From Classical to Quantum Mechanics by G. Esposito, G. Marmo, G. Sudarshan regarding the $\gamma$ matrices:     $$\tag{16.1.2} (\gamma^0)^2 = I , (\gamma^j)^2 = -I \ (j=1,2,3) $$    $$\tag{16.1.3}  \gamma^0\gamma^j + \gamma^j \gamma^0 = 0 $$   $$\tag{16.1.4}  \gamma^j \gamma^k + \gamma^k \gamma^j = 0, \ j\neq k$$    In looking for solutions of these equations in terms of matrices, one finds that they must have as order a multiple of 4, and that there exists a solution of order 4.   Obviously the word order here means dimension. In my QM classes the lecturer referenced chapter 5 from Advanced Quantum Mechanics by F. Schwabl, especially as regards the dimension of Dirac $\gamma$ matrices. However there it is stated only that, since the number of positive and negative eigenvalues of $\alpha$ and $\beta^k$ must be equal, $n$ is even. Moreover, $n=2$ is not sufficient, so $n=4$ is the smallest possible dimension in which it is possible to realize the desired algebraic structure.  While I got that the smallest dimension is 4, I fail to find any argument to reject the possibility that $n=6$ could be a solution. I also checked  Phys.SE post, but I didn't find it helpful at all.  Can anyone help me? Solving infinite sums with primes. Let $p_n$ denote the $n$'th prime number.  How would one go about proving that infinite products like: $$\prod_{k=1}^\infty1 - \frac{1}{(p_k)^2} = \frac{6}{\pi^2}$$  or  $$\prod_{k=1}^\infty\frac{{p_k}^2}{{p_k}^2 - 1} = \frac{\pi^2}{6}$$ are correct?  Is there any way to prove it except by exhaustion? Is there a tool in Ubuntu to automatically merge two images having a common strip? I need to scan a large image, which will not fit at once in the scanner. I was thinking about scanning it in two parts and hand-editing the result in Gimp to join them. But probably an automatic tool can do the same more quickly and better.  EDIT I think I may have not made my point clear. My difficulty is not aligning two images. My problem is that one has to compensate for the rotation or distortion introduced by the manual process of putting the sheet into the scanner, and an automatic tool should obtain more precise results at analyzing common patterns in the two images to rotate and align them seamlessly. How many copies of the DeLorean time machine co-existed in the Back to the Future series? As part of the definition of a cone spell in the handbook:     A cone's point of origin is not included in the cone's area of effect, unless you decide otherwise.   As an example, what would either case be for a casting of Burning Hands?   Could the caster include themselves? or does this mean that they can exclude the first square of the cone? $$\lim_{n\to\infty} (1+\frac{2}{n})^{n^2} e^{-2n} = ? $$         $e$   $e^2$   $e^{-1}$   $e^{-2}$      My answer is 1. Since $$\lim_{n \to \infty} \left(1+\frac{2}{n}\right)^{n} =e^{+2}.$$  Therefore $$\lim_{n\to\infty} \left(1+\frac{2}{n}\right)^{n^2} =e^{2n}.$$  Where am I wrong? How do I synchronise two folders in real-time in Windows 7? I shifted to Ubuntu 10.10 now I am facing problem to have C/C++ compiler. What are the possible ways so that I can use C/C++ compiler using all the libraries (like graphic, math, conio, stdlib, etc) as in Microsoft Windows creating executable file? What is the correct way to create a single-instance WPF application? Using C# and WPF under .NET (rather than  or console), what is the correct way to create an application that can only be run as a single instance?  I know it has something to do with some mythical thing called a mutex, rarely can I find someone that bothers to stop and explain what one of these are.  The code needs to also inform the already-running instance that the user tried to start a second one, and maybe also pass any command-line arguments if any existed.