
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 26504 Articles for Server Side Programming

1K+ Views
Given two strings Str and subStr as input. The goal is to find whether text present in subStr exists in Str as substring or not. The string X is called a substring of Y if whole X is present in Y at least once. We will use a recursive approach to do this.For ExampleInput − Str = “tutorialspoint” subStr=”Point”Output − Given string does not contain substring!Explanation − The string Point is not substring of tutorialspointInput − Str = “globalization” subStr=”global”Output − Given string contains substring!Explanation − The string global is substring of globalizationApproach used in the below program is as followsIn this approach we check ... Read More

1K+ Views
Insertion Sort is one of the sorting algorithms used to sort data by inserting elements like a deck of cards. All the elements are arranged from left to right then considering the first one as already sorted, insert rest to the sorted list on the left. Each element is compared with each element in the left list until it is inserted at its correct position.Insertion Sort Algorithmint arr[5]= { 5, 4, 2, 1, 3 };int i, j ;Traverse from index j=i+1 to jarr[i+1], swap those elements.Set temp=arr[i], arr[i]=arr[i+1] and arr[i+1]=temp.Now decrement length by 1 as the previous loop placed the ... Read More

1K+ Views
To create confusion matrix for a rpart model, we first need to find the predicted values then the table of predicted values and the response variable in the original data can be created, which will be the confusion matrix for the model.For Example, if we have a vector of predicted values say P and original values in data frame df$O then the confusion matrix can be created by using the following command −table(P, df$O)Check out the below Examples to understand how it can be done.Example 1Following snippet creates a sample data frame −Dep_Var1Read More

1K+ Views
To create bar plot using ggplot2 with structure data, we need to set the stat argument of geom_bar function to identity. This is same for the regular data frame.For example, if we have a structured data frame called df that contains a column X for categories and a numerical column say Y for frequency then we can the bar plot for this data by using the below given command −ggplot(df,aes(X,Y))+geom_bar(stat="identity")ExampleFollowing snippet creates a sample data frame −df

206 Views
To find the product of vector elements in pairs moving forward, we can use prod function along with combn function.For Example, if we have a vector called V and we want to find the product of elements of V in pairs moving forward then we can use the following command −combn(V,2,prod)Example 1Following snippet creates a sample data frame −x1

600 Views
To display data frame name in ggplot2 graph title, we can use ggtitle function and pass the name of the data frame.For example, if we have a data frame called df that contains two columns say x and y and we can create a point chart between x and y then the plot with data frame name as title can be created by using the below mentioned command −ggplot(df,aes(x,y))+geom_point()+ggtitle("df")ExampleFollowing snippet creates a sample data frame −x

300 Views
To create a colored frame for ggplot2 graph, we can use theme function and set the plot.background argument to different color for rectangular element.For example, if we have a data frame called df that contains two columns say X and Y then we can create point chart between X and Y with blue colored frame of the plot using the below mentioned command −ggplot(df,aes(X,Y))+geom_point()+theme(plot.background=element_rect(colour="blue",size=3))ExampleFollowing snippet creates a sample data frame −x

6K+ Views
We are given a string Str as input. The goal is to find if the input string is a palindrome word or not using a recursive function. Palindrome strings are those strings that when read from front or end form the same word. The strings of length 0 are considered as palindromes. Reversing the palindromes character wise forms, the same string as the original.Examples of palindromes are:- madam, abcba, malayalam etcExamplesInput − Str = “malayalam”Output − Input string is palindrome.Explanation −Str[ 0 to 8 ] = malayalamReverse Str [ 8 to 0 ] = malayalamBoth strings are same.Input − Str = “tutorial”Output − Input string ... Read More

1K+ Views
To add title to regression model using stargazer, we can use title argument inside stargazer function.For example, if we have a model called Reg_Model with Output as text then the title to this model using stargazer can be added by using the below mentioned command −stargazer(Reg_Model,type="text",title="Regression Model between x and y")Example 1Following snippet creates a sample data frame −x

6K+ Views
To delete a row from an R data frame if any value in the row is greater than n can be done by using the subsetting with single square brackets and negation operator. We will subset the values that are greater than n and then take the negation of the subset as shown in the below given examples.Example 1Following snippet creates a sample data frame −x1