sorry for this silly question but I am going insane, it's a simple if statement inside OnChildEventListener to exclude the current user results from my gridView as Firebase doesn't apparently have notEqualTo() method. However, the if statment doesn't seem to give me correct result when it should be true. Please see below :    String name = "eee";   //setting a username just a test for here  databaseRef.addChildEventListener(new ChildEventListener() {         @Override         public void onChildAdded(DataSnapshot dataSnapshot, String s) {             if (String.valueOf(dataSnapshot.child("username").getValue()) == name) {                  GridItem item = dataSnapshot.getValue(GridItem.class);                 mGridData.add(item);                 mGridAdapter.setGridData(mGridData);              }         }   I log the String value of what I have inside my if statment and it logs out as eee , now why doesn't this if statement result in true? I would appreciate if someone tells me what I am missing? if I simply do if(true) or any other string inside, it works!   Appreciate the help.
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?
I'm trying to create an item that can break certain blocks, but also has a colored name in 1.13.2   Here's the command I'm using.  /give iAugust minecraft:shears{display:{Name:"[{\"text\":\"Arcane Shears\",\"color\":\"aqua\",\"italic\":false,\"bold\":false}]CanDestroy:[minecraft:iron_bars]"}}   But it only has a colored name, and it can't break specific blocks. When should I use a fixed or variable time step? Is Autopilot Openstack 16.04 available? Value of momentum of a particle in 1D box prepared in a particular state? What is the value of momentum of particle in 1D box in state $\sin(10\pi x/a)$? My understanding Standing waves representing particle in 1D box is not an momentum eigenstate so if we measure the momentum of particle in this state we may get any value of momentum which gives a distribution whose expectation value tends to zero. Answer key In the answer key it's given that the value of momentum is 5h/a and -5h/a.If we measure the momentum for this state we may get any of these two values.But is this a wrong reasoning because if these was the case,these should mean that 5h/a and -5h/a are the eigenvalue of the following wavefunction which is clearly not. What is the correct answer? I just updated my Moto X to latest and greatest Android 4.4 KitKat (I even did full factory reset just to be sure) and now I'm trying to install  but unable to do so, I'm getting following error:     Unknown error code during application install "-24"   Please advise. Converting string of 1s and 0s into binary value I'm trying to convert an incoming sting of 1s and 0s from stdin into their respective binary values (where a string such as "11110111" would be converted to 0xF7). This seems pretty trivial but I don't want to reinvent the wheel so I'm wondering if there's anything in the C/C++ standard libs that can already perform such an operation? This dreaded issue started at some time after upgrade to OS X (Yosemite) 10.10.3. accountsd uses about 60% CPU constantly, making the laptop hot and noisy.  I'm not using iCloud at all.  Killing it doesn't help, because it starts again quickly.  Probably related question, but it's about iOS: Is there a way to substring a string in Python, to get a new string from the third character to the end of the string?  Maybe like myString[2:end]?  If leaving the second part means 'till the end', and if you leave the first part, does it start from the start? Speak Slower or Speak Slowlier? AFAIK the correct grammar for "speak slow" is "speak slowly" (slowly being an adverb). Please correct me if I am mistaken.  But in daily life I have not heard anyone saying "Speak slowlier".  I think I heard folks saying "Speak slower" but I also think it is incorrect.  Which is the best or correct form to convey the message?  Could that be the longish "Speak more slowly?" My interest in combinatorics was recently sparked when I read about the many things that the Catalan numbers count, as found by Richard Stanley. I picked up a copy of Brualdi's Combinatorics, and while browsing the section on counting sequences I found a nice little puzzle that has definitely puzzled me.     Let $m$ and $n$ be nonnegative integers with $n\geq m$. There are $m+n$ people in line to get into a theater for which admission if $50$ cents. Of the $m+n$ people, $n$ have a $50$-cent piece and $m$ have a $\$ 1$ dollar bill. The box offices opens with an empty cash register. Show that the number of ways the people can line up so that change is available when needed is   $$ \frac{n-m+1}{n+1}\binom{m+n}{m}. $$     I first noted that the first person to enter must be one of the $n$ with a half-dollar. Now the register has a half-dollar change. The second person can be either a person with a half-dollar or a dollar. In the first case, the register will now have two half-dollars, in the second case, the register will now have one dollar bill. So it seems to me that when one of the $n$ people with a half-dollar enters, the number of half-dollars in the register increases by $1$, and when one of the $m$ people with a bill enters, the number of half-dollars decreases by $1$ but the number of bills increases by $1$.   I tried to model this by looking at paths in $\mathbb{Z}^2$. The $x$-axis is like the number of half-dollars, and the $y$-axis is the number of bills. You start at $(0,0)$, and you can take steps forward $(1,0)$ or backwards diagonally $(-1,1)$ corresponding to who enters, but you must always stay in the first quadrant of the plane without crossing over the axes. The goal is to make $m+n$ moves, and I figured maybe the number of such paths is counted by $\frac{n-m+1}{n+1}\binom{m+n}{m}$, but I'm not sure how to show this. I don't know if this observation simplifies the problem at all, as I don't know how to finish up. I'd be happy to see how this problem is done, thank you. StandardSetController with History records Verbatim Environment in Figure Caption Can you transfer a Windows 7 XP-mode VHD to a new PC without the need for reactivation? Duplicates in sendable DE for MobileConnect My son is 5 years old.   Over the last few months I have been observing some disturbing sexual behavior from my child.  He is rubbing his penis on  the bed or pillow. Sometimes he would get naked and rub very tightly and make some sounds of pleasure! Previously, I thought he was playing... but later I understood.   His father doesn't want me to scold him, but one day I was really surprised and shocked by one incident... when I was in deep sleep in the afternoon, I suddenly woke up and saw he had pulled up my skirt and trying to mount me! I was really shocked!  I'm really upset.  What should I do? How to Truncate a string in PHP to the word closest to a certain number of characters? I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage.  The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters.  I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last word before 200 chars. Convergence of $\sqrt{n}x_{n}$ where $x_{n+1} = \sin(x_{n})$ Why do different humans look different? Although farmers appear to be able to tell their cows apart, cows look very much alike to me. And this similarity in appearance seems to be a general trait across the animal kingdom: one individual of one animal species looks much like another.  Why do human facial and body shapes vary so much?  I understand that human beings live in many different environments (e.g. hot and cold) and have adapted to these (e.g. through lighter or darker skin color), but there seems to be much variation that has no apparent evolutionary purpose. So does the difference have a purpose in itself? That is, did we evlove to vary in appearance, and what is the purpose of this variation? Guaranteed lifetime of temporary in C++? Does C++ provide a guarantee for the lifetime of a temporary variable that is created within a function call but not used as a parameter?  Here's an example class:  class StringBuffer { public:     StringBuffer(std::string &amp; str) : m_str(str)     {         m_buffer.push_back(0);     }     ~StringBuffer()     {         m_str = &amp;m_buffer[0];     }     char * Size(int maxlength)     {         m_buffer.resize(maxlength + 1, 0);         return &amp;m_buffer[0];     } private:     std::string &amp; m_str;     std::vector&lt;char&gt; m_buffer; };   And here's how you would use it:  // this is from a crusty old API that can't be changed void GetString(char * str, int maxlength);  std::string mystring; GetString(StringBuffer(mystring).Size(MAXLEN), MAXLEN);   When will the destructor for the temporary StringBuffer object get called?  Is it:   Before the call to GetString? After GetString returns? Compiler dependent?   I know that C++ guarantees that a local temporary variable will be valid as long as there's a reference to it - does this apply to parent objects when there's a reference to a member variable?  Thanks. How to reset Canon 70D WiFi?