I am trying to write a program that lets the user input the size of their class into an array, and then find the average of all the classes.  When I run the program, it prints out the stuff I input into the array, but then it gives me a NullPointerException.  Code:  public void getinput() { //     String dog="dog";     boolean done=true;     int x=0;     int avg=0;     int z=0;     Scanner scan = new Scanner(System.in);     String [] cs = new String [100];     while(done){         System.out.println("Enter the size of one class. When you are done, enter 'quit'");//ask for class sizes          dog=scan.nextLine();         cs[x]=dog;         x++;             if(dog.equalsIgnoreCase("Quit")){                 done=false;      } }  for(z=0;z&lt;cs.length;z++) {     if (!(cs[z].equalsIgnoreCase("quit"))&amp;&amp; !(cs[z]==null)){         System.out.print(cs[z]+", ");     } } for(z=0;z&lt;cs.length;z++) {     if (!(cs[z].equalsIgnoreCase("quit"))&amp;&amp; !(cs[z]==null)){         avg=Integer.parseInt(cs[z])+avg;         System.out.println("");         System.out.println("The average number of students in each classroom is "+avg);         } }
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 studying normalization and have been reading through descriptions and examples online. One Concept that isn't clear to me is if the process can be automated at any point. I understand that a system can't tell you if you schema makes any real-world sense, but it seems likely to me that if you feed a program some arguments say, the functional dependencies, it would be able to do some steps for you.  Say you have a relationship R(A,B,C,D)  and you tell your program that A,B->C and A->D and that the primary key is (A,B)  Now if my understanding serves me correctly it should be possible for a program to identify that A->D violates 2NF because D depends on A and A is a subset of the primary key. That the proper decomposition would be R1(A,B,C) and R2(A,D).   The main book i'm learning from and my instructor indicate these normalization's are done all by hand. Is this correct or can some parts be automated? Find the equation of the plane knowing that it passes through 3 points Origins of the nose-bleed in anime/manga In a similar spirit to my , I wonder who was the first artist to feature a nose-bleed when thinking, shall we say, "provocative thoughts"?  Did it become popularized in anime/manga because of the popularity of the artist's work or because it is a common belief in japanese folklore? Protecting game assets through archiving I'm writing a game in C++ (with OpenGL) and am getting quite far into development. Currently I'm loading the data directly from different directories.  (E.G. I load textures from a /Data/Textures/...png)  This is fine, but not preferable. Ideally I would like to protect these assets without too much of a performance hit. I looked at other games that I own, both Indie and AAA and found that the majority of them archive the data. However, I am unable to access these archives with programs like Winrar Archiver which implies that they have some level of protection.  I'm not particularly knowledgeable in the field of encryption and data storage, so I may be overlooking something obvious but I would like to know how exactly I could achieve something similar.  (I am aware that competent individuals are able to use the GPU to gain access to the data but that's not preventable) Compare given date with today Distributional Laplacian of logarithm and the Dirac delta distribution Consider $S(\mathbb{R}^2)$ .  Consider $F(x) = \displaystyle\frac{1}{2 \pi} \ln|x| , x \in \mathbb{R}^2 - \{ 0 \}$.  I want to prove this  : $\Delta F = \delta $ in $S^{'}(\mathbb{R}^2).$  My try: For every $\varphi \in S({\mathbb{R}}^2)$ we have  $$\langle \Delta F, \varphi\rangle  = \langle F , \Delta \varphi\rangle  = \displaystyle\int_{\mathbb{R}^2} F(x) \Delta\varphi(x) \ dx = \displaystyle\lim_{r \rightarrow + \infty} \displaystyle\lim_{\epsilon \rightarrow 0^{+} } \displaystyle\int_{\epsilon \leq |x| \leq R} F(x) \Delta \varphi(x) \ dx $$  I don't know how to prove this :$\displaystyle\lim_{r \rightarrow + \infty} \displaystyle\lim_{\epsilon \rightarrow 0^{+} } \displaystyle\int_{\epsilon \leq |x| \leq R} F(x) \Delta\varphi(x) \ dx = \varphi (0) = \delta(\varphi)$  I don't know what to do from here. Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.? Surface integral of a scalar over a unit cube. Evaluate the following integral $$\iint_S (x+y+z) \, dS$$  where $S$ is the surface of the cube $[0,1] \times [0,1] \times [0,1]$  Honestly, I don't know what to do. All I know is that you have to evaluate the integral for each of the 6 surfaces of the cube. The normals for them I can do and the equations of the planes, but other than that I couldn't do much.  Can someone break it down for me, please?  PS: No divergence theorem yet for me. Python HTTPS requests (urllib2) to some sites fail on Ubuntu 12.04 without proxy I have an little app I wrote in Python and it used to work... until yesterday, when it suddenly started giving me an error in a HTTPS connection. I don't remember if there was an update, but both Python 2.7.3rc2 and Python 3.2 are failing just the same.  I googled it and found out that this happens when people are behind a proxy, but I'm not (and nothing have changed in my network since the last time it worked). My syster's computer running windows and Python 2.7.2 has no problems (in the same network).  &gt;&gt;&gt; url = 'https://www.mediafire.com/api/user/get_session_token.php' &gt;&gt;&gt; response = urllib2.urlopen(url).read()   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen     return _opener.open(url, data, timeout)   File "/usr/lib/python2.7/urllib2.py", line 400, in open     response = self._open(req, data)   File "/usr/lib/python2.7/urllib2.py", line 418, in _open     '_open', req)   File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain     result = func(*args)   File "/usr/lib/python2.7/urllib2.py", line 1215, in https_open     return self.do_open(httplib.HTTPSConnection, req)   File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open     raise URLError(err) urllib2.URLError: &lt;urlopen error [Errno 8] _ssl.c:504: EOF occurred in violation of protocol&gt;   What's wrong? Any help is appreciated.  PS.: Older python versions don't work either, not in my system and not in a live session from USB, but DO work in a Ubuntu 11.10 live session. How can I typeset this accented, dotless i? See the rough sketch above. I am able to typeset the accented i shown in the middle (for which I used the \v macro) and, obviously, the plain and simple i shown on the left also. However, I can't figure out how to typeset the one shown on the right. How can I do that? My network icon is always a question mark in both wired and wireless connection but everything network related works correctly. What is the purpose of -e in sed command? I can't find any documentation about the sed -e switch, for simple replace, do I need it?  e.g.  sed 's/foo/bar/'   VS  sed -e 's/foo/bar/' VLC Media Player Green Line I am using Ubuntu 14.10 64bit and the latest version of VLC media player, when I play a video (MP4, MKV AVI etc... it doesn't matter) at the bottom of the screen there is a green line It isn't an issue with my OS, YouTube, and the default media player work fine. Has anyone else had this issue? and if so is there a fix or is it just a software bug? Force LaTeX image to appear in the section in which it's declared Possible Duplicates:           How can I force an image in a LaTeX documents to appear in the section in which I declared it?  I don't want that an image about "Section A" to appear in "Section F". :(  I actually include an image with  \begin{figure}[ht] \begin{center} \includegraphics[scale=0.7]{./img/RobotManipulator3D_WorkSpace.png} \end{center} \caption{3D View of the robotic workspace (in red).} \label{Img:3DRobotWorkspace} \end{figure} Is there a difference between "think of something" and "think about something"? I've also met "have heard of/about something". The validation tab in your script tool properties allows you to put parameters in categories. The :     Put parameters in different categories. Categories are expandable   window shades with a collection of parameters.     I am using the categories to organize my parameters, so I don't care about the expandable/collapsible feature;  it just adds a lot of time to the user.  This is all within a normal toolbox, not a script toolbox.  v10.1    Does anyone know how to have these categories expanded by default?  Here is my only validation code.  I am only utilizing categories.  The other parts are the default.  def initializeParameters(self):     """Refine the properties of a tool's parameters.  This method is     called when the tool is opened."""     self.params[0].category = "General"     self.params[1].category = "General"     self.params[2].category = "Inudaciones"     self.params[3].category = "Cienegas"     self.params[4].category = "DrenajesPrincipal"     self.params[5].category = "DrenajesSensillos"     self.params[6].category = "Inudaciones"     self.params[7].category = "Cienegas"     self.params[8].category = "DrenajesPrincipal"     self.params[9].category = "DrenajesSensillos"     return Modular arithmetic: division, fractions, solving linear congruences I want to ask a question about modular arithmetic. I know, that modular multiplicative inverse exists only if modulo and integer are relatively prime. I want to know, are there any ways of division in modular arithmetic, if modulo and integer aren't relatively prime? I tried to find info about that, but failed. What font is "z" in "z-score"? Page-wide table in two-column mode I want a table that is as wide as the whole page in a document with option twocolumn. The table has to be inserted on the bottom of the page, but that is not necessary.  I've tried:  \begin{table*}[b]   ... \end{table*}   But that puts the table at the end of the document instead of on the same page.  I also tried:  \twocolumn[   \begin{table}[b]     ...   \end{table} ]   But that gives me an error: ! Argument of \@xfloat has an extra }. Combining \twocolumn and the star mark gives the same error.  What's the right way to do this? Can a Rogue (D&D 3.5) use sneak attack on both the first and second attack?