Null pointer exception on implementing banner ads
What is a NullPointerException, and how do I fix it?
How can I compile different .tex file on click on typeset in TeXShop? (MacTeX 2011) My problem is that I want to have different .tex files for the preamble, the presentation aroundings (my target is a beamer PDF file) and the content of the presentation.  Mostly I'll be working on the content file. I even think about partitioning this content .tex file into several chapter files for a better overview. My problem with this solution is that I have to open the presentation.tex file to typeset the whole beamer PDF for looking at the results of my previous changes on the content files. (My presentation.tex file includes the preamble and the content.)  Is there any way to get TeXShop to always typeset one particular file (my presentation.tex) although I'm currently working on a different one (e.g. the content.tex)?  A shortcut? A command in the .tex file? An option in TeXShop? Anything? Was Thanos really committed or just a hypocrite? The title is extremely vague, because this question contains HEAVY spoilers for Avengers: Infinity War, specifically the very last scenes of the movie. I can't reasonably put the entire question in spoiler tags, so consider this your warning.  At the end of the movie, Thanos pretty much wins. He gets all the Infinity Stones, Gamora and Vision have been brutally murdered, and the rest of the cast completely beaten. Nobody could stop him. So he executes his plan.  As far as I know (unless I missed something), his plan is to eradicate exactly half of all mortals in the universe, and from his own words, in a fair lottery (random chance), without taking into account a person's wealth, social status, or anything else. Pure chance decides whether you are sacrified for the greater good or live through this greater good (according to him).  During the movie, Thanos and one of his underling (Ebony Maw) say themselves that being sacrified is an honor and should be appreciated. As you would expect, most people do not appreciate being sacrified.  At the end of the movie, Thanos uses all 6 stones to do a finger snap, deleting half the universe.  The question is: Did he exclude himself from the targets? Was there a 50% chance that Thanos himself would disappear right there?  As far as I know, this is not explicitly answered in the movie itself. I am looking for similar situations in the comics (or in the movie if I happened to miss something) where you could know, or have an educated guess, as to Thanos being the kind of person who follows through to the end, even if it means dying, or the kind of person who gets scared of death when it comes down to it, and comes off as an hypocrite.  Some people also mentioned his "deal" with Strange would make him spare Tony from the snap too. I'm also wondering about that, if there is a link between the two, but it's not the focus of the question.  The reason I'm wondering is that Thanos seems to me like a very extreme utilitarist. Even though he might be wrong about the value of his plan (Do the remaining half really become happy?), in-universe it seemed successful at least once (Gamora's home planet), so his reasoning is not bad, even if the premise might be horribly flawed. Excluding himself from the snap would make it into a straight villain, while considering himself equal to the rest would make him into a wannabe hero with very very evil methods. This makes a huge difference in the interpretation of the movie and his character. Google search results showing up a URL on its search which doesn't exist on the website I am using a keyword to display a website page on google search. After entering the keyword, on the first page of google, I am redirected to a page, whose domain is exactly similar to the website whose page I want to display, but it is showing a page which doesn't even exist on the domain. Also, as similar domain with spam characteristics is also getting displayed.   To practically demonstrate this issue, do follow the below steps.   Go to  Type dolce streichquartett and click on search. The 4th/5th URL has this link http://www.dolce-streichquartett.de/?high_ry=/casinos/de/spielautomaten-casino-bregenz.php, which is no where on the website and looks like spam The 7th/8th link you see is http://deonlinecasino.org/doc/kostenlos-roulette-spielen-spielgeld-ausdrucken.php, which is exactly similar to the above with the title as the keyword but a different domain.   What is this issue and why is this happening? Do small title edits constitute trivial edits? Being a fairly new user something I don't seem to be able to locate is information on whether small edits to the title are considered as trivial edits. I see the usual recommendation when suggesting an edit is:     Avoid trivial, tiny one-letter edits unless absolutely necessary.   I can see the logic in that for most cases, but for example I just read a question with a title containing "Andriod" which would be trivial in one way but also affect the ability of users to locate the question using both the site and external search engines. Would it be frowned upon to suggest an edit for those cases? I am using ECIES (Cryptobox as poncho pointed out) for public key encryption with ECC between Alice and Bob with secret/public keys $(a,A)$ and $(b,B)$ respectively. So Alice encrypts to Bob with  $$ Encrypt(aB,Message) $$  Additionally I would like to encrypt some of Alice's data such that only she can decrypt it. Is it safe to use ECIES to compute a shared secret from Alice's secret and public key as in  $$ Encrypt(aA,Message) $$  I know I could randomly generate a public key, but then I would have to store this key somewhere which I would like to avoid. What is the precise definition of a rigid shape? How to count derangements? I was going through .Suppose that there are n persons who are numbered 1, 2, ..., n. Let there be n hats also numbered 1, 2, ..., n. We have to find the number of ways in which no one gets the hat having same number as his/her number. Let us assume that the first person takes hat i. There are n − 1 ways for the first person to make such a choice. There are now two possibilities, depending on whether or not person i takes hat 1 in return:  A) Person i does not take the hat 1. This case is equivalent to solving the problem with n − 1 persons and n − 1 hats: each of the remaining n − 1 people has precisely 1 forbidden choice from among the remaining n − 1 hats (i's forbidden choice is hat 1).  B) Person i takes the hat 1. Now the problem reduces to n − 2 persons and n − 2 hats.  From this, the following relation is derived: !n = (n - 1) (!(n-1) + !(n-2))  I have a hard time understanding point B and the equation derived. I was trying to understand with an example of 4 people named A, B, C and D and the corresponding hats A, B, C and D. Everyone of them are supposed to wear any hat except their own matching hat i.e. A can wear B, C or D.  If suppose A wears B hat so we will be left with only 3 people and 3 hats. So I can understand "(n-1)!(n-1)" part but what i didn't understand is part B(marked above). Can anyone help? I was studying a  problem where optical light with a wavelength of 500&nbsp;nm travels through a gas with refractive index $n$.  If we look at the equations for wave motion and index of refraction  $$c=\lambda_0\nu\quad\text{(in vacuum)}$$  $$v = \lambda\nu\quad\text{(in medium)}$$  $$n = c/v$$  we see that, if the frequency is constant, the wavelength decreases in the medium compared to vacuum. Is this a consistent property at all frequencies and for all mediums with refractive index real and greater than 1?  Are there dielectrics which change the frequency (still for n > 1), and is there an example of that? How do you install an APK file in the Android emulator? Why is $x^0 = 1$ except when $x = 0$? Are delphi variables initialized with a value by default? I am relatively new to Java, and often find that I need to sort a Map&lt;Key, Value&gt; on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way? I am trying to install Microsoft Office 2013 on Ubuntu 12.04 LTS (32-bit). I have downloaded an iso file of said product and installed wine1.4-i386 using the apt-get command on the terminal.  The question is I don't know the steps how to install it. I can't get much tutorials on Internet how MSOffice2013 can be installed on Ubuntu.  If any versions of wine isn't an option, what other options can be used to run Microsoft Office 2013? Why does mathematical convention deal so ineptly with multisets? What is the use of percent signs (%) at the end of lines? (Why is my macro creating extra space?) I see that the code in many packages and examples contains percent signs % at the end of (many) lines. What are they used for? Do they affect the parsing of those lines? I am a physics Master's student.  I have good grades, with CGPA above 9(/10)(However, all courses in my university are graded on a curve so the actual marks are significantly lower than 90%). This has been my marks throughout my undergraduate and graduate courses and I was happy because this was above average. Also, my summer projects in UG were usually computational and any difficulty I had in theoretical aspects I attributed it to my inexperience in advanced Physics.   However, recently I have started to work on pure theoretical project and while reading for the project I realized that I consistently miss some details from each topic. I understand the general idea, can re-derive most of the equations(with some effort) however when I discuss things with my professor or when I read further topics I realize that I have missed certain key-details. This is exactly similar to the case of me missing a few key questions in my exams and getting that 9 grade point instead of 10(or at-least I think so). I was not worried about this before but now I realize that there is some flaw in the way I study (but I do not know what).   Since I want to apply for Physics PhD I realized that I will need to have solid concepts and it would be best to correct my mistakes but I do not know how or even what could be the reason for my imperfect understanding.  Any direct suggestion would help or even certain general guidelines on what I can do.    Things I've tried recently -   1) I've started to written down almost everything I read. This is slightly laborious but is certainly helping. It also helps me to gloss over the things I read previously when I come back the next day.  2) I completely avoid smartphone when I'm library/study room so that I won't get distracted. Not sure if it helps me solve the above problem but certainly helps me study better in general.  3) I've tried to read the topics from several sources. The books I am reading is somewhat like a collection of research papers and hence does not have a exercises. So I though reading from various sources might help get better ideas but it's not really helping because most other sources are too high level as an introductory text. But this will probably help me in cases where it's practical to do this.  4) Somewhat similar to point (1)- I am trying reread, whenever I can, what I've done until that point. But not sure how much this will help me in filling the gaps. \RequirePackage{filecontents} \begin{filecontents}{\jobname.bib} @article{Arter95,     Author = {David Arter},     Date-Added = {2013-08-11 17:38:06 +0000},     Date-Modified = {2013-09-01 15:13:22 +0000},     Journal = {Journal of Common Market Studies},     Number = {3},     Pages = {361-287},     Title = {The {EU} {Referendum} in {Finland} on 16 October 1994:              {A} Vote for the {West}, not for {Maastricht}},     Volume = {33},     Year = {1995}}  @article{Detlef95,     Author = {Jahn, Detlef; Storsved,Ann-sofie},     Date-Added = {2013-08-11 17:14:34 +0000},     Date-Modified = {2013-08-11 17:16:45 +0000},     Journal = {West European Politics},     Number = {4},     Pages = {18-37},     Title = {Legitimacy through referendum? The nearly successful domino‚Äêstrategy of the Eu‚Äêreferendums in Austria, Finland, Sweden and Norway},     Volume = {18},     Year = {1995}} \end{filecontents} \documentclass{article} \usepackage[ngerman]{babel} \usepackage{natbib} \bibpunct{(}{)}{;}{a}{}{,} \makeatletter \renewcommand\@biblabel[1]{} \makeatother  \begin{document}  \cite{Arter95}  \bibliography{\jobname} \bibliographystyle{plainnat}  \end{document}   Please help. I want the author's name displayed like this "Arter, D." instead of David Arter Why do RAW images look worse than JPEGs in editing programs? I've found that when you load a RAW image into an editing program such as Lightroom/Aperture, the image is usually worse than if you just took the image as JPEG. Now I understand that the camera does some magic during the JPEG conversion. But I'm trying to understand what that "magic" is.   If I'm looking to implement that "magic" myself on the desktop, what kind of settings should I be trying? I find that the RAW files have more extreme contrast. The dark areas for example are way darker than JPEG. Why is this? And what is the best way to fix this? Why can't I say “She died from drinking 18 cans of Coca-Cola”? Instead, the correct sentence would be “She died of drinking 18 cans of Coca-Cola”. Why does that happen? Calculating percentage of overlap between 2 features from 2 different layers using ArcGIS Desktop? I have two layers. Layer 1 has features that are property/parcels with area in acres. Layer 2 has features that are wetlands/bodies of water with area in acres. I want to calculate parcels that have for example 0% wetlands, 10% wetlands, 20% wetlands, 30% wetlands etc. to 100% wetlands.   How can I do this on ArcGIS Desktop?   Ideally, I want to find parcels/properties that have a limited number or a limited percentage of wetland coverage.