NullPointerException when I try to generate a pdf with with itextpdf
What is a NullPointerException, and how do I fix it?
Does there exist an $a_0$ such that the sequence $a_{n+1} = 2a_n + 1$ is prime for all $n \ge 0$? I believe I see that $a_n = 2^n(a_0+1) - 1$ but am somewhat uncertain where to proceed afterwards. I am a complete beginner at number theory and would appreciate it if someone could point me in the right direction--surely there is some obvious argument I am missing. How do you get the index of the current iteration of a foreach loop? How to test if these two samples are from the same distribution? (These are tweets located near some tourist attractions.     If yes, is there a simple implementation in Python? How can I get a views exposed filter to persist across multiple views? I have 2 separate views that return a set of results for each of my content types. The fields are different, but the filters are exactly the same - Sort by Location / Distance. This Distance / Proximity filter is exposed, and it is set to 'remember' the last entry. I followed the tutorial here  to be able to filter results by distance. It works great.  In views, to remember the last entry, Views uses sessions. But, each view has its own individual $_SESSION variable. That means what I set for one view does not carry over to the next, and even each view can have different values, which is not what I want. Here is a dump of the session after they have been set:  [views] =&gt; Array     (         [search_pages] =&gt; Array             (                 [default] =&gt; Array                     (                     )              )          [baby_clothes_pages] =&gt; Array             (                 [default] =&gt; Array                     (                         [distance] =&gt; Array                             (                                 [postal_code] =&gt; 11211                                 [search_distance] =&gt; 100                                 [search_units] =&gt; mile                             )                      )              )          [baby_gear_pages] =&gt; Array             (                 [default] =&gt; Array                     (                         [distance] =&gt; Array                             (                                 [postal_code] =&gt; 22343                                 [search_distance] =&gt; 100                                 [search_units] =&gt; mile                             )                      )              )      )   What I would like to do is create a small module or snippet of code that will simply allow someone to type in their 5 digit zip code and then it update all the values across all my pages with this filter. If it is changed on any page, then it changes it for the rest of the pages as well. It also needs to work so that it affects the results on the next page load so that it correctly shows them filtered.  Here is a snippet of code I was experimenting with to try to set this value, but it's the wrong direction.   $all_views = views_get_all_views();            // get an array of all views in use on the site  foreach ($all_views['category_pages']-&gt;display as $key =&gt; $value) {  //check to see if the structure exists I am looking to modify if(array_key_exists('postal_code', $all_views['category_pages']-&gt;display[$key]-&gt;display_options['filters']['distance']['value'])) {  //if so, set its value $all_views['category_pages']-&gt;display[$key]-&gt;display_options['filters']['distance']['value']['postal_code'] = '28152';  //try setting the session instead $_SESSION['views']['category_pages'][$key]['distance']['postal_code'] = '28152';     }   What's the correct direction? How do I get this value changed? Could it be done in the template.php file with preprocess function? Should I do it in a module, and if so, what do I need to alter?  Very lost at this point. Thanks for the direction! ESTA approved on the same day as B-1/B-2 visa refused I am writing because I have a question regarding my ESTA application and because I could not find a similar case online that would help me at this stage. I have never been to the U.S. so this would be my first visit.    I am a German citizen, hence eligible for the Waiver Program. I applied for an ESTA in June 2014 and got approved. After further research on the Internet I learned that the passport should be valid until 6 months after the planned return date. My passport was due to run out in Feb 2015 - which still should have been fine but because I didn't want to take chances I applied for a new passport which was issued August 2014 and is now valid until August 2024. My passport number has been changed also.    After I received my new passport I was advised by a friend to apply for a B-1/B-2 visa as it would allow me to extend my stay and it seemed like a good idea at first. On the day of my interview I also applied for a new ESTA with my new passport number (just in case) which again was granted.   Unfortunately for me the interview for the B-1/B-2 visa was unsuccessful and I got rejected. I was not aware then that after a rejected interview one could not travel with ESTA, otherwise I would have never risked it!  Now I am very concerned, can I still use my ESTA and enter the U.S.? as I read everywhere that once you get rejected the chances of getting through are very slim and any visa rejection will result in not being able to use the waiver program.  It might be important to note that both the B-1/B-2 interview and the waiver application were on the same day, 21st of August 2014, so depending on how one might look at it that might present a problem too I suppose.  I guess the frustration lies in the fact that I did not need to apply for a B-1/B-2 visa to begin with, and had I not I would now not have these problems. I would like to know how likely it is that I can still travel under the waiver program, if at all, and what my options are at this point. Recursively rename files and directories $IS \mid JS$ implies that $I\mid J$ where $I$ and $J$ are ideals of a number ring contained in another number ring $S$ SyntaxError: Non-ASCII character '\xa3' in file when function returns '£' Show that if $\lim_{x\to a}f'(x) = A$ then $f'(a)$ exists and equals A I ran across this problem in my Analysis class and can't seem to come up with a good solution. Here's the question: Show that if $\lim_{x\to a}f'(x) = A$ then $f'(a)$ exists and equals $A$. $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$.  I tried applying the Mean Value theorem like this: There exists a $c \in (a, x)$ st $f(x)-f(a)=f'(c)(x-a) \implies \frac{f(x)-f(a)}{x-a}=f'(c) \implies f'(a)=\lim_{x\to a}\frac{f(x)-f(a)}{x-a}=\lim_{c\to a}f'(c)=A$  However, I think this is wrong. I am pretty sure the Mean Value theorem is needed, but my application of it seems to be incorrect. Would somebody be able to point me in the right direction? Check differentiability of multivariable functions I am trying to determine if the following functions are (totally)   differentiable at $(x,y)=(0,0)$.      $$f(x,y)=\sqrt{\vert xy \vert}$$      $$g(x,y)=e^{{{\vert x \vert}^3}y}$$   However I am not particularly sure where to start. The concept of the total derivative being the Jacobian matrix makes sense but I don't really understand how to work with functions that may not have a Jacobian matrix. Any help would be greatly appreciated! What triggers the benefit of the bard's "Song of Rest" feature? In D&amp;D 5e, the benefit of the Bard's "Song of Rest" feature triggers "if you or any friendly creatures who can hear your performance regain hit points at the end of the the short rest."  Does Song of Rest's benefit apply just when spending hit dice to regain hit points? Or does it apply to any other way that a player might regain hit points at the end of a short rest (e.g. by casting a spell, using a Second Wind, eating a Goodberry, etc.)? Are any of the USB ports on a Macbook Pro "always on" Always on USB ports will provide power to a device even when the laptop is shut down. Obviously this can be problematic for battery issues, but sometimes a user wants this capability all things considered.  Do the Macbook Pro offer this on any of the USB ports and if not is there any chance its wired and just has to be enabled? Does $1.0000000000\cdots 1$ with an infinite number of $0$ in it exist? How do I access previous promise results in a .then() chain? I have had several business loans and understand that this is not by any means typical.  I noticed that for a year my payments were not decreasing the principal on the loan. When I asked the bank why, I found out that at some point my payments were getting applied to principal only. Now I am paying interest off that was not paid for 6 months or so.  My banker states that he can change all the interest payments to principal payments. I am confused to why this would be. If I make all my principal payments first then would the bank lose a substantial amount of interest?  This has happened on 2 of the 3 loans I have looked at so far.  If they are willing to change all the payments to principal only, would this be beneficial to paying less interest ultimately? I assume there would be an interest account accruing somewhere that would need to be paid off at the end of the loan.  I understand that typically you have a loan balance that would include interest and principal. My balance owed did not change when I continued to make same payment? It gets applied to interest. The balance on the statement must not be a true balance. There must be interest owed above the balance showed but why would they do this to start with? They applied full payments to principle only first in order for interest to get to be more than several payments I'm trying to prove that if $\alpha(t)=(x(t),y(t))$ is a $C^2$ regular curve $(\alpha'\neq0)$ with constant and positive curvature, then $\alpha$ is on the circunference and if $\alpha$ is the circunference, then its curvature is constant.  I solved the second part since $\alpha$ is the circunference, then $\alpha(t)=(r\cos\theta,r\sin\theta)$, so $|\alpha'(t)|=r$, I need help in the first part.  Thanks a lot. Ubuntu stuck/freeze on install I've been trying to replace my current Windows 10 installation with Ubuntu 16.04. My computer is a Lenovo Thinkpad T470. I've formatted my 15GB USB-dongle. Downloaded the software Rufus, and burned the ISO onto the USB. I've tried the settings "MBR Partition for BIOS or UEFI", "MBR Partition for UEFI" and "GPT partition for UEFI". I've tried using memtest86+ to test if I have any memory errors, I have not. I've tried disabling Secure boot, and Fast startup. I've tried using other software than Rufus, and I've tried entering the "nomodeset" in the boot options, as well "acpi=off", nothing works.   When I boot from my USB. I choose "Install Ubuntu" from the grub menu. And then select my language in the installer. It is from this point on, it gets problematic. Sometimes when I try to connect to my WIFI, it connects successfully, but when I press the "continue" button, the installer freezes and nothing happens. Sometimes I get past this point, but it then freezes later on in the installation progress - typically right when I press the "Install now" button.   It should also be mentioned that, if I press the "Quit" button in the install. I get to a black screen with a lot of text saying something like squashfs error.   Can someone please help me? When I tried booting memtest86+ it only worked when I changed my boot mode from UEFI to Legacy. Could this be it? Are there any downsides to installing an operating system in legacy?   If anyone has any other suggestions, it would be greatly appreciated!  Thank you :-) Android Debugging, how? \@seccntformat only for section The adverb "quite" has the following meanings :     1: wholly, completely ("not quite   finished")      2: to an extreme : positively "quite   sure" —often used as an intensifier   with a "quite a swell guy" "quite a   beauty"      3: to a considerable extent : rather   ("quite near")   My understanding is that #1 and #2 conflict with #3. For example, when you say "She's quite right", do you mean "She's completely right" or "To a considerable extent, she's right"? Notice that in the latter case you're not saying that she is completely right.  Another example is "I'm quite sure". Does it necessarily mean "I'm completely sure"?   Does the word really have conflicting meanings that can possibly cause ambiguity? Or am I missing something?