Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

02 May 2014

Trick to shorten MySQL error message

The steps provided here are only for Linux, If you are using some other OS then use respective editor and commands.
MySQL stores error message file at /usr/share/mysql/english/errmsg.sys where english is the language you want to use.
Note:You need to have super user privileges
Step 1. Take backup of existing errmsg.sys (so that you can revert if some problem occured
$sudo cp /usr/share/mysql/english/errmsg.sys ~/errmsg.sys.bkp
Step 2. Open /usr/share/mysql/english/errmsg.sys in vi editor.
$sudo vi /usr/share/mysql/english/errmsg.sys
Step 3. Search for "You have an" in errmsg.sys
in vi editor for searching try this way-->  /You have an [press enter]
It will get you to the string "You have an error...." as show in screen-shot 

Step 4. Edit that error message as per your need. I've deleted string You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the and kept just right syntax to use
Refer below screen-shot. 

Step 5. Save and Exit.
in vi editor to save and exit-->   :x! [press enter]     here ! is added to override read-only file
Step 6. Restart mysql service.
$sudo mysql restart
step 7. check error message (I'm checking in phpMyAdmin)

29 May 2013

Download VTU MCA 10MCA47 Web Programming Laboratory All Programms

Hello friends,

Today I'm sharing all LAB Programs of Web Programming,

Following is the list of all problems:
1. Develop and demonstrate a XHTML file that includes Javascript script for the following problems:
a) Input: A number n obtained using prompt
Output: The first n Fibonacci numbers

b) Input: A number n obtained using prompt
Output: A table of numbers from 1 to n and their squares using alert

2. a) Develop and demonstrate, using Javascript script, a XHTML document that collects the USN ( the valid format is: A digit from 1 to 4 followed by two upper-case characters followed by two digits followed by two upper-case characters followed by three digits; no embedded spaces allowed) of the user. Event handler must be included for the form element that collects this information to validate the input. Messages in the alert windows must be produced when errors are detected.

b) Modify the above program to get the current semester also (restricted to be a number from 1 to 8)

3. a) Develop and demonstrate, using Javascript script, a XHTML document that contains three short paragraphs of text, stacked on top of each other, with only enough of each showing so that the mouse cursor can be placed over some part of them. When the cursor is placed over the exposed part of any
paragraph, it should rise to the top to become completely visible.

b) Modify the above document so that when a paragraph is moved from the top stacking position, it returns to its original position rather than to the bottom.

4. a) Design an XML document to store information about a student in an engineering college affiliated to VTU. The information must include USN, Name, Name of the College, Brach, Year of Joining, and e-mail id. Make up sample data for 3 students. Create a CSS style sheet and use it to display the document.

b) Create an XSLT style sheet for one student element of the above document and use it to create a display of that element.

5. a) Write a Perl program to display various Server informations like Server Name, Server Software, Server protocol, CGI Revision etc.

b) Write a Perl program to accept UNIX command from a HTML form and to display the output of the command executed.

6. a) Write a Perl program to accept the User Name and display a greeting message randomly chosen from a list of 4 greeting messages.

b) Write a Perl program to keep track of the number of visitors visiting the web page and to display this count of visitors, with proper headings.

7. Write a Perl program to display a digital clock which displays the current time of the server.

8. Write a Perl program to insert name and age information entered by the user into a table created using MySQL and to display the current contents of this table.

9. Write a PHP program to store current date-time in a COOKIE and display the ‘Last visited on’ date-time on the web page upon reopening of the same page.

10. Write a PHP program to read student data from an XML file and store into the MYSQL database. Retrieve and display.

11. Create a XHTML form with Name, Address Line 1, Address Line 2, and E-mail text fields. On submitting, store the values in MySQL table. Retrieve and display the data based on Name.

12. Build a Rails application to accept book information viz. Accession number, title, authors, edition and publisher from a web page and store the information in a database and to search for a book with the title specified by the user and to display the search results with proper headings
Click to DOWNLOAD

13 December 2012

Download JAVA The Complete Reference - 7th edition by Herbert Schildt

Hello friends,
Here is the link to download e-book of "JAVA The Complete Reference - 7th" edition by Herbert Schildt

06 December 2012

How java is platform independent?

In the classic sense of software development, programs are coded in higher level languages such as C/C++, then that source code needs to be compiled into native machine language specific to that platform so that the program is made executable. Java compiler on the other hand does not compile Java source files into native machine language, instead it compiles the source code into bytecodes. These bytecodes are platform independant i.e. in other words specific to to the Java Virtual Machine specification. This enables platform independant compilation. When the bytecode compiled programs are executed thru the Java interpeter, it converts those bytecodes into native machine code and executes them thru the JVM which is specific to host environment it is running on. This enables platform specific execution.


After compiling the ".java" file ,that will be converting into the ".class" file,which is a byte code having the capability run on any OS.Basing on the concept byte code java achieving the platform independent,it leads to "Write onece run anyware".

15 November 2011

C Programm: Perform multiplication of two matrices using dynamic Array.



#include
#include
//function prototypes
void print_mat(int**,int,int);
void mul(int**,int**,int**,int,int,int,int);
void main()
{
    //double pointer for two dimentional array
    int **a,**b,**c,r1,c1,r2,c2,i,j,k,sum;
    clrscr();
    printf("Enter Matrix A information:\n");
    printf("Row 1:");
    scanf("%d",&r1);
    printf("Column 1:");
    scanf("%d",&c1);
    printf("Enter Matrix B information:\n");
    printf("Row 2:");
    scanf("%d",&r2);
    printf("Column 2:");
    scanf("%d",&c2);
    if(c1!=r2)
    {
        printf("Multiplication can not performed.");
        getch();
        return;
    }
    //memory allocation
    a=(int **)malloc(sizeof(int*)*r1);
    b=(int **)malloc(sizeof(int*)*r2);
    c=(int **)malloc(sizeof(int*)*r1);//r1xc2
    for(i=0;i
    {
        a[i]=(int *)malloc(sizeof(int)*c1);
        c[i]=(int *)malloc(sizeof(int)*c2);
    }
    for(i=0;i
    {
        b[i]=(int *)malloc(sizeof(int)*c2);
    }
    //http://kvGroup4all.blogspot.com
    for(i=0;i
    {
        for(j=0;j
        {
            printf("Enter A[%d][%d]=",i,j);
            scanf("%d",&a[i][j]);
        }
    }
    for(i=0;i
    {
        for(j=0;j
        {
            printf("Enter B[%d][%d]=",i,j);
            scanf("%d",&b[i][j]);
        }
    }
    //function calling
    mul(a,b,c,r1,c1,r2,c2);
    printf("Matrix A:\n");
    print_mat(a,r1,c1);
    printf("\nMatrix B:\n");
    print_mat(b,r2,c2);
    //printing answer
    printf("Matrix C:\n");
    print_mat(c,r1,c2);
    getch();
}
//http://kvGroup4all.blogspot.com
void print_mat(int **a,int r,int c)
{
    int i,j;
    for(i=0;i
    {
        for(j=0;j
        {
            printf("%d\t",a[i][j]);
        }
        printf("\n");
    }
}
//user defined function for multiplication
void mul(int **a,int **b,int **c,int r1,int c1,int r2,int c2)
{
    int i,j,k,sum;
    for(i=0;i
    {
        for(j=0;j
        {
            sum=0;
            for(k=0;k
            {
                  sum+=a[i][k]*b[k][j];
            }
            c[i][j]=sum;
        }
    }
}
//http://kvGroup4all.blogspot.com

Popular Posts