I am having this error when running the below code trying to parse the website using JSoup.  ERROR  java.lang.RuntimeException: An error occurred while executing doInBackground()  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'org.jsoup.select.Elements org.jsoup.nodes.Element.getElementsByTag(java.lang.String)' on a null object reference   The website doesn't have table with the specified id (getElementById('ctl00_ContentPlaceHolder1'). How to fix this exception where the table isn't present?  CODE  @Override protected Void doInBackground(Void... voids) {     try {         Document evalPage = Jsoup.connect("http://site.example.com")                 .cookies(loginCookies)                 .timeout(30 * 1000)                 .execute().parse();         //TODO FIX THE NO TABLE REFERENCE          table = llPage.getElementById("ctl00_ContentPlaceHolder1").getElementsByTag("table").get(2);      } catch (IOException ex) {         ex.printStackTrace();         parsingSuccessful = false;     }     return null; }
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?
When should one use the "recent past"? How much time should have passed? When to use \par and when \\, \newline, or blank lines How can I respawn the Ender Dragon? I have a server and the Ender dragon has been defeated.  However, returning to The End does not respawn the Ender Dragon.  How can I get the final boss back on a vanilla server without using mods? What's the single-word for "left or right handed"? 'Male'/'female' is to 'gender' as 'left-handed'/'right-handed 'is to...?  Is there a word to describe this? For example, if I ask a guy     What's your ____?   It should mean I'm asking whether he's left or right-handed.  Another example could be     Our designs are not biased  against your ____.   Basically, I'm looking for something that means the state of being left- or right-handed which could be used analogously as gender.  EDIT: Sorry for the delay in the edit, but I was tied up. There are some points I'd like to clarify:   I'm not looking for a way to paraphrase my questions. I'm looking for a single word. I know people normally ask something along the lines of "Are you left-handed or not?" People also ask "Are you afraid of the dark?" instead of "Are you scotophobiac?". The word for it,  still exists, right? It has been pointed out that I should go with Our designs are not biased against left-handed people as that is what I mean. But that is not necessarily what I mean.    For example, let's say there is a washbasin with the tap on the right. Clearly, it's biased against lefties. Sometimes, you come across a washbasin with a tap on the left. (The logic being: you use your left hand to turn the tap as your right one's dirty). But, your right hand might not always be dirty, in which case, it's biased against righties.  A washbasin with the tap on the center is, then, handedness-blind or chirality-blind, if you will. (I foresee that some would dwell on Our designs are symmetrical. Please don't.)  I'm looking for a term that would be applicable here, as well as in the 1st example.  My favorite so far is chirality, suggested by Dan Bron in a comment (with 25 upvotes!) But, I'm reluctant to use it because there's no hard proof it's used in that sense  If we are talking about male-female, gender works perfectly. What's your gender? and Our designs aren't biased against your gender. , both work perfectly here.  Sorry for the late edit again. If the consensus is that I rollback, I will. Let me know in the comments. What is the behaviour of \fontsize if baselineskip is below a certain value? during my optimization process I found something spurious I cannot explain to myself and which I would like to understand. So with \fontsize you set the fontsize and the baselineskip. However the behaviour of the second paramater is a bit unclear to me, because if you reduce it too much, at a certain point the baselineskip gets bigger again. Let me show you my example: \documentclass[landscape]{article} \usepackage[margin=1cm]{geometry} \usepackage{lipsum,multicol}  \begin{document} \begin{multicols}{4}     \fontsize{10}{11}\selectfont     \lipsum[1]     \columnbreak          \fontsize{10}{10}\selectfont     \lipsum[1]     \columnbreak          \fontsize{10}{9}\selectfont     \lipsum[1]     \columnbreak          \fontsize{10}{8}\selectfont     \lipsum[1]     \columnbreak \end{multicols} \end{document}  If you compile this, your result will be looking like this:  Now from the first to the third column it seems logic, that the baselineskip is reduced and hence less space is needed vertically to typeset. But with the third column, even though the baselineskip is reduced even further, it needs more vertical space overall. It is strange however, that for example from line 11 to 12 (starting with tus and lum), the spacing seems to be narrower than in column 3, while in a lot of line the spacing is bigger. Changing the baselineskip to lower values down to 0 does not modify the vertical alignment further. What is the purpose of this behaviour and is it intended? I cannot see a benefit of this and I am a bit confused. Where should I post my sum-up of the answers, as the OP? Best way to remove file extension from a string? So, I'm using a script I've made to convert videos to the webm format. A certain program calls the script, sending %f which is the full, absolute file name of the video, like this:  converter.sh %f   where %f has two possible extensions, .avi or .mpg.  # /bin/bash ffmpeg -i $1 `dirname $1``basename $1 avi`webm &amp;&amp; rm $1   It currently works perfectly when $1 contains a .avi file, because basename removes the .avi extension. When $1 ends with .mpg instead, the result is .mpgwebm.  How can I modify that script to be able to receive those two possible different formats?    Resuming: If $1 is /somedir/video.avi, the script should do:  ffmpeg -i /somedir/video.avi /somedir/video.webm   And if $1 is /somedir/video.mpg, the script should do:  ffmpeg -i /somedir/video.mpg /somedir/video.webm   I know this might be fool for some people, but I'm kind of new with the bash. Converting a string to a tuple in python Low Quality Posts reviews add comments more than once on behalf of reviewer How to add a Timeout to Console.ReadLine()? Which B2C option to choose? A stock Salesforce org is geared toward B2B companies, but I work in Higher Ed and we're B2C-focused.  There seem to be three main B2C options available:   Person Accounts Nonprofit Starter Pack (NPSP) 1-to-1 model NPSP bucket model   Why would I choose one option over the other? If $f(1)=1$, then is it true that $f(n)=n$ for all $n \in \mathbb{N}\cup\{0\}$. "The antipodal map of $S^2$ is the isometry $\bar m$ sending each point $P$ to its opposite point $-P$" (from textbook)  Show that antipodal points remain antipodal under any isometry of $S^2$. In other words, for each isometry f of $S^2$, if $P$ and $P'$ are antipodal, then so are $f(P)$ and $f(P')$  I am unsure how I can define the $P$ and $P'$ so that they are opposites of each other in the antipodal map, and am I supposed to apply the traditional isometries (translation, reflection and rotation) to the points? I don't understand this problem. Can I remove a digital signature from a DLL? Testing points in PCB I feel that I might have a complete misunderstanding here. If DNA has two strands, how does the machinery of RNA transcription determine which one to transcribe? I am a newbie in combinatorics and still don't have enough tools to handle this kind of problems.  Assuming I have a set of integers: $ \{1,2,3,4,\dots,n\} $  In how many ways, can I choose $k$ numbers out of those $n$, such that none of them are consecutive?  For instance, for the following set $ \{1,2,3,4,5\} $  For $ k=3 $ I have only 1 option: $\{1,3,5\}$  My purpose is first of all to understand the way you would think about this  problem, not necessarily the solution itself (I have the final answer for it).  Thanks. Correct way to render crepuscular rays in cycles? While trying to use the new cycles volumetric rending features to create  (with the intention of updating ), I have found this to be a little trickier than I anticipated.    When I create a basic setup with a spot lamp (sun lamps don't seem to work, not sure if that is a result of their one directional nature or what..) and a world material like this:    Which gives me this (500 samples):    The problems with this that make me think that I'm missing something (aside from the rendertime and noise, which I understand to be a part of using bleeding edge new features) are:   The background shader/sky texture isn't visible at all (volume is too dense?) The lamp needed to be set to 50000 strength (this is of course dependent on the distance from the camera, but the kinds of strengths required to get some nice defined rays will blow everything out if volumes are disabled)   I can't seem to get a straight render (no compositing tricks) to look anything remotely like the pretty image in the release notes:        (source: )     Is this just how it works? Or is there some trick I have missed (not counting compositing/renderlayer tricks)? How to combine bold and "code sample" in Markdown? How can I make a word in a code sample bold? I only see asterisks around the expected bold text.  sample **sample** sample How to print fields in node.tpl.php? I need to print individual fields from the $content variable in node.tpl.php file in separate div tags. How do I do that and how do I find out what the field's names are?