title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
C | Dynamic Memory Allocation | Question 8 - GeeksforGeeks | 08 Aug, 2018
Consider the following program, where are i, j and k are stored in memory?
int i;int main(){ int j; int *k = (int *) malloc (sizeof(int));}
(A) i, j and *k are stored in stack segment(B) i and j are stored in stack segment. *k is stored on heap.(C) i is stored in BSS part of data segment, j is stored... | [
{
"code": null,
"e": 24564,
"s": 24536,
"text": "\n08 Aug, 2018"
},
{
"code": null,
"e": 24639,
"s": 24564,
"text": "Consider the following program, where are i, j and k are stored in memory?"
},
{
"code": "int i;int main(){ int j; int *k = (int *) malloc (sizeof(in... |
Can we use “LIKE concat()” in a MySQL query? | Yes, we can do that. Let us first create a table −
mysql> create table DemoTable
(
Name varchar(50)
);
Query OK, 0 rows affected (0.63 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('John');
Query OK, 1 row affected (0.14 sec)
mysql> insert into DemoTable values('Ada... | [
{
"code": null,
"e": 1113,
"s": 1062,
"text": "Yes, we can do that. Let us first create a table −"
},
{
"code": null,
"e": 1205,
"s": 1113,
"text": "mysql> create table DemoTable\n(\n Name varchar(50)\n);\nQuery OK, 0 rows affected (0.63 sec)"
},
{
"code": null,
"e"... |
How to move an element of an array to a specific position (swap)? | To move an element from one position to other (swap) you need to –
Create a temp variable and assign the value of the original position to it.
Now, assign the value in the new position to original position.
Finally, assign the value in the temp to the new position.
Live Demo
import java.util.Arrays;
public class Changi... | [
{
"code": null,
"e": 1129,
"s": 1062,
"text": "To move an element from one position to other (swap) you need to –"
},
{
"code": null,
"e": 1205,
"s": 1129,
"text": "Create a temp variable and assign the value of the original position to it."
},
{
"code": null,
"e": 12... |
Plot Multiple Graphics in the Same Figure Using Python | by Gustavo Santos | Towards Data Science | If you work with Jupyter Notebooks, you know that the right side of it becomes really low populated when it comes to graphics. That happens because you usually create one graphic by cell and it does not take more than half of your screen.
However, sometimes it is necessary to plot two graphics side-by-side, not only fo... | [
{
"code": null,
"e": 405,
"s": 166,
"text": "If you work with Jupyter Notebooks, you know that the right side of it becomes really low populated when it comes to graphics. That happens because you usually create one graphic by cell and it does not take more than half of your screen."
},
{
"c... |
Apache Cassandra (NOSQL database) - GeeksforGeeks | 21 Apr, 2022
In this article, we will learn the basics of Apache Cassandra and the basics of CQL (Cassandra Query Language) operations like Create, insert, delete, select, etc.
Apache Cassandra: Apache Cassandra is an open-source no SQL database that is used for handling big data. Apache Cassandra has the capability t... | [
{
"code": null,
"e": 24024,
"s": 23996,
"text": "\n21 Apr, 2022"
},
{
"code": null,
"e": 24189,
"s": 24024,
"text": "In this article, we will learn the basics of Apache Cassandra and the basics of CQL (Cassandra Query Language) operations like Create, insert, delete, select, etc.... |
Remove Vowels from a String in Python | Suppose we have a string, we have to remove all vowels from that string. So if the string is like “iloveprogramming”, then after removing vowels, the result will be − "lvprgrmmng"
To solve this, we will follow these steps −
create one array vowel, that is holding [a,e,i,o,u]
for v in a vowelreplace v using blank string... | [
{
"code": null,
"e": 1242,
"s": 1062,
"text": "Suppose we have a string, we have to remove all vowels from that string. So if the string is like “iloveprogramming”, then after removing vowels, the result will be − \"lvprgrmmng\""
},
{
"code": null,
"e": 1286,
"s": 1242,
"text": "... |
Solidity - First Application | We're using Remix IDE to Compile and Run our Solidity Code base.
Step 1 − Copy the given code in Remix IDE Code Section.
pragma solidity ^0.5.0;
contract SolidityTest {
constructor() public{
}
function getResult() public view returns(uint){
uint a = 1;
uint b = 2;
uint result = a + b;
r... | [
{
"code": null,
"e": 2620,
"s": 2555,
"text": "We're using Remix IDE to Compile and Run our Solidity Code base."
},
{
"code": null,
"e": 2676,
"s": 2620,
"text": "Step 1 − Copy the given code in Remix IDE Code Section."
},
{
"code": null,
"e": 2896,
"s": 2676,
... |
How do I format a string using a dictionary in Python 3? | You can use dictionaries to interpolate strings. They have a syntax in which you need to provide the key in the parentheses between the % and the conversion character. For example, if you have a float stored in a key 'cost' and want to format it as '$xxxx.xx', then you'll place '$%(cost).2f' at the place you want to di... | [
{
"code": null,
"e": 1392,
"s": 1062,
"text": "You can use dictionaries to interpolate strings. They have a syntax in which you need to provide the key in the parentheses between the % and the conversion character. For example, if you have a float stored in a key 'cost' and want to format it as '$xx... |
How to check the PowerShell version installed in local and remote systems? | To check the PowerShell version installed in your system, you can use either $PSVersionTable or $host command.
Check if $host command available in remote servers.
Check if $host command available in remote servers.
Open the PowerShell console in the system and run the command $PSVersionTable.
$PSVersionTable
PS C:\WIND... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "To check the PowerShell version installed in your system, you can use either $PSVersionTable or $host command."
},
{
"code": null,
"e": 1225,
"s": 1173,
"text": "Check if $host command available in remote servers."
},
{
"code... |
Emulating a 2-d array using 1-d array - GeeksforGeeks | 25 Jun, 2021
How to convert a 2-d array of size (m x n) into 1-d array and how to store the element at position [i, j] of 2-d array in 1-d array? Clearly, the size of 1-d array is the number of elements in 2-d array i.e. (m x n). If the elements in the 2-d array are stored in row-major order. Then, the element at index... | [
{
"code": null,
"e": 24429,
"s": 24401,
"text": "\n25 Jun, 2021"
},
{
"code": null,
"e": 24801,
"s": 24429,
"text": "How to convert a 2-d array of size (m x n) into 1-d array and how to store the element at position [i, j] of 2-d array in 1-d array? Clearly, the size of 1-d array... |
Algorithms From Scratch: Support Vector Machines | by Kurtis Pykes | Towards Data Science | A popular algorithm that is capable of performing linear or non-linear classification and regression, Support Vector Machines were the talk of the town before the rise of deep learning due to the exciting kernel trick — If the terminology makes no sense to you right now don’t worry about it. By the end of this post you... | [
{
"code": null,
"e": 636,
"s": 171,
"text": "A popular algorithm that is capable of performing linear or non-linear classification and regression, Support Vector Machines were the talk of the town before the rise of deep learning due to the exciting kernel trick — If the terminology makes no sense t... |
Program to copy the contents of one array into another in the reverse order - GeeksforGeeks | 21 May, 2021
Given an array, the task is to copy these array elements into another array in reverse array.Examples:
Input: array: 1 2 3 4 5
Output: 5 4 3 2 1
Input: array: 10 20 30 40 50
Output: 50 40 30 20 10
Let len be the length of original array. We copy every element original_arr[i] to copy_arr[n-i-1] to ge... | [
{
"code": null,
"e": 24153,
"s": 24125,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 24257,
"s": 24153,
"text": "Given an array, the task is to copy these array elements into another array in reverse array.Examples: "
},
{
"code": null,
"e": 24357,
"s": 24257,... |
Python | Check order of character in string using OrderedDict( ) - GeeksforGeeks | 23 Nov, 2020
Given an input string and a pattern, check if characters in the input string follows the same order as determined by characters present in the pattern. Assume there won’t be any duplicate characters in the pattern.
Examples:
Input:
string = "engineers rock"
pattern = "er";
Output: true
Explanation:
All '... | [
{
"code": null,
"e": 25076,
"s": 25048,
"text": "\n23 Nov, 2020"
},
{
"code": null,
"e": 25291,
"s": 25076,
"text": "Given an input string and a pattern, check if characters in the input string follows the same order as determined by characters present in the pattern. Assume ther... |
Implementing Shamir's Secret Sharing Scheme in Python - GeeksforGeeks | 12 Mar, 2021
Secret Sharing schemes are used in the distribution of a secret value among multiple participants (shareholders) by dividing the secret into fragments (shares). This is done in a manner that prevents a single shareholder from having any useful knowledge of the original secret at all. The only way to retrie... | [
{
"code": null,
"e": 25815,
"s": 25787,
"text": "\n12 Mar, 2021"
},
{
"code": null,
"e": 26476,
"s": 25815,
"text": "Secret Sharing schemes are used in the distribution of a secret value among multiple participants (shareholders) by dividing the secret into fragments (shares). Th... |
Merge K sorted arrays of different sizes | ( Divide and Conquer Approach ) - GeeksforGeeks | 10 Nov, 2021
Given k sorted arrays of different length, merge them into a single array such that the merged array is also sorted.Examples:
Input : {{3, 13},
{8, 10, 11}
{9, 15}}
Output : {3, 8, 9, 10, 11, 13, 15}
Input : {{1, 5},
{2, 3, 4}}
Output : {1, 2, 3, 4, 5}
Let S be the total num... | [
{
"code": null,
"e": 25941,
"s": 25913,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 26069,
"s": 25941,
"text": "Given k sorted arrays of different length, merge them into a single array such that the merged array is also sorted.Examples: "
},
{
"code": null,
"e"... |
BigInteger isProbablePrime() Method in Java with Examples - GeeksforGeeks | 03 Apr, 2019
The java.math.BigInteger.isProbablePrime(int certainty) method is used to tell if this BigInteger is probably prime or if it’s definitely composite. This method checks for prime or composite upon the current BigInteger by which this method is called and returns a boolean value. It returns true if this BigI... | [
{
"code": null,
"e": 25690,
"s": 25662,
"text": "\n03 Apr, 2019"
},
{
"code": null,
"e": 26099,
"s": 25690,
"text": "The java.math.BigInteger.isProbablePrime(int certainty) method is used to tell if this BigInteger is probably prime or if it’s definitely composite. This method ch... |
Response Methods - Python requests - GeeksforGeeks | 23 Jul, 2021
When one makes a request to a URI, it returns a response. This Response object in terms of python is returned by requests.method(), method being – get, post, put, etc. Response is a powerful object with lots of functions and attributes that assist in normalizing data or creating ideal portions of code. For... | [
{
"code": null,
"e": 25689,
"s": 25661,
"text": "\n23 Jul, 2021"
},
{
"code": null,
"e": 26241,
"s": 25689,
"text": "When one makes a request to a URI, it returns a response. This Response object in terms of python is returned by requests.method(), method being – get, post, put, ... |
Node.js Buffer.toJSON() Method - GeeksforGeeks | 13 Oct, 2021
Buffer is a temporary memory storage which stores the data when it is being moved from one place to another. It is like the array of integers.
The Buffer.toJSON() method returns the buffer in JSON format.
Note: The JSON.Stringify() is the method which can also be used to return the data in JSON format. Whe... | [
{
"code": null,
"e": 26253,
"s": 26225,
"text": "\n13 Oct, 2021"
},
{
"code": null,
"e": 26396,
"s": 26253,
"text": "Buffer is a temporary memory storage which stores the data when it is being moved from one place to another. It is like the array of integers."
},
{
"code"... |
How to create a dynamic 2D array inside a class in C++ ? - GeeksforGeeks | 29 May, 2017
Suppose we want to create a class for Graph. The class stores adjacency matrix representation of the graph. Therefore, our class structure would be something like below.
class Graph { int V; int adj[V][V]; // This line doesn't work /* Rest of the members */}; int main(){}
Output :
error: invalid ... | [
{
"code": null,
"e": 25739,
"s": 25711,
"text": "\n29 May, 2017"
},
{
"code": null,
"e": 25909,
"s": 25739,
"text": "Suppose we want to create a class for Graph. The class stores adjacency matrix representation of the graph. Therefore, our class structure would be something like ... |
Build a Simple Beginner App with Node.js Bootstrap and MongoDB - GeeksforGeeks | 27 Sep, 2021
Node.js is one of the famous open-source environments that allows to you run javascript scripts outside the browser. MERN and MEAN stacks are the two most popular combination that helps you to create an amazing application. In this article, we will be creating a simple beginner-friendly Contact Form App wi... | [
{
"code": null,
"e": 26385,
"s": 26357,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 26829,
"s": 26385,
"text": "Node.js is one of the famous open-source environments that allows to you run javascript scripts outside the browser. MERN and MEAN stacks are the two most popular ... |
bits Package in Golang - GeeksforGeeks | 08 Jun, 2020
Go language provides inbuilt support for bit counting and manipulation functions for the predeclared unsigned integer types with the help of the bits package.
Example 1:
// Golang program to illustrate bits.Sub() Functionpackage main import ( "fmt" "math/bits") // Main functionfunc main() { //... | [
{
"code": null,
"e": 25703,
"s": 25675,
"text": "\n08 Jun, 2020"
},
{
"code": null,
"e": 25862,
"s": 25703,
"text": "Go language provides inbuilt support for bit counting and manipulation functions for the predeclared unsigned integer types with the help of the bits package."
}... |
How to position legends inside a plot in Plotly-Python? - GeeksforGeeks | 28 Nov, 2021
In this article, we will learn How to hide legend with Plotly Express and Plotly. A legend is an area describing the elements of the graph. In the plotly legend is used to Place a legend on the axes.
Example 1:
In this example, we are positioning legends inside a plot with the help of method fig.update_lay... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 25737,
"s": 25537,
"text": "In this article, we will learn How to hide legend with Plotly Express and Plotly. A legend is an area describing the elements of the graph. In the plotly legend is... |
How to Browse From the Linux Terminal Using W3M? - GeeksforGeeks | 17 Sep, 2019
W3M is an open-source text-based terminal web browser for Linux used to browse through the terminal. It is simple to use and do not require any additional interacting interface application though it interacts through the terminal. It renders the web pages in a form as their original layout.
How to Install ... | [
{
"code": null,
"e": 25475,
"s": 25447,
"text": "\n17 Sep, 2019"
},
{
"code": null,
"e": 25767,
"s": 25475,
"text": "W3M is an open-source text-based terminal web browser for Linux used to browse through the terminal. It is simple to use and do not require any additional interact... |
classmethod() in Python - GeeksforGeeks | 13 Sep, 2021
The classmethod() is an inbuilt function in Python, which returns a class method for a given function.;
Syntax: classmethod(function)
Parameter :This function accepts the function name as a parameter.
Return Type:This function returns the converted class method.
You can also use @classmethod decorator for ... | [
{
"code": null,
"e": 25361,
"s": 25333,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 25465,
"s": 25361,
"text": "The classmethod() is an inbuilt function in Python, which returns a class method for a given function.;"
},
{
"code": null,
"e": 25495,
"s": 25465,... |
Swiggy Interview Experience | Set 2 (On-Campus) - GeeksforGeeks | 30 May, 2018
First Round (Online Coding on HackerRank)4 problemsTime -90 min
1. Stock Buy Sell to Maximize Profit
Input: 1 3 100
Output: 196
link- https://www.hackerrank.com/challenges/stockmax
2. Given A string you need to print all subset of that string
Input: "abc"
Output:
"a"
"b"
"c"
"ab"
... | [
{
"code": null,
"e": 26325,
"s": 26297,
"text": "\n30 May, 2018"
},
{
"code": null,
"e": 26389,
"s": 26325,
"text": "First Round (Online Coding on HackerRank)4 problemsTime -90 min"
},
{
"code": null,
"e": 26426,
"s": 26389,
"text": "1. Stock Buy Sell to Maxim... |
NumberFormat setMaximumFractionDigits() method in Java with Examples - GeeksforGeeks | 01 Apr, 2019
The setMaximumFractionDigits() method is a built-in method of the java.text.NumberFormat which sets the maximum number of digits allowed in the fraction portion of a number.If the new value for maximumFractionDigits is less than the current value of minimumFractionDigits, then minimumFractionDigits will al... | [
{
"code": null,
"e": 25653,
"s": 25625,
"text": "\n01 Apr, 2019"
},
{
"code": null,
"e": 25988,
"s": 25653,
"text": "The setMaximumFractionDigits() method is a built-in method of the java.text.NumberFormat which sets the maximum number of digits allowed in the fraction portion of... |
Python - Double Split String to Matrix - GeeksforGeeks | 01 Oct, 2020
Given a String, perform the double split, 1st for rows, and next for individual elements so that the given string can be converted to a matrix.
Examples:
Input : test_str = ‘Gfg,best*for,all*geeks,and,CS’, row_splt = “*”, ele_splt = “,” Output : [[‘Gfg’, ‘best’], [‘for’, ‘all’], [‘geeks’, ‘and’, ‘CS’]] Exp... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 25681,
"s": 25537,
"text": "Given a String, perform the double split, 1st for rows, and next for individual elements so that the given string can be converted to a matrix."
},
{
"code... |
Collections swap() method in Java with Examples - GeeksforGeeks | 11 May, 2021
The swap() method of java.util.Collections class is used to swap the elements at the specified positions in the specified list. If the specified positions are equal, invoking this method leaves the list unchanged.
Syntax:
public static void swap(List list, int i, int j)
Parameters: This method takes the f... | [
{
"code": null,
"e": 25549,
"s": 25521,
"text": "\n11 May, 2021"
},
{
"code": null,
"e": 25763,
"s": 25549,
"text": "The swap() method of java.util.Collections class is used to swap the elements at the specified positions in the specified list. If the specified positions are equa... |
How to display title in Bootstrap-Select without empty element ? - GeeksforGeeks | 09 Apr, 2021
In this article, we will cover how to display the title in the Bootstrap-Select without any empty element in the select dropdown menu. Bootstrap Select is a form control that displays a collapsable list of different values that can be selected. This can be used for displaying forms or menus to the user.
Ex... | [
{
"code": null,
"e": 26745,
"s": 26717,
"text": "\n09 Apr, 2021"
},
{
"code": null,
"e": 27050,
"s": 26745,
"text": "In this article, we will cover how to display the title in the Bootstrap-Select without any empty element in the select dropdown menu. Bootstrap Select is a form c... |
GATE | GATE-CS-2014-(Set-1) | Question 65 - GeeksforGeeks | 28 Jun, 2021
Which of the regular expressions given below represent the following DFA?
I) 0*1(1+00*1)*
II) 0*1*1+11*0*1
III) (0+1)*1
(A) I and II only(B) I and III only(C) II and III only(D) I, II, and IIIAnswer: (B)Explanation:
I) 0*1(1+00*1)*
II) 0*1*1+11*0*1
III) (0+1)*1
(I) and (III) represent DFA.
(II) doesn'... | [
{
"code": null,
"e": 25675,
"s": 25647,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25749,
"s": 25675,
"text": "Which of the regular expressions given below represent the following DFA?"
},
{
"code": null,
"e": 25796,
"s": 25749,
"text": "I) 0*1(1+00*1)*\... |
File length() method in Java with Examples | 28 Jan, 2019
The length() function is a part of File class in Java . This function returns the length of the file denoted by the this abstract pathname was length.The function returns long value which represents the number of bits else returns 0L if the file does not exists or if an exception occurs.
Function signature... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2019"
},
{
"code": null,
"e": 317,
"s": 28,
"text": "The length() function is a part of File class in Java . This function returns the length of the file denoted by the this abstract pathname was length.The function returns long... |
Collections unmodifiableMap() method in Java with Examples | 08 Oct, 2018
The unmodifiableMap() method of java.util.Collections class is used to return an unmodifiable view of the specified map. This method allows modules to provide users with “read-only” access to internal maps. Query operations on the returned map “read through” to the specified map, and attempts to modify the... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Oct, 2018"
},
{
"code": null,
"e": 462,
"s": 52,
"text": "The unmodifiableMap() method of java.util.Collections class is used to return an unmodifiable view of the specified map. This method allows modules to provide users with “rea... |
Inheritance in Python | 07 Jul, 2022
Inheritance is the capability of one class to derive or inherit the properties from another class.
It represents real-world relationships well.
It provides the reusability of a code. We don’t have to write the same code again and again. Also, it allows us to add more features to a class without modifying ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 152,
"s": 52,
"text": "Inheritance is the capability of one class to derive or inherit the properties from another class. "
},
{
"code": null,
"e": 197,
"s": 152,
"text": "It re... |
Puzzle | Guess the total number of coins | 28 Aug, 2018
There are 10 robbers named as’A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’ they stole some coins from a bank and they decided to divide these coins equally among themselves. So they divide the coins into 10 parts but the last robber ‘J’ got 1 coin less than other robbers. So the remaining 9 robbers murd... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Aug, 2018"
},
{
"code": null,
"e": 816,
"s": 54,
"text": "There are 10 robbers named as’A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’ they stole some coins from a bank and they decided to divide these coins equally among themselve... |
How to Compare Two Queries in SQL | 08 Jun, 2021
Queries in SQL :A query will either be an invitation for data results from your info or for action on the info, or each. a question will provide you with a solution to a straightforward question, perform calculations, mix data from totally different tables, add, change, or delete data from info.
Creating a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jun, 2021"
},
{
"code": null,
"e": 325,
"s": 28,
"text": "Queries in SQL :A query will either be an invitation for data results from your info or for action on the info, or each. a question will provide you with a solution to a strai... |
Vulmap – Web Vulnerability Scanning And Verification Tools | 14 Sep, 2021
Vulnerability Scanning is the process of testing the target domain for various vulnerabilities in Web containers, Web servers, Web middleware, and CMS, and other Web programs, and has vulnerability exploitation functions. Testing each CVE against the target domain manually is not possible as manual testing... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 795,
"s": 28,
"text": "Vulnerability Scanning is the process of testing the target domain for various vulnerabilities in Web containers, Web servers, Web middleware, and CMS, and other Web programs,... |
How to reverse an Array using STL in C++? | 23 Jun, 2022
Given an array arr[], reverse this array using STL in C++. Example:
Input: arr[] = {1, 45, 54, 71, 76, 12}
Output: {12, 76, 71, 54, 45, 1}
Input: arr[] = {1, 7, 5, 4, 6, 12}
Output: {12, 6, 4, 5, 7, 1}
Approach: Reversing can be done with the help of reverse() function provided in STL. Syntax:
reverse(sta... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 121,
"s": 53,
"text": "Given an array arr[], reverse this array using STL in C++. Example:"
},
{
"code": null,
"e": 256,
"s": 121,
"text": "Input: arr[] = {1, 45, 54, 71, 76, 12... |
Python | Writing to an excel file using openpyxl module | 03 May, 2018
Prerequisite : Reading an excel file using openpyxl
Openpyxl is a Python library for reading and writing Excel (with extension xlsx/xlsm/xltx/xltm) files. The openpyxl module allows Python program to read and modify Excel files.
For example, user might have to go through thousands of rows and pick out few ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 May, 2018"
},
{
"code": null,
"e": 104,
"s": 52,
"text": "Prerequisite : Reading an excel file using openpyxl"
},
{
"code": null,
"e": 281,
"s": 104,
"text": "Openpyxl is a Python library for reading and writing ... |
Java - String Buffer reverse() Method | This method reverses the value of the StringBuffer object that invoked the method.
Let n be the length of the old character sequence, the one contained in the string buffer just prior to the execution of the reverse method. Then, the character at index k in the new character sequence is equal to the character at index ... | [
{
"code": null,
"e": 2460,
"s": 2377,
"text": "This method reverses the value of the StringBuffer object that invoked the method."
},
{
"code": null,
"e": 2734,
"s": 2460,
"text": "Let n be the length of the old character sequence, the one contained in the string buffer just prio... |
Solving Mazes With Python. Using Dijkstra’s Algorithm and OpenCV | by Max Reynolds | Towards Data Science | Mazes are often simple puzzles for humans, but they present a great programming problem that we can solve using shortest-path techniques like Dijkstra’s algorithm.
Dijkstra’s Algorithm is one of the more popular basic graph theory algorithms. It is used to find the shortest path between nodes on a directed graph. We st... | [
{
"code": null,
"e": 336,
"s": 172,
"text": "Mazes are often simple puzzles for humans, but they present a great programming problem that we can solve using shortest-path techniques like Dijkstra’s algorithm."
},
{
"code": null,
"e": 553,
"s": 336,
"text": "Dijkstra’s Algorithm i... |
Tflearn: Solving XOR with a 2x2x1 feed forward neural network in Tensorflow | by Tadej Magajna | Towards Data Science | A simple guide on how to train a 2x2x1 feed forward neural network to solve the XOR problem using only 12 lines of code in python tflearn — a deep learning library built on top of Tensorflow.
The goal of our network is to train a network to receive two boolean inputs and return True only when one input is True and the ... | [
{
"code": null,
"e": 364,
"s": 172,
"text": "A simple guide on how to train a 2x2x1 feed forward neural network to solve the XOR problem using only 12 lines of code in python tflearn — a deep learning library built on top of Tensorflow."
},
{
"code": null,
"e": 508,
"s": 364,
"te... |
for_each_n in C++17 - GeeksforGeeks | 13 Jun, 2018
The for_each_n() function was added in the C++17 technical specification. Its idea has been borrowed from the use of map in Python or Haskel. This function can be called with or without an execution policy. The execution policy lets you decide whether to utilize the new parallelization capabilities optimiz... | [
{
"code": null,
"e": 24018,
"s": 23990,
"text": "\n13 Jun, 2018"
},
{
"code": null,
"e": 24521,
"s": 24018,
"text": "The for_each_n() function was added in the C++17 technical specification. Its idea has been borrowed from the use of map in Python or Haskel. This function can be ... |
How do I get the resource id of an image if I know its name in Android using Kotlin? | This example demonstrates how to get the resource id of an image if I know its name in Android using Kotlin.
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.... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "This example demonstrates how to get the resource id of an image if I know its name in Android using Kotlin."
},
{
"code": null,
"e": 1300,
"s": 1171,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project... |
How To Analyse A Single Time Series Variable | by Jiahui Wang | Towards Data Science | Welcome back! This is the 2nd post in the column to explore analysing and modeling time series data with Python code. If you are not familiar with the basic statistical concepts, such as estimator, hypothesis testing, and p value, please check out my previous post: Time Series Modeling With Python Code: Fundamental Sta... | [
{
"code": null,
"e": 500,
"s": 171,
"text": "Welcome back! This is the 2nd post in the column to explore analysing and modeling time series data with Python code. If you are not familiar with the basic statistical concepts, such as estimator, hypothesis testing, and p value, please check out my prev... |
How to hide a widget after some time in Python Tkinter? | Tkinter is a standard Python library for developing GUI-based applications. We can create games, tools, and other applications using the Tkinter library. To develop GUI-based applications, Tkinter provides widgets.
Sometimes, there might be a requirement to hide a widget for some time. This can be achieved by using the... | [
{
"code": null,
"e": 1277,
"s": 1062,
"text": "Tkinter is a standard Python library for developing GUI-based applications. We can create games, tools, and other applications using the Tkinter library. To develop GUI-based applications, Tkinter provides widgets."
},
{
"code": null,
"e": 1... |
Creating child process using fork() in Python | Our task is to create a child process and display process id of both parent and child process using fork() function in Python.
When we use fork(), it creates a copy of itself, it is a very important aspect of LINUX, UNIX. fork() is mainly applicable for multithreading environment that means the execution of the thread ... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "Our task is to create a child process and display process id of both parent and child process using fork() function in Python."
},
{
"code": null,
"e": 1624,
"s": 1189,
"text": "When we use fork(), it creates a copy of itself, it is ... |
Node.js process.traceDeprecation Property - GeeksforGeeks | 10 Jun, 2021
The process.traceDeprecation property is an inbuilt application programming interface of the process module which is used to indicate whether the –trace-deprecation flag is set on the current Node.js process.
Syntax:
process.traceDeprecation
Return Value: This property indicates whether the –trace-depreca... | [
{
"code": null,
"e": 24603,
"s": 24572,
"text": " \n10 Jun, 2021\n"
},
{
"code": null,
"e": 24812,
"s": 24603,
"text": "The process.traceDeprecation property is an inbuilt application programming interface of the process module which is used to indicate whether the –trace-depreca... |
Creating a JavaScript array with new keyword. | Following is the code for creating a JavaScript array with new keyword −
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, ... | [
{
"code": null,
"e": 1135,
"s": 1062,
"text": "Following is the code for creating a JavaScript array with new keyword −"
},
{
"code": null,
"e": 1146,
"s": 1135,
"text": " Live Demo"
},
{
"code": null,
"e": 1950,
"s": 1146,
"text": "<!DOCTYPE html>\n<html lang... |
Absolute difference between the first X and last X Digits of N? | Here we will see how to get the differences between first and last X digits of a number N. The number and X are given. To solve this problem, we have to find the length of the number, then cut the last x digits using modulus operator. After that cut all digits from the number except first x digits. Then get the differe... | [
{
"code": null,
"e": 1541,
"s": 1062,
"text": "Here we will see how to get the differences between first and last X digits of a number N. The number and X are given. To solve this problem, we have to find the length of the number, then cut the last x digits using modulus operator. After that cut all... |
Go For Loops | The for loop loops through a block of code a specified number of times.
The for loop is the only loop
available in Go.
Loops are handy if you want to run the same code over and over again, each time with a different value.
Each execution of a loop is called an iteration.
The for loop can take up to three statements:
s... | [
{
"code": null,
"e": 72,
"s": 0,
"text": "The for loop loops through a block of code a specified number of times."
},
{
"code": null,
"e": 120,
"s": 72,
"text": "The for loop is the only loop \navailable in Go."
},
{
"code": null,
"e": 224,
"s": 120,
"text": "... |
Apex - if statement | An if statement consists of a Boolean expression followed by one or more statements.
if boolean_expression {
/* statement(s) will execute if the boolean expression is true */
}
If the Boolean expression evaluates to true, then the block of code inside the if statement will be executed. If the Boolean expression eva... | [
{
"code": null,
"e": 2137,
"s": 2052,
"text": "An if statement consists of a Boolean expression followed by one or more statements."
},
{
"code": null,
"e": 2233,
"s": 2137,
"text": "if boolean_expression {\n /* statement(s) will execute if the boolean expression is true */\n}\... |
jQuery Remove Elements | With jQuery, it is easy to remove existing HTML elements.
To remove elements and content, there are mainly two jQuery methods:
remove() - Removes the selected element (and its child elements)
empty() - Removes the child elements from the selected element
The jQuery remove() method removes the selected element(s) and it... | [
{
"code": null,
"e": 58,
"s": 0,
"text": "With jQuery, it is easy to remove existing HTML elements."
},
{
"code": null,
"e": 127,
"s": 58,
"text": "To remove elements and content, there are mainly two jQuery methods:"
},
{
"code": null,
"e": 192,
"s": 127,
"te... |
How to create a Venn diagram in R? | A Venn diagram helps to identify the common and uncommon elements between two or more than two sets of elements. This is also used in probability theory to visually represent the relationship between two or more events. To create a Venn diagram in R, we can make use of venn function of gplots package.
Consider the belo... | [
{
"code": null,
"e": 1365,
"s": 1062,
"text": "A Venn diagram helps to identify the common and uncommon elements between two or more than two sets of elements. This is also used in probability theory to visually represent the relationship between two or more events. To create a Venn diagram in R, we... |
SAP UI5 - Views | Views are defined using SAP libraries as follows −
XML with HTML, mixed, or Standalone: Library- sap.ui.core.mvc.XMLView
JavaScript: Library- sap.ui.core.mvc.JSView
JSON: Library - sap.ui.core.mvc.JSONView
HTML: Library - sap.ui.core.mvc.HTMLView
Sap.ui.jsview(“sap.hcm.address”, {
getControllerName: function() {
... | [
{
"code": null,
"e": 2092,
"s": 2041,
"text": "Views are defined using SAP libraries as follows −"
},
{
"code": null,
"e": 2162,
"s": 2092,
"text": "XML with HTML, mixed, or Standalone: Library- sap.ui.core.mvc.XMLView"
},
{
"code": null,
"e": 2206,
"s": 2162,
... |
TypeScript - Array push() | push() method appends the given element(s) in the last of the array and returns the length of the new array.
array.push(element1, ..., elementN);
element1, ..., elementN − The elements to add to the end of the array.
Returns the length of the new array.
var numbers = new Array(1, 4, 9);
var length = numbers.push(10);... | [
{
"code": null,
"e": 2157,
"s": 2048,
"text": "push() method appends the given element(s) in the last of the array and returns the length of the new array."
},
{
"code": null,
"e": 2195,
"s": 2157,
"text": "array.push(element1, ..., elementN);\n"
},
{
"code": null,
"e... |
Check if a string can be obtained by rotating another string 2 places in Python | Suppose we have two strings s and t. We have to check whether we can get s by rotating t two place at any direction left or right.
So, if the input is like s = "kolkata" t = "takolka", then the output will be True as we can rotate "takolka" to the left side two times to get "kolkata".
To solve this, we will follow thes... | [
{
"code": null,
"e": 1193,
"s": 1062,
"text": "Suppose we have two strings s and t. We have to check whether we can get s by rotating t two place at any direction left or right."
},
{
"code": null,
"e": 1348,
"s": 1193,
"text": "So, if the input is like s = \"kolkata\" t = \"tako... |
Program to find all possible strings typed using phone keypad in python | Suppose we have a string containing digits from 2-9. We have to find all possible letter combinations that the number could generate. One mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does map some characters but no letters.
For an example, if the given string is “49”, the... | [
{
"code": null,
"e": 1334,
"s": 1062,
"text": "Suppose we have a string containing digits from 2-9. We have to find all possible letter combinations that the number could generate. One mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does map some characte... |
Introduction to Principal Component Analysis (PCA) — with Python code | by Dhruvil Karani | Towards Data Science | Imagine a text data having 100000 sentences. The total number of unique words in the text is 10000 (vocabulary size). If each sentence is represented by a vector of length equal to the vocabulary size. In this vector of length 10000, each position belongs to a unique word. For the vector of our sentence, if a certain w... | [
{
"code": null,
"e": 723,
"s": 172,
"text": "Imagine a text data having 100000 sentences. The total number of unique words in the text is 10000 (vocabulary size). If each sentence is represented by a vector of length equal to the vocabulary size. In this vector of length 10000, each position belongs... |
How to get the current date to display in a Tkinter window? | To work with the date and time module, Python provides the 'datetime' package. Using 'datetime' package, we can display the date, manipulate the datetime object, and use it to write the additional functionality in an application.
To display the current date in a Tkinter window, we've to first import the datetime module... | [
{
"code": null,
"e": 1292,
"s": 1062,
"text": "To work with the date and time module, Python provides the 'datetime' package. Using 'datetime' package, we can display the date, manipulate the datetime object, and use it to write the additional functionality in an application."
},
{
"code": n... |
Exploratory Data Analysis with pandas | by Roman Orac | Towards Data Science | As a Data Scientist, I use pandas daily and I am always amazed by how many functionalities it has. These 5 pandas tricks will make you better with Exploratory Data Analysis, which is an approach to analyzing data sets to summarize their main characteristics, often with visual methods. Many complex visualizations can be... | [
{
"code": null,
"e": 623,
"s": 172,
"text": "As a Data Scientist, I use pandas daily and I am always amazed by how many functionalities it has. These 5 pandas tricks will make you better with Exploratory Data Analysis, which is an approach to analyzing data sets to summarize their main characteristi... |
A hands on an end to end data science project using Python | by Jonathan Leban | Towards Data Science | Machine learning, data science, prediction, you may have heard a lot of these words, but what exactly are they? In what situation is it useful?Born in the 1960s, Machine Learning is a branch of artificial intelligence that provides systems with the ability to learn models and make predictions such as predicting the pri... | [
{
"code": null,
"e": 1091,
"s": 172,
"text": "Machine learning, data science, prediction, you may have heard a lot of these words, but what exactly are they? In what situation is it useful?Born in the 1960s, Machine Learning is a branch of artificial intelligence that provides systems with the abili... |
ASP.NET MVC - Helpers | In ASP.Net web forms, developers are using the toolbox for adding controls on any particular page. However, in ASP.NET MVC application there is no toolbox available to drag and drop HTML controls on the view. In ASP.NET MVC application, if you want to create a view it should contain HTML code. So those developers who a... | [
{
"code": null,
"e": 2666,
"s": 2269,
"text": "In ASP.Net web forms, developers are using the toolbox for adding controls on any particular page. However, in ASP.NET MVC application there is no toolbox available to drag and drop HTML controls on the view. In ASP.NET MVC application, if you want to c... |
ReactJS componentDidCatch() Method - GeeksforGeeks | 10 Aug, 2021
The componentDidCatch() method is invoked if some error occurs during the rendering phase of any lifecycle methods or any children components. This method is used to implement the Error Boundaries for the React application. It is called during the commit phase, so unlike getDerivedStateFromError() which wa... | [
{
"code": null,
"e": 24836,
"s": 24808,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 25258,
"s": 24836,
"text": "The componentDidCatch() method is invoked if some error occurs during the rendering phase of any lifecycle methods or any children components. This method is used ... |
Java program to calculate the product of two numbers | The * operator in Java is used to multiply two numbers. Read required numbers from the user using Scanner class and multiply these two integers using the * operator.
import java.util.Scanner;
public class MultiplicationOfTwoNumbers {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
... | [
{
"code": null,
"e": 1228,
"s": 1062,
"text": "The * operator in Java is used to multiply two numbers. Read required numbers from the user using Scanner class and multiply these two integers using the * operator."
},
{
"code": null,
"e": 1680,
"s": 1228,
"text": "import java.util... |
Basic calculator program using C# | To create a calculator program in C#, you need to use Web Forms. Under that create buttons from 1-9, addition, subtraction, multiplication, etc.
Let us see the code for addition, subtraction, and multiplication. Firstly, we have declared two variables −
static float x, y;
Now, we will see how to set codes for calculati... | [
{
"code": null,
"e": 1207,
"s": 1062,
"text": "To create a calculator program in C#, you need to use Web Forms. Under that create buttons from 1-9, addition, subtraction, multiplication, etc."
},
{
"code": null,
"e": 1316,
"s": 1207,
"text": "Let us see the code for addition, sub... |
How to write JavaScript in an External File? | Create external JavaScript file with the extension .js. After creating, add it to the HTML file in the script tag. The src attribute is used to include that external JavaScript file.
If you have more than one external JavaScript file, then add it in the same web page to increase performance of the page.
Let’s say the f... | [
{
"code": null,
"e": 1245,
"s": 1062,
"text": "Create external JavaScript file with the extension .js. After creating, add it to the HTML file in the script tag. The src attribute is used to include that external JavaScript file."
},
{
"code": null,
"e": 1367,
"s": 1245,
"text": ... |
How to convert negative values in an R data frame to positive values? | Sometimes we need to use absolute values but few values in the data set are negative, therefore, we must convert them to positive. This can be done by using abs function. For example, if we have a data frame df with many columns and each of them having some negative values then those values can be converted to positive... | [
{
"code": null,
"e": 1413,
"s": 1062,
"text": "Sometimes we need to use absolute values but few values in the data set are negative, therefore, we must convert them to positive. This can be done by using abs function. For example, if we have a data frame df with many columns and each of them having ... |
ELMo helps to further improve your sentence embeddings | by Edward Ma | Towards Data Science | In the last story, Contextualized Word Vectors (CoVe) is introduced which is the enhanced version of word embeddings. Peters et al. introduces Deep Contextualized Word Representations which aim at providing a better word representation for NLP tasks under different context. They call it as ELMo (Embeddings from Languag... | [
{
"code": null,
"e": 503,
"s": 172,
"text": "In the last story, Contextualized Word Vectors (CoVe) is introduced which is the enhanced version of word embeddings. Peters et al. introduces Deep Contextualized Word Representations which aim at providing a better word representation for NLP tasks under... |
Get Started With TensorFlow 2.0 and Linear Regression | by Shubham Panchal | Towards Data Science | TensorFlow 2.0 has been a major breakthrough in the TensorFlow family. It’s completely new and refurbished and also less creepy! We’ll create a simple Linear Regression model in TensorFlow 2.0 to explore some new changes. So, open up your code editors and let’s get started!
Also, open up this notebook for an interactiv... | [
{
"code": null,
"e": 447,
"s": 172,
"text": "TensorFlow 2.0 has been a major breakthrough in the TensorFlow family. It’s completely new and refurbished and also less creepy! We’ll create a simple Linear Regression model in TensorFlow 2.0 to explore some new changes. So, open up your code editors and... |
Smart Discounts with Logistic Regression | Machine Learning from Scratch (Part I) | by Venelin Valkov | Towards Data Science | TL;DR in this part you will build a Logistic Regression model using Python from scratch. In the process, you will learn about the Gradient descent algorithm and use it to train your model.
Smart Discounts with Logistic RegressionPredicting House Prices with Linear RegressionBuilding a Decision Tree from Scratch in Pyth... | [
{
"code": null,
"e": 361,
"s": 172,
"text": "TL;DR in this part you will build a Logistic Regression model using Python from scratch. In the process, you will learn about the Gradient descent algorithm and use it to train your model."
},
{
"code": null,
"e": 797,
"s": 361,
"text"... |
First uppercase letter in a string (Iterative and Recursive) in C++ | In this tutorial, we are going to learn how find the first uppercase letter in the given string. Let's see an example.
Input −Tutorialspoint
Output −T
Let's see the steps to solve the problem using iterative method.
Initialize the string.
Initialize the string.
Iterate over the string.
Iterate over the string.
Check wh... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "In this tutorial, we are going to learn how find the first uppercase letter in the given string. Let's see an example."
},
{
"code": null,
"e": 1203,
"s": 1181,
"text": "Input −Tutorialspoint"
},
{
"code": null,
"e": 1213... |
Kotlin - Arrays | Arrays are used to store multiple items of the same data-type in a single variable, such as an integer or string under a single variable name.
For example, if we need to store names of 1000 employees, then instead of creating 1000 different string variables, we can simply define an array of string whose capacity will b... | [
{
"code": null,
"e": 2568,
"s": 2425,
"text": "Arrays are used to store multiple items of the same data-type in a single variable, such as an integer or string under a single variable name."
},
{
"code": null,
"e": 2753,
"s": 2568,
"text": "For example, if we need to store names ... |
Shortest Path with Alternating Colors in Python | Suppose we have directed graph, with nodes labelled 0, 1, ..., n-1. In this graph, each edge is colored with either red or blue colors, and there could be self-edges or parallel edges. Each [i, j] in red_edges indicates a red directed edge from node i to node j. Similarly, each [i, j] in blue_edges indicates a blue dir... | [
{
"code": null,
"e": 1628,
"s": 1062,
"text": "Suppose we have directed graph, with nodes labelled 0, 1, ..., n-1. In this graph, each edge is colored with either red or blue colors, and there could be self-edges or parallel edges. Each [i, j] in red_edges indicates a red directed edge from node i t... |
Graphs and its traversal algorithms | In this section we will see what is a graph data structure, and the traversal algorithms of it.
The graph is one non-linear data structure. That is consists of some nodes and their connected edges. The edges may be director or undirected. This graph can be represented as G(V, E). The following graph can be represented ... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "In this section we will see what is a graph data structure, and the traversal algorithms of it."
},
{
"code": null,
"e": 1446,
"s": 1158,
"text": "The graph is one non-linear data structure. That is consists of some nodes and their c... |
Assertions in C/C++ | Here we will see what is assertions in C/C++. The C library macro void assert(int expression) allows diagnostic information to be written to the standard error file. In other words, it can be used to add diagnostics in your C program.
Following is the declaration for assert() Macro.
void assert(int expression);
The par... | [
{
"code": null,
"e": 1297,
"s": 1062,
"text": "Here we will see what is assertions in C/C++. The C library macro void assert(int expression) allows diagnostic information to be written to the standard error file. In other words, it can be used to add diagnostics in your C program."
},
{
"cod... |
Error-free import of CSV files using Pandas DataFrame | by Syed Huma Shah | Towards Data Science | Data is at the centre of a Machine Learning pipeline. In order to leverage an algorithm’s full capacity, data must be first cleaned and wrangled properly.
The first step of data cleaning/wrangling is loading the file and then establishing a connection via the path of a file. There are different types of delimited files... | [
{
"code": null,
"e": 327,
"s": 172,
"text": "Data is at the centre of a Machine Learning pipeline. In order to leverage an algorithm’s full capacity, data must be first cleaned and wrangled properly."
},
{
"code": null,
"e": 769,
"s": 327,
"text": "The first step of data cleaning... |
DIY Deep Learning Projects. Inspired by the great work of Akshay... | by Favio Vázquez | Towards Data Science | Akshay Bahadur is one of the great examples that the Data Science community at LinkedIn gave. There are great people in other platforms like Quora, StackOverflow, Youtube, here, and in lots of forums and platforms helping each other in many areas of science, philosophy, math, language and of course Data Science and its... | [
{
"code": null,
"e": 505,
"s": 172,
"text": "Akshay Bahadur is one of the great examples that the Data Science community at LinkedIn gave. There are great people in other platforms like Quora, StackOverflow, Youtube, here, and in lots of forums and platforms helping each other in many areas of scien... |
How to set hamburger items on the right in bootstrap 4 ? - GeeksforGeeks | 30 Nov, 2019
In Bootstrap 4, NavBar is an essential component for menu purposes. To align menu items to right by using float-right class is works well in Bootstrap 3, but it doesn’t work in Bootstrap 4 because the navbar is now flexbox. The following approach will explain clearly.
In Bootstrap 4, NavBar contains so man... | [
{
"code": null,
"e": 24834,
"s": 24806,
"text": "\n30 Nov, 2019"
},
{
"code": null,
"e": 25103,
"s": 24834,
"text": "In Bootstrap 4, NavBar is an essential component for menu purposes. To align menu items to right by using float-right class is works well in Bootstrap 3, but it do... |
'dd' command in Linux - GeeksforGeeks | 10 Apr, 2022
dd is a command-line utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy files.
On Unix, device drivers for hardware (such as hard disk drives) and special device files (such as /dev/zero and /dev/random) appear in the file system just like normal files.
dd can als... | [
{
"code": null,
"e": 24002,
"s": 23974,
"text": "\n10 Apr, 2022"
},
{
"code": null,
"e": 24124,
"s": 24002,
"text": "dd is a command-line utility for Unix and Unix-like operating systems whose primary purpose is to convert and copy files."
},
{
"code": null,
"e": 2429... |
Query for documents where array size is greater than 1 in MongoDB? | You can use length to query for documents where array size is greater than 1:
db.yourCollectionName.find({$where:"this.yourArrayDocumentName.length > 1"}).pretty();
To understand the above syntax, let us create a collection with some documents. The query is
as follows to create a collection with documents:
>db.arrayLen... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "You can use length to query for documents where array size is greater than 1:"
},
{
"code": null,
"e": 1227,
"s": 1140,
"text": "db.yourCollectionName.find({$where:\"this.yourArrayDocumentName.length > 1\"}).pretty();"
},
{
"... |
Java Generics - List | Java has provided generic support in List interface.
List<T> list = new ArrayList<T>();
Where
list − object of List interface.
list − object of List interface.
T − The generic type parameter passed during list declaration.
T − The generic type parameter passed during list declaration.
The T is a type parameter passed ... | [
{
"code": null,
"e": 2693,
"s": 2640,
"text": "Java has provided generic support in List interface."
},
{
"code": null,
"e": 2729,
"s": 2693,
"text": "List<T> list = new ArrayList<T>();\n"
},
{
"code": null,
"e": 2735,
"s": 2729,
"text": "Where"
},
{
"... |
Local Development Set-Up of PostgreSQL with Docker | by Cesar Flores | Towards Data Science | When you are facing a project or a tech assignment on which you have to work with SQL, you either need access to a DB or you need to install it in your local. Either of them is very annoying, so I’m explaining what I normally do when I face this situation, while I wait for the full infrastructure and access to be provi... | [
{
"code": null,
"e": 497,
"s": 172,
"text": "When you are facing a project or a tech assignment on which you have to work with SQL, you either need access to a DB or you need to install it in your local. Either of them is very annoying, so I’m explaining what I normally do when I face this situation... |
Structure Your Data Science Projects | by Baran Köseoğlu | Towards Data Science | Data science has some key differences, as compared to software development. For example, data science projects focus on exploration and discovery, whereas software development typically focuses on implementing a solution to a well-defined problem. The ambiguities rarely occur in defining the requirements of a software ... | [
{
"code": null,
"e": 598,
"s": 171,
"text": "Data science has some key differences, as compared to software development. For example, data science projects focus on exploration and discovery, whereas software development typically focuses on implementing a solution to a well-defined problem. The amb... |
Unix / Linux - Shell Basic Operators | There are various operators supported by each shell. We will discuss in detail about Bourne shell (default shell) in this chapter.
We will now discuss the following operators −
Arithmetic Operators
Relational Operators
Boolean Operators
String Operators
File Test Operators
Bourne shell didn't originally have any mechan... | [
{
"code": null,
"e": 2878,
"s": 2747,
"text": "There are various operators supported by each shell. We will discuss in detail about Bourne shell (default shell) in this chapter."
},
{
"code": null,
"e": 2924,
"s": 2878,
"text": "We will now discuss the following operators −"
},... |
Musical Genre Classification with Convolutional Neural Networks | by Leland Roberts | Towards Data Science | As a lover of both music and data, the idea of combining the two sounded enticing. Innovative companies such as Spotify and Shazam have been able to leverage music data in a clever way to provide amazing services to users! I wanted to try my hand at working with audio data and try to build a model that could automatica... | [
{
"code": null,
"e": 569,
"s": 172,
"text": "As a lover of both music and data, the idea of combining the two sounded enticing. Innovative companies such as Spotify and Shazam have been able to leverage music data in a clever way to provide amazing services to users! I wanted to try my hand at worki... |
Accelerating Data Exploration. Using data describe for exploratory... | by Himanshu Sharma | Towards Data Science | Exploratory data analysis is one of the important initial steps for creating a better understanding of a dataset and the underlying data. It helps us in understanding what the data is all about, what are the different features of the dataset, understanding the association between different data points, etc.
Exploration... | [
{
"code": null,
"e": 480,
"s": 171,
"text": "Exploratory data analysis is one of the important initial steps for creating a better understanding of a dataset and the underlying data. It helps us in understanding what the data is all about, what are the different features of the dataset, understandin... |
Arduino - Serial Peripheral Interface | A Serial Peripheral Interface (SPI) bus is a system for serial communication, which uses up to four conductors, commonly three. One conductor is used for data receiving, one for data sending, one for synchronization and one alternatively for selecting a device to communicate with. It is a full duplex connection, which ... | [
{
"code": null,
"e": 3322,
"s": 2870,
"text": "A Serial Peripheral Interface (SPI) bus is a system for serial communication, which uses up to four conductors, commonly three. One conductor is used for data receiving, one for data sending, one for synchronization and one alternatively for selecting a... |
A Simple Neural Network. This is the simplest possible neural... | by Doug Wright | Towards Data Science | Though I recently completed Udacity’s Deep Learning NanoDegree program, I am fairly new to this subject. In an effort to further my studies, I am currently reading an excellent book on the subject, Andrew Trask’s Grokking Deep Learning. This blog post is directly inspired by this fantastic book.
So, what is a neural ne... | [
{
"code": null,
"e": 469,
"s": 172,
"text": "Though I recently completed Udacity’s Deep Learning NanoDegree program, I am fairly new to this subject. In an effort to further my studies, I am currently reading an excellent book on the subject, Andrew Trask’s Grokking Deep Learning. This blog post is ... |
Java Stream findAny() with examples | The findAny() method of the Java Stream returns an Optional for some element of the stream or an empty Optional if the stream is empty. Here, Optional is a container object which may or may not contain a non-null value.
Following is an example to implement the findAny() method in Java −
Live Demo
import java.util.*;
p... | [
{
"code": null,
"e": 1282,
"s": 1062,
"text": "The findAny() method of the Java Stream returns an Optional for some element of the stream or an empty Optional if the stream is empty. Here, Optional is a container object which may or may not contain a non-null value."
},
{
"code": null,
"... |
How to strip down all the punctuation from a string in Python? | The fastest way to strip all punctuation from a string is to use str.translate(). You can use it as follows:
import string
s = "string. With. Punctuation?"
print s.translate(None, string.punctuation)
This will give us the output:
string With Punctuation
If you want a more readable solution, you can explicitly iterate o... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "The fastest way to strip all punctuation from a string is to use str.translate(). You can use it as follows:"
},
{
"code": null,
"e": 1262,
"s": 1171,
"text": "import string\ns = \"string. With. Punctuation?\"\nprint s.translate(None... |
Counting elements of an array using a recursive function in JS? | The recursive function calls itself with some base condition. Let’s say the following is our array
with marks −
var listOfMarks=[56,78,90,94,91,82,77];
Following is the code to get the count of array elements −
function countNumberOfElementsUsingRecursive(listOfMarks) {
if (listOfMarks.length == 0) {
return 0;... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "The recursive function calls itself with some base condition. Let’s say the following is our array\nwith marks −"
},
{
"code": null,
"e": 1214,
"s": 1174,
"text": "var listOfMarks=[56,78,90,94,91,82,77];"
},
{
"code": null,
... |
.NET Core - SDK | In this chapter, we will understand the upcoming features in .NET Core. We will start with the .NET command line tools by opening the following Url in browser https://github.com/dotnet/cli
To know more about the progress, you can download the latest version of .NET Core SDK by scrolling down and you will see the Instal... | [
{
"code": null,
"e": 2575,
"s": 2386,
"text": "In this chapter, we will understand the upcoming features in .NET Core. We will start with the .NET command line tools by opening the following Url in browser https://github.com/dotnet/cli"
},
{
"code": null,
"e": 2732,
"s": 2575,
"t... |
C# | Get a collection of values in the StringDictionary - GeeksforGeeks | 01 Feb, 2019
StringDictionary.Values property is used to get a collection of values in the StringDictionary.
Syntax:
public virtual System.Collections.ICollection Values { get; }
Return Value: An ICollection that provides the values in the StringDictionary.
Example 1:
// C# code to get a collection// of values in the ... | [
{
"code": null,
"e": 23911,
"s": 23883,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24007,
"s": 23911,
"text": "StringDictionary.Values property is used to get a collection of values in the StringDictionary."
},
{
"code": null,
"e": 24015,
"s": 24007,
"te... |
What are the packages in Python? | To understand packages, you also need to know about modules. Any Python file is a module, its name being the file's base name/module's __name__ property without the .py extension. A package is a collection of Python modules, i.e., a package is a directory of Python modules containing an additional __init__.py file. The... | [
{
"code": null,
"e": 1609,
"s": 1062,
"text": "To understand packages, you also need to know about modules. Any Python file is a module, its name being the file's base name/module's __name__ property without the .py extension. A package is a collection of Python modules, i.e., a package is a directo... |
How to modify properties of a nested object in JavaScript? | There are two methods to modify properties of nested objects. One is Dot method and the other is Bracket method. The functionality is same for both the methods, but the only difference is their notation.
lets' discuss them in detail.
In the following example initially the value of property country is England. But usin... | [
{
"code": null,
"e": 1267,
"s": 1062,
"text": "There are two methods to modify properties of nested objects. One is Dot method and the other is Bracket method. The functionality is same for both the methods, but the only difference is their notation. "
},
{
"code": null,
"e": 1297,
"... |
Difference Between malloc() and calloc() with Examples - GeeksforGeeks | 21 Jan, 2022
Pre-requisite: Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()The functions malloc() and calloc() are library functions that allocate memory dynamically. Dynamic means the memory is allocated during runtime (execution of the program) from the heap segment.
malloc() allocates a... | [
{
"code": null,
"e": 24356,
"s": 24328,
"text": "\n21 Jan, 2022"
},
{
"code": null,
"e": 24643,
"s": 24356,
"text": "Pre-requisite: Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()The functions malloc() and calloc() are library functions that allocate... |
Double the first element and move zero to end - GeeksforGeeks | 28 Jan, 2022
For a given array of n integers and assume that ‘0’ is an invalid number and all others as a valid number. Convert the array in such a way that if both current and next element is valid and both have same value then double current value and replace the next number with 0. After the modification, rearrange ... | [
{
"code": null,
"e": 25125,
"s": 25097,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 25491,
"s": 25125,
"text": "For a given array of n integers and assume that ‘0’ is an invalid number and all others as a valid number. Convert the array in such a way that if both current and... |
SciPy Constants | As SciPy is more focused on scientific implementations, it provides many built-in scientific constants.
These constants can be helpful when you are working with Data Science.
PI is an example of a scientific constant.
Print the constant value of PI:
A list of all units under the constants module can be seen using the d... | [
{
"code": null,
"e": 104,
"s": 0,
"text": "As SciPy is more focused on scientific implementations, it provides many built-in scientific constants."
},
{
"code": null,
"e": 175,
"s": 104,
"text": "These constants can be helpful when you are working with Data Science."
},
{
... |
How to remove a SubList from an ArrayList in Java? | The subList() method of the List interface accepts two integer values representing indexes of the elements and, returns a view of the of the current List object removing the elements between the specified indices.
The clear() method of List interface removes all the elements from the current List object.
Therefore, to ... | [
{
"code": null,
"e": 1276,
"s": 1062,
"text": "The subList() method of the List interface accepts two integer values representing indexes of the elements and, returns a view of the of the current List object removing the elements between the specified indices."
},
{
"code": null,
"e": 13... |
Modular Exponentiation (Power in Modular Arithmetic) in java | The java.math.BigInteger.modPow(BigInteger exponent, BigInteger m) returns a BigInteger whose value is (this<sup>exponent</sup> mod m). Unlike pow, this method permits negative exponents. You can calculate the modular Exponentiation using this method.
Live Demo
import java.math.*;
public class BigIntegerDemo {
publ... | [
{
"code": null,
"e": 1314,
"s": 1062,
"text": "The java.math.BigInteger.modPow(BigInteger exponent, BigInteger m) returns a BigInteger whose value is (this<sup>exponent</sup> mod m). Unlike pow, this method permits negative exponents. You can calculate the modular Exponentiation using this method."
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.