I want to use Context in the static class below in the do in background method. I have tried parsing context in the constructor and also creating an instance of the class but every time I get this error :  Attempt to invoke virtual method java.io.File android.content.Context.getCacheDir() on a null object reference       public static class PopulateDbAsyncTask extends AsyncTask&lt;Void, Void,        Void&gt; {         private PicDao picDao;         Context context;          public PopulateDbAsyncTask(PictureDataBase db, Contex context) {             picDao = db.picDao();             this.context = context;          }          @Override         protected Void doInBackground(Void... voids) {             RequestQueue mRequestQueue = Volley.newRequestQueue(context);             return null;          } }
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?
UK coastline shapefile? Why is there a temperature gradient on Earth? I was thinking about why the poles are colder and I came out with three possible explanations.  1. The atmosphere blocks light beams coming to poles    The Sun is seen only slightly over the horizon at the poles, so the light beams have longer way to the poles. If only this case were true, then the total difference between the poles and the equator would be the same as the energy that was absorbed by the atmosphere.  2. Sun is only slightly over the horizon at the poles.    Poles are often in shadow of the parts of the Earth which are closer to the equator.  3. Poles are farther from the Sun    The longer is the way to Sun the lower is the chance to catch a light from the Sun.  Please, correct me wherever I'm wrong. I'd like to know   Which of these three is most correct?  How significant are the described effects of the other explanations? Stack Exchange OpenID credentials not removed on logout, allowing insecure re-login Finite Abelian groups with the same number of elements for all orders are isomorphic Let $A$ and $B$ be finite abelian groups. Suppose that for every natural number $m$, the number of elements of order $m$ in $A$ is equal to the number of elements of order $m$ in $B$. Prove that $A$ and $B$ are isomorphic.  Idea Given that these groups are finite, I think you have to use the primary decomposition theorem somehow. Let $\mathbb{F}_3$ be the field with three elements. Let $n\geq 1$. How many elements do the following groups have?   $\text{GL}_n(\mathbb{F}_3)$ $\text{SL}_n(\mathbb{F}_3)$   Here GL is the , the group of invertible n×n matrices, and SL is the , the group of n×n matrices with determinant 1. Recurrence relation for right-angled triangles stuck-together Are there any clones/alternatives for running a Stack Exchange style Q&A site? Display error message if same record exist with combination of some fields? What is the best way to "carve" a terrain created from a heightmap? How does one solve the matrix equation $AX+XB=C$ for $X$? It doesn't seem too difficult. I tried many times but failed.  I'm an adult student... I am now vexed about Gilbert Strang - An Introduction to Linear Algebra. I don't even understand a single word in Wikipedia: . If you have ever use some nice workable materials or lecture notes? You can generously upload and share the links of the lecture notes and assignments. Different subjects/ topics are welcome, as long as you deem they are nice and workable.   The problem origins from a system of diff equation, using undetermined coefficients (matrix) to find the particular solution. Try $y_p=X\begin{pmatrix}   e^{\alpha t} \\ e^{\beta t} \end{pmatrix}$  $\dot{y}+Ay=C\begin{pmatrix} e^{\alpha t} \\ e^{\beta t}\end{pmatrix}$   $\dot{y_p}=X\begin{pmatrix} \alpha &amp; 0 \\ 0 &amp; \beta \end{pmatrix} \begin{pmatrix}e^{\alpha t} \\ e^{\beta t}\end{pmatrix}$  substitute $\dot{y_p}$ and $y_p$ into the original differential equation..  $X\begin{pmatrix} \alpha &amp; 0 \\ 0 &amp; \beta \end{pmatrix}+AX=C$ How can I expand a partition into non adjacent free space using GParted? My dual-boot machine has partitions as follows:   sda1 50 GB NTFS sda2 15 GB unallocated sda3 20 GB ext3 sda4 20 GB ext4   I would like to allocate the unused space on sda2 to my Ubuntu partition on sda4, hopefully leaving the other two partitions untouched, leaving this configuration:    sda1 50 GB NTFS sda3 20 GB ext3 sda4 35 GB ext4   Is this possible? If so, how can it be done, preferably using GParted? Using pre-compiled headers with CMake Sum data based on cell color in Google Spreadsheets I have seen  and altough I face the same problem, the answer to that question is not helpful to my case.   I have large spreadsheets which are changed frequently. So, according to the solution accepted to that question, it is hard to duplicate all populated columns and it is cumbersome to edit one more cell everytime I wish to make a change on cells background colors.  Isn't there a way to sum data based on a condition regarding cell background color in Google Spreadsheets? Why does Ubuntu fail to run .exe files? / How do I run .exe? Do Legendary Pokemon Respawn After The Elite Four? I have a matrix which is kind of symmetrical with the other diagonal, i.e., something like  $$A = \left[ \begin{array}{c c c c}    a &amp; b &amp; c &amp; d \\    e &amp; f &amp; g &amp; c \\    h &amp; i &amp; f &amp; b \\    j &amp; h &amp; e &amp; a  \end{array} \right]$$  Does this matrix have a special name in literature? What are it's properties?  And a matrix that is symmetrical by both diagonals   $$A = \left[ \begin{array}{c c c c}    a &amp; b &amp; c &amp; d \\    b &amp; e &amp; f &amp; c \\    c &amp; f &amp; e &amp; b \\    d &amp; c &amp; b &amp; a  \end{array} \right]$$  What's the name of it? Any interesting properties? I am planning a trip to Italy this coming January. My plan is to land by plane in Roma and then go to France by train/bus stopping in some Northern Italian cities on the way, enjoying the architecture, the atmosphere, the art and and the food.   I want to do it at my own pace, without heavy scheduling. Ideally, I would just decide which cities to visit, and take a train whenever I feel it. I often do this here in South Korea where I am living, taking advantage of the "standing seats" as it is called here, that is travelling (for a cheap price and no reservation) standing on the romm between two cars. From my experience, it is also doable in Taiwan (at least in some trains).  In France, regional trains usually does not need any reservation, so you can buy a ticket and take the train whenever you want.  Can I expect a similar system in Italy, that is a way to make short travels between close cities without reservation?   Example of "short travel": Pisa - Firenze. hyperref: how to format text in a forms text-field I would like to pre-format the text in a form text-field, e.g. make it bold, italic or use a specific font. The following code generates a simple text-field:  \documentclass{scrreprt} \usepackage{hyperref} \begin{document} \textbf{The Text Field} \begin{Form} \TextField[]{\ } \end{Form} \end{document}   Is it possible to pre-format the text in the text-field? The hyperref package manual (10/2011) speaks of an optional parameter format and the use of JavaScript to format the field. Can this be used to format the text in the field? And if yes, how is it done? (I am not proficient in JavaScript) What does functools.wraps do? In a comment on this , someone said that they weren't sure what functools.wraps was doing. So, I'm asking this question so that there will be a record of it on StackOverflow for future reference: what does functools.wraps do, exactly? My chooser (file-picker dialog) goes under the dock so I can't see buttons. What can I do?