Sunday, 21 October 2012

Twiddle Factor in MATLAB



Just create a new file with extension .m and paste the code below in that .m file. Then Run it.


clear all;
clc;
N=input('enter the no. of points : ');
W=exp((-j*2*pi)/N);
K=2;
%VERIFICATION OF SYMETRY PROPERTY

deleting a row/data from a table in JAVA




import java.sql.*;
import java.util.*;
class delete
{
    public static void main(String[] argv)
    {
        try
        {
            Scanner sc=new Scanner(System.in);
            String roll;
         
         
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String database="jdbc:odbc:eceDSN";
            Connection con=DriverManager.getConnection(database,"","");
            System.out.println("DATABASE OF ECE is Connected");
            System.out.println("Enter The Roll No");

            roll=sc.nextLine();
            PreparedStatement ps=con.prepareStatement("delete from ECE where roll=?");
            ps.setString(1,roll);
         
            //create a statement object
            //Statement st=con.createStatement();
            //Execute the statement
            int result=ps.executeUpdate();
            if(result==1)
            {
                System.out.println("Record is Deleted Successfully");
            }
            con.close();
        }
        catch(Exception err)
        {
            System.out.println(err.getMessage());
        }
    //loading all the driver to the memory

    }
}

updating a table's data in JAVA



import java.sql.*;
import java.util.*;
class update
{
    public static void main(String[] argv)
    {
        try
        {
            Scanner sc=new Scanner(System.in);
            int a, result, tot,phno;
            String dob, roll;
         
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

insertion program of data in JAVA



class insert
{
    public static void main(String[] argv)
    {
        try
        {
            Scanner sc=new Scanner(System.in);
            String name,roll,dob;
            int tot;
         
         
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

creating of a table in JAVA



import java.sql.*;
import java.util.*;
class Student
{

    public  static void main(String[] argv)
    {
        try
        {
            Scanner sc=new Scanner(System.in);
            String roll,name,dob;
             int tot,phno;

Queue Reader Program



/* * queue_reader.c - a program that reads messages with a given identifier * off of a message queue. */
#include <stdio.h>        /* standard I/O functions. */
#include <stdlib.h>       /* malloc(), free() etc. */
#include <unistd.h>        /* sleep(), etc. */
#include <sys/types.h>    /* various type definitions. */
#include <sys/ipc.h>      /* general SysV IPC structures */
#include <sys/msg.h>      /* message queue functions and structs.*/

Queue Sender Program



/* * queue_sender.c - a program that reads messages with one of 3 identifiers * to a message queue. */
#include <stdio.h> /* standard I/O functions. */
#include <stdlib.h> /* malloc(), free() etc. */
#include <sys/types.h> /* various type definitions. */
#include <sys/ipc.h> /* general SysV IPC structures */
#include <sys/msg.h> /* message queue functions and structs. */

Tech N Science © 2013