I have a extended class, in class have a var, I define this by value, but say this is null !!!!  public class CalendarCell extends TextView {      public static final String TAG = "CalendarCell";      protected ArrayList&lt;Integer&gt; cellStates = new ArrayList&lt;&gt;();  public CalendarCell(Context context) {     super(context); }  public CalendarCell(Context context, AttributeSet attrs) {     super(context, attrs); }  public CalendarCell(Context context, AttributeSet attrs, int defStyle) {     super(context, attrs, defStyle); }  @Override protected int[] onCreateDrawableState(int states) {     int newStatesSize = cellStates.size();  // Error here (null)     if (newStatesSize &gt; 0)     {          ...     }     else     {         return super.onCreateDrawableState(states);     } }  public void resetStates() {     cellStates.clear(); }  public void addState(int state) {     if(!cellStates.contains(state))         cellStates.add(state);     } }   I defined 'cellStates' by value.but say this is null. Why???  java.lang.NullPointerException  at yaran.CalendarSection.ViewSection.CalendarCell.onCreateDrawableState(CalendarCell.java:44)
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?
Area 51 is miscounting my proposal followers I know of one person who is following my proposal who doesn't show up on the proposal webpage.    My proposal is for quantitative finance: .  It shows 19 people following the proposal (on the side of the page), and the total listed at the top of the page is 19 followers.  Yet one user is not listed: .  This makes me wonder if other followers are also not being counted? I have a video that was rotated 180° when recorded. Is it possible to correct this with FFmpeg? I'm going to install 64 bit 14.04 on a new machine with something like 1 to maybe 128GB RAM and even more RAM later. How much space should I allocate to the swap partition?   And especially: WHY those recommendations for these numbers?    (None of the existing answers  and  explain any of the why and are a bit dated if we look at 1GB or RAM and up) how to get rid of arm64 in apt W: Invalid 'Date' entry in Release file /var/lib/apt/lists/_var_cuda-repo-8-0-local_Release N: Skipping acquire of configured file 'non-free/binary-arm64/Packages' as repository 'http://repository.spotify.com stable InRelease' doesn't support architecture 'arm64' E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80] E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.88.161 80] E: Some index files failed to download. They have been ignored, or old ones used instead.   After I installed Jetpack for Jetson tx1, my ubuntu constantly tries to fetch arm updates. Is there a way to disable this?  EDIT:   $dpkg --print-architecture amd64  $dpkg --print-foreign-architectures i386 arm64   I see that arm64 is included in foreign architectures. How do I remove it? My wife wants a 4th baby, but I don't How align the qedsymbol after of a big formula in display mode? Notepad ignoring linebreaks Most documents I'm opening in notepad.exe under windows 7 lately, there are no linebreaks... everything just runs together.  The same documents in any other program, even previewed directly in Explorer, will show the linebreaks correctly.  this is happening with many .info files, .css, .js.. but not all of them.   I am guessing it's some kind of character encoding unix line endings something or other, but wondering if there's anything I can do or if anyone else has experienced similar and if I can make notepad work correctly. I prefer it to notepad++/other text editors for certain uses. In terminal emulation applications, pressing CTRL + Left / Right arrows jumps from one word to the previous or next one. Is it possible to have the same functionality in a Linux console, whether it is in text or in framebuffer modes?  In my configuration, the CTRL + arrow keys are transformed into escaped character sequences and not interpreted. We have two iPads, and both of them have Minecraft PE. My son wants to connect the two and play with me. I have absolutely no idea what I am doing here, so I do not know how to do this.   One game says "Broadcast to LAN", and the other one says "Local Server Multiplayer". I have switched both to on.   What do I need to do to be able to play joined? We are both on the same WiFi. If I call finalize() on an object from my program code, will the JVM still run the method again when the garbage collector processes this object?  This would be an approximate example:  MyObject m = new MyObject();  m.finalize();  m = null;  System.gc()   Would the explicit call to finalize() make the JVM's garbage collector not to run the finalize() method on object m? i want to create new event in SharePoint calendar list in which I have some custom columns,i tried below code but it is not working      function bookingRoomForMeeting() {         var ctx = new SP.ClientContext(appWebUrl);//Get the SharePoint Context object based upon the URL           var list = ctx.get_web().get_lists().getByTitle("MyCalendarList"); //Get the List based upon the Title         var listCreationInformation = new SP.ListItemCreationInformation(); //Object for creating Item in the List         listItem = list.addItem(listCreationInformation);         listItem.set_item('Title', $("#txt_Title").val());         var date = $("#txt_startTime").val();         var dateTime = moment(date, 'DD/MM/YYYY HH:mm a').format("MM/DD/YYYY HH:mm a");         listItem.set_item('EventDate', dateTime);         var enddate = $("#txt_endTime").val();         var enddateTime = moment(enddate, 'DD/MM/YYYY HH:mm a').format("MM/DD/YYYY HH:mm a");         listItem.set_item('EndDate', enddateTime);         listItem.set_item('EmailId1', $("#txt_EmailId1").val());         listItem.set_item('EmailId2', $("#txt_EmailId2").val());         listItem.update();         ctx.load(listItem);         ctx.executeQueryAsync(             Function.createDelegate(this, success),             Function.createDelegate(this, fail)            );     } function success() {     alert("Completed"); } function fail() {     alert("operation failed"); }   list am using is SharePoint hosted app list,can any one tell me where am going wrong? This is a question about American English usage of the word "already". As a UK resident I don't completely understand when I hear Americans give commands like "Stop it already!" In the UK the word already is not normally used in the imperative mood and the sentence I've just quoted would leave an English person thinking "If you're saying I've already stopped it why are you asking me to stop it again?" Two electrons, or an electron and a proton, interact with each other because of the Coulomb potential, which can also be seen in the Schrödinger equation (which is the equation that describes the motion for elementary particles).  But how do an electron and a photon interact? Why can a photon kick up an electron to a higher atomic orbital, or why is a photon emitted when an electron jumps down to a lower orbital? A photon do not have any charge, so the interaction cannot be caused by the Coulomb potential. So what is it that causes the interaction, and how does that affect the Schrödinger equation? (Or well, the relativistic version of the Schrödinger equation, since we're dealing with photons.) I've just purchased a new brand laptop with 17 inch size of the screen. I've installed Texmaker and it is messy. The icons are very small and the GUI is not zoomed out automatically to fit the contents of the window. These are pictures         I've already set the size of the icons to medium and the size of apps to 250 (i.e. the recommended size) for  the display.  I'm using Windows 10. Some fonts are blurry and a lot of people are complaining about this problem with no solution from Microsoft. Any suggestions? Looking for a curly script capital A A math book I'm studying uses a symbol and I'd like to be able to reproduce it.  I used detexify to search for it, but was unsuccessful. Most likely it is the letter 'a' in some font I'm not familiar with.   Here's a zoomed in image of the symbol:    Here it is in context: How to solve a difference equation? So I have the difference equation $4y_{k+1} = 2y_k$.  I need to solve this equation, first with the initial condition $y_0 = 0$ and then with the initial condition $y_0 = 2$.  The professor wrote on the answer sheet that applying iteratively the recurrence relation it is easy to check that:  $y_k= (1/2)^k y_0 $.  Since I missed the lecture where he explained this, can somebody explain how to come about with this question?  I imagine that once I get the equation, then the initial condition $y_0 = 0$ gives us the particular solution $y_k = 0$. Thus the other initial condition $y_0 = 2$ is verified by the solution $y_k = 2(1/2)^k$.  Any help on how to get to the equation $y_k= (1/2)^k y_0$ will be appreciated. A non orientable closed surface cannot be embedded into $\mathbb{R}^3$ Encode URL in JavaScript? Why are Icon Overlays (from 3rdParty-Apps) not showing up in the Win8 Explorer? In the Avengers movie, why is Hulk's behaviour inconsistent? In the Avengers movie, when      Bruce Banner is on the helicarrier, he becomes angry and transforms into the Hulk. Black Widow happens to be next to him and even though both are on same team, he attacks her and then Thor.  He becomes hostile to everyone on the ship.  But later on, in the fight against Chitauri troops, Hulk is very comfortably self-controlled.    Why is that?    The only thing I could think of is that it has been many days (a year?) since the Hulk had gotten angry, so he couldn't control himself.    But that's lame to be so puny when Bruce Banner was compared to Stephen Hawking in intelligence.