My method keeps returning 0. Can someone help me find why the GPA will not properly compute?  public static double getGPA(String a) {     double value = 0;     double sum = 0;     for(int i = 0; i&lt;a.length(); i++)     {         String grade = a.substring(i,i+1);         if(grade == "A") value = 4;         if(grade == "B") value = 3;         if(grade == "C") value = 2;         if(grade == "D") value = 1;         if(grade == "F") value = 0;         sum += value;     }     return sum/(a.length()+1); }
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?
What are these  error below ?  Package natbib Warning: Citation `Krishna2014' on page 16 undefined on input li ne 502.  [16 &lt;./figure/aks smr.png&gt;] [17] [18] ! Undefined control sequence. l.560 \Bibliography                    {figure/bib} Is there a way to spellcheck the word under the cursor with a keyboard shortcut? Since Ubuntu 11.10 use a new kernel, it's very difficult to have a decent support for virtualization.   VirtualBox doesn't support guest additions for ubuntu 11.10, so I can't copy to and from my ubuntu desktop and windows, which I absolutely require, plus FreeBSD seems not to be able to use DHCP without guest additions.  Virt-manager instead gives an error on launch:  Unable to open a connection to the libvirt management daemon.  Libvirt URI is: qemu:///system  Verify that:  - The 'libvirt-bin' package is installed  - The 'libvirtd' daemon has been started  - You are member of the 'libvirtd' group   unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: Permission denied  Traceback (most recent call last):   File "/usr/share/virt-manager/virtManager/connection.py", line 1146, in _open_thread     self.vmm = self._try_open()   File "/usr/share/virt-manager/virtManager/connection.py", line 1130, in _try_open     flags)   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 102, in openAuth     if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirtError: unable to connect to '/var/run/libvirt/libvirt-sock', libvirtd may need to be started: Permission denied   The problem is solved by running virt-manager as root, but I don't like that. How do I change permissions to run Virt-Manager as user?  Is there a way to install guest additions on Ubuntu 11.10? I want to uninstall and completely remove QGIS installation from my computer(windows vista). I have uninstalled it and when i try to reinstall it says it is already installed on the system. Can you use a Pensieve-memory to explore a place? how much space does a given package, and dependencies, cost? Difference between decimal, float and double in .NET? What is the difference between decimal, float and double in .NET?  When would someone use one of these? Different results with Plot option "Evaluated" in V9 and V10 Why is the ROC curve two-dimensional instead of three-dimensional? I'm studying orientability of manifolds currently and I'm having trouble to prove the following: $M\times N$ is orientable iff $M$ and $N$ are orientable.   I am able to prove that the product is orientable if components are orientable (chart is $\{(U_\alpha\times V_{\beta},\phi_\alpha\times \psi_\beta):(\alpha,\beta)\in A\times B \}$, and $\det J=\det J_1 \det J_2&gt;0$ by Cauchy-Binet's theorem), but I don't know how to prove the other direction.   So why this holds: if $M\times N$ is orientable, then $M$ and $N$ are orientable?  Thanks in advance. How can I count unique selections from multiple selections in a drop down list (Excel) I would like to count the number of unique selections from a column that contains multiple selections from a drop down list.  For example, column B3 contains,     Monday, Tuesday, Wednesday   The count function returns a value of 1 instead of 3 - is there any way to count the three days distinctly? Thank you!  Multiple selections from a drop down list was made possible using the VBA code from: Cooking away alcohol When you cook with wine or spirits, when does the alcohol cook away? Obviously high temperatures will do it, but how low of temperatures will work? Also, does it vary by the type of alcohol? I clicked on  to a comment in my email and it prompted a list of apps to open link. All browsers (Chrome, Firefox and etc) are in the list, but not SE app.  Most apps that can open site specific links get prompted for that app to open  the link, but not Stack Exchange links for some reason.    App Version: 1.0.95 Device Manufacturer: Asus Device Model: ASUS_Z010D   OS Version: 6.0.1 (WW_Phone-13.8.26.76-20161230) How to (properly) remove the parentheses around the year in authoryear style? (v3) I have a question that has been answered a few times, but does not work for me (and also not for another commenter in a previously asked question).   I want to remove the parenthesis around the yead in the bibliography with biblatex style authoryear, and ideally also add a comma and space before it. I have looked at the following questions:        I use biber 2.10 and TexLive 2017/W32Tex.  This MWE should work according to the question v2 above, but does not work for me, i.e. the output is still Author, Anne (2001a). Alpha. The output I need is Author, Anne, 2001a. Alpha.  \documentclass{article}  \usepackage[style=authoryear,dashed=false]{biblatex} \usepackage{xpatch,filecontents}  \begin{filecontents}{\jobname.bib} @misc{A01,author={Author, Anne},year={2001},title={Alpha}} @misc{A02,author={Author, Anne},year={2001},title={Beta}} \end{filecontents} \addbibresource{\jobname.bib}  \xpatchbibmacro{date+extrayear}{%   \printtext[parens]% }{%   \setunit*{\addperiod\space}%   \printtext% }{}{}   \begin{document} \nocite{*} \printbibliography \end{document} After one of the latest updates (not sure if it was the last one or a previous one) of the Google Play app, I am having an error trying to update a large app (42MB). It says:     Error Downloading . There is insufficient space on the device.   My device is a Samsung P1000 running Froyo. It's rooted, but the error was there before rooting it.  A quick Google search showed several Samsung users having the same problem (the app in question that was giving me the headache is Smurf's village). Some said that removing the updates to the Android Market (Google Play) app would fix it, but to me it was of no avail.  I also tried the procedure in  to no avail.  Now I am stuck with a prehistoric version of the Market (that works on small apps) and still cannot update Smurf's Village or install big apps. How can I fix this?  EDIT: device has over 2GB of internal SD storage, 27GB of external SD card, so space is not an issue. "There is no point in" or "There is not a point in" I was thinking about these negations. Do these mean the same thing?     There is no point in ...   There is not a point in ...   or:     I have no clue   I do not have any clue     etc. How can I show that $n^2&lt;n!$ for all $n\geq 4$ Step 1 For $n=1$, the LHS=$4^2=16$ and RHS=$4!=24$. So LHS$&lt;$ RHS. Step 2 Suppose the result be true for $n=k$  i.e., $k^2&lt;k!$ Step 3 For $n=k+1$ $(k+1)^2=k^2+2k+1$ What will be the next step? Why are there greyed / dimmed / faded questions now? I just refreshed the [iphone]-tag-site, and I'm seeing all kinds of questions with what appears to be a grey overlay (see image). What is this for/why am I seeing this? I have never seen anything like this before.. How to interpret regression coefficients when response was transformed by the 4th root? I'm using fourth root (1/4) power transformation on my response variable, as a result of heteroscedasticity. But now I'm not sure how to interpret my regression coefficients.   I assume that I would need to take the coefficients to the fourth power when I back-transform (see below regression output). All of the variables are in units of dollar in millions, but I would like to know the change in dollar in billions.    While holding the other independent variable constant, a billion dollar change in fees, on average, leads to a change of 32 (or 32,000 dollars) in collections. I take 0.000075223 * 1000 (to get to billions) ^ 4 = 0.000032. Now do I multiply this number by 1 million or 1 billion (the original unit of the dependent variable is in millions)?  lm(formula = (Collections^(1/4)) ~ Fees + DIR)                   Estimate      Std. Error  t value            Pr(&gt;|t|) (Intercept)   2.094573355     0.112292375   18.653  0.0000000000000151 Fees        **0.000075223   **0.000008411    8.943  0.0000000131878713 DIR           0.000022279     0.000004107    5.425  0.0000221138881913 Is it possible to edit the Audit fields on UPDATE?