I have seen many answers with respect to the above error in Java, however most of them are telling what the error is, and I cannot find a way to correct it. This is a snippet of my code in Java: public static void optimalAlignmentScoreBU(String r, String s, int matchScore, int transition, int transversion, int indel) {          int m = r.length();         int n = s.length();         Node[][] strg = new Node[m + 1][n + 1];          // base cases         strg[m][n].val = 0; }  I get error at the line where I write strg[m][n].val =0; I have created a Node class as follows: // ELEMENT OF DP MATRIX IS OF TYPE NODE     public class Node {         int val;         ArrayList&lt;Pair&lt;Integer&gt;&gt; arrows = new ArrayList&lt;Pair&lt;Integer&gt;&gt;();     }  // PAIR CLASS public static class Pair&lt;T&gt; {         T p1;         T p2;          public Pair(T p1, T p2) {             this.p1 = p1;             this.p2 = p2;         }     }  Can you tell me what is going wrong? Why is NULL being pointed? What can I do to correct this?
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?
Present continuous and simple future From : In calculus and other branches of mathematical analysis, an indeterminate form is an algebraic expression obtained in the context of limits. Limits involving algebraic operations are often performed by replacing subexpressions by their limits; if the expression obtained after this substitution does not give enough information to determine the original limit, it is known as an indeterminate form.    The indeterminate forms include $0^{0},\frac{0}{0},(\infty - \infty),1^{\infty}, \ \text{etc}\cdots$   My question is can anyone give me a nice explanation of why $1^{\infty}$ is considered to be an indeterminate form? Because, i don't see any justification of this fact. I am still perplexed. Digits of $\pi$ forming primes? Let $f(n)$ be the first $n$ digits of $\pi$ . How many times is $f(n)$ prime on the interval $[1, k]$ ? Are there infinitely many prime $f(n)$'s on $[1, \infty)$?  I know this is probably be a very hard question and most likely an open problem, but I am just curious. Composition of 2 involutions How can we prove that any bijection on any set is  a composition of 2 involutions ?  Since involutions are bijections mapping elements of a set to elements of the same set, I find it weird that this applies to any bijection.  Thanks for your help ! how to copy or backup files ignoring dot files I want to back-up all files from my laptop partitions to external HDD.  I ran, for example  cp -a /med*/ravb*/*00   /med*/ravb*/M*L*/7.3GB_CP &amp;&amp; echo "7.3GB BACKED UP PROPERLY" || echo "7.3GB FAILED TO BACK UP"   The issue is that dot files are also getting included which I don't want. What should I do so as to ignore all dot files for backing up. QUESTION Find the number of triples $$(x,y,z)$$ of real numbers satisfying the equation $$x^4+y^4+z^4+1=4xyz$$  I have tried to solve this problem but can't quite understand how to manipulate the given data to reach a clear result. Could someone please explain how I should approach and solve this problem.Thanks :) Equivalent of cURL for Ruby? Creating a temporary directory in Windows? What's the best way to get a temp directory name in Windows?  I see that I can use GetTempPath and GetTempFileName to create a temporary file, but is there any equivalent to the Linux / BSD  function for creating a temporary directory? Will the silhouette formula change depending on the distance metric? I am using Silhouette width to compute the best value for k in k-means. As I am performing document clustering, I am calculating the values of a and b as follows in Python:  a = distance(data[index], centroids[clusters[index]], metric=metric, p=p) b = min([distance(data[index], c) for i,c in enumerate(centroids) if i != currentindex]) score = float(b - a) / max(a, b) if max(a, b) &gt; 0 else 0.0   The original formula from the  is the following:    I am using a cosine similarity measure to compute the distances and was wondering if this formula needs to be changed or it can be left as is. In the above snippet of code, the function distance computes the cosine similarity metric. How to upload string as file with jQuery or other js framework Is a URI (specifically an HTTP URL) allowed to contain one or more space characters? If a URL must be encoded, is + just a commonly followed convention, or a legitimate alternative?    In particular, can someone point to an RFC that indicates that a URL with a space must be encoded?  Motivation for question: While beta-testing a web site, I noted that some URLs were constructed with spaces in them. Firefox seemed to do the right thing, which surprised me! But I wanted to be able to point the developers to an RFC so that they would feel the need to fix those URLs. Add a duplicate:0|1 search operator I often search for closed questions and sift through the ones that are not duplicates to see if any of them need to be killed. Technically, closure is the first step towards deletion and the only closed posts that are actually useful are duplicates (unless it's a crappy one).  For the rest, if the community hasn't bothered to reopen it after a while or if the OP has made no effort to edit their question, I delete it if it has no redeeming content. For example, the only closed posts seen on  are exact dupes.  But this does become tedious when there are several results for various close reasons with duplicates interspersed between them. I'd like to be able to search as:  closed:1 duplicate:0   so that it gives a list of questions closed as OT/NaRQ/NC/TL. This will be similar in behaviour to migrated:0|1.   This will also be useful for 10k+ users on all sites (2k+ in beta) in the network, especially SO, so that they can search for questions to spend their delete votes on— especially closed, non-dupe questions in the tag they specialize in. More often than not, I hesitate to vote on questions that are outside my area of interest (unless it is crappy). Expanding a parent  to the height of its children I have a page structure similar to this:  &lt;body&gt;   &lt;div id="parent"&gt;     &lt;div id="childRightCol"&gt;       /*Content*/     &lt;/div&gt;     &lt;div id="childLeftCol"&gt;       /*Content*/     &lt;/div&gt;   &lt;/div&gt; &lt;/body&gt;   I would like for the parent div to expand in height when the inner div's height increases.  Edit: One problem is that if the width of the child content expands past the width of the browser window, my current CSS puts a horizontal scrollbar on the parent div.  I would like the scrollbar to be at the page level. Currently my parent div is set to overflow: auto;  Can you please help me with the CSS for this? How do Stack Overflow questions appear in Google search results in seconds? How to pull data from internal memory on an unrooted phone? Yesterday, I suddenly discovered that I had lost all the user files on the internal memory of my android phone. All my photos, my music, my PDFs, audio recordings, everything. I will explain the events leading up to this in a separate paragraph below.  I have a Lava Z90 phone and I do not use an external SD card, so I must work with my phone to recover all data. I've been googling and following stuff I get from the internet(including Stack Overflow). Here's what I have done so far.   Tried using photo recovery apps available on Play Store. None of them worked. Decided to go more technical. Enabled USB Debugging and OEM Unlocking from Developer options in my phone. Then I used ADB pull command, pull /dev/block/mmcblk0 /home/data.img to try create an image of the entire internal storage so I can analyse it using PhotoRec. It says pull: not found I assumed this is because my phone isn't rooted?  I tried to root it with the KingoRoot apk but that didn't work. I have Ubuntu on my PC and there is not KingoRoot for Ubuntu. My next step would be to use Wine to run KingoRoot on my machine and try to root my phone that way.   I have the following questions:   How can I create an image, a data dump of my entire internal storage that i can later analyse for my data? Can I do it with an unrooted phone? If not, how can I root my phone with ADB? Am I going about this right? Is there a better, easier way to recover data that I should use instead?   Thank you very much.  How I lost my data  I recently uninstalled the TikTok app from my phone. Yesterday I connected my phone to my PC over mtp and found that there were certain leftover folders on the internal memory. One was a folder with Chinese name, one was a folder called ByteDance and one folder called Thumbnails. I assumed that the first two were leftovers from the TikTok app and the third was mere thumbnails. So I deleted them to save space. Nothing happened that day, except that I couldn't access any of my WhatsApp images through WhatsApp(they were still accessible through the gallery). However, when I woke up the next morning, all my data on the internal memory was gone. I still have contacts my messages and my settings, just that everything that was accessible through the file explorer has disappeared. Cropping Shapefiles in QGIS? tags of mundanity that are gratuitously applied to posts It's an additional unnecessary burden to the honest stacker during suggested edit duty. A question presents some code then the minor editor adds a tag like 'for-loop' or 'forms'.  These tags are so general that they only have a handful of followers. They serve no useful purpose and are the cause of many too minor edits. Why not permit culling of generic tags? S(x), which stands for “x is a surgeon”  P(x, y), which stands for “x is a patient of y”  R(x), which stands for “x recovers”  H(x), which stands for “x is happy”  1>"A surgeon with no patients is happy" means: for any person xx, if xx is a surgeon and there is no person yy for which yy is a patient of xx, then xx is happy.  2> "A surgeon is happy if all her patients recover" means: for any person xx, if xx is a surgeon and - if for every person yy for which yy is a patient of xx, we have that yy recovers - then xx is happy.  I have these as solution:  1:∀(x) ( S(x)∧ ∀(y)P(y,x) → H(x) ) 2: ∀(x) [ { S(x)∧ (∀(y)P(y,x) ∧ R(y)) } → H(x)]  Are these okay?  And how do prove that 1 follows from 2 by resolution (not by drawing a truth table)? I want to use a Java file SaveProp which is written in a package user. The class file has been placed in WEBINF/classes. Below are the two lines which cause the issue.  jsp:useBean id="user" class="user.SaveProp" scope="session"  jsp:setProperty name="user" property="*"   It throws:  The value for the useBean class attribute user.SaveProp is invalid   I'm using Tomcat 6.0. Inequalities for combinations of $\int f $ and $\int (1/f)$ where $m\le f\le M$ on an interval