Thursday 26 July 2012

SIMPLE TCP ECHO CLIENT PROGRAM USING LINUX SOCKET



/*CLIENT PROGRAM OF ECHO SERVER CLIENT*/
/*save this code
  as file name:echo_client.c
COMPILE:-
cc echo_client.c -o echo_client.out
RUN:-
./echo_client.out
OR RUN BY PROVIDING SERVER ADDRESS AND PORT NUMBER
./echo_client.out <server_address>  <portnumber>
example:- 
./echo_client.out 192.168.0.1 1024
NOTE:
SERVER PROGRAM MUST RUN BEFORE CLIENT PROGRAM
 */
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<string.h>
#include<netinet/in.h>
#include<sys/socket.h>
#define SERV_ADDR "127.0.0.1"
#define PORT_NO 2048
int main(int argc,char *argv[])
{
        int ser_sd;
        int buf_len;
        char buffer[256]={0};
        int port;
        struct sockaddr_in server_info;

        /* CREATION OF A SOCKET FOR CONNECTION TO SERVER*/
        ser_sd=socket(PF_INET,SOCK_STREAM,0);
        if(ser_sd==-1)
        {
                perror("socket():");
                exit(EXIT_FAILURE);
        }
        /*PREPARE SERVER INFORMATION TO sockaddr_in STRUCTURE*/
        /////////////as garbage can make  problems//////////
        bzero(&server_info,sizeof(struct sockaddr_in));
        server_info.sin_family=PF_INET;
        printf("argc=%d\n",argc);
        if(argc==3)
        {
                port=atoi(argv[2]);
                server_info.sin_port=htons(port);
                server_info.sin_addr.s_addr=inet_addr(argv[1]);
        }
        else
        {
                server_info.sin_port=htons(PORT_NO);
                server_info.sin_addr.s_addr=inet_addr(SERV_ADDR);
        }
        /*NOW SERVER STRUCTURE READY FOR USE TO CONNECT SERVER*/
        /*CONNECT FUNCTION FOR CONNECT TO SERVER USING SERVER INFO
          PRESENT IN THE server_info STRUCTURE*/
        if(connect(ser_sd,(struct sockaddr *)&server_info,sizeof(server_info)))
        {
                perror("connect: ");
                exit(EXIT_FAILURE);
        }
        printf("conection sucess\n");
        /*CONNECTION TO SERVER SUCESS NOW WE ARE READY TO PASS MESSAGE*/
        /*IT IS VERY SIMPLE YOU CAN USE SIMPLE READ WRITE FUNCTION
          AS IT IS A REGULAR FILE DESCRIPTOR*/
        while(1)
        {
                bzero(buffer,sizeof(buffer));/*FOR CLEARING THE PREVIOUS CONTENT*/
                scanf(" %[^\n]s",buffer); /*ACCEPTING A MESSAGE FROM KEY BOARD FOR 
                                            SEND*/
                write(ser_sd,buffer,255); /*use for writing to server*/
                if(!(strcmp(buffer,"EXIT")))
                {break;
                }
                buf_len=read(ser_sd,buffer,255);  /*reading echo message from server*/
                buffer[buf_len]='\0';
                printf("%s\n",buffer);
        }
        /*CLOSING OF SERVER SOCKET DESCRIPTOR*/
        if(shutdown(ser_sd,SHUT_RDWR))
        {
                perror("shutdown:");
                exit(EXIT_FAILURE);
        }
        printf("socket is properly closed\n");
}

SIMPLE TCP ECHO SERVER PROGRAM USING LINUX SOCKET


/*SERVER PROGRAM OF ECHO SERVER*/
/*save this code
  as file name:echo_server.c
COMPILE:-
cc echo_server.c -o echo_server.out
RUN:-
./echo_server.out
 */
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/un.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<signal.h>
#define PORT_NO 2048
main(int argc,char *argv[])
{
        int cli_sd,accept_cli_sd;
        int buf_len,cli_info_len;
        char buffer[256]={0};
        int port=0;
        struct sockaddr_in server_info,client_info;
        /* CREATION OF A SOCKET FOR ACCEPT CONNECTION FROM A CLINT*/
        accept_cli_sd=socket(PF_INET,SOCK_STREAM,0);
        if(accept_cli_sd==-1)
        {
                perror("socket():");
                exit(EXIT_FAILURE);
        }
        /*PREPARE SERVER INFORMATION TO sockaddr_in STRUCTURE*/
        /////////////as garbage can make  problems//////////
        //memset(&server_info,0,sizeof(struct sockaddr_un));
        server_info.sin_family=PF_INET;
        printf("argc=%d\n",argc);
        if(argc==2)
        {
                port=atoi(argv[1]);
                server_info.sin_port=htons(port);
        }
        else
        {
                server_info.sin_port=htons(PORT_NO);
        }
        server_info.sin_addr.s_addr=inet_addr("0.0.0.0");
        /* PREPARE SERVER TO ACCEPT CLINT BY ADDING SERVER PROPERTY
           TO ACCEPT_CLIENT SOCKET DESCRIPTOR*/
        if(bind(accept_cli_sd,(struct sockaddr *)&server_info,sizeof(struct sockaddr_un)))
        {
                perror("bind:");
                exit(EXIT_FAILURE);
        }
        /*DEFINIG THE QUEUE SIZE OF NEW CLINT REQUEST ON ACCEPT_CLINT SOCKET DESCRIPTOR*/
        listen(accept_cli_sd,3);
        /*NOW SERVER READY TO ACCEPT CLINT IN ACCEPT_CLLIENT SOCKET DESCRIPTOR*/
        /*SERVER USE ACCEPT() FUNCTION FOR ACCEPT CLINT REQUEST*/
        cli_info_len=sizeof(client_info);
        cli_sd=accept(accept_cli_sd,(struct sockaddr *)&client_info,&cli_info_len);
        if(cli_sd==-1)
        {
                perror("accept:");
                exit(EXIT_FAILURE);
        }
        printf("server listen to a clint::%s\n",(char*)inet_ntoa(client_info.sin_addr.s_addr));
        /*SERVER NOW READY TO SERVE A CLINT USING CLIENT_SOCKET DESCRIPTOR*/
        while(1)
        {
                bzero(buffer,sizeof(buffer));
                buf_len=read(cli_sd,buffer,255);
                buffer[buf_len]='\0';
                if(!(strcmp(buffer,"EXIT"))||(buf_len==0))
                {
                        break;
                }
                printf("%s\n",buffer);
                buf_len=write(cli_sd,buffer,255);
        }
        /*CLOSING OF CLIENT SOCKET DESCRIPTOR*/
        if(shutdown(cli_sd,SHUT_RDWR))
        {
                perror("shutdown:");
                exit(EXIT_FAILURE);
        }
        /*CLOSING OF ACCEPT_CLIENT SOCKET DESCRIPTOR*/
        if(shutdown(accept_cli_sd,SHUT_RDWR))
        {
                perror("shutdown:");
                exit(EXIT_FAILURE);
        }
        printf("socket descriptor properly closed\n");
        printf("server::Exiting\n");
}

Wednesday 25 July 2012

STACK IMPLEMENTED USING LINKED LIST


/*STACK IMPLEMENTATION USING LINKED LIST*/
/**header files for predefined function prototypes**/
#include<stdio.h>  /*FOR STANDARD INPUT OUTPUT i.e for printf,scanf*/
#include<stdlib.h>  /*FOR STANDARD LIBRARY FUNCTIONS I.E exit() */

/*macros for easy modification*/
#define MAX_STACK 10
#define INVALID -1

/*single element of stack represented by a NODE of list*/
typedef struct node
{
        int data;
        struct node *link;
}NODE;

/*function prototypes*/

void PUSH(NODE *,int);
int POP(NODE *);
int PICK(NODE);
void PRINT(NODE);
void INIT_STACK(NODE *);

/*main program for control the flow of execution*/
int main(int argc,char *argv[])
{
        int choice,n;
        NODE tos;          /*tos is the node which always point to
                             top of the stack*/
        INIT_STACK(&tos);
        while(1)/*infanite loop for menu driven program*/
        {
                choice=menu();
                switch(choice)
                {
                        case 1:printf("\nEnter an integer to push in to stack::");
                               scanf("%d",&n);
                               PUSH(&tos,n);
                               break;
                        case 2:n=POP(&tos);
                               if(n!=INVALID)
                                       printf("\n%d is popped from stack\n",n);
                               break;
                        case 3:n=PICK(tos);
                               if(n!=INVALID)
                                       printf("\n%d is present at the top of stack\n",n);
                               break;
                        case 4:PRINT(tos);break;
                        case 5:printf("\nTHANKYOU......\n");
                               exit(0);break;
                        default:printf("\nINVALID CHOICE.TRY AGAIN.....\n");break;
                }/*switch ends*/
        }/*while loop ends*/
}/*main() ends*/


/*menu function for displaying menu   **
 ** prototype:-                        **
 ** int menu(void);                    **
 ** return an integer according to user**
 ** choice. 
 */
int menu()
{
        int n;
        printf("\n::::::::::::MENU:::::::::::::\n");
        printf("1.PUSH\n2.POP\n3.PICK\n4.PRINT\n5.EXIT");
        printf("\nEnter your choice: ");
        scanf("%d",&n);
        return n;
}/*menu() ends*/
/* this function initialise the stack for further operation on it
   proto type
   void INIT(NODE *ATOS);
 */
void INIT_STACK(NODE *atos)
{
        (atos)->data=0;
        (atos)->link=NULL;
}/* INIT() ends*/

/*
   This function perform PUSH operation on stack
   prototype
   void PUSH(NODE *ATOS,int ele);
   perform push of data ele on to the stack
 */

void PUSH(NODE *atos,int ele)
{
        NODE *new;
        if((atos)->data>=MAX_STACK)
        {
                printf("\nSTACK IS ALREADY FULL\n");
                return;
        }
        else
        {
                (atos)->data+=1;
                new=malloc(sizeof(NODE));
                new->data=ele;
                new->link=atos->link;
                atos->link=new;
        }
}/*PUSH() ends*/
/*
   This function perform POP operation on stack
   prototype
   int POP(NODE *ATOS);
   perform pop of data ele from the stack
   it return an integer from top of stack and remove it from stack
 */
int POP(NODE *atos)
{
        NODE *temp;
        int n;
        if((atos)->data==0)
        {
                printf("\nSTACK IS EMPTY\n");
                return INVALID;
        }
        else
        {
                temp=(atos)->link;
                (atos)->link=temp->link;
                (atos)->data-=1;
                n=temp->data;
                free(temp);
                return n;
        }

}/*POP() ends*/
/*
   This function perform PICK operation on stack
   prototype
   int PICK(NODE TOS);
   perform pick of data ele from the stack
   it return an integer from top of stack but not remove it from stack
 */
int PICK(NODE tos)
{
        if(tos.data==0)
        {
                printf("\nSTACK IS EMPTY\n");
                return INVALID;
        }
        else
        {
                return (tos.link->data);
        }
}/*PICK() ends*/
/* this function print the hole stack
   we use this for verification of stack operation
prototype:-
void PRINT(NODE TOS);
 */
void PRINT(NODE tos)
{
        NODE *temp;
        printf("\n::::::::::STACK:::::::::\n");
        if(tos.data==0)
        {
                printf("\nSTACK IS EMPTY\n");
                return;
        }
        else
        {
                temp=tos.link;
                while(temp)
                {
                        printf("%d\n",temp->data);
                        temp=temp->link;
                }
        }
}/*PRINT() ends*/

Tuesday 24 July 2012

WHAT IS A STACK?

A stack is a last in- first out (LIFO) abstract data type and linear data structure.
It is small data structure having only two fundamental operation only.
--------------------------------------------------------------------------------------------------------------------------------------
Those fundamental operations are:-
--------------------------------------------------------------------------------------------------------------------------------------
a.push (insert an element in top of stack)
b.pop  (remove an element from top of stack)
--------------------------------------------------------------------------------------------------------------------------------------
And some other extra functions understanding
--------------------------------------------------------------------------------------------------------------------------------------
c.printing (printing of all element present in stack)
d.pick       (getting the element at top of stack but do not remove)


It follow some rules:-
 rule1:
   Data element can be inserted at the top of the stack.
 rule2:
  Data element can be deleted/remove from the top of the stack.




LINKS
------------------------------------------------------------------------------------------------------------------------------------
1.WIKI for STACK
2.STACK IMPLEMENTED USING ARRAY IN C
3.STACK IMPLEMENTED USING LINKED LIST IN C
4.WIKI BOOK FOR STACK
5. ADT FOR STACK IMPLEMENTATION

STACK IMPLEMENTED USING ARRAY IN C


/*This is a menu driven program which use an array of integer as a STACK*/

/*Header files for prototype of standard library function*/
#include<stdio.h>/*for standarad input and out put opereation*/
#include<stdlib.h>/*for standard C library support exit function */

/*Macros for Easy Modification*/

#define MAX_STACK 10
#define INVALID -1
/*global variables for stack*/

int tos;/*top of the stack*/
int bos;/*bottom of the stack*/

/*proto type for designed functions*/
void PUSH(int *,int);
int POP(int *);
int PICK(int *);
void PRINT(int *);
void INIT_STACK(void);

/*main program which control all the operation*/
int main(int argc,char *argv[])
{/*main starts*/
        int STACK[MAX_STACK];
        int choice,n;
        INIT_STACK();
        while(1) /*infanite loop for menu driven program*/
        {
                choice=menu();
                switch(choice)
                {
                        case 1:printf("\nEnter an integer to push in to stack::");
                               scanf("%d",&n);
                               PUSH(STACK,n);
                               break;
                        case 2:n=POP(STACK);
                               if(n!=INVALID)
                                       printf("\n%d is popped from stack\n",n);
                               break;
                        case 3:n=PICK(STACK);
                               if(n!=INVALID)
                                       printf("\n%d is present at the top of stack\n",n);
                               break;
                        case 4:PRINT(STACK);break;
                        case 5:printf("\nTHANKYOU......\n");
                               exit(0);break;
                        default:printf("\nINVALID CHOICE.TRY AGAIN.....\n");break;
                }/*switch case ends*/
        }/*while loop ends*/
}/*main ends*/
/*menu function for displaying menu   **
 ** prototype:-                        **
 ** int menu(void);                    **
 ** return an integer according to user**
 ** choice.                            */
int menu()
{
        int n;
        printf("\n::::::::::::MENU:::::::::::::\n");
        printf("1.PUSH\n2.POP\n3.PICK\n4.PRINT\n5.EXIT");
        printf("\nEnter your choice: ");
        scanf("%d",&n);
        return n;
}/*menu() ends*/

/* this function initialise the stack for further operation on it
   proto type
   void INIT(void);
 */

void INIT_STACK(void)
{
        tos=-1;
        bos=-1;
}/*INIT() ends*/

/*
   This function perform PUSH operation on stack
   prototype
   void PUSH(int *stack,int ele);
   perform push of data ele on to the stack
 */
void PUSH(int STACK[],int ele)
{
        if(tos>=MAX_STACK-1)
        {
                printf("\nSTACK IS ALREADY FULL\n");
                return;
        }
        else
        {
                ++tos;
                STACK[tos]=ele;
        }
}/* PUSH() ends*/
/*
   This function perform POP operation on stack
   prototype
   int POP(int *stack);
   perform pop of data ele from the stack
   it return an integer from top of stack and remove it from stack
 */
int POP(int STACK[])
{
        int n=INVALID;
        if(tos<0)
        {
                printf("\nSTACK ALREADY EMPTY\n");
                return n;
        }
        n=STACK[tos];
        STACK[tos]=INVALID;
        --tos;
        return n;
}/*POP() ends*/
/*
   This function perform PICK operation on stack
   prototype
   int PICK(int *stack);
   perform pick of data ele from the stack
   it return an integer from top of stack but not remove it from stack
 */
int PICK(int STACK[])
{
        int n=INVALID;
        if(tos<0)
        {
                printf("\nSTACK ALREADY EMPTY\n");
                return n;
        }
        n=STACK[tos];

        return n;
}/*PICK() ends*/
/* this function print the hole stack
   we use this for verification of stack operation
prototype:-
void PRINT(int *stack);
 */
void PRINT(int STACK[])
{
        int i;
        printf("\n::::::::STACK::::::::\n");
        if(tos<0)
        {
                printf("STACK IS EMPTY\n");
                return;
        }
        for(i=tos;i>=0;i--)
        {
                printf("%d\n",STACK[i]);
        }
}/*PRINT() ends*/

Monday 23 July 2012

C KEYWORDs


Keywords
All Keywords have Fixed meaning and these meanings cannot be changed. Keywords serves as basic building blocks for program statements. There are 32 key words according to ANSI C standard
Those are listed below:- 

-------------------------------------------------------------------------------------------------------------------------------------
auto                     double                          int                                struct
break                   else                              long                              switch
case                     enum                            register                        typedef
char                      extern                         return                           union
const                    float                             short                            unsigned
continue               for                               signed                           void
default                  goto                            sizeof                            volatile
do                         if                                 static                             while

------------------------------------------------------------------------------------------------------------------------------------
we are must be able to understand and use all these keywords in our program properly. 


C TOKENS


C TOKENS?
As in English Language,In a Passage of text,individual word and punctuation marks are called Tokens.

Similarly ,in a C Program the smallest individual units are known as C tokens. 
That is C tokens are similar to the words of a language. Using this words we can write our program/Instructions for computer.
C has six Type of Tokens as described below.

C Programs are written using these tokens and the syntax of the Language.

C TOKENS:-
2.Identifiers
3.Constants
4.Strings
5.Special Symbols
6.Operators 


links
-----------

Tuesday 17 July 2012

3G TECHNOLOGY


INTRODUCTION
International Mobile Telecommunications-2000 (IMT--2000), better known as 3G or 3rd Generation, is a generation of standards for mobile phones and mobile telecommunicationsservices fulfilling specifications by the International Telecommunication Union. Application services include wide-area wireless voice telephone, mobile Internet access, video calls and mobile TV, all in a mobile environment. Compared to the older 2G and 2.5Gstandards, a 3G system must allow simultaneous use of speech and data services, and provide peak data rates of at least 200 kbit/saccording to the IMT-2000 specification. Recent 3G releases, often denoted 3.5G and 3.75G, also provide mobile broadband access of several Mbit/s to laptop computers and smartphones


links
--------------
1.MORE ON 3G
2.3G TECHNOLOGY DISCUSSION
3.ITU WEB SITE FOR FURTHER REFERENCE
4.SEMINAR DOCUMENT 

WHERE DATA STRUCTURE USED?


WHERE DATA STRUCTURES USED?
Data structures are used in almost every program or software system. Data structures provide a means to manage huge amounts of data efficiently, such as large databases and internet indexing services. Usually, efficient data structures are a key to designing efficient algorithms.


EX.
1.NETWORKING (GRAPH)
2.STORING RECORD(ARRAY)
3.SEARCHING (TREE,HASH TABLE)

Like wise it used in a lot of Areas..

Examples of simple Data Structure.


Example of Data Structures.
1.Array
2.Linked list
3.tree
4.graph
5.dictionaries
6.stack and queues



links
-----------
list of data structures:
click here

WHICH BOOK TO FOLLOW FOR DATA STRUCTURE?

Now a days Online books are available at a free of cost.
one of the best free book is here.

You can follow These Books Also:-
1.Data Structures (Special Indian Edition) (Schaum’s Outline Series),Lipschutz&Pai
2.Data Structures Through C (With CD-ROM),Yashavant Kanetkar
3.Data Structures Through C In Depth,Srivastava S K
4.

Data Structures & Algorithms using C

 by R. S Salaria


What is Data Structure Means?

Data Structure is the Paticular way of storing and organising Data in computer So that it can be used efficiently.


Why Data Structure?
When a large no of data are need to be kept and processed by our Proram then for better organisation we use data structures for keeping Data.So that it can acess ,modify,search efficiently.

Data Structures Can be use for: maintain Vast Number of Datas,quick Searching of Data,Quick Inserting Data,Quick find and Modifying Data.


links
------------
1.MORE ON DATA STRUCTURE

SOME TERMS ASSOCIATED WITH PROGRAMMING


1.Source Code
2.Executable Code
3.Object Code
4.Interpreter
5.Complier
6.Assembler
7.Debugger


SOURCE CODE
1.Source code is written in high level language (I.e human Readable format) .which is easily understand by a programmer.
2.Source code can be easily modified as per requirement so portable as compared to executable code.
3.It almost same for different processors.

EXECUTABLE CODE
1.Executable code is in Low level language (I.e combination of only 0's and 1's).Which is processor dependent .It is different for different processors.
2.Modification and Maintenance of this code is very difficult some time not possible if backward compatibility is absent in successor processors.

OBJECT CODE
1.This codes are also Low level language but not directly run on a processor. They required some additional code to run on a processor (i.e startup code,initialization code..etc).
2.The additional codes are commonly known as supporting library code.

SOME NOTE REGARDING C PROGRAM


1.Every C program requires a main()function.(complier restrict us to use multiple main functions).
2.The main functions having a important roll ( the execution of program starts from here).
3.As C is a Structural language so every thing must be in a block. Out side block statements never executes. Execution of function/block starts with a opening curly brace and ends at corresponding ending curly brace.
4.all the words in a program line must be separated from each other by at least a space,or a tab,or a punctuation mark.
5.C programs are written in lowercase letter. But symbolic names and strings can be written in both case.
6.Every statement in C programs ends with semicolon.
7.all variables must be declared before their first use in the program.
8.Including of header file must be at the beginning of the program.
9.header files contain only declarations (does not contain any executable code).
10.comment lines are removed in preprocessor stage of compilation .So we can put a comment line almost every where.
11.line starting with #character are for preprocessor. Those lines are Processed in preprocessor stage of compilation.


links
-----------------------

Creating and Compiling a C program under linux?

Creating and Compiling a C program under linux?


1.In shell /terminal open vi editor for writing a c program source code for that
     user@ubuntu:~$ vi hello.c press enter
2. now vi editor is opened then press I button in your key board to enter in to insert mode of vi editor
    write your C code after writing your C code
    press Esc button
    for save and exit from vi editor press :wq from key board
3.now your source code is ready to be complie
4.use cc hello.c for complling the source code to get executable code
        user@ubuntu:~$ cc hello.c press enter
6.use ./a.out for run the executable file
        user@ubuntu:~$ ./a.out press enter



link
---------------------

WRITING FIRST C PROGRAM?


Hello world program
hello.c
--------------------------------------------------------------------
main()
{
printf(“Hello world!”);
}
-----------------------------------------------------------------------
1.main is the function/block where execution of program starts.
2.printfis used to display some message on standard output device(MONITOR).
3.Open Curly Brace for starting a function and Close Curly Brace for Ending of Function Block.
4.Semi colon used for ending a line/statement.  

for creating and compile your first program follow the steps :
Creating and Compiling a C program under linux?

HOW A SOURCE CODE TRANSLATED TO EXECUTABLE CODE ?


HOW A SOURCE CODE TRANSLATED TO EXECUTABLE CODE ?
We provide Source Code to the complier and it gives us Executable code .But this is not a single step operation .This follow some predefined steps to convert the Source Code to Executable Code.


1.Preprocessor
It is very useful part of the complier as it does lots of job before translated to machine code. It is a text processor which dose the below text editing operation
  • It removes the comment lines in source code which are written in the Source code for more readability/easy understanding .
  • It add the content of header files to the source code. Header files always contains function prototypes and declarations.(Header files never contain any executable code )
  • A very important property of Preprocessor is Conditional Compile. It is very required for scalable design. This property also remove the unnecessary burden from complier.
  • Macros are replaced by this preprocessor.
The final output of this stage is known as pure C code.
2.Translator
This part of complier is responsible for converting of pure C code to assembly language code.
Step by step mapping of C language code to assembly language code done here.
The prototypes of the functions and declarations are used by this part for translation of C code.
The out put of this stage known as assembly code.
3.Assembler
It generate Object code from assembly language code.It converts the assembly language codes to machine language code(i.e in 0's and 1's format).It is not directly run as we take the help of OS to execute our code in processor.
The out put of this stage known as object code.

4.Linker
It give the final executable code which is going to be run in our machine. The output of this stage is known as executable code. Which is a combination of object code and supporting files.
The supporting fies may be function definitions ,predefined library function definitions ...etc.   

UNDERSTAND YOUR COMPLIER


 UNDERSTAND YOUR COMPLIER
Complier is a nothing but a translator. Which take a C source code and translate that to a executable code.
Complier is also a software. It is already present in UNIX O S.
The name of the complier is gcc.

Complier follows some steps to produce Executable code from supplied Source code.
Those steps are listed below--
1.Preprocessor
2.Translator
3.Assembler
4.Linker


Every step is a independent module .And combination of these module in known as complier.


links
----------------
1.MORE ABOUT COMPILER
2.FURTHER DETAIL

Sunday 15 July 2012

WHAT IS A BIOS?

BIOS(Basic Input Output System)


1.Basic Input Output System (BIOS) is the first program which runs when we power on 
our personal computer. This is a small  program normally stored in a non-volatile 
memory(like ROM).

2.In earlier days BIOS softwares are loaded from a disk. But now a days ROM are 
already integrated to mother board and BIOS program are loaded to ROM .

3.This is a program which test all the peripherals and necessary condition so that 
OS can be loaded,this is known as power-on self-test.
Power-on self-test
The BIOS software is built into the PC, and is the first code run by a PC 
when powered on ('boot firmware'). When the PC starts up, the first job for 
the BIOS is the power-on self-test, which initializes and identifies system devices 
such as the CPU, RAM, video display card, keyboard and mouse, hard disk drive, 
optical disc drive and other hardware.
 
The BIOS then locates boot loader software(bootstrap) held on a peripheral device 
(designated as a 'boot device'), such as a hard disk or a CD/DVD, and loads 
and executes that software, giving it control of the PC 
 
LINKS
----------------------
1.MORE ON BIOS  

Saturday 14 July 2012

C language Introduction


C language Developer and Introduction:
Dennis Ritchie Developed the C language in 1970's at Bell laboratories. Initially it was designed for programming in the Operating System called UNIX. Now almost everything in entire UNIX Operating System and the tools supplied with it including the C complier itself are written in C language.

WHAT IS USER APPLICATION AND SYSTEM APPLICATION?

USER APPLICATION 
A program which is designed to help the user to perform a task.
Application software, also known as an application or an app, is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with documents. Apps may be bundled with the computer and its system software, or may be published separately. Some users are satisfied with the bundled apps and need never install one.



 System APPLICATION
System software is computer software designed to operate and control the computer hardware and to provide a platform for running application software.

links
1.More on User Application
2.More on System Application

 

WHAT IS HIGH LEVEL AND LOW LEVEL LANGUAGE?


HIGH LEVEL PROGRAMMING LANGUAGE
The programming language which is written in human readable language (I.e English like language)
which is easily understandable by the user is known as High level language. It is not understandable by processor and this must be translated to low level language to be run by a processor. So we can say that assembly instructions are also high level language (but little bit difficult to understand and also machine depended ).
Every data in this are some how more secure than in low level language.
LOW LEVEL PROGRAMMING LANGUAGE
The programming language which is written in machine code (I.e consist of only zeros and ones)
only. which is also not easily readable by its user but it the only language understandable by processor.
Machine code/mnemonics can be called as low level programming language.

Every Data in low level language are almost accessed at any where of program code. 

Why C?


C is a high level language. But some author say C is a middle level language. 
It has the simplicity of a high level language as well as the power of low level language(i.e In-line Assembly).
C can be used for both System Application as well as user Application development.

What is High Level and Low Level Language?
What is System Application and user Application?

WHAT IS A PROGRAMMING LANGUAGE AND WHY WE STUDY PROGRAMMING LANGUAGE?

A Programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.


 Programming language are used to write Programs which are going to run on a
computer to perform some specific task.So for making our own task run in a computer we must know programming language.

Example of Programming Languages
c,c++,java,php,c#,vb...etc.

Then why C? Why not c++,java,php..?


links
-----------------------
1.Programming language

WHAT IS C?

C is a Programming language.
Which language is used to instruct a computer to do some task for you.
So over all C is a language which is understandable by computer.If we want to develop some computer application we must know some programming language like C.

Then 1st question comes to our mind is what is a programming language and why i learn the programming language.

links
---------------
1.More about C

BLACK BOX IN AIRCRAFT


The Black Box


A black box in aircraft
Although they are called "black boxes," aviation recorders
are actually painted bright orange, are a group of data
collection devices mounted on the tail of an aircraft.
Dr. David Warren, a Australian aviation scientist
proposed a flight recording device and by 1958 he had
produced a prototype “ARL Flight Memory Unit”
  
Data from both the CVR and FDR is stored on stacked
memory boards inside the crash-survivable memory unit
(CSMU).
The black box is powered by one of two power generators
that draw their power from the plane's engines. One
generator is a 28-volt DC power source, and the other is a
115-volt, 400-hertz (Hz) AC power source


LINKS
----------------

DTH (Direct-To-Home ) Television


 DTH(DIRECT-TO-HOME)TELEVISION

DTH stands for Direct-To-Home television. DTH is defined as the reception of satellite programs with a personal dish in an individual home.DTH does away with the need for the local cable operator and puts the broadcaster directly in touch with the consumer. Only cable operators can receive satellite programs and they then distribute them to individual homes.  

How does DTH work?

A DTH network consists of a broadcasting center, satellites, encoders, multiplexers, modulators and DTH receivers.

A DTH service provider has to lease Ku-band transponders from
the satellite. The encoder converts the audio, video and data signals
into the digital format and the multiplexer mixes these signals. At
the user end, there will be a small dish antenna and set-top boxes to
decode and view numerous channels. On the user's end, receiving
dishes can be as small as 45 cm in diameter.

 DTH is an encrypted transmission that travels to the consumer directly through a satellite. DTH transmission is received directly by the consumer at his end through the small dish antenna. A set- top box, unlike the regular cable connection, decodes the encrypted transmission.


LINKS
-----------------------
   A power point presentation file for presenting seminar
  A more knowledge on DTH and Some basic Knowlegedges