new to the forum but had a quick question from my lecture yesterday. I understand string.equals() compares the actual content or characters while string == string compares the references. But where I got confused is he said that within the string pool each string literal is created only once, and that any variables that contain that same string literal will point to that one instance of the string within the string pool. So why not use == comparison then? Won't any variables that contain the same string literal point to the same one in the string pool and return true or false?
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?
There are several algorithms to calculate distance between two latitude/longitude points.     Hubeny     But there are not so many algorithms (actually I can't finally find it) which can calculate latitude/longitude of point B from another latitude/longitude point A with bearing and distance.      I'm glad to know if there are any algorithms which is lesser accurate, but faster than Vincenty's formulae. Physics are not simulated past a certain frame? I've set up the physics of a swinging wrecking ball and set the animation to run for 240 frames.  This was not long enough for the entire "swing" of the ball-and-chain.   I'm unable to reset the timeline, but I can set the end frame to (say) 1000 frames, but when I try to play the animation, the animation progress halts at frame 240 and I cannot get it to go any further.   There are no markers or keyframes in the timeline.  What should I do to "force reset" the animation-timeline, to allow changes to the length? How to placate a very angry priest? So whilst going to rescue the Moth Priest 'Dexion Evicus', I think I accidentally might have hit him, not sure how. Anyhow the bearded maniac has taken this as a personal attack and refuses to accept a yield. Because he's so angry with me he'll just not quit, but being a quest NPC he can't die, nor can my companion Mjoll. So aside from the hilarious infinity battle, I thought, fair enough I'll talk to him whilst he's 'downed' and lo, I progressed the quest.  So I go back to the Dawnguard fortress, and he's there in the middle shouting murder and attacking everyone in the fortress! Clearly his rage knows no bounds.    Is there a way to forcibly pacify him without interring him? Or do I need to roll back and do over? How to combine two QUERY results into one column I have the following QUERY  =query(XX!A2:A;" select A where A&gt;'50' ")   and  =query(YY!A2:A;" select A where A&gt;'50' ")   how do I combine these two data sources so I don't have to have two separate columns they process data to?   best would be if the 1st row from XX is followed by the 1st row of YY, 2nd row followed by 2nd row... and so on If the above option is not easily possible, it is OK for one query to be followed by the second one (if I expect correctly that the start of the second will be moved with newly added data into the first one) Is 'clamp' a formally recognized mathematical function? I was surprised to find the clamp function absent from  and . Is this mainly a concept particular to computer programming? Is it known by another name in mathematics? I'll be editing the Wikipedia shortly to include a reference to this function but I want to make sure I'm not omitting some synonymous terms I'm currently unaware of.  $$   \operatorname{clamp}(x) = \max( a , \min( x , b ) ) \in [a,b] $$ TikZ 3.0.0 (release) produces strange shadings if used with XeLaTeX and standalone I would like to use shadings in my TikZ graphics together with the standalone package and XeLaTeX, but for some reason it is broken if I try with the new 3.0.0 release (). Any other combination I tried works for me (use for example article class/pdflatex/lualatex/TikZ 2.10). (I'm using a fully updated TeX Live 2013.) MWE \documentclass{standalone} %\documentclass{article} % would work  \usepackage{tikz} \usetikzlibrary{shadings}  \begin{document} \tikz \draw[top color=red] (0,0) rectangle (2,1); \end{document}  Output  Expected Output  Question How can I avoid the problem and which package/class is causing it? Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy?  Desirable features are ease of maintenance, IDE-friendliness, suitability for source control branching/merging, and easy generation of install packages.  In particular:   Where do you put the source? Where do you put application startup scripts? Where do you put the IDE project cruft? Where do you put the unit/acceptance tests? Where do you put non-Python data such as config files? Where do you put non-Python sources such as C++ for pyd/so binary extension modules? How to check if my eSATAp port provides 12V power? I have a Lenovo ThinkPad Edge 13" model 0217-2QG with eSATAp port.  How do i check if my port provides 12V power (enough to power a 3.5" HDD)? I am a little bit confused about the Area Under Curve (AUC) of ROC and the overall accuracy.  Will the AUC be proportional to the overall accuracy? In other words, when we have a larger overall accuracy will we definitely a get larger AUC? Or are they by definition positively correlated?  If they are positively correlated, why do we bother reporting both of them in some publications?  In real case, I performed some classification task and got the results as follows: classifier A got an accuracy 85% and AUC of 0.98 and classifier B got an accuracy of 93% and AUC of 0.92. Question is, which classifier is better? Is it possible to get results similar to these (or do my results indicate a bug in my implementation)? Background not changing using gsettings from cron I'm trying to change my wallpaper to a random image using Indrajith Indraprastham's suggested script here:    When I run the script from a terminal window, the bg changes just fine, but when it's run from cron, I'm mailed this error:     (process:21901): dconf-WARNING **: failed to commit changes to dconf: Error spawning command line 'dbus-launch --autolaunch=00216c114dcf433c9bb9009985d607d6 --binary-syntax --close-stderr': Child process exited with code 1   I would appreciate any suggestions. How do I make a Theorem n followed by a Theorem n' ? Can one executable be both a console and GUI application? I want to make a  program that can be run as a CLI or GUI application depending on what flags are passed into it. Can this be done?  I have found these related questions, but they don't exactly cover my situation: What is the origin of non-conservative force? My understanding about  is a force that its work is independent of path such that we can construct another form of the work called potential to make our life easier.  For friction, if I start from microscopic point of view, it should be the macroscopic effect of the electric force or gravity which are both conservative force.  Why do we initially have description by conservative forces (electric/gravity force) but end up with a macroscopic description of nonconservative force(friction)? bug with varargs and overloading? Make an object invisible to a specific camera? (Cycles) I'm trying to set up multiple cameras for a scene set in a room. Is there a way to link object visibility to a specific camera? Ideally, a wall or ceiling would not render if it were in the way of the specified camera.  I've tried to get around this by keyframing Restrict Rendering, but that gets difficult to keep track of. I've also tried adjusting the clipping plane, but that clips too much and would also need to be keyframed if the camera moves.   Thanks! Shapes of planets? The square root of a prime number is irrational I'm trying to find a simple way to create vertices where two objects intersect and delete the leftover internal planes + then join the meshes so that I have one hollow mesh to sculpt. The reason I need to know this is that on my first sculpt I just joined the meshes, but it didn't create vertices at the intersecting points so when I went to sculpt it just overlapped the meshes as you can see here in the neck.  Here is what I am working on now, it needs to be 1 hollow mesh I'm getting the following error when i try and install MSSQL 2008 on Windows Server Standard 2008 R2: Proving $v(s,p)=2^{p-1}(2s-1)$ is a bijection of natural numbers and $f(s)=2s-1$ is a bijection between natural numbers and odd numbers. How do I prove this function is bijective? $$ v(s,p)=2^{p-1}(2s-1). $$ The domain is natural numbers and the codomain is also the natural numbers.  And this one: $$ f(s)=2s-1. $$ The domain is the natural numbers, and the codomain is the odd numbers in the natural numbers.  With this one I would do this to show it's injective: $$ \begin{align} v(s)&amp;=v(s_1)\\ \implies 2s-1&amp;=2s_1-1\\ \implies (2s_1)/2&amp;=(2s_2)/2\\ \implies s=s_1 \end{align} $$ So it's injective since if $v(s)=v(s_1)$ then $s=s_1$.  And to show it's surjective $f(s)=y$: $$ \begin{align} y&amp;=2s-1\\ \implies s&amp;=(y+1)/2 \end{align} $$ Then the function must be surjective since every $y$ is the same as the codomain for $f$.  Am I correct?