Exception in thread &quot;main&quot; java.lang.NullPointerException      at Module.addStudentMark(Module.java:23)      at Module.main(Module.java:12)  This question is asked for getting student marks Can someone help me to fix the error? Because I cannot find the variable which cause runtime exception. import java.util.Scanner;  class Module {      //limit size of array      final static int SIZE = 10;       public static void main(String args[]){          //Declaration          StudentMark studentMarkList[] = new StudentMark[SIZE];          int count = 0;               addStudentMark(studentMarkList);      }       public Module(){          StudentMark studentMarkList[] = new StudentMark[SIZE];      }       private static void addStudentMark(StudentMark studentMarkList[]){          Scanner sc = new Scanner(System.in);          for(int i = 0; i &lt; SIZE; i++){              System.out.print(&quot;Enter Student &quot; + (i + 1) + &quot; ID: &quot;);              studentMarkList[i].setId(sc.nextLine());              System.out.print(&quot;Enter Student &quot; + (i + 1) + &quot; marks: &quot;);              studentMarkList[i].setMark(sc.nextInt());          }      }  }
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 to make document custom page dimensions? Produce an explicit bijection between rationals and naturals? I remember my professor in college challenging me with this question, which I failed to answer satisfactorily: I know there exists a bijection between the rational numbers and the natural numbers, but can anyone produce an explicit formula for such a bijection? Why don't players get extra xp for large encounters? Based on the table Encounter XP Multipliers from the Basic Rules' DM section, Page 57, when you're building encounters in 5E, you include an XP modifier depending on the number of creatures your PCs will be fighting: 1.5x for a pair, 2x for 3-6 and so on. However, the PCs only get the base XP as a reward.     This doesn't change the actual xp reward ... just your calculations of how difficult the encounter is.   Why is this? After acknowledging that battles vs multiple opponents are more difficult, why not reward them as such? There are many lengths in LaTeX. For instance, \enskip, \enspace, \quad, \parskip, \smallskip, ...  Some of them are mostly used for vertical spacing, some others are mostly used for horizontal spacing, and perhaps some of them are used in both cases. I wonder whether there is a list that indicates the meaning and intended use of each length in LaTeX.  By "intended use" I mean not only whether the length is vertical or horizontal, but in which circumstances it is a good practice to use that specific length. How to use mirror ball to light a scene? What's the right terminology for Unity's UI elements? I've sent a few mails to the Ayatana mailing list regarding some UI suggestions for Unity, but I'm afraid I keep confusing the right terms for the UI element, so I would like to have some clarification.  Answer Index: To be honest I find it hard to keep up with all the changes, and very frequently I have to go look at the privileges list to see whether a user (that I'm looking at, so I have his reputation value) has a certain privilege or not.  However, I still don't know what that user will actually see or how the site actually behaves for that user.  There's quite a number of posts here on meta about "where did this go" and "why can't I" and I can't really tell either way how a site behaves for a user with a reputation level of 2500.  So, I propose the following functionality:   For all users, be able to view the site as though you had less reputation than you actually have Bonus-feature: For all users, be able to use the site at that reputation level, unless some features of low-level users conflict with your actual functionality For mods, be able to view the site as a specific users (be able to see all he sees, exactly the way he sees it), but of course not pose as that user (ie. things I do would still be me)   The UI could be merged into the mod menu and the privileges menu:    (Note, I chose a user randomly, Olivier Pons is in no way related to this question or flags, or whatever that I know of.) Modifying .sty files? Yesterday I did some changes in the layout of my TeX document. I couldn't accomplish the changes until I opened the .sty files and modified some of their code. I am sure this is not the best idea. For one reason, after the packages got an update, I will have to modify the file again (and again and again).  Another way would be to create my own version of that .sty file and call that instead of the original one, but this might not be the best idea either. (again: at least the updates speak against it)  How can I accomplish the following changes by adding code to a local file (e.g. my .tex preamble) instead of changing global files (like the package .sty files)?  I wanted to change the following lines in ledmac.sty:  \def\printlines#1|#2|#3|#4|#5|#6|#7|{\begingroup   \setprintlines{#1}{#2}{#3}{#4}{#5}{#6}%   \ifl@d@pnum #1\fullstop\fi   \ifledplinenum \linenumrep{#2}\else \symplinenum\fi     %% #2 into: \arabtxt{\n{#2}}   \ifl@d@ssub \fullstop \sublinenumrep{#3}\fi   \ifl@d@dash \endashchar\fi   \ifl@d@pnum #4\fullstop\fi   \ifl@d@elin \linenumrep{#5}\fi   \ifl@d@esl \ifl@d@elin \fullstop\fi \sublinenumrep{#6}\fi \endgroup}   The second thing is a line in ledpar.sty:  \newcommand*{\l@dlinenumR}{%   \numlabfont\linenumrepR{\line@numR}\Rlineflag%       %% numlabfont into: numlabfontR   \ifsublines@     \ifnum\subline@num&gt;\z@       \unskip\fullstop\sublinenumrepR{\subline@numR}%     \fi   \fi}   (In the latter case, just adding \renewcommand with the modified code did not work.) Checking to see if a user has a licence for a managed package So I'm aware that there is a method on UserInfo called isCurrentUserLicensed which lets you check if the user running the code has a licence for a namespace that you specify, i.e. for a particular managed package.  What I want to know is whether there is a way I can test to see if some other user (assume I have their ID) has a licence for a particular package. Has anybody found a way to do this? What file sizes and formats are most appropriate for enlarging and projecting an image onto a large wallspace for painting? One-sided limits of $f'(x)$ at a point vs. one-sided limits of the difference quotient at that point I know that if a function is piecewise, then when differentiating it one needs to deal separately with the points of intersection of the pieces, because the derivative may not be defined there.  Also, if a one-sided limit of $f'(x)$ at these "crucial points" is infinite or doesn't exist, it doesn't preclude the limit of the difference quotient from existing and being finite. For example, take $f(x)=x^2\sin\frac1x, f(0)=0$: $f'(x)= 2x\sin\frac1x-\sin\frac1x $ has no limit as $x\to0$ but $\lim\limits_{h\to0}\frac{f(h)-f(0)}{h}=0=f'(0)$.  On the contrary, looking at $f(x)=\sin x +\lvert \sin x\rvert $ on $[0,2\pi]$ one has $f'(x)=2\cos x$ on $(0,\pi) $ and $f'(x)=0$ on $(\pi,2\pi)$ so $\lim\limits_{h\to0^+}f'(\pi+h)\ne\lim\limits_{h\to0^-}f'(\pi+h)$, but they are both finite. And in this case it's easy to find that they agree with the one-sided limits of the difference quotient. Why? Does the finiteness of the former imply that they agree with the latter? Is this also true if the one-sided limits of $f'$ at the crucial points agree with each other? Indexing redundantly named vector in R Why do I sometimes see a downloading 'pie' icon when viewing photostream photos? it normally shows in the bottom corner as a sort of 'pie' that fills up as the picture is downloaded, similar to the 'app downloading' pie when viewing a downloading app on the home page/s  prior to this the picture resolution is terrible Convergence of a Harmonic Continued Fraction Permission denied in 777 folder john@ubuntu01:~$ sudo ls -l /var/opt/gitlab/git-data/repositories/GL/www.git total 25068 drwxr-xr-x  2 git  git      4096 aug 14 19:58 branches -rw-r--r--  1 git  git        66 aug 14 19:58 config drwxrwxrwx  2 root root     4096 aug 15 14:56 custom_hooks -rw-r--r--  1 git  git        73 aug 14 19:58 description -rw-r--r--  1 git  git        23 aug 14 19:58 HEAD lrwxrwxrwx  1 git  git        47 aug 14 19:58 hooks -&gt; /opt/gitlab/embedded/service/gitlab-shell/hooks drwxr-xr-x  2 git  git      4096 aug 14 19:58 hooks.old.1471193907 -rw-r--r--  1 git  git      1329 aug 15 14:48 index drwxr-xr-x  2 git  git      4096 aug 15 13:58 info drwxr-xr-x 71 git  git      4096 aug 15 14:55 objects -rw-r--r--  1 git  git        98 aug 15 13:58 packed-refs -rw-r--r--  1 git  git  25618530 aug 15 14:03 post-receive.log drwxr-xr-x  5 git  git      4096 aug 14 20:31 refs john@ubuntu01:~$ ls -l /var/opt/gitlab/git-data/repositories/GL/www.git ls: cannot access '/var/opt/gitlab/git-data/repositories/GL/www.git': Permission denied   Here are ACLs  john@ubuntu01:~$ sudo lsattr /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks -------------e-- /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks/post-receive   I have never seen this before. No permission to LS even with 777? I need to share this folder for more convenient development. How can I solve it? Thank you.  EDITED: (here are your requests)  john@ubuntu01:~$ sudo ls -ld /var/opt/gitlab/git-data/repositories/GL/www.git drwxrwxrwx 8 git git 4096 aug 15 14:48 /var/opt/gitlab/git-data/repositories/GL/www.git john@ubuntu01:~$ sudo ls -ld /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks drwxrwxrwx 2 root root 4096 aug 15 14:56 /var/opt/gitlab/git-data/repositories/GL/www.git/custom_hooks   EDITED MORE  sudo ls -ld /var/opt/gitlab/git-‌​data/repositories/GL/‌​www.git ls: cannot access '/var/opt/gitlab/git-‌​data/repositories/GL/‌​www.git': No such file or directory   hmmm... what is this? Curved space-time VS change of coordinates in Minkowski space coloring the page numbers in the table of contents Let users editing a question know if editing it would add it to the reopen queue This is sort of similar to , which was positively received, but was declined for technical reasons. I propose that users who are editing a post that was closed within the last five days be shown a notice on top of the edit form indicating that the post will be added to the reopen queue if edited, and that if one does not plan on editing the post into a state where it can be reopened, one should wait until five days after closure to make the edit. Closed questions are only added to the review queue once per closure by editing, and if a user comes by and makes a minor (yet benign) edit, the diff that reopen reviewers see is just that of the minor edit, and as such they dismiss the task as &quot;Leave Closed&quot;, which prevents it from being added to the queue again by another edit. This deprives the post author (and others interested in seeing the question reopened) of their chance to get the post reopened by editing. While some of these edits may be performed by users using (semi-)automated tools who would thus not see or overlook the warning, this will be a big help because 99%+ of users make edits solely manually and would thus see and possibly respond to such a notice. To help make this request more technically feasible, I propose that it instead only be loaded with the edit form, and that it should only be shown to users who can make binding edits. (Suggested edits occur at the time of approval, and the request to let the reviewers know has already been declined.) Here's an example of what I'm expecting:  This question was recently [closed/marked as duplicate]. This question will be added to a queue for possible reopening if you make this edit. If you are not planning to edit this post into a state where it can be reopened, please wait until [date and time after 70 days] to make your edit. If you are only making edits to the question's tags, please ignore this notice. Why two objects get charged by rubbing? A novel where a woman from "future" of 1999 speaks leet-speak I'm trying to remember the name of a novel/series I read back in the mid-eighties.  I can't remember the author other than that it was a known older author.  I initially thought maybe Saberhagen or Harrison, but can't find it in their bibliographies.  It involved a collection of 4-5 people from different times/places.  The distinctive bit I can remember was that one of them (not the main character) was a cyberpunkish woman from the "future" of 1999 who spoke in futuristic dialect of English that the other characters, including the protagonist, from the "present" (from the eighties) could not understand.  Unfortunately, I don't remember much else of the plot other than that they were making their way through ruins.