I'm trying to do a simple IF check of a String that I know has been formatted correctly with:  Calendar c = Calendar.getInstance(); SimpleDateFormat df = new SimpleDateFormat("MM/dd/yyyy"); String formattedDate = df.format(c.getTime());   At this point formattedDate is "09/24/2015". I can confirm that this is true:  remoteViews.setTextViewText( R.id.widget_date, formattedDate);   It's showing me the correct date.  So I know it's good. So I test it:  if (formattedDate=="09/24/2015"){ //do some stuff }   For whatever reason, that condition is not true, and nothing happens. I have tried everything from removing the slashes, to just changing the format around, but formattedDate never equals what that string clearly is.  Is there something I'm missing here?
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?
Suppose we have $n$ covariates $x_1, \dots, x_n$ and a binary outcome variable $y$. Some of these covariates are categorical with multiple levels. Others are continuous. How would you choose the "best" model? In other words, how do you choose which covariates to include in the model?  Would you model $y$ with each of the covariates individually using simple logistic regression and choose the ones with a significant association? Imputation before or after splitting into train and test? This is a sentence in a book by Rudy Giuliani.     I could ensure my deputies and commissioners were working off the same   page and could carry a coherent message back to their staffs.   Isn't staff a mass noun with no plural when referring to people? How do I show that $\ln(x) = \lim_{n\to\infty} n (x^{1/n} - 1)$?  I ran into this identity on . I haven't been able to find any proof online and my efforts to get from $\ln(x) := \int_1^x \frac{\mathrm dt}t$ to that limit have been a failure. Can you contract the main verb '[I] have' in a sentence? What are the effects of exceptions on performance in Java? Question:  Is exception handling in Java actually slow?  Conventional wisdom, as well as a lot of Google results, says that exceptional logic shouldn't be used for normal program flow in Java.  Two reasons are usually given,   it is really slow - even an order of magnitude slower than regular code (the reasons given vary),     and    it is messy because people expect only errors to be handled in exceptional code.     This question is about #1.  As an example,  describes Java exception handling as "very slow" and relates the slowness to the creation of the exception message string - "this string is then used in creating the exception object that is thrown. This is not fast."  The article  says that "the reason for this is due to the object creation aspect of exception handling, which thereby makes throwing exceptions inherently slow".  Another reason out there is that the stack trace generation is what slows it down.  My testing (using Java 1.6.0_07, Java HotSpot 10.0, on 32 bit Linux), indicates that exception handling is no slower than regular code.  I tried running a method in a loop that executes some code.  At the end of the method, I use a boolean to indicate whether to return or throw.  This way the actual processing is the same. I tried running the methods in different orders and averaging my test times, thinking it may have been the JVM warming up.  In all my tests, the throw was at least as fast as the return, if not faster (up to 3.1% faster).  I am completely open to the possibility that my tests were wrong, but I haven't seen anything out there in the way of the code sample, test comparisons, or results in the last year or two that show exception handling in Java to actually be slow.  What leads me down this path was an API I needed to use that threw exceptions as part of normal control logic.  I wanted to correct them in their usage, but now I may not be able to.  Will I instead have to praise them on their forward thinking?  In the paper , the authors suggest that the presence of exception handlers alone, even if no exceptions are thrown, is enough to prevent the JIT compiler from optimizing the code properly, thus slowing it down.  I haven't tested this theory yet. How do I attach rope to a mesh I am trying to make a pirate ship and am trying to attach rope to the sails. my rope is made using a path, and soft body physics. I can not find a way to attach my rope to the sail. and I can not use pinned vertices because this is not a cloth modifier. How to Translate Content type name using i18n module? I am developing a multilingual site that supports English and Norsk bokmal. I have set English as my default language. I wanted to translate the contents and the other things in the site.  My real problem started when I found that I was unable to see the translation of the content type's name. I went to admin/config/regional/translate/translate and translated everything, but still my content type's name is not translated.  I have attached a screenshot of the translation page. Still I don't find a way to translate the content type's name. Why do I get the error "failed unmounting /var" during shutdown? I have a fresh install of Debian 9.0.0. It has a separate 1 GB partition for /var formatted at ext4. When I shutdown from the terminal, using shutdown -h now, there is a bright-red error message stating "failed unmounting /var".  What is the fix for this error? How to make partitions mount at startup? Recalculate google sheet on demand: I have the following formula in a sheet:  =if(E1="HOLD",,query(Cust_Orders!B6:Z5000,"Select Y,G,I,H,K where H&gt;0  "))   With E1 being a drop down with values HOLD and FETCH  The recalculation when I go to FETCH takes about 13 seconds.  But when it is in HOLD, the query doesn't exceute, and everything goes blank. Not what I want.  I'm trying to avoid recalculating this query every time I make a change in the Cust_Orders range, but keep the old values, as two different pivot tables that are viewed by other people are dependent on it.  Google spreadsheet recalc settings all are 'on change and foo'  Is there a way to do this? Can we move "Start a bounty" to a more intuitive location? How can I find my Bug-report that I submitted from the Desktop on launchpad?  I have found a partial solution to my own question:  The program that sends the Bug-reports from the desktop is called apport. It doesn't requires a launchpad account. The service whoopsie submits the Bug-Report directly to the server daisy.ubuntu.com (I'm not sure if those bugs actually appear on launchpad publicly.)  But I found my Bug-Report on my Harddisk in /var/crash/ .  From there I can copy and paste parts of the file to my opened bug on launchpad. Thanks for your tips.  Original question:  I had a severe bug, and I found someone with the same problem in launchpad. After I found a temporary fix I was able to submit the bug with the ubuntu-bug-reporter.  How can I find this ubuntu-bug-reporter generated bug-report in launchpad? I would like to combine those two bug-reports (mark as duplicate). Because the generated one has all the debug information and the other one has the description of this bug. Will Stack Overflow's engine be (someday, or ever) open sourced? Get the real width and height of an image with JavaScript? (in Safari/Chrome) I am creating a jQuery plugin.  How do I get the real image width and height with Javascript in Safari?  The following works with Firefox 3, IE7 and Opera 9:  var pic = $("img")  // need to remove these in of case img-element has set width and height pic.removeAttr("width");  pic.removeAttr("height");  var pic_real_width = pic.width(); var pic_real_height = pic.height();   But in Webkit browsers like Safari and Google Chrome values are 0. Can you help me with my software licensing issue? This is a  about Licensing.    Questions on licensing are off-topic on Server Fault.  If your question has been closed as a duplicate of this question, then this is because we want to help you understand why licence questions are off topic rather than just telling you "it just is". In all likelihood, this question will not address your question directly, it was not meant to.    I have a question regarding software licensing. Can the Server Fault community please help with the following:   How many licenses do I need? Is this licensing configuration valid? What CALs do I need to be properly licensed? Can I run this product in a virtual environment? Can I downgrade this product to an earlier version? Am I entitled to feature X with license Y? How to know the usage of undocumented function like LinearAlgebra`BLAS? Do we keep hats from year to year? This is the first year that I pay attention to hats (I love hats!) and I wonder if I will keep my hats for next year?  Or will I start over with zero hats next year? Does C# have extension properties? I just installed Dufour on my Windows 7 Lenovo ThinkCentre desktop. When I open 2.0.1 I get this error window:    And when I try to add the 'Add Delimited Text Layer' plugin I get this message:    When I click 'OK' the program closes.   Any help is greatly appreciated - thanks.