If I set the text of a TextView in XML, like this:      &lt;TextView         ...         android:text="0" /&gt;   Can I compare that string in Java? Doing this:      private void InitializeMethod() {         A_1  = tv_1.getText().toString();     }      private void CheckAnsMethod() {         if (A_1 == "0"){             correctAns.start();             }         }else{             wrongAns.start();         }     }   causes the sound 'wrongAns.mp3' to be played...
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?
"Try Ubuntu" option is not dislayed I created a live USB using Unetbootin (distribution: ubuntu 12.04 ) from the alternate installation ISO, but while booting "try ubuntu" option is not displayed in Unetbootin menu. Is there any way to try this ubuntu distribution without installing ? How does the subject-verb agreement work when a singular noun describes a plural one? Of the following, which sentence is righter?  The computers is a good choice. The computers are a good choice.  Is there a rule about these types of formations? Please explain. How to set up RAID 1? I've grown quite fond of HTTP reverse proxies in our development environment and found the DNS based virtual host reverse proxy quite useful. Having only one port (and the standard one) open on the firewall makes it much easier for management.  I'd like to find something similar to do SSH connections but haven't had much luck. I'd prefer not to simply use SSH tunneling since that requires opening port ranges other than the standard. Is there anything out there that can do this?  Could HAProxy do this? In a case of mine a very high (compared to the video stream) resolution graphical frame (saying "access denied" (when my IP changes)) can appear instead of a video stream, which makes VLC window to resize, getting bigger than my screen is. This annoys me. Can I set up VLC to never resize its window when I don't do it myself and resize content instead? The equivalent electric field of a magnetic field Chmod to allow read and write permissions for directory I have created directories in root. I am looking for the chmod command to allow all users read and write permissions to a specific directory. I have done chmod 775 for a file but I need this for a directory. This includes permissions on all files and sub directories. How to multiply a BigDecimal by an integer in Java Why do ssh operations always ask for passphrase? (with ed25519) I just updated my ssh key and added a passphrase, however it constantly nags me for it now, such as when I do a git (or mercurial hg) push.  ssh-agent is running:  xxx  1303  1118  0 09:16 ?  00:00:00 /usr/bin/ssh-agent    /usr/bin/dbus-launch --exit-with-session     /usr/bin/im-launch mate-session   I tried ssh-add:  &gt; ssh-add Identity added: /home/…/.ssh/id_rsa (/home/…/.ssh/id_rsa) Enter passphrase for /home/…/.ssh/id_ed25519:  Could not add identity "/home/…/.ssh/id_ed25519":      communication with agent failed   What is missing?  16.04 Ubuntu Mate, in case it matters. Sed - unknown option to `s' After mis-reading this question:  I found myself wondering if there are other non-weapon items such as tools that utilize lightsaber technology.  Example: the lightsaber bread knife Possible Duplicate:             I faced this issue today when I was replying to a comment posted which used @Transaction annotation.     @Trevor: @Transaction and ... @Transaction   When typing this comment, I got a warning. How do I capture artificial light sources better? I am quite new to photography and was looking into how I can take better indoor photographs, particularly around night time.  I'm currently in a hotel room for the night and decided to try and take a picture of my room to test out my tripod which I haven't used before. However I noticed no matter what I set my camera settings to the artificial lights (particularly the lamp on the left, image attached) just appeared very washed out. You can't tell any detail about the lamp shade all you can see is just some sort of light but not much to it.  I tried a variety of fstop/shutter speed settings and tried a variety of ISO settings but they all appeared pretty much the same unless I massively underexposed the image.  Given that I wondered whether the solution would be to take a HDR image or take a normal exposure and an underexposed image and blend them later? I understand that artificial light like this can be very hard and harsh but I wondered if there's a way of improving the result with looking away from it?  I wasn't trying to take any particular special picture here but just test out my camera a bit more but this was the first thing I noticed and I didn't know how to fix it. Any tips would be greatly appreciated. I have 2 columns in Excel: the first contains a list of employee names who perform function A, and the second contains a list of employee names who perform function B.  What I want is to identify, in one cell, if there is one employee whose name appears in both the first and second columns. It does not have to show which name(s) appears in both columns, it just needs to identify IF there are any names that appear in both columns. Creating a textarea with auto-resize There was , which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clientHeight value comes back as the full size of the textarea, not its contents.  The code from that page is below:  function FitToContent(id, maxHeight) {    var text = id &amp;&amp; id.style ? id : document.getElementById(id);    if ( !text )       return;     var adjustedHeight = text.clientHeight;    if ( !maxHeight || maxHeight &gt; adjustedHeight )    {       adjustedHeight = Math.max(text.scrollHeight, adjustedHeight);       if ( maxHeight )          adjustedHeight = Math.min(maxHeight, adjustedHeight);       if ( adjustedHeight &gt; text.clientHeight )          text.style.height = adjustedHeight + "px";    } }  window.onload = function() {     document.getElementById("ta").onkeyup = function() {       FitToContent( this, 500 )     }; } Why don't C++ compilers define operator== and operator!=? Constructing the reciprocal of a segment How can one construct the reciprocal length of a line segment? For example, given any line segment a, how can $\frac{1}{a}$ be constructed?  I was told that it can be solved by creating similar triangles, but I do not get it. How Do I Allow A Standard User to Install Programs? Yes, I realize that defeats the purpose of standard user. But here is the situation. A friend of mine wants to set up time limits for his home schooled son, and his son needs to be a standard user in order to use Family Safety. But at the same time, his son (who I personally think is way too old to have time limits), needs to be able to update and install some of his games on his computer. So I guess it's just sort of "light" parental control (just something to help him focus and not get distracted with hours of gaming).  It is the basic version of Windows 8.1, so there is no Group Policy editor (gpedit.msc). However, I'm fairly good with computers and I figured out how to install it. But it doesn't have a lot of the features that the "real" gpedit seems to have. Here is an example of what is in my gpedit: Find $ P(Z>X+Y)$ where $X,Y,Z \sim U(0,1)$ independently I'm trying to follow a line in a derivation for $P(Z&gt;X+Y)$ where $X,Y,Z$ are independent continuous random variables distributed uniformly on $(0,1)$.  I've already derived the pdf of $X+Y$ using the convolution theorem, but there's a line in the answer that says:  $P(Z&gt;X+Y) = \mathbb{E}[\ P(Z&gt;X+Y\ |\  X+Y )\  ]$ where $\mathbb{E}$ is the expectation.  I'm not familiar with this result. Could anyone give a pointer to a similar result if one exists?  Thanks. Why does a 95% Confidence Interval (CI) not imply a 95% chance of containing the mean? It seems that through various related questions here, there is consensus that the "95%" part of what we call a "95% confidence interval" refers to the fact that if we were to exactly replicate our sampling and CI-computation procedures  many times, 95% of thusly computed CIs would contain the population mean. It also seems to be the consensus that this definition does not permit one to conclude from a single 95%CI that there is a 95% chance that the mean falls somewhere within the CI. However, I don't understand how the former doesn't imply the latter insofar as, having imagined many CIs 95% of which contain the population mean, shouldn't our uncertainty (with regards to whether our actually-computed CI contains the population mean or not) force us to use the base-rate of the imagined cases (95%) as our estimate of the probability that our actual case contains the CI?   I've seen posts argue along the lines of "the actually-computed CI either contains the population mean or it doesn't, so its probability is either 1 or 0", but this seems to imply a strange definition of probability that is dependent on unknown states (i.e. a friend flips fair coin, hides the result, and I am disallowed from saying there is a 50% chance that it's heads).  Surely I'm wrong, but I don't see where my logic has gone awry...