Month: May 2014

Structure of embedded program:

Posted on

The following Introductory program is representative of microcontroller programming  .The program tests to see if a button attached  to a controller port has been pushed.

If the button has been pushed, the program turns on an L ED attached to the port, waits and then it back off.

# include <hc705c8.h>

//#pragma portw portA @ 0X0A; is declared in header

//#pragma portw portADir @ 0X8A; is declared in header

# define INPUT 1

# define OUTPUT 0

# define ON 1

# define OFF 0

# define PUSHED 1

Void Wait (registera);  // wait  function protype

Void Main (void)

{

PortA Dir.0=OUTPUT;     // set pin 0 for output (light)

PortA Dir.1= INPUT;       // set pin 1 for input (button)

While (1)

{                                     // Infinite loop

If (portA.1==PUSHED)

{

Wait(1);              // is it valid push?

If (portA.1==PUSHED)

{

PortA.0=ON ;   // turn on light

Wait(10); //delay (light on)

PortA.0=OFF; // turn off light

}

}

}

}   // end main

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

DATA BASE ARCHITECTURE

Posted on

USEFULL FOR FYBSC (IT) & TYBSC (CS) STUDENTS

 

Data base architecture is logically divided into two types: –

1)    Logical two-tier Client/Server Architecture

2)    Logical three-tier Client/Server Architecture

 

LOGICAL TWO-TIER CLIENT/SERVER ARCHITECTURE

1

 

1)     This architecture is used for user interface program and application program that runs on client side. An interface called ODBC (Open DataBase Connectivity) provides an API (Application Programming Interface) that allows client side program to call the DBMS.

2)     Most DBMS vendors provide ODBC drivers. A client program may connect to several DBMS.

3)     In this architecture, some variation of client is also possible for example in some DBMS more functionality is transferred to the client including data dictionary, optimization etc. such clients are called data server.

LOGICAL THREE-TIER CLIENT/SERVER ARCHITECTURE

2

1)     This architecture is commonly used for web applications. Intermediate layer called application server or web server stores the web connectivity software and the business logic (constraints) part of application used to access the right amount of data from the database server.

2)     This layer acts like medium for sending partially processed data between the database server and the client.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

 

 

Declaration Statements in VB.NET

Posted on

Declaration Statements

The declaration statements are used to name and define procedures, variables, properties, arrays, and constants. When you declare a programming element, you can also define its data type, access level, and scope.

The programming elements you may declare include variables, constants, enumerations, classes, structures, modules, interfaces, procedures, procedure parameters, function returns, external procedure references, operators, properties, events, and delegates.

Following are the declaration statements in VB.Net:

S.N Statements and Description Example
1 Dim Statement
Declares and allocates storage space for one or more variables.
Dim number As IntegerDim quantity As Integer = 100Dim message As String = “Hello!”
2 Const Statement
Declares and defines one or more constants.
Const maximum As Long = 1000Const naturalLogBase As Object = CDec(2.7182818284)
3 Enum Statement
Declares an enumeration and defines the values of its members.
Enum CoffeeMugSize    Jumbo    ExtraLarge    Large    Medium    SmallEnd Enum
4 Class Statement
Declares the name of a class and introduces the definition of the variables, properties, events, and procedures that the class comprises.
Class BoxPublic length As DoublePublic breadth As Double   Public height As DoubleEnd Class
5 Structure Statement
Declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises.
Structure BoxPublic length As Double           Public breadth As Double   Public height As DoubleEnd Structure
6 Module Statement
Declares the name of a module and introduces the definition of the variables, properties, events, and procedures that the module comprises.
Public Module myModuleSub Main()Dim user As String = InputBox(“What is your name?”) MsgBox(“User name is” & user)End Sub End Module
7 Interface Statement
Declares the name of an interface and introduces the definitions of the members that the interface comprises.
Public Interface MyInterface    Sub doSomething()End Interface
8 Function Statement
Declares the name, parameters, and code that define a Function procedure.
Function myFunction(ByVal n As Integer) As Double     Return 5.87 * nEnd Function
9 Sub Statement
Declares the name, parameters, and code that define a Sub procedure.
Sub mySub(ByVal s As String)    ReturnEnd Sub
10 Declare Statement
Declares a reference to a procedure implemented in an external file.
Declare Function getUserNameLib “advapi32.dll” Alias “GetUserNameA” (  ByVal lpBuffer As String,   ByRef nSize As Integer) As Integer
11 Operator Statement
Declares the operator symbol, operands, and code that define an operator procedure on a class or structure.
Public Shared Operator +(ByVal x As obj, ByVal y As obj) As obj        Dim r As New obj’ implemention code for r = x + y        Return r    End Operator
12 Property Statement
Declares the name of a property, and the property procedures used to store and retrieve the value of the property.
ReadOnly Property quote() As String     Get         Return quoteString    End Get End Property
13 Event Statement
Declares a user-defined event.
Public Event Finished()
14 Delegate Statement
Used to declare a delegate.
Delegate Function MathOperator(     ByVal x As Double,     ByVal y As Double ) As Double

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

Perform push and pop operations over stack in c

Posted on

USEFUL FOR FYBSC (IT), FYBCA STUDENTS  

 

Perform push and pop operations over stack in c

Push: Push saves value in stack. The values having same data type can be pushed into stack.The value which is pushed at the last is stored at the top most position.
Pop: Push removes value from stack. The top most value is removed first i.e. LIFO policy. After removing a value from stack, the next value becomes the peek value.

 

#include < stdio.h >

#include < conio.h >

#define max 5

 

void main()

{

      //… create stack

      int stack[max],data;

      int top,option,reply;

      //… init stack

      top = -1;

      clrscr();

      do

      {

            printf(“\n 1. push”);

            printf(“\n 2. pop”);

            printf(“\n 3. exit”);

            printf(“\nSelect proper option : “);

            scanf(“%d”,&option);

            switch(option)

            {

                  case 1 : // push

                        printf(“\n Enter a value : “);

                        scanf(“%d”,&data);

                        reply = push(stack,&top,&data);

                        if( reply == -1 )

                               printf(“\nStack is full”);

                        else

                               printf(“\n Pushed value”);

                        break;

                  case 2 : // pop

                        reply = pop ( stack,&top,&data);

                        if( reply == – 1)

                               printf(“\nStack is empty”);

                        else

                               printf(“\n Popped value is %d”,data);

                        break;

                  case 3 : exit(0);

            } // switch

      }while(1);

} // main

 

int push( int stack[max],int *top, int *data)

{

      if( *top == max -1 )

            return(-1);

      else

      {

            *top = *top + 1;

            stack[*top] = *data;

            return(1);

      } // else

} // push

 

int pop( int stack[max], int *top, int *data)

{

      if( *top == -1 )

            return(-1);

      else

      {

            *data = stack[*top];

            *top = *top – 1;

            return(1);

      } //else

} // pop

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

interview questions of dot net

Posted on

Qu – What are Cascading style sheets?

Cascading style sheets(CSS) collect and organize all of the formatting information applied to HTML elements on a Web form. Because they keep this information in a single location, style sheets make it easy to adjust the appearance of Web applications.

 

Qu – What is the difference between System.String and System.Text.StringBuilder classes?

System.String is immutable.
System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

 

Qu – What are different types of Assemblies?

  • Single file and multi file assembly.
  • Assemblies can be static or dynamic.
  • Private assemblies and shared assemblies.

 

Qu – What is Delegates?

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it. Delegates are generally used as basis of events, which allow any delegate to easily be registered for as event.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

 

 

DBMS

Posted on

USEFULL FOR FYBSC (IT) & TYBSC (CS) STUDENTS

 

Qu-What is the difference between Cluster and Non cluster Index?

A clustered index reorders the way records in the table are physically stored. There can be only one clustered index per table. It makes data retrieval faster. A non clustered index does not alter the way it was stored but creates a complete separate object within the table. As a result insert and update command will be faster.

 

Qu-Explain the difference between DELETE, TRUNCATE and DROP commands?

Once delete operation is performed Commit and Rollback can be performed to retrieve data. But after truncate statement, Commit and Rollback statement can’t be performed. Where condition can be used along with delete statement but it can’t be used with truncate statement. Drop command is used to drop the table or keys like primary, foreign from a table.

Qu-What is a trigger?

Databases are set of commands that get executed when an event (Before Insert, After Insert, On Update, on delete of a row) occurs on a table, views.

 

Qu-What is the difference between Cluster and Non cluster Index?

A clustered index reorders the way records in the table are physically stored. There can be only one clustered index per table. It makes data retrieval faster. A non clustered index does not alter the way it was stored but creates a complete separate object within the table. As a result insert and update command will be faster.

 

Qu-What is Union, minus and Interact commands?

MINUS operator is used to return rows from the first query but not from the second query. INTERSECT operator is used to return rows returned by both the queries.

 

Qu-What is a stored procedure?

Stored Procedure is a function which contains collection of SQL Queries. Procedure can take inputs, process them and send back output.

 

Qu-What are the advantages a stored procedure?

Stored Procedures are precompiled and stored in database. This enables the database to execute the queries much faster. Since many queries can be included in a stored procedure, round trip time to execute multiple queries from source code to database and back is avoided.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

 

 

Interview questions of Data structures in C

Posted on

USEFUL FOR FYBSC (IT), FYBCA STUDENTS  

 

1.)   What is the difference between a Stack and an Array?

Stack

  • Stack is a dynamic object whose size is constantly changing as items are pushed and popped.
  • Stack may contain different data types.
  • Stack is declared as a structure containing an array to hold the element of the stack, and an integer to indicate the current stack top within the array.
  • Stack is a ordered collection of items.

Array

  • Array is an ordered collection of items.
  • Array is a static object.
  • It contains same data types.
  • Array can be home of a stack i.e. array can be declared large enough for maximum size of the stack.

 

2. What is sequential search?

In sequential search each item in the array is compared with the item being searched until a match occurs. It is applicable to a table organized either as an array or as a linked list.

 

3. What are the disadvantages array implementations of linked list?

The no of nodes needed can’t be predicted when the program is written.
The no of nodes declared must remain allocated throughout its execution.

 

4. Define circular list?

In linear list the next field of the last node contain a null pointer, when a next field in the last node contain a pointer back to the first node it is called circular list.

 

5. What does abstract Data Type Mean?

Data type is a collection of values and a set of operations on these values. Abstract data type refers to the mathematical concept that defines the data type.

 

6. Define double linked list?

  • It is a collection of data elements called nodes, where each node is divided into three parts
  • An info field that contains the information stored in the node.
  • Left field that contain pointer to node on left side.
  • Right field that contain pointer to node on right side.

 

7. What are the methods available in storing sequential files?

  • Straight merging
  • Natural merging
  • Polyphase sort
  • Distribution of Initial runs

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

 

 

interview questions of dot net

Posted on

Qu – What is the difference between a private assembly and a shared assembly?

  • Location and visibility

: A private assembly is normally used by a single application, and is stored in the application’s directory, or a sub -directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. the .NET framework classes.

  • Versioning: The runtime enforces versioning constraints only on shared assemblies, not on private assemblies.

 

Qu – What is garbage collection?

Garbage collection is a heap -management strategy where a run-time component takes responsibility for managing the lifetime of the memory used by objects. This concept is not new to .NET-Java and many other languages/runtimes have used garbage collection for some time.

 

Qu -What is the difference between an event and a delegate?

An event is just a wrapper for a multicast delegate. Adding a public event to a class is almost the same as adding a public multicast delegate field. In both cases, subscriber objects can register for notifications, and in both cases the publisher object can send notifications to the subscribers. However, a public multicast delegate has the undesirable property that external objects can invoke the delegate, something we’d normally want to re

strict to the publisher. Hence events – an event adds public methods to the containing

class to add and remove receivers, but does not make the invocation mechanism public.

 

Qu- What size is a .NET object?

Each instance of a reference type has two fields maintained by the runtime -a method table pointer and a sync block. These are 4 bytes each on a 32-bit system, making a total of 8 bytes per object overhead. Obviously the instance data for the type must be added to this to get the overall size of the obj ect. So, for example, instances of the following class are 12 bytes each:

 

class MyInt

{

private int x;

}

However, note that with the current implementation of the CLR there seems to be a minimum object size of 12 bytes, even for classes with no data (e.g.System.Object).

Values types have no equivalent overhead.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

Data Base Management System

Posted on

USEFULL FOR FYBSC (IT) & TYBSC (CS) STUDENTS

Qu-What is a query?

A query with respect to DBMS relates to user commands that are used to interact with a

data base. The query language can be classified into data definition language and data manipulation language.

 

Qu-What is durability in DBMS?

Once the DBMS informs the user that a transaction has successfully completed, its effects should persist even if the system crashes before all its changes are reflected on disk. This property is called durability.

 

Qu-What are partial, alternate,, artificial, compound and natural key?

  1. Partial Key: It is a set of attributes that can uniquely identify weak entities and that are related to same owner entity. It is sometime called as Discriminator.
  2. Alternate Key: All Candidate Keys excluding the Primary Key are known as Alternate Keys.
  3. Artificial Key: If no obvious key either stands alone or compound is available, then the last resort is to simply create a key, by assigning a unique number to each record or occurrence. Then this is known as developing an artificial key.
  4. Compound Key: If no single data element uniquely identifies occurrences within a construct, then combining multiple elements to create a unique identifier for the construct is known as creating a compound key.
  5. Natural Key: When one of the data elements stored within a construct is utilized as the primary key, then it is called the natural key

 

Qu-What is normalization?

It is a process of analyzing the given relation schemas based on their Functional Dependencies (FDs) and primary key to achieve the properties

(1).Minimizing redundancy, (2). Minimizing insertion, deletion and update anomalies

 

Qu-What is Functional Dependency?

A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y

 

Qu-What is Data Storage Definition Language?

The storage structures and access methods used by database system are specified by a set

of definition in a special type of DDL called data storage definition language.

 

Qu-What is DML (Data Manipulation Language)?

This language that enable user to access or manipulate data as organised by appropriate

data model.

  1. Procedural DML or Low level: DML requires a user to specify what data are needed and how to get those data.
  2. Non -Procedural DML or High level:DML requires a user to specify what data are

needed without specifying how to get those data.

Qu-What is DML Compiler?

It translates DML statements in a query language into low-level instruction that the query

evaluation engine can understand.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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

Hashing technique in Data structures in C

Posted on

USEFUL FOR FYBSC (IT), FYBCA STUDENTS  

 

1. The memory address of the first element of an array is called

a. floor address
b. foundation address
c. first address
d. base address

 

2. The memory address of fifth element of an array can be calculated by the formula

a. LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words per memory cell for the array
b. LOC(Array[5])=Base(Array[5])+(5-lower bound), where w is the number of words per memory cell for the array
c. LOC(Array[5])=Base(Array[4])+(5-Upper bound), where w is the number of words per memory cell for the array
d. None of above

 

3. Which of the following data structures are indexed structures?

a. linear arrays
b. linked lists
c. both of above
d. none of above

 

4. Which of the following is not the required condition for binary search algorithm?

a. The list must be sorted
b. there should be the direct access to the middle element in any sub list
c. There must be mechanism to delete and/or insert elements in list
d. none of above

 

5. Which of the following is not a limitation of binary search algorithm?

a. must use a sorted array
b. requirement of sorted array is expensive when a lot of insertion and deletions are needed
c. there must be a mechanism to access middle element directly
d. binary search algorithm is not efficient when the data elements are more than 1000.

 

6. Two dimensional arrays are also called

a. tables arrays
b. matrix arrays
c. both of above
d. none of above

 

7. A variable P is called pointer if

a. P contains the address of an element in DATA.
b. P points to the address of first element in DATA
c. P can store only memory addresses
d. P contain the DATA and the address of DATA

 

Posted By-: Vissicomp Technology Pvt. Ltd.

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