Welcome





Monday, July 25, 2011

List of DBMS Assignments

 1.  Demonstration of data independence with ADT
 2.  Simple Application using conventional files
 3.  Demonstration of Hierarchical model
 4.  Demonstration of Network model
 5.  Simple tool to convert E-R diagram to tables
 6. Persistent Java API
 7. Pro C
 8. SQL J
 9. Implementation of editor with shadow copying
10. Demonstration of race programs in concurrent programs

Database Management Systems

This blog will now serve as the official blog for DBMS 3-1 2011-2012.

Tuesday, July 19, 2011

static library

CREATION OF STATIC LIBRARY
--------------------------------------------

The creation of static library is illustrated below with the help of different stages.

step1:
--------

vi file1.c /* The file to be called */

#include

void call()
{

printf("hai");
}

--> gcc -c file1.c

In this step,the object file of the code is obtained.



step 2:
--------

/*Header file which has prototype of file1.c*/

vi h1.h

void call();

--> ar rs libstat.a file1.o

The above command enables the object file generated in the previous stage
to be placed in the archiver.




step3:
-------
/*create "include" and "lib" folder(\home\student) */

note: create these folders in \home\student folder.

(a):copy h1.h file to include folder

(b):copy libstat.a to lib folder


step 4:
--------

vi program.c

#include
void main()
{

call();
return 0;

}

This is the application program making use of the static library.


step 5:
--------

gcc --static -I /home/student/include -L /home/student/lib -o program program.c -lstat



note -I stands for include and -L for lib and l for linking

Compiling the application code must be done using the above command


step 6:
-------

./program

Executing the application code





Saturday, July 16, 2011


Screen shots of  Personal Calendar
                                                  -> It looks like this when its opened                      
                                            -> It looks like this when "save" button is clicked
     
                                           -> It looks like this when "view" button is clicked    

           It is done using AWT,Collections,Files,IOstreams and different LayoutManagers. It can store a maximum of three events for a particular date and month. It works only for this year.You can download the .class file here, run it in your own system and test it. Any queries are accepted and answered. 

Thursday, April 7, 2011

CREATION OF STATIC LIBRARIES IN LINUX

An archive is a single file holding a collection of other files in a structure that makes it possible to retrieve the original individual files (called members of the archive). A static library is an archive whose members are object files. A library makes it possible for a program to use common routines without the administrative overhead of maintaining their source code, or the processing overhead of compiling them each time the program is compiled. Conventionally, static libraries end with the ``.a'' suffix. Dynamic linking involves loading the subroutines of a library into an application program at load time or runtime, rather than linking them in at compile time. With static linking, it is enough to include those parts of the library that are directly and indirectly referenced by the target executable (or target library).
Implementation:
The XXX.c file containing the code for library is converted into object file. Then, the archiver (ar) is invoked to produce a static library (named libXXXX.a) out of the object file XXX.o. It is important to note that the library must start with the three letters lib and have the suffix .a since it is static however shared libraries have .so as suffix.When a program needs a function, that is stored in a static library,it includes the header file that declares the function.The program that uses the library should be linked with it and linking is done using the gcc commands(-lname).The user program is then executed to obtain the output.The striking feature of static linking is that it avoids dependency problems and increases reusability.

Monday, March 28, 2011

PERSONAL CALENDAR



Using personal calendars we can personalise our significant events.This personal calendar is based on java application.

The interface is for regular users to browse and edit their calendars.The initial display consists of one window which consists of two parts:command menu and regular monthly display.

The File menu contains typical commands for manipulating data files . 'File New' opens a new calendar in a new display window. 'File Open' opens an existing calendar from a previously saved file, displaying it in the current display window or a new window as selected by the user. 'File Close' closes the currently active calendar, offering to save if it has been modified since opening. (The currently active calendar is the one on which the user has most recently performed a command.)'File Save' saves the currently active calendar on the file from which it was opened, or on a new file if it was created from a new display.

The View menu allows the user to browse through a calendar in a variety of ways.'View Item' displays the scheduling details for a selected scheduled item. 'View Day' displays details of the currently selected calendar day. 'View Week' displays the seven-day week in which the currently selected day appears, with less detail than the daily display. Weeks can be displayed in tabular or list format.'View Goto Date' displays a dialog for choosing a specific date to become the current date in the active display.

Appointment scheduling is one of the most commonly performed operations with the Calendar system.To schedule an appointment, the user selects the 'Appointment' command in the Schedule menu, In response, the system displays the dialog.The 'Title' field is a one-line string that describes the appointment briefly. The 'Date' field contains the date on which the appointment is to occur.Appointment Security is one of four levels: 'public', 'title only', 'confidential', and private.


Sunday, March 27, 2011

VIRTUAL TABLE

(Team 2 : 71,49,31,30,29,23,876).


          A  Virtual Table or Vtable is a mechanism used in a programming language to support dynamic dispatch or dynamic polymorphism where run time binding is done. The virtual table is a lookup table of functions used to resolve function calls in dynamic binding.
          Suppose a program contains several classes in an inheritance hierarchy i.e., a superclass and two subclasses and when the program calls the virtual function on a superclass pointer or any of the subclass pointers,the run time environment must be able to determine which implementation to call,depending on the actual type of the object that is pointed to. There are a variety of different ways to implement such dynamic dispatch,but the vtable solution is common among C++ and its related languages ,because it allows objects to use a different implementation simply by using a different set of method pointers.
        The virtual table is actually quite simple, though it’s a little complex to describe in words.

Implementation of VTABLE:


        Every class that uses virtual functions (or is derived from a class that uses virtual functions) is given it’s own virtual table. This table is simply a static array that the compiler sets up at compile time. A virtual table contains one entry for each virtual function that can be called by objects of the class. Each entry in this table is simply a function pointer that points to the most-derived function accessible by that class. An object's dispatch table or vtable will contain the addresses of the object's dynamically bound methods. Method calls are performed by fetching the method's address from the object's dispatch table. The virtual table is the same for all objects belonging to the same class, and is therefore typically shared between them. Objects belonging to type-compatible classes (for example siblings in an inheritance hierarchy) will have dispatch tables with the same layout: the address of a given method will appear at the same offset for all type-compatible classes. Thus, fetching the method's address from a given dispatch table offset will get the method corresponding to the object's actual class.
       The compiler also adds a hidden pointer to the base class, which we will call  as Vpointer or virtual pointer or vptr .vptr is set (automatically) when a class instance is created so that it points to the virtual table for that class. Unlike the *this pointer, which is actually a function parameter used by the compiler to resolve self-references, vptr is a real pointer. Consequently, it makes each class object allocated bigger by the size of one pointer. It also means that vptr is inherited by derived classes, which is important.  The compiler also generates "hidden" code in the constructor of each class to initialize the vpointers of its objects to the address of the corresponding vtable.