I have records of data with many columns. One of the columns being date &amp; time. Check the sanpshot for view. Now I want to run a query to display data from particular date to particular date. I am writing following code in php but it doesn't work and actually query doesn't work. Second condition in code when nothing is coming in POST works but not vice versa.    $d1=date("d/m/Y", strtotime($_POST['frm'])); $d2=date("d/m/Y", strtotime($_POST['to'])); $query;  if(empty($_POST['frm'])){     if(empty($_POST['to'])){         $query = mysql_query("select * from ordermng where status = '$xno' ", $link);    }       }       else{     $query = mysql_query("select * from ordermng where (status = '$xno') between date  = '$d1%' and date = '$d2%' ", $link); }
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?
How to put a full stop at the bottom, not mid-line, after an aligned matrix? Cannot see Samba configuration tool in the Dash in ubuntu 14.04 After a fresh installation of ubuntu 14.04 (my previous installation has seen to be broken somewhere reading .wmv file with VLC), I've installed Samba GUI tool from the software center.  It briefly appears in the launchpad then disappears. From this time I cannot the see in in the dash.  I've found this in askUbuntu   but the command sudo apt-get install samba samba-common gives me nothing to install.  Lecture des listes de paquets... Fait Construction de l'arbre des dépendances        Lecture des informations d'état... Fait samba est déjà la plus récente version disponible. samba passé en « installé manuellement ». samba-common est déjà la plus récente version disponible. Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :   kde-l10n-engb kde-l10n-fr Veuillez utiliser « apt-get autoremove » pour les supprimer. 0 mis à jour, 0 nouvellement installés, 0 à enlever et 8 non mis à jour.   The following guide  has no result either.  Any idea ?  Laurent06000 In the following code, I need to use +/- where I have used it, and plus/minus where I have used it.  \documentclass{amsart} \usepackage{lipsum} \usepackage{calc} \parindent=0 pt \parskip=12 pt plus 0 pt minus 0 pt \def\headsep{25pt} \newcommand{\LAYOUT}[5]{%   \setlength{\hoffset}{0pt}   \setlength{\voffset}{0pt}   \setlength{\topmargin}{#1 - 1in - \voffset - \headheight - \headsep}    \setlength{\oddsidemargin}{#2 - 1in - \hoffset}   \setlength{\evensidemargin}{\oddsidemargin}   \setlength{\textheight}{#3}   \setlength{\textwidth}{#4}   \setlength{\marginparwidth}{#5} } \newcommand{\FULLPAGE}{\LAYOUT{1in}{1in}{9in}{6.5in}{0.75in}}  \FULLPAGE \begin{document} \lipsum[1-10] \end{document}   If I replace the plus and minus in line 5 with + and - I get an enigmatic  "missing begin{document}" error.    If I replace the minus's in lines 10-11 with "-" I get an equally enigmatic error:  "Missing number, treated as zero. Illegal unit of measure (pt inserted)."   Can somebody please explain when one can use +/- and when one can use plus/minus?  Presumably there's a good reason why latex's error messages are so completely mystifying, and why inconsistencies like these keep appearing? It's really hard to explain to my coauthors, who regularly complain that latex is the most infuriating program ever devised by mankind.  Thanks very much for any advice!   Leo Why does Skynet take prisoners? In the Terminator franchise, extermination camps are often mentioned. But from a machine-logic POV, wouldn't it make more sense to just kill all humans on sight, period? Or herd them into small areas and nuke them? (even today's military electronics are hardened against EMPs and Skynet wouldn't care about the environment.)   IIRC, the reasoning behind ghettoization / concentration camps / extermination camps / gas "showers" is to misdirect or mislead people both inside and outside the country as to what was really going on. But Skynet doesn't have to worry about bad publicity, and can manufacture all the free labor it needs. Is there any in-universe explanation for keeping large groups prisoners? Change Data Type Varchar To Varbinary(max) In SQL Server I am looking for a good source on group theory aimed at physicists. I'd prefer one with a good general introduction to group theory, not just focusing on Lie groups or crystal groups but one that covers "all" the basics, and then, in addition, talks about the specific subjects of group theory relevant to physicists, i.e. also some stuff on representations etc.  Is Wigner's text a good way to start? I guess it's a "classic", but I fear that its notation might be a bit outdated? Prove $R < ( 1 + (\sum |a_{i}|^{p} )^{q/p})^{1/q}$ for absolute value of polynomial zeros C# Lambda expressions: Why should I use them? How to best determine if a bike will fit without riding it How to know if other threads have finished? How do I enable the "partner" repository? I keep seeing places refer to the "partner" repository as a place I can get software, how can I enable this repository? Please specify how to do this graphically and via command line. Obtaining remote host name in bash script Sorry my knowledge of Linux bash commands is pretty basic, I've been searching for a while but I'm not 100% sure what I need to search for.  I was wondering if there's a way to grab the current logged in users remote host name in a Linux bash script? I have a script in which I need to log each time a user runs it. I'm obtaining the date like so:  cdat=`/bin/date +%a' '%d' '%h' '%Y', '%H':'%M`;   I now need to add the users remote host (not the username they logged in with). I'm not 100% sure I'm using the right terminology here either, just to clarify; by 'remote host name' I mean the same output that prints on the screen on most servers I've logged into over ssh, for example:  Last login: Mon Jul 22 16:35:09 2013 from win7-i7-stuart.my.domain.com   I'm looking for the win7-i7-stuart.my.domain.com bit. What's the recommended way to move a VirtualBox VM to another computer? I use VirtualBox 4.1.x on my Ubuntu machine and I’ve set up several virtual machines. Since there are several ways one can move a virtual machine in VirtualBox to another computer, I was wondering which one is the recommended way:   Use the “Import/Export utility.” Copy the entire virtual machine folder, containing the .vdi and .vbox files. Clone the VDI using “Virtual Media Manager” and then recreate a VM on the target machine but using the cloned VDI as the hard disk.   I have successfully used the 1st method several times and it has always worked. The problem is that after exporting and importing, the disk image is transformed into VMDK and not VDI anymore!  The 2nd method is probably the easiest but I’m not sure that simply copying the files will work or not on the target machine. When searching about this method, I found some people had problems in which they had to edit the VirtualBox.xml file to solve it!  At last, there’s the 3rd method, but it requires the extra work of creating a VM similar to the original VM configuration, which is not desirable.  It’s clear from the above explanation that my desired method is the 2nd one, but I need expert advice on this if it works or not. I don't want any XML editing getting in my way!  What’s the best method of safely transferring my VM’s to another computer with VirtualBox? Ubuntu 17.10 Upgrade Broke VMWare Workstation 12.5 Hi after upgrading to Ubuntu 17.10, vmware is now not starting.    I get the message:    /usr/lib/vmware/bin/vmware-modconfig: Relink `/lib/x86_64-linux-gnu/libbsd.so.0' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'   I am aware that there are patches available and I am attempting to apply these and recompile. I have run from the solution at :    cd ~   #Copy the vmmon source tar ball to your temporary location cp /usr/lib/vmware/modules/source/vmmon.tar .    #Extract the tar ball tar xf vmmon.tar    #Download the modified file that mkubecek posted and overwrite the one from the tar ball for VMware Workstation 12.5: wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/b50848c985f1a6c0a341187346d77f0119d0a835/vmmon-only/linux/hostif.c     #Wrap up the newly modified files into a tar ball replacing the original one sudo tar cf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only    #Rebuild the VMware kernel modules sudo vmware-modconfig --console --install-all   Failed to get gcc information.  gcc --version gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0 ...   Unforunately, vmware-modconfig is failing because of a dependency it seems on a particular gcc version. Am I on the right track? Any help with this issue would be much appreciated.  EDIT Thank you Steve, the below has gotten vmware going again. I've included minor correction. Tested and confirmed I could run a virtual machine.   sudo su    # do all below as root cd /usr/lib/vmware/modules/source tar xvf vmmon.tar  tar xvf vmnet.tar wget -O ./vmmon-only/linux/hostif.c https://raw.githubusercontent.com/mkubecek/vmware-host-modules/b50848c985f1a6c0a341187346d77f0119d0a835/vmmon-only/linux/hostif.c vim vmnet-only/bridge.c cd vmmon-only/ make cd ../vmnet-only/ make cd .. mkdir /lib/modules/4.13.0-16-generic/misc cp *.o /lib/modules/4.13.0-16-generic/misc insmod /lib/modules/4.13.0-16-generic/misc/vmmon.o insmod /lib/modules/4.13.0-16-generic/misc/vmnet.o rm /usr/lib/vmware/lib/libz.so.1/libz.so.1 ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1 vmware-networks --start exit  # run vmware as normal user /usr/lib/vmware/bin/vmware C++ copy-construct construct-and-assign question I'm trying to understand Python's approach to variable scope. In this example, why is f() able to alter the value of x, as perceived within main(), but not the value of n?  def f(n, x):     n = 2     x.append(4)     print('In f():', n, x)  def main():     n = 1     x = [0,1,2,3]     print('Before:', n, x)     f(n, x)     print('After: ', n, x)  main()   Output:  Before: 1 [0, 1, 2, 3] In f(): 2 [0, 1, 2, 3, 4] After:  1 [0, 1, 2, 3, 4] Is diamagnetism a static or dynamic effect? When we put a diamagnetic material in the presence of an external magnetic field $\vec B_0$, the magnetic field inside the material decreases to $$\vec B=(1+\chi_m)\vec B_0,$$ where the magnetic susceptibility $\chi_m$ is a small negative number. I am assuming the material is linear and isotropic.  On the other hand the diamagnetism is explained in terms of Lenz law. When we change the magnetic flux of the external field over the material, atomic currents generate an induced magnetic field trying to restore the flux. But then the induced field could have any sign (in the appropriated direction), depending if we are increasing or decreasing the flux of the external field. It seems diamagnetism is a dynamic effect. How come the sign of $\chi_m$ is always negative? Moreover, the magnitude of $\chi_m$ should depend on how large is the variation of the flux but I do not see any suggestion of this when looking at tables of $\chi_m$. Infinite Series: Fibonacci/ $2^n$ I presented the following problem to some of my students recently (from Senior Mathematical Challenge- edited by Gardiner)  In the Fibonacci sequence $1, 1, 2, 3, 5, 8, 13, 21, 34, 55,\ldots$ each term after the first two is the sum of the two previous terms. What is the sum to infinity of the series: $$\frac{1}{2} + \frac{1}{4}+ \frac{2}{8} + \frac{3}{16} + \frac{5}{32} +\frac{8}{64} + \frac{13}{128} +\frac{21}{256} +\frac{34}{512}+ \frac{55}{1024} + \cdots$$  Now, I solved this using an infinite geometric matrix series (incorporating the matrix version of the relation $a_n= \frac{a_{n-1}}{2}+ \frac{a_{n-2}}{4}$), and my students, after much hinting on my part, googled the necessary string to stumble across Binet's formula (which allows one to split the series into two simple, if rather messy, geometrics). Both of these are good methods, but neither really seems plausible for a challenge set for 15-18 year olds under exam conditions. So how is one supposed to do it? Lazy Method for Reading Big File in Python? I have a very big file 4GB and when I try to read it my computer hangs. So I want to read it piece by piece and after processing each piece store the processed piece into another file and read next piece.  Is there any method to yield these pieces ?  I would love to have a lazy method. MT7610U - Unable to install wifi driver