I have some values i have stored in mysal table. basically, they are some strings that hold the value up or down.  I want to fetch the data in my table and compare if they are equal to up or down  This is the code  String up = "up"; String down = "down";  @SuppressWarnings("deprecation") Query query = currentSession.createSQLQuery(            "select * from trades where trade_session_status=:trade_session_status AND trade_profit_worker_status=:trade_profit_worker_status"); query.setParameter("trade_session_status", "DONE"); query.setParameter("trade_profit_worker_status", "UNDONE"); @SuppressWarnings("rawtypes") List &lt; Object[] &gt; result = query.list();  for (Object[] objects: result) { Integer id = (Integer) objects[0]; String trade_prediction = (String) objects[10]; String trade_result = (String) objects[11];   if(trade_prediction.equals(up) &amp;&amp; trade_result.equals(up)) { }   The code works and i can test if the strings are equal but somewhere down the line, i get an error on this line   if(trade_prediction.equals(up) &amp;&amp; trade_result.equals(up)) {   but the program still works.  I get this error     SEVERE: Unexpected error occurred in scheduled task.   java.lang.NullPointerException           at com.boilerplate.components.Scheduler.profit_cron(Scheduler.java:396)   This is the line 396     if(trade_prediction.equals(up) &amp;&amp; trade_result.equals(up)) { }   What could be causing the error?
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?
Let $q_1,q_2,q_3,q_4$ be orthonormal vectors in $\mathbb{R}^4$,$z_1,z_2,...,z_6$ orthonormal vectors in $\mathbb{R}^6$ and $A=z_1q_1^T + z_2q_2^T$. Let $q_1,q_2,q_3,q_4$ be orthonormal vectors in $\mathbb{R}^4$,$z_1,z_2,...,z_6$ orthonormal vectors in $\mathbb{R}^6$ and $A=z_1q_1^T + z_2q_2^T$.  a) Find the base and dimension of fundamental subspaces of matrix A  b) Using the results given by a) find the general solution for $Ax - z_1$.  Any hint would be appreciated. How to enable projection transformation in QGIS How can I disable the Windows key from opening the Activities overview? How can I disable the Windows key (or Super) from showing the GNOME Shell Activities overlay? When I created my account, I used Facebook Connect as my only login type and I can only log in to my account using it.  I wish to create a Stack Exchange login to be able to log in with instead of Facebook Connect, but I can't find how to do this. It seems that the option for creating a Stack Exchange login is only present when creating a new account? Motivation: I once had one surplus card on my hand, and knew the robbers would come soon. So I gave it to someone for free, to avoid losing more cards when they hit. I was surprised by how badly this was received. Two of the three other players (the hosts of the game) acted upset, like I had tried to cheat. I had to take the card back, get robbed the next turn and 'giving cards away for free' was banned immediately. (Oh, how I hate mid-game additions to the rules. But that's beside the point.)  So now the question: Is this really illegal in Settlers of Catan? Is it generally considered underhanded in any way? If so, why?   My reasoning was like this:        Consider players A and B.   A wants to give B a sheep.   A trades a sheep and one rock to B, in exchange for wheat.   A trades the received wheat for the (formerly his) rock.   A and B now both have the same resources they had in the beginning, only the sheep has moved from A to B. This was talked about a few podcasts ago. And they referenced some other site that does this.  Currently location is a string but adding a country dropdown (and for the usa a state drop down) could be a great addition to the site.  Then allow for user filtering by country / state. How do I stop Illustrator from snapping to pixel increments? I am working in Illustrator (15.0.2 (CS5) or 16.0.0 (CS6)) and when I try to move objects small distances, they snap to the nearest two pixels on some invisible grid. I can't find anything in the preferences. Here are some screen shots: Difference between 'struct' and 'typedef struct' in C++? I cannot easily figure out which one is more appropriate to use:     It's important to me.        It's important for me.   Are they the same? If not, what's the difference? Getting a stack overflow exception when declaring a large array Reviewing suggested edit of own post after completing 20 reviews I've completed 20 suggested edits reviews today. Then, I came across a  and I approved it.   Then, I had a doubt that whether the review count has incremented or not, oh! it's not incrementing. System works fine.  But, take a look at review page,     The edit was already reviewed by one reviewer and then I reviewed it. As I'm the Owner of the post it's enough to approve the edit. But, the review history doesn't show the detail that I had approved it. It's misleading that only one vote of a reviewer who is neither the community user nor the OP nor the moderator, is enough.  So, what should we do in this type of situation?  Is it correct to make OP to review the suggested edit after completing daily limit?  Should we need to display/hide the OP has approved the edit in the review history? We know that some people were aware of the fact that Lord Voldemort was Tom Marvolo Riddle prior to his return in Goblet of Fire; at the very least his close soon-to-be-Death-Eater &quot;friends&quot; and Albus Dumbledore:  “Very few people know that Lord Voldemort was once called Tom Riddle. I taught him myself, fifty years ago, at Hogwarts...&quot; ... underwent so many dangerous, magical transformations, that when he resurfaced as Lord Voldemort, he was barely recognizable. Hardly anyone connected Lord Voldemort with the clever, handsome boy who was once Head Boy here.” (Professor Dumbledore to Weasleys, Chamber of Secrets, CHAPTER EIGHTEEN, Dobby’s Reward)  and  “Voldemort,” said Riddle softly, “is my past, present, and future, Harry Potter…” He pulled Harry’s wand from his pocket and began to trace it through the air, writing three shimmering words: TOM MARVOLO RIDDLE Then he waved the wand once, and the letters of his name rearranged themselves: I AM LORD VOLDEMORT “You see?” he whispered. “It was a name I was already using at Hogwarts, to my most intimate friends only, of course. ...  (Tom's Diary manifestation in the Chamber of Secrets).  QUESTION: Who - based on canon (books/interviews/pottermore) - knew about the fact that Lord Voldemort was Tom Marvolo Riddle prior to Ginny being taken to the Chamber of Secrets? Obviously, Albus Dumbledore and Tom himself. Who else? Example (note the case):  string s = "Hello world!"; String s = "Hello world!";   What are the guidelines for the use of each? And what are the differences? Why is energy in a wave proportional to amplitude squared? I'm a mathematics student trying to grasp some basics about wave propagation. A sentence I find very often in introductive physics textbooks is the following:      In a wave, energy is proportional to amplitude squared.   This is something I would like to understand better in the case of mechanical (linear) waves.  The simplest model is the vibrating string of mass density $\mu$ and tension $T$: here an element of string of rest length $dx$ and vertical displacement $y(x, t)$ possesses a kinetic energy $\frac{1}{2}\mu dx \left( \frac{\partial y}{\partial t}\right)^2$ and a potential elastic energy $\frac{1}{2}T dx \left( \frac{\partial y}{\partial x}\right)^2$. So we have the total energy   $$dE=\frac{1}{2}\mu dx \left( \frac{\partial y}{\partial t}\right)^2+\frac{1}{2}T dx \left( \frac{\partial y}{\partial x}\right)^2,$$  which completely explains the sentence. Can we obtain a similar formula for higher-dimensional waves? How should I modify the above formula for a (simplified model of an) elastic membrane, for example? I would expect something like   $$dE=\text{some constant}\left(\frac{\partial z}{\partial t}\right)^2+\text{some other constant}\left\lvert\nabla z\right\rvert^2,$$  where $z=z(x, y, t)$ is the vertical displacement. Am I right? Sending form POST request to PHP How to show that $\mathbb{Q}$ is not $G_\delta$ I read a section of a book and it made mention of the set of rationals not being a $G_\delta$. However, it gave no proof. I read on  about using contradiction, but it made use of the Baire category theorem, which is unfamiliar to me. I was wondering if anyone could offer me a different proof; perhaps using the fact that the complement of $G_\delta$ is $F_\sigma$.  Thanks. I know the usage of     This is a new car.   This is singular.     These are some books for you.   These is plural.  Shall we use   There exists some people who agree with me. There exist some people who agree with me.   Which one is the correct usage and why? If there are 5 points on the surface of a sphere, then there is a closed half sphere, containing at least 4 of them.  It's in a pigeonhole list of problems. But, I think I have to use rotations in more than 1 dimension.  Regards What is the word for the order of succession in which son assumes the throne after father? It can be any son-younger son after elder son after father. Also, what can be the term for only a single family in power? Please answer. $\sum_{n=-\infty}^{\infty}\frac{1}{(n+\alpha)^2}=\frac{\pi^2}{(\sin \pi \alpha)^2}$?