I'm trying to use a table to show students data as the following :      public class Main5Activity extends AppCompatActivity {     DataBaseConnection db;     @Override     protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main5);     setContentView(R.layout.activity_main);      final TableLayout stk = findViewById(R.id.datatable);     TableRow tbrow0 = new TableRow(this);     TextView SNo = new TextView(this);     SNo.setText(" Student NO ");     SNo.setTextColor(Color.WHITE);     tbrow0.addView(SNo);     TextView StudentName = new TextView(this);     StudentName.setText(" Student Name ");     StudentName.setTextColor(Color.WHITE);     tbrow0.addView(StudentName);     TextView hmewrk = new TextView(this);     hmewrk.setText(" Homework mark ");     hmewrk.setTextColor(Color.WHITE);     TextView orlmrk = new TextView(this);     orlmrk.setText(" Oral Mark ");     orlmrk.setTextColor(Color.WHITE);     TextView ttlwrkmrk = new TextView(this);     ttlwrkmrk.setText(" Total Works Mark");     ttlwrkmrk.setTextColor(Color.WHITE);     TextView orlexm = new TextView(this);     orlexm.setText(" Oral Exam");     orlexm.setTextColor(Color.WHITE);     TextView exm = new TextView(this);     exm.setText(" Exam ");     exm.setTextColor(Color.WHITE);     TextView exmttl = new TextView(this);     exmttl.setText(" Exam total");     exmttl.setTextColor(Color.WHITE);     TextView textView9 = new TextView(this);     textView9.setText(" Average");     textView9.setTextColor(Color.WHITE);     tbrow0.addView(hmewrk);     tbrow0.addView(orlexm);     stk.addView(tbrow0);     for (String i = db.stdntnmbr();; ) {   When calling the students number value from the database to create rows as the same value, it gives me the following error: The code is :  public class DataBaseConnection {  private final DataBase dataBase;  DataBaseConnection(Context context) {     dataBase = new DataBase(context); } public String stdntnmbr(){     SQLiteDatabase sqLiteDatabase = dataBase.getWritableDatabase();     String uid = DataBase.UID;     Cursor cursor = sqLiteDatabase.query(DataBase.tablename1 , null, uid, null     , null , null , null , null);     StringBuilder stringBuilder = new StringBuilder();     while (cursor.moveToNext()) {         int studentnmbr = cursor.getInt(1);         stringBuilder.append(studentnmbr + " " +"+/n");     }     return String.valueOf(stringBuilder);      the database type is SQLite and I'm using SQLiteOpenHelper. Any help would be greatly appreciated.
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?
Short way for upper triangularization Prove that:$\int_{a}^{b} f(x) dx = b \cdot f(b) - a \cdot f(a) - \int_{f(a)}^{f(b)} f^{-1}(x) dx$ Space between 2 paths in Illustrator How to colorize an image as in the example? Adding values to a C# array Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example:  int[] terms;  for(int runs = 0; runs &lt; 400; runs++) {     terms[] = runs; }   For those who have used PHP, here's what I'm trying to do in C#:  $arr = array(); for ($i = 0; $i &lt; 10; $i++) {     $arr[] = $i; } Is there a statement whose undecidability is undecidable? We know there are statements that are undecidable/independent of ZFC. Can there be a statement S, such that (ZFC $\not\vdash$ S and ZFC $\not\vdash$ ~S) is undecidable? Providing command key-value arguments with commas in value When using commands that allow using key-value pairs, how can one provide an argument value that has commas in it? As an example, say I'm using the \newacronym command from the glossaries package as below:  \newacronym[firstplural = Alphas, Bravos, and Charlies (ABCs), plural = ABCs]{ABC}{ABC}{Alpha, Bravo, Charlie}   Unfortunately, the comma is used to separate key-value pairs so the Bravos, and Charlies (ABCs) portion doesn't get parsed correctly. Is there a way to overcome this? Legendre symbol: Showing that $\sum_{m=0}^{p-1} \left(\frac{am+b}{p}\right)=0$ I have a question about Legendre symbol.  Let $a$, $b$ be integers. Let $p$ be a prime not dividing $a$. Show that the Legendre symbol verifies: $$\sum_{m=0}^{p-1} \left(\frac{am+b}{p}\right)=0.$$  I know that $\displaystyle\sum_{m=0}^{p-1} \left(\frac{m}{p}\right)=0$, but how do I connect this with the previous formula?  Any help is appreciated. I'm new to Ubuntu, it looks like it is better than Windows. Last day I tried to install Kget (the download manager) but during the process my computer suddenly stopped working. So I had to switch it off. After I logged into Ubuntu again I can't install any program. The Ubuntu Software Center says:  Items cannot be installed or removed until package catalog is repaired. Do you want to repair it now?   After I clicked repair it says (after few seconds):  Package operation fails - The installation or removal of a software package failed   I've tried several times, but the same problem occurred. Can anyone tell me a solution for this problem? Including all the jars in a directory within the Java classpath What exactly is 'Dark Matter'? Redirecting stdout to a file you don't have write permission on When you attempt to modify a file without having write permissions on it, you get an error:  &gt; touch /tmp/foo &amp;&amp; sudo chown root /tmp/foo &gt; echo test &gt; /tmp/foo zsh: permission denied: /tmp/foo   Sudoing doesn't help, because it runs the command as root, but the shell handles redirecting stdout and opens the file as you anyway:  &gt; sudo echo test &gt; /tmp/foo zsh: permission denied: /tmp/foo   Is there an easy way to redirect stdout to a file you don't have permission to write to, besides opening a shell as root and manipulating the file that way?  &gt; sudo su # echo test &gt; /tmp/foo How does Linux handle multiple consecutive path separators (/home////username///file)? Force a program to run *without* administrator privileges or UAC? Is there any way that I can force a program that normally requires administrator privileges (via UAC) to run without them? (ie: no UAC prompt and no system-wide access.)  Added: Without modifying the executable itself.    In spite of James's answer, I have found a few ways that it can almost be done:   By modifying the executable I can remove the trustInfo entry from the manifest (or the manifest entirely, so I can use an external one), allowing the program to start without UAC. Unfortunately this modifies the executable, so it exits shortly after due to an internal checksum test. By using Process Explorer I can launch it as a Limited User. However this seems to limit it significantly more than I would like (it runs like Protected Mode IE and so can access significantly less than what my standard un-elevated user can). Has a double slit experiment ever been done using a track chamber or even contemplated? I tried searches and the question has been posed in other fora, but no experiment came up.   Track chambers (cloud chambers, bubble chambers , time projection chambers, solid state detectors like the vertex detectors at LHC)  give the track of the particle as it ionizes the  medium, and could be carried out in geometry after the particle has passed the double slit. The straight track should be pointing back to the slit it came from and its record could be used as the points on the screen in the classical double slit experiment.  The set up as I see it would be the classical setup for single electron through the double slits but instead of a "screen" one has a detector and detects the track.  It should be a long enough detector to get an accuracy less than the slit difference so it could point back to the slit, as the interslit distance is of the order of 100 microns and detectors are giving order of microns accuracies.  This experiment, if possible,  would resolve the controversy whether the detection of the slit destroys the interference pattern or the  at the slits change the boundary conditions and destroy the interference pattern.  An expert's opinion is necessary whether the experiment is possible, whether the energies of the electrons to show interference with a specific d separation is enough to create an accurate track in a solid state detector. If not a cloud chamber would do , but again the energy of the electron would be important because it would have to pass the barrier air/chamber.  It could succeed if the double slits were within a cloud/ bubble chamber; the beam count was low  (10 to twelve per picture) but it was spread in the vertical direction. If the beam could be focused on the slits , it should be doable. Thought Experiment - Poking a stick across a Black Hole's Event Horizon The classical explanation of a black hole says that if you get to close, you reach a point - the event horizon radius - from which you cannot escape even travelling at the speed of light. Then they normally talk about spaghetti.  But here's a thought experiment. What if I have a BH with event horizon radius R such that the gravitational gradient at the event horizon is far too weak for creating pasta. I build a Ring with radius R+x around the BH. Then I lower a pole of length x+d from my ring towards the BH, so that the tip passes beyond the event horizon.  Now what happens when I try to pull the pole back? Access network share from within VBScript eg FileSystemObject Covering ten dots on a table with ten equal-sized coins: explanation of proof Note: . I have moved it here because:   I am curious about the answer The OP has not shown any interest in moving it himself     In the Communications of the ACM, , Peter Winkler asked the following question:     On the table before us are 10 dots,   and in our pocket are 10 $1 coins.   Prove the coins can be placed on the   table (no two overlapping) in such a   way that all dots are covered. Figure   2 shows a valid placement of the coins   for this particular set of dots; they   are transparent so we can see them.   The three coins at the bottom are not   needed.   In the , he presented his proof:     We had to show that any 10 dots on a   table can be covered by   non-overlapping &#36;1 coins, in a problem   devised by Naoki Inaba and sent to me   by his friend, Hirokazu Iwasawa, both   puzzle mavens in Japan.      The key is to note that packing disks   arranged in a honeycomb pattern cover   more than 90% of the plane. But how do   we know they do? A disk of radius one   fits inside a regular hexagon made up   of six equilateral triangles of   altitude one. Since each such triangle   has area $\frac{\sqrt{3}}{3}$, the hexagon   itself has area $2 \sqrt{3}$; since the   hexagons tile the plane in a honeycomb   pattern, the disks, each with area $\pi$,   cover $\frac{\pi}{2\sqrt{3}}\approx .9069$ of the   plane's surface.      It follows that if the disks are   placed randomly on the plane, the   probability that any particular point   is covered is .9069. Therefore, if we   randomly place lots of &#36;1 coins   (borrowed) on the table in a hexagonal   pattern, on average, 9.069 of our 10   points will be covered, meaning at   least some of the time all 10 will be   covered. (We need at most only 10   coins so give back the rest.)      What does it mean that the disks cover   90.69% of the infinite plane? The easiest way to answer is to say,   perhaps, that the percentage of any   large square covered by the disks   approaches this value as the square   expands. What is "random" about the   placement of the disks? One way to   think it through is to fix any packing   and any disk within it, then pick a   point uniformly at random from the   honeycomb hexagon containing the disk   and move the disk so its center is at   the chosen point.   I don't understand. Doesn't the probabilistic nature of this proof simply mean that in the majority of configurations, all 10 dots can be covered. Can't we still come up with a configuration involving 10 (or less) dots where one of the dots can't be covered? What is `$?` ? Is it a variable? The question is pretty straight forward. I can get the exit code of the previous command by using $?. But what exactly is it?  I don't think it is a variable, because you can't have any special characters in the name of variable other than _.  foo?foo=10   will result in the error: foo?foo=10: command not found  So if it is not a variable, what is it? Are there others like it? How does PK know better than Jaggu? In , PK knows about Jaggu's boyfriend that he didn't cheat/left her in Belgium. But PK only read the mind of Jaggu. PK didn't know about Tapasvi's lies. How does he know that Sarfaraz still loves Jaggu in the ending?