Monday, March 4, 2013

Magento default administration name change



Magneto default administration console is called “admin” but it can be changed easily

The Magento default administration console is called “admin” but it can be changed easily.  You need to use an FTP program to access your site.  In the app/etc/ folder you’ll see a file named “local.xml”.

Locate the following code near the bottom of the file:

<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>

You’ll notice in the frontName tag there’s the current path to your administration console.  In this example and by default, it is named “admin”.

Monday, January 30, 2012

C Program to Print Pascal Triangle

#include
#include

void main(){

int a[15][15],i,j,rows,num=25,k;
printf("\n enter the number of rows:");
scanf("%d",&rows);
for(i=0;i=0;k--)
printf(" ");
for(j=0;j<=i;j++){
if(j==0||i==j){
a[i][j]=1;
}
else{
a[i][j]=a[i-1][j-1]+a[i-1][j];
}
printf("%4d",a[i][j]);
}
printf("\n");
}
getch();
}

Tuesday, January 24, 2012

OOPS Interview Questions and Answers

1) What is meant by Object Oriented Programming?
OOP is a method of programming in which programs are organised as cooperative collections of objects. Each object is an instance of a class and each class belong to a hierarchy.

2) What is a Class?
Class is a template for a set of objects that share a common structure and a common behaviour.

3) What is an Object?
Object is an instance of a class. It has state,behaviour and identity. It is also called as an instance of a class.

4) What is an Instance?
An instance has state, behaviour and identity. The structure and behaviour of similar classes are defined in their common class. An instance is also called as an object.

5) What are the core OOP’s concepts?
Abstraction, Encapsulation,Inheritance and Polymorphism are the core OOP’s concepts.

6) What is meant by abstraction?
Abstraction defines the essential characteristics of an object that distinguish it from all other kinds of objects. Abstraction provides crisply-defined conceptual boundaries relative to the perspective of the viewer. Its the process of focussing on the essential characteristics of an object. Abstraction is one of the fundamental elements of the object model.

7) What is meant by Encapsulation?
Encapsulation is the process of compartmentalising the elements of an abtraction that defines the structure and behaviour. Encapsulation helps to separate the contractual interface of an abstraction and implementation.

8) What is meant by Inheritance?
Inheritance is a relationship among classes, wherein one class shares the structure or behaviour defined in another class. This is called Single Inheritance. If a class shares the structure or behaviour from multiple classes, then it is called Multiple Inheritance. Inheritance defines “is-a” hierarchy among classes in which one subclass inherits from one or more generalised superclasses.

9) What is meant by Polymorphism?
Polymorphism literally means taking more than one form. Polymorphism is a characteristic of being able to assign a different behavior or value in a subclass, to something that was declared in a parent class.

10) What is an Abstract Class?
Abstract class is a class that has no instances. An abstract class is written with the expectation that its concrete subclasses will add to its structure and behaviour, typically by implementing its abstract operations.

11) What is an Interface?
Interface is an outside view of a class or object which emphaizes its abstraction while hiding its structure and secrets of its behaviour.

12) What is a base class?
Base class is the most generalised class in a class structure. Most applications have such root classes. In Java, Object is the base class for all classes.

13) What is a subclass?
Subclass is a class that inherits from one or more classes

14) What is a superclass?
superclass is a class from which another class inherits.

15) What is a constructor?
Constructor is an operation that creates an object and/or initialises its state.

16) What is a destructor?
Destructor is an operation that frees the state of an object and/or destroys the object itself. In Java, there is no concept of destructors. Its taken care by the JVM.

17) What is meant by Binding?
Binding denotes association of a name with a class.

18) What is meant by static binding?
Static binding is a binding in which the class association is made during compile time. This is also called as Early binding.

19) What is meant by Dynamic binding?
Dynamic binding is a binding in which the class association is not made until the object is created at execution time. It is also called as Late binding.

20) Define Modularity?
Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules.

21) What is meant by Persistence?
Persistence is the property of an object by which its existence transcends space and time.

22) What is colloboration?
Colloboration is a process whereby several objects cooperate to provide some higher level behaviour.

23) In Java, How to make an object completely encapsulated?
All the instance variables should be declared as private and public getter and setter methods should be provided for accessing the instance variables.

24) How is polymorphism acheived in java?
Inheritance, Overloading and Overriding are used to acheive Polymorphism in java.

oops

Polymorphism means one interface and many forms. Polymorphism is a characteristics of being able to assign a different meaning or usage to something in different contexts specifically to allow an entity such as a variable, a function or an object to have more than one form.

There are two types of Polymorphism.
Compile time: function or operator overloading
Runtime: Inheritence & virtual functions

Abstract method doesn't provide the implementation & forces the derived class to override the method.

Virtual Method has implementation & provide the derived class with the option to override it.

No, Struct can't be inherited as this is implicitly sealed.

Object is anything that is identifiable as a single material item.

A Class is the generic definition of what an object is a template.

The keyword class in C# indicates that we are going to define a new class (type of object)

To indicate that a field should only be stored once no matter how many instance of the class we create.


It is possible to declare a method as Static provided that they don't attempt to access any instance data or other instance methods.

It provides a convenient way to reuse existing fully tested code in different context thereby saving lot of coding.

Inheritance of classes in C# is always implementation Inheritance.

This keyword indicates that a member can be overridden in a child class. It can be applied to methods, properties, indexes and events.

The new modifiers hides a member of the base class. C# supports only hide by signature.

Abstract class is a class that can not be instantiated, it exists extensively for inheritance and it must be inherited. There are scenarios in which it is useful to define classes that is not intended to instantiate; because such classes normally are used as base-classes in inheritance hierarchies, we call such classes abstract classes.

Abstract classes cannot be used to instantiate objects; because abstract classes are incomplete, it may contain only definition of the properties or methods and derived classes that inherit this implements it's properties or methods.

Static, Value Types & interface doesn't support abstract modifiers. Static members cannot be abstract. Classes with abstract member must also be abstract.

For detailed example, read this article http://www.dotnetfunda.com/articles/article467-abstract-class--explained.aspx

Sealed types cannot be inherited & are concrete.
Sealed modifiers can also be applied to instance methods, properties, events & indexes. It can't be applied to static members.

Sealed members are allowed in sealed and non-sealed classes.

An interface is a contract & defines the requisite behavior of generalization of types.

An interface mandates a set of behavior, but not the implementation. Interface must be inherited. We can't create an instance of an interface.

An interface is an array of related function that must be implemented in derived type. Members of an interface are implicitly public & abstract.

An interface can inherit from another interface.

Abstract Classes: Classes which cannot be instantiated. This means one cannot make a object of this class or in other way cannot create object by saying ClassAbs abs = new ClassAbs(); where ClassAbs is abstract class.
Abstract classes contains have one or more abstarct methods, ie method body only no implementation.
Interfaces: These are same as abstract classes only difference is we can only define method definition and no implementation.
When to use wot depends on various reasons. One being design choice.
One reason for using abstarct classes is we can code common
functionality and force our developer to use it. I can have a complete
class but I can still mark the class as abstract.
Developing by interface helps in object based communication.

oops concept click the following link

http://www.interview-made-easy.com/p/c-faqs.html

http://www.coolinterview.com/type.asp?iType=143


http://www.techinterviews.com/master-list-of-java-interview-questions


http://www.bestsamplequestions.com/technical-questions/cpp-sample-questions/cpp-sample-questions.html

http://www.dotnetfunda.com/interview/showcatquestion.aspx?category=42

http://ananddesai.wordpress.com/2007/12/24/oops-interview-questions-and-answers-part-1/


http://www.roseindia.net/java/simple-java-program.shtml


http://www.java-samples.com/showtutorial.php?tutorialid=13


http://javapgms.blogspot.com/

Sample C Program To Accept & Add Ten Numbers Using Pointers.

#include
#include

void main ()
{

int i, total;
int arr[10];
int *a;

a = arr;
for ( i = 0; i < 10; i++ )
{
printf ( " Enter the number %d: ", i+1 );
scanf ( " %d ", &arr[i] );
}

for ( i = 0; i < 10; i++ )
{
printf ( " %d--- ", *a );
total = total + *a;
a = a + 1;
}

printf ("\nTotal = %d \n",total);

}

OUTPUT:

Enter the number 1: 1
Enter the number 2: 2
Enter the number 3: 3
Enter the number 4: 4
Enter the number 5: 5
Enter the number 6: 6
Enter the number 7: 7
Enter the number 8: 8
Enter the number 9: 9
Enter the number 10: 10

1---2---3---4---5---6---7---8---9---10---
Total = 55