I tried creating the equivalent of this in Java, but I am facing NullPointerException the moment I enter the first name
What is a NullPointerException, and how do I fix it?
Book recommendations Punctuation with units I remember reading somewhere that if a unit is abbreviated as one character, there must not be a space between the number and the unit (e.g., 5m, 26K). If the unit is abbreviated as two or more Characters, there must be a space between the number and the unit (e.g., "10 km", "USD 5").   Can you please help me find the source again? Is this recommendation correct? Making a 3D map with shapefiles, lidar and aerial image data I want to try to make a simple 3D map for a small area (10 square miles) with some housing, some roads and some vegetation on it. My geodata is as follows:    shapes with houses/roads/vegetation.  LIDAR point cloud data over the area (can easily be built to a dem). georeferenced aerial image.   Any idea where to start to bundle these geodata together and make a neat looking 3D map? How to find max of amount of opportunity related to account? I have a below requirement : I need to find maximum amount on related opportunities and to display on account. Ex: suppose I have account A1 and A1 have 5 opportunities with amount o1=>100 o2=>500 o3=>300 o4=>1000 o5=>50 on my account i should have max_opportunity_amount =1000.  I have written below trigger ,but  I am not sure what to do further  trigger maxOppAmountonAcc on Opportunity(after insert){      map&lt;id,Opportunity&gt; oppMap = new map&lt;id,Opportunity&gt; ();     set&lt;Id&gt; oppId = new set&lt;Id&gt;();     for(Opportunity o : Trigger.new)     {         oppMap.put(o.accountId,o);         oppId.add(o.id);     }       List&lt;Account&gt; accList = new List&lt;Account&gt;();      for(Account a : [Select id ,MaxOppAmount__c,(select id,max(amount)  from opportunities) from Account where id in : oppMap.keyset()])     {      }  } I'v found this proposition.  If $G$ is a finite  group , $ A \subset G $ a subset and $|A| &gt; \frac{|G|}{2} $ then $AA = G $.  Why this is true ? Find the maximum likelihood estimator for $\theta$ when $f(x)=2\theta^{-2}x, 0\leq x \leq \theta$ Find the maximum likelihood estimator for $\theta$ when $f(x)=\frac{2x}{\theta^2}, 0\leq x \leq \theta$.  This should be a really easy question but I somehow cannot seem to get the right answer. My likelihood function is $\prod\limits_{i=1}^n \frac{2x_i}{\theta^2}$ which gives me after some simplification $n\ln(2\theta^{-2}) + \sum\limits_{i=1}^n ln(x_i)$ as my log-likelihood function. Then the derivative becomes $\frac{-2n}{\theta}$. If I equate this to $0$ to obtain the maximum I obtain $\hat{\theta}\rightarrow\infty$. However, this answer does not seem plausible. What did I do wrong? If a function $f$ is continuous $\implies$ $|f|$ is continuous.(Answered by Myself) $(i)$ Given a function $f:E \rightarrow \mathbb{R}$ define $|f|:E \rightarrow \mathbb{R}$ by $|f|(x)=|f(x)|$ for $x \in E$ show if $f$ is continuous at $c \in E$ then so is $|f|$.        $(ii)$ Now the converse is not true, find $f$ such that $|f|$ is continuous but $f$ is not. Which folder is recycle bin in on Win7? How to check files there? I was using another account before. Let me call it account A. And I deleted a lot of files to the Recycle Bin at that time. But before I removed account A I forgot to empty the Recycle Bin.   My question is, are my files still there? I've searched and found that the Recycle Bin may live in $Recycle.Bin, but I can't open files there so I can't know what they are. Any help how to open deleted files or how to delete them permanently? Expected value as a function of quantiles? How to show $(a^b)^c=a^{bc}$ for arbitrary cardinal numbers? One of the basic (and frequently used) properties of cardinal exponentiation is that $(a^b)^c=a^{bc}$.  What is the proof of this fact?  As Arturo pointed out in his comment, in computer science this is called . What is the distance a creature or player can travel if they have multiple types of movement speeds? What is the distance a creature or player can travel if they have multiple types of movement?  For example, the  has a 40 ft walking speed, a 40 ft climbing speed, and an 80 ft flying speed. Can it move a total of 160 ft in a round using each of those fully, or is there another way this is calculated? list files and store it in variables I'm new with shell programming. My goal is to give the user a selection which file should be run. I catch all available scripts in one var with:  var=$(find script*)   so far so good, this is the output:      echo $var     script1 script2 script3 scr...   now I want to store each file in a singel variable to run it in later selection  select SEL in script1 script2 script3 .......... case $SEL in         $Script1) echo ($Script1 will start) &amp;&amp; ./$script1 ;;         $Script2) echo ($Script2 will start) &amp;&amp; ./$script2 ;;         $Script3) echo ($Script3 will start) &amp;&amp; ./$script3 ;;         $Sc..) echo ($Scr.... will start) &amp;&amp; ./$scrip.... ;;         $Sc...) echo ($Sc...... will start) &amp;&amp; ./$scrip..... ;;         *) echo "choose on of the availabel files";;     esac done   I don't have a clue how should I should separate all files if I don't know how many and the exactly length of each file.  I tried to split with echo ${var[1]} and echo $var[1] but this dosn't work. I recive either a empty output or the whole string. ref to subsection number only Sqrt disappeared when exporting plot to PDF in version 10 I am looking to sell and buy a house. But with the current market being as crazy as it is (houses are selling fast for sometimes 150,000 over asking), I'm afraid if we sell first, we could be stuck without a new house. Or stuck settling on or over-paying for something and wishing we never sold at all. I'm wondering if it's possible to buy first. What is the best way to secure my next house before selling my current house without getting locked into a B-lender mortgage or risking too much?  I know there would be some risk putting an offer on a new house without knowing how much the current house will sell for, or the risk we don't sell the current house before the new house closes. I'm also afraid conditional offers will not be considered. Are there any other options?  (We do have a mortgage on the current house, but because the market has gone up so much there is also a good chunk of equity.) Prove that the difference between two rational numbers is rational This is a terribly simple question I'm sure, but I can't find a work-around in my proof. I must prove that the difference between two rational numbers is thus rational. Here is my attempt:     Let $a$ and $b$ be rational numbers. Therefore, \begin{align}  a=\frac{\lambda}{\beta},\:b=\frac{\xi}{\zeta},\:\ni\:\lambda,\beta,\xi,\zeta\in\mathbb{Z},\tag{1} \end{align} which gives us \begin{align}  a-b=\frac{\lambda}{\beta}-\frac{\xi}{\zeta}=\frac{\lambda\zeta-\xi\beta}{\beta\xi}.\tag{2} \end{align}   So I have shown that $a$ and $b$ are rational numbers which, by definition, can be represented by the quotient of two integers. But now how do I tackle the problem of the difference? By definition the difference between two integers is an integer. Does that require that this difference is thus rational?  Thank you for your time, Please add close flags, duplicate links and review data to the public data dump Is there a way to access an iteration-counter in Java's for-each loop? Is there a way in Java's for-each loop  for(String s : stringArray) {   doSomethingWith(s); }   to find out how often the loop has already been processed?  Aside from using the old and well-known for(int i=0; i &lt; boundary; i++) - loop, is the construct  int i = 0; for(String s : stringArray) {   doSomethingWith(s);   i++; }   the only way to have such a counter available in a for-each loop? Open Windows Terminal as admin with WIN+R Why does:   $$ \sum_{k=0}^{n} k \binom nk p^k (1-p)^{n-k} = np $$ ? Taking the derivative of:   $$ \sum_{k=0}^{n}  \binom nk p^k (1-p)^{n-k} = (1 + [1-P])^n = 1 $$   does not seem useful, since you would get zero. And induction hasn't yet worked for me, since – during the inductive step – I am unable to prove that:   $$ \sum_{k=0}^{n+1} k \binom {n+1}{k} p^k (1-p)^{n+1-k} = (n+1)p  $$   assuming that:   $$ \sum_{k=0}^{n} k \binom {n}{k} p^k (1-p)^{n-k} = np  $$