I was trying to make some kitPvP plugins but then I was faced with a "bug". When I choose the kit(pvp), it gives me the soups but it doesn't clear the previous inventory (that is the spawn inventory default). Here is the code:  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {     if(!(sender instanceof Player)) {         sender.sendMessage(ChatColor.RED + "Apenas players podem usar o comando /kit");         return true;     }     Player p = (Player)sender;     if (args.length == 0) {         p.sendMessage(ChatColor.RED + "Precisa defenir qual kit voce quer escolher!");         p.sendMessage(ChatColor.DARK_GRAY + "Comando: " + ChatColor.RED + "/Kit &lt;kit&gt; " + ChatColor.DARK_GRAY + "ou " + ChatColor.RED + "/Kits");         return true;     } else {         if(args[0].equalsIgnoreCase("pvp")) {             if(p.hasPermission("kit.pvp")) {                 if (KitAPI.getKit(p) == "Nenhum") {                     KitAPI.PvP(p);                     p.sendMessage(ChatColor.GREEN + "Voce escolheu o kit PvP");                     BarAPI.setMessage(p, ChatColor.GREEN + "Voce escolheu o kit PvP", 5);                                    p.getInventory().clear();                     return true;                 } else {                     p.sendMessage(ChatColor.RED + "Voce ja possui um kit!");                     return true;                 }             } else {                 p.sendMessage(ChatColor.RED + "Voce nao possui permissao para executar o comando!");                 return true;             }         }         p.sendMessage(ChatColor.DARK_GRAY + "Esse kit " + ChatColor.RED + args[0] + ChatColor.DARK_GRAY + " e invalido!");     }     return false; }   }  Here is the code where is supposted to clear the inventory:  if (KitAPI.getKit(p) == "Nenhum") {                     KitAPI.PvP(p);                     p.sendMessage(ChatColor.GREEN + "Voce escolheu o kit PvP");                     BarAPI.setMessage(p, ChatColor.GREEN + "Voce escolheu o kit PvP", 5);                                    p.getInventory().clear();                     return true;
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
This question is from [Number Theory George E. Andrews 1-1 #3].     Prove that $$x^n-y^n=(x-y)(x^{n-1}+x^{n-2}y+\ldots+xy^{n-2}+y^{n-1}).$$   This problem is driving me crazy. $$x^n-y^n = (x-y)(x^{n-1}+x^{n-2}y+\dots +xy^{n-2}+y^{n-1)}$$  $(x^n-y^n)/(x-y) =$ the sum for the first $n$ numbers and then I added $(xy^{(n+1)-2}+y^{(n+1)-1})$ which should equal $(x^{n+1}-y^{n+1})/(x-y)$ but I can't figure it out    This is a similar problem in the book and I tried this method but it wasn't working out      $\quad$Thereom $\bf1$-$\bf2$: $\,\,\,\,$ If $\,x$ is any real number other than $1$, then $$\sum_{j=0}^{n-1}x^j=1+x+x^2+\ldots+x^{n-1}=\dfrac{x^n-1}{x-1}.$$    $\quad$Remark: $\displaystyle\sum_{j=0}^{n-1}A_j$ is shorthand for $A_0+A_1+A_2+\ldots+A_{n-1}.$     $\quad$Proof: Again we proceed by mathematical induction. If $n=1$ then $\displaystyle\sum_{j=0}^{1-1}x^j=x^0=1$ and $(x-1)/(x-1)=1$. Thus the theorem is true for $n=1$.  $\quad$ Assuming that $\displaystyle\sum_{j=0}^{k-1}x^j=(x^k-1)/(x-1)$, we find that $$ \eqalign{ \sum^{(k+1)-1}_ {j=0}x^j &amp; = \sum^{k-1}_ {j=0}x^j+x^k=\dfrac{x^k-1}{x-1}+x^k \\ &amp;= \dfrac{x^k-1+x^{k+1}-x^k}{x-1}\\ &amp;= \dfrac{x^{k+1}-1}{x-1}. }$$   Hence condition $(\rm ii)$ is fulfilled, and we have established the theorem.    $\quad$Corollary $\bf1$-$\bf1$: $\,\,$ If $\,m$ and $n$ are positive integers and if $m&gt;1$, then $n&lt;m^n.$ Is ignoring emails acceptable in academia? As a grad student, I just find it tremendously frustrating when emails are ignored by faculty (both at my institution and at other places). Is this acceptable? I'd be content with a simple response with one line along the lines of "I have read this email and am busy right now, will respond in X days when I can write a more detailed email." I understand that, as a first year student in my field, I'm not really in a position to request anything of anyone, but it just seems like common decency.  Instead, I never hear back, as if my email has been jettisoned off into oblivion. I have an unused copy of Mass Effect 2 Collector's Edition bought via Amazon.com in the US, including a special code for Inferno Armour (also unused).  Will it work fine if I install and start playing the game in the UK? Does geographical location matter?  Thanks! Can I update an Mac App purchased by a different Apple ID? As the title says. I use, among other things, the following in my lstset:  framerule=1pt, frame=tblr   Some places a page break happens in the middle of my \lstlisting. Fine. But sometimes the whole code of the listing appears on one page, but the bottom frame appears on the top of the next page!    I know that I can float a particular listing, but I have a long document with many listings, and I don't want to float all of them; Most of them also need to be exactly where they are declared. That they are broken over a page doesn't bother me that much.  Is there something that can stop this from happening, without me needing to adjust each individual listing?   had the same problem, but fixed it by removing spaces in front of keywords in a custom language definition. I too have a custom language definition, but his solution doesn't help me. I managed to recreate the situation without a custom language.  Edit and MWE  I managed to reproduce it in a minimal working example. 's a pastebin, if that's helpfull.  \documentclass[UKenglish,a4paper,11pt]{report} \usepackage{babel}  %% Adjustments \addtolength{\topmargin}{-1\baselineskip} \addtolength{\textheight}{4\baselineskip} \pretolerance = 2000 \tolerance = 5000   \hbadness = \tolerance  %% Smaller font \usepackage{mathptmx}  %% LISTINGS \usepackage[final]{listings} \lstset{     xleftmargin=1.5em,     framexleftmargin=1em,     framextopmargin=0.5ex, %%  THE FRAME:     framerule=1pt,     frame=tblr }  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  \usepackage{lipsum}     % for demo \begin{document} \subsubsection{Lorem}   % some fiddling to get the "wrong spacing just right": \lipsum[1-3] \subsubsection{Ipsum}  \lipsum[1] and then some text  \begin{lstlisting} Here is a listing with three lines of code; The bottom border is placed on the next page! \end{lstlisting}  Can you believe it..?! \end{document}   This MWE is rather long. My document inputs most of the listings stuff from files written by others, so I'm not sure what all of it does. If anyone sees some lines that they are sure is irrelevant, feel free to take it out of the MWE.  "Fun fact"  An equally silly situation occurs if you remove \usepackage{mathptmx}: The whole code listing will then appear on the new page, except for the top frame which is left on the bottom of the first page! How can I switch between starting a coroutine vs running the routine all at once? How to find all questions that were duplicates of another question? I am interested to see a list of all questions that were closed because being a dup of another question.  I strongly want to research a particular question and reading all the answers inside the dups will help me a lot.  Is there such feature? if not, this is a feature request The boundary of union is the union of boundaries when the sets have disjoint closures Circular determinant problem I'm stuck in this question: How calculate this determinant ? $$\Delta=\left|\begin{array}{cccccc} 1&amp;2&amp;3&amp;\cdots&amp;\cdots&amp;n\\ n&amp;1&amp;2&amp;\cdots&amp;\cdots&amp; n-1\\ n-1&amp;n&amp;1&amp;\cdots&amp;\cdots&amp;n-2\\ \vdots &amp;\ddots &amp; \ddots&amp;\ddots&amp;&amp;\vdots\\ \vdots &amp;\ddots &amp; \ddots&amp;\ddots&amp;\ddots&amp;\vdots\\ 2&amp;3&amp;4&amp;\cdots&amp;\cdots&amp;1 \end{array}\right|$$ Thanks a lot. Why is $1$ not a prime number? Show that if $fd'=f'd $ and the pairs $f, d $ and $f',d' $ are coprime, then $f=f' $ and $d=d' $. Show that if $fd'=f'd $ and the pair $f, d $ are coprime, that is gcd($d,f $)=1, as is the pair $f',d' $, then $f=f' $ and $d=d' $.  This should be simple, but I couldn't verify it. Thanks in advance! Expected log value of noncentral exponential distribution Word for low level noise among restless crowd, as sign of confusion or complaint? Dictionary gives me "drone" and "murmur" but I'm not sure if that's the word I am thinking of.  I want to use it to describe a group of people on strike who hear that their demands are not met and the CEO has resigned.  They're not shouting, but they're not whispering either.  They're restless and confused.  I want to say that a certain something (murmur?) was heard among the crowds, to indicate their state. How to remove Windows 10 from Windows Boot Manager after uninstalling it? I installed Windows 7 on one partition and formatted the other where I had Windows 10 installed leaving only that one Windows 7 OS on my drive, but I still have two OSs offered in Windows Boot Manager. What is even weirder is that their names are reversed, when I choose Windows 10, it's Windows 7 that gets loaded. What is Reflection in Java Can anyone explain? Let $R$ be a commutative Noetherian ring (with unity), and let $I$ be an ideal of $R$ such that $R/I \cong R$. Then is it true that $I=(0)$ ?  I know that a surjective ring endomorphism of a Noetherian ring is also injective, and since there is a natural surjection from $R$ onto $R/I$ we get a surjection from $R$ onto $R$, but the problem is I can not determine the map explicitly and I am not sure about the statement. Please help. Thanks in advance. Creating an arbitrary state of the quantum simple harmonic oscillator How can I take shallow depth of field photos with a point-and-shoot camera? C# 3.0 Auto-Properties - Is it possible to add custom behaviour? I would like to know if there is any way to add custom behaviour to the auto property get/set methods.  An obvious case I can think of is wanting every set property method to call on any PropertyChanged event handlers as part of a System.ComponentModel.INotifyPropertyChanged implementation.  This would allow a class to have numerous properties that can be observed, where each property is defined using auto property syntax.  Basically I'm wondering if there is anything similar to either a get/set template or post get/set hook with class scope.  (I know the same end functionality can easily be achieved in slightly more verbose ways - I just hate duplication of a pattern) Proving Pascal's Rule : ${{n} \choose {r}}={{n-1} \choose {r-1}}+{{n-1} \choose r}$ when $1\leq r\leq n$ I'm trying to prove that ${n \choose r}$ is equal to ${{n-1} \choose {r-1}}+{{n-1} \choose r}$ when $1\leq r\leq n$.  I suppose I could use the counting rules in probability, perhaps combination= ${{n} \choose {r}}=\frac{n!}{r!(n-r!)}$.  I want to see an actual proof behind this equation.  Does anyone have any ideas?