title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python program to calculate square of a given number | 12 Oct, 2021
Given a number, the task is to write a Python program to calculate square of the given number.
Examples:
Input: 4
Output: 16
Input: 3
Output: 9
Input: 10
Output: 100
We will provide the number, and we will get the square of that number as output. We have three ways to do so:
Multiplying the number to get... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 149,
"s": 54,
"text": "Given a number, the task is to write a Python program to calculate square of the given number."
},
{
"code": null,
"e": 159,
"s": 149,
"text": "Examples:"... |
Program to add and Subtract Complex Numbers using Class in Java | 31 Oct, 2019
In this article, we will try to add and subtract these two Complex Numbers by creating a Class for Complex Number, in which:
The complex numbers will be initialized with the help of constructor.
The addition and subtraction will be performed with the help of function calling.
The function will be called wi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 177,
"s": 52,
"text": "In this article, we will try to add and subtract these two Complex Numbers by creating a Class for Complex Number, in which:"
},
{
"code": null,
"e": 247,
"s"... |
Swap Nodes in Binary tree of every k’th level | 06 Jul, 2022
Given a binary tree and integer value k, the task is to swap sibling nodes of every k’th level where k >= 1.
Examples:
Input : k = 2 and Root of below tree
1 Level 1
/ \
2 3 Level 2
/ / \
4 7 8 Level 3
Output : Root of ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 161,
"s": 52,
"text": "Given a binary tree and integer value k, the task is to swap sibling nodes of every k’th level where k >= 1."
},
{
"code": null,
"e": 172,
"s": 161,
"text... |
Scheduling with Deadline | 27 Aug, 2021
Prerequisite : CPU Scheduling
What is Scheduling with Deadline ?The goal of a Scheduling problem is to schedule the tasks such that the maximum total profit is obtained. This algorithm for scheduling with a deadline is different from scheduling without a deadline because task completion here is associated... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Aug, 2021"
},
{
"code": null,
"e": 59,
"s": 28,
"text": "Prerequisite : CPU Scheduling "
},
{
"code": null,
"e": 597,
"s": 59,
"text": "What is Scheduling with Deadline ?The goal of a Scheduling problem is to sche... |
Random Quote Generator Using HTML, CSS and JavaScript | 25 Feb, 2021
A Random Quote Generator is capable of pulling quotes randomly from an API, a database, or simply from an array. We will be designing a Random Quote Generator from scratch using HTML, CSS, JavaScript, and type.fit API. The webpage displays a random quote from a collection and upon the click of a button, it... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Feb, 2021"
},
{
"code": null,
"e": 512,
"s": 54,
"text": "A Random Quote Generator is capable of pulling quotes randomly from an API, a database, or simply from an array. We will be designing a Random Quote Generator from scratch us... |
JDBC - Delete Records Example | This chapter provides an example on how to delete records from a table using JDBC application. Before executing following example, make sure you have the following in place −
To execute the following example you can replace the username and password with your actual user name and password.
To execute the following exam... | [
{
"code": null,
"e": 2471,
"s": 2296,
"text": "This chapter provides an example on how to delete records from a table using JDBC application. Before executing following example, make sure you have the following in place −"
},
{
"code": null,
"e": 2587,
"s": 2471,
"text": "To exec... |
Java Ternary Operator Examples | The ternary operator is also known as the conditional operator. This operator consists of three operands and is used to evaluate Boolean expressions. The goal of the operator is to decide, which value should be assigned to the variable. The operator is written as −
variable x = (expression) ? value if true: value if fa... | [
{
"code": null,
"e": 1453,
"s": 1187,
"text": "The ternary operator is also known as the conditional operator. This operator consists of three operands and is used to evaluate Boolean expressions. The goal of the operator is to decide, which value should be assigned to the variable. The operator is ... |
How to get the first word of a sentence in PHP? | 07 May, 2019
The first word of a sentence can be obtained with the help of various inbuilt functions like strtok(), strstr(), explode() and some other methods like using regular expressions. Some examples to get the first word of a sentence are listed below:
Method 1: Using strtok() Function: This function is used to t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 May, 2019"
},
{
"code": null,
"e": 274,
"s": 28,
"text": "The first word of a sentence can be obtained with the help of various inbuilt functions like strtok(), strstr(), explode() and some other methods like using regular expression... |
HTML autofocus Attribute | 13 Dec, 2021
The autofocus attribute in HTML is used to specify that the element should get focused when the page loads. It is a boolean attribute.
Syntax:
<elementName autofocus>
Note: It supports only the following elements: <button>, <input>, <select> and <textarea>.
Supported Tags:
Button autofocus Attribute
Input... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n13 Dec, 2021"
},
{
"code": null,
"e": 188,
"s": 53,
"text": "The autofocus attribute in HTML is used to specify that the element should get focused when the page loads. It is a boolean attribute."
},
{
"code": null,
"e": 19... |
HTML | <frame> Tag | 17 Mar, 2022
HTML Frames are used to divide the web browser window into multiple sections where each section can be loaded separately. A frameset tag is the collection of frames in the browser window.
Creating Frames: Instead of using body tag, use frameset tag in HTML to use frames in web browser. But this Tag is depr... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n17 Mar, 2022"
},
{
"code": null,
"e": 241,
"s": 53,
"text": "HTML Frames are used to divide the web browser window into multiple sections where each section can be loaded separately. A frameset tag is the collection of frames in the br... |
Smallest subarray containing minimum and maximum values | 29 Jun, 2022
Given an array A of size N. The task is to find the length of smallest subarray which contains both maximum and minimum values.Examples:
Input : A[] = {1, 5, 9, 7, 1, 9, 4}
Output : 2
subarray {1, 9} has both maximum and minimum value.
Input : A[] = {2, 2, 2, 2}
Output : 1
2 is both maximum and minimum ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Jun, 2022"
},
{
"code": null,
"e": 191,
"s": 52,
"text": "Given an array A of size N. The task is to find the length of smallest subarray which contains both maximum and minimum values.Examples: "
},
{
"code": null,
"e"... |
InStr() and InstrRev() Function in MS Access | 28 Aug, 2020
1. InStr() Function :The InStr() Function returns the position of a string in another string. It always returns the first occurrence of the string. It works not case sensitive. It returns 0 if the string2 is not found in string1 or string1 is null or the parameter starts in the function is greater than len... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Aug, 2020"
},
{
"code": null,
"e": 468,
"s": 28,
"text": "1. InStr() Function :The InStr() Function returns the position of a string in another string. It always returns the first occurrence of the string. It works not case sensitive... |
Ways to concatenate two lists in Python | 03 Dec, 2020
Let’s see how to concatenate two lists using different methods in Python. This operation is useful when we have numbers of lists of elements which needs to be processed in a similar manner.
Method #1 : Using Naive Method
In this method, we traverse the second list and keep appending elements in the first l... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Dec, 2020"
},
{
"code": null,
"e": 242,
"s": 52,
"text": "Let’s see how to concatenate two lists using different methods in Python. This operation is useful when we have numbers of lists of elements which needs to be processed in a ... |
Program to calculate area of an Circle inscribed in a Square | 09 Jun, 2022
Given the side of a square. The task is to find the area of an inscribed circle in a square.Examples:
Input : a = 8
Output : Area of an inscribed circle: 50.24
Input : a = 12.04
Output : Area of an inscribed circle: 113.795
Given a square i.e. all sides of a square are of equal length and all four ang... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 132,
"s": 28,
"text": "Given the side of a square. The task is to find the area of an inscribed circle in a square.Examples: "
},
{
"code": null,
"e": 255,
"s": 132,
"text": "In... |
How to align images side by side with CSS? | Following is the code to align images side by side using CSS −
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
.imageColumn {
float: left;
width: 25%;
padding: 10px;
}
h1{
text-align: center;
}
</style>
</head>
<body>
<h1>Images Aligned Side by Side example</h1>
<div class=... | [
{
"code": null,
"e": 1250,
"s": 1187,
"text": "Following is the code to align images side by side using CSS −"
},
{
"code": null,
"e": 1261,
"s": 1250,
"text": " Live Demo"
},
{
"code": null,
"e": 2022,
"s": 1261,
"text": "<!DOCTYPE html>\n<html>\n<head>\n<sty... |
screenshot() element method – Selenium Python | 27 Apr, 2020
Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout – Navigating links using get method – Selenium Python. Just being able ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Apr, 2020"
},
{
"code": null,
"e": 585,
"s": 28,
"text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium ... |
How to log errors and warnings into a file in php? - GeeksforGeeks | 02 Jan, 2019
In PHP, errors and warnings can be logged into a file by using a php script and changing configuration of php.ini file. Two such approaches are mentioned below:
Approach 1: The error_log() function can be used to send error messages to a given file. First argument to the function is the error message to be... | [
{
"code": null,
"e": 31351,
"s": 31323,
"text": "\n02 Jan, 2019"
},
{
"code": null,
"e": 31512,
"s": 31351,
"text": "In PHP, errors and warnings can be logged into a file by using a php script and changing configuration of php.ini file. Two such approaches are mentioned below:"
... |
HTML | DOM createDocumentFragment() Method - GeeksforGeeks | 24 Jul, 2019
The createDocumentFragment() method in HTML DOM is used to create the document fragment which is useful to change the content of the document such as delete, modify or add a new node. This method creates the document fragment, then append the elements of the document to the document fragment and make the c... | [
{
"code": null,
"e": 23625,
"s": 23597,
"text": "\n24 Jul, 2019"
},
{
"code": null,
"e": 24088,
"s": 23625,
"text": "The createDocumentFragment() method in HTML DOM is used to create the document fragment which is useful to change the content of the document such as delete, modif... |
Set a default value for a ttk Combobox in Tkinter? | Tkinter Combobox is used to add a drop-down menu to the Entry widget, making it useful to handle multiple data of any application. A Combobox widget can be created using the Combobox(arguments). However, for the particular need of an application, we can set the default value for the Combobox widget. It can be set by li... | [
{
"code": null,
"e": 1591,
"s": 1062,
"text": "Tkinter Combobox is used to add a drop-down menu to the Entry widget, making it useful to handle multiple data of any application. A Combobox widget can be created using the Combobox(arguments). However, for the particular need of an application, we can... |
C++ Program to check if tank will overflow, underflow or filled in given time | Given with the rate of filling the tank, height of a tank and radius of a tank and the task is to check whether the tank is overflow, underflow and filled in given time.
Input-: radius = 2, height = 5, rate = 10
Output-: tank overflow
Input-: radius = 5, height = 10, rate = 10
Output-: tank undeflow
Approach used below... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "Given with the rate of filling the tank, height of a tank and radius of a tank and the task is to check whether the tank is overflow, underflow and filled in given time."
},
{
"code": null,
"e": 1363,
"s": 1232,
"text": "Input-: radi... |
How to Change Input Type of EditText Programmatically in Android? - GeeksforGeeks | 09 Dec, 2021
EditText in Android UI or applications is an input field, that is used to give input text to the application. This input text can be of multiple types like text (Characters), number (Integers), etc. These fields can be used to take text input from the users to perform any desired operation. Let us say, a l... | [
{
"code": null,
"e": 25036,
"s": 25008,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 26340,
"s": 25036,
"text": "EditText in Android UI or applications is an input field, that is used to give input text to the application. This input text can be of multiple types like text (C... |
How to insert a single line break in HTML? | Use the <br> tag to insert a single line break in HTML. You can try to run the following code to insert a line break using the <br> tag −
<!DOCTYPE html>
<html>
<head>
<title>HTML br Tag</title>
</head>
<body>
<p>This is before the line break<br />
and this after the line break.</p>
</body... | [
{
"code": null,
"e": 1200,
"s": 1062,
"text": "Use the <br> tag to insert a single line break in HTML. You can try to run the following code to insert a line break using the <br> tag −"
},
{
"code": null,
"e": 1392,
"s": 1200,
"text": "<!DOCTYPE html>\n<html>\n <head>\n <t... |
Lexicographical Numbers in C++ | Suppose we have an integer n. We have to return 1 to n in lexicographic order. So for example when 13 is given, then the output will be [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9].
To solve this, we will follow these steps −
define one array ret of size n
define one array ret of size n
curr := 1
curr := 1
for i in rang... | [
{
"code": null,
"e": 1243,
"s": 1062,
"text": "Suppose we have an integer n. We have to return 1 to n in lexicographic order. So for example when 13 is given, then the output will be [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9]."
},
{
"code": null,
"e": 1287,
"s": 1243,
"text": "T... |
The Celebrity Problem | Practice | GeeksforGeeks | A celebrity is a person who is known to all but does not know anyone at a party. If you go to a party of N people, find if there is a celebrity in the party or not.
A square NxN matrix M[][] is used to represent people at the party such that if an element of row i and column j is set to 1 it means ith person knows jth... | [
{
"code": null,
"e": 631,
"s": 238,
"text": "A celebrity is a person who is known to all but does not know anyone at a party. If you go to a party of N people, find if there is a celebrity in the party or not.\nA square NxN matrix M[][] is used to represent people at the party such that if an elemen... |
AngularJS - Tables | Table data is generally repeatable. The ng-repeat directive can be used to draw table easily. The following example shows the use of ng-repeat directive to draw a table −
<table>
<tr>
<th>Name</th>
<th>Marks</th>
</tr>
<tr ng-repeat = "subject in student.subjects">
<td>{{ subject.name }}<... | [
{
"code": null,
"e": 2870,
"s": 2699,
"text": "Table data is generally repeatable. The ng-repeat directive can be used to draw table easily. The following example shows the use of ng-repeat directive to draw a table −"
},
{
"code": null,
"e": 3077,
"s": 2870,
"text": "<table>\n ... |
Difference between indexed array and associative array - GeeksforGeeks | 22 Oct, 2021
An array is a collection of objects that contain a group of variables stored under the same name. All the elements belong to the same data type, i.e. string, integers, or lists. Keys are unique in the case of both indexed and associative arrays.
Indexed array: Indexed array is an array with a numeric key.... | [
{
"code": null,
"e": 24677,
"s": 24649,
"text": "\n22 Oct, 2021"
},
{
"code": null,
"e": 24924,
"s": 24677,
"text": "An array is a collection of objects that contain a group of variables stored under the same name. All the elements belong to the same data type, i.e. string, integ... |
How to layout table cells, rows, and columns with JavaScript? | To layout tables correctly in JavaScript, use the tableLayout property. Set the property to fixed to set the layout.
You can try to run the following code to set the way to layout table cells, rows, and columns with JavaScript −
<!DOCTYPE html>
<html>
<head>
<style>
table, td {
border: 2px... | [
{
"code": null,
"e": 1179,
"s": 1062,
"text": "To layout tables correctly in JavaScript, use the tableLayout property. Set the property to fixed to set the layout."
},
{
"code": null,
"e": 1291,
"s": 1179,
"text": "You can try to run the following code to set the way to layout ta... |
How to Fix: Can only compare identically-labeled series objects - GeeksforGeeks | 12 Dec, 2021
In this article, we are going to see how to fix it: Can only compare identically-labeled series objects in Python.
Can only compare identically-labeled series objects: It is Value Error, occurred when we compare 2 different DataFrames (Pandas 2-D Data Structure). If we compare DataFrames which are having d... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n12 Dec, 2021"
},
{
"code": null,
"e": 24016,
"s": 23901,
"text": "In this article, we are going to see how to fix it: Can only compare identically-labeled series objects in Python."
},
{
"code": null,
"e": 24266,
... |
How to sort a String array in Java? | To sort a String array in Java, you need to compare each element of the array to all the remaining elements, if the result is greater than 0, swap them.
One solution to do so you need to use two loops (nested) where the inner loop starts with i+1 (where i is the variable of outer loop) to avoid repetitions in compariso... | [
{
"code": null,
"e": 1215,
"s": 1062,
"text": "To sort a String array in Java, you need to compare each element of the array to all the remaining elements, if the result is greater than 0, swap them."
},
{
"code": null,
"e": 1385,
"s": 1215,
"text": "One solution to do so you nee... |
Determinant of a Matrix | Practice | GeeksforGeeks | Given a square matrix of size N x N. The task is to find the determinant of this matrix.
Example 1:
Input:
N = 4
matrix[][] = {{1, 0, 2, -1},
{3, 0, 0, 5},
{2, 1, 4, -3},
{1, 0, 5, 0}}
Output: 30
Explanation:
Determinant of the given matrix is 30.
Example 2:
Input:
N = 3
matr... | [
{
"code": null,
"e": 339,
"s": 238,
"text": "Given a square matrix of size N x N. The task is to find the determinant of this matrix.\n\nExample 1:"
},
{
"code": null,
"e": 530,
"s": 339,
"text": "Input:\nN = 4\nmatrix[][] = {{1, 0, 2, -1},\n {3, 0, 0, 5},\n ... |
How to get the Action bar height in android? | This example demonstrates how do I get the action bar height in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayou... | [
{
"code": null,
"e": 1135,
"s": 1062,
"text": "This example demonstrates how do I get the action bar height in android."
},
{
"code": null,
"e": 1264,
"s": 1135,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to cr... |
Pointers vs References in C++ | Pointers are used to store the address of variable.
Type *pointer;
Type *pointer;
pointer = variable name;
When a variable is declared as reference, it becomes an alternative name for an existing variable.
Type &newname = existing name;
Type &pointer;
pointer = variable name;
The main differences between pointers and r... | [
{
"code": null,
"e": 1114,
"s": 1062,
"text": "Pointers are used to store the address of variable."
},
{
"code": null,
"e": 1129,
"s": 1114,
"text": "Type *pointer;"
},
{
"code": null,
"e": 1169,
"s": 1129,
"text": "Type *pointer;\npointer = variable name;"
... |
Swing Examples - Add Shortcut to MenuItem | Following example showcase how to use add a shortcut to a menu item in a Java Swing application.
We are using the following APIs.
JMenuBar − To create a menu bar.
JMenuBar − To create a menu bar.
JMenu − To create a menu.
JMenu − To create a menu.
JMenuItem − To create a menu item.
JMenuItem − To create a menu item.
JM... | [
{
"code": null,
"e": 2136,
"s": 2039,
"text": "Following example showcase how to use add a shortcut to a menu item in a Java Swing application."
},
{
"code": null,
"e": 2169,
"s": 2136,
"text": "We are using the following APIs."
},
{
"code": null,
"e": 2202,
"s": ... |
Importance of macros in C++ | 07 Dec, 2018
99.9% of the C++ programs use macros. Unless you are making a basic file you have to write #include, which is a macro that pastes the text contained in a file. And it matters not the extension of the file. Macros are very powerful and can do things that not even templates, lambdas, constexpr, inlining or w... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Dec, 2018"
},
{
"code": null,
"e": 410,
"s": 54,
"text": "99.9% of the C++ programs use macros. Unless you are making a basic file you have to write #include, which is a macro that pastes the text contained in a file. And it matters... |
Ceil and floor of the dataframe in Pandas Python – Round up and Truncate | 08 Oct, 2021
In this article, we will discuss getting the ceil and floor values of the Pandas Dataframe. First, Let’s create a dataframe.
Example:
Python3
# importing pandas and numpyimport pandas as pdimport numpy as np # Creating a DataFramedf = pd.DataFrame({'Student Name': ['Anuj', 'Ajay', 'Vivek', ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 153,
"s": 28,
"text": "In this article, we will discuss getting the ceil and floor values of the Pandas Dataframe. First, Let’s create a dataframe."
},
{
"code": null,
"e": 162,
"s":... |
URL getUserInfo() method in Java with Examples | 31 Dec, 2018
The getUserInfo() function is a part of URL class. The function getUserInfo() returns the UserInfo part of a specified URL.
Function Signature:
public String getUserInfo()
Syntax:
url.getUserInfo()
Parameter: This function does not require any parameter
Return Type: The function returns String Type
Below p... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Dec, 2018"
},
{
"code": null,
"e": 152,
"s": 28,
"text": "The getUserInfo() function is a part of URL class. The function getUserInfo() returns the UserInfo part of a specified URL."
},
{
"code": null,
"e": 172,
"s": ... |
Go - Environment Setup | If you are still willing to set up your environment for Go programming language, you need the following two software available on your computer −
A text editor
Go compiler
You will require a text editor to type your programs. Examples of text editors include Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and... | [
{
"code": null,
"e": 2083,
"s": 1937,
"text": "If you are still willing to set up your environment for Go programming language, you need the following two software available on your computer −"
},
{
"code": null,
"e": 2098,
"s": 2083,
"text": "A text editor "
},
{
"code":... |
How to convert Python date in JSON format? | There is no standard JSON format for dates. Although JavaScript does have a standard date format that is human readable, sorts correctly, includes fractional seconds(which can help re-establish chronology) and conforms to ISO 8601. You can convert a Python date to the JS date format using the strftime function and des... | [
{
"code": null,
"e": 1700,
"s": 1062,
"text": "There is no standard JSON format for dates. Although JavaScript does have a standard date format that is human readable, sorts correctly, includes fractional seconds(which can help re-establish chronology) and conforms to ISO 8601. You can convert a Py... |
C library function - isupper() | The C library function int isupper(int c) checks whether the passed character is uppercase letter.
Following is the declaration for isupper() function.
int isupper(int c);
c − This is the character to be checked.
c − This is the character to be checked.
This function returns a non-zero value(true) if c is an uppercase ... | [
{
"code": null,
"e": 2106,
"s": 2007,
"text": "The C library function int isupper(int c) checks whether the passed character is uppercase letter."
},
{
"code": null,
"e": 2159,
"s": 2106,
"text": "Following is the declaration for isupper() function."
},
{
"code": null,
... |
Convex Hull | Set 1 (Jarvis's Algorithm or Wrapping) - GeeksforGeeks | 24 Feb, 2022
Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it.
We strongly recommend to see the following post first. How to check if two given line segments intersect?The idea of Jarvis’s Algorithm is simple, we start from the leftmost po... | [
{
"code": null,
"e": 34514,
"s": 34486,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 34645,
"s": 34514,
"text": "Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it. "
},
{
"code": null,
... |
Data science concepts you need to know! Part 1 | by Michael Barber | Towards Data Science | This is the first post in a 5-part series that will outline some of the core concepts in data science:
Notably we will be covering the statistics bucket from the diagram above and trying to make it as intuitive and maths-lite as possible.
My background is in big pharma, academia (a PhD from Oxford’s Physical and Theore... | [
{
"code": null,
"e": 275,
"s": 172,
"text": "This is the first post in a 5-part series that will outline some of the core concepts in data science:"
},
{
"code": null,
"e": 411,
"s": 275,
"text": "Notably we will be covering the statistics bucket from the diagram above and trying... |
How to convert days in a week to number in R data frame column? | To convert days in a week to number in R data frame column, we would need to convert
the column into a factor by defining the weekdays as the levels and then read that
column as integer.
If we provide the correct sequence of weekdays during conversion then Monday will be
converted to 1. Check out the below Examples to ... | [
{
"code": null,
"e": 1249,
"s": 1062,
"text": "To convert days in a week to number in R data frame column, we would need to convert\nthe column into a factor by defining the weekdays as the levels and then read that\ncolumn as integer."
},
{
"code": null,
"e": 1413,
"s": 1249,
"t... |
Google Maps - Symbols | In addition to markers, polygons, polylines, and other geometrical shapes, we can also add predefined vector images(symbols) on a map. This chapter explains how to use the symbols provided by Google Maps.
Google provides various vector-based images (symbols) that can be used on a marker or a polyline. Just like other o... | [
{
"code": null,
"e": 2037,
"s": 1832,
"text": "In addition to markers, polygons, polylines, and other geometrical shapes, we can also add predefined vector images(symbols) on a map. This chapter explains how to use the symbols provided by Google Maps."
},
{
"code": null,
"e": 2340,
"... |
C Program to count the number of lines in a file? | In this program, we are going to learn how to find the total number of lines available in a text file using C program?
This program will open a file and read the file’s content character by character and finally return the total number of lines in the file. To count the number of lines we will check the available Newli... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "In this program, we are going to learn how to find the total number of lines available in a text file using C program?"
},
{
"code": null,
"e": 1402,
"s": 1181,
"text": "This program will open a file and read the file’s content chara... |
How to set Heading alignment in HTML? | Headings in HTML have 6 tags, <h1> to <h6>. To set the heading alignment in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <h1> to <h6> tag, with the CSS property text-align. HTML5 do not support the align attribute of the heading tag, so... | [
{
"code": null,
"e": 1423,
"s": 1062,
"text": "Headings in HTML have 6 tags, <h1> to <h6>. To set the heading alignment in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <h1> to <h6> tag, with the CSS property text-ali... |
Turn on the general log in MySQL? | To turn ON the general log, you need to use SET command.
Following is the syntax −
set global general_log=ON;
Let us check the general log status with the help of SHOW command −
mysql> SHOW variables like '%general_log%';
This will produce the following output −
+------------------+---------------------+
| Variable_na... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "To turn ON the general log, you need to use SET command."
},
{
"code": null,
"e": 1146,
"s": 1119,
"text": " Following is the syntax −"
},
{
"code": null,
"e": 1173,
"s": 1146,
"text": "set global general_log=ON;"... |
Largest palindrome which is product of two N-digit numbers : Set 2 - GeeksforGeeks | 24 Nov, 2021
Given a value N, find out the largest palindrome number which is the product of two N-digit numbers.Examples:
Input: N = 2 Output: 9009 Explanation: 9009 is the largest number which is product of two 2-digit numbers 91 and 99 (9009 = 91*99)Input: N = 3 Output: 906609Input: N = 4 Output: 99000099
Observat... | [
{
"code": null,
"e": 26127,
"s": 26099,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 26238,
"s": 26127,
"text": "Given a value N, find out the largest palindrome number which is the product of two N-digit numbers.Examples: "
},
{
"code": null,
"e": 26426,
"s":... |
How to apply two CSS classes to a single element ? - GeeksforGeeks | 06 Jul, 2021
Multiple classes can be applied to a single element in HTML and they can be styled using CSS. In this article, we will stick to only two classes. But the concepts used in assigning two classes can be extended to multiple classes as well.Assigning classes to an element in HTML: The names of the classes can ... | [
{
"code": null,
"e": 25459,
"s": 25431,
"text": "\n06 Jul, 2021"
},
{
"code": null,
"e": 25863,
"s": 25459,
"text": "Multiple classes can be applied to a single element in HTML and they can be styled using CSS. In this article, we will stick to only two classes. But the concepts ... |
Advanced Quick Sort (Hybrid Algorithm) - GeeksforGeeks | 04 Aug, 2021
Prerequisites: Insertion Sort, Quick Sort, Selection SortIn this article, a Hybrid algorithm with the combination of quick sort and insertion sort is implemented. As the name suggests, the Hybrid algorithm combines more than one algorithm. Why Hybrid algorithm: Quicksort algorithm is efficient if the size ... | [
{
"code": null,
"e": 26051,
"s": 26023,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 26885,
"s": 26051,
"text": "Prerequisites: Insertion Sort, Quick Sort, Selection SortIn this article, a Hybrid algorithm with the combination of quick sort and insertion sort is implemented. ... |
Python: Age Calculator using Tkinter - GeeksforGeeks | 19 Jan, 2021
Prerequisites :Introduction to tkinter
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter outputs the fastest a... | [
{
"code": null,
"e": 26112,
"s": 26084,
"text": "\n19 Jan, 2021"
},
{
"code": null,
"e": 26151,
"s": 26112,
"text": "Prerequisites :Introduction to tkinter"
},
{
"code": null,
"e": 26572,
"s": 26151,
"text": "Python offers multiple options for developing a GUI... |
Creating Beautiful Twitter Graphs with Python | by Sean Whalen | Towards Data Science | Want to learn two useful Python packages? Want to visualize everyone who doesn’t follow you back on Twitter in one bitter and pathetic graph? Read on.
Graphs in the programming sense are a collection of vertices and edges, rather than a bar graph or a scatter-plot — but you knew that already. Graphs are powerful tools ... | [
{
"code": null,
"e": 323,
"s": 172,
"text": "Want to learn two useful Python packages? Want to visualize everyone who doesn’t follow you back on Twitter in one bitter and pathetic graph? Read on."
},
{
"code": null,
"e": 648,
"s": 323,
"text": "Graphs in the programming sense are... |
DeepPiCar — Part 3: Make PiCar See and Think | by David Tian | Towards Data Science | Welcome back! If you have been following my previous two posts (Part 1 and Part 2) on DeepPiCar, you should have a running robotic car that can be controlled via Python. In the article, we will give your car the superpower of Computer Vision and Deep Learning. By the end of the article, it would be transformed into a t... | [
{
"code": null,
"e": 574,
"s": 171,
"text": "Welcome back! If you have been following my previous two posts (Part 1 and Part 2) on DeepPiCar, you should have a running robotic car that can be controlled via Python. In the article, we will give your car the superpower of Computer Vision and Deep Lear... |
Productionize a Machine Learning model with Flask and Heroku | by GreekDataGuy | Towards Data Science | Coming from a software development background I never thought twice about productionizing my models. But for anyone just getting into coding, as a data scientist, it may not be obvious.
For a model to be used in the real world, you’ll need to productionize it.
In this post we’ll cover a few things:1. creating an ML mod... | [
{
"code": null,
"e": 232,
"s": 46,
"text": "Coming from a software development background I never thought twice about productionizing my models. But for anyone just getting into coding, as a data scientist, it may not be obvious."
},
{
"code": null,
"e": 307,
"s": 232,
"text": "F... |
Merge two arrays with alternating Values in JavaScript | Let’s say, we are required to write a function that takes in two arrays and returns a new array
that contains values in alternating order from first and second array. Here, we will just loop over
both the arrays simultaneously picking values from them one after the other and feed them into
the new array.
The full code ... | [
{
"code": null,
"e": 1368,
"s": 1062,
"text": "Let’s say, we are required to write a function that takes in two arrays and returns a new array\nthat contains values in alternating order from first and second array. Here, we will just loop over\nboth the arrays simultaneously picking values from them... |
Java Program for Ceiling in a sorted array - GeeksforGeeks | 15 Dec, 2021
Given a sorted array and a value x, the ceiling of x is the smallest element in array greater than or equal to x, and the floor is the greatest element smaller than or equal to x. Assume than the array is sorted in non-decreasing order. Write efficient functions to find floor and ceiling of x. Examples : ... | [
{
"code": null,
"e": 24796,
"s": 24768,
"text": "\n15 Dec, 2021"
},
{
"code": null,
"e": 25104,
"s": 24796,
"text": "Given a sorted array and a value x, the ceiling of x is the smallest element in array greater than or equal to x, and the floor is the greatest element smaller tha... |
Gensim - Creating LSI & HDP Topic Model | This chapter deals with creating Latent Semantic Indexing (LSI) and Hierarchical Dirichlet Process (HDP) topic model with regards to Gensim.
The topic modeling algorithms that was first implemented in Gensim with Latent Dirichlet Allocation (LDA) is Latent Semantic Indexing (LSI). It is also called Latent Semantic Anal... | [
{
"code": null,
"e": 2193,
"s": 2052,
"text": "This chapter deals with creating Latent Semantic Indexing (LSI) and Hierarchical Dirichlet Process (HDP) topic model with regards to Gensim."
},
{
"code": null,
"e": 2527,
"s": 2193,
"text": "The topic modeling algorithms that was fi... |
Perl unless Statement | A Perl unless statement consists of a boolean expression followed by one or more statements.
The syntax of an unless statement in Perl programming language is −
unless(boolean_expression) {
# statement(s) will execute if the given condition is false
}
If the boolean expression evaluates to false, then the block of ... | [
{
"code": null,
"e": 2313,
"s": 2220,
"text": "A Perl unless statement consists of a boolean expression followed by one or more statements."
},
{
"code": null,
"e": 2381,
"s": 2313,
"text": "The syntax of an unless statement in Perl programming language is −"
},
{
"code":... |
How does Python generate random numbers? | Standard distribution of Python has a random module that has functions for random number generation. Basic random() function returns a random floating point number between 0 and 1
>>> import random
>>> random.random()
0.5204702770265925
From same module, there is randrange() function which returns a random number betwe... | [
{
"code": null,
"e": 1242,
"s": 1062,
"text": "Standard distribution of Python has a random module that has functions for random number generation. Basic random() function returns a random floating point number between 0 and 1"
},
{
"code": null,
"e": 1299,
"s": 1242,
"text": ">>... |
SaltStack - Salt through SSH | Salt executes commands in a remote system by using salt-minion. This is the normal behavior. In some scenarios, the remote system can be accessed only by the SSH protocol. For these scenarios, Salt provides an option to connect the remote system using the SSH protocol only and execute the command through the SSH layer.... | [
{
"code": null,
"e": 2528,
"s": 2207,
"text": "Salt executes commands in a remote system by using salt-minion. This is the normal behavior. In some scenarios, the remote system can be accessed only by the SSH protocol. For these scenarios, Salt provides an option to connect the remote system using t... |
8 Tips and Tricks for Working with Large Datasets in Machine Learning | by Satyam Kumar | Towards Data Science | Pandas and Scikit-learn are popular libraries among the data science community, as they come with high performance, and easy-to-use data structures and functions. Pandas provide data analytics tools for data preparation and analysis. These libraries work well working with the in-memory datasets (data that fits into RAM... | [
{
"code": null,
"e": 610,
"s": 172,
"text": "Pandas and Scikit-learn are popular libraries among the data science community, as they come with high performance, and easy-to-use data structures and functions. Pandas provide data analytics tools for data preparation and analysis. These libraries work ... |
Resolve the MySQL error 'TYPE=MyISAM'? | To fix the error, you just need to replace TYPE with ENGINE. The syntax to set the engine is as follows −
ENGINE = MyISAM;
The MySQL error occurs when TYPE is used. Let us see the same scenario while creating a table −
mysql> create table Customers
−> (
−> CustomerId int,
−> CustomerName varchar(200)
−> )TY... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "To fix the error, you just need to replace TYPE with ENGINE. The syntax to set the engine is as follows −"
},
{
"code": null,
"e": 1185,
"s": 1168,
"text": "ENGINE = MyISAM;"
},
{
"code": null,
"e": 1281,
"s": 1185,
... |
Create predictive models in R with Caret | by Luiz Fonseca | Towards Data Science | Caret is the short for Classification And REgression Training. It is a complete package that covers all the stages of a pipeline for creating a machine learning predictive model. In this tutorial, I will explain the following topics:
How to install caretHow to create a simple modelHow to use cross-validation to avoid o... | [
{
"code": null,
"e": 406,
"s": 172,
"text": "Caret is the short for Classification And REgression Training. It is a complete package that covers all the stages of a pipeline for creating a machine learning predictive model. In this tutorial, I will explain the following topics:"
},
{
"code":... |
Assembly language program to find the range of bytes - GeeksforGeeks | 22 Oct, 2018
Problem – Write an assembly language program that if an input number BYTE1 lies b/w 50H to 80H display it on output PORT2. If BYTE1 is less then 50H then simply print 00H at the output PORT1.
Examples:
Input: 64H
Output: output at PORT2 -->64H
Input: 40H
Output: output at PORT1 -->00H
Algorithm –
Load t... | [
{
"code": null,
"e": 24415,
"s": 24387,
"text": "\n22 Oct, 2018"
},
{
"code": null,
"e": 24607,
"s": 24415,
"text": "Problem – Write an assembly language program that if an input number BYTE1 lies b/w 50H to 80H display it on output PORT2. If BYTE1 is less then 50H then simply pr... |
Python Design Patterns - Observer | In this pattern, objects are represented as observers that wait for an event to trigger. An observer attaches to the subject once the specified event occurs. As the event occurs, the subject tells the observers that it has occurred.
The following UML diagram represents the observer pattern −
Let us now see how to imple... | [
{
"code": null,
"e": 2712,
"s": 2479,
"text": "In this pattern, objects are represented as observers that wait for an event to trigger. An observer attaches to the subject once the specified event occurs. As the event occurs, the subject tells the observers that it has occurred."
},
{
"code"... |
HTML Navigator userAgent Property | The HTML navigator userAgent property returns the value of the user-agent header sent by the browser to the server.
Following is the syntax −
navigator.userAgent
Let us see an example of HTML navigator userAgent property −
Live Demo
<!DOCTYPE html>
<html>
<style>
body {
color: #000;
height: 100vh;
... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "The HTML navigator userAgent property returns the value of the user-agent header sent by the browser to the server."
},
{
"code": null,
"e": 1204,
"s": 1178,
"text": "Following is the syntax −"
},
{
"code": null,
"e": 122... |
jQuery UI Dialog maxHeight Option - GeeksforGeeks | 12 Jan, 2021
Dialog maxHeight option is used to set the maximum height that can be set to the dialog box. By default, value is false.
Syntax:
$( ".selector" ).dialog({
maxHeight : 10
});
Approach: First, add jQuery UI scripts needed for your project.
<link href = “https://code.jquery.com/ui/1.10.4/themes/ui-lightne... | [
{
"code": null,
"e": 26392,
"s": 26364,
"text": "\n12 Jan, 2021"
},
{
"code": null,
"e": 26513,
"s": 26392,
"text": "Dialog maxHeight option is used to set the maximum height that can be set to the dialog box. By default, value is false."
},
{
"code": null,
"e": 26521... |
HTTP headers | Accept-Ranges - GeeksforGeeks | 31 Oct, 2019
The HTTP Accept-Ranges is the Response type header also the part of the ranges system. This header act as a marker that is used by the server to supports the partial request of the clients. The HTTP Accept-Ranges is useful when the client requests any particular portion of a huge file then this header will... | [
{
"code": null,
"e": 25807,
"s": 25779,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 26381,
"s": 25807,
"text": "The HTTP Accept-Ranges is the Response type header also the part of the ranges system. This header act as a marker that is used by the server to supports the parti... |
How to get all selected checkboxes in an array using jQuery ? - GeeksforGeeks | 03 Aug, 2021
Given a number of checkboxes. The task is to get the value of all selected checkboxes in the array using JQuery. Few of the methods are discussed below:
jQuery on() MethodThis method adds one or more event handlers for the selected elements and child elements.Syntax:$(selector).on(event, childSel, data, fu... | [
{
"code": null,
"e": 26408,
"s": 26380,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 26561,
"s": 26408,
"text": "Given a number of checkboxes. The task is to get the value of all selected checkboxes in the array using JQuery. Few of the methods are discussed below:"
},
{
... |
PHP | MySQL Database Introduction - GeeksforGeeks | 08 Oct, 2021
What is MySQL? MySQL is an open-source relational database management system (RDBMS). It is the most popular database system used with PHP. MySQL is developed, distributed, and supported by Oracle Corporation.
The data in a MySQL database are stored in tables which consists of columns and rows.
MySQL is ... | [
{
"code": null,
"e": 42163,
"s": 42135,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 42375,
"s": 42163,
"text": "What is MySQL? MySQL is an open-source relational database management system (RDBMS). It is the most popular database system used with PHP. MySQL is developed, dis... |
How to Sort LinkedHashSet in Java? - GeeksforGeeks | 04 Jan, 2021
The LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When iterating through a HashSet the order is unpredictable, while a LinkedHashSet lets us iterate through the elements in the order in which they were inserted. When cycling through LinkedHashSet us... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n04 Jan, 2021"
},
{
"code": null,
"e": 25621,
"s": 25225,
"text": "The LinkedHashSet is an ordered version of HashSet that maintains a doubly-linked List across all elements. When iterating through a HashSet the order is unpredict... |
How to import a Python module given the full path? - GeeksforGeeks | 09 May, 2021
The python module is a file consisting of Python code with a set of functions, classes, and variables definitions. The module makes the code reusable and easy to understand. The program which needs to use the module should import that particular module. In this article, we will discuss how to import a Pyth... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 25875,
"s": 25537,
"text": "The python module is a file consisting of Python code with a set of functions, classes, and variables definitions. The module makes the code reusable and easy to u... |
Plotting graphs using Python's plotly and cufflinks module - GeeksforGeeks | 06 Sep, 2021
plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library.
cuffl... | [
{
"code": null,
"e": 25563,
"s": 25535,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 25865,
"s": 25563,
"text": "plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, s... |
SQL AND and OR operators - GeeksforGeeks | 04 Oct, 2021
In SQL, the AND & OR operators are used for filtering the data and getting precise results based on conditions. The SQL AND & OR operators are also used to combine multiple conditions. These two operators can be combined to test for multiple conditions in a SELECT, INSERT, UPDATE, or DELETE statement.
When... | [
{
"code": null,
"e": 25382,
"s": 25354,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 25685,
"s": 25382,
"text": "In SQL, the AND & OR operators are used for filtering the data and getting precise results based on conditions. The SQL AND & OR operators are also used to combine... |
Dashboard UI Design in Android - GeeksforGeeks | 24 Jan, 2021
The Dashboard design is one of the key elements which engages the user with the functionality of the application. It provides information about the overall functionality of the application in one place. The dashboard designing is like putting all the application features on a single page. Designing the das... | [
{
"code": null,
"e": 26039,
"s": 26011,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 26728,
"s": 26039,
"text": "The Dashboard design is one of the key elements which engages the user with the functionality of the application. It provides information about the overall functio... |
Guess the number with React - GeeksforGeeks | 01 Oct, 2021
We create two components App and Result. App components contain all the logic, it is stateful and the Result component only shows the appropriate message on the page according to the user’s guess. The App component has a controlled input field in which the user allowed to type and guess the number. There i... | [
{
"code": null,
"e": 28387,
"s": 28359,
"text": "\n01 Oct, 2021"
},
{
"code": null,
"e": 29030,
"s": 28387,
"text": "We create two components App and Result. App components contain all the logic, it is stateful and the Result component only shows the appropriate message on the pa... |
OnionSearch - Scrapes Urls On Different .Onion Search Engines - GeeksforGeeks | 18 Jul, 2021
OnionSearch is a free and open-source Python script that scrapes URLs on different “.onion” search engines. OnionSearch is a free and open-source tool available on GitHub. OnionSearch is used for scrapping URLs tools. OnionSearch is used to scan websites for information gathering and finding vulnerabilitie... | [
{
"code": null,
"e": 25651,
"s": 25623,
"text": "\n18 Jul, 2021"
},
{
"code": null,
"e": 26380,
"s": 25651,
"text": "OnionSearch is a free and open-source Python script that scrapes URLs on different “.onion” search engines. OnionSearch is a free and open-source tool available on... |
Python - Get Today's Current Day using Speech Recognition - GeeksforGeeks | 09 Aug, 2021
We often don’t remember the day of the date due to our load of work we are doing. So, here is a Python program with the help of which we can find the day of the date with just a simple chat with our laptop or mobile.
DateTime: This is a Library in Python with the help of which we can manipulate the date an... | [
{
"code": null,
"e": 25563,
"s": 25535,
"text": "\n09 Aug, 2021"
},
{
"code": null,
"e": 25780,
"s": 25563,
"text": "We often don’t remember the day of the date due to our load of work we are doing. So, here is a Python program with the help of which we can find the day of the da... |
Print all elements in sorted order from row and column wise sorted matrix - GeeksforGeeks | 17 Dec, 2021
Given an n x n matrix, where every row and column is sorted in non-decreasing order. Print all elements of matrix in sorted order.
Example:
Input: mat[][] = { {10, 20, 30, 40},
{15, 25, 35, 45},
{27, 29, 37, 48},
{32, 33, 39, 50},
... | [
{
"code": null,
"e": 24205,
"s": 24177,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 24336,
"s": 24205,
"text": "Given an n x n matrix, where every row and column is sorted in non-decreasing order. Print all elements of matrix in sorted order."
},
{
"code": null,
... |
Analyzing the Presidential Debate 2020 with text mining techniques | by fylim | Towards Data Science | Thanks to the internet, now the world knew about the Presidential Debate 2020 that went out of control. All of the major news stations were reporting about how the participants were interrupting and sniping at one another.
I decided to put together an article that focuses on analyzing the words used in the event and se... | [
{
"code": null,
"e": 395,
"s": 172,
"text": "Thanks to the internet, now the world knew about the Presidential Debate 2020 that went out of control. All of the major news stations were reporting about how the participants were interrupting and sniping at one another."
},
{
"code": null,
... |
Ionic - Padding | Ionic offers an easy way to add padding to elements. There are couple of classes that can be used and all of them will add 10px between border of element and its content. The following table displays all the available padding classes.
When you want to apply some padding to your element, you just need to assign one of t... | [
{
"code": null,
"e": 2698,
"s": 2463,
"text": "Ionic offers an easy way to add padding to elements. There are couple of classes that can be used and all of them will add 10px between border of element and its content. The following table displays all the available padding classes."
},
{
"cod... |
Pure Function in C++ | Pure functions always return the same result for the same argument values. They only return the result and there are no extra side effects like argument modification, I/O stream, output generation etc.
Some pure functions are sin(), strlen(), sqrt(), max(), pow(), floor() etc. Some impure functions are rand(), time() e... | [
{
"code": null,
"e": 1264,
"s": 1062,
"text": "Pure functions always return the same result for the same argument values. They only return the result and there are no extra side effects like argument modification, I/O stream, output generation etc."
},
{
"code": null,
"e": 1386,
"s":... |
R - Strings | Any value written within a pair of single quote or double quotes in R is treated as a string. Internally R stores every string within double quotes, even when you create them with single quote.
The quotes at the beginning and end of a string should be both double quotes or both single quote. They can not be mixed.
The ... | [
{
"code": null,
"e": 2596,
"s": 2402,
"text": "Any value written within a pair of single quote or double quotes in R is treated as a string. Internally R stores every string within double quotes, even when you create them with single quote."
},
{
"code": null,
"e": 2718,
"s": 2596,
... |
Global and Local Variables in C# | A local variable is used where the scope of the variable is within the method in which it is declared. They can be used only by statements that are inside that function or block of code.
Live Demo
using System;
public class Program {
public static void Main() {
int a;
a = 100;
// local variable
... | [
{
"code": null,
"e": 1249,
"s": 1062,
"text": "A local variable is used where the scope of the variable is within the method in which it is declared. They can be used only by statements that are inside that function or block of code."
},
{
"code": null,
"e": 1260,
"s": 1249,
"tex... |
Join, Sleep and Abort methods in C# Threading | Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping. This method has different overloaded forms.
Makes the thread pause for a period of time.
The Abort method is used to destroy threads.
Let us see an example of Join() in threading −
using System;
using ... | [
{
"code": null,
"e": 1225,
"s": 1062,
"text": "Blocks the calling thread until a thread terminates, while continuing to perform standard COM and SendMessage pumping. This method has different overloaded forms."
},
{
"code": null,
"e": 1270,
"s": 1225,
"text": "Makes the thread pa... |
Data Structures and Algorithms | Set 31 - GeeksforGeeks | 27 Mar, 2017
Following questions have been asked in GATE CS 2013 exam.
1) What is the return value of f(p, p) if the value of p is initialized to 5 before the call? Note that the first parameter is passed by reference, whereas the second parameter is passed by value.
int f(int &x, int c) {
c = c - 1;
if (c == 0)... | [
{
"code": null,
"e": 24009,
"s": 23981,
"text": "\n27 Mar, 2017"
},
{
"code": null,
"e": 24067,
"s": 24009,
"text": "Following questions have been asked in GATE CS 2013 exam."
},
{
"code": null,
"e": 24264,
"s": 24067,
"text": "1) What is the return value of f... |
How to delete a MongoDB document using Java? | You can delete a document from an existing collection in MongoDB using the remove() method.
db.coll.remove(DELLETION_CRITTERIA)
Where,
db is the database.
db is the database.
coll is the collection (name) in which you want to insert the document
coll is the collection (name) in which you want to insert the document
Ass... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "You can delete a document from an existing collection in MongoDB using the remove() method."
},
{
"code": null,
"e": 1190,
"s": 1154,
"text": "db.coll.remove(DELLETION_CRITTERIA)"
},
{
"code": null,
"e": 1197,
"s": 11... |
15 Surprisingly Useful Python Base Modules | by Emmett Boudreau | Towards Data Science | Earlier this month, I went in-depth on some seriously powerful and surprisingly useful functions that are in the base of the Python programming language. These standard library modules and Python functions are pretty awesome, but a fortunate thing is that they are all only only a blink in the eye when it comes to what ... | [
{
"code": null,
"e": 734,
"s": 172,
"text": "Earlier this month, I went in-depth on some seriously powerful and surprisingly useful functions that are in the base of the Python programming language. These standard library modules and Python functions are pretty awesome, but a fortunate thing is that... |
How to handle a mouse right click event using jQuery? | To handle a mouse right click event, use the mousedown() jQuery method. Mouse left, right and middle click can also be captured using the same method. You can try to run the following code to learn how to handle a mouse right click event:
Live Demo
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/... | [
{
"code": null,
"e": 1301,
"s": 1062,
"text": "To handle a mouse right click event, use the mousedown() jQuery method. Mouse left, right and middle click can also be captured using the same method. You can try to run the following code to learn how to handle a mouse right click event:"
},
{
... |
What is Multiplication Assignment Operator (*=) in JavaScript? | Multiplication Assignment Operator (*=)multiplies the right operand with the left operand and assigns the result to the left operand.
You can try to run the following code to learn how to work with Multiplication Assignment Operator −
<html>
<body>
<script>
var a = 33;
var b = 10;
d... | [
{
"code": null,
"e": 1196,
"s": 1062,
"text": "Multiplication Assignment Operator (*=)multiplies the right operand with the left operand and assigns the result to the left operand."
},
{
"code": null,
"e": 1297,
"s": 1196,
"text": "You can try to run the following code to learn h... |
Fibonacci: Linear Recurrences and Eigendecomposition in Python | by Christoph Ostertag | Towards Data Science | Today we are going to explore the infamous Fibonacci sequence and use it as an example to explain linear recurrences and eigendecomposition. You should be familiar with what a vector and a matrix is and how we can do matrix multiplication.
The Fibonacci sequence is defined recursively as an = a(n-1) + a(n-2)
We start w... | [
{
"code": null,
"e": 412,
"s": 172,
"text": "Today we are going to explore the infamous Fibonacci sequence and use it as an example to explain linear recurrences and eigendecomposition. You should be familiar with what a vector and a matrix is and how we can do matrix multiplication."
},
{
"... |
Donut Plot with Matplotlib (Python) | by Asad Mahmood | Towards Data Science | “A picture is worth a thousand words”
In this post, I’ll demonstrate how to create a donut plot using matplotlib with python. Donut plot is a very efficient way of comparing stats of multiple entities. As per [1]
Just like a pie chart, a doughnut chart shows the relationship of parts to a whole, but a doughnut chart ca... | [
{
"code": null,
"e": 210,
"s": 172,
"text": "“A picture is worth a thousand words”"
},
{
"code": null,
"e": 385,
"s": 210,
"text": "In this post, I’ll demonstrate how to create a donut plot using matplotlib with python. Donut plot is a very efficient way of comparing stats of mul... |
Packaging and Publishing Python code? | Python provides a very simple way of creating or publishing packages.
Package management in Python is available through different tools−
Pip- It remains one of the preferred choices because it virtually eliminates any manual installs and updates of software packages to operating systems. It manages full lists of packag... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "Python provides a very simple way of creating or publishing packages."
},
{
"code": null,
"e": 1199,
"s": 1132,
"text": "Package management in Python is available through different tools−"
},
{
"code": null,
"e": 1522,
... |
Text Analysis Using Turicreate | 08 Dec, 2021
What is Text Analysis?Text is a group of words or sentences.Text analysis is analyzing the text and then extracting information with the help of text.Text data is one of the biggest factor that can make a company big or small.For example
On E-Commerce website people buy things .With Text Analysis the E-... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Dec, 2021"
},
{
"code": null,
"e": 269,
"s": 28,
"text": "What is Text Analysis?Text is a group of words or sentences.Text analysis is analyzing the text and then extracting information with the help of text.Text data is one of the... |
What is the use of setInterval() method in Node.js ? | 30 Sep, 2021
The setInterval() method helps us to repeatedly execute a function after a fixed delay. It returns a unique interval ID which can later be used by the clearInterval() method which stops further repeated execution of the function.
Syntax:
const intervalId = setInterval(func,
[delay, arg1, agr2, ..., a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 259,
"s": 28,
"text": "The setInterval() method helps us to repeatedly execute a function after a fixed delay. It returns a unique interval ID which can later be used by the clearInterval() method w... |
Calculate number of nodes between two vertices in an acyclic Graph by Disjoint Union method | 06 Jul, 2021
Given a connected acyclic graph, a source vertex and a destination vertex, your task is to count the number of vertices between the given source and destination vertex by Disjoint Union Method .Examples:
Input : 1 4
4 5
4 2
2 6
6 3
1 3
Output : 3
In the input 6 is... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2021"
},
{
"code": null,
"e": 260,
"s": 54,
"text": "Given a connected acyclic graph, a source vertex and a destination vertex, your task is to count the number of vertices between the given source and destination vertex by Dis... |
void pointer in C / C++ | 14 Jun, 2022
A void pointer is a pointer that has no associated data type with it. A void pointer can hold address of any type and can be typecasted to any type.
C++
C
// C++ Program to demonstrate that a void pointer// can hold the address of any type-castable type #include <iostream>using namespace std; int main(){ ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Jun, 2022"
},
{
"code": null,
"e": 202,
"s": 52,
"text": "A void pointer is a pointer that has no associated data type with it. A void pointer can hold address of any type and can be typecasted to any type. "
},
{
"code": nu... |
Program to clear K-th bit of a number N | 08 Nov, 2021
Given a number N, the task is to clear the K-th bit of this number N. If K-th bit is 1, then clear it to 0 and if it is 0 then leave it unchanged.Examples:
Input: N = 5, K = 1
Output: 4
5 is represented as 101 in binary
and has its first bit 1, so clearing
it will result in 100 i.e. 4.
Input: N = 5, K =... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Nov, 2021"
},
{
"code": null,
"e": 212,
"s": 54,
"text": "Given a number N, the task is to clear the K-th bit of this number N. If K-th bit is 1, then clear it to 0 and if it is 0 then leave it unchanged.Examples: "
},
{
"c... |
How to adjust CSS for specific zoom level? | 02 Jul, 2019
In this article, we are going to learn how do we adjust the CSS for a specific zoom level. The CSS zoom property allows scaling of the content. This property is not recommended for production sites because it doesn’t support in some browsers.
Values:
percentage: Scaling by percentage
number: Scaling using ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Jul, 2019"
},
{
"code": null,
"e": 297,
"s": 54,
"text": "In this article, we are going to learn how do we adjust the CSS for a specific zoom level. The CSS zoom property allows scaling of the content. This property is not recommend... |
Python | Pandas dataframe.take() | 23 Nov, 2018
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas dataframe.take() function return the elements in the given positional indices along an... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Nov, 2018"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
How to remove .html extension from URL of a static page ? | 07 Aug, 2021
All the pages on the website have a structure which is given by HTML. HTML provides the structure to content, text, tables, headings, and lists on the webpage that makes the page easy to read. While saving an HTML document it has an extension as .html. Therefore, the URL of the website have a .html extensi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Aug, 2021"
},
{
"code": null,
"e": 412,
"s": 28,
"text": "All the pages on the website have a structure which is given by HTML. HTML provides the structure to content, text, tables, headings, and lists on the webpage that makes the p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.