How does it return NullPointerException.? public class TestDogs {      public static void main(String [] args) {          Dog [][] theDogs = new Dog[3][];         System.out.println(theDogs[2][0].toString());     } }  class Dog{ }
What is a NullPointerException, and how do I fix it? 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 $\dot\sim$ notation (dot over tilde) mean, in the context like $x \mathrel{\dot\sim} \mathcal N(0,1)$?  Turns out it is easier to find how to typeset it correctly:  that one should type \mathrel{\dot\sim} instead of simply \dot\sim to fix the spacing issue -- than to find what it actually means. It has only been used  on CV until now; is it standard? Ownership of .Xauthority transferred to root Somehow, while playing around with LightDM and Webkit Greeter, the ownership of the .Xauthority file in my home dir was given to the root user and I couldn't login because I hadn't the privilegues to lock the file.  I was able to regain ownership of the file and I could login again. (After several hours of reinstalling LightDM and it's greeters)  So now everything's working fine again. But I'd like to know how this happened. Is this a bug in LightDM or Webkit Greeter or something else? Is there any freely available pointcloud data?   I'm especially interested in dense clouds of small areas(5m to 100m radius) but anything else would be fine too.   I've found that these pages have very nice and easy to access point cloud data. No matter where I look, I just can't find gnome number [insert number here]. Where can I find every gnome in the game? In reading about the  protocol I noticed how much its proofs-of-work apparently depend on  of the SHA-256 hash function. And so  presumably do many other applications.  How do researchers go about proving uniformity of proposed hash functions? Is it just an empirical matter of running many inputs through the function and observing the distribution of outputs, or can one formally prove the property? Where could one (non-crypto-expert) learn about how such proofs are constructed and look one up e.g. for the case of SHA-256? How can I make my typing "stick" to box side? I heard about nautilus-gksu and would like to install it. Unfortunately, when I try, I get this:  glemi@XPS:~$ sudo apt-get install nautilus-gksu Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package nautilus-gksu   How and where can I get this package? Why did Mann's base explode? After the scuffle between Mann (Damon) and Cooper (McConaughey) in Interstellar, our protagonist gets a hold of a radio and alerts his shipmates to Mann's duplicity. Then his ship explodes. What happened there? I am reading separable extension. I don't quite understand why $\text{char} 0$ fields must be perfect. If $F$ is a $\text{char} 0$ field, $f(x)$ is an irreducible polynomial in $F[x]$. Then why $f$ must be separable? Assume $f$ has multiple roots, say $r$ is a multiple root of $f(x)$. Then $r$ is also a root of $f'(x)$. $r$ is in the splitting field of $f(x)$ over $F$, denote it as $E$. Then why $f$ must divide $f'$? I know $f$ is irreducible but I don't know how the argument goes on. Thanks for any help! When should "no problem" replace "you're welcome" as a response to "thank you"? What's a (big) word or phrase to describe a book that is so good that I cannot put down when I start to read it? I am currently in the process of trying to repair a power supply that has had one of its DC rails fail. A resistor in the PSU has exploded and I am trying to find what value it is.    Band 1: White Band 2: Brown Band 3: Silver (Possibly Grey?) Band 4: Gold Band 5: Green    The weird thing is that the middle band appears to be silver, which should be invalid as far as I can tell. If you assume the silver is grey (although this is unlikely, as there still needs to be a grey colour as well and the band is metallic), it produces a value of resistor which is incredibly uncommon to the point it does not exist (91.8 Ohms 0.5%).  Apologies for the noobie question, I'm just stumped after hours of trying to understand why this is and coming up short :). I have got a specific folder located in "/home/.../reboot/".  I have a series of users that require read-only access to the ever changing files within.  My problem is that the same users are not authorized to view any of the parent directory files.  Right now, the only thing I have in place is that their starting folder is at "/home/.../reboot/" by changing the etc/passwd file; and I need to block all access to other folders.  How could I only give them access to this directory? I'm trying to do a number checker in imessage. We all know that there is no such api, so I'm trying to use the tools at hand. The main took with past issues on this site on this topic.  I made a loop that inserts a number into a string, and by the color of the number (blue - registered, red - missing), using the standard utility Digital Colors Meter determines the color of the number. Then, depending on the color, it either adds a variable with a number from the initial txt file to the new one, or starts the script from the beginning. At least it should be.  But something is going wrong in loop. It checks the color, inserts numbers, everything is fine, but apparently the wrong condition, apparently the wrong data types. It inserts different numbers into the scatter. Some will insert, some will not, regardless of the initial condition. What could be the reason? Where is the error?      tell application "Digital Color Meter" to activate     tell application "System Events"         tell process "Digital Color Meter"             click menu item 1 of menu 1 of menu bar item 4 of menu bar 1         end tell         do shell script "/usr/bin/python -c \"import objc;bndl = objc.loadBundle('CoreGraphics', globals(), '/System/Library/Frameworks/ApplicationServices.framework');objc.loadBundleFunctions(bndl, globals(), [('CGWarpMouseCursorPosition', 'v{CGPoint=dd}')]);CGWarpMouseCursorPosition((" &amp; 1002 &amp; "," &amp; 222 &amp; "));\""         set rgbColors to words of (the clipboard)     end tell     if rgbColors is equal to {"77", "39", "38"} then         exit repeat     else         do shell script "echo " &amp; quoted form of n &amp; " &gt;&gt; /Users/oneone/Desktop/base2.txt"     end if   Only the color check condition for Digital Color Meter is presented here.  Through the do shell, the color is read at the mouse position and the variable is added to the new file. I was shooting the lighting of the city that is visible at the top of the trees if you shoot landscape.  No matter what I do, the image is blurry. What have i done:   ISO 100 Manual focus towards infinity Using a tripod Using really sharp prime &amp; good camera   Basically, everything I could. The only example i have is here, but it is not good, because image is underexposed:    The main question: Why can't night photographs be as sharp as daily photographs (with approperiate exposure times of course)? Quick doubt about multiplying vectors by scalars I've just started studying linear algebra, and I'm having trouble understanding something that apparentely seems obvious to everyone else. My question is, why does multiplying a vector by a positive scalar does not change its direction? I've seen some visual representations of this and it does seem reasonable to me that that should be the case. However, I wonder whether there is a way to actually show it mathematically? In the 2d coordinate plane, for instance, I guess way one of showing that vector $A$ has the same direction of $cA,c&gt;0$ would be to show that the line containing $A$ has the same slope as the one containing $cA$ (I'm not sure if this approach is correct though). However, how to proceed in the case of $n$ dimensions? I think I must be missing out something basic here, but I really can't seem to get my head around it. Any help will be highly appreciated. Thanks very much in advance. How do I prompt users with a GUI dialog box to choose file/directory path, via the command-line? Can a magnetic field be induced without an electric field? Because, as far as I know, a time varying electric field induces a magnetic field an vice versa.  But in the case of conductors carrying currennt, it doesn't seem that electric field varies with time, then how is a magnetic field induced? Question mark or period to end a rhetorical sentence Which makes more sense as end punctuation for the following rhetorical sentence—a period or a question mark?     Maybe you could be a security guard there and enforce whatever the WalMart policy is at that location MySQL: Allow both remote AND local connections