StudentTest.java: Has my Main(), tests the classes I've set up.  public class StudentTest {      public static void main(String args[])      {         Student s1 = new Student("Matt", "Patitz");         s1.setMidterm(78, "B");   Only the first couple lines because the error is on that last line.  Student.java: The Student class, includes the setMidterm(int, String) method I'm trying to call  import java.util.Scanner;  public class Student {     Scanner input = new Scanner(System.in);     private String FirstName;     private String LastName;     private Exam Midterm;     private Exam FinalExam;     private Coursework Homework;     private Coursework InClass;      public Student(String firstName, String lastName){         FirstName = firstName;         LastName = lastName;     }     public void setMidterm(int score, String grade){          Midterm.setScore(score);         Midterm.setLetterGrade(grade);     }   Again, not the whole class file. The error is on Midterm.setScore(score);  Exam.java: The Exam class, includes the setScore(int) method.  public class Exam {      private int Score;     private String LetterGrade;      public Exam(int score, String letterGrade){         if(score&gt;100){             Score=100;         } else if(score&lt;0){             Score=0;         } else {             Score=score;         }         if(letterGrade=="A" || letterGrade=="B" || letterGrade=="C" ||              letterGrade=="D" || letterGrade=="F")              LetterGrade=letterGrade;         else{              System.out.println("Invalid Grade");              LetterGrade="F";         }     }           public void setScore(int score){         if(score&gt;100){              Score=100;         } else if(score&lt;0){              Score=0;         } else {             Score=score;         }     }   That should be everything that's relevant from my project. Here's the error message itself:     Exception in thread "main" java.lang.NullPointerException         at Student.setMidterm(Student.java:19)         at StudentTest.main(StudentTest.java:6)   The 19 and 6 lines are the ones I pointed out. Thanks for any help!
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'm looking for an example of a finitely generated module with submodules that are not finitely generated.  I've found  dealing with group (i.e. an example of a finitely generated group with subgroups that are not finitely generated). But I can't figure out whether that question do help to this one.  And I actually want to find a more "module-like" example rather than an example derived from a 'strange' group.  Can you please help? Thank you! Removing Katoolin from Ubuntu 14.04 How do I calculate the distance between two points specified by latitude and longitude?  For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuracies of the approaches available. Smooth shaded model has odd shading I'm currently working on a model of an X-wing that I'm intending for use in a game and running into a bit of trouble with the shading of the mesh. The upper nose is rounded off where the sensor cone attaches, but at the point it reaches the canopy frame it flattens out and meets at a corner.  Everything is fine and dandy when the sides are modeled:    but once I close it off and add the top of the nose, the shading goes to hell:    As you can see, the smoothing gets confused at the lip of the cockpit.  I've tried a couple different means of getting around this, none of which looks right while maintaining the correct shape. The transition from the rounded to flat is a fairly important part of the ship's character, so I don't want to discard the contours, either.  Any tips or suggestions on modeling this area?  Addendum:  If I eliminate that second angle where the canopy frame meets the fuselage as marked in red:    this also fixes the smoothing. However this is not a solution, as the angle is a part of the design. It DOES give me another thought on fixing, but I won't be able to test it until I get home. Can I reduce the MAC size in TLS? The MAC size is reduced to 80 bits in  , which says "forging of MAC values cannot be done off-line: in TLS, a single failed MAC guess will cause the immediate termination of the TLS session."  Question 1 (main question): So can I reduce MAC size to something even smaller, say 32 bits?  Question 2: The truncated_hmac extension does not effect AEAD. Can I reduce the tag's size in AEAD, e.g. GCM or CHACHA-POLY? I would like to run a script from the main ubuntu shell as a different user that has no password.  I have full sudo privileges, so I tried this:  sudo su -c "Your command right here" -s /bin/sh otheruser   Then I have to enter my password, but I am not sure if that script is now really running under that user.  How can I confirm that the script is really running under that user now? Find all natural numbers $n$ and $m$ for which $n^m=(n-1)!+1$ I started a Roth IRA a little while ago, contributing ~$5,000, and I'd like some guidelines on how I should diversify my investments.  Should I invest in stocks or bonds or mutual funds or ETF? What percent should I contribute to these investments?  Additionally, I'm 30 years old, how might my age factor into diversification?  I understand that this is a very subjective question but any suggestions are greatly appreciated. I host am ExpressionEngine based website on a single Amazon EC2 instance in the US East (Virginia) region. I use Ubuntu.    The website allows members to post their content, and displays it for other members and for users who are not logged in.   Goal: I need to begin serving the same website across the globe, equally fast to Hong Kong, New York, and Los Angeles.   I considered two solutions:  1.Setting up three separate EC2 instances for three regions: Virginia, Oregon, and Singapore. Use Amazon Rot53 Geo Location to direct traffic to instances based on the browser's IP address.   Pro: the website will load fast for the region.   Contra: these will be essentially three separate websites. Unless I am mistaken?   Setting up one instance in a region equally remote from all three locations: (Ireliand), and boost the server to the highest performance available.    Pro: It will be the same website for all regions.   Contra: it will cost a lot to make it fast enough.   My challenges:   a) I do not know a way to sync server settings, database, and content between multiple Ubuntu instances in real time. If a knowledgeable person could explain to me how to do that, I would be most grateful.   b) I am not thoroughly familiar with all Amazon AWS resources. Does AWS has a built-in method that would allow me to achieve my goal of serving a single PHP / MySQL based membership website across the globe equally fast in all three chosen locations? Proof of Convergence: Babylonian Method $x_{n+1}=\frac{1}{2}(x_n + \frac{a}{x_n})$ I am a US citizen and have recently visted the UK  with simply a passport which allowed me to vist for 6months I have heard rumors that I am obligated to stay in the US for a Equal amount of time that I have visited the UK before I am able to return, but I am struggling tour no any proof of this obligation .. Am I missing somthing or is it simply not true states that if $f:X \rightarrow Y$ is a morphism of ringed space, $G$ is a locally free $O_Y$-module, then $f^*G$ is a locally free $O_X$ module.     Suppose that $G$ is a locally free $O_Y$ module, hence it is a free $O_Y|_U=O_U$ module. We have an induced map  $$f^{-1}(U) \rightarrow U$$ given by restriction of morphism of ringed spaces.   Hence, as $\bigoplus O_U \simeq G|_U$, $f^*:Mod(O_U) \rightarrow Mod(O_{f^{-1}(U)})$ is functorial, $f^*(G|_U) = (f^*G)|_{f^{-1}(U)}$, we have isomoprhism,  $$ \bigoplus O_{f^{-1}(U)} \simeq (f^*G)|_{f^{-1}(U)} $$ GeoServer cutting off symbols close to tile edges? Find the sum : $\frac{1}{\cos0^\circ\cos1^\circ}+\frac{1}{\cos1^\circ \cos2^\circ} +\frac{1}{\cos2^\circ \cos3^\circ}+......+$ Find the sum of the following :   (i) $$\frac{1}{\cos0^\circ \cos1^\circ}+\frac{1}{\cos1^\circ\cos2^\circ} +\frac{1}{\cos2^\circ \cos3^\circ}+......+\frac{1}{\cos88^\circ \cos89^\circ}$$  I tried :  $$\frac{1}{\cos1^\circ}\left[\frac{\cos(1^\circ-0^\circ)}{\cos0^\circ\cos1^\circ} + \frac{\cos(2^\circ-1^\circ)}{\cos1^\circ\cos2^\circ}+...\right]$$  = $$\frac{1}{\cos1^\circ}\left[\frac{\cos1^\circ\cos0^\circ}{\cos0^\circ\cos1^\circ} - \frac{\sin1^\circ \sin0^\circ}{\sin0^\circ\cos1^\circ} + \frac{\cos2^\circ \cos1^\circ}{\cos1^\circ\cos2^\circ} -\frac{\sin2^\circ \sin1^\circ}{\cos1^\circ\cos2^\circ}...\right]$$  For this, as well, I am not getting any pattern to solve further. Please suggest, thanks. Automorphism group of the quaternion group Let $Q_8$ be the quaternion group. How do we determine the automorphism group $Aut(Q_8)$ of $Q_8$ algebraically? I searched for this problem on internet. I found some geometric proofs that $Aut(Q_8)$ is isomorphic to the rotation group of a cube, hence it is isomorphic to the symmetric group $S_4$. I would like to know an algebraic proof that $Aut(Q_8)$ is isomorphic to $S_4$. How to prove $D^n/S^{n-1}\cong S^n$? In my textbook it is said that the quotient space $D^n/S^{n-1}$ is homeomorphic to $S^n$. I can imagine it for $n=2$, but fail to make a mathematical proof for any dimension.  Can anyone provide a rigorous proof? Conjugate subgroup strictly contained in the initial subgroup? Let $G$ be a group, $H\subseteq G$ a subgroup and $a\in G$ an element of the group. Is it possible that $aHa^{-1} \subset H$, but $aHa^{-1} \neq H$?   If $H$ has finite index or finite order, this is not possible. Let $a,b,c,d,p$, and $q$ be natural numbers such that $ad-bc = 1$ and $\frac{a}{b} &gt; \frac{p}{q} &gt; \frac{c}{d}$.  How prove that  $q \geq b+d$? Read MIME data using PHP How do I make a hole in an object created by me? Please help, youtube tutorials didn't help at all. Hope the image help.