I am facing weird situation here.   Following routine is called after I close my preference activity.   SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); String tmp = preferences.getString("unit", "C"); CommonTool.temperatureUnit = tmp;   What it does is, getting the settings that I made from the preference activity and I am storing it to a global variable called CommonTool.temperatureUnit. In this case, value "C" is assigned to it.    Fine by now.  In side the CommonTool class, I have a function which returns a temperature in Celsius or Fahrenheit depends on the user preference, I got from the preference activity.   public static String getCommonTemperature(int celsius) {     int ret;      if (temperatureUnit == "C") {         ret = celsius;     }     else {         ret = (9/5) * celsius + 32;     }      return Integer.toString(ret); }   The thing is.. it keeps fall into else part of it while temperatureUnit contains "C".     Does anyone have any idea? Thanks in advance.
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 does "Could not find or load main class" mean? Proving replacement theorem? I want to see if I am understanding the proof of the replacement theorem correctly.   Let $V$ be a vector space that is spanned by a set $G$ containing $n$ vectors.  Let $L \subseteq V$ be a linearly independent subset containing $m$ vectors.  Then $m\leq n$ and there exists a subset H of G containing exactly $n-m$ vectors s.t. $L \cup H$ generates $V$.   The proof in the book says to start with $m=0$. In that case $L=\varnothing$, the empty set.        Let's assume this theorem is true for some integer $m \geq 0$.   Let $L = \{v_j\}_{j=1}^{m+1}$ and define it as a linearly independent subset of $V$ consisting of $m+1$ vectors.  Since any subset of a linearly independent set is linearly independent as well ($S_1 \subseteq S_2 \subseteq V$), then $\{v_j\}_{j=1}^m$ is linearly independent also.   It then says to use the induction hypothesis to say that $m \geq n$. Well, ok, but that seems sort of pulled out of nowhere to me. The next step is to say that there is therefore another subset, $\{u_k\}_{k=1}^{n-m}$ of G such that $\{v_j\}_{j=1}^m \cup \{u_k\}_{k=1}^{n-m}$ spans $V$.   That being the case there are scalars $(a_j)_{j=1}^m$ and $(b_k)_{k=1}^{n-m}$ which you can multiply by the vectors $v_j$ and $u_k$. You can then add the two sets of vectors, yielding $$\sum_{j=1}^m a_j v_j + \sum_{k=1}^{n-m} b_k u_k = v_{m+1}$$  At this point I am not sure I understand things. Because we are assuming $n-m&gt;0$ -- otherwise $v_{m+1}$ is linearly dependent. But then it says not only is $n&gt;m $ but $n&gt;m+1$, and that is where I am losing the plot to get to the next step. I have a simple question.     over centuries / for centuries   what is the difference?  Thank you. I think my question relates to a fundamental of 3D modeling that I haven't picked up on yet. It's very simple:  Let's say I have a flat quad. A plane on the XY plane inserted into am empty blender file is a great example. Now let's say I start moving each of the 4 vertices around on in any direction, especially the Z axis.   At this point, there would still be one face, but its extremely unlikely that the face would be planar (I just learned this word). So blender does its best to make sense of what this should look like.  The problem I'm having is that it seems like my quads are always like this, but they never look the way I want. There are edges and seams that look like they are dangling in space, and what tends to happen is that my mesh looks great when viewed from most angles, but if you look at it from just the right angle, you notice the dangling edges or sometimes even some kind of impossible geometry. And so I might try to nudge the problematic vertices around, but this often seems to either make it worse, or just hide the bad geometry until you see it from a different angle.  For me, this always seems to happen whenever I'm trying to move vertices to add roundness to something that is originally square.   There is another question on here about how to actually flatten the quads. That's great, and I might use some of the techniques mentioned there. My question is:   Why does this happen? (Can someone explain this better?) What are some tips and tricks to avoid this situation? What are some tips and tricks to mitigate this situation?   EDIT Here is an illustration:  The overall mesh as viewed from a distance looks decent (for my skill level)    But if you get closer and look from a certain angle...    Super close up:    The "edge" that is pointed to by the arrow is not actually an edge, but some kind of artifact created when blender tries to show the quad. The way the vertices are positioned, it shouldn't actually be possible to see the sliver of the face that I marked in red, since this face is supposed to be around the corner from the edges. The edges should form the silhouette on the right side of my figure.     Here is the side view. Maybe it is the angled topology that skews the face in a funny way?  But I'm not looking for help with this one particular issue, but rather a better understanding of why this happens, and ideas to prevent this in future models. I have to admit, I didn't even know spoilers were supported until today, but really bugs me that spoilers just look like empty block quotes before you mouse over them.   Is this a spoiler or just a long empty block quote? I can't tell right away, so it would be really nice if there was some indication of which one it was so I didn't have to push my mouse all the way over to it. What can I say, I'm incredibly lazy.  vs.         I suppose the author should include something that says 'Spoilers below:', but it would be nice if there was some other indication of what it was. Object glitching/dissapearing in render due to parenting problems I have completed my animation but I realised when I render it that one of the propellers blades starts to glitch. On some frames it is in shot and some it is out of shot and this is really strange. These 'blades' are both parented to the same 'propeller' and the 'propeller' is parented to the middle ball. I have baked the animation through so this shouldn't be a problem. These propellers are passive rigid bodies. I have tried to figure out this problem and I just can't get to a solution. I've never had it where a rigid body object glitches out like that in the rendered animation, it's almost like it's jumping, which on the render these frames show the object as invisible. The video attached will show.   If anyone has experienced problems like this or knows an answer to my dilemma that would be greatly appreciated, thanks! My settlement was attacked by some Raiders and my defenses took care of them along with some of my NPC's. It seems like the Raiders didn't make it through to any of the buildings. What happens when they do?  Can you lose your items if you stored them in a house?  Can the NPC's die?  Do the enemies destroy your buildings? Use of Named Credentials seem to be tied to External Data Source How to add a vertical line to a plot Proving $\sqrt{ab} = \sqrt a\sqrt b$ I am currently in high school and we are studying radicals. I had asked my math teacher why $\sqrt{ab}=\sqrt{a}\sqrt{b}$ (for all a,b>0) and he tries to prove it by arguing that $a^{1/2}*b^{1/2}=(ab)^{1/2}$ (an exponent law). However, I find this proof problematic since $x^{1/2}$ is simply defined as $\sqrt{x}$, so the reasoning is circular.   My view is that $\sqrt{ab}=\sqrt{a}\sqrt{b}$ because once we square both sides we get $ab=ab$. Since we're obviously referring to the positive root, and the function $f(x) = \sqrt{x}$ is injective, it necessarily follows that the original expressions $\sqrt{ab}$ and $\sqrt{a}\sqrt{b}$ are equivalent because for injective functions it is not possible to map distinct elements in the domain to the same element in the range ($ab$). Hence they are equivalent expressions.   My question therefore is, is my proof valid and/or rigorous (I find it convincing but maybe it's wrong; I just want to be clear) and secondly was my teacher's proof correct? From time to time, I need to typeset Welsh. Sometimes, I need to typeset citations and bibliographies in Welsh. I think that last time I did this, I may still have been using BibTeX although I am honestly not sure. In any case, my entire work-flow now uses biber and biblatex...  I found  on changing the names of things, including the names of things used by biblatex. However, that cannot deal with the case of an unsupported language.  Suppose that I want to typeset a document in Welsh:  \documentclass[a4paper,welsh]{article}  \usepackage{babel} \usepackage[utf8]{inputenc}% welsh needs utf8x but biblatex doesn't like it \usepackage[T1]{fontenc}% not great for Welsh but the best pdfTeX can do \usepackage{csquotes}% doesn't like Welsh though biblatex likes csquotes on account of babel... \usepackage[backend=biber]{biblatex} \bibliography{biblatex-examples}  \title{Fy Nogfen} \author{Rhywun}  \begin{document}   \maketitle   \tableofcontents   \section{Cyntaf}   \autocite{westfahl:space}    \printbibliography  \end{document}   There are multiple problems in such a case. (One is that I need utf8x but can't use it on account of biblatex. Another is that I need utf8x at all. Another is that biblatex likes csquotes but csquotes doesn't do Welsh. But these are irrelevant to this question.)  The output is as follows:    Note that the use of the English citation is just so this is easy to reproduce. Obviously, the content of the reference might well be in Welsh. (Though it might be in English, too.)  As can be seen, while elements of the document controlled by babel are handled correctly, those under the control of biblatex are not. However, I cannot simply modify the solution offered by lockstep for changing strings to customised English variants. That is, I can't just use a Welsh version of  \DefineBibliographyStrings{english}{%   bibliography = {Works Cited},   references = {Works Cited}, }   because biblatex has never heard of it.  What is the most appropriate way to configure biblatex for use with an unsupported language? I frequently need to do the following things in MySQL:   Create a non-root user Set that user's password Grant that user all privileges Make a database with the same name as the new user Allow usage only for users from the localhost.   Previously I did this using PHPmyadmin, but I would prefer doing it directly from BASH. Is there a CLI way to execute these steps? We should make books of our best content! And that's a good idea!  We have a lot of high quality content here, certainly enough for a small book.   I'm not saying that it necessarily has to be integrated into the main site, but this is just a suggestion if anyone wants to implement it.   Stack Exchange probably could make money selling the physical books though. CC-BY-SA allows selling, as long as you allow others to make copies of your book, and credit the author.  What Wikipedia does is you can custom order any set of articles as a book (it even has a nice set of authors at the end, to satisfy the BY part of CC-BY-SA).  This could even tie into the docs feature. Is there a way to add a timer to a Beamer presentation? Let $X$ be any distribution with defined mean, $\mu$, and standard deviation, $\sigma$.  The central limit theorem says that  $$ \sqrt{n}\frac{\bar{X} - \mu}{\sigma}  $$ converges in distribution to a standard normal distribution.  If we replace $\sigma$ by the sample standard deviation $S$, is there a theorem stating that  $$ \sqrt{n}\frac{\bar{X} - \mu}{S}  $$ converges in distribution to a t-distribution?  Since for large $n$ a t-distribution approaches a normal, the theorem, if it exists, may state that the limit is a standard normal distribution.  Hence, it would seem to me that t-distributions are not very useful - that they are useful only when $X$ is roughly a normal.  Is this the case?    If it is possible, would you indicate references that containing a proof of this CLT when $\sigma$ is replace by $S$?  Such a reference could preferably use measure theory concepts.  But anything would be great to me at this point. prove every connected manifold is path connected manifold .       my thought:      connected space : Let $ X$  be a topological space. A separation of $ X $ is a pair $U, V$ of disjoint    nonempty open subsets of $ X $ whose union is $X$. The space $ X $ is said to be connected    if there does not exist a separation of  $X$ .      Components: Given  $X$ , define an equivalence relation on $X$ by setting x~y if there    is a connected subspace of $X$  containing both $ x$  and $ y$ . The equivalence classes are    called the components (or the "connected components") of $ X$.       Path Component: I define another equivalence relation on the space $ X$  by defining x ~ у    if there is a path in $ X$  from $ x$  to $ y$ . The equivalence classes are called the path components of $ X$ .       Theorem  : The path components of $ X$  are path connected disjoint subspaces    of $X$  whose union is $X$ , such that each nonempty path connected subspace of $X$  intersects only one of them.       thank you so much Does double negation distribute over implication intuitionistically? Group posts by year, then by month Are aerosol cans allowed and safe, in checked luggage? In my project, I use a lot of geodata from different directories. Now I want to give the QGIS project to a colleague (eg on a CD).  Is it possible to copy the shapes from different directories automatically to one directory?