Null Pointer in Java function
What is a NullPointerException, and how do I fix it?
Metapost label based on variable value I want to label a scale based on a variable value and I wrote a metapost code like this.  $ := 1; for i = -.3cm step .6cm until 3.6cm:     label.bot(str$,(i,-3.7cm));     $ := incr($); endfor;   It just labels "$" instead of its value. How to output the variables value? Plotting several 2d functions in a 3d graph I am trying to reproduce a similar figure to the following one. My first guess was to use pgfplots but I didn't find any example that I could use as a starting point. At the moment I am unsure if pgfplots is actually the right package or I should rely on something else e.g. TikZ.   Since I don't really know where to start, I would appreciate any piece of code that points me in the right direction.    EDIT  Here is some dummy data for the plots.  plot1   plot2   plot3   plot4 0       0       0       0 3.466   2.058   0       0 4.262   2.976   0.001   0 3.822   3.168   0.006   0.008 2.953   2.936   0.019   0.063 2.065   2.492   0.046   0.265 1.332   1.977   0.092   0.734 0.797   1.478   0.164   1.508 0.443   1.045   0.268   2.44 0.228   0.698   0.412   3.219 0.107   0.438   0.598   3.524 0.046   0.256   0.831   3.219 0.017   0.138   1.109   2.44 0.006   0.067   1.429   1.508 0.002   0.029   1.78    0.734 0       0.01    2.141   0.265 0       0.003   2.479   0.063 0       0.001   2.736   0.008 0       0       2.808   0 0       0       2.465   0 0       0       0       0 Resize partition without affecting other OSes in dual-boot I wanted to resize (increase or decrease the partition size) the existing Ubuntu partition without affecting it and the other OS(es) installed in the machine. Prove $\sum_{i=1}^n2^{i-1}=\sum_{i=0}^{n-1}2^i=2^n-1$ combinatorially.  This is easy to prove inductively.  I know that $\sum_{i=0}^n{n\choose i}=2^n$ so maybe change $\sum_{i=0}^{n-1}2^i$ to $\sum_{i=0}^{n-1}\sum_{j=0}^i{i\choose j}$.  I also know that $2^n-1$ is the number of proper subsets in a set of size $n$. Multilingual careers CVs tl/dr : Is it/will it be possible to fill out our Careers CV with localized information ?  Is it/will it possible to have different versions of the CV posted at careers (not totally different but just translated)?  Being in non English oriented country, this can be very helpful if I send local companies a link to my Careers CV and they could read it in a language other than English. LinkedIn has an implementation of this feature where you can create your profile in another language and it's up to the user to fill in the information in that language (first and last name, past experiences, etc)  The reason for this is primarily because my CV on careers contains more than just a list of bullet points, it reveals who I really am as a software developer (top tags, top answers, links to github projects, etc). Why isn't Harry Potter punished for using magic outside of Hogwarts in Prisoner of Azkaban? Electrical potential energy stored in vacumm for a single point charge? I have come to know the electrostatic potential energy in vacuum is given by $${\frac{1}{2}} \epsilon_0\int d^3x {E^2} $$ and this energy  is due to the mutual electrostatic coulomb potential energy. So only a single point charge in space also contributes to some electrostatic potential energy according to $${\frac{1}{2}} \epsilon_0 \int d^3x {E^2} $$  as due to a single point charge also we have an electric field at every point in space. Now I am not getting it physically, why should there be any Coulomb energy in this case as there is no other charge to provide the electrostatic coulomb potential energy? I have 256 colors working just fine in konsole,. I thought I'd give tmux a try because, unlike screen, it seems to support vi mode.  However I find that the colors of my prompt show up and this is most likely because I have a 256 color mode prompt. What do I need to do to get tmux to recognize all 256 colors? Do I have to pay taxes in the US if my online store sells to US customers even though I don't live in the US? I  own a website and I sell digital content. I'm a nonresident alien with the US. Most of my customers are US based so I was wondering will I have to pay any taxes to the US?  I have read that      For nonresidents, taxable income is separated into two categories:         Income that is effectively connected with a U.S. trade or business, after the deductions that are allowed, is subject to U.S. income tax   at graduated rates - the same rates that apply to U.S. citizens and   residents - or lower rates if the provisions of a tax treaty apply.   Income that is subject to U.S. income tax, for being U.S. source income, but that is not effectively connected with a U.S. trade or   business, is subject to a flat 30% tax      Is this true and do I belong to any of these categories?  If I form an LLC or C corp am I liable for this withholding tax?  My customers are based in the US and I believe all income is considered FDAP income according to the IRS:     Fixed, Determinable, Annual, or Periodical (FDAP) income is all   income, except:         Gains derived from the sale of real or personal property (including market discount and option premiums, but not including original issue   discount)   Items of income excluded from gross income, without regard to the U.S. or foreign status of the owner of the income, such as tax-exempt   municipal bond interest and qualified scholarship income      The thing is the IRS also says:     Effectively Connected Income, after allowable deductions, is taxed at   graduated rates. These are the same rates that apply to U.S. citizens   and residents. FDAP income generally consists of passive investment   income; however, in theory, it could consist of almost any sort of   income. FDAP income is taxed at a flat 30 percent (or lower treaty   rate) and no deductions are allowed against such income. Effectively   Connected Income should be reported on page one of Form 1040NR. FDAP   income should be reported on page four of Form 1040NR.   In the last quote, it’s like they say it only applies to passive income but if they feel like it, they can apply this to all income?? What are the various physical mechanisms for energy transfer to the photon during blackbody emission? By conservation of energy, the solid is left in a lower energy state following emission of a photon.  Clearly absorption and emission balance at thermal equilibrium, however, thermodynamic equilibrium is a statement of the mean behaviour of the system, not a statement that the internal energy is constant on arbitrarily short timescales.  The energy has to come from somewhere during emission, and go somewhere during absorption.  Energy in a solid can be stored as kinetic and potential energy of electrons and nuclei, either individually or in collective modes such as phonons and plasmons.  In thermal equilibrium energy will be stored more or less in various forms depending on the temperature and material.  However, even if most of the thermal energy in a particular solid at temperature $T$ is stored in the form of phonons, it could be that phonons primarily interact with light indirectly via electrons, e.g. a phonon excites an electron in a phonon-electron interaction, which can interact with light via the EM field.  Given that light is an EM field, it makes sense to me that it is emitted and absorbed by charged particles.  The electron-photon interaction is probably dominant for visible and ultraviolet light, given that metals are opaque, while semiconductors and insulators are transparent to (visible and UV) light with energy lower than their bandgap. However, once you get into energies in the IR and below, or X-rays and above, other mechanisms apparently take over.  For example, on the high-energy end of the spectrum I've heard that gamma rays can interact directly with nuclear degrees of freedom, which is reasonable considering that gamma rays are emitted during a lot of nuclear reactions.  A review of  might give clues to important light-matter interactions over a broad range of wavelengths.  Whether all of the these processes are involved in blackbody emission is a somewhat different question.  What physical processes mediate energy transfer during blackbody emission, and in which energy ranges are the various processes dominant? Show community wikis differently in the Android app How best to sum up lots of floating point numbers? need to make salesforce app available in multiple language I want to make my appexchange app available in multiple language like Spanish, dutch etc. so that depend on the language of the user they can access the app.  Is it possible in any way..  any help will be appreciated.. Thanks Jordan normal form and invertible matrix of generalized eigenvectors proof Struggling to find a place to start with this proof- just began learning about Jordan normal.  Given a 2-by-2 matrix $A$ and a Jordan normal form matrix $J_{\lambda}$, there exists a matrix $S = [v1, v2]$ s.t. $$S^{-1}AS = J_{\lambda}$$ That is, $J_{\lambda}$ is similar to $A$.  WTS: $$(A - \lambda I)v_{1} = 0 $$ $$(A - \lambda I)v_{2} = v_{1}$$    I was going to try to start with the similarity condition and work into producing the two statements below.  Transform the similarity condition to: $$(A = SJ_{\lambda}S^{-1}) * v_{1}$$  Rewrite our first statement to prove as: $$Av_{1} = \lambda I v_{1}$$   Substitute: $$\lambda I v_{1} = SJ_{\lambda}S^{-1}v_{1}$$  But I've been continually getting stuck.  Tried a few ways other than this.  What intuition am I missing? How do I install Skype? Can an inanimate thing lift Mjolnir? Can an inanimate thing can lift Mjolnir without the help of a living being (unworthy)  Scenario 1  Mjolnir in a very light car with a sail attached to it, then a very strong wind blew and moved the car uphill.  It is possible or not?  Scenario 2  Can upward wind alone lift the Mjolnir? I have Ubuntu 12.04 installed on my PC, recently I have edited /etc/passwd  and changed  user1:x:00:00:user1,,,:/home/user1:/bin/bash   to give root permission to user1 and the system always need to login as root, for running some custom software.  Now it seems the sound is not working, the volume icon is disabled. I understand that the pulseaudio demon can't be run as root that's why the audio is not working. How can I resolve it, like set the permission of pulseaudio to run as root.   When I type the command    /usr/bin/pulseaudio --start   Giving me the output  W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified). E: [autospawn] core-util.c: Home directory /home/user1 not ours. W: [autospawn] lock-autospawn.c: Cannot access autospawn lock. E: [pulseaudio] main.c: Failed to acquire autospawn lock   Edit   Solution for problem:  I have fixed the problem by disable root checking for pulseaudio equalizer  sed -i 's/exit 1/#exit1/g' /usr/bin/pulseaudio-equalizer Is there a word for someone who has others do all their work for them? In a way like a slave master. More though like say someone who had robots do all their work and they were never themselves productive and had no drive. If you've read R.U.R. you'll understand the question better. I'm looking for a word with more definition than just lazy.  Update 1: It think I may actually go with drone if anything. I think that definition fits what I'm looking for the best. I also liked the definition of the British term layabout that one person mentioned, but I will probably use drone. Thanks for all the help and sorry if I was confusing or unclear.  Update 2: I needed this word for use in an essay I was writing which I have now handed in. Thanks for the help guys. No more suggestions needed. What is the double slash (//) directory? I mistakenly typed cd // instead of cd /. To my surprise, current directory showed up as //.   What is that directory? Why does it exist?  apple@snipped $ pwd /home/apple apple@snipped $ cd / apple@snipped $ pwd / apple@snipped $ cd // apple@snipped $ pwd // apple@snipped $ cd /// apple@snipped $ pwd / Show that $G$ is cyclic Here is a problem from Herstein.     Let G be a finite abelian group so that the equation $x^n=e$ has at most $n$ solutions in $G$ for every positive integer $n$. Show that $G$ is cyclic.   I will have to basically show that there exists an element $g$ in $G$ having order $o(G)$.   I showed that such an element exists if $o(G)=p_1p_2...p_k$ where $p_i$ are primes. But I could not proceed if $o(G)=p_1^{a_1}p_2^{a_2}$. I feel that if I can prove this I will be able to extend.