Interview Questions

Find a text inside multiple files in linux

To find files that contain a text string in linux is very easy. Open terminal locate to the folder. Use below command. grep -lir “search text” * The -l switch outputs only the names of files in which the text occurs, the -i switch ignores the case, and the -r descends into sub directories.

How to Integrate buddypress to wordpress theme

If you want buddypress features should be a part of your website then you need to integrate buddypress theme to your existing wordpress theme. In this article you will find step by step procedure to integrate buddypress theme to wordpress theme.

How to kill any process in Linux?

To kill any process yo need to first find out the process ID (PID) For example if you want to kill firfox #ps aux | grep firefox This will generate: username   5365  0.0  0.0  3572  628 pts/0    S    11:00   0:00 grep firefox Now kill process using PID #kill 5365 #kill -9 5365 where -9 is […]

What is the use of extern in c/c++?

The extern keyword is used to tell the compiler that a data object is declared in a different *.cpp or *.c file. So there wont be any new memory is allocated for these variables. Check the below example and understand the working. //file1.cpp #include <iostream.h>   int x; extern void func2();   void func1(void) { […]

When we should use virtual destructor?

It is used whenever a base class pointer is pointing to its derived class. In such a case when a user tries to delete the base class pointer then it results in deallocating the memory occupied by the base class.Therefore instead the derived class getting destroyed the base class does. Now as the base class […]

How to setup wordpress on localhost?

First you need to install Apache web server to run PHP and MySQL. XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use – just download, extract and start. Steps to install XAMPP Download from Extract the file and double click […]

How to allocate two dimensional array?

Consider if you want to allocate a two dimensional array: int a[10][3]; Then you have to allocate the rows first and then columns using for loops. Here is the C example code. int **a, x; //Allocate memory a = malloc(sizeof(int *) * 10); for(x = 0; x &lt; 10; x ++) { a[x] = malloc(sizeof(int) […]

How to select text vertically in vi/vim editor

To select the text vertically first press escape if you are in insert mode. Then type: ^v (Control v) Then you can use arrow keys to select the text you want. After selecting the text use Delete to delete the text. y to copy the text p to paste the text

How to run PHP files on localhost?

To run any php file you need to install Apache web server on your localhost. Also you need to install MySQL server for any database programming. You can install these separately or there is easy way to achieve the same by installing XAMPP. XAMPP is an easy to install Apache distribution containing MySQL, PHP and […]

What is PHP?

PHP stands for “Hypertext Preprocessor“,  is a server-side scripting language used to create dynamic Web pages. This can be embedded to HTML pages. This is very easy scripting language compare to other scripting languags. The goal of the language is to allow Web developers to write dynamically generated pages quickly. PHP supports many databases like […]