title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Cartoonify Image using GAN(Generative Adversarial Network) | by Himanshu Sharma | Towards Data Science | GAN is basically an unsupervised learning algorithm that works on a neural network and generates samples from an image and also differentiates it from the original images which are used. For this, it uses two neural networks first one is a generator, and the second one is a discriminator.
In this article, we will use G... | [
{
"code": null,
"e": 461,
"s": 171,
"text": "GAN is basically an unsupervised learning algorithm that works on a neural network and generates samples from an image and also differentiates it from the original images which are used. For this, it uses two neural networks first one is a generator, and ... |
Area of a circle inscribed in a regular hexagon - GeeksforGeeks | 16 Mar, 2021
Given a regular Hexagon with side length a, the task is to find the area of the circle inscribed in it, given that, the circle is tangent to each of the six sides.Examples:
Input: a = 4
Output: 37.68
Input: a = 10
Output: 235.5
Approach: From the figure, it is clear that, we can divide the regular h... | [
{
"code": null,
"e": 25082,
"s": 25054,
"text": "\n16 Mar, 2021"
},
{
"code": null,
"e": 25257,
"s": 25082,
"text": "Given a regular Hexagon with side length a, the task is to find the area of the circle inscribed in it, given that, the circle is tangent to each of the six sides.... |
Difference Between && and ; chaining operators in Linux - GeeksforGeeks | 14 Oct, 2020
Logical AND operator(&&):
The second command will only execute if the first command has executed successfully i.e, its exit status is zero. This operator can be used to check if the first command has been successfully executed. This is one of the most used commands in the command line.
Syntax:
command1 &&... | [
{
"code": null,
"e": 26025,
"s": 25997,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 26052,
"s": 26025,
"text": "Logical AND operator(&&): "
},
{
"code": null,
"e": 26313,
"s": 26052,
"text": "The second command will only execute if the first command has e... |
Greedy Algorithms - GeeksforGeeks | 04 May, 2020
Suppose we run Dijkstra’s single source shortest-path algorithm on the following edge weighted directed graph with vertex P as the source. In what order do the nodes get included into the set of vertices for which the shortest path distances are finalized?
P, Q, R, S, T, U
P, Q, R, U, S, T
P, Q, R, U, T... | [
{
"code": null,
"e": 28855,
"s": 28827,
"text": "\n04 May, 2020"
},
{
"code": null,
"e": 29113,
"s": 28855,
"text": "Suppose we run Dijkstra’s single source shortest-path algorithm on the following edge weighted directed graph with vertex P as the source. In what order do the nod... |
Leaders in an array | 01 Jul, 2022
Write a program to print all the LEADERS in the array. An element is leader if it is greater than all the elements to its right side. And the rightmost element is always a leader. For example in the array {16, 17, 4, 3, 5, 2}, leaders are 17, 5 and 2. Let the input array be arr[] and size of the array be s... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Jul, 2022"
},
{
"code": null,
"e": 365,
"s": 52,
"text": "Write a program to print all the LEADERS in the array. An element is leader if it is greater than all the elements to its right side. And the rightmost element is always a le... |
Python | Maximum sum of elements of list in a list of lists | 11 Jul, 2022
Given lists in a list, find the maximum sum of elements of list in a list of lists. Examples:
Input : [[1, 2, 3], [4, 5, 6], [10, 11, 12], [7, 8, 9]]
Output : 33
Explanation: sum of all lists in the given list of lists are:
list1 = 6, list2 = 15, list3 = 33, list4 = 24
so the m... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Jul, 2022"
},
{
"code": null,
"e": 148,
"s": 54,
"text": "Given lists in a list, find the maximum sum of elements of list in a list of lists. Examples:"
},
{
"code": null,
"e": 442,
"s": 148,
"text": "Input : [[... |
Python Script to Shutdown Computer | 14 Jul, 2019
As we know, Python is a popular scripting language because of its versatile features. In this article, we will write a Python script to shutdown a computer.To shut down the computer/PC/laptop by using a Python script, you have to use the os.system() function with the code “shutdown /s /t 1” .
Note: For thi... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n14 Jul, 2019"
},
{
"code": null,
"e": 347,
"s": 53,
"text": "As we know, Python is a popular scripting language because of its versatile features. In this article, we will write a Python script to shutdown a computer.To shut down the c... |
Digital Electronics – Radix and Diminished Radix Complements | 18 Oct, 2021
Prerequisite – Complement of a Number
The use of complements is to mainly perform Subtraction. We can easily perform addition in contrast if we would like to implement subtraction using logic gates we require more (because we need to consider borrowing that kind of stuff). So if we somehow make it into sim... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Oct, 2021"
},
{
"code": null,
"e": 92,
"s": 54,
"text": "Prerequisite – Complement of a Number"
},
{
"code": null,
"e": 448,
"s": 92,
"text": "The use of complements is to mainly perform Subtraction. We can easil... |
Python program to find smallest number in a list | 10 Feb, 2021
Given a list of numbers, the task is to write a Python program to find the smallest number in given list.Examples:
Input : list1 = [10, 20, 4]
Output : 4
Input : list2 = [20, 10, 20, 1, 100]
Output : 1
Method 1 : Sort the list in ascending order and print the first element in the list.
Python3
# Python... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Feb, 2021"
},
{
"code": null,
"e": 168,
"s": 52,
"text": "Given a list of numbers, the task is to write a Python program to find the smallest number in given list.Examples: "
},
{
"code": null,
"e": 256,
"s": 168,
... |
Plot multiple boxplots in one graph in R | 23 May, 2021
In this article, we will learn how to plot multiple boxplot in one graph in R Programming Language. This can be accomplished by using boxplot() function, and we can also pass in a list, data frame or multiple vectors to it. For this purpose, we need to put name of data into boxplot() function as input.
Sy... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 May, 2021"
},
{
"code": null,
"e": 358,
"s": 53,
"text": "In this article, we will learn how to plot multiple boxplot in one graph in R Programming Language. This can be accomplished by using boxplot() function, and we can also pass... |
Python program to hide the mouse cursor on the Terminal screen | 18 Aug, 2020
Write a program to hide the mouse cursor on the terminal screen.
Approach:
The curses package is imported and used for this task in C language, napms function call is used for the delay, and curs_set() function is called to make the cursor disappear.
In Python, a package called UniCurses, which is similar ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Aug, 2020"
},
{
"code": null,
"e": 93,
"s": 28,
"text": "Write a program to hide the mouse cursor on the terminal screen."
},
{
"code": null,
"e": 103,
"s": 93,
"text": "Approach:"
},
{
"code": null,
"... |
Python – Extract tuples with elements in Range | 02 Sep, 2020
Given list of tuples, extract tuples having elements in range.
Input : test_list = [(4, 5, 7), (5, 6), (3, 8, 10 ), (4, 10)], strt, end = 5, 6Output : [(5, 6)]Explanation : Only 1 tuple lies in range of 5-6.
Input : test_list = [(4, 5, 7), (5, 6), (3, 8, 10 ), (4, 10)], strt, end = 1, 10Output : [(4, 5, 7)... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Sep, 2020"
},
{
"code": null,
"e": 91,
"s": 28,
"text": "Given list of tuples, extract tuples having elements in range."
},
{
"code": null,
"e": 236,
"s": 91,
"text": "Input : test_list = [(4, 5, 7), (5, 6), (3, 8... |
How to Scan Vulnerabilities of Websites using Nikto in Linux? | 03 Jun, 2020
Nikto is an open-source web server scanner which performs comprehensive tests against web servers for multiple items. You can use Nikto with any web servers like Apache, Nginx, IHS, OHS, Litespeed, and so on. Nikto can check for server configuration items such as the presence of multiple index files, HTTP ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2020"
},
{
"code": null,
"e": 508,
"s": 28,
"text": "Nikto is an open-source web server scanner which performs comprehensive tests against web servers for multiple items. You can use Nikto with any web servers like Apache, Nginx... |
Reverse a string without affecting special characters | 08 Jul, 2022
Given a string, that contains a special character together with alphabets (‘a’ to ‘z’ and ‘A’ to ‘Z’), reverse the string in a way that special characters are not affected.
Examples:
Input: str = "a,b$c"
Output: str = "c,b$a"
Note that $ and , are not moved anywhere.
Only subsequence "abc" is reverse... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 225,
"s": 52,
"text": "Given a string, that contains a special character together with alphabets (‘a’ to ‘z’ and ‘A’ to ‘Z’), reverse the string in a way that special characters are not affected."
... |
I/O Redirection in C++ | 22 Jun, 2022
In C, we could use the function freopen() to redirect an existing FILE pointer to another stream. The prototype for freopen() is given as
FILE * freopen ( const char * filename, const char * mode, FILE * stream );
For Example, to redirect the stdout to say a textfile, we could write :
freopen ("text_file.... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 193,
"s": 54,
"text": "In C, we could use the function freopen() to redirect an existing FILE pointer to another stream. The prototype for freopen() is given as "
},
{
"code": null,
"e"... |
Python os.rename() Method | Python method rename() renames the file or directory src to dst.If dst is a file or directory(already present), OSError will be raised.
Following is the syntax for rename() method −
os.rename(src, dst)
src − This is the actual name of the file or directory.
src − This is the actual name of the file or directory.
dst −... | [
{
"code": null,
"e": 2514,
"s": 2378,
"text": "Python method rename() renames the file or directory src to dst.If dst is a file or directory(already present), OSError will be raised."
},
{
"code": null,
"e": 2560,
"s": 2514,
"text": "Following is the syntax for rename() method −"... |
How to Fix: All input arrays must have same number of dimensions | 11 Feb, 2022
In this article, we will fix the error: All input arrays must have the same number of dimensions in Python.
Python3
# Importing numpy libraryimport numpy as np # Creating a numpy array with dimension 2 * 2np_array1 = np.array([[2, 3],[2,4]]) # Creating a numpy array with dimension 2 * 3np_array2 = np.array... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 136,
"s": 28,
"text": "In this article, we will fix the error: All input arrays must have the same number of dimensions in Python."
},
{
"code": null,
"e": 144,
"s": 136,
"text":... |
Find permutation of numbers 1 to N having X local maxima (peaks) and Y local minima (valleys) | 29 Dec, 2021
Given three integers N, A and B, the task is to find a permutation of pairwise distinct numbers from 1 to N that has exactly ‘A’ local minima’s and ‘B’ local maxima’s.
A local minima is defined as the element which is less than both its neighbours.
A local maxima is defined as the element which is greater... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 197,
"s": 28,
"text": "Given three integers N, A and B, the task is to find a permutation of pairwise distinct numbers from 1 to N that has exactly ‘A’ local minima’s and ‘B’ local maxima’s. "
},
... |
Prime Triplet | 24 May, 2021
Prime Triplet is a set of three prime numbers of the form (p, p+2, p+6) or (p, p+4, p+6). This is the closest possible grouping of three prime numbers, since one of every three sequential odd numbers is a multiple of three, and hence not prime (except for 3 itself) except (2, 3, 5) and (3, 5, 7).
Examples ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 352,
"s": 54,
"text": "Prime Triplet is a set of three prime numbers of the form (p, p+2, p+6) or (p, p+4, p+6). This is the closest possible grouping of three prime numbers, since one of every thr... |
How to Install and Use Chrony in Linux? | 05 Oct, 2021
chrony is a flexible Network Time Protocol implementation (NTP). It can sync the system clock with NTP servers, reference clocks (such as a GPS receiver), and manual input via wristwatch and keyboard. It can also act as an NTPv4 (RFC 5905) server and peer, allowing other computers on the network to receive... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 352,
"s": 28,
"text": "chrony is a flexible Network Time Protocol implementation (NTP). It can sync the system clock with NTP servers, reference clocks (such as a GPS receiver), and manual input via... |
Expressions in Python | 03 Sep, 2021
An expression is a combination of operators and operands that is interpreted to produce some other value. In any programming language, an expression is evaluated as per the precedence of its operators. So that if there is more than one operator in an expression, their precedence decides which operation wil... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Sep, 2021"
},
{
"code": null,
"e": 493,
"s": 52,
"text": "An expression is a combination of operators and operands that is interpreted to produce some other value. In any programming language, an expression is evaluated as per the p... |
Python - Variable Exercises | Now you have learned a lot about variables, 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:
Create a variable named carname and assign the value Volvo to it.
= ""
Go to the Exercise section and test all of our Python Variable Exercises:
Pytho... | [
{
"code": null,
"e": 75,
"s": 0,
"text": "Now you have learned a lot about variables, and how to use them in Python."
},
{
"code": null,
"e": 101,
"s": 75,
"text": "Are you ready for a test?"
},
{
"code": null,
"e": 167,
"s": 101,
"text": "Try to insert the mi... |
How to Use Bitmap images in Button in Tkinter? - GeeksforGeeks | 13 Jan, 2021
Prerequisite: Python GUI – tkinter
Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python.
A bitmap is an array of binary data representin... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n13 Jan, 2021"
},
{
"code": null,
"e": 23936,
"s": 23901,
"text": "Prerequisite: Python GUI – tkinter"
},
{
"code": null,
"e": 24161,
"s": 23936,
"text": "Python offers multiple options for developing GUI (Grap... |
WebGL - Shaders | Shaders are the programs that run on GPU. Shaders are written in OpenGL ES Shader Language (known as ES SL). ES SL has variables of its own, data types, qualifiers, built-in inputs and outputs.
The following table lists the basic data types provided by OpenGL ES SL.
void
Represents an empty value.
bool
Accepts true or ... | [
{
"code": null,
"e": 2241,
"s": 2047,
"text": "Shaders are the programs that run on GPU. Shaders are written in OpenGL ES Shader Language (known as ES SL). ES SL has variables of its own, data types, qualifiers, built-in inputs and outputs."
},
{
"code": null,
"e": 2314,
"s": 2241,
... |
How to convert a string to camel case in JavaScript? | Camel case is the practice of writing phrases such that each word or abbreviation in the middle of the phrase begins with a capital letter, with no intervening spaces or punctuation. For example, Concurrent hash maps in camel case would be written as −
ConcurrentHashMaps
We can implement a method to accept a string in ... | [
{
"code": null,
"e": 1315,
"s": 1062,
"text": "Camel case is the practice of writing phrases such that each word or abbreviation in the middle of the phrase begins with a capital letter, with no intervening spaces or punctuation. For example, Concurrent hash maps in camel case would be written as −"... |
How to set the Y-axis tick marks using ggplot2 in R? | The default value of Y-axis tick marks using ggplot2 are taken by R using the provided data but we can set it by using scale_y_continuous function of ggplot2 package. For example, if we want to have values starting from 1 to 10 with a gap of 1 then we can use scale_y_continuous(breaks=seq(1,10,by=1)).
Live Demo
Consid... | [
{
"code": null,
"e": 1365,
"s": 1062,
"text": "The default value of Y-axis tick marks using ggplot2 are taken by R using the provided data but we can set it by using scale_y_continuous function of ggplot2 package. For example, if we want to have values starting from 1 to 10 with a gap of 1 then we c... |
How to Connect to a Heroku Postgres Database With pgAdmin Using Docker | by Mahbub Zaman | Jan, 2021 | Towards Data Science | Towards Data Science | Heroku is a cloud platform to build, deploy, monitor, and scale applications. It supports a wide range of programming languages, including Ruby, Java, Python, and many more. On top of that, you can add many add-ons to your app. Heroku Postgres is one of them that supports PostgreSQL.
You can connect to PostgreSQL datab... | [
{
"code": null,
"e": 456,
"s": 171,
"text": "Heroku is a cloud platform to build, deploy, monitor, and scale applications. It supports a wide range of programming languages, including Ruby, Java, Python, and many more. On top of that, you can add many add-ons to your app. Heroku Postgres is one of t... |
Principal Component Analysis algorithm in Real-Life: Discovering patterns in a real-estate dataset | by Carolina Bento | Towards Data Science | Principal Component Analysis, PCA for short, is an unsupervised learning technique used to surface the core patterns in the data.
In this article, we’re going through how PCA works with the real-life example of a real estate agent who wants to understand why some of their listings are taking too long to close, and how ... | [
{
"code": null,
"e": 301,
"s": 171,
"text": "Principal Component Analysis, PCA for short, is an unsupervised learning technique used to surface the core patterns in the data."
},
{
"code": null,
"e": 535,
"s": 301,
"text": "In this article, we’re going through how PCA works with ... |
C++ | const keyword | Question 1 - GeeksforGeeks | 28 Jun, 2021
Predict the output of following program
#include <iostream>using namespace std;int main(){ const char* p = "12345"; const char **q = &p; *q = "abcde"; const char *s = ++p; p = "XYZWVU"; cout << *++s; return 0;}
(A) Compiler Error(B) c(C) b(D) Garbage ValueAnswer: (B)Explanation: Output... | [
{
"code": null,
"e": 24460,
"s": 24432,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24500,
"s": 24460,
"text": "Predict the output of following program"
},
{
"code": "#include <iostream>using namespace std;int main(){ const char* p = \"12345\"; const char **q =... |
Saving 95% on infrastructure costs using AWS Lambda for scikit-learn predictions | by Yoav Zimmerman | Towards Data Science | Disclaimer: I am the developer behind Model Zoo, a model deployment platform focused on ease-of-use.
If you’re an AWS customer that needs to deploy machine learning models for real-time inference, you might have considered using AWS SageMaker Inference Endpoints. However, there is another option for model deployment th... | [
{
"code": null,
"e": 273,
"s": 172,
"text": "Disclaimer: I am the developer behind Model Zoo, a model deployment platform focused on ease-of-use."
},
{
"code": null,
"e": 1183,
"s": 273,
"text": "If you’re an AWS customer that needs to deploy machine learning models for real-time... |
GATE | GATE CS 2021 | Set 1 | Question 31 - GeeksforGeeks | 11 Aug, 2021
Consider the following sequence of operations on an empty stack.
Push(54);push(52);pop();push(55);push(62);s=pop();
Consider the following sequence of operations on an empty queue.
enqueue(21);enqueue(24);dequeue();enqueue(28);enqueue(32);q=dequeue();
The value of s+q is ___________.(A) 86(B) 68(C) 24(D)... | [
{
"code": null,
"e": 25695,
"s": 25667,
"text": "\n11 Aug, 2021"
},
{
"code": null,
"e": 25760,
"s": 25695,
"text": "Consider the following sequence of operations on an empty stack."
},
{
"code": null,
"e": 25812,
"s": 25760,
"text": "Push(54);push(52);pop();p... |
C++ Program to Find a pair with the given difference - GeeksforGeeks | 21 Dec, 2021
Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples:
Input: arr[] = {5, 20, 3, 2, 50, 80}, n = 78
Output: Pair Found: (2, 80)
Input: arr[] = {90, 70, 20, 80, 50}, n = 45
Output: No Such Pair
The simplest method is to run two loop... | [
{
"code": null,
"e": 25421,
"s": 25393,
"text": "\n21 Dec, 2021"
},
{
"code": null,
"e": 25549,
"s": 25421,
"text": "Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: "
},
{
"code": null,
"e"... |
How can I insert an EditText (for inserting text) on an Android notification? | This example demonstrate about How can I insert an EditText (for inserting text) on an Android notification
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 = "... | [
{
"code": null,
"e": 1170,
"s": 1062,
"text": "This example demonstrate about How can I insert an EditText (for inserting text) on an Android notification"
},
{
"code": null,
"e": 1299,
"s": 1170,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project ... |
How to activate Tkinter menu and toolbar with keyboard shortcut or binding? - GeeksforGeeks | 29 Jun, 2021
You might have seen the menubar and toolbar in the various desktop apps, which are opened through shortcut keys. Don’t you know how to create such a menubar and toolbar which gets opened through a shortcut key? Have a read at the article and get to know the procedure to do the same.
For activating the men... | [
{
"code": null,
"e": 25665,
"s": 25637,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 25950,
"s": 25665,
"text": "You might have seen the menubar and toolbar in the various desktop apps, which are opened through shortcut keys. Don’t you know how to create such a menubar and to... |
Find k-th smallest element in BST (Order Statistics in BST) - GeeksforGeeks | 02 May, 2022
Given the root of a binary search tree and K as input, find Kth smallest element in BST. For example, in the following BST, if k = 3, then the output should be 10, and if k = 5, then the output should be 14.
Method 1: Using Inorder Traversal (O(n) time and O(h) auxiliary space) The Inorder Traversal of a B... | [
{
"code": null,
"e": 26625,
"s": 26597,
"text": "\n02 May, 2022"
},
{
"code": null,
"e": 26833,
"s": 26625,
"text": "Given the root of a binary search tree and K as input, find Kth smallest element in BST. For example, in the following BST, if k = 3, then the output should be 10,... |
How to add table rows Dynamically in Android Layout? | This example demonstrates how to add table rows Dynamically in Android Layout.
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"?>
<LinearL... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "This example demonstrates how to add table rows Dynamically in Android Layout."
},
{
"code": null,
"e": 1270,
"s": 1141,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details... |
Automated Browser Testing with Edge and Selenium in Python - GeeksforGeeks | 24 Jan, 2021
Cross-browser testing is mandatory in the software industry. We all know that there are many browsers like Firefox, Chrome, Edge, Opera etc., are available. Rather than writing separate code to each and every browser, it is always a decent approach to go towards automated testing. Let us see how to do that... | [
{
"code": null,
"e": 24390,
"s": 24362,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 24845,
"s": 24390,
"text": "Cross-browser testing is mandatory in the software industry. We all know that there are many browsers like Firefox, Chrome, Edge, Opera etc., are available. Rather... |
Python - Itertools.compress() - GeeksforGeeks | 19 Feb, 2020
Python’s Itertool is a module that provides various functions that work on iterators to produce complex iterators. This module works as a fast, memory-efficient tool that is used either by themselves or in combination to form iterator algebra.
Note: For more information, refer to Python Itertools
The itert... | [
{
"code": null,
"e": 24496,
"s": 24468,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 24740,
"s": 24496,
"text": "Python’s Itertool is a module that provides various functions that work on iterators to produce complex iterators. This module works as a fast, memory-efficient to... |
C++ Program to Implement Adjacency List | The adjacency list representation of a graph is linked list representation. In this representation we have an array of lists The array size is V. Here V is the number of vertices. In other words, we can say that we have an array to store V number of different lists. If a list header is vertex u, then it signifies that ... | [
{
"code": null,
"e": 1430,
"s": 1062,
"text": "The adjacency list representation of a graph is linked list representation. In this representation we have an array of lists The array size is V. Here V is the number of vertices. In other words, we can say that we have an array to store V number of dif... |
How to embed your Julia code into Python to speed up performance | by Yuval Blau | Towards Data Science | This blog post is about working with Python and Julia together and aimed mainly for Pythonists Data scientists who want to quickly accelerate their run time performance and do it by another programming language that gains its popularity within universities, companies, and users.
By the end of this post, you will gain:
... | [
{
"code": null,
"e": 452,
"s": 172,
"text": "This blog post is about working with Python and Julia together and aimed mainly for Pythonists Data scientists who want to quickly accelerate their run time performance and do it by another programming language that gains its popularity within universitie... |
How to split string on whitespace in Python? | You can usesplit() from the string class. The default delimiter for this method is whitespace, i.e., when called on a string, it'll split that string at whitespace characters. For example:
>>>"Please split this string".split()
['Please','split', 'this', 'string']
Regex can also be used to solve this problem. You can ... | [
{
"code": null,
"e": 1251,
"s": 1062,
"text": "You can usesplit() from the string class. The default delimiter for this method is whitespace, i.e., when called on a string, it'll split that string at whitespace characters. For example:"
},
{
"code": null,
"e": 1327,
"s": 1251,
"t... |
Delete a Node in Single Linked List | Practice | GeeksforGeeks | Given a singly linked list and an integer x.Delete xth node from the singly linked list.
Example 1:
Input: 1 -> 3 -> 4
x = 3
Output: 1 -> 3
Explanation:
After deleting the node at 3rd
position (1-base indexing), the
linked list is as 1 -> 3.
Example 2:
Input: 1 -> 5 -> 2 -> 9
x = 2
Output: 1 -> 2 -> 9
Expl... | [
{
"code": null,
"e": 328,
"s": 238,
"text": "Given a singly linked list and an integer x.Delete xth node from the singly linked list. "
},
{
"code": null,
"e": 340,
"s": 328,
"text": "Example 1: "
},
{
"code": null,
"e": 492,
"s": 340,
"text": "Input: 1 -> 3 -... |
What is unexpected indent in Python?
| Python not only insists on indentation, it insists on consistent indentation. If we indent one line by 4 spaces, but then if we indent the next by 3 (or 5, 6, .), we get this error of unexpected indent in python.
In the given code, line 3 has more spaces at the start than line 2. All lines of code in a block must start... | [
{
"code": null,
"e": 1275,
"s": 1062,
"text": "Python not only insists on indentation, it insists on consistent indentation. If we indent one line by 4 spaces, but then if we indent the next by 3 (or 5, 6, .), we get this error of unexpected indent in python."
},
{
"code": null,
"e": 155... |
Relational Operators Overloading in C++ | There are various relational operators supported by C++ language like (<, >, <=, >=, ==, etc.) which can be used to compare C++ built-in data types.
You can overload any of these operators, which can be used to compare the objects of a class.
Following example explains how a < operator can be overloaded and similar wa... | [
{
"code": null,
"e": 2467,
"s": 2318,
"text": "There are various relational operators supported by C++ language like (<, >, <=, >=, ==, etc.) which can be used to compare C++ built-in data types."
},
{
"code": null,
"e": 2561,
"s": 2467,
"text": "You can overload any of these ope... |
C library function - tmpnam() | The C library function char *tmpnam(char *str) generates and returns a valid temporary filename which does not exist. If str is null then it simply returns the tmp file name.
Following is the declaration for tmpnam() function.
char *tmpnam(char *str)
str − This is the pointer to an array of chars where the proposed tem... | [
{
"code": null,
"e": 2182,
"s": 2007,
"text": "The C library function char *tmpnam(char *str) generates and returns a valid temporary filename which does not exist. If str is null then it simply returns the tmp file name."
},
{
"code": null,
"e": 2234,
"s": 2182,
"text": "Followi... |
Ant - Property Task | Ant build files are written in XML, which does not allow declaring variables as you do in your favorite programming language. However, as you may have imagined, it would be useful if Ant allowed declaring variables such as project name, project source directory, etc.
Ant uses the property element which allows you to sp... | [
{
"code": null,
"e": 2365,
"s": 2097,
"text": "Ant build files are written in XML, which does not allow declaring variables as you do in your favorite programming language. However, as you may have imagined, it would be useful if Ant allowed declaring variables such as project name, project source d... |
How to open port for the Azure VM using Azure CLI in PowerShell? | To open the specific port for the Azure VM using Azure CLI, we can use az vm open-port command. Before running this command, make sure that you are connected with the Azure Cloud account and the proper Azure subscription.
To open port 80 we can use the below command.
az vm open-port -n Win2k16VM1 -g testvmrg --port 80
... | [
{
"code": null,
"e": 1284,
"s": 1062,
"text": "To open the specific port for the Azure VM using Azure CLI, we can use az vm open-port command. Before running this command, make sure that you are connected with the Azure Cloud account and the proper Azure subscription."
},
{
"code": null,
... |
How to set mnemonics in a label using JavaFX? | You can display a text element/image on the User Interface using the Label component. It is a not editable text control, mostly used to specify the purpose of other nodes in the application.
In JavaFX, you can create a label by instantiating the javafx.scene.control.Label class.
A mnemonic is a number or character, in ... | [
{
"code": null,
"e": 1253,
"s": 1062,
"text": "You can display a text element/image on the User Interface using the Label component. It is a not editable text control, mostly used to specify the purpose of other nodes in the application."
},
{
"code": null,
"e": 1342,
"s": 1253,
... |
Explore Your Activity on Youtube With R: How to Analyze and Visualize Your Personal Data History | by Saúl Buentello | Towards Data Science | Let’s face it, dear reader, one of the websites that we visit frequently and became part of our life, whether for entertainment or looking for answers, and where we could spend hours, is YouTube. As with anything else we spend so much time on, I find it curious to see exactly how our consumption habits have changed. Wi... | [
{
"code": null,
"e": 580,
"s": 172,
"text": "Let’s face it, dear reader, one of the websites that we visit frequently and became part of our life, whether for entertainment or looking for answers, and where we could spend hours, is YouTube. As with anything else we spend so much time on, I find it c... |
PHP | geoip_country_code_by_name() Function - GeeksforGeeks | 03 Jul, 2018
The geoip_country_code_by_name() is an inbuilt function in PHP which helps to generate the two-letter country code (Each country is assigned a two-letter country code. For Example: US for United States). The function takes the hostname or IP Address as an argument and generates the two letter country code.... | [
{
"code": null,
"e": 24770,
"s": 24742,
"text": "\n03 Jul, 2018"
},
{
"code": null,
"e": 25078,
"s": 24770,
"text": "The geoip_country_code_by_name() is an inbuilt function in PHP which helps to generate the two-letter country code (Each country is assigned a two-letter country c... |
Binary Classification Example. Predicting Opioid Use | by Kamil Mysiak | Towards Data Science | This global crisis has impacted all of our lives in one way or another but this is a perfect opportunity to hone your craft. I happened to renew my Coursera account specifically trying my hand at network analysis. Cryptocurrency/blockchain medium articles have become part of my daily routine. Finally, I wanted to post ... | [
{
"code": null,
"e": 725,
"s": 172,
"text": "This global crisis has impacted all of our lives in one way or another but this is a perfect opportunity to hone your craft. I happened to renew my Coursera account specifically trying my hand at network analysis. Cryptocurrency/blockchain medium articles... |
Divide an array into k segments to maximize maximum of segment minimums - GeeksforGeeks | 27 Apr, 2021
Given an array of n integers, divide it into k segments and find the maximum of the minimums of k segments. Output the maximum integer that can be obtained among all ways to segment in k subarrays.Examples:
Input : arr[] = {1, 2, 3, 6, 5}
k = 2
Output: 5
Explanation: There are many ways to crea... | [
{
"code": null,
"e": 25444,
"s": 25416,
"text": "\n27 Apr, 2021"
},
{
"code": null,
"e": 25653,
"s": 25444,
"text": "Given an array of n integers, divide it into k segments and find the maximum of the minimums of k segments. Output the maximum integer that can be obtained among a... |
Web scraping 101. How to make a simple bot for winning in... | by German Sharabok | Towards Data Science | Web scraping is a process of retrieving data and conducting certain actions online. It is usually done by a bot in order to automate certain repetitive tasks. This is a rather large field of study and there are a lot of fun things you can do with it. Getting started does not have to be slow and difficult. In this artic... | [
{
"code": null,
"e": 670,
"s": 172,
"text": "Web scraping is a process of retrieving data and conducting certain actions online. It is usually done by a bot in order to automate certain repetitive tasks. This is a rather large field of study and there are a lot of fun things you can do with it. Gett... |
Convert a TSV file to Excel using Python - GeeksforGeeks | 22 Oct, 2021
A tab-separated values (TSV) file is a simple text format for storing and exchanging data in a tabular structure, such as a database table or spreadsheet data. The table’s rows match the text file’s lines. Every field value in a record is separated from the next by a tab character. As a result, the TSV for... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n22 Oct, 2021"
},
{
"code": null,
"e": 24670,
"s": 24292,
"text": "A tab-separated values (TSV) file is a simple text format for storing and exchanging data in a tabular structure, such as a database table or spreadsheet data. The... |
Python os.chmod() Method | Python method chmod() changes the mode of path to the passed numeric mode. The mode may take one of the following values or bitwise ORed combinations of them −
stat.S_ISUID − Set user ID on execution.
stat.S_ISUID − Set user ID on execution.
stat.S_ISGID − Set group ID on execution.
stat.S_ISGID − Set group ID on execu... | [
{
"code": null,
"e": 2404,
"s": 2244,
"text": "Python method chmod() changes the mode of path to the passed numeric mode. The mode may take one of the following values or bitwise ORed combinations of them −"
},
{
"code": null,
"e": 2445,
"s": 2404,
"text": "stat.S_ISUID − Set use... |
How to Master Pandas for Data Science | by Chanin Nantasenamat | Towards Data Science | Pandas is an open source Python library that allows the handling of tabular data (i.e. explore, clean and process). The term originated from the econometrics term panel data and thus PAN(el)-DA(ta)-S.
At a high-level, Pandas works very much like a spreadsheet (i.e. think Microsoft Excel or Google Sheets) as you work wi... | [
{
"code": null,
"e": 373,
"s": 172,
"text": "Pandas is an open source Python library that allows the handling of tabular data (i.e. explore, clean and process). The term originated from the econometrics term panel data and thus PAN(el)-DA(ta)-S."
},
{
"code": null,
"e": 789,
"s": 373... |
Find specific key value in array of objects using JavaScript | Suppose we have a JSON object like this −
const obj = {
"LAPTOP": [{
"productId": "123"
}],
"DESKTOP": [{
"productId": "456"
}],
"MOUSE": [{
"productId": "789"
}, {
"productId": "012"
}],
"KEY-BOARD": [{
"productId": "345"
}]
};
We are required to write a JavaScr... | [
{
"code": null,
"e": 1104,
"s": 1062,
"text": "Suppose we have a JSON object like this −"
},
{
"code": null,
"e": 1348,
"s": 1104,
"text": "const obj = {\n \"LAPTOP\": [{\n \"productId\": \"123\"\n }],\n \"DESKTOP\": [{\n \"productId\": \"456\"\n }],\n \"MOUSE... |
Tk - Canvas Arc Widget | Arc widget is used to draw an arc in canvas. The syntax for arc widget is shown below −
canvasName create arc x1 y1 x2 y2 options
x1 y1 and x2 y2 are the end points of an arc.
The options available for the arc widget are listed below in the following table −
-fill color
The fill color fills the arc with the color.
-st... | [
{
"code": null,
"e": 2289,
"s": 2201,
"text": "Arc widget is used to draw an arc in canvas. The syntax for arc widget is shown below −"
},
{
"code": null,
"e": 2332,
"s": 2289,
"text": "canvasName create arc x1 y1 x2 y2 options\n"
},
{
"code": null,
"e": 2378,
"s"... |
C# program to print all the common elements of two lists | Firstly create the two lists −
List list1 = new List() {40, 20, 60, 3, 55};
List list2 = new List() {20, 70, 55, 80};
To find the common elements, use the Intersect −
list1.Intersect(list2)
The following is the complete code to find the common elements between the two lists −
Live Demo
using System;
using System.Linq;... | [
{
"code": null,
"e": 1093,
"s": 1062,
"text": "Firstly create the two lists −"
},
{
"code": null,
"e": 1180,
"s": 1093,
"text": "List list1 = new List() {40, 20, 60, 3, 55};\nList list2 = new List() {20, 70, 55, 80};"
},
{
"code": null,
"e": 1229,
"s": 1180,
"... |
How to arrange data in s specific order in MySQL? | Use ORDER BY IF() to arrange data in a specific order. Following is the syntax −
select *from yourTableName ORDER BY IF(yourColumnName=yourValue1 OR
yourColumnName=yourValue2 OR yourColumnName=yourValue3,yourColumnName,
~yourColumnName) ASC;
Let us first create a table −
mysql> create table arrangeDataInSpecificOrder
... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "Use ORDER BY IF() to arrange data in a specific order. Following is the syntax −"
},
{
"code": null,
"e": 1304,
"s": 1143,
"text": "select *from yourTableName ORDER BY IF(yourColumnName=yourValue1 OR\nyourColumnName=yourValue2 OR you... |
How to Generate Automated PDF Documents with Python | by M Khorasani | Towards Data Science | When was the last time you grappled with a PDF document? You probably don’t have to look too far back to find the answer to that question. We deal with a multitude of documents on a daily basis in our lives and an overwhelmingly large number of those are indeed PDF documents. It is fair to claim that a lot of these doc... | [
{
"code": null,
"e": 744,
"s": 172,
"text": "When was the last time you grappled with a PDF document? You probably don’t have to look too far back to find the answer to that question. We deal with a multitude of documents on a daily basis in our lives and an overwhelmingly large number of those are ... |
MySQL If statement with multiple conditions? | You can use if statement in a stored procedure with multiple conditions with the help of AND or OR operator. The syntax is as follows −
DECLARE X int;
DECLARE Y int;
SET X = value1;
SET Y = value2;
IF ( (X < Y AND X > value1 AND Y >value2) OR X! = anyValueToCompare) THEN
yourStatement;
ELSE
yourStatement;
END IF
... | [
{
"code": null,
"e": 1198,
"s": 1062,
"text": "You can use if statement in a stored procedure with multiple conditions with the help of AND or OR operator. The syntax is as follows −"
},
{
"code": null,
"e": 1382,
"s": 1198,
"text": "DECLARE X int;\nDECLARE Y int;\nSET X = value1... |
How to load data from a pickle file in S3 using Python | by Natalie Olivo | Towards Data Science | I don’t know about you but I love diving into my data as efficiently as possible. Pulling different file formats from S3 is something I have to look up each time, so here I show how I load data from pickle files stored in S3 to my local Jupyter Notebook.
Never hard code your credentials! And if you do, make sure to nev... | [
{
"code": null,
"e": 427,
"s": 172,
"text": "I don’t know about you but I love diving into my data as efficiently as possible. Pulling different file formats from S3 is something I have to look up each time, so here I show how I load data from pickle files stored in S3 to my local Jupyter Notebook."... |
How to create a dynamic report card using HTML CSS and JavaScript ? - GeeksforGeeks | 03 Aug, 2021
We have to build a website where you can upload your student data like their name, marks in different subjects. And after uploading it will insert the student data in the table as well as, it will show the total marks, average, and pass/fail status. The implementation is done by using HTML and JavaScript.
... | [
{
"code": null,
"e": 25376,
"s": 25348,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 25683,
"s": 25376,
"text": "We have to build a website where you can upload your student data like their name, marks in different subjects. And after uploading it will insert the student data... |
Java Program to Create Grayscale Image - GeeksforGeeks | 28 Oct, 2021
The RGB model where red, green and blue lights are added in various different intensities and permutations and combinations of them producing broad spectrum array of colors whereas grayscale refers to the white and black colors only where the weakest intensity gives birth to black color and strongest as pu... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n28 Oct, 2021"
},
{
"code": null,
"e": 24065,
"s": 23557,
"text": "The RGB model where red, green and blue lights are added in various different intensities and permutations and combinations of them producing broad spectrum array ... |
Document.title() use in JavaScript? | The title property sets or returns the value of the title attribute of an element, nothing but providing extra information regarding the element. This is mostly used as a tooltip, which displays the text on mouse hovering. Javascript has provided document.title() to get the title.
document.title();
In the following exa... | [
{
"code": null,
"e": 1344,
"s": 1062,
"text": "The title property sets or returns the value of the title attribute of an element, nothing but providing extra information regarding the element. This is mostly used as a tooltip, which displays the text on mouse hovering. Javascript has provided docume... |
Sorting Algorithms — With Python. This blog compares the sorting... | by Amit Singh Rathore | Towards Data Science | Sorting means putting items in a particular order. That particular order is determined by the comparison property of the elements. In the case of integers, we say smaller number comes first and bigger number appear later. Arranging items in particular order improves the searching of the element. Hence sorting has heavy... | [
{
"code": null,
"e": 520,
"s": 172,
"text": "Sorting means putting items in a particular order. That particular order is determined by the comparison property of the elements. In the case of integers, we say smaller number comes first and bigger number appear later. Arranging items in particular ord... |
\neq - Tex Command | \neq - Used to create neq symbol.
{ \neq}
\neq command draws neq symbol.
\neq
≠
\neq
≠
\neq
14 Lectures
52 mins
Ashraf Said
11 Lectures
1 hours
Ashraf Said
9 Lectures
1 hours
Emenwa Global, Ejike IfeanyiChukwu
29 Lectures
2.5 hours
Mohammad Nauman
14... | [
{
"code": null,
"e": 8020,
"s": 7986,
"text": "\\neq - Used to create neq symbol."
},
{
"code": null,
"e": 8028,
"s": 8020,
"text": "{ \\neq}"
},
{
"code": null,
"e": 8059,
"s": 8028,
"text": "\\neq command draws neq symbol."
},
{
"code": null,
"e"... |
Difference between "int main()" and "int main(void)" in C/C++? - GeeksforGeeks | 07 Sep, 2018
Consider the following two definitions of main().
int main(){ /* */ return 0;}
and
int main(void){ /* */ return 0;}
What is the difference?
In C++, there is no difference, both are same.
Both definitions work in C also, but the second definition with void is considered technically better as it cl... | [
{
"code": null,
"e": 24099,
"s": 24071,
"text": "\n07 Sep, 2018"
},
{
"code": null,
"e": 24149,
"s": 24099,
"text": "Consider the following two definitions of main()."
},
{
"code": "int main(){ /* */ return 0;}",
"e": 24183,
"s": 24149,
"text": null
},
... |
C++ | Function Overloading and Default Arguments | Question 2 - GeeksforGeeks | 28 Jun, 2021
Output?
#include<iostream>using namespace std; int fun(int x = 0, int y = 0, int z){ return (x + y + z); } int main(){ cout << fun(10); return 0;}
(A) 10(B) 0(C) 20(D) Compiler ErrorAnswer: (D)Explanation: All default arguments must be the rightmost arguments. The following program works fine and pr... | [
{
"code": null,
"e": 24187,
"s": 24159,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24195,
"s": 24187,
"text": "Output?"
},
{
"code": "#include<iostream>using namespace std; int fun(int x = 0, int y = 0, int z){ return (x + y + z); } int main(){ cout << fun(10);... |
C Program to check if strings are rotations of each other or not - GeeksforGeeks | 13 Jan, 2022
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1?(eg given s1 = ABCD and s2 = CDAB, return true, given s1 = ABCD, and s2 = ACBD , return false)
Algorithm: areRotations(str1, str2)
1. Create a temp string and store concatenation of str1 to
str1 in temp.
... | [
{
"code": null,
"e": 24930,
"s": 24902,
"text": "\n13 Jan, 2022"
},
{
"code": null,
"e": 25114,
"s": 24930,
"text": "Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1?(eg given s1 = ABCD and s2 = CDAB, return true, given s1 = ABCD, and s2 = ... |
SQL Tryit Editor v1.6 | SELECT CustomerName, /*City,*/ Country FROM Customers;
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... | [
{
"code": null,
"e": 55,
"s": 0,
"text": "SELECT CustomerName, /*City,*/ Country FROM Customers;"
},
{
"code": null,
"e": 57,
"s": 55,
"text": ""
},
{
"code": null,
"e": 120,
"s": 57,
"text": "Edit the SQL Statement, and click \"Run SQL\" to see the result."
... |
C program to replace all zeros with one in a given integer. | Write a program to replace all zeros (0's) with 1 in a given integer.
Given an integer as an input, all the 0's in the number has to be replaced with 1.
Consider an example given below −
Here, the input is 102410 and the output is 112411.
Refer an algorithm given below to replace all the 0’s to 1 in an integer.
Step 1 ... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "Write a program to replace all zeros (0's) with 1 in a given integer."
},
{
"code": null,
"e": 1215,
"s": 1132,
"text": "Given an integer as an input, all the 0's in the number has to be replaced with 1."
},
{
"code": null,
... |
Haskell - Basic Operators | In this chapter, we will learn about different operators used in Haskell. Like other programming languages, Haskell intelligently handles some basic operations like addition, subtraction, multiplication, etc. In the upcoming chapters, we will learn more about different operators and their use.
In this chapter, we will ... | [
{
"code": null,
"e": 2210,
"s": 1915,
"text": "In this chapter, we will learn about different operators used in Haskell. Like other programming languages, Haskell intelligently handles some basic operations like addition, subtraction, multiplication, etc. In the upcoming chapters, we will learn more... |
Exploring the Limits to Growth with Python | World3, World2, PyWorld3 & PyWorld2 | Charles Vanwynsberghe | Towards Data Science | Because of its alarming forecast about the sustainable nature of the current World evolution, the Limits to Growth book written by Meadows et al became world-renowned when it came out in 1972. Yet, it faded from memory quite quickly, probably because it received lots of bad criticisms due to its conclusions, considered... | [
{
"code": null,
"e": 908,
"s": 172,
"text": "Because of its alarming forecast about the sustainable nature of the current World evolution, the Limits to Growth book written by Meadows et al became world-renowned when it came out in 1972. Yet, it faded from memory quite quickly, probably because it r... |
Arduino - while loop | while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit.
while(expression) {
Block of statements;
}
65 Lectures
6.5 hours
Amit Rana
43 Lectures
3 hours
... | [
{
"code": null,
"e": 3063,
"s": 2870,
"text": "while loops will loop continuously, and infinitely, until the expression inside the parenthesis, () becomes false. Something must change the tested variable, or the while loop will never exit."
},
{
"code": null,
"e": 3110,
"s": 3063,
... |
SQL WHERE Clause | The WHERE clause is used to filter records.
It is used to extract only those records that fulfill a specified
condition.
Note: The WHERE clause is not only used in
SELECT statements, it is also used in UPDATE,
DELETE, etc.!
Below is a selection from the "Customers" table in the Northwind sample database:
The followin... | [
{
"code": null,
"e": 44,
"s": 0,
"text": "The WHERE clause is used to filter records."
},
{
"code": null,
"e": 122,
"s": 44,
"text": "It is used to extract only those records that fulfill a specified \ncondition."
},
{
"code": null,
"e": 226,
"s": 122,
"text":... |
How to Generate Captcha Image in PHP ? - GeeksforGeeks | 05 Oct, 2021
In this article, we’ll see how to generate a very simple and effective Captcha Image in PHP. Captchas are smart (at least most of the time) verification systems that prevent sites from bots that steal data from the site or unnecessarily increases the traffic of the site. In addition to preventing spams, Ca... | [
{
"code": null,
"e": 24581,
"s": 24553,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 24985,
"s": 24581,
"text": "In this article, we’ll see how to generate a very simple and effective Captcha Image in PHP. Captchas are smart (at least most of the time) verification systems th... |
How to Compile a Lua Executable? | While there are different ways with which a person can compile a Lua executable, some of them require more time and resources.
The most basic approach is to set the Lua Path environment variable and then simply run the lua command. While this might seem to be not much of a pain, setting the Lua Path definitely requires... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "While there are different ways with which a person can compile a Lua executable, some of them require more time and resources."
},
{
"code": null,
"e": 1394,
"s": 1189,
"text": "The most basic approach is to set the Lua Path environm... |
How to create a column in an R data frame with cumulative sum? | The cumulative sum is used to determine the total sum of a variable or group and helps us to understand the changes in the values of that variable or group over time. While creating the cumulative, we must be sure that the total sum and the cumulative sum of the last value (depending on the direction of sum) are same. ... | [
{
"code": null,
"e": 1477,
"s": 1062,
"text": "The cumulative sum is used to determine the total sum of a variable or group and helps us to understand the changes in the values of that variable or group over time. While creating the cumulative, we must be sure that the total sum and the cumulative s... |
A Complete Introduction to Apache Airflow | by Rebecca Vickery | Towards Data Science | Airflow is a tool for automating and scheduling tasks and workflows. If you want to work efficiently as a data scientist, data analyst or data engineer it is essential to have a tool that can automate the processes you want to repeat on a regular basis. This can be anything from extracting, transforming and loading dat... | [
{
"code": null,
"e": 579,
"s": 171,
"text": "Airflow is a tool for automating and scheduling tasks and workflows. If you want to work efficiently as a data scientist, data analyst or data engineer it is essential to have a tool that can automate the processes you want to repeat on a regular basis. T... |
How to extract the split string elements in R? | To split string vector elements, we can use strsplit function. And if we want to extract the string elements after splitting then double and single square brackets will be used. The double square bracket will extract the string vector element and the single square will extract the element after splitting. Check out the... | [
{
"code": null,
"e": 1420,
"s": 1062,
"text": "To split string vector elements, we can use strsplit function. And if we want to extract the string elements after splitting then double and single square brackets will be used. The double square bracket will extract the string vector element and the si... |
Instruction type ADC R in 8085 Microprocessor | In 8085 assembly language coding, sometimes there is a requirement to add two numbers and where each of these numbers are having several Bytes in size. As example, let us add the following two 16-bit numbers.
1
10 50H
A0 F1H
------
B1 01H
In this example, the addition of 50H and F1H results in a sum of... | [
{
"code": null,
"e": 1271,
"s": 1062,
"text": "In 8085 assembly language coding, sometimes there is a requirement to add two numbers and where each of these numbers are having several Bytes in size. As example, let us add the following two 16-bit numbers."
},
{
"code": null,
"e": 1318,
... |
Gaussian filtering an image with NaN in Python Matplotlib | Gaussian filtering an image with NaN values makes all the values of a matrix NaN, which produces an NaN valued matrix.
Create a figure and a set of subplots.
Create a matrix with NaN value in that matrix.
Display the data as an image, i.e., on a 2D regular raster, data.
Apply Gaussian filter on the data.
Display the da... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "Gaussian filtering an image with NaN values makes all the values of a matrix NaN, which produces an NaN valued matrix."
},
{
"code": null,
"e": 1220,
"s": 1181,
"text": "Create a figure and a set of subplots."
},
{
"code": nu... |
Check if an array contains only one distinct element - GeeksforGeeks | 17 Aug, 2021
Given an array arr[] of size N, the task is to check if the array contains only one distinct element or not. If it contains only one distinct element then print “Yes”, otherwise print “No”.
Examples:
Input: arr[] = {3, 3, 4, 3, 3} Output: No Explanation: There are 2 distinct elements present in the array ... | [
{
"code": null,
"e": 24431,
"s": 24403,
"text": "\n17 Aug, 2021"
},
{
"code": null,
"e": 24621,
"s": 24431,
"text": "Given an array arr[] of size N, the task is to check if the array contains only one distinct element or not. If it contains only one distinct element then print “Y... |
Generate all numbers up to N in Lexicographical Order | 16 Jul, 2021
Given an integer N, the task is to print all numbers up to N in Lexicographical order.
Examples:
Input: N = 15 Output: 1 10 11 12 13 14 15 2 3 4 5 6 7 8 9
Input: N = 19 Output: 1 10 11 12 13 14 15 16 17 18 19 2 3 4 5 6 7 8 9
Approach: In order to solve the problem, follow the steps below:
Iterate from ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Jul, 2021"
},
{
"code": null,
"e": 139,
"s": 52,
"text": "Given an integer N, the task is to print all numbers up to N in Lexicographical order."
},
{
"code": null,
"e": 150,
"s": 139,
"text": "Examples: "
},
... |
How do I identify if a string is a number in C#? | Let us say our string is −
string str = "3456";
Now, to check whether the entered string is a number or not −
str.All(c => char.IsDigit(c))
The above returns true if the string is a number, else false.
Here is the complete code −
Live Demo
using System;
using System.Linq;
namespace Demo {
public class MyApplicatio... | [
{
"code": null,
"e": 1214,
"s": 1187,
"text": "Let us say our string is −"
},
{
"code": null,
"e": 1235,
"s": 1214,
"text": "string str = \"3456\";"
},
{
"code": null,
"e": 1297,
"s": 1235,
"text": "Now, to check whether the entered string is a number or not −... |
C# program to print unique values from a list | Set the list.
List < int > list = new List < int > ();
list.Add(99);
list.Add(49);
list.Add(32);
To get unique elements.
List<int> myList = list.Distinct().ToList();
Here is the complete example to display unique values from a list.
Live Demo
using System;
using System.Collections.Generic;
using System.Linq;
public c... | [
{
"code": null,
"e": 1201,
"s": 1187,
"text": "Set the list."
},
{
"code": null,
"e": 1284,
"s": 1201,
"text": "List < int > list = new List < int > ();\nlist.Add(99);\nlist.Add(49);\nlist.Add(32);"
},
{
"code": null,
"e": 1308,
"s": 1284,
"text": "To get uniq... |
How to change the text and image by just clicking a button in JavaScript ? | 18 May, 2022
The image and text can be changed by using javascript functions and then calling the functions by clicking a button. We will done that into 3 sections., in the first section we will create the structure by using only HTML in the second section we will design minimally to make it attractive by using simple ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 May, 2022"
},
{
"code": null,
"e": 442,
"s": 54,
"text": "The image and text can be changed by using javascript functions and then calling the functions by clicking a button. We will done that into 3 sections., in the first section ... |
How to change the background image using jQuery ? | 03 Aug, 2021
To change the background image using jQuery, you can use the jQuery CSS() method. For this, the whole property value is specified using the url() functional notation.
Approach: Suppose we have an image URL stored in a variable and then use css() method to change the value of background image.
Below example... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 219,
"s": 52,
"text": "To change the background image using jQuery, you can use the jQuery CSS() method. For this, the whole property value is specified using the url() functional notation."
},
... |
How to validate Email Id in jQuery ? | 10 Nov, 2021
The task is to implement, how Email is validated in jQuery. jQuery is the fastest and lightweight JavaScript library that is used to simplify the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript.
jQuery is widely famous for its motto of “Write les... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 309,
"s": 53,
"text": "The task is to implement, how Email is validated in jQuery. jQuery is the fastest and lightweight JavaScript library that is used to simplify the interactions between an HTML... |
Josh Technology Interview Experience for SDE (Off-Campus) | 12 Jan, 2021
Online Selection Test: The comprised of three phases and all of them were on the same day.
Phase 1(MCQ ROUND): This round consists of 50 MCQs on C programming language, we were given 50 minutes to solve 50 questions, this phase also had some output based ques where we were given a code snippet, and we were... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Jan, 2021"
},
{
"code": null,
"e": 145,
"s": 54,
"text": "Online Selection Test: The comprised of three phases and all of them were on the same day."
},
{
"code": null,
"e": 584,
"s": 145,
"text": "Phase 1(MCQ RO... |
Program to convert Array to Set in Java | 09 Jun, 2022
Array is a group of like-typed variables that are referred to by a common name. An array can contain primitives data types as well as objects of a class depending on the definition of the array. In the case of primitives data types, the actual values are stored in contiguous memory locations. In case of ob... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 650,
"s": 28,
"text": "Array is a group of like-typed variables that are referred to by a common name. An array can contain primitives data types as well as objects of a class depending on the defin... |
Lodash _.assign() Method | 13 Sep, 2020
Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.
The _.assign() method is used to assign the enumerable string keyed properties of the given source objects to the destination objects. The source objects are applied f... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Sep, 2020"
},
{
"code": null,
"e": 168,
"s": 28,
"text": "Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc."
},
{
"code": null,
"e"... |
Sort n numbers in range from 0 to n^2 – 1 in linear time | 17 Jan, 2022
Given an array of numbers of size n. It is also given that the array elements are in range from 0 to n2 – 1. Sort the given array in linear time.
Examples:
Since there are 5 elements, the elements can be from 0 to 24.
Input: arr[] = {0, 23, 14, 12, 9}
Output: arr[] = {0, 9, 12, 14, 23}
Since there are 3 ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 200,
"s": 54,
"text": "Given an array of numbers of size n. It is also given that the array elements are in range from 0 to n2 – 1. Sort the given array in linear time."
},
{
"code": null,
... |
How to Disable Previous or Future Dates in Datepicker in Android? | 15 Jul, 2021
In this article, we are going to disable previous or future dates in Datepicker. Most of the time when we use DatePicker in Android we see that all the date in that is enabled. We can select any of the dates. But here we are going to see how to disable past or future dates. Disabling the Past Date can be u... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jul, 2021"
},
{
"code": null,
"e": 594,
"s": 28,
"text": "In this article, we are going to disable previous or future dates in Datepicker. Most of the time when we use DatePicker in Android we see that all the date in that is enabled... |
Ruby | Inheritance | 05 Aug, 2021
Ruby is the ideal object-oriented language. In an object-oriented programming language, inheritance is one of the most important features. Inheritance allows the programmer to inherit the characteristics of one class into another class. Ruby supports only single class inheritance, it does not support multi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 491,
"s": 28,
"text": "Ruby is the ideal object-oriented language. In an object-oriented programming language, inheritance is one of the most important features. Inheritance allows the programmer to... |
Poor man’s GPT-3: Few shot text generation with T5 Transformer | by Ramsri Goutham | Towards Data Science | I’m sure most of you have heard about OpenAI’s GPT-3 and its insane text generation capabilities learning from only a few examples.
The concept of feeding a model with very little training data and making it learn to do a novel task is called Few-shot learning.
A website GPT-3 examples captures all the impressive appli... | [
{
"code": null,
"e": 303,
"s": 171,
"text": "I’m sure most of you have heard about OpenAI’s GPT-3 and its insane text generation capabilities learning from only a few examples."
},
{
"code": null,
"e": 433,
"s": 303,
"text": "The concept of feeding a model with very little traini... |
Angular 4 - Module | Module in Angular refers to a place where you can group the components, directives, pipes, and services, which are related to the application.
In case you are developing a website, the header, footer, left, center and the right section become part of a module.
To define module, we can use the NgModule. When you create ... | [
{
"code": null,
"e": 2135,
"s": 1992,
"text": "Module in Angular refers to a place where you can group the components, directives, pipes, and services, which are related to the application."
},
{
"code": null,
"e": 2253,
"s": 2135,
"text": "In case you are developing a website, t... |
NLP in the Stock Market. Leveraging sentiment analysis on 10-k... | by Roshan Adusumilli | Towards Data Science | Machine learning models implemented in trading are often trained on historical stock prices and other quantitative data to predict future stock prices. However, natural language processing (NLP) enables us to analyze financial documents such as 10-k forms to forecast stock movements. 10-k forms are annual reports filed... | [
{
"code": null,
"e": 1005,
"s": 171,
"text": "Machine learning models implemented in trading are often trained on historical stock prices and other quantitative data to predict future stock prices. However, natural language processing (NLP) enables us to analyze financial documents such as 10-k form... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.