I am opening a Login JavaFX page from UserController.java and it has its control in LoginController.java.After processing it in LoginController.java and I am executing a close method to close the stage declared in UserController(which contains the stage for Login) but it throws NullPointerException  public class UserMenuController {     @FXML     private MenuItem Login;     Stage loginStage;      public void LoginPage(ActionEvent actionEvent) throws IOException {         loginStage=new Stage();         Parent loginFXML=FXMLLoader.load(getClass().getResource("/login.fxml"));         loginStage.setTitle("Login");         Scene loginScene=new Scene(loginFXML);         loginStage.setScene(loginScene);         loginStage.show();      }     public void shutLoginStage(){         loginStage.close();     } }  public class LoginController implements Initializable {     @FXML     private WebView view;     UserMenuController u=new UserMenuController();      public void initialize(URL location, ResourceBundle resources) {         view.getEngine().load("https://kite.trade/connect/login?v=3&amp;api_key=kpnnt4xthv187j8p");         view.getEngine().getLoadWorker().stateProperty().addListener((observable, oldValue, newValue) -&gt; {[enter image description here][1]             //Gets the URL  Request Token             if (newValue.equals(Worker.State.FAILED)) {                 //System.out.println(view.getEngine().getLocation());                 System.out.println(view.getEngine().getLocation());                 u.shutLoginStage();              }          });
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?
I'm trying to graph the function $y = \frac{x^2-4}{x-2}$.  I factored the numerator into $(x+2)(x-2)$, and then canceled the common factor (x-2), leaving the function as $y = x + 2$.    Is it acceptable to graph the original function as $y = x + 2$, a straight line with domain and range all real numbers?  Or do you have to restrict the domain as in the original function?  Thanks, Sean Does the everywhere differentiability of $f$ imply it is absolutely continuous on a compact interval? Suppose $f$ is differentiable everywhere on $[0,1]$. Must $f$ be absolutely continuous on $[0,1]$? I know this is true if $f'$ is integrable but I'm not sure in this more general case. How do I make a 2D game resolution independent? I'm working on a simple 2D game. I've finished the mobile phone version.  However, my boss wants the game to works on his RT. I'm doing the "conversion" but my buttons are in the wrong places, because I hard-coded the screen size, like this:   texture = game.Content.Load&lt;Texture2D&gt;("StartScreen");  mainFrame = new Rectangle(0, 0, game.GraphicsDevice.Viewport.Width, game.GraphicsDevice.Viewport.Height);   // button definitions  startbrect = new Rectangle(300, 258, 88, 88);  startbtext = game.Content.Load&lt;Texture2D&gt;("bplay");   In this example, mainframe is fine, but startbrect isn't, because I defined the size to match a Windows phone's screen. How can I handle responsive design when all Windows 8 phones' screens are different? Is there a formula or macro to calculate each time the good size? How to prove that we are living in a 3+1D world? What is the best way to open a file for exclusive access in Python? What is the most elegant way to solve this:   open a file for reading, but only if it is not already opened for writing open a file for writing, but only if it is not already opened for reading or writing   The built-in functions work like this  &gt;&gt;&gt; path = r"c:\scr.txt" &gt;&gt;&gt; file1 = open(path, "w") &gt;&gt;&gt; print file1 &lt;open file 'c:\scr.txt', mode 'w' at 0x019F88D8&gt; &gt;&gt;&gt; file2 = open(path, "w") &gt;&gt;&gt; print file2 &lt;open file 'c:\scr.txt', mode 'w' at 0x02332188&gt; &gt;&gt;&gt; file1.write("111") &gt;&gt;&gt; file2.write("222") &gt;&gt;&gt; file1.close()   scr.txt now contains '111'.  &gt;&gt;&gt; file2.close()   scr.txt was overwritten and now contains '222' (on Windows, Python 2.4).  The solution should work inside the same process (like in the example above) as well as when another process has opened the file. It is preferred, if a crashing program will not keep the lock open. Why did Itachi poke Sasuke's forehead? From the beginning of the series, even during his last moments, Itachi poked Sasuke's forehead as a way of showing affection and apologizing.  But is that the only reason? Did he perhaps try to transfer some knowledge or memories to Sasuke? Or is it simply unknown? Let $f:[0;1]\to\mathbb R$ be continiously differentiable How can I remap keyboard keys in windows 8.1? I'm looking for a simple utility which will modify registry and would not require running at startup. I tried sharpkeys but, it does not seem to work in windows 8.1. Any other suggestions? Or a simple how-to tutorial for windows 8.1?  Edit: Keytweak isn't working either. Actually I want to map an unused key to function key (fn) and neither sharpkeys nor keytweak detect the keystroke for that key.   Thanks How to merge partitions? I have two partitions, one of them has a file system and the other is unallocated.  How to merge two partitions? How to implement uniform grids Up until now, I implemented all-against-all collision detection in my games. It worked fine.  But I reached a point where implementing this kind of collision detection, makes the game run poorly, because there are two many objects to iterate through and check for collision.  I have searched this site and found something about 'uniform grids'. But I didn't completely understand what it is and how to implement it. Tried to Google it but nothing easy enough to understand came up.  I am a beginner to 2D-game programming. Do you mind trying to explain to uniform-grids, or link me to some good tutorial?  Thanks a lot Both DHCP and static IP addresses simultaneously on one interface We can use multiple IP addresses for a single interface in Linux (eg. eth0:0, eth0:1). But can we use DHCP and static IP at the same time? eth0:1 should have a static IP address and eth0:0 should be configured using DHCP.  How can we accomplish both? Why is King Tommen Baratheon the "First of his Name" rather than at least third? This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software.  sudo apt-get purge &lt;appname&gt;   But sudo itself can be removed.  sudo apt-get purge sudo # Do not run this command on production computers!   This is where the fun comes  ubuntu@ubuntu:~$ sudo bash: /usr/bin/sudo: No such file or directory   Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.  So is there a way of reinstalling sudo? Series rearrangement and Riemann's theorem I think understand that when I have a conditionally convergent series, it consists of series of positive and negative values which are divergent and thus one can find such permutation of indices $\phi : \mathbb{N}\rightarrow\mathbb{N}$ so the rearranged series sums up to an arbitrary value, diverges or oscillates.   This is how I understand what Riemann's rearrangement theorem says, but how do I use it practically? For example, when I have the conditionally convergent series:  $$\sum_{n=1}^{\infty}\frac{(-1)^n}{\sqrt{n}}$$  and I want to rearrange it to be divergent or to sum up to certain value M? How do I define such bijections $\phi$ ?  I appreciate all help. I am getting really confused now. I installed Tex Live 2012 on my Xubuntu 12.04 with a backport and I installed TexMaker.  I could user PdfLatex right away and it generated everything I needed except my bibliography. I read that Tex Live 2012 comes with biblatex so I just changed the bibtex command in TexMaker from "bibtex" to "biblatex". However, that does not exist. So I did  sudo apt-get remove biblatex sudo apt-get install biblatex   The package is installed but I don't find the binary. Using bibtex the whole thing crashes. Which does not surprise me since I want to userbiber:  \usepackage[backend=biber]{biblatex}   Btw does biber come with biblatex? So far I couldn't get any clear explanation what biber and biblatex are to each other.  EDIT: I had to remove texlive completely and install it with the install script form . Apparently the newest version of biber does not work with the older version of biblatex I had. Which pseudo-$R^2$ measure is the one to report for logistic regression (Cox & Snell or Nagelkerke)? I have SPSS output for a logistic regression model. The output reports two measures for the model fit, Cox &amp; Snell and Nagelkerke.  So as a rule of thumb, which of these $R^²$ measures would you report as the model fit?  Or, which of these fit indices is the one that is usually reported in journals?    Some Background: The regression tries to predict the presence or absence of a bird (capercaillie) from some environmental variables (e.g., steepness, vegetation cover, ...). Unfortunately, the bird did not appear very often (35 hits to 468 misses) so the regression performs rather poorly. Cox &amp; Snell is .09, Nagelkerke, .23.    The subject is environmental sciences or ecology. Is a business card necessary for a graduate student? I know some PhD students have their own business cards, but I don't know if it is a standard practice for PhD students to have their own business cards. I think a business card can be useful for networking in conference or collaborating with some industrial partners. So, is are business cards necessary for a PhD student or other graduate students attending conferences?   PS: in case it is field-specific, I would like to know the different practices in different fields Why does Axii sign not work? I was wondering, how can I create a timeline exactly like this one:    on LaTeX?  I am a Finance student, and write all of my notes using LaTeX. These timelines, are giving me a headache. Since we use a lot of different timelines because of annuities. I want to learn how to create one basic timeline, so that I can then change anything I want. But basically, I want something like this, with the arrows and everything.  Thank you so much guys! "SELECT *" why is it an antipattern On multiple questions here and on stack overflow i saw people saying in the comments and answers that select * from table is almost always an antipattern without any explaination why. Althrough I can sort of deduce why it is an antipattern. I may be looking over a detail that someone else with better understanding of the issue noticed.  So here is my question, why people say that select * is an antipattern.