Month: March 2014

Friend Function

Posted on

#include<iostream.h>

#include<conio.h>

class greater

{

private:

int no1,no2,no3;

public :

greater()

{

no1=4;

no2=7;

no3=1;

}

greater(int x,int y,int z)

{

no1=x;

no2=y;

no3=z;

}

friend int larger(greater &);

};

int larger(greater &g)

{

if(g.no1>g.no2 && g.no1>g.no3)

return g.no1;

else if(g.no2>g.no1 && g.no2>g.no3)

return g.no2;

else

return g.no3;

}

void main()

{

greater g(45,66,56);

cout<<“greater no is “<<larger(g);

 

getch();

}

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Advertisements

Using 2D Array

Posted on

#include<iostream.h>

#include<conio.h>

 

void main(){

clrscr();

int a[10][10],i,j,sum=0,m,n;

 

cout<<“\nEnter the row and column of matrix: “;

cin>>m;

cin>>n;

 

cout<<“\nEnter the elements of matrix: “;

for(i=0;i<m;i++)

for(j=0;j<n;j++)

cin>>a[i][j];

cout<<“\nThe matrix is\n”;

 

for(i=0;i<m;i++){

cout<<“\n”;

for(j=0;j<m;j++){

cout<<a[i][j];

}

}

for(i=0;i<m;i++){

for(j=0;j<n;j++){

if(i==j)

sum=sum+a[i][j];

}

}

cout<<“\n\nSum of the diagonal elements of a matrix is: “<<sum;

 

getch();

}

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

Using XSL

Posted on Updated on

To run this application we have to create to file one is xml and another xsl.

Fourth.xml

<?xml version =”1.0″?><?xml:stylesheet type=”text/xsl” href=”fourth.xsl”?>

<!DOCTYPE firstxsl SYSTEM “first.dtd”>

<firstxsl>

<first>

<heading> stylesheet </heading>

<body> learning xml </body>

</first>

</firstxsl>

Fourth.xsl

<?xml version=”1.0″?><xsl:stylesheet xmlns:xsl=”http://www.w3.org/TR/WD-xsl&#8221; result-ns=”html”>

<xsl:template match=”/”>

<xsl:apply-templates/>

</xsl:template>

<xsl:template match=”*”>

<xsl:apply-templates/>

</xsl:template>

<xsl:template match=”text()”>

<xsl:value-of select=”.”/>

</xsl:template>

<xsl:template match=”first”>

<html>

<font color=”red”>

<xsl:apply-templates select=”heading”/>

<br/>

</font>

<font color=”green”>

<xsl:apply-templates select=”body”/>

</font>

</html>

</xsl:template></xsl:stylesheet>

E. F. Codd’s 12 rules

Posted on

  • · Foundation Rule – A relational database management system must manage its stored data using only its relational capabilities.
  • · Information Rule – All information in the database should be represented in one and only one way – as values in a table.
  • · Guaranteed Access Rule – Each and every datum (atomic value) is guaranteed to be logically accessible by resorting to a combination of table name, primary key value and column name.
  • · Systematic Treatment of Null Values – Null values (distinct from empty character string or a string of blank characters and distinct from zero or any other number) are supported in the fully relational DBMS for representing missing information in a systematic way, independent of data type.
  • Dynamic On-line Catalog Based on the Relational Model – The database description is represented at the logical level in the same way as ordinary data, so authorized users can apply the same relational language to its interrogation as they apply to regular data.
  • · Comprehensive Data Sublanguage Rule – A relational system may support several languages and various modes of terminal use. However, there must be at least one language whose statements are expressible, per some well-defined syntax, as character strings and whose ability to support all of the following is comprehensible:
  1. data definition
  2. view definition
  3. data manipulation (interactive and by program)
  4. integrity constraints
  5. authorization
  6. Transaction boundaries (begin, commit, and rollback).

 

  • · View Updating Rule – All views that are theoretically updateable are also updateable by the system.
  • ·  High-level Insert, Update, and Delete – The capability of handling a base relation or a derived relation as a single operand applies nor only to the retrieval of data but also to the insertion, update, and deletion of data.
  • · Physical Data Independence – Application programs and terminal activities remain logically unimpaired whenever any changes are made in either storage representation or access methods.
  • · Logical Data Independence – Application programs and terminal activities remain logically unimpaired when information preserving changes of any kind that theoretically permit unimpairment are made to the base tables.
  • · Integrity Independence – Integrity constraints specific to a particular relational database must be definable in the relational data sublanguage and storable in the catalog, not in the application programs.
  • · Distribution Independence – The data manipulation sublanguage of a relational DBMS must enable application programs and terminal activities to remain logically unimpaired whether and whenever data are physically centralized or distributed.
  • · Nonsubversion Rule – If a relational system has or supports a low-level (single-record-at-a-time) language, that low-level language cannot be used to subvert or bypass the integrity rules or constraints expressed in the higher-level (multiple-records-at-a-time) relational language.

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

FILE HANDLING

Posted on Updated on

  • A file is a collection of data stored in a disk with a specific name and a directory path. When a file is opened for reading or writing, it becomes a stream.
  •  The stream is basically the sequence of bytes passing through the communication path. There are two main streams: the input stream and the output stream.
  • The input stream is used for reading data from file (read operation) and the output stream is used for writing into the file (write operation).
  •  The System.IO namespace has various classes that are used for performing various operations with files, like creating and deleting files, reading from or writing to a file, closing a file, etc.
  • The following table shows some commonly used non-abstract classes in the System.IO namespace:

I/O Class

Description

BinaryReader

Reads primitive data from a binary stream.

BinaryWriter

Writes primitive data in binary format.

BufferedStream

A temporary storage for a stream of bytes.

Directory

Helps in manipulating a directory structure.

DirectoryInfo

Used for performing operations on directories.

DriveInfo

Provides information for the drives.

File

Helps in manipulating files.

FileInfo

Used for performing operations on files.

FileStream

Used to read from and write to any location in a file.

MemoryStream

Used for random access of streamed data stored in memory.

Path

Performs operations on path information.

StreamReader

Used for reading characters from a byte stream.

StreamWriter

Is used for writing characters to a stream.

StringReader

Is used for reading from a string buffer.

StringWriter

Is used for writing into a string buffer.

 

FILESTREAM CLASS

  • The FileStream class in the System.IO namespace helps in reading from, writing to and closing files. This class derives from the abstract class Stream.
  •    To create a FileStream object to create a new file or open an existing files. The syntax for creating a FileStream object is as follows:

 

Dim <object_name> As FileStream = New FileStream(<file_name>, <FileMode Enumerator>, <FileAccess Enumerator>, <FileShare Enumerator>)
  • For example, for creating a FileStream object F for reading a file named sample.txt:
Dim f1 As FileStream = New FileStream("test.dat", FileMode.OpenOrCreate, FileAccess.ReadWrite)


Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: www.vissicomp.com

DATA STRUCTURE

Posted on

  •  Data structure is an arrangement of data in a computer’s memory or even disk storage. An example of several common data structures are arrays, linked lists, queues, stacks, binary trees, and hash tables.
  • Algorithms, on the other hand, are used to manipulate the data contained in these data structures as in searching and sorting.
  •  Many algorithms apply directly to a specific data structures. When working with certain data structures you need to know how to insert new data, search for a specified item, and deleting a specific item.
  •  Commonly used algorithms include are useful for:
  •   Searching for a particular data item (or record).
  •  Sorting the data. There are many ways to sort data, i.e. simple sorting and Advanced sorting.
  •  Iterating through all the items in a data structure. (Visiting each item in turn so as to display it or perform some other action on these.)

CHARACTERISTICS OF DATA STRUCTURE

Data Structure Advantages Disadvantages
Array Quick inserts
Fast access if index known
Slow search
Slow deletes
Fixed size
Ordered Array Faster search than unsorted array Slow inserts
Slow deletes
Fixed size
Stack Last-in, first-out acces Slow access to other items
Queue First-in, first-out access Slow access to other items
Linked List Quick inserts
Quick deletes
Slow search
Binary Tree Quick search
Quick inserts
Quick deletes
(If the tree remains balanced)
Deletion algorithm is complex
Red-Black Tree Quick search
Quick inserts
Quick deletes
(Tree always remains balanced)
Complex to implement
2-3-4 Tree Quick search
Quick inserts
Quick deletes
(Tree always remains balanced)
(Similar trees good for disk storage)
Complex to implement
Hash Table Very fast access if key is known
Quick inserts
Slow deletes
Access slow if key is not known
Inefficient memory usage
Heap Quick inserts
Quick deletes
Access to largest item
Slow access to other items
Graph Best models real-world situations Some algorithms are slow and very complex

Posted By -Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

Data Warehousing – Security

Posted on

  •  The objective data warehouse is to allow large amount of data to be easily accessible by the users. Hence allowing user to extract the information about the business as a whole. But we know that there could be some security restrictions applied on the data which can prove an obstacle for accessing the information. If the analyst has the restricted view of data then it is impossible to capture a complete picture of the trends within the business.
  • The data from each analyst can be summarised and passed onto management where the different summarise can be created. As the aggregations of summaries cannot be same as that of aggregation as a whole so It is possible to miss some information trends in the data unless someone is analysing the data as a whole.

Factor to Consider for Security requirements

  • The following are the parts that are affected by the security hence it is worth consider these factors.
  • User Access
  • Data Load
  • Data Movement
  • Query Generation

Requirements

  • Adding the security will affect the performance of the data warehouse, therefore it is worth determining the security requirements early as possible. Adding the security after the data warehouse has gone live, is very difficult.
  •  During the design phase of data warehouse we should keep in mind that what data sources may be added later and what would be the impact of adding those data sources. We should consider the following possibilities during the design phase.
  • Whether the new data sources will require new security and/or audit restrictions to be implemented?
  • Whether the new users added who have restricted access to data that is already generally available?
  • This situation arises when the future users and the data sources are not well known. In such a situation we need to use the knowledge of business and the objective of data warehouse to know likely requirements.

 

Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com