Knuth–Morris–Pratt Algorithm

Introduction

In computer science, The Knuth–Morris–Pratt Algorithm is an string searching algorithm. String Searching Algorithm means the algorithm that searches for the occurrence of a Word(W) in a main Text String(S). This algorithm tries to find the starting index m in string S[] that matches the search word W[].

To illustrate the details of algorithm, consider a run of the algorithm, where W = "abbc" and S = "abxabyabbc".

i : 0123456789
S : abxabyabbc
W : abbc

Keep Reading…

How To Setup Apache Virtual Host On Linux ?

This post guide you to set up Virtual Host on Apache Web Server.
According to Apache Virtual Host DocumentationThe term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.com) on a single machine. Virtual hosts can be “IP-based”, meaning that you have a different IP address for every web site, or “name-based”, meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

Virtual Hosts allow the administrator to use one server to host multiple domains or sites. Each domain that is configured, will direct the visitor to a specific directory holding that site’s information only and never indicating that the same server is also responsible for other sites. This scheme is expandable without any software limit as long as the server can handle the load.

This guide will show how to set up Apache Virtual Hosts on an Ubuntu 16.04. This will show you how to serve different content to different visitors depending on which domains they are requesting.

So, lets start…
Keep Reading…

How To Change The Document Root Of The Apache Server In Linux ?

This post shows, how to change The Document Root of The Apache Server. By default, /var/www/html is root directory of Apache Web Server. You need superuser privilege to create and modify file inside the default root directory, that is very tedious. Fortunately, you can change the default root /var/www/html to any other directory, say /home/username/www/html.
The steps in this post are performed on Ubuntu 16.04, but applied to other Linux Distros. So, let’s start.

Keep Reading…

How To Install LAMP Stack On Ubuntu ?

This tutorial is written to help Novice Linux Users, who want to setup LAMP stack on their machine. LAMP is the acronym of Linux, Apache, MySQL, PHP. LAMP is group of open source software that is installed together to enable a server to host dynamic websites and web apps. In LAMP Stack Linux is an Operating System, Apache is a Web Server, MySQL is a Database used to store data and PHP is a Server Side Scripting Language that is used to process dynamic contents.

In this tutorial, the installation is performed on Ubuntu 16.04 that will fulfils our first requirement: A Linux Operating System.

Keep Reading…

How To Uninstall JDK From Linux ?

This tutorial is written to help New Linux Users, who want to uninstall Java Development Kit (JDK) installed on their Linux. The tasks performed on Ubuntu 16.04, but this will also work on other Debian Based Linux like Linux Mint, Kali Linux, etc.

So, first of all, check the vendor of the JDK you have installed on your system, whether it is Oracle JDK or Openjdk. For that execute the following command in the terminal:
$ java -version

Keep Reading…