I am trying to execute following code and found that for loop is not executing at all. Even not getting any error. Let me clear that "dateList" is a list of string and it's not empty, I already tried printing that. "monthList" is an ArrayList of string.  private ArrayList&lt;String&gt; monthList = new ArrayList&lt;String&gt;(Arrays.asList("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")); private List&lt;String&gt; dateList = new ArrayList&lt;&gt;(); private List&lt;Date&gt; finalDatesInMMMDDYYYYFormate = new ArrayList&lt;&gt;(); private int year = 2019;     for (int m=0; m&lt;dateList.size(); m++){         System.out.println("Date at position ------ "+m+" is -------"+dateList.get(m));     } // length of this list is 9 &amp; it prints eberything from 0 to 9. It is not empty.     int assignYear = year;     for (int k=1; k&lt;dateList.size(); k++){         if (dateList.get(k).substring(0,2)==dateList.get(k-1).substring(0,2) || dateList.get(k).substring(0,2) == monthList.get(0)){             finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));         }         else if (dateList.get(k).substring(0,2) == monthList.get(11)){             finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear-1).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));             assignYear = assignYear-1;         }         else {             for (int l=0; l&lt;monthList.indexOf(dateList.get(k-1).substring(0,2)); l++){                 if (dateList.get(k).substring(0,2) == monthList.get(l)){                     finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));                     break;                 }                 else {                     finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear-1).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));                     assignYear--;                     break;                 }             }         }     }
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?
Show that conguence $\bmod m\,$ is an equivalence relation Can we search posts by number of comments? After reading a couple of answers and comments on some SQL questions here, and also hearing that a friend of mine works at a place which has a policy which bans them, I'm wondering if there's anything wrong with using backticks around field names in MySQL.  That is:  SELECT `id`, `name`, `anotherfield` ... -- vs -- SELECT id, name, anotherfield ... How do I install Guest Additions in a VirtualBox VM? What are examples where a "naive bootstrap" fails? $\lim_{x \to 0} f(x)=\frac{\tan 3x}{\tan 2x}$ without L'Hospital sftp: upload all files, directories and sub-directories contained in a folder On machine A I have the folder /home/a/  On machine B I have the folder /home/b/  I wish transfer all files, directories and sub-directories of /home/a in /home/b with sftp On machine A I tried the commands: sftp fibon82@machineB.com put /home/a/* /home/b/  but it doesn't work, i get the error message: &quot;skipping non-regular file /home/a/a1&quot;... [a1 is a sub-directory of a] How could I modify the put instruction? Thanks! :) EDIT: I solved using scp: scp -r /home/a/ fibon82@machineB.com:/home/b/ Shortcuts in Objective-C to concatenate NSStrings Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C, or shortcuts for working with NSString in general?  For example, I'd like to make:  NSString *myString = @"This"; NSString *test = [myString stringByAppendingString:@" is just a test"];   something more like:  string myString = "This"; string test = myString + " is just a test"; Number of triangles formed by $m$ lines opengl storing multiple indices into indices buffer I'm trying to find a way with javascript to highlight the text the user selects when they click some odd highlight button (as in &lt;span style="background-color:yellow"&gt;highlighted text&lt;/span&gt;). It only has to work with either WebKit or Firefox, but it seems to be well nigh impossible because it has to work in the following cases:  &lt;p&gt;this is text&lt;/p&gt; &lt;p&gt;I eat food&lt;/p&gt;   When the user selects from "is text" through "I eat" in the browser (can't just put a span there).  and this case:  &lt;span&gt;&lt;span&gt;this is text&lt;/span&gt;middle text&lt;span&gt;this is text&lt;/span&gt;&lt;/span&gt;   When the user selects from "is text" to "this is" in the browser (even though you can wrap your highlight spans around each element in the selection, I'd like to see you try to get that middle text highlighted).  This problem doesn't seem to be solved anywhere, frankly I doubt it's possible.  It would be possible if you could get the Range that you get from the selection as a string complete with html which could be parsed and then replaced, but as far as I can tell you can't get the raw html of a Range.. pity. Contraction of Kronecker delta = 4 This suggests, as a shortcut notation, the concept of lowering indices; from any vector we can construct a (0, 1) tensor defined by contraction with the metric: $$A_\nu ≡ g_{\mu\nu}A^\mu$$  so that the dot product becomes $$g_{\mu\nu}A^\mu B^\nu = A_\nu B^\nu$$  We also define the inverse metric $g^{\mu\nu}$ as the matrix inverse of the metric tensor: $$g^{\mu\nu}g_{\nu\rho} = δ^\mu_\rho$$  where $δ^\mu_\rho$ is the (spacetime) Kronecker delta. (Convince yourself that this expression really does correspond to matrix multiplication.) Then we have the ability to raise indices: $$A^\mu = g^{\mu\nu}A_\nu$$ Note that raising an index on the metric yields the Kronecker delta, so we have $$g^{\mu\nu}g_{\mu\nu} = δ^\mu_\mu = 4$$  I don't understand why $δ^\mu_\mu = 4$. Shouldn't it equal 1? Set up a scheduled job? I've been working on a web app using Django, and I'm curious if there is a way to schedule a job to run periodically.   Basically I just want to run through the database and make some calculations/updates on an automatic, regular basis, but I can't seem to find any documentation on doing this.  Does anyone know how to set this up?  To clarify:  I know I can set up a cron job to do this, but I'm curious if there is some feature in Django that provides this functionality.   I'd like people to be able to deploy this app themselves without having to do much config (preferably zero).  I've considered triggering these actions "retroactively" by simply checking if a job should have been run since the last time a request was sent to the site, but I'm hoping for something a bit cleaner. Leaving values blank if not passed in str.format I thought I'd post this as it illustrates a problem often encountered on ELU.     In structures such as 'football manager', is 'football' a modifier or   a complement of the head noun?   I've seen both terms used as if there were only one possible correct answer. However, I've come across widely differing definitions of both 'modify' and 'complement' as used in grammar. I believe that people stating baldly that this is either one or the other are assuming a grammar that they prefer, rather than giving a balanced overview.  Notice that I intend this question to explore the usage/s of the term 'modify' and of the term 'complement' in this context. There may be overlap with the question of which word-class 'football' fits into, but that decision hardly answers the question. Are comments safely hidden once the document is compiled? Jordan Canonical Form determined by characteristic and minimal polynomials in dimension $3$, but not beyond Why and how is the  of a matrix in $M_3(\mathbb C)$ fully determined by its characteristic and minimal polynomials? And why does it fail for $n &gt;3$?   Thanks. How can I do unit testing in Unity? How to implement Unit Test at Unity3D.   I wonder if it would be possible to extend the Unity editor to have some sort of testing framework in it.    Is there any guideline to implement it? Any reference like book, blog? Any working example or project? I know the  processors have been around for a long time and are mostly used in servers, but I am curious, why do people not use the Xeons in a high performance desktop?    As far as I know about the best desktop processor out there now is the  line. The i7's and Xeons are both quad-core processors, what is the main difference in these? I just saw that the MacBook Pro's are using the quad core Xeons instead of the i7's. How can I use pathauto to generate URLs for deeply nested vocabularies? I am generating breadcrumbs from URL arguments as described .  I have a vocabulary that looks like this:  Arts-> Performing-> Dancing-> Ballet  I want my url to look like this: arts/performing/dancing/ballet  Using the pathauto module, I can do this for taxonomy terms:  [term:parent]/[term:name]   Which, on the Ballet page, gives me the following; not what I want:  dancing/ballet    If I use parents instead of parent,  ([term:parents]/[term:name]); this is close but not quite:  arts-performing-dancing/ballet   How can I get from arts-performing-dancing to arts/performing/dancing?