java.lang.NullPointerException: Attempt to invoke virtual method 'long com.example.carpetcatalog.DataBaza.insertYec_product(com.example.carpetcatalog.Models.YecProductForDB)' on a null object reference at com.example.carpetcatalog.MainActivity$4.onResponse(MainActivity.java:374)  public void networkCallbackForProduct() {         Call&lt;List&lt;Yec_product&gt;&gt; productresponse = ApiClient.getRetrofit().create(ApiInterFace.class).getproductfromAPI();         productresponse.enqueue(new Callback&lt;List&lt;Yec_product&gt;&gt;() {             @Override             public void onResponse(Call&lt;List&lt;Yec_product&gt;&gt; call, Response&lt;List&lt;Yec_product&gt;&gt; response) {                 if (!response.isSuccessful()) {                     Toast.makeText(MainActivity.this, response.code(), Toast.LENGTH_SHORT).show();                 }                 List&lt;Yec_product&gt; productList = response.body();                 for (Yec_product product : productList) {                     YecProductForDB yecProductForDB = new YecProductForDB(product.getId(), product.getCode(), product.getName(), product.getImage_url(), product.getPrice(), product.getQuality_id(), product.getRoom_id(), product.getChanged());                   long natija=dataBaza.insertYec_product(yecProductForDB);                   if (natija==-1){                       Toast.makeText(MainActivity.this, &quot;error insert baza product&quot;, Toast.LENGTH_SHORT).show();                     finish();                   }                  }             }              @Override             public void onFailure(Call&lt;List&lt;Yec_product&gt;&gt; call, Throwable t) {                 Toast.makeText(MainActivity.this, &quot;error&quot; + t.getMessage(), Toast.LENGTH_SHORT).show();             }         });      }  Database classs*******************************
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?
What is $\sum_{n=1}^{\infty} \frac{n}{2^{\sqrt{n}}}$? What does "formal" mean? I know the definition of formal power series, power series and polynomials. But what does the adjective "formal" mean? In , does it mean "9. Of or relating to linguistic or logical form as opposed to function or meaning" or maybe another one in the link?   Or does "formal" have some mathematical meaning which is other than usual dictionary meaning? What is the best way to solve modular arithmetic equations such as $9x \equiv 33 \pmod{43}$? What is the best way to solve equations like the following:  $9x \equiv 33 \pmod{43}$  The only way I know would be to try all multiples of $43$ and $9$ and compare until I get $33$ for the remainder.  Is there a more efficient way ?   Help would be greatly appreciated! Today I updated to version 2.18.52 &amp; I can’t see the names of the people who send me a message. The only thing I see is the WhatsApp logo and the word “message”.    I can’t also see the status my friends posts, they all look black. I uninstalled the app, reset my phone &amp; nothing seems to work so far. Where are the NetworkManager logs? A previous poster on the regular forums (  ) said /var/log/daemon.log, but I don't seem to have such a file. Do I need to enable logging? Cannot change brightness setting using function buttons or using the brightness control bar on HP laptop Change the size/width of tabs in Notepad++ Shipping Labels not received for round trip courier service for UK Visa using VFS Global I purchased the round-trip courier service through VFS Global. In the instructions, it states that you will receive in a separate email the shipping labels for this courier service. I receive Registration Details and Transaction Details only. No Shipping labels. I have called VFS Global in NY,NY and no human being access to ask questions, just an insane phone tree that does not answer my questions on how to get shipping labels that were never sent. I have called the British Consul in Atlanta and she could not answer my questions then transferred me to the same phone tree message that I receive through the British Consulate. I have sent emails to customercare@vfsglobal.com, info.vfsnewyork@vfsglobal.com, NYscanhub.escalate@vfsglobal.com, DLUKVInewyorksensitive@fco.gov.uk and I have received no response from anyone.  Frustrated. I do not know what to do. Please help me!! How to interpret a QQ plot I am working with a small dataset (21 observations) and have the following normal QQ plot in R:     Seeing that the plot does not support normality, what could I infer about the underlying distribution? It seems to me that a distribution more skewed to the right would be a better fit, is that right? Also, what other conclusions can we draw from the data? Can independent variables with low correlation with dependent variable be significant predictors? I have eight independent variables and one dependent.  I have run a correlation matrix, and 5 of them have a low correlation with the DV.  I have then run a stepwise multiple regression to see whether any/all of the IVs can predict the DV.  The regression showed that only two IVs can predict the DV (can only account for about 20% of the variance though), and SPSS removed the rest from the model.  My supervisor reckons that I have not run the regression correctly, as due to the strength of the correlations, I should have found more predictors in the regression model. But the correlations were tiny, so my question is: if IVs and the DV hardly correlate, can IVs still be good predictors of the DV? Why does Calculate button remain gray in Group Stats Plugin for QGIS? In my case I failed to use  plugin (2.0.30) with QGIS 2.14.11 and 2.18.3 on windows64.  Tested on several datasets: points, polygons, and csv.- But I am not sure what I have missed.    I want to click on this Calculate button. Is the product of two Gaussian random variables also a Gaussian? Say I have $X \sim \mathcal N(a, b)$ and $Y\sim \mathcal N(c, d)$.  Is $XY$ also normally distributed?  Is the answer any different if we know that $X$ and $Y$ are independent? Why does Lang describe a field as a union and compositum of its subfields in this manner? I am reading Serge Lang's Algebra, revised 3rd edition, and on page 226, the author makes the following definitions and observations:   If $E,F \subset L$, the compositum of $E$ and $F$ in $L$ is defined to be the smallest subfield of $L$ containing both $E$ and $F$. It is denoted $EF$. If $k \subset E$ and $\alpha_1,\dots,\alpha_n \in E$, then $k(\alpha_1,\dots,\alpha_n)$ is defined to be the smallest subfield of $E$ containing $k$ and $\alpha_1,\dots,\alpha_n$. Observe that $$ E = \bigcup k(\alpha_1,\dots,\alpha_n), $$ where the union is taken over all finite families $\{ \alpha_1,\dots,\alpha_n \}$ of elements of $E$. The compositum of an arbitrary family of subfields of a field $L$ is defined as the smallest subfield of $L$ containing all fields in the family. $E$ is finitely generated over $k$ if there is a finite family $\{ \alpha_1,\dots,\alpha_n \}$ of elements of $E$ such that $E = k(\alpha_1,\dots,\alpha_n)$. Observe that $E$ is the compositum of all its finitely generated subfields over $k$.   My question is regarding the two observations (point nos. 3 and 6). It appears to me that it is enough to take union (and compositum) over all subfields generated by a single element. For example for point no. 3, I can write $$ E = \bigcup_{\alpha \in E} k(\alpha) $$ because $E$ is clearly contained in the RHS, and each $k(\alpha)$ is contained in $E$ and hence so is the union, implying that $E$ contains the RHS. Similarly for point no. 6.  So, why does Lang emphasise to take the union and compositum over all finitely generated subfields? Is there some perspective that he wishes to emphasise that I am missing? Any help in understanding this will be appreciated. Can ribosomes read ssDNA? My question is whether translation can be done, either naturally or artificially, through a ribosome reading (single-stranded) DNA directly. If not, I would like to know what allows ssRNA to be translated but not ssDNA. Connectedness in the Quotient Space I'm trying to get the subcaptions and captions in sanserif font and Uppercased. According the manual of the caption package this should be possible in the following way.However, this doesnt seem to work. Am I defining something in the wrong way here?  \documentclass{article} \usepackage{floatrow} \usepackage[demo]{graphicx} \usepackage{subfig} \usepackage{caption} \floatsetup[figure]{subcapbesideposition = top}  \captionsetup{labelfont={sf,up}, labelsep=period, format = plain, singlelinecheck = false, textfont=rm, skip = 2pt} \captionsetup[subfloat]{labelfont = {up,sf},format = plain,textfont = rm,labelformat = simple, labelsep = period}  \begin{document}   \begin{figure}[h!]   \ffigbox[\textwidth]     {\begin{subfloatrow}         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%       \end{subfloatrow}       \begin{subfloatrow}         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%         \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%       \end{subfloatrow}}     {\caption{this is a caption}} \end{figure}  \end{document} Escaping regex string What is the difference between a predicate and function? I need to to understand the difference between predicates and functions in the context of Clasual Form Logic in order to define the Herbrand universe.  If I have p(x) :- q(f(x)) would I be right in saying that p and q are predicates while f is a function because it is "nested"?  By this thinking then if I have p(x) :- q(x) both p and q are predicates and I have no functions?  If this is incorrect then how can I tell the difference between a predicate and function? An "urgent" tag for questions that need answers within minutes I was just watching a mega factory video and wondered why they use an AC motor which requires a power inverter instead of DC which may be powered directly from their DC battery? Introducing an inverter means more cost (weight, controller, etc).  Are there any reasons for that? What are the differences between an AC and DC motor that may have lead to this decision? Also does anyone know what kind of motor is used in other electric cars?