I've done fragments before and I've dealt with nnull pointers, but in this instance I get a null pointer when I try the onClickListener for the majorSecond5 button.  public class Intervals_and_chords extends Fragment {  Button majorSecond5;  public void majorSecond ()     {         notimportant     }  public View onCreateView(LayoutInflater inflater, ViewGroup container,                                  Bundle savedInstanceState) {             View view = inflater.inflate(R.layout.rhythm, container, false);           majorSecond5 = view.findViewById(R.id.majorSecond);           majorSecond5.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View view) {                majorSecond();            }        });   return view;  }  }   Here's the Logcat:  01-29 14:44:46.826 2508-2508/com.stefanawesome.piano E/AndroidRuntime: FATAL EXCEPTION: main                                                                        Process: com.stefanawesome.piano, PID: 2508                                                                        java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference                                                                            at com.stefanawesome.piano.Intervals_and_chords.onCreateView(Intervals_and_chords.java:158)                                                                            at android.support.v4.app.Fragment.performCreateView(Fragment.java:2354)                                                                            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1419)                                                                            at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1740)                                                                            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1809)                                                                            at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:799)                                                                            at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2580)                                                                            at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2367)                                                                            at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2322)                                                                            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2229)                                                                            at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:700)                                                                            at android.os.Handler.handleCallback(Handler.java:751)                                                                            at android.os.Handler.dispatchMessage(Handler.java:95)                                                                            at android.os.Looper.loop(Looper.java:154)                                                                            at android.app.ActivityThread.main(ActivityThread.java:6119)                                                                            at java.lang.reflect.Method.invoke(Native Method)                                                                            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)                                                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
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?
In Rey's vision, whose voice says "These are your first steps"? Why is "glide symmetry" its own type? Artin's Algebra pages 155 &amp; 156 list the types of symmetry of a plane figure as:   Reflective Rotational Translational Glide   He then goes on to say "Figures such as wallpaper patterns may have two talk about other figures having combinations of independent" symmetries. EDIT: He says "... having combinations of independent translational symmetries". See Joriki's answer.  Why doesn't glide symmetry count as having two independent (reflection + translation) symmetries? If we're going to count combinations, why not have rotation + translation etc. as their own types too? What's the full-form & significance of USS & ISS prefixes in name of Star Trek starships? Excel function that evaluates a string as if it were a formula? Suppose I have a text string like "11+5" or even "=11+5" stored in a cell. Is there a function in Excel that will allow me to actually evaluate that string as if it were a formula?  This would be helpful for another project where I would like to be able to write 'dynamic' formulas in Excel. Vertical space in lists Wire transfer to an intermediary bank account I sent money from a bank that doesn't have a space for intermediary bank, so I put the intermediary bank statement information where the beneficiary bank information is supposed to be.  I  don't know what will happen now. I'm fairly new to blender and not a graphics person by any stretch of the imagination. I've been having some success though modelling semi-reflective glass for a project I wish to build (physically) and I'm wondering if it is possible to model the effects of a lens. The lens I wish to model is a double-convex type. It has a diameter of 120mm and a focal-length of 301mm. Is this something that can be modelled in blender and if so, how? I'd like to be able to position the camera close to this lens and reproduce the magnifying effects of the lens on the scene behind the lens as well as depth-of-field effects.  Thanks a lot. I'm trying to use grep to show only lines containing either of the two words, if only one of them appears in the line, but not if they are in the same line.  So far I've tried  grep pattern1 | grep pattern2 | ... but didn't get the result I expected. Soundness of a rule of a proof system with respect to the truth tables? I have the following question: "Explain the concept of the soundness of a rule of a proof system with respect to the truth tables"  Would it be correct to state the following:  "A rule of a proof system is sound with respect to the truth tables iff the conditions of the rules (requirements of the rule) ensure that the final formula will behave according to it's intended truth table."?  This is a question in a practice exam, and I can not find a specific mentioning so far, by scanning Google and Proof Wiki.  What would the correct answer be?  Thank you. Would a fast interstellar spaceship benefit from an aerodynamic shape? Some (generous) assumptions:   We have a spaceship that can reach a reasonable fraction of light speed. The ship is able to withstand the high energies of matter impacting at that speed.   Given the amount of matter in inter-stellar space, at high speed, would it encounter enough of it and frequently enough that an aerodynamic shape would significantly reduce its drag (and thus save fuel)? If $f$ is a periodic function with $T = \pi$, does that mean that $F$ (a primitive of $f$) has the same period ? What about the inverse implication (periodic primitive implies periodic function) ? How can change in cost function be positive? In  it says     To make gradient descent work correctly, we need to choose the learning rate η to be small enough that Equation (9) is a good approximation. If we don't, we might end up with $\Delta C&gt;0$, which obviously would not be good! At the same time, we don't want $\eta$ to be too small, since that will make the changes $\Delta v$ tiny, and thus the gradient descent algorithm will work very slowly. In practical implementations, $\eta$ is often varied so that Equation (9) remains a good approximation, but the algorithm isn't too slow. We'll see later how this works.   But just a few paragraphs before we established that $\Delta C\approx−\eta\nabla C⋅\nabla C=−\eta\|\nabla C\|^2$ is obviously always negative (for positive $\eta$). So how can $\Delta C$ be positive if we don't choose a small enough learning rate? What is meant there? "That... be" construction How to use induction to prove the product rule for higher derivatives? How do I show through mathematical induction that   \begin{equation} \frac{d^n}{dx^n}[f(x)\cdot g(x)] = \sum_{k = 0}^{n} \binom{n}{k} \frac{d^k}{dx^k} [f(x)] \cdot \frac{d^{n-k}}{dx^{n-k}} [g(x)] \end{equation}  which is the product rule for higher derivatives? Why does Java not have block-scoped variable declarations? Show that $\frac{1}{\sqrt{2\pi}} \cdot \left(\int_{- \infty}^{\infty} e^{itx} \cdot e^{-\frac{1}{2}t^2 } dx \right) = e^{-\frac{1}{2}t^2}$ I am struggling to show that $$\frac{1}{\sqrt{2\pi}} \cdot \left(\int_{- \infty}^{\infty} e^{itx} \cdot e^{-\frac{1}{2}x^2 } dx \right) = e^{-\frac{1}{2}t^2}$$  In the same paper we defined  $$F(t):=\left(\int_0^t e^{-x^2}\right)^2 \quad \text{ and} \quad  G(t):=\left( \int _0^1\frac{e^{-t^2(1+x^2)}}{1+x^2} \right)$$  I showed that both functions are differentiable with  $$F'= 2e^{-t^2} \cdot \int_0^t e^{-x^2}$$ $$G' = -2te^{-t^2} \cdot \int_0^1 e^{-x^2t^2}$$  It follows that $F' + G' = 0$ and $F + G = \frac{\pi}{4}$  With that I showed that $\int_{-\infty}^{\infty} e^{-x^2} = \sqrt{\pi}$.  Any help is appreciated. How can I grep in PDF files? Is there a way to search PDF files using grep, without converting to text first in Ubuntu? I'm running badblocks to check for bad segments on an external drive, and it's been about an hour and it has not yet finished. Now, I need to go and consider cancelling. Is this somehow risky? Should I avoid this?   Clearly, I will need to start again from scratch; I just want to know if this is somehow risky to abort midway. Strip whitespace from jsp output How can I strip out extra whitespace from jsp pages' output?  Is there a switch I can flip on my web.xml?  Is there a Tomcat specific setting? Where can I find 32-bit version of Ubuntu?