title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Introduction to Complex Objects and Composition - GeeksforGeeks
29 Jul, 2021 An object is a basic unit of Object-Oriented Programming and represents the real-life entities. Complex objects are the objects that are built from smaller or a collection of objects. For example, a mobile phone is made up of various objects like a camera, battery, screen, sensors, etc. In this article, we...
[ { "code": null, "e": 25343, "s": 25315, "text": "\n29 Jul, 2021" }, { "code": null, "e": 26168, "s": 25343, "text": "An object is a basic unit of Object-Oriented Programming and represents the real-life entities. Complex objects are the objects that are built from smaller or a co...
Python | Get first index values in tuple of strings
01 May, 2019 Yet another peculiar problem which might not be common, but can occur in python programming while playing with tuples. Since tuples are immutable, they are difficult to manipulate and hence knowledge of possible variation solutions always helps. This articles solves problem of extracting only the first ind...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 May, 2019" }, { "code": null, "e": 435, "s": 28, "text": "Yet another peculiar problem which might not be common, but can occur in python programming while playing with tuples. Since tuples are immutable, they are difficult to manipu...
jQuery | append() Method
19 Feb, 2019 This append() Method in jQuery is used to insert some content at the end of the selected elements. Syntax: $(selector).append( content, function(index, html) ) Parameters: This method accepts two parameters as mentioned above and described below: content: It is required parameter and used to specify the co...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Feb, 2019" }, { "code": null, "e": 127, "s": 28, "text": "This append() Method in jQuery is used to insert some content at the end of the selected elements." }, { "code": null, "e": 135, "s": 127, "text": "Syntax:...
How to capture multiple matches in the same line in Java regex
import java.util.regex.*; class PatternMatcher { public static void main(String args[]) { int count = 0; // String to be scanned to find the pattern. String content = "aaa bb aaa"; String string = "aaa"; // Create a Pattern object Pattern p = Pattern.compile(string); // ge...
[ { "code": null, "e": 1741, "s": 1187, "text": "import java.util.regex.*;\nclass PatternMatcher {\n public static void main(String args[]) {\n int count = 0;\n // String to be scanned to find the pattern.\n String content = \"aaa bb aaa\";\n String string = \"aaa\";\n\n // ...
Set Matplotlib colorbar size to match graph
08 Sep, 2021 Prerequisites: Matplotlib Colorbar size that match graph or image is required to get good visualize effect. This can be achieved using any one of following approaches. Fraction parameter in colorbar() is used to set the size of colorbar. Using this we can match colorbar size to graph as: If vertical colorb...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Sep, 2021" }, { "code": null, "e": 54, "s": 28, "text": "Prerequisites: Matplotlib" }, { "code": null, "e": 196, "s": 54, "text": "Colorbar size that match graph or image is required to get good visualize effect. ...
Python – Difference between sorted() and sort()
03 Jun, 2022 Sorting means rearranging a given sequence of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of the element in the respective data structure.For example: The below list of characters is sorted in increasing order of their ASCII values. T...
[ { "code": null, "e": 52, "s": 24, "text": "\n03 Jun, 2022" }, { "code": null, "e": 471, "s": 52, "text": "Sorting means rearranging a given sequence of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of the elem...
Memory profiling in Python using memory_profiler
01 Aug, 2020 If you use Python a lot then you probably know that many people claim that Python takes up more time to execute. Well, you probably have seen approaches like the total time spent to execute a part of code or something like that but sometimes you need something more than that. What about RAM usage? Nobody r...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Aug, 2020" }, { "code": null, "e": 494, "s": 28, "text": "If you use Python a lot then you probably know that many people claim that Python takes up more time to execute. Well, you probably have seen approaches like the total time sp...
Twitter Sentiment Analysis WebApp Using Flask
13 Jun, 2022 This is a web app made using Python and Flask Framework. It has a registration system and a dashboard. Users can enter keywords to retrieve live Twitter text based on the keyword, and analyze it for customer feelings and sentiments. This data can be visualized in a graph. This project, in particular, mines...
[ { "code": null, "e": 54, "s": 26, "text": "\n13 Jun, 2022" }, { "code": null, "e": 511, "s": 54, "text": "This is a web app made using Python and Flask Framework. It has a registration system and a dashboard. Users can enter keywords to retrieve live Twitter text based on the key...
G-Fact 19 (Logical and Bitwise Not Operators on Boolean)
01 Jun, 2022 Most of the languages including C, C++, Java and Python provide the boolean type that can be either set to False or True.Consider below programs that use Logical Not (or !) operator on boolean. C++ Python C# Javascript // A C++ program that uses Logical Not or ! on boolean#include <iostream>using namespa...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Jun, 2022" }, { "code": null, "e": 248, "s": 52, "text": "Most of the languages including C, C++, Java and Python provide the boolean type that can be either set to False or True.Consider below programs that use Logical Not (or !) o...
Python | Perform Sentence Segmentation Using Spacy
05 Sep, 2020 The process of deciding from where the sentences actually start or end in NLP or we can simply say that here we are dividing a paragraph based on sentences. This process is known as Sentence Segmentation. In Python, we implement this part of NLP using the spacy library. Spacy is used for Natural Language P...
[ { "code": null, "e": 28, "s": 0, "text": "\n05 Sep, 2020" }, { "code": null, "e": 299, "s": 28, "text": "The process of deciding from where the sentences actually start or end in NLP or we can simply say that here we are dividing a paragraph based on sentences. This process is kn...
Ruby | Types of Variables
30 Jul, 2018 There are different types of variables in Ruby: Local variables Instance variables Class variables Global variables Each variable in Ruby is declared by using a special character at the start of the variable name which is mentioned in the following table: Local Variables: A local variable name always start...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Jul, 2018" }, { "code": null, "e": 100, "s": 52, "text": "There are different types of variables in Ruby:" }, { "code": null, "e": 116, "s": 100, "text": "Local variables" }, { "code": null, "e": 135,...
Reader ready() method in Java with Examples
07 Feb, 2019 The ready() method of Reader Class in Java is used to check whether this Reader is ready to be read or not. It returns a boolean which states if the reader is ready. Syntax: public void ready() Parameters: This method does not accepts any parameters Return Value: This method returns a boolean value which t...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Feb, 2019" }, { "code": null, "e": 194, "s": 28, "text": "The ready() method of Reader Class in Java is used to check whether this Reader is ready to be read or not. It returns a boolean which states if the reader is ready." }, {...
Palindrome String | Practice | GeeksforGeeks
Given a string S, check if it is palindrome or not. Example 1: Input: S = "abba" Output: 1 Explanation: S is a palindrome Example 2: Input: S = "abc" Output: 0 Explanation: S is not a palindrome Your Task: You don't need to read input or print anything. Complete the function isPlaindrome()which accepts string S and...
[ { "code": null, "e": 290, "s": 238, "text": "Given a string S, check if it is palindrome or not." }, { "code": null, "e": 301, "s": 290, "text": "Example 1:" }, { "code": null, "e": 360, "s": 301, "text": "Input: S = \"abba\"\nOutput: 1\nExplanation: S is a pa...
A Pancake Sorting Problem - GeeksforGeeks
17 Jan, 2022 We have discussed Pancake Sorting in the previous post. Following is a problem based on Pancake Sorting. Given an unsorted array, sort the given array. You are allowed to do only following operation on array. flip(arr, i): Reverse array from 0 to i Imagine a hypothetical machine where flip(i) always takes...
[ { "code": null, "e": 23253, "s": 23225, "text": "\n17 Jan, 2022" }, { "code": null, "e": 23462, "s": 23253, "text": "We have discussed Pancake Sorting in the previous post. Following is a problem based on Pancake Sorting. Given an unsorted array, sort the given array. You are all...
numpy.inner()
This function returns the inner product of vectors for 1-D arrays. For higher dimensions, it returns the sum product over the last axes. import numpy as np print np.inner(np.array([1,2,3]),np.array([0,1,0])) # Equates to 1*0+2*1+3*0 It will produce the following output − 2 # Multi-dimensional array example import n...
[ { "code": null, "e": 2380, "s": 2243, "text": "This function returns the inner product of vectors for 1-D arrays. For higher dimensions, it returns the sum product over the last axes." }, { "code": null, "e": 2478, "s": 2380, "text": "import numpy as np \nprint np.inner(np.array(...
Why Rectified Linear Unit (ReLU) in Deep Learning and the best practice to use it with TensorFlow | by B. Chen | Towards Data Science
The activation functions are at the very core of Deep Learning. They determine the output of a model, its accuracy, and computational efficiency. In some cases, activation functions have a major effect on the model’s ability to converge and the convergence speed. In this article, you’ll learn why ReLU is used in Deep L...
[ { "code": null, "e": 436, "s": 172, "text": "The activation functions are at the very core of Deep Learning. They determine the output of a model, its accuracy, and computational efficiency. In some cases, activation functions have a major effect on the model’s ability to converge and the convergenc...
CUDA - Quick Guide
CUDA − Compute Unified Device Architecture. It is an extension of C programming, an API model for parallel computing created by Nvidia. Programs written using CUDA harness the power of GPU. Thus, increasing the computing performance. Gordon Moore of Intel once famously stated a rule, which said that every passing year,...
[ { "code": null, "e": 2126, "s": 1892, "text": "CUDA − Compute Unified Device Architecture. It is an extension of C programming, an API model for parallel computing created by Nvidia. Programs written using CUDA harness the power of GPU. Thus, increasing the computing performance." }, { "code...
Program to count substrings with all 1s in binary string in Python
Suppose we have a binary string s. We have to find the number of substrings that contain only "1"s. If the answer is too large, mod the result by 10^9+7. So, if the input is like s = "100111", then the output will be 7, because the substrings containing only "1"s are ["1", "1", "1", "1", "11", "11" and "111"] To solve ...
[ { "code": null, "e": 1216, "s": 1062, "text": "Suppose we have a binary string s. We have to find the number of substrings that contain only \"1\"s. If the answer is too large, mod the result by 10^9+7." }, { "code": null, "e": 1373, "s": 1216, "text": "So, if the input is like s...
Dynamic program vs integer program: which one is better for the knapsack problem? | by Wei Xia | Towards Data Science
The field of optimization encompasses many different fields of models and algorithms. You can classify the field base on many different criteria: Linear vs nonlinear, convex vs non-convex, continuous vs discrete, etc. Often times, one problem could be solved with multiple different approaches, and this is where differe...
[ { "code": null, "e": 760, "s": 172, "text": "The field of optimization encompasses many different fields of models and algorithms. You can classify the field base on many different criteria: Linear vs nonlinear, convex vs non-convex, continuous vs discrete, etc. Often times, one problem could be sol...
Mockito - Spying
Mockito provides option to create spy on real objects. When spy is called, then actual method of real object is called. //create a spy on actual object calcService = spy(calculator); //perform operation on real object //test the add functionality Assert.assertEquals(mathApplication.add(20.0, 10.0),30.0,0); Step 1 − C...
[ { "code": null, "e": 2100, "s": 1980, "text": "Mockito provides option to create spy on real objects. When spy is called, then actual method of real object is called." }, { "code": null, "e": 2290, "s": 2100, "text": "//create a spy on actual object\ncalcService = spy(calculator)...
Dungeon Game in C++
Suppose there is a story like the demons had captured the princess whose name is P and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M row, N column grid-like rooms. Our valiant knight named K was initially positioned in the top-left room and must fight his way through the dungeon to r...
[ { "code": null, "e": 1402, "s": 1062, "text": "Suppose there is a story like the demons had captured the princess whose name is P and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M row, N column grid-like rooms. Our valiant knight named K was initially positioned i...
Data Analysis in MySQL — Operators, Joins and More in Relational Databases | by Craig Dickson | Towards Data Science
This is part 3 of a 3-part series taking you through the process of designing, coding, implementing and querying a relational database using MySQL, starting from zero. See part 1 (Designing a Relational Database and Creating an Entity Relationship Diagram) here, and part 2 (Coding and Implementing a Relational Database...
[ { "code": null, "e": 512, "s": 172, "text": "This is part 3 of a 3-part series taking you through the process of designing, coding, implementing and querying a relational database using MySQL, starting from zero. See part 1 (Designing a Relational Database and Creating an Entity Relationship Diagram...
Git - Quick Guide
Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work. Listed below are the functions of a VCS − Allows developers to work simultaneously. Does not allow overwriting each other’s changes. Maintains a history of every version. Following a...
[ { "code": null, "e": 2183, "s": 2045, "text": "Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work." }, { "code": null, "e": 2225, "s": 2183, "text": "Listed below are the functions of a VCS −" ...
How to resolve a NullPointerException in Java?
A NullPointerException is a runtime exception thrown by the JVM when our application code, other referenced API or the middleware encounters the following conditions Attempting to invoke an instance method of a null object. Attempting to access or modify a particular field of a null object. Attempting to obtain the len...
[ { "code": null, "e": 1228, "s": 1062, "text": "A NullPointerException is a runtime exception thrown by the JVM when our application code, other referenced API or the middleware encounters the following conditions" }, { "code": null, "e": 1286, "s": 1228, "text": "Attempting to in...
Encode an ASCII string into Base-64 Format - GeeksforGeeks
24 Sep, 2021 Base 64 is an encoding scheme that converts binary data into text format so that encoded textual data can be easily transported over network un-corrupted and without any data loss. Base64 is used commonly in a number of applications including email via MIME, and storing complex data in XML. Problem with se...
[ { "code": null, "e": 25477, "s": 25449, "text": "\n24 Sep, 2021" }, { "code": null, "e": 25959, "s": 25477, "text": "Base 64 is an encoding scheme that converts binary data into text format so that encoded textual data can be easily transported over network un-corrupted and witho...
C Program for sum of cos(x) series
We are given with the value of x and n where, x is the angle for cos and n is the number of terms in the cos(x) series. Cos(x) is a trigonometric function which is used to calculate the value of x angle. cos⁡(x)=∑k=0∞(−1)k(2k!)x2k Cos(x) = 1 – (x*2 / 2!) + (x*4 / 4!) – (x*6 / 6!) + (x*8 / 8!)...... Input-: x = 10, n = ...
[ { "code": null, "e": 1182, "s": 1062, "text": "We are given with the value of x and n where, x is the angle for cos and n is the number of terms in the cos(x) series." }, { "code": null, "e": 1266, "s": 1182, "text": "Cos(x) is a trigonometric function which is used to calculate ...
C++ Program to Find Fibonacci Numbers using Matrix Exponentiation
The Fibonacci numbers, commonly denoted Fn form a sequence, called the Fibonacci sequence, i.e; each number is the sum of the two preceding ones, starting from 0 and 1. That is − F0 = 0 and F1 = 1 And Fn = Fn-1 + Fn-2 for n > 1. Begin Take two 2 dimensional array Create a function and Perform matrix multiplicatio...
[ { "code": null, "e": 1241, "s": 1062, "text": "The Fibonacci numbers, commonly denoted Fn form a sequence, called the Fibonacci sequence, i.e; each number is the sum of the two preceding ones, starting from 0 and 1. That is −" }, { "code": null, "e": 1291, "s": 1241, "text": "F0 ...
Binary Representations in Digital Logic - GeeksforGeeks
07 Jul, 2021 Binary is a base-2 number system that uses two states 0 and 1 to represent a number. We can also call it to be a true state and a false state. A binary number is built the same way as we build the normal decimal number. For example, a decimal number 45 can be represented as 4*10^1+5*10^0 = 40+5 Now in bi...
[ { "code": null, "e": 25815, "s": 25787, "text": "\n07 Jul, 2021" }, { "code": null, "e": 26036, "s": 25815, "text": "Binary is a base-2 number system that uses two states 0 and 1 to represent a number. We can also call it to be a true state and a false state. A binary number is b...
Why do we Need Immutables in Python ?
10 Jul, 2020 When a Novice steps into the Programming world and kicks off to learn about different concepts of it and yet eventually reaching to the Data Structures and Algorithms, learning and implementing them, but one or the other way he/she tends to read once and forget about the Immutable object. Mutable and Immut...
[ { "code": null, "e": 52, "s": 24, "text": "\n10 Jul, 2020" }, { "code": null, "e": 342, "s": 52, "text": "When a Novice steps into the Programming world and kicks off to learn about different concepts of it and yet eventually reaching to the Data Structures and Algorithms, learni...
ReactJS Reactstrap Collapse Component
24 Nov, 2021 Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Collapse component is used as a content area that can be collapsed and expanded. We can use the following approach in ReactJS to use the Reac...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Nov, 2021" }, { "code": null, "e": 370, "s": 28, "text": "Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Collapse ...
How to Fix: ‘numpy.ndarray’ object has no attribute ‘append’
28 Nov, 2021 NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. If you are into analytics, you might have come across this library in python. In the beginn...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Nov, 2021" }, { "code": null, "e": 630, "s": 28, "text": "NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematic...
Information Security | Integrity
13 Jun, 2022 Integrity is the protection of system data from intentional or accidental unauthorized changes. The challenges of the security program are to ensure that data is maintained in the state that is expected by the users. Although the security program cannot improve the accuracy of the data that is put into the...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Jun, 2022" }, { "code": null, "e": 1224, "s": 28, "text": "Integrity is the protection of system data from intentional or accidental unauthorized changes. The challenges of the security program are to ensure that data is maintained i...
ReactJS | Setting up Development Environment
25 Jan, 2021 To run any React application, we must have NodeJS installed on our PC. So, the very first step will be to install NodeJS. Step 1: Install NodeJS. You may visit the official download link of NodeJS to download and install the latest version of NodeJS. Once we have set up NodeJS on our PC, the next thing we...
[ { "code": null, "e": 53, "s": 25, "text": "\n25 Jan, 2021" }, { "code": null, "e": 176, "s": 53, "text": "To run any React application, we must have NodeJS installed on our PC. So, the very first step will be to install NodeJS. " }, { "code": null, "e": 402, "s": ...
JavaScript | Object Properties
27 Mar, 2019 Object properties are defined as a simple association between name and value. All properties have a name and value is one of the attributes linked with the property, which defines the access granted to the property. Properties refer to the collection of values which are associated with the JavaScript objec...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Mar, 2019" }, { "code": null, "e": 510, "s": 28, "text": "Object properties are defined as a simple association between name and value. All properties have a name and value is one of the attributes linked with the property, which def...
Design a Parallax Webpage using HTML & CSS
13 Apr, 2021 A parallax website includes fixed images in the background that is kept in place and user can scroll down the page to see different parts of the image. In this article, we are creating a parallax webpage using HTML and CSS. We will use basic tags of HTML like div, paragraph, and heading to write our conten...
[ { "code": null, "e": 54, "s": 26, "text": "\n13 Apr, 2021" }, { "code": null, "e": 425, "s": 54, "text": "A parallax website includes fixed images in the background that is kept in place and user can scroll down the page to see different parts of the image. In this article, we ar...
How to create linear gradient text using HTML and CSS ?
11 Jun, 2020 The linear-gradient is a kind of text-styling in which the text is filled with linear-gradient color codes. These kinds of effects are generally used in dark-themed websites or apps to make the text look attractive and bold. They are almost suitable for dark themes and do not go well with the lighter theme...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Jun, 2020" }, { "code": null, "e": 338, "s": 28, "text": "The linear-gradient is a kind of text-styling in which the text is filled with linear-gradient color codes. These kinds of effects are generally used in dark-themed websites o...
Python – Extract elements from Ranges in List
02 Sep, 2020 Given a list, and a list of tuples with ranges, extract all elements in those ranges from list. Input : test_list = [4, 5, 4, 6, 7, 5, 4, 5, 6, 10], range_list = [(2, 4), (7, 8)]Output : [4, 6, 7, 5, 6]Explanation : 4, 6, 7 are elements at idx 2, 3, 4 and 5, 6 at idx 7, 8. Input : test_list = [4, 5, 4, 6, ...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Sep, 2020" }, { "code": null, "e": 124, "s": 28, "text": "Given a list, and a list of tuples with ranges, extract all elements in those ranges from list." }, { "code": null, "e": 302, "s": 124, "text": "Input : te...
VB.Net - Operators
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. VB.Net is rich in built-in operators and provides following types of commonly used operators − Arithmetic Operators Arithmetic Operators Comparison Operators Comparison Operators Logical/Bitwise Operators Logical/...
[ { "code": null, "e": 2636, "s": 2434, "text": "An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. VB.Net is rich in built-in operators and provides following types of commonly used operators −" }, { "code": null, "e": 2657, "s":...
A Covid Analysis. From a country-wise analysis of... | by Deepika Vijay | Towards Data Science
In this article, we are going to walk through Relationships between variables such as a country’s poverty rates, life expectancy rates, stringency indices and, covid cases and deathsVaccination rates per country and their predictions up until the end of JuneHow I went about the data and the analyses (only the jupyter n...
[ { "code": null, "e": 218, "s": 172, "text": "In this article, we are going to walk through" }, { "code": null, "e": 506, "s": 218, "text": "Relationships between variables such as a country’s poverty rates, life expectancy rates, stringency indices and, covid cases and deathsVacc...
C library function - atan2()
The C library function double atan2(double y, double x) returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant. Following is the declaration for atan2() function. double atan2(double y, double x) x − This is the floating point value representing an x-coordinate. x ...
[ { "code": null, "e": 2174, "s": 2007, "text": "The C library function double atan2(double y, double x) returns the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant." }, { "code": null, "e": 2225, "s": 2174, "text": "Following is th...
Python | Single Point Crossover in Genetic Algorithm - GeeksforGeeks
13 Oct, 2019 Single Point Crossover in Genetic Algorithm is a form of crossover in which two-parent chromosome are selected and a random/given point is selected and the genes/data are interchanged between them after the given/selected point for example Examples: P1: 000011110011 P2: 101010101010 Point: 4 After Crosso...
[ { "code": null, "e": 24492, "s": 24464, "text": "\n13 Oct, 2019" }, { "code": null, "e": 24732, "s": 24492, "text": "Single Point Crossover in Genetic Algorithm is a form of crossover in which two-parent chromosome are selected and a random/given point is selected and the genes/d...
What does the Double Star operator mean in Python? - GeeksforGeeks
26 Nov, 2020 Double Star or (**) is one of the Arithmetic Operator (Like +, -, *, **, /, //, %) in Python Language. It is also known as Power Operator. Arithmetic operators follow the same precedence rules as in mathematics, and they are: exponential is performed first, multiplication and division are performed next ,f...
[ { "code": null, "e": 23925, "s": 23897, "text": "\n26 Nov, 2020" }, { "code": null, "e": 24064, "s": 23925, "text": "Double Star or (**) is one of the Arithmetic Operator (Like +, -, *, **, /, //, %) in Python Language. It is also known as Power Operator." }, { "code": nu...
C program to sort an array by using merge sort
An array is a group of related data items which share’s a common name. A particular value in an array is identified with the help of its "index number". The syntax for declaring an array is as follows − datatype array_name [size]; For example, float marks [50] It declares ‘marks’ to be an array containing 50 float elem...
[ { "code": null, "e": 1215, "s": 1062, "text": "An array is a group of related data items which share’s a common name. A particular value in an array is identified with the help of its \"index number\"." }, { "code": null, "e": 1265, "s": 1215, "text": "The syntax for declaring an...
Factorial of Large Number Using boost multiprecision Library - GeeksforGeeks
28 Jan, 2018 We have given a large number now we can easily find out the factorial of this large number using boost multiprevision Library.Boost library has included a new multiprecision library in the current 1.53.0 release for C++ programmers who need more precision than 64 bits. Examples: Input : 100 Output : 93326...
[ { "code": null, "e": 24794, "s": 24766, "text": "\n28 Jan, 2018" }, { "code": null, "e": 25064, "s": 24794, "text": "We have given a large number now we can easily find out the factorial of this large number using boost multiprevision Library.Boost library has included a new mult...
Modular multiplicative inverse - GeeksforGeeks
19 Feb, 2022 Given two integers ‘a’ and ‘m‘, find modular multiplicative inverse of ‘a’ under modulo ‘m’.The modular multiplicative inverse is an integer ‘x’ such that. a x ≅ 1 (mod m) The value of x should be in { 1, 2, ... m-1}, i.e., in the range of integer modulo m. ( Note that x cannot be 0 as a*0 mod m will neve...
[ { "code": null, "e": 24159, "s": 24131, "text": "\n19 Feb, 2022" }, { "code": null, "e": 24316, "s": 24159, "text": "Given two integers ‘a’ and ‘m‘, find modular multiplicative inverse of ‘a’ under modulo ‘m’.The modular multiplicative inverse is an integer ‘x’ such that. " }, ...
Clearing input buffer in C/C++
The function fflush(stdin) is used to flush or clear the output buffer of the stream. When it is used after the scanf(), it flushes the input buffer also. It returns zero if successful, otherwise returns EOF and feof error indicator is set. Here is the syntax of fflush(stdin) to clear the input buffer in C language, in...
[ { "code": null, "e": 1303, "s": 1062, "text": "The function fflush(stdin) is used to flush or clear the output buffer of the stream. When it is used after the scanf(), it flushes the input buffer also. It returns zero if successful, otherwise returns EOF and feof error indicator is set." }, { ...
Composition vs Aggregation in C#
Under Composition, if the parent object is deleted, then the child object also loses its status. Composition is a special type of Aggregation and gives a part-of relationship. For example, A Car has an engine. If the car is destroyed, the engine is destroyed as well. public class Engine { . . . } public class Car { ...
[ { "code": null, "e": 1238, "s": 1062, "text": "Under Composition, if the parent object is deleted, then the child object also loses its status. Composition is a special type of Aggregation and gives a part-of relationship." }, { "code": null, "e": 1330, "s": 1238, "text": "For ex...
Detecting faces with Python and OpenCV Face Detection Neural Network | by Himasha Abeywickrama | Towards Data Science
Now, we all know that Artificial Intelligence is becoming more and more real and its filling the gaps between capabilities of humans and machines day by day. It’s not just a fancy word anymore. It has had many advancements over the years in many fields and one of such areas is the domain of Computer Vision. When it com...
[ { "code": null, "e": 481, "s": 172, "text": "Now, we all know that Artificial Intelligence is becoming more and more real and its filling the gaps between capabilities of humans and machines day by day. It’s not just a fancy word anymore. It has had many advancements over the years in many fields an...
Flutter - DevTools - GeeksforGeeks
15 Jan, 2021 DevTools is a tooling suite for Flutter and Dart developers consisting of layout inspection tools, performance tools, memory tools basically all the debugging tools that you need to be an efficient and effective Flutter developer bundled into a single web suite. The Flutter DevTools can be used to perform ...
[ { "code": null, "e": 24036, "s": 24008, "text": "\n15 Jan, 2021" }, { "code": null, "e": 24299, "s": 24036, "text": "DevTools is a tooling suite for Flutter and Dart developers consisting of layout inspection tools, performance tools, memory tools basically all the debugging tool...
ExpressJS - Database
We keep receiving requests, but end up not storing them anywhere. We need a Database to store the data. For this, we will make use of the NoSQL database called MongoDB. To install and read about Mongo, follow this link. In order to use Mongo with Express, we need a client API for node. There are multiple options for us...
[ { "code": null, "e": 2230, "s": 2061, "text": "We keep receiving requests, but end up not storing them anywhere. We need a Database to store the data. For this, we will make use of the NoSQL database called MongoDB." }, { "code": null, "e": 2281, "s": 2230, "text": "To install an...
Easy way to re-order columns in MySQL?
To re-order columns in MySQL, use the ALTER TABLE MODIFY COLUMN. The syntax is as follows - ALTER TABLE yourTableName MODIFY COLUMN yourColumnName data type after yourColumnName. To understand the above syntax, let us first create a table. The query to create a table is as follows. mysql> create table reOrderColumn -> ...
[ { "code": null, "e": 1154, "s": 1062, "text": "To re-order columns in MySQL, use the ALTER TABLE MODIFY COLUMN. The syntax is as follows -" }, { "code": null, "e": 1241, "s": 1154, "text": "ALTER TABLE yourTableName MODIFY COLUMN yourColumnName data type after yourColumnName." ...
Biopython - PDB Module
Biopython provides Bio.PDB module to manipulate polypeptide structures. The PDB (Protein Data Bank) is the largest protein structure resource available online. It hosts a lot of distinct protein structures, including protein-protein, protein-DNA, protein-RNA complexes. In order to load the PDB, type the below command −...
[ { "code": null, "e": 2376, "s": 2106, "text": "Biopython provides Bio.PDB module to manipulate polypeptide structures. The PDB (Protein Data Bank) is the largest protein structure resource available online. It hosts a lot of distinct protein structures, including protein-protein, protein-DNA, protei...
Flutter - Writing Android Specific Code
Flutter provides a general framework to access platform specific feature. This enables the developer to extend the functionality of the Flutter framework using platform specific code. Platform specific functionality like camera, battery level, browser, etc., can be accessed easily through the framework. The general ide...
[ { "code": null, "e": 2523, "s": 2218, "text": "Flutter provides a general framework to access platform specific feature. This enables the developer to extend the functionality of the Flutter framework using platform specific code. Platform specific functionality like camera, battery level, browser, ...
fork() and memory shared b/w processes created using it - GeeksforGeeks
28 Jun, 2021 Prerequisite : fork() in C. So when we do a fork() what are the sections the two process actually share ?Is the heap memory per process ?Are the global variables shared ?Will malloc return the same address to both ? Let us run below program and take look at the output of it to clear the questions above . /...
[ { "code": null, "e": 23843, "s": 23815, "text": "\n28 Jun, 2021" }, { "code": null, "e": 23871, "s": 23843, "text": "Prerequisite : fork() in C." }, { "code": null, "e": 24059, "s": 23871, "text": "So when we do a fork() what are the sections the two process a...
Javascript Program To Find Length Of The Longest Substring Without Repeating Characters - GeeksforGeeks
20 Dec, 2021 Given a string str, find the length of the longest substring without repeating characters. For “ABDEFGABEF”, the longest substring are “BDEFGA” and “DEFGAB”, with length 6. For “BBBB” the longest substring is “B”, with length 1. For “GEEKSFORGEEKS”, there are two longest substrings shown in the below diag...
[ { "code": null, "e": 24437, "s": 24409, "text": "\n20 Dec, 2021" }, { "code": null, "e": 24529, "s": 24437, "text": "Given a string str, find the length of the longest substring without repeating characters. " }, { "code": null, "e": 24611, "s": 24529, "text":...
Neural Networks with Memory. Understanding RNN, LSTM under 5 minutes | by Ramya Vidiyala | Towards Data Science
We always heard that Neural Networks (NNs)are inspired by biological neural networks. This huge representation was done in a fantastic way. Figure 1 shows the anatomy of a single neuron. The central part is called the cell body where the nucleus resides. There are various wires which pass the stimulus to the cell body ...
[ { "code": null, "e": 312, "s": 172, "text": "We always heard that Neural Networks (NNs)are inspired by biological neural networks. This huge representation was done in a fantastic way." }, { "code": null, "e": 724, "s": 312, "text": "Figure 1 shows the anatomy of a single neuron....
7 things to quickly improve your Data Analysis in Python | by Peter Nistrup | Towards Data Science
Take your Data Analysis to the next level! Turning a blind eye to the completely obvious risk of sounding like a broken record I just want to voice yet another giant thank you to everyone who’s been reading and sharing my last two articles: Python tricks 101, what every new programmer should know and Exploring your dat...
[ { "code": null, "e": 215, "s": 172, "text": "Take your Data Analysis to the next level!" }, { "code": null, "e": 687, "s": 215, "text": "Turning a blind eye to the completely obvious risk of sounding like a broken record I just want to voice yet another giant thank you to everyon...
Semaphore in C#
The semaphore class lets you set a limit on the number of threads that have access to a critical section. The class is used to control access to a pool of resources. System.Threading.Semaphore is the namespace for Semaphore because it has all the methods and properties required to implement Semaphore. For using a semap...
[ { "code": null, "e": 1365, "s": 1062, "text": "The semaphore class lets you set a limit on the number of threads that have access to a critical section. The class is used to control access to a pool of resources. System.Threading.Semaphore is the namespace for Semaphore because it has all the method...
DynamoDB - Error Handling
On unsuccessful processing of a request, DynamoDB throws an error. Each error consists of the following components: HTTP status code, exception name, and message. Error management rests on your SDK, which propagates errors, or your own code. Exceptions fall into different HTTP header status codes. The 4xx and 5xx hold ...
[ { "code": null, "e": 2633, "s": 2391, "text": "On unsuccessful processing of a request, DynamoDB throws an error. Each error consists of the following components: HTTP status code, exception name, and message. Error management rests on your SDK, which propagates errors, or your own code." }, { ...
Multivariable time series forecasting using Stateless Neural Networks | by Arjeus A. Guevarra | Towards Data Science
Forecasting with multiple variables that aids a target variable with stateless deep learning. Time series. Datasets that have a time element with them. Such data allow us to think about the combination of 2 properties of time series: Seasonality — Patterns in data that tends to repeat over and over at a specific length...
[ { "code": null, "e": 266, "s": 172, "text": "Forecasting with multiple variables that aids a target variable with stateless deep learning." }, { "code": null, "e": 406, "s": 266, "text": "Time series. Datasets that have a time element with them. Such data allow us to think about ...
Alternate XOR operations on sorted array - GeeksforGeeks
18 Nov, 2021 Given an array arr[] and two integers X and K. The task is to perform the following operation on array K times: Sort the array.XOR every alternate element of the sorted array with X i.e. arr[0], arr[2], arr[4], ... Sort the array. XOR every alternate element of the sorted array with X i.e. arr[0], arr[2]...
[ { "code": null, "e": 24405, "s": 24377, "text": "\n18 Nov, 2021" }, { "code": null, "e": 24519, "s": 24405, "text": "Given an array arr[] and two integers X and K. The task is to perform the following operation on array K times: " }, { "code": null, "e": 24622, "...
Equivalent of Java Super Keyword in C#
For super keyword in Java, we have the base keyword in C#. Super keyword in Java refers immediate parent class instance. It is used to differentiate the members of superclass from the members of subclass, if they have same names. It is used to invoke the superclass constructor from subclass. C# base keyword is used to ...
[ { "code": null, "e": 1121, "s": 1062, "text": "For super keyword in Java, we have the base keyword in C#." }, { "code": null, "e": 1355, "s": 1121, "text": "Super keyword in Java refers immediate parent class instance. It is used to differentiate the members of superclass from th...
Matcher replaceAll() method in Java with Examples
The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern. The replaceAll() method of this (Matcher) class accepts a string value, re...
[ { "code": null, "e": 1308, "s": 1062, "text": "The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class, you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern." }, ...
Convert array to HashSet in Java
Create an array and convert it to List − Integer[] arr = { 10, 15, 20, 10, 10, 10, 20, 30, 35, 40, 40}; List<Integer> l = Arrays.asList(arr); Now, let us convert the above array to HashSet − Set<Integer> s = new HashSet<Integer>(l); The following is an example to convert array to HashSet − Live Demo import java.util.*...
[ { "code": null, "e": 1103, "s": 1062, "text": "Create an array and convert it to List −" }, { "code": null, "e": 1204, "s": 1103, "text": "Integer[] arr = { 10, 15, 20, 10, 10, 10, 20, 30, 35, 40, 40};\nList<Integer> l = Arrays.asList(arr);" }, { "code": null, "e": 12...
Input/Output from external file in C/C++, Java and Python for Competitive Programming - GeeksforGeeks
06 Jan, 2022 In Competitive Programming, most of the time we need to enter input for checking our code manually. But it would become cumbersome if we have a questions like Graphs, strings, or bulky entry of input data because it will definitely time out or the chances of typing incorrect data would be increased. We can...
[ { "code": null, "e": 24568, "s": 24540, "text": "\n06 Jan, 2022" }, { "code": null, "e": 25288, "s": 24568, "text": "In Competitive Programming, most of the time we need to enter input for checking our code manually. But it would become cumbersome if we have a questions like Grap...
How can I get the current screen orientation in Android?
In some situation, we need to find an android activity orientation. This example demonstrates how to integrate Android Login and registration form. 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/layo...
[ { "code": null, "e": 1210, "s": 1062, "text": "In some situation, we need to find an android activity orientation. This example demonstrates how to integrate Android Login and registration form." }, { "code": null, "e": 1339, "s": 1210, "text": "Step 1 − Create a new project in A...
What is following-sibling in Selenium?
We can use the concept of following-sibling in xpath for identifying elements in Selenium. It identifies the siblings of the context node. The siblings should be located at the equal level of the existing node and should have the same parent. Let us see an example of an element with ul tag having more than one child wi...
[ { "code": null, "e": 1305, "s": 1062, "text": "We can use the concept of following-sibling in xpath for identifying elements in Selenium. It identifies the siblings of the context node. The siblings should be located at the equal level of the existing node and should have the same parent." }, { ...
How to create a Hero Image with CSS?
Following is the code to create a hero image with CSS − Live Demo <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> body, html { height: 100%; margin: 0; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } *, *::before, *::after { box-s...
[ { "code": null, "e": 1118, "s": 1062, "text": "Following is the code to create a hero image with CSS −" }, { "code": null, "e": 1129, "s": 1118, "text": " Live Demo" }, { "code": null, "e": 2402, "s": 1129, "text": "<!DOCTYPE html>\n<html>\n<head>\n<meta name=...
React Native - App
If you open the default app you can observe that the app.js file looks like import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; export default class App extends React.Component { render() { return ( <View style = {styles.container}> <Text>Open up App.js to st...
[ { "code": null, "e": 2420, "s": 2344, "text": "If you open the default app you can observe that the app.js file looks like" }, { "code": null, "e": 3036, "s": 2420, "text": "import React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nexport default class...
AI with Python – Computer Vision
Computer vision is concerned with modeling and replicating human vision using computer software and hardware. In this chapter, you will learn in detail about this. Computer vision is a discipline that studies how to reconstruct, interrupt and understand a 3d scene from its 2d images, in terms of the properties of the s...
[ { "code": null, "e": 2369, "s": 2205, "text": "Computer vision is concerned with modeling and replicating human vision using computer software and hardware. In this chapter, you will learn in detail about this." }, { "code": null, "e": 2556, "s": 2369, "text": "Computer vision is...
Python Virtual Environments made easy | by Karan Bhanot | Towards Data Science
I was starting a project where I had to quickly check if a package, Flask, worked with the Python installed on my machine. As I ran the command to install Flask, it alerted me that the package was already installed as I had Anaconda on my machine. But when I tried to run the Hello World Flask app on Sublime Text 3, the...
[ { "code": null, "e": 420, "s": 172, "text": "I was starting a project where I had to quickly check if a package, Flask, worked with the Python installed on my machine. As I ran the command to install Flask, it alerted me that the package was already installed as I had Anaconda on my machine." }, ...
Angular Material 7 - Progress Spinner
The <mat-progress-spinner>, an Angular Directive, is used to show a progress spinner with material styling. In this chapter, we will showcase the configuration required to draw a deterministic as well as indeterministic progress spinner using Angular Material. Follow the following steps to update the Angular applicatio...
[ { "code": null, "e": 2863, "s": 2755, "text": "The <mat-progress-spinner>, an Angular Directive, is used to show a progress spinner with material styling." }, { "code": null, "e": 3016, "s": 2863, "text": "In this chapter, we will showcase the configuration required to draw a det...
Diverging Bar Chart using Python - GeeksforGeeks
15 Mar, 2021 Diverging Bar Charts are used to ease the comparison of multiple groups. Its design allows us to compare numerical values in various groups. It also helps us to quickly visualize the favorable and unfavorable or positive and negative responses. The bar chart consisted of a combination of two horizontal bar...
[ { "code": null, "e": 24238, "s": 24210, "text": "\n15 Mar, 2021" }, { "code": null, "e": 24735, "s": 24238, "text": "Diverging Bar Charts are used to ease the comparison of multiple groups. Its design allows us to compare numerical values in various groups. It also helps us to qu...
How to use count with CASE condition in a MySQL query?
Use CASE WHEN for this in MySQL and set CASE condition inside the COUNT() method to count. Let us first create a table − mysql> create table DemoTable1374 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20), -> Score int -> ); Query OK, 0 rows affected (0.61 sec) Insert some records i...
[ { "code": null, "e": 1183, "s": 1062, "text": "Use CASE WHEN for this in MySQL and set CASE condition inside the COUNT() method to count. Let us first create a table −" }, { "code": null, "e": 1361, "s": 1183, "text": "mysql> create table DemoTable1374\n -> (\n -> Id int NOT ...
Bootstrap 4 - Input Group
Using input groups you can easily prepend and append text or buttons to the text-based inputs. You can create an input group by adding .input-group class within <div> element. Add the text in front of the input by using .input-group-prepend and use .input-group-append class to add the text behind the input. Style the s...
[ { "code": null, "e": 1911, "s": 1816, "text": "Using input groups you can easily prepend and append text or buttons to the text-based inputs." }, { "code": null, "e": 2185, "s": 1911, "text": "You can create an input group by adding .input-group class within <div> element. Add th...
Python VLC MediaPlayer – Taking Screenshot - GeeksforGeeks
18 Aug, 2020 In this article we will see how we can take screen shot of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cross-platform media player software and streaming media server developed by the VideoLAN project. MediPlyer object is the basic object in vlc modu...
[ { "code": null, "e": 25995, "s": 25967, "text": "\n18 Aug, 2020" }, { "code": null, "e": 26636, "s": 25995, "text": "In this article we will see how we can take screen shot of the MediaPlayer object in the python vlc module. VLC media player is a free and open-source portable cro...
OpenCV - Rotation
You can perform rotation operation on an image using the warpAffine() method of the imgproc class. Following is the syntax of this method − Imgproc.warpAffine(src, dst, rotationMatrix, size); This method accepts the following parameters − src − A Mat object representing the source (input image) for this operation. src...
[ { "code": null, "e": 3144, "s": 3004, "text": "You can perform rotation operation on an image using the warpAffine() method of the imgproc class. Following is the syntax of this method −" }, { "code": null, "e": 3197, "s": 3144, "text": "Imgproc.warpAffine(src, dst, rotationMatri...
Flipping an Image in Python
Suppose we have a binary matrix A, this is the representation of an image, we want to flip the image horizontally, after that invert it, and finally return the resulting image. To flip the image horizontally each row of the image will be reversed. And to invert the image each 0 will be replaced by 1, and each 1 will be...
[ { "code": null, "e": 1398, "s": 1062, "text": "Suppose we have a binary matrix A, this is the representation of an image, we want to flip the image horizontally, after that invert it, and finally return the resulting image. To flip the image horizontally each row of the image will be reversed. And t...
new vs operator new in C++ - GeeksforGeeks
23 Jun, 2017 When you create a new object, memory is allocated using operator new function and then the constructor is invoked to initialize the memory. Here, The new operator does both the allocation and the initialization, where as the operator new only does the allocation.Let us see how these both work individually....
[ { "code": null, "e": 25918, "s": 25890, "text": "\n23 Jun, 2017" }, { "code": null, "e": 26226, "s": 25918, "text": "When you create a new object, memory is allocated using operator new function and then the constructor is invoked to initialize the memory. Here, The new operator ...
Validate Date in MySQL using a custom function
Let us create a custom function to validate date in MySQL − mysql> set global log_bin_trust_function_creators=1; Query OK, 0 rows affected (0.03 sec) mysql> delimiter // mysql> create function isValidDate(actualDate varchar(255)) returns int -> begin -> declare flag int; -> if (select length(date(actualDate)) ...
[ { "code": null, "e": 1122, "s": 1062, "text": "Let us create a custom function to validate date in MySQL −" }, { "code": null, "e": 1560, "s": 1122, "text": "mysql> set global log_bin_trust_function_creators=1;\nQuery OK, 0 rows affected (0.03 sec)\nmysql> delimiter //\nmysql> cr...
Field setBoolean() method in Java with Examples - GeeksforGeeks
26 Aug, 2019 The setBoolean() method of java.lang.reflect.Field used to set the value of a field as a boolean on the specified object. When you need to set the value of a field of an object as boolean then you can use this method to set value over an Object. Syntax: public void setBoolean(Object obj, boolean z) ...
[ { "code": null, "e": 25817, "s": 25789, "text": "\n26 Aug, 2019" }, { "code": null, "e": 26063, "s": 25817, "text": "The setBoolean() method of java.lang.reflect.Field used to set the value of a field as a boolean on the specified object. When you need to set the value of a field...
Subsequence with maximum odd sum - GeeksforGeeks
07 Oct, 2021 Given a set of integers, check whether there is a subsequence with odd sum and if yes, then finding the maximum odd sum. If no subsequence contains odd sum, return -1. Examples : Input : arr[] = {2, 5, -4, 3, -1}; Output : 9 The subsequence with maximum odd sum is 2, 5, 3 and -1. Input : arr[] = {4, -3,...
[ { "code": null, "e": 26177, "s": 26149, "text": "\n07 Oct, 2021" }, { "code": null, "e": 26345, "s": 26177, "text": "Given a set of integers, check whether there is a subsequence with odd sum and if yes, then finding the maximum odd sum. If no subsequence contains odd sum, return...
Elixir - File IO
File IO is an integral part of any programming language as it allows the language to interact with the files on the file system. In this chapter, we will discuss two modules − Path and File. The path module is a very small module that can be considered as a helper module for filesystem operations. The majority of the f...
[ { "code": null, "e": 2373, "s": 2182, "text": "File IO is an integral part of any programming language as it allows the language to interact with the files on the file system. In this chapter, we will discuss two modules − Path and File." }, { "code": null, "e": 2982, "s": 2373, ...
Distinct permutations of the string | Set 2 - GeeksforGeeks
17 Apr, 2022 Print all distinct permutations of a string having duplicates. Examples: Input : ABCA Output : AABC AACB ABAC ABCA ACBA ACAB BAAC BACA BCAA CABA CAAB CBAA An algorithm to print all distinct permutations has already been discussed here. Here we’ll discuss one more approach to do the sa...
[ { "code": null, "e": 24661, "s": 24633, "text": "\n17 Apr, 2022" }, { "code": null, "e": 24724, "s": 24661, "text": "Print all distinct permutations of a string having duplicates." }, { "code": null, "e": 24736, "s": 24724, "text": "Examples: " }, { "...
Generating random Id’s in Python
We use to generate a random number in our project for a sample data, which later can be used for testing, filled empty columns or for many other purposes, the key thing is we need to generate random data. In python, there are numerous ways to generate random data and we're going to explore some of them here in this art...
[ { "code": null, "e": 1389, "s": 1062, "text": "We use to generate a random number in our project for a sample data, which later can be used for testing, filled empty columns or for many other purposes, the key thing is we need to generate random data. In python, there are numerous ways to generate r...
Do you think Python Dictionary is really Mutable?
Yes, Python Dictionary is mutable. Changing references to keys doesn't lead to the creation of new dictionaries. Rather it updates the current dictionary in place. a = {'foo': 1, 'bar': 12} b = a b['foo'] = 20 print(a) print(b) This will give the output − {'foo': 20, 'bar': 12} {'foo': 20, 'bar': 12}
[ { "code": null, "e": 1227, "s": 1062, "text": "Yes, Python Dictionary is mutable. Changing references to keys doesn't lead to the creation of new dictionaries. Rather it updates the current dictionary in place. " }, { "code": null, "e": 1292, "s": 1227, "text": "a = {'foo': 1, 'b...
Difference between Inline and Macro in C++ - GeeksforGeeks
28 Jun, 2020 1. Inline :An inline function is a normal function that is defined by the inline keyword. An inline function is a short function that is expanded by the compiler. And its arguments are evaluated only once. An inline functions are the short length functions that are automatically made the inline functions w...
[ { "code": null, "e": 24042, "s": 24014, "text": "\n28 Jun, 2020" }, { "code": null, "e": 24399, "s": 24042, "text": "1. Inline :An inline function is a normal function that is defined by the inline keyword. An inline function is a short function that is expanded by the compiler. ...
Timer in C#
The namespace used to set a timer is System. Timers. The Timer class generates an event after a set interval, with an option to generate recurring events. Firstly, create a timer object for 5 seconds interval − timer = new System.Timers.Timer(5000); Set elapsed event for the timer. This occurs when the interval elapses...
[ { "code": null, "e": 1217, "s": 1062, "text": "The namespace used to set a timer is System. Timers. The Timer class generates an event after a set interval, with an option to generate recurring events." }, { "code": null, "e": 1273, "s": 1217, "text": "Firstly, create a timer obj...
6 Examples to Master Python Generators | by Soner Yıldırım | Towards Data Science
The generators in Python are one of those tools that we frequently use but do not talk about much. For instance, most for loops are accompanied with the range function which is a generator. Generators allow for generating a sequence of values over time. The main advantage of using a generator is that we do not have to ...
[ { "code": null, "e": 362, "s": 172, "text": "The generators in Python are one of those tools that we frequently use but do not talk about much. For instance, most for loops are accompanied with the range function which is a generator." }, { "code": null, "e": 641, "s": 362, "text...
Identifying Outliers with Local Outlier Probabilities | by Valentino Constantinou | Towards Data Science
Locating outliers is important in a variety of data science tasks, from performing predictive modeling to determining outliers in historical data. Many types of approaches exist to identifying outliers in your data. Local Outlier Probabilities, or LoOP, is just one approach. While not capable of detecting more complex ...
[ { "code": null, "e": 665, "s": 172, "text": "Locating outliers is important in a variety of data science tasks, from performing predictive modeling to determining outliers in historical data. Many types of approaches exist to identifying outliers in your data. Local Outlier Probabilities, or LoOP, i...
Java & MySQL - Sample Code
This chapter provides an example of how to create a simple java based application to access MySQL database. This will show you how to open a database connection, execute a SQL query, and display the results. All the steps mentioned in this template example, would be explained in subsequent chapters of this tutorial. Th...
[ { "code": null, "e": 2894, "s": 2686, "text": "This chapter provides an example of how to create a simple java based application to access MySQL database. This will show you how to open a database connection, execute a SQL query, and display the results." }, { "code": null, "e": 3004, ...
What does abstract modifier in Java do?
An abstract keyword is used to declare methods abstract methods and abstract classes. Once a method is declared abstract we should not specify body for those. public abstract class Sample{ public abstract demo(){ } } Sample.java:2: error: invalid method declaration; return type required public abstract demo(){...
[ { "code": null, "e": 1221, "s": 1062, "text": "An abstract keyword is used to declare methods abstract methods and abstract classes. Once a method is declared abstract we should not specify body for those." }, { "code": null, "e": 1285, "s": 1221, "text": "public abstract class S...
How to display animated gif images in Android?
This example demonstrates how do I display animated gif images in android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Add the following dependency in build.gradle: Module: app implementation 'com.github.bumptech.glide:glide:4.9.0' Ste...
[ { "code": null, "e": 1137, "s": 1062, "text": "This example demonstrates how do I display animated gif images in android." }, { "code": null, "e": 1266, "s": 1137, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to ...
Updating Strings in Python
You can "update" an existing string by (re)assigning a variable to another string. The new value can be related to its previous value or to a completely different string altogether. For example − Live Demo #!/usr/bin/python var1 = 'Hello World!' print "Updated String :- ", var1[:6] + 'Python' When the above code is ex...
[ { "code": null, "e": 1258, "s": 1062, "text": "You can \"update\" an existing string by (re)assigning a variable to another string. The new value can be related to its previous value or to a completely different string altogether. For example −" }, { "code": null, "e": 1269, "s": 125...
Graph Attention Networks Under the Hood | by Giuseppe Futia | Towards Data Science
Graph Neural Networks (GNNs) have emerged as the standard toolbox to learn from graph data. GNNs are able to drive improvements for high-impact problems in different fields, such as content recommendation or drug discovery. Unlike other types of data such as images, learning from graph data requires specific methods. A...
[ { "code": null, "e": 523, "s": 171, "text": "Graph Neural Networks (GNNs) have emerged as the standard toolbox to learn from graph data. GNNs are able to drive improvements for high-impact problems in different fields, such as content recommendation or drug discovery. Unlike other types of data such...
How to use pip to install python modules in easy way?
If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version: On Linux or macOS: pip install -U pip setuptools On Windows: python -m pip install -U pip setuptools If you’re using a Python install on Linux that’s manage...
[ { "code": null, "e": 1226, "s": 1062, "text": "If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version:" }, { "code": null, "e": 1245, "s": 1226, "text": "On Linux or macOS:...
Get the longest and shortest string in an array JavaScript
We have an array of string literals like this − const arr = ['Some', 'random', 'words', 'that', 'actually', 'form', 'a', 'sentence.']; We are required to write a function that returns the longest and the shortest word from this array. We will use Array.prototype.reduce() method to keep track of the longest and shortest...
[ { "code": null, "e": 1110, "s": 1062, "text": "We have an array of string literals like this −" }, { "code": null, "e": 1197, "s": 1110, "text": "const arr = ['Some', 'random', 'words', 'that', 'actually', 'form', 'a',\n'sentence.'];" }, { "code": null, "e": 1431, ...
Extract csv file specific columns to list in Python
To extract csv file for specific columns to list in Python, we can use Pandas read_csv() method. Make a list of columns that have to be extracted. Make a list of columns that have to be extracted. Use read_csv() method to extract the csv file into data frame. Use read_csv() method to extract the csv file into data fram...
[ { "code": null, "e": 1159, "s": 1062, "text": "To extract csv file for specific columns to list in Python, we can use Pandas read_csv() method." }, { "code": null, "e": 1209, "s": 1159, "text": "Make a list of columns that have to be extracted." }, { "code": null, "e"...
Behave - Quick Guide
Behave is a tool used for Behaviour driven development (BDD) in Python programming language. In an Agile development framework, BDD creates a culture where testers, developers, business analysts, and other stakeholders of the project can contribute towards the software development. In short, both technical and non-tech...
[ { "code": null, "e": 2579, "s": 2296, "text": "Behave is a tool used for Behaviour driven development (BDD) in Python programming language. In an Agile development framework, BDD creates a culture where testers, developers, business analysts, and other stakeholders of the project can contribute towa...
How to convert a MySQL date to JavaScript date?
To convert a MySQL date to JavaScript, use Date.parse. You can try to run the following code to convert MySQL date to JavaScript date − Live Demo <!DOCTYPE html> <html> <body> <script> var MySQL_date = '2017-12-31 11:55:17'; document.write("MySQL Date: "+MySQL_date); var jsDate = ne...
[ { "code": null, "e": 1117, "s": 1062, "text": "To convert a MySQL date to JavaScript, use Date.parse." }, { "code": null, "e": 1198, "s": 1117, "text": "You can try to run the following code to convert MySQL date to JavaScript date −" }, { "code": null, "e": 1208, ...