I am building a midi piano in java. In this case, I want to play pitches ,record pitches and playback them.  Then I used java thread to add pitch to queue and add delay to queue. I used thread object to these process and call it in constructor. After the call this constructor it gives NullPointException.  Can you help me found out why?  public PianoPlayer() throws MidiUnavailableException{      queue = new LinkedBlockingQueue&lt;NoteEvent&gt;();        delayQueue = new LinkedBlockingQueue&lt;NoteEvent&gt;();      machine = new PianoMachine(this);      processQueue.start();      processDelayQueue.start(); }  Thread processDelayQueue = new Thread() {     public void run(){         while(true){             if(queue.isEmpty()){             }             else{                 try {                     NoteEvent e=queue.take();                     midi.Midi.wait(100);                     queue.put(e);                             } catch (InterruptedException ex) {                     Logger.getLogger(PianoPlayer.class.getName()).log(Level.SEVERE, null, ex);                 }             }         }    } };
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?
My computer does not store the history of the entries entered in RUN (WIN+R).   Thus, how to enable Windows to store the history? In this case what is correct?        Keep Tom and I updated.      or         Keep Tom and me updated.      I understand that me is an object pronoun. And therefore I feel the second option is correct.  Especially, because I would say "Keep him updated" and also "Keep me updated". Instead of "Keep he updated" or "Keep I updated". But something about saying "Keep him and me updated" feels wrong.  However I am not sure, because several people have told me that in this case I is the correct option because it is being used in conjunction with a name (Tom) and not a pronoun. Is that correct? Sometimes when reading through user comments on a particular answer, some usernames that appear like user[digit] e.g user12345 are not links. Is this a known behaviour or any other thing I am not aware of? If you view the Earth from far enough away can you observe its past? ${\rm Aut}(G)$ is cyclic $\implies G$ is abelian I would appreciate if you could please express your opinion about my proof. I'm not yet very good with automorphisms, so I'm trying to make sure my proofs are OK. Proof: Since ${\rm Aut}(G)$ is cyclic, ${\rm Aut}(G)$ is abelian. Thus for any elements $\phi, \psi \in{\rm Aut}(G)$ and some elements $g_i \in G$, $\phi\psi(g_1g_2)=\phi\psi(g_1)\phi\psi(g_2)=g_3g_4=\phi\psi(g_2)\phi\psi(g_1)=\phi\psi(g_2g_1)=g_4g_3$. Hence, $g_3g_4=g_4g_3\implies G$ is abelian. The proof seems to be quite straightforward, but I'd rather ask for advice. Considering the three types of Devil Fruits that has been explained are 1. Paramecia Type - where the user can get super human abilities and change their body parts into weapons, etc. 2. Zoan type - where the use can turn into a particular animal and inherit its abilities 3. Logia Type - where the user's body inherits a particular element and the body becomes like air which cannot be touched or damaged by non Haki users.  So what exactly is the type of Gomu Gomu no Mi? It cannot be Zoan or Logia. It's very close to a Paramecia but still doesn't have a logical explanation to be of Paramecia type! So is it some special type of Devil Fruit? Manipulating the axis on a ListLinePlot Are there any free/open source alternatives to Adobe After Effects? I've been a illustrator and graphic designer for a number of years and now I'm looking to go more into motion graphics and visual effects. Is there anything that is open source/free (not a demo, education version or trial) that is as complex and feature-rich as Adobe After Effects but for Linux? I've tried Cinlerra, kdenlive, openshot and Blender and whilst they are good at video editing (and 3d modelling in Blender's case) they fall short in effects and compositing features.  I've also tried , but the project recently closed and the last update was quite buggy.  Also,  doesn't work and hasn't been updated in many many years, so don't mention it ;-) Can you please explain this to me?          Could you please explain this to me?   I am unable to figure out which to use which situation. I did google, and some posts say they are both the same, even if the second one is more formal. Other posts say could is the past tense of can, but in the above example, I don't think could is used as past tense of can.  What is correct way to use these words? Why won't the location of the light affect the direction of the shadows? So I'm new to blender, and I've been working on a project with a tutorial. (some of you might know this)   I was going through quite smoothly until I noticed that no matter where I place my light, the rendered version appears the same. (directly above the objects) I tried different types of lighting, different brightnesses, (light is currently at around 4.000 brightness) nothing works. But if I delete the light, it becomes dark and grainy. (I checked on the side bar, there are no other light sources or objects..)  Even if I put the light source under my objects, the rendered version appears the same.  Am I doing something wrong? Why can't I change the direction of the light?        Uh.. Since I'm not allowed to post more than 2 links, I'll just post extra info here (also replying to @bertmoog)  I tried changing the light types, but they all do nothing (except for Sun, of course, and Hemi, which is interpreted as Sun for some reason) The brightness is set on 4.200, color set to white, shadows enabled, etc. But it still won't do anything. As you can see, nothing appears in the preview.    EDIT: I found that by rotating the sun to point where I want it to, it works almost like normal point lighting (sorta). This pretty much solves my problem, but still, why won't the other lighting modes work? How do I use Moq to mock an extension method? I am writing a test that depends on the results of an extension method but I don't want a future failure of that extension method to ever break this test. Mocking that result seemed the obvious choice but Moq doesn't seem to offer a way to override a static method (a requirement for an extension method). There is a similar idea with Moq.Protected and Moq.Stub, but they don't seem to offer anything for this scenario. Am I missing something or should I be going about this a different way?  Here is a trivial example that fails with the usual "Invalid expectation on a non-overridable member". This is a bad example of needing to mock an extension method, but it should do.  public class SomeType {     int Id { get; set; } }  var ListMock = new Mock&lt;List&lt;SomeType&gt;&gt;(); ListMock.Expect(l =&gt; l.FirstOrDefault(st =&gt; st.Id == 5))         .Returns(new SomeType { Id = 5 });   As for any TypeMock junkies that might suggest I use Isolator instead: I appreciate the effort since it looks like TypeMock could do the job blindfolded and inebriated, but our budget isn't increasing any time soon. What Topology does a Straight Line in the Plane Inherit as a Subspace of $\mathbb{R_l} \times \mathbb{R}$ and of $\mathbb{R_l} \times \mathbb{R_l}$ Given a straight line in the plane, what topology does this straight line inherit as a subspace of $\mathbb{R_l} \times \mathbb{R}$ and as a subspace of $\mathbb{R_l} \times \mathbb{R_l}$, where $\mathbb{R_l}$ is the lower limit topology?  So trying to figure this out definitely made my brain hurt.  I believe that as a subspace of $\mathbb{R_l} \times \mathbb{R}$, all non-vertical straight lines just inherit the lower limit topology $\mathbb{R_l}$, while vertical lines inherit the standard topology on $\mathbb{R}$.  As for $\mathbb{R_l} \times \mathbb{R_l}$, as far as I can tell, the only difference is that now all straight lines, including vertical ones, inherit the lower limit topology.  My reasoning was basically that for $\mathbb{R_l} \times \mathbb{R}$, open sets on the line all have an initial left end point, since the x-coordinate of this left end point is always captured by the open sets [a,b) in $\mathbb{R_l}$, and this in turn drags the y-coordinate of the initial left end point along for the ride (so to speak).  This is true in all but the vertical line case where there is no shift in the horizontal direction and thus the topology is inherited strictly from $\mathbb{R}$.  As for $\mathbb{R_l} \times \mathbb{R_l}$ it's basically the same argument except now the vertical lines inherit from $\mathbb{R_l}$ as well.  Can someone let me know whether I've reasoned correctly?  Thanks. A certain physics problem I have been working on has turned into a math problem. Particularly, I want to find the solutions of some equation of the form   $$f(x)=ae^{bx}+cx+d = 0$$  where $a, b, c,$ and $d$ are constant, real numbers that come from the physics problem and $x$ will be a real number. I do not know how to find the solutions of an equation of this form. In the special case where $c=0$, the solution is simply  $$x = \frac{\ln(\frac{-d}{a})}{b}$$  but for other values of $c$, I am stumped. If there is no exact form for the roots, is there a relatively simple way to estimate the roots? Beamer in LyX: no sperator option avaiable I have been using beamer in LyX for a while now. Love it. But I just got a new computer, istalled LyX again and when I create a new beamer file (or open an old one) the "separator" option that is used to end a frame is not avaiable.  I do not know if there is something wrong with my installation or if I should install some package, or something else.  Has anybody ever run into this problem as well?  Thank you for the help.  Edited: Thank you for the answers, I basically need to update lyx on the other computers now. How is missing data calculated on Likert Scale? Make \cite{my reference} show name and year I am trying to figure out how to make author's name and year show up every time I make a reference.  For example:  my_bibtex.bib has this entry:  @article{Franklin1999,  author = {Franklin Allen and Risto Karjalainen}, title = {Using genetic algorithms to find technical trading rules}, year = {1999}, volume = {51}, pages = {245-271}, journal = {Journal of Financial Economics}  }   If in my_paper.tex I use this line:  Important result has been found by \cite{Franklin1999}   My output looks like:  Important result has been found by [1]   But I want it too look like:  Important result has been found by Franklin 1999   I there a way to do it?  My bibliographystyle is set to plain  \bibliographystyle{plain}  \bibliography{my_bibtex} Do the predictions of a Random Forest model have a prediction interval? Least rank of a matrix Let $A$ be a $7\times 7$ matrix such that it has rank $3$ and $a$ be $7\times 1$ column vector.  Then least possible rank of $A+(a a^T)$ is? ($a^T$ is transpose of the vector)  Intuitively I think it's $2$ as $a a^T$ has rank $1$, and the most it could affect is one row of $A$. Adding two numbers concatenates them instead of calculating the sum Author information column wise I am using authblk package and I want to achieve following output using this package.