
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 33676 Articles for Programming

308 Views
To find the sequence of correlation between variables in an R data frame or matrix, we can use correlate and stretch function from corrr package.For example, if we have a data frame called df then we can find the sequence of correlation between variables in df by using the below given command −df%>% correlate() %>% stretch() %>% arrange(r)Example 1Following snippet creates a sample data frame −x1% + arrange(r) Correlation method: 'pearson' Missing treated using: 'pairwise.complete.obs' # A tibble: 25 x 3OutputIf you execute all the above given snippets as a single program, it generates the following output − ... Read More

758 Views
To create a matrix with vectors as elements in R, we can create arrays because an array contains matrices with vectors as elements.Check out the below given examples of arrays and vectors extracted by the arrays to understand how matrices stored in an array represent vectors as elements.Example 1Following snippet creates arrays consisting of matrices −Array

1K+ Views
To create a time series plot, we can use simply apply plot function on time series object and if we want to create a vertical line on that plot then abline function will be used with v argument.For example, if we have a time series object called T and we want to create a time series plot of T with vertical line at point 5 then we can use the below given command after creating the plot −abline(v=5)ExampleTo create a vertical line in a time series plot in base R, use the following code −x

409 Views
To change the order of a matrix in increasing order based on a single column in R, we can use order function after subsetting a particular column.For example, if we have a matrix called M and we want to change the order of M in increasing order based on first column then it can be done by using the following command −M[order(M[,1]),]Example 1Following snippet creates a matrix −M1

200 Views
A list may contain vectors, data frames, matrices, lists etc. If a list contains matrices and we want to convert those matrices into vectors then lapply function can be used along with as.vector function.For example, if we have a list called LIST that contains matrices then we can convert those matrices into data frames by using the below given command − lapply(LIST,function(x) as.vector(x))ExampleFollowing snippet creates the matrices −M1

3K+ Views
To create a new column with ratio of two columns in an R data frame, we can use division sign.For example, if we have a data frame called df that contains two columns say X and Y and we want to create a new column with ratio of X and Y then we can use the below given command −df$Ratio_X_Y

497 Views
To find the number of times a variable changes its sign in an R data frame column, we can use sign function with diff and sum function.For example, if we have a data frame called df that contains a column say C then, we can find the number of times C changes its sign by using the following command −sum(diff(sign(df$C))!=0)Example 1Following snippet creates a sample data frame −x

5K+ Views
We can upload files using Selenium Webdriver. This is achieved by the sendKeys method. We have to first identify the element which performs the file selection by mentioning the file path [to be uploaded].This is only applied to an element having a type attribute set to file as a value along with the element tag name as input. The below html code shows the element with type = file value set.ExampleCode Implementation.import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class WndsFileUpl{ public static void main(String[] args) { System.setProperty("webdriver.chrome.driver", "C:\Users\ghs6kor\Desktop\Java\chromedriver.exe"); ... Read More

761 Views
We can work with Selenium webdriver with Java Quickstart template. This can be done by following the below steps −Step1− Click on the File menu in Eclipse. Then select the option New. Next click on Other.Step2− Click on Maven Project from the Maven folder. Then click on Next.Step3− Proceed with the further steps.Step4− Select maven-archetype-quickstart template. Then click on Next.Step5− Add GroupId as Selenium, Artifact Id as Automation-Selenium, and proceed.Step6− A project should get created with an archetype project structure. The Selenium-related scripts should be written within the src/test/java folder.

24K+ Views
We can run Javascript in Selenium webdriver with Python. The Document Object Model communicates with the elements on the page with the help of Javascript. Selenium executes the Javascript commands by taking the help of the execute_script method. The commands to be executed are passed as arguments to the method.Some operations like scrolling down in a page cannot be performed by Selenium methods directly. This is achieved with the help of the Javascript Executor. The window.scrollTo method is used to perform scrolling operation. The pixels to be scrolled horizontally along the x-axis and pixels to be scrolled vertically along the ... Read More