I am new to Java and trying to learn by practicing. I am not sure where I am going wrong in my if statement, it seems that after I type r (I believe scanner is storing this in value) the first part of the if statement does not initialize and instead the else statement initializes.  import java.util.Scanner; import java.util.concurrent.ThreadLocalRandom; public class T2 { public static void main(String args[]){     Scanner input = new Scanner(System.in);     T2_2 T2_2Object = new T2_2();      System.out.println("What is your favorite color? (Enter 0 if unsure) ");     String value = input.nextLine();      if (value == "r"){         int value2;          value2 = ThreadLocalRandom.current().nextInt(1,10);          String value3 = Integer.toString(value2);         System.out.println(value3);
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?
Humans don't digest fibre, and nor do any animals, but some creatures have micro-organisms (bacteria, I'm guessing) in their gut which digest fibre for them.  My question is, could humans take some sort of pill and establish our own fibre-digesting colonies in our intestines?  Has this been tried?  Supposing it could be done, would you suppose it would have any negative effects on our health?  (i.e.. would those whose gut digested fibre for them be stuck on a low-fibre diet?).    Purpose of question: just wondering.  It would be cool to be able to eat bark. Simple question:     My apples and orange are wrong   or     My apples and orange is wrong   I am not a native English speaker, and I am having some trouble choosing between plural are or singular is for that kind of example. How do I change the computer name? When I connect to my server (ubuntu server 10.10), I get this:  name@server-name.belkin ~&gt;   How can I remove ".belkin"? Could cancer be in itself a evolutionary process? Could cancer be in itself a evolutionary process? Maybe in some way could it be a process of variation? Or would this idea be completely without support, if so, why?   I don't mean that each case would lead to evolution, but that within an entire group of organisms, it could lead to case of of individuals developing ways to resist what caused the cancer, maybe in cases of individuals beating the cancer or in cases of successive generations of off spring from individuals with cancer?   Could it be possible that in rare cases it could lead to the development of new organs or specialized cells? Is exFAT now the best choice for an external hard drive that will be used for Windows, Mac, and Linux? Latest NVIDIA driver on Ubuntu 16.04 Plain integer partitions of $n$ using $r$ parts Division of number $n$ on parts $a_1,...,a_r$ where $a_1 \le ... \le a_r$ we call a plain if $a_1 = 1$ and $a_i - a_{i-1} \le 1$ for $2 \le i \le r$. Find enumerator (generating function) for plain divisions.  my try  The hint was to use bijection between plain divisions and some commonly know enumerator. I tried to use enumerator of divisions on different parts: $$ (1+x)(1+x^2)...(1+x^r)$$ where number of plain divisions is  $$[x^n](1+x)(1+x^2)...(1+x^r) $$ let function  $$f(n,r) = [x^n](1+x)(1+x^2)...(1+x^r) $$  For some first divisions it works. For example: $$f(4,3) = 1 $$ $$f(6,3) = 1 $$ $$f(11,5) = 2$$ But when I tried to find bijection, I failed. I found that this function isn't correct because $f(15,6) = 4$ but should be equal to $3$ because: $$15 = 1,1, 2, 3, 4, 4 \\ 15 = 1, 2, 2, 3, 3, 4\\ 15 = 1, 2, 3, 3, 3, 3 $$. There I stucked. How do I get the first element from an IEnumerable in .net? I often want to grab the first element of an IEnumerable&lt;T&gt; in .net, and I haven't found a nice way to do it.  The best I've come up with is:  foreach(Elem e in enumerable) {   // do something with e   break; }   Yuck!  So, is there a nice way to do this? How does one use circular polarizers? How much web can Spider-Man produce? Especially if he is not using his  but .   Also what happens to the web that he leaves behind? Does it decay after certain time or lose it stickiness and drops off? Does "She had a brother" mean that her brother is dead? My Friend has sent me this riddle to solve:     "If you solve this, then you are a genius. Mr.Smith has 4   daughters🙍‍♀🙍‍♀🙍‍♀🙍‍♀ and each daughter had a brother.  How many   children does Mr. Smith have now?"   He said the answer is not 5, but 4 only as in the riddle it is mentioned as each daughter had a brother. So their only brother is dead.     Is he right? I have a 3TB Seagate Backup Plus Desktop USB 3.0 drive, which works fine when in its enclosure, but when I get it off its enclosure and directly plug it as an internal SATA drive, it's just not properly recognized (it works again when used in the enclosure). My systems’s motherboard is an , which has two SATA 6.0 Gb/s and four SATA 3.0 Gb/s ports.  When used as an internal SATA drive Windows 7 asks if I want to format the drive, as if it didn’t have a proper filesystem, and if I use the DISKMGMT.MSC tool (typing that in the start menu) I get completely wrong information about the drive.  It says the drive has 3 partitions (349,31GB of RAW data and two unassigned partitions of 1698,68GB and 746,52GB). This information is plain wrong, since the drive, when used in the USB enclosure, works as a single NTFS partition (2794,52GB). How come it’s shown as 3 partitions without filesystem when connected through SATA?!  Is Seagate using some proprietary way of storing the data when using the drive in its provided USB 3.0 enclosure? I didn’t use any kind of encryption. I just plugged the drive with USB 3.0 and started using it straight away, since it apparently came pre-formatted with an NTFS filesystem. I'm always on the hunt for free stock images to use while I design, what are some good resources for images that are under a a royalty free or creative commons licence? Why didn't Harry himself drink Polyjuice Potion instead of all others in Deathly Hallows Part 1? In Harry Potter and the Deathly Hallows Part 1, it is shown that members of the Order of Phoenix come to rescue Harry from his house at Privet Drive. There, they all drink Polyjuice Potion and assume the form of Harry to confuse death eaters in identifying who is the real Harry.  An obvious, more safe, better choice would be to change Harry into someone else. Maybe a muggle, like his cousin Dudley. And then, safely take him to the Weasleys, maybe apparating. That way, death eaters won't ever find out. Isn't that correct?  Why didn't they take this path, and follow a rather complicated and risky one? Evaluating $\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx$ How old is the word "prolly"? Prolly is given this definition at :     Clipped pronunciation of probably.   I was reading an interesting article today that  from 1947 and that surprised me. Unfortunately, I wasn't able to find a listed source for the claim. So how old is prolly? How do I use the GUI to search for files in GNOME? On the command line I regularly use locate, or more often a locate x | grep y pattern to find a file I know exists but can't find!  I'd like something that did this quickly in the GUI. Can't find it if it's there.  Here's my confusion   In the applications/overview I can see Search and Indexing. This seems to be a configuration tool. But if this is a server, I can't find a client. In applications I find Nepomuk File Indexing -- I think this is a KDE thing? Ditto, no client? I've installed tracker. This is a strange mix of powerful and unreliable/limited. e.g. it doesn't find files like locate does (returns no results where locate returns 96 results), but is will unpack every tag I've added to my photos! And you can't limit by folder for a quick search within a folder. The old Gnome 2 Search for files... thing is not in the Accessories menu anymore.   I feel that this is basic/core-level functionality and I can't help feeling I'm missing something obvious. How do the review limits work? I got the brand new Custodian badge today for reviewing posts. Inspired by that, I reviewed some more suggested edits. Now I ran into a limit:     You have no more suggested edit votes today; come back in x hours.   How is that limit calculated? I made 61 reviews today which seems to be some calculated limit.  I searched for an answer on meta but found nothing helpful. What does the '=>' syntax in C# mean? I just came over this syntax in some of the questions in this forum, but Google and any other searchengine tends to block out anything but letters and number in the search so it is impossible to search out "=>".  So can anyone tell me what it is and how it is used? Does 'fight' involve combat?