title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Minimum XOR of OR and AND of any pair in the Array - GeeksforGeeks | 05 May, 2021
Given an array arr[] of N positive integers the task is to find the minimum value of Bitwise XOR of Bitwise OR and AND of any pair in the given array.
Examples:
Input: arr[] = {1, 2, 3, 4, 5} Output: 1 Explanation: For element 2 & 3: The value of the expression (2&3) xor (2|3) is 1, which is the minimum ... | [
{
"code": null,
"e": 26069,
"s": 26041,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 26220,
"s": 26069,
"text": "Given an array arr[] of N positive integers the task is to find the minimum value of Bitwise XOR of Bitwise OR and AND of any pair in the given array."
},
{
... |
Generate permutations with only adjacent swaps allowed - GeeksforGeeks | 16 Jun, 2021
Given a string on length N. You can swap only the adjacent elements and each element can be swapped atmost once. Find the no of permutations of the string that can be generated after performing the swaps as mentioned.Examples:
Input : 12345
Output : 12345 12354 12435 13245 13254
21345 21354 214... | [
{
"code": null,
"e": 26723,
"s": 26695,
"text": "\n16 Jun, 2021"
},
{
"code": null,
"e": 26952,
"s": 26723,
"text": "Given a string on length N. You can swap only the adjacent elements and each element can be swapped atmost once. Find the no of permutations of the string that can... |
Check if the given decimal number has 0 and 1 digits only - GeeksforGeeks | 26 May, 2021
Given an integer n, the task is to check whether n is in binary or not. Print true if n is the binary representation else print false.
Examples:
Input: n = 1000111 Output: true
Input: n = 123 Output: false
Method #1: Using Set First add all the digits of n into a set after that remove 0 and 1 from the s... | [
{
"code": null,
"e": 26131,
"s": 26103,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 26266,
"s": 26131,
"text": "Given an integer n, the task is to check whether n is in binary or not. Print true if n is the binary representation else print false."
},
{
"code": null,
... |
Replace every element with the greatest element on right side - GeeksforGeeks | 17 Jan, 2022
Given an array of integers, replace every element with the next greatest element (greatest element on the right side) in the array. Since there is no element next to the last element, replace it with -1. For example, if the array is {16, 17, 4, 3, 5, 2}, then it should be modified to {17, 5, 5, 5, 2, -1}. ... | [
{
"code": null,
"e": 26481,
"s": 26453,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 26790,
"s": 26481,
"text": "Given an array of integers, replace every element with the next greatest element (greatest element on the right side) in the array. Since there is no element next ... |
Minimum edges to reverse to make path from a source to a destination - GeeksforGeeks | 04 Mar, 2022
Given a directed graph and a source node and destination node, we need to find how many edges we need to reverse in order to make at least 1 path from the source node to the destination node.
Examples:
In above graph there were two paths from node 0 to node 6,
0 -> 1 -> 2 -> 3 -> 6
0 -> 1 -> 5 -> 4 -> 6
... | [
{
"code": null,
"e": 26475,
"s": 26447,
"text": "\n04 Mar, 2022"
},
{
"code": null,
"e": 26667,
"s": 26475,
"text": "Given a directed graph and a source node and destination node, we need to find how many edges we need to reverse in order to make at least 1 path from the source n... |
Perl | glob() Function - GeeksforGeeks | 12 Jun, 2019
glob() function in Perl is used to print the files present in a directory passed to it as an argument. This function can print all or the specific files whose extension has been passed to it.
Syntax: glob(Directory_name/File_type);
Parameter: path of the directory of which files are to be printed.
Returns:... | [
{
"code": null,
"e": 25355,
"s": 25327,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 25547,
"s": 25355,
"text": "glob() function in Perl is used to print the files present in a directory passed to it as an argument. This function can print all or the specific files whose exte... |
How to Capture Screenshot of a View and Save it to Gallery in Android? - GeeksforGeeks | 14 Feb, 2021
In this article, we will capture a screenshot of a view and store the image in the gallery. A sample video is given below to get an idea about what we are going to do in this article. Note that we are going to implement this project using the Kotlin language.
Step 1: Create a new project
To create a new p... | [
{
"code": null,
"e": 26405,
"s": 26377,
"text": "\n14 Feb, 2021"
},
{
"code": null,
"e": 26666,
"s": 26405,
"text": "In this article, we will capture a screenshot of a view and store the image in the gallery. A sample video is given below to get an idea about what we are going to... |
How to install XAMPP on Windows ? - GeeksforGeeks | 28 Jan, 2022
XAMPP is the most popular software package which is used to set up a PHP development environment for web services by providing all the required software components. During the process of software deployment, most of the web servers use almost similar components, so use of XAMPP provides easy transition fro... | [
{
"code": null,
"e": 25912,
"s": 25884,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 26727,
"s": 25912,
"text": "XAMPP is the most popular software package which is used to set up a PHP development environment for web services by providing all the required software components... |
Python | Last occurrence of some element in a list - GeeksforGeeks | 30 Dec, 2018
There are many ways to find out the first index of element in the list as Python in its language provides index() function that returns the index of first occurrence of element in list. But if one desires to get the last occurrence of element in list, usually a longer method has to be applied.
Let’s discus... | [
{
"code": null,
"e": 25731,
"s": 25703,
"text": "\n30 Dec, 2018"
},
{
"code": null,
"e": 26026,
"s": 25731,
"text": "There are many ways to find out the first index of element in the list as Python in its language provides index() function that returns the index of first occurren... |
Why use Guzzle Instead of cURL in PHP ? - GeeksforGeeks | 17 Jan, 2022
What is cURL? cURL is a module in PHP with we can use libcurl. The libcurl is a library that is used in PHP to create connection and communicate with various kinds of different servers which may have different type of protocols. cURl provide us various pre-built functions like – curl_init(), curl_setopt(),... | [
{
"code": null,
"e": 26217,
"s": 26189,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 26574,
"s": 26217,
"text": "What is cURL? cURL is a module in PHP with we can use libcurl. The libcurl is a library that is used in PHP to create connection and communicate with various kinds... |
Create Heatmap in R - GeeksforGeeks | 29 Dec, 2021
Heatmap is a graphical way to represent data. It is most commonly used in data analysis. In data analysis, we explore the dataset and draws insight from the dataset, we try to find the hidden patterns in the data by doing a visual analysis of the data. Heatmap visualizes the value of the matrix with colour... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 27080,
"s": 26487,
"text": "Heatmap is a graphical way to represent data. It is most commonly used in data analysis. In data analysis, we explore the dataset and draws insight from the datase... |
How to Create a Package in Java? - GeeksforGeeks | 01 Nov, 2021
Package in Java is a mechanism to encapsulate a group of classes, sub-packages, and interfaces. All we need to do is put related classes into packages. After that, we can simply write an import class from existing packages and use it in our program. A package is a container of a group of related classes wh... | [
{
"code": null,
"e": 25250,
"s": 25222,
"text": "\n01 Nov, 2021"
},
{
"code": null,
"e": 25796,
"s": 25250,
"text": "Package in Java is a mechanism to encapsulate a group of classes, sub-packages, and interfaces. All we need to do is put related classes into packages. After that,... |
Python - Write "GFG" using Turtle Graphics - GeeksforGeeks | 03 Jun, 2020
IN this article we will learn how to write “GFG” using Turtle Graphics in Python. For that lets first know what is Turtle Graphics.
backward(length): moves the pen in the backward direction by x unit.
right(angle): rotate the pen in the clockwise direction by an angle x.
left(angle): rotate the pen in the ... | [
{
"code": null,
"e": 25831,
"s": 25803,
"text": "\n03 Jun, 2020"
},
{
"code": null,
"e": 25963,
"s": 25831,
"text": "IN this article we will learn how to write “GFG” using Turtle Graphics in Python. For that lets first know what is Turtle Graphics."
},
{
"code": null,
... |
Comparing Streams to Loops in Java - GeeksforGeeks | 21 Feb, 2022
A stream is an ordered pipeline of aggregate operations(filter(), map(), forEach(), and collect()) that process a (conceptually unbounded) sequence of elements. A stream pipeline consists of a source, followed by zero or more intermediate operations; and a terminal operation. An aggregate operation perform... | [
{
"code": null,
"e": 26103,
"s": 26075,
"text": "\n21 Feb, 2022"
},
{
"code": null,
"e": 26591,
"s": 26103,
"text": "A stream is an ordered pipeline of aggregate operations(filter(), map(), forEach(), and collect()) that process a (conceptually unbounded) sequence of elements. A ... |
Aspect Modelling in Sentiment Analysis - GeeksforGeeks | 30 May, 2021
Prerequisite: Sentiment Analysis
Before getting into the specifics of Aspect Modelling, let us first briefly understand what Sentiment Analysis is with a real-life example.
It is a technique to distinguish a person’s feeling towards something or someone based on a piece of text they have written about it... | [
{
"code": null,
"e": 25589,
"s": 25561,
"text": "\n30 May, 2021"
},
{
"code": null,
"e": 25623,
"s": 25589,
"text": "Prerequisite: Sentiment Analysis "
},
{
"code": null,
"e": 25764,
"s": 25623,
"text": "Before getting into the specifics of Aspect Modelling, l... |
math.Pow() Function in Golang With Examples - GeeksforGeeks | 13 Apr, 2020
Go language provides inbuilt support for basic constants and mathematical functions to perform operations on the numbers with the help of the math package. You can find the base-a exponential of b(a**b)with the help of Pow() function provided by the math package. So, you need to add a math package in your ... | [
{
"code": null,
"e": 25665,
"s": 25637,
"text": "\n13 Apr, 2020"
},
{
"code": null,
"e": 26042,
"s": 25665,
"text": "Go language provides inbuilt support for basic constants and mathematical functions to perform operations on the numbers with the help of the math package. You can... |
Angular PrimeNG ToggleButton Component - GeeksforGeeks | 22 Aug, 2021
Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the ToggleButton component in Angular PrimeNG.
ToggleButton compon... | [
{
"code": null,
"e": 26354,
"s": 26326,
"text": "\n22 Aug, 2021"
},
{
"code": null,
"e": 26642,
"s": 26354,
"text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp... |
Find last index of a character in a string in C++ | Suppose we have a string str. We have another character ch. Our task is to find the last index of ch in the string. Suppose the string is “Hello”, and character ch = ‘l’, then the last index will be 3.
To solve this, we will traverse the list from right to left, if the character is not same as ‘l’, then decrease index,... | [
{
"code": null,
"e": 1264,
"s": 1062,
"text": "Suppose we have a string str. We have another character ch. Our task is to find the last index of ch in the string. Suppose the string is “Hello”, and character ch = ‘l’, then the last index will be 3."
},
{
"code": null,
"e": 1427,
"s":... |
How to Use Convolutional Neural Networks for Time Series Classification | by Margarita Granat | Towards Data Science | A large amount of data is stored in the form of time series: stock indices, climate measurements, medical tests, etc. Time series classification has a wide range of applications: from identification of stock market anomalies to automated detection of heart and brain diseases.
There are many methods for time series clas... | [
{
"code": null,
"e": 448,
"s": 171,
"text": "A large amount of data is stored in the form of time series: stock indices, climate measurements, medical tests, etc. Time series classification has a wide range of applications: from identification of stock market anomalies to automated detection of hear... |
Pareto Distributions and Monte Carlo Simulations | by Michael Grogan | Towards Data Science | Pareto Distributions are all around us. It has also been referred to as the 80/20 rule. As some examples:
20% of all websites get 80% of the traffic.
The top 20% of earners globally make 80% of the income.
You wear 20% of your clothes 80% of the time.
Traditionally, we are thought that the assumed distribution for a st... | [
{
"code": null,
"e": 277,
"s": 171,
"text": "Pareto Distributions are all around us. It has also been referred to as the 80/20 rule. As some examples:"
},
{
"code": null,
"e": 321,
"s": 277,
"text": "20% of all websites get 80% of the traffic."
},
{
"code": null,
"e":... |
How do I see all foreign keys to a table column? | To see all the foreign keys to a table or column, the referenced_column_name command is
used.
First, two tables are created and then related with the help of the foreign key constraint.
Creating the first table −
mysql> CREATE table ForeignTable
-> (
-> id int,
-> name varchar(200),
-> Fk_pk int
-> );
Query OK, 0 rows ... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "To see all the foreign keys to a table or column, the referenced_column_name command is\nused."
},
{
"code": null,
"e": 1248,
"s": 1156,
"text": "First, two tables are created and then related with the help of the foreign key constra... |
acpi_available command in Linux with examples - GeeksforGeeks | 04 Apr, 2019
acpi_available is a command in Linux which test whether ACPI (Advanced Configuration and Power Interface) subsystem is available or not. It has three return statuses:
0 : It means ACPI subsystem is available.
1 : It means ACPI subsystem is not available.
2 : It means some usage error has occured.
Syntax:
$... | [
{
"code": null,
"e": 23725,
"s": 23697,
"text": "\n04 Apr, 2019"
},
{
"code": null,
"e": 23892,
"s": 23725,
"text": "acpi_available is a command in Linux which test whether ACPI (Advanced Configuration and Power Interface) subsystem is available or not. It has three return status... |
Batch Script - DEL | This batch command deletes files and not directories.
del [filename]
The following example shows the different variants of the del command.
@echo off
Rem Deletes the file lists.txt in C:\
del C:\lists.txt
Rem Deletes all files recursively in all nested directories
del /s *.txt
Rem Deletes all files recursively in ... | [
{
"code": null,
"e": 2223,
"s": 2169,
"text": "This batch command deletes files and not directories."
},
{
"code": null,
"e": 2239,
"s": 2223,
"text": "del [filename]\n"
},
{
"code": null,
"e": 2310,
"s": 2239,
"text": "The following example shows the differen... |
Understanding Linear Regression. The Workhorse Of Data Science | by Tony Yiu | Towards Data Science | Despite the prevalence of more complicated and fancier models in recent years, linear regression remains hard to beat because of its versatility, robustness, and explainability.
It’s a simple but powerful model that just gets the job done. And if you want to go into a quantitative field, you will need to understand how... | [
{
"code": null,
"e": 350,
"s": 172,
"text": "Despite the prevalence of more complicated and fancier models in recent years, linear regression remains hard to beat because of its versatility, robustness, and explainability."
},
{
"code": null,
"e": 503,
"s": 350,
"text": "It’s a s... |
Advanced Streamlit Caching. Caching = Better User Experience | by Rahul Agarwal | Towards Data Science | It is straightforward now how to create a web app using Streamlit, but there are a lot of things that it doesn’t allow you to do yet. One of the major issues I faced recently was around caching when I was trying to use a News API to create an analytical news dashboard in Streamlit.
The problem was that I was hitting th... | [
{
"code": null,
"e": 455,
"s": 172,
"text": "It is straightforward now how to create a web app using Streamlit, but there are a lot of things that it doesn’t allow you to do yet. One of the major issues I faced recently was around caching when I was trying to use a News API to create an analytical n... |
Grunt - Sample File | In this chapter, let us create a simple Grunt file using the following plugins −
grunt-contrib-uglify
grunt-contrib-concat
grunt-contrib-jshint
grunt-contrib-watch
Install all the above plugins and follow the steps given below to create a simple Gruntfile.js −
Step 1 − You need to create a wrapper function, which encap... | [
{
"code": null,
"e": 1796,
"s": 1715,
"text": "In this chapter, let us create a simple Grunt file using the following plugins −"
},
{
"code": null,
"e": 1817,
"s": 1796,
"text": "grunt-contrib-uglify"
},
{
"code": null,
"e": 1838,
"s": 1817,
"text": "grunt-con... |
Teradata - User Management | This chapter discussed the various strategies of user management in Teradata.
A user is created using CREATE USER command. In Teradata, a user is also similar to a database. They both can be assigned space and contain database objects except that the user is assigned a password.
Following is the syntax for CREATE USER.... | [
{
"code": null,
"e": 2708,
"s": 2630,
"text": "This chapter discussed the various strategies of user management in Teradata."
},
{
"code": null,
"e": 2910,
"s": 2708,
"text": "A user is created using CREATE USER command. In Teradata, a user is also similar to a database. They bot... |
Finding the nth element of the lucas number sequence in JavaScript | Lucas numbers are numbers in a sequence defined like this −
L(0) = 2
L(1) = 1
L(n) = L(n-1) + L(n-2)
We are required to write a JavaScript function that takes in a number n and return the nth lucas number.
Following is the code −
Live Demo
const num = 21;
const lucas = (num = 1) => {
if (num === 0)
return 2;
... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "Lucas numbers are numbers in a sequence defined like this −"
},
{
"code": null,
"e": 1163,
"s": 1122,
"text": "L(0) = 2\nL(1) = 1\nL(n) = L(n-1) + L(n-2)"
},
{
"code": null,
"e": 1268,
"s": 1163,
"text": "We are r... |
What are Chrome Flags or Experiments? - GeeksforGeeks | 31 Mar, 2021
Chrome Flags also called Experiments are the experimental features that are provided by the Chrome browser but are not a part of the default chrome experience. Anyone can use them by following some simple steps and transform their chrome browsing experience. Some flags eventually become a part of the defa... | [
{
"code": null,
"e": 25037,
"s": 25006,
"text": " \n31 Mar, 2021\n"
},
{
"code": null,
"e": 25526,
"s": 25037,
"text": "Chrome Flags also called Experiments are the experimental features that are provided by the Chrome browser but are not a part of the default chrome experience. ... |
Radix sort in Javascript? | The radix sort algorithm distributes integers into buckets based on a number's significant digit or value (the radix). The radix is based on the number system of the values of the arrays. Let us look at how it can be implemented −
function radixSort(arr) {
// Find the max number and multiply it by 10 to get a number... | [
{
"code": null,
"e": 1293,
"s": 1062,
"text": "The radix sort algorithm distributes integers into buckets based on a number's significant digit or value (the radix). The radix is based on the number system of the values of the arrays. Let us look at how it can be implemented −"
},
{
"code": ... |
Testing Broken Authentication | When authentication functions related to the application are not implemented correctly, it allows hackers to compromise passwords or session ID's or to exploit other implementation flaws using other users credentials.
Let us understand Threat Agents, Attack Vectors, Security Weakness, Technical Impact and Business Impa... | [
{
"code": null,
"e": 2658,
"s": 2440,
"text": "When authentication functions related to the application are not implemented correctly, it allows hackers to compromise passwords or session ID's or to exploit other implementation flaws using other users credentials."
},
{
"code": null,
"e"... |
Decoding Ethereum smart contract data | by Yifei Huang | Towards Data Science | In the last two posts of this series, I described what crypto data is and why it is a unique and compelling opportunity. I strongly encourage reading these before continuing if you have not already, as they provide important context for understanding this post. In this post, we will get our hands dirty and discuss the ... | [
{
"code": null,
"e": 873,
"s": 172,
"text": "In the last two posts of this series, I described what crypto data is and why it is a unique and compelling opportunity. I strongly encourage reading these before continuing if you have not already, as they provide important context for understanding this... |
Exploratory Data Analysis in Julia - GeeksforGeeks | 12 Oct, 2020
Exploratory Data Analysis (EDA) is used for achieving a better understanding of data in terms of its main features, the significance of various variables, and the inter-variable relationships. The First step is to explore the dataset.
Methods to explore the given dataset in Julia:
Using data tables and a... | [
{
"code": null,
"e": 25814,
"s": 25786,
"text": "\n12 Oct, 2020"
},
{
"code": null,
"e": 26051,
"s": 25814,
"text": "Exploratory Data Analysis (EDA) is used for achieving a better understanding of data in terms of its main features, the significance of various variables, and the ... |
Functors and their use in Python - GeeksforGeeks | 22 Nov, 2020
Let’s understand Functors First:Functors are objects the that can be treated as though they are a function.
When to use functors?
Functors are used when you want to hide/abstract the real implementation. Let’s say you want to call the different functions depending on the input but you don’t want the user c... | [
{
"code": null,
"e": 25517,
"s": 25489,
"text": "\n22 Nov, 2020"
},
{
"code": null,
"e": 25625,
"s": 25517,
"text": "Let’s understand Functors First:Functors are objects the that can be treated as though they are a function."
},
{
"code": null,
"e": 25647,
"s": 25... |
How to convert list of dictionaries into Pyspark DataFrame ? - GeeksforGeeks | 30 May, 2021
In this article, we are going to discuss the creation of the Pyspark dataframe from the list of dictionaries.
We are going to create a dataframe in PySpark using a list of dictionaries with the help createDataFrame() method. The data attribute takes the list of dictionaries and columns attribute takes the ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n30 May, 2021"
},
{
"code": null,
"e": 25647,
"s": 25537,
"text": "In this article, we are going to discuss the creation of the Pyspark dataframe from the list of dictionaries."
},
{
"code": null,
"e": 25859,
"s": ... |
PyQt5 QDateEdit - Selecting Whole Date - GeeksforGeeks | 07 Jul, 2020
In this article we will see how we can select the whole date of the QDateEdit. User can set a date to the date edit with the help of cursor and the keyboard. Selecting date means the text of the date, selecting date is used for copying or overwriting the text of date edit.
In order to do this we use select... | [
{
"code": null,
"e": 26131,
"s": 26103,
"text": "\n07 Jul, 2020"
},
{
"code": null,
"e": 26405,
"s": 26131,
"text": "In this article we will see how we can select the whole date of the QDateEdit. User can set a date to the date edit with the help of cursor and the keyboard. Selec... |
Python | Numpy numpy.matrix.T() - GeeksforGeeks | 08 Apr, 2019
With the help of Numpy numpy.matrix.T() method, we can make a Transpose of any matrix either having dimension one or more than more.
Syntax : numpy.matrix.T()
Return : Return transpose of every matrix
Example #1 :In this example we can see that with the help of matrix.T() method, we are able to transform a... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n08 Apr, 2019"
},
{
"code": null,
"e": 25670,
"s": 25537,
"text": "With the help of Numpy numpy.matrix.T() method, we can make a Transpose of any matrix either having dimension one or more than more."
},
{
"code": null,
... |
pr command in Linux - GeeksforGeeks | 28 Jan, 2022
In Linux/Unix pr command is used to prepare a file for printing by adding suitable footers, headers, and the formatted text. pr command actually adds 5 lines of margin both at the top and bottom of the page. The header part shows the date and time of the last modification of the file with the file name an... | [
{
"code": null,
"e": 25893,
"s": 25865,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 26220,
"s": 25893,
"text": "In Linux/Unix pr command is used to prepare a file for printing by adding suitable footers, headers, and the formatted text. pr command actually adds 5 lines of ma... |
Strings in LISP - GeeksforGeeks | 30 Sep, 2021
A string is a set of characters. String are enclosed in double-quotes.
Example:
"hello geek","java","python" etc
Example: LISP program to display strings
Lisp
;edisplay hello geek(write-line "Hello Geek") ;display (write-line "Welcome to java")
Output:
Hello Geek
Welcome to java
Used to compare two stri... | [
{
"code": null,
"e": 24837,
"s": 24809,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 24910,
"s": 24837,
"text": "A string is a set of characters. String are enclosed in double-quotes. "
},
{
"code": null,
"e": 24919,
"s": 24910,
"text": "Example:"
},
... |
Nested if-else statement in R - GeeksforGeeks | 23 Sep, 2021
In this article, we will discuss the nested if-else statement in the R programming language.
The if-else statements can be nested together to form a group of statements and evaluate expressions based on the conditions one by one, beginning from the outer condition to the inner one by one respectively. An i... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 26580,
"s": 26487,
"text": "In this article, we will discuss the nested if-else statement in the R programming language."
},
{
"code": null,
"e": 26877,
"s": 26580,
"text"... |
How to create a Circular image view in Android without using any library? - GeeksforGeeks | 07 Aug, 2021
This article aims to help in how to make a circular image view on an image using the Android App. A simple circular image view can be made with white border and transparent content with shape without using any library.
Below are steps on how to do so:
Step 1: Creating the layout of the circular image vie... | [
{
"code": null,
"e": 26111,
"s": 26083,
"text": "\n07 Aug, 2021"
},
{
"code": null,
"e": 26331,
"s": 26111,
"text": "This article aims to help in how to make a circular image view on an image using the Android App. A simple circular image view can be made with white border and tr... |
Android Package Name vs Application ID - GeeksforGeeks | 23 Jul, 2021
As an Android Developer, you should know that the Package Name that you choose for your app is very important. We are referring to the Package Name of the application which we declare in the Manifest.xml rather than the Java package name (although they will be identical). But there is a difference between ... | [
{
"code": null,
"e": 26381,
"s": 26353,
"text": "\n23 Jul, 2021"
},
{
"code": null,
"e": 26848,
"s": 26381,
"text": "As an Android Developer, you should know that the Package Name that you choose for your app is very important. We are referring to the Package Name of the applicat... |
How to add a tooltip to a div using JavaScript? - GeeksforGeeks | 31 Jul, 2019
Adding tooltip to div element displays a pop-up, whenever the mouse hovers over div.
Syntax:
< div title = "" > </div> <script> $(document).ready(function() { $('[data-toggle="tooltip"]').tooltip(); }); </script>
Tooltip Methods:
.tooltip(“show”): It is used to show the tooltip.
.tooltip(“hide... | [
{
"code": null,
"e": 26189,
"s": 26161,
"text": "\n31 Jul, 2019"
},
{
"code": null,
"e": 26274,
"s": 26189,
"text": "Adding tooltip to div element displays a pop-up, whenever the mouse hovers over div."
},
{
"code": null,
"e": 26282,
"s": 26274,
"text": "Synta... |
MySQLi - Delete Query | If you want to delete a record from any MySQL table, then you can use the SQL command DELETE FROM. You can use this command at the mysql> prompt as well as in any script like PHP.
The following code block has a generic SQL syntax of the DELETE command to delete data from a MySQL table.
DELETE FROM table_name [WHERE Cla... | [
{
"code": null,
"e": 2443,
"s": 2263,
"text": "If you want to delete a record from any MySQL table, then you can use the SQL command DELETE FROM. You can use this command at the mysql> prompt as well as in any script like PHP."
},
{
"code": null,
"e": 2550,
"s": 2443,
"text": "Th... |
Finding Patterns In Data Using NMF | by Himanshu Sharma | Towards Data Science | NLP-Natural Language Processing is one of the hottest topics in the field of Artificial Intelligence. It helps in building applications like chatbots, voice assistants, sentiment analysis, recommendation engines, etc. It is a budding field where most related companies are investing and researching to create next-gen vo... | [
{
"code": null,
"e": 508,
"s": 172,
"text": "NLP-Natural Language Processing is one of the hottest topics in the field of Artificial Intelligence. It helps in building applications like chatbots, voice assistants, sentiment analysis, recommendation engines, etc. It is a budding field where most rela... |
Python - Tuple Exercises | Now you have learned a lot about tuples, and how to use them in Python.
Are you ready for a test?
Try to insert the missing part to make the code work as expected:
Print the first item in the fruits tuple.
fruits = ("apple", "banana", "cherry")
print()
Go to the Exercise section and test all of our Python Tuple Exerci... | [
{
"code": null,
"e": 72,
"s": 0,
"text": "Now you have learned a lot about tuples, and how to use them in Python."
},
{
"code": null,
"e": 98,
"s": 72,
"text": "Are you ready for a test?"
},
{
"code": null,
"e": 164,
"s": 98,
"text": "Try to insert the missing... |
How can I set a table in a JPanel in Java? | Let us first set rows and columns for our table −
String[][] rec = {
{ "1", "Steve", "AUS" },
{ "2", "Virat", "IND" },
{ "3", "Kane", "NZ" },
{ "4", "David", "AUS" },
{ "5", "Ben", "ENG" },
{ "6", "Eion", "ENG" },
};
String[] header = { "Rank", "Player", "Country" };
Now, set the above in a table as r... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "Let us first set rows and columns for our table −"
},
{
"code": null,
"e": 1348,
"s": 1112,
"text": "String[][] rec = {\n { \"1\", \"Steve\", \"AUS\" },\n { \"2\", \"Virat\", \"IND\" },\n { \"3\", \"Kane\", \"NZ\" },\n { \"4\... |
C# Program to find the largest element from an array | Declare an array −
int[] arr = { 20, 50, -35, 25, 60 };
Now to get the largest element from an array, use the Max() method −
arr.Max());
Here is the complete code −
Live Demo
using System;
using System.Linq;
class Demo {
static void Main() {
int[] arr = { 20, 50, -35, 25, 60 };
Console.WriteLine(arr.Max... | [
{
"code": null,
"e": 1081,
"s": 1062,
"text": "Declare an array −"
},
{
"code": null,
"e": 1118,
"s": 1081,
"text": "int[] arr = { 20, 50, -35, 25, 60 };"
},
{
"code": null,
"e": 1187,
"s": 1118,
"text": "Now to get the largest element from an array, use the M... |
How to filter an array in Java | You can use List.removeAll() method to filter an array.
import java.util.ArrayList;
import java.util.List;
public class Tester {
public static void main(String[] args) {
List<String> list = new ArrayList<>();
list.add("A");
list.add("B");
list.add("C");
list.add("D");
list.add("E... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "You can use List.removeAll() method to filter an array. "
},
{
"code": null,
"e": 1709,
"s": 1119,
"text": "import java.util.ArrayList;\nimport java.util.List;\npublic class Tester {\n public static void main(String[] args) {\n ... |
Generating/Expanding your datasets with synthetic data | by Archit Yadav | Towards Data Science | As an ML practitioner or a Data Scientist, it might have been possible when we found ourselves in a situation like “if only we had more data”. There are often times when the dataset that we have is very limited and aren’t sure if the performance of our machine learning model would have been better or worse if given mor... | [
{
"code": null,
"e": 743,
"s": 172,
"text": "As an ML practitioner or a Data Scientist, it might have been possible when we found ourselves in a situation like “if only we had more data”. There are often times when the dataset that we have is very limited and aren’t sure if the performance of our ma... |
Nearest Power | Practice | GeeksforGeeks | Given two integers N and M you have to find out an integer which is a power of M and is nearest to N.
Note: If there are multiple answers possible to, print the greatest number possible.
Example 1:
Input:
N = 6, M = 3
Output:
9
Explanation:
Both 3 (31) and 9 (32) are equally
near to 6. But 9 is greater,
so the Outpu... | [
{
"code": null,
"e": 426,
"s": 238,
"text": "Given two integers N and M you have to find out an integer which is a power of M and is nearest to N.\nNote: If there are multiple answers possible to, print the greatest number possible."
},
{
"code": null,
"e": 439,
"s": 428,
"text"... |
Shuffle an Array in Python | Suppose we have an array A, we have to shuffle a set of numbers without duplicates. So if the input is like [1,2,3], then for shuffling, it will be [1,3,2], after resetting, if we shuffle again, it will be [2,3,1]
To solve this, we will follow these steps −
There will be different methods. these are init(), reset(), sh... | [
{
"code": null,
"e": 1276,
"s": 1062,
"text": "Suppose we have an array A, we have to shuffle a set of numbers without duplicates. So if the input is like [1,2,3], then for shuffling, it will be [1,3,2], after resetting, if we shuffle again, it will be [2,3,1]"
},
{
"code": null,
"e": 13... |
Count alphanumeric palindromes of length N - GeeksforGeeks | 26 Apr, 2021
Given a positive integer N, the task is to find the number of alphanumeric palindromic strings of length N. Since the count of such strings can be very large, print the answer modulo 109 + 7.
Examples:
Input: N = 2Output: 62Explanation: There are 26 palindromes of the form {“AA”, “BB”, ..., “ZZ”}, 26 palin... | [
{
"code": null,
"e": 25780,
"s": 25752,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 25972,
"s": 25780,
"text": "Given a positive integer N, the task is to find the number of alphanumeric palindromic strings of length N. Since the count of such strings can be very large, prin... |
How to add footnote under the X-axis using Matplotlib? | To add footnote under the X-axis using matplotlib, we can use figtext() and text() method.
Set the figure size and adjust the padding between and around the subplots.
Create x and y data points using numpy.
Plot x and y data points using numpy.
To place the footnote, use figtext() method with x, y position and box prop... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "To add footnote under the X-axis using matplotlib, we can use figtext() and text() method."
},
{
"code": null,
"e": 1229,
"s": 1153,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"... |
File structures (sequential files, indexing, B and B+ trees) - GeeksforGeeks | 09 Oct, 2019
Here block size is 10^3 B.
No. of entries in the FAT = Disk capacity/ Block size
= 10^8/10^3
= 10^5
Total space consumed by FAT = 10^5 *4B
= 0.4*10^6B
Max. size of file that can be stored = 100*10^6-0.4*10^6
... | [
{
"code": null,
"e": 29600,
"s": 29572,
"text": "\n09 Oct, 2019"
},
{
"code": null,
"e": 29958,
"s": 29600,
"text": "Here block size is 10^3 B.\nNo. of entries in the FAT = Disk capacity/ Block size \n = 10^8/10^3 \n = 10^5\nTotal... |
Delete Cookies On All Domains using Selenium Webdriver. | We can delete cookies on all domains with Selenium. The method deleteAllCookies is used to delete all cookies from the present domain. First, we shall add cookies, then get them and finally delete all the cookies.
driver.manage().deleteAllCookies();
import java.util.Set;
import org.openqa.selenium.WebDriver;
import org... | [
{
"code": null,
"e": 1276,
"s": 1062,
"text": "We can delete cookies on all domains with Selenium. The method deleteAllCookies is used to delete all cookies from the present domain. First, we shall add cookies, then get them and finally delete all the cookies."
},
{
"code": null,
"e": 13... |
Difference between DELETE, DROP and TRUNCATE - GeeksforGeeks | 24 Dec, 2021
Basically, it is a Data Manipulation Language Command (DML). It is used to delete one or more tuples of a table. With the help of the “DELETE” command, we can either delete all the rows in one go or can delete rows one by one. i.e., we can use it as per the requirement or the condition using the Where clau... | [
{
"code": null,
"e": 24073,
"s": 24045,
"text": "\n24 Dec, 2021"
},
{
"code": null,
"e": 24503,
"s": 24073,
"text": "Basically, it is a Data Manipulation Language Command (DML). It is used to delete one or more tuples of a table. With the help of the “DELETE” command, we can eith... |
File renameTo() method in Java with examples - GeeksforGeeks | 28 Jan, 2019
The renameTo() method is a part of File class. The renameTo() function is used to rename the abstract path name of a File to a given path name. The function returns true if the file is renamed else returns false
Function Signature:
public boolean renameTo(File destination)
Syntax:
file.renameTo(File destin... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n28 Jan, 2019"
},
{
"code": null,
"e": 24160,
"s": 23948,
"text": "The renameTo() method is a part of File class. The renameTo() function is used to rename the abstract path name of a File to a given path name. The function return... |
Set cellpadding and cellspacing in CSS - GeeksforGeeks | 04 Dec, 2018
Cell Padding
The cell padding is used to define the spaces between the cells and its border. If cell padding property is not apply then it will be set as default value.
Example:
<!DOCTYPE html><html> <head> <title>cell padding</title> <style> table, th, td { borde... | [
{
"code": null,
"e": 24275,
"s": 24247,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 24288,
"s": 24275,
"text": "Cell Padding"
},
{
"code": null,
"e": 24444,
"s": 24288,
"text": "The cell padding is used to define the spaces between the cells and its borde... |
Creating an Ethereum Token to Enable a Decentralized Rent-to-Own Network | by Evan Diewald | Towards Data Science | Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.
With real estate pri... | [
{
"code": null,
"e": 472,
"s": 172,
"text": "Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking profession... |
How to catch EnvironmentError Exception in Python? | EnvironmentError is the base class for errors that come from outside of Python (the operating system, filesystem, etc.). EnvironmentError Exception is a subclass of the StandarError class. It is the base class for IOError and OSError exceptions. It is not actually raised unlike its subclass errors like IOError and OSEr... | [
{
"code": null,
"e": 1387,
"s": 1062,
"text": "EnvironmentError is the base class for errors that come from outside of Python (the operating system, filesystem, etc.). EnvironmentError Exception is a subclass of the StandarError class. It is the base class for IOError and OSError exceptions. It is n... |
Using PyFlux To Predict Temperature Data | by Michael Grogan | Towards Data Science | PyFlux is a time series library built for Python, which integrates probability modelling with time series analysis.
In this example, let us see how this library can be used to predict temperature patterns for Dublin Airport, Ireland, using monthly data from November 1941 — January 2018.
Here is a short overview of the ... | [
{
"code": null,
"e": 288,
"s": 172,
"text": "PyFlux is a time series library built for Python, which integrates probability modelling with time series analysis."
},
{
"code": null,
"e": 460,
"s": 288,
"text": "In this example, let us see how this library can be used to predict te... |
What is overloading in C#? | C# provides two techniques to implement static polymorphism −
Function overloading
Operator overloading
Two or more than two methods having the same name but different parameters is what we call function overloading in C#.
Function overloading in C# can be performed by changing the number of arguments and the data type... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "C# provides two techniques to implement static polymorphism −"
},
{
"code": null,
"e": 1145,
"s": 1124,
"text": "Function overloading"
},
{
"code": null,
"e": 1166,
"s": 1145,
"text": "Operator overloading"
},
... |
How to create a new column in an R data frame based on some condition of another column? | Sometimes we want to change a column or create a new by using other columns of a data frame in R, this is mostly required when we want to create a categorical column but it can be done for numerical columns as well. For example, we might want to create a column based on salary for which if salaries are greater than the... | [
{
"code": null,
"e": 1639,
"s": 1062,
"text": "Sometimes we want to change a column or create a new by using other columns of a data frame in R, this is mostly required when we want to create a categorical column but it can be done for numerical columns as well. For example, we might want to create ... |
Anomaly Detection in Process Control Data with Machine Learning | by Nicholas Lewis | Towards Data Science | Anomaly detection is a powerful application of machine learning in a real-world situation. From detecting fraudulent transactions to forecasting component failure, we can train a machine learning model to determine when something out of the ordinary is occurring.
When it comes to machine learning, I’m a huge advocate f... | [
{
"code": null,
"e": 435,
"s": 171,
"text": "Anomaly detection is a powerful application of machine learning in a real-world situation. From detecting fraudulent transactions to forecasting component failure, we can train a machine learning model to determine when something out of the ordinary is oc... |
What are sealed modifiers in C#? | When you use sealed modifiers in C# on a method, then the method loses its capabilities of overriding. The sealed method should be part of a derived class and the method must be an overridden method.
Let us see an example −
The following example won’t allow you to override the method display() because it has a sealed m... | [
{
"code": null,
"e": 1262,
"s": 1062,
"text": "When you use sealed modifiers in C# on a method, then the method loses its capabilities of overriding. The sealed method should be part of a derived class and the method must be an overridden method."
},
{
"code": null,
"e": 1286,
"s": 1... |
Convert C/C++ code to assembly language | Here we will see how to generate assembly language output from C or C++ source code using gcc.
The gcc provides a great feature to get all intermediate outputs from a source code while executing. To get the assembler output we can use the option ‘-S’ for the gcc. This option shows the output after compiling, but before... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "Here we will see how to generate assembly language output from C or C++ source code using gcc."
},
{
"code": null,
"e": 1451,
"s": 1157,
"text": "The gcc provides a great feature to get all intermediate outputs from a source code whi... |
Add the element in a Python list with help of indexing | A python list is a collection data type that is ordered and changeable. Also, it allows duplicate members. It is the most frequently used collection data type used in Python programs. We will see how we can add an element to a list using the index feature.
But before adding the element in an existing link, let's access... | [
{
"code": null,
"e": 1319,
"s": 1062,
"text": "A python list is a collection data type that is ordered and changeable. Also, it allows duplicate members. It is the most frequently used collection data type used in Python programs. We will see how we can add an element to a list using the index featu... |
Find column with maximum sum in a Matrix using C++. | Suppose we have a matrix of size M x N. We have to find the column, that has a maximum sum. In this program we will not follow some tricky approach, we will traverse the array column-wise, then get the sum of each column, if the sum is the max, then print the sum and the column index.
#include<iostream>
#define M 5
#de... | [
{
"code": null,
"e": 1348,
"s": 1062,
"text": "Suppose we have a matrix of size M x N. We have to find the column, that has a maximum sum. In this program we will not follow some tricky approach, we will traverse the array column-wise, then get the sum of each column, if the sum is the max, then pri... |
How to change the state of react component on click? - GeeksforGeeks | 11 Feb, 2022
To change the state of the React component is useful when you are working on a single page application, it simply replaces the content of the existing component for the user without reloading the webpage.
We have to set initial state value inside constructor function and set click event handler of the ele... | [
{
"code": null,
"e": 27142,
"s": 27114,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 27348,
"s": 27142,
"text": "To change the state of the React component is useful when you are working on a single page application, it simply replaces the content of the existing component fo... |
Setting up PostgreSQL in Debian-based Linux | by Colton Magnant | Towards Data Science | In trying to set up a PostgreSQL server in my Linux boxes to practice SQL commands on my own, I ran into a few snags along the way, so I decided to put together this tutorial for my future self in case I ever needed to install again. After installing the base system, I was also able to obtain a dump from a small test d... | [
{
"code": null,
"e": 595,
"s": 172,
"text": "In trying to set up a PostgreSQL server in my Linux boxes to practice SQL commands on my own, I ran into a few snags along the way, so I decided to put together this tutorial for my future self in case I ever needed to install again. After installing the ... |
Flatten 2D Vector in C++ | Suppose we have a 2D vector, we have to design and implement an iterator to flatten that 2d vector. There will be different methods as follows −
next() − This will return the next element of the current element
next() − This will return the next element of the current element
hasNext() − This will check whether next el... | [
{
"code": null,
"e": 1207,
"s": 1062,
"text": "Suppose we have a 2D vector, we have to design and implement an iterator to flatten that 2d vector. There will be different methods as follows −"
},
{
"code": null,
"e": 1273,
"s": 1207,
"text": "next() − This will return the next el... |
Python Dictionaries: Everything You Need to Know | by Dario Radečić | Towards Data Science | Dictionaries are awesome. They allow you to store and structure nested data in a clean and easy-to-access way. Today we’ll explore everything there is to Python dictionaries and see how you can use them to structure your applications.
Don’t feel like reading? Check out my video on the topic:
Dictionaries are somewhat s... | [
{
"code": null,
"e": 407,
"s": 172,
"text": "Dictionaries are awesome. They allow you to store and structure nested data in a clean and easy-to-access way. Today we’ll explore everything there is to Python dictionaries and see how you can use them to structure your applications."
},
{
"code"... |
Change Image Dynamically when User Scrolls Down | Set 2 - GeeksforGeeks | 05 Jun, 2020
Change Image Dynamically when User Scrolls using JavaScript | Set 1
There may be situations where the image would need to change dynamically based on the user’s input. In this case, when the user scrolls down.
Approach:
Setting up a scroll event listener to know the user has scrolled the page.
Calculating ... | [
{
"code": null,
"e": 25068,
"s": 25040,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 25136,
"s": 25068,
"text": "Change Image Dynamically when User Scrolls using JavaScript | Set 1"
},
{
"code": null,
"e": 25278,
"s": 25136,
"text": "There may be situation... |
Array of Doubled Pairs in C++ | Suppose we have an array of integers A with even length, now we have to say true if and only if it is possible to reorder it in such a way that A[2 * i + 1] = 2 * A[2 * i] for every 0 <= i < len(A) / 2. So if the input is like [3,1,3,6] then the result will be false, where as [4,-2,2,-4], will return true.
To solve thi... | [
{
"code": null,
"e": 1370,
"s": 1062,
"text": "Suppose we have an array of integers A with even length, now we have to say true if and only if it is possible to reorder it in such a way that A[2 * i + 1] = 2 * A[2 * i] for every 0 <= i < len(A) / 2. So if the input is like [3,1,3,6] then the result ... |
How To Change The Size Of Figures In Matplotlib | Towards Data Science | Resizing figures generated through matplotlib in Python is a common task when it comes to visualizing data. In today’s short guide we will discuss a few possible ways for adjusting the size of the generated plots.
Specifically, we will discuss how to do so:
Using matplotlib.pyplot.figure()
Using set_size_inches()
by mo... | [
{
"code": null,
"e": 386,
"s": 172,
"text": "Resizing figures generated through matplotlib in Python is a common task when it comes to visualizing data. In today’s short guide we will discuss a few possible ways for adjusting the size of the generated plots."
},
{
"code": null,
"e": 430,... |
Nth Fibonacci Number | Practice | GeeksforGeeks | Given a positive integer n, find the nth fibonacci number. Since the answer can be very large, return the answer modulo 1000000007.
Example 1:
Input: n = 2
Output: 1
Explanation: 1 is the 2nd number
of fibonacci series.
Example 2:
Input: n = 5
Output: 5
Explanation: 5 is the 5th number
of fibonacci series.
Your Ta... | [
{
"code": null,
"e": 382,
"s": 238,
"text": "Given a positive integer n, find the nth fibonacci number. Since the answer can be very large, return the answer modulo 1000000007.\n\nExample 1:"
},
{
"code": null,
"e": 461,
"s": 382,
"text": "Input: n = 2\nOutput: 1 \nExplanation: 1... |
spaCy - Train Command | As name implies, this command will train a model. The output will be in spaCy’s JSON format and on every epoch the model will be saved out to the directory.
To package the model using spaCy package command, model details and accuracy scores will be added to meta.json file.
The Train command is as follows:
python -m spa... | [
{
"code": null,
"e": 2229,
"s": 2072,
"text": "As name implies, this command will train a model. The output will be in spaCy’s JSON format and on every epoch the model will be saved out to the directory."
},
{
"code": null,
"e": 2346,
"s": 2229,
"text": "To package the model usin... |
SortedSet Class in C# | The SortedSet class in C# represents a collection of objects that is maintained in sorted order.
Following are the properties of the SortedSet class −
Following are some of the methods of the SortedSet class −
Let us now see some examples −
To check if the SortedSet contains a specific element, the code is as follows −... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "The SortedSet class in C# represents a collection of objects that is maintained in sorted order."
},
{
"code": null,
"e": 1213,
"s": 1159,
"text": "Following are the properties of the SortedSet class −"
},
{
"code": null,
... |
Tryit Editor v3.7 | Tryit: HTML link to stylesheet | [] |
WebGL - Geometry | After obtaining the WebGL context, you have to define the geometry for the primitive (object you want to draw) and store it. In WebGL, we define the details of a geometry – for example, vertices, indices, color of the primitive – using JavaScript arrays. To pass these details to the shader programs, we have to create t... | [
{
"code": null,
"e": 2473,
"s": 2047,
"text": "After obtaining the WebGL context, you have to define the geometry for the primitive (object you want to draw) and store it. In WebGL, we define the details of a geometry – for example, vertices, indices, color of the primitive – using JavaScript arrays... |
Spotlighting Data in Simple Little Tables | by Michael Demastrie | Towards Data Science | When presenting tabular data, we often want to bring attention to a particular cell. This focus improves the visual support we want from our tables and keeps the audience from feeling overwhelmed by the breadth of the data contained in the whole set of values. Still, we want to present the key information in the contex... | [
{
"code": null,
"e": 649,
"s": 172,
"text": "When presenting tabular data, we often want to bring attention to a particular cell. This focus improves the visual support we want from our tables and keeps the audience from feeling overwhelmed by the breadth of the data contained in the whole set of va... |
time.Time.Date() Function in Golang with Examples - GeeksforGeeks | 19 Apr, 2020
In Go language, time packages supplies functionality for determining as well as viewing time. The Time.Date() function in Go language is used to check the year, month, and day in which the stated “t” presents itself. Moreover, this function is defined under the time package. Here, you need to import the “t... | [
{
"code": null,
"e": 24069,
"s": 24041,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 24422,
"s": 24069,
"text": "In Go language, time packages supplies functionality for determining as well as viewing time. The Time.Date() function in Go language is used to check the year, mo... |
First time fine-tuning BERT framework | Towards Data Science | My interest in the field of NLP started when I decided to participate in one of the ongoing competition of identifying whether the given tweet is about any disaster or not. I was not having any experience in the field of language processing, and after a few internet searches, I came to know about some of the text prepr... | [
{
"code": null,
"e": 1024,
"s": 172,
"text": "My interest in the field of NLP started when I decided to participate in one of the ongoing competition of identifying whether the given tweet is about any disaster or not. I was not having any experience in the field of language processing, and after a ... |
Sum of squares of binomial coefficients in C++ | The binomial coefficient is a quotation found in a binary theorem which can be arranged in a form of pascal triangle it is a combination of numbers which is equal to nCr where r is selected from a set of n items which shows the following formula
nCr=n! / r!(n-r)!
or
nCr=n(n-1)(n-2).....(n-r+1) / r!
The sum of the squar... | [
{
"code": null,
"e": 1308,
"s": 1062,
"text": "The binomial coefficient is a quotation found in a binary theorem which can be arranged in a form of pascal triangle it is a combination of numbers which is equal to nCr where r is selected from a set of n items which shows the following formula"
},
... |
How to catch IndexError Exception in Python? | An IndexError is raised when a sequence reference is out of range.
The given code is rewritten as follows to catch the exception and find its type
import sys
try:
my_list = [3,7, 9, 4, 6]
print my_list[6]
except IndexError as e:
print e
print sys.exc_type
C:/Users/TutorialsPoint1~.py
list index out of range
<type 'exce... | [
{
"code": null,
"e": 1129,
"s": 1062,
"text": "An IndexError is raised when a sequence reference is out of range."
},
{
"code": null,
"e": 1209,
"s": 1129,
"text": "The given code is rewritten as follows to catch the exception and find its type"
},
{
"code": null,
"e"... |
MongoDB query to search for string like “@email” in the field values | Search for email string using MongoDB find(). Let us create a collection with documents −
> db.demo727.insertOne({UserId:"John@email.com"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5eab375f43417811278f5898")
}
> db.demo727.insertOne({UserId:"John@yahoo.com"});
{
"acknowledged" : true,
"insertedId"... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "Search for email string using MongoDB find(). Let us create a collection with documents −"
},
{
"code": null,
"e": 1561,
"s": 1152,
"text": "> db.demo727.insertOne({UserId:\"John@email.com\"});\n{\n \"acknowledged\" : true,\n \"i... |
Requests - Handling Timeouts | Timeouts can be easily added to the URL you are requesting. It so happens that, you are using a third-party URL and waiting for a response. It is always a good practice to give a timeout on the URL, as we might want the URL to respond within a timespan with a response or an error. Not doing so, can cause to wait on tha... | [
{
"code": null,
"e": 2532,
"s": 2188,
"text": "Timeouts can be easily added to the URL you are requesting. It so happens that, you are using a third-party URL and waiting for a response. It is always a good practice to give a timeout on the URL, as we might want the URL to respond within a timespan ... |
Python | Raising an Exception to Another Exception - GeeksforGeeks | 12 Jun, 2019
Let’s consider a situation where we want to raise an exception in response to catching a different exception but want to include information about both exceptions in the traceback.
To chain exceptions, use the raise from statement instead of a simple raise statement. This will give you information about bo... | [
{
"code": null,
"e": 24368,
"s": 24340,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 24549,
"s": 24368,
"text": "Let’s consider a situation where we want to raise an exception in response to catching a different exception but want to include information about both exceptions ... |
MySQL query to create user and grant permission | To create a user and grant permission, the syntax is as follows −
create database yourDatabaseName DEFAULT CHARACTER SET utf8;
create user `yourUserName` identified by yourPassword;
GRANT SELECT ON yourDatabaseName .* TO `yourUserName`;
GRANT INSERT ON yourDatabaseName .* TO `yourUserName`;
GRANT UPDATE ON yourDatabase... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "To create a user and grant permission, the syntax is as follows −"
},
{
"code": null,
"e": 1521,
"s": 1128,
"text": "create database yourDatabaseName DEFAULT CHARACTER SET utf8;\ncreate user `yourUserName` identified by yourPassword;... |
How to work with JSON in Python for Data Analysis | Towards Data Science | In this blog post, we are going to learn about JSON. We are going to learn what JSON is, why it exists, why people use it and finally how to utilise the power of python to help us process it.
As a data scientist, programmer or simply an avid learner of technology, it is important that you understand what JSON is and ho... | [
{
"code": null,
"e": 239,
"s": 47,
"text": "In this blog post, we are going to learn about JSON. We are going to learn what JSON is, why it exists, why people use it and finally how to utilise the power of python to help us process it."
},
{
"code": null,
"e": 465,
"s": 239,
"tex... |
Applying Custom Functions to Groups of Data in Pandas | by Casey Whorton | Towards Data Science | Here, I will share with you two different methods for applying custom functions to groups of data in pandas. There are many out-of-the-box aggregate and filtering functions available for us to use already, but those don’t always do everything we want. Sometimes, when I want to know “what was the second most recent obse... | [
{
"code": null,
"e": 642,
"s": 171,
"text": "Here, I will share with you two different methods for applying custom functions to groups of data in pandas. There are many out-of-the-box aggregate and filtering functions available for us to use already, but those don’t always do everything we want. Som... |
Difference between Cost Performance Index (CPI) and Schedule Performance Index (SPI) - GeeksforGeeks | 16 May, 2019
Cost Performance Index (CPI):Cost Performance Index (CPI) is the measure of the cost efficiency of project. It is expressed as a ratio of earned value to actual cost.
Schedule Performance Index (SPI):Schedule Performance Index (SPI) is the measure of schedule efficiency of the project. It is expressed as t... | [
{
"code": null,
"e": 24798,
"s": 24770,
"text": "\n16 May, 2019"
},
{
"code": null,
"e": 24965,
"s": 24798,
"text": "Cost Performance Index (CPI):Cost Performance Index (CPI) is the measure of the cost efficiency of project. It is expressed as a ratio of earned value to actual co... |
How to check if a string starts with a substring using regex in Python? - GeeksforGeeks | 29 Dec, 2020
Prerequisite: Regular Expression in Python
Given a string str, the task is to check if a string starts with a given substring or not using regular expression.
Examples:
Input: String: "geeks for geeks makes learning fun"
Substring: "geeks"
Output: True
Input: String: "geeks for geeks makes learni... | [
{
"code": null,
"e": 24888,
"s": 24860,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 24931,
"s": 24888,
"text": "Prerequisite: Regular Expression in Python"
},
{
"code": null,
"e": 25047,
"s": 24931,
"text": "Given a string str, the task is to check if a s... |
SLF4J - Environment Setup | In this chapter, we will explain how to set SLF4J environment in Eclipse IDE. Before proceeding with the installation, make sure that you already have Eclipse installed in your system. If not, download and install Eclipse.
For more information on Eclipse, please refer our Eclipse Tutorial
Open the official homepage of ... | [
{
"code": null,
"e": 2008,
"s": 1785,
"text": "In this chapter, we will explain how to set SLF4J environment in Eclipse IDE. Before proceeding with the installation, make sure that you already have Eclipse installed in your system. If not, download and install Eclipse."
},
{
"code": null,
... |
How to get the data attributes of an element using JavaScript ? - GeeksforGeeks | 08 Dec, 2021
In this article, we will learn to get the element’s data attribute in Javascript. Given an HTML document and the task is to select the data attributes of an element using JavaScript. There are a few methods to solve this problem which are given below:
Using the dataset property
Using .getAttribute() method... | [
{
"code": null,
"e": 25159,
"s": 25131,
"text": "\n08 Dec, 2021"
},
{
"code": null,
"e": 25411,
"s": 25159,
"text": "In this article, we will learn to get the element’s data attribute in Javascript. Given an HTML document and the task is to select the data attributes of an elemen... |
Area of a n-sided regular polygon with given Radius? | Here we will see how to get the area of an n-sided regular polygon whose radius is given. Here the radius is the distance from the center of any vertex. To solve this problem, we have drawn one perpendicular from the center to one side. Let each side is of length ‘a’. The perpendicular is dividing the side into two par... | [
{
"code": null,
"e": 1508,
"s": 1062,
"text": "Here we will see how to get the area of an n-sided regular polygon whose radius is given. Here the radius is the distance from the center of any vertex. To solve this problem, we have drawn one perpendicular from the center to one side. Let each side is... |
How to Customize Toast in Android? - GeeksforGeeks | 08 Oct, 2021
A Toast is a feedback message. It takes very little space for displaying and it is displayed on top of the main content of an activity, and only remains visible for a short time period. In this article, we will learn how to customize Toast in android. So, we will understand this by making a simple app to d... | [
{
"code": null,
"e": 26491,
"s": 26463,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 26814,
"s": 26491,
"text": "A Toast is a feedback message. It takes very little space for displaying and it is displayed on top of the main content of an activity, and only remains visible fo... |
Production Planning and Resource Management of Manufacturing Systems in Python | by Will Keefe | Towards Data Science | It’s no secret that supply chain management is one of the biggest areas of focus for improvement in today’s global economy. Getting goods from destination A to destination B is challenging enough, but manufacturing enough materials is equivocally arduous, with shortages in silicon chips and pharmaceutical assemblies ca... | [
{
"code": null,
"e": 518,
"s": 172,
"text": "It’s no secret that supply chain management is one of the biggest areas of focus for improvement in today’s global economy. Getting goods from destination A to destination B is challenging enough, but manufacturing enough materials is equivocally arduous,... |
How To Change The Column Names Of PySpark DataFrames | Towards Data Science | In today’s short guide we will discuss 4 ways for changing the name of columns in a Spark DataFrame. Specifically, we are going to explore how to do so using:
selectExpr() method
withColumnRenamed() method
toDF() method
alias
Spark Session and Spark SQL
and rename one or more columns at a time.
First, let’s create an e... | [
{
"code": null,
"e": 331,
"s": 172,
"text": "In today’s short guide we will discuss 4 ways for changing the name of columns in a Spark DataFrame. Specifically, we are going to explore how to do so using:"
},
{
"code": null,
"e": 351,
"s": 331,
"text": "selectExpr() method"
},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.