I am having trouble seeing what is causing my error. Code is below and below that is the error message I am receiving. Thank you.      import java.util.*; import java.io.*;  public class IO {  public static void main(String[] args) throws Exception {     File inFile = new File("src/passign6/grades.txt");     File outFile = new File("src/passign6/finalgrades.txt");      try (             Scanner input = new Scanner(inFile);             PrintWriter output = new PrintWriter(outFile);) {          int[][] grades = new int[42][];         for (int i = 0; input.hasNextLine() &amp;&amp; i &lt; grades.length; i++) {             String line = input.nextLine();             Scanner input2 = new Scanner(line);             for (int j = 0; input2.hasNextInt() &amp;&amp; j &lt; grades[i].length; j++) {                 grades[i][j] = input.nextInt();             }              input.close();             output.close();         }      }  } }  Exception in thread "main" java.lang.NullPointerException at io.IO.main(IO.java:20)
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?
Intersection of three vector subspaces We say that two vector subspaces $U,W\subset V$ intersect transversally (written $U\pitchfork W$) if $U+W=V$.  Let $V_1,V_2,V_3$ be vector subspaces of $V$ where $\dim V=n$. We say they intersect normally if $V_i\pitchfork(V_k\cap V_l)$  for $i\ne k,l$. Prove that $V_1,V_2,V_3$ intersect normally if  the following condition holds:  $\operatorname{codim}(V_1\cap V_2\cap V_3)=\operatorname{codim} V_1+\operatorname{codim} V_2+\operatorname{codim} V_3,$   where $\operatorname{codim} V_i=n-\dim V_i$.  How to approach this problem? I tried to order dimensions of $V_i$ but I got that the LHS is $\ge n-\min (\dim V_i,i=1,2,3)$ and the RHS is $\le 3( n-\min (\dim V_i,i=1,2,3))$ which does not lead anywhere. What is the right way to do this? Is the function $\mbox{tr}(XAX')$ convex? Is the function $\mbox{tr}(XAX')$ convex, where $A$ is a positive semidefinite (PSD) matrix? I know that for a general $A$, the above trace function is not convex. But for a PSD $A$, is the function convex? Converting string into datetime Coefficient changes sign when adding a variable in logistic regression In my logistic regression the sign of coefficients of a variable (location distance of an amenity) changes based on other variables (with time -ve, with travel distance +ve) in the model. When the location distance is the only variable in the model, it has +ve sign.    Should the variable need to maintain the +ve sign no matter what other variables are added in the model? Does changing sign signify a multicollinearity issue? Some IVs are gaining significance while in a bivariate model, they didn't show significance and vice versa. Is it okay to add variables that don't have much significance (ex: travel distance has a significance of 0.33 individually, but 0.05 when added with other variables) but becomes significant in the model? thanks. Adding GPX files into ArcMap? What is the smoothest route, the easiest user experience, to add  files to ArcMap?  Ideally, I'd like to interact with .gpx with the same facility as .shp, being able drag'n'drop onto the map canvas and so on. Ultimately the results will be feature classes in a file-gdb but shapefile is an acceptable intermediate. Can you trade from Pokemon Red on GBA to Pokemon gold on virtual console? I have a Game Boy Advance SP and Pokemon Red GEN 1, and I'm curious if it is possible for me to trade a Pokemon from Red to the Virtual Console release of Pokemon Gold on the 3DS Custom cross-reference formats (e.g. "Equation 1" instead of just "1") How to fix very slow Ubuntu booting? How to forward specific log file outside of /var/log with rsyslog to remote server? How can I forward message from a specific log file like /www/myapp/log/test.log with rsyslog client to remote rsyslog server? This log file is outside of the directory /var/log. $C_c^{\infty}(\mathbb R^n)$ is dense in $W^{k,p}(\mathbb R^n)$ In the King James version of the Bible there is a verse like this:     The Lord is my strength, and my fortress, and my song. And He is become my salvation.   Is it still feasible to use "is become" instead of "has become" and what is the semantic difference? Where are temporary files in Chrome stored? How to use unicode characters in Windows command line? We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š letter to the command-line tools. The command prompt or what not else messes it up, and the tf.exe utility can't find the specified project.  I've tried different formats for the .bat file (ANSI, UTF-8 with and without ) as well as scripting it in JavaScript (which is Unicode inherently) - but no luck. How do I execute a program and pass it a Unicode command line? "Forgot" vs "Forget" Is the following correct, or is there more to it?  "I forgot his name" — I knew his name, but I forgot it.  "I forget his name" — I keep forgetting his name. Where using "forget" basically means that you tried to remember this information before as well, but you couldn't then either. How to install WhatsApp? Does "non-" prefixed to a two word phrase permit another hyphen before the second word?  If I want to refer to an entity which is defined as the negation of another entity by attaching "non-" it seems strange to attach the "non-" only to the first word when the second one is really the word naming the entity. For example,     non-control freak   looks like a person obsessed with not being in control rather than one who is simply not obsessed with control.     non-control-freak   actually looks better because the "freak" is attached to the "non-" as much as it is to "control-", without the space implying the presence of a phrase break.    and its answers make it sound like totally detaching the "non" could be an option, but if I were following the convention of hyphenating "non-" could I add a hyphen after the next word to resolve this problem? Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM? new finding by Minev et al. seems to suggest that transitions between atomic states are not instantaneous, but continuous processes wherein a superposition smoothly adjusts from favoring one state to another (if I understand it correctly). The authors also claim to be able to catch a system "mid-jump" and reverse it. Popular articles are  and .  I am curious if this finding rules out any interpretations of QM. It seems to generally go against the Copenhagen attitude, which describes measurements as collapsing physical systems into a definite classical state. The popular articles indeed claim that the founders of QM would have been surprised by the new finding.  The link with the asterisk mentions that something called "quantum trajectories theory" predicts what was observed. Is this an interpretation, or a theory? And are they implying that other interpretations/theories don't work? More numbers between $[0,1]$ or $[1,\infty)$? Currently, once an edit by a user without full edit privilege is suggested, it can be either approved or rejected.  There is a known edge case that cause suggested edits to get auto rejected: (aka edit conflict)   User with full edit privilege click "edit" and start typing. Let's name this user Joe. Since the user from previous step did not yet send the edit, users without full edit privilege can still click the "edit" as well, oblivious to the fact someone else is editing the same post in those very seconds. Such user click "edit" too and start typing. Let's name this user Kenny. Kenny is faster than Joe: he send his edit first, creating new suggested edit. Joe is still typing. Joe finally done typing. He send his edit to its merry way oblivious to the consequences. As result of the full edit made by Joe, Kenny's suggested edit is kicked away and rejected. Boom.   This is all known and reported many times.  where the user got it hard with at least two auto rejections in short period of time. Some concrete examples: , , .  For edge case, it became pretty thick edge. This is not just minor hassle: enough rejections, and the user is banned from suggesting for a whole week: and remember we're talking here about good edits made by good users. The above used to count for the ban, but . Thanks Gilles for requesting such a change!   I know it was already suggested to lock edits and similar solutions, but I suggest whole different approach: instead of auto rejecting the suggested edit, dismiss it, i.e. cancel it like it never existed same way a bounty can be revoked by moderator.  In the edit suggestion page it will show "Dismissed" instead of Approved or Rejected maybe with a tooltip explaining what caused this. This will soften the blow from those edge cases, taking the edge out of them. :) get exact file create time windows 7 I'm trying to figure out exactly when I created a file. Windows 7 thinks I don't know how to subtract two times, and tells me it was created "1 hour ago." I need a little more detail than this, but I can't seem to find a setting to toggle this "feature" off.  Example below: