newbie here,  probably a logical error so, I started with a set of codes without class and then I tried to redo it by using it with the same outcome, but now I keep getting a NullPointerException error on words[i].display(); what am I doing wrong in my codes? below are my before and after codes... thank you in advance for anyone who can help!  also, I tried doing it with a normal string or without loading an external file and it works fine! why do I get it when I start using a loadstrings is there any difference?  BEFORE:     String [] allWords;  int index = 0 ;  float x;  float y;    void setup () {  size (500,500); background (255); //background : white  String [] lines = loadStrings ("alice_just_text.txt"); //imports the  external file String text = join(lines, " "); //make into one long string allWords = splitTokens (text, ",.?!:-;:()03 "); //splits it by word  x = 100; //where they start  y = 150;   }   void draw() {  background (255);  for (int i = 0; i &lt; 50; i++) {  //produces 50 words    x = x + random (-3,3); //makes the words move or shake   y = y + random (-3,3); //makes the words move or shake    int index = int(random(allWords.length));  //random selector of words    textSize (random(10,80)); //random font sizes   fill (0); //font color: black   textAlign (CENTER,CENTER);   text (allWords[index], x, y, width/2, height/2);    println(allWords[index]);    index++ ;    }  }   and the AFTER:  String [] allWords; word [] words; int index = 0 ;  void setup () {  size (500,500); background (255); //background : white textSize (random(10,80)); //random font size  String [] lines = loadStrings ("alice_just_text.txt");  String text = join(lines, " "); //make into one long string allWords = splitTokens (text, ",.?!:-;:()03 "); //splits it by word  }  void draw() {  background (255);  for (int i = 0; i &lt; 50; i++) {  //produces 50 words   words[i].display();    }  } class word { float x; float y;   word(float x, float y) {   this.x = x;   this.y = y;  }  void move() {  x = 120 + random (-3,3); //variables sets random positions  y = 130 + random (-3,3); //variables sets random positions }  void display() {  int index = int(random(allWords.length));  fill (0); //font color: black  textAlign (CENTER,CENTER); //should make it start at the center  text (allWords[index], x, y, width/2, height/2); //positions     }     }
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?
Pivot rows into multiple columns I have a SQL Server instance that has a linked server to an Oracle server. There is a table on the Oracle server called PersonOptions which contains the following data:  ╔══════════╦══════════╗ ║ PersonID ║ OptionID ║ ╠══════════╬══════════╣ ║        1 ║ A        ║ ║        1 ║ B        ║ ║        2 ║ C        ║ ║        3 ║ B        ║ ║        4 ║ A        ║ ║        4 ║ C        ║ ╚══════════╩══════════╝   I need to pivot that data so the results are:  ╔══════════╦═════════╦══════════╦══════════╗ ║ PersonID ║ OptionA ║ Option B ║ Option C ║ ╠══════════╬═════════╬══════════╬══════════╣ ║        1 ║       1 ║        1 ║          ║ ║        2 ║         ║          ║        1 ║ ║        3 ║         ║        1 ║          ║ ║        4 ║       1 ║          ║        1 ║ ╚══════════╩═════════╩══════════╩══════════╝   Any suggestions? When articles are placed after adjectives? I couldn't afford that big a car. It was so warm a day that I could hardly work.   The sentences stated above have been taken from Practical English Usage by Michael Swan. If I write-   I couldn't afford that big car. It was so warm day that I could hardly work.   These make sense. But placement of article a makes these sentences awkward to me. Please say why and when articles are placed after adjectives. And what are the differences among 1, 2 and 3, 4. The square root of a prime number is irrational Show that every prime $p>3$ is either of the form $6n+1$ or of the form $6n+5$ Show that every prime $p&gt;3$ is either of the form $6n+1$ or of the form $6n+5$, where $n=0,1,2, \dots$ As a grad student, I just find it tremendously frustrating when emails are ignored by faculty (both at my institution and at other places). Is this acceptable? I'd be content with a simple response with one line along the lines of "I have read this email and am busy right now, will respond in X days when I can write a more detailed email." I understand that, as a first year student in my field, I'm not really in a position to request anything of anyone, but it just seems like common decency.  Instead, I never hear back, as if my email has been jettisoned off into oblivion. How to enclosure a text block into big square brackets? everybody.  I need to enclosure a text block into big square brackets.  Something like this (I need to replicate it, more or less):   I've read that it could be possible with tikz but I don't know anything about that package.  Even, I found a code that reproduce something similar but with braces in this post:  The code is this:  \documentclass{article} \usepackage{lipsum} \usepackage[many]{tcolorbox} \usetikzlibrary{decorations.pathreplacing}  \newtcolorbox{rightbrace}{%     enhanced jigsaw,      breakable, % allow page breaks     frame hidden, % hide the default frame     overlay={%         \draw [             fill=none, % fill paper             decoration={brace,amplitude=0.5em},             decorate,             ultra thick,             gray,         ]         % right line         (frame.north east)--(frame.south east);     },     % paragraph skips obeyed within tcolorbox     parbox=false, }  \begin{document}  \begin{itemize}     \item First line           \begin{rightbrace}             \item Second line              \item Third line, which is quite long and seemingly tedious in the extreme             \item Fourth line, which isn't as long as the third            \end{rightbrace}     \item Fifth line \end{itemize}  \begin{rightbrace}     \lipsum[1] \end{rightbrace} \lipsum[2]  \end{document}   How could I put the square brackets around a block of text? (Using tikz, tcolobox or whatever package then can be useful for it).  Thanks for your help. Parameterize an SQL IN clause How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?  SELECT * FROM Tags  WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC   In this query, the number of arguments could be anywhere from 1 to 5.  I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to , I am open to that. I've just got my first follower, and I'm wondering if I can get a second person to follow me. Is the game limited to one or two follower(s) or does it allow for a large number of followers? It really seems handy to me to have some followers protect me when I draw attention from a larger group, or when I try to steal something where I really shouldn't... I recently made changes to my fstab file and, upon reboot, noticed I had an error in it. I get the typical mount error on boot. I went to try and modify it by entering the read-only mode but then, since it's read only, I can't access it. Is there a way around this or some way to delete the file so I can use the backup (which I'm pretty sure works)? possessive apostrophe for two things or persons What is the difference between the two sentences below? Are they the same or different in meaning?     Jack and Laura's new house is almost ready.      Jack's and Laura's new house is almost ready.   To my perception, the first says two of them have one house and the second says each one has a (different) house (which is almost ready). Is my perception correct?  EDIT: If I don't use "houses" instead of "house" (for my second interpretation), does it mean the sentence is wrong? "One of them was/were you" If I am talking to somebody about a certain group of people in the third person, and then want to refer to the person I am talking with as one of those people, which do I say?     One of them were you      One of them was you. Show that $\mathbb{Q}(\sqrt{2})$ is the smallest subfield of $\mathbb{C}$ that contains $\sqrt{2}$ "SELECT *" why is it an antipattern On multiple questions here and on stack overflow i saw people saying in the comments and answers that select * from table is almost always an antipattern without any explaination why. Althrough I can sort of deduce why it is an antipattern. I may be looking over a detail that someone else with better understanding of the issue noticed.  So here is my question, why people say that select * is an antipattern. To make sure that we are talking about the same, I would like to post the relevant definitions I know first.  Definitions:  A pair $(G, +)$ where $G$ is a set and  $+: G \times G \rightarrow G$  is called a commutative group if it has all of the following three characteristics:   (associativity): $\forall x,y,z \in G: (x+y)+z=x+(y+z)$ (identity element): $\exists e \in G \forall x \in G: e + x = x = x +e$ (inverse elements): $\forall x \in G \exists x^{-1} \in G: x^{-1} + x = e = x + x^{-1}$ (commutativity): $\forall x,y \in G: x+y=y+x$.     A triple $(\mathbb{K}, +, \cdot)$, where $\mathbb{K}$ is a set and  $+: \mathbb{K} \times \mathbb{K} \rightarrow \mathbb{K}$  $\cdot: \mathbb{K} \times \mathbb{K} \rightarrow \mathbb{K}$  is called a field if it has all of the following three characteristics:   $(\mathbb{K}, +)$ is a commutative group $(\mathbb{K} \setminus \{0\}, \cdot)$ is a commutative group distributive properties: $\forall x,y,z \in \mathbb{K}: x \cdot (y+z) = (x \cdot y) + (x \cdot z)$ and $\forall x,y,z \in \mathbb{K}: (y+z) \cdot x = (y \cdot x) + (z \cdot x)$     $\mathbb{N^+} := 1, 2, 3, 4, 5 ...$ (all positive integers)  $\mathbb{N}_0 := \{0\} \cup \mathbb{N}$ (the natural numbers with zero)  $\mathbb{N}$ can be both: $\mathbb{N^+}$ or $\mathbb{N}_0$.    My question: Does a field exist that has $\mathbb{N}$ as its set?  I know that $(\mathbb{Q}, +, \cdot)$ is a field and I know that $(\mathbb{N}, + )$ is only a commutative semigroup.   But maybe it's possible to define two mappings $\circ, *$ for $\mathbb{N}$ in such a way that $(\mathbb{N}, \circ, *)$ is a field.    Related:     The smallest field containing the integers is the field of rational   numbers.   Source: en-Wikipedia:   I don't know if this is true. If somebody can prove (or at least scribble the proof of) the quote it would be a good answer, I guess. So I am running on Windows 7 (64-bit) Home Premium with 12 GB RAM (Intel Core i7 920).  I have restricted the Page File to 400MB since it was eating up a lot of space om my SSD (that is 80GB).   After that I sometimes get the "low memory"-warning, like this, except for the behold-comment:   When I get those warning I have usually a lot of RAM available; when I check Resource Manager I have over 2GB "Free" and over 2GB "Available" - usually more than that.  The diskspace on all my drives have over 10GB free.  So the question is - why does Windows complain? It actually restarted by computer (hard boot) when it happened, and as I said - lots or RAM available. I am trying to run grep against a list of a few hundred files:  $ head -n 3 &lt;(cat files.txt) admin.php ajax/accept.php ajax/add_note.php   However, even though I am grepping for a string that I know is found in the files, the following does not search the files:  $ grep -i 'foo' &lt;(cat files.txt)  $ grep -i 'foo' admin.php The foo was found   I am familiar with the -f flag which will read the patterns from a file. But how to read the input files?  I had considered the horrible workaround of copying the files to a temporary directory as cp seems to support the &lt;(cat files.txt) format, and from there grepping the files. Shirley there is a better way. Get real client IP in a Servlet What is Ruby's double-colon `::`? Appending the same string to a list of strings in Python How to Deserialize XML document