title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Array to BST | Practice | GeeksforGeeks | Given a sorted array. Convert it into a Height balanced Binary Search Tree (BST). Find the preorder traversal of height balanced BST. If there exist many such balanced BST consider the tree whose preorder is lexicographically smallest.
Height balanced BST means a binary tree in which the depth of the left subtree and t... | [
{
"code": null,
"e": 618,
"s": 238,
"text": "Given a sorted array. Convert it into a Height balanced Binary Search Tree (BST). Find the preorder traversal of height balanced BST. If there exist many such balanced BST consider the tree whose preorder is lexicographically smallest.\nHeight balanced BS... |
Rendering OpenAI Gym Envs on Binder and Google Colab | by David R. Pugh | Towards Data Science | I am currently using my COVID-19 imposed quarantine to expand my deep learning skills by completing the Deep Reinforcement Learning Nanodegree from Udacity. Almost immediately I ran into the tedious problem of getting my simulations to render properly when training on remote servers.
In particular, getting OpenAI Gym e... | [
{
"code": null,
"e": 456,
"s": 171,
"text": "I am currently using my COVID-19 imposed quarantine to expand my deep learning skills by completing the Deep Reinforcement Learning Nanodegree from Udacity. Almost immediately I ran into the tedious problem of getting my simulations to render properly whe... |
Run a Python program from PHP | In PHP, the ‘shell_exec’ function can be used. It can be executed via the shell and the result can be returned as a string. It returns an error if NULL is passed from the command line or returns no output at all.
Below is a code demonstration of the same −
<?php
$command_exec = escapeshellcmd('path-to-.py-file');
... | [
{
"code": null,
"e": 1275,
"s": 1062,
"text": "In PHP, the ‘shell_exec’ function can be used. It can be executed via the shell and the result can be returned as a string. It returns an error if NULL is passed from the command line or returns no output at all."
},
{
"code": null,
"e": 131... |
Serving html pages from node.js | So far we sent html code directly from the send(0 function in response object. For sending larger code, we definitely require to have a separate file for html code.
sendFile() function−
Response object gives a sendFile() function to return a html file to client.
How to provide path to html file in sendFile() ?
We impor... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "So far we sent html code directly from the send(0 function in response object. For sending larger code, we definitely require to have a separate file for html code."
},
{
"code": null,
"e": 1248,
"s": 1227,
"text": "sendFile() functi... |
Q-Learning Algorithm: From Explanation to Implementation | by Amrani Amine | Towards Data Science | In my today’s medium post, I will teach you how to implement the Q-Learning algorithm. But before that, I will first explain the idea behind Q-Learning and its limitation. Please be sure to have some Reinforcement Learning (RL) basics. Otherwise, please check my previous post about the intuition and the key math behind... | [
{
"code": null,
"e": 497,
"s": 172,
"text": "In my today’s medium post, I will teach you how to implement the Q-Learning algorithm. But before that, I will first explain the idea behind Q-Learning and its limitation. Please be sure to have some Reinforcement Learning (RL) basics. Otherwise, please c... |
HTML - Layouts | A webpage layout is very important to give better look to your website. It takes considerable time to design a website's layout with great look and feel.
Now-a-days, all modern websites are using CSS and JavaScript based framework to come up with responsive and dynamic websites but you can create a good layout using si... | [
{
"code": null,
"e": 2528,
"s": 2374,
"text": "A webpage layout is very important to give better look to your website. It takes considerable time to design a website's layout with great look and feel."
},
{
"code": null,
"e": 2909,
"s": 2528,
"text": "Now-a-days, all modern websi... |
Loop through array and edit string JavaScript | Let’s say, we have to write a function, say translate() that accepts a string as the first argument
and any number of words after that.
The string will actually contain n $ signs like this −
This $0 is more $1 just a $2.
Then there will be 3 strings which will replace the corresponding places.
For example −
If the func... | [
{
"code": null,
"e": 1198,
"s": 1062,
"text": "Let’s say, we have to write a function, say translate() that accepts a string as the first argument\nand any number of words after that."
},
{
"code": null,
"e": 1253,
"s": 1198,
"text": "The string will actually contain n $ signs li... |
Query API’s with Json Output in Python | by Alexandra Yanina | Towards Data Science | If you are a Data Science beginner, you will often work in courses and tutorials with .csv files that are easy to read into Pandas dataframes. In practice, however, you often need to access API’s and get data in Json format. This data often contains nested lists and dictionaries.
So today I will explain how to query an... | [
{
"code": null,
"e": 453,
"s": 172,
"text": "If you are a Data Science beginner, you will often work in courses and tutorials with .csv files that are easy to read into Pandas dataframes. In practice, however, you often need to access API’s and get data in Json format. This data often contains neste... |
Find the count of EMPTY or NULL columns in a MySQL table? | Let us first create a table −
mysql> create table DemoTable781 (
Name varchar(100)
);
Query OK, 0 rows affected (0.66 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable781 values('');
Query OK, 1 row affected (0.29 sec)
mysql> insert into DemoTable781 values('Chris');
Query OK,... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1188,
"s": 1092,
"text": "mysql> create table DemoTable781 (\n Name varchar(100)\n);\nQuery OK, 0 rows affected (0.66 sec)"
},
{
"code": null,
"e": 1244,
"s": 1... |
Find the cordinates of the fourth vertex of a rectangle with given 3 vertices in Python | Suppose we have a grid of size Q * P, this grid contains exactly three asterisk '*' and every other cell there is dot '.', where '*' is for a vertex of a rectangle. We have to find the coordinates of the missing vertex. Here we will consider 1-based indexing.
So, if the input is like grid = [ ".*.", "...", "*.*" ], the... | [
{
"code": null,
"e": 1322,
"s": 1062,
"text": "Suppose we have a grid of size Q * P, this grid contains exactly three asterisk '*' and every other cell there is dot '.', where '*' is for a vertex of a rectangle. We have to find the coordinates of the missing vertex. Here we will consider 1-based ind... |
Node.js Date.parse() API - GeeksforGeeks | 12 Mar, 2021
The date-and-time.Date.parse() is a minimalist collection of functions for manipulating JS date and time module which is used to parse the date according to a certain pattern.
Required Module: Install the module by npm or used it locally.
By using npm.
npm install date-and-time --save
By using CDN link.
<s... | [
{
"code": null,
"e": 24531,
"s": 24503,
"text": "\n12 Mar, 2021"
},
{
"code": null,
"e": 24707,
"s": 24531,
"text": "The date-and-time.Date.parse() is a minimalist collection of functions for manipulating JS date and time module which is used to parse the date according to a cert... |
Python 3 - os.chmod() Method | The 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 executio... | [
{
"code": null,
"e": 2497,
"s": 2340,
"text": "The 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": 2538,
"s": 2497,
"text": "stat.S_ISUID − Set user I... |
PL/SQL - Nested IF-THEN-ELSE Statements | It is always legal in PL/SQL programming to nest the IF-ELSE statements, which means you can use one IF or ELSE IF statement inside another IF or ELSE IF statement(s).
IF( boolean_expression 1)THEN
-- executes when the boolean expression 1 is true
IF(boolean_expression 2) THEN
-- executes when the boole... | [
{
"code": null,
"e": 2233,
"s": 2065,
"text": "It is always legal in PL/SQL programming to nest the IF-ELSE statements, which means you can use one IF or ELSE IF statement inside another IF or ELSE IF statement(s)."
},
{
"code": null,
"e": 2549,
"s": 2233,
"text": "IF( boolean_ex... |
Find the minimum element in a sorted and rotated array - GeeksforGeeks | 23 Feb, 2022
A sorted array is rotated at some unknown point, find the minimum element in it. The following solution assumes that all elements are distinct.
Examples:
Input: {5, 6, 1, 2, 3, 4}
Output: 1
Input: {1, 2, 3, 4}
Output: 1
Input: {2, 1}
Output: 1
A simple solution is to traverse the complete array and find... | [
{
"code": null,
"e": 41276,
"s": 41248,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 41420,
"s": 41276,
"text": "A sorted array is rotated at some unknown point, find the minimum element in it. The following solution assumes that all elements are distinct."
},
{
"code... |
Check whether BST contains Dead End or not - GeeksforGeeks | 07 Mar, 2022
Given a Binary search Tree that contains positive integer values greater than 0. The task is to check whether the BST contains a dead end or not. Here Dead End means, we are not able to insert any element after that node.Examples:
Input : 8
/ \
5 9
/ \
... | [
{
"code": null,
"e": 25336,
"s": 25308,
"text": "\n07 Mar, 2022"
},
{
"code": null,
"e": 25569,
"s": 25336,
"text": "Given a Binary search Tree that contains positive integer values greater than 0. The task is to check whether the BST contains a dead end or not. Here Dead End mea... |
Angular10 getLocaleId() Function - GeeksforGeeks | 30 Apr, 2021
In this article, we are going to see what is getLocaleId in Angular 10 and how to use it.
The getLocaleId is used to get the locale ID from the current locale.
Syntax:
getLocaleId(locale: string): string
NgModule: Module used by getLocaleId is:
CommonModule
Approach:
Create the angular app to be used
In ap... | [
{
"code": null,
"e": 25109,
"s": 25081,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 25199,
"s": 25109,
"text": "In this article, we are going to see what is getLocaleId in Angular 10 and how to use it."
},
{
"code": null,
"e": 25269,
"s": 25199,
"text": "... |
Changing the color of an axis in Matplotlib | First, we can get the axes. Then, ax.spines could help to set the color by specifying the name of the axes, i.e., top, bottom, right and left.
Add an axes to the current figure and make it the current axes.
Add an axes to the current figure and make it the current axes.
Using step 1 axes, we can set the color of all th... | [
{
"code": null,
"e": 1205,
"s": 1062,
"text": "First, we can get the axes. Then, ax.spines could help to set the color by specifying the name of the axes, i.e., top, bottom, right and left."
},
{
"code": null,
"e": 1269,
"s": 1205,
"text": "Add an axes to the current figure and m... |
Marker interface in Java programming. | An empty interface in Java is known as a marker interface i.e. it does not contain any methods or fields by implementing these interfaces a class will exhibit a special behavior with respect to the interface implemented. java.lang.Cloneable and java.io.Serializable are examples of marker interfaces.
Consider the follow... | [
{
"code": null,
"e": 1363,
"s": 1062,
"text": "An empty interface in Java is known as a marker interface i.e. it does not contain any methods or fields by implementing these interfaces a class will exhibit a special behavior with respect to the interface implemented. java.lang.Cloneable and java.io.... |
Git - Patch Operation | Patch is a text file, whose contents are similar to Git diff, but along with code, it also has metadata about commits; e.g., commit ID, date, commit message, etc. We can create a patch from commits and other people can apply them to their repository.
Jerry implements the strcat function for his project. Jerry can creat... | [
{
"code": null,
"e": 2296,
"s": 2045,
"text": "Patch is a text file, whose contents are similar to Git diff, but along with code, it also has metadata about commits; e.g., commit ID, date, commit message, etc. We can create a patch from commits and other people can apply them to their repository."
... |
Count the Number of matching characters in a pair of string in Python | We are given two strings. We need to find the count it of the characters in the first string which are also present in a second string.
The set function gives us unique values all the elements in a string. We also use the the & operator which finds the common elements between the two given strings.
Live Demo
strA = 'T... | [
{
"code": null,
"e": 1198,
"s": 1062,
"text": "We are given two strings. We need to find the count it of the characters in the first string which are also present in a second string."
},
{
"code": null,
"e": 1362,
"s": 1198,
"text": "The set function gives us unique values all th... |
Train Image Recognition AI with 5 lines of code | by Moses Olafenwa | Towards Data Science | In this article, we will briefly introduce the field of artificial intelligence, particularly in computer vision, the challenges involved, the existing modern solutions to these challenges and how you can apply these solutions conveniently and easily without taking much time and effort.
Artificial Intelligence has for ... | [
{
"code": null,
"e": 460,
"s": 172,
"text": "In this article, we will briefly introduce the field of artificial intelligence, particularly in computer vision, the challenges involved, the existing modern solutions to these challenges and how you can apply these solutions conveniently and easily with... |
Dynamic Spinner in Kotlin - GeeksforGeeks | 28 Mar, 2022
Android Spinner is a view similar to dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it.
Default value of the android spinner will be currently selected v... | [
{
"code": null,
"e": 23753,
"s": 23725,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 23995,
"s": 23753,
"text": "Android Spinner is a view similar to dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the... |
Explain attributes and the different types of attributes in DBMS? | Attributes are the properties which describe an entity.
Example
The attributes of student entity are as follows −
Roll number
Roll number
Name
Name
Branch
Branch
Age
Age
The different types of attributes are as follows −
It can be divided into smaller sub parts, each sub part can form an independent attribute.
For exam... | [
{
"code": null,
"e": 1118,
"s": 1062,
"text": "Attributes are the properties which describe an entity."
},
{
"code": null,
"e": 1126,
"s": 1118,
"text": "Example"
},
{
"code": null,
"e": 1176,
"s": 1126,
"text": "The attributes of student entity are as follows... |
Convert characters of a string to opposite case - GeeksforGeeks | 16 Mar, 2022
Given a string, convert the characters of the string into opposite case,i.e. if a character is lower case then convert it into upper case and vice-versa.
Examples:
Input : geeksForgEeks
Output : GEEKSfORGeEKS
Input : hello every one
Output : HELLO EVERY ONE
ASCII values of alphabets: A – Z = 65 to 90, ... | [
{
"code": null,
"e": 25186,
"s": 25158,
"text": "\n16 Mar, 2022"
},
{
"code": null,
"e": 25341,
"s": 25186,
"text": "Given a string, convert the characters of the string into opposite case,i.e. if a character is lower case then convert it into upper case and vice-versa. "
},
... |
Creating a Pandas Series from Lists - GeeksforGeeks | 06 Jan, 2019
A Series is a one-dimensional labeled array capable of holding any data type (integers, strings, floating point numbers, Python objects, etc.). It has to be remembered that unlike Python lists, a Series will always contain data of the same type.
Let’s see how to create a Pandas Series from lists.
Method #1... | [
{
"code": null,
"e": 24844,
"s": 24816,
"text": "\n06 Jan, 2019"
},
{
"code": null,
"e": 25090,
"s": 24844,
"text": "A Series is a one-dimensional labeled array capable of holding any data type (integers, strings, floating point numbers, Python objects, etc.). It has to be rememb... |
Query a nested field within an array with MongoDB | To query a nested field within an array, use $elemMatch in MongoDB. Let us create a collection with documents −
> db.demo153.insertOne({"ClientDetails":[{"ClientName":"Chris","ClientProject":"Online Banking System"},{"ClientName":"David","ClientProject":"Online School Management"}]});
{
"acknowledged" : true,
"in... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "To query a nested field within an array, use $elemMatch in MongoDB. Let us create a collection with documents −"
},
{
"code": null,
"e": 1680,
"s": 1174,
"text": "> db.demo153.insertOne({\"ClientDetails\":[{\"ClientName\":\"Chris\",\... |
Ext.js - Class System | Ext JS is a JavaScript framework having functionalities of object oriented programming. Ext is the namespace, which encapsulates all the classes in Ext JS.
Ext provides more than 300 classes, which we can use for various functionalities.
Ext.define() is used for defining the classes in Ext JS.
Ext.define(class name, cl... | [
{
"code": null,
"e": 2179,
"s": 2023,
"text": "Ext JS is a JavaScript framework having functionalities of object oriented programming. Ext is the namespace, which encapsulates all the classes in Ext JS."
},
{
"code": null,
"e": 2261,
"s": 2179,
"text": "Ext provides more than 300... |
Network Visualizations with GRANDstack | by Tomaz Bratanic | Towards Data Science | Throughout the years, I have worked on a couple of Neo4j projects. Almost all the projects have in common that there was a need to develop a custom network visualization tool that would allow end-users to explore the graph without having to learn any Cypher query language syntax. This blog post will present a simple ne... | [
{
"code": null,
"e": 695,
"s": 172,
"text": "Throughout the years, I have worked on a couple of Neo4j projects. Almost all the projects have in common that there was a need to develop a custom network visualization tool that would allow end-users to explore the graph without having to learn any Cyph... |
Scala Stack take() method with example - GeeksforGeeks | 03 Nov, 2019
In Scala Stack class, the take() method is utilized to return a stack consisting of the first ‘n’ elements of the stack.
Method Definition: def take(n: Int): Stack[A]
Return Type: It returns a stack consisting of the first ‘n’ elements of the stack.
Example #1:
// Scala program of take() // method // Imp... | [
{
"code": null,
"e": 24138,
"s": 24110,
"text": "\n03 Nov, 2019"
},
{
"code": null,
"e": 24259,
"s": 24138,
"text": "In Scala Stack class, the take() method is utilized to return a stack consisting of the first ‘n’ elements of the stack."
},
{
"code": null,
"e": 24305... |
PyQt5 – Setting and accessing WHATS THIS help text for Status Bar - GeeksforGeeks | 26 Mar, 2020
n PyQt5 there are lots of widgets and bars and when we tend to make an application, we end up putting lots of windows and for each window there exit status bar. Sometimes we can’t remember why this status bar is used and what is this status bar. That’s why for back-end purposes PyQt5 allows us to set help ... | [
{
"code": null,
"e": 25034,
"s": 25006,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 25423,
"s": 25034,
"text": "n PyQt5 there are lots of widgets and bars and when we tend to make an application, we end up putting lots of windows and for each window there exit status bar. So... |
Control Structures in Programming Languages - GeeksforGeeks | 16 Jan, 2020
Control Structures are just a way to specify flow of control in programs. Any algorithm or program can be more clear and understood if they use self-contained modules called as logic or control structures. It basically analyzes and chooses in which direction a program flows based on certain parameters or c... | [
{
"code": null,
"e": 24648,
"s": 24620,
"text": "\n16 Jan, 2020"
},
{
"code": null,
"e": 25034,
"s": 24648,
"text": "Control Structures are just a way to specify flow of control in programs. Any algorithm or program can be more clear and understood if they use self-contained modu... |
Blazing Fast Data Wrangling With R data.table | by Thu Vu | Towards Data Science | Update March 2020: You can find a very interesting comparison between data.tableand dplyr here.
I have recently noticed that every R script I wrote starts with library(data.table). And that seems a very compelling reason for me to write a post about it.
You may have seen that as the machine learning community is develo... | [
{
"code": null,
"e": 268,
"s": 172,
"text": "Update March 2020: You can find a very interesting comparison between data.tableand dplyr here."
},
{
"code": null,
"e": 426,
"s": 268,
"text": "I have recently noticed that every R script I wrote starts with library(data.table). And t... |
Google Charts - Basic Timelines Chart | Following is an example of a basic timelines chart. We've already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let's see the complete example.
We've used Timeline class to show timelines diagram.
//Timeline chart
var chart = new google.visualization.Timeline(document... | [
{
"code": null,
"e": 2457,
"s": 2261,
"text": "Following is an example of a basic timelines chart. We've already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let's see the complete example."
},
{
"code": null,
"e": 2510,
"s": 2457,... |
Python - Get Indices of Even Elements from list - GeeksforGeeks | 23 Jan, 2020
Sometimes, while working with Python lists, we can have a problem in which we wish to find Even elements. This task can occur in many domains such as web development and while working with Databases. We might sometimes, require to just find the indices of them. Let’s discuss certain way to find indices of ... | [
{
"code": null,
"e": 24041,
"s": 24013,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 24363,
"s": 24041,
"text": "Sometimes, while working with Python lists, we can have a problem in which we wish to find Even elements. This task can occur in many domains such as web developme... |
Haskell - Function Composition | Function Composition is the process of using the output of one function as an input of another function. It will be better if we learn the mathematics behind composition. In mathematics, composition is denoted by f{g(x)} where g() is a function and its output in used as an input of another function, that is, f().
Funct... | [
{
"code": null,
"e": 2230,
"s": 1915,
"text": "Function Composition is the process of using the output of one function as an input of another function. It will be better if we learn the mathematics behind composition. In mathematics, composition is denoted by f{g(x)} where g() is a function and its ... |
RPAD() Function in MySQL - GeeksforGeeks | 21 Jun, 2021
RPAD() function in MySQL is used to pad or add a string to the right side of the original string.
Syntax :
RPAD(str, len, padstr)
Parameter : This function accepts three parameter as mentioned above and described below :
str : The actual string which is to be padded. If the length of the original stri... | [
{
"code": null,
"e": 23913,
"s": 23885,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 24012,
"s": 23913,
"text": "RPAD() function in MySQL is used to pad or add a string to the right side of the original string. "
},
{
"code": null,
"e": 24023,
"s": 24012,
... |
How does MySQL handle out of range numeric values? | Handling of MySQL numeric value that is out of allowed range of column data type depends upon the SQL mode in following ways −
(A) Enabled SQL strict mode - When strict SQL mode is enabled, MySQL returns the error on entering the put-of-range value. In this case, the insertion of some or all the values got failed.
For ... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "Handling of MySQL numeric value that is out of allowed range of column data type depends upon the SQL mode in following ways −"
},
{
"code": null,
"e": 1378,
"s": 1189,
"text": "(A) Enabled SQL strict mode - When strict SQL mode is e... |
Cassandra - Shell Commands | Cassandra provides documented shell commands in addition to CQL commands. Given below are the Cassandra documented shell commands.
The HELP command displays a synopsis and a brief description of all cqlsh commands. Given below is the usage of help command.
cqlsh> help
Documented shell commands:
=======================... | [
{
"code": null,
"e": 2418,
"s": 2287,
"text": "Cassandra provides documented shell commands in addition to CQL commands. Given below are the Cassandra documented shell commands."
},
{
"code": null,
"e": 2544,
"s": 2418,
"text": "The HELP command displays a synopsis and a brief de... |
Different Types of Normalization in Tensorflow | by Vardan Agarwal | Towards Data Science | When normalization was introduced in deep learning, it was the next big thing and improved performances considerably. Getting it right can be a crucial factor for your model. Ever had those questions whatever the hell is batch normalization and how does it improve performances. Also are there any substitutes for it? If... | [
{
"code": null,
"e": 626,
"s": 172,
"text": "When normalization was introduced in deep learning, it was the next big thing and improved performances considerably. Getting it right can be a crucial factor for your model. Ever had those questions whatever the hell is batch normalization and how does i... |
How to scrape ANY website with python and beautiful soup (static web) | by Patrick Collins | Towards Data Science | Note: This is a purely technical tutorial. Please check with the policies of the website before engaging in any scraping.
For those who want to see it done in front of your eyes, check out my YouTube video at the bottom of the page.
Scraping the web can be done for a TON of reasons.
Do you want to get stats on your foo... | [
{
"code": null,
"e": 294,
"s": 172,
"text": "Note: This is a purely technical tutorial. Please check with the policies of the website before engaging in any scraping."
},
{
"code": null,
"e": 405,
"s": 294,
"text": "For those who want to see it done in front of your eyes, check o... |
5 Techniques to work with Imbalanced Data in Machine Learning | by Satyam Kumar | Towards Data Science | For classification tasks, one may encounter situations where the target class label is un-equally distributed across various classes. Such conditions are termed as an Imbalanced target class. Modeling an imbalanced dataset is a major challenge faced by data scientists, as due to the presence of an imbalance in the data... | [
{
"code": null,
"e": 557,
"s": 172,
"text": "For classification tasks, one may encounter situations where the target class label is un-equally distributed across various classes. Such conditions are termed as an Imbalanced target class. Modeling an imbalanced dataset is a major challenge faced by da... |
Statistics is dead, long live statistics! | Towards Data Science | Estimating confidence intervals and hypothesis testing are two common statistical tasks. They have an air of mystery around them as they rely on math accompanied by complex and case-specific assumptions. While this is still the way many people do stats, I argue it is not the best way. Modern computing power allows us t... | [
{
"code": null,
"e": 604,
"s": 171,
"text": "Estimating confidence intervals and hypothesis testing are two common statistical tasks. They have an air of mystery around them as they rely on math accompanied by complex and case-specific assumptions. While this is still the way many people do stats, I... |
Word Break - Part 2 | Practice | GeeksforGeeks | Given a string s and a dictionary of words dict of length n, add spaces in s to construct a sentence where each word is a valid dictionary word. Each dictionary word can be used more than once. Return all such possible sentences.
Follow examples for better understanding.
Example 1:
Input: s = "catsanddog", n = 5
dict ... | [
{
"code": null,
"e": 468,
"s": 238,
"text": "Given a string s and a dictionary of words dict of length n, add spaces in s to construct a sentence where each word is a valid dictionary word. Each dictionary word can be used more than once. Return all such possible sentences."
},
{
"code": nul... |
How to Create Publication-Ready Plots with LaTeX | by Aruna Pisharody | Towards Data Science | If you’ve ever written an article in a scientific journal, chances are that you’ve used a LaTeX template for preparing your manuscript. It is after all the industry standard in typesetting documents. However, how many of you have considered LaTeX as a plotting tool?
LaTeX offers a powerful visualization library, PGFPlo... | [
{
"code": null,
"e": 439,
"s": 172,
"text": "If you’ve ever written an article in a scientific journal, chances are that you’ve used a LaTeX template for preparing your manuscript. It is after all the industry standard in typesetting documents. However, how many of you have considered LaTeX as a plo... |
Convert from any base to decimal and vice versa in C++ | In this tutorial, we will be discussing a program to convert from any base to a decimal and vice versa.
For this we will be provided with an integer and its base. Our task is to convert the number to its decimal equivalent. Further we will also be performing the reverse of this procedure as well.
Live Demo
#include <s... | [
{
"code": null,
"e": 1166,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to convert from any base to a decimal and vice versa."
},
{
"code": null,
"e": 1360,
"s": 1166,
"text": "For this we will be provided with an integer and its base. Our task is to conv... |
How to dynamically set the height and width of a div element using jQuery ? - GeeksforGeeks | 03 Aug, 2021
Set the height of a div element using jQuery
The content height of a div can dynamically set or change using height(), innerHeight(), and outerHeight() methods depending upon the user requirement. If the user wants to change the content height of a div dynamically, it includes changing the actual height, a... | [
{
"code": null,
"e": 25539,
"s": 25511,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 25584,
"s": 25539,
"text": "Set the height of a div element using jQuery"
},
{
"code": null,
"e": 26034,
"s": 25584,
"text": "The content height of a div can dynamically s... |
SQL Tryit Editor v1.6 | SELECT * FROM Customers
ORDER BY CustomerName;
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 ... | [
{
"code": null,
"e": 24,
"s": 0,
"text": "SELECT * FROM Customers"
},
{
"code": null,
"e": 47,
"s": 24,
"text": "ORDER BY CustomerName;"
},
{
"code": null,
"e": 49,
"s": 47,
"text": ""
},
{
"code": null,
"e": 112,
"s": 49,
"text": "Edit th... |
Rust - Quick Guide | Rust is a systems level programming language, developed by Graydon Hoare. Mozilla Labs later acquired the programme.
Application programming languages like Java/C# are used to build software, which provide services to the user directly. They help us build business applications like spreadsheets, word processors, web ap... | [
{
"code": null,
"e": 2204,
"s": 2087,
"text": "Rust is a systems level programming language, developed by Graydon Hoare. Mozilla Labs later acquired the programme."
},
{
"code": null,
"e": 2442,
"s": 2204,
"text": "Application programming languages like Java/C# are used to build ... |
How to increase the width of axes using ggplot2 in R? | To increase the width of axes (both X-axis and Y-axis at the same time) using ggplot2 in
R, we can use theme function with axis.line argument where we can set element_line
argument to a larger value.
Check out the Example given below to understand how it can be done.
Following snippet creates a sample data frame −
x<-s... | [
{
"code": null,
"e": 1262,
"s": 1062,
"text": "To increase the width of axes (both X-axis and Y-axis at the same time) using ggplot2 in\nR, we can use theme function with axis.line argument where we can set element_line\nargument to a larger value."
},
{
"code": null,
"e": 1330,
"s":... |
How to show current location on a google map on Android? | This example demonstrates how do I show current location on a google map on 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"?>
<f... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "This example demonstrates how do I show current location on a google map on Android."
},
{
"code": null,
"e": 1276,
"s": 1147,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required d... |
Lodash - parseInt method | _.parseInt(string, [radix=10])
Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used unless value is a hexadecimal, in which case a radix of 16 is used.
[string=''] (string) − The string to convert.
[string=''] (string) − The string to convert.
[radix=10] (number) − Th... | [
{
"code": null,
"e": 1859,
"s": 1827,
"text": "_.parseInt(string, [radix=10])\n"
},
{
"code": null,
"e": 2031,
"s": 1859,
"text": "Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used unless value is a hexadecimal, in which case ... |
C# | Check whether a Hashtable contains a specific key or not - GeeksforGeeks | 01 Feb, 2019
Hashtable.Contains(Object) Method is used to check whether the Hashtable contains a specific key or not.
Syntax:
public virtual bool Contains (object key);
Here, key is the Key of Object type which is to be located in the Hashtable.
Return Value: This method returns true if the Hashtable contains an elemen... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24407,
"s": 24302,
"text": "Hashtable.Contains(Object) Method is used to check whether the Hashtable contains a specific key or not."
},
{
"code": null,
"e": 24415,
"s": 24407... |
Machine Learning Project 17 — Compare Classification Algorithms | by Omair Aasim | Towards Data Science | In the past 7 projects, we implemented the same project using different classification algorithms namely — “Logistic Regression”, “KNN”, “SVM”, “Kernel SVM”, “Naive Bayes”, “Decision Tree” and “Random Forest”.
The reason I wrote a separate article for each is to understand the intuition behind each algorithm.
#100DaysO... | [
{
"code": null,
"e": 257,
"s": 47,
"text": "In the past 7 projects, we implemented the same project using different classification algorithms namely — “Logistic Regression”, “KNN”, “SVM”, “Kernel SVM”, “Naive Bayes”, “Decision Tree” and “Random Forest”."
},
{
"code": null,
"e": 358,
... |
How to save a matrix as CSV file using R? | To save a matrix as CSV file using R, we can use write.matrix function of MASS package.
For Example, if we have a matrix called M and we want to save it as CSV file then we can
use the below mentioned command −
write.matrix(M,file="Mat.csv")
Following snippet creates a sample matrix −
M<-matrix(rpois(80,10),ncol=4)
M
T... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "To save a matrix as CSV file using R, we can use write.matrix function of MASS package.\nFor Example, if we have a matrix called M and we want to save it as CSV file then we can\nuse the below mentioned command −"
},
{
"code": null,
"e": 130... |
11 Examples to Master Pandas Groupby Function | by Soner Yıldırım | Towards Data Science | Pandas Groupby function is a versatile and easy-to-use function that helps to get an overview of the data. It makes it easier to explore the dataset and unveil the underlying relationships among variables.
In this post, we will go through 11 different examples to have a comprehensive understanding of the groupby functi... | [
{
"code": null,
"e": 252,
"s": 46,
"text": "Pandas Groupby function is a versatile and easy-to-use function that helps to get an overview of the data. It makes it easier to explore the dataset and unveil the underlying relationships among variables."
},
{
"code": null,
"e": 421,
"s":... |
MATLAB - Logical Operations | MATLAB offers two types of logical operators and functions −
Element-wise − these operators operate on corresponding elements of logical arrays.
Element-wise − these operators operate on corresponding elements of logical arrays.
Short-circuit − these operators operate on scalar, logical expressions.
Short-circuit − the... | [
{
"code": null,
"e": 2202,
"s": 2141,
"text": "MATLAB offers two types of logical operators and functions −"
},
{
"code": null,
"e": 2286,
"s": 2202,
"text": "Element-wise − these operators operate on corresponding elements of logical arrays."
},
{
"code": null,
"e": ... |
dnssec-keygen command in Linux with Examples - GeeksforGeeks | 01 Sep, 2020
dnssec-keygen command is used to generate keys for DNSSEC (DNS Security Extensions). DNSSEC is an extension to the regular DNS (Domain Name System) technology but with added authentication for the DNS data. This authentication is carried out using public key cryptography technique and the above mentioned c... | [
{
"code": null,
"e": 24406,
"s": 24378,
"text": "\n01 Sep, 2020"
},
{
"code": null,
"e": 24758,
"s": 24406,
"text": "dnssec-keygen command is used to generate keys for DNSSEC (DNS Security Extensions). DNSSEC is an extension to the regular DNS (Domain Name System) technology but ... |
Seaborn - Pair Grid | PairGrid allows us to draw a grid of subplots using the same plot type to visualize data.
Unlike FacetGrid, it uses different pair of variable for each subplot. It forms a matrix of sub-plots. It is also sometimes called as “scatterplot matrix”.
The usage of pairgrid is similar to facetgrid. First initialise the grid a... | [
{
"code": null,
"e": 2129,
"s": 2039,
"text": "PairGrid allows us to draw a grid of subplots using the same plot type to visualize data."
},
{
"code": null,
"e": 2285,
"s": 2129,
"text": "Unlike FacetGrid, it uses different pair of variable for each subplot. It forms a matrix of ... |
Interactive Pivot Tables in Jupyter Notebook | by Satyam Kumar | Towards Data Science | Python has achieved popularity in a short span of time, still, it falls short to interact with data in some cases, that is where excel takes a lead. For the development of a model, the initial steps are data understanding and Exploratory data analysis (EDA).
For EDA you need the ability of flexibility to play around wi... | [
{
"code": null,
"e": 431,
"s": 172,
"text": "Python has achieved popularity in a short span of time, still, it falls short to interact with data in some cases, that is where excel takes a lead. For the development of a model, the initial steps are data understanding and Exploratory data analysis (ED... |
Line of Best Fit in Linear Regression | by Indhumathy Chelliah | Towards Data Science | Linear Regression is one of the most important algorithms in machine learning. It is the statistical way of measuring the relationship between one or more independent variables vs one dependent variable.
The Linear Regression model attempts to find the relationship between variables by finding the best fit line. Let’s ... | [
{
"code": null,
"e": 375,
"s": 171,
"text": "Linear Regression is one of the most important algorithms in machine learning. It is the statistical way of measuring the relationship between one or more independent variables vs one dependent variable."
},
{
"code": null,
"e": 606,
"s": ... |
Time Series Modeling of Bitcoin Prices | by Paul Tune | Towards Data Science | While the world was (and still is) in the grip of a pandemic in 2020, Bitcoin has had a stellar run. From its spectacular crash in 2018 and a relatively uneventful year in 2019, it started 2020 with a price of USD$8,000 to an all new record high of USD$50,000 as of the writing of this article. That’s roughly more than ... | [
{
"code": null,
"e": 436,
"s": 47,
"text": "While the world was (and still is) in the grip of a pandemic in 2020, Bitcoin has had a stellar run. From its spectacular crash in 2018 and a relatively uneventful year in 2019, it started 2020 with a price of USD$8,000 to an all new record high of USD$50,... |
degrees() and radians() in Python - GeeksforGeeks | 09 Apr, 2018
degress() and radians() are methods specified in math module in Python 3 and Python 2.
Often one is in need to handle mathematical computation of conversion of radians to degrees and vice-versa, especially in the field of geometry. Python offers inbuilt methods to handle this functionality. Both the functi... | [
{
"code": null,
"e": 23815,
"s": 23787,
"text": "\n09 Apr, 2018"
},
{
"code": null,
"e": 23902,
"s": 23815,
"text": "degress() and radians() are methods specified in math module in Python 3 and Python 2."
},
{
"code": null,
"e": 24157,
"s": 23902,
"text": "Oft... |
Move all zeros to start and ones to end in an Array of random integers in C++ | In this tutorial, we are going to write a program that moves all zeroes to front and ones to end of the array.
Given an array with zeroes and ones along with random integers. We have to move all the zeroes to start and ones to the end of the array. Let's see an example.
Input
arr = [4, 5, 1, 1, 0, 0, 2, 0, 3, 1, 0, 1]
... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "In this tutorial, we are going to write a program that moves all zeroes to front and ones to end of the array."
},
{
"code": null,
"e": 1333,
"s": 1173,
"text": "Given an array with zeroes and ones along with random integers. We have... |
How to get the fragment identifier from a URL ? - GeeksforGeeks | 19 Dec, 2019
A fragment identifier is a string of characters that refers to a resource that is inferior to a primary resource.
Approach 1: We are able to print the fragment identifier by defining a new variable as location.hash and then displaying it with the help of document.getElementbyId() method.Syntax:var x = loc... | [
{
"code": null,
"e": 25300,
"s": 25272,
"text": "\n19 Dec, 2019"
},
{
"code": null,
"e": 25414,
"s": 25300,
"text": "A fragment identifier is a string of characters that refers to a resource that is inferior to a primary resource."
},
{
"code": null,
"e": 26364,
"... |
How to use window.location to redirect to a different URL? | You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection.
It is quite simple to do a page redirect using JavaScript on the client side. To redirect your site visitors to a new page, you just need to add a line... | [
{
"code": null,
"e": 1231,
"s": 1062,
"text": "You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection."
},
{
"code": null,
"e": 1416,
"s": 1231,
"text": "It is quite s... |
What are the differences and similarities between tuples and lists in Python? | Both List and Tuple are called as sequence data types of Python. Objects of both types are comma separated collection of items not necessarily of same type.
Concatenation, repetition, indexing and slicing can be done on objects of both types
>>> #list operations
>>> L1=[1,2,3]
>>> L2=[4,5,6]
>>> #concatenation
>>> L3=L... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "Both List and Tuple are called as sequence data types of Python. Objects of both types are comma separated collection of items not necessarily of same type."
},
{
"code": null,
"e": 1304,
"s": 1219,
"text": "Concatenation, repetition... |
Find maximum of minimum for every window size in a given array - GeeksforGeeks | 22 Oct, 2021
Given an integer array of size n, find the maximum of the minimum’s of every window size in the array. Note that window size varies from 1 to n.Example:
Input: arr[] = {10, 20, 30, 50, 10, 70, 30} Output: 70, 30, 20, 10, 10, 10, 10The first element in the output indicates the maximum of minimums of all wi... | [
{
"code": null,
"e": 25046,
"s": 25018,
"text": "\n22 Oct, 2021"
},
{
"code": null,
"e": 25199,
"s": 25046,
"text": "Given an integer array of size n, find the maximum of the minimum’s of every window size in the array. Note that window size varies from 1 to n.Example:"
},
{
... |
Python - Synonyms and Antonyms | Synonyms and Antonyms are available as part of the wordnet which a lexical database for the English language. It is available as part of nltk corpora access. In wordnet Synonyms are the words that denote the same concept and are interchangeable in many contexts so that they are grouped into unordered sets (synsets). We... | [
{
"code": null,
"e": 2995,
"s": 2587,
"text": " Synonyms and Antonyms are available as part of the wordnet which a lexical database for the English language. It is available as part of nltk corpora access. In wordnet Synonyms are the words that denote the same concept and are interchangeable in many... |
Python Grayscaling of Images using OpenCV | In this tutorial, we are going to learn how to change the grayscaling of an image using Grayscaling is the process of changing the images from different colour spaces like RGB,CMYK, etc.., to shades of gray. Install the OpenCV module if you didn't install it before.
pip install opencv-python
After installing the OpenCV... | [
{
"code": null,
"e": 1329,
"s": 1062,
"text": "In this tutorial, we are going to learn how to change the grayscaling of an image using Grayscaling is the process of changing the images from different colour spaces like RGB,CMYK, etc.., to shades of gray. Install the OpenCV module if you didn't insta... |
C library function - exp() | The C library function double exp(double x) returns the value of e raised to the xth power.
Following is the declaration for exp() function.
double exp(double x)
x − This is the floating point value.
x − This is the floating point value.
This function returns the exponential value of x.
The following example shows the ... | [
{
"code": null,
"e": 2099,
"s": 2007,
"text": "The C library function double exp(double x) returns the value of e raised to the xth power."
},
{
"code": null,
"e": 2148,
"s": 2099,
"text": "Following is the declaration for exp() function."
},
{
"code": null,
"e": 2169... |
3D Maths - DirectX Math | The initialization process of Direct3D requires some specific Direct3D types and basic graphics concepts. This chapter addresses these requirements.
Direct3D includes a design of low-level graphics API (Application Programming Interface) that enables us to render 3D worlds using 3D hardware acceleration. The most impor... | [
{
"code": null,
"e": 2447,
"s": 2298,
"text": "The initialization process of Direct3D requires some specific Direct3D types and basic graphics concepts. This chapter addresses these requirements."
},
{
"code": null,
"e": 2818,
"s": 2447,
"text": "Direct3D includes a design of low... |
How to add “graphics.h” C/C++ library to gcc compiler in Linux | In this tutorial, we will be discussing a program to understand how to add “graphics.h” C/C++ library to gcc compiler in Linux.
To do this we are required to compile and install the libgraph package.
This includes install build-essential and some external packages
>>sudo apt-get install build-essential
>>sudo apt-get ... | [
{
"code": null,
"e": 1190,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to understand how to add “graphics.h” C/C++ library to gcc compiler in Linux."
},
{
"code": null,
"e": 1262,
"s": 1190,
"text": "To do this we are required to compile and install the ... |
Python 3 - os.readlink() Method | The method readlink() returns a string representing the path to which the symbolic link points. It may return an absolute or relative pathname.
Following is the syntax for readlink() method −
os.readlink(path)
path − This is the path or symblic link for which we are going to find source of the link.
This method return ... | [
{
"code": null,
"e": 2484,
"s": 2340,
"text": "The method readlink() returns a string representing the path to which the symbolic link points. It may return an absolute or relative pathname."
},
{
"code": null,
"e": 2532,
"s": 2484,
"text": "Following is the syntax for readlink()... |
How to decrement a value in MySQL keeping it above zero? | You can decrement value in MySQL with update command. With this, you can also restrict the value to not reach below 0.
The syntax is as follows −
update yourTableName set yourColumnName = yourColumnName - 1 where yourColumnName > 0;
To avoid the value to go below zero, you can use yourColumnName > 0.
To understand the ... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "You can decrement value in MySQL with update command. With this, you can also restrict the value to not reach below 0."
},
{
"code": null,
"e": 1208,
"s": 1181,
"text": "The syntax is as follows −"
},
{
"code": null,
"e":... |
How to get specific nodes in xml file in Python? | Using the xml library you can get any node you want from the xml file. But for extracting a given node, you'd need to know how to use xpath to get it. You can learn more about XPath here:https://www.w3schools.com/xml/xml_xpath.asp.
For example, assume you have a xml file with following structure,
<bookstore>
<book... | [
{
"code": null,
"e": 1295,
"s": 1062,
"text": "Using the xml library you can get any node you want from the xml file. But for extracting a given node, you'd need to know how to use xpath to get it. You can learn more about XPath here:https://www.w3schools.com/xml/xml_xpath.asp. "
},
{
"code"... |
Java & MySQL - Streaming Data | A PreparedStatement object has the ability to use input and output streams to supply parameter data. This enables you to place entire files into database columns that can
hold large values, such as CLOB and BLOB data types.
There are following methods, which can be used to stream data −
setAsciiStream() − This method... | [
{
"code": null,
"e": 2910,
"s": 2686,
"text": "A PreparedStatement object has the ability to use input and output streams to supply parameter data. This enables you to place entire files into database columns that can\nhold large values, such as CLOB and BLOB data types."
},
{
"code": null,
... |
Reverse array in groups | Practice | GeeksforGeeks | Given an array arr[] of positive integers of size N. Reverse every sub-array group of size K.
Example 1:
Input:
N = 5, K = 3
arr[] = {1,2,3,4,5}
Output: 3 2 1 5 4
Explanation: First group consists of elements
1, 2, 3. Second group consists of 4,5.
Example 2:
Input:
N = 4, K = 3
arr[] = {5,6,8,9}
Output: 8 6 5 9
... | [
{
"code": null,
"e": 332,
"s": 238,
"text": "Given an array arr[] of positive integers of size N. Reverse every sub-array group of size K."
},
{
"code": null,
"e": 345,
"s": 334,
"text": "Example 1:"
},
{
"code": null,
"e": 488,
"s": 345,
"text": "Input:\nN = ... |
Integration of Hadoop and R Programming Language | 28 Dec, 2021
Hadoop is an open-source framework that was introduced by the ASF — Apache Software Foundation. Hadoop is the most crucial framework for copying with Big Data. Hadoop has been written in Java, and it is not based on OLAP (Online Analytical Processing). The best part of this big data framework is that it is... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Dec, 2021"
},
{
"code": null,
"e": 728,
"s": 28,
"text": "Hadoop is an open-source framework that was introduced by the ASF — Apache Software Foundation. Hadoop is the most crucial framework for copying with Big Data. Hadoop has been... |
Python | Split given dictionary in half | 26 Jul, 2019
While working with dictionaries, sometimes we might have a problem in which we need to reduce the space taken by single container and wish to divide the dictionary into 2 halves. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using items() + len() + list slicingThe combination ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jul, 2019"
},
{
"code": null,
"e": 271,
"s": 28,
"text": "While working with dictionaries, sometimes we might have a problem in which we need to reduce the space taken by single container and wish to divide the dictionary into 2 halv... |
PHP vs. Node.js | 06 Jan, 2022
PHP and Node.js are both used for server side development and thus have become a competitor for each other. Below are some differences based on different parameters to understand the two and make decisions between the two giants.
Both platforms have access to the command line interface via:
Example: Prin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jan, 2022"
},
{
"code": null,
"e": 285,
"s": 54,
"text": "PHP and Node.js are both used for server side development and thus have become a competitor for each other. Below are some differences based on different parameters to unders... |
SQL Query to find the Nth Largest Value in a Column using Limit and Offset - GeeksforGeeks | 30 Jun, 2021
Prerequisite – How to find Nth highest salary from a table Problem Statement : Write an SQL query to find the nth largest value from the column using LIMIT and OFFSET.
Example-1 :
Table – BILLS
The above table has the electricity bills of all the flats in an apartment. You have to find the nth largest... | [
{
"code": null,
"e": 24509,
"s": 24481,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 24678,
"s": 24509,
"text": "Prerequisite – How to find Nth highest salary from a table Problem Statement : Write an SQL query to find the nth largest value from the column using LIMIT and OFF... |
Apache POI PPT - Slide Management | After completing this chapter, you will be able to delete, reorder, and perform read and write operations on a slide.
We can change the page size of a slide using the setPageSize() method of the XMLSlideShow class.
Initially create a presentation as shown below −
File file = new File("C://POIPPT//Examples// TitleAndCon... | [
{
"code": null,
"e": 2135,
"s": 2017,
"text": "After completing this chapter, you will be able to delete, reorder, and perform read and write operations on a slide."
},
{
"code": null,
"e": 2232,
"s": 2135,
"text": "We can change the page size of a slide using the setPageSize() m... |
Union of two Objects in R Programming - union() Function - GeeksforGeeks | 19 May, 2020
union() function in R Language is used to combine the data of two objects. This function takes two objects like Vectors, dataframes, etc. as arguments and results in a third object with the combination of the data of both the objects.
Syntax: union(x, y)
Parameters:x and y: Objects with sequence of items
E... | [
{
"code": null,
"e": 25400,
"s": 25372,
"text": "\n19 May, 2020"
},
{
"code": null,
"e": 25635,
"s": 25400,
"text": "union() function in R Language is used to combine the data of two objects. This function takes two objects like Vectors, dataframes, etc. as arguments and results ... |
What is the difference between int and Int32 in C#? | Int32 is a type provided by .NET framework whereas int is an alias for Int32 in C# language.
Int32 x = 5;
Int32 x = 5;
int x = 5;
int x = 5;
So, in use both the above statements will hold a 32bit integer. They compile to the same code, so at execution time there is no difference whatsoever.
The only minor difference is... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "Int32 is a type provided by .NET framework whereas int is an alias for Int32 in C# language."
},
{
"code": null,
"e": 1168,
"s": 1155,
"text": "Int32 x = 5;"
},
{
"code": null,
"e": 1181,
"s": 1168,
"text": "Int32... |
Betweenness Centrality (Centrality Measure) - GeeksforGeeks | 10 Feb, 2018
In graph theory, betweenness centrality is a measure of centrality in a graph based on shortest paths. For every pair of vertices in a connected graph, there exists at least one shortest path between the vertices such that either the number of edges that the path passes through (for unweighted graphs) or t... | [
{
"code": null,
"e": 31467,
"s": 31439,
"text": "\n10 Feb, 2018"
},
{
"code": null,
"e": 31956,
"s": 31467,
"text": "In graph theory, betweenness centrality is a measure of centrality in a graph based on shortest paths. For every pair of vertices in a connected graph, there exist... |
Program to find Nth term in the series 0, 2, 1, 3, 1, 5, 2, 7, 3,... - GeeksforGeeks | 15 Mar, 2021
Given a number N. The task is to write a program to find the N-th term in the below series:
0, 2, 1, 3, 1, 5, 2, 7, 3, ...
Examples:
Input: N = 5
Output: 1
Input: N = 10
Output: 11
When we look carefully at the series, we find that the series is a mixture of 2 series:
Terms at odd positions in t... | [
{
"code": null,
"e": 26583,
"s": 26555,
"text": "\n15 Mar, 2021"
},
{
"code": null,
"e": 26677,
"s": 26583,
"text": "Given a number N. The task is to write a program to find the N-th term in the below series: "
},
{
"code": null,
"e": 26710,
"s": 26677,
"text... |
Find the index of an array element in Java - GeeksforGeeks | 27 Oct, 2021
Given an array of N elements and an element K, find the index of an array element in Java. Examples:
Input: a[] = { 5, 4, 6, 1, 3, 2, 7, 8, 9 }, K = 5
Output: 0
Input: a[] = { 5, 4, 6, 1, 3, 2, 7, 8, 9 }, K = 7
Output: 6
An element in an array of N integers can be searched using the below-mentioned metho... | [
{
"code": null,
"e": 26338,
"s": 26310,
"text": "\n27 Oct, 2021"
},
{
"code": null,
"e": 26440,
"s": 26338,
"text": "Given an array of N elements and an element K, find the index of an array element in Java. Examples: "
},
{
"code": null,
"e": 26561,
"s": 26440,
... |
Data Structures | Tree Traversals | Question 11 - GeeksforGeeks | 28 Jun, 2021
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respectively, of a complete binary tree. Which of the following is always true? (GATE CS 2000)(A) LASTIN = LASTPOST(B) LASTIN = LASTPRE(C) LASTPRE = LASTPOST(D) None of the aboveAnswer: (D)Explan... | [
{
"code": null,
"e": 26275,
"s": 26247,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 26811,
"s": 26275,
"text": "Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal. Respectively, of a complete binary tree. Which of t... |
Is it possible to prevent users from taking screenshots of webpage ? - GeeksforGeeks | 21 Nov, 2021
The screenshot is a feature of OS in windows. We can simply press the print screen ( print screen ) on the keyboard to take screenshots. If the keyboard doesn’t have prt sc key, we can use Fn + Windows logo key + Space Bar. Also, we can use Snip & Sketch or Snipping tool by pressing the Windows logo key + ... | [
{
"code": null,
"e": 26621,
"s": 26593,
"text": "\n21 Nov, 2021"
},
{
"code": null,
"e": 26977,
"s": 26621,
"text": "The screenshot is a feature of OS in windows. We can simply press the print screen ( print screen ) on the keyboard to take screenshots. If the keyboard doesn’t ha... |
Tensorflow.js Introduction - GeeksforGeeks | 15 Aug, 2021What is Tensorflow.js?TensorFlow.js is a JavaScript library for training and deploying machine learning models on web applications and in Node.js. You can develop the machine learning models from scratch using tensorflow.js or can use the APIs provided to train your existing models in the browser or on your... | [
{
"code": null,
"e": 41879,
"s": 23503,
"text": "\n15 Aug, 2021What is Tensorflow.js?TensorFlow.js is a JavaScript library for training and deploying machine learning models on web applications and in Node.js. You can develop the machine learning models from scratch using tensorflow.js or can use th... |
Python Regex to extract maximum numeric value from a string - GeeksforGeeks | 29 Dec, 2020
Given an alphanumeric string, extract maximum numeric value from that string. Alphabets will only be in lower case.
Examples:
Input : 100klh564abc365bg
Output : 564
Maximum numeric value among 100, 564
and 365 is 564.
Input : abchsd0sdhs
Output : 0
This problem has existing solution please refer Extract... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 25677,
"s": 25561,
"text": "Given an alphanumeric string, extract maximum numeric value from that string. Alphabets will only be in lower case."
},
{
"code": null,
"e": 25687,
... |
Grouping Rows in pandas - GeeksforGeeks | 14 Jan, 2019
Pandas is the most popular Python library that is used for data analysis. It provides highly optimized performance with back-end source code is purely written in C or Python.
Let’s see how to group rows in Pandas Dataframe with help of multiple examples.
Example 1:
For grouping rows in Pandas, we will star... | [
{
"code": null,
"e": 25562,
"s": 25534,
"text": "\n14 Jan, 2019"
},
{
"code": null,
"e": 25737,
"s": 25562,
"text": "Pandas is the most popular Python library that is used for data analysis. It provides highly optimized performance with back-end source code is purely written in C... |
Program to build a DFA to accept strings that start and end with same character - GeeksforGeeks | 21 May, 2021
Given a string consisting of characters a and b, check if the string starts and ends with the same character or not. If it does, print ‘Yes’ else print ‘No’.Examples:
Input: str = “abbaaba” Output: Yes Explanation: The given input string starts and ends with same character ‘a’ So the states of the below ... | [
{
"code": null,
"e": 26313,
"s": 26285,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 26482,
"s": 26313,
"text": "Given a string consisting of characters a and b, check if the string starts and ends with the same character or not. If it does, print ‘Yes’ else print ‘No’.Exampl... |
Python | Sort a Dictionary - GeeksforGeeks | 29 Aug, 2020
Python, Given a dictionary, perform sort, basis on keys or values. [ applicable Python >=3.6v ].
Input : test_dict = {“Gfg” : 5, “is” : 7, “Best” : 2}Output : {‘Best’: 2, ‘Gfg’: 5, ‘is’: 7}, {‘is’: 7, ‘Gfg’: 5, ‘Best’: 2}Explanation : Sorted by keys, in ascending and reverse order.
Input : test_dict = {“Be... | [
{
"code": null,
"e": 26143,
"s": 26115,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 26240,
"s": 26143,
"text": "Python, Given a dictionary, perform sort, basis on keys or values. [ applicable Python >=3.6v ]."
},
{
"code": null,
"e": 26426,
"s": 26240,
"t... |
LocalTime now() method in Java with Examples - GeeksforGeeks | 12 May, 2020
The now() method of the LocalTime class in Java is used to get the current time from the system clock in the default time-zone.
Syntax:
public static LocalTime now()
Parameters: This method does not accept any parameter.
Return value: This method returns the current time using the system clock and default ... | [
{
"code": null,
"e": 25505,
"s": 25477,
"text": "\n12 May, 2020"
},
{
"code": null,
"e": 25633,
"s": 25505,
"text": "The now() method of the LocalTime class in Java is used to get the current time from the system clock in the default time-zone."
},
{
"code": null,
"e"... |
Matrix Multiplication | Recursive - GeeksforGeeks | 27 Apr, 2021
Given two matrices A and B. The task is to multiply matrix A and matrix B recursively. If matrix A and matrix B are not multiplicative compatible, then generate output “Not Possible”.Examples :
Input: A = 12 56
45 78
B = 2 6
5 8
Output: 304 520
480 894
Input: A = 1 2... | [
{
"code": null,
"e": 26553,
"s": 26525,
"text": "\n27 Apr, 2021"
},
{
"code": null,
"e": 26749,
"s": 26553,
"text": "Given two matrices A and B. The task is to multiply matrix A and matrix B recursively. If matrix A and matrix B are not multiplicative compatible, then generate ou... |
Program to check if an array is palindrome or not using Recursion - GeeksforGeeks | 01 Apr, 2021
Given an array. The task is to determine whether an array is a palindrome or not using recursion.Examples:
Input: arr[] = {3, 6, 0, 6, 3}
Output: Palindrome
Input: arr[] = {1, 2, 3, 4, 5}
Output: Not Palindrome
Approach:
Base case: If array has only one element i.e. begin == end then return 1, also ... | [
{
"code": null,
"e": 26294,
"s": 26266,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 26403,
"s": 26294,
"text": "Given an array. The task is to determine whether an array is a palindrome or not using recursion.Examples: "
},
{
"code": null,
"e": 26508,
"s": 2... |
How to concatenate two integer arrays without using loop in C ? - GeeksforGeeks | 02 Jun, 2017
Given two arrays such that first array has enough extra space to accommodate elements of second array. How to concatenate second array to first in C without using any loop in program?
Example:
Input: arr1[5] = {1, 2, 3}
arr2[] = {4, 5}
Output: arr1[] = {1, 2, 3, 4, 5}
We strongly recommend you to ... | [
{
"code": null,
"e": 25477,
"s": 25449,
"text": "\n02 Jun, 2017"
},
{
"code": null,
"e": 25661,
"s": 25477,
"text": "Given two arrays such that first array has enough extra space to accommodate elements of second array. How to concatenate second array to first in C without using ... |
Skewness of statistical data - GeeksforGeeks | 25 May, 2021
Given data in an array. Find skewness of the data distribution.Skewness is a measure of the asymmetry of data distribution. Skewness is an asymmetry in a statistical distribution, in which the curve appears distorted or skewed either to the left or to the right. Skewness can be quantified to define the ext... | [
{
"code": null,
"e": 26066,
"s": 26038,
"text": "\n25 May, 2021"
},
{
"code": null,
"e": 26469,
"s": 26066,
"text": "Given data in an array. Find skewness of the data distribution.Skewness is a measure of the asymmetry of data distribution. Skewness is an asymmetry in a statistic... |
How to use the mouse to scale and rotate an image in PyGame ? - GeeksforGeeks | 28 Apr, 2021
In this article, we will discuss how to transform the image i.e (scaling and rotating images) using the mouse in Pygame.
Step 1: First, import the libraries Pygame and math.
import pygame
import math
from pygame.locals import *
Step 2: Now, take the colors as input that we want to use in the game.
color_1 ... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n28 Apr, 2021"
},
{
"code": null,
"e": 25658,
"s": 25537,
"text": "In this article, we will discuss how to transform the image i.e (scaling and rotating images) using the mouse in Pygame."
},
{
"code": null,
"e": 25711... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.