title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Ruby - Environment Setup | If you are still willing to set up your environment for Ruby programming language, then let's proceed. This tutorial will teach you all the important topics related to environment setup. We would recommend you to go through the following topics first and then proceed further −
Ruby Installation on Linux/Unix − If you a... | [
{
"code": null,
"e": 2572,
"s": 2294,
"text": "If you are still willing to set up your environment for Ruby programming language, then let's proceed. This tutorial will teach you all the important topics related to environment setup. We would recommend you to go through the following topics first an... |
8085 program to access and exchange the content of Flag register with register B - GeeksforGeeks | 17 Jan, 2022
Problem – Write an assembly language program in 8085 microprocessor to access Flag register and exchange the content of flag register F with register B.
Example –
Assumptions – Initial values of flag register, register B and stack pointer are is 00, 3F, and 3FFF respectively.
PSW stands for PROGRAM ST... | [
{
"code": null,
"e": 24700,
"s": 24672,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 24854,
"s": 24700,
"text": "Problem – Write an assembly language program in 8085 microprocessor to access Flag register and exchange the content of flag register F with register B. "
},
{... |
Minimum number of chairs required to ensure that every worker is seated at any instant - GeeksforGeeks | 22 Apr, 2021
Given a string S representing the record of workers entering and leaving the rest area, where E represents entering and L represents leaving the rest area. For each worker, one chair is required. The task is to find the minimum number of chairs required so that there is no shortage of chairs at any given t... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n22 Apr, 2021"
},
{
"code": null,
"e": 24613,
"s": 24301,
"text": "Given a string S representing the record of workers entering and leaving the rest area, where E represents entering and L represents leaving the rest area. For eac... |
Optimizing Your Python Code. Essential tips for working with large... | by Anna Astori | Towards Data Science | While you will only occasionally get to the point where you need to run a profiler to analyze your code and find bottlenecks, it’s definitely a good idea to get into the habit of writing efficient code and spotting the places where you can improve right away.
An important thing to keep in mind when looking for ways to ... | [
{
"code": null,
"e": 432,
"s": 172,
"text": "While you will only occasionally get to the point where you need to run a profiler to analyze your code and find bottlenecks, it’s definitely a good idea to get into the habit of writing efficient code and spotting the places where you can improve right a... |
How to find a file using Python? | To find a file within a directory using python, you can walk the directory tree using os.walk and find the file as follows −
import os
def find_file(file_name, directory_name):
files_found = []
for path, subdirs, files in os.walk(directory_name):
for name in files:
if(file_name == name):
... | [
{
"code": null,
"e": 1187,
"s": 1062,
"text": "To find a file within a directory using python, you can walk the directory tree using os.walk and find the file as follows −"
},
{
"code": null,
"e": 1538,
"s": 1187,
"text": "import os\ndef find_file(file_name, directory_name):\n ... |
Multi-Class Text Classification with Doc2Vec & Logistic Regression | by Susan Li | Towards Data Science | Doc2vec is an NLP tool for representing documents as a vector and is a generalizing of the word2vec method.
In order to understand doc2vec, it is advisable to understand word2vec approach. However, the complete mathematical details is out of scope of this article. If you are new to word2vec and doc2vec, the following r... | [
{
"code": null,
"e": 280,
"s": 172,
"text": "Doc2vec is an NLP tool for representing documents as a vector and is a generalizing of the word2vec method."
},
{
"code": null,
"e": 528,
"s": 280,
"text": "In order to understand doc2vec, it is advisable to understand word2vec approac... |
Python Slicing | Extract ‘k’ bits from a given position - GeeksforGeeks | 12 Sep, 2018
How to extract ‘k’ bits from a given position ‘p’ in a number?
Examples:
Input : number = 171
k = 5
p = 2
Output : The extracted number is 21
171 is represented as 10101011 in binary,
so, you should get only 10101 i.e. 21.
Input : number = 72
k = 5
p = 1... | [
{
"code": null,
"e": 24597,
"s": 24569,
"text": "\n12 Sep, 2018"
},
{
"code": null,
"e": 24660,
"s": 24597,
"text": "How to extract ‘k’ bits from a given position ‘p’ in a number?"
},
{
"code": null,
"e": 24670,
"s": 24660,
"text": "Examples:"
},
{
"co... |
Java - Encapsulation | Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction.
Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from... | [
{
"code": null,
"e": 2500,
"s": 2377,
"text": "Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction."
},
{
"code": null,
"e": 2826,
"s": 2500,
"text": "Encapsulation in Java is a mechanism of wrapping the data (... |
Minimum operation to make all elements equal in array in C++ | Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition, multiplication, subtraction or division with any element on an array element.
If input array is = {1, 2, 3, 4} then we require minimum 3 operations to make all elements equal. Fo... | [
{
"code": null,
"e": 1282,
"s": 1062,
"text": "Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition, multiplication, subtraction or division with any element on an array element."
},
{
"code": null,
"... |
Convert datetime string to YYYY-MM-DD-HH:MM:SS format in Python - GeeksforGeeks | 23 Aug, 2021
In this article, we are going to convert the DateTime string into the %Y-%m-%d-%H:%M:%S format. For this task strptime() and strftime() function is used.
strptime() is used to convert the DateTime string to DateTime in the format of year-month-day hours minutes and seconds
Syntax:
datetime.strptime(my_dat... | [
{
"code": null,
"e": 24121,
"s": 24093,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 24276,
"s": 24121,
"text": "In this article, we are going to convert the DateTime string into the %Y-%m-%d-%H:%M:%S format. For this task strptime() and strftime() function is used."
},
... |
Implement Stack using Queues in C++ | Suppose we want to implement one stack using a queue. We have to define these methods for the stack.
push(x) − Push x onto stack.
push(x) − Push x onto stack.
pop() − Delete and return top element from stack
pop() − Delete and return top element from stack
top() − Return the top element from stack.
top() − Return the t... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "Suppose we want to implement one stack using a queue. We have to define these methods for the stack."
},
{
"code": null,
"e": 1192,
"s": 1163,
"text": "push(x) − Push x onto stack."
},
{
"code": null,
"e": 1221,
"s": ... |
How to invert an object in JavaScript? | Inverting an object is one of the difficult tasks until underscore.js, a javascript framework, came into light. It has many functions in which _.invert() is one of them. This method actually inverts the key/value pairs. For suppose let an object has a key/value like name/Kiran. Then after inverting the object using _.i... | [
{
"code": null,
"e": 1490,
"s": 1062,
"text": "Inverting an object is one of the difficult tasks until underscore.js, a javascript framework, came into light. It has many functions in which _.invert() is one of them. This method actually inverts the key/value pairs. For suppose let an object has a k... |
How to get a fuller picture of a model’s accuracy | by Allison Stafford | Towards Data Science | Using a single train-test split gives you a single snapshot of the performance of a machine learning model or algorithm. It’s like evaluating a football team (American or otherwise) based on a single game. If you really want to know how well a team performs in general, you’re going to want more than just this snapshot.... | [
{
"code": null,
"e": 634,
"s": 172,
"text": "Using a single train-test split gives you a single snapshot of the performance of a machine learning model or algorithm. It’s like evaluating a football team (American or otherwise) based on a single game. If you really want to know how well a team perfor... |
Perl | sort() Function - GeeksforGeeks | 07 May, 2019
sort() function in Perl is used to sort a list with or without the use of method of sorting. This method can be specified by the user in the form of subroutines or blocks. If a subroutine or block is not specified then it will follow the default method of sorting.
Syntax:sort Listsort block, Listsort Subro... | [
{
"code": null,
"e": 23990,
"s": 23962,
"text": "\n07 May, 2019"
},
{
"code": null,
"e": 24255,
"s": 23990,
"text": "sort() function in Perl is used to sort a list with or without the use of method of sorting. This method can be specified by the user in the form of subroutines or... |
Dot Product of Vectors in R Programming - GeeksforGeeks | 25 Aug, 2020
In mathematics, the dot product or also known as the scalar product is an algebraic operation that takes two equal-length sequences of numbers and returns a single number. Let us given two vectors A and B, and we have to find the dot product of two vectors.
Given that,
and,
where,
i: the unit vector along... | [
{
"code": null,
"e": 26161,
"s": 26133,
"text": "\n25 Aug, 2020"
},
{
"code": null,
"e": 26419,
"s": 26161,
"text": "In mathematics, the dot product or also known as the scalar product is an algebraic operation that takes two equal-length sequences of numbers and returns a single... |
Explain the Mat class in Java OpenCV library | In OpenCV, images are stored in Using Mat object. It is nothing but an n-dimensional array and is used to store image data of grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms, etc.
If you try to read an image using the OpenCV library it will be read to a Mat object.
Mat matrix ... | [
{
"code": null,
"e": 1285,
"s": 1062,
"text": "In OpenCV, images are stored in Using Mat object. It is nothing but an n-dimensional array and is used to store image data of grayscale or color images, voxel volumes, vector fields, point clouds, tensors, histograms, etc."
},
{
"code": null,
... |
Floyd's triangle | Practice | GeeksforGeeks | Given a number N. The task is to print Floyd's triangle with N lines.
Example 1:
Input:
N = 4
Output:
1
2 3
4 5 6
7 8 9 10
Explanation:
For N = 4 there are 4 rows in the output
and the number of elements increases
with an increase in the row.
Example 1:
Input:
N = 5
Output:
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
Ex... | [
{
"code": null,
"e": 308,
"s": 238,
"text": "Given a number N. The task is to print Floyd's triangle with N lines."
},
{
"code": null,
"e": 319,
"s": 308,
"text": "Example 1:"
},
{
"code": null,
"e": 484,
"s": 319,
"text": "Input:\nN = 4\n\nOutput:\n1\n2 3\n4 ... |
Git- Setting up a Repository - GeeksforGeeks | 05 Nov, 2019
What is Repository?In simple terms, it is the central location in which data is stored or managed. A git repository virtually stores a particular file and allows you to save and access it’s version.
Initializing a RepositoryTo create a new repository the git init command is used. It is used to convert an e... | [
{
"code": null,
"e": 24019,
"s": 23991,
"text": "\n05 Nov, 2019"
},
{
"code": null,
"e": 24218,
"s": 24019,
"text": "What is Repository?In simple terms, it is the central location in which data is stored or managed. A git repository virtually stores a particular file and allows y... |
R - Functions | A function is a set of statements organized together to perform a specific task. R has a large number of in-built functions and the user can create their own functions.
In R, a function is an object so the R interpreter is able to pass control to the function, along with arguments that may be necessary for the function... | [
{
"code": null,
"e": 2571,
"s": 2402,
"text": "A function is a set of statements organized together to perform a specific task. R has a large number of in-built functions and the user can create their own functions."
},
{
"code": null,
"e": 2750,
"s": 2571,
"text": "In R, a funct... |
String Matching: Surpass Excel VLOOKUP with Python & NLP | by Mauro Di Pietro | Towards Data Science | Do you wanna match two sets of strings similar but not equal? Excel VLOOKUP won’t help you with that, but fear not, I got you covered! In this article, using Python and NLP, I will explain how to create and use your own string matching web application.
Matching different registries together, populated by several people... | [
{
"code": null,
"e": 425,
"s": 172,
"text": "Do you wanna match two sets of strings similar but not equal? Excel VLOOKUP won’t help you with that, but fear not, I got you covered! In this article, using Python and NLP, I will explain how to create and use your own string matching web application."
... |
What are the differences between a JTextField and a JFormattedTextField in Java? | A JTextField can be used for plain text whereas a JFormattedTextField is a class that can extend JTextField and it can be used to set any format to the text that it contains phone numbers, e-mails, dates and etc.
A JTextFeld is one of the most important components that allow the user to type an input text value in a si... | [
{
"code": null,
"e": 1275,
"s": 1062,
"text": "A JTextField can be used for plain text whereas a JFormattedTextField is a class that can extend JTextField and it can be used to set any format to the text that it contains phone numbers, e-mails, dates and etc."
},
{
"code": null,
"e": 140... |
Swing Examples - Creating Toggle Button | A Toggle Button is a two state button. It is either pressed or not pressed. Following example showcase how to modify the default appearance of a Button in a Java Swing application.
We are using the following APIs.
JToggleButton() − To create a toggle button.
JToggleButton() − To create a toggle button.
JToggleButton.is... | [
{
"code": null,
"e": 2220,
"s": 2039,
"text": "A Toggle Button is a two state button. It is either pressed or not pressed. Following example showcase how to modify the default appearance of a Button in a Java Swing application."
},
{
"code": null,
"e": 2253,
"s": 2220,
"text": "W... |
BabylonJS - Materials | Materials are like clothes for the objects. You can add color, texture and wrap your meshes with it. You can use the same material to cover many meshes. Meshes can be the scene which we just saw in the example in the previous for chapter - the plane passing through the sky.
In this chapter, we will learn how to add col... | [
{
"code": null,
"e": 2458,
"s": 2183,
"text": "Materials are like clothes for the objects. You can add color, texture and wrap your meshes with it. You can use the same material to cover many meshes. Meshes can be the scene which we just saw in the example in the previous for chapter - the plane pas... |
Docker - Public Repositories | Public repositories can be used to host Docker images which can be used by everyone else. An example is the images which are available in Docker Hub. Most of the images such as Centos, Ubuntu, and Jenkins are all publicly available for all. We can also make our images available by publishing it to the public repository... | [
{
"code": null,
"e": 2676,
"s": 2340,
"text": "Public repositories can be used to host Docker images which can be used by everyone else. An example is the images which are available in Docker Hub. Most of the images such as Centos, Ubuntu, and Jenkins are all publicly available for all. We can also ... |
Write a C program to reduce any fraction to least terms using while loop | Reducing the fraction to the lowest terms means that there is no number, except 1, that can be divided evenly into both the numerator and the denominator.
For example, 24/4 is a fraction, the lowest term for this fraction is 6, or 12/16 is a fraction the lowest term is 3/4.
Now let’s write a c program to reduce the fra... | [
{
"code": null,
"e": 1217,
"s": 1062,
"text": "Reducing the fraction to the lowest terms means that there is no number, except 1, that can be divided evenly into both the numerator and the denominator."
},
{
"code": null,
"e": 1337,
"s": 1217,
"text": "For example, 24/4 is a frac... |
SAP ABAP - Exception Handling | An exception is a problem that arises during the execution of a program. When an exception occurs the normal flow of the program is disrupted and the program application terminates abnormally, which is not recommended, therefore these exceptions are to be handled.
Exceptions provide a way to transfer control from one p... | [
{
"code": null,
"e": 3163,
"s": 2898,
"text": "An exception is a problem that arises during the execution of a program. When an exception occurs the normal flow of the program is disrupted and the program application terminates abnormally, which is not recommended, therefore these exceptions are to ... |
Object Oriented Python - Advanced Features | In this we will look into some of the advanced features which Python provide
In this we will look onto, how Python allows us to take advantage of operators in our classes. Python is largely objects and methods call on objects and this even goes on even when its hidden by some convenient syntax.
>>> var1 = 'Hello'
>>> v... | [
{
"code": null,
"e": 1887,
"s": 1810,
"text": "In this we will look into some of the advanced features which Python provide"
},
{
"code": null,
"e": 2106,
"s": 1887,
"text": "In this we will look onto, how Python allows us to take advantage of operators in our classes. Python is ... |
Bitwise AND and OR in Arduino | Bitwise AND/ OR means AND/ OR performed at a bit-level, individually. Each number has its binary representation. When you perform the bitwise AND of one number with another, the AND operation is performed on the corresponding bits of the two numbers. Thus, LSB of number 1 is ANDed with the LSB of number 2, and so on.
T... | [
{
"code": null,
"e": 1381,
"s": 1062,
"text": "Bitwise AND/ OR means AND/ OR performed at a bit-level, individually. Each number has its binary representation. When you perform the bitwise AND of one number with another, the AND operation is performed on the corresponding bits of the two numbers. Th... |
How to Extract Time from Datetime in R ? | 30 Jun, 2021
In this article, we are going to extract time from Datetime in R programming language using lubridate() function and format() function.
Note: datetime is in the format of time and date (YYYY/MM/DD HH:MM:SS) i.e. Year:month:day Hours:Minute:Seconds
Where,
Year:month:day comes under date
Hours:Minute:Seconds... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 164,
"s": 28,
"text": "In this article, we are going to extract time from Datetime in R programming language using lubridate() function and format() function."
},
{
"code": null,
"e": 27... |
CSS Borders | 21 Feb, 2022
CSS border properties allow us to set the style, color, and width of the border. Note: Different properties can be set for all the different borders i.e.top border, right border, bottom border, and left border. Properties of CSS Borders:
1. Border Style
CSS border-top style Property
border-right-style Pr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Feb, 2022"
},
{
"code": null,
"e": 292,
"s": 52,
"text": "CSS border properties allow us to set the style, color, and width of the border. Note: Different properties can be set for all the different borders i.e.top border, right bor... |
Program for First Fit algorithm in Memory Management | 13 Jun, 2022
Prerequisite : Partition Allocation MethodsIn the first fit, the partition is allocated which is first sufficient from the top of Main Memory.Example :
Input : blockSize[] = {100, 500, 200, 300, 600};
processSize[] = {212, 417, 112, 426};
Output:
Process No. Process Size Block no.
1 ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 205,
"s": 52,
"text": "Prerequisite : Partition Allocation MethodsIn the first fit, the partition is allocated which is first sufficient from the top of Main Memory.Example : "
},
{
"code":... |
Overloading Subscript or array index operator [] in C++ | 28 Jun, 2021
The Subscript or Array Index Operator is denoted by ‘[]’. This operator is generally used with arrays to retrieve and manipulate the array elements.This is a binary or n-ary operator and is represented in two parts:
postfix/primary expressionexpression
postfix/primary expression
expression
The postfix expr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 268,
"s": 52,
"text": "The Subscript or Array Index Operator is denoted by ‘[]’. This operator is generally used with arrays to retrieve and manipulate the array elements.This is a binary or n-ary ... |
Run Length Encoding in Python | 31 Mar, 2020
Given an input string, write a function that returns the Run Length Encoded string for the input string.
For example, if the input string is ‘wwwwaaadexxxxxx’, then the function should return ‘w4a3d1e1x6’.
Examples:
Input : str = 'wwwwaaadexxxxxx'
Output : 'w4a3d1e1x6'
This problem has existing solution... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Mar, 2020"
},
{
"code": null,
"e": 159,
"s": 54,
"text": "Given an input string, write a function that returns the Run Length Encoded string for the input string."
},
{
"code": null,
"e": 260,
"s": 159,
"text": "... |
Python String – removeprefix() function | 12 Nov, 2020
In this article we will use str.removeprefix(prefix, /) function which removes the prefix and returns the rest of the string. If the prefix string is not found then it returns the original string. It is introduced in Python 3.9.0 version.
Syntax:
str.removeprefix(prefix, /)
Parameters:
suffix- prefix stri... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Nov, 2020"
},
{
"code": null,
"e": 267,
"s": 28,
"text": "In this article we will use str.removeprefix(prefix, /) function which removes the prefix and returns the rest of the string. If the prefix string is not found then it returns... |
Percentage increase in volume of the sphere if radius is increased by a given percentage | 27 Mar, 2022
Given here is a sphere, whose radius is increased by a given percentage. The task is to find the percentage increase in the volume of the sphere.Examples:
Input: x = 10
Output: 33.1%
Input: x = 50
Output: 237.5%
Approach:
Let, the radius of the sphere = a
given percentage increase = x%
volume before i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Mar, 2022"
},
{
"code": null,
"e": 185,
"s": 28,
"text": "Given here is a sphere, whose radius is increased by a given percentage. The task is to find the percentage increase in the volume of the sphere.Examples: "
},
{
"cod... |
Working with UDP DatagramSockets in Java | 04 Jan, 2022
DatagramSockets are Java’s mechanism for network communication via UDP instead of TCP. Java provides DatagramSocket to communicate over UDP instead of TCP. It is also built on top of IP. DatagramSockets can be used to both send and receive packets over the Internet.
One of the examples where UDP is preferr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Jan, 2022"
},
{
"code": null,
"e": 319,
"s": 52,
"text": "DatagramSockets are Java’s mechanism for network communication via UDP instead of TCP. Java provides DatagramSocket to communicate over UDP instead of TCP. It is also built o... |
Largest Square in a Binary Matrix with at most K 1s for multiple Queries | 26 Aug, 2021
Given a binary matrix M where each element of the matrix will be 0 or 1, the task is to find the largest square that can be formed with center (i, j) and contains atmost K 1’s.
Input: M[][] = { {1, 0, 1, 0, 0} {1, 0, 1, 1, 1} {1, 1, 1, 1, 1} {1, 0, 0, 1, 0}}, i = 1, j = 2, K = 9 Output: 3 Explanation: Maxi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Aug, 2021"
},
{
"code": null,
"e": 229,
"s": 52,
"text": "Given a binary matrix M where each element of the matrix will be 0 or 1, the task is to find the largest square that can be formed with center (i, j) and contains atmost K 1’... |
How to programmatically hide Android soft keyboard | 23 Feb, 2021
In this article, we will learn about how to hide soft keyboard programmatically. The keyboard generally hides but there are certain instances when it does not hide. So for better user experience, the keyboard is hidden programmatically.
Without using below approach, the default response of the app is shown... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Feb, 2021"
},
{
"code": null,
"e": 289,
"s": 52,
"text": "In this article, we will learn about how to hide soft keyboard programmatically. The keyboard generally hides but there are certain instances when it does not hide. So for be... |
Partitioning Method (K-Mean) in Data Mining - GeeksforGeeks | 05 Feb, 2020
Partitioning Method:This clustering method classifies the information into multiple groups based on the characteristics and similarity of the data. Its the data analysts to specify the number of clusters that has to be generated for the clustering methods.
In the partitioning method when database(D) that c... | [
{
"code": null,
"e": 25715,
"s": 25687,
"text": "\n05 Feb, 2020"
},
{
"code": null,
"e": 25972,
"s": 25715,
"text": "Partitioning Method:This clustering method classifies the information into multiple groups based on the characteristics and similarity of the data. Its the data an... |
Grouping dropdown options using ReactJS - GeeksforGeeks | 18 Jan, 2021
Grouping options means putting options in groups based on conditions for a better user experience. For example on our mobile, all contacts are grouped by their first letter so that it becomes easier for users to search for contacts. Material UI for React has this component available for us and it is very e... | [
{
"code": null,
"e": 26557,
"s": 26529,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 26882,
"s": 26557,
"text": "Grouping options means putting options in groups based on conditions for a better user experience. For example on our mobile, all contacts are grouped by their fir... |
Why "&" is not used for strings in scanf() function? - GeeksforGeeks | 29 Dec, 2021
Below is syntax of Scanf. It requires two arguments:
scanf("Format Specifier", Variable Address);
Format Specifier: Type of value to expect while input
Variable Address: &variable returns the variable's memory address.
In case of a string (character array), the variable itself points to the first element... | [
{
"code": null,
"e": 25478,
"s": 25450,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 25532,
"s": 25478,
"text": "Below is syntax of Scanf. It requires two arguments: "
},
{
"code": null,
"e": 25699,
"s": 25532,
"text": "scanf(\"Format Specifier\", Variable... |
Modular Addition - GeeksforGeeks | 12 Aug, 2020
Below are some interesting properties of Modular Addition:
(a + b) mod m = ((a mod m) + (b mod m)) mod m (a + b + c) mod m = ((a mod m) + (b mod m) + (c mod m)) mod m
Example 1: Find the remainder of 22 + 26 + 29 when divided by 5. Solution: On dividing 22 by 5 we get 2 as remainder. On dividing 26 by ... | [
{
"code": null,
"e": 26137,
"s": 26109,
"text": "\n12 Aug, 2020"
},
{
"code": null,
"e": 26198,
"s": 26137,
"text": "Below are some interesting properties of Modular Addition: "
},
{
"code": null,
"e": 26308,
"s": 26198,
"text": "(a + b) mod m = ((a mod m) + ... |
FakeDataGen - Full Valid Fake Data Generator - GeeksforGeeks | 04 Jan, 2022
FakeDataGen is a free and open-source tool available on GitHub. This tool can be used to create a Full Valid Data Generator. This tool can be used to create fake accounts, emails, name data set which can be used in many attacks such as the men in the middle attack. Using this tool you can find the most com... | [
{
"code": null,
"e": 25651,
"s": 25623,
"text": "\n04 Jan, 2022"
},
{
"code": null,
"e": 26262,
"s": 25651,
"text": "FakeDataGen is a free and open-source tool available on GitHub. This tool can be used to create a Full Valid Data Generator. This tool can be used to create fake a... |
GATE | GATE-CS-2015 (Set 1) | Question 65 - GeeksforGeeks | 28 Jun, 2021
Let an represent the number of bit strings of length n containing two consecutive 1s. What is the recurrence relation for an?(A) an–2 + an–1 + 2n–2(B) an–2 + 2an–1 + 2n–2(C) 2an–2 + an–1 + 2n–2(D) 2an–2 + 2an–1 + 2n–2Answer: (A)Explanation: Simple SolutionOne way to solve this is to try for small values an... | [
{
"code": null,
"e": 25695,
"s": 25667,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 26022,
"s": 25695,
"text": "Let an represent the number of bit strings of length n containing two consecutive 1s. What is the recurrence relation for an?(A) an–2 + an–1 + 2n–2(B) an–2 + 2an–1... |
autoheader command in Linux with Examples - GeeksforGeeks | 15 May, 2019
autoheader command in Linux is used to create a template file of C “#define” or any other template header for configure to use. If the user will give autoheader an argument, it reads the standard input instead of reading configure.ac and also writes the header file to the standard output. This command scan... | [
{
"code": null,
"e": 25651,
"s": 25623,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 26050,
"s": 25651,
"text": "autoheader command in Linux is used to create a template file of C “#define” or any other template header for configure to use. If the user will give autoheader an... |
Linux | Nmon - GeeksforGeeks | 27 Oct, 2018
Nmon is a fully interactive performance monitoring command-line utility tool for Linux. It is a benchmark tool that displays performance about the CPU, MEMORY, NETWORK, DISKS, FILE SYSTEM, NFS, TOP PROCESSES, RESOURCES, AND POWER MICRO-PARTITION.
INSTALLATIONOn Ubuntu/Debian :
$ sudo apt-get install nmon
O... | [
{
"code": null,
"e": 25677,
"s": 25649,
"text": "\n27 Oct, 2018"
},
{
"code": null,
"e": 25924,
"s": 25677,
"text": "Nmon is a fully interactive performance monitoring command-line utility tool for Linux. It is a benchmark tool that displays performance about the CPU, MEMORY, NET... |
Count distinct prime factors for each element of an array - GeeksforGeeks | 05 Jul, 2021
Given an array arr[] of size N, the task is to find the count of distinct prime factors of each element of the given array.
Examples:
Input: arr[] = {6, 9, 12}Output: 2 1 2Explanation:
6 = 2 × 3. Therefore, count = 2
9 = 3 × 3. Therefore, count = 1
12 = 2 × 2 × 3. Therefore, count = 2
The count of distinct... | [
{
"code": null,
"e": 26067,
"s": 26039,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 26191,
"s": 26067,
"text": "Given an array arr[] of size N, the task is to find the count of distinct prime factors of each element of the given array."
},
{
"code": null,
"e": 26... |
How to use gotoxy() in codeblocks? - GeeksforGeeks | 18 May, 2021
The gotoxy() function places the cursor at the desired location on the screen. This means it is possible to change the cursor location on the screen using the gotoxy() function. It is basically used to print text wherever the cursor is moved. Below is the C program to print the “hello” message on the scree... | [
{
"code": null,
"e": 26177,
"s": 26149,
"text": "\n18 May, 2021"
},
{
"code": null,
"e": 26523,
"s": 26177,
"text": "The gotoxy() function places the cursor at the desired location on the screen. This means it is possible to change the cursor location on the screen using the goto... |
How to check a function is defined in JavaScript ? - GeeksforGeeks | 24 May, 2019
The job is to identify whether a function is defined or not. The JavaScript typeof operator is used to solve the problem described below:
Javascript typeof Operator: This operator can be used to find the type of a JavaScript variable. This operator returns the type of a variable or an expression:
Syntax:
t... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n24 May, 2019"
},
{
"code": null,
"e": 26683,
"s": 26545,
"text": "The job is to identify whether a function is defined or not. The JavaScript typeof operator is used to solve the problem described below:"
},
{
"code": nul... |
Print maximum sum square sub-matrix of given size - GeeksforGeeks | 02 May, 2022
Given an N x N matrix, find a k x k submatrix where k <= N and k >= 1, such that sum of all the elements in submatrix is maximum. The input matrix can contain zero, positive and negative numbers.For example consider below matrix, if k = 3, then output should print the sub-matrix enclosed in blue.
We stro... | [
{
"code": null,
"e": 26615,
"s": 26587,
"text": "\n02 May, 2022"
},
{
"code": null,
"e": 26915,
"s": 26615,
"text": "Given an N x N matrix, find a k x k submatrix where k <= N and k >= 1, such that sum of all the elements in submatrix is maximum. The input matrix can contain zero... |
Explain NLP models with LIME & SHAP | by Susan Li | Towards Data Science | Last week, I gave a talk on “Hands-on Feature Engineering for NLP” at QCon New York. As a very small part of the presentation, I gave a brief demo on how LIME & SHAP work in terms of text classification explainability.
I decided to write a blog post about them because they are fun, easy to use and visually compelling.
... | [
{
"code": null,
"e": 390,
"s": 171,
"text": "Last week, I gave a talk on “Hands-on Feature Engineering for NLP” at QCon New York. As a very small part of the presentation, I gave a brief demo on how LIME & SHAP work in terms of text classification explainability."
},
{
"code": null,
"e":... |
Git Branch | In Git, a branch is a new/separate version of the main repository.
Let's say you have a large project, and you need to update the design on it.
How would that work without and with Git:
Without Git:
Make copies of all the relevant files to avoid impacting the live version
Start working with the design and find that cod... | [
{
"code": null,
"e": 67,
"s": 0,
"text": "In Git, a branch is a new/separate version of the main repository."
},
{
"code": null,
"e": 144,
"s": 67,
"text": "Let's say you have a large project, and you need to update the design on it."
},
{
"code": null,
"e": 186,
... |
Python Main Function | 27 Dec, 2019
Main function is like the entry point of a program. However, Python interpreter runs the code right from the first line. The execution of the code starts from the starting line and goes line by line. It does not matter where the main function is present or it is present or not.
Since there is no main() fun... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 331,
"s": 52,
"text": "Main function is like the entry point of a program. However, Python interpreter runs the code right from the first line. The execution of the code starts from the starting li... |
How to add a box-shadow on one side of an element using CSS? | 19 Feb, 2019
The box-shadow property is used to set the box shadow on one side of element.
Syntax:
box-shadow: h-offset v-offset blur spread color;
box-shadows values:
h-offset: It is required and used to set the position of the shadow horizontally. The positive value is used to set the shadow on right side of the box ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Feb, 2019"
},
{
"code": null,
"e": 106,
"s": 28,
"text": "The box-shadow property is used to set the box shadow on one side of element."
},
{
"code": null,
"e": 114,
"s": 106,
"text": "Syntax:"
},
{
"code"... |
Program to check if a given year is leap year | 13 Jul, 2022
A year is a leap year if the following conditions are satisfied:
The year is multiple of 400.The year is multiple of 4 and not multiple of 100.
The year is multiple of 400.
The year is multiple of 4 and not multiple of 100.
Following is pseudo-code
if year is divisible by 400 then is_leap_year
else if ye... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Jul, 2022"
},
{
"code": null,
"e": 118,
"s": 52,
"text": "A year is a leap year if the following conditions are satisfied: "
},
{
"code": null,
"e": 197,
"s": 118,
"text": "The year is multiple of 400.The year is... |
Set Axis Breaks of ggplot2 Plot in R | 23 Aug, 2021
In this article, we are going to see how to set axis break of ggplot2 plot in R Programming Language.
To add axis breaks in ggplot2 plots in R, we use scale_x_break() and scale_y_break() functions. These functions take a vector as a parameter that has breakpoints. If we need multiple breakpoints we can a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 131,
"s": 28,
"text": "In this article, we are going to see how to set axis break of ggplot2 plot in R Programming Language. "
},
{
"code": null,
"e": 349,
"s": 131,
"text": "To ... |
How to implement column specific search filter using DataTables plugin ? | 11 Nov, 2021
DataTables are a modern jQuery plugin for adding interactive and advanced controls to HTML tables for a webpage. It is a very simple-to-use plug-in with a variety of options for the developer’s custom changes as per the application’s need. The plugin’s features include pagination, sorting, searching, and m... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Nov, 2021"
},
{
"code": null,
"e": 386,
"s": 54,
"text": "DataTables are a modern jQuery plugin for adding interactive and advanced controls to HTML tables for a webpage. It is a very simple-to-use plug-in with a variety of options ... |
What are custom attributes in HTML5 ? | 16 Sep, 2021
Custom attributes are attributes that are not part of the standard HTML5 attributes but are explicitly created. They allow us to add our own information to HTML tags. These are not specific and can be used with all the HTML elements. The extra information stored through custom attributes are data that need... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Sep, 2021"
},
{
"code": null,
"e": 474,
"s": 28,
"text": "Custom attributes are attributes that are not part of the standard HTML5 attributes but are explicitly created. They allow us to add our own information to HTML tags. These ar... |
Salesforce Interview Experience for SDE Internship 2021 | 13 Aug, 2021
Salesforce came to my college in august 2021 for an SDE intern, the criteria were 7+ GPA and no backlog and any branch. The test started with an online coding test consisting 3 Questions to be solved in 90 mins on hackerrank. the questions were easy/moderate, 1 Question involved the concept of CIDR (networ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Aug, 2021"
},
{
"code": null,
"e": 696,
"s": 52,
"text": "Salesforce came to my college in august 2021 for an SDE intern, the criteria were 7+ GPA and no backlog and any branch. The test started with an online coding test consisting... |
Manipulating objects in array of objects in JavaScript | Suppose, we have two arrays of objects like this −
const arr1 = [
{id:'124',name:'qqq'},
{id:'589',name:'www'},
{id:'45',name:'eee'},
{id:'567',name:'rrr'}
];
const arr2 = [
{id:'124',name:'ttt'},
{id:'45',name:'yyy'}
];
We are required to write a JavaScript function that takes in two such objects. Ou... | [
{
"code": null,
"e": 1238,
"s": 1187,
"text": "Suppose, we have two arrays of objects like this −"
},
{
"code": null,
"e": 1426,
"s": 1238,
"text": "const arr1 = [\n {id:'124',name:'qqq'},\n {id:'589',name:'www'},\n {id:'45',name:'eee'},\n {id:'567',name:'rrr'}\n];\nconst... |
SQL Query to Add Foreign Key Constraints Using ALTER Command | 19 Apr, 2021
In this article, we will look into how you can add a foreign key constraint using the ALTER command in SQL. For this article, we will be using Microsoft SQL Server as our database.
But before we start let’s take a look at the below terminologies:
Primary key: It is used to uniquely identify the records in ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 235,
"s": 54,
"text": "In this article, we will look into how you can add a foreign key constraint using the ALTER command in SQL. For this article, we will be using Microsoft SQL Server as our dat... |
How to Add Image in Text Background using HTML and CSS ? | 11 May, 2020
In this article, we will use HTML and CSS to set the image in the text background. To set the image in the text background, some CSS property is used.
HTML Code: HTML code is used to create a basic structure of the body. In the following code, we will use paragraph tag to write text content.
<!DOCTYPE html... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 May, 2020"
},
{
"code": null,
"e": 205,
"s": 54,
"text": "In this article, we will use HTML and CSS to set the image in the text background. To set the image in the text background, some CSS property is used."
},
{
"code": n... |
Unit Testing in Python – Unittest | 04 Oct, 2017
What is Unit Testing?Unit Testing is the first level of software testing where the smallest testable parts of a software are tested. This is used to validate that each unit of the software performs as designed.The unittest test framework is python’s xUnit style framework.
Method:White Box Testing method is... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Oct, 2017"
},
{
"code": null,
"e": 325,
"s": 52,
"text": "What is Unit Testing?Unit Testing is the first level of software testing where the smallest testable parts of a software are tested. This is used to validate that each unit o... |
JavaScript | Function Apply | 02 Dec, 2021
The apply() method is used to write methods, which can be used on different objects. It is different from the function call() because it takes arguments as an array.
Syntax:
apply()
Return Value: It returns the method values of a given function.
Example 1: This example illustrates the apply() function with... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 194,
"s": 28,
"text": "The apply() method is used to write methods, which can be used on different objects. It is different from the function call() because it takes arguments as an array."
},
{... |
Sequence Points in C | Set 1 | 13 Oct, 2021
In this post, we will try to cover many ambiguous questions like following.
Guess the output of following programs.
// PROGRAM 1#include <stdio.h>int f1() { printf ("Geeks"); return 1;}int f2() { printf ("forGeeks"); return 1;}int main() { int p = f1() + f2(); return 0; } // PROGRAM 2#include <stdio.... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 130,
"s": 54,
"text": "In this post, we will try to cover many ambiguous questions like following."
},
{
"code": null,
"e": 170,
"s": 130,
"text": "Guess the output of following... |
while Loop in C# | 25 Aug, 2020
Looping in a programming language is a way to execute a statement or a set of statements multiple number of times depending on the result of the condition to be evaluated. while loop is an Entry Controlled Loop in C#.
The test condition is given in the beginning of the loop and all statements are executed ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Aug, 2020"
},
{
"code": null,
"e": 246,
"s": 28,
"text": "Looping in a programming language is a way to execute a statement or a set of statements multiple number of times depending on the result of the condition to be evaluated. whi... |
How to generate a random number between 0 and 1 in Python ? | 03 Jan, 2021
The use of randomness is an important part of the configuration and evaluation of modern algorithms.
Here, we will see the various approaches for generating random numbers between 0 ans 1.
Method 1:
Here, we will use uniform() method which returns the random number between the two specified numbers (both i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jan, 2021"
},
{
"code": null,
"e": 129,
"s": 28,
"text": "The use of randomness is an important part of the configuration and evaluation of modern algorithms."
},
{
"code": null,
"e": 217,
"s": 129,
"text": "Here,... |
Server Side Request Forgery (SSRF) in Depth | 28 Jun, 2022
Server-Side Request Forgery (SSRF) :SSRF stands for the Server Side Request Forgery. SSRF is a server site attack that leads to sensitive information disclosure from the back-end server of the application. In server site request forgery attackers send malicious packets to any Internet-facing web server and... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 745,
"s": 52,
"text": "Server-Side Request Forgery (SSRF) :SSRF stands for the Server Side Request Forgery. SSRF is a server site attack that leads to sensitive information disclosure from the back... |
Program to check valid mobile number | 05 Oct, 2021
Mobile Number validation criteria:
The first digit should contain number between 7 to 9.
The rest 9 digit can contain any number between 0 to 9.
The mobile number can have 11 digits also by including 0 at the starting.
The mobile number can be of 12 digits also by including 91 at the starting
The number wh... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 87,
"s": 52,
"text": "Mobile Number validation criteria:"
},
{
"code": null,
"e": 141,
"s": 87,
"text": "The first digit should contain number between 7 to 9."
},
{
"cod... |
How to drop rows in Pandas DataFrame by index labels? | 11 Jun, 2021
Pandas provide data analysts a way to delete and filter data frame using .drop() method. Rows can be removed using index label or column name using this method.
Syntax: DataFrame.drop(labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors=’raise’)Parameters: labels: String or lis... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 216,
"s": 54,
"text": "Pandas provide data analysts a way to delete and filter data frame using .drop() method. Rows can be removed using index label or column name using this method. "
},
{
... |
response.raise_for_status() – Python requests | 07 Jul, 2022
response.raise_for_status() returns an HTTPError object if an error has occurred during the process. It is used for debugging the requests module and is an integral part of Python requests. Python requests are generally used to fetch the content from a particular resource URI. Whenever we make a request to... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 621,
"s": 53,
"text": "response.raise_for_status() returns an HTTPError object if an error has occurred during the process. It is used for debugging the requests module and is an integral part of P... |
How to install MongoDB on MacOS ? | 10 Mar, 2022
MongoDB is an open-source document-oriented database that is designed to store a large scale of data and also allows you to work with that data very efficiently. It is categorized under the NoSQL(Not only SQL) database because the storage and retrieval of data in the MongoDB are not in the form of tables. ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Mar, 2022"
},
{
"code": null,
"e": 433,
"s": 28,
"text": "MongoDB is an open-source document-oriented database that is designed to store a large scale of data and also allows you to work with that data very efficiently. It is categor... |
Find the Batting Average of a batsman | 05 Apr, 2021
Given three integers runs, matches, and not-out representing the number of runs scored, number of innings played by the batsman and number of times he remained Not Out respectively, the task is to calculate the Batting Average of the batsman.
where
Note: If the batsman was never dismissed, print “NA” as... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n05 Apr, 2021"
},
{
"code": null,
"e": 297,
"s": 53,
"text": "Given three integers runs, matches, and not-out representing the number of runs scored, number of innings played by the batsman and number of times he remained Not Out respec... |
Print all even nodes of Binary Search Tree | 01 Nov, 2021
Given a binary search tree. The task is to print all even nodes of the binary search tree.Examples:
Input :
5
/ \
3 7
/ \ / \
2 4 6 8
Output : 2 4 6 8
Input :
14
/ \
12 17
/ \ / \
8 13 16 19
Output :... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Nov, 2021"
},
{
"code": null,
"e": 154,
"s": 52,
"text": "Given a binary search tree. The task is to print all even nodes of the binary search tree.Examples: "
},
{
"code": null,
"e": 371,
"s": 154,
"text": "Inp... |
Format Calendar with String.format() in Java | Firstly, consider an object with date value.
Object arrObj[] = { "Date", Calendar.getInstance() };
After that, use the String.format() method to format Calendar and display the date.
The following is an example.
Live Demo
import java.util.Calendar;
public class Demo {
public static void main(String []args){
O... | [
{
"code": null,
"e": 1107,
"s": 1062,
"text": "Firstly, consider an object with date value."
},
{
"code": null,
"e": 1161,
"s": 1107,
"text": "Object arrObj[] = { \"Date\", Calendar.getInstance() };"
},
{
"code": null,
"e": 1245,
"s": 1161,
"text": "After that... |
Reading and visualizing data from Jira by python | by Sergei Dmitriev | Towards Data Science | Jira is one of the widespread software application for bug/ issue tracking and agile project management. One of the entity of this tool is an issue, which can represent a bug, a task, an order or something else (it depends on in what way an organization uses this application):
There is a lot communications information ... | [
{
"code": null,
"e": 450,
"s": 172,
"text": "Jira is one of the widespread software application for bug/ issue tracking and agile project management. One of the entity of this tool is an issue, which can represent a bug, a task, an order or something else (it depends on in what way an organization u... |
jQuery UI Autocomplete search() Method - GeeksforGeeks | 22 Dec, 2021
jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpages. The jQuery UI Autocomplete widget is used to perform autocomplete enables to quickly find and select from a pre-populated list of values as ... | [
{
"code": null,
"e": 25554,
"s": 25526,
"text": "\n22 Dec, 2021"
},
{
"code": null,
"e": 25908,
"s": 25554,
"text": "jQuery UI consists of GUI widgets, visual effects, and themes implemented using HTML, CSS, and jQuery. jQuery UI is great for building UI interfaces for the webpag... |
Why is the Size of an Empty Class Not Zero in C++? - GeeksforGeeks | 22 Nov, 2021
When the structure was introduced in C, there was no concept of Objects at that time. So, according to the C standard, it was decided to keep the size of the empty structure to zero.
In C++, the Size of an empty structure/class is one byte as to call a function at least empty structure/class should have s... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 25739,
"s": 25555,
"text": "When the structure was introduced in C, there was no concept of Objects at that time. So, according to the C standard, it was decided to keep the size of the empty... |
Node.js Bot.sendDocument() Method - GeeksforGeeks | 13 Oct, 2020
The Bot.sendDocument() method is used in the Node.js Telegram Bot API. This Node.js module to interact with the official Telegram Bot API. This method is used to send Documents having extension like .pdf, .docx, .txt, etc.Syntax:
TelegramBot.sendDocument(chatId, location)
Parameters: This method accept... | [
{
"code": null,
"e": 26263,
"s": 26235,
"text": "\n13 Oct, 2020"
},
{
"code": null,
"e": 26495,
"s": 26263,
"text": "The Bot.sendDocument() method is used in the Node.js Telegram Bot API. This Node.js module to interact with the official Telegram Bot API. This method is used to s... |
How to Create a Password Protected ZIP File in Linux? - GeeksforGeeks | 23 Feb, 2021
Linux provides Zip command to work with a file like compressing the file and decompressing with a password. It’s not come with built-in you need to install from an external source. The Zip command has two different utility(zip and unzip). zip is used for compressing the file and unzip is used for decompres... | [
{
"code": null,
"e": 26197,
"s": 26169,
"text": "\n23 Feb, 2021"
},
{
"code": null,
"e": 26519,
"s": 26197,
"text": "Linux provides Zip command to work with a file like compressing the file and decompressing with a password. It’s not come with built-in you need to install from an... |
How to create a Heart using C Graphics - GeeksforGeeks | 04 Aug, 2021
Prerequisite: graphics.h, How to include graphics.h?
The task is to write a C program to draw a Heart using graphics in C.
Approach: To run the program we have the include the below header file:
#include <graphic.h>
We will create a Heart with the help below functions:
rectangle(x1,y1,x2,y2): A function fr... | [
{
"code": null,
"e": 26175,
"s": 26147,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 26228,
"s": 26175,
"text": "Prerequisite: graphics.h, How to include graphics.h?"
},
{
"code": null,
"e": 26298,
"s": 26228,
"text": "The task is to write a C program to d... |
Bitwise recursive addition of two integers - GeeksforGeeks | 05 May, 2021
When adding two binary numbers by hand we keep the carry bits in mind and add it at the same time. But to do same thing in program we need a lot of checks. Recursive solution can be imagined as addition of carry and a^b (two inputs) until carry becomes 0.
Examples :
Input : int x = 45, y = 45
Output : 90
... | [
{
"code": null,
"e": 26279,
"s": 26251,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 26535,
"s": 26279,
"text": "When adding two binary numbers by hand we keep the carry bits in mind and add it at the same time. But to do same thing in program we need a lot of checks. Recursi... |
Groovy - contains() | Checks if a range contains a specific value.
boolean contains(Object obj)
Obj − The value to check in the range list.
Returns true if this Range contains the specified element.
Following is an example of the usage of this method −
class Example {
static void main(String[] args) {
// Example of an Integer us... | [
{
"code": null,
"e": 2283,
"s": 2238,
"text": "Checks if a range contains a specific value."
},
{
"code": null,
"e": 2313,
"s": 2283,
"text": "boolean contains(Object obj)\n"
},
{
"code": null,
"e": 2357,
"s": 2313,
"text": "Obj − The value to check in the ran... |
HTML - <dialog> tag | The HTML <dialog> tag is used for defining a dialog box.
<!Doctype html>
<html>
<head>
<title>HTML dialog Tag</title>
</head>
<body>
<dialog open>this will be shown in a dialog</dialog>
</body>
</html>
This will produce the following result −
This tag supports all the global attributes descri... | [
{
"code": null,
"e": 2431,
"s": 2374,
"text": "The HTML <dialog> tag is used for defining a dialog box."
},
{
"code": null,
"e": 2603,
"s": 2431,
"text": "<!Doctype html>\n<html>\n\n <head>\n <title>HTML dialog Tag</title>\n </head>\n\n <body>\n <dialog open>this ... |
Selenium - Capture Screenshots | This functionality helps to grab screenshots at run time when required, in particularly when a failure happens. With the help of screenshots and log messages, we will be able to analyze the results better.
Screenshots are configured differently for local executions and Selenium Grid(remote) executions. Let us take a lo... | [
{
"code": null,
"e": 2081,
"s": 1875,
"text": "This functionality helps to grab screenshots at run time when required, in particularly when a failure happens. With the help of screenshots and log messages, we will be able to analyze the results better."
},
{
"code": null,
"e": 2232,
... |
Servlets - Server HTTP Response | As discussed in the previous chapter, when a Web server responds to an HTTP request, the response typically consists of a status line, some response headers, a blank line, and the document. A typical response looks like this −
HTTP/1.1 200 OK
Content-Type: text/html
Header2: ...
...
HeaderN: ...
(Blank Line)
<!docty... | [
{
"code": null,
"e": 2412,
"s": 2185,
"text": "As discussed in the previous chapter, when a Web server responds to an HTTP request, the response typically consists of a status line, some response headers, a blank line, and the document. A typical response looks like this −"
},
{
"code": null... |
Unicode Character Class \p{IsLatin} | The character class \p{IsLatin} matches any latin script character.
The following example shows the usage of Unicode character class matching.
package com.tutorialspoint;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class UnicodeCharacterClassDemo {
private static final String REGEX = "\\... | [
{
"code": null,
"e": 2192,
"s": 2124,
"text": "The character class \\p{IsLatin} matches any latin script character."
},
{
"code": null,
"e": 2267,
"s": 2192,
"text": "The following example shows the usage of Unicode character class matching."
},
{
"code": null,
"e": 2... |
GATE | GATE-CS-2004 | Question 42 - GeeksforGeeks | 28 Jun, 2021
What does the following algorithm approximate?
x = m;y = 1;while (x - y > e){ x = (x + y)/2; y = m/x;}print(x);
(Assume m > 1, e > 0).
(A) log m(B) m2(C) m1/2(D) m1/3Answer: (C)Explanation: The given code is implementation of Babylonian method for square rootQuiz of this Question
GATE-CS-2004
GATE-GA... | [
{
"code": null,
"e": 24466,
"s": 24438,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24513,
"s": 24466,
"text": "What does the following algorithm approximate?"
},
{
"code": "x = m;y = 1;while (x - y > e){ x = (x + y)/2; y = m/x;}print(x);",
"e": 24584,
... |
Decision Tree Models in Python — Build, Visualize, Evaluate | by Mustafa Adel Amer | Towards Data Science | Classification and Regression Trees (CART) can be translated into a graph or set of rules for predictive classification. They help when logistic regression models cannot provide sufficient decision boundaries to predict the label. In addition, decision tree models are more interpretable as they simulate the human decis... | [
{
"code": null,
"e": 627,
"s": 172,
"text": "Classification and Regression Trees (CART) can be translated into a graph or set of rules for predictive classification. They help when logistic regression models cannot provide sufficient decision boundaries to predict the label. In addition, decision tr... |
DB2 - Constraints | This chapter describes various constraints in the database.
To enforce database integrity, a set of rules is defined, called constraints. The constraints either permit or prohibit the values in the columns.
In a Real time database activities, the data should be added with certain restrictions. For example, in a sales d... | [
{
"code": null,
"e": 1988,
"s": 1928,
"text": "This chapter describes various constraints in the database."
},
{
"code": null,
"e": 2135,
"s": 1988,
"text": "To enforce database integrity, a set of rules is defined, called constraints. The constraints either permit or prohibit th... |
Classifying data using Support Vector Machines(SVMs) in Python - GeeksforGeeks | 20 Apr, 2022
Introduction to SVMs: In machine learning, support vector machines (SVMs, also support vector networks) are supervised learning models with associated learning algorithms that analyze data used for classification and regression analysis. A Support Vector Machine (SVM) is a discriminative classifier formall... | [
{
"code": null,
"e": 24590,
"s": 24562,
"text": "\n20 Apr, 2022"
},
{
"code": null,
"e": 25078,
"s": 24590,
"text": "Introduction to SVMs: In machine learning, support vector machines (SVMs, also support vector networks) are supervised learning models with associated learning alg... |
How to Use W&B Sweeps with LightGBM for Hyperparameter Tuning | by Claudia Ng | Towards Data Science | Hyperparameter tuning is an important step in the modeling process to improve model performance and to customize model hyperparameters to better suit your dataset. There are different useful tools and packages that help with hyperparameter tuning, using grid, random or Bayesian searches. These search functions return o... | [
{
"code": null,
"e": 700,
"s": 172,
"text": "Hyperparameter tuning is an important step in the modeling process to improve model performance and to customize model hyperparameters to better suit your dataset. There are different useful tools and packages that help with hyperparameter tuning, using g... |
What’s in a “Random Forest”? Predicting Diabetes | by Raveena Jayadev | Towards Data Science | (Disclaimer: This article is mainly for people who want a friendly, intuitive understanding of what’s going on in random forests and decision trees — so I won’t be going into huge mathematical detail. I’ll post some links further below in the article to videos and material if you want to go more into the statistical de... | [
{
"code": null,
"e": 567,
"s": 171,
"text": "(Disclaimer: This article is mainly for people who want a friendly, intuitive understanding of what’s going on in random forests and decision trees — so I won’t be going into huge mathematical detail. I’ll post some links further below in the article to v... |
Longest Subarray with Sum greater than Equal to Zero - GeeksforGeeks | 19 May, 2021
Given an array of N integers. The task is to find the maximum length subarray such that the sum of all its elements is greater than or equal to 0.
Examples:
Input: arr[]= {-1, 4, -2, -5, 6, -8}
Output: 5
Explanation: {-1, 4, -2, -5, 6} forms the longest subarray with sum=2.
Input: arr[]={-5, -6}
Output: ... | [
{
"code": null,
"e": 24777,
"s": 24749,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 24924,
"s": 24777,
"text": "Given an array of N integers. The task is to find the maximum length subarray such that the sum of all its elements is greater than or equal to 0."
},
{
"c... |
JDBC - Sorting Data Example | This chapter provides an example on how to sort records from a table using JDBC application. This would use asc and desc keywords to sort records in ascending or descending order. Before executing the following example, make sure you have the following in place −
To execute the following example you can replace the use... | [
{
"code": null,
"e": 2426,
"s": 2162,
"text": "This chapter provides an example on how to sort records from a table using JDBC application. This would use asc and desc keywords to sort records in ascending or descending order. Before executing the following example, make sure you have the following ... |
ReactJS Reactstrap Pagination Component - GeeksforGeeks | 22 Jul, 2021
Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Pagination component allows the users to easily switch between pages across a website or app. We can use the following approach in ReactJS to... | [
{
"code": null,
"e": 25232,
"s": 25204,
"text": "\n22 Jul, 2021"
},
{
"code": null,
"e": 25589,
"s": 25232,
"text": "Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. T... |
Format and Parse Date in Java | To format a date in Java, firstly import the following package.
import java.text.DateFormat;
Now, create DateFormat object.
DateFormat shortFormat = DateFormat.getDateInstance(DateFormat.SHORT);
DateFormat longFormat = DateFormat.getDateInstance(DateFormat.LONG);
Use the format() method to format the above dates.
Syste... | [
{
"code": null,
"e": 1126,
"s": 1062,
"text": "To format a date in Java, firstly import the following package."
},
{
"code": null,
"e": 1155,
"s": 1126,
"text": "import java.text.DateFormat;"
},
{
"code": null,
"e": 1186,
"s": 1155,
"text": "Now, create DateFo... |
Google Charts - Basic Candlestick Chart | Following is an example of a basic candlestick chart. A candlestick chart is generally used to show an opening and closing value which are overlaid on top of a total variance. Candlestick charts are often used to show stocks value behavior. In this chart, filled boxes are drawn for items where the opening value is less... | [
{
"code": null,
"e": 2864,
"s": 2261,
"text": "Following is an example of a basic candlestick chart. A candlestick chart is generally used to show an opening and closing value which are overlaid on top of a total variance. Candlestick charts are often used to show stocks value behavior. In this char... |
Python - Ways to merge strings into list | While developing an application, there come many scenarios when we need to operate on the string and convert it as some mutable data structure, say list.
# Importing ast library
import ast
# Initialization of strings
str1 ="'Python', 'for', 'fun'"
str2 ="'vishesh', 'ved'"
str3 ="'Programmer'"
# Initialization of list
l... | [
{
"code": null,
"e": 1216,
"s": 1062,
"text": "While developing an application, there come many scenarios when we need to operate on the string and convert it as some mutable data structure, say list."
},
{
"code": null,
"e": 1719,
"s": 1216,
"text": "# Importing ast library\nimp... |
How to Validate Data using validator Module in Node.js ? - GeeksforGeeks | 27 Apr, 2020
Validator module is popular for validation. Validation is necessary to check whether the data is correct or not, so this module is easy to use and validates data quickly and easily.
Feature of validator module:
It is easy to get started and easy to use.It is widely used and popular module for validation.Si... | [
{
"code": null,
"e": 25028,
"s": 25000,
"text": "\n27 Apr, 2020"
},
{
"code": null,
"e": 25210,
"s": 25028,
"text": "Validator module is popular for validation. Validation is necessary to check whether the data is correct or not, so this module is easy to use and validates data q... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.