How to fix a null pointer exception error in java
What is a NullPointerException, and how do I fix it?
Do I need a visa for Paris, if my connecting flight stops for 24 hours in Paris? Do I need visa for Paris, if my connecting flight stops at Paris for 24hrs and I want to visit Paris during that 24hrs? I have US B1 visa. I'll be travelling from San Francisco to Bangalore (India) via Paris. I hold Indian passport. If yes, what is the procedure for that visa? Bias and variance in leave-one-out vs K-fold cross validation How do  methods compare in terms of model variance and bias?   My question is partly motivated by this thread: . The answer there suggests that models learned with leave-one-out cross-validation have higher variance than those learned with regular $K$-fold cross-validation, making leave-one-out CV a worse choice.  However, my intuition tells me that in leave-one-out CV one should see relatively lower variance between models than in the $K$-fold CV, since we are only shifting one data point across folds and therefore the training sets between folds overlap substantially.  Or going in the other direction, if $K$ is low in the $K$-fold CV, the training sets would be quite different across folds, and the resulting models are more likely to be different (hence higher variance).  If the above argument is right, why would models learned with leave-one-out CV have higher variance? What is the difference between lands and mana? What is the relationship between lands and mana in Magic and what do each of them do?  A good answer should especially include how a new player should think about them.    Note:  This is an attempt to create a canonical question about the relationship between lands and mana in Magic.  Beginners are often confused about this given the same symbols are used to mean different things across basic lands, non-basic lands, and mana costs.  This can lead to confusion about , about , or even about . Evaluate $$I=\int_{0}^{1}\frac{x\log x}{\log(1-x)}dx$$   I try to change it to:$$I=\int_{0}^{1}\frac{(1-x)\log(1-x)}{\log x}dx$$ but I can't do next steps,help me ,thank you very much. I'm reading page number 4 here. In particular the section where it deals with the case $p=\infty$, that is , showing that $L^{\infty}$ is complete.    Two questions:  1) Why is the convergence uniform? where it says "for $x \in N^{c}$ , $f_{n}$ is a Cauchy sequence of complex numbers. Thus $f_{n} \rightarrow f$ uniformly. Clearly we have pointwise convergence but why is it uniform?  2) I don't see why $||f_{n} - f||_{\infty} \rightarrow 0$. Can you please explain this step?  Thanks.  (3/2015) Edit: The original link appears to be broken.  seems to provide a similar (maybe even identical) proof to the one the OP talks about with slight notational differences. Enabling CORS in GeoServer (jetty)? As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example:  int main(void) {     NSString *string;     string = [[NSString alloc] init];     /* use the string */     [string release]; }   My question, though, is wouldn't this be just as valid?:  int main(void) {     NSAutoreleasePool *pool;     pool = [[NSAutoreleasePool alloc] init];     NSString *string;     string = [[[NSString alloc] init] autorelease];     /* use the string */     [pool drain]; } Compute $P(X_1+\cdots+X_k\lt 1)$ for $(X_i)$ i.i.d. uniform on $(0,1)$ Consider $N=\min\{n: S_n&gt;1\}$, where $S_n=X_1+\cdots+X_n$ and $(X_i)_{i=1}^\infty$ is i.i.d. uniform on $(0,1)$. So, $N$ is the first time that $(S_n)_{n=1}^\infty$ crosses $1$. I'd like to calculate $E(N)$. To this end I'd like to calculate $\Pr(N\gt k)=\Pr(S_k\lt 1)$.  Is there a way to actually do this for any arbitrary $k$? I mean, certainly there is as I know about the distribution of $S_n$ but the formula is just formidable when you move with $k$ toward $\infty$ and even though tractable with a computer, I don't think it's tractable without it.  Is there maybe a better way to calculate the expectation? Thanks for any help. How to show that the determinant of the following $(n\times n)$ matrix  $$\begin{pmatrix} 5 &amp; 2 &amp; 0 &amp; 0 &amp; 0 &amp; \cdots &amp; 0 \\ 2 &amp; 5 &amp; 2 &amp; 0 &amp; 0 &amp; \cdots &amp; 0 \\ 0 &amp; 2 &amp; 5 &amp; 2 &amp; 0 &amp; \cdots &amp; 0 \\ \vdots &amp; \vdots&amp; \vdots&amp; \vdots &amp; \vdots &amp; \vdots &amp; \vdots \\ 0 &amp; \cdots &amp; \cdots &amp; 0 &amp; 2 &amp; 5 &amp; 2 \\ 0 &amp; \cdots &amp; \cdots &amp; \cdots &amp; \cdots &amp; 2 &amp; 5 \end{pmatrix}$$  is equal to $\frac13(4^{n+1}-1)$?    More generally:     How does one compute the determinant of the following  (where the three diagonals are constant)?      $$M_n(a,b,c) = \begin{pmatrix} a &amp; b &amp; 0 &amp; 0 &amp; 0 &amp; \cdots &amp; 0 \\ c &amp; a &amp; b &amp; 0 &amp; 0 &amp; \cdots &amp; 0 \\ 0 &amp; c &amp; a &amp; b &amp; 0 &amp; \cdots &amp; 0 \\ \vdots &amp; \vdots&amp; \vdots&amp; \vdots &amp; \vdots&amp; \vdots &amp; \vdots \\ 0 &amp; \cdots &amp; \cdots &amp; 0 &amp; c &amp; a &amp; b \\ 0 &amp; \cdots &amp; \cdots &amp; \cdots &amp; \cdots &amp; c &amp; a \end{pmatrix}$$      Here $a,b,c$ can be taken to be real numbers, or complex numbers.   In other words, the matrix $M_n(a,b,c) = (m_{ij})_{1 \le i,j \le n}$ is such that $$m_{ij} = \begin{cases} a &amp; i = j, \\ b &amp; i = j - 1, \\ c &amp; i = j + 1, \\ 0 &amp; \text{otherwise.} \end{cases}$$  There does not seem to be an easy pattern to use induction: the matrix is not a diagonal  of the type $M = \bigl(\begin{smallmatrix} A &amp; C \\ 0 &amp; B \end{smallmatrix}\bigr)$ (where we could use $\det(M) = \det(A) \det(B)$ for the induction step), and there are no lines or columns with only one nonzero entry, so  gets complicated quickly.  Is there a general pattern that one could use? Or is the answer only known on a case-by-case basis? It's possible to compute the determinant by hand for small $n$:  $$\begin{align} \det(M_1(a,b,c)) &amp; = \begin{vmatrix} a \end{vmatrix} = a  \\ \det(M_2(a,b,c)) &amp; = \begin{vmatrix} a &amp; b \\ c &amp; a \end{vmatrix} = a^2 - bc \\ \det(M_3(a,b,c)) &amp; = \begin{vmatrix} a &amp; b &amp; 0 \\ c &amp; a &amp; b \\ 0 &amp; c &amp; a \end{vmatrix} = a^3 - 2abc \end{align}$$  But there is no readily apparent pattern and the computation becomes very difficult when $n$ gets large. Is it safe to put hot food in the fridge? I heard that putting really warm food in the fridge right after cooking it is not the right thing to do. It might cause bacterial growth? Is this true? If mastery of the Force is hereditary, how are the Jedi so numerous? I need to get the size of directory in terminal for signing purposes. I'm using following command:  du -s /path/to/dir   I'm multiplying the result by traditional UNIX block size (512 bytes) and get actual directory size in bytes. However, the Finder's "Get Info" dialog window shows the size slightly smaller than the one calculated with the terminal command. And it seems that it's reproducible on any folder/bundle. What am I missing? How does one change to engineering for graduate school after undergrad in a science field? I've always had an interest in electrical engineering (actually all engineering in general) and I've decided that I'd like to pursue a graduate degree.  I guess I'm wondering if I should really try to do this or just keep it as a fun hobby I spend all my free time doing.  So, the question is,  how does one change fields between undergrad and grad school?  A specific example follows, but please provide answers that address a more general case, so that your answers will be helpful to other people with the same general question.  I already have a BS and MS in chemistry with a minor in applied math.I published three papers during my MS, one first author in the top journal in my specialty and two as coauthor in an average and a so-so journal.  I hope those will count for something.  I finished my BS with around 3.1 and my MS with a 3.9 gpa.  I'm sure that my MS advisor would write me a great letter.  My GRE scores are too old to count so I'd have to retake it or try and get a pass on it since I already have a graduate degree.  Since finishing school I've been working for 4 years as a chemist.  I can get great recommendations from my supervisor who is a PhD chemist.      I've been working for a while to cover some of the things I would have learned in a BSEE to try and make up for my lack of one.  I worked through some texts on analog/digital design, lots and lots of programming, built a balancing robot that got a bit of internet attention, and I'm currently working on an autonomous robotics project that's looking really good so far.  After that I have more project ideas than I have time or money for.    I want to apply for PhD programs (specifically in controls/robotics) but I'm worried that my application will get tossed right away because I don't have a BSEE.  Maybe I should just apply to MS programs? Who should own files shared by a group and where should they go How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule? I'm using consecutive \cmidrule commands in conjunction with \arrayrulecolor to alternately hide and unhide horizontal rules in a table.  However, when \arrayrulecolor is used with \cmidrule, some odd vertical spacing is introduced. I'd like to eliminate it.  (I'm using longtable, so a colorbox, minipage, or anything else tied to a page won't work.)  Below is an image that introduces the challenge. The first block shows a \toprule.  My goal is to create a shaded border around the table, so I've added a dummy column.  The second rule shows a \cmidrule that skips the first column.  The third block shows how I can use a \cmidrule to fill in the whitespace with a shorter \cmidrule.  Finally, I want to recolor this short \cmidrule to the background color and restore the color later.  Note the jagged vertical skipping in case 4 compared to case 3.  Why would \arrayrulecolor change vertical alignment?  How can I eliminate the jagged edges?    Here is the code:   \documentclass[11pt]{article}  \usepackage{longtable} \usepackage{booktabs} \usepackage{color} \usepackage{xcolor} \usepackage{colortbl}  \setlength{\aboverulesep}{0pt} \setlength{\belowrulesep}{0pt} \setlength{\extrarowheight}{0.25ex}  \newcolumntype{L}{&gt;{\columncolor[gray]{0.8}}l} \newcolumntype{C}{&gt;{\columncolor[gray]{0.8}}c} \newcolumntype{R}{&gt;{\columncolor[gray]{0.8}}r}  \begin{document}  \textsf{ \begin{longtable}{LLLLL}  &amp; \multicolumn{3}{@{}L}{\small {\tablename\ \thetable{}} - demonstration of odd vertical alignment with arrayrulecolor} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {case 1: the line below is a toprule}} &amp; \\% \toprule  &amp; \multicolumn{3}{@{}L}{\small {case 2: the line below is a cmidrule that spans the middle 3 columns.  Note the whitespace!}} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {The challenge: hide the widespace giving the appearance of a spacing around a longtable.}} &amp; \\% \cmidrule[\heavyrulewidth]{2-4}  &amp; \multicolumn{3}{@{}L}{\small {case 3: the line below is 3 cmidrules, 1 each for the first and last columns and 1 for the middle}} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {note how the cmidrules align vertically ... perfect!}} &amp; \\% \cmidrule[\heavyrulewidth]{1-1}\cmidrule[\heavyrulewidth]{2-4}\cmidrule[\heavyrulewidth]{5-5}  &amp; \multicolumn{3}{@{}L}{\small {case 4: Now, lets try recoloring the first and last cmidrules}} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {how do I eliminate the odd vertical alignments?}} &amp; \\% \arrayrulecolor[gray]{0.80}\cmidrule[\heavyrulewidth]{1-1}\arrayrulecolor[gray]{0.0}\cmidrule[\heavyrulewidth]{2-4}\arrayrulecolor[gray]{0.80}\cmidrule[\heavyrulewidth]{5-5}\arrayrulecolor[gray]{0.00} \endfirsthead  &amp;  Arizona State University &amp;  &amp; ASU &amp;\\   &amp;   Baylor University &amp;  &amp; BAYLOR &amp;\\   &amp;   Boston University &amp; 164988 &amp; BU &amp;\\   &amp;   Brown University &amp; 217156 &amp; BROWN &amp;\\   &amp;   California Institute of Technology &amp; 110404 &amp; CALTECH &amp;\\   &amp;   Carnegie Mellon University &amp; 211440 &amp; CMU &amp;\\   &amp;   Case Western Reserve University &amp; 201645 &amp; CASE &amp;\\   &amp;   Columbia University &amp; 190150 &amp; COLUMBIA &amp;\\   &amp;   Cornell University &amp; 190415 &amp; CORNELL &amp;\\      &amp; Yale University &amp; 130794 &amp; YALE &amp; % \label{tab:schools} \end{longtable} }  \end{document} Mobile web refresher, part 3 Add an API key to QGIS for QOSM layer Prove a assertion concerning Lebesgue space Let $f_n \in L^1$ such that $f_n\rightrightarrows f$. Then I want to conclude that If $\mu(X)&lt;\infty,$ then $f\in L^1$ and $\int f_n\to\int f$, so I want to make use of the Dominated convergence theorem, the thing is that I don't know which would be my dominating function.  I was trying to figure out if the measure could play that role, but after thinking a little bit I have realize that the measure doesn't have to be bigger than the absolute value of the functions of the sequence.  Another thing I was thinking of, is to apply Fatou's lemma, but I can't ensure that my functions are positive.  So, Can someone help me to prove this theorem please ?  Thanks a lot in advance :).    NOTE: I think this theorem is taken from Folland's Real analysis, modern techniques, and their aplications 2nd Edition :), This is to have all the definitions so we can talk the same language as in the book (this is, same notation and theorems or machinery) How to access raw texture data in DirectX 11? I want to get access to a texture's pixel color data on the CPU. When trying to map the texture, I get E_INVALIDARG in return from ID3D11DeviceContext::Map.  ID3D11ShaderResourceView* resourceView; //represents my texture, already loaded up //...  //Getting the resources of the texture view... ID3D11Resource* res = nullptr; ID3D11Texture2D* tex = nullptr; resourceView-&gt;GetResource(&amp;res); res-&gt;QueryInterface(&amp;tex); D3D11_TEXTURE2D_DESC desc; tex-&gt;GetDesc(&amp;desc); //Correct data gets filled out D3D11_RESOURCE_DIMENSION dim; res-&gt;GetType(&amp;dim); //value gets set as Texture2D which it should  D3D11_MAPPED_SUBRESOURCE mappedResource; HRESULT h; h = context-&gt;Map(tex,0,D3D11_MAP_READ,0,&amp;mappedResource); //This always fails h = context-&gt;Map(res,0,D3D11_MAP_READ,0,&amp;mappedResource); //This also fails   The idea is that I keep only shaderResourceViews for my textures, because that is all I needed until now, and get the relevant resources here.  I tried mapping as WRITE_DISCARD also, but to no success. I am really confused, because I never had any problem with mapping constant buffers and vertex buffers. I seem to be certainly missing something? By the way, I am using Wic Texture loader and DDS Texture loader for the DirectXTex toolkit, and tried this code for png, dds textures, with and without mip-maps. Using Android as network server I want to use my Android device as a network server. In the same kind of way you would make it a Wi-Fi hotspot, but I don't want to allow connected computers to access the internet, I would like them to be able to communicate together.  Possible uses:   Playing games via LAN (e.g., Quake) Allow computers to share files Bonjour (Macs) etc...   Is there any way to achieve this? Any apps out there that will set up a wireless network server?