title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
C++ Inline Functions | C++ inline function is powerful concept that is commonly used with classes. If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time.
Any change to an inline function could require all clients of the function to be recompiled because com... | [
{
"code": null,
"e": 2535,
"s": 2318,
"text": "C++ inline function is powerful concept that is commonly used with classes. If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time."
},
{
"code": null,
"e":... |
Change the background color of a button with CSS | To change the background color of a button, use the background-color property.
You can try to run the following code to change button’s background color
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
.btn {
background-color: yellow;
color: black;
text-align: center... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "To change the background color of a button, use the background-color property."
},
{
"code": null,
"e": 1215,
"s": 1141,
"text": "You can try to run the following code to change button’s background color"
},
{
"code": null,
... |
Program to reverse an array up to a given position in Python | In this tutorial, we will learn how to reverse an array upto a given position. Let's see the problem statement.
We have an array of integers and a number n. Our goal is to reverse the elements of the array from the 0th index to (n-1)th index. For example,
Input
array = [1, 2, 3, 4, 5, 6, 7, 8, 9] n = 5
Output
[5, 4, 3,... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "In this tutorial, we will learn how to reverse an array upto a given position. Let's see the problem statement."
},
{
"code": null,
"e": 1318,
"s": 1174,
"text": "We have an array of integers and a number n. Our goal is to reverse th... |
Shortest Path Distance Approximation Using Deep Learning: Node2Vec | by Asutosh Nayak | Towards Data Science | This article is an implementation of a research paper titled “Shortest Path Distance Approximation using Deep Learning Techniques”, where the authors explain a new method to approximate the shortest path distance between the nodes of a graph. I will explain the paper and my implementation of it. You can find the projec... | [
{
"code": null,
"e": 706,
"s": 172,
"text": "This article is an implementation of a research paper titled “Shortest Path Distance Approximation using Deep Learning Techniques”, where the authors explain a new method to approximate the shortest path distance between the nodes of a graph. I will expla... |
How to create a random sample of values between 0 and 1 in R? | The continuous uniform distribution can take values between 0 and 1 in R if the range is not defined. To create a random sample of continuous uniform distribution we can use runif function, if we will not pass the minimum and maximum values the default will be 0 and 1 and we can also use different range of values.
runi... | [
{
"code": null,
"e": 1378,
"s": 1062,
"text": "The continuous uniform distribution can take values between 0 and 1 in R if the range is not defined. To create a random sample of continuous uniform distribution we can use runif function, if we will not pass the minimum and maximum values the default ... |
Back Propagation, the Easy Way (Part 2) | by Ziad SALLOUM | Towards Data Science | Update: The best way of learning and practicing Reinforcement Learning is by going to http://rl-lab.com
In the first part we have seen how back propagation is derived in a way to minimize the cost function. In this article we will see the implementation aspect, and some best practices to avoid common pitfalls.
We are s... | [
{
"code": null,
"e": 276,
"s": 172,
"text": "Update: The best way of learning and practicing Reinforcement Learning is by going to http://rl-lab.com"
},
{
"code": null,
"e": 484,
"s": 276,
"text": "In the first part we have seen how back propagation is derived in a way to minimiz... |
Java Examples - Copy a File | How to copy one file into another file ?
This example shows how to copy contents of one file into another file using read & write methods of BufferedWriter class.
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
BufferedWriter out1 = new BufferedWriter(new FileWr... | [
{
"code": null,
"e": 2109,
"s": 2068,
"text": "How to copy one file into another file ?"
},
{
"code": null,
"e": 2231,
"s": 2109,
"text": "This example shows how to copy contents of one file into another file using read & write methods of BufferedWriter class."
},
{
"code... |
Apache Derby - Alter Table Statement | The ALTER TABLE statement, allows you to alter an existing table. Using this you can do the following −
Add a column, add a constraint
Add a column, add a constraint
Drop a column, drop a constraint
Drop a column, drop a constraint
Change the row level locking of a table
Change the row level locking of a table
Let us a... | [
{
"code": null,
"e": 2284,
"s": 2180,
"text": "The ALTER TABLE statement, allows you to alter an existing table. Using this you can do the following −"
},
{
"code": null,
"e": 2315,
"s": 2284,
"text": "Add a column, add a constraint"
},
{
"code": null,
"e": 2346,
... |
How we can iterate through a Python list of tuples? | Easiest way is to employ two nested for loops. Outer loop fetches each tuple and inner loop traverses each item from the tuple. Inner print() function end=’ ‘ to print all items in a tuple in one line. Another print() introduces new line after each tuple.
L=[(1,2,3), (4,5,6), (7,8,9,10)]
for x in L:
for y in x:
p... | [
{
"code": null,
"e": 1318,
"s": 1062,
"text": "Easiest way is to employ two nested for loops. Outer loop fetches each tuple and inner loop traverses each item from the tuple. Inner print() function end=’ ‘ to print all items in a tuple in one line. Another print() introduces new line after each tupl... |
Combinatorial Game Theory | Set 4 (Sprague - Grundy Theorem) - GeeksforGeeks | 04 Sep, 2021
Prerequisites : Grundy Numbers/Numbers and MexWe have already seen in Set 2 (https://www.geeksforgeeks.org/combinatorial-game-theory-set-2-game-nim/), that we can find who wins in a game of Nim without actually playing the game.Suppose we change the classic Nim game a bit. This time each player can only re... | [
{
"code": null,
"e": 24881,
"s": 24853,
"text": "\n04 Sep, 2021"
},
{
"code": null,
"e": 25366,
"s": 24881,
"text": "Prerequisites : Grundy Numbers/Numbers and MexWe have already seen in Set 2 (https://www.geeksforgeeks.org/combinatorial-game-theory-set-2-game-nim/), that we can ... |
Arithmetic Encoding and Decoding Using MATLAB - GeeksforGeeks | 17 Aug, 2020
Arithmetic coding is a type of entropy encoding utilized in lossless data compression. Ordinarily, a string of characters, for example, the words “hey” is represented for utilizing a fixed number of bits per character.
In the most straightforward case, the probability of every symbol occurring is equivalen... | [
{
"code": null,
"e": 24211,
"s": 24183,
"text": "\n17 Aug, 2020"
},
{
"code": null,
"e": 24430,
"s": 24211,
"text": "Arithmetic coding is a type of entropy encoding utilized in lossless data compression. Ordinarily, a string of characters, for example, the words “hey” is represen... |
Count Fibonacci numbers in given range in O(Log n) time and O(1) space - GeeksforGeeks | 28 Jun, 2021
Given a range, count Fibonacci numbers in given range. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 141, .. Example :
Input: low = 10, high = 100
Output: 5
There are five Fibonacci numbers in given
range, the numbers are 13, 21, 34, 55 and 89.
Input: low = 10, high = 20
Output... | [
{
"code": null,
"e": 24754,
"s": 24726,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24901,
"s": 24754,
"text": "Given a range, count Fibonacci numbers in given range. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 141, .. Example : "
},
{
"c... |
Top 10 new features of HTML5 | 15 Mar, 2021
HTML stands for Hypertext Markup Language, and it is the standard markup language for creating web pages and web applications. HTML5 is the 5th version of HTML. With invent of features in HTML5, it’s not only possible to create better websites, but we can also create dynamic websites.
Now let’s have a look... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Mar, 2021"
},
{
"code": null,
"e": 338,
"s": 52,
"text": "HTML stands for Hypertext Markup Language, and it is the standard markup language for creating web pages and web applications. HTML5 is the 5th version of HTML. With invent o... |
vector emplace() function in C++ STL | 06 Oct, 2021
The vector::emplace() is an STL in C++ which extends the container by inserting a new element at the position. Reallocation happens only if there is a need for more space. Here the container size increases by one.Syntax:
template
iterator vector_name.emplace (const_iterator position, element);
Parameter... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n06 Oct, 2021"
},
{
"code": null,
"e": 276,
"s": 53,
"text": "The vector::emplace() is an STL in C++ which extends the container by inserting a new element at the position. Reallocation happens only if there is a need for more space. He... |
SQL Query to Display Last 50% Records from Employee Table | 13 Apr, 2021
Here, we are going to see how to display the last 50% of records from an Employee Table in MySQL and MS SQL server’s databases.
For the purpose of demonstration, we will be creating an Employee table in a database called “geeks“.
Use the below SQL statement to create a database called geeks:
CREATE DATABAS... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Apr, 2021"
},
{
"code": null,
"e": 156,
"s": 28,
"text": "Here, we are going to see how to display the last 50% of records from an Employee Table in MySQL and MS SQL server’s databases."
},
{
"code": null,
"e": 258,
"... |
CSS | matrix3d() Function | 21 Aug, 2019
The matrix3d() function is an inbuilt function which is used to apply a transformation to create a 3D transformation as a 4×4 homogeneous matrix.
Syntax:
matrix3d( a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4 )
Parameters: This function accepts 16 parameters as mentioned above and describ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Aug, 2019"
},
{
"code": null,
"e": 174,
"s": 28,
"text": "The matrix3d() function is an inbuilt function which is used to apply a transformation to create a 3D transformation as a 4×4 homogeneous matrix."
},
{
"code": null,
... |
C/C++ if statement with Examples | 22 Nov, 2019
Decision Making in C/C++ helps to write decision driven statements and execute a particular set of code based on certain conditions.
The C/C++ if statement is the most simple decision making statement. It is used to decide whether a certain statement or block of statements will be executed or not based on ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n22 Nov, 2019"
},
{
"code": null,
"e": 186,
"s": 53,
"text": "Decision Making in C/C++ helps to write decision driven statements and execute a particular set of code based on certain conditions."
},
{
"code": null,
"e": 389,... |
How to Implement Circular ProgressBar in Android? | 06 Apr, 2021
ProgressBar is used when we are fetching some data from another source and it takes time, so for user’s satisfaction, we generally display them the progress of the task. In this article, we are going to learn how to implement the circular progress bar in an android application using Java. So, this article ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Apr, 2021"
},
{
"code": null,
"e": 570,
"s": 54,
"text": "ProgressBar is used when we are fetching some data from another source and it takes time, so for user’s satisfaction, we generally display them the progress of the task. In t... |
JavaScript Date getTime() Method | 22 Nov, 2021
In this article, we will learn the getTime() method in Javascript, along with understanding their implementation through the examples.
The date.getTime() method is used to return the number of milliseconds since 1 January 1970. when a new Date object is created it stores the date and time data when it is c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 163,
"s": 28,
"text": "In this article, we will learn the getTime() method in Javascript, along with understanding their implementation through the examples."
},
{
"code": null,
"e": 527... |
How to output in Octave GNU | 21 Jun, 2021
Octave is open-source, free available for many of the platforms. It is a high-level language. It comes up with a text interface along with an experimental graphical interface. It is also used for various Machine Learning algorithms for solving various numeric problems. You can say that it is similar to MAT... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 432,
"s": 28,
"text": "Octave is open-source, free available for many of the platforms. It is a high-level language. It comes up with a text interface along with an experimental graphical interface.... |
How to set the visibility of the CheckBox in C#? | 30 Sep, 2021
The CheckBox control is the part of the windows form that is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple elements from the given list. In CheckBox, you are allowed to set a value that represents the CheckBox and its CheckBox controls are disp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 389,
"s": 28,
"text": "The CheckBox control is the part of the windows form that is used to take input from the user. Or in other words, CheckBox control allows us to select single or multiple eleme... |
Program for replacing one digit with other | 26 May, 2022
Given a number x and two digits d1 and d2, replace d1 with d2 in x.Examples:
Input : x = 645, d1 = 6, d2 = 5
Output : 545
We replace digit 6 with 5 in number 645.
Input : x = 746, d1 = 7, d2 = 8
Output : 846
We traverse through all digits of x. For every digit, we check if it is d1, we update result acc... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 May, 2022"
},
{
"code": null,
"e": 130,
"s": 52,
"text": "Given a number x and two digits d1 and d2, replace d1 with d2 in x.Examples: "
},
{
"code": null,
"e": 263,
"s": 130,
"text": "Input : x = 645, d1 = 6, d2... |
Swing Examples - Change the default icon of the window | Following example showcase how to change the default icon of the window in Swing based application.
We are using the following APIs.
ImageIcon − To create an image icon.
ImageIcon − To create an image icon.
JFrame.setIconImage() − To set the icon to the window.
JFrame.setIconImage() − To set the icon to the window.
imp... | [
{
"code": null,
"e": 2139,
"s": 2039,
"text": "Following example showcase how to change the default icon of the window in Swing based application."
},
{
"code": null,
"e": 2172,
"s": 2139,
"text": "We are using the following APIs."
},
{
"code": null,
"e": 2209,
"s... |
LESS - Namespaces and Accessors | Namespaces are used to group the mixins under a common name. Using namespaces, you can avoid conflict in name and encapsulate a group of mixins from outside.
The following example demonstrates the use of namespaces and accessors in the LESS file −
<html>
<head>
<title>Less Namespaces and Accessors</title>
... | [
{
"code": null,
"e": 2708,
"s": 2550,
"text": "Namespaces are used to group the mixins under a common name. Using namespaces, you can avoid conflict in name and encapsulate a group of mixins from outside."
},
{
"code": null,
"e": 2798,
"s": 2708,
"text": "The following example de... |
System Design Using Microcontroller | Microprocessors and microcontrollers can be used to design some tools or systems to perform some special tasks. Using microcontrollers, we can make different types of modules or systems. Here is a list of some systems that can be designed by using microcontrollers −
Electronic Voting Machine
Electronic Voting Machine
R... | [
{
"code": null,
"e": 1329,
"s": 1062,
"text": "Microprocessors and microcontrollers can be used to design some tools or systems to perform some special tasks. Using microcontrollers, we can make different types of modules or systems. Here is a list of some systems that can be designed by using micro... |
An Overview of Data Analysis with the Tidyverse Library in R | by Rashida Nasrin Sucky | Towards Data Science | The ‘tidyverse’ package in R is a very useful tool for data analysis in R as it covers almost everything you need to analyze a dataset. It is a combination of several big libraries that makes it a huge library to learn. In his article, I will try to provide a good overview of the tidyverse library that gives enough res... | [
{
"code": null,
"e": 618,
"s": 172,
"text": "The ‘tidyverse’ package in R is a very useful tool for data analysis in R as it covers almost everything you need to analyze a dataset. It is a combination of several big libraries that makes it a huge library to learn. In his article, I will try to provi... |
Android - RSS Reader | RSS stands for Really Simple Syndication. RSS is an easy way to share your website updates and content with your users so that users might not have to visit your site daily for any kind of updates.
RSS is a document that is created by the website with .xml extension. You can easily parse this document and show it to th... | [
{
"code": null,
"e": 3805,
"s": 3607,
"text": "RSS stands for Really Simple Syndication. RSS is an easy way to share your website updates and content with your users so that users might not have to visit your site daily for any kind of updates."
},
{
"code": null,
"e": 3988,
"s": 380... |
What to Log? From Python ETL Pipelines! | by Shiva Koreddi | Towards Data Science | As part of my work, I have been converting some of my ETL jobs developed on the traditional tool-based framework into a python framework and came across a few challenges. These few challenges are orchestration, code management, logging, version control, etc. For a few of them, there was not much effort required while d... | [
{
"code": null,
"e": 648,
"s": 172,
"text": "As part of my work, I have been converting some of my ETL jobs developed on the traditional tool-based framework into a python framework and came across a few challenges. These few challenges are orchestration, code management, logging, version control, e... |
Colored Flower by circles using Turtle in Python - GeeksforGeeks | 01 Aug, 2020
Turtle is an inbuilt module in Python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle (pen). To move turtle, there are some functions i.e forward(), backward(), etc.
Following steps are used :
Import Turtle
Set screen
Make Turtle... | [
{
"code": null,
"e": 24640,
"s": 24612,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 24884,
"s": 24640,
"text": "Turtle is an inbuilt module in Python. It provides drawing using a screen (cardboard) and turtle (pen). To draw something on the screen, we need to move the turtle... |
C++ Program to implement Symbol Table - GeeksforGeeks | 11 Sep, 2018
Prerequisite: Symbol Table
A Symbol table is a data structure used by the compiler, where each identifier in program’s source code is stored along with information associated with it relating to its declaration. It stores identifier as well as it’s associated attributes like scope, type, line-number of occ... | [
{
"code": null,
"e": 24047,
"s": 24019,
"text": "\n11 Sep, 2018"
},
{
"code": null,
"e": 24074,
"s": 24047,
"text": "Prerequisite: Symbol Table"
},
{
"code": null,
"e": 24368,
"s": 24074,
"text": "A Symbol table is a data structure used by the compiler, where ... |
Print all possible words from phone digits - GeeksforGeeks | 09 Feb, 2022
Before the advent of QWERTY keyboards, texts and numbers were placed on the same key. For example, 2 has “ABC” if we wanted to write anything starting with ‘A’ we need to type key 2 once. If we wanted to type ‘B’, press key 2 twice and thrice for typing ‘C’. Below is a picture of such a keypad.
Given a ke... | [
{
"code": null,
"e": 24665,
"s": 24637,
"text": "\n09 Feb, 2022"
},
{
"code": null,
"e": 24962,
"s": 24665,
"text": "Before the advent of QWERTY keyboards, texts and numbers were placed on the same key. For example, 2 has “ABC” if we wanted to write anything starting with ‘A’ we ... |
Analysis of Algorithms (Recurrences) - GeeksforGeeks | 21 May, 2019
T(n) = T(n/4) + T(n/2) + cn2
T(1) = c
T(0) = 0
cn^2
/ \
T(n/4) T(n/2)
cn^2
/ \
c (n^2)/16 c(n^2)/4
/ \ / \
T(n/16) T(n/8) T(n/8) T(n/4)
cn^2
/ ... | [
{
"code": null,
"e": 34412,
"s": 34384,
"text": "\n21 May, 2019"
},
{
"code": null,
"e": 34460,
"s": 34412,
"text": "\nT(n) = T(n/4) + T(n/2) + cn2\nT(1) = c\nT(0) = 0"
},
{
"code": null,
"e": 34518,
"s": 34460,
"text": " cn^2\n / \\\n ... |
Count the Number of Binary Search Trees present in a Binary Tree in C++ | We are given a binary tree as input. The goal is to find the number of binary search trees (BSTs) present as subtrees inside it. A BST is a binary tree with left child less than root and right child more than the root.
For Example
The tree which will be created after inputting the values is given below −
Count the Numb... | [
{
"code": null,
"e": 1281,
"s": 1062,
"text": "We are given a binary tree as input. The goal is to find the number of binary search trees (BSTs) present as subtrees inside it. A BST is a binary tree with left child less than root and right child more than the root."
},
{
"code": null,
"e... |
Automatically Detect COVID-19 Misinformation | by Susan Li | Towards Data Science | It’s not easy for ordinary citizens to identify fake news. And fake coronavirus news is no exception.
As part of an effort to combat misinformation about coronavirus, I tried and collected training data and trained a ML model to detect fake news on coronavirus.
My training data is not perfect, but I hope it will be use... | [
{
"code": null,
"e": 274,
"s": 172,
"text": "It’s not easy for ordinary citizens to identify fake news. And fake coronavirus news is no exception."
},
{
"code": null,
"e": 434,
"s": 274,
"text": "As part of an effort to combat misinformation about coronavirus, I tried and collect... |
Converting image to Grayscale without using any methods Java OpenCV. | To convert the colored image to grayscale.
Get the red green blue values of each pixel
Get the red green blue values of each pixel
Get the average of these 3 colors.
Get the average of these 3 colors.
Replace the RGB values with the average.
Replace the RGB values with the average.
Create a new pixel value from the mod... | [
{
"code": null,
"e": 1105,
"s": 1062,
"text": "To convert the colored image to grayscale."
},
{
"code": null,
"e": 1149,
"s": 1105,
"text": "Get the red green blue values of each pixel"
},
{
"code": null,
"e": 1193,
"s": 1149,
"text": "Get the red green blue v... |
Check if a destination is reachable from source with two movements allowed | Set 2 - GeeksforGeeks | 07 May, 2021
Given a pair of coordinates (X1, Y1)(source) and (X2, Y2)(destination), the task is to check if it is possible to reach the destination form the source by the following movements from any cell (X, Y):
(X + Y, Y)(X, Y + X)
(X + Y, Y)
(X, Y + X)
Note: All coordinates are positive and can be as large as 1018.... | [
{
"code": null,
"e": 26825,
"s": 26797,
"text": "\n07 May, 2021"
},
{
"code": null,
"e": 27026,
"s": 26825,
"text": "Given a pair of coordinates (X1, Y1)(source) and (X2, Y2)(destination), the task is to check if it is possible to reach the destination form the source by the foll... |
How to loop through collections with a cursor in MongoDB? | Following is the syntax to loop through collections with cursor
var anyVariableName1;
var anyVariableName2= db.yourCollectionName.find();
while(yourVariableName2.hasNext()) {
yourVariableName1= yourVariableName2.next(); printjson(yourVariableName1);
};
Let us create a collection with documents. Following is the quer... | [
{
"code": null,
"e": 1126,
"s": 1062,
"text": "Following is the syntax to loop through collections with cursor"
},
{
"code": null,
"e": 1318,
"s": 1126,
"text": "var anyVariableName1;\nvar anyVariableName2= db.yourCollectionName.find();\nwhile(yourVariableName2.hasNext()) {\n y... |
Insert() Method in C# | The Insert() method in C# is used to return a new string in which a specified string is inserted at a specified index position in this instance.
The syntax is as follows −
public string Insert (int begnIndex, string val);
Above, the parameter begnIndex is the zero-based index position of the insertion, whereas val is t... | [
{
"code": null,
"e": 1207,
"s": 1062,
"text": "The Insert() method in C# is used to return a new string in which a specified string is inserted at a specified index position in this instance."
},
{
"code": null,
"e": 1234,
"s": 1207,
"text": "The syntax is as follows −"
},
{
... |
Python Program to Print Numbers in an Interval | In this article, we will learn about the solution and approach to solve the given problem statement.
Given the starting and ending range of an interval. We need to print all the numbers in the interval given.
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.
There ... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "In this article, we will learn about the solution and approach to solve the given problem statement."
},
{
"code": null,
"e": 1271,
"s": 1163,
"text": "Given the starting and ending range of an interval. We need to print all the numb... |
Heatmap Basics with Seaborn. A guide for how to create heatmaps with... | by Thiago Carvalho | Towards Data Science | The idea is straightforward, replace numbers with colors.
Now, this visualization style has come a long way from simple color-coded tables. It became widely used with geospatial data. Its commonly applied for describing the density or intensity of variables, visualize patterns, variance, and even anomalies.
With so man... | [
{
"code": null,
"e": 230,
"s": 172,
"text": "The idea is straightforward, replace numbers with colors."
},
{
"code": null,
"e": 481,
"s": 230,
"text": "Now, this visualization style has come a long way from simple color-coded tables. It became widely used with geospatial data. It... |
Check if MongoDB database exists? | There are two possibilities to check if MongoDB database exists.
Case 1: The first possibility is that the MongoDB database exists i.e. it returns particular index.
Case 2: The second possibility is that the MongoDB database does not exist i.e. it returns index -1.
NOTE: An index starts from 0 and ends with (N-1) like ... | [
{
"code": null,
"e": 1127,
"s": 1062,
"text": "There are two possibilities to check if MongoDB database exists."
},
{
"code": null,
"e": 1227,
"s": 1127,
"text": "Case 1: The first possibility is that the MongoDB database exists i.e. it returns particular index."
},
{
"co... |
What is strstr() Function in C language? | The C library function char *strstr(const char *haystack, const char *needle) function finds the first occurrence of the substring needle in the string haystack. The terminating '\0' characters are not compared.
An array of characters is called a string.
The syntax for declaring an array is as follows −
char stringname... | [
{
"code": null,
"e": 1274,
"s": 1062,
"text": "The C library function char *strstr(const char *haystack, const char *needle) function finds the first occurrence of the substring needle in the string haystack. The terminating '\\0' characters are not compared."
},
{
"code": null,
"e": 131... |
Sort an array of 0s, 1s and 2s | Practice | GeeksforGeeks | Given an array of size N containing only 0s, 1s, and 2s; sort the array in ascending order.
Example 1:
Input:
N = 5
arr[]= {0 2 1 2 0}
Output:
0 0 1 2 2
Explanation:
0s 1s and 2s are segregated
into ascending order.
Example 2:
Input:
N = 3
arr[] = {0 1 0}
Output:
0 0 1
Explanation:
0s 1s and 2s are segregated
into... | [
{
"code": null,
"e": 330,
"s": 238,
"text": "Given an array of size N containing only 0s, 1s, and 2s; sort the array in ascending order."
},
{
"code": null,
"e": 342,
"s": 330,
"text": "\nExample 1:"
},
{
"code": null,
"e": 457,
"s": 342,
"text": "Input: \nN =... |
DynamoDB - Update Items | Updating an item in DynamoDB mainly consists of specifying the full primary key and table name for the item. It requires a new value for each attribute you modify. The operation uses UpdateItem, which modifies the existing items or creates them on discovery of a missing item.
In updates, you might want to track the cha... | [
{
"code": null,
"e": 2668,
"s": 2391,
"text": "Updating an item in DynamoDB mainly consists of specifying the full primary key and table name for the item. It requires a new value for each attribute you modify. The operation uses UpdateItem, which modifies the existing items or creates them on disco... |
Create a Screen recorder using Python - GeeksforGeeks | 05 Sep, 2020
Python is a widely used general-purpose language. It allows performing a variety of tasks. One of them can be recording a video. It provides a module named pyautogui which can be used for the same. This module along with NumPy and OpenCV provides the way to manipulate and save the images (screenshot in thi... | [
{
"code": null,
"e": 24318,
"s": 24290,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 24633,
"s": 24318,
"text": "Python is a widely used general-purpose language. It allows performing a variety of tasks. One of them can be recording a video. It provides a module named pyautog... |
C library function - strrchr() | The C library function char *strrchr(const char *str, int c) searches for the last occurrence of the character c (an unsigned char) in the string pointed to, by the argument str.
Following is the declaration for strrchr() function.
char *strrchr(const char *str, int c)
str − This is the C string.
str − This is the C st... | [
{
"code": null,
"e": 2186,
"s": 2007,
"text": "The C library function char *strrchr(const char *str, int c) searches for the last occurrence of the character c (an unsigned char) in the string pointed to, by the argument str."
},
{
"code": null,
"e": 2239,
"s": 2186,
"text": "Fol... |
JavaScript: Check if array has an almost increasing sequence | Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the array.
The sequence a0, a1, ..., an is considered to be a strictly increasing if a0 < a1 < ... < an. Sequence containing only one element is also considered t... | [
{
"code": null,
"e": 1231,
"s": 1062,
"text": "Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the array."
},
{
"code": null,
"e": 1408,
"s": 1231,
"text": "The sequence ... |
Jython - Event Handling | Event handling in Java swing requires that the control (like JButton or JList etc.) should be registered with the respective event listener. The event listener interface or corresponding Adapter class needs to be either implemented or subclassed with its event handling method overridden. In Jython, the event handling i... | [
{
"code": null,
"e": 2510,
"s": 2081,
"text": "Event handling in Java swing requires that the control (like JButton or JList etc.) should be registered with the respective event listener. The event listener interface or corresponding Adapter class needs to be either implemented or subclassed with it... |
3 Cool Features of Python Altair. It is more than a data visualization... | by Soner Yıldırım | Towards Data Science | Data visualization is an integral part of data science. It expedites many tasks such as exploring data, delivering results, storytelling, and so on. Thankfully, there are great data visualization libraries for Python.
Altair is a declarative statistical visualization library for Python. It provides several features to ... | [
{
"code": null,
"e": 390,
"s": 172,
"text": "Data visualization is an integral part of data science. It expedites many tasks such as exploring data, delivering results, storytelling, and so on. Thankfully, there are great data visualization libraries for Python."
},
{
"code": null,
"e": ... |
Using Extensions with Selenium & Python | We can use extensions with Selenium webdriver in Python. We can have multiple extensions of the Chrome browser while we manually open the browser and work on it.
However, while the Chrome browser is opened through Selenium webdriver, those extensions which are available to the local browser will not be present. To conf... | [
{
"code": null,
"e": 1224,
"s": 1062,
"text": "We can use extensions with Selenium webdriver in Python. We can have multiple extensions of the Chrome browser while we manually open the browser and work on it."
},
{
"code": null,
"e": 1462,
"s": 1224,
"text": "However, while the C... |
Sarcasm Classification (Using FastText) | by Sambit Mahapatra | Towards Data Science | FastText is a library created by the Facebook Research Team for efficient learning of word representations and sentence classification. It has gained a lot of attraction in the NLP community especially as a strong baseline for word representation replacing word2vec as it takes the char n-grams into account while gettin... | [
{
"code": null,
"e": 568,
"s": 172,
"text": "FastText is a library created by the Facebook Research Team for efficient learning of word representations and sentence classification. It has gained a lot of attraction in the NLP community especially as a strong baseline for word representation replacin... |
ANOVA With Python And SQL. Understanding why and how to do... | by Nurullah Sirca | Towards Data Science | The analysis of variance (ANOVA) is utilized for analyzing the variance which involves assessing the difference between the two variables. It is an effective statistical tool for analyzing financial or customer data which is helpful for monitoring the planning process and managing the projects successfully. One-way ANO... | [
{
"code": null,
"e": 796,
"s": 171,
"text": "The analysis of variance (ANOVA) is utilized for analyzing the variance which involves assessing the difference between the two variables. It is an effective statistical tool for analyzing financial or customer data which is helpful for monitoring the pla... |
Python Increment and Decrement Operators | In this article, we will learn about increment and decrement operators in Python 3.x. Or earlier. In other languages we have pre and post increment and decrement (++ --) operators.
In Python we don’t have any such operators . But we can implement these operators in the form as dicussed in example below.
x=786
x=x+1
pr... | [
{
"code": null,
"e": 1243,
"s": 1062,
"text": "In this article, we will learn about increment and decrement operators in Python 3.x. Or earlier. In other languages we have pre and post increment and decrement (++ --) operators."
},
{
"code": null,
"e": 1367,
"s": 1243,
"text": "I... |
How to build KNN from scratch in Python | by Doug Steen | Towards Data Science | k-Nearest Neighbors (KNN) is a supervised machine learning algorithm that can be used for either regression or classification tasks. KNN is non-parametric, which means that the algorithm does not make assumptions about the underlying distributions of the data. This is in contrast to a technique like linear regression, ... | [
{
"code": null,
"e": 624,
"s": 171,
"text": "k-Nearest Neighbors (KNN) is a supervised machine learning algorithm that can be used for either regression or classification tasks. KNN is non-parametric, which means that the algorithm does not make assumptions about the underlying distributions of the ... |
Simple Little Tables with Matplotlib | by Michael Demastrie | Towards Data Science | Sometimes, I need to create an image for a document that contains a few rows and columns of data. Like most people, I’ll just use a screen capture to create the image, but this approach doesn’t lend well to automated tasks and requires hand-tweaking to get it ready to present. It’s absurd that I’m working in my Jupyter... | [
{
"code": null,
"e": 675,
"s": 172,
"text": "Sometimes, I need to create an image for a document that contains a few rows and columns of data. Like most people, I’ll just use a screen capture to create the image, but this approach doesn’t lend well to automated tasks and requires hand-tweaking to ge... |
How to add a regression line to a plot in base R if intercept and slope are given? | To add a regression line to a plot in base R if intercept and slope are given, we can follow the below steps −
First of all, create two vectors and the scatterplot between them.
Then, use abline function to create the regression line with intercept and slope given by a and b respectively.
Use plot functions to create s... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "To add a regression line to a plot in base R if intercept and slope are given, we can follow the below steps −"
},
{
"code": null,
"e": 1240,
"s": 1173,
"text": "First of all, create two vectors and the scatterplot between them."
}... |
SQL - Transactions | A transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program.
A transaction is the propagation of one or more changes to the database. For examp... | [
{
"code": null,
"e": 2691,
"s": 2453,
"text": "A transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program."
},
{
"... |
Break statement in Scala - GeeksforGeeks | 17 Jan, 2019
In Scala, we use a break statement to break the execution of the loop in the program. Scala programing language does not contain any concept of break statement(in above 2.8 versions), instead of break statement, it provides a break method, which is used to break the execution of a program or a loop. Break ... | [
{
"code": null,
"e": 24427,
"s": 24399,
"text": "\n17 Jan, 2019"
},
{
"code": null,
"e": 24799,
"s": 24427,
"text": "In Scala, we use a break statement to break the execution of the loop in the program. Scala programing language does not contain any concept of break statement(in ... |
How to Deploy Static Website using Caddy Webserver? - GeeksforGeeks | 23 Jun, 2021
Caddy web server is an open-source web server written in Go. It uses the Go standard library for its HTTP functionality and supports HTTPS natively, which means it takes care of your SSL certificate management. In this article, we are going to deploy a static website to caddy webserver on a VPS. We will be... | [
{
"code": null,
"e": 23837,
"s": 23809,
"text": "\n23 Jun, 2021"
},
{
"code": null,
"e": 24158,
"s": 23837,
"text": "Caddy web server is an open-source web server written in Go. It uses the Go standard library for its HTTP functionality and supports HTTPS natively, which means it... |
How to get the size of PyGame Window? - GeeksforGeeks | 02 Jun, 2021
In this article, we will learn How to get the size of a PyGame Window.
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 progra... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n02 Jun, 2021"
},
{
"code": null,
"e": 24364,
"s": 24292,
"text": "In this article, we will learn How to get the size of a PyGame Window. "
},
{
"code": null,
"e": 24671,
"s": 24364,
"text": "Game programming i... |
Check if a number is magic (Recursive sum of digits is 1) - GeeksforGeeks | 14 Jul, 2021
A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition. If the single digit comes out to be 1,then the number is a magic number.
For example- Number= 50113 => 5+0+1+1+3=10 => 1+0=1 This is a Magic ... | [
{
"code": null,
"e": 24392,
"s": 24364,
"text": "\n14 Jul, 2021"
},
{
"code": null,
"e": 24631,
"s": 24392,
"text": "A number is said to be a magic number, if the sum of its digits are calculated till a single digit recursively by adding the sum of the digits after every addition... |
How to change file or directory permission in Linux/Unix? | We know that the Linux/Unix is a multiuser operating system files and directories are associated with permission so that only authorized users can access the files.
The chmod command is used to change the access permission of files or directories.
The general syntax of the chmod command is as follows −
chmod [OPTION]..... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "We know that the Linux/Unix is a multiuser operating system files and directories are associated with permission so that only authorized users can access the files."
},
{
"code": null,
"e": 1310,
"s": 1227,
"text": "The chmod command... |
How to style multi-line conditions in 'if' statements in Python? | There are many ways you can style multiple if conditions. You don't need to use 4 spaces on your second conditional line. So you can use something like &minusl;
if (cond1 == 'val1' and cond2 == 'val2' and
cond3 == 'val3' and cond4 == 'val4'):
# Actual code
You can also start the conditions from the next line −
if (... | [
{
"code": null,
"e": 1223,
"s": 1062,
"text": "There are many ways you can style multiple if conditions. You don't need to use 4 spaces on your second conditional line. So you can use something like &minusl;"
},
{
"code": null,
"e": 1309,
"s": 1223,
"text": "if (cond1 == 'val1' a... |
MySQL - SQRT Function | MySQL SQRT function is used to find out the square root of any number. You can use SELECT statement to find out square root of any number as follows −
mysql> select SQRT(16);
+----------+
| SQRT(16) |
+----------+
| 4.000000 |
+----------+
1 row in set (0.00 sec)
You are seeing float value here because internally MySQ... | [
{
"code": null,
"e": 2484,
"s": 2333,
"text": "MySQL SQRT function is used to find out the square root of any number. You can use SELECT statement to find out square root of any number as follows −"
},
{
"code": null,
"e": 2598,
"s": 2484,
"text": "mysql> select SQRT(16);\n+----... |
Print all k-sum paths in a binary tree in C++ | In this problem, we are given a binary tree and a number K and we have to print all paths in the tree which have the sum of nodes in the path equal k.
Here, the path of the tree can start from any node of the tree and end at any node. The path should always direct from the root node to the leaf node. The values of the ... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "In this problem, we are given a binary tree and a number K and we have to print all paths in the tree which have the sum of nodes in the path equal k."
},
{
"code": null,
"e": 1436,
"s": 1213,
"text": "Here, the path of the tree can ... |
What is difference between gravity and layout_gravity on Android? | Android supports both gravity and layout_gravity. Gravity adjusts view position. Using gravity we can do alignment of view as shown below.
<TextView
android:id = "@+id/button"
android:layout_width = "match_parent"
android:layout_height = "wrap_content"
android:gravity = "center"
android:text = "Click her... | [
{
"code": null,
"e": 1201,
"s": 1062,
"text": "Android supports both gravity and layout_gravity. Gravity adjusts view position. Using gravity we can do alignment of view as shown below."
},
{
"code": null,
"e": 1396,
"s": 1201,
"text": "<TextView\n android:id = \"@+id/button\"\... |
How to Create Fake Data with Faker | by Khuyen Tran | Towards Data Science | Let’s say you want to create data with certain data types (bool, float, text, integers) with special characteristics (names, address, color, email, phone number, location) to test some Python libraries or specific implementation. But it takes time to find that specific kind of data. You wonder: is there a quick way tha... | [
{
"code": null,
"e": 523,
"s": 171,
"text": "Let’s say you want to create data with certain data types (bool, float, text, integers) with special characteristics (names, address, color, email, phone number, location) to test some Python libraries or specific implementation. But it takes time to find... |
C++ String Library - c_str | It returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object.
Following is the declaration for std::string::c_str.
const char* c_str() const;
const char* c_str() const noexcept;
const char* c_str() const noexcept;
none
It ... | [
{
"code": null,
"e": 2763,
"s": 2603,
"text": "It returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object."
},
{
"code": null,
"e": 2816,
"s": 2763,
"text": "Following is the decla... |
Phik (φk) — get familiar with the latest correlation coefficient | by Eryk Lewinson | Towards Data Science | Recently I was doing EDA using pandas-profiling and something piqued my interest. In the correlations tab, I saw many known metrics I have known since university — Pearson’s r, Spearman’s ρ, and so on. However, among those I have seen something new — Phik (φk). I have not heard about this metric before so I decided to ... | [
{
"code": null,
"e": 518,
"s": 171,
"text": "Recently I was doing EDA using pandas-profiling and something piqued my interest. In the correlations tab, I saw many known metrics I have known since university — Pearson’s r, Spearman’s ρ, and so on. However, among those I have seen something new — Phik... |
How to stop Tkinter Frame from shrinking to fit its contents? | The sizing property of all the widgets in the Tkinter frame is by default set to the size of the widgets themselves. The frame container shrinks or grows automatically to fit the widgets inside it. To stop allowing the frame to shrink or grow the widget, we can use propagate(boolean) method with one of any pack or grid... | [
{
"code": null,
"e": 1473,
"s": 1062,
"text": "The sizing property of all the widgets in the Tkinter frame is by default set to the size of the widgets themselves. The frame container shrinks or grows automatically to fit the widgets inside it. To stop allowing the frame to shrink or grow the widget... |
C# | Array.TrueForAll() Method | 08 Jul, 2021
This method is used to determine whether every element in the array matches the conditions defined by the specified predicate.Syntax:
public static bool TrueForAll (T[] array, Predicate<T> match);
Here, T is the type of element of the array.Parameters:
array: It is the one-dimensional, zero-based Array... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 164,
"s": 28,
"text": "This method is used to determine whether every element in the array matches the conditions defined by the specified predicate.Syntax: "
},
{
"code": null,
"e": 22... |
How to Execute a .class File in Java? | 02 Dec, 2020
A Java class file is a compiled java file. It is compiled by the Java compiler into bytecode to be executed by the Java Virtual Machine.
1. To compile your .java files, open Terminal (Mac) or Command Prompt (Windows).
2. Navigate to the folder your java file is at.
3. To compile, type
javac <javaFileName>
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Dec, 2020"
},
{
"code": null,
"e": 165,
"s": 28,
"text": "A Java class file is a compiled java file. It is compiled by the Java compiler into bytecode to be executed by the Java Virtual Machine."
},
{
"code": null,
"e": 2... |
Matplotlib.axes.Axes.get_position() in Python | 19 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": 28,
"s": 0,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 328,
"s": 28,
"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, Line2D, Text... |
How to bundle an Angular app for production? | 28 May, 2020
IntroductionBefore deploying the web app, Angular provides a way to check the behavior of the web application with the help of a few CLI-commands. Usually, ng serves command is used to build, watch, and serve the application from local memory. But for deployment, the behavior of the application is seen by ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n28 May, 2020"
},
{
"code": null,
"e": 386,
"s": 53,
"text": "IntroductionBefore deploying the web app, Angular provides a way to check the behavior of the web application with the help of a few CLI-commands. Usually, ng serves command ... |
Minimum spanning tree cost of given Graphs | 08 Jun, 2022
Given an undirected graph of V nodes (V > 2) named V1, V2, V3, ..., Vn. Two nodes Vi and Vj are connected to each other if and only if 0 < | i – j | ≤ 2. Each edge between any vertex pair (Vi, Vj) is assigned a weight i + j. The task is to find the cost of the minimum spanning tree of such graph with V nod... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jun, 2022"
},
{
"code": null,
"e": 376,
"s": 54,
"text": "Given an undirected graph of V nodes (V > 2) named V1, V2, V3, ..., Vn. Two nodes Vi and Vj are connected to each other if and only if 0 < | i – j | ≤ 2. Each edge between an... |
How to check an HTML element is empty using jQuery ? | 03 Aug, 2021
Given an HTML document and select an element from the HTML document and check that element is empty or not. There are two methods used to solve this problem which are discussed below:
Method 1: Using the “:empty” selector: The element to be checked using is() method. The is() method is used to check if one... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 212,
"s": 28,
"text": "Given an HTML document and select an element from the HTML document and check that element is empty or not. There are two methods used to solve this problem which are discusse... |
Node.js authentication using Passportjs and passport-local-mongoose | 14 Oct, 2021
Passport is the authentication middleware for Node. It is designed to serve a singular purpose which is to authenticate requests. It is not practical to store user password as the original string in the database but it is a good practice to hash the password and then store them into the database. But with ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Oct, 2021"
},
{
"code": null,
"e": 678,
"s": 54,
"text": "Passport is the authentication middleware for Node. It is designed to serve a singular purpose which is to authenticate requests. It is not practical to store user password a... |
What is Latency? | 13 Sep, 2021
What is Latency?
Being simple latency means whenever you have given input to the system and the total time period it takes to give output so that particular time period/interval is known as latency.
Actually, latency is the in-between handling time of computers, as some of you may think that whenever some ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 45,
"s": 28,
"text": "What is Latency?"
},
{
"code": null,
"e": 227,
"s": 45,
"text": "Being simple latency means whenever you have given input to the system and the total time p... |
Change one element in the given array to make it an Arithmetic Progression | 30 May, 2022
Given an array which is an original arithmetic progression with one element changed. The task is to make it an arithmetic progression again. If there are many such possible sequences, return any one of them. The length of the array will always be greater than 2. Examples:
Input : arr = [1, 3, 4, 7] Output ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 May, 2022"
},
{
"code": null,
"e": 325,
"s": 52,
"text": "Given an array which is an original arithmetic progression with one element changed. The task is to make it an arithmetic progression again. If there are many such possible s... |
Python program for Longest Increasing Subsequence | 08 Jun, 2022
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order. For example, the length of LIS for {10, 22, 9, 33, 21, 50, 41, 60, 80} is 6 and LIS is {10, 22, 33, 50, 60, 80}. M... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jun, 2022"
},
{
"code": null,
"e": 375,
"s": 54,
"text": "The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in ... |
Dynamic Styling in ElectronJS | 29 May, 2020
ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable of running on Windows, macOS, and Linux operating systems. It combines the Chromium engine and NodeJS into a Single Runtime.
To make... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 May, 2020"
},
{
"code": null,
"e": 328,
"s": 28,
"text": "ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable ... |
whoami command in Linux with example | 18 Feb, 2021
whoami command is used both in Unix Operating System and as well as in Windows Operating System.
It is basically the concatenation of the strings “who”,”am”,”i” as whoami.
It displays the username of the current user when this command is invoked.
It is similar as running the id command with the options -un... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Feb, 2021"
},
{
"code": null,
"e": 150,
"s": 53,
"text": "whoami command is used both in Unix Operating System and as well as in Windows Operating System."
},
{
"code": null,
"e": 225,
"s": 150,
"text": "It is ba... |
Print all combinations of points that can compose a given number | 13 Jun, 2022
You can win three kinds of basketball points, 1 point, 2 points, and 3 points. Given a total score of n, print out all the combinations to compose n.
Examples:
For n = 1, the program should print following:
1
For n = 2, the program should print following:
1 1
2
For n = 3, the program should print follow... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 205,
"s": 54,
"text": "You can win three kinds of basketball points, 1 point, 2 points, and 3 points. Given a total score of n, print out all the combinations to compose n. "
},
{
"code": n... |
JPA - Advanced Mappings | JPA is a library which is released with java specification. Therefore, it supports all object oriented concepts for entity persistence. Till now we are done with the basics of object relational mapping. This chapter takes you through the advanced mappings between objects and relational entities.
Inheritance is the core... | [
{
"code": null,
"e": 2170,
"s": 1873,
"text": "JPA is a library which is released with java specification. Therefore, it supports all object oriented concepts for entity persistence. Till now we are done with the basics of object relational mapping. This chapter takes you through the advanced mappin... |
Matplotlib.axes.Axes.hist() in Python | 13 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": 28,
"s": 0,
"text": "\n13 Apr, 2020"
},
{
"code": null,
"e": 328,
"s": 28,
"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, Line2D, Text... |
Longest Common Prefix using Binary Search | 21 Jan, 2022
Given a set of strings, find the longest common prefix.
Input : {“geeksforgeeks”, “geeks”, “geek”, “geezer”}
Output : "gee"
Input : {"apple", "ape", "april"}
Output : "ap"
Input : {"abcd"}
Output : "abcd"
Previous Approaches – Word by Word Matching , Character by Character Matching, Divide and Conq... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jan, 2022"
},
{
"code": null,
"e": 112,
"s": 54,
"text": "Given a set of strings, find the longest common prefix. "
},
{
"code": null,
"e": 267,
"s": 112,
"text": "Input : {“geeksforgeeks”, “geeks”, “geek”, “ge... |
Lookup and Reference - INDEX Function | The INDEX function returns a value or the reference to a value from within a table or range. You can use INDEX function in two ways −
To return the value of a specified cell or array of cells.
To return a reference to specified cells.
Use this if the first argument to INDEX is an array constant.
Description
The functio... | [
{
"code": null,
"e": 1988,
"s": 1854,
"text": "The INDEX function returns a value or the reference to a value from within a table or range. You can use INDEX function in two ways −"
},
{
"code": null,
"e": 2047,
"s": 1988,
"text": "To return the value of a specified cell or array... |
D3.js axis.tickSize() Function - GeeksforGeeks | 18 Aug, 2020
The d3.axis.tickSize() function in D3.js is used to set the inner and outer tick size to the specified value and returns the axis. If size is not specified, returns the current inner tick size, which defaults to 6.
Syntax:
axis.tickSize([size])
Parameters: This function accepts single parameter as mentione... | [
{
"code": null,
"e": 24916,
"s": 24888,
"text": "\n18 Aug, 2020"
},
{
"code": null,
"e": 25131,
"s": 24916,
"text": "The d3.axis.tickSize() function in D3.js is used to set the inner and outer tick size to the specified value and returns the axis. If size is not specified, return... |
How to create a responsive navigation menu with icons, using CSS?
| Following is the code for creating the responsive navigation menu with icons.
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
margin:0px;
margin-top:10px;
padding: 0px;
}
nav{
... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "Following is the code for creating the responsive navigation menu with icons."
},
{
"code": null,
"e": 1151,
"s": 1140,
"text": " Live Demo"
},
{
"code": null,
"e": 2295,
"s": 1151,
"text": "<!DOCTYPE html>\n<html... |
JavaScript: How to loop through all DOM elements on a page and display result on console? | To loop through all DOM elements on a page, use document.getElementsByTagName(‘*’). Loop
through its length and display the result in console as in the below code −
var tags = document.getElementsByTagName("*");
for (var i=0, max=tags.length; i < max; i++) {
console.log(tags[i]);
}
Live Demo
<!DOCTYPE html>
<html l... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "To loop through all DOM elements on a page, use document.getElementsByTagName(‘*’). Loop\nthrough its length and display the result in console as in the below code −"
},
{
"code": null,
"e": 1348,
"s": 1227,
"text": "var tags = docum... |
Join Multiple Tables Using Inner Join - GeeksforGeeks | 27 May, 2021
To retrieve data from the single table we use SELECT and PROJECTION operations but to retrieve data from multiple tables we use JOINS in SQL. There are different types of JOINS in SQL. In this article, only operations on inner joins in MSSQL are discussed.
Inner Join is the method of retrieval of data fr... | [
{
"code": null,
"e": 24262,
"s": 24234,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 24521,
"s": 24262,
"text": "To retrieve data from the single table we use SELECT and PROJECTION operations but to retrieve data from multiple tables we use JOINS in SQL. There are different t... |
Visualizing beyond 3 Dimensions. Peeking into unseeably complex data | by Alec Morgan | Towards Data Science | Vision is arguably one of our greatest strengths as humans. Even the most tremendously complex ideas tend to become easy (or at least, much easier) to understand as soon as you find a way to visualize them — our occipital lobes have done us well. That’s why when you’re working with datasets that have more than 3 dimens... | [
{
"code": null,
"e": 662,
"s": 171,
"text": "Vision is arguably one of our greatest strengths as humans. Even the most tremendously complex ideas tend to become easy (or at least, much easier) to understand as soon as you find a way to visualize them — our occipital lobes have done us well. That’s w... |
Inbuilt Data Structures in Python - GeeksforGeeks | 01 Feb, 2022
Python has four basic inbuilt data structures namely Lists, Dictionary, Tuple and Set. These almost cover 80% of the our real world data structures. This article will cover the above mentioned topics.
Above mentioned topics are divided into four sections below.
Lists: Lists in Python are one of the most ... | [
{
"code": null,
"e": 24316,
"s": 24288,
"text": "\n01 Feb, 2022"
},
{
"code": null,
"e": 24518,
"s": 24316,
"text": "Python has four basic inbuilt data structures namely Lists, Dictionary, Tuple and Set. These almost cover 80% of the our real world data structures. This article w... |
Embedding Graphs with Deep Learning | by Connor Shorten | Towards Data Science | Sparse representations are the natural killer of classifiers. Current graph data structures such as adjacency matrices and lists are plagued with this sparsity. This article will discuss techniques such as Matrix decomposition, DeepWalk, and Node2Vec which convert sparse graph data into low-dimensional continuous vecto... | [
{
"code": null,
"e": 502,
"s": 172,
"text": "Sparse representations are the natural killer of classifiers. Current graph data structures such as adjacency matrices and lists are plagued with this sparsity. This article will discuss techniques such as Matrix decomposition, DeepWalk, and Node2Vec whic... |
Converting Tkinter program to exe file | Let us suppose that we want to create a standalone app (executable application) using tkinter. We can convert any tkinter application to an exe compatible file format using the PyInstaller package in Python.
To work with pyinstaller, first install the package in the environment by using the following command,
pip insta... | [
{
"code": null,
"e": 1270,
"s": 1062,
"text": "Let us suppose that we want to create a standalone app (executable application) using tkinter. We can convert any tkinter application to an exe compatible file format using the PyInstaller package in Python."
},
{
"code": null,
"e": 1373,
... |
Compiler Design | Detection of a Loop in Three Address Code - GeeksforGeeks | 10 Nov, 2021
Prerequisite – Three address code in CompilerLoop optimization is the phase after the Intermediate Code Generation. The main intention of this phase is to reduce the number of lines in a program. In any program majority of the time is spent by any program is actually inside the loop for an iterative progra... | [
{
"code": null,
"e": 25244,
"s": 25216,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 25673,
"s": 25244,
"text": "Prerequisite – Three address code in CompilerLoop optimization is the phase after the Intermediate Code Generation. The main intention of this phase is to reduce t... |
How can fetch records from specific month and year in a MySQL table? | Use YEAR() and MONTH() to display records from specific month and year respectively. Let us first create a table −
mysql> create table DemoTable
(
CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
CustomerName varchar(20),
CustomerTotalBill int,
PurchasingDate date
);
Query OK, 0 rows affected (0.83... | [
{
"code": null,
"e": 1177,
"s": 1062,
"text": "Use YEAR() and MONTH() to display records from specific month and year respectively. Let us first create a table −"
},
{
"code": null,
"e": 1388,
"s": 1177,
"text": "mysql> create table DemoTable\n (\n CustomerId int NOT NULL AUT... |
HTML | content Attribute - GeeksforGeeks | 25 Aug, 2021
The HTML content Attribute is used to given the values that are related to the http-equiv or name attribute. The content attribute can associated with the <meta> element.
Supported Tags:
<meta>
Syntax:
<meta content="text">
Attribute Values: It contains the values the text which specify the content of ... | [
{
"code": null,
"e": 23826,
"s": 23798,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 23998,
"s": 23826,
"text": "The HTML content Attribute is used to given the values that are related to the http-equiv or name attribute. The content attribute can associated with the <meta> e... |
Convert an array of binary numbers to corresponding integer in JavaScript | Let’s say, we have an array of Numbers that contains 0 and 1 −
const arr = [0, 1, 0, 1];
We are required to write an Array function, toBinary() that returns the corresponding binary for
the array it is used with.
For example − If the array is −
const arr = [1, 0, 1, 1];
Then the output should be 11 because the decimal ... | [
{
"code": null,
"e": 1125,
"s": 1062,
"text": "Let’s say, we have an array of Numbers that contains 0 and 1 −"
},
{
"code": null,
"e": 1151,
"s": 1125,
"text": "const arr = [0, 1, 0, 1];"
},
{
"code": null,
"e": 1275,
"s": 1151,
"text": "We are required to wri... |
Python Pandas - Get the number of days from TimeDelta | To get the number of days from TimeDelta, use the timedelta.days property in Pandas. At first, import the required libraries −
import pandas as pd
TimeDeltas is Python’s standard datetime library uses a different representation timedelta’s. Create a Timedelta object
timedelta = pd.Timedelta('5 days 1 min 45 s')
Return... | [
{
"code": null,
"e": 1314,
"s": 1187,
"text": "To get the number of days from TimeDelta, use the timedelta.days property in Pandas. At first, import the required libraries −"
},
{
"code": null,
"e": 1334,
"s": 1314,
"text": "import pandas as pd"
},
{
"code": null,
"e"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.