When I compile my code, I get the following:  Display ommitted hash table:  Exception in thread "main" java.lang.NullPointerException at Hash.display_hash_table(Hash.java:268) at Driver.main(Driver.java:20)   Here are the relevant portions of code:  public void display_hash_table()  {     System.out.println("Display ommitted hash table: ");      pw.append("Display ommitted hash table: \n");      for (int i = 0; i &lt; table.length; i++) {          System.out.println(String.valueOf(i) + "\t" + table[i].getData());          pw.append(String.valueOf(i) + "\t" + table[i].getData() + "\n");      }      System.out.println("The total number of probes is: " + String.valueOf(this.count_probe) +     "\n");      pw.append("The total number of probes is: " + String.valueOf(this.count_probe) + "\n");  }   and      omitted_words.display_hash_table();   Does anyone have any suggestions on what could possibly be my error?  Thank you!
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 rename multiple files by removing the extension? Textbook clarification: $\log = \ln$ Textbook reads:     All logarithms are natural logarithms: $\log = \ln$.   Does this mean $n\log(n) = n\ln(n)$? For some reason, I can run halt, poweroff, shutdown, and reboot as a regular user without root. How can I fix this? Is it something to do with user groups, or is it a seting somewhere? Story about a trip to a Valley of Sound You can think this of the following as a 3d QFT where we try to calculate the self-energy of two fields. $I$ is a this external self-energy and let us assume it does not depend on the loop momenta which I denote a $\vec{x}=(x,y)$. Consider the following propagator  $$ P(\vec{r}) = \frac{x-ia}{2i^2[\,(x-ia)^2+(y-ib)^2+(z-ic)^2]\,} \,\, \gamma_i. $$ Then we want to calculate $$ I(x) = \int \frac{\,dx \,dy\, dz}{(2\pi)^3} \text{Tr} \left( \frac{x-ia}{2i^2[\,(x-ia)^2+(y-ib)^2+(z-ic)^2]\,}\gamma_x \gamma_x  \right), $$ where Tr$(\gamma_i \gamma_j)=2\delta_{ij}$. Therefore  I am trying to resolve the following integral where $x,y,z \in \mathbb{R}$ and $a,b,c$ are constants (internal self-energies if you wish) in $\mathbb{R}$.  Then, after simplifying the propagator $P(x,y)$ we end up with the following expression for the $x$ component:  $$ I = \frac{1}{2i^2} \int \frac{dxdy}{(2\pi)^2} (x-ia) \int \frac{dz}{2\pi} \frac{1}{[\,(x-ia)^2+(y-ib)^2+(z-ic)^2]\,} $$ but it can be shown that  $$ \int \frac{dq}{(q+iv)^2+w^2} = \frac{\pi}{|w|}\theta(|w|-|v|).  $$ (e.g. see here ) Thus we get that for $|(y-ib)^2+(x-ia)^2|&gt;|a|$, $\theta=1$ (for this is what we are interested about) and then we are left with $$ I = \frac{1}{4i^2} \int \frac{dxdy}{(2\pi)^2} \frac{(x-ia)}{|(x-ia)^2+(y-ib)^2|}.   $$ The question is wether I can make the transformation $$ (x-ia) = q \cos \theta  $$ $$ (y-ib) = q \sin \theta $$ in polar coordinates. Then $dx dy = qdqd\theta$ and the previous integral becomes, assuming $|q|&gt;0$, $$ I = \int_0^{\infty} dq \int_0^{2\pi} d\theta \frac{q \cos \theta}{|q|} =0. $$ Is this correct? I am confused since one can find complex poles in the $I$. If not, what would the correct way to resolve this be? I have a suspicion that this integral should indeed give zero but how can we find this? elementary ring proof with composition of functions and addition of functions as operations Consider the set $\mathcal{F}=\lbrace f\mid \mathcal{f}:\Bbb{R}\to\Bbb{R}\rbrace$, in which an additive group is defined by addition of functions and a second operation defined as composition of functions. The question asks to verify that the resulting structure does not satisfy the ring properties.     This is the question 24.10 from Modern Algebra, by Durbin, 4th edition.  So what I have so far is that all of the properties for the additive group (with addition of functions as the operation here) hold, associativity of the composition of functions hold, and that the failure must come from the distributive laws.  My proof of my claim, so far;  $$1\,\,\,\,\,[(\mathcal{f}\circ\mathcal{g})+\mathcal{h}](\mathcal{x})=\cdots=\mathcal{f}(\mathcal{g}(\mathcal{x}))+\mathcal{f}(\mathcal{h}(\mathcal{x})).$$ ...but,  $$2\,\,[(\mathcal{f}\circ\mathcal{g})+\mathcal{h}](\mathcal{x})=$$ $$3\,\,(\mathcal{f}\circ\mathcal{g})(\mathcal{x})+\mathcal{h}(\mathcal{x})=$$ $$4\,\,\,\mathcal{f}(\mathcal{g}(\mathcal{x}))+\mathcal{h}(\mathcal{x}).$$ ...which brings me to my contradiction of the properties of rings that;  $$5\,\,\,[\mathcal{f}\circ(\mathcal{g}+\mathcal{h})](\mathcal{x})\neq[(\mathcal{f}\circ\mathcal{g})+\mathcal{h}](\mathcal{x}).$$  So my question is, is this the correct path to showing the distributive laws are not obeyed when composition is taken as an operation on $\mathcal{F}$? particularly my proceeding from 2 to 3 to 4 is what i feel uncomfortable about, like i may be missing a step in there.  thanks How to put a brace on the right, not left, to group cases? How can I get a brace on the right, not the left, to group cases, using cases? (I know actual cases look better with the brace on the left, but the items I need to group are not literally cases. They are a set of steps in an algorithm which I want to consider as an item.)  The following puts the brace on the left. All I need to do is to flip it to the right.  \begin{align} \begin{cases} a&amp;=bbb\\ c&amp;=ddddddd\\ e&amp;=ffffffffff \end{cases} \end{align}   Thanks for any help with this! Handling registration ID changes in Google Cloud Messaging on Android A message may be accompanied with a digital signature, a MAC or a message hash, as a proof of some kind.  Which assurances does each primitive provide to the recipient?  What kind of keys are needed? When the phrase is used as an object, why so many native speakers are saying "you and I" instead of "you and me"? I'm not a native speaker but I thought "you and me" is correct. Not sure if this falls into the same category, but "Just between you and me" sounds more natural than "Just between you and I". Computing: $\int_0^1 \sqrt[3]{x\log{\frac{1}x}} \, \mathrm dx$ Is it possible for a system to have negative potential energy? With respect to both gravity and electromagnetism, to the best of my understanding potential energy is added or subtracted from a system based on the distance between two objects such as charged or massive objects.  Would this then imply that when oppositely charged objects or two massive objects are brought together within a small enough radius that the drop in potential energy would be greater than the combined mass of the two objects making the net mass/energy of the system negative? Extracting intersection areas in R I have two polygons. One contains fields(X,Y,Z) and the other contains soil types (A,B,C,D). I want to know what  area of every field contains which type of soil. I tried the following:    library(rgdal) library(rgeos) Field&lt;-readOGR("./","Field") Soil&lt;-readOGR("./","Soil") Results&lt;-gIntersects(Soil,Field,byid=TRUE) rownames(Results)&lt;-Field@data$FieldName colnames(Results)&lt;-Soil@data$SoilType  &gt; Results       A     B     C     D Z  TRUE FALSE FALSE FALSE Y FALSE  TRUE  TRUE FALSE X  TRUE  TRUE  TRUE  TRUE   and achieved good results with it telling me which field contains which soil type. However, how do I get the area instead? Objective-C and Swift URL encoding How to calculate overlap between empirical probability densities? I'm looking for a method to calculate the area of overlap between two kernel density estimates in R, as a measure of similarity between two samples. To clarify, in the following example, I would need to quantify the area of the purplish overlapping region:  library(ggplot2) set.seed(1234) d &lt;- data.frame(variable=c(rep("a", 50), rep("b", 30)), value=c(rnorm(50), runif(30, 0, 3))) ggplot(d, aes(value, fill=variable)) + geom_density(alpha=.4, color=NA)     A similar question was discussed , the difference being that I need to do this for arbitrary empirical data rather than predefined normal distributions. The overlap package addresses this question, but apparently only for timestamp data, which doesn't work for me. The Bray-Curtis index (as implemented in vegan package's vegdist(method="bray") function) also seems relevant but again for somewhat different data.  I'm interested in both the theoretical approach and the R functions I might employ to implement it. Is there anything we can do to locate companions in the world easier? Keeping track of where everyone is is hard.  I could be out in the wasteland while Dogmeat will let me know he found something. That's great, but then it's a chore trying to find him a lot of times. Sometimes, he'll even run ahead and attack enemies and I'll lose sight of him. Only if I leave an area sufficiently far enough, he'll come back and meet with me which isn't always possible. I know I can listen out for him but visual indicators would be better. But none of this works if I sent him to a settlement but needed to find him and he hasn't returned yet.  Is there anything we can do to make locating companions in the world easier? How can I reverse (flip horizontal) a table? How can I do a full shutdown of windows 10 without logging in? I have a computer with both Windows 10 and Ubuntu 17.04 installed on it. I can't log in to Windows, and think it's a problem with the registry. Luckily, there is a way to restore the registry from backup from Ubuntu, but you have to be able to modify files on the Windows partition. Right now, I can't write to the NTFS partition because Windows didn't do a full shutdown.  How can I force windows 10 to do a full shutdown without being able to log in? How to completely uninstall gnome-shell and all extensions? Trigonometry and algebra question Given:   The total length of ad + dc The lengths of each ab, bc and ca That angle adb = angle cdb   How can I work out lengths ad and cd