I'm trying to develop game scenario that able to trigger the alarm with alarm light and siren audio to play. For the testing purpose I set it that to boolean value as "alarmOn" in AlarmLight class.   **AlarmLight.cs** public class AlarmLight : MonoBehaviour {  public float fadeSpeed = 2f; public float highIntensity = 2f; public float lowIntensity = 0.5f; public float changeMargin = 0.2f; public bool alarmOn = false;  private float targetIntensity; public Light light;   //add alarm lights // tag as siren void Awake() {     light.intensity = 0f;     targetIntensity = highIntensity; }  void Update() {     if (alarmOn==true)     {         light.intensity = Mathf.Lerp(light.intensity, targetIntensity,fadeSpeed * Time.deltaTime);         ChecktargetIntensity();     }     else     {         light.intensity = Mathf.Lerp(light.intensity, 0f, fadeSpeed * Time.deltaTime);      }  }  void ChecktargetIntensity() {     if (Mathf.Abs(targetIntensity - light.intensity) &lt; changeMargin)     {         if (targetIntensity==highIntensity)         {             targetIntensity = lowIntensity;         }         else         {             targetIntensity = highIntensity;         }     } }   }  Then I  tried to access that value with LastPlayerSight class and for the testing purpose i was trying to return false as below.  alarm.alarmOn = (playerPosition != resetPlayerPosition);   Then I tried to play my scene, and I got the error which is the problem with above line of code.    This is my LastPlayerSight.cs class  public class LastPlayerSight : MonoBehaviour {  public Vector3 playerPosition = new Vector3(1000f, 1000f, 1000f); public Vector3 resetPlayerPosition = new Vector3(1000f, 1000f, 1000f);  public float lightHighIntensity = 0.25f; public float lightLowIntensity = 0f; public float fadeSpeed =7f;  public float musicFadeSpeed = 1f;  //directional alarmlight ref private AlarmLight alarm;  //main directional light ref private Light mainLight;  private AudioSource panicAudio;  //siren audio private AudioSource[] sirens;  void Awake() {     alarm = GameObject.FindGameObjectWithTag(Tags.alarms).GetComponent&lt;AlarmLight&gt;();     mainLight = GameObject.FindGameObjectWithTag(Tags.mainLight).GetComponent&lt;Light&gt;();      GameObject[] sirenAttachedGameObjects = GameObject.FindGameObjectsWithTag(Tags.siren);     sirens = new AudioSource[sirenAttachedGameObjects.Length];        for(int i = 0; i&lt;sirens.Length; i++)     {         sirens[i] = sirenAttachedGameObjects[i].GetComponent&lt;AudioSource&gt;();     } }  void Update() {     SwitchAlarms();     MusicFading(); }  void SwitchAlarms() {     alarm.alarmOn = (playerPosition != resetPlayerPosition);      float newIntensity;      if(playerPosition != resetPlayerPosition)     {         newIntensity = lightLowIntensity;     }     else     {         newIntensity = lightHighIntensity;     }      mainLight.intensity = Mathf.Lerp(mainLight.intensity, newIntensity,fadeSpeed*Time.deltaTime);      for (int i = 0; i &lt; sirens.Length; i++)     {         if (playerPosition != resetPlayerPosition)         {             sirens[i].Play();         }         else         {             sirens[i].Stop();         }     } }  void MusicFading() {    //AudioSource audioTemp = audio.GetComponent&lt;AudioSource&gt;();      if (playerPosition != resetPlayerPosition)     {         //audio.GetComponent&lt;AudioSource&gt;().volume = Mathf.Lerp(audio.volume, 0f, musicFadeSpeed * Time.deltaTime);          panicAudio.volume = Mathf.Lerp(panicAudio.volume, 0.8f, musicFadeSpeed * Time.deltaTime);      }     else     {         panicAudio.volume = Mathf.Lerp(panicAudio.volume, 0.0f, musicFadeSpeed * Time.deltaTime);      } }   }  I'm beginner of developing such things and can anyone guide me to correct the problem?
Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea to gather from multiple source some explanation and ways to fix this error.  Symptoms I am getting the error below appearing in my console, what does it mean and how do I fix it?  NullReferenceException: Object reference not set to an instance of an object
A continuation of .  I'm fighting a page-limit in a single-column layout and I need to put a Figure and a Table side-by-side and provide them with independent captions. However, the style guide for the publishers (LNCS) wants Figure captions below and Table captions above (probably something to do with ).   =======================================================  If I adapt @lockstep's floatrow example from  accordingly to have a Table caption above ...  \documentclass{article}  \usepackage{floatrow} % Table float box with bottom caption, box width adjusted to content  %% ********************************** %% just adding \captop to original example %% ********************************** \newfloatcommand{capbtabbox}{table}[\captop][\FBwidth]  \usepackage{blindtext}   \begin{document}  \blindtext  \begin{figure} \begin{floatrow} \ffigbox{%   \rule{3cm}{3cm}% }{%   \caption{A figure}% } \capbtabbox{%   \begin{tabular}{cc} \hline   Author &amp; Title \\ \hline   Knuth &amp; The \TeX book \\   Lamport &amp; \LaTeX \\ \hline   Knuth &amp; The \TeX book \\   Lamport &amp; \LaTeX \\ \hline   Knuth &amp; The \TeX book \\   Lamport &amp; \LaTeX \\ \hline   \end{tabular} }{%   \caption{A table}% } \end{floatrow} \end{figure}  \end{document}   =======================================================  The problem becomes clear ...    =======================================================  The floatrow doesn't correctly line up the Table and Caption. I reluctantly tried to use vspace to solve the problem, but it didn't work out.  Any suggestions on how to get these two to align? I'm happy to accept any alignment that ensures that the Table and Figure fit within the same "box".  (A similar-ish question was , but specific for subfig and with a very localised problem it seems.) In Cycles, is there a way to create a procedural texture that follows the longitudinal lines of a sphere? Like a beach ball or globe? The texture should be able to be mapped to any sphere-shaped object, not just perfect spheres.    My current approach is to use a rotated wave texture, but that doesn't come from the poles (It uses latitudes) What are logic gates? How do I suppress stderr warning messages from a command inside command substitution? touch ~/deleted/$(echo "directory_"$(readlink -f foo)|tr '/' '\') 2&gt; /dev/null   where foo is a directory  It's reading the full pathname of foo and creating it as a file replacing all '/' with '\' and putting a directory_ in front so the directory  /home/test/foo would create a file directory_\home\test\foo  It does exactly what I want except a warning keeps printing tr: warning: an unescaped backslash at end of string is not portable   a. I don't know what that means b. I would like it to not show  I tried to redirect stderr to /dev/null but it doesn't work. How do I suppress it? I'm reading  and I'm trying to understand the proof under "Degeneracy in One Dimension".  Here's what it says:     Considering a one-dimensional quantum system in a potential $V(x)$ with degenerate states $|\psi_1\rangle$ and $|\psi_2\rangle$ corresponding to the same energy eigenvalue $E$, writing the time-independent Schrödinger equation for the system:       $$-\frac{\hbar^2}{2m}\frac{ \partial^2\psi_1}{ \partial x^2} + V\psi_1 =E\psi_1$$       $$-\frac{\hbar^2}{2m}\frac{ \partial^2\psi_2}{ \partial x^2} + V\psi_2 =E\psi_2$$   Multiplying the first equation by $\psi_2$ and the second by $\psi_1$ and subtracting one from the other, we get:       $$\psi_1\frac{d^2}{d x^2}\psi_2-\psi_2\frac{d^2}{d x^2}\psi_1=0$$   Integrating both sides       $$\psi_1\frac{\partial \psi_2}{\partial x}-\psi_2\frac{\partial \psi_1}{\partial x}=constant$$   In case of well-defined and normalizable wave functions, the above constant vanishes, provided both the wave functions vanish at at least one point, and we find: $\psi_1(x)=c\psi_2(x)$ where $c$ is, in general, a complex constant. So, the two degenerate wave functions are not linearly independent. For bound state eigenfunctions, the wave function approaches zero in the limit $x\to\infty$ or $x\to-\infty$, so that the above constant is zero and we have no degeneracy.   Here are the parts I don't understand:   How does integrating $\psi_1\frac{d^2}{d x^2}\psi_2-\psi_2\frac{d^2}{d x^2}\psi_1=0$ yield $\psi_1\frac{\partial \psi_2}{\partial x}-\psi_2\frac{\partial \psi_1}{\partial x}=constant$.  Without having explicit formulas for $\psi_1(x)$ and $\psi_2(x)$, how do we just apparently pull them both out of the integral? I don't understand how the constant in the last equation vanishes just because $\psi_1$ and $\psi_2$ vanish at infinity. Even if it does vanish, how does that imply $\psi_1=c\psi_2$? Is there any term used for multiple hat tricks? If a bowler takes more than three sequential wickets (say six wickets) in one over, would this be called as two hat-tricks or does this feat, however unlikely, has a different name? How many group structures make $S^1$ a topological group? Let $S^1$ be the subspace of $R^2$ given the usual topology. How many group structures make $S^1$ a topological group? Discouraged by simple Bayesian Question My university is testing an intro Machine Learning (ML) course for us undergrads, and having been interested in ML since the beginning to understand what it was, I jumped at the chance to take it. But being someone who has not been back in school for a long time and much busier than I was in my first years long ago, I am finding that I need more info and examples than the class in its current form has.  I am struggling to figure out what the attached question is asking. I am searching online for help with this particular topic, but I am also finding that everyone seems to have their own way of phrasing similar questions in such a way that I am finding it hard to link the info.   My understanding from stats way back when is that $p(x|\omega_1)$ is stating the probability of $x$ given $\omega_1$ for $0\le x \le 2$ and zero other wise. Same obviously if given $\omega_2$. If I understand, the priors are the probability of $\omega_1$ and $\omega_2$ which are somehow obtained. And honestly that is as far as I am really comprehending. I am not sure what (a) and (b) are truly asking for or how to get them. If anyone is able to help me with some pointed info on the topic it would be greatly appreciated. Why did Eve die with Maelon's data available? I saved Wrex in ME1, I saved Maelon's data in ME2, the import screen in ME3 confirmed this.    When I get to the missions on Tuchanka, I completed every one of the side missions before starting the mission where they take down the Reaper and distribute the genophage cure.  Then when I finally get to the lab, Mordin tells me that Eve has died.    Yet every site I've been to says that keeping the data allows her to live.  So why did she die? If gravity isn't a force, then why do we learn in school that it is? I have studied some of Einstein's Theory of General Relativity, and I understand that it states that gravity isn't a force but rather the effects of objects curving space-time. If this is true, then why are we instructed in middle school that it is a force? I took several statistics courses in college but I found that my education was very theory driven.  I was wondering if any of you had a text in Applied Statistics (at the graduate level) that you recommend or have had good experience with. Context: I was looking at . I didn't know the result referred to in Brian M. Scott's answer is hard enough to require a separate proof   ― .  ― .  (1)  ― What's the intuition? Is Bezout Identity supposed to be intuitive?  (2) — Why doesn't this try work? Let $c$ be any common divisor of $a, b$. Therefore $c\mid a, c\mid b \iff cj_1 = a, cj_2 = b$ for some integers $j_1, j_2$.     Call $g = \gcd$. By definition $\gcd(a,b)\mid a$ and $\gcd(a,b)\mid b$ and $c \le \gcd(a,b)$. Therefore $g\mid a, g\mid b \iff gk_1 = a, gk_2 = b$ for some integers $k_1, k_2$.   The two paragraphs together precipitate $cj_1 = a = gk_1,  cj_2 = b = gk_2$ but this only proves $c\mid gk_1, c\mid gk_2$?    Origin - Elementary Number Theory, Jones,  p9, Exercise 1.8 I’m a Filipino citizen. My flight goes from Vancouver to Manila via Tokyo Haneda. I will arrive in Japan at 6pm then depart at 9am the next day. I'm not planning to go out of the airport during my layover, so I don't see a need to have a transit visa. However, I called the Consulate-General of Japan here in Canada, and they asked me to get a transit visa.  Then I called the Ministry of Foreign Affairs in Japan and asked them the same question.. at first, they told me I don’t need a visa as long as I stay inside the airport, but when I told them that the Consulate-General of Japan in Canada asked me to get a visa, they also asked me to get one.  I'm so confused. I would like to know your knowledge or experience regarding this. triggered my curiosity for this question. Why most of manga are black and white? Is this because of more cost if they add colors to it? See my edit below, this is not totally a duplicate of   My reverse-search function in the CLI is broken and I don't know how to fix it back...  When I hit ctrl+r and search a command I did earlier, find it then press the right arrow key to use it, the output is broken. Here is an example:  # I reverse-searched the word "test" then pressed right arrow yoshiji@x1carbon:~/path/to/git/folder (master) $ch)`test': rake test #                                              ^^^^^^^^^^ weird output #                                                     ^ cursor right there   It also "shifts" my cursor to a different position. If I press enter, the right command is executed (rake test in this case) so it means the text displayed is not the same as what is actually executed.  I know this is most-likely related to my PS1 export in my ~/.bashrc, so here are the last lines of this file:  # Git branch in prompt. git_branch() {   branch=$(__git_ps1 2&gt; /dev/null)   if [ "$branch" = " (master)" ]; then      echo -e "\033[33m${branch}\033[00m" # yellow   elif [ "$branch" = "" ]; then      echo -e "\033[90m (no git)\033[00m" # red   else      echo -e "\033[32m${branch}\033[00m" # green   fi } PS1='\u@\h:\w$(git_branch) \$ '   This is something I wrote to displays the git branch in orange (if master branch) or else in green (or no git in gray).  Do you guys have any idea on what is causing this weird behavior?    Edit: This is a different problem from the  in the way that I am using echo -e "some string" to return a string having color+name of the git branch from the function git_branch(). Using echo -e does not escape the characters \[ and \] (try it yourself in your CLI: echo -e "\[\033[33m\]test").  Ideally, I would like to keep those conditional colors based on the branch's presence &amp; name (gray if no branch, orange if master, else green). Combining two covariance matrices I'm calculating the covariance of a distribution in parallel and I need to combine the distributed results into on singular Gaussian. How do I combine the two?  Linearly interpolating between the two almost works, if they are similarly distributed and sized.   provides a forumla at the bottom for combination but it doesn't seem right; two identically distributed distributions should have the same covariance, but the formula at the bottom of the page doubles the covariance.  Is there a way to combine two matrices? Which tools and technologies are used to build the Stack Exchange Network? What tools and technologies are used to build the Stack Exchange Network?  See also: Find what packages are installed from a repository Why was Severus Snape placed in Slytherin? From the top of my head, Danish "De" (practically never used), German "Sie", Chinese "您", French "vous", Spanish "usted" are a formal way of addressing someone, especially if one isn't familiar with the addressee. Did English ever have this? It sounds as though Proto-Indo-European might have had this (based on my 4 examples), but perhaps someone can enlighten me?