Can someone explain me why can sometimes this exception happen?  Exception java.lang.NullPointerException: Attempt to invoke virtual method 'long java.util.Date.getTime()' on a null object reference  ChannelEPGF$myPagerAdapter.getItem (ChannelEPGF.java:82) (find the "//THIS IS THE 82. rows" text in my code)  here is my code:      import android.os.Bundle;     import android.support.v4.app.Fragment;     import android.support.v4.app.FragmentManager;     import android.support.v4.app.FragmentPagerAdapter;     import android.support.v4.view.ViewPager;     import android.view.LayoutInflater;     import android.view.View;     import android.view.ViewGroup;     import com.mp.myapp.DataTypes.ChannelEPG;     import java.util.Date;      public class ChannelEPGF extends Fragment implements ChannelEPG.fragmentCommunicator {     private Date selectedDate;     private String channelId;     private String channelTitle;     private ViewPager pager;     private boolean isTunable;      @Override     public void sendMessage(String name, Object msg) {             if (msg != null) {                     ChannelEPG item = (ChannelEPG) msg;                     channelId = item.GetId();                     channelTitle = item.GetTitle();                     isTunable = item.GetTunable();             } else {                     pager.getAdapter().notifyDataSetChanged();             }     }      @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {             View v = inflater.inflate(R.layout.activity_channel_epgf, container, false);              pager = (ViewPager) v.findViewById(R.id.viewPager);             if (pager != null) {                     pager.setAdapter(new myPagerAdapter(getChildFragmentManager()));                     pager.setCurrentItem(1);             }              return v;     }      private class myPagerAdapter extends FragmentPagerAdapter {              public myPagerAdapter(FragmentManager fm) {                     super(fm);             }              @Override             public Fragment getItem(int pos) {                     if (pos == 0) {                             selectedDate = new Date();                             selectedDate.setTime(selectedDate.getTime() - 24 * 3600 * 1000);                             return ActivityChannelEPG.newInstance(selectedDate, channelId, channelTitle, isTunable);                     } else if (pos == 1) {                             selectedDate = new Date();                             return ActivityChannelEPG.newInstance(selectedDate, channelId, channelTitle, isTunable);                     } else if (pos == 2) {                             selectedDate = new Date();                             selectedDate.setTime(selectedDate.getTime() + 24 * 3600 * 1000);                             return ActivityChannelEPG.newInstance(selectedDate, channelId, channelTitle, isTunable);                     } else {                             selectedDate.setTime(selectedDate.getTime() + 24 * 3600 * 1000); //THIS IS THE 82. rows                             return ActivityChannelEPG.newInstance(selectedDate, channelId, channelTitle, isTunable);                     }             }              @Override             public int getCount() {                     return 8;             }              public int getItemPosition(Object object) {                     return POSITION_NONE;             }     }   }
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?
Are there any rules related to the creation of a ?   I am aware of the creation method for the amulet. But I'm asking about creating the actual construct. Using Fermats prime numbers to prove that there is infinitely many prime numbers Nautilus doesn't launch on Ubuntu I would like to know what would be the best way to do unit testing of a servlet.   Testing internal methods is not a problem as long as they don't refer to the servlet context, but what about testing the doGet/doPost methods as well as the internal method that refer to the context or make use of session parameters?  Is there a way to do this simply using classical tools such as JUnit, or preferrably TestNG? Did I need to embed a tomcat server or something like that? Inner Product Spaces I am trying to reconcile the definition of Inner Product Spaces that I encountered in Mathematics with the one I recently came across in Physics.  In particular, if $(,)$ denotes an inner product in the vector space $V$ over $F$:    $(u + v, w) = (u, w) + (v, w) \text{ for all } u, v, w \in V$, $(\alpha v, w) = \alpha(v, w) \text{ for all } v, w \in V$ and $\alpha \in F$, $(v, w) = (w, v)^* \text{ for all } v, w \in V$, (* denotes complex conjugation)   were some of the properties listed in my mathematics course.    In physics, however, the inner product was said to be linear in the second argument and $(v,\sum(\lambda_i w_i)) = \sum(\lambda_i (v,w_i))$ where $v$ and $w_i$ are kets in Hilbert space and $\lambda_i$ are complex numbers.    To me, these properties of an Inner Product are not compatible.  If the first definition of inner product is correct, then I think $(v,\sum(\lambda_i w_i)) = \sum((\lambda_i)^* (v,w_i))$ where $^*$ denotes complex conjugation. Which livestock is the most efficient food source? How can mixed content compromise an entire HTTPS session? Does there exist an automorphism of $\mathbb{C}$ that does not keep $\mathbb{R}$ fixed? for any ring $A$ the matrix ring $M_n(A)$ is simple if and only if $A$ is simple Let integer $n\geq 1$. I have obtained that for any field $k$, the matrix ring $M_n(k)$ is simple, i.e., $M_n(k)$ contains no nonzero proper two sided ideals. Now I want to prove that: for any ring $A$ (not necessarily commutative), the matrix ring $M_n(A)$ is simple if and only if $A$ is simple.   How to prove? Solve $p_4(x) = x^4 −(2m + 4)x^2 + (m−2)^2 $such that $p_4$ is a product of two non-constant integer-coeficient polynomials I'm having trouble getting the starting idea for a problem I've been presented with:  I need to find values for m (integer) such that the following polynomial     $p_4(x) = x^4 −(2m + 4)x^2 + (m−2)^2$; $m$ is integer   can be described as the product of two non-constant integer-coeficient polynomials.  Any help/pointers/tips on how to go about this are greatly appreciated!  Edit: I meant polynomials with integer coeficients, but for some reason typed positive. If $e^{itx_n}$ converges for every $t\in\mathbb R$, then does $x_n$ converge? Different and opposing voltage sources? &ndash; Schematic created using   The diagram above, the voltage sources are equal and wired parallel, they would increase the current(2x) flow to the load(R), but what about this case:          Are the two voltage sources in series now? How to Combine two Normal Maps? I made a high poly model and then baked its textures onto a low poly model. Now I want to give another normal map's details to the model. How can this be done? Pandemic, Global Epidemic, Epidemic, Endemic I really want to hear from the experts the definitions of all 4 terms especially whether global epidemic is equivalent to pandemic. Or should this question be directed to the epidemiologist?   Pandemic Global Epidemic Epidemic Endemic   I have Googled the terms and I understand the definition of 1), 3) and 4). In short the definition is based on geographical location and scale of outbreak, Pandemic is an outbreak of disease on a global scale (e.g. HIV). Epidemic is an outbreak of disease on a localised area. Endemic is a disease in a localised area. However, a definition for Global Epidemic is not available online.  Recently, WHO mentioned that "“It is important to put this on the table: this virus(Covid19) may become just another endemic virus in our communities, and this virus may never go away,” WHO emergencies expert Mike Ryan told an online briefing." Isn't covid19 considered a pandemic since it is on a global scale and is spreading rapidly?  Another term that I come across often is Global Epidemic. For example in the WHO website, HIV is listed as Global Epidemic. Does that mean Pandemic and Global Epidemic are the same? Question: Integrate$$\int\limits_0^1dx\,\frac {\log(1-x)\log^2(1+x)}x=-\frac {\pi^4}{240}$$   I'm curious as to if there is a way to integrate this. I've tried using integration by parts to get$$I=-\frac {\pi^2}6\log^22+2\int\limits_0^1dx\,\frac {\operatorname{Li}_2(x)\log(1+x)}{1+x}$$However, I'm not sure how to continue even further. The polylog in the second integrand seems a bit intimidating and I don't see how the first term even helps. Where does the extra kinetic energy of the rocket come from? Consider a rocket in deep space with no external forces. Using the formula for linear kinetic energy $$\text{KE} = mv^2/2$$ we find that adding $100\ \text{m/s}$ while initially travelling at $1000\ \text{m/s}$ will add a great deal more energy to the ship than adding $100 \ \text{m/s}$ while initially at rest: $$(1100^2 - 1000^2) \frac{m}{2} \gg (100^2) \frac{m}{2}.$$ In both cases, the $\Delta v$ is the same, and is dependent on the mass of fuel used, hence the same mass and number of molecules is used in the combustion process to obtain this $\Delta v$. So I'd wager the same quantity of chemical energy is converted to kinetic energy, yet I'm left with this seemingly unexplained $200,000\ \text{J/kg}$ more energy, and I'm clueless as to where it could have come from. I searched around, and currently there are two methods suggested; installing an enhancement for Windows Subsystem for Linux and installing an XServer.  I want to know which method is the most hassle-free (easy to install AND to use), and which one is less memory-heavy.  I just want Synaptic and CMake. Why couldn't that be a builtin feature? Internal or external oscillator I always use the internal oscillator that pics have as I have never found the need to run anything at higher frequency than 8 MHz (which is the fastest the pics I use tend to be able to go). Are there any reasons, beyond going above 8 MHz, that mean I should use an external oscillator? It just seems like one more thing to go wrong to me but I'd be interested to hear what others do. Flatten an irregular list of lists How to cook fall-off-the-bone beef spare ribs in oven or on stove top? All,  I would like to cook spare ribs to a fall-off-the-bone consistency.  I don't have access to a grill.  I know how to do that with pork shoulders (dry rubbed, then uncovered in the oven at low heat for 6-8hrs), but spare ribs are a different type of animal.  They are individually smaller pieces (my ribs are sawed in chunks), and they are fairly fatty, with a big bone.  What should I do?  Should I pan-sear them first, do I need some liquid in the dish?  Should I cover them?  Thanks,  JDelage