I am building a simple message app, at the moment I would like to view the users image next to their text. I am trying to get the users image from the firebase database. However, whenever I try to getValue() of the an image the app crashes. If I choose to replace imageURI with an image link, then I see it works with that link.  08-27 23:14:02.392 4817-4817/com.myproj.blogapp E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference                                                                          at com.myproj.blogapp.MessageAdapter$1.onDataChange(MessageAdapter.java:79)                                                                          at com.google.android.gms.internal.to.zza(Unknown Source)                                                                          at com.google.android.gms.internal.vj.zzHX(Unknown Source)                                                                          at com.google.android.gms.internal.vp.run(Unknown Source)                                                                          at android.os.Handler.handleCallback(Handler.java:739)                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)                                                                          at android.os.Looper.loop(Looper.java:145)                                                                          at android.app.ActivityThread.main(ActivityThread.java:5938)                                                                          at java.lang.reflect.Method.invoke(Native Method)                                                                          at java.lang.reflect.Method.invoke(Method.java:372)                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)     @Override public void onBindViewHolder(final MessageViewHolder viewHolder, final int index) {      final Message c = messagesList.get(index);      final String sender = c.getFrom();     databaseReference = FirebaseDatabase.getInstance().getReference().child("Users").child(sender);     databaseReference.addValueEventListener(new ValueEventListener() {          @Override         public void onDataChange(DataSnapshot dataSnapshot) {               imageUrl = dataSnapshot.child("image").getValue().toString(); //error on this line             viewHolder.setUserimage(context,imageUrl);               String name = dataSnapshot.child("name").getValue().toString();             viewHolder.displayName.setText(name);          }         @Override         public void onCancelled(DatabaseError databaseError) {         }      });      viewHolder.messageText.setText(c.getMessage());     viewHolder.time.setText(EpochtimeToDateAndTimeString(c.getTime())); }
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?
There is an alignment issue in the stackexchange.com search page .  The bottom bar is missing in the search input box.  Sample URL:   Screen shot for reference:    Firefox version: 54.0b8 (32-bit) OS Version: Windows 10 Pro  Also happens with Chrome latest version. How to accomplish SQL Server 2012+2014 high availability Maybe I'm searching for the wrong thing, but I can't see how I can do this.  I have two servers:   Server A (has SQL Server 2012 installed) Server B (has SQL Server 2014 installed)   Server A provides an API via IIS. The code both inserts and gets data from the database depending on the API call.  Server B does exactly the same for its local database.  I would like to have it so that the two databases are consistent copies of each other. I do believe this is what HA accomplishes.   So a load balancer, for example, might direct API calls to A sometimes, and B sometimes, but the data needs to be consistent either way.  I found some documentation on HA for SQL Server 2012, but not on how to do this for a mixed environment of 2012 and 2014.  Any help or pointers to documentation would be great! Thanks. Been doing tests in sandbox in which I've created about a million accountshares that I need to get rid of for testing.   I'm trying data loader in bulk api mode to export than delete but I keep getting:     InvalidBatch : Failed to process query: QUERY_TIMEOUT: Your query request was running for too long. Trying again later.;   Not sure if I should be waiting longer? Any other options or dataloader configurations I should be looking at?  EDIT  I've been trying with batch apex jobs yet still having issues.   Script  string str='select id from AccountShare where lastmodifiedbyid =\'0050P000007Kfy2\' limit 10000'; sharedeletebatch bdt=new sharedeletebatch(str); Database.executeBatch(bdt); system.debug(bdt);   Batch  global class sharedeletebatch Implements Database.batchable&lt;sobject&gt; {       global final string query;      global sharedeletebatch(string q){            query=q;      }       global Database.QueryLocator start(Database.BatchableContext BC){        return Database.getQueryLocator(query);      }      global  void execute(Database.BatchableContext BC,List&lt;SObject&gt; scope){          delete scope;      }     global void finish(Database.BatchableContext BC){     }   }      First error: [REQUEST_RUNNING_TOO_LONG] Your request was running for too long, and has been stopped. Where to place my local website starting with the 2.4.7 version of apache2? I recently installed Ubuntu 14.04, then I installed lamp-server and placed my webpages in /var/www directory, but when I opened localhost in the browser there was nothing. I think that happened because Zend updated Apache.  Whatever the reason may be, I want to know where to keep my php files so that I can access them from my browser. A Regex that will never be matched by anything Do downvotes on Meta truly mean something different? Is it possible to password protect a zip file created by Windows itself (without external tools?) Using relative paths for Windows shortcuts How to escape braces (curly brackets) in a format string in .NET For natural numbers $a$ and $b$, show that $a \Bbb Z + b \Bbb Z = \gcd(a, b)\Bbb Z $ For natural numbers $a$ and $b$, show that $a \Bbb Z + b \Bbb Z = \gcd(a, b)\Bbb Z $  I just basically said that the gcd of a and b { written as C } obviously divides aZ and bZ, therefore it can be rewritten as  CdZ + CeZ -> C[dZ + eZ] -> CZ[d+e] where Cd=a and Ce=b.   if a and b and C are natural numbers, then  so are d and e. the sum of d and e is an integer, that when multiplied by an integer produces an integer. therefore  CZ[d+e] = CZ, so aZ + bZ = GCD(a,b)Z  { Where C is the gcd(a,b) } Rigorously proving equal tension on both ends There is always one point in introductory mechanics that has been continuously bothering me ever since I had taken my freshman physics course - Why does a massless rope have its tension equal on both ends?  I have been searching for a good explanation on various textbooks at different levels, but none of them provided me a satisfactory explanation. They either   State directly "we assume the string is massless and the pulley has no friction, therefore the tension must be the same throughout the string" without further any elaboration and continue the calculation, Claim without any reasons that "whenever the rope and the pulley are massless and frictionless, the tension will be the same on both sides", or Explain using a lot of hand-waving arguments regarding infinite acceleration, non-zero moment of inertia, etc. , in one line or two.   Although those hand-waving arguments of type $(3)$ do sound quite reasonable to me and will convince me for a while every time I review them. But after a while, I will start feeling not well about this whole tension concept again.  Therefore, I am looking for a rigorous (in the physicist's sense) proof of exactly why and when do the tension in rope will be uniform, and hopefully from that I can clean up all of my conceptual difficulties. How do I remove this wall plate with no visible screws? I'm amazed how complicated this wall plate is to remove. It is made of plastic and accommodates a phone jack and a coaxial cable. Please see the images that accompany this question. I've searched it thoroughly and there are no tabs anywhere on the face or edges to press in. There are no screws. I've pulled on it pretty hard, hoping that it would pop off, but if I pulled any harder it surely would break. Of course, I had the coaxial off while I tried to remove the plate. The brand name on the phone jack part is &quot;KRONE&quot;. Has anyone seen a wall plate like this? If so, how do you remove it? I have to say, I'm absolutely blown away by how ridiculously difficult this is. Any help would be appreciated. I am using eclipse and i get this error--I think it's an error with the way i imported becker.robots What harm can be done with a copy of one's passport? factorization of a^n+1? I'm trying to prove that $a^n+1$ can only be prime if $n$ is a power of $2$. Is there a general factorization of $a^n+1$? Introduce a  "general reference" close reason There is a certain amount of questions that are absolutely trivial in nature: How to format a date, how to concatenate a string, et cetera. Questions that could be solved by taking a look into the manual.  Random examples from the tags I frequent:                What those OPs need is a link to the right manual, which we should give them. But the question serves no purpose. They don't even have a use by being searchable,  because any sane search query would lead to the actual manual as the first hit.  Jeff discusses the possibility of introducing a new close reason for this over at  According to Robert's suggestion there, it could go like this:     general reference: this question is too basic; the answer is indexed in any number of general internet reference sources designed specifically to find that type of information.   Please please implement this.  Add a field (like the "enter duplicate ID here" popup) for users to suggest the correct manual link:    The suggested links would then be shown in a block in the top section of the question, like duplicate links.   Also, the amount of reputation earnable from these trivial questions is appalling. I'm sure a great portion of most high-rep users' points (including mine) is from answering "what was that function for replacing a string again?" type questions. This dilutes the value of reputation as a measure of true expertise a great deal.  I would suggest that answers to questions that get closed as "general reference" are made community wiki retroactively, taking away any reputation earned. I got pretty confused at that question... Can anyone help me understand this question better and/or drop some hints please? Thank you! I would like to render an animation as a series of .png images with transparent backgrounds for use in a video. Is this possible? Shutdown and User button missing in panel I faced with a problem after update,   I missed 2 buttons from above panel, System menu (including shutdown, suspend &amp; …) and User (including log out &amp; …)  how can I restore them !?... Why don't Muggle-born wizards use Muggle technology to fight Death Eaters?