title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Text-based Causal Inference. Tutorial on analyzing voter fraud... | by Haaya Naushan | Towards Data Science | Science fiction tells us that rampant disinformation is a foresign of a society’s descent into a dystopia. It could be argued that disinformation destabilizes a democracy (Morgan 2018, Farkas & Schou 2019). Tangibly, people disregarding medical evidence has a negative impact on public health. For instance, people who a... | [
{
"code": null,
"e": 1305,
"s": 172,
"text": "Science fiction tells us that rampant disinformation is a foresign of a society’s descent into a dystopia. It could be argued that disinformation destabilizes a democracy (Morgan 2018, Farkas & Schou 2019). Tangibly, people disregarding medical evidence ... |
Clear a list in C# | Firstly, set a list −
List<int> myList = new List<int>();
myList.Add(45);
myList.Add(77);
Now, to clear the above list, use Clear() −
myList.Clear();
Here is the complete code −
Live Demo
using System;
using System.Collections.Generic;
public class Demo {
public static void Main() {
List<int> myList = new Lis... | [
{
"code": null,
"e": 1084,
"s": 1062,
"text": "Firstly, set a list −"
},
{
"code": null,
"e": 1152,
"s": 1084,
"text": "List<int> myList = new List<int>();\nmyList.Add(45);\nmyList.Add(77);"
},
{
"code": null,
"e": 1196,
"s": 1152,
"text": "Now, to clear the a... |
C/C++ Tricky Programs - GeeksforGeeks | 28 Mar, 2022
We may come across various tricky programs in our day to day life. Maybe in technical interviews, coding tests, or in C/C++ classrooms.
Here is a list of such programs:-
Print text within double quotes (” “). This may seem easy but beginners may get puzzled while printing text within double-quotes.
C++
/... | [
{
"code": null,
"e": 24234,
"s": 24206,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 24371,
"s": 24234,
"text": "We may come across various tricky programs in our day to day life. Maybe in technical interviews, coding tests, or in C/C++ classrooms. "
},
{
"code": null... |
Arcade inbuilt functions to draw polygon in Python3 - GeeksforGeeks | 11 Oct, 2020
The arcade library is a high-tech Python Package with advanced set of tools for making 2D games with gripping graphics and sound. It is Object-oriented and is especially built for Python 3.6 and above versions.
Arcade has two inbuilt functions for drawing a polygon:
1. arcade.draw_polygon_outline( ) : This... | [
{
"code": null,
"e": 23927,
"s": 23899,
"text": "\n11 Oct, 2020"
},
{
"code": null,
"e": 24138,
"s": 23927,
"text": "The arcade library is a high-tech Python Package with advanced set of tools for making 2D games with gripping graphics and sound. It is Object-oriented and is espe... |
Add Column to Pandas DataFrame with a Default Value - GeeksforGeeks | 29 Aug, 2020
The three ways to add a column to Pandas DataFrame with Default Value.
Using pandas.DataFrame.assign(**kwargs)
Using [] operator
Using pandas.DataFrame.insert()
It Assigns new columns to a DataFrame and returns a new object with all existing columns to new ones. Existing columns that are re-assigned will b... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 23972,
"s": 23901,
"text": "The three ways to add a column to Pandas DataFrame with Default Value."
},
{
"code": null,
"e": 24012,
"s": 23972,
"text": "Using pandas.DataFr... |
EasyMock - Verifying Behavior | EasyMock can ensure whether a mock is being used or not. It is done using the verify() method. Take a look at the following code snippet.
//activate the mock
EasyMock.replay(calcService);
//test the add functionality
Assert.assertEquals(mathApplication.add(10.0, 20.0),30.0,0);
//verify call to calcService is made or ... | [
{
"code": null,
"e": 2047,
"s": 1909,
"text": "EasyMock can ensure whether a mock is being used or not. It is done using the verify() method. Take a look at the following code snippet."
},
{
"code": null,
"e": 2263,
"s": 2047,
"text": "//activate the mock\nEasyMock.replay(calcSer... |
Materialize CSS - Modals - GeeksforGeeks | 09 Sep, 2020
Materialize CSS uses modal component for creating dialog boxes, confirmation messages or presenting important content to the viewers where underlying content becomes inactive until the modal window is closed.
In order for the modal to work, add the modal Id to the link of the trigger and include the refere... | [
{
"code": null,
"e": 25376,
"s": 25348,
"text": "\n09 Sep, 2020"
},
{
"code": null,
"e": 25585,
"s": 25376,
"text": "Materialize CSS uses modal component for creating dialog boxes, confirmation messages or presenting important content to the viewers where underlying content becom... |
How to get the title and full URL of a document in JavaScript? | Javascript HTML DOM has provided some basic methods to access and manipulate the HTML data. To find the title and URL of a document, javascript has provided document.title and document.URL respectively. Let's discuss them individually.
To get the title of a document javascript HTML DOM has provided document.title metho... | [
{
"code": null,
"e": 1298,
"s": 1062,
"text": "Javascript HTML DOM has provided some basic methods to access and manipulate the HTML data. To find the title and URL of a document, javascript has provided document.title and document.URL respectively. Let's discuss them individually."
},
{
"co... |
Forecasting using Granger’s Causality and Vector Auto-regressive Model | by Sarit Maitra | Towards Data Science | FORECASTING of Gold and Oil have garnered major attention from academics, investors and Government agencies like. These two products are known for their substantial influence on global economy. I will show here, how to use Granger’s Causality Test to test the relationships of multiple variables in the time series and V... | [
{
"code": null,
"e": 557,
"s": 46,
"text": "FORECASTING of Gold and Oil have garnered major attention from academics, investors and Government agencies like. These two products are known for their substantial influence on global economy. I will show here, how to use Granger’s Causality Test to test ... |
Java Program for focal length of a spherical mirror | Following is the Java code for focal length of a spherical mirror −
Live Demo
import java.util.*;
import java.lang.*;
public class Demo{
public static float concave_f_len(float val){
return val/2 ;
}
public static float convex_f_len(float val){
return - (val/2 ) ;
}
public static void main(S... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "Following is the Java code for focal length of a spherical mirror −"
},
{
"code": null,
"e": 1141,
"s": 1130,
"text": " Live Demo"
},
{
"code": null,
"e": 1650,
"s": 1141,
"text": "import java.util.*;\nimport java... |
Check whether a number has consecutive 0's in the given base or not - GeeksforGeeks | 09 Apr, 2021
Given a decimal number N, the task is to check if a number has consecutive zeroes or not after converting the number to its K-based notation.
Examples:
Input: N = 4, K = 2 Output: No 4 in base 2 is 100, As there are consecutive 2 thus the answer is No.
Input: N = 15, K = 8 Output: Yes 15 in base 8 is 17, ... | [
{
"code": null,
"e": 25259,
"s": 25231,
"text": "\n09 Apr, 2021"
},
{
"code": null,
"e": 25401,
"s": 25259,
"text": "Given a decimal number N, the task is to check if a number has consecutive zeroes or not after converting the number to its K-based notation."
},
{
"code":... |
Install Shapely on Windows. Simple instructions for installing... | by Dalya Gartzman | Towards Data Science | Shapely is a Python package full of wonderful possibilities for geometric stuff to do with your data.Though, if you are working on Windows OS, installing Shapely is not a trivial task.
Luckily, once you know the details, it’s not that hard.
Find out your whether you are using Windows 32-bit or 64-bit. Go to Settings =>... | [
{
"code": null,
"e": 357,
"s": 172,
"text": "Shapely is a Python package full of wonderful possibilities for geometric stuff to do with your data.Though, if you are working on Windows OS, installing Shapely is not a trivial task."
},
{
"code": null,
"e": 413,
"s": 357,
"text": "L... |
base64.DecodeString() Function in Golang With Examples - GeeksforGeeks | 19 May, 2020
Go language provides inbuilt support for base64 encoding/decoding and has functions that could be used to perform operations on the given data using the base64 package. This package provides DecodeString() function which is used to decode a base64 string to its plaintext form. It supports decoding using bo... | [
{
"code": null,
"e": 24380,
"s": 24352,
"text": "\n19 May, 2020"
},
{
"code": null,
"e": 24736,
"s": 24380,
"text": "Go language provides inbuilt support for base64 encoding/decoding and has functions that could be used to perform operations on the given data using the base64 pac... |
Develop a WiFi Scanner for Android | This example demonstrate about How to develop a WiFi Scanner for 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"?>
<RelativeL... | [
{
"code": null,
"e": 1135,
"s": 1062,
"text": "This example demonstrate about How to develop a WiFi Scanner for 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... |
Convert an Integer to a Binary value in R Programming - as.binary() Function - GeeksforGeeks | 16 Jun, 2020
as.binary() function in R Language is used to convert an integer value to a binary value.
Syntax: as.binary(x)
Parameters:x: Integer value
Example 1:
# R Program to convert# an integer to binary # Loading librarylibrary(binaryLogic) # Calling as.binary() functionas.binary(1)as.binary(10)as.binary(-1)as.b... | [
{
"code": null,
"e": 24395,
"s": 24367,
"text": "\n16 Jun, 2020"
},
{
"code": null,
"e": 24485,
"s": 24395,
"text": "as.binary() function in R Language is used to convert an integer value to a binary value."
},
{
"code": null,
"e": 24506,
"s": 24485,
"text": "... |
DateTime.ToOADate() Method in C# | The DateTime.ToOADate() method in C# is used to convert the value of this instance to the equivalent OLE Automation date.
Following is the syntax −
public double ToOADate ();
Let us now see an example to implement the DateTime.ToOADate() method −
using System;
public class Demo {
public static void Main() {
Da... | [
{
"code": null,
"e": 1184,
"s": 1062,
"text": "The DateTime.ToOADate() method in C# is used to convert the value of this instance to the equivalent OLE Automation date."
},
{
"code": null,
"e": 1210,
"s": 1184,
"text": "Following is the syntax −"
},
{
"code": null,
"e... |
HTML DOM removeChild() Method | The DOM removeChild() method returns and remove the specified child node of the specified node in an HTML document.
Following is the syntax −
node.removeChild(node);
Let us see an example of removeChild() method −
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
html{
height:100%;
}
body{
text-alig... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "The DOM removeChild() method returns and remove the specified child node of the specified node in an HTML document."
},
{
"code": null,
"e": 1204,
"s": 1178,
"text": "Following is the syntax −"
},
{
"code": null,
"e": 122... |
Profit and loss Problems using C | Given a certain cost price(cp) and a selling price(sp) of an unknown product or a service, our task is to find the profit earned or loss suffered using a C program where if the profit is earned should print “Profit” and it’s amount or if the loss is suffered “Loss” and its respective amount or if there is not profit no... | [
{
"code": null,
"e": 1421,
"s": 1062,
"text": "Given a certain cost price(cp) and a selling price(sp) of an unknown product or a service, our task is to find the profit earned or loss suffered using a C program where if the profit is earned should print “Profit” and it’s amount or if the loss is suf... |
Find the direction from given string in C++ | Suppose we have a string which contains only L and R, this denotes left rotation and right rotation respectively, we have to find the final direction of pivot. Here directions are north(N), east(E), south(S) and west(W). We are assuming that the pivot is pointed towards north(N) in a compass.
So, if the input is like "... | [
{
"code": null,
"e": 1356,
"s": 1062,
"text": "Suppose we have a string which contains only L and R, this denotes left rotation and right rotation respectively, we have to find the final direction of pivot. Here directions are north(N), east(E), south(S) and west(W). We are assuming that the pivot i... |
Python | Index of Non-Zero elements in Python list - GeeksforGeeks | 05 Sep, 2019
Sometimes, while working with python list, we can have a problem in which we need to find positions of all the integers other than 0. This can have application in day-day programming or competitive programming. Let’s discuss a shorthand by which we can perform this particular task.
Method : Using enumerate... | [
{
"code": null,
"e": 24391,
"s": 24363,
"text": "\n05 Sep, 2019"
},
{
"code": null,
"e": 24674,
"s": 24391,
"text": "Sometimes, while working with python list, we can have a problem in which we need to find positions of all the integers other than 0. This can have application in ... |
Elegant And Efficient Usage of If-Else Clauses | by Mohammed Ayar | Towards Data Science | Take a piece of writing. Remove the cohesive devices (However, Therefore...). And read it. Does it make sense anymore? NO! The same thing applies to code without if-else statements.
Conditional branching is a basic and mandatory programming concept. It flags a reasoning shift. The wise utilization of conditionals resul... | [
{
"code": null,
"e": 354,
"s": 172,
"text": "Take a piece of writing. Remove the cohesive devices (However, Therefore...). And read it. Does it make sense anymore? NO! The same thing applies to code without if-else statements."
},
{
"code": null,
"e": 547,
"s": 354,
"text": "Cond... |
C++ Program to Perform Inorder Recursive Traversal of a Given Binary Tree | Tree traversal is a form of graph traversal. It involves checking or printing each node in the tree exactly once. The inorder traversal of a binary search tree involves visiting each of the nodes in the tree in the order (Left, Root, Right).
An example of Inorder traversal of a binary tree is as follows.
A binary tree ... | [
{
"code": null,
"e": 1304,
"s": 1062,
"text": "Tree traversal is a form of graph traversal. It involves checking or printing each node in the tree exactly once. The inorder traversal of a binary search tree involves visiting each of the nodes in the tree in the order (Left, Root, Right)."
},
{
... |
Leaders in an array | Practice | GeeksforGeeks | Given an array A of positive integers. Your task is to find the leaders in the array. An element of array is leader if it is greater than or equal to all the elements to its right side. The rightmost element is always a leader.
Example 1:
Input:
n = 6
A[] = {16,17,4,3,5,2}
Output: 17 5 2
Explanation: The first leade... | [
{
"code": null,
"e": 467,
"s": 238,
"text": "Given an array A of positive integers. Your task is to find the leaders in the array. An element of array is leader if it is greater than or equal to all the elements to its right side. The rightmost element is always a leader. "
},
{
"code": null... |
C | Functions | Question 8 - GeeksforGeeks | 28 Jun, 2021
What is the meaning of using extern before function declaration?
For example following function sum is made extern
extern int sum(int x, int y, int z)
{
return (x + y + z);
}
(A) Function is made globally available(B) extern means nothing, sum() is same without extern keyword.(C) Function need not to b... | [
{
"code": null,
"e": 24478,
"s": 24450,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24543,
"s": 24478,
"text": "What is the meaning of using extern before function declaration?"
},
{
"code": null,
"e": 24593,
"s": 24543,
"text": "For example following fun... |
Importing DynamoDB Data Using Apache Hive on Amazon EMR | by Yi Ai | Towards Data Science | This article describes one of the many ways to import data into AWS DynamoDB database. The option explained here uses Amazon EMR and Hive. Using Amazon EMR and Hive you can quickly and efficiently process large amounts of data, such as importing data from Amazon S3 into a DynamoDB table.
Every day an external datasourc... | [
{
"code": null,
"e": 460,
"s": 171,
"text": "This article describes one of the many ways to import data into AWS DynamoDB database. The option explained here uses Amazon EMR and Hive. Using Amazon EMR and Hive you can quickly and efficiently process large amounts of data, such as importing data from... |
Matplotlib.axes.Axes.properties() in Python - GeeksforGeeks | 30 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axe... | [
{
"code": null,
"e": 24225,
"s": 24197,
"text": "\n30 Apr, 2020"
},
{
"code": null,
"e": 24525,
"s": 24225,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ... |
How can we use MySQL SUM() function with HAVING clause? | By using MySQL SUM() function with the HAVING clause, it filters the result based on a specific condition given after the HAVING clause. To understand the above concept, consider an ‘employee_tbl’ table, which is having the following records −
mysql> SELECT * FROM employee_tbl;
+------+------+------------+-------------... | [
{
"code": null,
"e": 1306,
"s": 1062,
"text": "By using MySQL SUM() function with the HAVING clause, it filters the result based on a specific condition given after the HAVING clause. To understand the above concept, consider an ‘employee_tbl’ table, which is having the following records −"
},
{... |
Solidity - Arrays | Array is a data structure, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
Instead of declaring individual variables, such as number0, number1, ..... | [
{
"code": null,
"e": 2804,
"s": 2555,
"text": "Array is a data structure, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type."
}... |
Check if all levels of two trees are anagrams or not - GeeksforGeeks | 15 Sep, 2021
Given two binary trees, we have to check if each of their levels are anagrams of each other or not. Example:
Tree 1:
Level 0 : 1
Level 1 : 3, 2
Level 2 : 5, 4
Tree 2:
Level 0 : 1
Level 1 : 2, 3
Level 2 : 4, 5
As we can clearly see all the levels of above two binary trees are anagrams of each other, he... | [
{
"code": null,
"e": 24652,
"s": 24624,
"text": "\n15 Sep, 2021"
},
{
"code": null,
"e": 24763,
"s": 24652,
"text": "Given two binary trees, we have to check if each of their levels are anagrams of each other or not. Example: "
},
{
"code": null,
"e": 24866,
"s":... |
Program to compare two fractions - GeeksforGeeks | 11 May, 2021
Given two fractions a/b and c/d, compare them and print the larger of the two.
Examples :
Input: 5/6, 11/45
Output: 5/6
Input: 4/5 and 2/3
Output: 4/5
We can simply convert the fractions into floating-point values by dividing the numerator by the denominator. Once we have the two floating-point numbers... | [
{
"code": null,
"e": 24716,
"s": 24688,
"text": "\n11 May, 2021"
},
{
"code": null,
"e": 24795,
"s": 24716,
"text": "Given two fractions a/b and c/d, compare them and print the larger of the two."
},
{
"code": null,
"e": 24808,
"s": 24795,
"text": "Examples : ... |
HTML5 Canvas - Composition | HTML5 canvas provides compositing attribute globalCompositeOperation which affect all the drawing operations.
We can draw new shapes behind existing shapes and mask off certain areas, clear sections from the canvas using globalCompositeOperation attribute as shown below in the example.
There are following values which ... | [
{
"code": null,
"e": 2718,
"s": 2608,
"text": "HTML5 canvas provides compositing attribute globalCompositeOperation which affect all the drawing operations."
},
{
"code": null,
"e": 2895,
"s": 2718,
"text": "We can draw new shapes behind existing shapes and mask off certain areas... |
TCL Full Form - GeeksforGeeks | 08 Nov, 2021
TCL stands for Transaction Control Languages. These commands are used for maintaining consistency of the database and for the management of transactions made by the DML commands.
A Transaction is a set of SQL statements that are executed on the data stored in DBMS. Whenever any transaction is made these t... | [
{
"code": null,
"e": 24040,
"s": 24012,
"text": "\n08 Nov, 2021"
},
{
"code": null,
"e": 24220,
"s": 24040,
"text": "TCL stands for Transaction Control Languages. These commands are used for maintaining consistency of the database and for the management of transactions made by th... |
Implement Gradient Descent in Python | by Rohan Joseph | Towards Data Science | It is an optimization algorithm to find the minimum of a function. We start with a random point on the function and move in the negative direction of the gradient of the function to reach the local/global minima.
Question : Find the local minima of the function y=(x+5)2 starting from the point x=3
Solution : We know th... | [
{
"code": null,
"e": 384,
"s": 171,
"text": "It is an optimization algorithm to find the minimum of a function. We start with a random point on the function and move in the negative direction of the gradient of the function to reach the local/global minima."
},
{
"code": null,
"e": 470,
... |
Check if removing an edge can divide a Binary Tree in two halves - GeeksforGeeks | 10 May, 2021
Given a Binary Tree, find if there exists an edge whose removal creates two trees of equal size.
Examples:
Input : root of following tree
5
/ \
1 6
/ / \
3 7 4
Output : true
Removing edge 5-6 creates two trees of equal size
Input : root of ... | [
{
"code": null,
"e": 24935,
"s": 24907,
"text": "\n10 May, 2021"
},
{
"code": null,
"e": 25032,
"s": 24935,
"text": "Given a Binary Tree, find if there exists an edge whose removal creates two trees of equal size."
},
{
"code": null,
"e": 25044,
"s": 25032,
"t... |
How does garbage collection work in Python? | Python deletes unwanted objects (built-in types or class instances) automatically to free the memory space. The process by which Python periodically frees and reclaims blocks of memory that no longer are in use is called Garbage Collection.
Python's garbage collector runs during program execution and is triggered when ... | [
{
"code": null,
"e": 1303,
"s": 1062,
"text": "Python deletes unwanted objects (built-in types or class instances) automatically to free the memory space. The process by which Python periodically frees and reclaims blocks of memory that no longer are in use is called Garbage Collection."
},
{
... |
Python IMDbPY – Getting rating of the series - GeeksforGeeks | 10 May, 2020
In this article we will see how we can get the rating of the series, rating in IMDb is given from 10 points the rating is based on the viewer experience, the higher the rating means views are highly satisfied or in other words they like the movie.
In order to get this we have to do the following –
1. Get t... | [
{
"code": null,
"e": 24083,
"s": 24055,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 24331,
"s": 24083,
"text": "In this article we will see how we can get the rating of the series, rating in IMDb is given from 10 points the rating is based on the viewer experience, the highe... |
How to create a collapsible section with CSS and JavaScript? | To create a collapsible section with CSS and JavaScript, the code is as follows −
Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.collapse {
background-col... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "To create a collapsible section with CSS and JavaScript, the code is as follows −"
},
{
"code": null,
"e": 1155,
"s": 1144,
"text": " Live Demo"
},
{
"code": null,
"e": 2489,
"s": 1155,
"text": "<!DOCTYPE html>\n<... |
Path iterator() method in Java with Examples | 30 Jul, 2019
The iterator() method of java.nio.file.Path used to returns an iterator of the name elements which construct this path.The first element of this iterator contains the name element that is closest to the root in the directory hierarchy, the second element is the next closest, and so on. The last element of ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jul, 2019"
},
{
"code": null,
"e": 460,
"s": 28,
"text": "The iterator() method of java.nio.file.Path used to returns an iterator of the name elements which construct this path.The first element of this iterator contains the name ele... |
Nested switch statement in C++ | 01 Dec, 2018
Switch-case statements:
These are a substitute for long if statements that compare a variable to several integral values
The switch statement is a multiway branch statement. It provides an easy way to dispatch execution to different parts of code based on the value of the expression.
Switch is a control st... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Dec, 2018"
},
{
"code": null,
"e": 78,
"s": 54,
"text": "Switch-case statements:"
},
{
"code": null,
"e": 175,
"s": 78,
"text": "These are a substitute for long if statements that compare a variable to several in... |
Introduction to Scala | 24 Sep, 2021
Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides the support to the functional programming approach. There is no concept of primitive data as everything is an object in Scala. It is designed to express the gen... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 696,
"s": 52,
"text": "Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides the support to the function... |
PHP & AJAX | AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS and Java Script.
AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web appl... | [
{
"code": null,
"e": 3080,
"s": 2891,
"text": "AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS and Java Script."
},
{
"code": null,
"e": 3269,
"s": 3080,
"t... |
How to append a string in PHP ? | 02 Jun, 2020
We have given two strings and the task is to append a string str1 with another string str2 in PHP. There is no specific function to append a string in PHP. In order to do this task, we have the this operator in PHP:
Using Concatenation assignment operator (“.=”): The Concatenation assignment operator is us... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Jun, 2020"
},
{
"code": null,
"e": 244,
"s": 28,
"text": "We have given two strings and the task is to append a string str1 with another string str2 in PHP. There is no specific function to append a string in PHP. In order to do this... |
C# | How to change Foreground Color of Text in Console | 28 Jan, 2019
Given the normal Console in C#, the default color of the text foreground is “Black”. The task is to change this color to some other color.
Approach: This can be done using the ForegroundColor property in the Console class of the System package in C#.
Program 1: Changing the Console Foreground Color to Blue... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2019"
},
{
"code": null,
"e": 167,
"s": 28,
"text": "Given the normal Console in C#, the default color of the text foreground is “Black”. The task is to change this color to some other color."
},
{
"code": null,
"e":... |
Lodash _.uniqBy() Method | 11 Feb, 2021
The _.uniqBy method is similar to _.uniq except that it accepts iteratee which is invoked for each element in an array to generate the criterion by which uniqueness is computed. The order of result values is determined by the order they occur in the array.Syntax:
_.uniqBy([array], [iteratee=_.identity])
Pa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Feb, 2021"
},
{
"code": null,
"e": 292,
"s": 28,
"text": "The _.uniqBy method is similar to _.uniq except that it accepts iteratee which is invoked for each element in an array to generate the criterion by which uniqueness is compute... |
GATE | GATE CS 1999 | Question 40 | 30 Sep, 2020
A grammar that is both left and right recursive for a non-terminal is(A) Ambiguous(B) Unambiguous(C) Information is not sufficient to decide whether it is ambiguous or Unambiguous.(D) None of the aboveAnswer: (C)Explanation: Suppose we have grammar like this :
S → n
B → BbB
Here we see that grammar is lef... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Sep, 2020"
},
{
"code": null,
"e": 289,
"s": 28,
"text": "A grammar that is both left and right recursive for a non-terminal is(A) Ambiguous(B) Unambiguous(C) Information is not sufficient to decide whether it is ambiguous or Unambig... |
Python - Filter Rows Based on Column Values with query function in Pandas? | To filter rows based on column values, we can use the query() function. In the function, set the condition through which you want to filter records. At first, import the required library −
import pandas as pd
Following is our data with Team Records −
Team = [['India', 1, 100],['Australia', 2, 85],['England', 3, 75],['N... | [
{
"code": null,
"e": 1251,
"s": 1062,
"text": "To filter rows based on column values, we can use the query() function. In the function, set the condition through which you want to filter records. At first, import the required library −"
},
{
"code": null,
"e": 1271,
"s": 1251,
"t... |
How to create your own VS Code server | by Dimitris Poulopoulos | Towards Data Science | Visual Studio Code is a free, lightweight, and cross-platform code editor. It may not be a full-fledged IDE like IntelliJ Idea or PyCharm, but it is a powerful, distraction-free tool with a dedicated fanbase and a thriving ecosystem.
VS Code has become the editor many developers prefer during recent years, irrespective... | [
{
"code": null,
"e": 406,
"s": 172,
"text": "Visual Studio Code is a free, lightweight, and cross-platform code editor. It may not be a full-fledged IDE like IntelliJ Idea or PyCharm, but it is a powerful, distraction-free tool with a dedicated fanbase and a thriving ecosystem."
},
{
"code":... |
JDBC - CallableStatement Object Example | Following is the example, which makes use of the CallableStatement along with the following getEmpName() MySQL stored procedure −
Make sure you have created this stored procedure in your EMP Database. You can use MySQL Query Browser to get it done.
DELIMITER $$
DROP PROCEDURE IF EXISTS `EMP`.`getEmpName` $$
CREATE PRO... | [
{
"code": null,
"e": 2292,
"s": 2162,
"text": "Following is the example, which makes use of the CallableStatement along with the following getEmpName() MySQL stored procedure −"
},
{
"code": null,
"e": 2411,
"s": 2292,
"text": "Make sure you have created this stored procedure in ... |
Find the number of squares inside the given square grid - GeeksforGeeks | 08 Mar, 2022
Given a grid of side N * N, the task is to find the total number of squares that exist inside it. All squares selected can be of any length.Examples:
Input: N = 1 Output: 1
Input: N = 2 Output: 5
Input: N = 4 Output: 30
Approach 1: Taking a few examples, it can be observed that for a grid on size... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n08 Mar, 2022"
},
{
"code": null,
"e": 24453,
"s": 24301,
"text": "Given a grid of side N * N, the task is to find the total number of squares that exist inside it. All squares selected can be of any length.Examples: "
},
{
... |
Pascal - Strings | The string in Pascal is actually a sequence of characters with an optional size specification. The characters could be numeric, letters, blank, special characters or a combination of all. Extended Pascal provides numerous types of string objects depending upon the system and implementation. We will discuss more common ... | [
{
"code": null,
"e": 2438,
"s": 2083,
"text": "The string in Pascal is actually a sequence of characters with an optional size specification. The characters could be numeric, letters, blank, special characters or a combination of all. Extended Pascal provides numerous types of string objects dependi... |
HTML - <li>Tag | The HTML <li> tag is used for specifying a list item in ordered, unordered, directory, and menu lists.
<!DOCTYPE html>
<html>
<head>
<title>HTML li Tag</title>
</head>
<body>
<ul>
<li>ol - ordered list</li>
<li>ul - unordered list</li>
<li>dir - directory list</li>
... | [
{
"code": null,
"e": 2477,
"s": 2374,
"text": "The HTML <li> tag is used for specifying a list item in ordered, unordered, directory, and menu lists."
},
{
"code": null,
"e": 2757,
"s": 2477,
"text": "<!DOCTYPE html>\n<html>\n\n <head>\n <title>HTML li Tag</title>\n </he... |
Python Inheritance | Inheritance allows us to define a class that inherits all the methods and properties from another class.
Parent class is the class being inherited from, also called
base class.
Child class is the class that inherits from another class,
also called derived class.
Any class can be a parent class, so the syntax is the s... | [
{
"code": null,
"e": 105,
"s": 0,
"text": "Inheritance allows us to define a class that inherits all the methods and properties from another class."
},
{
"code": null,
"e": 178,
"s": 105,
"text": "Parent class is the class being inherited from, also called \nbase class."
},
{... |
Unable to locate an element using xpath error in selenium-java | We may encounter the error - unable to locate element while working with Selenium webdriver. This leads to NoSuchElementException. This type of exception is thrown when there is no element on the page which matches with the locator value.
If error is encountered, we can fix it by the following ways −
Check if there is ... | [
{
"code": null,
"e": 1301,
"s": 1062,
"text": "We may encounter the error - unable to locate element while working with Selenium webdriver. This leads to NoSuchElementException. This type of exception is thrown when there is no element on the page which matches with the locator value."
},
{
... |
Creating 3D animation using matplotlib | To create a 3D animation using matplotlib, we can take the following steps −
Import the required packages. For 3D animation, you need to import Axes3D from mpl_toolkits.mplot3d and matplotlib.animation.
Set the figure size and adjust the padding between and around the subplots.
Create t, x, y and data points using nump... | [
{
"code": null,
"e": 1139,
"s": 1062,
"text": "To create a 3D animation using matplotlib, we can take the following steps −"
},
{
"code": null,
"e": 1265,
"s": 1139,
"text": "Import the required packages. For 3D animation, you need to import Axes3D from mpl_toolkits.mplot3d and m... |
C# | Check if a thread belongs to managed thread pool or not - GeeksforGeeks | 01 Feb, 2019
A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as IsThreadPoolThread to check if the thread belongs to the managed thread pool or not.
Syntax:
public bool IsThreadPoolThread { get; }
Return Value: This property returns true if the ... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24513,
"s": 24302,
"text": "A Thread class is responsible for creating and managing a thread in multi-thread programming. It provides a property known as IsThreadPoolThread to check if the th... |
How to Create a Tolerance Chart in Excel? | 01 May, 2021
A tolerance chart shows how a particular data item compares to the maximum and minimum permissible values. In this article, we’ll analyze the average results of the students of a class using a tolerance chart.
Tolerance Chart
Follow the below steps to create a Tolerance chart in Excel:
Step 1: The first st... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 May, 2021"
},
{
"code": null,
"e": 238,
"s": 28,
"text": "A tolerance chart shows how a particular data item compares to the maximum and minimum permissible values. In this article, we’ll analyze the average results of the students o... |
How to Execute WordCount Program in MapReduce using Cloudera Distribution Hadoop(CDH) | 24 Jun, 2021
Counting the number of words in any language is a piece of cake like in C, C++, Python, Java, etc. MapReduce also uses Java but it is very easy if you know the syntax on how to write it. It is the basic of MapReduce. You will first learn how to execute this code similar to “Hello World” program in other la... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Jun, 2021"
},
{
"code": null,
"e": 463,
"s": 52,
"text": "Counting the number of words in any language is a piece of cake like in C, C++, Python, Java, etc. MapReduce also uses Java but it is very easy if you know the syntax on how ... |
How to start a new activity by clicking a button on Android using Kotlin? | This example demonstrates how to start new activity on click button on Android using Kotlin
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-... | [
{
"code": null,
"e": 1279,
"s": 1187,
"text": "This example demonstrates how to start new activity on click button on Android using Kotlin"
},
{
"code": null,
"e": 1408,
"s": 1279,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all req... |
How to copy a table from one MySQL database to another? | The following is the syntax to copy a table from one database to another.
INSERT INTO yourDestinationDatabaseName.yourTableName SELECT * from yourSourceDatabaseName.yourtableName;
Let us see an example.
The CREATE command is used to create a table in the database ‘business’. We are creating a new table here.
mysql> us... | [
{
"code": null,
"e": 1261,
"s": 1187,
"text": "The following is the syntax to copy a table from one database to another."
},
{
"code": null,
"e": 1368,
"s": 1261,
"text": "INSERT INTO yourDestinationDatabaseName.yourTableName SELECT * from yourSourceDatabaseName.yourtableName;\n"... |
Print the middle character of a string | 10 Nov, 2021
Given string str, the task is to print the middle character of a string. If the length of the string is even, then there would be two middle characters, we need to print the second middle character.
Examples:
Input: str = “Java”Output: vExplanation: The length of the given string is even. Therefore, there ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 252,
"s": 53,
"text": "Given string str, the task is to print the middle character of a string. If the length of the string is even, then there would be two middle characters, we need to print the ... |
How to Alter a SQLite Table using Python ? | 03 Jun, 2021
In this article, we will discuss how can we alter tables in the SQLite database from a Python program using the sqlite3 module.
We can do this by using ALTER statement. It allows to:
Add one or more column to the table
The syntax of ALTER TABLE to add a new column in an existing table in SQLite is given b... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 157,
"s": 28,
"text": "In this article, we will discuss how can we alter tables in the SQLite database from a Python program using the sqlite3 module. "
},
{
"code": null,
"e": 212,
... |
Lodash _.memoize() Method | 16 Sep, 2020
The _.memoize() method is used to memorize a given function by caching the result computed by the function. If resolver is issued, the cache key for store the result is determined based on the arguments given to the memoized method. By default, the first argument provided to the memoized function is used a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Sep, 2020"
},
{
"code": null,
"e": 356,
"s": 28,
"text": "The _.memoize() method is used to memorize a given function by caching the result computed by the function. If resolver is issued, the cache key for store the result is determ... |
GATE | GATE CS 2010 | Question 65 | 28 Jun, 2021
If 137 + 276 = 435 how much is 731 + 672?(A) 534(B) 1403(C) 1623(D) 1513Answer: (C)Explanation: If we try adding the numbers directly (i.e. considering decimal)
1
137
+276
---
3
Since 7+6=13 and the given answer 435 has 5 in the one’s place therefore the numbers are in base 8; Because 13 ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 215,
"s": 54,
"text": "If 137 + 276 = 435 how much is 731 + 672?(A) 534(B) 1403(C) 1623(D) 1513Answer: (C)Explanation: If we try adding the numbers directly (i.e. considering decimal)"
},
{
... |
Reverse a Linked List in groups of given size | Set 2 | 24 Jun, 2022
Given a linked list, write a function to reverse every k node (where k is an input to the function). Examples:
Inputs: 1->2->3->4->5->6->7->8->NULL and k = 3
Output: 3->2->1->6->5->4->8->7->NULL.
Inputs: 1->2->3->4->5->6->7->8->NULL and k = 5
Output: 5->4->3->2->1->8->7->6->NULL.
We have alread... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 167,
"s": 54,
"text": "Given a linked list, write a function to reverse every k node (where k is an input to the function). Examples: "
},
{
"code": null,
"e": 345,
"s": 167,
"... |
How to create a session only cookies with JavaScript? | To create a session only cookie, you need to set the expiration date of the cookie to be some years ahead. You need to set the expire attribute −
current time + 5 years
The expire attribute shows the date the cookie will expire. If this is blank, the cookie will expire when the visitor quits the browser.
Note − Do not ... | [
{
"code": null,
"e": 1333,
"s": 1187,
"text": "To create a session only cookie, you need to set the expiration date of the cookie to be some years ahead. You need to set the expire attribute −"
},
{
"code": null,
"e": 1356,
"s": 1333,
"text": "current time + 5 years"
},
{
... |
Variadic functions in C | 04 Jun, 2022
Variadic functions are functions that can take a variable number of arguments. In C programming, a variadic function adds flexibility to the program. It takes one fixed argument and then any number of arguments can be passed. The variadic function consists of at least one fixed variable and then an ellipsi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Jun, 2022"
},
{
"code": null,
"e": 389,
"s": 52,
"text": "Variadic functions are functions that can take a variable number of arguments. In C programming, a variadic function adds flexibility to the program. It takes one fixed argum... |
Merge odd and even positioned nodes of two Linked Lists alternately | 19 Jan, 2022
Given two linked lists L1 and L2, the task is to print a new list obtained by merging odd position nodes of L1 with the even positioned nodes of L2 alternately.
Examples:
Input: L1 = 8->5->3->2->10->NULL, L2 = 11->13->1->6->9->NULLOutput: 8->13->3->6->10->NULL Explanation:The odd positioned nodes of L1 ar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Jan, 2022"
},
{
"code": null,
"e": 189,
"s": 28,
"text": "Given two linked lists L1 and L2, the task is to print a new list obtained by merging odd position nodes of L1 with the even positioned nodes of L2 alternately."
},
{
... |
How to create custom banner background using CSS ? | 11 Jun, 2020
In modern web designs, the custom background has emerged as a popular design for the banner background. A custom background has an infinite number of designs. The design is purely based on one’s imagination and creativity. Some common examples of custom backgrounds include wavy background, skewed backgroun... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Jun, 2020"
},
{
"code": null,
"e": 343,
"s": 28,
"text": "In modern web designs, the custom background has emerged as a popular design for the banner background. A custom background has an infinite number of designs. The design is pu... |
Sorting objects of user defined class in Python | 29 Dec, 2020
The following article discusses how objects of a user-defined class can be arranged based on any of the variables of the class, which obviously will hold some value for every object. So far, we are aware of how we can sort elements of a list, the concept here is more or less the same as, except it is a ste... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 468,
"s": 28,
"text": "The following article discusses how objects of a user-defined class can be arranged based on any of the variables of the class, which obviously will hold some value for every ... |
SQL | Difference between functions and stored procedures in PL/SQL | 06 Jun, 2022
Prerequisite:
Procedures in PL/SQL
Functions in PL/SQL.
Differences between Stored procedures(SP) and Functions(User-defined functions (UDF)):
1. SP may or may not return a value but UDF must return a value. The return statement of the function returns control to the calling program and returns the resul... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jun, 2022"
},
{
"code": null,
"e": 67,
"s": 52,
"text": "Prerequisite: "
},
{
"code": null,
"e": 88,
"s": 67,
"text": "Procedures in PL/SQL"
},
{
"code": null,
"e": 109,
"s": 88,
"text": "Func... |
Python | Pandas dataframe.cumsum() | 16 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.cumsum() is used to find the cumulative sum value over any axis. Each cell i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 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 do you use regular expressions in Cucumber? | We can use regular expressions in Cucumber for selecting a collection of
similar statements in the feature file.
feature file
Feature: Exam Syllabus
Scenario Outline: Summer and Winter Exam Schedule
Given Exam time table in summer season
Given Mathematics and Physics Syllabus
Given Exam time table in winter season
The ... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "We can use regular expressions in Cucumber for selecting a collection of\nsimilar statements in the feature file."
},
{
"code": null,
"e": 1188,
"s": 1175,
"text": "feature file"
},
{
"code": null,
"e": 1378,
"s": 118... |
Buy chocolates and save N rupees | Practice | GeeksforGeeks | Geek wants to buy chocolates. The shop only has two types of chocolates. One costs 3 rupees and the other costs 7 rupees. Geek has 100 rupees. Is it possible for him to save exactly N rupees after visiting the shop ?
Example 1:
Input: N = 99
Output: 0
Explaination: Geek needs to save 99 rupees.
That means he can only... | [
{
"code": null,
"e": 443,
"s": 226,
"text": "Geek wants to buy chocolates. The shop only has two types of chocolates. One costs 3 rupees and the other costs 7 rupees. Geek has 100 rupees. Is it possible for him to save exactly N rupees after visiting the shop ?"
},
{
"code": null,
"e": 4... |
Advanced Excel Logical - IFS Function | The IFS function checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition. This Function was added in Excel 2016.
IFS (logical_test1, value_if_true1, [logical_test2, value_if_true2], [logical_test3, value_if_true3]...)
As functions are limited to 254 parameters, y... | [
{
"code": null,
"e": 2022,
"s": 1854,
"text": "The IFS function checks whether one or more conditions are met and returns a value that corresponds to the first TRUE condition. This Function was added in Excel 2016."
},
{
"code": null,
"e": 2129,
"s": 2022,
"text": "IFS (logical_t... |
Prevent scientific notation in matplotlib.pyplot | To prevent scientific notation, we must pass style='plain' in the ticklabel_format method.
Pass two lists to draw a line using plot() method.
Pass two lists to draw a line using plot() method.
Using ticklabel_format() method with style='plain'. If a parameter is not set, the corresponding property of the formatter is l... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "To prevent scientific notation, we must pass style='plain' in the ticklabel_format method."
},
{
"code": null,
"e": 1204,
"s": 1153,
"text": "Pass two lists to draw a line using plot() method."
},
{
"code": null,
"e": 125... |
Summarizing data with Pandas crosstab | by B. Chen | Towards Data Science | The most immediate effect of summarizing data is to take data that may be overwhelming to work with, and reduce it to a few key summary values that can be viewed, often in a table or plot.
Source from Introduction to Data Science [1]
Data summarization is a process to present the summary of generated data in an easily ... | [
{
"code": null,
"e": 361,
"s": 172,
"text": "The most immediate effect of summarizing data is to take data that may be overwhelming to work with, and reduce it to a few key summary values that can be viewed, often in a table or plot."
},
{
"code": null,
"e": 406,
"s": 361,
"text"... |
How to Take a Screenshot in Selenium WebDriver Using Java? - GeeksforGeeks | 23 Jan, 2022
Selenium WebDriver is a collection of open-source APIs which are used to automate the testing of a web application. In order to capture a screenshot in Selenium, one has to utilize the method Takes Screenshot. This notifies WebDriver that it should take a screenshot in Selenium and store it. Selenium WebDr... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n23 Jan, 2022"
},
{
"code": null,
"e": 24028,
"s": 23557,
"text": "Selenium WebDriver is a collection of open-source APIs which are used to automate the testing of a web application. In order to capture a screenshot in Selenium, o... |
Function Timeouts using Wrapt Timeout Decorator | Towards Data Science | In this short guide, I will show how to use a handy timeout decorator for Python function to limit the execution times. This guide is based on an example that utilizes Python’s multiprocessing package.
Lately, I’ve been building a script using Beautiful Soup that scrapes similarly structured websites and identifies its... | [
{
"code": null,
"e": 374,
"s": 172,
"text": "In this short guide, I will show how to use a handy timeout decorator for Python function to limit the execution times. This guide is based on an example that utilizes Python’s multiprocessing package."
},
{
"code": null,
"e": 1091,
"s": 3... |
Print all permutations with repetition of characters - GeeksforGeeks | 12 May, 2022
Given a string of length n, print all permutations of the given string. Repetition of characters is allowed. Print these permutations in lexicographically sorted order
Examples:
Input: AB
Output: All permutations of AB with repetition are:
AA
AB
BA
BB
Input: ABC
Output: All permu... | [
{
"code": null,
"e": 26721,
"s": 26693,
"text": "\n12 May, 2022"
},
{
"code": null,
"e": 26890,
"s": 26721,
"text": "Given a string of length n, print all permutations of the given string. Repetition of characters is allowed. Print these permutations in lexicographically sorted o... |
Create a Cycle Graph using Networkx in Python - GeeksforGeeks | 03 Jan, 2021
A cycle graph is a graph which contains a single cycle in which all nodes are structurally equivalent therefore starting and ending nodes cannot be identified.
Number of nodes in a Cycle Graph(Cn) are equal to N.
Number of edges in a Cycle Graph(Cn) are equal to N.
Every node is connected to 2 edges hence ... | [
{
"code": null,
"e": 26311,
"s": 26283,
"text": "\n03 Jan, 2021"
},
{
"code": null,
"e": 26471,
"s": 26311,
"text": "A cycle graph is a graph which contains a single cycle in which all nodes are structurally equivalent therefore starting and ending nodes cannot be identified."
... |
Encrypt and Decrypt Files using Python - GeeksforGeeks | 13 Jan, 2021
Encryption is the act of decoding the message so that intended users can only see it. We encrypt data because we don’t want anyone to see or access it.
We will use the cryptography library to encrypt a file. The cryptography library uses a symmetric algorithm to encrypt the file. In the symmetric algorithm... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n13 Jan, 2021"
},
{
"code": null,
"e": 25713,
"s": 25561,
"text": "Encryption is the act of decoding the message so that intended users can only see it. We encrypt data because we don’t want anyone to see or access it."
},
{
... |
Print elements of an array according to the order defined by another array | set 2 - GeeksforGeeks | 28 Jun, 2021
Given two arrays a1[] and a2[], print elements of a1 in such a way that the relative order among the elements will be the same as those are in a2. That is, elements which come before in the array a2[], print those elements first from the array a1[]. For the elements not present in a2, print them at last in... | [
{
"code": null,
"e": 26067,
"s": 26039,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 26548,
"s": 26067,
"text": "Given two arrays a1[] and a2[], print elements of a1 in such a way that the relative order among the elements will be the same as those are in a2. That is, element... |
Check if two given strings are isomorphic to each other - GeeksforGeeks | 02 May, 2022
Two strings str1 and str2 are called isomorphic if there is a one-to-one mapping possible for every character of str1 to every character of str2. And all occurrences of every character in ‘str1’ map to the same character in ‘str2’.
Examples:
Input: str1 = "aab", str2 = "xxy"
Output: True
'a' is mapped to... | [
{
"code": null,
"e": 25985,
"s": 25957,
"text": "\n02 May, 2022"
},
{
"code": null,
"e": 26217,
"s": 25985,
"text": "Two strings str1 and str2 are called isomorphic if there is a one-to-one mapping possible for every character of str1 to every character of str2. And all occurrenc... |
Different ways of Method Overloading in Java - GeeksforGeeks | 08 Mar, 2022
Method overloading in java is based on the number and type of the parameters passed as an argument to the methods. We can not define more than one method with the same name, Order, and type of the arguments. It would be a compiler error. The compiler does not consider the return type while differentiating ... | [
{
"code": null,
"e": 30196,
"s": 30168,
"text": "\n08 Mar, 2022"
},
{
"code": null,
"e": 30749,
"s": 30196,
"text": "Method overloading in java is based on the number and type of the parameters passed as an argument to the methods. We can not define more than one method with the ... |
Introduction to pygame - GeeksforGeeks | 08 Oct, 2020
Game programming is very rewarding nowadays and it can also be used in advertising and as a teaching tool too. Game development includes mathematics, logic, physics, AI, and much more and it can be amazingly fun. In python, game programming is done in pygame and it is one of the best modules for doing so. ... | [
{
"code": null,
"e": 25687,
"s": 25659,
"text": "\n08 Oct, 2020"
},
{
"code": null,
"e": 25995,
"s": 25687,
"text": "Game programming is very rewarding nowadays and it can also be used in advertising and as a teaching tool too. Game development includes mathematics, logic, physic... |
Solidity - Abstract Contract - GeeksforGeeks | 11 May, 2022
Abstract contracts are contracts that have at least one function without its implementation. An instance of an abstract cannot be created. Abstract contracts are used as base contracts so that the child contract can inherit and utilize its functions. The abstract contract defines the structure of the contr... | [
{
"code": null,
"e": 25681,
"s": 25653,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 26382,
"s": 25681,
"text": "Abstract contracts are contracts that have at least one function without its implementation. An instance of an abstract cannot be created. Abstract contracts are u... |
C++ Library - <exception> | It is a standard exception class. All objects thrown by components of the standard library are derived from this class. Therefore, all standard exceptions can be caught by catching this type by reference.
Following is the declaration for std::exception.
class exception;
In below example for std::exception.
#include <th... | [
{
"code": null,
"e": 2808,
"s": 2603,
"text": "It is a standard exception class. All objects thrown by components of the standard library are derived from this class. Therefore, all standard exceptions can be caught by catching this type by reference."
},
{
"code": null,
"e": 2857,
"... |
Basic System Controls with Terminal in Linux - GeeksforGeeks | 16 Jul, 2020
Sometimes some of the basic services of the system stop working or starts malfunctioning. And it becomes really difficult to solve the problem through Graphical User Interface so here is the list of Terminal Command to solve the problem and to control the basic services manually.
Installing the required pa... | [
{
"code": null,
"e": 24247,
"s": 24219,
"text": "\n16 Jul, 2020"
},
{
"code": null,
"e": 24528,
"s": 24247,
"text": "Sometimes some of the basic services of the system stop working or starts malfunctioning. And it becomes really difficult to solve the problem through Graphical Us... |
Java program to print the factorial of the given number | Factorial of a positive integer n is the product of all values from n to 1. For example, the factorial of 3 is (3 * 2 * 1 = 6).
1. Take integer variable A
2. Assign a value to the variable
3. From value, A up to 1 multiply each digit and store
4. The final stored value is factorial of A
import java.util.Scanner;
pu... | [
{
"code": null,
"e": 1191,
"s": 1062,
"text": "Factorial of a positive integer n is the product of all values from n to 1. For example, the factorial of 3 is (3 * 2 * 1 = 6). "
},
{
"code": null,
"e": 1351,
"s": 1191,
"text": "1. Take integer variable A\n2. Assign a value to the ... |
Matplotlib.axes.Axes.xcorr() in Python - GeeksforGeeks | 21 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axe... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 24201,
"s": 23901,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ... |
How do I programmatically “restart” an Android app? | There are some situations, we need to restart whole application programmatically. This example demonstrates how do I programmatically “restart” an Android app.
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... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "There are some situations, we need to restart whole application programmatically. This example demonstrates how do I programmatically “restart” an Android app."
},
{
"code": null,
"e": 1351,
"s": 1222,
"text": "Step 1 − Create a new ... |
How to change the permission of a directory using Python? | On a platform with the chmod command available, you could call the chmod command like this:
>>> import subprocess
>>> subprocess.call(['chmod', '-R', '+w', 'my_folder'])
If you want to use the os module, you'll have to recursively write it:
Using os:
import os
def change_permissions_recursive(path, mode):
for root,... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "On a platform with the chmod command available, you could call the chmod command like this:"
},
{
"code": null,
"e": 1232,
"s": 1154,
"text": ">>> import subprocess\n>>> subprocess.call(['chmod', '-R', '+w', 'my_folder'])"
},
{
... |
How to Implement Priority Queue in Python? | The queue module provides a first-in, first-out (FIFO), Last-in, First out (LIFO) data structure suitable for multi-threaded programming. Queues can be used to pass data or any wide range of information e.g. session details, paths, variables,.. between creator and consumer threads safely. Locking is generally handled f... | [
{
"code": null,
"e": 1397,
"s": 1062,
"text": "The queue module provides a first-in, first-out (FIFO), Last-in, First out (LIFO) data structure suitable for multi-threaded programming. Queues can be used to pass data or any wide range of information e.g. session details, paths, variables,.. between ... |
Loss Function (Part II): Logistic Regression | by Shuyu Luo | Towards Data Science | This series aims to explain loss functions of a few widely-used supervised learning models, and some options of optimization algorithms. In part I, I walked through the optimization process of Linear Regression in details by using Gradient Descent and using Least Squared Error as loss function. In this part, I will mov... | [
{
"code": null,
"e": 518,
"s": 172,
"text": "This series aims to explain loss functions of a few widely-used supervised learning models, and some options of optimization algorithms. In part I, I walked through the optimization process of Linear Regression in details by using Gradient Descent and usi... |
Fetch all the ids of MongoDB documents? | To fetch all the ids, simply use find() in MongoDB. Let us create a collection with documents −
> db.demo169.insertOne({"StudentName":"Chris"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5e36975e9e4f06af551997d7")
}
> db.demo169.insertOne({"StudentName":"Bob"});
{
"acknowledged" : true,
"insertedId"... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "To fetch all the ids, simply use find() in MongoDB. Let us create a collection with documents −"
},
{
"code": null,
"e": 1558,
"s": 1158,
"text": "> db.demo169.insertOne({\"StudentName\":\"Chris\"});\n{\n \"acknowledged\" : true,\n... |
SQL | Advanced Functions - GeeksforGeeks | 07 Nov, 2019
Following are some of the advanced functions defined in SQL:
BIN(): It converts a decimal number to a binary number.Syntax:SELECT BIN(18);
Output:BINARY(): It converts a value to a binary stringSyntax:SELECT BINARY "GeeksforGeeks";Output:COALESCE(): It returns the first non-null expression in a list.Syntax... | [
{
"code": null,
"e": 23899,
"s": 23871,
"text": "\n07 Nov, 2019"
},
{
"code": null,
"e": 23960,
"s": 23899,
"text": "Following are some of the advanced functions defined in SQL:"
},
{
"code": null,
"e": 25623,
"s": 23960,
"text": "BIN(): It converts a decimal ... |
Find Quotient and Remainder of two integer without using division operators - GeeksforGeeks | 07 Apr, 2021
Given two positive integers dividend and divisor, our task is to find quotient and remainder. The use of division or mod operator is not allowed.
Examples:
Input : dividend = 10, divisor = 3 Output : 3, 1 Explanation: The quotient when 10 is divided by 3 is 3 and the remainder is 1.
Input : dividend = 11, ... | [
{
"code": null,
"e": 24397,
"s": 24369,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 24543,
"s": 24397,
"text": "Given two positive integers dividend and divisor, our task is to find quotient and remainder. The use of division or mod operator is not allowed."
},
{
"co... |
Check if any anagram of a string is palindrome or not in Python | Suppose we have a string s. We have to check whether an anagram of that string is forming a palindrome or not.
So, if the input is like s = "aarcrec", then the output will be True one anagram of this string is "racecar" which is palindrome.
To solve this, we will follow these steps −
freq := a map to store all characte... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "Suppose we have a string s. We have to check whether an anagram of that string is forming a palindrome or not."
},
{
"code": null,
"e": 1303,
"s": 1173,
"text": "So, if the input is like s = \"aarcrec\", then the output will be True ... |
Connect to MySQL using PyMySQL in Python - GeeksforGeeks | 05 Sep, 2020
In this article, we will discuss how to connect to the MySQL database remotely or locally using Python. In below process, we will use PyMySQL module of Python to connect our database.
This package contains a pure-Python MySQL client library, based on PEP 249.
Requirements :
MySQL Server – one of the follow... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 24476,
"s": 24292,
"text": "In this article, we will discuss how to connect to the MySQL database remotely or locally using Python. In below process, we will use PyMySQL module of Python to c... |
Machine Learning Kaggle Competition Part One: Getting Started | by Will Koehrsen | Towards Data Science | In the field of data science, there are almost too many resources available: from Datacamp to Udacity to KDnuggets, there are thousands of places online to learn about data science. However, if you are someone who likes to jump in and learn by doing, Kaggle might be the single best location for expanding your skills th... | [
{
"code": null,
"e": 405,
"s": 47,
"text": "In the field of data science, there are almost too many resources available: from Datacamp to Udacity to KDnuggets, there are thousands of places online to learn about data science. However, if you are someone who likes to jump in and learn by doing, Kaggl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.