Saturday, August 1, 2015

Copy MySQL data from one machine to another


  • Go to the source machine. Dump the database to a file.
      $ mysqldump -u <user-name> -p <database-name> > src-file
  • Login to the destination machine and copy the file over.
      $ scp <remote-location-of-src-file> dest-file
  • (Optional) If we only want to import incremental data, edit the file and remove all the statements of DROP/CREATE TABLE, and change the INSERT statements to INSERT IGNORE.
  • Import the data to the destination database.
      $ mysql -u <user-name> -p <database-name> < dest-file

Sunday, July 12, 2015

IE Compatibility


Different versions of IEs render web pages differently. That causes headache for web developers. Microsoft provides a compatibility solution for the old web sites. Since IE 8, the Internet Explorer browsers start to handle the X-UA-Compatible Meta Tag or HTTP response header. The web server can send it to tell the IE to render the web document in an older IE mode.

This link gives a detailed description of X-UA-Compatible: https://msdn.microsoft.com/en-us/library/ff955275%28v=vs.85%29.aspx

The values of X-UA-Compatible are:
  • IE=5
  • IE=7
  • IE=8
  • IE=9
  • IE=10
  • IE=11
  • IE=edge
  • IE=EmulateIE7
  • IE=EmulateIE8
  • IE=EmulateIE9
  • IE=EmulateIE10
  • IE=EmulateIE11
The difference between IE=7 and IE=EmulateIE7 is that IE=EmulateIE7 wil determine whether to use IE7 mode or IE5 (Quirks) mode by the !DOCTYPE declaration.

This link explains the !DOCTYPE declaration and the IE modes: https://msdn.microsoft.com/en-us/library/ff955379%28v=vs.85%29.aspx

IE also provides a Compatibility View List that an end user can manually add a site to make it be rendered as EmulateIE7. Users can also control to display all local intranet sites or even all web sites in EmulateIE7 mode. (https://msdn.microsoft.com/en-us/library/ff955410%28v=vs.85%29.aspx)

Another very good article about this topic: https://sharovatov.wordpress.com/2009/05/18/ie8-rendering-modes-theory-and-practice/.



Wednesday, June 24, 2015

Prevent TortoiseCVS from converting LF to CRLF in checkout


If you have used a UNIX-like CVS client to check in a file, and the file has CRLF at the end of each line -- that means the file is in DOS format, when you check out the file with TortoiseCVS, the file will have CRCRLF at the end of each line.

That is because when TortoiseCVS checks out the file, it converts LF to CRLF for each line by default.

We can make TortoiseCVS stop this behavior by using an option during the checkout:
  • On an Windows Explorer, right click and choose menu CVS Checkout...
  • The TortoiseCVS - Checkout Module dialog is shown.
  • Select the Options tab on the dialog.
  • At the bottom, check the Use UNIX line endings checkbox.
  • Continue the checkout process and the files will be checked out without the LF to CRLF conversion.
 
Get This <