i'm tring to implement In App Billing into my application. I wrote this code.  public class Settings extends PreferenceFragment {      ServiceConnection mServiceConn;     IInAppBillingService mService;     PendingIntent pending;     Intent intent;     Bundle bundle;      @Override     public void onDestroy() {         super.onDestroy();         if (mService != null) {             getActivity().unbindService(mServiceConn);         }        }      @Override     public void onCreate(Bundle savedIstanceState) {         super.onCreate(savedIstanceState);         addPreferencesFromResource(R.xml.settings);          getActivity().getActionBar().setTitle(getString(R.string.settings));           mServiceConn = new ServiceConnection() {                 @Override                 public void onServiceConnected(ComponentName arg0, IBinder arg1) {                     // TODO Auto-generated method stub                        mService = IInAppBillingService.Stub.asInterface(arg1);                 }                  @Override                 public void onServiceDisconnected(ComponentName arg0) {                     // TODO Auto-generated method stub                     mService = null;                 }             };              intent = new Intent("com.android.vending.billing.InAppBillingService.BIND").setPackage("com.android.vending");             getActivity().bindService(intent, mServiceConn, Context.BIND_AUTO_CREATE);              try {                 bundle = mService.getBuyIntent(3, getActivity().getPackageName(), "pro_version", "inapp", "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");                 pending = bundle.getParcelable("BUY_INTENT");                 getActivity().startIntentSenderForResult(pending.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));             } catch (RemoteException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             } catch (SendIntentException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }      }  }   When i launch the application and open this Fragment the app crash with this error:  01-31 19:59:30.969: E/AndroidRuntime(11546): java.lang.NullPointerException: Attempt to invoke interface method 'android.os.Bundle com.android.vending.billing.IInAppBillingService.getBuyIntent(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)' on a null object reference   In the AndroidManifest obviously i've these permissions:   &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;       &lt;uses-permission android:name="android.permission.INTERNET"/&gt;   &lt;uses-permission android:name="com.android.vending.BILLING"/&gt;
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 doesn't a bike/bicycle fall if going with a high speed? The passive with "let" Is there a canonical explanation for how Ant-Man's weight works when he shrinks down that's consistent with the various events depicted in the film?    I think the explanation given in the film is roughly "the suit compresses the space in-between atoms, so your size decreases, your density increases, and your total mass stays the same", however it seems to be portrayed in contradictory ways.  For instance:   He can float in water, and even be sent shooting through the air by a relatively gentle flow of water filling a bathtub.  This wouldn't happen if he retained his original mass, as he'd essentially be the densest thing on the planet and should sink like a stone even in a vat of molten lead. Upon landing after being ejected from the bathtub, the ceramic tile underneath him shatters.  That takes a significant amount of force, and similar effects are used at other points in the movie where he falls onto (or straight through) various things. He's able to get sucked into a vacuum-cleaner.  One that didn't even appear to be a high-end, extra powerful vacuum-cleaner, let alone one capable of sucking up a 200 pound piece of dust.   He can run along the barrel of a gun as someone shoots it, apparently without causing them to drop the weapon or even have trouble continuing to aim it.     Does a more consistent explanation exist in other media, that would fit with the above examples?  Or is this simply a case of the power being made to do whatever happened to be most convenient at the time? Linear functional on a Banach space is discontinuous then its nullspace is dense. Para 5, , by      If the Lord would show thee but this one   thing, -- that to use "thee" and "thou" to a particular person is   proper language, and Scripture language; and that to say "you," is   improper, and arose from pride, and nourisheth pride, and so is of the   world, and not of the Father; and thou should bow thy spirit to him in   this one thing, thou little thinkest what a work it would make within thee, and how strongly the spirit of darkness would fight against thy   subjection thereto. The Lord lead thee as he seeth good, and give thee   faithfully to follow; for else, if the Lord should lead in any thing,   and thou not follow in that thing, his Spirit would be grieved and   vexed thereby, and thy heart in danger of being hardened by the   deceitfulness of sin.   What is the Lord giving thee faithfully to follow?   The grey claims that the reader thinks little of the significance of stressing 'thee' and 'thou' over 'you'. So I'd guess that the Lord is giving 'thee' this caution? If I'm right, why is there no direct object in the bolded? I recognise grammatical differences in the 1600s, but still want to learn. Sometimes it takes too long for the network manager to update to see new wireless AP. Is it possible to change the time interval between checks? Given a compact Hausdorff space $X$, if $a \in X$ is a $G_\delta$ singleton (i.e., $\{ a \}$ is a $G_\delta$ set), then there is a countable local base at $a$.   The point $a$ can be written as countable intersection of open sets let's call $U_{n}$.  How can I use the compactness? What is the next step for proof? Could you give me hint please? Learn Bayesian inference applied to astronomy / astrophysics? Reputation and inbox notification shows up again after refresh This was asked before too. .  Currently I am facing the issue of appearance of reputation notification in above toolbar.  I can see the reputation notification, for every page refresh even after clicking and viewing the notification.  current browser: Chrome Version 36.0.1985.143 m Numbering rows within groups in a data frame Is it true that for algebraic sets $V,W$ we have $I(V \times W ) =I(V) + I(W)$? This is a follow up question to my previous question  Let $k$ be a field and $V \subseteq \Bbb{A}^n$ and $W \subseteq \Bbb{A}^m$ be algebraic sets. Then it should be true that $I(V \times W ) = I(V) + I(W)$ where by $I(V)$ here we mean the extension of $I(V)k[x_1,\ldots,x_{m+n}]$. Now I believe I have proven this (see the proof at the bottom of my question) but when I look at Martin's answer , it is instead claimed that we  actually have  $$I(V \times W )= \sqrt{I(V) + I(W)},$$  and for $I(V) + I(W)$ to be a radical ideal we need $k$ to be algebraically closed.           My question is: What's going on here? I believe my claim is true even without the assumption that $k$ is algebraically closed.           Here's a proof user Sanchez told me of, which I have simplified:       First it is clear that we always have $I(V) + I(W) \subseteq I(V \times W)$. For the reverse inclusion consider a polynomial $f \in I(V \times W)$. Then we can always write $$f = \sum_{i=1}^n f_ig_i$$ where $f_i \in k[x_1,\ldots,x_n]$ and $g_i \in k[x_{n+1},\ldots,x_{m+n}]$. Now take any $b' \in W$. If for all $i$ we have $g_i(b') = 0$ then since $b'$ is arbitrary, $g_i \in I(W)$ for all $i$. Then $f \in I(W) \subseteq I(V ) + I(w)$ and we are done. Otherwise suppose there exists $b \in W$  and $i$ such that $g_i(b) \neq 0$. Then wlog we may suppose that  $g_1(b) \neq 0$.   Next, $\sum f_ig_i(b) = 0 $ on all of $V$ by assumption of $f \in I(V \times W)$. So $\sum f_i g_i(b) = p$ for some $p \in I(V)$. Now write $$f_1 = \frac{ p - g_2(b) f_2 + \ldots g_n(b)f_n}{g_1(b)}.$$  Substituting this for $f_1$ in $\sum f_ig_i$, followed by taking things mod $I(V)$ we get an  expression with only $n-1$ terms $\mod{I(V)}$. Continuing this process we will finally get an expression with $0$ terms $\mod{I(V)}$ so that $f \in I(V)$. This shows $I(V \times W) \subseteq I(V) + I(W)$ which completes the proof. How to store lots of small text in a SQL Server database? Why don't absorption and emission lines cancel out in our Sun? I was looking at  on why  and emission lines don't cancel out:      An experiment shining light on the material and looking at the   reflected spectrum will see absorption lines at those frequencies,   because the relaxation of the excited electrons will emit back   radiation all around randomly, whereas the reflected spectrum is at a   specific angle.   However it is not totally convincing to me. The photons that get emitted towards the center of the Sun (by the electrons in higher energy states that absorbed a photon earlier) would get absorbed again when they hit a different electron (and then re-emitted) and would eventually make it out. So why don't absorption and emission lines cancel out in our Sun? Connecting two DC wallwarts in series - to produce dual DC supply I have two 9 V, 300 mA wallwarts and would like to connect them in series to produce +9 V, 0 V and -9 V. This can be done with two 9 V batteries (as seen below), but can I do this with two non-identical wallwarts? How often do publishers sue researchers for copyright infringement for putting their articles on a personal website? I know that some publishers sometimes send copyright infringement emails to researchers putting their articles on a personal website. How often do publishers actually sue researchers for copyright infringement for putting their articles on a personal website? (assuming the authors didn't have the legal right to do so)  I am mostly interested in United States-based authors, but I am curious about other countries as well. Is there a reason why ls does not have a --zero or -0 option Action to crop a photo with user input. The batch processing I'm stumped.  All I need to do is open my photo, have the action stop to wait for me to decide where the crop should be (to center the important part of the photo), then close that photo so the batch processing can go get the next photo.  I see the "inset stop" is the key, but it never allows me to crop, it just moves on to the next photo. How to lazy load images in ListView in Android Systemd is really slow in comparison to upstart I have been using Ubuntu for a long time now, this is what happened when I use:  Systemd: It performs really bad using systemd: it uses 95% of the CPU all the time and the PC gets really hot. Also it takes a really long time to boot (about 1.5 min, and sometimes it does not boot at all as it has a black screen at boot.)  Upstart: When I tried the upstart options at boot, it performs as expected, booted in seconds, and it was awesome as it should be.  Laptop:   AMD A8 Radeon SSD   Questions:   Why does upstart perform better than systemd? How can I debug systemd? Should I switch to upstart? If yes, how do I do it? What is the best way to animate the camera path? I'm modeling a car driving along a road(speeds up, slows down, and stops at traffic lights to wait till the lights turn green, etc.) What is the best way to animate the camera path for the following scenario?   The camera starts moving from point A, and it takes 500 frames to get to point B. During this 500 frames, the camera first gradually speeds up, then moves at a constant speed, and finally slows down to a complete stop at point B. The next 50 frames, the camera will stay at point B. From frame 551, it takes another 500 frames to get to point C from point B. The camera experiences the same motion as described in #1 (speeds up, constant speed, slows down, then stop.) Again, the camera will stay at point C for another 50 frames.  Point C to D is a curve path ( added using Shift + A -> add path). I want the camera to move along the path from frame 1101 to frame 1200. The camera should have the same motion as before(speeds up, constant speed, slows down, then stop.)   What is the best way to animate the camera path in this case? Is there any Python scripts available and can be applied to case like this? Thank you all in advance for your replies.