Wednesday, November 23, 2011

HTML TAG LIST


HTML Tags Chart
To use any of the following HTML tags, simply select the HTML code you'd like and copy and paste it into your web page.
Tag
Name
Code Example
Browser View
<!--comment<!--This can be viewed in the HTML part of a document-->Nothing will show (Tip)
<a -anchor<a href="http://www.domain.com/">
Visit Our Site</a>
http://abhi-computers.blogspot.com/ (Tip)
<b>bold<b>Example</b>Example
<big>big (text)<big>Example</big>Example (Tip)
<body>body of HTML document<body>The content of your HTML page</body>Contents of your web page (Tip)
<br>line breakThe contents of your page<br>The contents of your pageThe contents of your web page
The contents of your web page
<center>center<center>This will center your contents</center>
This will center your contents
<dd>definition description<dl>
<dt>Definition Term</dt>
<dd>Definition of the term</dd>
<dt>Definition Term</dt>
<dd>Definition of the term</dd>
</dl>

Definition Term
Definition of the term
Definition Term
Definition of the term
<dl>definition list<dl>
<dt>Definition Term</dt>
<dd>Definition of the term</dd>
<dt>Definition Term</dt>
<dd>Definition of the term</dd>
</dl>

Definition Term
Definition of the term
Definition Term
Definition of the term
<dt>definition term<dl>
<dt>Definition Term</dt>
<dd>Definition of the term</dd>
<dt>Definition Term</dt>
<dd>Definition of the term</dd>
</dl>

Definition Term
Definition of the term
Definition Term
Definition of the term
<em>emphasisThis is an <em>Example</em> of using the emphasis tagThis is an Example of using the emphasis tag
<embed>embed object<embed src="yourfile.mid" width="100%" height="60" align="center">
(Tip)
<embed>embed object<embed src="yourfile.mid" autostart="true" hidden="false" loop="false">
<noembed><bgsound src="yourfile.mid" loop="1"></noembed>


Music will begin playing when your page is loaded and will only play one time. A control panel will be displayed to enable your visitors to stop the music.
<font>font<font face="Times New Roman">Example</font>Example (Tip)
<font>font<font face="Times New Roman" size="4">Example</font>Example (Tip)
<font>font<font face="Times New Roman" size="+3" color="#ff0000">Example</font>Example (Tip)
<form>form<form action="mailto:you@yourdomain.com">
Name: <input name="Name" value="" size="10"><br>
Email: <input name="Email" value="" size="10"><br>
<center><input type="submit"></center>
</form>
Name:  (Tip)
Email: 
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
heading 1
heading 2
heading 3
heading 4
heading 5
heading 6
<h1>Heading 1 Example</h1>
<h2>Heading 2 Example</h2>
<h3>Heading 3 Example</h3>
<h4>Heading 4 Example</h4>
<h5>Heading 5 Example</h5>
<h6>Heading 6 Example</h6>

<head>heading of HTML document<head>Contains elements describing the document</head>Nothing will show
<hr>horizontal rule<hr />
Contents of your web page (Tip)

Contents of your web page
<hr>horizontal rule<hr width="50%" size="3" />Contents of your web page

Contents of your web page
<hr>horizontal rule<hr width="50%" size="3" noshade />Contents of your web page

Contents of your web page
<hr>
(Internet
Explorer)
horizontal rule<hr width="75%" color="#ff0000" size="4" />Contents of your web page

Contents of your web page
<hr>
(Internet
Explorer)
horizontal rule<hr width="25%" color="#6699ff" size="6" />Contents of your web page

Contents of your web page
<html>hypertext markup language<html><head>
<meta>
<title>Title of your web page</title>
</head>
<body>HTML web page contents
</body>
</html>
Contents of your web page
<i>italic<i>Example</i>Example
<img>image<img src="Earth.gif" width="41" height="41" border="0" alt="text describing the image" />a sentence about your site (Tip)
<input>input fieldExample 1:

<form method=post action="/cgi-bin/example.cgi">
<input type="text" size="10" maxlength="30">
<input type="Submit" value="Submit">
</form>
Example 1: (Tip)

 
<input>
(Internet Explorer)
input fieldExample 2:

<form method=post action="/cgi-bin/example.cgi">
<input type="text" style="color: #ffffff; font-family: Verdana; font-weight: bold; font-size: 12px; background-color: #72a4d2;" size="10" maxlength="30">
<input type="Submit" value="Submit">
</form>
Example 2: (Tip)

 
<input>input fieldExample 3:

<form method=post action="/cgi-bin/example.cgi">
<table border="0" cellspacing="0" cellpadding="2"><tr><td bgcolor="#8463ff"><input type="text" size="10" maxlength="30"></td><td bgcolor="#8463ff" valign="Middle"> <input type="image" name="submit" src="yourimage.gif"></td></tr> </table>
</form>
Example 3: (Tip)

<input>input fieldExample 4:

<form method=post action="/cgi-bin/example.cgi">
Enter Your Comments:<br>
<textarea wrap="virtual" name="Comments" rows=3 cols=20 maxlength=100></textarea><br>
<input type="Submit" value="Submit">
<input type="Reset" value="Clear">
</form>
Example 4: (Tip)


 
<input>input fieldExample 5:

<form method=post action="/cgi-bin/example.cgi">
<center>
Select an option:
<select>
<option >option 1</option>
<option selected>option 2</option>
<option>option 3</option>
<option>option 4</option>
<option>option 5</option>
<option>option 6</option>
</select><br>
<input type="Submit" value="Submit"></center>
</form>
Example 5: Tip)

Select an option: 
<input>input fieldExample 6:

<form method=post action="/cgi-bin/example.cgi">
Select an option:<br>
<input type="radio" name="option"> Option 1
<input type="radio" name="option" checked> Option 2
<input type="radio" name="option"> Option 3
<br>
<br>
Select an option:<br>
<input type="checkbox" name="selection"> Selection 1
<input type="checkbox" name="selection" checked> Selection 2
<input type="checkbox" name="selection"> Selection 3
<input type="Submit" value="Submit">
</form>
Example 6: (Tip)

Select an option:
 Option 1
 Option 2
 Option 3

Select an option:
 Selection 1
 Selection 2
 Selection 3
<li>list itemExample 1:

<menu>
<li type="disc">List item 1</li>
<li type="circle">List item 2</li>
<li type="square">List item 3</li>
</MENU>

Example 2:

<ol type="i">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>
Example 1: (Tip)
  • List item 1
  • List item 2
  • List item 3

Example 2:
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
<link>link<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<marquee>
(Internet
Explorer)
scrolling text<marquee bgcolor="#cccccc" loop="-1" scrollamount="2" width="100%">Example Marquee</marquee>Example Marquee(Tip)
<menu>menu<menu>
<li type="disc">List item 1</li>
<li type="circle">List item 2</li>
<li type="square">List item 3</li>
</menu>
  • List item 1
  • List item 2
  • List item 3
<meta>meta<meta name="Description" content="Description of your site">
<meta name="keywords" content="keywords describing your site">
Nothing will show (Tip)
<meta>meta<meta HTTP-EQUIV="Refresh" CONTENT="4;URL=http://www.yourdomain.com/">Nothing will show (Tip)
<meta>meta<meta http-equiv="Pragma" content="no-cache">Nothing will show (Tip)
<meta>meta<meta name="rating" content="General">Nothing will show (Tip)
<meta>meta<meta name="robots" content="all">Nothing will show (Tip)
<meta>meta<meta name="robots" content="noindex,follow">Nothing will show (Tip)
<ol>ordered listNumbered

<ol>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Numbered Special Start

<ol start="5">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Lowercase Letters<ol type="a">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Capital Letters

<ol type="A">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Capital Letters Special Start

<ol type="A" start="3">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Lowercase Roman Numerals

<ol type="i">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Capital Roman Numerals

<ol type="I">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>

Capital Roman Numerals Special Start
<ol type="I" start="7">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
<li>List item 4</li>
</ol>
Numbered
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Numbered Special Start
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Lowercase Letters
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Capital Letters
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Capital Letters Special Start
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Lowercase Roman Numerals
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Capital Roman Numerals
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
Capital Roman Numerals Special Start
  1. List item 1
  2. List item 2
  3. List item 3
  4. List item 4
<option>listbox option<form method=post action="/cgi-bin/example.cgi">
<center>
Select an option:
<select>
<option>option 1</option>
<option selected>option 2</option>
<option>option 3</option>
<option>option 4</option>
<option>option 5</option>
<option>option 6</option>
</select><br>
</center>
</form>
Select an option: (Tip)
<p>paragraphThis is an example displaying the use of the paragraph tag. <p> This will create a line break and a space between lines.

Attributes:

<p align="left">
Example 1:<br />
<br />
This is an example<br>
displaying the use<br>
of the paragraph tag.</p>
<p align="right">
Example 2:<br>
<br>
This is an example<br>
displaying the use<br>
of the paragraph tag.</p>
<p align="center">
Example 3:<br>
<br>
This is an example<br>
displaying the use<br>
of the paragraph tag.</p>
This is an example displaying the use of the paragraph tag.
This will create a line break and a space between lines.

Attributes:
Example 1:

This is an example
displaying the use
of the paragraph tag.
Example 2:

This is an example
displaying the use
of the paragraph tag.
Example 3:

This is an example
displaying the use
of the paragraph tag.
<small>small (text)<small>Example</small>Example (Tip)
<strike>deleted text<strike>Example</strike>Example
<strong>strong emphasis<strong>Example</strong>Example
<table>tableExample 1:

<table border="4" cellpadding="2" cellspacing="2" width="100%">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</table>

Example 2: (Internet Explorer)

<table border="2" bordercolor="#336699" cellpadding="2" cellspacing="2" width="100%">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</table>

Example 3:

<table cellpadding="2" cellspacing="2" width="100%">
<tr>
<td bgcolor="#cccccc">Column 1</td>
<td bgcolor="#cccccc">Column 2</td>
</tr>
<tr>
<td>Row 2</td>
<td>Row 2</td>
</tr>
</table>
Example 1: (Tip)
Column 1Column 2

Example 2: (Tip)
Column 1Column 2

Example 3: (Tip)
Column 1Column 2
Row 2Row 2
<td>table data<table border="2" cellpadding="2" cellspacing="2" width="100%">
<tr>
<td>Column 1</td>
<td>Column 2</td>

</tr>
</table>

Column 1Column 2
<th>table header<div align="center">
<table>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>

</tr>
<tr>
<td>Row 2</td>
<td>Row 2</td>
<td>Row 2</td>
</tr>
<tr>
<td>Row 3</td>
<td>Row 3</td>
<td>Row 3</td>
</tr>
<tr>
<td>Row 4</td>
<td>Row 4</td>
<td>Row 4</td>
</tr>
</table>
</div>
Column 1Column 2Column 3
Row 2Row 2Row 2
Row 3Row 3Row 3
Row 4Row 4Row 4
<title>document title<title>Title of your HTML page</title>Title of your web page will be viewable in the title bar. (Tip)
<tr>table row<table border="2" cellpadding="2" cellspacing="2" width="100%">
<tr>
<td>Column 1</td>
<td>Column 2</td>
</tr>
</table>

Column 1Column 2
<tt>teletype<tt>Example</tt>Example
<u>underline<u>Example</u>Example
<ul>unordered listExample 1:<br>
<br>
<ul>
<li>List item 1</li>
<li>List item 2</li>
</ul>
<br>
Example 2:<br>
<ul type="disc">
<li>List item 1</li>
<li>List item 2</li>
<ul type="circle">
<li>List item 3</li>
<li>List item 4</li>
</ul>
</ul>
Example 1:

  • List item 1
  • List item 2

Example 2:
  • List item 1
  • List item 2
    • List item 3
    • List item 4

Wednesday, April 6, 2011

SLIDING WINDOW PROTOCOL


sliding window protocol is a feature of packet-based data transmission protocols. Sliding window protocols are used where reliable in-order delivery of packets is required, such as in the Data Link Layer (OSI model) as well as in the Transmission Control Protocol (TCP).
Conceptually, each portion of the transmission (packets in most data link layers, but bytes in TCP) is assigned a unique consecutive sequence number, and the receiver uses the numbers to place received packets in the correct order, discarding duplicate packets and identifying missing ones. The problem with this is that there is no limit of the size of the sequence numbers that can be required.
By placing limits on the number of packets that can be transmitted or received at any given time, a sliding window protocol allows an unlimited number of packets to be communicated using fixed-size sequence numbers.
For the highest possible throughput, it is important that the transmitter is not forced to stop sending by the sliding window protocol earlier than one round-trip delay time (RTT). The limit on the amount of data that it can send before stopping to wait for an acknowledgment should be larger than the bandwidth-delay product of the communications link. If it is not, the protocol will limit the effective bandwidth of the link.

DOMAIN NAME SERVER OR SYSTEM (DNS)


  • Short for Domain Name System (or Service or Server), an Internet service that translates domain names into IP addresses. Because domain names are alphabetic, they're easier to remember. The Internet however, is really based on IP addresses. Every time you use a domain name, therefore, a DNS service must translate the name into the corresponding IP address. For example, the domain name www.example.com might translate to 198.105.232.4.
  • The DNS system is, in fact, its own network. If one DNS server doesn't know how to translate a      particular domain name, it asks another one, and so on, until the correct IP address is returned.
  • Short for digital nervous system, a term coined by Bill Gates to describe a network of personal computers that make it easier to obtain and understand information.

INTERNET

The Internet, sometimes called simply "the Net," is a worldwide system of computer networks - a network of networks in which users at any one computer can, if they have permission, get information from any other computer (and sometimes talk directly to users at other computers). It was conceived by the Advanced Research Projects Agency (ARPA) of the U.S. government in 1969 and was first known as the ARPANET. The original aim was to create a network that would allow users of a research computer at one university to be able to "talk to" research computers at other universities. A side benefit of ARPANet's design was that, because messages could be routed or rerouted in more than one direction, the network could continue to function even if parts of it were destroyed in the event of a military attack or other disaster.

INTRANET


Intranet is the generic term for a 
collection of private computer networks 
within an organization. An intranet uses 
network technologies as a tool to 
facilitate communication between people 
or workgroups to improve the data 
sharing capability and overall knowledge 
base of an organization's employees.

WWW

A technical definition of the World Wide Web is: all the resources and users on the Internet that are using the Hypertext Transfer Protocol (HTTP).
A broader definition comes from the organization that Web inventor Tim Berners-Lee helped found, the World Wide Web Consortium (w3c):
"The World Wide Web is the universe of network-accessible information, an embodiment of human knowledge."

Friday, April 1, 2011

LEXICAL ANALYSER


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
main()
{
char buff[30],c,ch;
char key[5][10]={"int\0","char\0","float\0","main\0"};
FILE *fp;
int i,j,k,l,m;
clrscr();
fp=fopen("add.c","r");
while(1)
{
ch=fgetc(fp);
c=ch;
if(c==EOF)
break;
if(c=='+'||c=='-'||c=='*'||c=='/')
{
buff[0]=c;
c=fgetc(fp);
if(c=='+'||c=='-'||c=='=')
printf ("%c%c\t is operator\n",buff[0],c);
else
{
printf("%c is operator\n",buff[0]);
fseek(fp,0,-1);
}
}
else if(c=='=')
{
buff[0]=c;
c=fgetc(fp);
if(c=='=')
printf("%c%c\t is comparision\n",buff[0],c);
else
{
printf("%c is assignment\n",buff[0]);
fseek(fp,0,-1);
}
}
else if(isdigit(c))
{
i=0;
buff[i]=c;
c=fgetc(fp);
while (isdigit(c))
{
i++;
buff[i]=c;
c=fgetc(fp);
}
for(k=0;k<=i;k++)
{
printf("%c",buff[k]);
}
printf("\t is number\n");
fseek(fp,0,-1);
}
else if(isalnum(c))
{
m=0;
i=0;
do
{
buff[i]=c;
c=fgetc(fp);
i++;
}while(isalnum(c));
buff[i]='\0';
for(j=0;j<4;j++)
{
if(strcmp(buff,key[j])==0)
{
m=1;
printf(" %s is key word\n",buff);
break;
}
}
if(strcmp(buff,key[j])!=0)
{
printf(" %s is a identifier\n",buff);
}
fseek(fp,0,-1);
}
}
fclose(fp);
getch();
}


RECURSIVE PARSING


#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
char input[10];
int i=0;
void t();
void eprime();
void f();
void tprime();
void e()
{
if(input[i+1]=='+')
eprime();
else if(input[i+1]=='*')
{
t();
e();
}
else if(input[i]=='\0')
printf("string not accepted");

else
{
f();
e();
}
}
void t()
{
if(input[i+1]=='*')
tprime();
else if(input[i]=='\0')
printf("string not accepted");
else
f();
}
void f()
{
if(input[i]=='(')
{
i++;
e();
}
else if(input[i]==')' && input[i+1]=='\0')
printf("string is accepted");
else if(input[i]=='I')
{
i++;
if(input[i]=='\0'||input[i]==')')
{
printf("string is accepted");
exit(0);
}
}
}
void eprime()
{
f();
i++;
e();
}
void tprime()
{
f();
i++;
e();
}
main()
{
clrscr();
printf("enter the string replacing id with I\n");
scanf(" %s",input);
e();
getch();
}

3ADDRESS CODE


#include<stdio.h>
#include<ctype.h>
main()
{
char expr[20],stack[20];
int i,top=0,k=0,num[20];
printf("enter the postfix expression\n");
scanf("%s",&expr);
for(i=0;expr[i]!='\0';i++)
if(isalnum(expr[i]))
stack[top++]=expr[i];
else
{
printf("T%d=",k);
if(stack[top-2]=='T')
printf("%c%d",stack[top-2],num[top-2]);
else
printf("%c",stack[top-2]);
printf("%c",expr[i]);
if(stack[top-1]=='T')
printf("%c%d",stack[top-1],num[top-1]);
else
printf("%c",stack[top-1]);
printf("\n");
top=top-2;
stack[top]='T';
num[top++]=k++;
}
}

Friday, March 4, 2011

CYCLIC REDUNDANCY CHECK PROGRAM


#include<iostream.h>
#include<conio.h>
#include<stdio.h>
int main() //int avgc,char *avgv[];
{
int val1[20],val2[20],val3[20],val4[20];
int x,i,j,n,m,a,s;
clrscr();
cout<<"enter no .of generating fu.bits";
cin>>n;
cout<<"\n";
cout<<" enter gen.fu";
cout<<"\n ";
for (i=0;i<n;i++)
{
cin>>val1[i];
}
cout<<"gen.fu";
cout<<"\n";
for(i=0;i<n;i++)
{
cout<<val1[i];
}
cout<<"\n";
cout<<" enter no .of bits of polynomial";
cout<<"\n";
cin>>n;
cout<<"enter polynomial ";
cout<<"\n";
for(i=0;i<m;i++)
{
cin>>val2[i];
val4[i]=val2[i];
}
cout<<"\n";
cout<<" polynomial";
cout<<"n";
for(i=0;i<m;i++)
{
cout<<val2[i];
}
cout<<"\n";
cout<<"\n";
for(i=m;i<m+n-1;i++)
{
val2[i]=0;
}
cout<<"\n";
cout<<"appened polynomial i";
for(i=0;i<m+n-1;i++)
{
cout<<val2[i];
}
a=m+(n-1);
for(i=0;i<m;i++)
{
if(val2[i]==0)
{
for(i=1;j<n+i;++j)
val2[j]=val2[j]^0;
}
else
{
val2[i]=val2[i]^val2[0];
val2[i+1]=val2[i+1]^val1[1];
val2[i+2]=val2[i+2]^val1[2];
val2[i+3]=val2[i+3]   ^val1[3];
}
}
cout<<"\n \t the crc is !";
for(i=m;i<a;++i)
cout<<val2[i];
for(i=m,j=m;j<a,i<m+n-1;j++,i++)
{
val4[i]=val2[j];
}
cout<<"crc matrix is :";
cout<<"\n";
for(i=0;i<m;i++)
{
if(val4[i]==0)
{
for(j=i;j<n+i;++j)
val4[j]=val4[i]^val1[0];
val4[i+1]=val4[i+1]^val1[1];
val4[i+2]=val4[i+2]^val1[2];
val4[i+3]=val4[i+3]^ val1[3];
}
}
cout<<"\n\t after error check is :";
for(i=m;i<a;i++)
{
cout<< val4[i];
}
cin>>x;
return 0;
}

CHARACTER STUFFING PROGRAM


#include<stdio.h>
#include<conio.h>
#include<string.h>
void start();
void end(char);
FILE *of;
FILE *cf;
int b,i=0;
char c,a='@',z='$',d[25];
void main()
{
clrscr();
cf=fopen("andy.txt","r");
of=fopen("ani.txt","w");
do
{
c=getc(cf);
d[i++]=c;
}while(c!=EOF);
fprintf(of,"%c",a);
for(i=0;i<strlen(d);i++)
{
if(d[i]==' '||d[i]=='\t')
{
end(d[i]);
}
else if(d[i]=='\n')
{
start();
}
else if(d[i]==EOF)
{
fprintf(of,"%c",z);
}
else
{
fprintf(of,"%c",d[i]);
}
}
printf("file sucessfully stuffed");
fclose(cf);
fclose(of);
getch();
}
void start()
{
fprintf(of,"%c\n",z);
fprintf(of,"%c",a);
}
void end(char k)
{
fprintf(of,"%c",z);
fprintf(of,"%c",a);
fprintf(of,"%c",k);
fprintf(of,"%c",z);
fprintf(of,"%c",a);
}

ROUND ROBIN


#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,t=0,s=1;
int a,q,x,*b;
clrscr();
printf("enter number of processes");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("process %d",i);
scanf("%d",&b[i]);
}
printf("enter time quantum");
scanf("%d",&q);
x=0;
for(i=1;i<=n;i++)
  t=t+b[i];
printf("total time is = %d\n",t);
for(i=0;i<=n;i++)
{
for(a=1;a<=n;a++)
{
if(b[a]>0)
{
if(b[a]<q && b[a]>0)
   x=x+b[a];
else
   x=x+q;
printf("current program is p %d...%d \n",a,x);
b[a]=b[a]-q;
s++;
}
}
}
getch();
}

PRIORITY SCHEDULING PROGRAM


#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n,r,s,t,x,d=0,p[20],b[20],pr[20];
clrscr();
printf("enter the no. of process");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("enter burst time %d:",i);
scanf("%d",b[i]);
}
for(i=1;i<=n;i++)
{
printf("priority %d",i);
scanf("%d",pr[i]);
}
for(i=1;i<=n;i++)
{
for(j=i+1;j<=n;j++)
{
if(pr[i]>pr[j])
{
r=p[j];
s=b[j];
t=pr[j];
p[j]=p[i];
b[j]=b[i];
pr[j]=pr[i];
p[i]=r;
b[i]=s;
pr[i]=t;
}
}
}
for(i=1;i<=n;i++)
{
x=x+b[i];
printf("process %d interval is from %d to %d",p[i],d,x);
d=x;
}
getch();
}





Saturday, February 19, 2011

NETWORK CLASSIFICATION


The following list presents categories used for classifying networks.


Connection method

Computer networks can be classified according to the hardware and software technology that is used to interconnect the individual devices in the network, such as optical fiber, Ethernet,wireless LAN, HomePNA, power line communication or G.hn.
Ethernet as it is defined by IEEE 802 utilizes various standards and mediums that enable communication between devices. Frequently deployed devices include hubs, switches, bridges, or routers. Wireless LAN technology is designed to connect devices without wiring. These devices use radio waves or infrared signals as a transmission medium. ITU-T G.hn technology uses existing home wiring (coaxial cable, phone lines and power lines) to create a high-speed (up to 1 Gigabit/s) local area network.


Wired technologies

  • Twisted pair wire is the most widely used medium for telecommunication. Twisted-pair cabling consist of copper wires that are twisted into pairs. Ordinary telephone wires consist of two insulated copper wires twisted into pairs. Computer networking cabling consist of 4 pairs of copper cabling that can be utilized for both voice and data transmission. The use of two wires twisted together helps to reduce crosstalk and electromagnetic induction. The transmission speed ranges from 2 million bits per second to 100 million bits per second. Twisted pair cabling comes in two forms which are Unshielded Twisted Pair (UTP) and Shielded twisted-pair (STP) which are rated in categories which are manufactured in different increments for various scenarios.
  • Coaxial cable is widely used for cable television systems, office buildings, and other work-sites for local area networks. The cables consist of copper or aluminum wire wrapped with insulating layer typically of a flexible material with a high dielectric constant, all of which are surrounded by a conductive layer. The layers of insulation help minimize interference and distortion. Transmission speed range from 200 million to more than 500 million bits per second.
  • Optical fiber cable consists of one or more filaments of glass fiber wrapped in protective layers. It transmits light which can travel over extended distances. Fiber-optic cables are not affected by electromagnetic radiation. Transmission speed may reach trillions of bits per second. The transmission speed of fiber optics is hundreds of times faster than for coaxial cables and thousands of times faster than a twisted-pair wire.


Wireless technologies

  • Terrestrial microwave – Terrestrial microwaves use Earth-based transmitter and receiver. The equipment look similar to satellite dishes. Terrestrial microwaves use low-gigahertz range, which limits all communications to line-of-sight. Path between relay stations spaced approx, 30 miles apart. Microwave antennas are usually placed on top of buildings, towers, hills, and mountain peaks.
  • Communications satellites – The satellites use microwave radio as their telecommunications medium which are not deflected by the Earth's atmosphere. The satellites are stationed in space, typically 22,000 miles (for geosynchronous satellites) above the equator. These Earth-orbiting systems are capable of receiving and relaying voice, data, and TV signals.
  • Cellular and PCS systems – Use several radio communications technologies. The systems are divided to different geographic areas. Each area has a low-power transmitter or radio relay antenna device to relay calls from one area to the next area.
  • Wireless LANs – Wireless local area network use a high-frequency radio technology similar to digital cellular and a low-frequency radio technology. Wireless LANs use spread spectrum technology to enable communication between multiple devices in a limited area. An example of open-standards wireless radio-wave technology is IEEE.
  • Infrared communication , which can transmit signals between devices within small distances not more than 10 meters peer to peer or ( face to face ) without any body in the line of transmitting.


Scale

Networks are often classified as local area network (LAN), wide area network (WAN), metropolitan area network (MAN), personal area network (PAN), virtual private network (VPN),campus area network (CAN), storage area network (SAN), and others, depending on their scale, scope and purpose, e.g., controller area network (CAN) usage, trust level, and access right often differ between these types of networks. LANs tend to be designed for internal use by an organization's internal systems and employees in individual physical locations, such as a building, while WANs may connect physically separate parts of an organization and may include connections to third parties.


Functional relationship (network architecture)

Computer networks may be classified according to the functional relationships which exist among the elements of the network, e.g., active networking, client–server and peer-to-peer(workgroup) architecture.


Network topology

Computer networks may be classified according to the network topology upon which the network is based, such as bus network, star network, ring network, mesh network. Network topology is the coordination by which devices in the network are arranged in their logical relations to one another, independent of physical arrangement. Even if networked computers are physically placed in a linear arrangement and are connected to a hub, the network has a star topology, rather than a bus topology. In this regard the visual and operational characteristics of a network are distinct. Networks may be classified based on the method of data used to convey the data, these include digital and analog networks.

Monday, February 7, 2011

SCHEDULER


Types of operating system schedulers

Operating systems may feature up to 3 distinct types of a long-term scheduler (also known as an admission scheduler or high-level scheduler), amid-term or medium-term scheduler and a short-term scheduler . The names suggest the relative frequency with which these functions are performed.


Long-term scheduler

The long-term, or admission, scheduler decides which jobs or processes are to be admitted to the ready queue; that is, when an attempt is made to execute a program, its admission to the set of currently executing processes is either authorized or delayed by the long-term scheduler. Thus, this scheduler dictates what processes are to run on a system, and the degree of concurrency to be supported at any one time - ie: whether a high or low amount of processes are to be executed concurrently, and how the split between IO intensive and CPU intensive processes is to be handled. In modern OS's, this is used to make sure that real time processes get enough CPU time to finish their tasks. Without proper real time scheduling, modern GUI interfaces would seem sluggish. [Stallings, 399].
Long-term scheduling is also important in large-scale systems such as batch processing systems, computer cluster, supercomputers and render farms. In these cases, special purpose job scheduler software is typically used to assist these functions, in addition to any underlying admission scheduling support in the operating system.


Mid-term scheduler

The mid-term scheduler temporarily removes processes from main memory and places them on secondary memory (such as a disk drive) or vice versa. This is commonly referred to as "swapping out" or "swapping in" (also incorrectly as "paging out" or "paging in"). The mid-term scheduler may decide to swap out a process which has not been active for some time, or a process which has a low priority, or a process which is page faulting frequently, or a process which is taking up a large amount of memory in order to free up main memory for other processes, swapping the process back in later when more memory is available, or when the process has been unblocked and is no longer waiting for a resource. [Stallings, 396] [Stallings, 370]
In many systems today (those that support mapping virtual address space to secondary storage other than the swap file), the mid-term scheduler may actually perform the role of the long-term scheduler, by treating binaries as "swapped out processes" upon their execution. In this way, when a segment of the binary is required it can be swapped in on demand, or "lazy loaded". [stallings, 394]


Short-term scheduler

The short-term scheduler (also known as the CPU scheduler) decides which of the ready, in-memory processes are to be executed (allocated a CPU) next following a clock interrupt, an IO interrupt, an operating system call or another form of signal. Thus the short-term scheduler makes scheduling decisions much more frequently than the long-term or mid-term schedulers - a scheduling decision will at a minimum have to be made after every time slice, and these are very short. This scheduler can be preemptive, implying that it is capable of forcibly removing processes from a CPU when it decides to allocate that CPU to another process, or non-preemptive (also known as "voluntary" or "co-operative"), in which case the scheduler is unable to "force" processes off the CPU. [Stallings, 396]. In most cases short-term scheduler is written in assembler because it is critical part of operating system.


Dispatcher

Another component involved in the CPU-scheduling function is the dispatcher. The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves the following:
  • Switching context
  • Switching to user mode
  • Jumping to the proper location in the user program to restart that program
The dispatcher should be as fast as possible, since it is invoked during every process switch. The time it takes for the dispatcher to stop one process and start another running is known as the dispatch latency

HDLC


HDLC: High Level Data Link Control
The High Level Data Link Control (HDLC) protocol, an ISO data link layer protocol based on the IBM SDLC, is to ensure that data passed up to the next layer has been received exactly as transmitted (i.e error free, without loss and in the correct order). Another important function of HDLC is flow control, which ensures that data is transmitted only as fast as the receiver can receive it. There are two distinct HDLC implementations: HDLC NRM (also known as SDLC) and HDLC Link Access Procedure Balanced (LAPB), the later is a more popular implementation. HDLC is usually used by X.25.
LAPB is a bit-oriented synchronous protocol that provides complete data transparency in a full-duplex point-to-point operation. It supports a peer-to-peer link in that neither end of the link plays the role of the permanent master station. HDLC NRM, on the other hand, has a permanent primary station with one or more secondary stations.
HDLC LAPB is a very efficient protocol, which requires a minimum of overhead to ensure flow control, error detection and recovery. If data is flowing in both directions (full duplex), the data frames themselves carry all the information required to ensure data integrity.
The concept of a frame window is used to send multiple frames before receiving confirmation that the first frame has been correctly been received. This means that data can continue to flow in situations where there may be long "turn-around" time lags without stopping to wait for an acknowledgement. This kind of situation occurs, for instance in satellite communication.
There are three categories of frames:
  • Information framestransport data across the link and may encapsulate the higher layers of the OSI architecture.
  • Supervisory framesperform the flow control and error recovery functions.
  • Unnumbered framesprovide the link initialization and termination.

SDLC


The System Development Life Cycle framework provides system designers and developers to follow a sequence of activities. It consists of a set of steps or phases in which each phase of the SDLC uses the results of the previous one.
A Systems Development Life Cycle (SDLC) adheres to important phases that are essential for developers, such as planning, analysis, design, and implementation, and are explained in the section below. A number of system development life cycle (SDLC) models have been created: waterfall, fountain, spiral, build and fix, rapid prototyping, incremental, and synchronize and stabilize. The oldest of these, and the best known, is the waterfall model: a sequence of stages in which the output of each stage becomes the input for the next. These stages can be characterized and divided up in different ways, including the following:
  • Project planning, feasibility study: Establishes a high-level view of the intended project and determines its goals.
  • Systems analysis, requirements definition: Refines project goals into defined functions and operation of the intended application. Analyzes end-user information needs.
  • Systems design: Describes desired features and operations in detail, including screen layouts, business rules, process diagrams, pseudocode and other documentation.
  • Implementation: The real code is written here.
  • Integration and testing: Brings all the pieces together into a special testing environment, then checks for errors, bugs and interoperability.
  • Acceptance, installation, deployment: The final stage of initial development, where the software is put into production and runs actual business.
  • Maintenance: What happens during the rest of the software's life: changes, correction, additions, moves to a different computing platform and more. This, the least glamorous and perhaps most important step of all, goes on seemingly forever.
In the following example (see picture) these stage of the Systems Development Life Cycle are divided in ten steps from definition to creation and modification of IT work products:

Saturday, February 5, 2011

fragmentation

In computer storage, fragmentation is a phenomenon in which storage space is used inefficiently, reducing storage capacity and in most cases performance. The term is also used to denote the wasted space itself.


Two kinds of fragmentations are present. they are:-
                                                  
                                                a) INTERNAL FRAGMENTATION


                                                b) EXTERNAL FRAGMENTATION


Internal fragmentation occurs when storage is allocated without intention to use it. This space is wasted. While this seems foolish, it is often accepted in return for increased efficiency or simplicity. The term "internal" refers to the fact that the unusable storage is inside the allocated region but is not being used.


External fragmentation is the phenomenon in which free storage becomes divided into many small pieces over time. It is a weakness of certain storage allocation algorithms, occurring when an application allocates and deallocates ("frees") regions of storage of varying sizes, and the allocation algorithm responds by leaving the allocated and deallocated regions interspersed. The result is that although free storage is available, it is effectively unusable because it is divided into pieces that are too small to satisfy the demands of the application. The term "external" refers to the fact that the unusable storage is outside the allocated regions.



Monday, January 24, 2011

OSI REFERENCE MODEL


The OSI, or Open System Interconnection, model defines a networking framework for implementing protocols in seven layers. Control is passed from one layer to the next, starting at the application layer in one station, and proceeding to the bottom layer, over the channel to the next station and back up the hierarchy.

Application (Layer 7)

This layer supports application and end-user processes. Communication partners are identified, quality of service is identified, user authentication and privacy are considered, and any constraints on data syntax are identified. Everything at this layer is application-specific. This layer provides application services for file transfers, e-mail, and other network software services. Telnet and FTP are applications that exist entirely in the application level. Tiered application architectures are part of this layer.

Presentation (Layer 6)

This layer provides independence from differences in data representation (e.g.,encryption) by translating from application to network format, and vice versa. The presentation layer works to transform data into the form that the application layer can accept. This layer formats and encrypts data to be sent across a network, providing freedom from compatibility problems. It is sometimes called the syntax layer.

Session (Layer 5)

This layer establishes, manages and terminates connections between applications. The session layer sets up, coordinates, and terminates conversations, exchanges, and dialogues between the applications at each end. It deals with session and connection coordination.

Transport (Layer 4)

This layer provides transparent transfer of data between end systems, or hosts, and is responsible for end-to-end error recovery and flow control. It ensures complete data transfer.

Network (Layer 3)

This layer provides switching and routing technologies, creating logical paths, known as virtual circuits, for transmitting data from node to node. Routing and forwarding are functions of this layer, as well as addressing, inter networking, error handling, congestion control and packet sequencing.

Data Link (Layer 2)

At this layer, data packets are encoded and decoded into bits. It furnishestransmission protocol knowledge and management and handles errors in the physical layer, flow control and frame synchronization. The data link layer is divided into two sub layers: The Media Access Control (MAC) layer and the Logical Link Control (LLC) layer. The MAC sub layer controls how a computer on the network gains access to the data and permission to transmit it. The LLC layer controls frame synchronization, flow control and error checking.

Physical (Layer 1)

This layer conveys the bit stream - electrical impulse, light or radio signal -- through the network at the electrical and mechanical level. It provides the hardware means of sending and receiving data on a carrier, including defining cables, cards and physical aspects. Fast Ethernet, RS232, and ATM are protocols with physical layer components.