I have following code (coords calculations for grenade trajectory)  public class GrenadeTrajectory {     public int speedValue;     public static boolean shotStart;     public boolean stop;     ArrayList&lt;Integer&gt; xA = new ArrayList&lt;Integer&gt;();     ArrayList&lt;Integer&gt; yA = new ArrayList&lt;Integer&gt;();     Executor executor = Executors.newSingleThreadExecutor();     Worms worms = new Worms();     MapSettings MapSettings;     public void startTask()     {           stop = false;         executor.execute(new Runnable()          {             @Override             public void run()              {                 int TRAJECTORY_STEPS = 10;                 double alpha = 45.0;                 double x0 = MapSettings.mp_player1_weapon_position_x;                 double y0 = MapSettings.mp_player1_weapon_position_y;                 double v0 = 50.0;                 double g = 8.91;                 double c = Math.sqrt(Math.pow((worms.getWeaponDirectionPosition(true) + MapSettings.mp_player1_weapon_position_x), 2));                 double degrees = Math.acos((worms.getWeaponDirectionPosition(true) - MapSettings.mp_player1_weapon_position_x) / Math.pow(worms.getWeaponDirectionPosition(true) - MapSettings.mp_player1_starting_position_x, 2) - Math.pow(MapSettings.mp_player1_starting_position_y - worms.getWeaponDirectionPosition(false), 2));                 double[] arrayX = new double[TRAJECTORY_STEPS];                 double[] arrayY = new double[TRAJECTORY_STEPS];                 for (int t = 0; t &lt; TRAJECTORY_STEPS; t++)                 {                      arrayX[t] = x0+v0*Math.cos(degrees)*t;                     arrayY[t] = y0+v0*Math.sin(degrees)*t-0.5*g*t*t;                     System.out.format("t=%d x=%f y=%f", t, arrayX[t], arrayY[t]);                 }                 Thread.currentThread().stop();               }           });     }     public void setCons(Worms w, MapSettings cfg)     {         xA.clear();         yA.clear();         worms = w;     }     public void stopTask() throws InterruptedException     {              stop = true;      }   }   And I'm getting following errors / exceptions:  Exception in thread "main" java.lang.StackOverflowError     at java.util.concurrent.AbstractExecutorService.&lt;init&gt;(AbstractExecutorService.java:71)     at java.util.concurrent.ThreadPoolExecutor.&lt;init&gt;(ThreadPoolExecutor.java:1305)     at java.util.concurrent.ThreadPoolExecutor.&lt;init&gt;(ThreadPoolExecutor.java:1198)     at java.util.concurrent.Executors.newSingleThreadExecutor(Executors.java:134)     at com.worms.ShotPower.&lt;init&gt;(ShotPower.java:15)     at com.worms.Worms.&lt;init&gt;(Worms.java:31)     at com.worms.GrenadeTrajectory.&lt;init&gt;(GrenadeTrajectory.java:19)   And those exceptions I have there like 1000 times. Error is on line    double c = Math.sqrt(Math.pow((worms.getWeaponDirectionPosition(true) + MapSettings.mp_player1_weapon_position_x), 2));   What am I doing wrong and how can I fix this? Thanks.
What is a StackOverflowError, what causes it, and how should I deal with them?
Why do I get blurry pictures when I take a lens attachment off? Using "nor" in a list without "neither" This is the classic usage of neither/nor:     I would neither hide nor run away.   But is the following construction grammatical? (More than two choices, no neither)     I wasn't going to play dead.   I wasn't going to hide.   Nor was I going to run away. I'm struggling to understand the concept of quantum entanglement. I've distilled my understanding into an analogy, and I need your help to validate it. Here it is:  Let's say I receive two envelopes. Both envelopes have this written on them:     Hello! Open this letter...   If the paper inside is red, then other envelope has blue paper.   If the paper inside is blue, then other envelope has red paper.   So, if I open one letter, and the paper inside is red, then I know the other letter contains the blue paper.  Is this equivalent to quantum entanglement? The fact that I will know the color of the other paper when I open (i.e. observe) one envelope?  In theory, if one of the letters "appeared" in a different galaxy, I would still know the color of the paper inside that letter, just by opening my letter, instantly, correct?  Before I open the letter, is the paper inside each envelope in superposition (??), i.e. 50/50, red or blue?  In this analogy, I am assuming that what's written on the letters is true. Is this a correct assumption in quantum physics? I think so yes?  In real quantum physics, would I be able to change the color of one paper, so that I change the color of the other one? No right? What happens to the holes in the skull where teeth were developing? In Skeptics.SE, a question regarding the skulls of children arose. Depicting a scary skull where the permenent teeth are "hidden" inside the jaws and the milk teeth are in the their place.  After all milk teeth fall out, and the permanent teeth "rise", do the holes left by them filled up, or do we go around with holes in our jaws?    The picture: How do you find the distance from a point to a plane? I am having trouble with this:      Find the distance from the point $(1,1,1)$ to the plane $2x+2y+z=0$.   Any ideas? Thanks. unable to use synaptic via launcher When I open synaptic via launcher on gnome-panel, it opens and asks me for the password but if I enter the password, it says its wrong even though the password is correct and it used to work OK few days ago. If I open synaptic via terminal using sudo synaptic then it opens OK without any problem. Center a column in align I have the following type of code in my document:  \begin{align*}        (-m)+m &amp; \stackrel{\mathrm{Ax 1.1 (i)}}{=}  m+(-m)\\   &amp;\stackrel{\mathrm{Ax 1.4}}{=}  0 \   I want to align on the = but that is complicated by the fact that there is something hovering over it.  It would seem to be easier to align their centers (no matter what, that is where the = will be).  How can I center a column in align (or align* to be honest, I am not that clear on the difference) I need a regular expression to select all the text between two outer brackets.  Example: some text(text here(possible text)text(possible text(more text)))end text  Result: (text here(possible text)text(possible text(more text))) What’s the best way to reload / refresh an iframe? I would like to reload an &lt;iframe&gt; using JavaScript. The best way I found until now was set the iframe’s src attribute to itself, but this isn’t very clean. Any ideas? How can I Have a WPF EventTrigger on a View trigger when the underlying Viewmodel dictates it should? Torus object stretched in array curve modifier I have a chain object. And i have a curve it follows. I got it to work for following curve, but chain object is not circles but both parts are more like stretched circles (ovals). Object i made with 2 toruses one rotated 90 degrees and then joined them together. I tried single torus too. But same issue. on a curve it just looks stretched oval. What can be the issue?   Thanks How do I get the current date and time in PHP? Which PHP function can return the current date/time? The selection toggle arrows in the Outliner disappeared. Is there some preference in the settings that has to be turned on? How do I change the GRUB boot order? I have both Windows 7 and Ubuntu installed on a shared machine. Because a lot of the non-developers use Windows, I'd like to change the boot order to make it easier for them.  Currently the boot order looks like the following:   Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot)  Memory test Memory test Windows 7 on /dev/sda6   How do I change the default order so that Windows 7 is at the top of the list?   Windows 7 on /dev/sda6 Ubuntu 11.10 kernelgeneric *86 Ubuntu 11.10 kernelgeneric *86 (safe boot)  Memory test Memory test What is the advantage on saving the money for the overlord when you have 9 drones, and not filling your supply first and then getting the overlord?  In my theory, in the first case you get to wait the saving time with 9 drones, and get to wait almost the same time with 10 drones in the second case. Second case should be better, since 10 drones mine faster than 9? So why does everybody go with the first case?  All this is assuming you go 12 pool or something like that, where you will get more drones after the overlord. 6- and 8-pools are obviously different. How do I pre-populate a jQuery Datepicker textbox with today's date? Can “due to” and “because of ” be used interchangeably? Is it fine to use due to in place of because of ? How about the other way around? Are any of these sentences ungrammatical?   He was lost because of the storm. He was lost due to the storm. He lost his way due to the storm. He  lost his way because of the storm. Project point onto line in Latitude/Longitude Given line AB made from two Latitude/Longitude co-ordinates, and point C, how can I calculate the position of D, which is C projected onto D.  Diagram: Does C1 code coverage analysis exist for Ruby? I'm currently using  to get C0 code coverage analysis for a rails project that I'm working on.  However, those results are practically meaningless- I have 100% coverage according to rcov (as it only covers C0 analysis) and I've barely written half the test cases for the functionality that exists thus far.  I'm used to the useful results from the code coverage in Visual Studio 2008 Team, which has C1 coverage.  Are there any tools that provide similar coverage for ruby? Footnotes in tables?