I am currently trying to check whether 2 values, saved in my Firebase database, are equal to or greater than the other. Although I'm having no problems getting the value's and creating a Toast which displays the correct values, when I put them in an 'if' statement, both value's come up 'null'. Is there any solution to this?  Here some code.   public void onDataChange(DataSnapshot dataSnapshot) {                                                if (dataSnapshot.child("endTime").exists()) {                                                        Long timeOpened = dataSnapshot.child("timeOpened").child("time").getValue(Long.class);           Long serviceEnd = dataSnapshot.child("endTime").child("time").getValue(Long.class);              Toast.makeText(StoryPreset.this, timeOpened + " " + serviceEnd, Toast.LENGTH_LONG).show();       if (timeOpened &gt;= serviceEnd) {                                                                      Toast.makeText(StoryPreset.this, "Values are not null.", Toast.LENGTH_LONG).show();      } else {                                                                                             Toast.makeText(StoryPreset.this, " they are null.", Toast.LENGTH_LONG).show();      }      As I mentioned, the 'Toast' present in the above code displays both values fine. It is only when they are put into an if statement that they become null. Any help is greatly appreciated!   EDIT: just to be more clear, inside the 'if' statement, bith 'timeOpened' and 'serviceEnd' are highlighted in yellow &amp; when hovered over, a popup states that they may produce NullPointerExceptions. When testing, I also made sure I tested when I knrw 'timeOpened' was greater than 'serviceEnd' of which I got the result 'they are null'  EDIT: This question has been marked as a duplicate of the question "What is a NullPointerException". Just to be clear, I understand what a NullPointerException is and why it occurs, however I cannot understand as to why I cannot reference and compare values within the Firebase Database without them becoming NullPointerExceptions, and how I can compare them without having the NullPointerException result.
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 am writing pseudo code in the algorithmic environment. It is quite long and doesn't fit on one single page. Instead of it continuing on the next page, it is cut off. I tried inserting it into a figure environment, but the problem persists. Is there a solution to have the code continue on the next page? Got problem with installation. "No root file system is defined." I'm very new with Ubuntu and generally with linux. I saw ubuntu and it seems like this OS is really good and stable, and so I decided to install it alongside my windows 7 OS.  I have a few problems with the installation. Here is what I did:   I downloaded the 64bit version from Ubuntu official website, and burned it on a dvd. I set the boot sequence to first load from my CD-Rom. Ubuntu installation started, and I chose "Install Ubuntu" in the menu. (where there is also a "Try Ubuntu" option) I clicked forward until I got into the installation type screen    As you can see, the installation wont show my actual details about my hard drive! I have 1 hard drive with 750 GB - 80 GB - My main drive with windows 7 OS 600GB - All of my stuff 20GB Free space that I saved for Ubuntu But the installation wont show that! Drawing a constant randomly distorted circle I am trying to draw a special and contradictive plot : A circle with random distortions which have to remain constant regardless of how many times I build the document.  An example of what I am trying to achieve can be seen below    This figure was produced with the following code  \documentclass{standalone} \usepackage{tikz}    \usetikzlibrary{decorations.pathmorphing}   \begin{document}     \begin{tikzpicture}         % axes         \draw[ultra thin] (-2.5, 0) -- (2.5, 0);         \draw[ultra thin] (0, -2.5) -- (0, 2.5);         % undistorted sphere         \draw[ultra thin, dashed] (0, 0) circle (2.25cm);         \draw[ultra thin, dashed, -&gt;] (0:0) -- (125:2.25);         \node at (-1, 1) {$R$};         % distrorted sphere         \draw[very thick] plot[domain=0:350,smooth cycle ] (\x:2+rnd*0.5);         \draw[very thick, -&gt;] (0:0) -- (45:2.1);         \draw[ultra thin, -&gt;] (1, 0) arc (0:45:1);         \node at (1.2, 0.4) {$\theta$};         \node at (0.7, 1.25) {$R(\theta)$};     \end{tikzpicture} \end{document}   The problem with the code is that whenever I make a change to it and rebuild the document, the "distorted" circle will have a different shape, since I am using the rnd function. The reason I would like to have a constant-random shape is because I would like to denote its radius at an angle θ, therefore it has to touch the outline of the circle.  Any idea on how to achieve such a thing? ANOVA analysis with only mean and standard deviation Spontaneous electroweak symmetry breaking (i.e. $SU(2)\times U(1)\to U(1)_{em}$ ) is at scale about 100 Gev. So, for , gauge bosons $Z$ &amp; $W$ have masses about 100 GeV. But before this spontaneous symmetry breaking ( i.e. Energy > 100 GeV) the symmetry $SU(2)\times U(1)$ is not broken, and therefore gauge bosons are massless.  The same thing happens when we go around energy about $10^{16}$ GeV, where we have the Grand Unification between electroweak and strong interactions, in some bigger group ($SU(5)$, $SO(10)$ or others). So theoretically we should find gauge bosons $X$ and $Y$ with masses about $10^{16}$ GeV after GUT symmetry breaks into the Standard Model gauge group $SU(3)\times SU(2)\times U(1)$, and we should find massless X and Y bosons at bigger energies (where GUT isn't broken).  So this is what happened in the early universe: when temperature decreased, spontaneous symmetry breaking happened and firstly $X$ &amp; $Y$ gauge bosons obtained mass and finally $Z$ &amp; $W$ bosons obtained mass.   Now, I ask: have I understood this correctly? In other words, if we make experiments at energy above the electroweak scale (100 GeV) we are where $SU(2)\times U(1)$ isn't broken and then we should (experimentally) find $SU(2)$ and $U(1)$ massless gauge bosons, i.e. $W^1$, $W^2$, $W^3$ and $B$ with zero mass? But this is strange, because if I remember well in LHC we have just make experiments at energy about 1 TeV, but we haven't discovered any massless gauge bosons. How do I combine the NBT tags from two separate commands? I have two commands I'd like to combine into one, but I'm not sure how to go about combining them. Is this possible?   Here are the commands. They work individually, I just can't seem to get them to work together:  /give @p jukebox 1 0 {CanPlaceOn:["minecraft:melon_block"]}     /give @p jukebox 1 0 {display:{Name:"Box"}}   Can you help me to add one of the commands to the other one? "Subject, verb, direct object, object complement" versus "subject, verb, indirect object, direct object" Reading English Grammar (HarperCollins College Outline, published by HarperResource, an imprint of HarperCollinsPublishers) I found a chapter (Sentence Basics) that explains that in English there are different sentence patterns; in particular   Subject, verb, direct object, object complement Subject, verb, indirect object, direct object   The chapter reports the following example for the patterns:     Alice called Charles Professor Miller.   Alice gave Charles the rabbit.   What is the difference between the two kind of sentences? What is the difference between the object complement in the first case, and the indirect object in the second case?  PS: The question, which could appear silly, comes from the fact in my first language there is only the object complement. How to mount a VirtualBox shared folder at startup? Adjectives or compound noun? Regex pattern to choose data BETWEEN matching quotation marks Do we have any experimental evidence to confirm that light is an electromagnetic wave? Or is it confirmed simply by Maxwell's equations showing a similarity in speed? Given the differential equation $$\dot x = -2x + u$$ determine the optimal control law $u = - kx$ that minimizes the performance index $$J = \int_0^{\infty} x^2 \, \mathrm d t$$  My approach was to find the state feedback $k$. But since the value of $R$ (positive semidefinite Hermitian) is not given, that means $R=0$. How do I determine the optimal control for this system where $R=0$? Why time is considered a dimension? date difference in days, in Android What are acceptable reasons for flagging as "Requires Moderator attention"? After reading , I feel I don't quite understand this function. What are the guidelines for flagging a question as &quot;Requires Moderator attention&quot;? the largest integer $n$ for which $n+5$ divivides $n^5+5$? When we divide $n^5+5$ by $n+5$, we get a remainder $-620$, i.e., $n^5+5=K(n+5)-620$ , now how to proceed further? Why is $\mathbb{Z}[\sqrt{-n}], n\ge 3$ not a UFD? I'm considering the ring $\mathbb{Z}[\sqrt{-n}]$, where $n\ge 3$ and square free. I want to see why it's not a UFD.   I defined a norm for the ring by $|a+b\sqrt{-n}|=a^2+nb^2$. Using this I was able to show that $2$, $\sqrt{-n}$ and $1+\sqrt{-n}$ are all irreducible. Is there someway to conclude that $\mathbb{Z}[\sqrt{-n}]$ is not a UFD based on this? Thanks. Getting Error while starting Google Map v2 Example of a recursive set $S$ and a total recursive function $f$ such that $f(S)$ is not recursive? Browsing wikipedia, I stumbled on the following: "The image of a computable set under a total computable bijection is computable." Given the form of the theorem, there must be some example of a example of a recursive set $S$ and a total recursive function $f$ such that $f(S)$ is not recursive (otherwise the statement would have presumably been stronger). But I'm having difficulty dreaming up a case where this happens. Let $G$ be a group, possibly a singleton. Let $M$ be a set, possibly empty. Let $\mu: M \times G \to M$ be a right group action. Let $1_G$ be the identity of $G$.  I understand 's second definition of faithful as follows:     $\mu$ is faithful if for each $g \in G$ such that $g \ne 1_G$, there exists $x \in M$ such that $\mu(x,g) \ne x$. $\tag{1}$   Later  says if $\mu$ is free and $M$ is a non-empty set, then $\mu$ is faithful.  Question: Given the idea that we can have $M$ as an empty set, I would like to clarify: Are these correct?   If $G$ is a singleton, then every action $\mu$ is faithful, whether or not $M$ is empty. If $G$ is not a singleton, but $M$ is empty, then every action $\mu$ is not faithful.