After being marked as duplicate:  Ok I see that now this is a duplicate, and I apologize for a seemingly silly question. It's just from my perspective it was difficult to realise what to "search" online to solve this problem because I didn't know using == with strings in this manner was a problem to begin with! Even so, I'm still wondering why is using the test array still work in the for loop at the bottom of the code despite it checking with == and not .equals() but it doesn't work for the array created with stored Scanner input? It's because one of these methods still worked in finding p with == and not .equals() that made me think it was the method of storing the array that caused the problem and look in the wrong places for answers.  Problem:  I'm trying to make a simple AI for a problem I'm working on in Java, and part of it requires storing user input with the Java Scanner library in order to make an array of strings that represents a game board or "grid". I decided to store the input of this array "grid" one by one, asking the user to enter element for the current array position. The array is a 2-dimensional array and the input is stored one by one via two for loops one nested in the other as you can see near the start of the code I have provided below. I made a method called displayGrid that prints out the contents of 2-dimensional array in the form of a grid and it seems to take in the input correctly and the board displays correctly.  However when I try to search this "grid" after storing it with input (by using for loops as you can see near the end of the code snippet) the if statement there can't seem to verify as true even when I have stored the letter "p" in the first part of running the program when the Scanner is storing input into the array, and the displayGrid method actually prints out the array correctly showing there is in fact a "p" in the array. In any case, this part of the code is supposed to check if there is a "p" in the array and if there is return it's column position which I tried doing but it always returns 0 since it cannot verify that if statement as true.   The strangest thing though is that if I make a test array that is composed of strings as you can see at the very start of the code, and try the loop at the bottom of the code on this test array it does find "p" and print it's column value.   So are there any ideas why the loops at the bottom cannot find the "p" value of an array created from the scanner inputs near the start of the code - even when my displayGrid method shows that this array does contain a "p"? Thanks in advance!  Note: I haven't included rest of the code because it was largely irrelevant, but I can post it if it's really needed.   public static void main(String[] args) {     // tests     String[][] test = {{"-", "p", "-"},{"-", "-", "-"},{"-", "-", "-"}};      // running main program     Scanner in = new Scanner(System.in);      int n = 0, boardSize;     boardSize = n*n;     do {         System.out.print("Enter n dimension of your game grid (for an nxn sized board): ");         n = in.nextInt();     } while(n &lt; 3 || n &gt; 100 || n % 2 == 0);      String grid[][] = new String[n][n];      System.out.println("Please enter the contents of your array now.");      for (int row = 0; row &lt; n; row++) {         for (int col = 0; col &lt; n; col++) {             System.out.print("Enter element at grid location: [" + row + "] [" + col + "]: ");             String temp;             temp = in.next();             grid[row][col] = temp;         }     }      // display grid for testing     displayGrid(grid, n);      // test     for(int row=0; row&lt;grid.length; row++) {          for(int col=0; col&lt;grid.length; col++) {              if (grid[row][col] == "p") {                 System.out.println(col);             }         }     }
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?
Let $A=\begin{pmatrix}0&amp;5\\ 7&amp;4\end{pmatrix}$.      1) Write $A$ as a product of $4$ elementary matrices.      2) Write $A^{-1}$ as a product of $4$ elementary matrices.   My work. I have managed to find $A^{-1}$, which came out to be this:  \begin{pmatrix}-\frac{4}{35}&amp;\frac{1}{7}\\ \frac{1}{5}&amp;0\end{pmatrix}  However, I am struggling to figure out how I would split each of these matrices into $4$ elementary matrices. Any help? This question is from PDE by Evans, 1st edition, Chapter 5, Problem 14. It has been posted  previously, however, I cannot quite put all the information together from the responses there. Hopefully you can help me now. The problem is as follows:     Let $U$ be bounded with a $C^1$ boundary. Show that a ''typical''   function $u \in L^p(U) \ (1 \leq p &lt; \infty)$ does not have a trace on   $\partial U$. More precisely, prove there does not exist a bounded   linear operator      \begin{equation} T:L^p(U) \to L^p(\partial U) \end{equation}      such that $Tu = \left. u \right|_{\partial U}$ whenever $u \in C(\overline{U}) \cap L^p(U)$.   So what we're trying to find is a bounded sequence of functions that go to infinity at the boundary, correct? Because then $Tu = \left. u \right|_{\partial U}$ is undefined.  I like the idea of using the $\mathrm{dist}(x, \partial U)$ function to do this. I was thinking about defining the function  \begin{equation} u(x) = \frac{1}{\mathrm{dist}(x,\partial U)}, \end{equation}  which must be in $L^p(U)$ since $U$ is bounded (hence integral of $\varepsilon$ over $U$ is finite, right?). But this function is not continuous at the boundary, and so $u \notin C(\overline{U})$. Can this be modified somehow?  Another option is to use that the boundary is $C^1$. So for each $x^0 \in \partial U$ there exists an $r &gt; 0$ and a $C^1$ function $\gamma : \mathbb{R}^{n-1} \to \mathbb{R}$ such that $U \cap B(x^0,r) = \{ x \in B(x^0,r) \ | \ x_n &gt; \gamma(x_1,\ldots, x_n) \}$. So around every point on the boundary we can find a ball where the n'th coordinate is greater than the $C^1$ function $\gamma$. How can we use this? I am moving from Egypt to the Netherlands and I need to take my PC with me. I won't be taking the monitor, just the case, but I'm wondering what the best way would be.  Am considering taking it as carry-on because I'm allowed 8kg and at least then I can handle it myself. Has anyone done this before and can give me tips or warn me that this doesn't work? Would putting it in my normal suitcase as checked baggage be a better idea? This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating? How can I check if my (unlocked) phone will work with a particular country's SIM cards, for 3G and calls? I've used my phone overseas with local SIM cards a lot, but recently had a surprising experience where one local SIM card simply wouldn't work with my phone but did work first time on my partner's, even though both were similar (unlocked Android phones) and another SIM card from a different local provider did work. Looking into it, it looks like there are various different standards around, but it all gets very technical very quickly.  Is there any simple way of looking up which SIM cards in a particular country will work with a particular model of phone, for calls, texts and internet access? If I could stop ALL motion would I stop time? I've never really understood time. Time is not a force. It isn't energy or matter. Time doesn't MAKE anything do anything. Time doesn't make a clock tick (motion or batteries do). Time doesn't make the earth revolve around the sun (motion/gravity does). I don't think time exists. People say time is used as a form of measurement but aren't we just measuring movement? Even atomic clocks measure the movement of electrons that orbit an atom's nucleus as they "jump" back and forth between energy states. So my question is if I were to stop ALL motion (even movement of electrons that orbit an atom's nucleus) would I stop time? Is time just masquerading as the measurement of motion?  EDIT: This question is not a duplicate of "Does time freeze at Absolute Zero?" Because I am NOT talking about temperature. I am speaking about the motion of ALL things. I am asking if ALL things (photons, energy, matter, forces) stop moving would time stand still? I would have to say yes it would. If ALL motion were to stop for a million years and then start again no one would even know. Atomic clocks wouldn't even miss a step. When choosing cards for a deck, one of the most important things to consider is the number of land you put in. The biggest issue is mana curve, of course. What shortcuts are best for determining the proper amount of land with a given mana curve? Is it possible to run an x86 binary on an ARM processor? I'm having trouble distinguishing between the concepts of scedasticity and stationarity. As I understand them, heteroscedasticity is differing variabilities in sub-populations and non-stationarity is a changing mean/variance over time.   If this is a correct (albeit simplistic) understanding, is non-stationarity simply a specific case of heteroscedasticity across time? Show that $\sum\limits_{n=0}^\infty \frac{z}{(1+z^2)^n}$ converges for all $z\in \mathbb{C}$ outside $|1+z^2|=1$ Show that $\sum\limits_{n=0}^\infty \frac{z}{(1+z^2)^n}$ converges for all $z\in \mathbb{C}$ outside $|1+z^2|=1$  Actually, I have the problem to understand the meaning of "outside $|1+z^2|=1$". If it means that the collection of $z\in\mathbb{C}$ such that $|1+z^2|&gt;1.$ This problem will be easy to verify since for each given $z$ with $|1+z^2|&gt;1$, then we have $|1+z^2|^{-1}&lt;1$. Then, it is the geometric series with common ratio less than $1$ which implies that the series converges.   Do I have correct interpretation with "outside $|1+z^2|=1$"? If not, what is the correct interpretation with this? Thanks. How do you associate the .exe file extension with a program in Windows? Uniform Scattering with vector Regex to match only letters How to find historical stock price for a de-listed or defunct company? I received some text that is encoded, but I don't know what charset was used. Is there a way to determine the encoding of a text file using Python?  deals with C#. Trouble with batch conversion of .png to .pdf using convert convert /home/bill/TempScan/*.png  myfile.pdf   gives error message:  convert-im6.q16: not authorized `myfile.pdf' @ error/constitute.c/WriteImage/1037.   Any help would be appreciated! Why don't Death Eaters always use Avada Kedavra? When the Death Eaters attacked Hogwarts, why did the Death Eaters not just use Avada Kedavra and kill everyone? How do I solve $$x'=e^{it}\overline{x}?$$  This is a complex differential equation, but I don't see how to solve it.  Edit: the original ODE is given by $$(x', y')=\begin{pmatrix}\cos t&amp; \sin t\\ \sin t&amp;-\cos t\end{pmatrix}(x,y)$$ I want to show that solutions of this ODE do not remain bounded for all $t$, and the idea was to solve the complex equation. How can you print a variable name in python? Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to  In [53]: namestr(choice) Out[53]: 'choice'   for use in making a dictionary. There's a good way to do this and I'm just missing it.  EDIT:  The reason to do this is thus. I am running some data analysis stuff where I call the program with multiple parameters that I would like to tweak, or not tweak, at runtime. I read in the parameters I used in the last run from a .config file formated as  filename no_sig_resonance.dat  mass_peak 700  choice 1,2,3   When prompted for values, the previously used is displayed and an empty string input will use the previously used value.  My question comes about because when it comes to writing the dictionary that these values have been scanned into. If a parameter is needed I run get_param which accesses the file and finds the parameter.   I think I will avoid the problem all together by reading the .config file once and producing a dictionary from that. I avoided that originally for... reasons I no longer remember. Perfect situation to update my code! Compute the sum of the series $\sum_{n=1}^{\infty} \frac{1}{n \cdot 2^n}$ What would be the sum of the following series?  $$\sum_{n=1}^{\infty} \frac{1}{n \cdot 2^n}$$  Thanks