public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.beta);      ed_code = (EditText) findViewById(R.id.et_beta_01);     bu_ok = (Button) findViewById(R.id.bu_beta);      bu_ok.setOnClickListener(new OnClickListener() {             @Override         public void onClick(View v) {                 // TODO Auto-generated method stub             String code = ed_code.getText().toString();             String target = "vsi8";              Log.v(TAG, code+"="+target);              if(code == target){                     Intent intent = new Intent(BetaCheck.this, AppMenu.class);                 startActivity(intent);             }             else {                     Toast.makeText(getApplicationContext(), "wrong", Toast.LENGTH_SHORT).show();                     ed_code.setText("");             }         }     }); }   It seems that the the if statement does not understand that the 2 values are equal.  Thanks for 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?
How do I prevent Apache from answering requests for domains I don't host? Google analytics: Tracking Not Installed Detect Chrome extension first run / update For example, the square can be described with the equation $|x| + |y| = 1$. So is there a general equation that can describe a regular polygon (in the 2D Cartesian plane?), given the number of sides required?  Using the Wolfram Alpha site, this input gave an almost-square: PolarPlot(0.75 + ArcSin(Sin(2x+Pi/2))/(Sin(2x+Pi/2)*(Pi/4))) (x from 0 to 2Pi)  This input gave an almost-octagon: PolarPlot(0.75 + ArcSin(Sin(4x+Pi/2))/(Sin(4x+Pi/2)*Pi^2)) (x from 0 to 2Pi)  The idea is that as the number of sides in a regular polygon goes to infinity, the regular polygon approaches a circle. Since a circle can be described by an equation, can a regular polygon be described by one too? For our purposes, this is a regular convex polygon (triangle, square, pentagon, hexagon and so on).  It can be assumed that the centre of the regular polygon is at the origin $(0,0)$, and the radius is $1$ unit.  If there's no such equation, can the non-existence be proven? If there are equations, but only for certain polygons (for example, only for $n &lt; 7$ or something), can those equations be provided? Difference between focusin/focusout and focus/blur, with example Shell programming temp=$1 vs temp=1 What's the difference between temp=$1 and temp=1? Why do I need the dollar sign?  For example:   #!/bin/bash  temp=$1 cell=$((($temp-32)*5/9))  echo $cell How can I visualize which folders and files are taking up all of the space on my hard drive?  I'm getting some conflicting reports on the size of hard drive contents. Namely what is and isn't there and what folders are actually using the space.   I need to know which of the files or folders the culprits behind all this hidden bloat. Also there should be a print option to get it on paper. Separability over intersection of intermediate fields Let $E\mathop{/}F$ be a finite-degree normal extension of fields. Let $K$ and $L$ be intermediate fields (that is, $F\subseteq K\subseteq E$ and $F\subseteq L\subseteq E$) such that $E$ is separable over both $K$ and $L$. Show that $E$ is separable over $K\cap L$.   So I was thinking that if $f=\min_{K\cap L}(\alpha)$. Then $\min_{K}(\alpha)$ divides $f$. But if $f$ has repeated roots then I don't see what goes wrong.   Thanks! Why is electric field of an infinite plate constant at all points? I know from Gauss law, it is $\vec{E}=\dfrac{\sigma}{2 \epsilon_0}(\hat{n})$ at all points. But it doesn't make sense because of the inverse square nature of electric field which suggests if you move further away from the plane, electric field must reduce.   Then why is electric field of an infinite plate constant at all points? Prove $\int_{a}^{b}{f(x)dx}>0$. Let $f\ge0$ be integrable on $[a,b]$. Let $f$ be continuous on $x_0\in (a,b)$ and let $f(x_0)&gt;0$.   Prove $$\int_{a}^{b}{f(x)dx}&gt;0$$  It is easy to see it, graphically, because $$f\ge 0 \Rightarrow\int_{a}^{b}{f(x)dx}\ge0$$  and if $f&gt;0$ somewhere between $a$ and $b$, then the zone of $F$ between those point is "real" (positive) and $\ne 0$.  My problem is, how do I show it formally?  I would appreciate your help. How fast would someone have to run to run over water? I was thinking about Flash, the superhero, or the little boy in the Incredibles.   There is  that doesn't answer a lot. Especially, I don't think surface tension would help a lot for a human to run over water, I think one would have to build on the inertial effect of the water.  There is one empirical approach based on figuring out the speed at which bare-footed water skiing is done, but I wasn't able to find a decent number. Still the difference may be that a hypothetical runner would have to propulse herself over the water, which may or may not make the thing more difficult.  Hence, I raise the question here. I am a beginner of ordinals and I don't know any powerful techniques in it. I come across with a problem about the first uncountable ordinal like this.  Let $X$ be a set of uncountable cardinality. Using the Principle of Well Order we have a well ordering $\le$ on X(and $&lt;$ means $\le$ but not euqual). By adding an element, which we denote by $∞$, and introducing the convention that $x &lt; ∞$ for all $x ∈ X$, we will assume that X has a maximum with respect to $\le$.   We define $ω_1 = \text{min} \{ x ∈ X : \{y ∈ X : y &lt; x \} \  \text{is uncountable}\} $  Clearly such a $ω_1$ exists. we define $0 = \text{min} \ X$ and intervels $[0,x], [x,y), (a,b]$ etc. in the usual sense.  Here are my questions:  (1)For any countable $A ⊂ [0, ω_1)$ there is an $x &lt; ω_1$ so that $A ⊂ [0, x]$.(I don't know how to make use of the countability and uncountablity here)   (2)Equipped with the topology generated by open intervals,  $[0, ω_1]$ is compact.   (3)A famous application of the first uncountable ordinal is to find an example of a Borel measure (with respect to the topology in (2)) that is not Radon. So how to construct a finite Borel measure $µ$ on $[0, ω_1]$ which is not a Radon measure?  Any solutions or elementary references will be appreciated! Does non-mass-energy generate a gravitational field? At a very basic level I know that gravity isn't generated by mass but rather the  and when I wave my hands a lot it seems like that implies that energy in $E^2 = (pc)^2 + (mc^2)^2$ is the source of gravity.  If the total energy of a particle contributes to the generation of a gravitational field, that seems to imply some strange things.  For example, you could accelerate a particle like an electron to such a high velocity that it has enough momentum / kinetic energy to collapse into a black hole.  An observer traveling with the electron would see an electron and stationary observers would see an arbitrarily massive black hole flying by.  These observations seem to be contradictory.  The same would be true of an extremely high energy photon.  Another consequence is that a stationary particle could appear to have so much mass that it could attract / deflect the trajectory of a rapidly moving observer.  It seems odd that at low velocities you wouldn't even notice a stationary electron as you pass it by but at high velocities the gravitational field you observe could be significant enough to alter your path.  Am I correct that non-mass-energy generates a gravitational field?  If it does, how are these strange observations like a particle looking like a black hole in one reference frame but not another reconciled? Awesome WM menu missing Firefox After sudo apt-get install awesome awesome-extra and logging into it (with no previous configuration that I know of), there's no menu entry for Firefox. All my other stuff is there - Mutt, Meld, jEdit, BOINC, etc., only Firefox is missing. I have no ~/.config/awesome/ directory, so there should be no override in place. How can I make a message appears on my PC when my phone is ringing? When I'm at work, I usually have a headset on my head and I am listening to music. My phone is always on vibrate to respect co-workers.  However, I don't keep the phone in my pocket because of its size, so I don't feel it vibrating.  I miss a lot of calls.  I was wondering if it's possible to forward "phone is ringing" notifications to the PC, ideally via a Bluetooth connection.  I would not mind installing a 3rd-party app on the phone or software on the PC. Extracting usernames from the /etc/passwd file What voltage is a 3-LED light from a LED-TV? I have some "NDV rev1.1 4248 back lights" from a television.   There is a print that sais "94V" on the strip, and on the wire supplying the strips it said "96V".   Every strip has 9x buttons which have 3 LED's in them. So i devided 94 by 9 and figured that every button should have 10.4V roughly, which makes sense, because a white LED is normally 3.5 volts.  I have a 12v Lithium battery which measured 11.1V so i tested one of the LED's with it and it lasted less than one second.   Are the LED's are rated for 10.4V roughly and not more? Gluing Lemma for Closed Sets: Infinite Cover Counter-Example Why do I have to solve for $x$ in this proof, if I choose not to find a counterexample? Forgotten the pattern and phone not showing the "forgot pattern" button. I upgraded my Moto G2 to Android Lollipop using over-the-air upgrade. It was awesome but I set a pattern lock which I forgot. Usually after 5 wrong attempts it shows the "forgot password" button but it is not showing that button even after 100 wrong attempts. How to unlock the phone?