Up navigation key : NullPointerException Java Android
What is a NullPointerException, and how do I fix it?
ReSharper likes to point out multiple functions per ASP.NET page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class? 2D collision detection Let's assume I'm using this character.  (source: ) How would you implement collision detection for it? Using a bounding box doesn't seem to be a good approximation, because the bird's shape is nowhere near a square. I was thinking of having a sort of quad tree data structure inside the object that represents portions of the image. Each leaf could be either false (in case it covers the white/transparent space outside the bird) or true (in case it represents an area of the bird i.e. beak, eye etc). Then somehow test the only obstacle in the scene for collision with the bird. But my problems in my approach are:  I don't know how to initialize the quad tree. Once the quad tree is initialized, I'm not sure how to traverse &amp; use it once the obstacle is within the coordinates of the image.  How would you do collision detection with non-squarish characters? LE: The other approach I've seen was to use multiple bounding boxes. For example I'd have one or a few bounding boxes for the beak, then a few of them for the hair or the tail. But it can get tedious. If this is a valid approach in my case, how would I generate those bounding boxes? I doubt I'd have to have them hardcoded in my program. LE2: I care about fairly precise collisions. I can't imagine how a single bounding box or circle can at least approximate decently that shape, so this approach won't work. Why is this limit $\lim_{n \to \infty}(1 + \frac{1}{n})^n$ equal to $e$? I dont get it, if I look at $$\lim \limits_{n \to \infty}\left(1 + \frac{1}{n}\right)^n = e$$    It seems like it should be $1$ because $1 \over n$ is almost zero and $1^\infty$ is still $1$ I'm currently doing a couple of exercises on logarithmic expressions, and I was a bit confused when presented with the following: $5^{\log_5 17}$.  The answer is $17$, which is the argument of the logarithm in the exponent, but I don't understand the reason why.  A previous question in the exercise was $12^{\log_{12} 144}$, which is pretty straight forward since $\log_{12} 144=2$ and $12^2=144$ but since $\log_5 17$ is an irrational number, I couldn't calculate it the same way.  So my question is, why is $x^{\log_x n}=n$?  [Update]  I've now managed to reason this out and realized how simple it is.  Basically, if $y=\log_x n$, then $y$ is the number that  $x$ must be raised to to become $n$; therefore, if I raise $x$ to that power $y$, I will naturally get $n$.  I guess my problem was that I tried to work out the question mechanically instead of intelligently and that's why I failed, because once I realized that I can't calculate $\log_5 17$, I was stumped.  Now that I reasoned it out, as explained in the previous paragraph, I understand it. Prime divisors of the integer $n^2+n-1$ (using the Legendre symbol) What made me have a question is the following problem.     The prime divisors $p\not=5$ of the integer $n^2+n-1$ are of the form   $10k+1$ or $10k+9$.   I thought $\left(\frac 5 p\right) = 1$, because $5 \equiv 1 \pmod 4$.  So $\left(\frac 5 p\right) = (-1)^{p-1}\left(\frac p 5\right)=1$ by qudratic reciprocity.  Then $p$ should be of the form $2k+1$  But I think there is something wrong, and I have lost.  Is there someone to help me? Getting all the combinations in an array For all types of derivative works, namely:   Movies Novels Comic books Other written works (including RPG materials) Cartoons Video games Derivative movies (such as the infamous Ewok movies and even more infamous )   According to what rules does something become "canon" and who is responsible for the evaluation of a published work? Looking for the title of a book about alien invasion, mining asteroids and using lasers to defend earth What I remember of this novel/series is that the main character creates solar laser satellites and mines asteroids to create more satellites to defend Earth from aliens. Later on, he uses the hollowed out asteroids as a base and eventually as an armored fortress to repulse the alien fleets. I last remember the main character attempting to hollow out more asteroids to defend and attack the aliens eventually. Find the representing matrix with the respect to the standard basis Let $\Bbb R^2$ be a finite-dimensional vector space and $T:\mathbb{R}^2\to \mathbb{R}^2$ a linear operator. Let $[T]_B =  \begin {bmatrix}0 &amp; 0 \\-1 &amp; 1 \end{bmatrix} $ be a matrix representation of $T$ in the basis $B= (1,1),(-1,0)$.   How can I find the matrix $[T]_E$ where $E$ is the standard basis $(1,0),(0,1)$ if the transformation isn't given in the question?  Thanks,  Alan Do I need to license fonts included with my OS? If moderators can view , can we see comments we've deleted? We can see our deleted answers, but why not our deleted comments? I'm looking into using Named Credentials (spring '15) to simplify apex callouts to an external web service.  I actually thought, based on the documentation, that this would help, and I'm referring correctly to the Named Credential in my code and have also given my profile access to the NC, but I'm faced with this error when I do the callout:     System.UnexpectedException: You don't have permission to view this   data. Ask your administrator to set up authentication for the external   data source   This seems to say that NC are tied to the use of External Data Source, which is absolutely unrelated to what I want to do, and the documentation doesn't mention that they are a requirement.  Have any of you run into this error when testing out Named Credentials? Is it possible to make a sequence of renders and give the user the option to cancel the process through the UI at any given time? I'm trying to make a script where I have to render several images of the same scene at the same frame, and write to disk with appropriate names. The problem is that although this works fine with a non-responsive UI, it doesn't work well when the render progress appears in the Blender UI.  I mean,  bpy.ops.render.render()   uses "EXEC_DEFAULT" when called from a script. This leaves a blocked User Interface until the render finishes, meaning that you can't cancel the process, except by killing Blender. The problem is that the render may be too big in resolution, and the user could want to stop the process when realizing that the render could take hours, so the idea is to cancel this process without losing the currently opened project.  If I call,  bpy.ops.render.render("INVOKE_DEFAULT")   I get a nice preview bar in the Info Window with a clickable "X" button. I want the user to be able to press that button to cancel the operation if needed, but for a series of renders (not animation).  The problem here seems to be when trying to loop this command with the INVOKE_DEFAULT context to write several renders. I made a lot of testing, and this way of calling the render operator seems to continue with whatever is next in the script, so it loops very fast and ends before the rendering actually finishes.  I think that I need some way to stop the script and make it wait until render finishes to continue looping with the next ones. I tried the "render_complete" and "render_cancel" handlers, but I can't use them to start a new render or even make the rest of the script wait until the loop of renders is complete. I tried threading and events without success either. Maybe I'm doing something wrong.  import bpy  render = bpy.context.scene.render path = render.filepath = "/tmp/" shots = ["one", "two", "three"]  for x in shots:     render.filepath = path + x     bpy.ops.render.render("INVOKE_DEFAULT", write_still=True) # this doesn't work      # but if I use:     # bpy.ops.render.render(write_still=True)     # without the INVOKE thing, images are written as expected,     # but losing the possibility to see the progress and cancel rendering Is ¬¬(¬¬P → P) provable in intuitionistic logic? Possible to perform cross-database queries with PostgreSQL? What is a feminine version of 'guys'? I commonly use the word 'guys' to refer to a group of males colloquially. It's colloquial but not rude, off putting, condescending, patronizing (though I wouldn't use it with a group of men at a board meeting (hypothetically of course), unless I knew them). So, some that I would not consider as replacements would be    buddies: too old-fashioned dudes: too informal boys: too patronizing men, gentlemen: too formal or false respect   I realized that I had also been using it for any group of people, males and females, even just females. It worked for me and I didn't think of the gender implications, that women might not care for it. No one ever complained, directly or indirectly (rule of life: sometimes people don't complain about things they should).   But it occurred to me (maybe by reading something that sparked realization) that the intended hearers might not all care for it.  What might be a female gendered or non-gendered version of 'guys'?  Some that I've considered don't feel right about (though these may be reasonable answers) are:   dolls: too old-fashioned babes: too informal  ladies: too formal or I've heard from women, too creepy women: too factual girls: too patronizing (as much as 'boys') everyone, you all: too bland y'all: perfectly non-sexist but too regional (might work, but not everywhere)   Hopefully I haven't eliminated all the possibilities -- any suggestions? Spartan 6 DCM unstable clock output The link here refers to the clocking resources of spartan-6 FPGA. I am using the DCM-CLKGEN primitive described in the link, to generate a 8x clock based on an input clock. It works fine as long as the input clock is stable.  But now i sweep the input clock at every 90 us by ±5%. I see that although the DCM does not lose lock, it takes very long (15 to 20 us) to change the output freq after changing the input frequency. This is for me undesirable. Any suggestions?  This question was posted on the xilinx forum and the suggestion was to reset the DCM everytime it loses lock. But the problem is that the DCM is not losing lock  Also, this was earlier posted on stackoverflow and now has been reposted here. Some images shown outside of preview rectange Some images shown outside of preview rectange before uploading, eg: Why was the Holdo manoeuvre not used earlier? This question is related to "The Last Jedi":  The maneuvre that vice admiral Holdo (with the purple hair) uses towards the end of the film seems remarkably effective.   It seems that it would have worked pretty well much earlier. Especially as two other ships were just allowed to run out of fuel and be destroyed.  It seems doing it earlier with different assets would have incurred less losses. Yet nobody seemed to consider it. Any in universe reason why? Differential equation $y''=\frac{y'}{2\sqrt y}$