It's possible avoid totally SQL injection allowing ONLY A-Z/0-9 in GET or POST parameter?   if(preg_match("/^[a-zA-Z0-9]+$/", $_GET['myVal']) == 1) {     $myValue = $_GET['myVal']; } else {     die(); }   It's a good practice? It's possible defeat this way? Thanks
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?
Midpoint-Convex and Continuous Implies Convex Given that $$f\left(\frac{x+y}{2}\right)\leqslant \frac{f(x)+f(y)}{2}~,$$ how can I show that $f$ is convex. Thanks.      Edit: I'm sorry for all the confusion. $f$ is assumed to be continuous on an interval $(a,b)$. Which shell interpreter runs a script with no shebang? Suppose the default shell for my account is zsh but I opened the terminal and fired up bash and executed a script named prac002.sh, which shell interpreter would be used to execute the script, zsh or bash? Consider the following example:  papagolf@Sierra ~/My Files/My Programs/Learning/Shell % sudo cat /etc/passwd | grep papagolf [sudo] password for papagolf:  papagolf:x:1000:1001:Rex,,,:/home/papagolf:/usr/bin/zsh # papagolf's default shell is zsh  papagolf@Sierra ~/My Files/My Programs/Learning/Shell % bash # I fired up bash. (See that '%' prompt in zsh changes to '$' prompt, indicating bash.)  papagolf@Sierra:~/My Files/My Programs/Learning/Shell$ ./prac002.sh  Enter username : Rex Rex # Which interpreter did it just use?   **EDIT : ** Here's the content of the script  papagolf@Sierra ~/My Files/My Programs/Learning/Shell % cat ./prac002.sh  read -p "Enter username : " uname echo $uname This is probably a dumb question. I guess what I'm trying to ask is if radio waves travel the same speed as gamma rays, how do gamma photons carry more energy than radio photons? Do they spin faster? What other energy sources could they carry if they are moving the same speed through space? For my MAC laptop, I only have 250GB and out of this 250GB MAC is taking up 129GB in the other section. I looked everywhere to the best of my knowledge. Please note my home directories is only 45GB. Can you somehow please help me? How to replace a character by a newline in Vim I'm trying to replace each , in the current file by a new line:  :%s/,/\n/g    But it inserts what looks like a ^@ instead of an actual newline. The file is not in DOS mode or anything.  What should I do?  If you are curious, like me, check the question  as well. How can I restrict various roles with limit in creating nodes of a particular content type How can I restrict various roles with limit in creating nodes of a particular content type? Solve for $x$ in $6x^2-25x+12+\frac{25}{x}+\frac{6}{x^2}=0$ pgfplots data time format I have this type of data set:  Time          State 22:54:14.716    5 22:54:14.716    5 22:54:14.716    5 22:54:14.716    5 22:54:14.729    4 22:54:14.919    1 22:54:14.919    1 22:54:15.128    5   I would like to plot a graph with pgfplots but the package can not read properly the time format. Restore a SQL Server 2012 backup file in SQL Server 2016/2014 I have SQL Server 2012 backup files and want to restore these to SQL Server 2016/2014. Will it work?  I need to find this out before I uninstall SQL Server 2012. I have tried reading up on WMS on wiki and other sources but haven't managed to get my head around a couple of points.   1) Using WMS is it possible to get a local copy of the raster data (say a tiff image tile). The reason, I ask is, I need to use his raster data in a secondary process that needs a local copy of the file.   2) I am primarily interested in allowing users the option of downloading orthoimagery and elevation from the USGS repository. I've tried using the Seamless viewer but I am thinking more along the lines of user specifying a coordinate (or four corner coords) and getting the orthoimage and elevation data corresponding to that. I thought WMS (Geoserver being my first option) is the way to go for this, but not certain. So wanted to get your advice.  Thanks in advance.  Sincerely, ST. I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine.  I tried using MySQL Administrator, but I got the following error:     The selected file was generated by   mysqldump and cannot be restored by   this application.   How do I get this working? I have a question that says "Show that there is a bounded sequence $x_n$ which is not convergent but has the property that $x_n - x_{n+1} \to 0$ as $n \to 0$.  What does this mean? Do I need to come up with an example or does the problem actually want me to prove such proposition?  By the way, I see that this sequence looks like Cauchy because of $x_n - x_{n+1} \to 0$ as $n \to 0$, but it is obviously not. If you could travel to the center of the Earth (or any planet), would you be weightless there? If electrons were positive and protons were negative, would life be different? This was a question on a worksheet during my first week in a class on Electromagnetism. The answer is essentially:     No. Life would be no different if electrons were positively charged and protons were negatively charged. Opposite charges would still attract, and like charges would still repel. The designation of charges as positive and negative is merely a definition.   But how would we have negative charges within the nucleus? Taking a look at the , it seems that down quarks are required in this new "negative proton" to help with creating the pion to "transmit a residual part of the strong force even between colorless hadrons".  I tried to set out and try to find a particle with (-1) charge with a down quark (by going through this ) but all the particles are not stable with the exception of two unknown:   Bottom Xi Baryon Double Bottom Xi Baryon   Assuming one of the above are stable, could the strong force act between one of them and a neutron, implying its alright to have a negatively charged nucleus?  Edit: If it wasn't clear, my question concerned whether or not there existed stable baryons of $-1$ charge with down quarks that could "replace" the proton. Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on Flag pop-up hidden beneath answer box (and it's still transparent!) The flag window on (a comment to) the last question is hidden beneath the answer box, as shown in the following screenshot:    Linked: , which is currently  - this is not fixed for flags on comments! Assuming file2 already exists, the command   &gt; file1 &lt; file2 cat   appears to be copying the content of file2 to file1.  But I cannot understand this structure.  I understand that "Nothing" is being directed to file1 (creating or erasing its content). Then the content of file2 is being directed to file1.  Why is cat after file2? How does it know to cat file2 if the operands are not in the correct order? It is me who am to blame.    It is I who am to blame.      Which one is correct here? I am bewildered about these two sentences. How does PK know better than Jaggu? How do I install Ubuntu 16.04 from an SD card? Could someone explain how to install Ubuntu from an SD card? I don't have any CDs or USB sticks around. My current operating system is Windows 10 64 bit.