title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
How to convert NumPy array to dictionary in Python? - GeeksforGeeks
23 Feb, 2022 The following article explains how to convert numpy array to dictionary in Python. Array in Numpy is a table of elements (usually numbers), all of the same type, indexed by a tuple of positive integers. In Numpy, number of dimensions of the array is called rank of the array. A tuple of integers giving the ...
[ { "code": null, "e": 24212, "s": 24184, "text": "\n23 Feb, 2022" }, { "code": null, "e": 24752, "s": 24212, "text": "The following article explains how to convert numpy array to dictionary in Python. Array in Numpy is a table of elements (usually numbers), all of the same type, i...
MySQL - TIMESTAMPDIFF() Function
The DATE, DATETIME and TIMESTAMP datatypes in MySQL are used to store the date, date and time, time stamp values respectively. Where a time stamp is a numerical value representing the number of milliseconds from '1970-01-01 00:00:01' UTC (epoch) to the specified time. MySQL provides a set of functions to manipulate the...
[ { "code": null, "e": 2664, "s": 2333, "text": "The DATE, DATETIME and TIMESTAMP datatypes in MySQL are used to store the date, date and time, time stamp values respectively. Where a time stamp is a numerical value representing the number of milliseconds from '1970-01-01 00:00:01' UTC (epoch) to the ...
How to install and configuration ftp server in centos 7
In this article, we will learn how to configure FTP server on CentOs 7 using ‘vsftpd’. ‘vsftpd’ (Very Secure File Transport Protocol Daemon) is a secure and very fast FTP server on Linux systems. Below is the command to install the ‘vsftpd’, we needed a root user to run the following command # yum install vsftp ftp –y ...
[ { "code": null, "e": 1258, "s": 1062, "text": "In this article, we will learn how to configure FTP server on CentOs 7 using ‘vsftpd’. ‘vsftpd’ (Very Secure File Transport Protocol Daemon) is a secure and very fast FTP server on Linux systems." }, { "code": null, "e": 1355, "s": 1258,...
Dates in Tableau. This post will be useful for those who... | by Amanda Monzon | Towards Data Science
This post will be useful for those who are working with financial data or anyone who is tracking how the business is doing compared to last years numbers. User wants to track how sales are doing to the previous year on a macro and micro level (YTD, Day YOY). Switch between date fields — when working with financial data...
[ { "code": null, "e": 327, "s": 172, "text": "This post will be useful for those who are working with financial data or anyone who is tracking how the business is doing compared to last years numbers." }, { "code": null, "e": 431, "s": 327, "text": "User wants to track how sales a...
JUnit - Executing Tests
The test cases are executed using JUnitCore class. JUnitCore is a facade for running tests. It supports running JUnit 4 tests, JUnit 3.8.x tests, and mixtures. To run tests from the command line, run java org.junit.runner.JUnitCore <TestClass>. For one-shot test runs, use the static method runClasses(Class[]). Followin...
[ { "code": null, "e": 2284, "s": 1972, "text": "The test cases are executed using JUnitCore class. JUnitCore is a facade for running tests. It supports running JUnit 4 tests, JUnit 3.8.x tests, and mixtures. To run tests from the command line, run java org.junit.runner.JUnitCore <TestClass>. For one-...
What is Docker Images?
09 Jun, 2022 Docker Image is an executable package of software that includes everything needed to run an application. This image informs how a container should instantiate, determining which software components will run and how. Docker Container is a virtual environment that bundles application code with all the depend...
[ { "code": null, "e": 53, "s": 25, "text": "\n09 Jun, 2022" }, { "code": null, "e": 485, "s": 53, "text": "Docker Image is an executable package of software that includes everything needed to run an application. This image informs how a container should instantiate, determining wh...
Can a try block have multiple catch blocks in Java?
Yes, you can have multiple catch blocks for a single try block. The following Java program contains an array of numbers (which is displayed). from user it accepts two positions from this array and, divides the number in first position with the number in second position. While entering values − If you choose a position ...
[ { "code": null, "e": 1251, "s": 1187, "text": "Yes, you can have multiple catch blocks for a single try block." }, { "code": null, "e": 1458, "s": 1251, "text": "The following Java program contains an array of numbers (which is displayed). from user it accepts two positions from ...
turtle.degrees() function in Python
01 Aug, 2020 The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a version of Python installed with Tk support. This method is used to set angle measurement units to degrees. By default the angle measur...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Aug, 2020" }, { "code": null, "e": 245, "s": 28, "text": "The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses tkinter for the underlying graphics, it needs a ver...
Create a Quiz App using ReactJS
08 Oct, 2020 React is a JavaScript library used to develop interactive user interfaces. It is managed by Facebook and a community of individual developers and companies. react mainly focus on developing single-page web or mobile applications. here, we will create a quiz app to understand the basics of reactjs. Modules ...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Oct, 2020" }, { "code": null, "e": 351, "s": 52, "text": "React is a JavaScript library used to develop interactive user interfaces. It is managed by Facebook and a community of individual developers and companies. react mainly focu...
HTTP headers | X-Content-Type-Options
14 Sep, 2021 The HTTP headers X-Content-Type-Options acts as a marker that indicates the MIME-types headers in the content types headers should not be changed to the server. This header was introduced in the Internet Explorer 8 of Microsoft. This header block the content sniffing (non-executable MIME type into executab...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Sep, 2021" }, { "code": null, "e": 486, "s": 28, "text": "The HTTP headers X-Content-Type-Options acts as a marker that indicates the MIME-types headers in the content types headers should not be changed to the server. This header wa...
How to add a column in an R data frame with consecutive numbers?
Addition of a column with consecutive might have different objectives such as getting the sequence of numbers, representing serial numbers, representing ids, identification of each row, or a variable. We can use the sequence starting from any number up to the number of rows if we know the number of rows for this purpos...
[ { "code": null, "e": 1510, "s": 1187, "text": "Addition of a column with consecutive might have different objectives such as getting the sequence of numbers, representing serial numbers, representing ids, identification of each row, or a variable. We can use the sequence starting from any number up ...
Python String lstrip() Method
Python string method lstrip() returns a copy of the string in which all chars have been stripped from the beginning of the string (default whitespace characters). Following is the syntax for lstrip() method − str.lstrip([chars]) chars − You can supply what chars have to be trimmed. chars − You can supply what chars h...
[ { "code": null, "e": 2542, "s": 2378, "text": "Python string method lstrip() returns a copy of the string in which all chars have been stripped from the beginning of the string (default whitespace characters)." }, { "code": null, "e": 2588, "s": 2542, "text": "Following is the s...
Software Testing | Static Testing
13 May, 2019 Static Testing is a type of a Software Testing method which is performed to check the defects in software without actually executing the code of the software application. Whereas in Dynamic Testing checks the code is executed to detect the defects. Static testing is performed in early stage of development ...
[ { "code": null, "e": 53, "s": 25, "text": "\n13 May, 2019" }, { "code": null, "e": 302, "s": 53, "text": "Static Testing is a type of a Software Testing method which is performed to check the defects in software without actually executing the code of the software application. Whe...
What are the differences between compareTo() and compare() methods in Java?
The Comparable interface provides a compareTo() method for the ordering of objects. This ordering is called the class’s natural ordering and the compareTo() method is called its natural comparison method. The Comparator interface provides the methods for performing sorting operations. By using the Comparator interface ...
[ { "code": null, "e": 1608, "s": 1187, "text": "The Comparable interface provides a compareTo() method for the ordering of objects. This ordering is called the class’s natural ordering and the compareTo() method is called its natural comparison method. The Comparator interface provides the methods fo...
Java Program to Print Left Triangle Star Pattern
06 Jun, 2022 In this article, we will learn about printing Left Triangle Star Pattern. Examples: Input : n = 5 Output: * * * * * * * * * * * * * * * Left Triangle Star Pattern: Java import java.io.*; // java program for left trianglepublic class GFG { // Function to demonstra...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Jun, 2022" }, { "code": null, "e": 126, "s": 52, "text": "In this article, we will learn about printing Left Triangle Star Pattern." }, { "code": null, "e": 136, "s": 126, "text": "Examples:" }, { "code":...
Negative transformation of an image using Python and OpenCV
11 Mar, 2020 Image is also known as a set of pixels. When we store an image in computers or digitally, it’s corresponding pixel values are stored. So, when we read an image to a variable using OpenCV in Python, the variable stores the pixel values of the image. When we try to negatively transform an image, the brightes...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Mar, 2020" }, { "code": null, "e": 434, "s": 28, "text": "Image is also known as a set of pixels. When we store an image in computers or digitally, it’s corresponding pixel values are stored. So, when we read an image to a variable u...
Minimum Platforms | Practice | GeeksforGeeks
Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept waiting. Consider that all the trains arrive on the same day and leave on the same day. Arrival and departure time can never be the same for a trai...
[ { "code": null, "e": 805, "s": 238, "text": "Given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept waiting.\nConsider that all the trains arrive on the same day and leave on the sam...
Moment.js moment().diff() Function
29 Jul, 2020 The moment().diff() function is used to get the difference in milliseconds of given dates which are passed as parameter to this function. Syntax: moment().diff(Moment|String|Number|Date|Array, String, Boolean); Parameters: This function has two parameters, first one is the date of type Moment|String|Number...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Jul, 2020" }, { "code": null, "e": 166, "s": 28, "text": "The moment().diff() function is used to get the difference in milliseconds of given dates which are passed as parameter to this function." }, { "code": null, "e": ...
Python | Split a list having single integer
28 Feb, 2019 Given a list containing single integer, the task is to split each value in the list. Examples: Input: Input = [23] Output: Output = [2, 3] Input: Input = [15478] Output: Output = [1, 5, 4, 7, 8] Method #1 : Using Map # Python code to split list containing single integer # List initializationinput = [2...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Feb, 2019" }, { "code": null, "e": 113, "s": 28, "text": "Given a list containing single integer, the task is to split each value in the list." }, { "code": null, "e": 123, "s": 113, "text": "Examples:" }, { ...
Virtual Functions in Derived Classes in C++
16 May, 2022 A virtual function is a member function of a base class that is overridden by a derived class. When you use a pointer or a reference to the base class to refer to a derived class object, you can call a virtual function for that object and have it run the derived class’s version of the function. In C++, onc...
[ { "code": null, "e": 52, "s": 24, "text": "\n16 May, 2022" }, { "code": null, "e": 348, "s": 52, "text": "A virtual function is a member function of a base class that is overridden by a derived class. When you use a pointer or a reference to the base class to refer to a derived c...
Program to implement t-test
03 May, 2021 The t test (also called Student’s T Test) compares two averages (means) and tells if they are different from each other. The t-test also tells how significant the differences are. In other words it lets you know if those differences could have happened by chance. t-test can be calculated by using formula :...
[ { "code": null, "e": 54, "s": 26, "text": "\n03 May, 2021" }, { "code": null, "e": 363, "s": 54, "text": "The t test (also called Student’s T Test) compares two averages (means) and tells if they are different from each other. The t-test also tells how significant the differences...
Pytest - Run Tests in Parallel
By default, pytest runs tests in sequential order. In a real scenario, a test suite will have a number of test files and each file will have a bunch of tests. This will lead to a large execution time. To overcome this, pytest provides us with an option to run tests in parallel. For this, we need to first install the py...
[ { "code": null, "e": 2455, "s": 2176, "text": "By default, pytest runs tests in sequential order. In a real scenario, a test suite will have a number of test files and each file will have a bunch of tests. This will lead to a large execution time. To overcome this, pytest provides us with an option ...
Kali Linux – Command Line Essentials
26 May, 2022 Command-line plays a vital role while working with Kali Linux as most of its tools don’t have a Graphical User Interface and if you are performing ethical hacking or penetration testing then most of the time you will have to work with command Line Interface itself. While executing a command in Kali Linux w...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 May, 2022" }, { "code": null, "e": 454, "s": 28, "text": "Command-line plays a vital role while working with Kali Linux as most of its tools don’t have a Graphical User Interface and if you are performing ethical hacking or penetrati...
How to get integer values from a string in Python?
You can use regular expressions to get all integer values in order of their occurance in an array. You can use the following code to get those values - import re s = "12 hello 52 19 some random 15 number" # Extract numbers and cast them to int list_of_nums = map(int, re.findall('\d+', s)) print list_of_nums [12, 52, 19...
[ { "code": null, "e": 1339, "s": 1187, "text": "You can use regular expressions to get all integer values in order of their occurance in an array. You can use the following code to get those values -" }, { "code": null, "e": 1496, "s": 1339, "text": "import re\ns = \"12 hello 52 1...
Flexbox - Justifying Contents
Often you can observe an extra space left in the container after arranging the flex items as shown below. Using the property justify-content, you can align the contents along the main axis by distributing the extra space as intended. You can also adjust the alignment of the flexitems, in case they overflow the line. us...
[ { "code": null, "e": 2051, "s": 1945, "text": "Often you can observe an extra space left in the container after arranging the flex items as shown below." }, { "code": null, "e": 2263, "s": 2051, "text": "Using the property justify-content, you can align the contents along the mai...
D3.js - Geographies
Geospatial coordinates are often used for weather or population data. D3.js gives us three tools for geographic data − Paths − They produce the final pixels. Paths − They produce the final pixels. Projections − They turn sphere coordinates into Cartesian coordinates and Projections − They turn sphere coordinates into ...
[ { "code": null, "e": 2383, "s": 2264, "text": "Geospatial coordinates are often used for weather or population data. D3.js gives us three tools for geographic data −" }, { "code": null, "e": 2422, "s": 2383, "text": "Paths − They produce the final pixels." }, { "code": nu...
C# | FlowLayoutPanel Class
15 Nov, 2021 In Windows Forms, FlowLayoutPanel control is used to arrange its child controls in a horizontal or vertical flow direction. Or in other words, FlowLayoutPanel is a container which is used to organize different or same types of controls in it either horizontally or vertically. The FlowLayoutPanel class is u...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 Nov, 2021" }, { "code": null, "e": 588, "s": 28, "text": "In Windows Forms, FlowLayoutPanel control is used to arrange its child controls in a horizontal or vertical flow direction. Or in other words, FlowLayoutPanel is a container w...
Tree of Space – Locking and Unlocking N-Ary Tree
21 Nov, 2021 Given a world map in the form of Generic M-ary Tree consisting of N nodes and an array queries[], the task is to implement the functions Lock, Unlock and Upgrade for the given tree. For each query in queries[], the functions return true when the operation is performed successfully, otherwise it returns fal...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Nov, 2021" }, { "code": null, "e": 394, "s": 52, "text": "Given a world map in the form of Generic M-ary Tree consisting of N nodes and an array queries[], the task is to implement the functions Lock, Unlock and Upgrade for the give...
Multiple regression as a machine learning algorithm | by Mahbubul Alam | Towards Data Science
Previously I wrote a couple of pieces on multivariate modeling but they both focused on time series forecasting. If curious, go ahead and check out the posts on vector autoregression and panel data modeling. Writing on multivariate regression (i.e. multiple linear regression) was always on my list but something else wa...
[ { "code": null, "e": 638, "s": 172, "text": "Previously I wrote a couple of pieces on multivariate modeling but they both focused on time series forecasting. If curious, go ahead and check out the posts on vector autoregression and panel data modeling. Writing on multivariate regression (i.e. multip...
What is an object in Python? Explain with examples
A python is an object-oriented programming language. Almost everything in Python is considered as an object. An object has its own properties(attributes) and behavior(methods). A class is a blueprint of the objects or can be termed as object constructor for creating objects. One class can have many objects and value of...
[ { "code": null, "e": 1239, "s": 1062, "text": "A python is an object-oriented programming language. Almost everything in Python is considered as an object. An object has its own properties(attributes) and behavior(methods)." }, { "code": null, "e": 1338, "s": 1239, "text": "A cla...
ReactJS | Keys
11 May, 2022 In the previous article on ReactJS | Lists, we had discussed Keys and also told why they are needed while creating lists. We will continue the discussion further in this article. A “key” is a special string attribute you need to include when creating lists of elements in React. Keys are used to React to id...
[ { "code": null, "e": 52, "s": 24, "text": "\n11 May, 2022" }, { "code": null, "e": 231, "s": 52, "text": "In the previous article on ReactJS | Lists, we had discussed Keys and also told why they are needed while creating lists. We will continue the discussion further in this arti...
Number of words in a camelcase sequence
03 May, 2021 CamelCase is the sequence of one or more than one words having the following properties: It is a concatenation of one or more words consisting of English letters.All letters in the first word are lowercase.For each of the subsequent words, the first letter is uppercase and rest of the letters are lowerca...
[ { "code": null, "e": 52, "s": 24, "text": "\n03 May, 2021" }, { "code": null, "e": 143, "s": 52, "text": "CamelCase is the sequence of one or more than one words having the following properties: " }, { "code": null, "e": 363, "s": 143, "text": "It is a concat...
Program for triangular pattern (mirror image around 0)
18 Jun, 2022 Given the value of n, print the pattern.Examples : Input : n = 5 Output : 0 101 21012 3210123 432101234 Input : n = 7 Output : 0 101 21012 3210123 432101234 54321012345 6543210123456 Below is the program to print the above pattern C++ Java Python3 C# PHP Javascript /...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 Jun, 2022" }, { "code": null, "e": 105, "s": 52, "text": "Given the value of n, print the pattern.Examples : " }, { "code": null, "e": 271, "s": 105, "text": "Input : n = 5\nOutput : \n 0\n 101\n 21012\n 3...
How to set the Background Color of the RadioButton in C#?
30 Jun, 2019 In Windows Forms, RadioButton control is used to select a single option among the group of the options. For example, select your gender from the given list, so you will choose only one option among three options like Male or Female or Transgender. In Windows Forms, you are allowed to adjust the background ...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Jun, 2019" }, { "code": null, "e": 503, "s": 28, "text": "In Windows Forms, RadioButton control is used to select a single option among the group of the options. For example, select your gender from the given list, so you will choose...
SQL – Logical Operators
18 Oct, 2021 SQL logical operators are used to test for the truth of the condition. A logical operator like the Comparison operator returns a boolean value of TRUE, FALSE, or UNKNOWN. Given below is the list of logical operators available in SQL. In the below example, we will see how this logical operator works. Step 1...
[ { "code": null, "e": 53, "s": 25, "text": "\n18 Oct, 2021" }, { "code": null, "e": 224, "s": 53, "text": "SQL logical operators are used to test for the truth of the condition. A logical operator like the Comparison operator returns a boolean value of TRUE, FALSE, or UNKNOWN." ...
Composite Design Pattern
01 Sep, 2021 Composite pattern is a partitioning design pattern and describes a group of objects that is treated the same way as a single instance of the same type of object. The intent of a composite is to “compose” objects into tree structures to represent part-whole hierarchies. It allows you to have a tree structur...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Sep, 2021" }, { "code": null, "e": 420, "s": 52, "text": "Composite pattern is a partitioning design pattern and describes a group of objects that is treated the same way as a single instance of the same type of object. The intent o...
Move first element to end of a given Linked List
24 Jun, 2021 Write a C function that moves first element to end in a given Singly Linked List. For example, if the given Linked List is 1->2->3->4->5, then the function should change the list to 2->3->4->5->1. Algorithm: Traverse the list till last node. Use two pointers: one to store the address of last node(last) an...
[ { "code": null, "e": 53, "s": 25, "text": "\n24 Jun, 2021" }, { "code": null, "e": 250, "s": 53, "text": "Write a C function that moves first element to end in a given Singly Linked List. For example, if the given Linked List is 1->2->3->4->5, then the function should change the ...
Queries of nCr%p in O(1) time complexity
19 Jan, 2022 Given Q queries and P where P is a prime number, each query has two numbers N and R and the task is to calculate nCr mod p. Constraints: N <= 106 R <= 106 p is a prime number Examples: Input: Q = 2 p = 1000000007 1st query: N = 15, R = 4 2nd query: N = 20, R = 3 Output: 1st query: 1365 2nd query: 1140 15!...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Jan, 2022" }, { "code": null, "e": 190, "s": 52, "text": "Given Q queries and P where P is a prime number, each query has two numbers N and R and the task is to calculate nCr mod p. Constraints: " }, { "code": null, "e":...
How to Copy or Append HashSet to Another HashSet in Java?
15 Dec, 2020 HashSet is used to store distinct values in Java. HashSet stores the elements in random order, so there is no guarantee of the elements’ order. The HashSet class implements the Set interface, backed by a hash table which is actually a HashMap instance. We can copy or append a HashSet to another HashSet. T...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 Dec, 2020" }, { "code": null, "e": 282, "s": 28, "text": "HashSet is used to store distinct values in Java. HashSet stores the elements in random order, so there is no guarantee of the elements’ order. The HashSet class implements th...
Laplace Transform in MATLAB
21 Apr, 2021 In this article, we will see how to find Laplace Transform in MATLAB. Laplace Transform helps to simplify problems that involve Differential Equations into algebraic equations. As the name suggests, it transforms the time-domain function f(t) into Laplace domain function F(s). Using the above function on...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Apr, 2021" }, { "code": null, "e": 330, "s": 52, "text": "In this article, we will see how to find Laplace Transform in MATLAB. Laplace Transform helps to simplify problems that involve Differential Equations into algebraic equation...
BlockingQueue Interface in Java
15 Sep, 2021 The BlockingQueue interface in Java is added in Java 1.5 along with various other concurrent Utility classes like ConcurrentHashMap, Counting Semaphore, CopyOnWriteArrrayList, etc. BlockingQueue interface supports flow control (in addition to queue) by introducing blocking if either BlockingQueue is full o...
[ { "code": null, "e": 52, "s": 24, "text": "\n15 Sep, 2021" }, { "code": null, "e": 1190, "s": 52, "text": "The BlockingQueue interface in Java is added in Java 1.5 along with various other concurrent Utility classes like ConcurrentHashMap, Counting Semaphore, CopyOnWriteArrrayLis...
How to run a node.js application permanently ?
03 Feb, 2021 NodeJS is a runtime environment on a V8 engine for executing JavaScript code with some additional functionality that allows the development of fast and scalable web applications but we can’t run the Node.js application locally after closing the terminal or Application, to run the nodeJS application permane...
[ { "code": null, "e": 53, "s": 25, "text": "\n03 Feb, 2021" }, { "code": null, "e": 623, "s": 53, "text": "NodeJS is a runtime environment on a V8 engine for executing JavaScript code with some additional functionality that allows the development of fast and scalable web applicati...
CSS | rgb() Function
04 Dec, 2018 The rgb() function is an inbuilt function in CSS which is used to define the colors using the Red Green Blue (RGB) model. Syntax: rgb( red, green, blue ) Parameters: This function accepts three parameters as mentioned above and described below: red: This parameter is used to define the intensity of red col...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Dec, 2018" }, { "code": null, "e": 150, "s": 28, "text": "The rgb() function is an inbuilt function in CSS which is used to define the colors using the Red Green Blue (RGB) model." }, { "code": null, "e": 158, "s": 15...
Construct a Binary Tree from Postorder and Inorder
18 May, 2022 Given Postorder and Inorder traversals, construct the tree. Examples: Input: in[] = {2, 1, 3} post[] = {2, 3, 1} Output: Root of below tree 1 / \ 2 3 Input: in[] = {4, 8, 2, 5, 1, 6, 3, 7} post[] = {8, 4, 5, 2, 6, 7, 3, 1} Output: Root of below tree 1 / ...
[ { "code": null, "e": 54, "s": 26, "text": "\n18 May, 2022" }, { "code": null, "e": 114, "s": 54, "text": "Given Postorder and Inorder traversals, construct the tree." }, { "code": null, "e": 125, "s": 114, "text": "Examples: " }, { "code": null, "e...
Python – Difference between json.dump() and json.dumps()
02 Jun, 2022 JSON is a lightweight data format for data interchange which can be easily read and written by humans, easily parsed and generated by machines. It is a complete language-independent text format. To work with JSON data, Python has a built-in package called json. Note: For more information, refer to Working...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Jun, 2022" }, { "code": null, "e": 291, "s": 28, "text": "JSON is a lightweight data format for data interchange which can be easily read and written by humans, easily parsed and generated by machines. It is a complete language-indep...
Deploy Keras Models using TensorFlow Serving — TF 2.x | by Pranit Bankar | Towards Data Science
Created a great Deep Learning model? Congratulations! Don’t know how to create a Deep Learning model using Keras? No worries! I shall cover how to create a basic and super simple Keras Model and how to deploy it on your local machine. This model would definitely be simpler than whatever you plan to deploy (well, I hope...
[ { "code": null, "e": 226, "s": 172, "text": "Created a great Deep Learning model? Congratulations!" }, { "code": null, "e": 298, "s": 226, "text": "Don’t know how to create a Deep Learning model using Keras? No worries!" }, { "code": null, "e": 630, "s": 298, ...
Hibernate - Native SQL
You can use native SQL to express database queries if you want to utilize database-specific features such as query hints or the CONNECT keyword in Oracle. Hibernate 3.x allows you to specify handwritten SQL, including stored procedures, for all create, update, delete, and load operations. Your application will create a...
[ { "code": null, "e": 2353, "s": 2063, "text": "You can use native SQL to express database queries if you want to utilize database-specific features such as query hints or the CONNECT keyword in Oracle. Hibernate 3.x allows you to specify handwritten SQL, including stored procedures, for all create, ...
BillCipher – An Information Gathering Tool in Kali Linux - GeeksforGeeks
27 Apr, 2021 BillCipher is a free and open-source tool available on Github. BillCipher is based upon Open Source Intelligence (OSINT), the easiest and useful tool for reconnaissance. BillCipher interface is very similar to Metasploit 1 and Metasploit 2. This tool provides a command-line interface that you can run on Ka...
[ { "code": null, "e": 24179, "s": 24151, "text": "\n27 Apr, 2021" }, { "code": null, "e": 25060, "s": 24179, "text": "BillCipher is a free and open-source tool available on Github. BillCipher is based upon Open Source Intelligence (OSINT), the easiest and useful tool for reconnais...
Program to check a number is power of two or not in Python
Suppose we have a number n. We have to check whether this is power of 2 or not. So, if the input is like n = 2048, then the output will be True as 2048 is 2^11. To solve this, we will follow these steps − if n is same as 0, thenreturn False if n is same as 0, then return False return False return true when (n AND (n - ...
[ { "code": null, "e": 1142, "s": 1062, "text": "Suppose we have a number n. We have to check whether this is power of 2 or not." }, { "code": null, "e": 1223, "s": 1142, "text": "So, if the input is like n = 2048, then the output will be True as 2048 is 2^11." }, { "code":...
Simple Plotly Tutorials. Creating Beautiful Animated Maps | by Gabrielgilling | Towards Data Science
Animated maps are an efficient way to visualize and communicate data with geographic properties. In this tutorial, you will learn how to deploy the Plotly Express package in Python to quickly make beautiful maps with interactive features. Plotly is one of the fastest growing visualization libraries available for data s...
[ { "code": null, "e": 410, "s": 171, "text": "Animated maps are an efficient way to visualize and communicate data with geographic properties. In this tutorial, you will learn how to deploy the Plotly Express package in Python to quickly make beautiful maps with interactive features." }, { "c...
Python | Pandas dataframe.cumprod()
16 Nov, 2018 Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.cumprod() is used to find the cumulative product of the values seen so far o...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Nov, 2018" }, { "code": null, "e": 242, "s": 28, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp...
How to make a beep sound in JavaScript ?
13 Mar, 2020 A beep sound in a website can be used for the following tasks: Alert notification Make the website more interactive There can be many more use cases of these sounds. It all depends on one’s creativity and needs. Usually, we create a function in Javascript and call that function whenever required. In this t...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Mar, 2020" }, { "code": null, "e": 91, "s": 28, "text": "A beep sound in a website can be used for the following tasks:" }, { "code": null, "e": 110, "s": 91, "text": "Alert notification" }, { "code": null...
PHP | preg_match() Function
27 Feb, 2019 This function searches string for pattern, returns true if pattern exists, otherwise returns false. Usually search starts from beginning of subject string. The optional parameter offset is used to specify the position from where to start the search. Syntax: int preg_match( $pattern, $input, $matches, $flag...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Feb, 2019" }, { "code": null, "e": 278, "s": 28, "text": "This function searches string for pattern, returns true if pattern exists, otherwise returns false. Usually search starts from beginning of subject string. The optional parame...
How to remove the border of the legend of a chart created by plot function in R?
When we create a chart using plot function and add a legend to that chart, the output of the chart has the legend that is covered with borders. But this breaks the flow of the chart and the area covered by the order make the chart unattractive. Therefore, we can use bty="n" with the legend function and it will remove t...
[ { "code": null, "e": 1532, "s": 1187, "text": "When we create a chart using plot function and add a legend to that chart, the output of the chart has the legend that is covered with borders. But this breaks the flow of the chart and the area covered by the order make the chart unattractive. Therefor...
Java.net.DatagramSocket class in Java
30 Nov, 2021 Datagram socket is a type of network socket which provides connection-less point for sending and receiving packets. Every packet sent from a datagram socket is individually routed and delivered. It can also be used for sending and receiving broadcast messages. Datagram Sockets is the java’s mechanism for p...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Nov, 2021" }, { "code": null, "e": 391, "s": 28, "text": "Datagram socket is a type of network socket which provides connection-less point for sending and receiving packets. Every packet sent from a datagram socket is individually ro...
Fermat’s Last Theorem
23 Jun, 2022 According to Fermat’s Last Theorem, no three positive integers a, b, c satisfy the equation, for any integer value of n greater than 2. For n = 1 and n = 2, the equation have infinitely many solutions. Some solutions for n = 1 are, 2 + 3 = 5 7 + 13 = 20 5 + 6 = 11 10 + 9 = 19 Some solutions for n = 2...
[ { "code": null, "e": 53, "s": 25, "text": "\n23 Jun, 2022" }, { "code": null, "e": 256, "s": 53, "text": "According to Fermat’s Last Theorem, no three positive integers a, b, c satisfy the equation, for any integer value of n greater than 2. For n = 1 and n = 2, the equation have...
Largest connected component on a grid
17 Dec, 2020 Given a grid with different colors in a different cell, each color represented by a different number. The task is to find out the largest connected component on the grid. Largest component grid refers to a maximum set of cells such that you can move from any cell to any other cell in this set by only movin...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 Dec, 2020" }, { "code": null, "e": 415, "s": 52, "text": "Given a grid with different colors in a different cell, each color represented by a different number. The task is to find out the largest connected component on the grid. Lar...
Python | Reverse Geocoding to get location on a map using geographic coordinates
12 Jul, 2021 Reverse geocoding is the process of finding a place or a location address from a given pair of geographic coordinates(latitude and longitude).Modules needed: reverse_geocoder: A Python library for offline reverse geocoding. pprint: A module which helps to "pretty-print" any arbitrary python data structur...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Jul, 2021" }, { "code": null, "e": 188, "s": 28, "text": "Reverse geocoding is the process of finding a place or a location address from a given pair of geographic coordinates(latitude and longitude).Modules needed: " }, { "...
numpy.ndarray.fill() in Python
28 Dec, 2018 numpy.ndarray.fill() method is used to fill the numpy array with a scalar value. If we have to initialize a numpy array with an identical value then we use numpy.ndarray.fill(). Suppose we have to create a NumPy array a of length n, each element of which is v. Then we use this function as a.fill(v). We nee...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Dec, 2018" }, { "code": null, "e": 109, "s": 28, "text": "numpy.ndarray.fill() method is used to fill the numpy array with a scalar value." }, { "code": null, "e": 412, "s": 109, "text": "If we have to initialize ...
Python – Replace Substrings from String List
06 Nov, 2021 Sometimes while working with data, we can have a problem in which we need to perform replace substrings with the mapped string to form a short form of some terms. This kind of problem can have applications in many domains involving data. Let’s discuss certain ways in which this task can be performed. Metho...
[ { "code": null, "e": 54, "s": 26, "text": "\n06 Nov, 2021" }, { "code": null, "e": 356, "s": 54, "text": "Sometimes while working with data, we can have a problem in which we need to perform replace substrings with the mapped string to form a short form of some terms. This kind o...
p5.js | filter() Function
27 Apr, 2021 The filter() function is used to apply filters to the canvas. p5.js has several presets that can be used with different levels of intensity to get the desired effect.Syntax: filter( filterType, filterParam) Parameters: This function accept two parameters as mentioned above and described below: filterTy...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Apr, 2021" }, { "code": null, "e": 204, "s": 28, "text": "The filter() function is used to apply filters to the canvas. p5.js has several presets that can be used with different levels of intensity to get the desired effect.Syntax: ...
Speech Recognition in Hindi using Python
17 May, 2022 We can use Python for Speech Recognition, it is mostly used to recognize English words. However, in this article, we are going to use Python so that it can also recognize Hindi words with the help of the Speech Recognition module. Speech Recognition Module: It is a library with the help of which Python ca...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 May, 2022" }, { "code": null, "e": 284, "s": 52, "text": "We can use Python for Speech Recognition, it is mostly used to recognize English words. However, in this article, we are going to use Python so that it can also recognize Hin...
uDork – Google Hacking Tool
23 Sep, 2021 Google Dorking is the technique used for advanced searching. Google Dorking can be beneficial in victim domain detection or collecting some sensitive data from the target domain, This can be done through automated tools which can decrease the time of old-fashioned searching. uDork is an automated tool dev...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Sep, 2021" }, { "code": null, "e": 305, "s": 28, "text": "Google Dorking is the technique used for advanced searching. Google Dorking can be beneficial in victim domain detection or collecting some sensitive data from the target doma...
Java Program to Empty an ArrayList in Java
14 Dec, 2021 ArrayList class is a resizable array, present in ‘java.util package’. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified (i.e. if you want to append/add or remove element(s) to/from an array, you have to create a new array. However, elements ca...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Dec, 2021" }, { "code": null, "e": 424, "s": 28, "text": "ArrayList class is a resizable array, present in ‘java.util package’. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be ...
current_window_handle driver method – Selenium Python
15 May, 2020 Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout – Navigating links using get method – Selenium Python. Just being able ...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 May, 2020" }, { "code": null, "e": 767, "s": 28, "text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium ...
Simple POST request using the fetch API
25 May, 2020 The fetch() method, like the XMLHttpRequest and Axios request, is used to send the requests to the server. The main difference is that the Fetch API uses Promises, which enables a simpler and cleaner API. You will get the whole Get and Post method using fetch API Syntax: fetch(url, { config }) .then(res =...
[ { "code": null, "e": 53, "s": 25, "text": "\n25 May, 2020" }, { "code": null, "e": 317, "s": 53, "text": "The fetch() method, like the XMLHttpRequest and Axios request, is used to send the requests to the server. The main difference is that the Fetch API uses Promises, which enab...
How to validate Indian driving license number using Regular Expression
27 Jan, 2021 Given string str, the task is to check whether the given string is a valid Indian driving license number or not by using Regular Expression.The valid Indian driving license number must satisfy the following conditions: It should be 16 characters long (including space or hyphen (-)).The driving license num...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Jan, 2021" }, { "code": null, "e": 248, "s": 28, "text": "Given string str, the task is to check whether the given string is a valid Indian driving license number or not by using Regular Expression.The valid Indian driving license nu...
Node.js path.normalize() Method
13 Oct, 2021 The path.normalize() method is used to normalize the given path. Normalization resolves the (.) and (..) segments of the path to their correct form. If the method encounters multiple path separators, it replaces all of them by a single platform-specific path separator. This method preserves all trailing se...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Oct, 2021" }, { "code": null, "e": 345, "s": 28, "text": "The path.normalize() method is used to normalize the given path. Normalization resolves the (.) and (..) segments of the path to their correct form. If the method encounters m...
Practice Questions for Recursion | Set 4
21 Jun, 2022 Question 1 Predict the output of the following program. C++ C Java Python3 C# Javascript #include <iostream>using namespace std; void fun(int x){ if(x > 0) { fun(--x); cout << x <<" "; fun(--x); }} int main(){ int a = 4; fun(a); return 0;} // This code is contributed...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Jun, 2022" }, { "code": null, "e": 111, "s": 54, "text": "Question 1 Predict the output of the following program. " }, { "code": null, "e": 115, "s": 111, "text": "C++" }, { "code": null, "e": 117, ...
File.Replace(String, String, String) Method in C# with Examples
08 Mar, 2021 File.Replace(String, String, String) is an inbuilt File class method that is used to replace the contents of a specified destination file with the contents of a source file then it deletes the source file and creates a backup of the replaced file.Syntax: public static void Replace (string sourceFileName,...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Mar, 2021" }, { "code": null, "e": 285, "s": 28, "text": "File.Replace(String, String, String) is an inbuilt File class method that is used to replace the contents of a specified destination file with the contents of a source file th...
chkconfig command in Linux with Examples
15 May, 2019 chkconfig command is used to list all available services and view or update their run level settings. In simple words it is used to list current startup information of services or any particular service, updating runlevel settings of service and adding or removing service from management. Synopsis: chkconf...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 May, 2019" }, { "code": null, "e": 318, "s": 28, "text": "chkconfig command is used to list all available services and view or update their run level settings. In simple words it is used to list current startup information of service...
Last Minute Notes – Theory of Computation
28 Jun, 2021 See Last Minute Notes on all subjects here. We will discuss the important key points useful for GATE exams in summarized form. For details you may refer this. Finite Automata: It is used to recognize patterns of specific type input. It is the most restricted type of automata which can accept only regular...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Jun, 2021" }, { "code": null, "e": 98, "s": 54, "text": "See Last Minute Notes on all subjects here." }, { "code": null, "e": 213, "s": 98, "text": "We will discuss the important key points useful for GATE exams ...
Draw Rainbow using Turtle Graphics in Python
15 Oct, 2020 Turtle is an inbuilt module in Python. It provides: Drawing using a screen (cardboard).Turtle (pen). Drawing using a screen (cardboard). Turtle (pen). To draw something on the screen, we need to move the turtle (pen), and to move the turtle, there are some functions like the forward(), backward(), etc. Pr...
[ { "code": null, "e": 54, "s": 26, "text": "\n15 Oct, 2020" }, { "code": null, "e": 107, "s": 54, "text": "Turtle is an inbuilt module in Python. It provides: " }, { "code": null, "e": 156, "s": 107, "text": "Drawing using a screen (cardboard).Turtle (pen)." ...
strings.Compare() Function in Golang with Examples
21 Apr, 2020 The Compare() function is an inbuilt function in the Golang programming language which is used to compare two strings. It is used to compare two strings in lexicographical order (order in which the words are arranged alphabetically, similar to the way we search words in dictionary) or to find out if the st...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Apr, 2020" }, { "code": null, "e": 399, "s": 28, "text": "The Compare() function is an inbuilt function in the Golang programming language which is used to compare two strings. It is used to compare two strings in lexicographical ord...
Node.js fs.createReadStream() Method
11 Oct, 2021 The createReadStream() method is an inbuilt application programming interface of fs module which allow you to open up a file/stream and read the data present in it.Syntax: fs.createReadStream( path, options ) Parameters: This method accept two parameters as mentioned above and described below: path: Th...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Oct, 2021" }, { "code": null, "e": 202, "s": 28, "text": "The createReadStream() method is an inbuilt application programming interface of fs module which allow you to open up a file/stream and read the data present in it.Syntax: " ...
How to read a file line by line using node.js ?
20 May, 2020 The ability to read a file line by line allows us to read large files without entirely storing it to the memory. It is useful in saving resources and improves the efficiency of the application. It allows us to look for the information that is required and once the relevant information is found, we can stop...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 May, 2020" }, { "code": null, "e": 394, "s": 28, "text": "The ability to read a file line by line allows us to read large files without entirely storing it to the memory. It is useful in saving resources and improves the efficiency o...
Variables in LISP
16 Oct, 2021 Similar to other languages, in LISP variables are named places that store a particular value, but they are not declared the way you declare variables in C++ or Java i.e you don’t need to mention data-type of variables when declaring them as LISP is dynamically typed. LISP supports two types of variables: L...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Oct, 2021" }, { "code": null, "e": 296, "s": 28, "text": "Similar to other languages, in LISP variables are named places that store a particular value, but they are not declared the way you declare variables in C++ or Java i.e you do...
How to calculate and plot the derivative of a function using Python – Matplotlib ?
24 Feb, 2021 In this article, we will plot the derivative of a function using matplotlib and python. For this we are using some modules in python which are as follows: Matplotlib: Matplotlib is one of the most popular Python packages used for data visualization. It is a cross-platform library for making 2D plots from d...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Feb, 2021" }, { "code": null, "e": 209, "s": 54, "text": "In this article, we will plot the derivative of a function using matplotlib and python. For this we are using some modules in python which are as follows:" }, { "code...
Scala List filterNot() method with example
26 Jul, 2019 The filterNot() method is utilized to select all elements of the list which does not satisfies a stated predicate. Method Definition: def filterNot(p: (A) => Boolean): List[A] Return Type: It returns a new list consisting all the elements of the list which does not satisfies the given predicate. Example #1...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Jul, 2019" }, { "code": null, "e": 143, "s": 28, "text": "The filterNot() method is utilized to select all elements of the list which does not satisfies a stated predicate." }, { "code": null, "e": 204, "s": 143, ...
Python | How to lock Critical Sections
24 Jun, 2019 This article aims how to lock the threads and critical sections in the given program to avoid race conditions. So, using Lock object in the threading library to make mutable objects safe to use by multiple threads. Code #1 : import threading class counter_share: ''' multiple threads can share. ''...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Jun, 2019" }, { "code": null, "e": 243, "s": 28, "text": "This article aims how to lock the threads and critical sections in the given program to avoid race conditions. So, using Lock object in the threading library to make mutable o...
Notifications in Android with Example
01 Jan, 2021 Notification is a kind of message, alert, or status of an application (probably running in the background) that is visible or available in the Android’s UI elements. This application could be running in the background but not in use by the user. The purpose of a notification is to notify the user about a p...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Jan, 2021" }, { "code": null, "e": 542, "s": 52, "text": "Notification is a kind of message, alert, or status of an application (probably running in the background) that is visible or available in the Android’s UI elements. This app...
Program for n’th node from the end of a Linked List
15 Jun, 2022 Given a Linked List and a number n, write a function that returns the value at the n’th node from the end of the Linked List.For example, if the input is below list and n = 3, then output is “B” Method 1 (Use length of linked list) 1) Calculate the length of the Linked List. Let the length be len. 2) Print...
[ { "code": null, "e": 52, "s": 24, "text": "\n15 Jun, 2022" }, { "code": null, "e": 247, "s": 52, "text": "Given a Linked List and a number n, write a function that returns the value at the n’th node from the end of the Linked List.For example, if the input is below list and n = 3...
How to set the cursor to wait in JavaScript ?
18 Aug, 2021 In JavaScript, we could easily set the cursor to wait. In this article, we will see how we are going to do this. Actually, it’s quite an easy task, there is a CSS cursor property and it has some values and one of the values is wait. We will use the [cursor: wait] property of CSS and control its behavior us...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Aug, 2021" }, { "code": null, "e": 352, "s": 28, "text": "In JavaScript, we could easily set the cursor to wait. In this article, we will see how we are going to do this. Actually, it’s quite an easy task, there is a CSS cursor prope...
GATE | GATE CS 2019 | Question 42
18 Feb, 2019 Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8k Band the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128 valid entries. At most ho...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Feb, 2019" }, { "code": null, "e": 479, "s": 28, "text": "Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8k Band...
Remove duplicate elements in an Array using STL in C++
31 May, 2022 Given an array, the task is to remove the duplicate elements from the array using STL in C++ Examples: Input: arr[] = {2, 2, 2, 2, 2} Output: arr[] = {2} Input: arr[] = {1, 2, 2, 3, 4, 4, 4, 5, 5} Output: arr[] = {1, 2, 3, 4, 5} Approach: This can be done using set in standard template library. Set type v...
[ { "code": null, "e": 52, "s": 24, "text": "\n31 May, 2022" }, { "code": null, "e": 155, "s": 52, "text": "Given an array, the task is to remove the duplicate elements from the array using STL in C++ Examples:" }, { "code": null, "e": 282, "s": 155, "text": "In...
K-th Largest Sum Contiguous Subarray
07 Mar, 2022 Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative and positive numbers. Examples: Input: a[] = {20, -5, -1} k = 3 Output: 14 Explanation: All sum of contiguous subarrays are (20, 15, 14, -5, -6, -1) so...
[ { "code": null, "e": 54, "s": 26, "text": "\n07 Mar, 2022" }, { "code": null, "e": 219, "s": 54, "text": "Given an array of integers. Write a program to find the K-th largest sum of contiguous subarray within the array of numbers which has negative and positive numbers." }, {...
Understanding Monte Carlo Simulation Through Basketball | by Vinicius Monteiro | Towards Data Science
Monte Carlo Simulation is a type of simulation where the events are chosen to happen randomly. By iterating and trying out various outcomes many times, arbitrarily, it gives great confidence in the result. [1] The name comes from Monte Carlo, located in Monaco, known for its strong gambling activity. Let’s use a simple...
[ { "code": null, "e": 474, "s": 172, "text": "Monte Carlo Simulation is a type of simulation where the events are chosen to happen randomly. By iterating and trying out various outcomes many times, arbitrarily, it gives great confidence in the result. [1] The name comes from Monte Carlo, located in M...
Recursion in Python, an exploration | by Carlos Brown | Towards Data Science
Recursion is one of those ideas that may seem out of reach, likely from a higher plane of programming existence. Something that A. You don’t really know why it’s a thing and B. You don’t think you would ever need to utilize it. After all, there are no Functional Programming languages in the Top 10 of the TIOBE index as...
[ { "code": null, "e": 535, "s": 171, "text": "Recursion is one of those ideas that may seem out of reach, likely from a higher plane of programming existence. Something that A. You don’t really know why it’s a thing and B. You don’t think you would ever need to utilize it. After all, there are no Fun...
GATE | GATE CS 2013 | Question 65 - GeeksforGeeks
13 Aug, 2019 Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction (FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand (WO). The stage delays for FI, DI, FO, EI and WO are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns, respectively. There are int...
[ { "code": null, "e": 24412, "s": 24384, "text": "\n13 Aug, 2019" }, { "code": null, "e": 25089, "s": 24412, "text": "Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction (FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instr...
Shortest Unique prefix for every word | Practice | GeeksforGeeks
Given an array of words, find all shortest unique prefixes to represent each word in the given array. Assume that no word is prefix of another. Example 1: Input: N = 4 arr[] = {"zebra", "dog", "duck", "dove"} Output: z dog du dov Explanation: z => zebra dog => dog duck => du dove => dov Example 2: Input: N = 3 ...
[ { "code": null, "e": 382, "s": 238, "text": "Given an array of words, find all shortest unique prefixes to represent each word in the given array. Assume that no word is prefix of another." }, { "code": null, "e": 393, "s": 382, "text": "Example 1:" }, { "code": null, ...
How can we export data to a CSV file whose filename name contains timestamp at which the file is created?
Sometimes we need to export data into a CSV file whose name has a timestamp at which that file is created. It can be done with the help of MySQL prepared statement. To illustrate it we are using the following example − Example The queries in the following example will export the data from table ‘student_info’ to the CS...
[ { "code": null, "e": 1281, "s": 1062, "text": "Sometimes we need to export data into a CSV file whose name has a timestamp at which that file is created. It can be done with the help of MySQL prepared statement. To illustrate it we are using the following example −" }, { "code": null, "e...
What are RMSE and MAE?. A Simple Guide to Evaluation Metrics | by Shwetha Acharya | Towards Data Science
Root Mean Squared Error (RMSE)and Mean Absolute Error (MAE) are metrics used to evaluate a Regression Model. These metrics tell us how accurate our predictions are and, what is the amount of deviation from the actual values. Technically, RMSE is the Root of the Mean of the Square of Errors and MAE is the Mean of Absolu...
[ { "code": null, "e": 397, "s": 172, "text": "Root Mean Squared Error (RMSE)and Mean Absolute Error (MAE) are metrics used to evaluate a Regression Model. These metrics tell us how accurate our predictions are and, what is the amount of deviation from the actual values." }, { "code": null, ...
How can I display MySQL query result vertically?
With the use of ego, \G option at end of a statement, we can get the result set in vertical format. Consider the following example − mysql> Select * from Student where name = 'Aarav'\G *************************** 1. row *************************** Name: Aarav RollNo: 150 Grade: M.SC 1 row in set (0.00 sec)
[ { "code": null, "e": 1195, "s": 1062, "text": "With the use of ego, \\G option at end of a statement, we can get the result set in vertical format. Consider the following example −" }, { "code": null, "e": 1373, "s": 1195, "text": "mysql> Select * from Student where name = 'Aarav...
Systematically Pricing Financial Options With Black Scholes | by Brunna Torino | Towards Data Science
There are two types of vanilla financial options that are traded in the financial markets: American — where you can exercise the option any time until the exercise date — and European — where you have to wait until the exercise date to exercise the option. The names “American” and “European” don’t actually relate to wh...
[ { "code": null, "e": 429, "s": 172, "text": "There are two types of vanilla financial options that are traded in the financial markets: American — where you can exercise the option any time until the exercise date — and European — where you have to wait until the exercise date to exercise the option...
C++ String Library - front
It returns a reference to the first character of the string. Following is the declaration for std::string::front. char& front(); const char& front() const; none It returns a reference to the first character of the string. if an exception is thrown, there are no changes in the string. In below example for std::string::f...
[ { "code": null, "e": 2664, "s": 2603, "text": "It returns a reference to the first character of the string." }, { "code": null, "e": 2717, "s": 2664, "text": "Following is the declaration for std::string::front." }, { "code": null, "e": 2732, "s": 2717, "text"...
How can we map multiple date formats using Jackson in Java?
A Jackson is a Java-based library and it can be useful to convert Java objects to JSON and JSON to Java Object. We can map the multiple date formats in the Jackson library using @JsonFormat annotation, it is a general-purpose annotation used for configuring details of how values of properties are to be serialized. The ...
[ { "code": null, "e": 1805, "s": 1062, "text": "A Jackson is a Java-based library and it can be useful to convert Java objects to JSON and JSON to Java Object. We can map the multiple date formats in the Jackson library using @JsonFormat annotation, it is a general-purpose annotation used for configu...
Java Guava | Booleans.countTrue() method with Examples - GeeksforGeeks
30 Jan, 2019 The countTrue() method of Booleans Class in Guava Library is used to count the number of values that are true in the specified boolean values passed as the parameter. Syntax: public static int countTrue(boolean... values) Parameters: This method accepts the boolean values among which the true values are t...
[ { "code": null, "e": 23811, "s": 23783, "text": "\n30 Jan, 2019" }, { "code": null, "e": 23978, "s": 23811, "text": "The countTrue() method of Booleans Class in Guava Library is used to count the number of values that are true in the specified boolean values passed as the paramet...
Python Program For Inserting Node In The Middle Of The Linked List
10 Jul, 2022 Given a linked list containing n nodes. The problem is to insert a new node with data x at the middle of the list. If n is even, then insert the new node after the (n/2)th node, else insert the new node after the (n+1)/2th node. Examples: Input : list: 1->2->4->5 x = 3 Output : 1->2->3->4->5 Inpu...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Jul, 2022" }, { "code": null, "e": 257, "s": 28, "text": "Given a linked list containing n nodes. The problem is to insert a new node with data x at the middle of the list. If n is even, then insert the new node after the (n/2)th nod...
Corona Virus Live Updates for India – Using Python
06 Oct, 2020 As we know the whole world is being affected by the COVID-19 pandemic and almost everyone is working from home. We all should utilize this duration at best, to improve our technical skills or writing some good Pythonic scripts. Let’s see a simple Python script to demonstrate the state-wise coronavirus case...
[ { "code": null, "e": 54, "s": 26, "text": "\n06 Oct, 2020" }, { "code": null, "e": 574, "s": 54, "text": "As we know the whole world is being affected by the COVID-19 pandemic and almost everyone is working from home. We all should utilize this duration at best, to improve our te...
Find the altitude and area of an isosceles triangle
22 Jun, 2022 Given the side (a) of the isosceles triangle. The task is to find the area (A) and the altitude (h). An isosceles triangle is a triangle with 2 sides of equal length and 2 equal internal angles adjacent to each equal sides. In this figure, a- Measure of the equal sides of an isosceles triangle. b- Base of...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jun, 2022" }, { "code": null, "e": 253, "s": 28, "text": "Given the side (a) of the isosceles triangle. The task is to find the area (A) and the altitude (h). An isosceles triangle is a triangle with 2 sides of equal length and 2 equ...