I am trying to detect when the player jumps, but I keep getting a NullPointerExeption, and I don't know what is causing it. Here is my code private Map&lt;Player, Double&gt; playerY = new HashMap&lt;&gt;();  @org.bukkit.event.EventHandler public void onPlayerMove(PlayerMoveEvent event) {     if (event.getPlayer().getLocation().getY() &gt; playerY.get(event.getPlayer())       &amp;&amp; event.getPlayer().getWorld().getBlockAt((int)event.getPlayer().getLocation().getX(), (int)(event.getPlayer().getLocation().getY() - 0.2), (int)event.getPlayer().getLocation().getZ()).getType() == (Material.AIR)) {         //My Code     }     }  I know I probably missing something really obvious here but I can't figure out why I am getting a NullPointerException.
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?
Does electricity flow on the surface of a wire or in the interior? Recover Data from Card that cannnot be read I am trying to help a friend who is very concerned that she has just lost all of the data on her 32GB SanDisk microSD card.  I told her I would post this and see if anyone could offer help.  Here are the details:   The SanDisk microSD card is less than two years old.  Probably only about a year old.  The store will take it back, but that doesn't really help.  She wants her data. She used the card in her Samsung Galaxy S4 smartphone for over a month.  The phone was never exposed to water or temperature extremes. Today, her phone suddenly said something like "Your SD card is blank or an unsupported format". Her phone was then unable to read the SanDisk microSD card at all.   Here's what she has tried:   Rebooting her phone.  Had no effect. Taking out the SanDisk microSD card and putting it inside a full-size SD card adapter, and inserting it into a Windows 7 SP1 computer.  The computer did not recognize its presence at all. Putting the SanDisk microSD card into a USB 2.0 external card reader and inserting the card reader into a USB port on a Windows 7 SP1 computer.  The computer recognized the card reader and installed drivers for it.  The card reader shows up as 'Removable Disk' in Windows Explorer.  Clicking on 'Removable Disk' in Windows Explorer results in the error "Insert disk: Please insert a disk into the Removable Disk". After trying #3, tried opening the 'Removable Disk' in FreeCommander.  Doing so results in the error "The device is not ready".   She does not have access to a linux box, but does have access to her Android phone.  What can she do to recover the data on her 32GB SanDisk microSD card? What oil is best for seasoning a cast-iron skillet What is the best way to store user settings for a .NET application? I have a .NET 2.0 Windows Forms application. Where is the best place the store user settings (considering Windows guidelines)?  Some people pointed to Application.LocalUserAppDataPath. However, that creates a folder structure like:     C:\Documents and Settings\user_name\Local Settings\Application   Data\company_name\product_name\product_version\   If I release version 1 of my application and store an XML file there, then release version 2, that would change to a different folder, right? I'd prefer to have a single folder, per user, to store settings, regardless of the application version. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ Err 80 appears when I turn on my Canon EOS 5D Mark II Recently when on holiday in Italy my 5DII stopped powering up. Turn the switch on and - nada. Pulling the battery and popping it back in brings the camera to life, however as soon as the camera goes in to sleep mode, or I turn the power off, the problem returns. Sometimes the camera shows Error 80 at this point:     Err 80      Shooting is not possible due to an error.    Turn the camera off and on again or re-install the battery.   I've seen various posts on the interwebs about pulling the clock battery and leaving the camera for a while - have tried this and also replaced the clock battery to no avail.   Has anyone else had this problem - did the body have to go back to Canon for repair or did you manage to fix it? Determine value of the limit:  $$L=\lim_{n\to \infty}\sqrt[n]{1^2+2^2+\cdots+n^2}$$  My try:  $$1^2+2^2+\cdots+n^2=\frac{n(n+1)(2n+1)}{6}$$  Hence: $$L=\lim_{n\to \infty} \sqrt[n]{\frac{n(n+1)(2n+1)}{6}}=?$$  But, come here, i do not know how, because please help me. How do I complete the square from the point I have left off at, and is this correct so far?   I have a normal prior for $\beta$ of the form $p(\beta|\sigma^2)\sim \mathcal{N}(0,\sigma^2V)$, to get:  $p(\beta|\sigma^2)=(2\pi\sigma^2V)^\frac{p}{2}\exp[-\frac{1}{2\sigma^2}\beta^T\beta]$  where $\beta^T\beta$ is   $\sum\limits_{i=1}^p \beta_i^2$.  My likelihood has a normal distribtuion for the data points y of the form $p(y|\beta,\sigma^2)\sim\mathcal{N}(B\beta,\sigma^2I)  $  $p(y|\beta,\sigma^2)=(2\pi \sigma^2V)^\frac{n}{2}\exp[-\frac{1}{2\sigma^2}({\bf y}-{\bf B}{\bf \beta})^T({\bf y}-{\bf B}{\bf \beta})]$  (Note that $\beta$ is a matrix/vector too, \bf does not work.)  To get my posterior for $\beta$ I combined the above, took the exponential parts only, and then expanded to get:  $\exp[-\frac{1}{2\sigma^2}({\bf y}^T{\bf y}-{\bf y}^T{\bf B}\beta-\beta{\bf B}^T{\bf y}-\beta^T{\bf B}^T{\bf B}\beta)]\exp[-\frac{1}{2\sigma^2}({\bf \beta}^T{\bf B})]$.  I dropped the $({\bf y}^T{\bf y})$ term, as is not a function of $\beta$.  Putting into one expression without the exponential:  $-\frac{1}{2\sigma^2}(-{\bf y}^T{\bf B}\beta-\beta{\bf B}^T{\bf y}-\beta^T{\bf B}^T{\bf B}\beta+{\bf \beta}^T{\bf B})$.  I know I need to combine the similar terms and get into the form of the multivariate normal distribution, which is what I am aiming for, but I am unsure how to do this? I probably have to add an extra term to the expression to get it into the correct form?  Note: This is not homework, it's a project, but my Bayesian working knowledge is not good at all and so I need to understand the working out. I intend to integrate out the $\beta$ and then the $\sigma^2$ after getting into the multivariate form. Recommendations for good Newtonian mechanics and kinematics books What are some good books for learning the concepts of Kinematics, Newton laws, 2D Motion of Object etc.? How do you pull first 100 characters of a string in PHP I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.    Is there a function that can do this easily?  For example:  $string1 = "I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing."; $string2 = 100charfunction($string1); print $string2   To get:  I am looking for a way to pull the first 100 characters from a string vari In Avengers: Infinity War, up until Thanos      gets all six Stones   in order to use the Gauntlet he needs to close his fist, as we see in the fight scene on Titan.     Doctor Strange: "Don't let him close his fist!"   So why later does snapping work? Handle .bib in subfiles I have a problem very similar to the question being asked in  . My .bib is references in main.tex. When compiling main, everything works like a charm. Working on the subfiles, I have two issues though (which are most likely related):   I can't access the bib with auto-completion When compiling the subfile, it doesn't insert the citations.   I tried including  \bibliographystyle{plainnat} \bibliography{mybib}   in the subfiles, which also worked smoothly. Obviously, the bibs are included in every chapter of the document when compiling main.tex, then. I tried setting a global boolean in main.tex:  \newboolean{printBibInSubfiles} \setboolean{printBibInSubfiles}{false}    and in the subfiles:  \ifthenelse{\boolean{printBibInSubfiles}}    {}    {\bibliographystyle{plainnat}     \bibliography{../betterbib.bib}}    For some reason, then setting the boolean to false, the "bibliography"-header was printed in the subfiles as well as for the main file, but there was no output of citations under any of the "bibliography"-headers. Furthermore, compiling only the subfiles didn't work correctly.  My document structure is the following:  main.tex:  \begin[document] ... \subfile{sub/dataprocessing} ... \bibliographystyle{plainnat} \bibliography{mybib} \end{document}   the subfiles:  \documentclass[../main.tex]{subfiles} \begin{document} ... \cite{Random2014} ... \end{document}   After all this explanation: the only thing I want is to access the .bib from the subfiles without having to manually uncommenting something when compiling the main file. Any takers?  PS: Obviously, I also tried the solution provided in "" but couldn't get it to work. I don't know whether that would solve my problem anyway, since I don't have the \printbibliography-issue of the thread opener. Spring's SecurityContextHolder.getContext().getAuthentication() returns null after RedirectView is used in HTTPS/SSL Fortunately, I can still login with this email address that I have lost access to.  I have been searching around here for a way to update it to the current one I use.  I have found many answers.  But they all give instructions to click on something not displayed or in one case, a page that prompts me to login via another email I no longer have the password for. I need current up to date instructions on how to change my email address or add another email-based login for this same user name that I am posting this with. How do I open Chromium in incognito mode by default? I would like to be able to open Chromium in incognito mode automatically. I'm new to Linux and I love it so far but I haven't yet found a way to do this. I'm using Ubuntu 14.04. Allow bounty to be set with reputation from another site? Is there any way to verify a cashier cheque? There are plenty of warnings around about forged cashier's cheques, and that if you deposit a forged one your bank will "hold you responsible".   What does it mean that the bank will "hold you responsible"? Clearly the money won't be credited. Will you be charged a fee like an NSF cheque? Will they try to prosecute you? Is there any way to confirm whether a cashiers cheque is forged? Could you for example tell your bank that you were uncertain of the origin, and ask them to confirm it? Can you call the issuer and verify (from the serial number) that they did in fact issue a cheque for that amount with you as the payee? I am currently making a map in the Minecraft 1.13 snapshots and have encountered a problem. I want to use the title command to give the player the number of resources they have for a certain resource. For example Wood: 150. I looked this up and found you could do this using the title command. Example:   title @a[r=1] actionbar [{"text":"Wood: "},{"score":{"name":"@p","objective":"Wood"},"bold":true}]}}   This works in 1.12 but not in 1.13. It seems that the JSON format has changed in 1.13 but I can't find anything on the wiki or the changelog.  Could someone please help me to work this out? Are DSLRs a dying breed, making now the time to switch to a mirrorless camera system? I have a document divided into \part \chapter \section and \subsection. I have 3 parts and in each part I reset all the counters.  I want that, when I do a crossref to something that is in the 1st part, chapter 3 and section 5, that LaTeX prints something like I-3.5, but  I don't want that in the tableofcontents part that LaTeX prints the part number. For example, what I want is:     Part I      chapter 1 section 1.1 section 1.2      chapter 2   AND NOT     chapter I-1 section I-1.1 section I-1.2      chapter I-2   The command that I've tried   \renewcommand{\thechapter}{\thepart-\arabic{chapter}} \renewcommand{\thesection}{\thechapter.\arabic{section}}   does exactly what I've said  Can anyone help me? Split a commit into smaller commits with Git?