So, in my app, I am retrieving JSON data and parsing it. RIght now, it is displaying every record on a textView like this  Name: Eric Email: Eric.com  Name: Greg Email: Greg@Greg.com  .................. etc  Code:    //parse json data  try {    String s = "";    JSONArray jArray = new JSONArray(result);     for(int i=0; i&lt;jArray.length();i++){        JSONObject json = jArray.getJSONObject(i);         s = s +                 "Name : "+json.getString("Name")+"\n"+                "Email : "+json.getString("Email")+"\n\n";    }     resultView.setText(s);   I want to be able to search and display only a single record, e.g. Eric's record. How could I do this? I tried this adding if (json.getString("Name") == "Eric") { } like this:  //parse json data  try {    String s = "";    JSONArray jArray = new JSONArray(result);     for(int i=0; i&lt;jArray.length();i++){        JSONObject json = jArray.getJSONObject(i);            if (json.getString("Name") == "Eric) { //added if statement        s = s +                 "Name : "+json.getString("Name")+"\n"+                "Email : "+json.getString("Email")+"\n\n";                }    }     resultView.setText(s);   but it doesn't display anything, then. Any ideas on how I can search for a single person's record in JSON? Thanks!
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?
Is there anyway to remove denied permissions from a group for a folder if I dont have access? Show $GCD(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$ Given $a_1, a_2, a_3, \ldots , a_n$ not all zero, show $\gcd(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$. Also deduce $a_1x_1+a_2x_2+ \ldots +a_nx_n = b$ has solutions $\iff \gcd(a_1, a_2, a_3, \ldots , a_n)|b$.   I know that $ax+by=n$ has integer solutions $\iff \gcd(a,b)|n$. I'll need to use induction to show $a_1x_1+a_2x_2+ \ldots +a_nx_n = \gcd(a_1, a_2, a_3, \ldots , a_n)$ has solutions, and then I will be able to say that as $\gcd(a_1, a_2, a_3, \ldots , a_n) | a_1x_1+a_2x_2+ \ldots +a_nx_n $ for any $x_1,x_2, x_3 \ldots x_n$ then $c \leq \gcd(a_1, a_2, a_3, \ldots , a_n)$ and $c \geq \gcd(a_1, a_2, a_3, \ldots , a_n)$, and thus $c=\gcd(a_1, a_2, a_3, \ldots , a_n)$. The  asks about functions $f \colon \mathbb R \to \mathbb R$ such that $$f(x+y)=f(x)+f(y).$$ It is a very well-known functional equation, which appears in various areas of mathematics ranging from exercises in freshman classes to constructing useful counterexamples for some advanced questions. Solutions of this equation are often called . Also a few other equations related to this equation are often studied. (Equations which can be easily transformed to Cauchy functional equation or can be solved by using similar methods.) Is there some overview of basic facts about Cauchy equation and related functional equations - preferably available online? Types of photon qubit encoding How many types of qubit encoding on photons exist nowadays? I know only two:   Encoding on polarization: $$ \lvert \Psi \rangle = \alpha \lvert H \rangle + \beta \lvert V \rangle $$ $$ \lvert H \rangle = \int_{-\infty}^{\infty} d\mathbf{k}\ f(\mathbf{k}) e^{-iw_k t} \hat{a}^\dagger_{H}(\mathbf{k}) \lvert 0 \rangle_\text{Vacuum} $$ $$ \lvert V \rangle = \int_{-\infty}^{\infty} d\mathbf{k}\ f(\mathbf{k}) e^{-iw_k t} \hat{a}^\dagger_{V}(\mathbf{k}) \lvert 0 \rangle_\text{Vacuum} $$ Time-bin: $$ \lvert \Psi \rangle = \alpha \lvert 0 \rangle + \beta \lvert 1 \rangle $$ $$ \lvert 0 \rangle = \int_{-\infty}^{\infty} dz\ f\left(\frac{t -z/c}{\delta t_{ph}}\right) e^{-i w_0 (t-z/c)} \hat{a}^\dagger(z) \lvert 0 \rangle_\text{Vacuum} $$ $$ \lvert 1 \rangle = \int_{-\infty}^{\infty} dz\ f\left(\frac{t -z/c+\tau}{\delta t_{ph}}\right) e^{-i w_0 (t-z/c+\tau)} \hat{a}^\dagger(z) \lvert 0 \rangle_\text{Vacuum} $$   Is there anything else? Proof for SSS Congruence? I am interested in good integer approximation from below and from above for binary Log(N!).  and  provides only a general idea but not exact values. In other words I need integers A and B so that  A &lt;= Log(N!) &lt;= B I want to apply a macro to all the cells of a column with the cell content as the input to the macro. Is this possible?  For example if the cell contents have the word TEST, the macro should take TEST as its argument. The origin of spin is some what a puzzle to me, everything spin from galaxies to planets to weather to electrons.  Where has all the angular momentum come from? Why is it so natural?  I was also thinking do photons spin? we always think of the wave as a standard 2d sin wave but could this rotate in 3d? What implications would this have?   And what about spacetime how does all the spinning effect?  This has always been avoided in all lectures and classes I ever went to. Can we clarify to the OP that their question is not yet closed and the duplicates are only suggestions? Algebraic Proof that $\sum\limits_{i=0}^n \binom{n}{i}=2^n$ How do I create my own URL protocol? (e.g. so://...) I have seen:   http://www... ftp://blah.blah... file://blah.blah... unreal://blah.blah... mailto://blah.blah...   What is that first section where you see http and the like called?  Can I register my own? How to horizontally center an element How can I horizontally center a &lt;div&gt; within another &lt;div&gt; using CSS? &lt;div id=&quot;outer&quot;&gt;   &lt;div id=&quot;inner&quot;&gt;Foo foo&lt;/div&gt; &lt;/div&gt; How does passive perception work Total noob question, but the passive perception is confusing. I don't understand how to calculate it or use it, and I need help. Should I use a categorical cross-entropy or binary cross-entropy loss for binary predictions? First of all, I realized if I need to perform binary predictions, I have to create at least two classes through performing a one-hot-encoding. Is this correct? However, is binary cross-entropy only for predictions with only one class? If I were to use a categorical cross-entropy loss, which is typically found in most libraries (like TensorFlow), would there be a significant difference?  In fact, what are the exact differences between a categorical and binary cross-entropy? I have never seen an implementation of binary cross-entropy in TensorFlow, so I thought perhaps the categorical one works just as fine. In the proof of the lemma     For every limit ordinal $\alpha$, $\textrm{cf } \alpha$ is a regular cardinal    Jech says that     It is easy to see that if $\alpha$ is not a cardinal, then using a mapping of $|\alpha|$ onto $\alpha$ one can construct a cofinal sequence in $\alpha$ of length $\leq |\alpha|$, and therefore $\textrm{cf } \alpha &lt; \alpha$.    I've spent a while trying to construct this cofinal sequence and was wondering if I was on the right path:   From a bijection $f$ between $\kappa = |\alpha|$ and $\alpha$ take $S = \{\beta \in \kappa : \ f(\gamma) &lt; f(\beta)$ for all $\gamma &lt; \beta\}$ then if $\xi$ is the order type of $S$ and $g$ is the isomorphism from $\xi$ to $S$ the function $f\circ g$ is a cofinal sequence in $\alpha$ and $\xi &lt; \alpha$.   Is this on the right track, or is there an easier way of doing it? Calculate all integer solutions $(x,y,z)\in\mathbb{Z}^3$ of the equation $x^2+y^2+z^2 = 2xyz$.   My Attempt:  We will calculate for $x,y,z&gt;0$. Then, using the AM-GM Inequality, we have  $$ \begin{cases} x^2+y^2\geq 2xy\\ y^2+z^2\geq 2yz\\ z^2+x^2\geq 2zx\\ \end{cases} $$  So $x^2+y^2+z^2\geq xy+yz+zx$. How can I solve for $(x,y,z)$ after this? Create directory if it does not exist Why is the application of probability in  (QM) fundamentally different from its application in other areas? QM applies probability according to the same  as in other areas of physics, engineering, etc.  Why is there a difference?  Naively one would assume one of these possibilities:   It is not the same probability (theory?) It is a matter of interpretation (of the formalism?) Something else?   Many answers (which I am still studying) focus on the fact that the combined probability of two mutually-exclusive events in QM is not equal to the sum of the probabilities of each event (which holds classically by definition). This fact (appears to) makes the formulation of another probability (a quantum one) a necessity.   Yet this again breaks down to assumed independent, if this is not so, the "classic probability" is applicable (as indeed in other areas). This is one of the main points of the question. how to show textview and edittextview on same line? What are these tags related to on the Newest Questions page? On the right, there is a widget that lists "Related Tags" (left − SO April 2013, right − MSE May 2014):         What are they related to? There isn't even a question selected. Are they related to the whole displayed list?  This can be seen on every SE site.