I'm looking for the equivalent word in the dabase by the ContextQuery method, and when a equivalent word is null the program must try to use the next index from words and add it up to the current to make it a two word, if the two word is still null the program will make it a three word looking for the next 2 values. And i'm getting a NullPointerException everytime      for (int i = 0; i &lt; words.size(); i++)       {                      try {             temp = QueryWithContext.query(words.get(i));             if(temp == null &amp;&amp; temp.isEmpty() &amp;&amp; words.size() &gt;= i+1)             {             QueryWithContext.query(words.get(i)+" "+words.get(i+1));             temp = QueryWithContext.query(words.get(i)+" "+words.get(i+1));                 if(temp == null &amp;&amp; temp.isEmpty());                     {                     temp = words.get(i);                     }             }             else if(temp == null &amp;&amp; temp.isEmpty() &amp;&amp; words.size() &gt;= i+2)             {                 temp = QueryWithContext.query(words.get(i)+" "+words.get(i+1)+" "+words.get(i+2));                 if(temp == null &amp;&amp; temp.isEmpty());                 {                 temp = words.get(i);                 }             }                System.out.println(temp);             holder = holder +" "+ temp;             counter++;       }
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?
Why can't we use double pointer to represent two dimensional arrays? Why won't Nikon B700 focus close when fully zoomed? Hello recently I went to best buy and played with a Nikon B500, it was great. I was able to focus on the smallest things, close or far, zoomed all the way in and all the way out. So I went on the internet and found out that the B700 shoots in raw so I got it instead thinking it was better. Only I cant get it to focus on anything close up, weather in macro or not after like 25% zoom it no longer focuses on anything no matter what settings I put it on leaving me to think that I should have gotten the cheaper B500. It may not shoot in raw but at least it would be usable. I am fairly new to photography I had a friend with much more experience come over and try to figure it out. He told me that my camera has a range that it is able to focus on. Only the cheaper B500 focused on things way more zoomed in and with the camera much closer to the object so it doesn't make much since to me. So my question is why wont my camera focus on macro shots (weather in macro or not)? Where do the X-Men get all their money/funding? Charles Xavier's father was a "wealthy nuclear scientist". In the beginning, Charles personally bankrolled the Xavier Institute/X-Men using his family's money.   This included, but was not limited to things like upgrading the mansion to house the training levels, providing a helicopter (the predecessor to the Blackbird jet), providing and replacing uniforms, providing health care for injured students, and rebuilding/repairing the mansion and parts of the Danger Room  repeatedly.  These have all been recurring costs. The mansion has been damaged or outright destroyed a ridiculous number of times. X-Men can't get into a fight without someone's uniform getting damaged.   In one of the more recent stories (I believe it was an early issue of Wolverine &amp; The X-Men), a comment is made about how the X-Men are pretty much bankrupt.  Where has all this money come from over all these years?   Xavier may have had a large war chest to start with, but no other income has ever been mentioned to my knowledge. Student's tuition could account for some of it, but there's no way that's going to fund everything. How do I efficiently iterate over each entry in a Java Map? What kind of ring $R$ makes $\mathcal O(\mathrm{Proj}\,R[x_0,\cdots,x_n])=R$? Zip all files in directory? Is there a way to zip all files in a given directory with the zip command? I've heard of using *.*, but I want it to work for extensionless files, too. Choosing whether to include PDF or PNG in PDFLaTeX Can I tell graphicx somehow which graphic format to choose when I omit the file extension in includegraphics and both a PDF and a PNG version of the same image exist? The reason is that I have some very large PDF vector graphics (in terms of file size/drawing primitives) that take a pretty long time to load each time I view the document. I would like to convert them to PNGs while working on the document and only use the PDF versions in the final document. Therefore, a global option that I can switch in the end would be great.  An additional plus would be to do the conversion to PNG on the fly during the LaTeX run if there is a PDF that has not been converted to PNG yet, if a tool for that exists. (I know how to use convert, but not how to include it automatically in LaTeX.) Prove $\mathbb{Z}$ is not a vector space over a field This is an exercise from Chapter 3 of Golan's linear algebra book.  Problem: Show $\mathbb{Z}$ is not a vector space over a field.  Solution attempt:  Suppose there is a such a field and proceed by contradiction. I will write multiplication $FV$, where $F$ is in the field and $V$ is an element of $\mathbb{Z}$.   First we rule out the case where the field has characteristic 2. We would have   $$0=(1_F+1_F)1=1_F1+1_F1=2$$  a contradiction.  Now, consider the case where the field does not have characteristic 2. Then there is an element $2^{-1}_F$ in the field, and   $1=2_F(2^{-1}_F1)=2^{-1}_F1+2^{-1}_F1$  Now $2^{-1}_F1\in\mathbb{Z}$ as it is an element of the vector space, but there is no element $a\in\mathbb{Z}$ with $2a=1$, so we have a contradiction.  Is this correct? Program does not wait before output PHP replaces spaces with underscores In course of evolution (possibly), mammary glands became vestigial in male mammals, but became fully developed in females. Is there any plausible explanation for this characteristic? What leads to the existence of critical temperature? We know that $T_c$ is the temperature above which no amount of pressure could force a gas to liquefy. But why is this? Somehow I don't buy the point that the gas molecules exert too much pressure back to get close and turn into a liquid. If we had tens of thousands of atmosphere pressure (such as on the inside of hot planets), we should be able to liquefy any gas at any temperature. How do I make a textbox that only accepts numbers? How can one motivate the relativistic momentum? Motivating the non-relativistic momentum $$\mathbf{p} = m\mathbf{v}$$ is quite easy: it is meant to represent the quantity of motion of the particle, and since the mass is one measure of quantity of matter it should be proportional to mass (how much thing is moving) and should be proportional to velocity (how fast and to where it is moving). Now, in Special Relativity the momentum changes. The new quantity of motion becomes $$\mathbf{p} = \dfrac{m\mathbf{v}}{\sqrt{1-\dfrac{v^2}{c^2}}}$$ Or, using $\gamma$ the Lorentz factor $$\mathbf{p} = \gamma(v) m\mathbf{v}$$ where I write $\gamma(v)$ to indicate that the velocity is that of the particle relative to the frame in which the movement is being observed. The need for this new momentum is because the old one fails to be conserved and because using the old one in Newton's second law leads to a law which is not invariant under Lorentz transformations. So the need for a new momentum is perfectly well motivated. What I would like to know is how can one motivate that the correct choice for $\mathbf{p}$ is the $\gamma(v)m\mathbf{v}$. There are some arguments using the mass: considering a colision, requiring momentum to be conserved, transform the velocity and then find how mass should transform. Although this work, it doesn't seem natural, and it is derived in one particular example. On my book there's even something that Einstein wote saying that he didn't think it was a good idea to try transforming the mass from $m$ to $M = \gamma(v)m$, that it was better to simply keep $\gamma$ on the new momentum without trying to combine it with the mass. So I would like to know: without resorting to arguments based on transformation of the mass, how can one motivate the new form of momentum that works for special relativity? I'm very new to presentations in LaTeX (I've been using PowerPoint for years but have finally converted). I am wondering how to get a GIF into a section. If need be, I can convert a GIF into lots of pictures and have them overlay to give the impression of movement. How does the NSAutoreleasePool autorelease pool work? As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example:  int main(void) {     NSString *string;     string = [[NSString alloc] init];     /* use the string */     [string release]; }   My question, though, is wouldn't this be just as valid?:  int main(void) {     NSAutoreleasePool *pool;     pool = [[NSAutoreleasePool alloc] init];     NSString *string;     string = [[[NSString alloc] init] autorelease];     /* use the string */     [pool drain]; } We are Indian passport holders, with valid visas for Canada. Plan is to take the EgyptAir flight Mumbai to Toronto, via Cairo. Problem is Egypt embassy website says we don't need Transit Visa if transit is up to 12 hours but here transit is 14 hours.    Has anyone with a Indian passport traveled this route? What was your experience at Cairo? Did you need a transit visa? Adding Vertical Reference in Python to ArcGIS feature dataset I want to ask a question about modular arithmetic. I know, that modular multiplicative inverse exists only if modulo and integer are relatively prime. I want to know, are there any ways of division in modular arithmetic, if modulo and integer aren't relatively prime? I tried to find info about that, but failed. How can I know if my post(comment, answer, question) was Flagged? Is it possible to see if my post was flagged. The only way as I see it, if you see your post has got deleted, them may be someone might have flagged it for moderation. But is there other way to see if your post was flagged for moderation.   I am wondering if someone's is repeatedly flagged for posts, maybe he can be assigned a badge(bad one :) )  But right now, I want to know if it is possible to see how many posts of mine were flagged.