Not sure why this Java Null Pointer Exception is happening I have a method that return an array of files in a given directory that is giving me a null pointer exception when executed. I can't figure out why.  private ArrayList&lt;File&gt; getFiles(String path) {      File f = new File(path);     ArrayList&lt;File&gt; files = new ArrayList&lt;&gt;(Arrays.asList(f.listFiles()));      return files; }   thanks for your help
What is a NullPointerException, and how do I fix it? 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?
ls: cannot access .gvfs: Permission denied Whenever I run an application in terminal as root (such as sudo gedit  /etc/default/varnish) , subsequently when I open another terminal I get "ls: cannot access .gvfs: Permission denied" error at top line of terminal.   I found a solution on the net     umount /path/to/.gvfs   rm -rf .gvfs   but it only fixes problem temporarily.  It appears that I have two mounted instances of gvfs in my system    $ sudo mount |grep gvfs     gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=33)     gvfsd-fuse on /home/****/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)   I don't know if it's related to, a few months ago I had to change permission in my home folder like     sudo chown -R $USER:www-data   Would you please help me fix it?  EDIT: After I unmount /run/user/1000/gvfs I don't get that error. Possibly two questions in here: Are these sentence constructions logical, and if they are, why are they different?     I swam across the Ocmulgee River.   I swam across the Pacific Ocean.   I swam across the Red Sea.   I swam across Lake Winnipeg.   I can't think of a way of phrasing the lake example while using an article with a proper noun. I thought at first it was because Lake Winnipeg is different; it's generic portion (the "Lake") comes first and the name of that body comes second, but I swam across Falls Lake is the same.   Yet the sentence I swam across the lake sounds right to me. ...Why? Proof that the real numbers are countable: Help with why this is wrong I was just thinking about this recently, and I thought of a possible bijection between the natural numbers and the real numbers.  First, take the numbers between zero and one, exclusive.  The following sequence of real numbers is suggested so that we have bijection.    0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.01, 0.02, ... , 0.09, 0.10, 0.11, ... , 0.99, 0.001, 0.002, ... , 0.999, 0.0001, etc.  Obviously, this includes repeats, but this set is countable.  Therefore, the set of all numbers between zero and one is a subset of the above countable set, and is thus countable.  Then we simply extend this to all real numbers and all the whole numbers themselves, and since the real numbers, as demonstrated above, between any two whole numbers is countable, the real numbers are the union of countably many countable sets, and thus the real numbers are countable.    Please help me with this.  I understand the diagonalization argument by Cantor, but I am curious specifically about this proof which I thought of and its strengths and flaws.  Thanks. What does static/dynamic BVH do? In the render properties panel, under the performance rollout there is a setting for static vs. dynamic BVH.  I am simply wondering what this setting does.  From the :     The raytracing acceleration structure used is a bounding volume hierarchy... This code includes spatial splits to make it more competitive with kd-trees.   Unfortunately, though I know quite a bit about cycles, this is totally Greek to me.  I couldn't really find much else useful on the web other than it may have some impact on animations only.  Can anybody explain this better (maybe starting with BVH in general)? How to lazy load images in ListView in Android Is Autopilot Openstack 16.04 available? Why is channel capacity a factor of bandwidth instead of frequency? I'm trying to understand the concept of capacity for a wireless channel.  Some help would be appreciated.  For a AWGN channel capacity is calculated as:  $$C=B \cdot log_2(1 + S/N)\text{ bits/sec}$$  B = bandwidth.  This is what I don't understand.  Why isn't it a factor of frequency? To me considering bandwidth only makes sense in cases where the system changes frequency.   Bandwidth is the difference between an upper and lower frequency range.  Well, what if I'm using a fixed-frequency signal?  Fupper and Flower would be the same value, right?  So does that mean B=0?  So a fixed frequency signal can't carry any data?  We know that's not true, AM radio does it.  So what am I missing? According to this formula, a fixed-frequency signal would have the same performance regardless of whether it's at high or low frequency.  This makes no sense to me.  For example say my bandwidth is 1Hz at a fixed frequency of 1Hz.  Compare this with a bandwidth of 1Hz at a frequency of 2.4GHz.  It's plainly obvious that I can cram way more bits into 2.4 x 109 cycles/second than I can with just 1/sec.  But according to this formula I can't.  Please help. What about fractional differences?  Waveforms are analog in nature, so we could have a 1Hz signal and a 1.5Hz signal.  Likewise at the high frequency range.  Say 2.4GHz minus 0.5Hz.  There is an infinite amount of space between 1 and 1.5.  Could not 1Hz and 1.001Hz serve as two separate channels?  In terms of practicality I realize this would be difficult, nearly impossible to measure this difference with modern electronics, especially with noise added, but in pure theory you could have two channels.  So in that sense, shouldn't there be an infinite amount of bandwidth between two frequencies?  Or do we only count in 1Hz whole number increments? I currently have the Geometry Dash lite version and I want to buy the full version. Can I login with my account of Geometry Dash lite and keep everything I already had? It would suck if I had to redo everything. how to disable system apps without root? Let $f$ and $g$ be continuous at $ x=a$, with $f(a)<g(a)$. Prove that there exists a neighborhood $I$ of a such that $f(x)<g(x)$ for all $x \in I$. I just bought "Reputation to the max". I bought this first, because I really want to help the cleanup of the vote-to-close queue, which, despite the efforts I've been hearing about, is still quite large. According to SO, my reputation is now 15,750, but that queue still says I need at least 3k rep to review! That is clearly a bug! When I type $\overset{\circ}{Z}^\lambda$ the lambda is placed slightly above and to the right of the circle. Is there a way to make it appear as a superscript on the Z? I tried $\overset{\circ}{Z^\lambda}$, but then the circle is too high and to the right.  As a bizarre aside: a friend uses the exact same code with no problem. However, when I type it into MathOverflow it looks the same as in my compiler (i.e. bad). Seeking English term for relationship between two members of extended family? How to send text to Notepad in C#/Win32? I'm trying to use SendMessage to Notepad, so that I can insert written text without making Notepad the active window.  I have done something like this in the past using SendText, but that required giving Notepad focus.  Now, first I'm retrieving the Windows handle:  Process[] processes = Process.GetProcessesByName("notepad"); Console.WriteLine(processes[0].MainWindowHandle.ToString());   I've confirmed it's the right handle for Notepad, the same shown within Windows Task Manager.  [DllImport("User32.dll", EntryPoint = "SendMessage")] public static extern int SendMessage(int hWnd, int Msg, int wParam, int lParam);   From here, I haven't been able to get SendMessage to work in all my experimentation.  Am I going in the wrong direction? Proving that free modules are flat (without appealing projective modules) Suppose $R\neq 0$ is a commutative ring with $1$. Let $M$ be a free $R$-module. I would like to prove that $M$ is a flat $R$-module. Everywhere I have looked (mostly online) this is proved by first proving that every free module is projective, and then proving that every projective module is flat. Unfortunately, Atiyah &amp; Macdonald's "Introduction to Commutative Algebra" (Chapter 2) does not discuss projective modules. But the result that every free module is flat comes very handy in the exercises.   So my question is,     Is it possible to prove that every free module is flat just by   definitions and without appealing to projective modules?   Thanks! Duplicity Backup Browse Prove that, $\binom{3n}{r}=\binom{3n-1}{r} + \binom{3n-1}{r-1}$ Reading through my textbook I came across the following problem and I am looking for some help solving it.  Prove that,  $$\binom{3n}{r}=\binom{3n-1}{r} + \binom{3n-1}{r-1}$$  In a previous problem I solved the following but I wasn't sure how to use it to prove the question above. Prove,  $$\binom{n}{r}=\binom{n}{n-r}$$  Solution:  left Side,  $$\binom{n}{r}=\frac{n!}{(n-r)!r!}$$  right side,  $$\binom{n}{n-r}=\frac{n!}{(n-(n-r))!(n-r)!} = \frac{n!}{(n-r)!r!}$$  Therefore completing the proof,  but how do I solve my first question? thanks! Fullscreen Vista's Command Prompt, or Replacement Who was/were the first Jedi? Why aren't particles constantly "measured" by the whole universe? Let's say we are doing the double slit experiment with electrons. We get an interference pattern, and if we put detectors at slits, then we get two piles pattern because we measure electrons' positions when going through slits. But an electron interacts with other particles in a lot of different ways, e.g. electric field, gravity. Seems like the whole universe is receiving information about the electron's position. Why is it not the case and the electron goes through slits "unmeasured"?  Bonus question: in real experiments do we face the problem of not "shielding" particles from "measurement" good enough and thus getting a mix of both patterns on the screen?