I'm trying to use a custom font on a TextView... but i got that exception when when run my app     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTypeface(android.graphics.Typeface)' on a null object reference      in the right path and that's my code:    My XML
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?
How to parse hex values into a uint? uint color;  bool parsedhex = uint.TryParse(TextBox1.Text, out color);  //where Text is of the form 0xFF0000 if(parsedhex)    //...   doesn't work. What am i doing wrong? Can I install any iOS version I wish by picking and choosing which firmware to restore? I'm trying to downgrade my iPhone from the current iOS to an older one, as per .  But every time I try, I always receive this error:     The iPhone could not be restored. This device isn't eligible for the requested build.     I have tried many times with and without DFU mode. Any ideas regarding this? Does "singular" have a common meaning across matrices, decomposition, vectors and values? Where and why do I have to put the "template" and "typename" keywords? In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template &lt;typename T, typename Tail&gt; // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template&lt;typename U&gt; struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion&lt;U&gt; dummy;      };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; }; template &lt;typename T&gt; // For the last node Tn. struct UnionNode&lt;T, void&gt; {     // ...     template&lt;typename U&gt; struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; };   The problem I have is in the typedef Tail::inUnion&lt;U&gt; dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion&lt;U&gt; names a type and not a function? Limits of dead reckoning using MEMS sensors I'm trying to track body parts relative to a person's torso. I see quite a few questions about using MEMS accelerometers and gyros for dead reckoning, and they confirm my suspicions that various factors greatly limit their usefulness for these sorts of applications, but I'm seeking clarification of these limits:   What exactly are these limits?  Other answers have addressed why these limits exist. Naturally the specifications the parts in the system in question and what is considered "acceptable error" for the system will both change the exact limits, but is there a single order of magnitude in time, or distance that I can expect dead reckoning to work? I'm well aware that over long distances (a few yards or so) the error becomes too large for most practical purposes, but what about within a few feet?  What can I do to improve these limits?  I'm currently looking at using an accelerometer and a gyro. What other sensors can I add to the system to improve the error rate? I know over longer distances a GPS can be used, but I doubt any consumer electronics grade GPS has fine enough resolution to help in my case.  Additionally, a general consensus seems to the only way to improve these limits past the point of improved sensors is to provide a reference not subject to error. Some systems solve this using cameras and markers.  What kind of reference points can a portable/wearable device provide?   I've seen the usage of radio waves to measure long distances accurately, but I can't tell if such a system could be accurate on such small scale (in terms of distance measured) using "off-the-shelf" components. I have noticed that I hardly ever use the \negthinspace command  \!.  This is because I don't know how to use it properly (I do use other spacing commands quite a bit, because I can better understand the guidelines of when they might be useful). When might it be considered appropriate to use this spacing command? I know that SZ0 makes vertices straightened on the z-axis, but I'm wondering if there's a way to make vertices into a complete circle on the z-axis with a hotkey? $N(ab) \geq N(a)$ is not necessary for the ring to be euclidean The definition of euclidean ring in my textbook is 1) $N(ab) \geq N(a)$ 2) Euclidean algorithm works. However there is a note that the first condition is not necessary. There is a hint that we can choose a following norm: $N'(a) = \min_{b\sim a} N(b)$. I do not understand why it works. We need to check that euclidean algorithm still works with this norm.   I tried to do the following. If $a \sim b$, then $a = bx, x \in K^*$. Let $N'(a)$ be $N(ax)$. Let us divide $ax$ by $bx$ instead of $b$. We get $ax = bxq + rx$, $N(rx) \leq N(bx)$. Here I am stuck and have no idea how to continue. A student of mine has been self-studying some elementary number theory. She came by my office today and asked if I had any hints on how to prove the statement      If $m$ is odd then $\gcd(2^m-1,2^n+1)=1$.    It's been a while since I took number theory and I'm not sure what to do. She said she is learning about congruences, primitive roots, and power residues.  She has not taken any group theory. If $f \in L_p \cap L_q$, $1 \leq p < r < q < \infty$ then $f \in L_r$. If $f \in L_p \cap L_q$ and $1 \leq p &lt; r &lt; q &lt; \infty$ then $f \in L_r$.   Proof: Let $E = \{ x \in X: \left\lvert f \right\rvert \leq 1 \}$. Then, $$\int \left\lvert f \right\rvert^r \mathrm{d}\mu = \int_E \left\lvert f \right\rvert^r \mathrm{d}\mu+\int_{E^C} \left\lvert f \right\rvert^r \mathrm{d}\mu \leq \int_E \left\lvert f \right\rvert^p \mathrm{d}\mu+\int_{E^C} \left\lvert f \right\rvert^q \mathrm{d}\mu$$ $$\leq \int \left\lvert f \right\rvert^p \mathrm{d}\mu+\int \left\lvert f \right\rvert^q \mathrm{d}\mu &lt; \infty.$$ Thus, $f \in L_r$.  I just want to make sure I am somehow not missing anything. Thanks Closing as "off topic" has just gotten painful I know that useability and friendliness are given priority in the features implemented on StackExchange, but after using the new close-as-off-topic flow for the first time I would have to say I'm somewhat underwhelmed.  Why do we not have a simple It's off topic type reason? And why do I have to write half a book chapter as my custom close reason, especially when I can go back and edit the automatically posted comment so that it's way shorter?   This question complaint is prompted by  here on Meta. It's off topic, plain and simple. We now have a bunch of people wanting to close it, all potentially writing their own custom close reasons, it's just messy suboptimal. Regardless of how nice and friendly you want to be to the user, this particular question shouldn't need an explanation.    Does the off topic flow have to stay this way? Can we allow higher rep users to close as off topic without having to specify a (really long) custom reason, maybe have some canned reasons like we used to?  Edit: just to be clear, there are still three canned close reasons, but none of them were applicable to this example. The second one is closest, but does not appear to seek input... is quite different to It's a question, but doesn't belong here in any way, shape, or form. In the Harry Potter world, there's the term "muggle" for people with no magical abilities, "muggle-born" for those with magical abilities who's parents are muggles and "squib" for those with no magical abilities who's parents are magical.  But is there any collective term for all magical people (as opposed to wizards for males and witches for females)?  I don't recall seeing any word that refers to all men and women and children with magical abilities, and it's the only group left without noun or collective noun to describe them. Why is electric field of an infinite plate constant at all points? I know from Gauss law, it is $\vec{E}=\dfrac{\sigma}{2 \epsilon_0}(\hat{n})$ at all points. But it doesn't make sense because of the inverse square nature of electric field which suggests if you move further away from the plane, electric field must reduce.   Then why is electric field of an infinite plate constant at all points? How do I restrict my kids' computing time? How do I count the number of occurrences of a char in a String? Story about a deadly alien creature on another planet that has some chemical in its body that makes it faster I can not remember if it was a short story or a novel, but I am leaning towards it being a novel. There is a colony of humans and I can't remember if they crash-landed or not.   There is a creature that they come to discover after it has killed a few people. The creature has some kind of chemical in its body that is like a super-adrenaline. One part is I remember is one of these creatures getting very hot from using up its reserve of this chemical and it dived into a river or pond and it started to steam. Something like that.  It has to be at least 10 years since I read the story. Is $2^{|\mathbb{N}|} = |\mathbb{R}|$? What are the differences between a pointer variable and a reference variable in C++? Can I use a variable in a Bash brace expansion? Move EFI System Partition to another drive