MySQL query that finds circles containing given coordinate OK, so, here's the problem. I have three columns in MySQL table:  location_lat location_lng radius   I need to make a query that when user selects the point on map I get latitude,longitude values and to find all DB entries that contains this dot.  To illustrate it, I've made a mockup:    So, given the coordinates of the black marker I need to find only red circles and not the green ones.  Is it doable via MySQL?  I know how to make it in PHP, but that could be more resource intensive.
MySQL Great Circle Distance (Haversine formula) I've got a working PHP script that gets Longitude and Latitude values and then inputs them into a MySQL query. I'd like to make it solely MySQL. Here's my current PHP Code:  if ($distance != "Any" &amp;&amp; $customer_zip != "") { //get the great circle distance      //get the origin zip code info     $zip_sql = "SELECT * FROM zip_code WHERE zip_code = '$customer_zip'";     $result = mysql_query($zip_sql);     $row = mysql_fetch_array($result);     $origin_lat = $row['lat'];     $origin_lon = $row['lon'];      //get the range     $lat_range = $distance/69.172;     $lon_range = abs($distance/(cos($details[0]) * 69.172));     $min_lat = number_format($origin_lat - $lat_range, "4", ".", "");     $max_lat = number_format($origin_lat + $lat_range, "4", ".", "");     $min_lon = number_format($origin_lon - $lon_range, "4", ".", "");     $max_lon = number_format($origin_lon + $lon_range, "4", ".", "");     $sql .= "lat BETWEEN '$min_lat' AND '$max_lat' AND lon BETWEEN '$min_lon' AND '$max_lon' AND ";     }   Does anyone know how to make this entirely MySQL? I've browsed the Internet a bit but most of the literature on it is pretty confusing.
I would like to know the purpose of nohup these days. I ask because I read this  Nohup is short for “No Hangups.” It’s not a command that you run by itself. Nohup is a supplemental command that tells the Linux system not to stop another command once it has started. That means it’ll keep running until it’s done, even if the user that started it logs out. The syntax for nohup is simple and looks something like this: nohup sh your-script.sh &amp; Notice the “&amp;” at the end of the command. That moves the command to the background, freeing up the terminal that you’re working in. Nohup works with just about any command that you run in the terminal. It can be run with custom scripts as well as standard system commands and command line utilities.  With using linux distributions such as SLES 11.4, or RHEL/CentOS 7.x, I can  remote log in to linux over the network via SSH run the simple program below, or any other, doing ./a.out &amp; log out of linux; type exit in the putty SSH terminal my sample program below, or any other including bash, csh, or tcsh shell scripts, run to completion just fine without the need for nohup typing exit in putty to close an SSH session, I would think that qualifies as a logout?  Is there any purpose or value with nouhup today?  Is it a kernel &gt;= 3.x thing? For however long I can remember (kernel &gt;= 2.6) I've never used nohup and have always just use &amp; with no problems. Can someone give me a practical scenario where nohup would be used? #include &lt;stdlib.h&gt; #include &lt;stdio.h&gt;  /*     sample C code, to print numbers to a file named zz.tmp     the numbers 0 to 29 over 30 seconds */  int main ( int argc, char *argv[] ) {    FILE *fp;    int i;     i = 0;    fp = fopen(&quot;zz.tmp&quot;, &quot;w&quot; );     while ( i &lt; 30 )    {       fprintf( fp, &quot;%d\n&quot;, i++ );       sleep( 1 );    }    fclose( fp );    return 0; }  mysleep.sh #!/bin/bash  sleep 1000  On Centos 7.7, optiplex pc login with keyboard &amp; mouse, my account is bash. I do nohup ./mysleep.sh and then control-z.  When typing jobs I see [1]+ Stopped nohup ./mysleep.sh A ps -ef | grep mysleep shows that process id existing, but if I close the terminal window via X in upper right corner, that process goes away so it seems nohup is not working? My Windows 10 notebook died but fortunately I was able to rescue the hard drive and put it into another PC.   Unfortunately, the other PC can't open the C/Users/Joe folder. What do I have to do to open the folder? Why can we apply the $E=hf$ equation for electrons? So in my textbook, it states that the $E=hf$ equation applies to electrons, and all particles, not just photons.   But in order to prove this, wouldn't these particles need to have zero mass, to satisfy $E=pc$ from Einstein's equation?  In Einstein's theory of relativity $E^2= p^2c^2 + m^2c^4$, we get $E=pc$ because we consider the mass to be zero.   For $E=hf$ to work for other particles, don't we need to assume electrons have zero rest mass? Was Luke Skywalker the leader of the Rebel forces on Hoth? Rewatching Star Wars: The Empire Strikes Back, I noticed the opening crawl declares Luke Skywalker as the leader of the Rebel forces on Hoth:     Evading the dreaded Imperial Starfleet, a group of freedom fighters   led by Luke Skywalker has established a new secret base on the remote   ice world of Hoth.   Is that correct? I though Princess Leia or General Rieekan commanded the Rebel base on Hoth.  I can't find any references to this discrepancy on the Internet. Maybe in an earlier version of the script, Luke Skywalker was the commander and the crawl wasn't updated. Or perhaps "led" is meant in the sense Luke was a moral leader of the Rebel fighters? How to add Windows to GRUB I have my encrypted Archlinux installed on my SSD. Now I have one HDD with Windows installed. But in my GRUB just Archlinux is shown (no Wonder, because I just installed Windows on the other HDD, GRUB doesn't know of that by now.).  My Question is, how do I properly add my Windows-HDD to GRUB, so that I can choose which to boot when starting?  I am a little bit afraid of destroying my GRUB so I can't boot my encrypted Archlinux anymore.  Thanks! The number of 5-digit numbers such that their sum of digits is even is? I tried this problem by counting the number of 5-digit numbers and then dividing it by 2 just like we do for three digits. Please help. Thank you. How do I add CSS & JavaScript to ? I want to add the following code in my  section of the front page using a Drupal 8 sub theme of Bartik.   Can anybody help how to do it? What is the best way to do it in this new twig version of theme? Where is page.tpl?  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="stepcarousel.js"&gt;&lt;/script&gt; HBONOW on Ubuntu 16.04LTS I am trying to watch HBONow on Ubuntu 16.04LTS on Chrome browser. It is showing the certification video (i.e. PG-13, TV-MA) and then when it tries to load content it's never shows up.  My windows browser is able to load it successfully. What could be the possible solutions? Are there integer solutions to $9^x - 8^y = 1$? Google Chrome: Import/Export Passwords? I recently migrated from Windows7 to Kubuntu 10.0.4. In many ways, I'm loving the change. (I never knew it could be such a seemless process to write/test scripts!)  One of the few things that is causing me any hangup is that none of the passwords that were saved in my browser are available (obviously, since it's a completely separate installation). Is it possible to export my passwords from the Windows instance of Chrome and then import them into the Linux version? Let $a,b,c,x,y,z&gt;0$ and $x+ y+ z= 1$. Show that $$ax+ by+ cz\geq  a^{x}.b^{y}.c^{z}$$ I have found the generalization of this inequality: For 2 sets of numbers $\left \{ a_{i} \right \}, \left \{ b_{i} \right \}&gt; 0$ and $\sum_{1}^{n}b_{i}= 1$, we have: $$\sum_{1}^{n}\left ( a_{i}b_{i} \right )\geq  \prod_{1}^{n}\left ( a_{i}^{b_{i}} \right )$$ First solution Simply compare the logs: as the natural logarithm is a concave function, one has $$\ln\bigl(a^x b^y c^z)=x\ln a+y\ln b+z\ln c\le \ln(ax+by+cz)$$ for all non-negative $x,y,z$ such that $x+y+z=1$. How about another solution? I really hope to see that. Thanks! Why can't I join a friend's world on Minecraft PE? I'm on my tablet playing Minecraft PE. My boyfriend rang me and asked me to join his Minecraft PE world. However, I can't do it because the game doesn't show his world. What's wrong and how can I fix it? Why is my mesh inversed when Imported to Unity? So I modeled this sword and all the parts were separate meshes. I used a mirror modifier when I was modeling and then I applied the modifier when I was done to make the parts into solid meshes. Put a UV map on everything and it all looked good in Blender.  Then I put it into Unity and I got what you see in the picture. Part of the sword is inversed. Oddly, the inversed part actually maintains the proper silhouette. It maintains the correct shape, but then is shaded like the front half is missing.  Does anyone have an idea of what's going on and how to fix it?  Thanks, James I am trying to model a violin belly and I am intrigued, how is it possible to make faces with soft / rounded edges?    The edges I do are totally straight (see the blue amoeba).  Also, do you have some idea on how to avoid the edge loops getting too "compressed" in the middle of the model (see the red amoeba) ?    I know the Subdivision surface modifier, but I want curved edges after applying the modifier... like in this picture :  Any help will be very appreciated. Thank you in advance!  Marcos  2nd part  In fact, I've tryied to model using nurbs and bezier curves, but I wasn't able to find any tool similar to loft that works with curves, then I was forced to convert it in meshes, the results were not terrific and I've started to move the vertices manually, a real pain... Unlike a guitar, each edge loop is on a diferente elevation on z axis and I have to keep the original dimensions, So I have to be extremely careful when using the subdivision suface modifier. I've already modeled this think on three different CAD softwares, but the meshes are far from good... I want to improve the edge loops, but it will be a long path... Thank you again. On , sorted by votes, the accepted answer is #3 in order of votes.  It appears as number 3 in the list as well. Is this new behavior intended? Java: split a List into two sub-Lists? I have this problem I'm working on. Hints are much appreciated (I don't want complete proof):  In a normed vector space, if $ x_n \longrightarrow x $ then  $ z_n = \frac{x_1 + \dots +x_n}{n} \longrightarrow x $   I've been trying adding and subtracting inside the norm... but I don't seem to get anywhere.  Thanks! Is $\sin \infty$ an indeterminate form? I had a  over what seems like a simple question:     Is $\sin \infty$ an ?   What do you think? :)    I'm labelling this as (soft-question) to be safe, but it should have a clear answer depending on the definition of indeterminate form used. The term "indeterminate form" is seldom used in post-calculus mathematics, but I believe it has one or more accepted definitions, which are either informal or formal. So any answer which takes a standard definition and argues the case would be interesting to me.  How to make a good answer:   State the definition of indeterminate form, either from an online or textbook source, or a definition you came up with on your own. Determine, using your stated definition, whether $\sin \infty$ is indeterminate or not.   EDIT: What do I mean by $\sin (\infty)$?  It's not a well-defined expression, but neither are any of the other indeterminate forms: $\frac{0}{0}$ doesn't exist, $1^\infty$, doesn't exist, and so on. So the question is whether this expression -- which is not well-defined, just like any other indeterminate form -- is an indeterminate form. How does RAID 1 determine which drive should act as the source for a rebuild? Here's my scenario -- both drives were working perfectly fine. I removed one of the drives for a while (building a new PC, didn't think I was going to use RAID anymore but changed my mind). I actually switch the SATA type to AHCI and was operating for about a week on the new system before deciding to re-enable RAID and reinstall the drive I had removed.   It's currently rebuilding, but I'm curious how it knows which one is the source and which one is out-of-date? Matching exact string with JavaScript How can I test if a RegEx matches a string exactly?  var r = /a/; r.test("a"); // returns true r.test("ba"); // returns true testExact(r, "ba"); // should return false testExact(r, "a"); // should return true