getting an runtime Exception in thread "main" java.lang.NullPointerException please help to resolve the same
What is a NullPointerException, and how do I fix it?
Given a continuous random variable $X$ and the pdf find.... There is a pattern excercise:  First pattern: We have $X$ and the probability density function is usually:  $$ f(x) = \begin{cases}   {ax+bx^2} &amp;  {0\lt x \lt 1} \\   0 &amp; \text{else}   \end{cases} $$  Then we are given $E|X| = 0.6$   And usually asks to find:  a) $P\{X&gt;0.5\}$  b) $Var(X)$    Second pattern:  $$ f(x) = \begin{cases}   {cx^4} &amp;  {0\lt x \lt 2} \\   0 &amp; \text{else}   \end{cases} $$  Where c is a constant. Find:  a) Mean value of $X$  b) Variance of $X$     Third pattern (it's more like a reverse problem):  We are given $Y= \sqrt{X}$, find it's cumulative distribution function (CDF) and  it's probability density function (pdf).    Update:  The third one is transferred to a .  This is not homework. I'm self-studying and in need of some help. Thank you. Is  "choose from one of four options" wrong? I need backup in pressing my case that the phrase “choose from one of four options” is grammatically incorrect. Is there some resource that can prove my case, that the incorrect phrase should be replaced with one of the two following ones?        Choose one of four options   Choose from four options Why does the version of Java verified by Oracle differ from the version shown at the command line? Does the series $\sum \sin^{(n)}(1)$ converge, where $\sin^{(n)}$ denotes the $n$-fold composition of $\sin$? Using simple quotes "" instead of \text{} Is there a way to use newcommand or some other nice technique to transform any occurence of  "bla"   in math mode into  \text{bla}   The reason I ask is because it is easy, and doesn't interrupt the flow of reading the (La)TeX code as much.  I would like to keep Xe(La)TeX's nice quote behavior (ie it can use the regular "" instead of backticks to quote some text outside math mode). Why can't variable names start with numbers? I was working with a new C++ developer a while back when he asked the question: "Why can't variable names start with numbers?"  I couldn't come up with an answer except that some numbers can have text in them (123456L, 123456U) and that wouldn't be possible if the compilers were thinking everything with some amount of alpha characters was a variable name.  Was that the right answer?  Are there any more reasons?  string 2BeOrNot2Be = "that is the question"; // Why won't this compile? What's the best way of handling permissions for Apache 2's user www-data in /var/www? Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data.  We've got two regular users &amp; root. So when messing with files in /var/www, rather than having to...  chown -R www-data:www-data   ...all the time, what's a good way of handling this?  Supplementary question: How hardcore do you then go on permissions?  This one has always been a problem in collaborative development environments. url completion in cartoDB info windows How to accomplish SQL Server 2012+2014 high availability Maybe I'm searching for the wrong thing, but I can't see how I can do this.  I have two servers:   Server A (has SQL Server 2012 installed) Server B (has SQL Server 2014 installed)   Server A provides an API via IIS. The code both inserts and gets data from the database depending on the API call.  Server B does exactly the same for its local database.  I would like to have it so that the two databases are consistent copies of each other. I do believe this is what HA accomplishes.   So a load balancer, for example, might direct API calls to A sometimes, and B sometimes, but the data needs to be consistent either way.  I found some documentation on HA for SQL Server 2012, but not on how to do this for a mixed environment of 2012 and 2014.  Any help or pointers to documentation would be great! Thanks. Drawing visibility polygons in Unity (for vision cones with occlusion) I'm currently trying to create an effect like the one displayed below in Unity:    However, it seems that I can't do this with any of Unity's built-in light objects, and I simply cannot find anything online that talks about this. Is there a way to achieve this in Unity? 2D or 3D solutions are fine, as I'm sure that they're both very similar to each other, How to keep processes running after ending ssh session? Checkout one file from Subversion Variance of Normal Order Statistics Suppose we have $X_1, \cdots, X_n \overset{\textrm{i.i.d.}}{\sim} \mathcal{N}(0, 1)$ with $n &gt; 50$, and let $X_{(1)}, \cdots, X_{(n)}$ be the associated order statistics. Are there any references pointing to formulas that specify (or estimate) the variance of the $k^{\textrm{th}}$ order statistic, i.e. $\textrm{Var}(X_{(k)})$, for $1 \leq k \leq n$? I am looking for formulas can be explicitly evaluated without resorting back to numerical integration.  I have seen this question: , which attracted a number of answers on approximate formula for the mean of the $k^{\textrm{th}}$ order statistic, e.g. Blom (1958) (and modifications based on work by Harter (1961) and Elfving (1947)). Searching on Google also yields a number of work on the variance / standard deviation for the $k^\textrm{th}$ order statistics for small $n$, all of them opting for a computation/tabulation route. They are: Godwin(1949), Teichroew (1956), and Parrish (1992). I have also attempted to derive something myself following the method sketched by @probabilityislogic in , along the lines of: $$\textrm{Var}(X_{(k)}) = \int_{-\infty}^{\infty} \left(x-\mathbb{E}(X)\right)^2 \frac{n!}{(k-1)!(n-k)!} f_X(x)[1-F_X(x)]^{n-k}[F_X(x)]^{k-1}\;\textrm{d}x,$$ with lower case $f$ denoting the PDF of a r.v. $X$, and upper case $F$ denoting the CDF. Noting $x = F^{-1}(F_X(x))$ and using the substitution $u = F_X(x)$ (with corresponding r.v. in upper case $U$), we have: $$\textrm{Var}(X_{(k)}) = \int_{0}^{1} \left(F_X^{-1}(u) - \mathbb{E}\left(F_X^{-1}(U)\right)\right)^2\,\mathcal{B}(u | k, n-k+1) \; \textrm{d}u,$$ where $\mathcal{B}$ denotes the PDF of a beta distribution (not the beta function). This can be rewritten as the variance based on the beta distribution: $$\textrm{Var}(X_{(k)}) = \textrm{Var}_{\mathcal{B}(u | k, n-k+1)}\left(F_X^{-1}(u)\right).$$ Approximating the RHS using (the variance bit of the) delta method, we get: $$\textrm{Var}_{\mathcal{B}(u | k, n-k+1)}\left(F_X^{-1}(u)\right) \approx \textrm{Var}_{\mathcal{B}(u | k, n-k+1)}(U) \cdot \left[(F_X^{-1})'\left(\mathbb{E}_{\mathcal{B}(u | k, n-k+1)}(U)\right)\right]^2,$$ where the prime denotes the derivative. The first term of the product is standard result. For the second part, given $(F^{-1})'(\cdot)=\frac{1}{f(F^{-1})(\cdot)}$ (see e.g. ), we then have: $$\textrm{Var}_{\mathcal{B}(u | k, n-k+1)}\left(F_X^{-1}(u)\right) \approx \frac{k(n-k+1)}{(n+1)^2(n+2)} \frac{1}{\left(f\left(F^{-1}\left(\frac{k}{n+1}\right)\right)\right)^2}.$$ Substituting in the standard normal distribution ($\phi$ for PDF, $\Phi$ for CDF) and scaling it to the desired variance $\sigma^2$ we arrive at: $$\textrm{Var}(X_{(k)}) \approx \frac{k(n-k+1)}{(n+1)^2(n+2)} \frac{1}{\left(\phi\left(\Phi^{-1}\left(\frac{k}{n+1}\right)\right)\right)^2},$$ which we can throw in a $\sigma^2$ term in front if it is not a standard normal. But surely someone must have derived that somewhere (again I am looking for some references), and there is a high chance that I have gone off track somewhere above. I'm trying to update an existing Subscriber in the All Subscriber Table through the API; i've set up the AppId in the App Center and have connected and created Subscribers, but i'm still having issues updating.  What call do I need to be making to do this? These are the ones i've been trying. I have not had to mess with mailto links much.  However I now need to add a link in the body of a mailto if it is possible.    Is there a way to add a link or to change the email opened to an html email vs a text email?  Something like:  &lt;a href="mailto:test@test.test?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.%0A%0ALink goes here"&gt;Link text goes here&lt;/a&gt; Kinetic energy is simple, right?! from the equation it seems as though if you know the speed and mass you'll know the work. Let's try to prove it. let's assume we know the acceleration and distance for now. $$w=mda$$ So the distance is $$d= 1/2 *at^2$$ Then  $$t = \sqrt{2d/a}$$ So $a*t$, which is the speed, is  $$a*\sqrt{2d/a} = a* \sqrt{2d}/\sqrt{a} = \sqrt{2da} = \sqrt{2w/m}$$ So regardless of the distance or acceleration, if you know the work and the mass, you can calculate the speed which is  $$v=\sqrt{2w/m}$$  What if you know the speed and the mass? You can easily calculate the work. $$v = \sqrt{2w/m}$$ Then  $$v^2 = 2w/m$$  That would mean  $$m*1/2*v^2=W $$ Rearrange it and  $$W= 1/2 *m *v^2$$ would be the equation.  What if you have an initial speed and a new speed and want calculate the amount of work done after an initial speed to get the new speed? You'll just subtract the total work from the initial speeds work.  $$1/2mv^2 - 1/2ms^2$$  where s is  the initial speed and v is the new speed. However if you do it the other way which is  $$d= 1/2at^2 + vt$$ and solve it the answer would be $$1/2ms^2  + 1/2msv$$ Why aren't they equal? Chrome 100% CPU usage, again - software_reporter_tool.exe software_reporter_tool.exe belonging to Chrome running at 100% cpu, fan full speed.  Deleting it doesn't fix anything, because it gets redownloaded again! Disabling "Protect me from bla bla" doesn't make it stop running.  Please anyone have any solutions? I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield.  I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when two threads interact in a given manner?  This seems like a really key problem for programmers today, it would be useful to pool our knowledge on this one imho. Intersect (analysis) of polygons generating empty output I'm using Xubuntu 14.04 64 bit. I know that question been asked a billion times, but all of them consist of editing following file:  /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla   That file does not exist on my system. I tried com.xubuntu.enable-hibernate.pkla but doesn't exist either, locate command doesn't find it.