This is an employee-management-system. Which has some cool functions(methods)like searching for an employee by the index position, registering users by index position etc. Now at its last functionality, I face a big issue and don't know where the problem could be.   Will share the method and the error message but could also share the whole code if someone is interested, but keep in mind I am sure that it lays somewhere hidden in the method:   public static void sucheL(String[] nN) {         Scanner sc = new Scanner(System.in);         System.out.println("Geben Sie den Text ein: ");         String nn = sc.nextLine();         boolean gefunden = false;         // check for all the entries in nN         // if the entry starts with the entered String or         for (int i = 0; i &lt; nN.length; i++)             if (nN[i].startsWith(nn)) {                 System.out.println("Der Name " + nN[i] + " beginnt mit " + nn);                 gefunden = true;                 // break;                 // if it contains the entered String             } else if (nN[i].contains(nn)) {                 System.out.println("Der Name " + nN[i] + " enthält " + nn);                 gefunden = true;                 // break;             }         if (!gefunden) {             System.err.println("Es wurde kein Name gefunden, der mit dem eingegebenen Text beginnt oder ihn beinhaltet");         } else {             System.out.println("Es wurde mindestens ein Name gefunden, der mit dem eingegebenen Text beginnt oder ihn beinhaltet");         }     }   Error message:  Exception in thread "main" java.lang.NullPointerException     at PersonalVerwaltung.sucheL(PersonalVerwaltung.java:148)     at PersonalVerwaltung.main(PersonalVerwaltung.java:54)
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?
How can I find all files that do NOT contain a text string? What concise command can I use to find all files that do NOT contain a text string?  I tried this (using -v to invert grep's parameters) with no luck:  find . -exec grep -v -l shared.php {} \;   Someone said this would work:  find . ! -exec grep -l shared.php {} \;   But it does not seem to work for me.   has this example:  find ./logs -size +1c  &gt; t._tmp while read filename do      grep -q "Process Complete" $filename      if [ $? -ne 0 ] ; then              echo $filename      fi done &lt; t._tmp rm -f t_tmp   But that's cumbersome and not at all concise.  ps: I know that grep -L * will do this, but how can I use the find command in combination with grep to excluded files is what I really want to know.  pss: Also I'm not sure how to have grep include subdirectories with the grep -L * syntax, but I still want to know how to use it with find :) I am a graduate student of math right now but I was not able to get a topology subject in my undergrad... I just would like to know if you guys know the best one.. It's easy to check that for any natural $n$ $$\frac{n+1}{n}=\cfrac{1}{2-\cfrac{n+2}{n+1}}.$$  Now,   $$1=\frac{1}{2-1}=\frac{1}{2-\cfrac{1}{2-1}}=\frac{1}{2-\cfrac{1}{2-\cfrac{1}{2-1}}}=\cfrac{1}{2-\cfrac{1}{2-\frac{1}{2-\frac{1}{2-1}}}}=\ldots =\cfrac{1}{2-\cfrac{1}{2-\frac{1}{2-\frac{1}{2-\frac{1}{2-\dots}}}}},$$  $$2=\cfrac{1}{2-\cfrac{3}{2}}=\cfrac{1}{2-\cfrac{1}{2-\cfrac{4}{3}}}=\cfrac{1}{2-\cfrac{1}{2-\frac{1}{2-\frac{5}{4}}}}=\cfrac{1}{2-\cfrac{1}{2-\cfrac{1}{2-\frac{1}{2-\frac{6}{5}}}}}=\ldots =\cfrac{1}{2-\frac{1}{2-\frac{1}{2-\frac{1}{2-\frac{1}{2-\ldots}}}}}.$$  Since the right hand sides are the same, hence $1=2$. How do I convert the coordinates of a click to a tilemap position? How do you turn a tilemap (produced by TileD) for cocos2d where I can click on individual items and get a callback?  Is it just a case of converting captured touch and finding out where it is on the tilemap and then converting that to pixels  -- but that doesn't say what item was clicked on.  I have a tilemap of a city with buildings on it, and I'd like to be able to click or press on a specific building, get a callback.  What would be the best way to accomplish this? Occasionally I see an old Meta post that has no status tag (like ), but from the answers it looks like the question is resolved.  Example:  should be  since the answers say HTTP compression actually is enabled.  Is it worth flagging these questions, or is that a waste of time? I can see by manipulating the expression why $\mathbb{E}X$ works out to be $\int_0^\infty 1-F(x)\,dx$, where $F$ is the distribution function of $X$, but what is an intuitive explanation for why that is true? If at each point we sum the probability $\mathbb{P}(X&gt;x)$, why should we end up with the expectation?  Thanks What does why would I do it mean in this context? I've often heard people saying this. And even I say it when someone accuses me of doing something that I didn't do.  I'd say:  Why would I do that?  But what's the grammar behind it?  Is it future from the past tense or something or what? It's obviously not a conditional construction 😒  Context from SE01 EP02 Austin &amp; Ally  Austin: what does the jacket have to do with the music video?  Trish: It's a line in Ally's song, "my jacket's in the lost and found."  Ally: "my jacket"? It says "I like it." The line is "I like it when you hang around."  Dez: "hang around"? I thought it said "kangaroo." ♪ I like it when you kangaroo. ♪.  Ally: Why would I write "I like it when you kangaroo"? At which embassy should I apply for a Schengen visa when staying a few days in several countries? I'm planning to go to Germany on Sept 6-8, then Netherlands on Sept 8-11 and exit Switzerland on Sept 11-14.  My question is:  Which embassy do I need to apply for the Schengen visa? The number of days are the same for Netherlands and Switzerland, but I'm planning to apply in Netherlands since it will be my second point of entry. Why can't you add attributes to object in python? Are there integral solutions to the equation $x^2+y^2-z^2=1$? need a regex to parse a csv file with double quotes in php What are the alternatives to OS X's Spotlight? What can I expect from a Skype interview for PhD admissions? I need to find a way of proving that the square roots of a finite set    of different primes are linearly independent over the field of    rationals.    I've tried to solve the problem using elementary algebra  and also using the theory of field extensions, without success. To  prove linear independence of two primes is easy but then my problems  arise. I would be very thankful for an answer to this question. I want to make a logistic model from my survey data. It is a small survey of four residential colonies in which only 154 respondents were interviewed. My dependent variable is "satisfactory transition to work". I found that, of the 154 respondents, 73 said that they have satisfactorily transitioned to work, while the rest did not. So the dependent variable is binary in nature and I decided to use logistic regression. I have seven independent variables (three continuous and four nominal). One guideline suggest that there should be 10 cases for each predictor / independent variable (Agresti, 2007). Based on this guideline I feel that it is OK to run logistic regression.    Am I right? If not please let me know how to decide the number of independent variables? Resizing an iframe based on content I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes.   How do I resize the iframes to fit the height of the iframes' content?  I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitless so far.  Update: Please note that content is loaded from other domains, so the  applies. The  is minimal and clean on a fresh installation of Windows. Install a bunch of applications and soon the context menu is loaded with all kinds of opening options from various applications.  How do I remove items from the right click (context) menu?  I find that there are different types of right click menu items:   Global items that appear in all context menus. Items that appear only on folders. Items that appear only on files. Items that appear only on special folders (Ex: Right clicking a folder of MP3s shows up a context menu with items like Play with Windows Media Player.) Items that appear only on certain file types (Ex: Right clicking a MP3 file shows up a context menu with items from Windows Media Player/Foobar2000/VLC/your-favorite-media-player begging to open this file.)   I want to be able to delete all these kinds items from the right click (context) menu. Read data from Excel file in Objective-C (iPhone) The origin of spin is some what a puzzle to me, everything spin from galaxies to planets to weather to electrons.  Where has all the angular momentum come from? Why is it so natural?  I was also thinking do photons spin? we always think of the wave as a standard 2d sin wave but could this rotate in 3d? What implications would this have?   And what about spacetime how does all the spinning effect?  This has always been avoided in all lectures and classes I ever went to. Is an empty set equal to another empty set? I have a definition that claims that two sets are equal A = B, if and only if:  $\forall x ( x \in A \leftrightarrow x \in B)$  An empty set contains no elements. If I define the sets:  A = $\emptyset$  B = $\emptyset$  then can I conclude that A $\neq$ B? Since they contain no elements? Or would I have to show that an elements exists in one but not the other? To me it seems that these are not equal, but I'm struggling to wrap my head around this.  Thanks, Paul