title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Plot scatter points on polar axis in Matplotlib
To plot scatter points on polar axis in Matplotlib, we can take the following steps − Set the figure size and adjust the padding between and around the subplots. Initialize a variable, N, for number of sample data. Get r, theta, area and color data using numpy Create a new figure or activate an existing figure. Plot th...
[ { "code": null, "e": 1148, "s": 1062, "text": "To plot scatter points on polar axis in Matplotlib, we can take the following steps −" }, { "code": null, "e": 1224, "s": 1148, "text": "Set the figure size and adjust the padding between and around the subplots." }, { "code"...
Get started with Apache Spark and TensorFlow on Azure Databricks | by Adi Polak | Towards Data Science
This is a step by step tutorial on how to get new Spark TensorFrame library running on Azure Databricks. Big Data is a huge topic that consists of many domains and expertise. All the way from DevOps, Data Engineers to Data Scientist, AI, Machine Learning, algorithm developers and many more. We all struggle with massive...
[ { "code": null, "e": 277, "s": 172, "text": "This is a step by step tutorial on how to get new Spark TensorFrame library running on Azure Databricks." }, { "code": null, "e": 698, "s": 277, "text": "Big Data is a huge topic that consists of many domains and expertise. All the way...
How to limit maximum items on multiple input (<input type=“file” multiple />)?
To allow multiple file uploads in HTML forms, use the multiple attributes. The multiple attributes work with email and file input types. For limiting maximum items on multiple inputs, use JavaScript. Through this, limit the number of files to be uploaded. For example, let’s say only 2 files to be uploaded at once. You ...
[ { "code": null, "e": 1199, "s": 1062, "text": "To allow multiple file uploads in HTML forms, use the multiple attributes. The multiple attributes work with email and file input types." }, { "code": null, "e": 1378, "s": 1199, "text": "For limiting maximum items on multiple inputs...
JavaScript Array Ranking - JavaScript
Suppose, we have three JavaScript arrays of Number like these − const array1 = [10,23,53,74,33,56,6,0,43,45,11]; const array2 = [52,46,27,28,4,11,53,6,75,75,22]; const array3 = [26,18,10,12,31,12,5,8,44,34,65]; The length of all the arrays will always be the same. We are required to write a JavaScript function that in ...
[ { "code": null, "e": 1126, "s": 1062, "text": "Suppose, we have three JavaScript arrays of Number like these −" }, { "code": null, "e": 1273, "s": 1126, "text": "const array1 = [10,23,53,74,33,56,6,0,43,45,11];\nconst array2 = [52,46,27,28,4,11,53,6,75,75,22];\nconst array3 = [26...
TreeSet contains() Method in Java With Examples - GeeksforGeeks
26 Jan, 2022 TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by a set using their natural ordering whether or not an explicit comparator is provided. This must be consistent with equals if it is to correctly...
[ { "code": null, "e": 25486, "s": 25458, "text": "\n26 Jan, 2022" }, { "code": null, "e": 25824, "s": 25486, "text": "TreeSet is one of the most important implementations of the SortedSet interface in Java that uses a Tree for storage. The ordering of the elements is maintained by...
Number of smaller circles that can be inscribed in a larger circle - GeeksforGeeks
22 Apr, 2021 Given two positive integers R1 and R2, where R1 and R2 represent the radius of the larger and smaller circles respectively, the task is to find out the number of smaller circles that can be placed inside the larger circle such that the smaller circle touches the boundary of the larger circle. Examples: Inp...
[ { "code": null, "e": 26561, "s": 26533, "text": "\n22 Apr, 2021" }, { "code": null, "e": 26855, "s": 26561, "text": "Given two positive integers R1 and R2, where R1 and R2 represent the radius of the larger and smaller circles respectively, the task is to find out the number of s...
How to use React.cloneElement() function? - GeeksforGeeks
31 Mar, 2021 We can use React.cloneElement() method when a parent component wants to add or modify the props of its children. The React.cloneElement() function creates a clone of a given element, and we can also pass props and children in the function. The resultant element would have the initial element’s props mixed ...
[ { "code": null, "e": 26071, "s": 26043, "text": "\n31 Mar, 2021" }, { "code": null, "e": 26311, "s": 26071, "text": "We can use React.cloneElement() method when a parent component wants to add or modify the props of its children. The React.cloneElement() function creates a clone ...
How to prevent text in a table cell from wrapping using CSS? - GeeksforGeeks
26 Feb, 2019 Given a table which contains the table head and body section. The task is to prevent the text in a table cell from wrapping using CSS. To achieve this we use white-space property of CSS. This property forces the contents of th to display in one line. There are many property values exists to the white-space...
[ { "code": null, "e": 25925, "s": 25897, "text": "\n26 Feb, 2019" }, { "code": null, "e": 26243, "s": 25925, "text": "Given a table which contains the table head and body section. The task is to prevent the text in a table cell from wrapping using CSS. To achieve this we use white...
Convert an arbitrary Binary Tree to a tree that holds Children Sum Property - GeeksforGeeks
01 Apr, 2022 Question: Given an arbitrary binary tree, convert it to a binary tree that holds Children Sum Property. You can only increment data values in any node (You cannot change the structure of the tree and cannot decrement the value of any node). For example, the below tree doesn’t hold the children sum property...
[ { "code": null, "e": 26185, "s": 26157, "text": "\n01 Apr, 2022" }, { "code": null, "e": 26541, "s": 26185, "text": "Question: Given an arbitrary binary tree, convert it to a binary tree that holds Children Sum Property. You can only increment data values in any node (You cannot ...
Find the total guests that are present at the party - GeeksforGeeks
01 Apr, 2021 A person hosts a party and invites N guests to it. However, each guest has a condition, that each guest ‘Gi’ only stays at the party if there are at least ‘Pi’ people already at the party, otherwise leaves. The total number of guests N and the number of people each guest needs ‘Pi’ are given as input for e...
[ { "code": null, "e": 26521, "s": 26493, "text": "\n01 Apr, 2021" }, { "code": null, "e": 27008, "s": 26521, "text": "A person hosts a party and invites N guests to it. However, each guest has a condition, that each guest ‘Gi’ only stays at the party if there are at least ‘Pi’ peo...
HTML | DOM Audio duration Property - GeeksforGeeks
14 Nov, 2019 The Audio duration property is used for returning the length of an audio. The Audio duration property returns the value in seconds.Different browsers return different precision values such as with safari returning up to 14 decimal places followed by opera returning up to 9 decimal places.The Audio duration...
[ { "code": null, "e": 31621, "s": 31593, "text": "\n14 Nov, 2019" }, { "code": null, "e": 32115, "s": 31621, "text": "The Audio duration property is used for returning the length of an audio. The Audio duration property returns the value in seconds.Different browsers return differ...
Matplotlib.pyplot.acorr() in Python - GeeksforGeeks
12 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. The acorr() function in pyplot module of matplotlib library is used to plot the autocorrelation of x (array-like...
[ { "code": null, "e": 26027, "s": 25999, "text": "\n12 Apr, 2020" }, { "code": null, "e": 26222, "s": 26027, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which pr...
Find top k (or most frequent) numbers in a stream - GeeksforGeeks
14 Mar, 2022 Given an array of n numbers. Your task is to read numbers from the array and keep at-most K numbers at the top (According to their decreasing frequency) every time a new number is read. We basically need to print top k numbers sorted by frequency when input stream has included k distinct elements, else nee...
[ { "code": null, "e": 26809, "s": 26781, "text": "\n14 Mar, 2022" }, { "code": null, "e": 27181, "s": 26809, "text": "Given an array of n numbers. Your task is to read numbers from the array and keep at-most K numbers at the top (According to their decreasing frequency) every time...
GATE | GATE CS 2019 | Question 17 - GeeksforGeeks
14 Feb, 2019 Let G be an arbitrary group. Consider the following relations on G: R1: ∀a, b ∈ G, aR1b if and only if ∃g ∈ G such that a = g−1bg R2: ∀a, b ∈ G, aR2b if and only if a = b−1 Which of the above is/are equivalence relation/relations?(A) R1 and R2(B) R1 only(C) R2 only(D) Neither R1 nor R2Answer: (B)Explanatio...
[ { "code": null, "e": 25607, "s": 25579, "text": "\n14 Feb, 2019" }, { "code": null, "e": 25675, "s": 25607, "text": "Let G be an arbitrary group. Consider the following relations on G:" }, { "code": null, "e": 25737, "s": 25675, "text": "R1: ∀a, b ∈ G, aR1b if...
Shell Script to Validate Integer Input - GeeksforGeeks
09 Apr, 2021 Here we are going to see a shell script which validates an integer. We are going to display whether the input entered is an integer or an invalid input. Approach: Take input from the user.Store the input of any variableNow we are going to trim the input in such a way that all the -(minus) or +(plus) sign...
[ { "code": null, "e": 25677, "s": 25649, "text": "\n09 Apr, 2021" }, { "code": null, "e": 25831, "s": 25677, "text": "Here we are going to see a shell script which validates an integer. We are going to display whether the input entered is an integer or an invalid input. " }, {...
How to set/insert null values to in to a column of a row using JDBC program?
You can insert null values into a table in SQL in two ways: Directly inserting the value NULL into the desired column as: Directly inserting the value NULL into the desired column as: Insert into SampleTable values (NULL); Using ‘ ’ as null Using ‘ ’ as null Insert into SampleTable values (NULL); While inserting data i...
[ { "code": null, "e": 1122, "s": 1062, "text": "You can insert null values into a table in SQL in two ways:" }, { "code": null, "e": 1184, "s": 1122, "text": "Directly inserting the value NULL into the desired column as:" }, { "code": null, "e": 1246, "s": 1184, ...
Modify a bit at a given position - GeeksforGeeks
25 Apr, 2022 Given a number n, a position p and a binary value b, we need to change the bit at position p in n to value b. Examples : Input : n = 7, p = 2, b = 0 Output : 3 7 is 00000111 after clearing bit at 2nd position, it becomes 0000011. Input : n = 7, p = 3, b = 1 Output : 15 7 is 00000111 after setting bit at...
[ { "code": null, "e": 25012, "s": 24984, "text": "\n25 Apr, 2022" }, { "code": null, "e": 25122, "s": 25012, "text": "Given a number n, a position p and a binary value b, we need to change the bit at position p in n to value b." }, { "code": null, "e": 25134, "s": ...
Next Permutation | Practice | GeeksforGeeks
Implement the next permutation, which rearranges the list of numbers into Lexicographically next greater permutation of list of numbers. If such arrangement is not possible, it must be rearranged to the lowest possible order i.e. sorted in an ascending order. You are given an list of numbers arr[ ] of size N. Example 1...
[ { "code": null, "e": 549, "s": 238, "text": "Implement the next permutation, which rearranges the list of numbers into Lexicographically next greater permutation of list of numbers. If such arrangement is not possible, it must be rearranged to the lowest possible order i.e. sorted in an ascending or...
Extracting a substring as an array of characters in Java
To extract a substring as an array of characters in Java, use the getChars() method. Let’s say the following is our string and character array. String str = "World is not enough!"; char[] chArr = new char[10]; Now, use the getChars() method to extract a substring. str.getChars(13, 19, chArr, 0); The above substring is ...
[ { "code": null, "e": 1147, "s": 1062, "text": "To extract a substring as an array of characters in Java, use the getChars() method." }, { "code": null, "e": 1206, "s": 1147, "text": "Let’s say the following is our string and character array." }, { "code": null, "e": 1...
How to Easily Make Beautiful Wordclouds in Python | by Frank Andrade | Towards Data Science
A wordcloud lets us easily identify the keywords in a text where the size of the words represents their frequency. With this, we’ll get a good idea of what a text is about before even reading it. Although there are many free tools to make wordclouds online, we can use our Python skills to customize wordclouds even more...
[ { "code": null, "e": 494, "s": 172, "text": "A wordcloud lets us easily identify the keywords in a text where the size of the words represents their frequency. With this, we’ll get a good idea of what a text is about before even reading it. Although there are many free tools to make wordclouds onlin...
How to get single array from multiple arrays in JavaScript
Suppose, we have an array of arrays like this − const arr = [ [ {"c": 1},{"d": 2} ], [ {"c": 2},{"d": 3} ] ]; We are required to write a JavaScript function that takes in one such array as the first and the only argument. The function should then convert the array (creating a new array) into array of objects remo...
[ { "code": null, "e": 1110, "s": 1062, "text": "Suppose, we have an array of arrays like this −" }, { "code": null, "e": 1178, "s": 1110, "text": "const arr = [\n [ {\"c\": 1},{\"d\": 2} ],\n [ {\"c\": 2},{\"d\": 3} ]\n];" }, { "code": null, "e": 1290, "s": 117...
C++ Input / Output | Practice | GeeksforGeeks
Given two integers A and B. Your task is to return their product. Example 1: Input: A = 1, B = 2 Output: 2 Explanation: Multiplication of 1 and 2 is 2. Example 2: Input: A = 8, B = 7 Output: 56 Explanation: Multiplication of 8 and 7 is 56. Your Task: You don't need to read input or print anything. Your task is t...
[ { "code": null, "e": 304, "s": 238, "text": "Given two integers A and B. Your task is to return their product." }, { "code": null, "e": 317, "s": 306, "text": "Example 1:" }, { "code": null, "e": 393, "s": 317, "text": "Input:\nA = 1, B = 2\nOutput:\n2\nExplan...
Fabric.js | Rect borderColor Property - GeeksforGeeks
20 May, 2020 In this article, we are going to see how to change the border color of the canvas rectangle using FabricJS. The canvas rectangle means rectangle is movable and can be stretched according to requirement. Further, the rectangle can be customized when it comes to initial stroke color, height, width, fill colo...
[ { "code": null, "e": 24970, "s": 24942, "text": "\n20 May, 2020" }, { "code": null, "e": 25297, "s": 24970, "text": "In this article, we are going to see how to change the border color of the canvas rectangle using FabricJS. The canvas rectangle means rectangle is movable and can...
AngularJS | Events - GeeksforGeeks
22 Apr, 2020 Events in AngularJS can be added using the Directives mentioned below: ng-mousemove: Movement of mouse leads to the execution of event. ng-mouseup: Movement of mouse upwards leads to the execution of event. ng-mousedown: Movement of mouse downwards leads to the execution of event. ng-mouseenter: Click of t...
[ { "code": null, "e": 28271, "s": 28243, "text": "\n22 Apr, 2020" }, { "code": null, "e": 28342, "s": 28271, "text": "Events in AngularJS can be added using the Directives mentioned below:" }, { "code": null, "e": 28407, "s": 28342, "text": "ng-mousemove: Movem...
Hibernate Restrictions Example | Restrictions in Hibernate
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws In this tutorials, we are going to learn abou...
[ { "code": null, "e": 158, "s": 123, "text": "PROGRAMMINGJava ExamplesC Examples" }, { "code": null, "e": 172, "s": 158, "text": "Java Examples" }, { "code": null, "e": 183, "s": 172, "text": "C Examples" }, { "code": null, "e": 195, "s": 183, ...
Java sql.Time setTime() method with example
The setTime() method of the java.util.Time class accepts a variable of long type, representing the number of milliseconds from the epoch time (January 1, 1970 00:00:00.000 GMT) to the required time, and sets the specified time value to the current Time object //Setting time time.setTime(time_value_in_long); Let us crea...
[ { "code": null, "e": 1322, "s": 1062, "text": "The setTime() method of the java.util.Time class accepts a variable of long type, representing the number of milliseconds from the epoch time (January 1, 1970 00:00:00.000 GMT) to the required time, and sets the specified time value to the current Time ...
A Data Science Case Study with Python: Mercari Price Prediction | by Geoffrey Lobo | Towards Data Science
The most effective way to learn data science is by solving data science related problems. Reading, listening and taking notes is valuable, but once you work through a problem, concepts solidify from abstractions into tools you feel confident using. Generally a full cycle data science project includes the following stag...
[ { "code": null, "e": 496, "s": 172, "text": "The most effective way to learn data science is by solving data science related problems. Reading, listening and taking notes is valuable, but once you work through a problem, concepts solidify from abstractions into tools you feel confident using. Genera...
C++ for loop
A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. The syntax of a for loop in C++ is − for ( init; condition; increment ) { statement(s); } Here is the flow of control in a for loop − The init step is executed first, and only o...
[ { "code": null, "e": 2457, "s": 2318, "text": "A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times." }, { "code": null, "e": 2494, "s": 2457, "text": "The syntax of a for loop in C++ is −" }, ...
Displaying rotatable 3D plots in IPython or Jupyter Notebook
By creating a 3D projection on the axis and iterating that axis for different angles using view_init(), we can rotate the output diagram. Create a new figure, or activate an existing figure. Create a new figure, or activate an existing figure. Add an `~.axes.Axes` to the figure as part of a subplot arrangement with nro...
[ { "code": null, "e": 1200, "s": 1062, "text": "By creating a 3D projection on the axis and iterating that axis for different angles using view_init(), we can rotate the output diagram." }, { "code": null, "e": 1253, "s": 1200, "text": "Create a new figure, or activate an existing...
Logging in Node.js
Logging is a very essential part in any application whether it is made in Node.js or any other programming languages. Logging helps us to detect weird behaviours of an application along with real-time errors and exceptions. One should definitely put logical logs in their application. These logs help the user to identif...
[ { "code": null, "e": 1429, "s": 1062, "text": "Logging is a very essential part in any application whether it is made in Node.js or any other programming languages. Logging helps us to detect weird behaviours of an application along with real-time errors and exceptions. One should definitely put log...
PyTorch [Vision] — Binary Image Classification | by Akshaj Verma | Towards Data Science
import numpy as npimport pandas as pdimport seaborn as snsfrom tqdm.notebook import tqdmimport matplotlib.pyplot as pltimport torchimport torchvisionimport torch.nn as nnimport torch.optim as optimimport torch.nn.functional as Ffrom torchvision import transforms, utils, datasetsfrom torch.utils.data import Dataset, Dat...
[ { "code": null, "e": 588, "s": 172, "text": "import numpy as npimport pandas as pdimport seaborn as snsfrom tqdm.notebook import tqdmimport matplotlib.pyplot as pltimport torchimport torchvisionimport torch.nn as nnimport torch.optim as optimimport torch.nn.functional as Ffrom torchvision import tra...
Handling Overflowing Content using CSS
We can use CSS overflow property to manage/handle the overflowing content of an element. This property allows user to clip content, provide scrollbars to view clipped content, render content outside the container thus the name overflow. Following is the syntax for CSS Overflow property − Selector { overflow: /*value...
[ { "code": null, "e": 1299, "s": 1062, "text": "We can use CSS overflow property to manage/handle the overflowing content of an element. This property allows user to clip content, provide scrollbars to view clipped content, render content outside the container thus the name overflow." }, { "c...
MySQL Syntax to create Foreign Key?
The syntax to create a foreign key is as follows − alter table yourSecondTableName ADD CONSTRAINT yourConstraintname FOREIGN KEY(yourForeignKeyColumnName) references yourFirstTableName (yourPrimaryKeyColumnName); To understand the above syntax, let us create two tables. The query to create the first table is as follows...
[ { "code": null, "e": 1113, "s": 1062, "text": "The syntax to create a foreign key is as follows −" }, { "code": null, "e": 1275, "s": 1113, "text": "alter table yourSecondTableName ADD CONSTRAINT yourConstraintname FOREIGN KEY(yourForeignKeyColumnName)\nreferences yourFirstTableN...
Pytorch LSTMs for time-series data | by Charlie O'Neill | Towards Data Science
You might have noticed that, despite the frequency with which we encounter sequential data in the real world, there isn’t a huge amount of content online showing how to build simple LSTMs from the ground up using the Pytorch functional API. Even the LSTM example on Pytorch’s official documentation only applies it to a ...
[ { "code": null, "e": 748, "s": 166, "text": "You might have noticed that, despite the frequency with which we encounter sequential data in the real world, there isn’t a huge amount of content online showing how to build simple LSTMs from the ground up using the Pytorch functional API. Even the LSTM ...
Find number of days between two given dates | Practice | GeeksforGeeks
Given two dates, find the total number of days between them. Note: The system follows Gregorian calender from the beginning of time. Example 1: Input: d1 = 10, m1 = 2, y1 = 2014 d2 = 10, m2 = 3, y2 = 2015 Output: 393 Explanation: By counting manually, we find out there are 393 days between the two dates. Example 2: I...
[ { "code": null, "e": 371, "s": 238, "text": "Given two dates, find the total number of days between them.\nNote: The system follows Gregorian calender from the beginning of time." }, { "code": null, "e": 384, "s": 373, "text": "Example 1:" }, { "code": null, "e": 546,...
Calculating percentage in a MySQL query and round off the result
For this, you can use CONCAT() and round(). Let us first create a table − mysql> create table DemoTable1844 ( Number int, TotalNumber int ); Query OK, 0 rows affected (0.00 sec) Insert some records in the table using insert command − mysql> insert into DemoTable1844 values(50,500); Query OK, 1 row a...
[ { "code": null, "e": 1136, "s": 1062, "text": "For this, you can use CONCAT() and round(). Let us first create a table −" }, { "code": null, "e": 1260, "s": 1136, "text": "mysql> create table DemoTable1844\n (\n Number int,\n TotalNumber int\n );\nQuery OK, 0 rows...
What is the difference between VAR and DYNAMIC keywords in C#?
Store any type of value in the dynamic data type variable created using dynamic keyword. Type checking for these types of variables takes place at run-time. Dynamic are dynamically typed variables. The following is the syntax for declaring a dynamic type − dynamic <variable_name> = value; The following is an example − ...
[ { "code": null, "e": 1260, "s": 1062, "text": "Store any type of value in the dynamic data type variable created using dynamic keyword. Type checking for these types of variables takes place at run-time. Dynamic are dynamically typed variables." }, { "code": null, "e": 1319, "s": 126...
Make Your Inventory Simulation in Python | Towards Data Science
This article is an extract from my book Inventory Optimization: Models and Simulations. You can read my other articles here and subscribe to my blog here. I am also active on LinkedIn. Before jumping in Python and coding our inventory simulation, let’s take the time to define the inventory policy we will simulate: a pe...
[ { "code": null, "e": 356, "s": 171, "text": "This article is an extract from my book Inventory Optimization: Models and Simulations. You can read my other articles here and subscribe to my blog here. I am also active on LinkedIn." }, { "code": null, "e": 550, "s": 356, "text": "B...
Google Colab - Executing External Python Files
Suppose, you already have some Python code developed that is stored in your Google Drive. Now, you will like to load this code in Colab for further modifications. In this chapter, we will see how to load and run the code stored in your Google Drive. Tools / Command palette You will see the list of commands as shown in...
[ { "code": null, "e": 2291, "s": 2041, "text": "Suppose, you already have some Python code developed that is stored in your Google Drive. Now, you will like to load this code in Colab for further modifications. In this chapter, we will see how to load and run the code stored in your Google Drive." ...
Python | Mean of tuple list
18 Oct, 2019 Sometimes, while working with Python tuple list, we can have a problem in which we need to find the average of tuple values in the list. This problem has the possible application in many domains including mathematics. Let’s discuss certain ways in which this task can be performed. Method #1 : Using loopsTh...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Oct, 2019" }, { "code": null, "e": 310, "s": 28, "text": "Sometimes, while working with Python tuple list, we can have a problem in which we need to find the average of tuple values in the list. This problem has the possible applicat...
Longest path in an undirected tree
07 Jul, 2022 Given an undirected tree, we need to find the longest path of this tree where a path is defined as a sequence of nodes. Example: Input : Below shown Tree using adjacency list representation: Output : 5 In below tree longest path is of length 5 from node 5 to node 7 This problem is the same as th...
[ { "code": null, "e": 54, "s": 26, "text": "\n07 Jul, 2022" }, { "code": null, "e": 175, "s": 54, "text": "Given an undirected tree, we need to find the longest path of this tree where a path is defined as a sequence of nodes. " }, { "code": null, "e": 185, "s": 17...
How to check if a MySQL database exists?
The schema_name command is used to check if a MySQL database exists or not. The syntax of this command is as follows − select schema_name from information_schema.schemata where schema_name = 'database name'; Now, the above command is used to check whether the database exists or not. The query for that is as follows − C...
[ { "code": null, "e": 1306, "s": 1187, "text": "The schema_name command is used to check if a MySQL database exists or not. The syntax of\nthis command is as follows −" }, { "code": null, "e": 1395, "s": 1306, "text": "select schema_name from information_schema.schemata where sche...
CSS | column-rule Property
29 Apr, 2021 The column-rule property in CSS is used to specify the width, style, and color of the rules between the columns.Syntax: column-rule: column-rule-width column-rule-style column-rule-color| initial|inherit; Property Values: column-rule-width: This value is used to set the width of the rule between the co...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Apr, 2021" }, { "code": null, "e": 150, "s": 28, "text": "The column-rule property in CSS is used to specify the width, style, and color of the rules between the columns.Syntax: " }, { "code": null, "e": 235, "s": 15...
StringJoiner toString() method in Java
12 Dec, 2021 The toString() of StringJoiner is used to convert StringJoiner to String. It returns the current value, consisting of the prefix, the values added so far separated by the delimiter, and the suffix, unless no elements have been added in which case, the prefix + suffix or the emptyValue characters are return...
[ { "code": null, "e": 53, "s": 25, "text": "\n12 Dec, 2021" }, { "code": null, "e": 371, "s": 53, "text": "The toString() of StringJoiner is used to convert StringJoiner to String. It returns the current value, consisting of the prefix, the values added so far separated by the del...
How to use Iterator in Java?
18 Jul, 2018 ‘Iterator’ is an interface which belongs to collection framework. It allows us to traverse the collection, access the data element and remove the data elements of the collection.java.util package has public interface Iterator and contains three methods: boolean hasNext(): It returns true if Iterator has mo...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 Jul, 2018" }, { "code": null, "e": 306, "s": 52, "text": "‘Iterator’ is an interface which belongs to collection framework. It allows us to traverse the collection, access the data element and remove the data elements of the collect...
MATLAB - Inverse of a Matrix
The inverse of a matrix A is denoted by A−1 such that the following relationship holds − AA−1 = A−1A = 1 The inverse of a matrix does not always exist. If the determinant of the matrix is zero, then the inverse does not exist and the matrix is singular. Inverse of a matrix in MATLAB is calculated using the inv function...
[ { "code": null, "e": 2364, "s": 2275, "text": "The inverse of a matrix A is denoted by A−1 such that the following relationship holds −" }, { "code": null, "e": 2380, "s": 2364, "text": "AA−1 = A−1A = 1" }, { "code": null, "e": 2529, "s": 2380, "text": "The in...
JavaScript String substring() Method
07 Oct, 2021 The string.substring() is an inbuilt function in JavaScript which is used to return the part of the given string from start index to end index. Indexing start from zero (0). Syntax: string.substring(Startindex, Endindex) Parameters: Here the Startindex and Endindex describes the part of the string to be ...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Oct, 2021" }, { "code": null, "e": 236, "s": 52, "text": "The string.substring() is an inbuilt function in JavaScript which is used to return the part of the given string from start index to end index. Indexing start from zero (0). ...
Python | Word Embedding using Word2Vec
16 May, 2022 Word Embedding is a language modeling technique used for mapping words to vectors of real numbers. It represents words or phrases in vector space with several dimensions. Word embeddings can be generated using various methods like neural networks, co-occurrence matrix, probabilistic models, etc. Word2Vec c...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 May, 2022" }, { "code": null, "e": 537, "s": 28, "text": "Word Embedding is a language modeling technique used for mapping words to vectors of real numbers. It represents words or phrases in vector space with several dimensions. Word...
Node.js Query String
07 Feb, 2022 The Query String module used to provides utilities for parsing and formatting URL query strings.It can be used to convert query string into JSON object and vice-versa. The Query String is the part of the URL that starts after the question mark(?). Requiring Module: You can include the module using the fol...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Feb, 2022" }, { "code": null, "e": 197, "s": 28, "text": "The Query String module used to provides utilities for parsing and formatting URL query strings.It can be used to convert query string into JSON object and vice-versa. " }, ...
Bootstrap - Button Dropdowns
This chapter will discuss about how to add dropdown menu to buttons using Bootstrap classes. To add a dropdown to a button, simply wrap the button and dropdown menu in a .btn-group. You can also use <span class = "caret"></span> to act as an indicator that the button is a dropdown. The following example demonstrates a ...
[ { "code": null, "e": 3614, "s": 3331, "text": "This chapter will discuss about how to add dropdown menu to buttons using Bootstrap classes. To add a dropdown to a button, simply wrap the button and dropdown menu in a .btn-group. You can also use <span class = \"caret\"></span> to act as an indicator...
C Program For Union And Intersection Of Two Linked Lists - GeeksforGeeks
20 Dec, 2021 Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. The order of elements in output lists doesn’t matter.Example: Input: List1: 10->15->4->20 List2: 8->4->2->10 Output: Intersection List: 4->10 Union List: 2->8->20->4-...
[ { "code": null, "e": 26363, "s": 26335, "text": "\n20 Dec, 2021" }, { "code": null, "e": 26565, "s": 26363, "text": "Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. The order of elements i...
Infix to Prefix conversion using two stacks - GeeksforGeeks
30 Aug, 2021 Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 operator operand2). Example : (A+B) * (C-D)Prefix : An expression is called the prefix expression if the operator appears in the expression before the operand...
[ { "code": null, "e": 26043, "s": 26015, "text": "\n30 Aug, 2021" }, { "code": null, "e": 26535, "s": 26043, "text": "Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 operator opera...
DeepFool — A simple and accurate method to fool Deep Neural Networks. | by Arc | Towards Data Science
Summary of the paperDeepFool: A Simple and Accurate Method to Fool Deep Neural Networksby Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Pascal FrossardLink to the paper: https://arxiv.org/pdf/1511.04599.pdf Deep Neural Networks achieve state of the art performances in many tasks but fail miserably on slightly perturb...
[ { "code": null, "e": 381, "s": 172, "text": "Summary of the paperDeepFool: A Simple and Accurate Method to Fool Deep Neural Networksby Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Pascal FrossardLink to the paper: https://arxiv.org/pdf/1511.04599.pdf" }, { "code": null, "e": 553, ...
How to wait for iFrames to load completely in Selenium webdriver?
We can wait for the iframe to load completely with Selenium webdriver.First of all we need to identify the iframe with the help iframe id, name, number or webelement. Then we shall use the explicit wait concept in synchronization to wait for the iframe to load. We need to import org.openqa.selenium.support.ui.ExpectedC...
[ { "code": null, "e": 1324, "s": 1062, "text": "We can wait for the iframe to load completely with Selenium webdriver.First of all we need to identify the iframe with the help iframe id, name, number or webelement. Then we shall use the explicit wait concept in synchronization to wait for the iframe ...
Write a C Program to count the frequency of each character
Follow the algorithm to write a C program which enables to count the frequency of each character. Step 1: Define MAX size. Step 2: Declare char and integer variables. Step 3: Read the string from console. Step 4: Find length of the string. Step 5: Initialize frequency of each character to 0. Step 6: Find total number o...
[ { "code": null, "e": 1160, "s": 1062, "text": "Follow the algorithm to write a C program which enables to count the frequency of each character." }, { "code": null, "e": 1731, "s": 1160, "text": "Step 1: Define MAX size.\nStep 2: Declare char and integer variables.\nStep 3: Read ...
File Objects in Java
The File object represents the actual file/directory on the disk. Here are the list of constructors to create File Object in Java − Assuming an object is present in the given location, the first argument to the command line will be considered as the path and the below code will be executed − import java.io.File; public...
[ { "code": null, "e": 1194, "s": 1062, "text": "The File object represents the actual file/directory on the disk. Here are the list of constructors to\ncreate File Object in Java −" }, { "code": null, "e": 1355, "s": 1194, "text": "Assuming an object is present in the given locati...
MuseGAN: Using GANs to generate original Music | by Victor Sim | Towards Data Science
Here is the github repo (ads) of this project: GANs are highly versatile, allowing for the generation of anything that can be synthesized into images. By utilizing this feature of GANs, it is possible to generate very unorthodox content, at least from the perspective of machine learning. This article is sharing my proj...
[ { "code": null, "e": 94, "s": 47, "text": "Here is the github repo (ads) of this project:" }, { "code": null, "e": 458, "s": 94, "text": "GANs are highly versatile, allowing for the generation of anything that can be synthesized into images. By utilizing this feature of GANs, it ...
Tryit Editor v3.7
Tryit: HTML layout
[]
Microsoft Interview Experience | Set 141 (Off-Campus - Online Coding Test for IDC) - GeeksforGeeks
06 Nov, 2017 The online test was conducted on CoCubes on 2017, 5th November. The test was webcam enabled to avoid any kind of cheating. You cannot open any other tab or minimize the window. It consisted of 3 coding questions. TIME LIMIT: 75 minutes(*) Marks(Qn-1) = 2 (*) Marks(Qn-2) = 3 (*) Marks(Qn-3) = 5 Question 1: ...
[ { "code": null, "e": 25268, "s": 25240, "text": "\n06 Nov, 2017" }, { "code": null, "e": 25481, "s": 25268, "text": "The online test was conducted on CoCubes on 2017, 5th November. The test was webcam enabled to avoid any kind of cheating. You cannot open any other tab or minimiz...
Cellular Nucleus Image Segmentation Project | by Christopher Bui | Towards Data Science
The 2018 Data Science Bowl Kaggle competition caught my attention for its potential to have a profoundly practical impact in the biotechnology industry. This post covers my overall experience while a detailed summary of my work can be found on my Github. The Challenge: Given microscope images of many types of nuclei ta...
[ { "code": null, "e": 427, "s": 172, "text": "The 2018 Data Science Bowl Kaggle competition caught my attention for its potential to have a profoundly practical impact in the biotechnology industry. This post covers my overall experience while a detailed summary of my work can be found on my Github."...
Check if strings are rotations of each other or not in Python
Suppose we have two strings s and t, we have to check whether t is a rotation of s or not. So, if the input is like s = "hello", t = "llohe", then the output will be True. To solve this, we will follow these steps − if size of s is not same as size of t, thenreturn False return False temp := s concatenate with s again ...
[ { "code": null, "e": 1153, "s": 1062, "text": "Suppose we have two strings s and t, we have to check whether t is a rotation of s or not." }, { "code": null, "e": 1234, "s": 1153, "text": "So, if the input is like s = \"hello\", t = \"llohe\", then the output will be True." }, ...
jQuery | prev() & prevAll() with Examples - GeeksforGeeks
13 Feb, 2019 The prev() is an inbuilt function in jQuery which is used to return the previous sibling element of the selected element. Siblings are those having same parent element in DOM Tree. Document Object Model(DOM) is a World Wide Web Consortium standard defined for accessing elements. prev() Syntax: $(selector)....
[ { "code": null, "e": 24761, "s": 24733, "text": "\n13 Feb, 2019" }, { "code": null, "e": 25041, "s": 24761, "text": "The prev() is an inbuilt function in jQuery which is used to return the previous sibling element of the selected element. Siblings are those having same parent ele...
An RFM Analysis with Python | Wenling Yao | Towards Data Science
It’s time to brush up on my Python skills! 👩🏻‍💻 This week I want to go techie and share a recent Python exercise using the RFM framework. It is a method used to determine customer value by looking at three dimensions: Recency: when is the last time the user takes an action (e.g., login, place an order)? Frequency: h...
[ { "code": null, "e": 220, "s": 172, "text": "It’s time to brush up on my Python skills! 👩🏻‍💻" }, { "code": null, "e": 390, "s": 220, "text": "This week I want to go techie and share a recent Python exercise using the RFM framework. It is a method used to determine customer val...
Calculate range of data types using C++ - GeeksforGeeks
12 Jan, 2018 C++ program for printing the range data type like int, char, short. Signed Data Types METHOD 1.) calculate total number of bits by multiplying sizeof with 8 (say n) 2.) Calculate -2^(n-1) for minimum range 3.) Calculate (2^(n-1))-1 for maximum range // CPP program to calculate // range of signed data ty...
[ { "code": null, "e": 25479, "s": 25451, "text": "\n12 Jan, 2018" }, { "code": null, "e": 25547, "s": 25479, "text": "C++ program for printing the range data type like int, char, short." }, { "code": null, "e": 25565, "s": 25547, "text": "Signed Data Types" }...
How to create a draggable HTML element with JavaScript and CSS?
To create a draggable HTML element with JavaScript and CSS, the code is as follows − Live Demo <!DOCTYPE html> <html> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .dragDiv { position: absolute; z-index: 9; text-align: center; border: 1px solid #d...
[ { "code": null, "e": 1147, "s": 1062, "text": "To create a draggable HTML element with JavaScript and CSS, the code is as follows −" }, { "code": null, "e": 1158, "s": 1147, "text": " Live Demo" }, { "code": null, "e": 2858, "s": 1158, "text": "<!DOCTYPE html>...
How to include Functions from other files in Node.js ? - GeeksforGeeks
29 Jun, 2020 Code reusability is an important pillar in modern day programming. Code Reuse means the practice of using an existing code for a new function or software. In this article, we would learn how to use functions from other files in Node.js. This functionality can be easily implemented using the inbuilt export...
[ { "code": null, "e": 26401, "s": 26373, "text": "\n29 Jun, 2020" }, { "code": null, "e": 26639, "s": 26401, "text": "Code reusability is an important pillar in modern day programming. Code Reuse means the practice of using an existing code for a new function or software. In this ...
ES6 - Object Extensions
Some popular methods added to the String object in ES6 are − determines whether a string begins with the characters of a specified string. Returns true or false determines whether a string ends with the characters of a specified string. Returns true/false determines whether one string may be found within another string...
[ { "code": null, "e": 2338, "s": 2277, "text": "Some popular methods added to the String object in ES6 are −" }, { "code": null, "e": 2438, "s": 2338, "text": "determines whether a string begins with the characters of a specified string. Returns true or false" }, { "code":...
Set heights and widths of forms with Bootstrap
Use classes like .input-lg and .col-lg-* to set the height and width of forms. You can try to run the following code to set the form height and width − Live Demo <!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <scrip...
[ { "code": null, "e": 1141, "s": 1062, "text": "Use classes like .input-lg and .col-lg-* to set the height and width of forms." }, { "code": null, "e": 1214, "s": 1141, "text": "You can try to run the following code to set the form height and width −" }, { "code": null, ...
Integer reverseBytes() Method in Java - GeeksforGeeks
07 Jul, 2018 The java.lang.Integer.reverseBytes(int a) is a built-in method which returns the value obtained by reversing the order of the bytes in the two’s complement representation of the specified int value. Syntax : public static int reverseBytes(int a) Parameter: The method takes one parameter a of integer type w...
[ { "code": null, "e": 24456, "s": 24428, "text": "\n07 Jul, 2018" }, { "code": null, "e": 24655, "s": 24456, "text": "The java.lang.Integer.reverseBytes(int a) is a built-in method which returns the value obtained by reversing the order of the bytes in the two’s complement represe...
How to fill array values in Java?
Let us first create an int array − int[] arr = new int[10]; Now, fill array values. Here, the numbers get added from the index 2 to 7 − Arrays.fill(arr, 2, 7, 100); Live Demo import java.util.Arrays; public class Demo { public static void main(String[] args) { int[] arr = new int[10]; System.out.println...
[ { "code": null, "e": 1097, "s": 1062, "text": "Let us first create an int array −" }, { "code": null, "e": 1122, "s": 1097, "text": "int[] arr = new int[10];" }, { "code": null, "e": 1198, "s": 1122, "text": "Now, fill array values. Here, the numbers get added...
Build a GUI Application to Get Live Stock Price using Python - GeeksforGeeks
19 Jan, 2021 The stock price is the highest amount someone is willing to pay for the stock. In this article, we are going to write code for getting live share prices for each company and bind it with GUI Application. Yahoo_fin: This module is used to scrape historical stock price data, as well as to provide current inf...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n19 Jan, 2021" }, { "code": null, "e": 24496, "s": 24292, "text": "The stock price is the highest amount someone is willing to pay for the stock. In this article, we are going to write code for getting live share prices for each c...
PHP program to find the maximum and the minimum in array - GeeksforGeeks
24 Jun, 2021 Given an array of integers, find the maximum and minimum in it.Examples: Input : arr[] = {2, 3, 1, 6, 7} Output : Maximum integer of the given array:7 Minimum integer of the given array:1 Input : arr[] = {1, 2, 3, 4, 5} Output : Maximum integer of the given array : 5 Minimum integer o...
[ { "code": null, "e": 31430, "s": 31402, "text": "\n24 Jun, 2021" }, { "code": null, "e": 31505, "s": 31430, "text": "Given an array of integers, find the maximum and minimum in it.Examples: " }, { "code": null, "e": 31759, "s": 31505, "text": "Input : arr[] =...
Hour-glass Pattern - GeeksforGeeks
16 Nov, 2021 Given positive integer n, print numeric pattern in form of an hourglass.Examples : Input : rows_no = 7 Output : 1 2 3 4 5 6 7 2 3 4 5 6 7 3 4 5 6 7 4 5 6 7 5 6 7 6 7 7 6 7 5 6 7 4 5 6 7 3 4 5 6 7 2 3 4 5 6 7 1 2 3 4 5 6 7 C++ Java Python3 C# PHP Javascript // CPP...
[ { "code": null, "e": 24506, "s": 24478, "text": "\n16 Nov, 2021" }, { "code": null, "e": 24591, "s": 24506, "text": "Given positive integer n, print numeric pattern in form of an hourglass.Examples : " }, { "code": null, "e": 24768, "s": 24591, "text": "Input...
Visualizing the Fundamentals of Convolutional Neural Networks | by Mark C. F. Sousa | Towards Data Science
Convolutional Neural Networks (CNNs) are a subtype of Artificial Neural Networks (ANNs) mostly used for image classification. CNNs follow the biological principle of the replication of a structure capable of identifying patterns to identify these patterns in different locations. It was inspired by the model of cats’ vi...
[ { "code": null, "e": 1689, "s": 171, "text": "Convolutional Neural Networks (CNNs) are a subtype of Artificial Neural Networks (ANNs) mostly used for image classification. CNNs follow the biological principle of the replication of a structure capable of identifying patterns to identify these pattern...
Count how many times the given digital clock shows identical digits in C++
Suppose we have a digital clock of type HH:MM. Which shows the time in hours and minutes only. We are given a number of hours and minutes as input. The goal is to count the number of times all digits are the same. H=M. This happens 3 times a day, first at 00:00 midnight, then at 11:11 and last at 22:22. As time is repr...
[ { "code": null, "e": 1281, "s": 1062, "text": "Suppose we have a digital clock of type HH:MM. Which shows the time in hours and minutes\nonly. We are given a number of hours and minutes as input. The goal is to count the number of times all digits are the same. H=M." }, { "code": null, "...
KL Divergence Python Example. We can think of the KL divergence as... | by Cory Maklin | Towards Data Science
As you progress in your career as a data scientist, you will inevitable come across the Kullback–Leibler (KL) divergence. We can think of the KL divergence as distance metric (although it isn’t symmetric) that quantifies the difference between two probability distributions. One common scenario where this is useful is w...
[ { "code": null, "e": 854, "s": 47, "text": "As you progress in your career as a data scientist, you will inevitable come across the Kullback–Leibler (KL) divergence. We can think of the KL divergence as distance metric (although it isn’t symmetric) that quantifies the difference between two probabil...
Angular 6 - CLI
Angular CLI makes it easy to start with any Angular project. Angular CLI comes with commands that help us create and start on our project very fast. Let us now go through the commands available to create a project, a component and services, change the port, etc. To work with Angular CLI, we need to have it installed on...
[ { "code": null, "e": 2258, "s": 1995, "text": "Angular CLI makes it easy to start with any Angular project. Angular CLI comes with commands that help us create and start on our project very fast. Let us now go through the commands available to create a project, a component and services, change the p...
Functions in Julia - GeeksforGeeks
26 Mar, 2020 A function in Julia is an object that takes a tuple of arguments and maps it to a return value. A function can be pure mathematical or can alter the state of another object in the program.With Julia’s function, we can write bigger computations but in very fewer lines of code as function support some compre...
[ { "code": null, "e": 24464, "s": 24436, "text": "\n26 Mar, 2020" }, { "code": null, "e": 24842, "s": 24464, "text": "A function in Julia is an object that takes a tuple of arguments and maps it to a return value. A function can be pure mathematical or can alter the state of anoth...
Python Program for Merge Sort
In this article, we will learn about the solution to the problem statement given below. Problem statement − We are given an array, we need to sort it using the concept of merge sort Here we place the maximum element at the end. This is repeated until the array is sorted. Now let’s observe the solution in the implementa...
[ { "code": null, "e": 1150, "s": 1062, "text": "In this article, we will learn about the solution to the problem statement given below." }, { "code": null, "e": 1244, "s": 1150, "text": "Problem statement − We are given an array, we need to sort it using the concept of merge sort"...
MapStruct - Custom Mapping
We can add custom methods as well to the Mapper created using org.mapstruct.Mapper annotation. We can create abstract class as well intead of an Interface. Mapstruct automatically creates the corresponding mapper class. Now create a default conversion method in interface. @Mapper public interface StudentMapper { def...
[ { "code": null, "e": 2480, "s": 2260, "text": "We can add custom methods as well to the Mapper created using org.mapstruct.Mapper annotation. We can create abstract class as well intead of an Interface. Mapstruct automatically creates the corresponding mapper class." }, { "code": null, "...
C++ Program to Find median in row wise sorted matrix
11 Jan, 2022 We are given a row-wise sorted matrix of size r*c, we need to find the median of the matrix given. It is assumed that r*c is always odd.Examples: Input : 1 3 5 2 6 9 3 6 9 Output : Median is 5 If we put all the values in a sorted array A[] = 1 2 3 3 5 6 6 9 9) Input: 1 3 4 2 5 6 ...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Jan, 2022" }, { "code": null, "e": 175, "s": 28, "text": "We are given a row-wise sorted matrix of size r*c, we need to find the median of the matrix given. It is assumed that r*c is always odd.Examples: " }, { "code": null, ...
Sort the words in lexicographical order in Python
17 Aug, 2018 Given a strings, we need to sort the words in lexicographical order (dictionary order). Examples : Input : "hello python program how are you" Output : are hello how program python you Input : "Coders loves the algorithms" Output : Coders alg...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 Aug, 2018" }, { "code": null, "e": 140, "s": 52, "text": "Given a strings, we need to sort the words in lexicographical order (dictionary order)." }, { "code": null, "e": 151, "s": 140, "text": "Examples :" }, ...
Node.js File System
08 Oct, 2021 Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js helps developers to write JavaScript code to run on the server-side, to generate dynamic content and deliver to the web clients. The two features that make Node.js stand-out are: Event-driven Non-blocking I/O model About Node.j...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Oct, 2021" }, { "code": null, "e": 261, "s": 52, "text": "Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js helps developers to write JavaScript code to run on the server-side, to generate dynamic conte...
Prime numbers and Fibonacci
28 Sep, 2021 Given a number, find the numbers (smaller than or equal to n) which are both Fibonacci and prime. Examples: Input : n = 40 Output: 2 3 5 13 Explanation : Here, range(upper limit) = 40 Fibonacci series upto n is, 1, 1, 2, 3, 5, 8, 13, 21, 34. Prime numbers in above series = 2, 3, 5, 13. Input : n = 100 O...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Sep, 2021" }, { "code": null, "e": 150, "s": 52, "text": "Given a number, find the numbers (smaller than or equal to n) which are both Fibonacci and prime." }, { "code": null, "e": 161, "s": 150, "text": "Example...
Integration in MATLAB
28 Apr, 2021 Integration is defined as the process of finding the anti derivative of a function. It is used to calculate area, volume, displacement, and many more. In this article, we will see how to perform integration on expressions in MATLAB. There are two types of Integration: Indefinite integral: Let f(x) be a fun...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Apr, 2021" }, { "code": null, "e": 261, "s": 28, "text": "Integration is defined as the process of finding the anti derivative of a function. It is used to calculate area, volume, displacement, and many more. In this article, we will...
Probability that a N digit number is palindrome
22 Jun, 2022 Given an integer N, the task is to find the probability that a number with a number of digits as N is a palindrome. The number may have leading zeros.Examples: Input: N = 5 Output: 1 / 100Input: N = 6 Output: 1 / 1000 Solution: As leading zeroes are allowed a total number of N digit numbers is 10N. A nu...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Jun, 2022" }, { "code": null, "e": 215, "s": 54, "text": "Given an integer N, the task is to find the probability that a number with a number of digits as N is a palindrome. The number may have leading zeros.Examples: " }, { ...
Trie | (Delete)
11 Aug, 2021 In the previous post on trie we have described how to insert and search a node in trie. Here is an algorithm how to delete a node from trie.During delete operation we delete the key in bottom up manner using recursion. The following are possible conditions when deleting key from trie, Key may not be there...
[ { "code": null, "e": 52, "s": 24, "text": "\n11 Aug, 2021" }, { "code": null, "e": 339, "s": 52, "text": "In the previous post on trie we have described how to insert and search a node in trie. Here is an algorithm how to delete a node from trie.During delete operation we delete ...
How to print the content of an object in JavaScript ?
09 May, 2019 The JSON.stringify() method is used to print the JavaScript object.JSON.stringify() Method: The JSON.stringify() method is used to allow to take a JavaScript object or Array and create a JSON string out of it. While developing an application using JavaScript many times it is needed to serialize the data to...
[ { "code": null, "e": 53, "s": 25, "text": "\n09 May, 2019" }, { "code": null, "e": 610, "s": 53, "text": "The JSON.stringify() method is used to print the JavaScript object.JSON.stringify() Method: The JSON.stringify() method is used to allow to take a JavaScript object or Array ...
How to create a copy of an object in PHP?
01 Dec, 2021 An object copy is created by using the clone keyword (which calls the object’s __clone() method if possible). An object’s __clone() method cannot be called directly. When an object is cloned, PHP will perform a shallow copy of all of the object’s properties. Any properties that are references to other vari...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Dec, 2021" }, { "code": null, "e": 373, "s": 28, "text": "An object copy is created by using the clone keyword (which calls the object’s __clone() method if possible). An object’s __clone() method cannot be called directly. When an o...
Django project – Creating a Basic E-commerce Website for Displaying Products
24 Feb, 2022 Project Title – Basic Ecommerce Website using Django Django is a powerful framework based on python. Here we will see how to create a basic e-commerce website in Django. This project includes storing products in the database and show them on the website. Refer to the following articles to check how to cr...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Feb, 2022" }, { "code": null, "e": 108, "s": 54, "text": "Project Title – Basic Ecommerce Website using Django " }, { "code": null, "e": 311, "s": 108, "text": "Django is a powerful framework based on python. Her...
Program for addition of two matrices
23 Jun, 2022 The below program adds two square matrices of size 4*4, we can change N for different dimensions. Implementation: C++ C Java Python3 C# PHP Javascript // C++ program for addition// of two matrices#include <bits/stdc++.h>using namespace std;#define N 4 // This function adds A[][] and B[][], and stores// th...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Jun, 2022" }, { "code": null, "e": 151, "s": 52, "text": "The below program adds two square matrices of size 4*4, we can change N for different dimensions. " }, { "code": null, "e": 167, "s": 151, "text": "Implem...
What is CSS flexbox ?
31 Oct, 2021 CSS Flexible Layout Box, popularly known as Flexbox is a powerful one-dimensional layout model. It helps to lay, align and distribute items (children) efficiently inside a container (parent). Important Features: One-dimensional layout model: Flex is a one-dimensional layout model as it can only deal with...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Oct, 2021" }, { "code": null, "e": 222, "s": 28, "text": "CSS Flexible Layout Box, popularly known as Flexbox is a powerful one-dimensional layout model. It helps to lay, align and distribute items (children) efficiently inside a con...
How does the functools cmp_to_key function works in Python?
12 Nov, 2020 There has been a change in Python’s sorted() function, it now takes three values namely, the iterable, key, and reverse. Out of these last two are optional but this article emphasizes the key part of the sorted() function. What key does is, it helps in the comparison of iterable elements while sorting. Py...
[ { "code": null, "e": 54, "s": 26, "text": "\n12 Nov, 2020" }, { "code": null, "e": 650, "s": 54, "text": "There has been a change in Python’s sorted() function, it now takes three values namely, the iterable, key, and reverse. Out of these last two are optional but this article e...
Stream findFirst() in Java with examples
06 Dec, 2018 Stream findFirst() returns an Optional (a container object which may or may not contain a non-null value) describing the first element of this stream, or an empty Optional if the stream is empty. If the stream has no encounter order, then any element may be returned. Syntax : Optional<T> findFirst() Where...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Dec, 2018" }, { "code": null, "e": 296, "s": 28, "text": "Stream findFirst() returns an Optional (a container object which may or may not contain a non-null value) describing the first element of this stream, or an empty Optional if ...
Transform the string
30 Jun, 2022 Given a string s, change the string s according to the rules provided below: Delete all the vowels from the string. Insert # in front of all the consonants. Change the case of all the letters of the string. Examples: Input : aBAcAba Output :#b#C#B Input :SunshinE!! Output :#s#N#S#H#N!! Approach : Fi...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 Jun, 2022" }, { "code": null, "e": 133, "s": 54, "text": "Given a string s, change the string s according to the rules provided below: " }, { "code": null, "e": 172, "s": 133, "text": "Delete all the vowels from...
JavaScript Array.of() function
01 Nov, 2021 The array.of() function is an inbuilt function in JavaScript that creates a new array instance with variables present as the argument of the function. Syntax: Array.of(element0, element1, ....) Parameters: Parameters present are element0, element1, .... which are basically an element for which the array c...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Nov, 2021" }, { "code": null, "e": 180, "s": 28, "text": "The array.of() function is an inbuilt function in JavaScript that creates a new array instance with variables present as the argument of the function. " }, { "code": n...
Bitwise Complement Operator (~ tilde)
10 Dec, 2021 Pre-requisite:Bitwise Operators in C/ C++Bitwise Operators in Java The bitwise complement operator is a unary operator (works on only one operand). It takes one number and inverts all bits of it. When bitwise operator is applied on bits then, all the 1’s become 0’s and vice versa. The operator for the bitw...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Dec, 2021" }, { "code": null, "e": 95, "s": 28, "text": "Pre-requisite:Bitwise Operators in C/ C++Bitwise Operators in Java" }, { "code": null, "e": 364, "s": 95, "text": "The bitwise complement operator is a unar...
How to transform child elements preserve the 3D transformations ?
30 Apr, 2021 The CSS transform-style property is used to transform child elements to preserve the 3D transformations. The transform-style property is used to specify that the children of an element are positioned in 3D space or flattened with respect to the plane of the element. The preserve-3d property value on an ele...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Apr, 2021" }, { "code": null, "e": 403, "s": 28, "text": "The CSS transform-style property is used to transform child elements to preserve the 3D transformations. The transform-style property is used to specify that the children of a...
Find n-th term of series 1, 3, 6, 10, 15, 21 | Practice | GeeksforGeeks
Given a number N, find the Nth term in the series 1, 3, 6, 10, 15, 21... Example 1: Input : N = 4 Output: 10 Explanation: The 4th term of the Series is 10. Example 2: Input : N = 3 Output: 6 Explanation: The 3rd term of the Series is 6. Your Task: You don't need to read input or print anything. Your task is to co...
[ { "code": null, "e": 311, "s": 238, "text": "Given a number N, find the Nth term in the series 1, 3, 6, 10, 15, 21..." }, { "code": null, "e": 324, "s": 313, "text": "Example 1:" }, { "code": null, "e": 397, "s": 324, "text": "Input :\nN = 4 \nOutput:\n10\nExp...
How to abort a merge conflict in Git?
When doing a merge, you may run into one or more conflicts. Now what if we are not quite ready to handle this conflict yet. Perhaps you have several conflicts and you don't have enough time to spend on resolving these conflicts. In situations like this we can easily go back to the state before we started the merge. To ...
[ { "code": null, "e": 1504, "s": 1187, "text": "When doing a merge, you may run into one or more conflicts. Now what if we are not quite ready to handle this conflict yet. Perhaps you have several conflicts and you don't have enough time to spend on resolving these conflicts. In situations like this ...