Monday, February 28, 2011

Advantages and Disadvantages to Using MySQL Vs MS SQL

Two of the most popular database systems used by web developers today are MySQL and Microsoft's MS SQL server. Both are similar in regards to being storage and retrieval systems. The two systems support primary keys, along with key indices which allow you to speed up queries and constrain input. Furthermore, both systems offer some form of support for XML.

Apart from price, which is the obvious difference, what distinguishes these two systems, and which one is right for you? We'll overview both products, point out the major differences and explain the advantages and disadvantages of using them for your business.

Open-source vs. Proprietary

When it comes to these two databases, the differences begin with the open-source nature of MySQL vs. the closed, proprietary structure of the SQL Server. MySQL is an extensible, open storage database engine, offering multiple variations such as Berkeley DB, InnoDB, Heap and MyISAM. On the other hand, with the Microsoft product, you are limited to a Sybase-derived engine through both the good and bad times.

When considering how MySQL integrates seamlessly with a number of programming languages and other web-based technologies, it certainly has the advantage over MS SQL in the way of compatibility, as the SQL Server is known to work better with other Microsoft products.

Licensing

Contrary to popular belief, the MySQL system isn't always free. On the other hand, it is always more affordable. In regard to both products, licensing fees are based on a two-tiered scheme. With MS SQL, the best way to obtain a developer's license is to buy a license for the Microsoft Developer or Microsoft Visual Studio suite. Both provide you with a free SQL Server license for development use. If you want to use the product in a commercial environment, you need to at least purchase the SQL Server Standard Edition - which could set you back over $1,000 for a few client connections.

Because MySQL is an open-source system under the GNU General Public License, developers can use it at no cost as long as the associated projects are also open-source. However, if you intend to sell your software as a proprietary product, you would need to purchase a commercial license, which costs about $400 for up to nine clients. Depending on the project and your funds, MySQL may have the advantage here.

Technical Differences

The open-source vs. proprietary battle alone is a leading cause why some users choose one system over the other. However, there are a few differences from a technical aspect as well.

For instance, MySQL doesn't offer full support for foreign keys, meaning it doesn't have all the relational features of MS SQL, which is considered a complete relational database. Some versions of MySQL also lack full support for stored procedures - the biggest disadvantage being the MyISAM system, which doesn't support transactions.

Performance

In the way of performance, MySQL is the clear leader, mainly due to the format of its default table, MyISAM. MyISAM databases leave a small footprint using little disk space, memory and CPU. While the system runs on the Windows platform without flaw, it tends to perform better on Linux and other UNIX-like systems. Because of its stability, many internet powerhouses such as Yahoo! use MySQL as their back-end database.

When it comes to performance, MS SQL's strength of being packed with more features than other systems is perhaps its biggest disadvantage. Although most of these features are designed for performance tuning, they tend to sacrifice other essential elements. The cost here is complexity and the hogging of resources in the way of storage and memory, which leads to poorer performance. If you lack the knowledge and sufficient hardware to support an SQL server, you would be better off with another database management system.

Security

These two database systems are pretty much deadlocked in regards to security. Both come with adequate security mechanisms by default, bearing you follow the directions and keep the software updated with security patches. Both operate over known IP ports which unfortunately attracts a wealth of intruders, a downside that can be attributed to both products. The good thing is that MySQL and MS SQL allow you to change ports just in case the default becomes too vulnerable.

Recovery

As far as recovery goes, the SQL Server has a definite advantage over MySQL, which tends to fall a little short with its MyISAM configuration. A UPS system is mandatory with MyISAM as it assumes uninterrupted operation. If a power outage should occur, it could result in the corruption and loss of critical data. With the SQL Server, data corruption is more unlikely. The data travels through various checkpoints while passing from your keyboard to the hard disk and through the monitor. Additionally, the SQL Server keeps track of the process, even if the system unexpectedly shuts down.

The Best Choice

As you can see, both systems have their advantages and disadvantages. From our perspective, any product that allows you to be efficient is a good database; anything other than that isn't worthy of your time and frustration. When it comes to MySQL and MS SQL, the decision all boils down to the situation and most importantly, what you're looking to accomplish.

Thursday, February 24, 2011

Video Editing Software

1) Windows Movie Maker 2.6 : Microsoft has made version 2.6 of Movie Maker available for download, and it runs on both Windows Vista and Windows 7. While advanced users are likely using a more sophisticated video editing program, there’s no denying that Movie Maker is an excellent, full-featured option for the average home user.


2) VirtualDub : VirtualDub is a video capture/processing utility for 32-bit and 64-bit Windows platforms (98/ME/NT4/2000/XP/Vista/7), licensed under the GNU General Public License (GPL). It lacks the editing power of a general-purpose editor such as Adobe Premiere, but is streamlined for fast linear operations over video. It has batch-processing capabilities for processing large numbers of files and can be extended with third-party video filters. VirtualDub is mainly geared toward processing AVI files, although it can read (not write) MPEG-1 and also handle sets of BMP images.

3) T@b ZS4 Video Editor : ZS4 Video Editor is free to download and use. It is video editing and compositing software which aims to provide media experts with a facility to combine a variety of media types(currently photos, videos and audio files) into one or more output files.

4) Wax : Wax is a high performance and flexible video compositing and special effects software. The idea for Wax is to be very general purpose and flexible in video compositing and effects, so that you can compose your dream video sequence with ease everytime.Wax can create 2D & 3D special effects and can work in two modes – as a standalone application which would appeal for home users/beginners, and as a “plug-in” to video editors/NLEs which would be more useful for professional editors.

5) Cinefx Jashaka : Cinefx is an offline playback, editing, encoding, animation and visual effects tool based on the Jahshaka technology that allows you to create professional digital media on your desktop. Use the tools that hollywood uses to create blockbuster films and special effects.

6) Blender : Blender is the free open source 3D content creation suite, available for all major operating systems under the GNU General Public License. It is one of the powerful, multi-use editing/compositing and modeling tool. This tool allows you to edit, create 3D graphics, sound effects, add special effects and much more.

7) Avidemux : Avidemux is a free video editor designed for simple cutting, filtering and encoding tasks. It supports many file types, including AVI, DVD compatible MPEG files, MP4 and ASF, using a variety of codecs. Tasks can be automated using projects, job queue and powerful scripting.

8 ) MovieStorm : Moviestorm is the complete 3D movie making software application for all abilities. Whether your movie interest is cartoons, crime, music, horror etc, you can create awesome animation effects using this software.

9) Movica : Movica is just a graphical user interface that uses some fine programs to edit movie files. A great deal of emphasis has been placed on keyboard shortcuts to make the job of editing easier. Basically, it is meant for editing the kind of movies that VirtualDub won’t. V-Dub is primarily an AVI editor, Movica will work on .wmv, .flv, .rm and .mpg files. This makes it more versatile than Virtualdub.

10) Video Spin : VideoSpin, free editor based on Studio, does a pretty darn good job compared with most free video tools. It doesn’t match the qualities of paid softwares but perform basic editing and output movies pretty easily.

11) AVIedit : It is a great tool to work with .AVI files. Regardless of small executable size, this avi editor offers you unlimited power of digital video processing. AVIedit allows you to join and split avi files, extract frames and do whatever you want… You can capture video by number of ways, including one-frame-per-minute (web camera) option, workaround annoying 2 Gb file size limit, send your videos to printer, heavy compress it and post to your webpage.

12) StoryBoard Pro Software : Atomic Learning’s FREE Video StoryBoard Pro is designed to give teachers, students, and home movie makers a tool to plan ahead when creating video projects. It features the ability to enter shot titles and descriptions, complete with planned lengths and edited order, indicate shot types: video, still, audio, music, or titles and much more.

13) AVI Trimmer : SolveigMM AVI Trimmer is a free video editor for fast and lossless AVI editing. This freeware AVI editor is small, smart, easy to use and involves no encoding/decoding processes. No video / audio degradation and out of sync problem arises after editing. All AVI file types of any size and video / audio content are supported.

14) Zwei-Stien Video Editor : Zwei-Stein 3.01 is a freeware non-linear, non-destructive video compositing and editing system which offers many advanced features unavailable elsewhere. With Zwei-Stein you can edit up to 256 video, audio and still image clips, each with up to 64 effects chained serially. Cropping, panning and custom effects are easy with automatic key frames.

15) DVDVideoSoft Free : A pretty basic software to edit video and audio files. Free Studio is a single package which bundles all free software from DVDVideoSoft to work with DVD, video and audio files. With this free software you can convert video and audio files between different formats and to iPod, PSP, iPhone, BlackBerry and other portable devices; burn and rip DVDs and audio CDs; upload and download videos and music to your computer, iPod, PSP, iPhone and BlackBerry; perform basic editing of audio and video files.

16) AVITricks Video Editor : AviTricks is a non-linear, non-destructive AVI video editor with real-time preview. It makes cutting and joining footage easy and includes a wide range of built-in adjustable effects that can be used separately or in combination. (Effects include dissolves, mirror image, sepia, iris effects, fades, TV-shop and many more.) Besides the preview screen, the video you are working on is also represented clearly and graphically on a timeline and a tree-structure. Both of these fields are active and easy to work.

17) DVD Knife : DVD Knife is a simple tool for extracting DVD clips from your DVD’s.The clips will be stored in VOB format only. This is the simplest and fastest tool in its category which has ability to extract long VOB clips in few seconds.Its so simple that only three steps can extract the clip ie “Select start” – “Select end” – “Save”. So get your favorite movie or film scenes stored seperately now. It is compatible with Windows XP. I hope this little free tool will come for Vista or 7 in he future.

18) Mewa Film : It is a non-linear editing tool, called montage (this name might change) where video files are shown as a sequence of images layed off horizontally. The video files can then be assembled and cuted using intuitive actions as “drag and drop” and “rubberband selection”.

Monday, February 7, 2011

Zend Framework: PHP + MVC + More!

Zend Framework is an open-source software framework for PHP5. It has a flexible architecture that lets you build interactive web applications and web services effortlessly. One of its strengths is the highly modular Model-View-Controller design, which makes the code more reusable and easier to maintain and lets you focus on the big picture.

Model-view-controller is an architectural pattern used in software engineering. Complex computer applications present a large amount of data to the user. A developer often wishes to separate data (model) and user interface (view) concerns. This enables him to make changes to the user interface without affecting data handling, and reorganize data without changing the user interface. MVC solves this problem by introducing an intermediate component: the controller. The controller decouples data access and business logic from data presentation and user interaction.

Zend Framework has further enhanced PHP and improved its candidature for use within an enterprise environment. It aims to:

* Provide a repository of high quality components that are actively supported.
* Provide a complete system for developing web applications powered by PHP5.
* Don’t change the PHP – it’s already a great platform.
* Embrace collaboration and community to further advanced PHP5 programming.
* Positively contribute to the PHP 5 ecosystem and the PHP collaboration project.

Advantages of Zend Framework include:

§ MVC application framework – Zend Framework’s model-view-controller architecture provides an industry best practice for Web application development. It enables the separation of business logic from user interface design.

§ Database support- Access multiple brands of RDBMS via a database-independent object-oriented interface. Databases supported include IBM DB2, MySQL, Oracle, Microsoft SQL Server, PostgreSQL and SQLite.

§ Internationalization – Zend Framework supports advanced yet simple solutions to develop PHP 5 Web applications for a global audience.

§ Web services – Use classes to publish and consume Web services and feeds in PHP.

§ Foundation Framework services – Zend Framework provides many other classes to make common application development tasks quick and easy. For example, solutions for email, sessions, authentication, logging, caching, filtering input, and others are included.

Built in the true PHP spirit, the Zend Framework delivers ease-of-use and powerful functionality. It implements best practices in connecting the application to databases and networks. And so, it frees the developer to concentrate on user interactions and the business logic behind them.

All in all, Zend Framework provides much required “face-lift” to PHP and facilitates powerful solutions for building modern, robust, and secure websites.

Sunday, February 6, 2011

change the default developement environment in Visual Studio 2008, 2010

How do I change the default developement environment in Visual Studio 2008, 2010?

answer:

Use the Import and Export Setting Wizard:

1. Choose Tools -> Import and Export Settings...
2. Select Reset All Settings and click Next
3. Select whether you would like to save the current settings and click Next
4. Select the settings you want to use and click Finish

Thursday, January 27, 2011

Java Interview Questions

Java Interview Questions
Question: What if the main method is declared as private?
Question: What if the static modifier is removed from the signature of the main
method?
Question: What if I write static public void instead of public static void?
Q:Question:What if I do not provide the String array as the argument to the
method?
Question: What is the first argument of the String array in main method?
Question: If I do not provide any arguments on the command line, then the String
array of Main method will be empty of null?
Question: How can one prove that the array is not null but empty?
Question: What environment variables do I need to set on my machine in order to
be able to run Java programs?
Question: Can an application have multiple classes having main method?
Question: Can I have multiple main methods in the same class?
Question: Do I need to import java.lang package any time? Why ?
Question: Can I import same package/class twice? Will the JVM load the package
twice at runtime?
Question: What are Checked and UnChecked Exception?
Question: What is Overriding?
Question: What are different types of inner classes?
Q:What if the main method is declared as private?
A:The program compiles properly but at runtime it will give "Main method not
public." message.
[ Received from Sandesh Sadhale] TOP
Q:What if the static modifier is removed from the signature of the main
method?
A:Program compiles. But at runtime throws an error "NoSuchMethodError".
[ Received from Sandesh Sadhale] TOP
Q:What if I write static public void instead of public static void?
A:Program compiles and runs properly.
[ Received from Sandesh Sadhale] TOP
Q:What if I do not provide the String array as the argument to the method?
A:Program compiles but throws a runtime error "NoSuchMethodError".
[ Received from Sandesh Sadhale] TOP
Q:What is the first argument of the String array in main method?
A:The String array is empty. It does not have any element. This is unlike C/C++
where the first element by default is the program name.
[ Received from Sandesh Sadhale] TOP
Q:If I do not provide any arguments on the command line, then the String
array of Main method will be empty of null?
A:It is empty. But not null.
[ Received from Sandesh Sadhale] TOP
Q:How can one prove that the array is not null but empty?
A:Print args.length. It will print 0. That means it is empty. But if it would have been
null then it would have thrown a NullPointerException on attempting to print
args.length.
[ Received from Sandesh Sadhale] TOP
Q:What environment variables do I need to set on my machine in order to
be able to run Java programs?
A:CLASSPATH and PATH are the two variables.
[ Received from Sandesh Sadhale] TOP
Q:Can an application have multiple classes having main method?
A:Yes it is possible. While starting the application we mention the class name to be
run. The JVM will look for the Main method only in the class whose name you have
mentioned. Hence there is not conflict amongst the multiple classes having main
method.
[ Received from Sandesh Sadhale] TOP
Q:Can I have multiple main methods in the same class?
A:No the program fails to compile. The compiler says that the main method is
already defined in the class.
[ Received from Sandesh Sadhale] TOP
Q:Do I need to import java.lang package any time? Why ?
A:No. It is by default loaded internally by the JVM.
[ Received from Sandesh Sadhale] TOP
Q:Can I import same package/class twice? Will the JVM load the package
twice at runtime?
A:One can import the same package or same class multiple times. Neither compiler
nor JVM complains abt it. And the JVM will internally load the class only once no
matter how many times you import the same class.
[ Received from Sandesh Sadhale] TOP
Q:What are Checked and UnChecked Exception?
A:A checked exception is some subclass of Exception (or Exception itself), excluding
class RuntimeException and its subclasses.
Making an exception checked forces client programmers to deal with the possibility
that the exception will be thrown. eg, IOException thrown by
java.io.FileInputStream's read() method·
Unchecked exceptions are RuntimeException and any of its subclasses. Class Error
and its subclasses also are unchecked. With an unchecked exception, however, the
compiler doesn't force client programmers either to catch the
exception or declare it in a throws clause. In fact, client programmers may not
even know that the exception could be thrown. eg,
StringIndexOutOfBoundsException thrown by String's charAt() method· Checked
exceptions must be caught at compile time. Runtime exceptions do not need to
be. Errors often cannot be.
TOP
Q:What is Overriding?
A:When a class defines a method using the same name, return type, and arguments
as a method in its superclass, the method in the class overrides the method in the
superclass.
When the method is invoked for an object of the class, it is the new definition of
the method that is called, and not the method definition from superclass. Methods
may be overridden to be more public, not more private.
TOP
Q:What are different types of inner classes?
A:Nested top-level classes, Member classes, Local classes, Anonymous classes
Nested top-level classes- If you declare a class within a class and specify the
static modifier, the compiler treats the class just like any other top-level class.
Any class outside the declaring class accesses the nested class with the declaring
class name acting similarly to a package. eg, outer.inner. Top-level inner classes
implicitly have access only to static variables.There can also be inner interfaces.
All of these are of the nested top-level variety.
Member classes - Member inner classes are just like other member methods and
member variables and access to the member class is restricted, just like methods
and variables. This means a public member class acts similarly to a nested toplevel
class. The primary difference between member classes and nested top-level
classes is that member classes have access to the specific instance of the
enclosing class.
Local classes - Local classes are like local variables, specific to a block of code.
Their visibility is only within the block of their declaration. In order for the class to
be useful beyond the declaration block, it would need to implement a
more publicly available interface.Because local classes are not members, the
modifiers public, protected, private, and static are not usable.
Anonymous classes - Anonymous inner classes extend local inner classes one
level further. As anonymous classes have no name, you cannot provide a
constructor.

C++ questions

what is C++?
Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management. 

C++ used for:
C++ is a powerful general-purpose programming language. It can be used to create small programs or large applications. It can be used to make CGI scripts or console-only DOS programs. C++ allows you to create programs to do almost anything you need to do. The creator of C++, Bjarne Stroustrup, has put together a partial list of applications written in C++.


1. What is a modifier?
A modifier, also called a modifying
function is a member function that
changes the value of at least one
data member. In other words, an
operation that modifies the state
of an object. Modifiers are also
known as ‘mutators’. Example:
The function mod is a modifier in the
following code snippet:

class test
{
int x,y;
public:
test()
{
x=0; y=0;
}
void mod()
{
x=10;
y=15;
}
};
2. What is an accessor?
An accessor is a class operation that does not modify the state of an object. The accessor functions need to be declared as const operations
3. Differentiate between a template class and class template.
Template class: A generic definition or a parameterized class not instantiated until the client provides the needed information. It’s jargon for plain templates. Class template: A class template specifies how individual classes can be constructed much like the way a class specifies how individual objects can be constructed. It’s jargon for plain classes.
4. When does a name clash occur?
A name clash occurs when a name is defined in more than one place. For example., two different class libraries could give two different classes the same name. If you try to use many class libraries at the same time, there is a fair chance that you will be unable to compile or link the program because of name clashes.


5. Define namespace.
It is a feature in C++ to minimize name collisions in the global name space. This namespace keyword assigns a distinct name to a library that allows other libraries to use the same identifier names without creating any name collisions. Furthermore, the compiler uses the namespace signature for differentiating the definitions.


6. What is the use of ‘using’ declaration.
A using declaration makes it possible to use a name from a namespace without the scope operator.

7. What is an Iterator class?
A class that is used to traverse through the objects maintained by a container class. There are five categories of iterators: input iterators, output iterators, forward iterators, bidirectional iterators, random access. An iterator is an entity that gives access to the contents of a container object without violating encapsulation constraints. Access to the contents is granted on a one-at-a-time basis in order. The order can be storage order (as in lists and queues) or some arbitrary order (as in array indices) or according to some ordering relation (as in an ordered binary tree). The iterator is a construct, which provides an interface that, when called, yields either the next element in the container, or some value denoting the fact that there are no more elements to examine. Iterators hide the details of access to and update of the elements of a container class.
The simplest and safest iterators are those that permit read-only access to the contents of a container class.

10. What is an incomplete type?
Incomplete types refers to pointers in which there is non availability of the implementation of the referenced location or it points to some location whose value is not available for modification. 

int *i=0x400 // i points to address 400
*i=0; //set the value of memory location pointed by i. 

Incomplete types are otherwise called uninitialized pointers.
11. What is a dangling pointer?

A dangling pointer arises when you use
the address of an object after
its lifetime is over. This may occur
in situations like returning
addresses of the automatic variables
from a function or using the
address of the memory block after
it is freed. The following
code snippet shows this:

class Sample
{
public:
int *ptr;
Sample(int i)
{
ptr = new int(i);
}

~Sample()
{
delete ptr;
}
void PrintVal()
{
cout << "The value is " << *ptr;
}
};

void SomeFunc(Sample x)
{
cout << "Say i am in someFunc " << endl;
}

int main()
{
Sample s1 = 10;
SomeFunc(s1);
s1.PrintVal();
}

In the above example when PrintVal() function is
called it is called by the pointer that has been
freed by the destructor in SomeFunc.

12. Differentiate between the message and method.
Message:
* Objects communicate by sending messages to each other.
* A message is sent to invoke a method.

Method
* Provides response to a message.
* It is an implementation of an operation.

13. What is an adaptor class or Wrapper class?
A class that has no functionality of its own. Its member functions hide the use of a third party software component or an object with the non-compatible interface or a non-object-oriented implementation.
14. What is a Null object?
It is an object of some class whose purpose is to indicate that a real object of that class does not exist. One common use for a null object is a return value from a member function that is supposed to return an object with some specified properties but cannot find such an object.
15. What is class invariant?
A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and post-conditions for all operations or member functions of the class.
16. What do you mean by Stack unwinding?
It is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught.
17. Define precondition and post-condition to a member function.
Precondition: A precondition is a condition that must be true on entry to a member function. A class is used correctly if preconditions are never false. An operation is not responsible for doing anything sensible if its precondition fails to hold. For example, the interface invariants of stack class say nothing about pushing yet another element on a stack that is already full. We say that isful() is a precondition of the push operation. Post-condition: A post-condition is a condition that must be true on exit from a member function if the precondition was valid on entry to that function. A class is implemented correctly if post-conditions are never false. For example, after pushing an element on the stack, we know that isempty() must necessarily hold. This is a post-condition of the push operation.
19. What are proxy objects?
Objects that stand for other objects are called proxy objects or surrogates. 
template
class Array2D
{
public:
class Array1D
{
public:
T& operator[] (int index);
const T& operator[] (int index)const;
};

Array1D operator[] (int index);
const Array1D operator[] (int index) const;
};

The following then becomes legal:

Array2Ddata(10,20);
cout<
Here data[3] yields an Array1D object and the operator [] invocation on that object yields the float in position(3,6) of the original two dimensional array. Clients of the Array2D class need not be aware of the presence of the Array1D class. Objects of this latter class stand for one-dimensional array objects that, conceptually, do not exist for clients of Array2D. Such clients program as if they were using real, live, two-dimensional arrays. Each Array1D object stands for a one-dimensional array that is absent from a conceptual model used by the clients of Array2D. In the above example, Array1D is a proxy class. Its instances stand for one-dimensional arrays that, conceptually, do not exist.
20. Name some pure object oriented languages.
Smalltalk, Java, Eiffel, Sather.
22. What is a node class?
A node class is a class that,
* relies on the base class for services and implementation,
* provides a wider interface to the users than its base class,
* relies primarily on virtual functions in its public interface
* depends on all its direct and indirect base class
* can be understood only in the context of the base class
* can be used as base for further derivation
* can be used to create objects.
A node class is a class that has added new services or functionality beyond the services inherited from its base class.
23. What is an orthogonal base class?
If two base classes have no overlapping methods or data they are said to be independent of, or orthogonal to each other. Orthogonal in the sense means that two classes operate in different dimensions and do not interfere with each other in any way. The same derived class may inherit such classes with no difficulty.
24. What is a container class? What are the types of container classes?
A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behavior and a well-known interface. A container class is a supporting class whose purpose is to hide the topology used for maintaining the list of objects in memory. When a container class contains a group of mixed objects, the container is called a heterogeneous container; when the container is holding a group of objects that are all the same, the container is called a homogeneous container.
26. What is polymorphism?
Polymorphism is the idea that a base class can be inherited by several classes. A base class pointer can point to its child class and a base class array can store different child class objects.
28. How can you tell what shell you are running on UNIX system?
You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID.
29. What is Boyce Codd Normal form?
A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a->b, where a and b is a subset of R, at least one of the following holds: 

* a->b is a trivial functional dependency (b is a subset of a)
* a is a superkey for schema R
30. What is pure virtual function?
A class is made abstract by declaring one or more of its virtual functions to be pure. A pure virtual function is one with an initializer of = 0 in its declaration
32. How do you traverse a Btree in Backward in-order?
Process the node in the right subtree
Process the root
Process the node in the left subtree
33. What is the two main roles of Operating System?
As a resource manager
As a virtual machine
What is the difference between realloc() and free()?
The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.
What is function overloading and operator overloading?
Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types. 
Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).
What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration 
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j > =0; j--) //function body
cout << *;
cout << endl; }
What do you mean by inline function?
The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables.
What is public, protected, private?
Public, protected and private are three access specifiers in C++.
Public data members and member functions are accessible outside the class.
Protected data members and member functions are only available to derived classes.
Private data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes.
What is a template?
Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones:


template function_declaration; template function_declaration; 

The only difference between both prototypes is the use of keyword class or typename, its use is indistinct since both expressions have exactly the same meaning and behave exactly the same way.
What is the difference between an ARRAY and a LIST?
Answer1
Array is collection of homogeneous elements.
List is collection of heterogeneous elements. 

For Array memory allocated is static and continuous.
For List memory allocated is dynamic and Random. 

Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated. 

Answer2
Array uses direct access of stored members, list uses sequencial access for members.

//With Array you have direct access to memory position 5
Object x = a[5]; // x takes directly a reference to 5th element of array

//With the list you have to cross all previous nodes in order to get the 5th node:
list mylist;
list::iterator it;

for( it = list.begin() ; it != list.end() ; it++ )
{
if( i==5)
{
x = *it;
break;
}
i++;
}

What is n-Tier Architecture?

What is n-Tier Architecture?

This is a very important topic to consider when developing an application. Many elements need to be considered when deciding on the architecture of the application, such as performance, scalability and future development issues. When you are deciding on which architecture to use, first decide on which of the three aforementioned elements you think is most valuable -- as some choices you make will impact on others. For example, some choices that boost performance will impact on the scalability or future development of your design, etc.

Here we will talk generally about what n-Tier architecture is, and then we will have a look at different n-Tier architectures you can use to develop ASP.NET applications and issues that arise relating to performance, scalability and future development issues for each one.

Firstly, what is n-Tier architecture? N-Tier architecture refers to the architecture of an application that has at least 3 "logical" layers -- or parts -- that are separate. Each layer interacts with only the layer directly below, and has specific function that it is responsible for.

Why use n-Tier architecture? Because each layer can be located on physically different servers with only minor code changes, hence they scale out and handle more server load. Also, what each layer does internally is completely hidden to other layers and this makes it possible to change or update one layer without recompiling or modifying other layers.

This is a very powerful feature of n-Tier architecture, as additional features or change to a layer can be done without redeploying the whole application. For example, by separating data access code from the business logic code, when the database servers change you only needs to change the data access code. Because business logic code stays the same, the business logic code does not need to be modified or recompiled.

[Note] tier and layer mean the same thing [End Note]

An n-Tier application usually has three tiers, and they are called the presentation tier, the business tier and the data tier. Let's have a look at what each tier is responsible for.

Presentation Layer
Presentation Layer is the layer responsible for displaying user interface and "driving" that interface using business tier classes and objects. In ASP.NET it includes ASPX pages, user controls, server controls and sometimes security related classes and objects.

Business Tier
Business Tier is the layer responsible for accessing the data tier to retrieve, modify and delete data to and from the data tier and send the results to the presentation tier. This layer is also responsible for processing the data retrieved and sent to the presentation layer.

In ASP.NET it includes using SqlClient or OleDb objects to retrieve, update and delete data from SQL Server or Access databases, and also passing the data retrieved to the presentation layer in a DataReader or DataSet object, or a custom collection object. It might also include the sending of just an integer, but the integer would have been calculated using the data in the data tier such as the number of records a table has.

BLL and DAL
Often this layer is divided into two sub layers: the Business Logic Layer (BLL), and the Data Access Layers (DAL). Business Logic Layers are above Data Access Layers, meaning BLL uses DAL classes and objects. DAL is responsible for accessing data and forwarding it to BLL.

In ASP.NET it might be using SqlClient or OleDb to retrieve the data and sending it to BLL in the form of a DataSet or DataReader. BLL is responsible for preparing or processing the data retrieved and sends it to the presentation layer. In ASP.NET it might be using the DataSet and DataReader objects to fill up a custom collection or process it to come up with a value, and then sending it to Presentation Layer. BLL sometimes works as just transparent layer. For example, if you want to pass a DataSet or DataReader object directly to the presentation layer.

Data Tier
Data tier is the database or the source of the data itself. Often in .NET it's an SQL Server or Access database, however it's not limited to just those. It could also be Oracle, mySQL or even XML. In this article we will focus on SQL Server, as it has been proven to be the fastest database within a .NET Application.

Logical Layers vs. Physical Layers (Distributed)
Logical Layers and Physical Layers are the ones that confuse people. Firstly, a logical layer means that layers are separate in terms of assembly or sets of classes, but are still hosted on the same server. Physical layer means that those assemblies or sets of classes are hosted on different servers with some additional code to handle the communication between the layers. E.g. remoting and web services.

Deciding to separate the layers physically or not is very important. It really depends on the load your application expects to get. I think it's worth mentioning some of the facts that might affect your decision.

Please DO note that separating the layers physically WILL slow your application down due to the delay in communicating between the servers throughout the network, so if you are using the physical layer approach, make sure the performance gain is worth the performance loss from this.

Hopefully you would have designed your application using the n-Tier approach. If this is the case, then note that you can separate the layers in the future.

Cost for deploying and maintaining physically separated applications is much greater. First of all, you will need more servers. You also need network hardware connecting them. At this point, deploying the application becomes more complex too! So decide if these things will be worth it or not.

Another fact that might affect your decision is how each of the tiers in the application are going to be used. You will probably want to host a tier on a separate server if more than 1 service is dependent on it, e.g. You might want to host business logic somewhere else if you have multiple presentation layers for different clients. You might also want a separate SQL server if you have other applications using the same data.

what is the difference between 1-tier,2-tier,3-tier,and n-tier architecture

The term Architecture in IT generally refers to Client Server Architecture. A client is defined as a requester of services and a server is defined as the provider of services. A single machine can be both a client and a server depending on the software configuration. There are different types of Client-Server architecture available. Some of them are 2-tier architecture, 3 tier architecture, 4 tier architecture and n tier architecture.

2-tier architecture
In 2-tier, the application logic is either buried inside the User Interface on the client or within the database on the server (or both). With two tier client/server architectures (see Two Tier Software Architectures), the user system interface is usually located in the user's desktop environment and the database management services are usually in a server that is a more powerful machine that services many clients. Processing management is split between the user system interface environment and the database management server environment. The database management server provides stored procedures and triggers

3-tier architecture
In 3-tier, the application logic (or) process lives in the middle-tier, it is separated from the data and the user interface. 3-tier systems are more scalable, robust and flexible. In addition, they can integrate data from multiple sources. In the three tier architecture, a middle tier was added between the user system interface client environment and the database management server environment. There are a variety of ways of implementing this middle tier, such as transaction processing monitors, message servers, or application servers. The middle tier can perform queuing, application execution, and database staging. For example, if the middle tier provides queuing, the client can deliver its request to the middle layer and disengage because the middle tier will access the data and return the answer to the client. In addition the middle layer adds scheduling and prioritization for work in progress. The three tier client/server architecture has been shown to improve performance for groups with a large number of users (in the thousands) and improves flexibility when compared to the two tier approach. Flexibility in partitioning can be a simple as "dragging and dropping" application code modules onto different computers in some three tier architectures. A limitation with three tier architectures is that the development environment is reportedly more difficult to use than the visually-oriented development of two tier applications. The most basic type of three tier architecture has a middle layer consisting of Transaction Processing (TP) monitor technology. The TP monitor technology is a type of message queuing, transaction scheduling, and prioritization service where the client connects to the TP monitor (middle tier) instead of the database server. The transaction is accepted by the monitor, which queues it and then takes responsibility for managing it to completion, thus freeing up the client.

4-tier Architecture
In a 4-tier architecture, all of the data storage and retrieval processes are logically and usually physically located on a single tier. A 4-tier architecture allows an unlimited number of programs to run simultaneously, send information to one another, use different protocols to communicate, and interact concurrently. This allows for a much more powerful application, providing many different services to many different clients. In this application we will have following 4-Tiers
1. Business Object [BO]
2. Business Access Layer [BAL]
3. Data Access Layer [DAL]
4. UI (4-Tier) folder [UI]

3-Tier Architecture..
There are three layers in 3-tier architecture.
1.GUI Layer
2.Object Layer
3.Database Layer
Verify these links for 3-Tier Architecture..
http://www.sum-it.nl/en200037.php3
http://www.codeproject.com/KB/architecture/three_tier_architecture.aspx

N-Tier Architecture..
It refers to the architecture of an application that has at least three logical parts ,that are separate.
Verify these links for N-Tier Architecture..
http://www.developerfusion.co.uk/show/3058/2/
http://www.pha.jhu.edu/~mmathis/seminar/ntier.html

Regards
Anthony rajan