I have this loop but i dont know why it never check the condition,i thought it might for integer.tostring,please help if you can:     public static void linerSearch(String[] array1, int key){         int size = array1.length;         for(int i=0;i&lt;size;i++){             if(array1[i] == Integer.toString(key)){ // &lt; -- This line                 System.out.println("The node is already in the list");             }         }       }
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?
(How) Can SE sites change their reputation payout? A recent question on  reminded me that there is a  about awarding 10 rep per question upvote. This is mainly due to the relative difficulty and usefulness of asking/answering being different on the site (or appearing to be, at least).  The highly voted answer on PPCG is "Yes, we should do that," but it's been well over three years since it was posted. The answer there said that (at least at that time) meta.so had this implemented already, so it wouldn't/shouldn't be hard to do.  Given that it's been quite some time, I don't know if that's (still) true. I know that meat has undergone changes since then, but as long as I've been actively participating, meta.se (and meta.so before the split) has given 5 points per question upvote, not 10.  My question is: What would the process to change it look like? It's been discussed on meta.ppcg and agreed upon, so what's the next step? Or is it not feasible at all? Limit of Multivariate Probability Density Function as one or more or all variables approach positive or negative infinity Could someone point out a good source or provide justification as to whether the limit of a multivariate probability density function, as one or more or all variables tends to positive or negative infinity, goes to zero.  $$\lim_{x_{1}\to\pm\infty}f(x_{1},x_{2},...,x_{n})=0$$  $$\lim_{x_{1},x_{2}\to\pm\infty}f(x_{1},x_{2},...,x_{n})=0$$  $$\lim_{x_{1},x_{2},...,x_{n}\to\pm\infty}f(x_{1},x_{2},...,x_{n})=0$$  I have found this related question for the univariate case: Nilpotent matrix and basis for $F^n$ Calculating geometry for feature class with x/y and Lat/Long values in different projections? How to determine if the specific time is between given time range in javascript Foreign words reborrowed back into English Wikipedia mentions several English words that have been :   Anime comes from animation and has been reborrowed into English to mean Japanese-style animation. Puroresu comes from professional wrestling and is a term for Japanese-style professional wrestling. Kosupure comes from cosplay (an abbreviation of costume play) and refers to the practice of dressing in costumes of anime and video game characters.    Do you know other examples of word reborrowings from Japanese or other languages back into English, or vice versa? Display error message if same record exist with combination of some fields? I have taken three fields from case object called AccountName, IntegrationTo__c and SfType__c (checkbox).  I have created one case record with a specific combination of three fields.  For the second time I create a record with that combination, then  display error message only if SfType__c is true in first record otherwise allow  for record creation.  trigger AvoidDuplicate on Case(before insert)  {          set&lt;string&gt; newNameSet = new set&lt;string&gt;();     newNameSet = new set&lt;string&gt;();      set&lt;string&gt; newEmailSet = new set&lt;string&gt;();      set&lt;string&gt; dbNameSet = new set&lt;string&gt;();      set&lt;string&gt; dbEmailSet = new set&lt;string&gt;();      for(Case newLead : trigger.new){          newNameSet.add(newLead.Account.Name);          newEmailSet.add(newLead.IntegrationTo__c);      }      for(Case dbLead : [select id, Case.Account.Name, IntegrationTo__c from Case where IntegrationTo__c IN: newEmailSet OR Case.Account.Name IN: newNameSet]){          dbNameSet.add(dbLead.Account.Name);          dbEmailSet.add(dbLead.IntegrationTo__c);      }      for(Case newLead : trigger.new){          if(dbNameSet.contains(newLead.Account.Name) &amp;&amp; dbEmailSet.Contains(newLead.IntegrationTo__c))              newLead.addError('You are inserting Duplicate Case');      }  }   i wrote this this not checking the account field name and integration__c values only with combination of account and integration__c shows error Do particles in a sound wave ever move transversally? I'm trying to visualize how sound waves work and I was curious about something.   So sound moves in longitudinal waves, which I think I understand.  There is a really good  explaining this.  In the video the air particles are depicted as moving from left to right (longitudinally). But do they ever move up and down even a little bit? Are they on some kind of fixed axis where they can only move longitudinally and never move even the slightest bit in a vertical direction? How to execute a JavaScript function when I have its name as a string I have the name of a function in JavaScript as a string. How do I convert that into a function pointer so I can call it later?  Depending on the circumstances, I may need to pass various arguments into the method too.  Some of the functions may take the form of namespace.namespace.function(args[...]). Display bare HTML from hook_menu() What would be the cleanest way to route URLs to functions and return only the HTML output from those functions (a.k.a. the menu callback)?  If I use hook_menu() the string that's returned will be the HTML within the rest of the site. I want the page to display only the string returned from the menu callback.  Should I use drupal_set_header() in the same way drupal_json() does? Is this not inefficient having fully bootstrapped Drupal, and then changing the header at the last minute?  I want the fastest code path possible since this is going to be for widgets on external sites.  I could start with a standalone .php file and bootstrap what I need but the hook_menu routing is nice.    How should you do this? System.FinalException: Record is read-only: Trigger.updateCompetitors: line 24 I am writing a trigger to get all the Opportunity competitors into a field on Opportunity, however, getting an error while testing it.  Error: updateCompetitors: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.updateCompetitors: line 24  Can you please check the below code and suggest me what's wrong with this?  trigger updateCompetitors on Opportunity(after insert, after update){    List&lt;Opportunity&gt; OppIds = new List&lt;Opportunity&gt;();     for (Opportunity opp: trigger.new){         OppIds.add(opp);     }  List&lt;OpportunityCompetitor&gt; oppComps = new List&lt;OpportunityCompetitor&gt;();  oppComps= [select id, CompetitorName, Strengths, Weaknesses from OpportunityCompetitor where OpportunityId in: Trigger.newMap.keySet()];  List&lt;Opportunity&gt; OppstoUpdate = new List&lt;Opportunity&gt;();   for (Opportunity opp: OppIds){     String allcomps = null;      if( oppComps.size()&gt;0 ) {       for (integer i = 0; i &lt; oppComps.size(); i++){          allcomps = allcomps + oppComps[i].CompetitorName+',';       }     }    opp.OpportunityCompetitors__c = allcomps;    OppstoUpdate.add(opp);  }    update OppstoUpdate; } Careers: create PDF is not handling properly the sections Writing and Reading Scenario #1: no items in the section Writing, a few items in Reading   click on create pdf in the PDF you get your readings under the title "Writing" (should be "Reading")   Scenario #2: one item in the section Writing, a few items in Reading   click on create pdf in the PDF you get:   your readings under the title "Writing" (should be "Reading"), as in scenario #1 there are no writings (there should be one)    Hope it to be clear. Let me know in case it isn't.  Thank you! The origin of my question arose from a problem: Let $q: X \to Y$ and $r: Y \to Z$ be covering maps, let $p= r \circ q$. Show that if $r^{-1}(z)$ is finite for each $z \in Z$, then $p$ is a covering map.  I am just wondering is there an easy counter example to show the necessary of "inverse image of every point is finite" condition?  I have already checked Hatcher's book (the wedged circle example) but I wonder is there a less complex and more obvious example?  I tried to construct a counter example by composition of a covering map from $R_+$ to $S^1$ with $R$ in the middle, but I failed due to I can't find a covering map from $R^+$ to $R$ which does the job. INT(5) vs SMALLINT(5): numbers in parenthesis after the numeric type In MySQL table definitions is there a different between INT(5) and SMALLINT(5)?  Or do they both represent the same size? How do I record a screen cap video of the iPad? I'm looking for a method to record the video without actually filming the device. Does such a method exist? When is 6 a square in Zp To find when $6$ is a square I divided $6$ in to $2$ and $3$ by The Legendre symbol.  $$\frac{6}{p} = \frac{2}{p} \times \frac{3}{p}$$  I know that we can multiply the cases of when $2$ and $$ are squares because then it is (1)(1) by Legendre.   $2$ is a square when $p \equiv 1 \pmod{8}$   $3$ is a square when $p \equiv 1 \pmod{12}$  so $6$ is a square when $p \equiv 1 \pmod {24}$ ($96$, but the $lcm(8,12)= 24$)   but how do I find the cases when $2$ and $3$ are both NOT squares? because then $6$ would be a square then as well, $(-1)(-1) = 1$ by Legendre. Arrays, linked lists and other data structures in cmd.exe (batch) script Is there such a thing as a deposit-only bank account? My employer wants me to give my routing-numbers, social-security numbers, and basically everything else required to take money out of my account, to several third-party direct-deposit websites (one for weekly paychecks, one for mileage reimbursements, etc.).  I am not comfortable giving my identity information away to all these places.  I'd like to give them access to an account which they can only deposit into, never withdraw (either a separate account, or, even better, a deposit-only alias to my real account).  Does such a thing exist?    [Edit] I'm not worried about the companies so much as I am worried about bad guys who inevitably hack those companies' databases, or get hired to work there.  This type of account would also be handy for giving read-only access to sites like mint.com or quicken.com, easing my mind about their hackers/unscrupulous employees. Get in vs. get on Possible Duplicate:          I'm an EFL (English as a foreign language) teacher and I haven't been able to come up with a good principle for which preposition to use after get when referring to transportation.  Some examples:   Get in:   a car/taxi/van/truck, etc.  Get on:   a bus/plane/bike/truck, etc.    How can one choose whether to use in or on? Note that in some cases, such as the example with truck, either preposition is possible but the choice affects the meaning.  I've been telling my students that there is no rule, so they just have to memorize which preposition to use, but I'm really hoping I'm wrong.  This question would be better suited for the upcoming  Stack Exchange, but it hasn't entered beta yet. More . Apt-get update with an @ in password error