Pages

Monday, June 20, 2011

Disabling directory listing in apache

Go to "X:\wamp\bin\apache\Apache2.2.11\conf" (X is the drive where you installed apache), Open httpd.conf in text editor, Search for line "Options Indexes FollowSymLinks", comment or delete this line and add this new line "Options FollowSymLinks". Save the file and restart the apache.

Thursday, April 28, 2011

Getting back from Linux Grub menu to Windows boot menu

Suppose you have installed Ubuntu after installing windows, now when you will reboot you system then at startup you will see Grub menu. Now say later on you delete the ubuntu partition or you format that ubuntu based partition & after that when you reboot you will find yourself stuck and will not be able to login inside windows, then may you will use windows installation disk and then try to repair the windows start up, but alas say it also didn't work. then in that case you have to open the cmd prompt from windows 7 installation disk and then type "bootrec /FixMbr". in win xp you have to directly type fixmbr. And after that restart system. Ta da now you can login to Windows 7 OS.

Tuesday, April 26, 2011

Import excel or csv sheet into mysql database

Please follow the following step to import in xslx file into database.

1. Open the excel sheet and save it as csv format (say you save the file as import.csv).
2. Open that file with notepad and check how the fileds are seprated, for example it may be seprated my ',' or ';' etc.
3. move that file into "C:\wamp\bin\mysql\mysql5.1.36\bin" directory.
4. open cmd and go to "C:\wamp\bin\mysql\mysql5.1.36\bin" directory.
5. create database and table in mysql.
(Suppose you created database "test" and table "test" and it have columns "sno" and "comment")
(Now you have to type this command to import into table).
6. LOAD DATA INFILE 'C:/wamp/bin/mysql/mysql5.1.36/bin/import.csv' into table test.test fields terminated by ',' lines terminated by '\r\n' (sno,comment);
7. Tada it's done :).

Reference : http://dev.mysql.com/doc/refman/5.0/en/load-data.html
http://blog.tjitjing.com/index.php/2008/02/import-excel-data-into-mysql-in-5-easy.html

Thursday, April 14, 2011

mysql_close() issue

Hi Folks,
In older version of PHP, that is before version of 5. There is a small bug in php. In mysql_close(), it's seems like it is mandatory to pass Mysql link as argument other wise you application will get crash without error. So you have to pass link parameter like mysql_close($link);

Thursday, March 24, 2011

See the future with the help of Data Mining

What is data mining ?

Data mining is a process in which we extract some useful information from dataware house, process that data, find some pattern in that data, to assimilate it.

I'll try to give the most simple example of data mining, Actually we already did the data mining thing in our college and school days, and most of the engineers has clear there examination because of data mining.

Well, remember in our final examination day, when we don't have the time to study all the topics in detail what we do ?

We do data mining. First we collect all the question paper of last five or six years. then we select the questions which has been repeated more frequently ( in my case, i prefer at least more than 3 times). than in that selected question, we process it and try to analyze it. and than after analysis we try to find out patterns in that selected question, like which type of question has been repeated more time and it is coming from which section. after seeing all the patterns, we conclude that, which topic is more important, and in which topic examiner is more interested.

In same manner most of the business entities try to find out there answers to question like :
"Which clients are most likely to respond to my next promotional mailing, and why?"

Saturday, March 19, 2011

Unblocking Localhost in Quick Heal Firewall Pro

I'm Using Quick Heal Firewall pro. After installing wamp, i entered the URL "http://localhost" in explorer but it was giving me error "Unable to connect". First i was wondering that may be i need to change the port number coz it is possible some other application is running on the default port 80. So i changed the port no. for apache to 81, but no success. Then i thought firewall may be blocking the ip. so i added the ip in exclusion, but alas that also didn't work. Later on after playing with Quick Heal Firewall Pro setting came to know that in Settings -> LAN Setting I've to add the localhost ip address as "Trusted". And then voilĂ , localhost page was running, :).

Friday, March 4, 2011

getElementsByClassName


I came to know that IE does not support getElementsByClassName property of Javascript document object. I put around 12 hours on this to find.

I was writing a javascript for username and password textfield in which if onfocus value = "username" then insert "blank" value and onblur if textfield == "" then insert defaultvalue.

for that thing i was fetching the value with the help of property getElementsByClassName, it was working fine on firefox and other browser excepty IE. which was giving me error that "Object doesn't support this property" on google came to know that it doesn't support this property. then i approach jquery to solve this problem.

My html was like :


And the jquery which i write is like :

$(document).ready(function(){
$("input.name1").focus(function(){
if ($(this).val() == "username") {
$(this).val('');
}

});

$("input.name1").blur(function(){
if ($(this).val() == "") {

$(this).val('username');
}
});

});


May be this code is not very efficient. But i write it, whichever things came to my mind at that time. :)