title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Web Scraping CryptoCurrency price and storing it in MongoDB using Python | 29 Dec, 2020
Let us see how to fetch history price in USD or BTC, traded volume and market cap for a given date range using Santiment API and storing the data into MongoDB collection.
Python is a mature language and getting much used in the Cryptocurrency domain. MongoDB is a NoSQL database getting paired with Python i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 199,
"s": 28,
"text": "Let us see how to fetch history price in USD or BTC, traded volume and market cap for a given date range using Santiment API and storing the data into MongoDB collection."
}... |
GATE | GATE CS 2013 | Question 65 | 13 Sep, 2021
Determine the maximum length of the cable (in km) for transmitting data at a rate of 500 Mbps in an Ethernet LAN with frames of size 10,000 bits. Assume the signal speed in the cable to be 2,00,000 km/s.(A) 1(B) 2(C) 2.5(D) 5Answer: (B)Explanation:
Data should be transmitted at the rate of 500 Mbps.
Transm... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 303,
"s": 54,
"text": "Determine the maximum length of the cable (in km) for transmitting data at a rate of 500 Mbps in an Ethernet LAN with frames of size 10,000 bits. Assume the signal speed in t... |
Huffman Coding | Greedy Algo-3 | 19 Apr, 2022
Huffman coding is a lossless data compression algorithm. The idea is to assign variable-length codes to input characters, lengths of the assigned codes are based on the frequencies of corresponding characters. The most frequent character gets the smallest code and the least frequent character gets the larg... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Apr, 2022"
},
{
"code": null,
"e": 1169,
"s": 52,
"text": "Huffman coding is a lossless data compression algorithm. The idea is to assign variable-length codes to input characters, lengths of the assigned codes are based on the freq... |
How to Create custom Turtle shapes in Python? | 19 Apr, 2021
In Turtle, by default, we have an arrowhead-shaped cursor for drawing on the canvas. This can be changed to some other predefined shape or we can also create a custom shape and register it under a name. Not just that, we can even use gif format images to replace our cursor.
The shape() function is used to ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 327,
"s": 52,
"text": "In Turtle, by default, we have an arrowhead-shaped cursor for drawing on the canvas. This can be changed to some other predefined shape or we can also create a custom shape a... |
PostgreSQL – Array Data Type | 30 Jun, 2022
PostgreSQL Supports the concept of Arrays. All data type has a companion array associated with it irrespective of the properties of the data type.It is available even for user-defined data types.
Syntax: variable_name DATA TYPE [];
Now that we know the use and need of Arrays in PostgreSQL, let’s look into... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 225,
"s": 28,
"text": "PostgreSQL Supports the concept of Arrays. All data type has a companion array associated with it irrespective of the properties of the data type.It is available even for use... |
UGC-NET | UGC NET CS 2017 Jan – III | Question 50 | 27 Nov, 2018
Consider a disk queue with I/O requests on the following cylinders in their arriving order:
6, 10, 12, 54, 97, 73, 128, 15, 44, 110, 34, 45
The disk head is assumed to be at cylinder 23 and moving in the direction of decreasing number of cylinders. Total number of cylinders in the disk is 150. The disk he... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Nov, 2018"
},
{
"code": null,
"e": 120,
"s": 28,
"text": "Consider a disk queue with I/O requests on the following cylinders in their arriving order:"
},
{
"code": null,
"e": 169,
"s": 120,
"text": "6, 10, 12, 54,... |
How to create an alert in JavaFX? | An alert is a dialog which shows pre-built dialog types. You can create an alert by instantiating the javafx.scene.control.Alert class. This class is a subclass of the Dialog class. You can create required type of dialog bypassing the respective parameter at the time of instantiation as −
Alert alert = new Alert(Alert.... | [
{
"code": null,
"e": 1352,
"s": 1062,
"text": "An alert is a dialog which shows pre-built dialog types. You can create an alert by instantiating the javafx.scene.control.Alert class. This class is a subclass of the Dialog class. You can create required type of dialog bypassing the respective paramet... |
MySQL INSERT INTO SELECT into a table with AUTO_INCREMENT | Let us create a table −
mysql> create table DemoTable1923
(
UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
UserName varchar(20)
);
Query OK, 0 rows affected (0.00 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1923(UserId,UserName)
select 101 as UserId,'Chris'... | [
{
"code": null,
"e": 1086,
"s": 1062,
"text": "Let us create a table −"
},
{
"code": null,
"e": 1243,
"s": 1086,
"text": "mysql> create table DemoTable1923\n (\n UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n UserName varchar(20)\n );\nQuery OK, 0 rows affected (0.00 s... |
How to represent the mean with vertical line in a histogram created by hist function in R? | The value of mean is an important characteristic of the data to be represented by a histogram, therefore, one might want to plot it with the histogram. If the histogram is created by using hist function then we can create a vertical line on the histogram with the help of abline function by defining mean of the data for... | [
{
"code": null,
"e": 1404,
"s": 1062,
"text": "The value of mean is an important characteristic of the data to be represented by a histogram, therefore, one might want to plot it with the histogram. If the histogram is created by using hist function then we can create a vertical line on the histogra... |
exit - Unix, Linux Command | exit-The exit command terminates a script, just as in a C program. It can also return a value, which is available to the script's parent process.
exit
exit-Issuing the exit command at the shell prompt will cause the shell to exit.
In some cases, if you have jobs running in the background, the shell will remind you tha... | [
{
"code": null,
"e": 10723,
"s": 10577,
"text": "exit-The exit command terminates a script, just as in a C program. It can also return a value, which is available to the script's parent process."
},
{
"code": null,
"e": 10728,
"s": 10723,
"text": "exit"
},
{
"code": null,... |
Explaining a BigQuery ML model. How to obtain and interpret... | by Lak Lakshmanan | Towards Data Science | BigQuery ML is an easy-to-use way to invoke machine learning models on structured data using just SQL. Although it started with only linear regression, more sophisticated models like Deep Neural Networks and AutoML Tables have been added by connecting BigQuery ML with TensorFlow and Vertex AI as its backend. In other w... | [
{
"code": null,
"e": 555,
"s": 172,
"text": "BigQuery ML is an easy-to-use way to invoke machine learning models on structured data using just SQL. Although it started with only linear regression, more sophisticated models like Deep Neural Networks and AutoML Tables have been added by connecting Big... |
Next Greater Even Number | Practice | GeeksforGeeks | Given a positive integer X. The task is to find the smallest even number E such that
E > X and all digits in X and E are same.
Note: All the digits in X should be same with digits in E.
Example 1:
Input:
X = 34722641
Output:
34724126
Explanation:
Next greater number with same
digits as in input is 34724126.
Example... | [
{
"code": null,
"e": 365,
"s": 238,
"text": "Given a positive integer X. The task is to find the smallest even number E such that\nE > X and all digits in X and E are same."
},
{
"code": null,
"e": 424,
"s": 365,
"text": "Note: All the digits in X should be same with digits in E.... |
Hands On Bayesian Statistics with Python, PyMC3 & ArviZ | by Susan Li | Towards Data Science | If you think Bayes’ theorem is counter-intuitive and Bayesian statistics, which builds upon Baye’s theorem, can be very hard to understand. I am with you.
There are countless reasons why we should learn Bayesian statistics, in particular, Bayesian statistics is emerging as a powerful framework to express and understand... | [
{
"code": null,
"e": 327,
"s": 172,
"text": "If you think Bayes’ theorem is counter-intuitive and Bayesian statistics, which builds upon Baye’s theorem, can be very hard to understand. I am with you."
},
{
"code": null,
"e": 531,
"s": 327,
"text": "There are countless reasons why... |
Visualize Missing Values with Missingno | by Soner Yıldırım | Towards Data Science | Data is the new fuel. However, the raw data is cheap. We need to process it well to take the most value out of it. Complex, well-structured models are as good as the data we feed to them. Thus, data needs to be cleaned and processed thoroughly in order to build robust and accurate models.
One of the issues that we are ... | [
{
"code": null,
"e": 461,
"s": 171,
"text": "Data is the new fuel. However, the raw data is cheap. We need to process it well to take the most value out of it. Complex, well-structured models are as good as the data we feed to them. Thus, data needs to be cleaned and processed thoroughly in order to... |
Pedestrian detection in Aerial Images using RetinaNet | by Priya Dwivedi | Towards Data Science | Object Detection in Aerial Images is a challenging and interesting problem. With the cost of drones decreasing, there is a surge in amount of aerial data being generated. It will be very useful to have models that can extract valuable information from aerial data. Retina Net is the most famous single stage detector and... | [
{
"code": null,
"e": 962,
"s": 172,
"text": "Object Detection in Aerial Images is a challenging and interesting problem. With the cost of drones decreasing, there is a surge in amount of aerial data being generated. It will be very useful to have models that can extract valuable information from aer... |
WPF - Popup | Popup is a control that displays content on top of existing content, within the bounds of the application window. It is a temporary display on other content. The hierarchical inheritance of Popup class is as follows −
Child
Gets or sets the content to be hosted in the popup.
ChildProperty
Gets the identifier for the Ch... | [
{
"code": null,
"e": 2238,
"s": 2020,
"text": "Popup is a control that displays content on top of existing content, within the bounds of the application window. It is a temporary display on other content. The hierarchical inheritance of Popup class is as follows −"
},
{
"code": null,
"e"... |
ByteBuffer array() method in Java with Examples - GeeksforGeeks | 03 Jun, 2021
The array() method of java.nio.ByteBuffer class is used to return the byte array that backs the taken buffer.Modifications to this buffer’s content will cause the returned array’s content to be modified, and vice versa.Invoke the hasArray() method before invoking this method in order to ensure that this bu... | [
{
"code": null,
"e": 24518,
"s": 24490,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 24863,
"s": 24518,
"text": "The array() method of java.nio.ByteBuffer class is used to return the byte array that backs the taken buffer.Modifications to this buffer’s content will cause the ... |
Android - Audio Capture | Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but the most common way is through MediaRecorder class.
Android provides MediaRecorder class to record audio or video. In order to use MediaRecorder class ,you will first create ... | [
{
"code": null,
"e": 3805,
"s": 3607,
"text": "Android has a built in microphone through which you can capture audio and store it , or play it in your phone. There are many ways to do that but the most common way is through MediaRecorder class."
},
{
"code": null,
"e": 3990,
"s": 380... |
Python - Box Plots | Boxplots are a measure of how well distributed the data in a data set is. It divides the data set into three quartiles. This graph represents the minimum, maximum, median, first quartile and third quartile in the data set. It is also useful in comparing the distribution of data across data sets by drawing boxplots for ... | [
{
"code": null,
"e": 2863,
"s": 2529,
"text": "Boxplots are a measure of how well distributed the data in a data set is. It divides the data set into three quartiles. This graph represents the minimum, maximum, median, first quartile and third quartile in the data set. It is also useful in comparing... |
How to resolve CORS issue in C# ASP.NET WebAPI? | Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP request when it requests a resource that has a different origin (do... | [
{
"code": null,
"e": 1421,
"s": 1062,
"text": "Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell browsers to give a web application running at one origin, access to selected resources from a different origin. A web application executes a cross-origin HTTP ... |
Java class Keyword | ❮ Java Keywords
Create a class named "Main":
public class Main {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Try it Yourself »
The class keyword is used to create a class.
Every line of code that runs in Java must be inside a class. A class should always start with an upp... | [
{
"code": null,
"e": 18,
"s": 0,
"text": "\n❮ Java Keywords\n"
},
{
"code": null,
"e": 47,
"s": 18,
"text": "Create a class named \"Main\":"
},
{
"code": null,
"e": 156,
"s": 47,
"text": "public class Main {\n public static void main(String[] args) {\n Sys... |
How to insert a Python object in MySQL? | Assuming that a MySQL database named 'test' is present on the server and a table named employee is also created. Let the table have five fields fname, lname, age, gender, and salary.
Suppose we want to insert a tuple object containing data of a record defined as follows into the Msql database.
t1=('Steven', 'Assange', ... | [
{
"code": null,
"e": 1245,
"s": 1062,
"text": "Assuming that a MySQL database named 'test' is present on the server and a table named employee is also created. Let the table have five fields fname, lname, age, gender, and salary."
},
{
"code": null,
"e": 1357,
"s": 1245,
"text": ... |
SAS - Scatter Plots | A scatterplot is a type of graph which uses values from two variables plotted in a Cartesian plane. It is usually used to find out the relationship between two variables. In SAS we use PROC SGSCATTER to create scatterplots.
Please note that we create the data set named CARS1 in the first example and use the same data s... | [
{
"code": null,
"e": 2807,
"s": 2583,
"text": "A scatterplot is a type of graph which uses values from two variables plotted in a Cartesian plane. It is usually used to find out the relationship between two variables. In SAS we use PROC SGSCATTER to create scatterplots."
},
{
"code": null,
... |
Python - Check if two lists have any element in common | During manipulating data using python lists, we come across a situation where we need to know if two lists are entirely different from each other or they have any element in common. This can be found out by comparing the elements in the two lists with the below approaches decribed.
In a for loop we use the in clause to... | [
{
"code": null,
"e": 1345,
"s": 1062,
"text": "During manipulating data using python lists, we come across a situation where we need to know if two lists are entirely different from each other or they have any element in common. This can be found out by comparing the elements in the two lists with t... |
Building a Collaborative Filtering Recommender System with ClickStream Data | by Susan Li | Towards Data Science | Recommender systems are everywhere, helping you find everything from books to romantic dates, hotels to restaurants.
There are all kinds of recommender systems for all sorts of situations, depends on your needs and available data.
Explicit vs Implicit
Let’s face it, explicit feedback is hard to collect as they require ... | [
{
"code": null,
"e": 289,
"s": 172,
"text": "Recommender systems are everywhere, helping you find everything from books to romantic dates, hotels to restaurants."
},
{
"code": null,
"e": 403,
"s": 289,
"text": "There are all kinds of recommender systems for all sorts of situation... |
Styling in React.js | Styling in React.js can be done in below two ways
css style sheets
inline style
We have App.js file as shown below −
import React, {Component} from 'react';
import './App.css';
class App extends Component {
render(){
return (
<div className="App">
<p className="myColoredText">Styling React... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "Styling in React.js can be done in below two ways"
},
{
"code": null,
"e": 1129,
"s": 1112,
"text": "css style sheets"
},
{
"code": null,
"e": 1142,
"s": 1129,
"text": "inline style"
},
{
"code": null,
... |
AVRO - Serialization By Generating Class | One can read an Avro schema into the program either by generating a class corresponding to a schema or by using the parsers library. This chapter describes how to read the schema by generating a class and Serializing the data using Avr.
To serialize the data using Avro, follow the steps as given below −
Write an Avro s... | [
{
"code": null,
"e": 2098,
"s": 1861,
"text": "One can read an Avro schema into the program either by generating a class corresponding to a schema or by using the parsers library. This chapter describes how to read the schema by generating a class and Serializing the data using Avr."
},
{
"c... |
What are Lvalues and Rvalues in C++? | An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address).
rvalues are defined by exclusion. Every expression is either an lvalue or an rvalue, so, an rvalue is an expression that does not represent an object occupying some identifiable location in memory.
F... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address)."
},
{
"code": null,
"e": 1381,
"s": 1183,
"text": "rvalues are defined by exclusion. Every expression is either ... |
Order-Agnostic Binary Search | 20 Jun, 2022
Order-Agnostic Binary Search is a modified version of Binary Search algorithm. Here in this modified binary search comes with one more condition checking. The intuition behind this algorithm is what if the order of the sorted array is not given. So here check that the value of the first element is greater ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 393,
"s": 52,
"text": "Order-Agnostic Binary Search is a modified version of Binary Search algorithm. Here in this modified binary search comes with one more condition checking. The intuition behin... |
How to find Nth highest salary from a table | 17 Jan, 2022
Finding Nth highest salary in a table is the most common question asked in interviews. Here is a way to do this task using dense_rank() function.
Consider the following table: Employee
Query :
select * from(
select ename, sal, dense_rank()
over(order by sal desc)r from Employee)
where r=&n;
To find... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 201,
"s": 54,
"text": "Finding Nth highest salary in a table is the most common question asked in interviews. Here is a way to do this task using dense_rank() function. "
},
{
"code": null,... |
Ternary number system or Base 3 numbers | 18 Nov, 2021
A number system can be considered as a mathematical notation of numbers using a set of digits or symbols. In simpler words, the number system is a method of representing numbers. Every number system is identified with the help of its base or radix.
For example, Binary, Octal, Decimal and Hexadecimal Numbe... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 304,
"s": 54,
"text": "A number system can be considered as a mathematical notation of numbers using a set of digits or symbols. In simpler words, the number system is a method of representing numb... |
Python String | replace() | 08 Jul, 2022
replace() is an inbuilt function in the Python programming language that returns a copy of the string where all occurrences of a substring are replaced with another substring.
Syntax :
string.replace(old, new, count)
Parameters :
old – old substring you want to replace. new – new substring which would... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 230,
"s": 52,
"text": "replace() is an inbuilt function in the Python programming language that returns a copy of the string where all occurrences of a substring are replaced with another substring... |
Magic Square | The magic square is a square matrix, whose order is odd and where the sum of the elements for each row or each column or each diagonal is same.
The sum of each row or each column or each diagonal can be found using this formula. n(n2+ 1)/2
Here are the rules to construct a magic square −
We will start from the middle ... | [
{
"code": null,
"e": 1332,
"s": 1187,
"text": "The magic square is a square matrix, whose order is odd and where the sum of the elements for each row or each column or each diagonal is same. "
},
{
"code": null,
"e": 1428,
"s": 1332,
"text": "The sum of each row or each column or... |
Recursive Descent Parser | 01 Jun, 2021
Prerequisite – Construction of LL(1) Parsing Table, Classification of top down parsers Parsing is the process to determine whether the start symbol can derive the program or not. If the Parsing is successful then the program is a valid program otherwise the program is invalid. There are generally two types... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 376,
"s": 54,
"text": "Prerequisite – Construction of LL(1) Parsing Table, Classification of top down parsers Parsing is the process to determine whether the start symbol can derive the program or ... |
Angular ng Bootstrap Accordion Component | 06 Jul, 2021
Angular ng bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make responsive websites.
In this article we will know how to use Accordion in angular ng bootstrap. Accordion is used to display collapsible content... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Jul, 2021"
},
{
"code": null,
"e": 212,
"s": 28,
"text": "Angular ng bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make responsive w... |
Scala Map tail() method with example | 13 Aug, 2019
The tail() method is utilized to display all the elements of the map except the first one.
Method Definition: def tail: Map[A, B]
Return Type: It returns all the elements of the stated map except the first one.
Example #1:
// Scala program of tail()// method // Creating objectobject GfG{ // Main met... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Aug, 2019"
},
{
"code": null,
"e": 119,
"s": 28,
"text": "The tail() method is utilized to display all the elements of the map except the first one."
},
{
"code": null,
"e": 158,
"s": 119,
"text": "Method Definiti... |
Check if two numbers are co-prime or not - GeeksforGeeks | 20 Apr, 2021
Two numbers A and B are said to be Co-Prime or mutually prime if the Greatest Common Divisor of them is 1. You have been given two numbers A and B, find if they are Co-prime or not.Examples :
Input : 2 3
Output : Co-Prime
Input : 4 8
Output : Not Co-Prime
C++
Java
Python3
C#
PHP
Javascript
// CPP pr... | [
{
"code": null,
"e": 24871,
"s": 24843,
"text": "\n20 Apr, 2021"
},
{
"code": null,
"e": 25065,
"s": 24871,
"text": "Two numbers A and B are said to be Co-Prime or mutually prime if the Greatest Common Divisor of them is 1. You have been given two numbers A and B, find if they ar... |
\theta - Tex Command | \theta - Used to create lower case Greek theta symbol.
{ \theta}
\theta command draws theta symbol.
\theta
θ
\theta
θ
\theta
14 Lectures
52 mins
Ashraf Said
11 Lectures
1 hours
Ashraf Said
9 Lectures
1 hours
Emenwa Global, Ejike IfeanyiChukwu
29 Lectures
2.5 h... | [
{
"code": null,
"e": 8041,
"s": 7986,
"text": "\\theta - Used to create lower case Greek theta symbol."
},
{
"code": null,
"e": 8051,
"s": 8041,
"text": "{ \\theta}"
},
{
"code": null,
"e": 8086,
"s": 8051,
"text": "\\theta command draws theta symbol."
},
... |
12 Python Tips and Tricks For Writing Better Code | by Pavel Tech | Towards Data Science | F-Strings provide a concise and convenient way to embed Python expressions inside string literals for formatting.
First, let’s define two variables name and age that you want to include in our print statement.
name = "Pavel"age = 23
To not deal with string concatenation or using commas inside the print statement, you c... | [
{
"code": null,
"e": 286,
"s": 172,
"text": "F-Strings provide a concise and convenient way to embed Python expressions inside string literals for formatting."
},
{
"code": null,
"e": 382,
"s": 286,
"text": "First, let’s define two variables name and age that you want to include ... |
Python program to display all second lowest grade student name from nested list | Suppose we have the names and grades for each student in a nested list we have to display the names of any students having the second lowest grade. If there are more than one students with the second lowest grade, reorder these in an alphabetical order and print each name on a new line.
So, if the input is like student... | [
{
"code": null,
"e": 1350,
"s": 1062,
"text": "Suppose we have the names and grades for each student in a nested list we have to display the names of any students having the second lowest grade. If there are more than one students with the second lowest grade, reorder these in an alphabetical order ... |
How can we convert a JSON string to a JSON object in Java? | The JSON stands for JavaScript Object Notation and it can be used to transfer and storage of data. The JSONObject can parse text from a String to produce a map-like object. The object provides methods for manipulating its contents, and for producing a JSON compliant object serialization. The JSONArray can parse text f... | [
{
"code": null,
"e": 1543,
"s": 1062,
"text": "The JSON stands for JavaScript Object Notation and it can be used to transfer and storage of data. The JSONObject can parse text from a String to produce a map-like object. The object provides methods for manipulating its contents, and for producing a ... |
Community detection in social networks using brute-force method - GeeksforGeeks | 05 Sep, 2020
Prerequisite- Python Basics, NetworkX Basics
We are going to divide the nodes of the graph into two or more communities using the brute force method. The brute force method means we will try every division of nodes into communities and check whether the communities are correctly divided or not. We will us... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 24338,
"s": 24292,
"text": "Prerequisite- Python Basics, NetworkX Basics "
},
{
"code": null,
"e": 24637,
"s": 24338,
"text": "We are going to divide the nodes of the grap... |
10 Examples That Will Make You Use Pandas Query Function More Often | by Soner Yıldırım | Towards Data Science | Pandas is a widely-used data analysis and manipulation library. It provides numerous functions and methods to perform typical operations simply and efficiently.
A typical task in data analysis is filtering data points (or observations). In case of working with tabular data, a data point is represented by a row. We some... | [
{
"code": null,
"e": 333,
"s": 172,
"text": "Pandas is a widely-used data analysis and manipulation library. It provides numerous functions and methods to perform typical operations simply and efficiently."
},
{
"code": null,
"e": 561,
"s": 333,
"text": "A typical task in data an... |
How to find contours of an image using scikit-learn in Python? | Scikit-learn, commonly known as sklearn is a library in Python that is used for the purpose of implementing machine learning algorithms. It is an open-source library hence it can be used free of cost. This library is built on Numpy, SciPy and Matplotlib libraries.
The method of ‘marching squares’ is used to find the co... | [
{
"code": null,
"e": 1327,
"s": 1062,
"text": "Scikit-learn, commonly known as sklearn is a library in Python that is used for the purpose of implementing machine learning algorithms. It is an open-source library hence it can be used free of cost. This library is built on Numpy, SciPy and Matplotlib... |
Rust - String | The String data type in Rust can be classified into the following −
String Literal(&str)
String Literal(&str)
String Object(String)
String Object(String)
String literals (&str) are used when the value of a string is known at compile time. String literals are a set of characters, which are hardcoded into a variable. For... | [
{
"code": null,
"e": 2155,
"s": 2087,
"text": "The String data type in Rust can be classified into the following −"
},
{
"code": null,
"e": 2176,
"s": 2155,
"text": "String Literal(&str)"
},
{
"code": null,
"e": 2197,
"s": 2176,
"text": "String Literal(&str)"
... |
Lex program for Decimal to Binary Conversion - GeeksforGeeks | 02 May, 2019
Problem: Write a Lex program for Decimal to Binary conversion.
Explanation:FLEX (Fast Lexical Analyzer Generator) is a tool/computer program for generating lexical analyzers (scanners or lexers) written by Vern Paxson in C around 1987. Lex reads an input stream specifying the lexical analyzer and outputs s... | [
{
"code": null,
"e": 26259,
"s": 26231,
"text": "\n02 May, 2019"
},
{
"code": null,
"e": 26322,
"s": 26259,
"text": "Problem: Write a Lex program for Decimal to Binary conversion."
},
{
"code": null,
"e": 26707,
"s": 26322,
"text": "Explanation:FLEX (Fast Lexi... |
How to resize an image in an HTML 5 canvas ? - GeeksforGeeks | 27 Aug, 2019
The canvas element is part of HTML 5 and it allows the rendering of 2D shapes and bitmap(also called “raster”) images.A canvas actually has two sizes:
the size of the element.
the size of the element’s drawing surface.
The element’s width and height attributes set both the size of the element and the size ... | [
{
"code": null,
"e": 26705,
"s": 26677,
"text": "\n27 Aug, 2019"
},
{
"code": null,
"e": 26856,
"s": 26705,
"text": "The canvas element is part of HTML 5 and it allows the rendering of 2D shapes and bitmap(also called “raster”) images.A canvas actually has two sizes:"
},
{
... |
How to perform string matching in MySQL? | For string matching, use LIKE operator. Let us first create a table −
mysql> create table DemoTable
-> (
-> MonthName varchar(100)
-> );
Query OK, 0 rows affected (0.63 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('JFMA');
Query OK, 1 row affected (0.19 sec)
... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "For string matching, use LIKE operator. Let us first create a table −"
},
{
"code": null,
"e": 1245,
"s": 1132,
"text": "mysql> create table DemoTable\n -> (\n -> MonthName varchar(100)\n -> );\nQuery OK, 0 rows affected (0.63 ... |
How to remove “disabled” attribute from HTML input element using JavaScript ? - GeeksforGeeks | 27 Apr, 2020
The task is to remove the disabled attribute from the input element using JavaScript. There are two approaches that are discussed below.
Approach 1: Select the input element and use disabled property and set its value to false.
Example:<!DOCTYPE html><html> <head> <title> How to remove “disabled... | [
{
"code": null,
"e": 26527,
"s": 26499,
"text": "\n27 Apr, 2020"
},
{
"code": null,
"e": 26664,
"s": 26527,
"text": "The task is to remove the disabled attribute from the input element using JavaScript. There are two approaches that are discussed below."
},
{
"code": null... |
PHP | Decision Making - GeeksforGeeks | 01 Sep, 2021
PHP allows us to perform actions based on some type of conditions that may be logical or comparative. Based on the result of these conditions i.e., either TRUE or FALSE, an action would be performed as asked by the user. It’s just like a two- way path. If you want something then go this way or else turn th... | [
{
"code": null,
"e": 42163,
"s": 42135,
"text": "\n01 Sep, 2021"
},
{
"code": null,
"e": 42549,
"s": 42163,
"text": "PHP allows us to perform actions based on some type of conditions that may be logical or comparative. Based on the result of these conditions i.e., either TRUE or ... |
Bean life cycle in Java Spring - GeeksforGeeks | 02 Sep, 2021
Pre-requisite: Introduction to Spring Framework
The lifecycle of any object means when & how it is born, how it behaves throughout its life, and when & how it dies. Similarly, the bean life cycle refers to when & how the bean is instantiated, what action it performs until it lives, and when & how it is des... | [
{
"code": null,
"e": 25623,
"s": 25595,
"text": "\n02 Sep, 2021"
},
{
"code": null,
"e": 25671,
"s": 25623,
"text": "Pre-requisite: Introduction to Spring Framework"
},
{
"code": null,
"e": 26000,
"s": 25671,
"text": "The lifecycle of any object means when & h... |
Matplotlib - Axes Class - GeeksforGeeks | 27 May, 2020
Matplotlib is one of the Python packages which is used for data visualization. You can use the NumPy library to convert data into an array and numerical mathematics extension of Python. Matplotlib library is used for making 2D plots from data in arrays.
Axes is the most basic and flexible unit for creating... | [
{
"code": null,
"e": 29911,
"s": 29883,
"text": "\n27 May, 2020"
},
{
"code": null,
"e": 30165,
"s": 29911,
"text": "Matplotlib is one of the Python packages which is used for data visualization. You can use the NumPy library to convert data into an array and numerical mathematic... |
Dynamically add elements in ListView in android? | This example demonstrates how do I dynamically add elements in ListView 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.
<RelativeLayout xmlns:android="http://sche... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "This example demonstrates how do I dynamically add elements in ListView in android."
},
{
"code": null,
"e": 1275,
"s": 1146,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required de... |
Excel DAX - Calculated Columns | A calculated column is a column that you add to an existing table in the Data Model of your workbook by means of a DAX formula that defines the column values. Instead of importing the values in the column, you create the calculated column.
You can use the calculated column in a PivotTable, PivotChart, Power PivotTable,... | [
{
"code": null,
"e": 2489,
"s": 2249,
"text": "A calculated column is a column that you add to an existing table in the Data Model of your workbook by means of a DAX formula that defines the column values. Instead of importing the values in the column, you create the calculated column."
},
{
... |
What is the equivalent of EXCEPT in MySQL? | You cannot use EXCEPT in MySQL, instead use the NOT IN operator. Let us first create a table −
mysql> create table DemoTable
(
Number1 int
);
Query OK, 0 rows affected (0.71 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(100);
Query OK, 1 row affected (0.14 sec... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "You cannot use EXCEPT in MySQL, instead use the NOT IN operator. Let us first create a table −"
},
{
"code": null,
"e": 1250,
"s": 1157,
"text": "mysql> create table DemoTable\n (\n Number1 int\n );\nQuery OK, 0 rows affected (... |
C++ Library - <vector> | Vectors are sequence container that can change size. Container is a objects that hold data of same type. Sequence containers store elements strictly in linear sequence.
Vector stores elements in contiguous memory locations and enables direct access to any element using subscript operator []. Unlike array, vector can sh... | [
{
"code": null,
"e": 2772,
"s": 2603,
"text": "Vectors are sequence container that can change size. Container is a objects that hold data of same type. Sequence containers store elements strictly in linear sequence."
},
{
"code": null,
"e": 3013,
"s": 2772,
"text": "Vector stores... |
How to convert an integer to a hexadecimal string in Python? | We can use built in hex() function to convert any integer to its hexadecimal representation.
>>> hex(100)
'0x64'
>>> hex(4095)
'0xfff'
>>> hex(31)
'0x1f' | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "We can use built in hex() function to convert any integer to its hexadecimal representation."
},
{
"code": null,
"e": 1216,
"s": 1155,
"text": ">>> hex(100)\n'0x64'\n>>> hex(4095)\n'0xfff'\n>>> hex(31)\n'0x1f'"
}
] |
Are array members deeply copied? - GeeksforGeeks | 28 May, 2017
In C/C++, we can assign a struct (or class in C++ only) variable to another variable of same type. When we assign a struct variable to another, all members of the variable are copied to the other struct variable. But what happens when the structure contains pointer to dynamically allocated memory and what ... | [
{
"code": null,
"e": 24576,
"s": 24548,
"text": "\n28 May, 2017"
},
{
"code": null,
"e": 24908,
"s": 24576,
"text": "In C/C++, we can assign a struct (or class in C++ only) variable to another variable of same type. When we assign a struct variable to another, all members of the ... |
Ngrep - Network Packet Analyzer for Linux - GeeksforGeeks | 23 Aug, 2021
Ngrep a network packet analyzer that is similar to the grep command, but ngrep grep the package on the network layer. This tool grep the traffic going to coming on the network interface.ngrep allow us to specify an extended regular or hexadecimal expression to match against data payloads of packets.ngrep c... | [
{
"code": null,
"e": 24015,
"s": 23987,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 24423,
"s": 24015,
"text": "Ngrep a network packet analyzer that is similar to the grep command, but ngrep grep the package on the network layer. This tool grep the traffic going to coming on... |
Check if a number can be expressed as product of a prime and a composite number - GeeksforGeeks | 23 Dec, 2021
Given a number N, the task is to check if N can be represented as the product of a prime and a composite number or not. If it can, then print Yes, otherwise No.
Examples:
Input: N = 52 Output: YesExplanation: 52 can be represented as the multiplication of 4 and 13, where 4 is a composite and 13 is a prime ... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 24462,
"s": 24301,
"text": "Given a number N, the task is to check if N can be represented as the product of a prime and a composite number or not. If it can, then print Yes, otherwise No."
... |
Extract numbers from list of strings in Python | While using python for data manipulation, we may come across lists whose elements are a mix of letters and numbers with a fixed pattern. In this article we will see how to separate the numbers form letters which can be used for future calculations.
The split functions splits a string by help of a character that is trea... | [
{
"code": null,
"e": 1311,
"s": 1062,
"text": "While using python for data manipulation, we may come across lists whose elements are a mix of letters and numbers with a fixed pattern. In this article we will see how to separate the numbers form letters which can be used for future calculations."
}... |
How to mute audio using HTML5 ? - GeeksforGeeks | 14 Jul, 2020
In this article, we mute the audio by using the muted attribute in the <audio> tag of the HTML document. It is used to define that the audio should be muted on the webpage.
Syntax:
<audio controls muted>
Example:
<!DOCTYPE html> <html> <head> <title> How to mute an audio using HTML5? </title><... | [
{
"code": null,
"e": 24503,
"s": 24475,
"text": "\n14 Jul, 2020"
},
{
"code": null,
"e": 24676,
"s": 24503,
"text": "In this article, we mute the audio by using the muted attribute in the <audio> tag of the HTML document. It is used to define that the audio should be muted on the... |
Algorithms From Scratch: Naive Bayes Classifier | by Kurtis Pykes | Towards Data Science | The Naive Bayes classifier is an Eager Learning algorithm that belongs to a family of simple probabilistic classifiers based on Bayes’ Theorem.
Although Bayes Theorem — put simply, is a principled way of calculating a conditional probability without the joint probability — assumes each input is dependent upon all other... | [
{
"code": null,
"e": 190,
"s": 46,
"text": "The Naive Bayes classifier is an Eager Learning algorithm that belongs to a family of simple probabilistic classifiers based on Bayes’ Theorem."
},
{
"code": null,
"e": 845,
"s": 190,
"text": "Although Bayes Theorem — put simply, is a p... |
Exclude certain columns from SHOW COLUMNS in MySQL? | Let us first create a demo table
mysql> create table excludeCertainColumnsDemo
-> (
-> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> StudentName varchar(100),
-> StudentAge int,
-> StudentMarks int,
-> StudentAddress varchar(200)
-> );
Query OK, 0 rows affected (0.50 sec)
Now you can check ... | [
{
"code": null,
"e": 1095,
"s": 1062,
"text": "Let us first create a demo table"
},
{
"code": null,
"e": 1364,
"s": 1095,
"text": "mysql> create table excludeCertainColumnsDemo\n -> (\n -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n -> StudentName varchar(100),\n ... |
Flutter - Introduction to State Management Using Riverpod - GeeksforGeeks | 07 Sep, 2021
Riverpod is a Reactive State-Management and Dependency Injection framework, it uses different providers to let us access and listen to state changes across our app, it is built by Remi Rousselet. If you don’t know what is state then I’ll recommend you to read this article first as it will be a little hard ... | [
{
"code": null,
"e": 25116,
"s": 25088,
"text": "\n07 Sep, 2021"
},
{
"code": null,
"e": 25496,
"s": 25116,
"text": "Riverpod is a Reactive State-Management and Dependency Injection framework, it uses different providers to let us access and listen to state changes across our app... |
Cryptocurrency Prediction with LSTM | by Soner Yıldırım | Towards Data Science | Although the first redistributed cryptocurrency (bitcoin) was created in 2009, the idea of digital money arised in 1980s. In the recent years, cryptocurrencies have gained tremendeous popularity. As traditional currencies, the value of cryptocurrencies are changing over time. Using the historical data, I will implement... | [
{
"code": null,
"e": 498,
"s": 47,
"text": "Although the first redistributed cryptocurrency (bitcoin) was created in 2009, the idea of digital money arised in 1980s. In the recent years, cryptocurrencies have gained tremendeous popularity. As traditional currencies, the value of cryptocurrencies are... |
LISP - Macros | Macros allow you to extend the syntax of standard LISP.
Technically, a macro is a function that takes an s-expression as arguments and returns a LISP form, which is then evaluated.
In LISP, a named macro is defined using another macro named defmacro. Syntax for defining a macro is −
(defmacro macro-name (parameter-list... | [
{
"code": null,
"e": 2116,
"s": 2060,
"text": "Macros allow you to extend the syntax of standard LISP."
},
{
"code": null,
"e": 2241,
"s": 2116,
"text": "Technically, a macro is a function that takes an s-expression as arguments and returns a LISP form, which is then evaluated."
... |
C Program for Maximum circular subarray sum - GeeksforGeeks | 21 Dec, 2021
Given n numbers (both +ve and -ve), arranged in a circle, find the maximum sum of consecutive numbers.
Examples:
Input: a[] = {8, -8, 9, -9, 10, -11, 12}
Output: 22 (12 + 8 - 8 + 9 - 9 + 10)
Input: a[] = {10, -3, -4, 7, 6, 5, -4, -1}
Output: 23 (7 + 6 + 5 - 4 -1 + 10)
Input: a[] = {-1, 40, -14, 7, 6... | [
{
"code": null,
"e": 24405,
"s": 24377,
"text": "\n21 Dec, 2021"
},
{
"code": null,
"e": 24509,
"s": 24405,
"text": "Given n numbers (both +ve and -ve), arranged in a circle, find the maximum sum of consecutive numbers. "
},
{
"code": null,
"e": 24520,
"s": 24509,... |
Const cast in C++ | Given the task is to show the working of const_cast in C++.
const_cast is one of the type casting operators. It is used to change the constant value of any object or we can say it is used to remove the constant nature of any object.
const_cast can be used in programs that have any object with some constant value which ... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "Given the task is to show the working of const_cast in C++."
},
{
"code": null,
"e": 1295,
"s": 1122,
"text": "const_cast is one of the type casting operators. It is used to change the constant value of any object or we can say it is... |
Easy Runtime Permissions in Android with Dexter - GeeksforGeeks | 20 Jan, 2021
The runtime permission in Android which introduced in Marshmallow and due to these runtime permissions user can grant permission to the app in runtime, also while writing the code for runtime permissions. Sometimes handling the task of requesting permissions become so difficult and the developer has to wri... | [
{
"code": null,
"e": 25142,
"s": 25114,
"text": "\n20 Jan, 2021"
},
{
"code": null,
"e": 25566,
"s": 25142,
"text": "The runtime permission in Android which introduced in Marshmallow and due to these runtime permissions user can grant permission to the app in runtime, also while ... |
Reshape a pandas DataFrame using stack,unstack and melt method | 08 Jan, 2019
Pandas use various methods to reshape the dataframe and series. Let’s see about the some of that reshaping method.
Let’s import a dataframe first.
# import pandas moduleimport pandas as pd # making dataframedf = pd.read_csv("https://media.geeksforgeeks.org/wp-content/uploads/nba.csv") # it was print the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2019"
},
{
"code": null,
"e": 143,
"s": 28,
"text": "Pandas use various methods to reshape the dataframe and series. Let’s see about the some of that reshaping method."
},
{
"code": null,
"e": 175,
"s": 143,
... |
Python | Pandas MultiIndex.nlevels | 24 Dec, 2018
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas MultiIndex.nlevels attribute returns the integer number of levels in the MultiIndex.
S... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
Generalized Lists in Data Structure | In this section we will see the generalized lists. The generalized list can be defined as below −
A generalized list L is a finite sequence of n elements (n ≥ 0). The element ei is either an atom (single element) or another generalized list. The elements ei that are not atoms, they will be sub-list of L. Suppose L is (... | [
{
"code": null,
"e": 1285,
"s": 1187,
"text": "In this section we will see the generalized lists. The generalized list can be defined as below −"
},
{
"code": null,
"e": 1691,
"s": 1285,
"text": "A generalized list L is a finite sequence of n elements (n ≥ 0). The element ei is e... |
Python Tkinter – Toplevel Widget | 11 Aug, 2021
Tkinter is a GUI toolkit used in python to make user-friendly GUIs.Tkinter is the most commonly used and the most basic GUI framework available in Python. Tkinter uses an object-oriented approach to make GUIs.
Note: For more information, refer to Python GUI – tkinter
A Toplevel widget is used to create a w... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Aug, 2021"
},
{
"code": null,
"e": 263,
"s": 53,
"text": "Tkinter is a GUI toolkit used in python to make user-friendly GUIs.Tkinter is the most commonly used and the most basic GUI framework available in Python. Tkinter uses an obj... |
Python – Sum of tuple elements | 19 Feb, 2020
Sometimes, while programming, we have a problem in which we might need to perform summation among tuple elements. This is an essential utility as we come across summation operation many times and tuples are immutable and hence required to be dealt with. Let’s discuss certain ways in which this task can be ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 370,
"s": 52,
"text": "Sometimes, while programming, we have a problem in which we might need to perform summation among tuple elements. This is an essential utility as we come across summation ope... |
Finding Exploit offline using Searchsploit in Kali Linux | 24 Dec, 2020
SearchSploit is a command-line search tool for Exploit-DB that allows you to take a copy of the Exploit Database with you. Searchsploit is included in the Exploit Database repository on GitHub. SearchSploit is very useful for security assessments when you don’t have Internet access because it gives you the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Dec, 2020"
},
{
"code": null,
"e": 417,
"s": 28,
"text": "SearchSploit is a command-line search tool for Exploit-DB that allows you to take a copy of the Exploit Database with you. Searchsploit is included in the Exploit Database rep... |
Python Program for Depth First Search or DFS for a Graph | 22 Jun, 2022
Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, unlike trees, graphs may contain cycles, so we may come to the same node again. To avoid processing a node more than once, we use a boolean visited array.
For example, in the following graph... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 300,
"s": 28,
"text": "Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, unlike trees, graphs may contain cycles, so we may come to... |
<utility> in C++ | 03 Aug, 2021
It is a header file that contains utilities in unrelated domains.
Pairs: These are the objects which can hold two different types of values.
Generic Relational Approach: It is used for the relational operators !=, >, = under a specific namespace: rel_ops.
Generic swap function: This a standard definitio... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 95,
"s": 28,
"text": "It is a header file that contains utilities in unrelated domains. "
},
{
"code": null,
"e": 171,
"s": 95,
"text": "Pairs: These are the objects which can ho... |
Python | Check if a Substring is Present in a Given String | 24 Jun, 2022
In this article, we will cover how to check if a Python string contains another string or a substring in Python.
Given two strings, check if a substring is there in the given string or not.
Example 1: Input : Substring = "geeks"
String="geeks for geeks"
Output : yes
Example 2: Input : Substri... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 167,
"s": 53,
"text": "In this article, we will cover how to check if a Python string contains another string or a substring in Python. "
},
{
"code": null,
"e": 245,
"s": 167,
... |
PHP | unlink() Function | 23 Nov, 2020
The unlink() function is an inbuilt function in PHP which is used to delete files. It is similar to UNIX unlink() function. The $filename is sent as a parameter that needs to be deleted and the function returns True on success and false on failure.
Syntax:
unlink( $filename, $context )
Parameters: This fu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Nov, 2020"
},
{
"code": null,
"e": 277,
"s": 28,
"text": "The unlink() function is an inbuilt function in PHP which is used to delete files. It is similar to UNIX unlink() function. The $filename is sent as a parameter that needs to ... |
Java Examples - Producer Consumer Problem | How to solve the producer consumer problem using thread?
Following example demonstrates how to solve the producer consumer problem using thread.
public class ProducerConsumerTest {
public static void main(String[] args) {
CubbyHole c = new CubbyHole();
Producer p1 = new Producer(c, 1);
Consumer c1 ... | [
{
"code": null,
"e": 2259,
"s": 2202,
"text": "How to solve the producer consumer problem using thread?"
},
{
"code": null,
"e": 2347,
"s": 2259,
"text": "Following example demonstrates how to solve the producer consumer problem using thread."
},
{
"code": null,
"e": ... |
Cisco Router modes | 09 Nov, 2021
A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP address and the entry in the routing table. By using a routing table, it finds an optimized path between the source and destination network.
Let’... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 355,
"s": 52,
"text": "A router is a layer 3 device used to forward packets from one network to another. It forwards the packet through one of its ports on the basis of destination IP address and t... |
Program for Stair Case Patterns | 23 Nov, 2021
Programs to print following pattern.Examples:
Input : 6
Output :
* *
* *
* * * *
* * * *
* * * * * *
* * * * * *
C++
Java
Python3
C#
PHP
Javascript
// CPP program to print stair case pattern.#include <iostream> using namespace std; // Function definitionvoid pattern(int n){ // for loop for rows for ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Nov, 2021"
},
{
"code": null,
"e": 75,
"s": 28,
"text": "Programs to print following pattern.Examples: "
},
{
"code": null,
"e": 142,
"s": 75,
"text": "Input : 6\nOutput :\n* *\n* *\n* * * *\n* * * *\n* * * * * *\... |
RC5 Encryption Algorithm | 09 Aug, 2019
RC5 is a symmetric key block encryption algorithm designed by Ron Rivest in 1994. It is notable for being simple, fast (on account of using only primitive computer operations like XOR, shift, etc.) and consumes less memory.
Example:
Key : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Plain Text : 0000000... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Aug, 2019"
},
{
"code": null,
"e": 276,
"s": 52,
"text": "RC5 is a symmetric key block encryption algorithm designed by Ron Rivest in 1994. It is notable for being simple, fast (on account of using only primitive computer operations... |
Deep Search JSON Object JavaScript | Suppose we have the following nested JSON object −
const obj = {
id: 1,
title: 'hello world',
child: {
id: null,
title: 'foobar',
child: {
id: null,
title: 'i should be in results array '
}
},
foo: {
id: null,
title: 'i should be in results array too!... | [
{
"code": null,
"e": 1113,
"s": 1062,
"text": "Suppose we have the following nested JSON object −"
},
{
"code": null,
"e": 1517,
"s": 1113,
"text": "const obj = {\n id: 1,\n title: 'hello world',\n child: {\n id: null,\n title: 'foobar',\n child: {\n ... |
Convert.ToString Method in C# | Convert the specified value to its equivalent string using the ToString() method.
Initialize a bool value.
bool boolVal = false;
Now, to convert it to a string, use the ToString() method.
Convert.ToString(boolVal)
The following is the complete example.
Live Demo
using System;
public class Demo {
public static void ... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "Convert the specified value to its equivalent string using the ToString() method."
},
{
"code": null,
"e": 1169,
"s": 1144,
"text": "Initialize a bool value."
},
{
"code": null,
"e": 1191,
"s": 1169,
"text": "bool... |
Batch Script - REM | This batch command is used for remarks in batch files, preventing the content of the remark from being executed.
REM remark description
@echo off
REM This is a batch file
None
Print
Add Notes
Bookmark this page | [
{
"code": null,
"e": 2282,
"s": 2169,
"text": "This batch command is used for remarks in batch files, preventing the content of the remark from being executed."
},
{
"code": null,
"e": 2306,
"s": 2282,
"text": "REM remark description\n"
},
{
"code": null,
"e": 2342,
... |
Creating an Email Parser with Python and SQL | by Benjamin Dornel | Towards Data Science | You might be wondering what an email parser is, and why you might need one.
In short, an email parser is a software that looks for and extracts data from inbound emails and attachments. More importantly, an email parser uses conditional processing to pull the specific data that matters to you.
So why does this matter? ... | [
{
"code": null,
"e": 247,
"s": 171,
"text": "You might be wondering what an email parser is, and why you might need one."
},
{
"code": null,
"e": 466,
"s": 247,
"text": "In short, an email parser is a software that looks for and extracts data from inbound emails and attachments. ... |
java.time.LocalDateTime.ofInstant() Method Example | The java.time.LocalDateTime.ofInstant(Instant instant, ZoneId zone) method obtains an instance of LocalDateTime from an Instant and zone ID.
Following is the declaration for java.time.LocalDateTime.ofInstant(Instant instant, ZoneId zone) method.
public static LocalDateTime ofInstant(Instant instant, ZoneId zone)
insta... | [
{
"code": null,
"e": 2056,
"s": 1915,
"text": "The java.time.LocalDateTime.ofInstant(Instant instant, ZoneId zone) method obtains an instance of LocalDateTime from an Instant and zone ID."
},
{
"code": null,
"e": 2161,
"s": 2056,
"text": "Following is the declaration for java.tim... |
Count number of trees in a forest in C++ | Given vertices of a forest ( collection of trees). The goal is to find the number of trees in that forest. We will do this by running a DFS (depth first search) algorithm on the forest.
For Example
edges = { { 1,3 }, {2,8}, {2,6}, {3,5}, {3,7}, {4,8} }
Count of number of trees in a forest are: 3
The number of trees tha... | [
{
"code": null,
"e": 1248,
"s": 1062,
"text": "Given vertices of a forest ( collection of trees). The goal is to find the number of trees in that forest. We will do this by running a DFS (depth first search) algorithm on the forest."
},
{
"code": null,
"e": 1260,
"s": 1248,
"text... |
Python - How to read config.ini files - onlinetutorialspoint | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorial, we are going to see how to ... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
Creating a solid Data Science development environment | by Gabriel dos Santos Gonçalves | Towards Data Science | Starting a Data Science project is usually fun, at least in the beginning. You get some data, start asking questions and exploring it, make some plots, try some models and after a few minutes, you have a bunch of interesting and chaotic insights and more data wrangling to do. Then you realize you have to organize your ... | [
{
"code": null,
"e": 846,
"s": 172,
"text": "Starting a Data Science project is usually fun, at least in the beginning. You get some data, start asking questions and exploring it, make some plots, try some models and after a few minutes, you have a bunch of interesting and chaotic insights and more ... |
Divide HuggingFace training time by 2 | Towards Data Science | update 06/04/2020: following a suggestion, experiments performed on large flavor of CamemBERT have been added to the report. TL;DR: training times have been reduced from 4h to 1h30.
I work at Lefebvre Sarrut, a publishing company which is a major player in the European legal industry. As explained in precedent articles... | [
{
"code": null,
"e": 354,
"s": 172,
"text": "update 06/04/2020: following a suggestion, experiments performed on large flavor of CamemBERT have been added to the report. TL;DR: training times have been reduced from 4h to 1h30."
},
{
"code": null,
"e": 714,
"s": 354,
"text": "I wo... |
Wiggle Sort in C++ | Suppose we have an unsorted array called nums, we have to reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... and so on.
So, if the input is like nums = [3,5,2,1,6,4], then the output will be [3,5,1,6,2,4], there may be some other answers.
To solve this, we will follow these steps −
n := size of ... | [
{
"code": null,
"e": 1206,
"s": 1062,
"text": "Suppose we have an unsorted array called nums, we have to reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... and so on."
},
{
"code": null,
"e": 1325,
"s": 1206,
"text": "So, if the input is like nums = [3,5,2... |
Count smaller values whose XOR with x is greater than x - GeeksforGeeks | 06 May, 2021
Given a integer ‘x’, find the number of values of ‘a’ satisfying the following conditions:
a XOR x > x0 < a < x
a XOR x > x
0 < a < x
Examples :
Input : x = 10
Output : 5
Explanation: For x = 10, following 5 values
of 'a' satisfy the conditions:
1 XOR 10 = 11
4 XOR... | [
{
"code": null,
"e": 25084,
"s": 25056,
"text": "\n06 May, 2021"
},
{
"code": null,
"e": 25176,
"s": 25084,
"text": "Given a integer ‘x’, find the number of values of ‘a’ satisfying the following conditions: "
},
{
"code": null,
"e": 25197,
"s": 25176,
"text":... |
HTML - Image Links | We have seen how to create hypertext link using text and we also learnt how to use images in our webpages. Now, we will learn how to use images to create hyperlinks.
It's simple to use an image as hyperlink. We just need to use an image inside hyperlink at the place of text as shown below −
<!DOCTYPE html>
<html>
<... | [
{
"code": null,
"e": 2540,
"s": 2374,
"text": "We have seen how to create hypertext link using text and we also learnt how to use images in our webpages. Now, we will learn how to use images to create hyperlinks."
},
{
"code": null,
"e": 2666,
"s": 2540,
"text": "It's simple to u... |
C++ Program to Implement Treap | This is a C++ program to implement Treap. Treap data structure is basically a randomized binary search tree. Here, we shall consider insert, delete and search operations on this.
function insetNod() to insert a given key into treap with priority recursively −
If root = nullptr
return data as root.
If given data is l... | [
{
"code": null,
"e": 1241,
"s": 1062,
"text": "This is a C++ program to implement Treap. Treap data structure is basically a randomized binary search tree. Here, we shall consider insert, delete and search operations on this."
},
{
"code": null,
"e": 1322,
"s": 1241,
"text": "fun... |
Fortran - Do Loop Construct | The do loop construct enables a statement, or a series of statements, to be carried out iteratively, while a given condition is true.
The general form of the do loop is −
do var = start, stop [,step]
! statement(s)
...
end do
Where,
the loop variable var should be an integer
the loop variable var should be a... | [
{
"code": null,
"e": 2280,
"s": 2146,
"text": "The do loop construct enables a statement, or a series of statements, to be carried out iteratively, while a given condition is true."
},
{
"code": null,
"e": 2317,
"s": 2280,
"text": "The general form of the do loop is −"
},
{
... |
8085 program to convert an 8 bit BCD number into hexadecimal number - GeeksforGeeks | 28 Aug, 2019
Problem – Write an assembly language program in 8085 microprocessor to convert an 8 bit BCD number into hexadecimal number.
Assumptions – Assume that starting address of the program is 2000, input memory locations, 2050, 2051, and output memory location is 2052.
Example –
INPUT: 2050:02H
2051: 09H
... | [
{
"code": null,
"e": 24840,
"s": 24812,
"text": "\n28 Aug, 2019"
},
{
"code": null,
"e": 24964,
"s": 24840,
"text": "Problem – Write an assembly language program in 8085 microprocessor to convert an 8 bit BCD number into hexadecimal number."
},
{
"code": null,
"e": 25... |
Python | Check for ASCII string - GeeksforGeeks | 25 Jun, 2019
Many times it is desirable to work with the strings that only contain alphabets and the other special characters are undesirable and sometimes this very task becomes the point to filter the strings and hence requires the way to check if a string is whole ASCII. Let’s discuss certain ways in which this task... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n25 Jun, 2019"
},
{
"code": null,
"e": 24618,
"s": 24292,
"text": "Many times it is desirable to work with the strings that only contain alphabets and the other special characters are undesirable and sometimes this very task becom... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.