title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Implement your own itoa() in C | In this section we will see how to convert an integer number to a string.
The logic is very simple. Here we will use the sprintf() function. This function is used to print some value or line into a string, but not in the console. This is the only difference between printf() and sprintf(). Here the first argument is the... | [
{
"code": null,
"e": 1136,
"s": 1062,
"text": "In this section we will see how to convert an integer number to a string."
},
{
"code": null,
"e": 1430,
"s": 1136,
"text": "The logic is very simple. Here we will use the sprintf() function. This function is used to print some value... |
Chatbots aren’t as difficult to make as You Think | by Rahul Agarwal | Towards Data Science | Chatbots. Chatbots. Chatbots everywhere.
Every website must implement it. Every Data Scientist must know about them. Anytime we talk about AI; Chatbots must be discussed.
But they intimidate someone very new to the field. We struggle with a lot of questions before we even begin to start working on them.
Are they hard t... | [
{
"code": null,
"e": 213,
"s": 172,
"text": "Chatbots. Chatbots. Chatbots everywhere."
},
{
"code": null,
"e": 343,
"s": 213,
"text": "Every website must implement it. Every Data Scientist must know about them. Anytime we talk about AI; Chatbots must be discussed."
},
{
"... |
Support Vector Machines & Imbalanced Data | by Deepthi A R | Towards Data Science | A brief about SVMsObserve how SVM works in case of an imbalanced dataset.Observe how the hyperplane changes according to the change in the regularization term.
A brief about SVMs
Observe how SVM works in case of an imbalanced dataset.
Observe how the hyperplane changes according to the change in the regularization term... | [
{
"code": null,
"e": 332,
"s": 172,
"text": "A brief about SVMsObserve how SVM works in case of an imbalanced dataset.Observe how the hyperplane changes according to the change in the regularization term."
},
{
"code": null,
"e": 351,
"s": 332,
"text": "A brief about SVMs"
},
... |
Apache Kafka - Tools | Kafka Tool packaged under “org.apache.kafka.tools.*. Tools are categorized into system tools and replication tools.
System tools can be run from the command line using the run class script. The syntax is as follows −
bin/kafka-run-class.sh package.class - - options
Some of the system tools are mentioned below −
Kafka M... | [
{
"code": null,
"e": 2083,
"s": 1967,
"text": "Kafka Tool packaged under “org.apache.kafka.tools.*. Tools are categorized into system tools and replication tools."
},
{
"code": null,
"e": 2184,
"s": 2083,
"text": "System tools can be run from the command line using the run class ... |
Database Migration from Oracle to AWS Redshift using AWS DMS | by Shafiqa Iqbal | Towards Data Science | AWS DMS takes a minimalist approach and creates only those objects required to efficiently migrate the data. In other words, AWS DMS creates tables, primary keys, and in some cases unique indexes, but doesn’t create any other objects that are not required to efficiently migrate the data from the source. For example, it... | [
{
"code": null,
"e": 679,
"s": 172,
"text": "AWS DMS takes a minimalist approach and creates only those objects required to efficiently migrate the data. In other words, AWS DMS creates tables, primary keys, and in some cases unique indexes, but doesn’t create any other objects that are not required... |
Bootstrap class dropdown-header | Add a header to label sections of actions in any drop-down menu by using the class dropdown-header.
You can try to run the following code to implement the dropdown-header Bootstrap class
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<link href = "/bootstrap/css/bootstrap.min.cs... | [
{
"code": null,
"e": 1162,
"s": 1062,
"text": "Add a header to label sections of actions in any drop-down menu by using the class dropdown-header."
},
{
"code": null,
"e": 1249,
"s": 1162,
"text": "You can try to run the following code to implement the dropdown-header Bootstrap c... |
How to add tooltip to JLabel in Java? | Tooltip is visible whenever you will place the mouse cursor on the label. Use the setToolTipText() method to add tooltip to JLabel −
label.setToolTipText("This is a demo tooltip");
The following is an example to add tooltip to JLabel −
import java.awt.Color;
import java.awt.Font;
import javax.swing.*;
import javax.swin... | [
{
"code": null,
"e": 1195,
"s": 1062,
"text": "Tooltip is visible whenever you will place the mouse cursor on the label. Use the setToolTipText() method to add tooltip to JLabel −"
},
{
"code": null,
"e": 1243,
"s": 1195,
"text": "label.setToolTipText(\"This is a demo tooltip\");... |
Plotting Regional Topographic Maps from Scratch in Python | by Fouad Faraj | Towards Data Science | Topographic maps represent Earth’s 3D landscape as a 2D map and are used to visualize both anthropogenic and natural features in their geographical context. The specific applications for topographic maps vary depending on the scale of the map. Some uses include planning transportation routes, guiding travelers, and del... | [
{
"code": null,
"e": 634,
"s": 172,
"text": "Topographic maps represent Earth’s 3D landscape as a 2D map and are used to visualize both anthropogenic and natural features in their geographical context. The specific applications for topographic maps vary depending on the scale of the map. Some uses i... |
Remove duplicate element from sorted Linked List | Practice | GeeksforGeeks | Given a singly linked list consisting of N nodes. The task is to remove duplicates (nodes with duplicate values) from the given list (if exists).
Note: Try not to use extra space. Expected time complexity is O(N). The nodes are arranged in a sorted way.
Example 1:
Input:
LinkedList: 2->2->4->5
Output: 2 4 5
Explanation... | [
{
"code": null,
"e": 492,
"s": 238,
"text": "Given a singly linked list consisting of N nodes. The task is to remove duplicates (nodes with duplicate values) from the given list (if exists).\nNote: Try not to use extra space. Expected time complexity is O(N). The nodes are arranged in a sorted way."... |
Merge two tables with union in MySQL? | To merge two tables with UNION, you can use create table select statement. Following is the syntax −
create table yourNewTableName
select * from yourFirstTableName
UNION
select * from yourSecondTableName;
Let us first create a table. Following is the query −
mysql> create table FirstTable
-> (
-> Id int,
-> Pe... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "To merge two tables with UNION, you can use create table select statement. Following is the syntax −"
},
{
"code": null,
"e": 1267,
"s": 1163,
"text": "create table yourNewTableName\nselect * from yourFirstTableName\nUNION\nselect * ... |
How to Export Pandas DataFrame to CSV | by Barney H. | Towards Data Science | The easiest way to do this :
df.to_csv('file_name.csv')
If you want to export without the index, simply add index=False;
df.to_csv('file_name.csv', index=False)
If you getUnicodeEncodeError , simply add encoding='utf-8' ;
df.to_csv('file_name.csv', encoding='utf-8')
Pandas DataFrames create an excel data structure with... | [
{
"code": null,
"e": 201,
"s": 172,
"text": "The easiest way to do this :"
},
{
"code": null,
"e": 228,
"s": 201,
"text": "df.to_csv('file_name.csv')"
},
{
"code": null,
"e": 293,
"s": 228,
"text": "If you want to export without the index, simply add index=Fal... |
Video Analysis with Tensor Decomposition in Python | by Célestin Hermez | Towards Data Science | Artificial Intelligence. Deep Learning. Convolutional Neural Networks. Reinforcement Learning. These are revolutionary advances in the field of machine learning, and have made the impossible possible. Despite all these qualities, there are also drawbacks and limitations. For instance, neural networks are prone to overf... | [
{
"code": null,
"e": 634,
"s": 172,
"text": "Artificial Intelligence. Deep Learning. Convolutional Neural Networks. Reinforcement Learning. These are revolutionary advances in the field of machine learning, and have made the impossible possible. Despite all these qualities, there are also drawbacks ... |
Difference between Statement and PreparedStatement - GeeksforGeeks | 04 Apr, 2022
1. Statement : It is used for accessing your database. Statement interface cannot accept parameters and useful when you are using static SQL statements at runtime. If you want to run SQL query only once then this interface is preferred over PreparedStatement.
Example –
//Creating The Statement Object
S... | [
{
"code": null,
"e": 24768,
"s": 24740,
"text": "\n04 Apr, 2022"
},
{
"code": null,
"e": 25029,
"s": 24768,
"text": "1. Statement : It is used for accessing your database. Statement interface cannot accept parameters and useful when you are using static SQL statements at runtime.... |
NLP | Location Tags Extraction - GeeksforGeeks | 26 Feb, 2019
Different kind of ChunkParserI subclass can be used to identify the LOCATION chunks. As it uses the gazetteers corpus to identify location words. The gazetteers corpus is a WordListCorpusReader class that contains the following location words:
Country names
U.S. states and abbreviations
Mexican states
Majo... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n26 Feb, 2019"
},
{
"code": null,
"e": 24536,
"s": 24292,
"text": "Different kind of ChunkParserI subclass can be used to identify the LOCATION chunks. As it uses the gazetteers corpus to identify location words. The gazetteers co... |
KnockoutJS - HTML Binding | HTML binding causes the associated DOM element to display the HTML specified by the parameter. This is very useful if you want to generate HTML markup dynamically.
html: <binding-value>
KnockoutJS sets DOM element's content to the parameter value provided. This functionality is also available in JQuery. If JQuery is n... | [
{
"code": null,
"e": 2016,
"s": 1852,
"text": "HTML binding causes the associated DOM element to display the HTML specified by the parameter. This is very useful if you want to generate HTML markup dynamically."
},
{
"code": null,
"e": 2039,
"s": 2016,
"text": "html: <binding-val... |
Ruby | Array bsearch() operation - GeeksforGeeks | 08 Jan, 2020
Array#bsearch() : bsearch() is an Array class method which finds a value from the array that meets with the given condition. It’s complexity is O(log n) where n is the array size. This method can work in both the modes – find-minimum and find-any mode.
Syntax: Array.bsearch()
Parameter:
- Arrays to sear... | [
{
"code": null,
"e": 23940,
"s": 23912,
"text": "\n08 Jan, 2020"
},
{
"code": null,
"e": 24193,
"s": 23940,
"text": "Array#bsearch() : bsearch() is an Array class method which finds a value from the array that meets with the given condition. It’s complexity is O(log n) where n is... |
VBScript Dictionary Objects | A Dictionary object can be compared to a PERL associative array. Any Values can be stored in the array and each item is associated with a unique key. The key is used to retrieve an individual element and it is usually an integer or a string, but can be anything except an array.
VBScript classes are enclosed within Clas... | [
{
"code": null,
"e": 2359,
"s": 2080,
"text": "A Dictionary object can be compared to a PERL associative array. Any Values can be stored in the array and each item is associated with a unique key. The key is used to retrieve an individual element and it is usually an integer or a string, but can be ... |
How to Use SFTP to Secure File Transfer with a Remote Server | In this article, you can learn about – how to setup SFTP (Secured File Transfer Protocol) which will help us to transfer the files from local machine to remote server secure. FTP (File Transfer protocol) is a very popular method used to transfer files from one machine to another or from remote servers.
SFTP stands for ... | [
{
"code": null,
"e": 1366,
"s": 1062,
"text": "In this article, you can learn about – how to setup SFTP (Secured File Transfer Protocol) which will help us to transfer the files from local machine to remote server secure. FTP (File Transfer protocol) is a very popular method used to transfer files f... |
Why need build workflow in React.js | BUILDING A WORK-FLOW HELPS IN DOING BELOW THINGS
It optimizes code
Using next-gen JavaScript (ES6)
Its a standard way for single/multiple page apps
Productive approach
Easy integration of dependencies with NPM or Yarn
Use of bundler like web-pack for easier modular code and shipping code
Pre compiler like Babel
We can ... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "BUILDING A WORK-FLOW HELPS IN DOING BELOW THINGS"
},
{
"code": null,
"e": 1129,
"s": 1111,
"text": "It optimizes code"
},
{
"code": null,
"e": 1161,
"s": 1129,
"text": "Using next-gen JavaScript (ES6)"
},
{
... |
boost::algorithm::equal() in C++ library - GeeksforGeeks | 17 Jun, 2019
The equal() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/equal.hpp’ tests to see if two sequences contain equal values. It returns a boolean value which determines if both the sequences are same or not.
Syntax:
bool equal ( InputIterator1 first1, InputIterator1 second1,
... | [
{
"code": null,
"e": 24091,
"s": 24063,
"text": "\n17 Jun, 2019"
},
{
"code": null,
"e": 24328,
"s": 24091,
"text": "The equal() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/equal.hpp’ tests to see if two sequences contain equal values. It return... |
React Native - Switch | In this chapter, we will explain the Switch component in a couple of steps.
We will use the HomeContainer component for logic, but we need to create the presentational component.
Let us now create a new file: SwitchExample.js.
We are passing value from the state and functions for toggling switch items to SwitchExample ... | [
{
"code": null,
"e": 2420,
"s": 2344,
"text": "In this chapter, we will explain the Switch component in a couple of steps."
},
{
"code": null,
"e": 2523,
"s": 2420,
"text": "We will use the HomeContainer component for logic, but we need to create the presentational component."
... |
Bootstrap .btn-block class | To create a button using the .btn-block class, you can try to run the following code −
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://stackpath.bootstrapcd... | [
{
"code": null,
"e": 1274,
"s": 1187,
"text": "To create a button using the .btn-block class, you can try to run the following code −"
},
{
"code": null,
"e": 1284,
"s": 1274,
"text": "Live Demo"
},
{
"code": null,
"e": 2089,
"s": 1284,
"text": "<!DOCTYPE html... |
Python – itertools.repeat() | 19 Feb, 2020
Python’s Itertool is a module that provides various functions that work on iterators to produce complex iterators. This module works as a fast, memory-efficient tool that is used either by themselves or in combination to form iterator algebra.
Note: For more information, refer to Python Itertools
itertools... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 272,
"s": 28,
"text": "Python’s Itertool is a module that provides various functions that work on iterators to produce complex iterators. This module works as a fast, memory-efficient tool that is u... |
SELECT a FLOAT with given precision in MySQL | You can use ROUND() function.
The syntax is as follows
SELECT ROUND(yourColumnName,yourPrecisionIntegerValue) from yourTableName;
To understand the concept, let us create a table. The query to create a table is as follows
mysql> create table givenPrecisionDemo
-> (
-> Amount float
-> );
Query OK, 0 rows affect... | [
{
"code": null,
"e": 1217,
"s": 1187,
"text": "You can use ROUND() function."
},
{
"code": null,
"e": 1242,
"s": 1217,
"text": "The syntax is as follows"
},
{
"code": null,
"e": 1317,
"s": 1242,
"text": "SELECT ROUND(yourColumnName,yourPrecisionIntegerValue) f... |
OCR of Handwritten digits | OpenCV - GeeksforGeeks | 26 Mar, 2020
OCR which stands for Optical Character Recognition is a computer vision technique used to identify the different types of handwritten digits that are used in common mathematics. To perform OCR in OpenCV we will use the KNN algorithm which detects the nearest k neighbors of a particular data point and then ... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 24596,
"s": 24212,
"text": "OCR which stands for Optical Character Recognition is a computer vision technique used to identify the different types of handwritten digits that are used in commo... |
Andrew Ng’s Machine Learning Course in Python (Anomaly Detection) | by Benjamin Lau | Towards Data Science | This is the last part of Andrew Ng’s Machine Learning Course python implementation and I am very excited to finally complete the series. To give you guys some perspective, it took me a month to convert these codes to python and writes an article for each assignment. If any of you were hesitating to do your own implemen... | [
{
"code": null,
"e": 753,
"s": 172,
"text": "This is the last part of Andrew Ng’s Machine Learning Course python implementation and I am very excited to finally complete the series. To give you guys some perspective, it took me a month to convert these codes to python and writes an article for each ... |
LDA Topic modeling with Tweets. Making sense of unstructured text | by Rob Zifchak | Towards Data Science | Having some experience with building NLP models for text classification, I’ve been thinking further about how to work with completely unstructured text data. With approximately 500 million tweets tweeted on Twitter on a daily basis, Twitter is a great source of textual data. What are people tweeting about? Can these tw... | [
{
"code": null,
"e": 702,
"s": 172,
"text": "Having some experience with building NLP models for text classification, I’ve been thinking further about how to work with completely unstructured text data. With approximately 500 million tweets tweeted on Twitter on a daily basis, Twitter is a great sou... |
How to declare an empty string array in C#? | In C#, you can use strings as an array of characters, However, more common practice is to use the string keyword to declare a string variable. The string keyword is an alias for the System.String class.
To declare an empty string.
string[] arr = new string[] {}; // empty string
Now let us see what will happen when we w... | [
{
"code": null,
"e": 1265,
"s": 1062,
"text": "In C#, you can use strings as an array of characters, However, more common practice is to use the string keyword to declare a string variable. The string keyword is an alias for the System.String class."
},
{
"code": null,
"e": 1293,
"s"... |
How to use the ValidateSet Attribute in PowerShell function? | The ValidateSet attribute in PowerShell function is to validate the values entered from the set which
means, it allows only specific values from the set. To understand better consider the below example, we
have an array and we need to check if entered values are among array or not then we will use the below
code.
Funct... | [
{
"code": null,
"e": 1377,
"s": 1062,
"text": "The ValidateSet attribute in PowerShell function is to validate the values entered from the set which\nmeans, it allows only specific values from the set. To understand better consider the below example, we\nhave an array and we need to check if entered... |
Java â String lastIndexOf() Method | This method returns the index of the last occurrence of the character in the character sequence represented by this object that is less than or equal to fromIndex, or -1 if the character does not occur before that point.
Here is the syntax of this method −
int lastIndexOf(int ch)
Here is the detail of parameters −
ch ... | [
{
"code": null,
"e": 2598,
"s": 2377,
"text": "This method returns the index of the last occurrence of the character in the character sequence represented by this object that is less than or equal to fromIndex, or -1 if the character does not occur before that point."
},
{
"code": null,
... |
Operating Systems | Set 11 - GeeksforGeeks | 28 Sep, 2018
Following questions have been asked in GATE 2008 CS exam.
1) A process executes the following code
for (i = 0; i < n; i++) fork();
The total number of child processes created is(A) n(B) 2^n - 1(C) 2^n(D) 2^(n+1) - 1;
Answer (B)
F0 // There will be 1 child process created by first fork
... | [
{
"code": null,
"e": 23629,
"s": 23601,
"text": "\n28 Sep, 2018"
},
{
"code": null,
"e": 23687,
"s": 23629,
"text": "Following questions have been asked in GATE 2008 CS exam."
},
{
"code": null,
"e": 23728,
"s": 23687,
"text": "1) A process executes the follow... |
Authentication Bypass using SQL Injection on Login Page - GeeksforGeeks | 20 Nov, 2020
SQL injection is a technique used to exploit user data through web page inputs by injecting SQL commands as statements. Basically, these statements can be used to manipulate the application’s web server by malicious users.
SQL injection is a code injection technique that might destroy your database.
SQL in... | [
{
"code": null,
"e": 24864,
"s": 24836,
"text": "\n20 Nov, 2020"
},
{
"code": null,
"e": 25087,
"s": 24864,
"text": "SQL injection is a technique used to exploit user data through web page inputs by injecting SQL commands as statements. Basically, these statements can be used to ... |
How to solve diamond problem using default methods in Java | Inheritance is a relation between two classes where one class inherits the properties of the other class. This relation can be defined using the extends keyword as −
public class A extends B{}
public class A extends B{
The class which inherits the properties is known as sub class or, child class and the class whose pro... | [
{
"code": null,
"e": 1228,
"s": 1062,
"text": "Inheritance is a relation between two classes where one class inherits the properties of the other class. This relation can be defined using the extends keyword as −"
},
{
"code": null,
"e": 1255,
"s": 1228,
"text": "public class A e... |
Tryit Editor v3.7 | Padding & Spacing
Tryit: HTML table - cellpadding | [
{
"code": null,
"e": 40,
"s": 22,
"text": "Padding & Spacing"
}
] |
How do I create a listView with rounded corners in Android? | This example demonstrates how do I create a listView with rounded corners in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "This example demonstrates how do I create a listView with rounded corners in android."
},
{
"code": null,
"e": 1277,
"s": 1148,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required ... |
How to concatenate more than 2 fields with SQL? | To concatenate more than 2 fields with SQL, you can use CONCAT() or CONCAT_WS() function. The syntax is as follows. Let us first see using CONCAT().
SELECT CONCAT(yourColumnName1,'/',yourColumnName2, '/',yourColumnName3, '/',......N) AS anyVariableName FROM yourTableName;
The syntax is as follows:
SELECT CONCAT_WS(‘/’,... | [
{
"code": null,
"e": 1211,
"s": 1062,
"text": "To concatenate more than 2 fields with SQL, you can use CONCAT() or CONCAT_WS() function. The syntax is as follows. Let us first see using CONCAT()."
},
{
"code": null,
"e": 1335,
"s": 1211,
"text": "SELECT CONCAT(yourColumnName1,'/'... |
Clustered & Overlapped Bar Charts | by Darío Weitz | Towards Data Science | 1.- Clustered Bar Charts
AKA: grouped, side-by-side, multiset [bar charts, bar graphs, column charts]
Why: Clustered Bar Charts (CBC) display numerical information about the relative proportion that exists between a main category and its subgroups that belongs to a second categorical variable. Similar to Stacked Bar Gr... | [
{
"code": null,
"e": 196,
"s": 171,
"text": "1.- Clustered Bar Charts"
},
{
"code": null,
"e": 273,
"s": 196,
"text": "AKA: grouped, side-by-side, multiset [bar charts, bar graphs, column charts]"
},
{
"code": null,
"e": 874,
"s": 273,
"text": "Why: Clustered ... |
PriorityQueue offer() Method in Java | 10 Dec, 2018
The java.util.PriorityQueue.offer() method is used to insert a particular element into the Priority Queue. It acts similar to the add() method of Priority Queue.
Syntax:
Priority_Queue.offer(Object element)
Parameters: The parameter element is of the type PriorityQueue and refers to the element to be inser... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Dec, 2018"
},
{
"code": null,
"e": 216,
"s": 54,
"text": "The java.util.PriorityQueue.offer() method is used to insert a particular element into the Priority Queue. It acts similar to the add() method of Priority Queue."
},
{
... |
How to compare numbers in Python? | You can use relational operators in python to compare numbers(both float and int) in python. These operators compare the values on either side of them and decide the relation among them. Assume variable a holds 10 and variable b holds 20, then
You can use this as follows −
a = 10
b = 20
print(a == b)
print(a != b)
prin... | [
{
"code": null,
"e": 1431,
"s": 1187,
"text": "You can use relational operators in python to compare numbers(both float and int) in python. These operators compare the values on either side of them and decide the relation among them. Assume variable a holds 10 and variable b holds 20, then"
},
{... |
Python program to interchange first and last elements in a list | 26 Jul, 2021
Given a list, write a Python program to swap first and last element of the list.
Examples:
Input : [12, 35, 9, 56, 24]
Output : [24, 35, 9, 56, 12]
Input : [1, 2, 3]
Output : [3, 2, 1]
Approach #1: Find the length of the list and simply swap the first element with (n-1)th element.
Python3
# Python3 progr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Jul, 2021"
},
{
"code": null,
"e": 133,
"s": 52,
"text": "Given a list, write a Python program to swap first and last element of the list."
},
{
"code": null,
"e": 144,
"s": 133,
"text": "Examples: "
},
{
... |
Date and Time Formatting in Android | 19 Feb, 2021
Date and Time in Android are formatted using the SimpleDateFormat library from Java, using Calendar instance which helps to get the current system date and time. The current date and time are of the type Long which can be converted to a human-readable date and time. In this article, it’s been discussed how... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n19 Feb, 2021"
},
{
"code": null,
"e": 513,
"s": 53,
"text": "Date and Time in Android are formatted using the SimpleDateFormat library from Java, using Calendar instance which helps to get the current system date and time. The current ... |
Sankey Charts with Multiple levels | Following is an example of a SanKey Chart with multiple levels.
We have already seen the configurations used to draw a chart in Google Charts Configuration Syntax chapter. Now, let us see an example of a SanKey Chart with multiple levels.
We've used Sankey class to show a Sankey chart with multiple levels.
Sankey chart... | [
{
"code": null,
"e": 2406,
"s": 2342,
"text": "Following is an example of a SanKey Chart with multiple levels."
},
{
"code": null,
"e": 2581,
"s": 2406,
"text": "We have already seen the configurations used to draw a chart in Google Charts Configuration Syntax chapter. Now, let u... |
wall command in Linux with Examples | 27 May, 2019
wall command in Linux system is used to write a message to all users. This command displays a message, or the contents of a file, or otherwise its standard input, on the terminals of all currently logged in users. The lines which will be longer than 79 characters, wrapped by this command. Short lines are w... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 May, 2019"
},
{
"code": null,
"e": 733,
"s": 28,
"text": "wall command in Linux system is used to write a message to all users. This command displays a message, or the contents of a file, or otherwise its standard input, on the termi... |
How to style with SASS/SCSS in React ? | 16 Feb, 2021
Introduction: We can use SASS in React using a package called node-sass. Using node-sass we can just create sass files and use them as the normal CSS files in our React application and node-sass will take care of compiling sass files.
Prerequisite: Introduction to SASS
Modules: To compile sass code, node-s... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Feb, 2021"
},
{
"code": null,
"e": 287,
"s": 52,
"text": "Introduction: We can use SASS in React using a package called node-sass. Using node-sass we can just create sass files and use them as the normal CSS files in our React appli... |
Swap Kth node from beginning with Kth node from end in a Linked List | 03 Jul, 2022
Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be changed. This requirement may be logical in many situations where the linked list data part is huge (For example student details line Name, RollNo, Address, ..etc). The ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jul, 2022"
},
{
"code": null,
"e": 424,
"s": 54,
"text": "Given a singly linked list, swap kth node from beginning with kth node from end. Swapping of data is not allowed, only pointers should be changed. This requirement may be log... |
Encryption and Decryption Application in Android using Caesar Cipher Algorithm | 30 Jun, 2021
Here, we are going to make an application of “Encryption-decryption”. By making this application we will be able to learn that how we can convert a normal text to ciphertext and encrypt our message. We will also be decrypting our message with help of a key by again converting it to a readable form. This ar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 423,
"s": 28,
"text": "Here, we are going to make an application of “Encryption-decryption”. By making this application we will be able to learn that how we can convert a normal text to ciphertext a... |
Private Destructor in C++ | 22 Dec, 2021
Destructors with the access modifier as private are known as Private Destructors. Whenever we want to prevent the destruction of an object, we can make the destructor private.
What is the use of private destructor?
Whenever we want to control the destruction of objects of a class, we make the destructor pr... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Dec, 2021"
},
{
"code": null,
"e": 230,
"s": 54,
"text": "Destructors with the access modifier as private are known as Private Destructors. Whenever we want to prevent the destruction of an object, we can make the destructor private... |
Weather App in Python using Tkinter module | 23 Jan, 2021
In this article, we are going to discuss how to create a weather app using tkinter. The GUI app will tell us the current weather of a particular city along with temperature details along with other details.
Tkinter: It is a built-in python library for making GUI using tkinter toolkit.
Requests: It is a li... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jan, 2021"
},
{
"code": null,
"e": 260,
"s": 52,
"text": "In this article, we are going to discuss how to create a weather app using tkinter. The GUI app will tell us the current weather of a particular city along with temperature d... |
Perl | Scope of Variables | 12 Feb, 2019
The scope of a variable is the part of the program where the variable is accessible. A scope is also termed as the visibility of the variables in a program. In Perl, we can declare either Global variables or Private variables. Private variables are also known as lexical variables.
Global variables can be u... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Feb, 2019"
},
{
"code": null,
"e": 310,
"s": 28,
"text": "The scope of a variable is the part of the program where the variable is accessible. A scope is also termed as the visibility of the variables in a program. In Perl, we can de... |
String.Format() Method in C# with Examples | Set – 1 | 28 May, 2020
In C#, Format() is a string method. This method is used to replace one or more format items in the specified string with the string representation of a specified object.In other words, this method is used to insert the value of the variable or an object or expression into another string.
This method can b... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 May, 2020"
},
{
"code": null,
"e": 318,
"s": 28,
"text": "In C#, Format() is a string method. This method is used to replace one or more format items in the specified string with the string representation of a specified object.In ot... |
Ionic - Colors | Before we start with actual elements available in the Ionic framework, let us have a little understanding on how Ionic makes use of colors for different elements.
Ionic framework gives us a set of nine predefined color classes. You can use these colors or you can override it with your own styling.
The following table s... | [
{
"code": null,
"e": 2760,
"s": 2597,
"text": "Before we start with actual elements available in the Ionic framework, let us have a little understanding on how Ionic makes use of colors for different elements."
},
{
"code": null,
"e": 2896,
"s": 2760,
"text": "Ionic framework giv... |
SAP ABAP - Strings | Strings, which are widely used in ABAP programming, are a sequence of characters.
We use data type C variables for holding alphanumeric characters, with a minimum of 1 character and a maximum of 65,535 characters. By default, these are aligned to the left.
The following declaration and initialization creates a string c... | [
{
"code": null,
"e": 3114,
"s": 3032,
"text": "Strings, which are widely used in ABAP programming, are a sequence of characters."
},
{
"code": null,
"e": 3289,
"s": 3114,
"text": "We use data type C variables for holding alphanumeric characters, with a minimum of 1 character and ... |
Python bit functions on int (bit_length, to_bytes and from_bytes) | 20 Aug, 2020
The int type implements the numbers.Integral abstract base class.
1. int.bit_length()Returns the number of bits required to represent an integer in binary, excluding the sign and leading zeros.
Code to demonstrate
num = 7print(num.bit_length()) num = -7print(num.bit_length())
3
3
2. int.to_bytes(length, ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Aug, 2020"
},
{
"code": null,
"e": 118,
"s": 52,
"text": "The int type implements the numbers.Integral abstract base class."
},
{
"code": null,
"e": 246,
"s": 118,
"text": "1. int.bit_length()Returns the number o... |
C / C++ Program for Subset Sum | Backtracking-4 | 11 Dec, 2018
Subset sum problem is to find subset of elements that are selected from a given set whose sum adds up to a given number K. We are considering the set contains non-negative values. It is assumed that the input set is unique (no duplicates are presented).
C/C++
#include <stdio.h>#include <stdlib.h> #define ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 306,
"s": 52,
"text": "Subset sum problem is to find subset of elements that are selected from a given set whose sum adds up to a given number K. We are considering the set contains non-negative va... |
Multi-Armed Bandits and Reinforcement Learning | by Christian Hubbs | Towards Data Science | Multi-armed bandit problems are some of the simplest reinforcement learning (RL) problems to solve. We have an agent which we allow to choose actions, and each action has a reward that is returned according to a given, underlying probability distribution. The game is played over many episodes (single actions in this ca... | [
{
"code": null,
"e": 537,
"s": 172,
"text": "Multi-armed bandit problems are some of the simplest reinforcement learning (RL) problems to solve. We have an agent which we allow to choose actions, and each action has a reward that is returned according to a given, underlying probability distribution.... |
Diet Plan Performance in Python | Suppose a dieter consumes calories[i], this indicates the calories on the i-th day. If we have an integer k, for every consecutive sequence of k days that is (calories[i], calories[i+1], ..., calories[i+k-1] for all 0 <= i <= n-k), they find T. The T is the total calories consumed during that sequence of k days (calori... | [
{
"code": null,
"e": 1461,
"s": 1062,
"text": "Suppose a dieter consumes calories[i], this indicates the calories on the i-th day. If we have an integer k, for every consecutive sequence of k days that is (calories[i], calories[i+1], ..., calories[i+k-1] for all 0 <= i <= n-k), they find T. The T is... |
Number of factors | Practice | GeeksforGeeks | Find the number of factors for a given integer N.
Example 1:
Input:
N = 5
Output:
2
Explanation:
5 has 2 factors 1 and 5
Example 2:
Input:
N = 25
Output:
3
Explanation:
25 has 3 factors 1, 5, 25
Your Task:
You don't need to read input or print anything. Your task is to complete the function countFactors() which tak... | [
{
"code": null,
"e": 290,
"s": 238,
"text": "Find the number of factors for a given integer N.\n "
},
{
"code": null,
"e": 301,
"s": 290,
"text": "Example 1:"
},
{
"code": null,
"e": 361,
"s": 301,
"text": "Input:\nN = 5\nOutput:\n2\nExplanation:\n5 has 2 fact... |
Count the pairs in an array such that the difference between them and their indices is equal - GeeksforGeeks | 19 Mar, 2022
Given an array arr[] of size N, the task is to count the number of pairs (arr[i], arr[j]) such that arr[j] – arr[i] = j – i.Examples:
Input: arr[] = {5, 2, 7} Output: 1 The only valid pair is (arr[0], arr[2]) as 7 – 5 = 2 – 0 = 2.Input: arr[] = {1, 2, 3, 4} Output: 6
Approach: A pair (arr[i], arr[j]) i... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n19 Mar, 2022"
},
{
"code": null,
"e": 24958,
"s": 24822,
"text": "Given an array arr[] of size N, the task is to count the number of pairs (arr[i], arr[j]) such that arr[j] – arr[i] = j – i.Examples: "
},
{
"code": null,... |
What is the difference between CHAR and VARCHAR in MySQL? | CHAR and VARCHAR are both ASCII character data types and almost same but they are different at the stage of storing and retrieving the data from the database. Following are some important differences between CHAR and VARCHAR in MySQL −
mysql>create table emp(name CHAR(20));
Query OK, 0 rows affected (0.25
mysql>create ... | [
{
"code": null,
"e": 1298,
"s": 1062,
"text": "CHAR and VARCHAR are both ASCII character data types and almost same but they are different at the stage of storing and retrieving the data from the database. Following are some important differences between CHAR and VARCHAR in MySQL −"
},
{
"co... |
Check if a number is Palindrome in PL/SQL - GeeksforGeeks | 16 May, 2018
Given an integer, write a function that returns true if the given number is palindrome, else false. For example, 12321 is palindrome, but 1451 is not palindrome.
Let the given number be num. A simple method for this problem is to first reverse digits of num, then compare the reverse of num with num. If bot... | [
{
"code": null,
"e": 24658,
"s": 24630,
"text": "\n16 May, 2018"
},
{
"code": null,
"e": 24820,
"s": 24658,
"text": "Given an integer, write a function that returns true if the given number is palindrome, else false. For example, 12321 is palindrome, but 1451 is not palindrome."
... |
Virtual Function in C++ | In this tutorial, we will be discussing a program to understand virtual functions in C++.
Virtual function is the member function defined in the base class and can further be defined in the child class as well. While calling the derived class, the overwritten function will be called.
Live Demo
#include <iostream>
usin... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to understand virtual functions in C++."
},
{
"code": null,
"e": 1347,
"s": 1152,
"text": "Virtual function is the member function defined in the base class and can further be defined... |
How to add an extra point to scatterplot using ggplot2 in R? | To add an extra point to scatterplot using ggplot2, we can still use geom_point function. We just need to use aes function for quoting with new values for the variables, also we can change the color of this point using colour argument. The display of an extra point will help us to distinguish between a threshold/new va... | [
{
"code": null,
"e": 1408,
"s": 1062,
"text": "To add an extra point to scatterplot using ggplot2, we can still use geom_point function. We just need to use aes function for quoting with new values for the variables, also we can change the color of this point using colour argument. The display of an... |
AWS Quicksight - Quick Guide | AWS Quicksight is one of the most powerful Business Intelligence tools which allows you to create interactive dashboards within minutes to provide business insights into the organizations. There are number of visualizations or graphical formats available in which the dashboards can be created. The dashboards get automa... | [
{
"code": null,
"e": 2684,
"s": 2231,
"text": "AWS Quicksight is one of the most powerful Business Intelligence tools which allows you to create interactive dashboards within minutes to provide business insights into the organizations. There are number of visualizations or graphical formats availabl... |
Log functions in C# | With C#, you can easily work with Logarithms. It has the following methods for Log as well as Log base 10.
Let us see an example to work with Log functions in C# −
using System;
class Demo {
static void Main() {
double val1 = Math.Log(1);
Console.WriteLine(val1);
double val2 = Math.Log10(1000);
... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "With C#, you can easily work with Logarithms. It has the following methods for Log as well as Log base 10."
},
{
"code": null,
"e": 1226,
"s": 1169,
"text": "Let us see an example to work with Log functions in C# −"
},
{
"cod... |
Redis - Hash Hexists Command | Redis HEXISTS command is used to check whether a hash field exists or not.
Integer reply, 1 or 0.
1, if the hash contains a field.
0 if the hash does not contain a field, or the key does not exist.
Following is the basic syntax of Redis HEXISTS command.
redis 127.0.0.1:6379> HEXISTS KEY_NAME FIELD_NAME
redis 127.0.0.1... | [
{
"code": null,
"e": 2120,
"s": 2045,
"text": "Redis HEXISTS command is used to check whether a hash field exists or not."
},
{
"code": null,
"e": 2143,
"s": 2120,
"text": "Integer reply, 1 or 0."
},
{
"code": null,
"e": 2176,
"s": 2143,
"text": "1, if the has... |
Reading an excel file using Python - GeeksforGeeks | 19 Feb, 2022
Using xlrd module, one can retrieve information from a spreadsheet. For example, reading, writing or modifying the data can be done in Python. Also, the user might have to go through various sheets and retrieve data based on some criteria or modify some rows and columns and do a lot of work.
xlrd module is... | [
{
"code": null,
"e": 24453,
"s": 24425,
"text": "\n19 Feb, 2022"
},
{
"code": null,
"e": 24746,
"s": 24453,
"text": "Using xlrd module, one can retrieve information from a spreadsheet. For example, reading, writing or modifying the data can be done in Python. Also, the user might... |
DLL - Registration | In order to use a DLL, it has to be registered by having appropriate references entered in the Registry. It sometimes happens that a Registry reference gets corrupted and the functions of the DLL cannot be used anymore. The DLL can be re-registered by opening Start-Run and entering the following command:
regsvr32 somef... | [
{
"code": null,
"e": 1958,
"s": 1652,
"text": "In order to use a DLL, it has to be registered by having appropriate references entered in the Registry. It sometimes happens that a Registry reference gets corrupted and the functions of the DLL cannot be used anymore. The DLL can be re-registered by o... |
Responsive page in AngularJS - GeeksforGeeks | 26 Aug, 2020
The web development design that focuses on the dynamic changes to the appearance of a website, which depends upon the screen size and orientation of the device on which we are viewing it. This whole process to meet the ends of the user is called Responsive web design (RWD). So, basically the experience of ... | [
{
"code": null,
"e": 24718,
"s": 24690,
"text": "\n26 Aug, 2020"
},
{
"code": null,
"e": 25377,
"s": 24718,
"text": "The web development design that focuses on the dynamic changes to the appearance of a website, which depends upon the screen size and orientation of the device on ... |
Laravel - Namespaces | Namespaces can be defined as a class of elements in which each element has a unique name to that associated class. It may be shared with elements in other classes.
The use keyword allows the developers to shorten the namespace.
use <namespace-name>;
The default namespace used in Laravel is App, however a user can chan... | [
{
"code": null,
"e": 2636,
"s": 2472,
"text": "Namespaces can be defined as a class of elements in which each element has a unique name to that associated class. It may be shared with elements in other classes."
},
{
"code": null,
"e": 2700,
"s": 2636,
"text": "The use keyword al... |
Replacing VBA with Java in Excel. Fall in love with Excel again with the... | by Tony Roberts | Towards Data Science | Excel is ubiquitous in nearly every workplace. From top tier investment firms and large scale engineering companies right down to individual sole traders, people get work done using Excel.
This article will look at some of the problems and advantages of using Excel, and how using Java embedded in Excel those problems c... | [
{
"code": null,
"e": 361,
"s": 172,
"text": "Excel is ubiquitous in nearly every workplace. From top tier investment firms and large scale engineering companies right down to individual sole traders, people get work done using Excel."
},
{
"code": null,
"e": 508,
"s": 361,
"text"... |
The Ultimate Guide to Relational Operators in R | by Linda Ngo | Towards Data Science | Relational operators, or comparators, are operators which help us see how one R object relates to another.
For example, you can check whether two objects are equal (equality) by using a double equals sign == .
We can see if the logical value of TRUE equals the logical value of TRUE by using this query TRUE == TRUE . Th... | [
{
"code": null,
"e": 279,
"s": 172,
"text": "Relational operators, or comparators, are operators which help us see how one R object relates to another."
},
{
"code": null,
"e": 382,
"s": 279,
"text": "For example, you can check whether two objects are equal (equality) by using a ... |
Java Examples - Exception Hierarchies | How to handle the exception hierarchies ?
Here is the sample diagram of Exception Hierarchies
This example shows how to handle the exception hierarchies by extending Exception class ?
class Animal extends Exception {
}
class Mammel extends Animal {
}
public class Human {
public static void main(String[] args) {
... | [
{
"code": null,
"e": 2110,
"s": 2068,
"text": "How to handle the exception hierarchies ?"
},
{
"code": null,
"e": 2162,
"s": 2110,
"text": "Here is the sample diagram of Exception Hierarchies"
},
{
"code": null,
"e": 2252,
"s": 2162,
"text": "This example show... |
Object Detection with 10 lines of code | by Moses Olafenwa | Towards Data Science | Part 2 of this tutorial for detecting your custom objects is available via this link.
One of the important fields of Artificial Intelligence is Computer Vision. Computer Vision is the science of computers and software systems that can recognize and understand images and scenes. Computer Vision is also composed of vario... | [
{
"code": null,
"e": 258,
"s": 172,
"text": "Part 2 of this tutorial for detecting your custom objects is available via this link."
},
{
"code": null,
"e": 938,
"s": 258,
"text": "One of the important fields of Artificial Intelligence is Computer Vision. Computer Vision is the sc... |
URI getPath() method in Java with Examples | 02 Jan, 2019
The getPath() function is a part of URI class. The function getPath() returns the Path name of a specified URI.
Function Signature:
public String getPath()
Syntax:
url.getPath()
Parameter: This function does not require any parameter
Return Type: The function returns String Type
Below programs illustrates ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Jan, 2019"
},
{
"code": null,
"e": 140,
"s": 28,
"text": "The getPath() function is a part of URI class. The function getPath() returns the Path name of a specified URI."
},
{
"code": null,
"e": 160,
"s": 140,
"te... |
Suspending the current thread for the specified amount of time in C# | 01 Feb, 2019
In C#, a Sleep() method temporarily suspends the current execution of the thread for specified milliseconds, so that other threads can get the chance to start the execution, or may get the CPU for execution. There are two methods in the overload list of Thread.Sleep Method as follows:
Sleep(Int32)
Sleep(Ti... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 314,
"s": 28,
"text": "In C#, a Sleep() method temporarily suspends the current execution of the thread for specified milliseconds, so that other threads can get the chance to start the execution, o... |
SQL | Numeric Functions | 30 Dec, 2019
Numeric Functions are used to perform operations on numbers and return numbers.Following are the numeric functions defined in SQL:
ABS(): It returns the absolute value of a number.Syntax: SELECT ABS(-243.5);Output: 243.5SQL> SELECT ABS(-10);
+--------------------------------------+
| ABS(10) ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n30 Dec, 2019"
},
{
"code": null,
"e": 184,
"s": 53,
"text": "Numeric Functions are used to perform operations on numbers and return numbers.Following are the numeric functions defined in SQL:"
},
{
"code": null,
"e": 3708,
... |
HTTP headers | Content-Length | 31 Oct, 2019
HTTP headers are used to pass additional information in HTTP request or HTTP response. HTTP Content-Length entity-header is used to indicate the size of entity-body in decimal no of octets i.e. bytes and sent it to the recipient. It is a forbidden header name. Basically it is the number of bytes of data in... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 428,
"s": 28,
"text": "HTTP headers are used to pass additional information in HTTP request or HTTP response. HTTP Content-Length entity-header is used to indicate the size of entity-body in decimal... |
Priority Queue of Tuples in C++ with Examples | 23 Nov, 2021
Priority Queue
Priority queues are a type of container adapters, specifically designed such that the first element of the queue is the greatest of all elements in the queue and elements are in nonincreasing order (hence we can see that each element of the queue has a priority {fixed order}).
Functions asso... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Nov, 2021"
},
{
"code": null,
"e": 43,
"s": 28,
"text": "Priority Queue"
},
{
"code": null,
"e": 321,
"s": 43,
"text": "Priority queues are a type of container adapters, specifically designed such that the first e... |
ML | Binning or Discretization | 14 Apr, 2022
Real-world data tend to be noisy. Noisy data is data with a large amount of additional meaningless information in it called noise. Data cleaning (or data cleansing) routines attempt to smooth out noise while identifying outliers in the data.
There are three data smoothing techniques as follows –
Binning : ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Apr, 2022"
},
{
"code": null,
"e": 270,
"s": 28,
"text": "Real-world data tend to be noisy. Noisy data is data with a large amount of additional meaningless information in it called noise. Data cleaning (or data cleansing) routines a... |
ifup command in Linux with Examples | 22 May, 2019
The ifup command basically brings the network interface up, allowing it to transmit and receive data. Technically ifup command is used to configure network interfaces based on interface definitions in the file /etc/network/interfaces.
Syntax:
ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [-... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 May, 2019"
},
{
"code": null,
"e": 263,
"s": 28,
"text": "The ifup command basically brings the network interface up, allowing it to transmit and receive data. Technically ifup command is used to configure network interfaces based on... |
Function to find Number of customers who could not get a computer | 27 Jun, 2022
Write a function “runCustomerSimulation” that takes following two inputs
An integer ‘n’: total number of computers in a cafe and a string: A sequence of uppercase letters ‘seq’: Letters in the sequence occur in pairs. The first occurrence indicates the arrival of a customer; the second indicates the depar... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Jun, 2022"
},
{
"code": null,
"e": 128,
"s": 54,
"text": "Write a function “runCustomerSimulation” that takes following two inputs "
},
{
"code": null,
"e": 390,
"s": 128,
"text": "An integer ‘n’: total number of... |
Left Rotation and Right Rotation of a String | 29 Jun, 2022
Given a string of size n, write functions to perform the following operations on a string-
Left (Or anticlockwise) rotate the given string by d elements (where d <= n)Right (Or clockwise) rotate the given string by d elements (where d <= n).
Left (Or anticlockwise) rotate the given string by d elements (wh... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Jun, 2022"
},
{
"code": null,
"e": 145,
"s": 54,
"text": "Given a string of size n, write functions to perform the following operations on a string-"
},
{
"code": null,
"e": 296,
"s": 145,
"text": "Left (Or antic... |
Plotting back-to-back bar charts Matplotlib | 16 Dec, 2021
In this article, we will learn how to plot back-to-back bar charts in matplotlib in python. Let’s discuss some concepts :
Matplotlib: Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 150,
"s": 28,
"text": "In this article, we will learn how to plot back-to-back bar charts in matplotlib in python. Let’s discuss some concepts :"
},
{
"code": null,
"e": 425,
"s": 15... |
Minimum steps to reduce N to 0 by given operations | 09 Jun, 2022
Give an integer N, the task is to find the minimum number of moves to reduce N to 0 by one of the following operations:
Reduce N by 1.
Reduce N to (N/2), if N is divisible by 2.
Reduce N to (N/3), if N is divisible by 3.
Examples:
Input: N = 10Output: 4Explanation: Here N = 10Step 1: Reducing N by 1 i.e., ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 174,
"s": 54,
"text": "Give an integer N, the task is to find the minimum number of moves to reduce N to 0 by one of the following operations:"
},
{
"code": null,
"e": 189,
"s": 174... |
Stream forEachOrdered() method in Java with examples | 06 Dec, 2018
Stream forEachOrdered(Consumer action) performs an action for each element of this stream, in the encounter order of the stream if the stream has a defined encounter order. Stream forEachOrdered(Consumer action) is a terminal operation i.e, it may traverse the stream to produce a result or a side-effect.
S... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 358,
"s": 52,
"text": "Stream forEachOrdered(Consumer action) performs an action for each element of this stream, in the encounter order of the stream if the stream has a defined encounter order. S... |
Factory Method – Python Design Patterns | 31 Jan, 2022
Factory Method is a Creational Design Pattern that allows an interface or a class to create an object, but lets subclasses decide which class or object to instantiate. Using the Factory method, we have the best ways to create an object. Here, objects are created without exposing the logic to the client, an... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Jan, 2022"
},
{
"code": null,
"e": 444,
"s": 54,
"text": "Factory Method is a Creational Design Pattern that allows an interface or a class to create an object, but lets subclasses decide which class or object to instantiate. Using ... |
Binary Search Visualization using Pygame in Python | 28 Jul, 2020
An algorithm like Binary Search can be understood easily by visualizing. In this article, a program that visualizes the Binary Search Algorithm has been implemented. The Graphical User Interface(GUI) is implemented in Python using pygame library.
Generate random array, sort it using any sorting algorithm, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2020"
},
{
"code": null,
"e": 275,
"s": 28,
"text": "An algorithm like Binary Search can be understood easily by visualizing. In this article, a program that visualizes the Binary Search Algorithm has been implemented. The Graph... |
Spring Boot - Sending Email | By using Spring Boot RESTful web service, you can send an email with Gmail Transport Layer Security. In this chapter, let us understand in detail how to use this feature.
First, we need to add the Spring Boot Starter Mail dependency in your build configuration file.
Maven users can add the following dependency into the... | [
{
"code": null,
"e": 3330,
"s": 3159,
"text": "By using Spring Boot RESTful web service, you can send an email with Gmail Transport Layer Security. In this chapter, let us understand in detail how to use this feature."
},
{
"code": null,
"e": 3426,
"s": 3330,
"text": "First, we n... |
Ruby | String gsub! Method | 12 Dec, 2019
gsub! is a String class method in Ruby which is used to return a copy of the given string with all occurrences of pattern substituted for the second argument. If no substitutions were performed, then it will return nil. If no block and no replacement is given, an enumerator is returned instead.
Syntax: str... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Dec, 2019"
},
{
"code": null,
"e": 324,
"s": 28,
"text": "gsub! is a String class method in Ruby which is used to return a copy of the given string with all occurrences of pattern substituted for the second argument. If no substituti... |
Differences between Flatten() and Ravel() Numpy Functions | 23 Oct, 2020
We have two similar kind of ways to convert a ndarray to 1D array : Flatten() and Ravel()
import numpy as np
a = np.array( [ (1,7,3,4),(3,2,4,1) ] )
#OUTPUT:
print( a.flatten() )
# [ 1,7,3,4,3,2,4,1 ]
print ( a.ravel() )
# [ 1,7,3,4,3,2,4,1 ]
The question arises here, why are there two numpy functions t... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Oct, 2020"
},
{
"code": null,
"e": 144,
"s": 54,
"text": "We have two similar kind of ways to convert a ndarray to 1D array : Flatten() and Ravel()"
},
{
"code": null,
"e": 300,
"s": 144,
"text": "import numpy as... |
Python | Remove substring list from String | 22 Apr, 2020
Sometimes, while working with Python Strings, we can have problem in which we need to remove a substring from String. This is quite easy and many times solved before. But sometimes, we deal with list of strings that need to be removed and String adjusted accordingly. Lets discuss certain ways in which this... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 354,
"s": 28,
"text": "Sometimes, while working with Python Strings, we can have problem in which we need to remove a substring from String. This is quite easy and many times solved before. But some... |
Python – How to create an ARP Spoofer using Scapy? | 27 Jul, 2020
ARP spoofing is a malicious attack in which the hacker sends falsified ARP in a network. Every node in a connected network has an ARP table through which we identify the IP address and the MAC address of the connected devices.What aim to send an ARP broadcast to find our desired IP which needs to be spoofe... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jul, 2020"
},
{
"code": null,
"e": 812,
"s": 52,
"text": "ARP spoofing is a malicious attack in which the hacker sends falsified ARP in a network. Every node in a connected network has an ARP table through which we identify the IP a... |
How to add content in <head> section using jQuery/JavaScript? | 01 Jul, 2020
Any content can be added to the <head> section using the following two approaches:
Using the document.head propertySelecting the head element using jQuery
Using the document.head property
Selecting the head element using jQuery
Method 1: Using the document.head property: The head property of the document r... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Jul, 2020"
},
{
"code": null,
"e": 111,
"s": 28,
"text": "Any content can be added to the <head> section using the following two approaches:"
},
{
"code": null,
"e": 183,
"s": 111,
"text": "Using the document.head... |
Python | Checkbox widget in Kivy | 19 Oct, 2021
Kivy is a platform independent GUI tool in Python. Kivy applications can be run on Android, IOS, linux, and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktop applications.
Kivy Tutorial – Learn Kivy with Examples.
Checkbox widget... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 302,
"s": 52,
"text": "Kivy is a platform independent GUI tool in Python. Kivy applications can be run on Android, IOS, linux, and Windows, etc. It is basically used to develop the Android applicat... |
How to Set navbar active class with Bootstrap and AngularJS ? | 05 Jan, 2022
To set an active class in your bootstrap navbar, you can use ng-controller(NavigationController) to set bootstrap navbar active class with AngularJS. To run a single controller outside ng-view. You can set class= “active” when the angular route is clicked.
Below example implements the above approach:
Examp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jan, 2022"
},
{
"code": null,
"e": 285,
"s": 28,
"text": "To set an active class in your bootstrap navbar, you can use ng-controller(NavigationController) to set bootstrap navbar active class with AngularJS. To run a single controlle... |
Ruby | Symbol upcase function | 10 Dec, 2019
Symbol#upcase() : upcase() is a Symbol class method which returns the uppercase representation of the symbol object.
Syntax: Symbol.upcase()
Parameter: Symbol values
Return: the uppercase representation of the symbol object.
Example #1 :
# Ruby code for Symbol.upcase() method # declaring Symbol a = :aBcDe... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Dec, 2019"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "Symbol#upcase() : upcase() is a Symbol class method which returns the uppercase representation of the symbol object."
},
{
"code": null,
"e": 169,
"s": 145,
... |
MongoDB - Distinct() Method - GeeksforGeeks | 05 Feb, 2021
In MongoDB, the distinct() method finds the distinct values for a given field across a single collection and returns the results in an array. It takes three parameters first one is the field for which to return distinct values and the others are optional.
If you are using this method in the sharded cluster... | [
{
"code": null,
"e": 24364,
"s": 24336,
"text": "\n05 Feb, 2021"
},
{
"code": null,
"e": 24620,
"s": 24364,
"text": "In MongoDB, the distinct() method finds the distinct values for a given field across a single collection and returns the results in an array. It takes three parame... |
Aggregate Daily Data to Month and Year Intervals in R DataFrame - GeeksforGeeks | 23 Sep, 2021
In this article, we are going to see how to aggregate daily data over a period of months and year intervals in dataframe in R Programming Language.
Base R contains a large number of methods to perform operations on the dataframe. The seq() method in R is used to generate regular sequences beginning from a... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 26636,
"s": 26487,
"text": "In this article, we are going to see how to aggregate daily data over a period of months and year intervals in dataframe in R Programming Language. "
},
{
... |
Gini Impurity Measure— An intuitive explanation using python | Towards Data Science | The Gini impurity measure is one of the methods used in decision tree algorithms to decide the optimal split from a root node, and subsequent splits.
(Before moving forward you may want to review Making Decisions with Trees)
To put it into context, a decision tree is trying to create sequential questions such that it p... | [
{
"code": null,
"e": 322,
"s": 172,
"text": "The Gini impurity measure is one of the methods used in decision tree algorithms to decide the optimal split from a root node, and subsequent splits."
},
{
"code": null,
"e": 397,
"s": 322,
"text": "(Before moving forward you may want ... |
Equal Sum and XOR in C++ | In this problem, we are given an integer n. Our task is to create a program to find the count of integers from i = 0 to n, where sum is equal to XOR i.e. (n+i) = (n^i).
Input: n = 4
Output: 4
Explanation:
Considering all values of i from 0 to n,
i = 0, 4 + 0 = 4, 4^0 = 4i = 1, 4 + 1 = 5, 4^1 = 5i = 2, 4 + 2 = 6, 4... | [
{
"code": null,
"e": 1231,
"s": 1062,
"text": "In this problem, we are given an integer n. Our task is to create a program to find the count of integers from i = 0 to n, where sum is equal to XOR i.e. (n+i) = (n^i)."
},
{
"code": null,
"e": 1245,
"s": 1231,
"text": "Input: n = 4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.