$update_query = "UPDATE notifications SET status = '1' WHERE status='0'";     mysqli_query($con, $update_query);   Its a very simple query with no dynamic variables defined. Is it fine to run it like this or should go for prepared statement for this kind of queries also?
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
Determining direction of longest segment of polygon using ArcGIS Desktop? I have a shapefile with 9000 agriculture fields and what I like to do is to determine for each field (=each polygon) the direction of the longest segment.  For instance, the selected polygon in the screenshot has its longest segment from west to east so I would like to mark give the polygon the attribute W (for west) or either E (for east).   Is there any solution to solve my problem in a fast but generalized way?   I do not need very detailed results. It's just for the interpretation of a question.   I'm seeking an answer using ArcGIS 10.2 for Desktop.  To be more precise on what I'm looking for I try to explain more practical: I'm doing winderosion analysis for a specific area with 9000 fields. As result I have a potential susceptibility for each field. I like to check, if the fields with high susceptibility are correlated to a certain orientation of the fields, e.g. check if most of the fields with high risk are oriented in the main winddirection or not.   The search for the longest segment is not really important for me. It was just an idea I had to determine the direction. So forget about the longest segment if there is a way to determine the direction with another method ;) How to capture ordered STDOUT/STDERR and add timestamp/prefixes? What is polarisation, spin, helicity, chirality and parity? Polarisation, spin, helicity, chirality and parity keep confusing me. They seem to be related, but exactly how they are related is unclear to me. Can someone maybe give a short overview about what these quantities mean and how they are related? What are the values for e.g. basic particles like electron or photon? Comparison between integrals Let's say - $F(x) &gt; G(x)$ for all $x$ in $E$.  So is it true that ?  $$\int F(x)\,dx  &gt; \int G(x)\,dx$$ or I can use this statement only when the two functions are non-negative functions.  Thanks! Is there any freely available pointcloud data?   I'm especially interested in dense clouds of small areas(5m to 100m radius) but anything else would be fine too.   I've found that these pages have very nice and easy to access point cloud data. Number of permutations of $n$ elements where no number $i$ is in position $i$ I am trying to figure out how many permutations exist in a set where none of the numbers equal their own position in the set; for example, $3,1,5,2,4$ is an acceptable permutation where $3,1,2,4,5$ is not because 5 is in position 5.  I know that the number of total permutations is $n!$. Is there a formula for how many are acceptable given the case that no position holds its own number? Does assigning objects to null in Java impact garbage collection? Does assigning an unused object reference to null in Java improve the garbage collection process in any measurable way?  My experience with Java (and C#) has taught me that is often counter intuitive to try and outsmart the virtual machine or JIT compiler, but I've seen co-workers use this method and I am curious if this is a good practice to pick up or one of those voodoo programming superstitions? How to prove that compact subspaces of the Sorgenfrey line are countable? How to prove that every compact subspace of the  is countable? Why are newer generations of processors faster at the same clock speed? Why, for example, would a 2.66 GHz dual-core Core i5 be faster than a 2.66 GHz Core 2 Duo, which is also dual-core?  Is this because of newer instructions that can process information in fewer clock cycles? What other architectural changes are involved?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this question. Feel free to edit the answers to add additional details. Rename all the files within a folder with prefix “Unix_” Rename all the files within a folder with prefix “Unix_” i.e. suppose a folder has two files a.txt and b.pdf than they both should be renamed from a single command to Unix_a.txt and Unix_b.pdf Looking for illustrator script to swap all objects with another I have a map with small circles for over 200 cities. I need to change all of the circles into map pins. Is there a way to do this? I think it's a script maybe.   I know how to select all objects of the same appearance and give them a new graphic style but that will only let me change the color, stroke, etc. not replace with a new shape. I have had no problems exporting .fbx files for Unity except recently some of my .fbx started to rotate the mesh. The asset is correctly oriented, but the mesh is rotated 90 degrees. Is there an explanation and fix for why this happens sometimes, and works properly otherwise? Group of order 15 is abelian How do I prove group of order 15 is abelian?  Is there any general strategy to prove that a group of particular order(composite order) is abelian? In an exam paper, there was a picture of an air stewardess in the aeroplane serving passengers. One of my pupils wrote the following:      The air stewardess works on an aeroplane.    Shouldn't it be the air stewardess works in an aeroplane? Why do adult insects have 6 legs? Apparently, there is an advantage to having 6 legs in the insect world. What is that advantage, if anything? Why would such an advantage exist for insects, but not for other, larger land animals?  What do those middle legs do that the front and hind legs cannot, if anything? Are they really essential, or do they just generate more muscle power? Is there difference in force when the height increases? Consider a man with mass 50kg.   When he jumps from a 2 meter height, the total force is $F=ma$ ie (mass * gravity), but nothing happens to him. When he jumps from a 50 meter height, the total force is (mass * gravity ) same, but he dies.   Why is this happening? What are the benefits of playing an alignment other than True Neutral? How can I utilize the whole terminal, like htop or emacs do? I want to write a program that can "draw" in the terminal the same way as htop or emacs. By that I mean "get rid of the prompt and make the output dependent on the current size of the terminal".   To make this a bit more clear:   I want to use the terminal this way:     in stead of this way: $n$ Lines in the Plane How am I to "[u]se induction to show that $n$ straight lines in the plane divide the plane into $\frac{n^2+n+2}{2}$ regions"? It is assumed here that no two lines are parallel and that no three lines have a common point. Further, this is not a non-Euclidean problem, but I wouldn't mind a discussion on the non-Euclidean nature of the problem.  I was thinking it might be easier to show using the unit sphere.    A GOOD REFERENCE I FOUND THAT WILL BE USEFUL TO ANYONE COMING ACROSS THIS PROBLEM IS Concrete Mathematics, Graham, Knuth, Patashnik pp. 4–8. automatically apply special formatting to selected words in text