I'm getting the following error:  java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.sebastian.codivatemanager.User.getName()' on a null object reference at com.sebastian.codivatemanager.FriendAdapter.getView(FriendAdapter.java:57)   on this class:  public class FriendAdapter extends BaseAdapter {  private Context mContext; private User[] mUsers;  public FriendAdapter(Context context, User[] users) {     mContext = context;     mUsers = users; }  @Override public int getCount() {     return mUsers.length; }  @Override public Object getItem(int position) {     return mUsers[position]; }  @Override public long getItemId(int position) {     return 0; }  @Override public View getView(int position, View convertView, ViewGroup parent) {     ViewHolder holder;      if(convertView == null) {         //brand new         convertView = LayoutInflater.from(mContext).inflate(R.layout.user_overview, null);         holder = new ViewHolder();         holder.nameLabel = (TextView) convertView.findViewById(R.id.textViewName);         holder.levelLabel = (TextView) convertView.findViewById(R.id.textViewLevel);          convertView.setTag(holder);     }     else {         holder = (ViewHolder) convertView.getTag();     }      User user = mUsers[position];      holder.nameLabel.setText(user.getName());     holder.levelLabel.setText(user.getLevel() + "");      return convertView; }  private static class ViewHolder {     TextView nameLabel;     TextView levelLabel; } }   The line pointed out is:  holder.nameLabel.setText(user.getName());   I'm trying to display a list using the list adapter "FriendAdapter". This list comes from an array called "mUsers" which is carried over from the class it's included in:              User[] mUsers = new User[array.length() + 1];          for(int n = 0; n &lt; array.length(); n++) {             JSONObject obj = array.getJSONObject(n);             Log.i("Friends", obj.toString());             mUsers[n] = new User();             mUsers[n].setName(obj.getString("name"));             mUsers[n].setLevel(obj.getDouble("level"));         }          FriendAdapter adapter = new FriendAdapter(this, mUsers);         setListAdapter(adapter);
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?
I need to start reading Lucifer comics, but I am having trouble figuring out where to start Do I read the Sandman stuff, or do I jump right into the main comics? Because I really want to maintain continuity, what's the right sequence to ensure that I get every bit of the story? Paris has 3 airports (Orly, Roissy, Beauvais), what are the options to go to or to come from there?  (There is also Vatry (XCR) but there is very few flights and i see the shuttle system is currently off.) How to read high voltages on microcontroller? I saw a lot of times claims that they have to be exhaustive (the examples in such books were always set in such way, that they were indeed), on the other hand I also saw a lot of times books stating they should be exclusive (for example $\mathrm{H}_{0}$ as $\mu_1=\mu_2$ and $\mathrm{H}_{1}$ as $\mu_1&gt;\mu_2$) without clarifying the exhaustive issue. Only before typing in this question I found somewhat stronger statement on the  -- "The alternative need not be the logical negation of the null hypothesis".  Could someone more experienced explain which is true, and I would be grateful for shedding some light on the (historical?) reasons for such difference (the books were written by statisticians after all, i.e. scientists, not philosophers). So I have seen the similar question and answers on here for $x^4 +1$, but I am having trouble extending anything there to this polynomial... I understand it is fairly trivial with Galois theory, but my class has just barely covered Field Extensions, so suffice it to say we have no Galois theory to play with.  I managed to prove it for the primes such that $p \equiv 1, 7 \pmod 8$, by noting that $2$ is a square modulo those primes and thus $x^4 - 2x^2 +1 = (x^2 -1 + 2qx)(x^2 - 1 - 2qx)$ for those $\mathbb{Z}_p$... however, trying to get a similar result for $3 \pmod 8$ and $5 \pmod 8$ has been stumping me for a long time, I am having a hard time making $q^2 = -1$ and $q^2 = -2$ give me something factorable...  I guess the worst part of all of this is that I don't think this solution is even particularly enlightening, in terms of abstract algebra. It's really just some number theory trickery. I don't think my course has prepared me theoretically for this problem, does anyone have an elementary approach to it? I have got hundreds images of products with clear white backgrounds. I would like to change the white background color to become transparent.   Is there a means of batch processing this particular process with Photoshop or any other applications? Quantum Entanglement - What's the big deal? Bearing in mind I am a layman - with no background in physics - please could someone explain what the "big deal" is with quantum entanglement?  I used to think I understood it - that 2 particles, say a light-year apart spatially, could affect each other physically, instantly.  Here I would understand the "big deal".  On further reading I've come to understand (maybe incorrectly) that the spatially separated particles may not affect each other, but in knowing one's properties you can infer the other's.  If that it the case, I don't see what the big deal is... 2 things have some properties set in correlation to each other at the point of entanglement, they are separated, measured, and found to have these properties...?  What am I missing? Is it that the particles properties are in an "un-set" state, and only when measured do they get set?  (i.e. the wave-function collapses).  If this is true - why do we think this instead of the more intuitive thought that the properties were set at an earlier time? A woman's butt was allegedly touched by a man several times during a commute on the MRT.   How to use butt, bottom, buttock and ass? I am confusing with these words. I know there a lot of posts about ram but I'm still confused about it. I'm building a new system and because it was cheaper, I bought a 6GB kit from Corsair. So I'm wondering if I would be better off just using 4GB of it in a dual channel configuration or just add all 6GB (3 DIMMS) in a single channel configuration.   Thanks I deleted an answer which had no upvotes or downvotes, but after some time I saw that my reputation was -2 and the reason is linked to my search engine.    I want to know why this happened and what "linked to my serach engine" means? Why is there no plural 's' after "hundred" or "thousand" in cardinal numbers? Let's say we have the numeral "12,345". Why is it pronounced as "twelve thousand three hundred and forty five" as opposed to "twelve thousands three hundreds and forty five". Are 's's omitted while pronouncing numerals to make the whole thing more succinct and easier to pronounce? Do the beacon lighters really live on top of the mountains? Following this image I found online:    Do the beacon lighters really live on top of the mountains?  It seems really cold on top of some of these mountains and there are no villages or whatsoever. Why doesn't my flash fire from the hot shoe trigger? I have a Yongnuo YN-560 III and a pair of RF-603II (C3) triggers. I have a Canon Rebel T5i.   I put one trigger on the hot shoe.  When this trigger is in TX mode I get a blue comm light and I can fire a test flash using the large test button on the trigger. But when I press the shutter button to take a picture, there's no flash.  The trigger and flash are on Channel 1. The trigger on the hot shoe is set to TRX. TX is fine, TRX gives me no flash. The flash and camera are in M mode.  I don't have a trigger on the flash because the Mark III has a built-in trigger The problem seems to be the camera.  The trigger can talk to the flash but the camera is not sending a flash command through the trigger in the hot shoe to the flash.  Grateful for anything you could suggest. TeXShop and Mac preview crashing when opening latex/beamer built pdfs After updating to Sierra 10.12.4 last week, TeXShop crashes:   when opening an existing .tex document that has a pdf associated to it immediately after compiling a new document, i.e. as soon as a pdf is created.   Furthermore, preview crashes opening almost any pdf that has been created with TeXShop. There is virtually nothing on the internet about it, and the only solution seems to be a complete reinstall of MacOSX (so as to reinstall the supposedly broken preview), which I'd like to avoid if at all possible.  Someone else has described a similar issue, but has not received any responses ().  I would be very grateful for some help, as I can neither produce work, nor look at any at the moment. Many thanks! Kernel of injective group homomorphism If $\phi$ is a homomorphism from the group $G$ with identity $e$ to the group $G'$ with identity $e'$, then $\phi$ is injective if and only if $\ker\phi=$?  I think the $Ker\phi = \{x\in G:\phi(x)=1\}$  because you are looking at an identity then it is all reals $0$ does not work a because if $x=0, e'x=0$  but then i realize it is injective how does that affect the kernel? I wonder  whether there is a function $f\colon\Bbb R\to\Bbb R$ with the folowing characteristic?   for every two real numbers $\alpha,\beta,\alpha\lt\beta$,  $$\{f(x):x\in(\alpha,\beta)\}=\Bbb R$$   I can't  say such a function does not exist, neither can I construct a example  Thanks a lot! How to edit files in a terminal with nano? Sometimes, a graphical text editor like gedit or kate cannot be used (because you're in a virtual console for example). Luckily, there are text editors for the terminal. An easy one is nano, but I cannot understand how to work with it.  If I start nano by running nano, the bottom text is supposed to help me but all I see are things like ^G Get Help    ^O WriteOut.   How can I open text files for editing? How can I save the file? How can I quit the editor without saving the changes? How to edit? I heard that you've to enter some commands to begin editing in vi, is this true for nano too? Sometimes, if I manage to open a file, the text is unreadable due to its colors. How can I disable these colors? (see the image below) In the some files, lines are truncated because those do not fit in the screen. How can I prevent that from happening? (see the image below) Does a car use friction to move? When a car's engine injects fuel into the cylinder chambers, the reaction creates a force that generates rotational momentum to the shaft and over the transmission, it translates that power to the wheels, right?  But, something's bothering me, how does the car actually move, is it dependent on the force of friction? Wheels have a contact with the road in one exact point and when the drive gets to rotate them, a force is exerted on the road in the direction of movement and there is friction that is counteracting it.  Is the key to get a car properly moving to have the drive force equal or less than the force of friction to keep that point locked to the ground and use the rolling of the wheel for translational displacement ie. moving forward? If it's bigger than the force of friction, that would cause the wheels to spin in place?  Am I completely off or am I getting something right? If there's a knowledgeable person on this topic, I'd greatly appreciate some insight, perhaps even a bigger response with some basic vehicle physics. How do I write a correct micro-benchmark in Java? How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related: Solve for $x$ in $6x^2-25x+12+\frac{25}{x}+\frac{6}{x^2}=0$ I simplified to get $6x^4-25x^3+12x^2+25x+6=0$  Or $6 (x^2+1)^2+25x(1-x^2)=0$  Then I substituted $z=x^2+1$, to get $6z^2+25\sqrt{(z-1)}(2-z)=0$  I can't find a way to proceed further.