Here what i am trying to achive is to print a anchor pane by getting the default printer and here is the code.  public class printnodeController { @FXML private AnchorPane print; public void print (){      Printer printer = Printer.getDefaultPrinter();     PageLayout pageLayout         = printer.createPageLayout(Paper.A4, PageOrientation.PORTRAIT,  Printer.MarginType.HARDWARE_MINIMUM);     PrinterAttributes attr = printer.getPrinterAttributes();     PrinterJob job = PrinterJob.createPrinterJob();     double scaleX         = pageLayout.getPrintableWidth() /  print.getBoundsInParent().getWidth();     double scaleY         = pageLayout.getPrintableHeight() /  print.getBoundsInParent().getHeight();     Scale scale = new Scale(scaleX, scaleY);     print.getTransforms().add(scale);      if (job != null &amp;&amp; job.showPrintDialog(print.getScene().getWindow())) {       boolean success = job.printPage(pageLayout, print);       if (success) {         job.endJob();        }     }     print.getTransforms().remove(scale);  } }   but i am getting this error:      java.lang.reflect.InvocationTargetException     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at     com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)     at       com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)     Caused by: java.lang.NullPointerException     at application.printnodeController.print(printnodeController.java:25)     at application.Main.main(Main.java:47)     ... 11 more     Exception running application application.Main   i had tried searching but didnt find any solution ; please help  new to this site Thankyou in advance.
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?
Key '@' (Keycode 49) and key '<' (keycode 94) are inverted on macbookPro keyboard How do I ensure that figures appear in the section they're associated with? Often floats may land quite a bit later in the document than the point they are created, sometimes after a section break.  Is there a way to force a new section to start on a new page, after any unplaced floats? I have a web page that includes a bunch of images. Sometimes the image isn't available, so a broken image is displayed in the client's browser.  How do I use jQuery to get the set of images, filter it to broken images then replace the src?    --I thought it would be easier to do this with jQuery, but it turned out much easier to just use a pure JavaScript solution, that is, the one provided by Prestaul. Find Oracle JDBC driver in Maven repository Why not use development provisioning instead of ad hoc? SQLiteException while inserting values in the database in Android ls -la symbolics... what does that last symbol mean? Eclipse says: “Workspace in use or cannot be created, chose a different one.” How do I unlock a workspace? JSON encode MySQL results How do I use the json_encode() function with MySQL query results? Do I need to iterate through the rows or can I just apply it to the entire results object? Schrödinger Equation for Two Electrons? I'm having trouble finding a simple answer to this question (maybe because there isn't one), but I'm just confused about how the Schrödinger Equation would look for two electrons. I understand that it would exist in 6 dimensional configuration space, but how does the potential look? It's confusing that the potential would be different for each electron depending on where the other one is. While playing Phase Ten, is it legal to pick up the top card of the discard pile and then immediately discard that exact card? There are Recurrent Neural Networks and Recursive Neural Networks. Both are usually denoted by the same acronym: RNN. According to , Recurrent NN are in fact Recursive NN, but I don't really understand the explanation.  Moreover, I don't seem to find which is better (with examples or so) for Natural Language Processing. The fact is that, although Socher uses Recursive NN for NLP in his , I can't find a good implementation of recursive neural networks, and when I search in Google, most of the answers are about Recurrent NN.  Besides that, is there another DNN which applies better for NLP, or it depends on the NLP task? Deep Belief Nets or Stacked Autoencoders? (I don't seem to find any particular util for ConvNets in NLP, and most of the implementations are with machine vision in mind).  Finally, I would really prefer DNN implementations for C++ (better yet if it has GPU support) or Scala (better if it has Spark support) rather than Python or Matlab/Octave.  I've tried Deeplearning4j, but it's under constant development and the documentation is a little outdated and I can't seem to make it work. Too bad because it has the "black box" like way of doing things, very much like scikit-learn or Weka, which is what I really want. My linear voltage regulator is overheating very fast I'm using a 5 V / 2 A voltage regulator () without a heatsink. I'm testing the circuit with a microcontroller (PIC18FXXXX), a few LEDs and a 1 mA piezzo buzzer. The input voltage is aprox. 24 VDC. After running for a minute, the voltage regulator starts to overheat, meaning it burns my finger if I keep it there for more than a second. Within a few minutes it starts to smell like it's burnt. Is this a normal behavior for this regulator? What could cause it to heat that much?    Other components used in this circuit:  L1:   R2:   F1: Remove last character from line Node Package Manager got corrupted in some way, now it cannot be installed Is it a good practice to always scale/normalize data for machine learning? My understanding is that when some features have different ranges in their values (for example, imagine one feature being the age of a person and another one being their salary in USD) will affect negatively algorithms because the feature with bigger values will take more influence, is it a good practice to simply ALWAYS scale/normalize the data?  It looks to me that if the values are already similar among then, then normalizing them will have little effect, but if the values are very different normalization will help, however it feels too simple to be true :)  Am I missing something? Are there situations/algorithms were actually it is desirable to let some features to deliberately outweigh others? $\Bbb Q$-linear is equivalent to additive How do I play a YouTube video in the background on my iPad? Early propagation of carries in the BLAKE hash function char!=(signed char), char!=(unsigned char) The code below compiles, but has different behavior for the char type than for the int types.  In particular     cout &lt;&lt; getIsTrue&lt; isX&lt;int8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;uint8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;char&gt;::ikIsX  &gt;() &lt;&lt; endl;   result in 3 instantiations of templates for three types: int8, uint8 and char. What gives?  The same is not true for ints: int and uint32 which result in the same template instantiation, and signed int another.  The reason seems to be that C++ sees char, signed char and unsigned char as three different types. Whereas int is the same as a signed int. Is this right or am I missing something?  #include &lt;iostream&gt;  using namespace std;  typedef   signed char       int8; typedef unsigned char      uint8; typedef   signed short      int16; typedef unsigned short     uint16; typedef   signed int        int32; typedef unsigned int       uint32; typedef   signed long long  int64; typedef unsigned long long uint64;  struct TrueType {}; struct FalseType {};  template &lt;typename T&gt; struct isX {    typedef typename T::ikIsX ikIsX; };   // This  int==int32 is ambiguous //template &lt;&gt;            struct isX&lt;int  &gt;    { typedef FalseType ikIsX; };  // Fails template &lt;&gt;            struct isX&lt;int32  &gt;  { typedef FalseType ikIsX; }; template &lt;&gt;            struct isX&lt;uint32 &gt;  { typedef FalseType ikIsX; };   // Whay isn't this ambiguous? char==int8 template &lt;&gt;            struct isX&lt;char  &gt;  { typedef FalseType ikIsX; }; template &lt;&gt;            struct isX&lt;int8  &gt;  { typedef FalseType ikIsX; }; template &lt;&gt;            struct isX&lt;uint8 &gt;  { typedef FalseType ikIsX; };   template &lt;typename T&gt; bool getIsTrue(); template &lt;&gt;           bool getIsTrue&lt;TrueType&gt;() { return true; } template &lt;&gt;           bool getIsTrue&lt;FalseType&gt;() { return false; }  int main(int, char **t ) {    cout &lt;&lt; sizeof(int8) &lt;&lt; endl;  // 1    cout &lt;&lt; sizeof(uint8) &lt;&lt; endl; // 1    cout &lt;&lt; sizeof(char) &lt;&lt; endl;  // 1     cout &lt;&lt; getIsTrue&lt; isX&lt;int8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;uint8&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;char&gt;::ikIsX  &gt;() &lt;&lt; endl;     cout &lt;&lt; getIsTrue&lt; isX&lt;int32&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;uint32&gt;::ikIsX  &gt;() &lt;&lt; endl;    cout &lt;&lt; getIsTrue&lt; isX&lt;int&gt;::ikIsX  &gt;() &lt;&lt; endl;  }   I'm using g++ 4.something