In order to index my collection of tweets I have written this code but an error appears I do not know is what I should initialize a few things, thank you.  public static void main (String args []) throws IOException{         String line;         Gson gson = new GsonBuilder().create();         File f = new File(Constante.DATA);         BufferedReader reader;         Indexer indexer = new Indexer(Constante.INDEX);         int nbrtweet =0, i=0;                 for(File file : f.listFiles())         {                 System.out.println(file.getName());         reader = new BufferedReader( new FileReader(file));         while((line = reader.readLine())!=null){         Tweet tweet;                 try{            tweet = gson.fromJson(line, Tweet.class);            }catch( JsonSyntaxException e){             i++;             continue;                 }         nbrtweet++;         indexer.indexTweet(tweet);                 }   The error shows up on this line:   for(File file : f.listFiles())   and prints  Exception in thread "main" java.lang.NullPointerException     at ApprocheTwitter.src.Indexer.IndexationThematiqueTwits.main(IndexationThematiqueTwits.java:26)
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?
Etymology for “Mc‑” and “O’‑” prefix in surnames There is clearly a prefix in names like McDonald, McChrystal, O’Brian, O’Neal.  What does this Mc- and O- prefix signify? It looks like Donald, Chrystal, Brian, Neal are perfectly fine names on their own, so why is there a prefix before it? Save entire process for continuation after reboot I have a function defined as follows: $f(x,y)= \dfrac{x^2-y^2}{\left(x^2+y^2\right)^2}$, if $(x,y)\neq (0, 0)$ and $f(x,y)=0$ if $(x,y)=(0,0)$.  Now, $$\int_0^1\int_0^1 f(x,y)\,\text{d}x~\text{d}y=-\frac{\pi}{4}$$ and $$\int_0^1\int_0^1 f(x,y)\,\text{d}y~\text{d}x=\frac{\pi}{4}.$$   The question I have is this: why does this not contradict Fubini's theorem?    thanks. How to type a circumflex over a greek letter in text mode? How to get the length of longest string in an array When will SO stop wasting real estate of my screen by having static width layout?  EDIT  It would be very interesting to hear how does Joel, being UI specialist, feel about this. JoelOnSoftware site has fluid layout... The  spell description states:  If a creature is holding or wearing the object and takes the damage from it, the creature must succeed on a Constitution saving throw or drop the object if it can. If it doesn't drop the object, it has disadvantage on attack rolls and ability checks until the start of your next turn...  I am unsure how this disadvantage mechanic functions as a whole. When do you suffer from it and in what ways (if any) can you end it? For example: What happens if you fail the save but cannot drop the object? Does dropping the object later, on your turn, do anything? What happens if you succeed on the save?  Does dropping the object later, on your turn, do anything? I would like it to be assumed that ; however, heat metal can still force you to drop the weapon. I would also like it to be assumed that . How to negate a specific symbol? I want to negate the symbol whose code is \models (this would be specific to Formal Logic). How can I do that? I tried a number of combination, but didn't find how this could be done. I tried \neqmodels, \nemodels, \notmodels, \nmodels  but all of them are wrong.  Is there a general way to negate symbols? Can you triple-boot safely? I´m having some trouble with my udev rule. At the moment, I had my udev rule setup to execute a script whenever a Android phone is connected to any USB port on the computer. But I don´t want the script to be executed from every USB port. I just want that the script to be execute in example when the phone is connected to the 4th USB port and nothing should happen when it is connected to 1st, 2nd or 3rd USB port.  How can I achieve that and how can I determine the for example 4th USB Port?  I would highly appreciate your help.  My current udev rule:  KERNELS="1-2:1.1", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}!="1d6b", ATTRS{idVendor}!="203a", ATTRS{idVendor}=="****", ATTRS{idProduct}=="****", RUN+="/usr/local/bin/tmp.sh $attr{serial}" How to know if a time series is stationary or non-stationary? Limiting double to 3 decimal places How to reinstall yum? I made a big mistake: I removed yum. So now when I for example run the following it gives me an error:  $ yum clean all yum command not found.   I can download the package succesfully:  wget mirror.centos.org/centos/6/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm --2014-01-15 15:42:59--  http://mirror.centos.org/centos/6/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm Resolving mirror.centos.org... 192.133.139.3 Connecting to mirror.centos.org|192.133.139.3|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1019540 (996K) [application/x-rpm] Saving to: “yum-3.2.29-40.el6.centos.noarch.rpm.1”  100%[====================================================================================================================&gt;] 1,019,540    649K/s   in 1.5s  2014-01-15 15:43:01 (649 KB/s) - “yum-3.2.29-40.el6.centos.noarch.rpm.1” saved [1019540/1019540]   Trying to install the downloaded package gives the following error:  # rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm Preparing...                ########################################### [100%]     file /usr/lib/python2.6/site-packages/yum/__init__.py from install of yum-3.2.29-40.el6.centos.noarch conflicts with file from package yum-3.2.29-30.el6.centos.noarch [...] file /usr/share/yum-cli/yummain.pyo from install of yum-3.2.29-40.el6.centos.noarch conflicts with file from package yum-3.2.29-30.el6.centos.noarch   There is no directory "yum" in /usr/bin.  When I use the command "rpm -qa | grep yum".  yum-metadata-parser-1.1.2-16.el6.x86_64 yum-plugin-fastestmirror-1.1.30-14.el6.noarch yum-3.2.29-30.el6.centos.noarch   The distro is CentOS 6.3. How can I reinstall yum? Is ∅ equivalent to {∅}? I think they are, but I am not sure? If anyone could clarify, that would be great. Thank you! Why didn't Gimli know Moria had fallen? What is a Vanilla JS or jQuery solution that will select all of the contents of a textbox when the textbox receives focus? How will learning about philosophy impact real-life? Examining the practical, impactful, real-life benefits of getting a degree in philosophy It is often asked, &quot;What is the practical use of philosophy?&quot; or &quot;How will learning about philosophy impact real-life?&quot; It is easy to see why there is such mystery surrounding the topic. Most schools up through high school may only offer 1 or 2 courses on it, if any. It is also often talked about in general conversation as a &quot;wishy-washy&quot; subject, often negatively, as though it contains no answers but only raises an endless series of questions. To add to this, those who hear of the subject but know very little of it may be surprised to see it offered at their university as a major. It is clear to most why some people would want to major in Computer science, Mathematics, or Physics. But what would a degree in philosophy get you? How to turn off Facebook notifications on Mac OS X? For bash script, I can use "$@" to access arguments. What's the equivalent when I use an alias? Does a particle annihilate only with its antiparticle? If yes, why? Or to put the question another way - what is the result of a proton-positron collision, or an up quark-charm antiquark collision, etc.? As far as I know, annihilation happens only between particles of opposite charge and same mass, but perhaps I am wrong?  And if the types of annihilation mentioned above cannot happen, what are the reasons?