Below code represents the same operation but results getting differes ? can any one tell me how the java executs the == operation ?            String str = new String("Hello");           String str1 = new String("Hello");           System.out.println(str == str1);   o/p  False            String str = "Hello";           String str1 = "Hello";           System.out.println(str == str1);   o/p  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 button is in the new Firefox, but what is the name of it? Unable to SSH to my virtual machine via Windows Power Shell ISE Why am I forced to use the newest chat interface? When logging into chat-stackexange I am presented with this message:  The new mobile version of chat is now the default mobile version on devices that support it. Unlike the classic (okay, ancient) version, it allows you to perform actions like editing, starring, and direct replies to particular messages. The classic version is still available and will be used in browsers that lack support for some necessary features of the new version. Logged in users can also choose to continue using the old version on the preferences page of their user profile. Please report bugs and other issues on Meta Stack Exchange. Thank you!  I choose to continue using the old version but cannot find the option to do so on my chat user profile page? Problem using atan in pgfplots My roommate put a hunk of beef roast in the slow-cooker for a good 6 hours.  It's a fairly large sized slow-cooker, at least 8 quarts.  The meat was cooked through but very chewy, and I never remember my mom having that issue with a slow-cooker.  My roommate tends to put only enough water to get halfway up the side of the roast, and always uses a slow-cooker 'bag' (another thing my mom never did).  What advice can I offer them to get a better outcome? Grub rescue after installing Ubuntu on a external HDD from USB "Unfortunately, ... has stopped" when Downloading file in Android Fantasy book with shape shifting dragon warriors Set in a fantasy world with shape shifting Dragon kings and their warriors. They terrorize the humans, and kill those with magic.   The protagonist is the great-grandson of a powerful warlock. He finds out that he has magic, and fights with it to save his new friends, the Griffin, Blackhorse (I think that's his name), some creepy necromancer who is immortal, and Gwen (fellow sorceress), along with the kingdom that the Griffin rules in.   They fight the protagonist's father, the leader of the Dragon kings, the king's Duke, and the creepy sorcerer, who has a curse (when he dies, he changes side from good to bad, or bad to good). I have no clue what this is called, but I want to find out, since I'm out of things to read. I know you can create a rounded-corner rectangle; but, how do you create a triangle with rounded corners in Photoshop?  I am actually interested in making it from scratch, not basing it on a custom shape that is available in Photoshop. Thanks. Sitemaps - one per subdomain or one for the base domain? I have more than 5 subdomains on a project, say developer, www, staff and some more, what is the best practice in creating sitemaps?   All subdomains that share a same sitemap at base domain (example.com/sitemap.xml) ? or different sitemaps for different subdomains?(developer.example.com/sitemap.xml and www.example.com/sitemap.xml)   Since the subdomains are several parts of the main application, what are the pros and cons of each, and what should I consider while choosing the one over the other? (one sitemap per subdomain or one for the whole site) How do I use reflection to call a generic method? What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod&lt;T&gt;() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod&lt;T&gt;()?         GenericMethod&lt;myType&gt;(); // This doesn't work          // What changes to call StaticMethod&lt;T&gt;()?         Sample.StaticMethod&lt;myType&gt;(); // This also doesn't work     }      public void GenericMethod&lt;T&gt;()     {         // ...     }      public static void StaticMethod&lt;T&gt;()     {         //...     } } Most efficient way to append arrays in C#? I am pulling data out of an old-school ActiveX in the form of arrays of doubles. I don't initially know the final number of samples I will actually retrieve.  What is the most efficient way to concatenate these arrays together in C# as I pull them  out of the system? In which scenario do I use a particular STL container? I've been reading up on STL containers in my book on C++, specifically the section on the STL and its containers. Now I do understand each and every one of them have their own specific properties, and I'm close to memorizing all of them... But what I do not yet grasp is in which scenario each of them is used.  What is the explanation? Example code is much prefered. How do I disable the guest session? How do I disable the guest session in Ubuntu 11.10 or higher? I don't want people to be able to use my computer without using a password to log in! I'd like to extract the text from an HTML file using Python.  I want essentially the same output I would get if I copied the text from a browser and pasted it into notepad.    I'd like something more robust than using regular expressions that may fail on poorly formed HTML.  I've seen many people recommend Beautiful Soup, but I've had a few problems using it.  For one, it picked up unwanted text, such as JavaScript source.  Also, it did not interpret HTML entities.  For example, I would expect &amp;#39; in HTML source to be converted to an apostrophe in text, just as if I'd pasted the browser content into notepad.  Update html2text looks promising. It handles HTML entities correctly and ignores JavaScript.  However, it does not exactly produce plain text; it produces markdown that would then have to be turned into plain text. It comes with no examples or documentation, but the code looks clean.    Related questions: I'm having trouble understanding the wording of one of my homework questions. Since this question appears early in the chapter, I have a feeling that I'm misinterpreting it.  Give a finite automaton that that accepts the following language: The language over $\{a, b\}$ of any even number of $a$'s and any odd number of $b$'s.   I'm having trouble with the usage of "and". Is it asking for an FA that accepts any string that is either an even number of $a$'s or an odd number of $b$'s, e.g. $aa$, $bbb$, $aaaa$, etc, but not accept strings like $aabbb$, $abbab$.   Or, is it asking for an FA that accepts any string that contains an even number of $a$'s or an odd number of $b$'s, e.g. $aabbb$, $ababb$, etc.   The first case is relatively simple, but I've been struggling with the second. I haven't even managed to convince myself that it is a regular language (because I haven't been able to come up with a regular expression that matches it).   My questions: Which interpretation seems most likely. Is the second case a regular language, if so, give a regular expression that recognizes it. How to generate PDF/A and PDF/X? I have heard about PDF  PDF/A (for archival) and PDF/X (for printing). How to generate LaTeX documents like that?  I'm also interested in answers with plain TeX and ConTeXt, and hopefully with both pdfTeX and XeTeX engines. Prove that 1/2 + 1/4 + 1/8 ....... = 1 I've often heard that instead of adding up to a little less than one, 1/2 + 1/4 + 1/8... = 1. Is there any way to prove this using equations without using Sigma, or is it just an accepted fact? I need it without Sigma so I can explain it to my little sister.  It is not a duplicate because this one does not use Sigma, and the one marked as duplicate does. I want it to use variables and equations. In many machine learning applications, the so called data augmentation methods have allowed building better models. For example, assume a training set of $100$ images of cats and dogs. By rotating, mirroring, adjusting contrast, etc. it is possible to generate additional images from the original ones.  In the case of images, the data augmentation is relatively straightforward. However, suppose (for example) that one has a training set of $100$ samples and few hundred continuous variables that represent different things. The data augmentation does not anymore seem so intuitive. What could be done in such case? How to rename objects with python?