Thursday 15 November 2012

Hack for Browser Compatibility in IE 6+



How many times you might have come across a situation where your web-page looks cluttered in different versions of IE(I am strictly speaking about IE here). Creating a Bank's Application have always made me go through legacy code and compatibility for the applications in IE.


There is something called as the Document mode in Browsers, and this is what handles the rendering of CSS and HTML.

There are 2 majorly known Document modes a Web Browser supports

1) Standard -pages are rendered according to the HTML and CSS specifications,
2) Quirks -pages rendered as If to made to emulate the behavior of older browsers.


If you force the document mode to Quirks mode, web-pages will have the same look and feel in all the IE6+ versions.

Add the following piece of code for specifying the DOCTYPE to your web-page will make it render in Standard mode , and if you do not specify any DOC-TYPE(a bad practice ) it will render in Quirks mode.

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">




One Exception to this is IE 6+Quirks mode in any version of IE will also be triggered if anything precedes the DOCTYPE. For example, if a hypertext document contains a comment, space or any tag before the DOCTYPE declaration, IE will use quirks mode:

<!-- This comment will put IE 6, 7, 8, and 9 in quirks mode -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">




Happy developing for legacy systems.

Sunday 8 January 2012

Install MySQL 6.0 on Windows 7

Download the copy of mysql from here. and store in on your Hard Drive.

1.       1.Double click on the setup file.


2. Click on Next

3.       3.Choose from the options available,for basic stuff select  “Typical” click on Next.


4.   The screen shows the Installation Path, and the Data Folder path. The Data Folder path is a usually a Hidden folder that contans the User’s details and access details to the Root user account in a .ini file. Click on Install.

5.Click on Next.

6.Click on Next.



7.You can uncheck the second option by now, if you are in hurry.

8.This will open the MySQL Server Instance Configuration Wizard.Click on Next.


9.Check on the Standard Configuration,Detailed Configurations has options for  Optimal use of Memory by MySQL Server.


10.Installing MySQL as a Windows service is recommended for Windows 7.And if you want to run the SQL commands via Command Prompt,Check the second option to Include the Bin Directory in WINDOWS PATH .Click on Next.


11.Enter ROOT password of your choice and click on next.

12.If you are installing MySQL for the first time, it will not ask for your current root  password.
 Whenever you uninstall MySQL from your machine, the.ini  file present in the hidden folder C:\ProgramData\MySQL  as discussed in the step 4 is not deleted,so the next time you repair/re-install MySQL  it will ask you for the current root password. If you do not remember the root password,simply delete the MySQL folder from  C:\ProgramData\MySQL, before starting the installation. 

13.Click on Execute Button.

 
14.Click on finish.That’s it!!! You have sucessfully Installed MySQL. To start writing you own DB programs, Go to START>>All Programs>>MySQL>>MySQL Command Line Client.

15. Enter the root password you have set during installation and press Enter .

16.You need to select a particular DB Name for use.

mysql DB is already created for you. Type  use mysql;
Bonjour Start firing your SQL Queries.

17. To create you new Database instance, write create database “databasename”;.



18.To Change your command line point to your newly created Database, type use databasename;.