title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Perfect Number | 22 Mar, 2022
A number is a perfect number if is equal to sum of its proper divisors, that is, sum of its positive divisors excluding the number itself. Write a function to check if a given number is perfect or not. Examples:
Input: n = 15
Output: false
Divisors of 15 are 1, 3 and 5. Sum of
divisors is 9 which is not ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Mar, 2022"
},
{
"code": null,
"e": 265,
"s": 52,
"text": "A number is a perfect number if is equal to sum of its proper divisors, that is, sum of its positive divisors excluding the number itself. Write a function to check if a give... |
Python | Size Range Combinations in list | 23 Jan, 2020
The problem of finding the combinations of list elements of specific size has been discussed. But sometimes, we require more and we wish to have all the combinations of elements of all sizes in range between i and j. Let’s discuss certain ways in which this function can be performed.
Method #1 : Using list... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 313,
"s": 28,
"text": "The problem of finding the combinations of list elements of specific size has been discussed. But sometimes, we require more and we wish to have all the combinations of elemen... |
How to sort a list in C# | List.Sort() Method Set -1 | 12 Feb, 2019
List<T>.Sort() Method is used to sort the elements or a portion of the elements in the List<T> using either the specified or default IComparer<T> implementation or a provided Comparison<T> delegate to compare list elements. There are total 4 methods in the overload list of this method as follows:
Sort(ICom... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Feb, 2019"
},
{
"code": null,
"e": 326,
"s": 28,
"text": "List<T>.Sort() Method is used to sort the elements or a portion of the elements in the List<T> using either the specified or default IComparer<T> implementation or a provided ... |
Python program to Sort a List of Strings by the Number of Unique Characters | 01 Oct, 2020
Given a list of strings. The task is to sort the list of strings by the number of unique characters.
Examples:
Input : test_list = [‘gfg’, ‘best’, ‘for’, ‘geeks’], Output : [‘gfg’, ‘for’, ‘best’, ‘geeks’] Explanation : 2, 3, 4, 4 are unique elements in lists.
Input : test_list = [‘gfg’, ‘for’, ‘geeks’], Ou... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 129,
"s": 28,
"text": "Given a list of strings. The task is to sort the list of strings by the number of unique characters."
},
{
"code": null,
"e": 139,
"s": 129,
"text": "Examp... |
Navigation Bars in Flask | 26 May, 2022
Navigation across HTML pages is quite a common way to work across pages. The client-side navigation approach is commonly used in HTML. However, having custom server-end navigations can provide greater flexibilities as far as customizations are concerned. This article walks you through a way to integrate Se... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2022"
},
{
"code": null,
"e": 379,
"s": 28,
"text": "Navigation across HTML pages is quite a common way to work across pages. The client-side navigation approach is commonly used in HTML. However, having custom server-end naviga... |
Python – Create acronyms from words | 21 Jun, 2022
Given a string, the task is to write a Python program to extract the acronym from that string.
Examples:
Input: Computer Science Engineering
Output: CSE
Input: geeks for geeks
Output: GFG
Input: Uttar pradesh
Output: UP
Approach 1:
The following steps are required:
Take input as a string.
Add the first let... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 149,
"s": 54,
"text": "Given a string, the task is to write a Python program to extract the acronym from that string."
},
{
"code": null,
"e": 159,
"s": 149,
"text": "Examples:"... |
Python | sympy.integrate() using limits | 12 Jun, 2019
With the help of sympy.integrate(expression, limit) method, we can find the integration of mathematical expressions using limits in the form of variables by using sympy.integrate(expression, limit) method.
Syntax : sympy.integrate(expression, reference variable, limit)Return : Return integration of mathema... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 234,
"s": 28,
"text": "With the help of sympy.integrate(expression, limit) method, we can find the integration of mathematical expressions using limits in the form of variables by using sympy.integr... |
GATE | GATE CS 2011 | Question 4 | 16 Mar, 2018
Consider different activities related to email:
m1: Send an email from a mail client to a mail server
m2: Download an email from mailbox server to a mail client
m3: Checking email in a web browser
Which is the application level protocol used in each activity?(A) m1: HTTP m2: SMTP m3: POP(B) m1: SMTP m2: FT... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n16 Mar, 2018"
},
{
"code": null,
"e": 101,
"s": 53,
"text": "Consider different activities related to email:"
},
{
"code": null,
"e": 250,
"s": 101,
"text": "m1: Send an email from a mail client to a mail server\nm2... |
Find Median of List in Python | 03 Oct, 2019
Sometimes, while working with Python list we can have a problem in which we need to find Median of list. This problem is quite common in the mathematical domains and generic calculations. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using loop + "~" operatorThis task can be p... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n03 Oct, 2019"
},
{
"code": null,
"e": 305,
"s": 53,
"text": "Sometimes, while working with Python list we can have a problem in which we need to find Median of list. This problem is quite common in the mathematical domains and generic ... |
How to read large text files in Python? | 29 Dec, 2020
Python is an open-source dynamically typed and interpreted programming language. Reading and writing files are an integral part of programming. In Python, files are read by using the readlines() method. The readlines() method returns a list where each item of the list is a complete sentence in the file. Th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 1134,
"s": 28,
"text": "Python is an open-source dynamically typed and interpreted programming language. Reading and writing files are an integral part of programming. In Python, files are read by u... |
Sum of the first N Prime numbers | 23 Mar, 2021
Given an integer ‘n’, the task is to find the sum of first ‘n’ prime numbers.
First few prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, ......
Examples:
Input: N = 4
Output: 17
2, 3, 5, 7 are first 4 prime numbers so their sum is equal to 17
Input: N = 40
Output: 3087
Approach:
Create a sieve whi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Mar, 2021"
},
{
"code": null,
"e": 133,
"s": 54,
"text": "Given an integer ‘n’, the task is to find the sum of first ‘n’ prime numbers. "
},
{
"code": null,
"e": 201,
"s": 133,
"text": "First few prime numbers ar... |
How to iterate HashSet in Java? | 15 Feb, 2022
HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage. It stores information by using a mechanism called hashing. In hashing, the informational content of a key is used to determine a unique value, called its hash code.
There are three simp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 315,
"s": 28,
"text": "HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage. It stores information by using a mechanism called has... |
Python | os.scandir() method - GeeksforGeeks | 08 Aug, 2021
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system-dependent functionality.
The os.scandir() method in Python is used to get an iterator of os.DirEntry objects corr... | [
{
"code": null,
"e": 24236,
"s": 24208,
"text": "\n08 Aug, 2021"
},
{
"code": null,
"e": 24455,
"s": 24236,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable... |
Powershell - Hashtables | Hashtable stores key/value pairs in a hash table. When using a Hashtable, you specify an object that is used as a key, and the value that you want linked to that key. Generally we used String or numbers as keys.
This tutorial introduces how to declare hashtable variables, create hashtables, and process hashtable using ... | [
{
"code": null,
"e": 2246,
"s": 2034,
"text": "Hashtable stores key/value pairs in a hash table. When using a Hashtable, you specify an object that is used as a key, and the value that you want linked to that key. Generally we used String or numbers as keys."
},
{
"code": null,
"e": 2367... |
How to bind to port number less than 1024 with non root access? - GeeksforGeeks | 26 Sep, 2017
Why are the first 1024 ports restricted to the root user only?
Binding is an integral step for server side socket. It’s like providing some address to end-user (server). So, we assign an IP address and a port number for running a server. But we can not provide any random port number to a server. The port n... | [
{
"code": null,
"e": 24232,
"s": 24204,
"text": "\n26 Sep, 2017"
},
{
"code": null,
"e": 24295,
"s": 24232,
"text": "Why are the first 1024 ports restricted to the root user only?"
},
{
"code": null,
"e": 24657,
"s": 24295,
"text": "Binding is an integral step... |
Remove repeated digits in a given number - GeeksforGeeks | 20 Jan, 2022
Given an integer, remove consecutive repeated digits from it.Examples:
Input: x = 12224
Output: 124
Input: x = 124422
Output: 1242
Input: x = 11332
Output: 132
We need to process all digits of n and remove consecutive representations. We can go through all digits by repeatedly dividing n with 10 and ta... | [
{
"code": null,
"e": 24776,
"s": 24748,
"text": "\n20 Jan, 2022"
},
{
"code": null,
"e": 24849,
"s": 24776,
"text": "Given an integer, remove consecutive repeated digits from it.Examples: "
},
{
"code": null,
"e": 24940,
"s": 24849,
"text": "Input: x = 12224\... |
Structure declaration in C language | The structure is a collection of different datatype variables, grouped together under a single name. It is a heterogeneous collection of data items that share a common name.
It is possible to copy the contents of all structural elements of different data types to another structure variable of its type by using an assig... | [
{
"code": null,
"e": 1236,
"s": 1062,
"text": "The structure is a collection of different datatype variables, grouped together under a single name. It is a heterogeneous collection of data items that share a common name."
},
{
"code": null,
"e": 1398,
"s": 1236,
"text": "It is po... |
Draw a Hut using turtle module in Python - GeeksforGeeks | 30 Aug, 2021
Turtle is a inbuilt module in Python, which has many functions like forward(), backward(), right() and left() etc. You can draw a hut on the screen just by using the turtle module in Python. In this article, we will create a hut using the turtle module.
Approach:
Import turtleSet the background color.Defin... | [
{
"code": null,
"e": 24318,
"s": 24290,
"text": "\n30 Aug, 2021"
},
{
"code": null,
"e": 24572,
"s": 24318,
"text": "Turtle is a inbuilt module in Python, which has many functions like forward(), backward(), right() and left() etc. You can draw a hut on the screen just by using t... |
CSS Flexbox and Its Properties - GeeksforGeeks | 03 Dec, 2020
Before we dive in to CSS Flexbox, let us learn about Pre Flexbox
Pre Flexbox: A recap of some properties in CSS which might be related to learning Flexbox.
We have different positional properties such as ‘absolute’ and ‘relative’ depending on how we want to place our elements in our page.
Floats, grids, cl... | [
{
"code": null,
"e": 25376,
"s": 25348,
"text": "\n03 Dec, 2020"
},
{
"code": null,
"e": 25441,
"s": 25376,
"text": "Before we dive in to CSS Flexbox, let us learn about Pre Flexbox"
},
{
"code": null,
"e": 25532,
"s": 25441,
"text": "Pre Flexbox: A recap of s... |
iText - Adding a Table | In this chapter, we will see how to create a PDF document and add a table to it using the iText library.
You can create an empty PDF Document by instantiating the Document class. While instantiating this class, you need to pass a PdfDocument object as a parameter to its constructor. Then, to add a table to the document... | [
{
"code": null,
"e": 2473,
"s": 2368,
"text": "In this chapter, we will see how to create a PDF document and add a table to it using the iText library."
},
{
"code": null,
"e": 2790,
"s": 2473,
"text": "You can create an empty PDF Document by instantiating the Document class. Whi... |
Convert a NumPy array into a csv file - GeeksforGeeks | 02 Sep, 2020
In this article, we are going to see different methods to save an NumPy array into a CSV file. CSV file format is the easiest and useful format for storing data
There are different methods by which we can save the NumPy array into a CSV file
Method 1: Using Dataframe.to_csv().
This method is used to write ... | [
{
"code": null,
"e": 24489,
"s": 24461,
"text": "\n02 Sep, 2020"
},
{
"code": null,
"e": 24650,
"s": 24489,
"text": "In this article, we are going to see different methods to save an NumPy array into a CSV file. CSV file format is the easiest and useful format for storing data"
... |
Flutter - Ephemeral State Management | Since Flutter application is composed of widgets, the state management is also done by widgets. The entry point of the state management is Statefulwidget. Widget can be inherited from Statefulwidget to maintain its state and its children state. Statefulwidget provides an option for a widget to create a state, State (wh... | [
{
"code": null,
"e": 2847,
"s": 2218,
"text": "Since Flutter application is composed of widgets, the state management is also done by widgets. The entry point of the state management is Statefulwidget. Widget can be inherited from Statefulwidget to maintain its state and its children state. Stateful... |
Bootstrap lead class | The lead class in Bootstrap is used to add emphasis to a paragraph.
You can try to run the following code to implement the lead class in Bootstrap −
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap lead class</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "The lead class in Bootstrap is used to add emphasis to a paragraph."
},
{
"code": null,
"e": 1211,
"s": 1130,
"text": "You can try to run the following code to implement the lead class in Bootstrap −"
},
{
"code": null,
"... |
How to convert a Base64 string into a Bitmap image in Android app? | This example demonstrates how to do I in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://s... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "This example demonstrates how to do I in android."
},
{
"code": null,
"e": 1241,
"s": 1112,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project."
... |
Bidirectional Associative Memory (BAM) Implementation from Scratch - GeeksforGeeks | 06 Oct, 2021
Prerequisite: ANN | Bidirectional Associative Memory (BAM) Learning AlgorithmTo implement BAM model, here are some essential consideration and approach-
Consider the value of M, as BAM will be constructed with M pairs of patterns. Here the value of M is 4.Set A: Input PatternsSet B: Corresponding Target ... | [
{
"code": null,
"e": 24484,
"s": 24456,
"text": "\n06 Oct, 2021"
},
{
"code": null,
"e": 24639,
"s": 24484,
"text": "Prerequisite: ANN | Bidirectional Associative Memory (BAM) Learning AlgorithmTo implement BAM model, here are some essential consideration and approach- "
},
... |
How to use Meta Tag to redirect an HTML page? - GeeksforGeeks | 17 Oct, 2019
URL redirection, also called URL forwarding is a way to send users to a different URL from the one they originally requested. The three most commonly used redirects are 301, 302, and Meta Refresh.Meta Refresh Redirect is a client-side redirect. Unlike 301 and 302 redirects that happen on the webserver, Met... | [
{
"code": null,
"e": 24920,
"s": 24892,
"text": "\n17 Oct, 2019"
},
{
"code": null,
"e": 25612,
"s": 24920,
"text": "URL redirection, also called URL forwarding is a way to send users to a different URL from the one they originally requested. The three most commonly used redirect... |
Find N random points within a Circle - GeeksforGeeks | 07 Feb, 2022
Given four integers N, R, X, and Y such that it represents a circle of radius R with [X, Y] as coordinates of the center. The task is to find N random points inside or on the circle. Examples:
Input: R = 12, X = 3, Y = 3, N = 5 Output: (7.05, -3.36) (5.21, -7.49) (7.53, 0.19) (-2.37, 12.05) (1.45, 11.80)In... | [
{
"code": null,
"e": 25354,
"s": 25326,
"text": "\n07 Feb, 2022"
},
{
"code": null,
"e": 25547,
"s": 25354,
"text": "Given four integers N, R, X, and Y such that it represents a circle of radius R with [X, Y] as coordinates of the center. The task is to find N random points insid... |
JupyterLab - Installing R Kernel | Project Jupyter now supports kernels of programming environments. We shall now see how to install R kernel in anaconda distribution.
In Anaconda prompt window enter following command −
conda install -c r r-essentials
Now, from the launcher tab, choose R kernel to start a new notebook.
The following is a screenshot of ... | [
{
"code": null,
"e": 2793,
"s": 2660,
"text": "Project Jupyter now supports kernels of programming environments. We shall now see how to install R kernel in anaconda distribution."
},
{
"code": null,
"e": 2845,
"s": 2793,
"text": "In Anaconda prompt window enter following command... |
Spring Boot Kafka Consume JSON Messages Example - onlinetutorialspoint | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
This tutorial helps you to understand how to ... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
ANOVA and the Bonferroni Correction | by Michael Grogan | Towards Data Science | Performing a hypothesis test comes with the risk of obtaining either a Type 1 or Type 2 error.
Type 1 error: Rejecting a true null hypothesis
Type 2 error: Accepting a false null hypothesis
When analysing different groups, a one-way ANOVA can tell us if there is a statistically significant difference between those grou... | [
{
"code": null,
"e": 267,
"s": 172,
"text": "Performing a hypothesis test comes with the risk of obtaining either a Type 1 or Type 2 error."
},
{
"code": null,
"e": 314,
"s": 267,
"text": "Type 1 error: Rejecting a true null hypothesis"
},
{
"code": null,
"e": 362,
... |
Java sql.Timestamp valueOf() method with example | The valueOf() method of the java.sql.Timestamp class accepts a String value representing a time stamp in JDBC escape format and converts the given String value into Timestamp object.
Timestamp timeStamp = Time.valueOf("timeStamp_string");
Let us create a table with name dispatches_data in MySQL database using CREATE st... | [
{
"code": null,
"e": 1245,
"s": 1062,
"text": "The valueOf() method of the java.sql.Timestamp class accepts a String value representing a time stamp in JDBC escape format and converts the given String value into Timestamp object."
},
{
"code": null,
"e": 1301,
"s": 1245,
"text": ... |
A Single Line of Python Code Scraping Dataset from Webpages | by Christopher Tao | Towards Data Science | No matter what level of data science/analytics skills we have, you cannot do anything without datasets.
Indeed, there are many open-source datasets such as Kaggle and Data.world. However, they are more suitable to be used for exercises and learning purposes, but may not satisfy our general needs.
Usually, data scientis... | [
{
"code": null,
"e": 276,
"s": 172,
"text": "No matter what level of data science/analytics skills we have, you cannot do anything without datasets."
},
{
"code": null,
"e": 470,
"s": 276,
"text": "Indeed, there are many open-source datasets such as Kaggle and Data.world. However... |
Find element in a sorted array whose frequency is greater than or equal to n/2. - GeeksforGeeks | 15 Apr, 2021
Given a sorted array of length n, find the number in array that appears more than or equal to n/2 times. It is given that such element always exists.Examples:
Input : 2 3 3 4
Output : 3
Input : 3 4 5 5 5
Output : 5
Input : 1 1 1 2 3
Output : 1
To find that number, we traverse the array and check t... | [
{
"code": null,
"e": 26569,
"s": 26541,
"text": "\n15 Apr, 2021"
},
{
"code": null,
"e": 26730,
"s": 26569,
"text": "Given a sorted array of length n, find the number in array that appears more than or equal to n/2 times. It is given that such element always exists.Examples: "
... |
How to perform Merge Sort using C#? | Merge Sort is a sorting algorithm that uses the divide and conquer method. It divides the array into two parts and then calls itself for each of these two parts. This process is continued until the array is sorted.
A program that demonstrates merge sort in C# is given as follows −
Live Demo
using System;
namespace Qui... | [
{
"code": null,
"e": 1277,
"s": 1062,
"text": "Merge Sort is a sorting algorithm that uses the divide and conquer method. It divides the array into two parts and then calls itself for each of these two parts. This process is continued until the array is sorted."
},
{
"code": null,
"e": 1... |
Palindrome | Practice | GeeksforGeeks | Given an integer, check whether it is a palindrome or not.
Example 1:
Input: n = 55555
Output: Yes
Example 2:
Input: n = 123
Output: No
Your Task:
You don't need to read or print anything. Your task is to complete the function is_palindrome() which takes the number as input parameter and returns "Yes" if it is pa... | [
{
"code": null,
"e": 309,
"s": 238,
"text": "Given an integer, check whether it is a palindrome or not.\n\nExample 1:"
},
{
"code": null,
"e": 339,
"s": 309,
"text": "Input: n = 55555\nOutput: Yes\n"
},
{
"code": null,
"e": 351,
"s": 339,
"text": "\nExample 2:... |
Circular Queue | Theory of Computation
In Circular queue, elements in a queue are arranged in a circular way. In this front and rear ends are joined
together, which solves the dequeue re buffering problem and prevents excessive use of memory. It also follows the FIFO principle.
Suppose we have a linear queue. Now if we want to inser... | [
{
"code": null,
"e": 112,
"s": 90,
"text": "Theory of Computation"
},
{
"code": null,
"e": 355,
"s": 112,
"text": "In Circular queue, elements in a queue are arranged in a circular way. In this front and rear ends are joined \ntogether, which solves the dequeue re buffering probl... |
The easiest and fastest way to make GIFs and math videos with Python | by Bruno Rodrigues | Towards Data Science | “Celluloid, Easy Matplotlib Animations”
I really enjoy working with data visualization and I always wonder what’s the best way to provide more direct and intuitive visual interactions when I have to explain some result or complex model.
Lately, I’ve been growing to use GIFs and quick videos. Even if this makes the codi... | [
{
"code": null,
"e": 87,
"s": 47,
"text": "“Celluloid, Easy Matplotlib Animations”"
},
{
"code": null,
"e": 284,
"s": 87,
"text": "I really enjoy working with data visualization and I always wonder what’s the best way to provide more direct and intuitive visual interactions when ... |
Adding two polynomials using Linked List - GeeksforGeeks | 07 Apr, 2022
Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers.Example:
Input:
1st number = 5x2 + 4x1 + 2x0
2nd number = -5x1 - 5x0
Output:
5x2-1x1-3x0
Input:
1st number = 5x3 + 4x2 + 2x0
... | [
{
"code": null,
"e": 25324,
"s": 25296,
"text": "\n07 Apr, 2022"
},
{
"code": null,
"e": 25489,
"s": 25324,
"text": "Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers.Example: ... |
Securing API Keys with Environment Variables Using Anaconda | by Raymond Willey | Towards Data Science | If you are reading this, I assume you are already familiar with APIs, tokens, private keys, and public keys. Your private and public keys serve as a form of authentication to identify you and track your activity with a developer’s API. What this means is that, if someone got ahold of your keys, they could access data i... | [
{
"code": null,
"e": 566,
"s": 172,
"text": "If you are reading this, I assume you are already familiar with APIs, tokens, private keys, and public keys. Your private and public keys serve as a form of authentication to identify you and track your activity with a developer’s API. What this means is ... |
Difference between super and super() in Java with Examples - GeeksforGeeks | 14 Sep, 2021
In java it is predefined that the ‘super’ word is somewhere related to the parent class. If we need to brief and justify the title in one go then the super keyword in java refers to dealing with parent class object while super() deals with parent class constructor. We will be covering the article first dis... | [
{
"code": null,
"e": 24882,
"s": 24854,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 25263,
"s": 24882,
"text": "In java it is predefined that the ‘super’ word is somewhere related to the parent class. If we need to brief and justify the title in one go then the super keyword... |
MySQL Tryit Editor v1.0 | Edit the SQL Statement, and click "Run SQL" to see the result.
This SQL-Statement is not supported in the WebSQL Database.
The example still works, because it uses a modified version of SQL.
Your browser does not support WebSQL.
Your are now using a light-version of the Try-SQL Editor, with a read-only Database.
If you... | [
{
"code": null,
"e": 88,
"s": 25,
"text": "Edit the SQL Statement, and click \"Run SQL\" to see the result."
},
{
"code": null,
"e": 148,
"s": 88,
"text": "This SQL-Statement is not supported in the WebSQL Database."
},
{
"code": null,
"e": 216,
"s": 148,
"tex... |
ML Algorithm to Predict Stock Price | by Sarit Maitra | Towards Data Science | ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nAlgorithmic trading expected to follow rules, and furthermore, they can form objective, unbiased estimates of risk and represent a revolution in both the art and theory of finance.\nHere, we will see how machine learning can solve the puzzle of forecasting which will be forecasting the difference between today’s price and tomorrow’s price (which is unknown).\nThe data can be loaded through open API provided by world trade data. The financial time-series problem is quite complex from the ML perspective. We need to think about financial data structures more than about particular events like open, high, low and close.\n# Plot the Opening pricesdataset['Open'].plot(grid=True, figsize=(10, 6))plt.title('Nasdaq Composite open price')plt.ylabel('price ($)')# Show the plotplt.show()\nLet’s start preparing the data for the analysis. I will create some features based on short window simple moving average.\nHigh Low % provides some percent volatility in the market.\npercent change reflects the daily percent change\n1 day window open price.\nCurrent day volume increment.\nCurrent day volume rate of change.\nCurrent day open price increment.\nopen price.\nNow, we keep the relevant attributes in the data-frame which are predictor variables here.\nInstead of dropping all NaN values we have replaced NaN with some number which will be treated as outlier in the data-set. We will try gradient boosted trees which in general being robust to outliers.\nLet’s define our target variable. we will have a classification variable because the average price will either go up or down the next day. So, we will target to predict the difference between today’s price and tomorrow’s price.\nFrom the correlation plot below, we have an idea that some of the attributes are correlated with each other and may not be required for the model. However, we will identify this later from gradient boosting feature importance plot.\n# Checking Correlation for easy understandingsns.set(style='darkgrid', context='talk', palette='Dark2')plt.figure(figsize=(14,5))dataset.corr()['Open'].sort_values(ascending = False).plot(kind='bar')plt.show()\nOur data-set has a total of 5158 samples, and 10 features. We have used time-series cross validator which provides train/test indices to split time series data samples that are observed at fixed time intervals. In each split, test indices must be higher than before, and thus shuffling in cross validator is inappropriate.\nprint('Total dataset has {} samples, and {} features.'.format(dataset.shape[0], dataset.shape[1]))X = (dataset.drop(['target'], 1))y = (dataset['target'])print(len(X), len(y))X = np.array(dataset.drop(['target', 'open1'], 1)) # dropping openy = np.array(dataset['target'])#timeseries splittscv = TimeSeriesSplit(max_train_size=None, n_splits=5)for train_samples, test_samples in tscv.split(X): #print(\"TRAIN:\", train_samples, \"TEST:\", test_samples) X_train, X_test = X[train_samples], X[test_samples] y_train, y_test = y[train_samples], y[test_samples]#separating features namesfeature_names = ['ma1','ma2','ma3','HL','pct_change','vol_increment','open_increment','Open']X_train = pd.DataFrame(data=X_train, columns=feature_names)X_test = pd.DataFrame(data=X_test, columns=feature_names)print(X_train.shape, y_train.shape, X_test.shape, y_test.shape)\nLet us convert the target variable to binary classification. A positive change in the value of prices will be classified as 1 and a non-positive change as 0.\ny_train = pd.DataFrame(y_train) # converting to data framey_train.rename(columns = {0: 'target'}, inplace=True)y_test = pd.DataFrame(y_test)y_test.rename(columns = {0: 'target'}, inplace=True)def getBinary(val): if val>0: return 1 else: return 0y_test_binary = pd.DataFrame(y_test[\"target\"].apply(getBinary))\nWe will initiate XGB regressor to test the model. fit the training set\nOur model accuracy score is 78.81% and can predict the daily price change (average) for next 8 trading days .\nIt is relatively easy and straight forward to retrieve importance score for each features once the boosted trees are constructed. This importance is calculated explicitly for each attribute in the data-set, allowing attributes to be ranked and compared to each other.\nWe can see from the feature importance plot that, not all the features are really important for the algorithm to perform; so, we can probably run the algorithm with just 4 features to attain the same accuracy score. The model can be further trained discarding attributes with no correlation.\nThis is a simple model with no big complexities involved and the model attained quite a decent accuracy score. So, we can see that, no longer do we need to rely on descriptive statistics of human outputs as a sort of loose justification of inference.\nI can be reached here." | [
{
"code": null,
"e": 89,
"s": 46,
"text": "https://sarit-maitra.medium.com/membership"
},
{
"code": null,
"e": 270,
"s": 89,
"text": "Algorithmic trading expected to follow rules, and furthermore, they can form objective, unbiased estimates of risk and represent a revolution in b... |
How can we MySQL LOAD DATA INFILE statement with ‘ENCLOSED BY’ option to import data from text file into MySQL table? | Sometimes the input text files have the text fields enclosed by double quotes and to import data from such kind of files we need to use the ‘ENCLOSED BY’ option with LOAD DATA INFILE statement. We are considering the following example to make it understand −
Followings are the comma-separated values in A.txt file −
100... | [
{
"code": null,
"e": 1321,
"s": 1062,
"text": "Sometimes the input text files have the text fields enclosed by double quotes and to import data from such kind of files we need to use the ‘ENCLOSED BY’ option with LOAD DATA INFILE statement. We are considering the following example to make it underst... |
AVRO - Environment Setup | Apache software foundation provides Avro with various releases. You can download the required release from Apache mirrors. Let us see, how to set up the environment to work with Avro −
To download Apache Avro, proceed with the following −
Open the web page Apache.org. You will see the homepage of Apache Avro as shown b... | [
{
"code": null,
"e": 2046,
"s": 1861,
"text": "Apache software foundation provides Avro with various releases. You can download the required release from Apache mirrors. Let us see, how to set up the environment to work with Avro −"
},
{
"code": null,
"e": 2100,
"s": 2046,
"text"... |
Python Pandas - GroupBy | Any groupby operation involves one of the following operations on the original object. They are −
Splitting the Object
Splitting the Object
Applying a function
Applying a function
Combining the results
Combining the results
In many situations, we split the data into sets and we apply some functionality on each subset. ... | [
{
"code": null,
"e": 2541,
"s": 2443,
"text": "Any groupby operation involves one of the following operations on the original object. They are −"
},
{
"code": null,
"e": 2562,
"s": 2541,
"text": "Splitting the Object"
},
{
"code": null,
"e": 2583,
"s": 2562,
"... |
AAA (Authentication, Authorization and Accounting) configuration (locally) - GeeksforGeeks | 10 Mar, 2022
Prerequisite – AAA (Authentication, Authorization and Accounting) To provide security to access network resources, AAA is used. AAA is a standard based framework used to control who is permitted to use network resources (through authentication), what they are authorized to do (through authorization) and ca... | [
{
"code": null,
"e": 24432,
"s": 24404,
"text": "\n10 Mar, 2022"
},
{
"code": null,
"e": 24818,
"s": 24432,
"text": "Prerequisite – AAA (Authentication, Authorization and Accounting) To provide security to access network resources, AAA is used. AAA is a standard based framework u... |
Stream Editor - Basic Commands | This chapter describes several useful SED commands.
SED provides various commands to manipulate text. Let us first explore about the delete command. Here is how you execute a delete command:
[address1[,address2]]d
address1 and address2 are the starting and the ending addresses respectively, which can be either line n... | [
{
"code": null,
"e": 1875,
"s": 1823,
"text": "This chapter describes several useful SED commands."
},
{
"code": null,
"e": 2014,
"s": 1875,
"text": "SED provides various commands to manipulate text. Let us first explore about the delete command. Here is how you execute a delete ... |
C - Pointer to Pointer | A pointer to a pointer is a form of multiple indirection, or a chain of pointers. Normally, a pointer contains the address of a variable. When we define a pointer to a pointer, the first pointer contains the address of the second pointer, which points to the location that contains the actual value as shown below.
A var... | [
{
"code": null,
"e": 2399,
"s": 2084,
"text": "A pointer to a pointer is a form of multiple indirection, or a chain of pointers. Normally, a pointer contains the address of a variable. When we define a pointer to a pointer, the first pointer contains the address of the second pointer, which points t... |
Sharpe Ratio, Sortino Ratio and Calmar Ratio | by Shuo Wang | Towards Data Science | In portfolio performance analysis, sharpe ratio is the usually the first number that people look at. However, it does not tell us the whole story (nothing does...). So, let’s spend some time looking at a few more metrics that can be very helpful at times.
Sharpe ratio is the ratio of average return divided by the stand... | [
{
"code": null,
"e": 428,
"s": 172,
"text": "In portfolio performance analysis, sharpe ratio is the usually the first number that people look at. However, it does not tell us the whole story (nothing does...). So, let’s spend some time looking at a few more metrics that can be very helpful at times.... |
NPDA for L = {0i1j2k | i==j or j==k ; i , j , k >= 1} - GeeksforGeeks | 31 Aug, 2018
Prerequisite – Pushdown automata, Pushdown automata acceptance by final stateThe language L = {0i1j2k | i==j or j==k ; i , j , k >= 1} tells that every string of ‘0’, ‘1’ and ‘2’ have certain number of 0’s, then certain number of 1’s and then certain number of 2’s. The condition is that count of each of th... | [
{
"code": null,
"e": 29810,
"s": 29782,
"text": "\n31 Aug, 2018"
},
{
"code": null,
"e": 30336,
"s": 29810,
"text": "Prerequisite – Pushdown automata, Pushdown automata acceptance by final stateThe language L = {0i1j2k | i==j or j==k ; i , j , k >= 1} tells that every string of ‘... |
Basics of Markov Chain Monte Carlo Algorithms | by Sheharyar Akhtar | Towards Data Science | Markov Chain Monte Carlo is a group of algorithms used to map out the posterior distribution by sampling from the posterior distribution. The reason we use this method instead of the quadratic approximation method is because when we encounter distributions that have multiple peaks, it is possible that the algorithm wil... | [
{
"code": null,
"e": 773,
"s": 172,
"text": "Markov Chain Monte Carlo is a group of algorithms used to map out the posterior distribution by sampling from the posterior distribution. The reason we use this method instead of the quadratic approximation method is because when we encounter distribution... |
Display tick marks in a JSlider with Java | To display tick marks in a JSlider, you need to use the setPaintTicks() method and set it to TRUE −
JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 75);
slider.setPaintTicks(true);
The following is an example to display tick marks in a slider in Java −
package my;
import java.awt.Color;
import java.awt.Font;
i... | [
{
"code": null,
"e": 1162,
"s": 1062,
"text": "To display tick marks in a JSlider, you need to use the setPaintTicks() method and set it to TRUE −"
},
{
"code": null,
"e": 1252,
"s": 1162,
"text": "JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 75);\nslider.setPaintTick... |
Getting Started with Comet ML. An overview of the popular... | by Angelica Lo Duca | Towards Data Science | Comet ML is an experimentation platform, which permits testing Machine Learning projects, from the beginning up to the final monitoring. Many other similar platforms exist on the Web, including Neptune.ai, Guild.ai, Sacred, and so on.
Comet ML can be easily integrated with the most popular Machine Learning libraries, i... | [
{
"code": null,
"e": 407,
"s": 172,
"text": "Comet ML is an experimentation platform, which permits testing Machine Learning projects, from the beginning up to the final monitoring. Many other similar platforms exist on the Web, including Neptune.ai, Guild.ai, Sacred, and so on."
},
{
"code"... |
Python | Remove empty tuples from a list | When it is required to remove empty tuples from a list of tuples, a simple loop can be used.
A list can be used to store heterogeneous values (i.e data of any data type like integer, floating point, strings, and so on).
A list of tuple basically contains tuples enclosed in a list.
Below is a demonstration for the same ... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "When it is required to remove empty tuples from a list of tuples, a simple loop can be used."
},
{
"code": null,
"e": 1282,
"s": 1155,
"text": "A list can be used to store heterogeneous values (i.e data of any data type like integer,... |
Univariate Outlier Detection in Python | by Philip Wilkinson | Towards Data Science | Outlier detection can often be an important part of any exploratory data analysis. This is because in the real world, data is often messy and many different things can affect the underlying data. It is thus important to be able to identify different methods to be able to identify these from the underlying data.
The fir... | [
{
"code": null,
"e": 485,
"s": 172,
"text": "Outlier detection can often be an important part of any exploratory data analysis. This is because in the real world, data is often messy and many different things can affect the underlying data. It is thus important to be able to identify different metho... |
Computer Graphics - Quick Guide | Computer graphics is an art of drawing pictures on computer screens with the help of programming. It involves computations, creation, and manipulation of data. In other words, we can say that computer graphics is a rendering tool for the generation and manipulation of images.
The primary output device in a graphical sy... | [
{
"code": null,
"e": 2196,
"s": 1919,
"text": "Computer graphics is an art of drawing pictures on computer screens with the help of programming. It involves computations, creation, and manipulation of data. In other words, we can say that computer graphics is a rendering tool for the generation and ... |
Assigning an integer to float and comparison in C/C++ - GeeksforGeeks | 29 May, 2017
Consider the below C++ program and predict the output.
#include <iostream>using namespace std; int main(){ float f = 0xffffffff; unsigned int x = 0xffffffff; // Value 4294967295 if (f == x) cout << "true"; else cout << "false"; return 0;}
The output of above program is false... | [
{
"code": null,
"e": 24154,
"s": 24126,
"text": "\n29 May, 2017"
},
{
"code": null,
"e": 24209,
"s": 24154,
"text": "Consider the below C++ program and predict the output."
},
{
"code": "#include <iostream>using namespace std; int main(){ float f = 0xffffffff; unsi... |
PyQt5 StringSpinBox - Looping the strings - GeeksforGeeks | 17 May, 2020
In this article we will see how we can make the string values repeat themselves when the last value reaches it should go back to the first value similarly when value is decremented after first value it should go back to the last value. In order to do this we have to change the custom class code of the Stri... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n17 May, 2020"
},
{
"code": null,
"e": 24530,
"s": 24212,
"text": "In this article we will see how we can make the string values repeat themselves when the last value reaches it should go back to the first value similarly when val... |
Continuous Genetic Algorithm From Scratch With Python | by Cahit bartu yazıcı | Towards Data Science | Genetic algorithm is a powerful optimization technique that was inspired by nature. Genetic algorithms mimic evolution to find the best solution. Unlike most optimization algorithms, genetic algorithms do not use derivatives to find the minima. One of the most significant advantages of genetic algorithms is their abili... | [
{
"code": null,
"e": 889,
"s": 172,
"text": "Genetic algorithm is a powerful optimization technique that was inspired by nature. Genetic algorithms mimic evolution to find the best solution. Unlike most optimization algorithms, genetic algorithms do not use derivatives to find the minima. One of the... |
Convert an ArrayList of String to a String array in Java | At first, let us set an ArrayList of string −
ArrayList<String> arrList = new ArrayList<String>();
arrList.add("Bentley");
arrList.add("Audi");
arrList.add("Jaguar");
arrList.add("Cadillac");
Now, use toArray() to convert to a string array −
int size = arrList.size();
String res[] = arrList.toArray(new String[size]);
F... | [
{
"code": null,
"e": 1108,
"s": 1062,
"text": "At first, let us set an ArrayList of string −"
},
{
"code": null,
"e": 1254,
"s": 1108,
"text": "ArrayList<String> arrList = new ArrayList<String>();\narrList.add(\"Bentley\");\narrList.add(\"Audi\");\narrList.add(\"Jaguar\");\narrLi... |
Programming examples of 6800 | Now, in this section, we will see how we can use the Motorola M6800 Microprocessor to add multi-Byte numbers.
AddingMulti-Byte Number
In this example, we are using 4-Byte numbers (56 2F 7A 89)16 and (21 FB A9 AF)16
In the memory, at first, we are storing the Byte counts, and then the numbers (from least significant Byt... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "Now, in this section, we will see how we can use the Motorola M6800 Microprocessor to add multi-Byte numbers."
},
{
"code": null,
"e": 1196,
"s": 1172,
"text": "AddingMulti-Byte Number"
},
{
"code": null,
"e": 1277,
"... |
Create a BigDecimal via string in Java | Let us see how we can create BigDecimal values via string. Here, we have set string as a parameter to the BigDecimal constructor.
BigDecimal val1 = new BigDecimal("375789755.345778656");
BigDecimal val2 = new BigDecimal("525678755.155778656");
We can also perform mathematical operations on it −
val2 = val2.subtract(val... | [
{
"code": null,
"e": 1192,
"s": 1062,
"text": "Let us see how we can create BigDecimal values via string. Here, we have set string as a parameter to the BigDecimal constructor."
},
{
"code": null,
"e": 1306,
"s": 1192,
"text": "BigDecimal val1 = new BigDecimal(\"375789755.3457786... |
Electron - Packaging Apps | Packaging and distributing apps is an integral part of the development process of a desktop application. Since Electron is a cross-platform desktop application development framework, packaging and distribution of apps for all the platforms should also be a seamless experience.
The electron community has created a proje... | [
{
"code": null,
"e": 2343,
"s": 2065,
"text": "Packaging and distributing apps is an integral part of the development process of a desktop application. Since Electron is a cross-platform desktop application development framework, packaging and distribution of apps for all the platforms should also b... |
Explain the difference between undefined and not defined in JavaScript - GeeksforGeeks | 18 Aug, 2021
In JavaScript, they both are related to memory space and there is a very simple difference between them. If the variable name which is being accessed doesn’t exist in memory space then it would be not defined, and if exists in memory space but hasn’t been assigned any value till now, then it would be undef... | [
{
"code": null,
"e": 24909,
"s": 24881,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 25222,
"s": 24909,
"text": "In JavaScript, they both are related to memory space and there is a very simple difference between them. If the variable name which is being accessed doesn’t exist... |
Perl substr Function | This function returns a substring of EXPR, starting at OFFSET within the string. If OFFSET is negative, starts that many characters from the end of the string. If LEN is specified, returns that number of bytes, or all bytes up until end-of-string if not specified. If LEN is negative, leaves that many characters off the... | [
{
"code": null,
"e": 2560,
"s": 2220,
"text": "This function returns a substring of EXPR, starting at OFFSET within the string. If OFFSET is negative, starts that many characters from the end of the string. If LEN is specified, returns that number of bytes, or all bytes up until end-of-string if not... |
Data Link Layer in OSI Model - GeeksforGeeks | 28 Jun, 2021
Below are some common GATE CS topics of data link layer.
Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access or CSMA method was developed to minimize the probability of collision and thus, to increase the performance. The probability of collision can be minimized if a station senses or reads... | [
{
"code": null,
"e": 24543,
"s": 24515,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24600,
"s": 24543,
"text": "Below are some common GATE CS topics of data link layer."
},
{
"code": null,
"e": 24637,
"s": 24600,
"text": "Carrier Sense Multiple Access (CS... |
3 Ways To Create Tables With Apache Spark | by AnBento | Towards Data Science | A few of my readers have contacted me asking for on-demand courses to learn more about Apache Spark. These are 3 great resources I would recommend:
Data Streaming With Apache Kafka & Apache Spark Nanodegree (Udacity)
Data Engineering Nanodegree (Udacity)
Distributed Computing With Spark SQL (Coursera)
Apache Spark is a... | [
{
"code": null,
"e": 320,
"s": 172,
"text": "A few of my readers have contacted me asking for on-demand courses to learn more about Apache Spark. These are 3 great resources I would recommend:"
},
{
"code": null,
"e": 389,
"s": 320,
"text": "Data Streaming With Apache Kafka & Apa... |
Python | List of float to string conversion | 29 Oct, 2019
Sometimes, while working with Python list, we can have a problem in which we have to transform the list elements to string. This is easier in case of integral list, as they can be joined easily with join(), and their contents can be displayed. But the case with floats is different, there are additional und... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2019"
},
{
"code": null,
"e": 465,
"s": 28,
"text": "Sometimes, while working with Python list, we can have a problem in which we have to transform the list elements to string. This is easier in case of integral list, as they ca... |
Median of two sorted arrays of same size | 06 Jul, 2022
There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging the above 2 arrays(i.e. array of length 2n). The complexity should be O(log(n)).
Note: Since the size of the set for which we are looking for the median is even (2n), we need to take... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 258,
"s": 52,
"text": "There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging the above 2 arrays(i.e. array of length 2n). The c... |
Pyscaffold module in Python | 19 Nov, 2021
Starting off with a Python project is usually quite complex and complicated as it involves setting up and configuring some files. This is where Pyscaffold comes in. It is a tool to set up a new python project, is very easy to use and sets up your project in less than 10 seconds! To use Pyscaffold, Git is a... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Nov, 2021"
},
{
"code": null,
"e": 824,
"s": 52,
"text": "Starting off with a Python project is usually quite complex and complicated as it involves setting up and configuring some files. This is where Pyscaffold comes in. It is a t... |
The OFFSETOF() macro | 21 Jun, 2022
We know that the elements in a structure will be stored in sequential order of their declaration. How to extract the displacement of an element in a structure? We can make use of offsetof macro. Usually we call structure and union types (or classes with trivial constructors) as plain old data (POD) types, ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 550,
"s": 52,
"text": "We know that the elements in a structure will be stored in sequential order of their declaration. How to extract the displacement of an element in a structure? We can make us... |
HTML frameset Tag | 17 Mar, 2022
The <frameset> tag in HTML is used to define the frameset. The <frameset> element contains one or more frame elements. It is used to specify the number of rows and columns in frameset with their pixel of spaces. Each element can hold a separate document.
Note: The <frameset> tag is not supported in HTML5.... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Mar, 2022"
},
{
"code": null,
"e": 308,
"s": 52,
"text": "The <frameset> tag in HTML is used to define the frameset. The <frameset> element contains one or more frame elements. It is used to specify the number of rows and columns in... |
UGC-NET | UGC NET CS 2016 Aug – II | Question 38 | 11 Apr, 2018
Consider a system having ‘m’ resources of the same type. These resources are shared by three processes P1, P2and P3 which have peak demands of 2, 5 and 7 resources respectively. For what value of ‘m’ deadlock will not occur ?(A) 70(B) 14(C) 13(D) 7Answer: (B)Explanation: To avoid deadlock ‘m’ >= peak deman... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Apr, 2018"
},
{
"code": null,
"e": 453,
"s": 28,
"text": "Consider a system having ‘m’ resources of the same type. These resources are shared by three processes P1, P2and P3 which have peak demands of 2, 5 and 7 resources respectivel... |
Python time gmtime() Method | Pythom time method gmtime() converts a time expressed in seconds since the epoch to a struct_time in UTC in which the dst flag is always zero. If secs is not provided or None, the current time as returned by time() is used.
Following is the syntax for gmtime() method −
time.gmtime([ sec ])
sec − These are the number o... | [
{
"code": null,
"e": 2602,
"s": 2378,
"text": "Pythom time method gmtime() converts a time expressed in seconds since the epoch to a struct_time in UTC in which the dst flag is always zero. If secs is not provided or None, the current time as returned by time() is used."
},
{
"code": null,
... |
Deadlock in Java Multithreading | 28 Jun, 2021
synchronized keyword is used to make the class or method thread-safe which means only one thread can have lock of synchronized method and use it, other threads have to wait till the lock releases and anyone of them acquire that lock. It is important to use if our program is running in multi-threaded enviro... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 531,
"s": 52,
"text": "synchronized keyword is used to make the class or method thread-safe which means only one thread can have lock of synchronized method and use it, other threads have to wait t... |
How to Set Java Path in Windows and Linux? | 02 Feb, 2021
PATH is an environment variable that is used by Operating System to locate the exe files (.exe) or java binaries ( java or javac command). The path once it is set, cannot be overridden. The PATH variable prevents us from having to write out the entire path to a program on the Command Line Interface every t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n02 Feb, 2021"
},
{
"code": null,
"e": 446,
"s": 52,
"text": "PATH is an environment variable that is used by Operating System to locate the exe files (.exe) or java binaries ( java or javac command). The path once it is set, cannot be ... |
Signal Processing and Time Series (Data Analysis) | 05 Mar, 2020
Signal processing is a field of engineering that focuses on analyzing analog and digital signals with respect to time. Time Series Analysis is one of the categories of signal processing.
A time series is a sequence of data points recorded at regular intervals of time. Time series analysis is an important s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Mar, 2020"
},
{
"code": null,
"e": 215,
"s": 28,
"text": "Signal processing is a field of engineering that focuses on analyzing analog and digital signals with respect to time. Time Series Analysis is one of the categories of signal ... |
Decision Trees — Pruning. My last blog focused on the concept of... | by Blake Lawrence | Towards Data Science | My last blog focused on the concept of decision trees which form the basis of the Random Forest machine learning algorithm. As it was only a short blog (4 minute read), I didn’t delve into the detail however did embed some (hopefully) useful links.
In this post I would like to go a little further and cover:
How random ... | [
{
"code": null,
"e": 421,
"s": 172,
"text": "My last blog focused on the concept of decision trees which form the basis of the Random Forest machine learning algorithm. As it was only a short blog (4 minute read), I didn’t delve into the detail however did embed some (hopefully) useful links."
},
... |
Clustering Coefficient in Graph Theory - GeeksforGeeks | 08 Feb, 2018
In graph theory, a clustering coefficient is a measure of the degree to which nodes in a graph tend to cluster together. Evidence suggests that in most real-world networks, and in particular social networks, nodes tend to create tightly knit groups characterized by a relatively high density of ties; this l... | [
{
"code": null,
"e": 24646,
"s": 24618,
"text": "\n08 Feb, 2018"
},
{
"code": null,
"e": 25117,
"s": 24646,
"text": "In graph theory, a clustering coefficient is a measure of the degree to which nodes in a graph tend to cluster together. Evidence suggests that in most real-world ... |
How to Access any Component Outside RecyclerView from RecyclerView in Android? - GeeksforGeeks | 09 Dec, 2020
The title may be a little confusing but what we want to say is, suppose in an Android App, there’s a RecyclerView, and outside that there’s a TextView. In the RecyclerView there’s a list of clickable components, said Button. Now what I want is, for different button clicks, the text in the TextView will be ... | [
{
"code": null,
"e": 25062,
"s": 25034,
"text": "\n09 Dec, 2020"
},
{
"code": null,
"e": 25468,
"s": 25062,
"text": "The title may be a little confusing but what we want to say is, suppose in an Android App, there’s a RecyclerView, and outside that there’s a TextView. In the Recy... |
Java Collection | Set 1 (ArrayList) Part-2 | Practice | GeeksforGeeks | Implement different operations on a ArrayList A .
Input:
The first line of input contains an integer T denoting the no of test cases . Then T test cases follow. The first line of input contains an integer Q denoting the no of queries . Then in the next line are Q space separated queries .
A query can be of five types... | [
{
"code": null,
"e": 278,
"s": 226,
"text": "Implement different operations on a ArrayList A .\n "
},
{
"code": null,
"e": 987,
"s": 278,
"text": "Input:\nThe first line of input contains an integer T denoting the no of test cases . Then T test cases follow. The first line of inp... |
Deploy Flask API to Google Cloud | Towards Data Science | Building that first API is for many of us, a significant step towards creating impactful tools that may one day be used by many developers. But often those APIs don’t make it out of our local machines.
Fortunately, it’s incredibly easy to deploy APIs. Assuming you have no idea what you’re doing right now — you will pro... | [
{
"code": null,
"e": 373,
"s": 171,
"text": "Building that first API is for many of us, a significant step towards creating impactful tools that may one day be used by many developers. But often those APIs don’t make it out of our local machines."
},
{
"code": null,
"e": 548,
"s": 37... |
Tryit Editor v3.7 | Tryit: HTML table - striped rows | [] |
Check two ArrayList for equality in Java | Two ArrayList can be compared to check if they are equal or not using the method java.util.ArrayList.equals(). This method has a single parameter i.e. an ArrayList that is compared with the current object. It returns true if the two ArrayList are equal and false otherwise.
A program that demonstrates this is given as f... | [
{
"code": null,
"e": 1336,
"s": 1062,
"text": "Two ArrayList can be compared to check if they are equal or not using the method java.util.ArrayList.equals(). This method has a single parameter i.e. an ArrayList that is compared with the current object. It returns true if the two ArrayList are equal ... |
Spring boot Exception Handling | @ExceptionHandler | @ControllerAdvice | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorial, we will show you how to han... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
How to check a String for palindrome using arrays in java? | To verify whether the given string is a palindrome (using arrays)
Convert the given string into a character array using the toCharArray() method.
Make a copy of this array.
Reverse the array.
Compare the original array and the reversed array.
in case of match given string is a palindrome.
import java.util.Arrays;
impor... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "To verify whether the given string is a palindrome (using arrays)"
},
{
"code": null,
"e": 1208,
"s": 1128,
"text": "Convert the given string into a character array using the toCharArray() method."
},
{
"code": null,
"e":... |
How does pipelining improve performance in computer architecture? | Performance in an unpipelined processor is characterized by the cycle time and the execution time of the instructions. In the case of pipelined execution, instruction processing is interleaved in the pipeline rather than performed sequentially as in non-pipelined processors. Therefore the concept of the execution time ... | [
{
"code": null,
"e": 1612,
"s": 1062,
"text": "Performance in an unpipelined processor is characterized by the cycle time and the execution time of the instructions. In the case of pipelined execution, instruction processing is interleaved in the pipeline rather than performed sequentially as in non... |
MySQL filtering by multiple columns? | To perform filtering by multiple columns, use where clause along with OR. Let us first create a table −
mysql> create table DemoTable
(
Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name varchar(10),
Score int
);
Query OK, 0 rows affected (0.28 sec)
Insert some records in the table using insert command −
m... | [
{
"code": null,
"e": 1291,
"s": 1187,
"text": "To perform filtering by multiple columns, use where clause along with OR. Let us first create a table −"
},
{
"code": null,
"e": 1450,
"s": 1291,
"text": "mysql> create table DemoTable\n (\n Id int NOT NULL AUTO_INCREMENT PRIMARY... |
Web Scraping Coronavirus Data into MS Excel | 23 May, 2022
Prerequisites: Web Scraping using BeautifulSoap
Coronavirus cases are increasing rapidly worldwide. This article will guide you on how to web scrape Coronavirus data and into Ms-excel.
If you’ve ever copy and pasted information from a website, you’ve performed the same function as any web scraper, only on ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 May, 2022"
},
{
"code": null,
"e": 101,
"s": 53,
"text": "Prerequisites: Web Scraping using BeautifulSoap"
},
{
"code": null,
"e": 238,
"s": 101,
"text": "Coronavirus cases are increasing rapidly worldwide. This ... |
Python | Pandas Dataframe.duplicated() | 29 Sep, 2021
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.An important part of Data analysis is analyzing Duplicate Values and removing them. Pandas dup... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Sep, 2021"
},
{
"code": null,
"e": 497,
"s": 54,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes im... |
What is right shift (>>) operator in Python? | In Python >> is called right shift operator. It is a bitwise operator. It requires a bitwise representation of object as first operand. Bits are shifted to right by number of bits stipulated by second operand. Leading bits as towards left as a result of shifting are set to 0.
>>> bin(a) #binary equivalent 0110 0100... | [
{
"code": null,
"e": 1464,
"s": 1187,
"text": "In Python >> is called right shift operator. It is a bitwise operator. It requires a bitwise representation of object as first operand. Bits are shifted to right by number of bits stipulated by second operand. Leading bits as towards left as a result of... |
SQL – SELECT DATE | 19 May, 2021
In Microsoft SQL Server, SELECT DATE is used to get the data from the table related to the date, the default format of date is ‘YYYY-MM-DD’.
Syntax:
SELECT * FROM table_name
WHERE condition1, condition2,..;
Now we will execute queries on SELECT DATE on database student in detail step-by-step:
Step 1: Creat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 169,
"s": 28,
"text": "In Microsoft SQL Server, SELECT DATE is used to get the data from the table related to the date, the default format of date is ‘YYYY-MM-DD’."
},
{
"code": null,
"e... |
Union in C | 08 Feb, 2019
Like Structures, union is a user defined data type. In union, all members share the same memory location.
For example in the following C program, both x and y share the same location. If we change x, we can see the changes being reflected in y.
#include <stdio.h> // Declaration of union is same as structu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Feb, 2019"
},
{
"code": null,
"e": 158,
"s": 52,
"text": "Like Structures, union is a user defined data type. In union, all members share the same memory location."
},
{
"code": null,
"e": 297,
"s": 158,
"text": ... |
How to Import a CSV file into a SQLite database Table using Python? | 28 Oct, 2021
In this article, we are going to discuss how to import a CSV file content into an SQLite database table using Python.
At first, we import csv module (to work with csv file) and sqlite3 module (to populate the database table).
Then we connect to our geeks database using the sqlite3.connect() method.
At this... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 146,
"s": 28,
"text": "In this article, we are going to discuss how to import a CSV file content into an SQLite database table using Python."
},
{
"code": null,
"e": 254,
"s": 146,
... |
Python OpenCV – Canny() Function | 22 Nov, 2021
In this article, we will see the Canny Edge filter in OpenCV. Canny() Function in OpenCV is used to detect the edges in an image.
Syntax: cv2.Canny(image, T_lower, T_upper, aperture_size, L2Gradient)
Where:
Image: Input image to which Canny filter will be applied
T_lower: Lower threshold value in Hysteres... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 158,
"s": 28,
"text": "In this article, we will see the Canny Edge filter in OpenCV. Canny() Function in OpenCV is used to detect the edges in an image."
},
{
"code": null,
"e": 228,
... |
How can we return a dictionary from a Python function? | There can be any number of ways we can return a dictionary from a python function. Consider the one given below.
# This function returns a dictionary
def foo():
d = dict();
d['str'] = "Tutorialspoint"
d['x'] = 50
return d
print foo()
{'x': 50, 'str': 'Tutorialspoint'} | [
{
"code": null,
"e": 1300,
"s": 1187,
"text": "There can be any number of ways we can return a dictionary from a python function. Consider the one given below."
},
{
"code": null,
"e": 1443,
"s": 1300,
"text": "# This function returns a dictionary\ndef foo():\n d = dict();\n ... |
Smallest number in BST which is greater than or equal to N | 16 May, 2022
Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater than or equal to N. Print the value of the element if it exists otherwise print -1.
Examples:
Input: N = 20 Output: 21 Explanation: 21 is the smallest element greater than 20.
Inpu... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 May, 2022"
},
{
"code": null,
"e": 264,
"s": 54,
"text": "Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater than or equal to N. Print the value of the elemen... |
Removing Direct and Indirect Left Recursion in a Grammar | 25 Mar, 2022
Prerequisite – Classification of Context Free Grammars, Ambiguity and Parsers Left Recursion: Grammar of the form,
S --> S / a / b
It is called left recursive where S is any non Terminal and a, and b are any set of terminals. Problem with Left Recursion: If a left recursion is present in any grammar then,... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Mar, 2022"
},
{
"code": null,
"e": 167,
"s": 52,
"text": "Prerequisite – Classification of Context Free Grammars, Ambiguity and Parsers Left Recursion: Grammar of the form,"
},
{
"code": null,
"e": 184,
"s": 167,
... |
How to specify that a user can enter more than one value in an input element in HTML5? | 12 Apr, 2021
The multiple attribute is used to specify whether the user can enter more than one value in an input element. It is a Boolean attribute. When set to true, the input element can accept more than one value. The multiple properties can be used in the following ways.
With the <input> tag only the Email and Fil... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Apr, 2021"
},
{
"code": null,
"e": 292,
"s": 28,
"text": "The multiple attribute is used to specify whether the user can enter more than one value in an input element. It is a Boolean attribute. When set to true, the input element ca... |
How to keep gap between columns using Bootstrap? | 30 Nov, 2020
We can keep gap between columns by using normal CSS but here we will use the Bootstrap framework for that. In this article, we will keep a measured gap between columns by the following methods.
Using “div” tag: Simply adding a “div” with padding in between two “div” tags gives spacing between the “div”.
Ex... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Nov, 2020"
},
{
"code": null,
"e": 222,
"s": 28,
"text": "We can keep gap between columns by using normal CSS but here we will use the Bootstrap framework for that. In this article, we will keep a measured gap between columns by the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.