Introduction :
You must have heard the word assembly many times in .NET documentation. In this article I will share some thing about .NET assemblies.
What is an assembly?
The assembly which is used only by a single application is called as private assembly. Suppose you created a DLL which encapsulates your business logic. This DLL will be used by your client application only and not by any other application. In order to run the application properly your DLL must reside in the same folder in which the client application is installed. Thus the assembly is private to your application.
Suppose that you are creating a general purpose DLL which provides functionality which will be used by variety of applications. Now, instead of each client application having its own copy of DLL you can place the DLL in 'global assembly cache'. Such assemblies are called as shared assemblies.
What is assembly manifest?
Assembly manifest is a data structure which stores information about an assembly
This information is stored within the assembly file (DLL/EXE) itself
The information includes version information, list of constituent files etc.
Saturday, October 20, 2007
.NET Assemblies
Posted by Prof. Sukhdev Singh at 10:36 PM 0 comments
Wednesday, October 17, 2007
single link_list program in c++
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
class list
{
struct node
{
int data;
node *link;
}*p;
public:
void inslast(int);
void insbeg(int);
void insnext(int,int);
void delelement(int);
void delbeg();
void dellast();
void disp();
int seek(int);
list(){p=NULL;}
~list();
};
void list::inslast(int x)
{
node *q,*t;
if(p==NULL)
{
p=new node;
p->data=x;
p->link=NULL;
}
else
{
q=p;
while(q->link!=NULL)
q=q->link;
t=new node;
t->data=x;
t->link=NULL;
q->link=t;
}
cout<<"Inserted successfully at the end..";
disp();
}
void list:: insbeg(int x)
{
node *q;
q=p;
p=new node;
p->data=x;
p->link=q;
cout<<"
Inserted successfully at the begining..";
disp();
}
void list::delelement(int x)
{
node *q,*r;
q=p;
if(q->data==x)
{
p=q->link;
delete q;
return;
}
r=q;
while(q!=NULL)
{
if(q->data==x)
{
r->link=q->link;
delete q;
return;
}
r=q;
q=q->link;
}
cout<<"
Element u entered "<<x<<" is not found..";
}
void list:: delbeg()
{
cout<<" The list before deletion:";
disp();
node *q;
q=p;
if(q==NULL)
{
cout<<" No data is present..";
return;
}
p=q->link;
delete q;
return;
}
void list:: dellast()
{
cout<<"
The list before deletion:";
disp();
node *q,*t;
q=p;
if(q==NULL)
{
cout<<"
There is no data in the list..";
return;
}
if(q->link==NULL)
{
p=q->link;
delete q;
return;
}
while(q->link->link!=NULL)
q=q->link;
q->link=NULL;
return;
}
list::~list()
{
node *q;
if(p==NULL) return;
while(p!=NULL)
{
q=p->link;
delete p;
p=q;
}
}
void list::disp()
{
node *q;
q=p;
if(q==NULL)
{
cout<<" No data is in the list..";
return;
}
cout<<" The items present in the list are :";
while(q!=NULL)
{
cout<<" "<<q->data;
q=q->link;
}
}
void list :: insnext(int value,int position)
{
node *temp,*temp1;
temp=p;
if(temp1==NULL)
{
temp1= new node;
temp1->data=value;
temp1->link=NULL;
p=temp1;
return;
}
for(int i=0;((i<position)&&(temp->link!=NULL)) ;i++)
{
if(i==(position-1))
{
temp1= new node;
temp1->data= value;
temp1->link=temp->link;
temp->link=temp1;
}
temp=temp->link;
}
//cout<<" Inserted successfully at the position.."<<position;
disp();
}
int list::seek(int value)
{
node *temp;
temp=p;
int position=0;
while(temp!=NULL)
{
if(temp->data==value)
return position+1;
else
{
temp=temp->link;
position=position+1;
}
}
cout<<" Element "<<value<<" not found";
return 0;
}
void main()
{
list l;
int ch,v,p,ps;
do
{
clrscr();
cout<<" Operations on List..";
cout<<"
1.Insertion
2.Deletion
3.Display
4.Seek
5.Exit";
cout<<" Enter ur choice:";
cin>>ch;
switch(ch)
{
case 1:
cout<<"1.Insertion at begining 2.Insertion at the end";
cout<<"3.Insertion after the mentioned position";
cout<<" Enter ur choice:";
cin>>ps;
cout<<" Enter the value to insert:";
cin>>v;
switch(ps)
{
case 1:
l.insbeg(v);
break;
case 2:
l.inslast(v);
break;
case 3:
cout<<" Enter the position to insert the value:";
cin>>p;
l.insnext(v,p);
break;
default:
cout<<" The choice is invalid";
return;
}
break;
case 2:
cout<<"1.Delete the first element 2.Delete the last element";
cout<<"3.Enter the element to delete from the list";
cout<<" Enter ur choice:";
cin>>ps;
switch(ps)
{
case 1:
l.delbeg();
cout<<" The list after deletion:";
l.disp();
break;
case 2:
l.dellast();
cout<<" The list after deletion:";
l.disp();
break;
case 3:
l.disp();
cout<<" Enter the element to delete : ";
cin>>v;
l.delelement(v);
cout<<" The list after deletion:";
l.disp();
break;
default:
cout<<" The option is invalid...";
break;
}
break;
case 3:
l.disp();
break;
case 4:
l.disp();
cout<<" Enter the element to search:";
cin>>v;
cout<<" The position of the element "<< v<<" is "<<l.seek(v);
getch();
break;
case 5:
exit(1);
default:
cout<<" The option is invalid...";
return;
}
getch();
}while(ch!=5);
getch();
return;
}
Posted by Prof. Sukhdev Singh at 12:23 PM 3 comments
C-Programes
WAP to find greatest among two rnumbers using conditional operators?
WAP to find area of triangle using hero’s formula?- Admission to PGDCA class is suspected to following condition:
marks in matriculation >=50%
marks in chemistry >=40%
marks in physics >=45%
total in all three subjects >=180
Scan the marks from keyboard. Write a program to display list of eligible candidates. - WAP that will read value of x & evaluate the following function:
i. y = 5 if x>0
ii. y = 0 if x=0
iii. y = -5 if x<0 - WAP to find sum of digits?
- WAP to check if the given number is peridrom?
- WAP to print fibonaci series?
- WAP to find factorial of any number?
- WAP to check if the entered number is prime or not?
- WAP to Print
*
* *
* * *
* * * *
* * * * * - WAP a program to swap two numbers using pointers?
- WAP to Print
*
* *
* * *
* * * *
* * * * * - WAP to print
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5 - Write a recursion function to find factorial of n?
- Write a recursion function to print fibonaci series up to n terms?
- WAP to find sum of array elements?
- WAP to find product of two matrix?
- WAP to find transpose of a matrix?
- Write a function to print array elements using pointers?
- WAP to find greatest element in 2-D array?
- Write a function to find length of string?
- Write a function to reverse a string?
- WAP to compare two strings
- Design a structure named student to store data about a student which contains following info.:
i. Data items type
ii. Roll.no. int
iii. Name char[20]
iv. Class char[10]
v. Marks int
Assume that there are not more than 50 students .W.a.p to input data about students &
Output stored items? - Demonstrate concepts of nested structures.Consider employee, address, contact as structur
Posted by Prof. Sukhdev Singh at 6:51 AM 49 comments
Monday, October 15, 2007
Data Structures using C++
- WAP to insert an element into Linear Array at specific position.
- WAP to delete an element into Linear Array at specific position.
- WAP to delete duplicates from a linear array.
- WAP to search largest and smallest element in a linear array.
- WAP to add, subtract and multiply matrices
- WAP to insert a node into simple linked list at the beginning.
- WAP to insert a node into a simple linked list at the end of the list.
- WAP to search an element from linked list.
- WAP to delete an element from a simple linked list.
- WAP to insert a node into the right of node in doubly linked list.
- WAP to insert a node into the left most node in doubly linked list.
- WAP to insert an element at particular location in doubly linked list.
- WAP to delete a node at particular location in doubly linked list.
- WAP to merge two-sorted single linked list.
- WAP to reverse a link list.
- WAP to sort an unsorted single linked list
- WAP to implement STACK using array.
- WAP to implement STACK using Linked List.
- WAP to check Parenthesis in an arithmetic expression using STACK
- WAP to convert completely parenthesized expression to postfix expression.
- WAP to implement QUEUE using Circular Array.
- WAP to implement QUEUE using Single Linked List.
- WAP to implement Linear Search
- WAP to implement Binary Search
- WAP to implement Bubble Sort.
- WAP to implement Insertion Sort.
- WAP to impalement QUICK Sort.
- WAP to implement Selection sort.
- Implement following operations on binary search tree
· Insert a node
· Delete a node
· Traverse tree using recursion
· Search a node - Implement heap sort algorithm in C++.
Posted by Prof. Sukhdev Singh at 9:59 AM 3 comments
Sunday, October 14, 2007
C++ Programmes
- WAP to find greatest of three numbers using conditional operator.
- WAP to find greatest of three numbers using if statement only.
- WAP to find sum of digit.
- WAP to check whether a given String is palindrome or not.
- WAP to store/show employee information (Name, age, address) in structure.
- WAP to demonstrator concept of nested structure.
- WAP to compare two strings using user defined functions.
- WAP to demonstrate how we can print structure value using pointers
- WAP to find length of a string using user defined function
- WAP to compare two strings using user defined function
- WAP to copy a string
- . WAP to demonstrate use of access specifier in classes
- . WAP to demonstrate an array of bank acc object where acc class consist of acno, name and balance as data members
- . WAP to demonstrate passing of an object by value
- WAP to demonstrate passing of an object by address
- WAP to add two matrices by returning as object form a function using classes and objects
- WAP that calculate total number of object created.
- WAP to enter time in hours, minutes and seconds and display time in universal format (2:00 pm =14:00)
- WAP to generate fibonacci series using object.
- WAP to calculate distance between two points using constructors. If (x1,y1) and (x2,y2) are two points then distance between them is:
D=√(x2-x1)2+(y2-y1)2 - WAP to implement basic operation of stack using class
- WAP to add two times and display output in proper format
- Write a class Box with its data members width, length and height. Initialize data members using default, parameterized and copy constructors and calculate volume of the box.
- WAP to overload increment operator for prefix and postfix increment on time class
- WAP to overload comparison operator == for strings
- WAP to overload >= operator for date object
- WAP to demonstrate operator overloading for unary operator using friend functions
- WAP to demonstrate operator overloading for binary operator using friend functions
29. WAP to demonstrate concept of friend functions
30. WAP to demonstrate friend function act as bridge between two different classes
31. WAP to show how we can create dynamic objects
32. WAP to create an array of dynamic object
33. WAP to demonstrate how to declare entire class as a friend of another class
34. WAP to demonstrate the concept of overriding
35. WAP to demonstrate public, private and protected inheritance
36. WAP to calculate result of students using private inheritance
37. WAP to demonstrate multilevel and multiple inheritance
38. WAP to demonstrate hybrid inheritance
39. WAP to show behavior of constructor in multiple and multilevel inheritance
40. Design an application for hospital management system. For this create the following classes and members
Person(name, dob, sex)
Doctor(specialization)
Patient(Caseno, disease, doadmin, dodis, billno)
Write functions to input data from user and display data to user - Design a railway traffic control system. Where TRAIN is a Base class for PASSENGER_TRAIN and GOODS_TRAIN classes. Each class contain following members:
TRAIN( TrainNo, Source, Destination, NoOfBogies)
PASSENGER_TRAIN(NoOfPassengerPerBogy)
GOODS_TRAIN(LoadingCapacityPerBogy)
Write functions to get data from user and display to user - WAP to demonstrate the behavior of parameterized constructor in multilevel inheritance
- WAP to demonstrate #define, #include, #if, #else, #endif, #ifdef #undef
- WAP to sum of two number using #define
Posted by Prof. Sukhdev Singh at 7:22 PM 7 comments
Digital Signature
A digital signature serves the same purpose as a handwritten signature.However, a handwritten signature is easy to counterfeit. A digital signature is superior to a handwritten signature in that it is nearly impossible to counterfeit, plus it attests to the contents of the information as well as the identity of the signer.
Digital signature creation
This consists of the following stages:
The signer first creates the message that he is desirous of digitally signing.
He then uses a hash function (say SHA1) to compute the hash result (also called message digest) of the message.
He then uses his private key to digitally sign the message digest.
The signer then sends the original message and the digitally signed message digest to the receiver.
Digital signature verification
This consists of the following stages:
The receiver receives the original message and the digitally signed message digest from the sender.
The receiver computes the message digest from the original message using the same hash function as used by the sender (SHA1 in this case). He then compares the message digest computed by him to the message digest sent to him by the sender. If they are the same it implies that the message has not been altered unauthorizedly.
The receiver then verifies whether the private key of the sender was actually used to sign the message digest. He does this using the public key of the sender
Posted by Prof. Sukhdev Singh at 4:26 AM 3 comments