I'm working on an application in Android Studio that, for some reason, constantly throws the error "Unfortunately, MyApp has stopped".  This only happens if I run the app, make a change to the code while it's running, and then try to run it again.  If I stop the "Run" task and start it again, I don't get this error.  Here's the log:  06-14 15:54:06.213 25752-25752/com.myapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapp, PID: 25752 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.activity_host}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.myapp.MB_item.getItemId()' on a null object reference   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)   at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4077)   at android.app.ActivityThread.-wrap15(ActivityThread.java)   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)   at android.os.Handler.dispatchMessage(Handler.java:102)   at android.os.Looper.loop(Looper.java:148)   at android.app.ActivityThread.main(ActivityThread.java:5417)   at java.lang.reflect.Method.invoke(Native Method)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.myapp.MB_item.getItemId()' on a null object reference   at com.myapp.BT_screen_menuButtons$override.onCreateView(MB_screen_menuButtons.java:119)   at com.myapp.BT_screen_menuButtons$override.access$dispatch(MB_screen_menuButtons.java)   at com.myapp.BT_screen_menuButtons.onCreateView(MB_screen_menuButtons.java:0)   at android.app.Fragment.performCreateView(Fragment.java:2220)   at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)   at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148)   at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1130)   at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1953)   at android.app.FragmentController.dispatchActivityCreated(FragmentController.java:152)   at android.app.Activity.performCreateCommon(Activity.java:6232)   at android.app.Activity.performCreate(Activity.java:6239)   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4077)    at android.app.ActivityThread.-wrap15(ActivityThread.java)    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)    at android.os.Handler.dispatchMessage(Handler.java:102)    at android.os.Looper.loop(Looper.java:148)    at android.app.ActivityThread.main(ActivityThread.java:5417)    at java.lang.reflect.Method.invoke(Native Method)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)   Why would the code behave differently only on subsequent launches and not when I initially run the app?  Additional code:  This is the line (119 of MB_screen_menuButtons.java) that's throwing the error. screenData.getItemId() is clearly where the null value is being passed but I don't understand why it would only be null during an Instant Run update.  debugger.showIt(fragmentName + ":onCreateView JSON itemId: \"" + screenData.getItemId() + "\" itemType: \"" + screenData.getItemType() + "\" itemNickname: \"" + screenData.getItemNickname() + "\"");
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?
Why didn't Harry die in the dark forest? Cannot open adobe reader on Ubuntu 12.10 64bits I downloaded AdbeRdr9.5.1-1_i386linux_enu.deb from the official website and installed it. Nothing wrong happened during the installation. But when I click Adobe Reader's icon, it has no response. Neither can I open a pdf file with Adobe Reader.  I checked that the package name is adobereader-enu:i386. How to completely delete and app from iphone (including all the data and history) So this problem particularly emerged with the Tinder app. I was using Tinder with a user account (A) and one day I logged out and created a new user account (B) which I never succeeded to activate due to sms verification problems, so I decided to login again with my old account. But even when I delete the Tinder app and reinstall it again, it still shows the B account logged in to the app. This means that IOS is somewhere storing a history for this app. Now I'm looking for a way to delete this history.  Note that this question is not necessarily about a certain app, but rather about where IOS stores historical data of apps and how to delete those histories alongside with the app.  P.S: If there are solutions like changing UUID of my i-phone that wouldn't damage my phone (I'm new to iphone so I'm not sure what I'm saying. For instance this jailbreaking thing which I keep hearing about and I'm not sure what it exactly does to my phone, doesn't sound like an I idea that I like), I'm open to them. During the last phase of layout I frequently get a single line or two on a separate page. Rather then pulling the whole paragraph on that last page I would like to "squeeze" the lines on the previous page a bit.  Is there a way to mark the current page to be squeezed a bit if necessary, but let LaTeX reset this marking automatically after the page is done? Sampling with replacement or without replacement I'm writing a program in R that simulates bank losses on car loans.  Here is the questions I'm trying to solve:  You run a bank that has a history of identifying potential homeowners that can be trusted to make payments. In fact, historically, in a given year, only 2% of your customers default. You want to use stochastic models to get an idea of what interest rates you should charge to guarantee a profit this upcoming year.  A. Your bank gives out 1,000 loans this year. Create a sampling model and use the function sample() to simulate the number of foreclosure in a year with the information that 2% of customers default. Also suppose your bank loses $120,000 on each foreclosure. Run the simulation for one year and report your loss.  B. Note that the loss you will incur is a random variable. Use Monte Carlo simulation to estimate the distribution of this random variable. Use summaries and visualization to describe your potential losses to your board of trustees.   C. The 1,000 loans you gave out were for 180,000. The way your bank can give out loans and not lose money is by charging an interest rate. If you charge an interest rate of, say, 2% you would earn 3,600 for each loan that doesn't foreclose. At what percentage should you set the interest rate so that your expected profit totals 100,000. Hint: Create a sampling model with expected value 100 so that when multiplied by the 1,000 loans you get an expectation of 100,000. Corroborate your answer with a Monte Carlo simulation.  I'm confused about how to set up this simulation up from a high level point of view and have the following questions: 1. For part A, Should I create a pool of 1000 customers or should I create a larger pool of customers? 2. For part A, when sampling, do I sample with or without replacement? 3. For part B, I'm confused about how to set up the monte carlo simulation.  Am I varying the size of the customer pool? 4. For part C, I'm not sure how to set up a sampling model that involves the interest rate.  Any advice or guidance would be appreciated.  I'm also thinking that if I fully understood the high level concepts for parts A and B, part C might not be such a mystery. Book ID: Astronauts and Lab Students can create portals through space Reset lightning:input textbox Field Value to Null I am trying to create a button which will update a field value to null (RESET it). However, it's not working and not even giving any error. So when I click on the button, nothing happens.  lc.cmp:  &lt;aura:attribute name="myObj" type="Account" default="{'SObject':'Account'}"/&gt; &lt;lightning:input type="text" name="accountPhn" label="Enter Account Phone" value="{!v.myObj.Name}"/&gt; &lt;lightning:button label="Reset" onclick="{!c.resetMe}"/&gt;   lc.js:  resetMe : function(component, event, helper) {         //alert("Called");         component.set("v.accountPhn","");     }   Appreciate help around this. Accessing Email logs using REST or SOQL My final goal is to generate Impulse Response Functions in R.  I have variables that are non stationary when I set k = 5 in a Unit Root test, and they are cointegrated which to my understanding prompts the use of the VECM, from which the Vec2Var argument is used to then generate IRFs. However, my response functions from this methodology do not decay over time and mostly do not revert to the zero line.  Furthermore, I noticed that when I input first differenced variables into the VECM as opposed to level data above, response function do revert to the zero line. Therefore my first question is: 1) is it appropriate to use differenced variables in a VECM model?  Secondly, as an alternative I am considering restricting the number of lags used in the Unit Root tests so that the variables are not all non-stationary; in this case 2) would the use of VECM be void and the VAR with first differences be a more appropriate model? Again, using differenced data is giving me better response functions that revert to zero in the long run. However, 3) is it ok to use the VAR for stationary/non-stationary data in levels where these variables are still cointegrated?  Also, I am using growth rate variables, 4) should I still long transform all variables and use logs in all tests?  Thank you for the help! Diffeomorphism group of the unit circle I am given to understand that the group of diffeomorphisms of the unit circle, $\operatorname{Diff}(\mathbb{S}^1)$, has two connected components, $\operatorname{Diff}^+(\mathbb{S}^1)$ and $\operatorname{Diff}^-(\mathbb{S}^1)$, the diffeomorphisms that preserve or reverse the canonical (counterclockwise) orientation, respectively.  Question 1: How does one prove that?  Question 2: Given $\Phi, \Psi \in \operatorname{Diff}^+(\mathbb{S^1})$, can one construct an explicit path joining them?  I'd be satisfied already with a proof that we can join $\Psi, \Phi \in \operatorname{Diff}^+ (\mathbb{S}^1)$, without giving the path explicitly. I tried the obvious path, $t \mapsto \dfrac{t\Phi + (1-t)\Psi}{|t\Phi + (1-t)\Psi|}$, but that doesn't seem to work.  Thanks. Execute Java from command line Fantasy piece involving different worlds and a crippled protagonist This is a novel that I think I remember reading somewhere in the 1990s courtesy of my brother (who does not remember the book). Only a few details are coming to mind at the moment. It's a male protagonist. Something was not quite right with his legs, which led to him being nicknamed Frog or Leapfrog due to his usual method of locomotion, which consisted of pushing off from his legs to his hands and vice versa. Something happens and he winds up moving between a number of worlds (I want to say that he fell into a well or a hole in a field). There was a part which stuck with me where he's in a bottomless hole and finds he keeps falling faster and faster without end with the rushing wind becoming actively painful (I don't remember if he actually reaches a terminal velocity or if some aspect of the world prevented it while still allowing the rushing air to affect him physically).  Unfortunately, that's all I can remember. I don't remember whether he eventually gains companions on the voyage or how it ended. The most vivid memory is that of the nonstop falling. I am using gdal_rasterize to create a raster of a huge file containing polygons. I managed to generate the raster file with the right color and with the minimum size to tile it after with the gdal2tile.  gdal_rasterize -of GTiff -co COMPRESS=DEFLATE  -b 1 -b 2 -b 3 -burn 136-burn 46 -burn 17 -co PREDICTOR=2  -co ZLEVEL=9 -ot Byte  -a_nodata 255  -a Niveau  -ts 500000 500000  -l layer W:/layer.shp W:/layer.tif   Tile will be used to overlay Google Maps so the polygon must be transparent.  Has anybody experimented with this usage of gdal_rasterize and succeeded in setting the opacity of the output raster? Decode JWT Token in Apex "You're too clever a man" How to provide a counterexample for if $n$ is prime, then $2^n -1$ is prime I have the following question where I need to provide a counterexample     if $n$ is prime, then $2^n -1$ is prime   The statement is invalid and I now that $2^n -1$ is not prime when $ n = 11$, but other than plugging in prime numbers is there any other way to figure out whether $2^n -1$ is prime if $n$ is prime? What's the action of banging two beers together called? When beers in cans or bottles are banged together in rejoice of the company you're with, what is the action called? MiKTeX and Perl scripts (and one Python script) Some Windows 10 UWP icons not displaying on search, or in settings Show (within ZF Set Theory without choice) that for any sets $A,B,C:$   If $|A|^{|B|} = |B|$, then $|A| = 1 = |B|.$   That is, if there is a bijection from $|A|^{|B|}$ to $|B|$, then  $|A| = 1 = |B|.$  Please help me..