public void traverseRowLR(String [] list, String [] key, String pool)    {        pool = "left to right";       ArrayList&lt;Location&gt; obj = new ArrayList&lt;Location&gt;();       for(int i = 0; i&lt;key.length; i++)       {          for(int a=0;a&lt;list.length;a++)             if(list[a].indexOf(key[i])&gt;-1)                finalList.add(new Location(key[i],a+1,list[a].indexOf(key[i]),pool));               }     }   That above is the method. The error is on the line of the second for loop.  Heres another place the error is mentioned:   public MazeAH(String [] key, String [][] wordBank)    {       maze = wordBank;       answer = key;     }   //other methods      public ArrayList&lt;Location&gt; solve()    {         mergeRow(maze, rowWords);       mergeCol(maze, colWords);          traverseRowLR(rowWords, answer, horizontal);       traverseRowRL(rowWords, answer, horizontal);       traverseRowTB(colWords, answer, vertical);       traverseRowBT(colWords, answer, vertical);        return finalList;    }         The error is in the line:   traverseRowLR(rowWords, answer, horizontal);   Finally, heres the driver program, sorry if im posting too much code, im not sure what's necessary: The goal of this program is to merge rows and columns together into Strings, and then search for words in the "key" word bank. I originally completed this project using non-void methods, but my professor wants me to redo it with void methods.  import java.util.*;  public class SolveWordSearchAH {     public static void main(String [] args)    {        String [][] letters = {{"e","p","l","i","r","q","k","o","s","a"},                         {"u","k","i","e","s","y","x","c","n","f"},                         {"c","p","o","z","g","f","q","a","y","r"},                         {"p","e","m","c","z","a","n","t","e","i"},                         {"g","u","g","q","t","a","b","r","h","e"},                         {"g","i","q","v","b","e","d","b","s","s"},                         {"c","o","f","f","e","e","i","l","r","q"},                         {"h","r","e","t","a","w","b","d","e","l"},                         {"y","q","o","k","w","v","p","x","h","z"},                         {"c","d","n","t","f","q","k","b","p","w"}};        String [] key = {"coffee", "water", "taco", "hershey", "fries"};       //can have another key array if needed-depends on your implementation        MazeAH m=new MazeAH(key, letters);       ArrayList&lt;Location&gt; answer=m.solve();       System.out.println(answer);     } }    My variables are declared here:  private ArrayList&lt;Location&gt; finalList = new ArrayList&lt;Location&gt;();    private String [][] maze;    private String [] answer;    private String vertical="";    private String horizontal = "";     private String [] rowWords;    private String [] colWords;   Here is the error in the compile log:  Exception in thread "main" java.lang.NullPointerException     at MazeAH.mergeRow(MazeAH.java:117)     at MazeAH.solve(MazeAH.java:26)     at SolveWordSearchAH.main(SolveWordSearchAH.java:24)   Heres MergeRow:   public void mergeRow(String[][] letters, String [] words)    {       String []temp = new String [letters.length];       for(int i=0; i&lt;letters.length; i++)       {          temp[i]="";          for(int a=0; a&lt;letters[0].length; a++)          {             temp[i]+=letters[i][a];          }       }       for(int s = 0; s&lt;temp.length; s++)       {       temp[s] = words[s];       }     }   Heres the updated trace:  Exception in thread "main" java.lang.NullPointerException     at MazeAH.mergeRow(MazeAH.java:117)     at MazeAH.solve(MazeAH.java:26)     at SolveWordSearchAH.main(SolveWordSearchAH.java:24)
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?
I'm using R(3.1.1), and ARIMA models for forecasting. I would like to know what should be the &quot;frequency&quot; parameter, which is assigned in the ts() function, if im using time series data which is:  separated by minutes and is spread over 180 days (1440 minutes/day) separated by seconds and is spread over 180 days (86,400 seconds/day).  If I recall right the definition, a &quot;frequency&quot; in ts in R, is the number of observations per &quot;season&quot;. Question part 1: What is the &quot;season&quot; in my case? If the season is &quot;day&quot;, then is the &quot;frequency&quot; for minutes = 1440 and 86,400 for seconds? Question part 2: Could the &quot;frequency&quot;  also depend on what I am trying to achieve/forecast? for example, in my case, I'd like to have a very short-term forecast. One-step ahead of 10minutes each time. Would it then be possible to consider the season as an hour instead of a day? In that case frequency= 60 for minutes, frequency = 3600 for seconds? I've tried for example to use frequency = 60 for the minute data and got better results compared to frequency = 1440 (used fourier see link below by Hyndman)  (The comparison was made by using MAPE for the measure of forecast accuracy) In case the results are complete arbitrary, and the frequency cannot be changed. What would be actually the interpretation of using freq = 60 on my data? I also think it's worth mentioning that my data contains seasonality at every hour and every two hours (by observing the raw data and the Autocorrelation function) If $\sin \theta+\cos\theta+\tan\theta+\cot\theta+\sec\theta+\csc\theta=7$, then $\sin 2\theta$ is a root of $x^2 -44x +36=0$ My own bonafide attempt. $$ 0&lt;\theta&lt;\pi/2$$   and $$\sin\theta+\cos\theta+\tan\theta+\cot\theta+\sec\theta+\csc\theta=7$$   then show that $\sin 2\theta$ is a root of the equation $$x^2 -44x +36=0$$   I tried to use the above given equation of all the trigonometric ratios, though I ended up with an expression of $\sin\theta\cos\theta$.   But this too is in the form of $\sin\theta$ and $\cos\theta$ which was $\sin\theta\cos\theta=\frac{1}{6-\sin\theta-\cos\theta}$.  When I put that in the quadratic equation, it would again transform into the form of $\sin\theta$ and $\cos\theta$, and hence at last I couldn't prove the thing.  Even hints would work, as I would like to solve the question myself. When voting to migrate an off-topic question, why is the list of sites limited? Earlier, I voted to close  as off-topic.  The question has since been closed.  There is an , but it didn't show up in the list when I selected "off-topic".  The options were:   Meta Stack Overflow Server Fault Super User Webmasters Programmers   Questions:   Should Wordpress appear in this list? Are there any other sites that should appear in the list?   Should all non-beta sites appear in that list by default? LIGO flawed by the identical expansion of laser wavelength and arms in presence of a gravitational wave? , Laser Interferometer Gravitational-Wave Observatory, is a large-scale physics experiment aiming to directly detect gravitational waves. The device measures the phase shift laser beams.  If I understand this well, the measurement assumes that a suitable gravitational wave reduces and prolongs one of the tubes and the extension will take effect in the phase-shifting laser beams.  But I think if there's a gravitational wave that passes through it, it will affect everything, even the laser beam. This means that when the wave lengthens or shortens the tube, it also lengthens or shortens the wavelength of the laser beam.  In my opinion, therefore, this device does not work. Or am I wrong? What is the distance a creature or player can travel if they have multiple types of movement speeds? What is the distance a creature or player can travel if they have multiple types of movement?  For example, the  has a 40 ft walking speed, a 40 ft climbing speed, and an 80 ft flying speed. Can it move a total of 160 ft in a round using each of those fully, or is there another way this is calculated? How do wizards cast spells which appear on their spell list when it has a divine focus component? What does a wizard do to cast a spell which contains a DF component? Take  for example,  Components V, S, DF    A divine focus component is an item of spiritual significance. The divine focus for a cleric or a paladin is a holy symbol appropriate to the character's faith. The divine focus for a druid or a ranger is a sprig of holly, or some other sacred plant. If the Components line includes F/DF or M/DF, the arcane version of the spell has a focus component or a material component (the abbreviation before the slash) and the divine version has a divine focus component (the abbreviation after the slash).  So do wizards have holy/unholy symbols in their spell components pouch or what? The 's  feature (E:RftLW, p. 58; WGtE, p. 180) states:     [...] You ignore all class, race, spell, and level requirements on attuning to or using magic items.   Class and race requirements are relatively intuitive, additionally, since an Artificer is able to cast spells they can already attune to items that require you to be a spellcaster. But there's still some questions:   Can they use a spell scroll of a spell not on their spell list? Is this one of the four requirements ignored? What are level and spell requirements; what are some examples? I stand up and I look at two parallel railroad tracks. I find that converge away from me. Why? Can someone explain me why parallel lines seem to converge, please? Does separation of variables in PDEs give a general solution? When a partial differential equation is solved using the separation of variables method, is the produced solution the most general one that satisfies the equation or have we lost some forms of the solution because of the assumption that it is in the form of separated variables? What will at actually execute? Is there an MD5 Fixed Point where md5(x) == x? How do I build a SOQL query for records in a list of IDs? Can some one correct my soql? I need to export records in data loader like:  WHERE Id IN ('123123123','123123fsdf')   But this following query does not work for me:  SELECT Id, Syndication_Documents__c FROM ContentVersion  WHERE Syndication_Documents__c in : 'a4fa0000000KzbV','a4fa0000000KzbW' I am confused by the behaviour of Currency fields in Multi-Currency environments. My app does a calculation on day X and stores its result in a record.  The custom page which displays a SUM of those values should always display the same as a database query. But...it does not. If I change Exchanges Rates those values change.  Was it wrong to store currency values in a Currency field, am I querying incorrectly or do I need to display a values that is manually calculated?  How does Multi-Currency and Currency fields work together? When are currency values converted and which conversion rate is taken into account?  I am confused?! Cropping Shapefiles in QGIS? $gh = hg, \ \gcd(|g|, |h|) = 1\Rightarrow|gh| = |g||h|\ \ (|a|$ = order of element $a)$ Let $G$ be a group and $g,h \in G$. I need to prove that if $g$ and $h$ commute and their orders are coprime, then $|gh| = |g||h|$, that is, the order of their product is the multiple of their orders.  Since $gh = hg$, then $(gh)^{ lcm(|g|, |h|)} = e$, so, $|gh|$ divides $lcm(|g|, |h|)$. Since $\gcd(|g|, |h|) = 1$, then $lcm(|g|, |h|) = |g||h|$.  So, $|gh|$ divides $|g||h|$. Infectious chicken pox My 21 year old son has chicken pox and has been home for a few days now. The spots are just starting to crust over.  I work with elderly people but have had chicken pox as a child - should I carry on working while he is here (hes usually away at Uni) and infectious? Mysql crashed, dumped DB's in recovery mode. What now? In our 5e game, we stole a boat. And a horse carriage. And a lot of other stuff for moving things between cities.   Our DM meant for this to be a way to skip road encounters. We decided to fund a shipping company and hire managers (Knights retainers, etc.) to turn a profit. The DM ruled that these would cover lifestyle expenses, provide us with easy smuggling, etc.   However, we want to keep tabs on the treasure we're moving back and forth.   What can we use for communicating with our managers from anywhere in the world? What about from say, across the city?  We don't need to communicate often or for long - a single round will work. All we need is for the manager to say "we need you back" How to include custom non-system folder under This PC in Windows 8.1? I've recently upgraded from Windows 8 to 8.1 and noticed the restructured This PC folder, formerly Computer.   What I want to achieve is to include custom folder under "This PC".    What I've found after googling is that what is displayed under "This PC" is stored in registries under   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace  However those folders (such as Desktop, Documents, etc) are referenced via CLSID and the folder I want to include in the list does not have CLSID. How can I make a peer-to-peer multiplayer game? How can I make a p2p multiplayer game? I would like to have a server-less multiplayer game. But then, how all the clients know each other?  Why the p2p-protocol is so famous in file transfer but not in multiplayer games?