I'm making a simple game to learn how to use Android Studio. The objective of the game is to do some simple tasks as fast as possible. In my main game screen, I have a thread that makes an int count up every second, so the player knows how much time has gone by. When the player has done all the simple tasks, the game goes to the end screen. Now I want to display the time in the endscreen, so the player knows how fast they finished. I get an error when I run the game. This is the code to run the thread every second: Timer d = new Timer(true); thread1 thread1 = new thread1(this, myCanvas); t.scheduleAtFixedRate(thread1, 0, 1000);   This is the tick function that the thread does every second: public void tick1(){     timer++; }  This is the getter for the timer: public int getTimer(){     return timer; }  When the game ends and it goes to the endscreen, I use the getTimer() to have a textview that should display the timer: err = (TextView)findViewById(R.id.textView); err.setText(&quot;Tijd: &quot;+ timer+&quot;&quot;);  This is the error message I get when I try to run it: 2021-03-06 11:18:38.153 21729-21729/com.example.test_game E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.test_game, PID: 21729     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test_game/com.example.test_game.Eindscherm}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.test_game.MyCanvas.getTimer()' on a null object reference         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3792)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3968)         at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)         at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)         at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)         at android.os.Handler.dispatchMessage(Handler.java:106)         at android.os.Looper.loop(Looper.java:246)         at android.app.ActivityThread.main(ActivityThread.java:8506)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)      Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.test_game.MyCanvas.getTimer()' on a null object reference         at com.example.test_game.Eindscherm.onCreate(Eindscherm.java:24)         at android.app.Activity.performCreate(Activity.java:8198)         at android.app.Activity.performCreate(Activity.java:8182)         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3765)         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3968)          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)          at android.os.Handler.dispatchMessage(Handler.java:106)          at android.os.Looper.loop(Looper.java:246)          at android.app.ActivityThread.main(ActivityThread.java:8506)          at java.lang.reflect.Method.invoke(Native Method)          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
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?
Setting up a download page requiring a user to fill a form before downloading anything In the Drupal site I'm setting up, there's a Download page containing several links to download softwares.   What is the best way to "bind" the softwares to the page, put them anywhere online and place a direct link in the page?   Does anyone know a module that would show a contact form when a user clicks one of the "Download" buttons, preventing him from downloading unless he properly completes the form?  Our goal is to receive the contact information of any person downloading our software. Well structured URLs vs. URLs optimized for SEO Let’s take an example of a movie site. So a well structured set of URLs for this site can be:     Movie page - example.com/movies/the-matrix Review for movie - example.com/movies/the-matrix/reviews Trailers for movie - example.com/movies/the-matrix/trailers Specific trailer for movie - example.com/movies/the-matrix/trailers/trailer1   where it’s possible to navigate the resource even by directly deleting/appending resource name seamlessly.  For SEO purpose I read somewhere that for two given pages, Google will prefer the page which have search query up in the URL hierarchy among other things. So for the given 2 URLs and the query "the matrix trailer"    example.com/movies/the-matrix/trailers example.org/trailers/the-matrix/    `     Google might prefer the second URL as it has the keyword "trailer" at first level comparing to first URL which has "trailer" at 3rd level (a resource deeper in URL hierarchy may be less important).    If it is correct, one may be tempted to create URL hierarchy somewhat like      Movie page - example.com/movies/the-matrix Review for movie - example.com/reviews/the-matrix/ Trailers for movie - example.com/trailers/the-matrix/ Specific trailer for movie - example.com/trailers/the-matrix/trailer1     which will break the seamless hierarchy.    My questions are:   Is it true that resource deeper in URL hierarchy is tend to be less important when comparing to URLs of other site?   Is sacrificing meaningful, seamless hierarchy worth for this SEO optimization? How to get a normal application menu in the top- or titlebar in Gnome Crash course on algebraic geometry with view to applications in physics Could you please recommend any good texts on algebraic geometry (just over the complex numbers rather than arbitrary fields) and on complex geometry including Kahler manifolds that could serve as an informal introduction to the subject for a theoretical physicist (having in mind the applications in physics, e.g. in the string theory)?   What I want for a moment is to get some informal picture of the subject rather than being dug up into the gory details of the proofs and lost in higher and higher layers of abstraction of commutative algebra and category theory. The texts I have found so far are all rather dry and almost completely lack this informal streak, and all of them are geared towards pure mathematicians, so if there exists something like "Algebraic geometry for physicists" and "Kahler manifolds for physicists" (of course, they would probably have different titles :)), I would greatly appreciate the relevant references. How do I code a table to look like this? I'm not the best at LaTeX and can't seem to wrap my head around \multirow. I checked other examples prior to posting but they used \multicolumn and it just confused me even more. Thanks in advance!    \begin{center} \begin{tabular}{ |c|c|c|c|c|}   \hline  TextA &amp; TextB &amp; TextC &amp; TextD &amp; TextE\\  \hline  A &amp; TextF &amp; TextG &amp; TextH &amp; TextI\\  B &amp; TextJ &amp; TextK &amp; TextL &amp; TextM\\  C &amp; \multirow{2}*{TextF} &amp; TextG &amp; TextH &amp; TextI\\  \cline{3-3}  &amp; TextJ &amp; TextK \\ \hline \end{tabular} \end{center}   I was trying something like this.. I'm starting to have problems as I'm trying to multirow within a multirow? I'm not sure of the process here. I would like TextG to be split into 2 and TextH and TextI to be the cells which are split in 3 but not sure how to go about it. Will then TextJ and TextK be the contents of the split TextG cell? Radius of Convergence of power series of Complex Analysis I have come across the following few questions on past exams papers.. I know how to solve these type when it is of the form $a_nz^n$ but don't have a clue what to do with these. Any help would be greatly appreciated!  (i) $\displaystyle\sum_{n=0}^\infty \bigg(\dfrac{1}{2n}\bigg)z^{3n}$.  (ii) $\displaystyle\sum_{n=0}^\infty(2^n+i)(z-i)^n$.  (iii) Show that the radius of convergence of $\displaystyle\sum_{n=0}^\infty z^{n!}$ is $1$ and that there are infinitely many $z \in \mathbb{C}$ with $|z|=1$ for which the series diverges. Does the std::stack in the C++ STL expose any iterators of the underlying container or should I use that container directly? Evaluating $\zeta(0)$ using the functional equation of Riemann-Zeta function. $$\zeta(it)=2it\pi it−1\sin(i\pi t/2)\Gamma(1−it)\zeta(1−it).$$ Everything on the RHS is never zero,  Does that means LHS has no zeros, since $\sin(s)$ has a simple zero at $s=0$ while $\zeta(1−s)$ has a simple pole at $s=0$  (the Laurent expansion), so the product $\sin(i\pi t/2)\zeta(1−it)$ is finite and nonzero at $t=0$.  My question is that from functional equation one can't get direct answer $\zeta(0)=−1/2$ unless using alternate infinite series ! In , one learns two definitions of free groups associating with sets.        Let $A$ be a set, the free group of $A$, $F(A)$ is the initial object in the category $\mathcal{C}$, where \begin{equation} \operatorname{Obj}(\mathcal{C})=\{A\xrightarrow{g}G\}, \end{equation}where the codomain $G$ are groups, and \begin{equation} \operatorname{Hom}(\mathcal{C})=\{\text{Commutative Diagrams } A\xrightarrow{g_1}G_1\xrightarrow{\phi}G_2\xleftarrow{g_2}A\}  \end{equation} where $\phi$ are group homomorphisms.   Also $F(A)$ has the concrete construction with elements being non-redundant words with alphabet $A$, and the group multiplication being juxtaposition and reduction.      But what good are free groups? Why are they useful?  says they are useful in topology, but does not explain why explicity.   Can someone give some examples that an undergraduate can understand? I am asking about examples that can show the usefulness of this abstract construction. So I guess the identification of $\mathbb{Z}=F({a})$ does not really count. Error message in my excel formula Is there a way to add a timer to a Beamer presentation? I have seen presentations in Power Point which contain a timer. Can this be done in Beamer using a simple command, or maybe a package? If not a timer, is it possible to at least get a clock on your slides? What is the purpose of Microsoft.SharePoint.Runtime.dll in CSOM? I know we need to use Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime dll's reference in .NET managed CSOM application development. But can someone help me understand why we have to use Microsoft.SharePoint.Client.Runtime and whats it's purpose, in detail. or point me to a reference please. Thank you in advance Why aren't logarithms defined for negative $x$? Given a logarithm is true, if and only if, $y = \log_b{x}$ and $b^y = x$ (and $x$ and $b$ are positive, and $b$ is not equal to $1$), are true, why aren't logarithms defined for negative numbers?  Why can't $b$ be negative? Take $(-2)^3 = -8$ for example. Turning that into a logarithm, we get $3 = \log_{(-2)}{(-8)}$ which is an invalid equation as $b$ and $x$ are not positive! Why is this? How can I safely prototype a mains power circuit? I'm building a device that has a mains power component, which I need to prototype before building to make sure everything works. I know I need to make sure wiring—and insulation!—is thick enough to cope with the higher current, and that I need to make sure there's enough space between exposed components so there's no arcing. I'll also be stashing whatever I prototype in a nice, insulated box before applying power, and I'll be include a small-value (250mA) fuse just in case. I'll be considering everything double-insulated rather than earthed (plastic enclosure, and there's nothing I'll need to touch while it's operating).  My plan is to solder (through-hole) components directly to each other, then insulate everything (with heatshrink tubing or electrical tape) as much as possible, then use screw-type cable joiners to connect the power cable.  I know I can't use traditional prototyping tools such as breadboards and stripboard for mains voltages, but what can I use to make prototyping at mains voltages easier?  (To be clear, 'mains voltage' in my area means 230V AC +10/-6% at 50Hz; GPOs are generally rated at 10A.) How do I grep for all non-ASCII characters? 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? How to input a specific Pantone color number in Illustrator? Zero to the zero power – is $0^0=1$? I've got a qml file and I just want to ssh to the phone and do  qmlscene myfile.qml   Is it possible without doing all that stuff with SDK and packages? Just vim and some simple commands that can fit into person's memory. I want to copy the data folders from a previous ubuntu(14.04) partition My hard drive is a mess and I want to reformat it and do a fresh install of 16.04. My problem is I only have access to the HDD via 16.04 on a USB stick and although I can navigate to the various folders, nothing I do allows me to copy to an external hard drive. The folders are not encrypted. I also have a small swap partition - I would like to preserve the data on that too if possible.  Here's a listing of the home directories on the drive:  ubuntu@ubuntu:/$ ls -l /media/*/*/home /media/ubuntu/0e228f65-dac7-435f-828b-1eb1a6c3f29a/home: total 4 drwxr-xr-x 46 1000 1000 4096 Dec 21  2015 simon  /media/ubuntu/db79a6d1-7c6c-4d8c-822b-ba6ccd1ddecd/home: total 4 drwxr-xr-x 27 1000 1000 4096 Apr 17  2014 simon  /media/ubuntu/ebe2a6ba-9cb5-4279-8352-5082b8dd4d5e/home: total 4 drwxr-xr-x 39 1000 1000 4096 Aug  3 14:21 simon