java - Null pointer exception when calling a method
What is a NullPointerException, and how do I fix it?
Technique for finding the nth term I'm a trainee teacher and I need to pass a skills test in maths, but I'm having trouble in this particular area of algebra in finding the nth term of any sequence. I've been given a series of questions to answer one of them is:  Find the nth term of the sequence 3, 8, 15, 24.  I not only need to know the answer but more importantly the technique. This is GCSE level. Can I use Wi-Fi and cable (Ethernet) networking at same time? I am on an intranet that is not connected to the Internet and a Wi-Fi router with connection to the Internet. When I am connected to the wireless network, I can browse the Internet, but I cannot browse my LAN with my Ethernet cable connected.  How can I browse the Internet via my Wi-Fi router and at the same time browse my local LAN web application via my connected Ethernet cable? Define additional math operators to be typeset in roman Mathematical operators, such as function names, should be set in roman type, not italics. Latex already has commands for some operators, including \max, \min, and \log.  How can I define additional such commands? Can Objective C determine the caller object reference at runtime (reflection)? I have notice some sites have the same form for login, register and forgotten password.  Below the form you have 3 buttons    i forgot my password register log me in   What are the pros and cons on using this approach and which version would you go for. Mod of numbers with large exponents [modular order reduction] I am trying to produce a presentation where code for a pair of arrays appear in the same position of a beamer slide.  I tried something like this (with different combinations and braces) and did not work.  \begin{verbatim}\only&lt;1&gt;       V1 V2 V3 V4 [1,]  0  1  1  0 [2,]  1  0  1  0 [3,]  1  1  0  0 [4,]  0  0  0  0   \only&lt;2&gt;       V1 V2 V3 V4 [1,]  0  1  0  0 [2,]  1  0  1  0 [3,]  0  0  0  0 [4,]  0  0  0  0  \end{verbatim}    Appreciate any suggestions.  Thanks! Intuitive explanation of entropy I have bumped many times into entropy, but it has never been clear for me why we use this formula:  If $X$ is random variable then its entropy is:  $$H(X) = -\displaystyle\sum_{x} p(x)\log p(x).$$  Why are we using this formula? Where did this formula come from? I'm looking for the intuition. Is it because this function just happens to have some good analytical and practical properties? Is it just because it works? Where did Shannon get this from? Did he sit under a tree and entropy fell to his head like the apple did for Newton? How do you interpret this quantity in the real physical world? What if I run a virus/trojan Windows EXE on Ubuntu with Wine? How can I install .ipa file to my iPhone simulator? I need to install .ipa file to my iPhone simulator.   I tried to change the extension .ipa to .zip and extracted it.  And I got the Payload folder and moved the application inside to my iPhone simulators applications folder found at: /Library/Application\ Support/iPhone Simulator/6.1/Applications/.   Application appears on iPhone Simulator, But the application did't running. How to solve the problem then how to run the app. Uses of the 'Golden Ratio' I have heard much about the numerous appearances of the ratio found in nature: 1.6180339887.  Are there any actual mathematical uses that have been found of this number? What are its advantages? Just curiosity, really. Defragmenting an SSD drive is a bad idea and Windows 7 is (should be?) smart enough not to schedule defragmentation on such drives.  However, I've opened up Disk Defragmenter on my system and found, to my surprise, that my SSD has indeed been defragmented... recently!  Then I checked the disks selected for the scheduled defrag (I have one SSD and one normal disk), and there the list correctly shows only the non-SSD drive.   MSDN forum post seems to suggest that, at least on Windows 8, defragmenting an SSD drive will just cause the TRIM command to be sent to the drive, but there's no word on what actually happens if you try to defrag an SSD drive on Windows 7 (aside from the fact that it shouldn't happen automatically).  What happens in Windows 7 if one chooses to defrag and SSD? What could possibly have been the reason my SSD drive got been defragmented?  EDIT:  I just remembered - I've moved some folders (Users and ProgramData) from my SSD drive to my normal drive using junctions.  question suggests that this shouldn't have any effects at all on the defragmentation process, but could it have an effect on the "last run" in Disk Defragmenter? Does Find My Mac work if the disk gets erased? Algorithm over 2 pages I am writing a few rather large pseudocode functions using algorithm and algorithmic, i.e. my code looks something like:  \begin{algorithm}                      \caption{Coolest Algorithm ever}           \label{findme}                           \begin{algorithmic} [1]                   % enter the algorithmic environment \REQUIRE    Here are a few variables \\             variable 2 \\             variable 3  \ENSURE     this is the output \\             output 2  \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \end{algorithmic} \end{algorithm}   Unfortunately this code does not fit on one page and I am definitely not able to split it into some subfunctions or so (I already did that as far as possible).  So now I need to split up the algorithm into two pages, but I have no idea how.  The easiest way I can imagine is just to start a new algorithm on the new page, but this time letting the line counter start at line 35 or so instead of 1. But how can I do that?  Please not that there is already a similar question here on this site, but it deals with the package algorithmicx. Did Sidious know the secret of cheating death? In Star Wars: Revenge of the Sith, Chancellor Palpatine tells Anakin the tale of Darth Plagueis the Wise. He told Anakin that if he joined the dark side he could save the people he loved from death by extending their midichlorian count, just as Darth Plagueis had done (obviously more subtly than that).  When Anakin asked what had happened to Plagueis, Palpatine says:      Unfortunately, he taught his apprentice everything he knew. Then his apprentice...killed him in his sleep.   It is revealed (not in the movie) that it was Palpatine himself that was Plagueis' apprentice  After Anakin and Palpatine kill Mace Windu, Palpatine says,     To cheat death is a power only one has achieved, but if we work together I know we can discover the secret.   This implies that Palpatine doesn't already know the secrets but if Plagueis taught him "everything he knew" then surely he would have.  So did Sidious know the entire time or was "everything he knew" an exaggeration?  Just to be clear when I say "cheat death" I only mean extending someone's midichlorian count, not "transfer essence" or anything else like that. No Time in Top Panel (Gnome Classic) I've been using Ubuntu with Gnome Classic for a while and I've noticed recently that in the "Indicator Applet Complete" in the Top Panel, my name and the clock have disappeared.    I think it happened a while ago when I was messing around with packages. Every time I did apt-get... it would say "the following packages can be removed by apt-get autoremove", so I did it and then the clock and my name stopped appearing.   Can anyone help me? Thanks. It would be greatly appreciated. What is the easiest way to swap occurrences of two strings in Vim? I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings? Why is $\sqrt {12} = 2 \sqrt 3$? On Latin.SE, I am getting a 404 error when clicking any of the three "history" links on the .  That is, this:        Gives this:        All three editable sections have a revision history with two revisions or more, and all three give an error.  The actual links are , , and .