I am trying to use my function to check if I have a certain value in a text file and I am having a issue with my code. My Boolean is not picking up the values that I declared in my while loop. My code is below.  public static Boolean isValueExistant(String value) throws FileNotFoundException {     Scanner scanner = null;     Boolean h = null;     scanner = new Scanner(responses);     while (scanner.hasNextLine()) {         String lineFromFile = scanner.nextLine();         if(lineFromFile.contains(value)) {             h = true;             break;         } else {             h = false;             break;         }     }     return h; }   Calling function:  private static String askMessage() throws FileNotFoundException {         if(FileUtils.isValueExistant("Value name = ")){             String f5 = FileUtils.getValue("Value name = ");             System.out.print(f5.replaceAll("Value name = ", "")+": ");         }else if(!FileUtils.isValueExistant("Value name = ")){             System.out.print("You: ");         }     String input = sc.nextLine();     return input; }   I just get a NullPointerException on my Boolean because it isn't changing from the null value to the true or false. Thanks 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?
Argument list too long error for rm, cp, mv commands How to set the font for a \section title (and chapter etc) How do I specify the fonts, and general font size, for the titles, chapters and sections in my document  Update:  I can see how my question is confusing.  I use \section and \chapter etc. to organise my document, and I would like to change the way the section and chapter titles are displayed. Can someone please give me the prerequisites and mathematics required for string theory? Are there some good references to study it, both online and in a book? Please consider I am a newbie in string theory, and only about up to the level explained in Hawking's Brief History of Time and Penrose's Road to Reality. I would prefer something which does not omit rigor, but builds it up.Also, are there good online lectures on this?  (I have covered most of GR, but I am not really comfortable with advanced Quantum mechanics. I have studied QM only from Griffith's book, and a few McGraw hill lecture notes.) Replace non-numeric with empty string Quick add on requirement in our project.  A field in our DB to hold a phone number is set to only allow 10 characters.  So, if I get passed "(913)-444-5555" or anything else, is there a quick way to run a string through some kind of special replace function that I can pass it a set of characters to allow?  Regex? How to save/restore Sublime Text 2 configs/plugins to migrate to another computer? "Recent Badges" list is displayed without margins on "Home" page When the &quot;Hide Hot Network Questions&quot; preference is enabled (i.e. HNQ sidebar is hidden), we see &quot;Recent Tags&quot; and &quot;Recent Badges&quot; in the homepage instead of the HNQ. However, the &quot;Recent Badges&quot; list is displayed with no margins. ex.)   I think that the appropriate margins were set in the past. cf.) Can space expand with unlimited speed? just after the Big Bang and before inflation the currently observable universe was the size of a coin. One millionth of a second later the universe was the size of the Solar System, which is an expansion much much faster than speed of light. Can space expand with unlimited speed? Possible Duplicate:          Is there some rule governing the following, or similar, subject-auxiliary inversions (*"Rarely they do see the light of day", *"Never I have been so insulted")?     In fancy sit-down restaurants, you can order a large meal and halfway through the main course, take a little dead cockroach or a piece of glass out of your pocket and place it deftly on the plate. Jump up astonished and summon the headwaiter. "Never have I been so insulted. I could have been poisoned" you scream slapping down the napkin. You can refuse to pay and leave, or let the waiter talk you into having a brand new meal on the house for this terrible inconvenience. ()      Rarely do they see the light of day; it's generally judged to be in no one's commercial interest that they should. Just occasionally, however, like a seemingly dormant volcano, they explode into the open. () Can't use method return value in write context How does remittance work? How does it differ from direct money transfer? I have a bank account in Germany in which I receive my salary in Euros. I want to deposit a part of it in my Indian bank account for personal savings. My Indian bank account is in INR. As I see it, I have two options:   To use a remittance service that converts my Euros into INR and deposits in my account. I am not sure how it works. The service (which I know is reliable) I signed up for asks me to deposit Euros in a certain account ("funding") which will be converted to INR and deposited in my account. How does that work exactly? Use my bank's service to make a international bank transfer to my account. Is that even possible, given that my Indian account is in INR? Will I incur higher conversion fees and lower exchange rate?   In general, what are the pros and cons of each of the above methods? And are there any other methods? When applying for post-doctoral and faculty positions you are typically asked for three (sometimes more) reference letters to support your application.    Given that it is competitive out there, it also makes sense to apply for all positions that are good matches to your qualifications and career development goals (in the case of post-docs).  Sometimes this may mean asking for several reference letters (or pre-application "can you support me if required?" requests) in a short space of time.  Also, there may only be a small pool of people (i.e. 3 or 4) who know your work sufficiently well to give an excellent reference.  I have also been told that referees want to help you out, and that there is no reason to fear asking them.  And, that in many cases once a letter is written it can typically be quickly repurposed.  But there must be a breaking point.  How do I manage this without being disrespectful?  How many requests in a given unit of time is too many, or harms my credibility?   I am asking this question in this forum, as I am interested in the norms in the academic world, which are often somewhat different than the rest of the working world. I am looking for an Ubuntu version that consumes less Memory and CPU. I have read both Lubuntu and Xubuntu (The homepages, wikipedia, phoronix and other sites comparing both). But from experience, which one uses less memory and is less CPU intensive. I need to install them in very old hardware and want to persuade the owner of the hardware of the benefits of Ubuntu.  in this case I want to install 11.10 or 12.04 when it comes out. How are each behaving in those versions?  The 2 PCs I will be installing either Xubuntu or Lubuntu are:  Granpa PC:  CPU - Pentium 2 450Mhz RAM - 64MB DIMM Video - 16MB Used for - Documents and Internet. No listening to music, no looking at videos. Just using it for document writing.  The other old meat:  CPU - Pentium 3 550Mhz RAM - 128MB DIMM Video - 16MB Used for - Documents and Internet also but they want.. or maybe they are wishing for it to use it to see movies and listen to music. This one has internet. The other one does not.  UPDATE  Wanted to update this question with the test results for over 8 months worth of using Lubuntu and Xubuntu. When it comes to very old hardware, am talking about 64 MB, 128 MB or even 256 MB of RAM computers, Lubuntu is better than Xubuntu when comparing Memory usage. When it comes to CPU usage, both are the same.  This will not improve I/O Disk performance which will be the bottleneck for old computers. Also the difference in performance between Xubuntu and Lubuntu is about 10% to 20% percent in memory usage. Again, CPU usage is the same.  Now, when it comes to how responsive the Desktop is, LXDE (Lubuntu) has a much better response time than XFCE (Xubuntu). I would say about 50% or just simply noticeable to the eye. Lubuntu is similar to how Windows XP looks while Xubuntu is more like how Gnome 2 looked.  The computers (The old ones mentioned here) and 2 more are still working in excellent conditions thanks to the Ubuntu family. I also want to add I am using 13.10 for both distros. When you watch a video in YouTube, you can seek it with the thumbnail preview. Many Windows' and MacOS' video players have this feature, but what about Linux's? I've already read , but the information in it seems out-of-date.  is still alive but the project is neglected (see ), and actually the player doesn't work on the latest Ubuntu or Linux Mint.  Is there any video player which has the feature and works on the latest linux distributions? Or must I use Windows' one with VirtualBox? If only VLC would implement this feature, but it seems that won't happen as far as I read .  YouTube's seek preview: recursive statistics on file types in directory? I did a website scrape for a conversion project. I'd like to do some statistics on the types of files in there -- for instance, 400 .html files, 100 .gif, etc. What's an easy way to do this? It has to be recursive.   Edit: With the script that maxschelpzig posted, I'm having some problems due to the architecture of the site I've scraped. Some of the files are of the name *.php?blah=blah&amp;foo=bar with various arguments, so it counts them all as unique. So the solution needs to consider *.php* to be all of the same type, so to speak. Is it possible to find power armor in the wasteland? LCM. What am I missing? Problem statement:  Let $S$ be the set of all positive integers $n$ such that $n^2$ is a multiple of both $24$ and $108$. Which of the following integers are divisors of every integer $n$ in $S$? The choices are: $12, 24, 36, 72$. The solution is $12$ and $36$. My solution was $S = \{36, 36* 6^3, 36*6^5, ...\}$  I can't figure out this problem. I started by finding the $\text{lcm}(24,108)$ and solved for $n$. I got some of the numbers in the set $S$, but not all of them, and I don't see what I'm missing. Update: added the choices and what my results Can't Open files from a directory in python Why does virtualbox only have 32-bit option, no 64-bit option on Windows 7? I have downloaded and installed the newest  for my Windows 7 (64-bit OS), but when I want to install 64-bit Linux, the New->Create Virtual Machine only displays 32-bit option, no 64-bit option. Could anyone give any clues about this issue? Thanks very much in advance! Citrix receiver error 1000119 I am trying to run Citrix receiver on the Xenial version of Ubuntu, but I am getting this error below  ERROR: Cannot connect to &quot;0.0.0.2 - Remote Desktop Connection&quot; Unknown error 1000119. Verify your connection settings and try again.  What should I do? What level should I be to kill Alduin I am level 31 and I have the Elder Scroll. I am not sure if my level is high enough to go to Whiterun and trap one of Alduin's minions. What level should I be before I attempt it?