I don't know what this error means:  Exception in thread "main" java.lang.NullPointerException     at Untitled.main(Untitled.java:16)  class Untitled {  public static void main(String[] args) {      int x=3;      int y=5;      double d=0;      int[][] route = new int[][]{       { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 },       { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 },       { 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 },       { 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 },       { 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }     };      int[][] distance = new int[10][];      for (int i=0;i&lt;route.length;i++) {         for (int j=0;j&lt;route[0].length;j++) {             distance[i][j]=route[i][j]-x;         }      }   } }
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?
How do I connect a PS3 Controller with Xperia P? Recently I bought a new laptop that came with Windows 10 installed but not activated. I use both Windows 10 and Ubuntu 18.04, so I tried making a dual boot with a USB flash drive. It was recognized by the BIOS, I tried Try Ubuntu without installing and Install Ubuntu. With both options the PC freezes, and I need to press the power button. It's shown very fast some errors that are listed below:  [ 0.064522] ACPI Error: Method parse/execution failed \_SB.PCID.RPOB.PXSX, AE_NOT_FOUND (20170831/parse-550)  [ 0.066316] ACPI Error: [_SB.PCID.RPOB.PXSX], Namespace lookup failure, AE_NOT_FOUND (20170831/download2-191)  [ 0.066325] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20170831/psobject-252)  [ 0.246232] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246248] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246260] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246272] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246285] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246297] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246310] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)  [ 0.246322] ACPI Exception: AE_NOT_FOUND. Evaluating _PRS (20170831/pci_link-176)   I'm using NVIDIA GTX 1050 Ti graphics card and Intel i7-8750H processor.  I talked to the customer support and they just said that my laptop might not be compatible with Ubuntu. I also tried Ubuntu 16.04, but there were no changes.  EDIT: Thanks a lot for all the answers, but unfortunatelly I returned the PC to the store, neither the technical support found a solution for the problem, they just said: "Our PCs are just able to work with Windows, anyother OS might work but without our warranty". What price is a limit buy and a limit sell order settled at? A market has an existing limit buy order at $1.00.  The market then receives a limit sell order at $0.95, what price is the transaction settled at? What does this notation mean? F|U If $F$ is a function and $U$ is a set, then what does $F|U$ mean?   In , the Inverse Function Theorem, the notation is used  Also, the file in stating the Lemma 2.14 states that $A \in U$, what does this mean? A set is an element of another set? What is $A$?  EDIT: Could someone kindly explain to me what is going on in Lemma 2.16. How does $\delta$ come into play? I dont see the role in the lemma. I also don't see why this proves one-to-one My wife and I didn't know we're pregnant and in a weekend fun with friends we smoked a bit of weed - we don't usually smoke weed or cigarettes.  This is not something we're regulary doing as I said, but how bad to the fetus can it be ? What is an undefined reference/unresolved external symbol error and how do I fix it? Increase word space between words in small caps What does -y mean in apt-get -y install command? I always see commands like this  apt-get -y install    What is the -y tag for and what is the difference between apt-get install with and without the -y tag? How To Make A Solid Object Drop To The Ground Like It Was Liquid I'm writing an application that allows users to upload images onto the server. I expect about 20 images per day all jpeg and probably not edited/resized. (This is another question, how to resize the images on the server side before storing. Maybe someone can please drop a .NET resource for that in the comment or so).  I wonder now what the best place for storing uploaded images is.   Store the images as a file in the file system and create a record in a table with the exact path to that image. Or, store the image itself in a table using an "image" or "binary data" data type of the database server.   I see advantages and disadvantages in both.  I like a) because I can easily relocate the files and just have to change the table entry. On the other hand I don't like storing business data on the web server and I don't really want to connect the web server to any other datasource that holds business data (for security reasons)  I like b) because all the information is in one place and easily accessible by a query. On the other hand the database will get very big very soon. Outsourcing that data could be more difficult. PBKDF vs HKDF for pretty long key I'm developing a messenger application with encrypted chats.   In the first version of the app I've used PBKDF2 (10000 iterations, SHA1, random salt) to extend a short user password and generate keys to encrypt (AES256) and sign message (HMAC).  In the current version of the app I generate a random 130-bit key and use it instead of a user password. I think that using PBKDF2 with such a key has some overhead.   I see 2 possible ways to improve the current approach:   Keep using PBKDF2 and decrease iterations to 1 or 10. Don't use PBKDF2 and use HKDF instead.   What are the advantages and disadvantages of each approach? Are there any other options? C# Settings.Default.Save() not saving? Why do we say "is it" when asking a question rather than "it is"? What it says on the tin, a foreign friend of mine has asked and I can't tell him; apart from it sounding horrible.  For example:  "Why is it raining today?"   Instead of:  "Why it is raining today?" Dobble card game - mathematical background In  there is a deck of 55 cards. Each of them has 8 symbols on it. There is a total of 50 different symbols and each two cards have one and only one in common.  I am wondering, given a total number of symbols N and a number of symbols on each card K, how do you find the biggest number of cards such that:   on each of those cards there are exactly K of the N symbols, every two cards have one and only one symbol in common. Combine multiple results in a subquery into a single comma-separated value I've got two tables:  TableA ------ ID, Name  TableB ------ ID, SomeColumn, TableA_ID (FK for TableA)   The relationship is one row of TableA - many of TableB.  Now, I want to see a result like this:  ID     Name      SomeColumn  1.     ABC       X, Y, Z (these are three different rows) 2.     MNO       R, S   This won't work (multiple results in a subquery):  SELECT ID,        Name,         (SELECT SomeColumn FROM TableB WHERE F_ID=TableA.ID) FROM TableA   This is a trivial problem if I do the processing on the client side. But this will mean I will have to run X queries on every page, where X is the number of results of TableA.   Note that I can't simply do a GROUP BY or something similar, as it will return multiple results for rows of TableA.   I'm not sure if a UDF, utilizing COALESCE or something similar might work? Is there any way to create a simple txt file without opening the terminal? Is there any way to create a text file without using the terminal at all? If an elephant can apply 250N force and a rabbit can apply 25N force , and if they are pulling each other , then elephant will pull with 250N force and according to newtons third law the rabbit should also pull the elephant with 250N force.then from where do the rabbit got the extra 225N i.e.(250-25=225) force??? can anyone please explain. On the iPod Touch/iPhone, since it is tied to your iTunes account, I am quite sure you can have your bought apps on multiple devices you own (can't test though, iPod Touch was stolen).  However, now I have the Motorola Droid, and am waiting for a tablet, and am considering getting a Nook and rooting it to run my own apps.  Question is, if you buy an app on the marketplace, how is the security done:   Is it tied to your Gmail account so you can share it between devices you own? Is it tied to the device? (Don't break/replace your phone!) As long as it's installed, you're OK? (If you uninstall, or wipe your device, it's gone).   I assume 3 is highly unlikely, though a possibility, so leaving it here as a potential answer to my question. I've done a clean install of 18.04 and I can't open desktop folders, not even the desktop trash can. Anybody else had this issue? I click on the desktop folders (double click) and nothing happens.  Strange enough, I can open  them when using Nautilus and going to home\stackinator\desktop\ or whatever the path is (can't remember at this point). Learn QM algebraic formulations and interpretations I have a good undergrad knowledge of quantum mechanics, and I'm interesting in reading up more about interpretation and in particular things related to how QM emerges algebraically from some reasonable real world assumptions. However I want to avoid the meticulous maths style and rather read something more meant for physicists (where rigorous proofs aren't needed and things are well-behaved ;) ) I.e. I'd prefer more intuitive resources as opposed to the rigorous texts.       Can you recommend some reading to get started?