Please see the error of this program in the image  It is in java swing     blog: solvedprograms.blogspot.com  thanks  anuj    Please see the error of this program in the image  It is in java swing     blog: solvedprograms.blogspot.com  thanks  anuj   import java.applet.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; import java.awt.*; import java.io.*; import java.lang.*;  public class d1 implements ActionListener { JButton jb; JFrame jf;  d1() { button(); frame(); jf.setVisible(true);  }  public void button() { jb=new JButton("p2222222"); jf.add(jb,BorderLayout.EAST); jb.addActionListener(this); }   public void frame() { jf=new JFrame("p2 frame"); jf.setSize(500,500); } public void actionPerformed(ActionEvent ae) { if(ae.getActionCommand().equals(jb.getText())) {  } }  public static void main(String args[])throws IOException { SwingUtilities.invokeLater( new Runnable() {     public void run()     {     d1 a=new d1();     } }                  );   }  }
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 does "calculus" mean? "calculus" and "formal system"  From      a calculus is a formal system that consists of          a set of syntactic expressions (well-formed formulæ or wffs),    a distinguished subset of these expressions (axioms), plus    a set of formal rules that define a specific binary relation on the space of expressions.      From      Formal systems in mathematics consist of the following elements:         A finite set of symbols (i.e. the alphabet), that can be used for constructing formulas (i.e. finite strings of symbols).   A grammar, which tells how well-formed formulas (abbreviated wff) are constructed out of the symbols in the alphabet. It is   usually   required that there be a decision procedure for deciding whether a   formula is well formed or not.   A set of axioms or axiom schemata: each axiom must be a wff.   A set of inference rules.      what is the difference between a formal system, and a calculus, then? I think they are the same? "calculus" and "logic system"  "Calculus" appears in "propositional calculus" and "first-order predicate calculus", which are also called "propositional logic" and "first-order logic" respectively. So I thought "calculus" and "logic" mean the same, and "a logic" is, according to ,      A logical system or, for short, logic, is a formal system together with a form of semantics, usually in the form of model-theoretic   interpretation, which assigns truth values to sentences of the   formal language, that is, formulae that contain no free variables.    But then I saw "calculus" also appears in "lambda calculus", which is also a formal system. I think a lambda calculus isn't a logic system, right? What does "calculus" mean in "lambda calculus"? Furthermore  "calculus" can also mean computational real analysis for first-year college students.   Thanks. Replace values which obey certain criteria Verb agreement with "what" This came up when reviewing a written English exercise, and I realized that I don't entirely trust my intuition on the answer.  Which of the following is correct?  Or are both valid?  (Or is it strongly advisable to rewrite the sentence in some other way?)   "I see what appears to be a man and his son." "I see what appear to be a man and his son." Why can a discontinuous function not be differentiable? Prove that $f$ continuous and $\int_a^\infty |f(x)|\;dx$ finite imply $\lim\limits_{ x \to \infty } f(x)=0$ What are best practices for choosing and pairing fonts? I've always found font selection to be a little bit of a mystery. What factors should be considered when choosing a font? How does one successfully incorporate two fonts into a design?  I realize that some factors will include things like:   Legibility Scalability Appropriateness/Mood/Emotion   However, how does one objectively judge legibility or appropriateness? Are there objective principles that can be applied for font selection? If possible, please list resources or examples in your answers. Studies focused on the effectiveness of different fonts would also be extremely useful. R raster: masking a raster by polygon also remove cells partially covered? I want to mask out a raster based on the values of a polygon: i.e., set to NA all values of the raster that are not covered by the polygons. However, it seems that raster::mask() masks out cells (i.e. set them to NA) even if they are partially covered?  This is similar to the question: , but unlike crop(), mask() does not have the snap="out" option.   Check: here the right point of the triangle touches a cell, yet that cells is masked out.   library(raster) library(sp)  r &lt;- raster(xmn=1, xmx=5, ymn=1, ymx=5, nrows=4, ncols=4) r[] &lt;- 1:length(r)  Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2))) Sr2 = Polygon(cbind(c(4.1,4,2),c(2,3,2)))  SpP = SpatialPolygons(list(Polygons(list(Sr1), "s1"), Polygons(list(Sr2), "s2")), 1:2)  plot(mask(r, SpP)) plot(SpP,  add=TRUE) Can't watch youtube videos with chromium on ubuntu 13.04 64-bit I've digged all over google but I can't find any solution to my problem.   Firefox works pretty well. I have this issue only with chromium and only with youtube. I have no problem watching videos at any other site with chromium.   When I try to watch a video a black screen occurs and after a while it gives me the warning "an error occurred". Weirdly, sometimes when I try a couple of refreshing it starts to play but then the issue occurs again.  I tried removing-reinstalling chromium or the flash plugin but it did not do any good. How to run an encrypted virtual machine? Should flagging a question for closure prevent close-voting? Back in April, I flagged a post as "not a real question".  The post was subsequently closed and reopened, then closed again and finally just reopened a 2nd time a short time ago.  I still firmly believe the post is not acceptable for SO, so I went to use my recently acquired close vote privilege and was greeted with the following messsage:    I specifically clicked close and not flag (and figuring I just clicked in error, I tried again and got the same message).  I do understand that, in the new closing system, flagging for closure is treated very much like a close vote (since it throws it to the close vote queue) except no vote is actually recorded.  My issue is why should by flag be counted as a close vote when I never actually voted to close. Is there a GLM bible? Is there consensus in the field of statistics that one book is the absolute best source and completely covering every aspect of GLM - detailing everything from estimation to inference? how to play wav file in python? Vertical uniform circular motion.. can it really be uniform? This is the picture in my mind:    For centripetal force, I learned that: $T-mg\cos\theta= \frac{mv^2}{r}$  In vertical circular motion, the velocity is naturally going to decrease as kinetic energy is converted to potential energy as the particle moves up the circle- and thus resulting into a non-uniform circular motion.  However, I was told that if tension changes accordingly, the velocity will remain constant(as from the equation). What I do not get about this part of the explanation is that which force will balance mgsinθ (tangential force in the diagram  )? Can't execute .out files, getting permission denied Update Manager is constantly offering me updates (e.g. security fixes, updates from PPAs).  How can I tell my Ubuntu installation to automatically download and install updates whenever they become available? How can I clear the water out of this area? I've sectioned of this area in the sea near my base, and I need to get rid of all the water from it.  From what I've tried the only way I can see to clear it is fully cover one layer, delete the blocks, then go down to the next layer. Is that the only way I can clear the area or is there a better approach?  Ideally I'd like a survival method (if there is a better one), but any commands what could be used I'd like to hear just so I can learn more commands :) Can I write the output the of time difference command to a file? Book recommendation for Atomic & Molecular physics What are some interesting books for a sophomore undergrad about Atomic &amp; Molecular Physics? Help with Spivak Calculus Ch3 Problem 6a Yet again I find myself stuck on a Spivak question. This time it is simply the question that isn't clear to me. It states:  If $x_1, ..., x_n$ are distinct numbers, find a polynomial function $f_i$, of degree $n-1$ which is 1 at $x_i$ and 0 at $x_j$ for $j\neq i$. Hint: the product of all $(x-x_j)$ for $j\neq i$, is 0 at $x_j$ if $j\neq i$. This product is usually denoted by: $$\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x-x_j)$$  To be honest I don't know where to begin. I understand how to create a polynomial equation for a given set of results but this is quite strange. I'm not sure exactly what the author is expecting.  The answer book shows:  $$f_i(x)={\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x-x_j)}/{\prod_{\begin{smallmatrix}{j=1}\\ {j\neq i} \end{smallmatrix}}^n(x_i-x_j)}$$  Which I have expanded out just fine but don't know what to do with. How to reduce vertical space in matrix? I want to reduce the size of the vertical space in matrix environment and have a result something like this     But at present I manage something like below     with the following code    $\begin{bmatrix}     00 &amp; 08 &amp; 10 &amp; 18 &amp; 20 &amp; 28 &amp; 30 &amp; 38 \\     01 &amp; 09 &amp; 11 &amp; 19 &amp; 21 &amp; 29 &amp; 31 &amp; 39 \\     02 &amp; 0a &amp; 12 &amp; 1a &amp; 22 &amp; 2a &amp; 32 &amp; 3a \\     03 &amp; 0b &amp; 13 &amp; 1b &amp; 23 &amp; 2b &amp; 33 &amp; 3b \\     04 &amp; 0c &amp; 14 &amp; 1c &amp; 24 &amp; 2c &amp; 34 &amp; 3c \\     05 &amp; 0d &amp; 15 &amp; 1d &amp; 25 &amp; 2d &amp; 35 &amp; 3d \\     06 &amp; 0e &amp; 16 &amp; 1e &amp; 26 &amp; 2e &amp; 36 &amp; 3e \\     07 &amp; 0f &amp; 17 &amp; 1f &amp; 27 &amp; 2f &amp; 37 &amp; 3f   \end{bmatrix}$   I can change the font using \mathsf{}, but other than that, how I reduce the vertical space between the rows? I did find things like  to increase vertical space between rows in matrix, but not something that can decrease the space.