Sunday, April 26, 2009

How to dump sql data base into a file

Here are the steps to dump sql data base into a .sql file
1. Go to the bin folder of the mysql, which might be (C:/xampp/mysql/bin if you are using xampp)
2. Type the following command mysqldump -u root -p --database name of the database > file to ouput.sql

Thursday, April 23, 2009

How to use MySQL command line in XAMPP

Here are the step by step procedure to use MySQL Command line in XAMPP

Before doing this make sure that mysql is installed on computer and its running successfully.
1. Go to start menu -> Run -> then type cmd to open command line
2. Go to the home directory of XAMPP (type cd C:\xampp in command line)
3. Go to the mysql bin directory (type cd mysql\bin in command line)
4. Now type mysql.exe --user=root --password = password (if you have changed the password)
5. Type mysql.exe --user=root --password = (if you didn't change the password)
6. If you properly do all the above steps then you will get mysql> in command line
7. Now go ahead with all your data base related quires to interact with your mysql server

Tuesday, July 22, 2008

C program to find Ugly numbers

Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...

shows the first 11 ugly numbers. By convention, 1 is included.

Here is the program to find nth Ugly number



main()
{
int i, j, n, count = 0;
printf("Enter which ugly number you want\n");
scanf("%d", &n);
int b[n];
for(i = 1; count < n; i++)
{
j = i;
while(j % 2 == 0)
{
j = j / 2;
}
while(j % 3 == 0)
{
j = j /3;
}
while(j % 5 == 0)
{
j = j / 5;
}
if(j == 1)
{
b[count] = i;
count++;
}
}
printf("nth ugly number is %d", b[n-1]);
getch();
}

Thursday, July 17, 2008

Get rid of connection timedout error (110) with yum in fedora 9

To get rid of this error first check yum.conf, where your internet connection details have been set. Suppose if u r using proxy then edit yum.conf and add below line.
http_proxy="http://Proxy IP:port number

But you should be a root user to edit the file yum.conf

Then save it. Now, you don't have the problem sated above.

Saturday, April 12, 2008

How to troubleshoot 500 internal sever while running perl scripts

I wasted my time in solving 500 internal server error in Apache. I don't know why it was happening. Finally I recovered from this error. What I did is just i changed the first line in the script to
#!/perl/bin/perl -w

Thursday, March 27, 2008

How to increase the Memory for JVM

Some times in your java programming the memory for JVM should be increased to avoid 'out of memory error'.

To do that we should specify the minimum and maximum memory for JVM by using the following command.

1. Go to Start button--> run command--> type cmd
2. Enter the path of the program to run
3. Give the command: java -Xms64m -Xmx256m classname of your program

In the above command -Xms is the minimum memory and -Xmx is the maximum memory. 64m is 64MB and 256m is 256MB.

By default the memory occupied by JVM is 64MB