When i run my java code:  public class LalaLuLu { public static void main(String[] args) {      try{          String path = "D:/Gem/FINAL/Datatest.csv";         File file = new File(path);         InputStream is;         System.out.println(file.exists());          FileReader fr = new FileReader(file);         BufferedReader br = new BufferedReader(fr);          PrintWriter os = new PrintWriter ( new FileOutputStream("D:/Gem/FINAL/out_datatest1.txt"));         String output = "";         int count = 0;         do{             output = br.readLine();             String[] a = output.split(";");             System.out.println("total kolom: " + a.length);             os.println(output);             System.out.println(count++ );         } while (!output.equals(""));      } catch (Exception e) {         e.printStackTrace();     } } }   When i run, the error on this line :  output = br.readLine(); String[] a = output.split(";");   And error I am getting is:  java.lang.NullPointerException   at DAO.readdata.readdataCSV(readdata.java:47)   Can you tell me how to solve this error? Thank you
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?
$\require{enclose}\enclose{horizontalstrike}{\rm Greatest}\!$ Least prime factor of $n$ is less than square root of $n$, proof I remember reading this somewhere but I cannot locate the proof. Can an html element have multiple ids? I understand that an id must be unique within an HTML/XHTML page.  My question is, for a given element, can I assign multiple ids to it?  &lt;div id="nested_element_123 task_123"&gt;&lt;/div&gt;   I realize I have an easy solution with simply using a class. I'm just curious about using ids in this manner. Finding an isomorphic subring of matrices I'm struggling a fair amount with this exercise:     Find a subring of $M(2,\mathbb{Q})$ which is isomorphic to a) $\mathbb{Q}$ x $ \mathbb{Q}$ b) $\mathbb{Q}$ c) $\mathbb{Q}[x]$/$x^2$   Now I know a subring must be a subgroup, must contain the elements $0,1$ and must be closed under multiplication. As we are looking for isomorphisms then they must also be ring homomorphisms and must be bijective.  I tried to come up with a random subring and attempt to prove it is an isomorphism. E.g $\left\{\left.\begin{matrix}  a &amp; b \\ c &amp; 0  \end{matrix}\right|a,b,c \in \mathbb{Q}\right\}$ is a subgroup of $M(2,\mathbb{Q})$ and then try and show it's an isomorphism. However I'm stuck here as I don't actually know how to go about finding these specific isomorphisms and I completely lose what I'm doing. Any help would be great. How do you do Impersonation in .NET? Is there a simple out of the box way to impersonate a user in .NET?  So far I've been using  for all my impersonation requirements.  Is there a better way to do it by using .NET Framework?  I have a user credential set, (username, password, domain name) which represents the identity I need to impersonate. Is the electric force a vector or a vector field? When did UX start being called UX? When did people start talking about User Experience as a role/domain similar to the way that it's used today?  The earliest reference I can find is the Norman, Miller, Henderson CHI 95 piece on Apple's set up (Donald Norman, Jim Miller, Austin Henderson: What You See, Some of What's in the Future, And How We Go About Doing It: HI at Apple Computer. Proceedings of CHI 1995, Denver, Colorado, USA)  Anything earlier?  [Edit - after @Andrew's nice answer we have 1993 as an earlier date     "I invented the term because I thought Human Interface and usability   were too narrow: I wanted to cover all aspects of the person's   experience with a system, including industrial design, graphics, the   interface, the physical interaction, and the manual." - Don Norman   ]  (I'm writing a talk on communities of practice relating to UX - and want to get my time lines right ;-) A very recent post asking people to go "on strike" was just deleted Integrate $\int \frac{dx}{\sqrt{-ax^2 + bx +c}} $ Question  The test scores of three groups of people are saved as separate vectors in R.  set.seed(1) group1 &lt;- rnorm(100, mean = 75, sd = 10) group2 &lt;- rnorm(100, mean = 85, sd = 10) group3 &lt;- rnorm(100, mean = 95, sd = 10)   I want to know if there is a significant difference in the medians between these groups. I know that I could test group 1 versus group 2 using the Wilcoxon test, like so.  wilcox.test(group1, group2)   However, this compares only two groups at a time, and I would like to compare all three simultaneously. I would like a statistical test that yields a p value at the 0.05 significance level. Could someone please help?  Edit #1 - Mood's median test  Following user Hibernating's suggested answer, I tried Mood's median test.  median.test &lt;- function(x, y){     z &lt;- c(x, y)     g &lt;- rep(1:2, c(length(x), length(y)))     m &lt;- median(z)     fisher.test(z &lt; m, g)$p.value }  median.test(group1, group2)   However, this approach allows me to test for a significant difference between the medians of only two groups at a time. I am not sure of how to use it to compare the medians of all three simultaneously.  Edit #2 - Kruskal-Wallis test  User dmartin's suggested answer appears to be more or less what I need, and allows me to test all three groups simultaneously.  kruskal.test(list(group1, group2, group3))   Edit #3  User Greg Snow helpfully notes in his answer that the Kruskal-Wallis test is appropriate as long as it makes strict assumptions that make it also a test of means. Count number of increasing functions, nondecreasing functions $f: \{1, 2, 3, \ldots, n\} \to \{1, 2, 3, \ldots, m\}$, with $m \geq n$. I stumbled upon a question given like:  Let $m$ and $n$ be two integers such that $m \geq n \geq 1$.   Count the number of functions $$f: \{1, 2, · · · , n\} \to \{1, 2, · · · , m\}$$ of the following two types:  (a) strictly increasing; i.e., whenever $x &lt; y, f(x) &lt; f(y)$, and  (b) non-decreasing; i.e., whenever $x &lt; y, f(x) \leq f(y)$.  I tried in the following way.  For (a). We can say $f(n)&gt;f(n-1)$ AND $f(n)&gt;f(n-2) \ldots f(n)&gt;f(1)$ (total $n-1$ elements)  Similarly for $f(n-1)&gt;f(n-2), f(n-1)&gt;f(n-3) \ldots f(n-1)&gt;f(1)$ (total $n-2$ elements)...  and $f(2)&gt;1$  Like this $$(n-1) + (n-2) + \ldots + (1) = \frac{n(n-1)}{2}$$  Is this correct?  For (b). Since there's equality, it will be $$n + (n-1) + ... (1) = \frac{n(n+1)}{2}$$  Is my approach correct? Any help is appreciated. Thanks in advance. How can I clone an ArrayList and also clone its items in Java?  For example I have:  ArrayList&lt;Dog&gt; dogs = getDogs(); ArrayList&lt;Dog&gt; clonedList = ....something to do with dogs....   And I would expect that objects in clonedList are not the same as in dogs list. There used to be a place where you could buy Stack Exchange branded gear, what happened to it? In Drupal 7, I used the Secure login module to run the site on a secure connection, but it seems it doesn't revert back to http on logout. I would like to just run the whole site as https:// as a simplification.  Is there a simple way to do this without the use of module? Is it possible to add entries to the bibliography based on keyword using Biblatex/Biber and within the document code? I would like to print a bibliography which includes all entries with a certain keyword (and possibly some additional entries).  I know that I can filter by keyword when I print the bibliography using  \printbibliography[keyword=&lt;keyword&gt;]   but this will only print entries which I have cited. I could, of course, use  \nocite{*}   to add all entries to the bibliography and then print just those I want.  However, this will make my .bbl file huge as my database is enormous.  Another possibility is to use Biber or another tool to prepare a document-specific .bib file containing only those entries with the keyword. However, this would need to be recreated if additional entries with the keyword are added to my main database files.  Here's an MWE to play with, annotated to indicate the way I'd like it to work ;), and the disadvantages of the way it (almost) works.  The issue of excluding explicitly cited entries is less of an issue for me. The thing I'd really like to work around is adding the entire database contents to the .bbl.  \RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @book{new-stuff,     author          =   {Watt, Brian},     title           =   {Happy Times with Penguins},     publisher       =   {Harvard University Press},     address         =   {Cambridge, MA},     year            =   1995,     pagination      =   {section},     keywords        =   {happy}} @book{den-coll,   author                =   {Till, Jr., Dennis E.},     booktitle           =   {Penguin Land and Further North: Human Influence},     title               =   {Penguin Land and Further North: Human Influence},     publisher           =   {Oxford University Press},     year                =   2008,     address             =   {Oxford and New York},     keywords            =   {penguin, human}} @book{old-stuff,   author                =   {Harvey, Jr., Dennis E.},     booktitle           =   {Penguin Land and Further North: Human Influence},     title               =   {Penguin Land and Further North: Human Influence},     publisher           =   {Someone \&amp; Daughters},     year                =   1567,     address             =   {Oxford},     bookpagination      =   {paragraph},     keywords            =   {penguin}} \end{filecontents} \documentclass{article} \usepackage[defernumbers=true]{biblatex} \bibliography{\jobname} \begin{document}  \cite{old-stuff}  % what I would like to work % \nocite[keyword=happy] % \printbibliography  % what does work - except that \cite{old-stuff} is ignored and, more importantly, den-coll is added to the .bbl \nocite{*} \printbibliography[keyword=happy]  \end{document} How to find the most famous questions on Stack Overflow? How to find questions with   most comments most votes most viewed   I have seen following question, but seems like there is no easy way.   Is there way to bookmark a page so that the same URL can be used to update data (which will be very seldom) at each hit? I am new to TeX/LaTeX. How do I install TeX on Windows (7)? It seems that there are many different implementations, so which one is best for my OS? Do I need a RHEL subscription to install packages? Is there a streaming API for JSON? How to call child component controller function/helper from Parent Component Controller Who is blowing the horn to alert the Night's Watch?