title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Program for Hexadecimal to Decimal
14 Sep, 2021 Given a hexadecimal number as input, we need to write a program to convert the given hexadecimal number into an equivalent decimal number. Examples: Input : 67 Output: 103 Input : 512 Output: 1298 Input : 123 Output: 291 We know that hexadecimal number uses 16 symbols {0, 1, 2, 4, 5, 6, 7, 8, 9, A, B, ...
[ { "code": null, "e": 52, "s": 24, "text": "\n14 Sep, 2021" }, { "code": null, "e": 191, "s": 52, "text": "Given a hexadecimal number as input, we need to write a program to convert the given hexadecimal number into an equivalent decimal number." }, { "code": null, "e"...
GraphQL - Authenticating Client
Authentication is the process or action of verifying the identity of a user or a process. It is important that an application authenticates a user to ensure that the data is not available to an anonymous user. In this section, we will learn how to authenticate a GraphQL client. In this example, we will use jQuery to cr...
[ { "code": null, "e": 2364, "s": 2085, "text": "Authentication is the process or action of verifying the identity of a user or a process. It is important that an application authenticates a user to ensure that the data is not available to an anonymous user. In this section, we will learn how to authe...
Python | Print the initials of a name with last name in full
21 Nov, 2018 Given a name, print the initials of a name(uppercase) with last name(with first alphabet in uppercase) written in full separated by dots. Examples: Input : geeks for geeks Output : G.F.Geeks Input : mohandas karamchand gandhi Output : M.K.Gandhi A naive approach of this will be to iterate for spaces and...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Nov, 2018" }, { "code": null, "e": 192, "s": 54, "text": "Given a name, print the initials of a name(uppercase) with last name(with first alphabet in uppercase) written in full separated by dots." }, { "code": null, "e":...
Thread States in Operating Systems
25 Nov, 2019 When a thread moves through the system, it is always in one of the five states: (1) Ready (2) Running (3) Waiting (4) Delayed (5) Blocked Excluding CREATION and FINISHED state. When an application is to be processed, then it creates a thread.It is then allocated the required resources(such as a network) a...
[ { "code": null, "e": 28, "s": 0, "text": "\n25 Nov, 2019" }, { "code": null, "e": 108, "s": 28, "text": "When a thread moves through the system, it is always in one of the five states:" }, { "code": null, "e": 167, "s": 108, "text": "(1) Ready\n(2) Running\n(3...
Length of the longest subarray whose Bitwise XOR is K
17 May, 2021 Given an array arr[] of size N and an integer K, the task is to find the length of the longest subarray having Bitwise XOR of all its elements equal to K. Examples: Input: arr[] = { 1, 2, 4, 7, 2 }, K = 1Output: 3Explanation: Subarray having Bitwise XOR equal to K(= 1) are { { 1 }, { 2, 4, 7 }, { 1 } }.The...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 May, 2021" }, { "code": null, "e": 207, "s": 52, "text": "Given an array arr[] of size N and an integer K, the task is to find the length of the longest subarray having Bitwise XOR of all its elements equal to K." }, { "code...
Java Program to Create a Thread
06 Jun, 2021 Thread can be referred to as a lightweight process. Thread uses fewer resources to create and exist in the process; thread shares process resources. The main thread of Java is the thread that is started when the program starts. The slave thread is created as a result of the main thread. This is the last th...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Jun, 2021" }, { "code": null, "e": 387, "s": 52, "text": "Thread can be referred to as a lightweight process. Thread uses fewer resources to create and exist in the process; thread shares process resources. The main thread of Java i...
How do I generate random floats in C++?
In C or C++, we cannot create random float directly. We can create random floats using some trick. We will create two random integer values, then divide them to get random float value. Sometimes it may generate an integer quotient, so to reduce the probability of that, we are multiplying the result with some floating p...
[ { "code": null, "e": 1372, "s": 1187, "text": "In C or C++, we cannot create random float directly. We can create random floats using some trick. We will create two random integer values, then divide them to get random float value." }, { "code": null, "e": 1531, "s": 1372, "text"...
Data Classes in Python | An Introduction
23 Apr, 2021 dataclass module is introduced in Python 3.7 as a utility tool to make structured classes specially for storing data. These classes hold certain properties and functions to deal specifically with the data and its representation.DataClasses in widely used Python3.6 Although the module was introduced in Pyth...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Apr, 2021" }, { "code": null, "e": 412, "s": 28, "text": "dataclass module is introduced in Python 3.7 as a utility tool to make structured classes specially for storing data. These classes hold certain properties and functions to de...
Node2Vec Algorithm
13 Dec, 2021 Prerequisite: Word2Vec Word Embedding: It 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, probabilis...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Dec, 2021" }, { "code": null, "e": 51, "s": 28, "text": "Prerequisite: Word2Vec" }, { "code": null, "e": 352, "s": 51, "text": "Word Embedding: It is a language modeling technique used for mapping words to vectors...
Select from table where value does not exist with MySQL?
For this, you can use NOT IN() − mysql> create table DemoTable1991 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(20) ); Query OK, 0 rows affected (0.61 sec) Insert some records in the table using insert command − mysql> insert into DemoTable1991(StudentName) values('Chris'); Query OK, 1...
[ { "code": null, "e": 1095, "s": 1062, "text": "For this, you can use NOT IN() −" }, { "code": null, "e": 1252, "s": 1095, "text": "mysql> create table DemoTable1991\n(\n StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n StudentName varchar(20)\n);\nQuery OK, 0 rows affecte...
Python Program to Swap Two Variables - GeeksforGeeks
08 Jul, 2021 Given two variables x and y, write a Python program to swap their values. Let’s see different methods in Python to do this task. Method 1: Using Naive approachThe most naive approach is to store the value of one variable(say x) in a temporary variable, then assigning the variable x with the value of vari...
[ { "code": null, "e": 24236, "s": 24208, "text": "\n08 Jul, 2021" }, { "code": null, "e": 24367, "s": 24236, "text": "Given two variables x and y, write a Python program to swap their values. Let’s see different methods in Python to do this task. " }, { "code": null, ...
Apex - Collections
Collections is a type of variable that can store multiple number of records. For example, List can store multiple number of Account object's records. Let us now have a detailed overview of all collection types. List can contain any number of records of primitive, collections, sObjects, user defined and built in Apex ty...
[ { "code": null, "e": 2263, "s": 2052, "text": "Collections is a type of variable that can store multiple number of records. For example, List can store multiple number of Account object's records. Let us now have a detailed overview of all collection types." }, { "code": null, "e": 2647,...
Java String isEmpty() Method
❮ String Methods Find out if a string is empty or not: String myStr1 = "Hello"; String myStr2 = ""; System.out.println(myStr1.isEmpty()); System.out.println(myStr2.isEmpty()); Try it Yourself » The isEmpty() method checks whether a string is empty or not. This method returns true if the string is empty (length() is...
[ { "code": null, "e": 19, "s": 0, "text": "\n❮ String Methods\n" }, { "code": null, "e": 57, "s": 19, "text": "Find out if a string is empty or not:" }, { "code": null, "e": 178, "s": 57, "text": "String myStr1 = \"Hello\";\nString myStr2 = \"\";\nSystem.out.pr...
Streaming Twitter Data into a MySQL Database | by Daniel Foley | Towards Data Science
Given the frequency that I have seen database languages listed as a requirement for data science jobs, I thought it would be a good idea to do a post on MySQL today. In particular, I wanted to look at how we can use python and an API to stream data directly into a MySQL database. I did this recently for a personal proj...
[ { "code": null, "e": 618, "s": 171, "text": "Given the frequency that I have seen database languages listed as a requirement for data science jobs, I thought it would be a good idea to do a post on MySQL today. In particular, I wanted to look at how we can use python and an API to stream data direct...
FuzzyWuzzy: Find Similar Strings within one column in Python | Towards Data Science
There are different ways to make data dirty, and inconsistent data entry is one of them. Inconsistent values are even worse than duplicates, and sometimes difficult to detect. This article presents how I apply FuzzyWuzzy package to find similar ramen brand names in a ramen review dataset (full Jupyter Notebook can be f...
[ { "code": null, "e": 568, "s": 172, "text": "There are different ways to make data dirty, and inconsistent data entry is one of them. Inconsistent values are even worse than duplicates, and sometimes difficult to detect. This article presents how I apply FuzzyWuzzy package to find similar ramen bran...
How to get an Entry box within a Messagebox in Tkinter?
There are various methods and built-in functions available with the messagebox library in tkinter. Let's assume you want to display a messagebox and take some input from the user in an Entry widget. In this case, you can use the askstring library from simpledialog. The askstring library creates a window that takes two ...
[ { "code": null, "e": 1513, "s": 1062, "text": "There are various methods and built-in functions available with the messagebox library in tkinter. Let's assume you want to display a messagebox and take some input from the user in an Entry widget. In this case, you can use the askstring library from s...
How to convert Byte Array to Image in java?
Java provides ImageIO class for reading and writing an image. To convert a byte array to an image. Create a ByteArrayInputStream object by passing the byte array (that is to be converted) to its constructor. Create a ByteArrayInputStream object by passing the byte array (that is to be converted) to its constructor. Rea...
[ { "code": null, "e": 1161, "s": 1062, "text": "Java provides ImageIO class for reading and writing an image. To convert a byte array to an image." }, { "code": null, "e": 1270, "s": 1161, "text": "Create a ByteArrayInputStream object by passing the byte array (that is to be conve...
Intersection of two subgroups of a group is again a subgroup - GeeksforGeeks
05 Mar, 2021 Group : It is a set equipped with a binary operation that combines any two elements to form a third element in such a way that three conditions called group axioms are satisfied, namely associativity, identity, and invertibility. Subgroup : If a non-void subset H of a group G is itself a group under the op...
[ { "code": null, "e": 24501, "s": 24473, "text": "\n05 Mar, 2021" }, { "code": null, "e": 24731, "s": 24501, "text": "Group : It is a set equipped with a binary operation that combines any two elements to form a third element in such a way that three conditions called group axioms...
4 Pandas GroupBy Tricks You Should Know | by Christopher Tao | Medium | Towards Data Science
As one of the most popular libraries in Python, Pandas has been utilised very commonly especially in data EDA (Exploratory Data Analysis) jobs. Very typically, it can be used for filtering and transforming dataset just like what we usually do using SQL queries. They share a lot of similar concepts such as joining table...
[ { "code": null, "e": 599, "s": 172, "text": "As one of the most popular libraries in Python, Pandas has been utilised very commonly especially in data EDA (Exploratory Data Analysis) jobs. Very typically, it can be used for filtering and transforming dataset just like what we usually do using SQL qu...
Substring with Concatenation of All Words in C++
Suppose we have a string, s, and we also have a list of words, words present in the array are all of the same length. We have to find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters. So if the input is like “barfoothefoobarman” ...
[ { "code": null, "e": 1337, "s": 1062, "text": "Suppose we have a string, s, and we also have a list of words, words present in the array are all of the same length. We have to find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any in...
Calculate age from date of birth in MySQL?
To calculate age from date of birth, you can use the below syntax − select timestampdiff(YEAR,yourColumnName,now()) AS anyAliasName from yourTableName; Let us first create a table − mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentDOB datetime ); Query OK, 0 rows affected ...
[ { "code": null, "e": 1130, "s": 1062, "text": "To calculate age from date of birth, you can use the below syntax −" }, { "code": null, "e": 1214, "s": 1130, "text": "select timestampdiff(YEAR,yourColumnName,now()) AS anyAliasName from yourTableName;" }, { "code": null, ...
What are the differences between an Integer and an int in Java?
The major difference between an Integer and an int is that Integer is a wrapper class whereas int is a primitive data type. An int is a data type that stores 32-bit signed two’s complement integer whereas an Integer is a class that wraps a primitive type int in an object. An Integer can be used as an argument to a meth...
[ { "code": null, "e": 1186, "s": 1062, "text": "The major difference between an Integer and an int is that Integer is a wrapper class whereas int is a primitive data type." }, { "code": null, "e": 1335, "s": 1186, "text": "An int is a data type that stores 32-bit signed two’s comp...
Lexicographically smallest string formed repeatedly deleting character from substring 10 - GeeksforGeeks
22 Jul, 2021 Given a binary string S of length N, the task is to find lexicographically the smallest string formed after modifying the string by selecting any substring “10” and removing any one of the characters from that substring, any number of times. Examples: Input: S = “0101”Output: 001Explanation:Removing the S[...
[ { "code": null, "e": 25260, "s": 25232, "text": "\n22 Jul, 2021" }, { "code": null, "e": 25502, "s": 25260, "text": "Given a binary string S of length N, the task is to find lexicographically the smallest string formed after modifying the string by selecting any substring “10” an...
RESTful Web Services - Quick Guide
REST stands for REpresentational State Transfer. REST is web standards based architecture and uses HTTP Protocol. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods. REST was first introduced by Roy Fielding in 2000. In REST archi...
[ { "code": null, "e": 2162, "s": 1855, "text": "REST stands for REpresentational State Transfer. REST is web standards based architecture and uses HTTP Protocol. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard method...
How to add delay in a loop in JavaScript?
To add delay in a loop, use the setTimeout() metod in JavaScript. Following is the code for adding delay in a loop − Live Demo <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> body { font-f...
[ { "code": null, "e": 1179, "s": 1062, "text": "To add delay in a loop, use the setTimeout() metod in JavaScript. Following is the code for\nadding delay in a loop −" }, { "code": null, "e": 1190, "s": 1179, "text": " Live Demo" }, { "code": null, "e": 2058, "s": 1...
Numba: “weapon of mass optimization” | by Alex Diaz | Towards Data Science
Numba is a Python compiler, specifically for numerical functions and allows you to accelerate your applications with high performance functions written directly in Python. Numba generates machine code optimized from pure Python code using LLVM. With a couple of simple changes, our Python code (function-oriented) can be...
[ { "code": null, "e": 343, "s": 171, "text": "Numba is a Python compiler, specifically for numerical functions and allows you to accelerate your applications with high performance functions written directly in Python." }, { "code": null, "e": 607, "s": 343, "text": "Numba generate...
Aggregating and grouping data in SQL with Group by and Partition by | by Lan Chu | Towards Data Science
Aggregate functions are a very powerful tool to analyze the data and gain useful business insights. The most commonly used SQL aggregate functions include SUM, MAX, MIN, COUNT and AVERAGE. Aggregators are very often used in conjunction with Grouping functions in order to summarize the data. In this story, I will show y...
[ { "code": null, "e": 566, "s": 172, "text": "Aggregate functions are a very powerful tool to analyze the data and gain useful business insights. The most commonly used SQL aggregate functions include SUM, MAX, MIN, COUNT and AVERAGE. Aggregators are very often used in conjunction with Grouping funct...
Interactive Geospatial AI Visualization in Jupyter Notebook | by Juan Nathaniel | Towards Data Science
Getting to know your data is key to building and deploying a robust AI/ML system in production. It is, therefore, imperative to perform a good Exploratory Data Analysis (EDA) beforehand prior to formulating an AI/ML solution. However, performing an EDA on Geospatial dataset may seem daunting and, often times, challengi...
[ { "code": null, "e": 708, "s": 172, "text": "Getting to know your data is key to building and deploying a robust AI/ML system in production. It is, therefore, imperative to perform a good Exploratory Data Analysis (EDA) beforehand prior to formulating an AI/ML solution. However, performing an EDA on...
Binary tree to string with brackets - GeeksforGeeks
30 Jun, 2021 Construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be represented by empty parenthesis pair “()”. Omit all the empty parenthesis pairs that don’t affect the one-to-one mapping relationship between the string and the original b...
[ { "code": null, "e": 25192, "s": 25164, "text": "\n30 Jun, 2021" }, { "code": null, "e": 25522, "s": 25192, "text": "Construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be represented by empty parenth...
C# | SortedDictionary.Item[] Property - GeeksforGeeks
01 Feb, 2019 This property is used to get or set the value associated with the specified key. Syntax: public TValue this[TKey key] { get; set; } Here, key is the Key of the value to get or set. Property Value: The value associated with the specified key. If the specified key is not found, a get operation throws a KeyNo...
[ { "code": null, "e": 25963, "s": 25935, "text": "\n01 Feb, 2019" }, { "code": null, "e": 26044, "s": 25963, "text": "This property is used to get or set the value associated with the specified key." }, { "code": null, "e": 26052, "s": 26044, "text": "Syntax:" ...
How to Create a Foolproof Interactive Terminal Menu With Bash Scripts | by Shinichi Okada | Towards Data Science
If you are thinking of creating an interactive menu for your next Bash Script project, you are at the right place. In this article, we will create a simple menu template with colors for ease of navigation. Terminal commands use options to pass parameters to a program. These options can be a dash followed by one letter ...
[ { "code": null, "e": 378, "s": 172, "text": "If you are thinking of creating an interactive menu for your next Bash Script project, you are at the right place. In this article, we will create a simple menu template with colors for ease of navigation." }, { "code": null, "e": 609, "s"...
Bitwise and (or &) of a range - GeeksforGeeks
24 Mar, 2022 Given two non-negative long integers, x and y given x <= y, the task is to find bit-wise and of all integers from x and y, i.e., we need to compute value of x & (x+1) & ... & (y-1) & y.7 Examples: Input : x = 12, y = 15 Output : 12 12 & 13 & 14 & 15 = 12 Input : x = 10, y = 20 Output : 0 A simple...
[ { "code": null, "e": 26277, "s": 26249, "text": "\n24 Mar, 2022" }, { "code": null, "e": 26476, "s": 26277, "text": "Given two non-negative long integers, x and y given x <= y, the task is to find bit-wise and of all integers from x and y, i.e., we need to compute value of x & (x...
PyTorch - Introduction to Convents
Convents is all about building the CNN model from scratch. The network architecture will contain a combination of following steps − Conv2d MaxPool2d Rectified Linear Unit View Linear Layer Training the model is the same process like image classification problems. The following code snippet completes the procedure of a ...
[ { "code": null, "e": 2391, "s": 2259, "text": "Convents is all about building the CNN model from scratch. The network architecture will contain a combination of following steps −" }, { "code": null, "e": 2398, "s": 2391, "text": "Conv2d" }, { "code": null, "e": 2408, ...
ConcurrentModificationException in Java with Examples - GeeksforGeeks
02 Apr, 2020 ConcurrentModificationException in Multi threaded environment In multi threaded environment, if during the detection of the resource, any method finds that there is a concurrent modification of that object which is not permissible, then this ConcurrentModificationException might be thrown. If this exceptio...
[ { "code": null, "e": 24524, "s": 24496, "text": "\n02 Apr, 2020" }, { "code": null, "e": 24586, "s": 24524, "text": "ConcurrentModificationException in Multi threaded environment" }, { "code": null, "e": 24815, "s": 24586, "text": "In multi threaded environmen...
Lua - Basic Syntax
Let us start creating our first Lua program! Lua provides a mode called interactive mode. In this mode, you can type in instructions one after the other and get instant results. This can be invoked in the shell by using the lua -i or just the lua command. Once you type in this, press Enter and the interactive mode will...
[ { "code": null, "e": 2148, "s": 2103, "text": "Let us start creating our first Lua program!" }, { "code": null, "e": 2451, "s": 2148, "text": "Lua provides a mode called interactive mode. In this mode, you can type in instructions one after the other and get instant results. This...
SHA-256 Hash in Java
29 Apr, 2022 Definition: In Cryptography, SHA is cryptographic hash function which takes input as 20 Bytes and rendered the hash value in hexadecimal number, 40 digits long approx.Message Digest Class: To calculate cryptographic hashing value in Java, MessageDigest Class is used, under the package java.security.MessagD...
[ { "code": null, "e": 54, "s": 26, "text": "\n29 Apr, 2022" }, { "code": null, "e": 461, "s": 54, "text": "Definition: In Cryptography, SHA is cryptographic hash function which takes input as 20 Bytes and rendered the hash value in hexadecimal number, 40 digits long approx.Message...
Python program to print Pascal’s Triangle
04 Jun, 2021 Pascal’s triangle is a pattern of the triangle which is based on nCr, below is the pictorial representation of Pascal’s triangle. Example: Input: N = 5 Output: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 Method 1: Using nCr formula i.e. n!/(n-r)!r! After using nCr formula, the pictorial representatio...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jun, 2021" }, { "code": null, "e": 182, "s": 52, "text": "Pascal’s triangle is a pattern of the triangle which is based on nCr, below is the pictorial representation of Pascal’s triangle." }, { "code": null, "e": 191, ...
Substring Reverse Pattern
21 May, 2021 Given string str, the task is to print the pattern given in the examples below: Examples: Input: str = “geeks” Output: geeks *kee* **e** The reverse of “geeks” is “skeeg” Replace the first and last characters with ‘*’ i.e. *kee* Replace the second and second last character in the modified string i.e. **e...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 May, 2021" }, { "code": null, "e": 132, "s": 52, "text": "Given string str, the task is to print the pattern given in the examples below:" }, { "code": null, "e": 144, "s": 132, "text": "Examples: " }, { ...
Path endsWith() method in Java with Examples
23 Jul, 2019 endswith() method of java.nio.file.Path usec to check if this path object ends with the given path or string which we passed as parameter.There are two types of endsWith() methods. endsWith(String other) method of java.nio.file.Path used to check if this path ends with a Path, constructed by converting the...
[ { "code": null, "e": 53, "s": 25, "text": "\n23 Jul, 2019" }, { "code": null, "e": 234, "s": 53, "text": "endswith() method of java.nio.file.Path usec to check if this path object ends with the given path or string which we passed as parameter.There are two types of endsWith() me...
Java Swing | GroupLayout Class
20 May, 2022 GroupLayout is a LayoutManager that hierarchically group the components and arranges them in a Container. Grouping is done by using the instances of the Group class. It is generally used for developing a GUI ( Graphic User Interface) builders such as Matisse, the GUI builder provided with the NetBeans IDE....
[ { "code": null, "e": 28, "s": 0, "text": "\n20 May, 2022" }, { "code": null, "e": 384, "s": 28, "text": "GroupLayout is a LayoutManager that hierarchically group the components and arranges them in a Container. Grouping is done by using the instances of the Group class. It is gen...
Python | Pandas Index.tolist()
24 Dec, 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 Index.tolist() function return a list of the values. These are each a scalar type, whi...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Dec, 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...
Method Class | getName() Method in Java
05 Dec, 2018 The getName() method of java.lang.reflect.Method class is helpful to get the name of methods, as a String. To get name of all methods of a class, get all the methods of that class object. Then call getName() on those method objects. Syntax: public String getName() Return Value: It returns the name of the m...
[ { "code": null, "e": 28, "s": 0, "text": "\n05 Dec, 2018" }, { "code": null, "e": 261, "s": 28, "text": "The getName() method of java.lang.reflect.Method class is helpful to get the name of methods, as a String. To get name of all methods of a class, get all the methods of that c...
std::equal_to in C++ with Examples
16 Jul, 2021 The std::equal_to allows the equality comparison to be used as a function, which means that it can be passed as an argument to templates and functions. This is not possible with the equality operator == since operators cannot be passed as parameters.Header File: #include <functional.h> Template Class: ...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Jul, 2021" }, { "code": null, "e": 293, "s": 28, "text": "The std::equal_to allows the equality comparison to be used as a function, which means that it can be passed as an argument to templates and functions. This is not possible wi...
Implement your own tail (Read last n lines of a huge file)
29 May, 2017 Given a huge file having dynamic data, write a program to read last n lines from the file at any point without reading the entire file. The problem is similar to tail command in linux which displays the last few lines of a file. It is mostly used for viewing log file updates as these updates are appended t...
[ { "code": null, "e": 52, "s": 24, "text": "\n29 May, 2017" }, { "code": null, "e": 376, "s": 52, "text": "Given a huge file having dynamic data, write a program to read last n lines from the file at any point without reading the entire file. The problem is similar to tail command...
C program to swap adjacent characters of a String
09 Jun, 2022 Given a string str, the task is to swap adjacent characters of this string in C. Examples: Input: str = "geeks" Output: NA Not possible as the string length is odd Input: str = "geek" Output: egke Approach: Check if the length of the string is even or odd.If the length is odd, swapping cannot be done.If t...
[ { "code": null, "e": 28, "s": 0, "text": "\n09 Jun, 2022" }, { "code": null, "e": 119, "s": 28, "text": "Given a string str, the task is to swap adjacent characters of this string in C. Examples:" }, { "code": null, "e": 226, "s": 119, "text": "Input: str = \"...
How to generate a vector with random values in C++?
24 Nov, 2020 Vectors are dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container. It can also be created with random value using the generate function and rand() function. Below is the template of both the STL...
[ { "code": null, "e": 52, "s": 24, "text": "\n24 Nov, 2020" }, { "code": null, "e": 322, "s": 52, "text": "Vectors are dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the conta...
Introduction to 3D Plotting with Matplotlib
08 Feb, 2022 In this article, we will be learning about 3D plotting with Matplotlib. There are various ways through which we can create a 3D plot using matplotlib such as creating an empty canvas and adding axes to it where you define the projection as a 3D projection, Matplotlib.pyplot.gca(), etc. In the below code, w...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Feb, 2022" }, { "code": null, "e": 341, "s": 54, "text": "In this article, we will be learning about 3D plotting with Matplotlib. There are various ways through which we can create a 3D plot using matplotlib such as creating an empt...
Java program to swap first and last characters of words in a sentence
26 Dec, 2017 Write a Java Program to Swap first and last character of words in a Sentence as mentioned in the example? Examples: Input : geeks for geeks Output :seekg rof seekg Approach:As mentioned in the example we have to replace first and last character of word and keep rest of the alphabets as it is. First we wil...
[ { "code": null, "e": 52, "s": 24, "text": "\n26 Dec, 2017" }, { "code": null, "e": 158, "s": 52, "text": "Write a Java Program to Swap first and last character of words in a Sentence as mentioned in the example?" }, { "code": null, "e": 168, "s": 158, "text": ...
struct module in Python
12 Jan, 2017 This module performs conversions between Python values and C structs represented as Python bytes objects. Format strings are the mechanism used to specify the expected layout when packing and unpacking data. Module struct is available in Python 3.x and not on 2.x, thus these codes will run on Python3 inter...
[ { "code": null, "e": 52, "s": 24, "text": "\n12 Jan, 2017" }, { "code": null, "e": 367, "s": 52, "text": "This module performs conversions between Python values and C structs represented as Python bytes objects. Format strings are the mechanism used to specify the expected layout...
Python | Tabbed panel in kivy
18 Oct, 2021 Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications Kivy Tutorial – Learn Kivy with Examples. The TabbedPanel widget manage...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Oct, 2021" }, { "code": null, "e": 263, "s": 28, "text": "Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it doe...
Time Complexity where loop variable is incremented by 1, 2, 3, 4 ..
30 Oct, 2015 What is the time complexity of below code? void fun(int n){ int j = 1, i = 0; while (i < n) { // Some O(1) task i = i + j; j++; }} The loop variable ‘i’ is incremented by 1, 2, 3, 4, ... until i becomes greater than or equal to n. The value of i is x(x+1)/2 after x iterations. So ...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Oct, 2015" }, { "code": null, "e": 95, "s": 52, "text": "What is the time complexity of below code?" }, { "code": "void fun(int n){ int j = 1, i = 0; while (i < n) { // Some O(1) task i = i + j; j++; ...
How to draw an arc on a tkinter canvas?
The Canvas is a rectangular area intended for drawing pictures or other complex layouts. You can place graphics, text, widgets or frames on a Canvas. To draw an arc on a tkinter Canvas, we will use the create_arc() method of the Canvas and supply it with a set of coordinates to draw the arc. We can use create_arc() to ...
[ { "code": null, "e": 1337, "s": 1187, "text": "The Canvas is a rectangular area intended for drawing pictures or other complex layouts. You can place graphics, text, widgets or frames on a Canvas." }, { "code": null, "e": 1578, "s": 1337, "text": "To draw an arc on a tkinter Canv...
Parsing and converting HTML documents to XML format using Python
23 Aug, 2021 In this article, we are going to see how to parse and convert HTML documents to XML format using Python. It can be done in these ways: Using Ixml module. Using Beautifulsoup module. In this approach, we will use Python’s lxml library to parse the HTML document and write it to an encoded string representati...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Aug, 2021" }, { "code": null, "e": 133, "s": 28, "text": "In this article, we are going to see how to parse and convert HTML documents to XML format using Python." }, { "code": null, "e": 163, "s": 133, "text": "I...
Find the Nth term of the series 1, 2, 6, 21, 88, 445. . .
14 Jan, 2022 Given a positive integer N. The task is to find Nth term of the series: 1, 2, 6, 21, 88, 445, . . . Examples: Input: N = 3Output: 6 Input: N = 6Output: 445 Approach: The given sequence follows the following pattern- 1, (1 * 1 + 1 = 2), (2 * 2 + 2 = 6), (6 * 3 + 3 = 21), (21 * 4 + 4 = 88), (88 * 5 + 5 = 44...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Jan, 2022" }, { "code": null, "e": 100, "s": 28, "text": "Given a positive integer N. The task is to find Nth term of the series:" }, { "code": null, "e": 128, "s": 100, "text": "1, 2, 6, 21, 88, 445, . . ." }, ...
How can we run MySQL statements in batch mode?
We need to create a .sql file for running MySQL in batch mode. This file will contain the MySQL statements. Suppose I have hh.sql file in which I have written the statement select * from hh. With the help of the following command, we can run this file in batch mode − C:\Program Files\MySQL\bin>mysql -u root -p gaurav <...
[ { "code": null, "e": 1455, "s": 1187, "text": "We need to create a .sql file for running MySQL in batch mode. This file will contain the MySQL statements. Suppose I have hh.sql file in which I have written the statement select * from hh. With the help of the following command, we can run this file i...
Segregating negative and positive maintaining order and O(1) space
06 Jul, 2022 Segregation of negative and positive numbers in an array without using extra space, and maintaining insertion order and in O(n^2) time complexity.Examples: Input :9 12 11 -13 -5 6 -7 5 -3 -6 Output :-13 -5 -7 -3 -6 12 11 6 5 Input :5 11 -13 6 -7 5 Output :-13 -7 11 6 5 We have discussed ...
[ { "code": null, "e": 54, "s": 26, "text": "\n06 Jul, 2022" }, { "code": null, "e": 211, "s": 54, "text": "Segregation of negative and positive numbers in an array without using extra space, and maintaining insertion order and in O(n^2) time complexity.Examples: " }, { "co...
How to build an HTML table using ReactJS from arrays ?
07 Apr, 2021 If we have an array and want to build an HTML table of it using ReactJS we can use the map function. The map() method iterates through each element of the array and will convert it into a table row. First, we will create a table tag then first, we will iterate through the heading/column names of the table ...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Apr, 2021" }, { "code": null, "e": 503, "s": 28, "text": "If we have an array and want to build an HTML table of it using ReactJS we can use the map function. The map() method iterates through each element of the array and will conve...
Count the numbers divisible by 'M' in a given range - GeeksforGeeks
26 Apr, 2022 A and B are two numbers which define a range, where A <= B. Find the total numbers in the given range [A ... B] divisible by ‘M’Examples: Input : A = 25, B = 100, M = 30 Output : 3 Explanation : In the given range [25 - 100], 30, 60 and 90 are divisible by 30 Input : A = 6, B = 15, M = 3 Output : 4 Ex...
[ { "code": null, "e": 25392, "s": 25364, "text": "\n26 Apr, 2022" }, { "code": null, "e": 25532, "s": 25392, "text": "A and B are two numbers which define a range, where A <= B. Find the total numbers in the given range [A ... B] divisible by ‘M’Examples: " }, { "code": n...
AutoML for Object Detection: How to Train a Model to Identify Potholes | by Déborah Mesquita | Towards Data Science
Initial algorithm selection and hyperparameter optimization are activities that I personally don’t like doing. If you’re like me then maybe you’ll like Automated Machine Learning (AutoML), a technique where we can let the scripts do these time-consuming ML tasks for us. The Azure Machine Learning (AML) is a cloud servi...
[ { "code": null, "e": 443, "s": 172, "text": "Initial algorithm selection and hyperparameter optimization are activities that I personally don’t like doing. If you’re like me then maybe you’ll like Automated Machine Learning (AutoML), a technique where we can let the scripts do these time-consuming M...
Convert Character Matrix to Numeric Matrix in R - GeeksforGeeks
09 May, 2021 In this article, we are going to see how to convert a given character matrix to numeric in R Programming Language. Converting the Character Matrix to Numeric Matrix we will use as.numeric() & matrix() Functions. as.numeric() function: This function is used to convert a given column into a numeric value col...
[ { "code": null, "e": 25242, "s": 25214, "text": "\n09 May, 2021" }, { "code": null, "e": 25454, "s": 25242, "text": "In this article, we are going to see how to convert a given character matrix to numeric in R Programming Language. Converting the Character Matrix to Numeric Matri...
DirectX - Creating App
This chapter involves the process of creating new application with DirectX using Visual Studio Code Editor. Following steps should be followed for creating an app in DirectX − Here we will start by constructing a DirectX project with a walk through of the basic steps to get a working application. To create a DirectX “n...
[ { "code": null, "e": 2474, "s": 2298, "text": "This chapter involves the process of creating new application with DirectX using Visual Studio Code Editor. Following steps should be followed for creating an app in DirectX −" }, { "code": null, "e": 2596, "s": 2474, "text": "Here w...
Deploy and Monitor your ML Application with Flask and WhyLabs | by Felipe de Pontes Adachi | Towards Data Science
One of the best milestones in every AI builder’s journey is the day when a model is ready to graduate from training and get deployed into production. According to a recent survey done by Algorithmia, most organizations already have more than 25 models in production. This underscores how enterprises are increasingly rel...
[ { "code": null, "e": 928, "s": 46, "text": "One of the best milestones in every AI builder’s journey is the day when a model is ready to graduate from training and get deployed into production. According to a recent survey done by Algorithmia, most organizations already have more than 25 models in p...
Python - Draw Star Using Turtle Graphics - GeeksforGeeks
16 Oct, 2020 In this article, we will learn how to make a Star using Turtle Graphics in Python. For that let’s first know what is Turtle Graphics. Turtle is a Python feature like a drawing board, which let us command a turtle to draw all over it! We can use many turtle functions which can move the turtle around. Turtle...
[ { "code": null, "e": 24213, "s": 24185, "text": "\n16 Oct, 2020" }, { "code": null, "e": 24347, "s": 24213, "text": "In this article, we will learn how to make a Star using Turtle Graphics in Python. For that let’s first know what is Turtle Graphics." }, { "code": null, ...
Pandas vs Tidyverse on Textual Data | by Soner Yıldırım | Towards Data Science
Textual data does not usually come in a nice and clean format so it requires a lot of preprocessing and manipulation. A substantial amount or raw data is textual so a data analysis library should be able to handle strings very well. In this article, we will compare two popular libraries in terms of working on strings. ...
[ { "code": null, "e": 404, "s": 171, "text": "Textual data does not usually come in a nice and clean format so it requires a lot of preprocessing and manipulation. A substantial amount or raw data is textual so a data analysis library should be able to handle strings very well." }, { "code": ...
A Complete Guide to Using TensorBoard with PyTorch | by Ajinkya Pahinkar | Towards Data Science
In this article, we will be integrating TensorBoard into our PyTorch project. TensorBoard is a suite of web applications for inspecting and understanding your model runs and graphs. TensorBoard currently supports five visualizations: scalars, images, audio, histograms, and graphs. In this guide, we will be covering all...
[ { "code": null, "e": 598, "s": 171, "text": "In this article, we will be integrating TensorBoard into our PyTorch project. TensorBoard is a suite of web applications for inspecting and understanding your model runs and graphs. TensorBoard currently supports five visualizations: scalars, images, audi...
Data Mining - Quick Guide
There is a huge amount of data available in the Information Industry. This data is of no use until it is converted into useful information. It is necessary to analyze this huge amount of data and extract useful information from it. Extraction of information is not the only process we need to perform; data mining also i...
[ { "code": null, "e": 2342, "s": 2110, "text": "There is a huge amount of data available in the Information Industry. This data is of no use until it is converted into useful information. It is necessary to analyze this huge amount of data and extract useful information from it." }, { "code":...
Python | Convert String to bytes - GeeksforGeeks
22 May, 2019 Inter conversions are as usual quite popular, but conversion between a string to bytes is more common these days due to the fact that for handling files or Machine Learning ( Pickle File ), we extensively require the strings to be converted to bytes. Let’s discuss certain ways in which this can be performe...
[ { "code": null, "e": 24317, "s": 24289, "text": "\n22 May, 2019" }, { "code": null, "e": 24627, "s": 24317, "text": "Inter conversions are as usual quite popular, but conversion between a string to bytes is more common these days due to the fact that for handling files or Machine...
Git Setup for Mac Users. Mac users, let’s setup Git the right... | by Joseph Robinson, PhD | Towards Data Science
I stumbled upon Medium a few months ago — initially, I found the content broad in scope and material keen on quality — already there have been significant improvements found in blogs and overall interface. With that, and as I configure a new iMac for the lab (i.e., SMILE Lab — more on this later), I figured I would rec...
[ { "code": null, "e": 705, "s": 172, "text": "I stumbled upon Medium a few months ago — initially, I found the content broad in scope and material keen on quality — already there have been significant improvements found in blogs and overall interface. With that, and as I configure a new iMac for the ...
Cutting edge semantic search and sentence similarity | by Daulet Nurmanbetov | Towards Data Science
We commonly spend a lot of time looking for a specific piece of information in a large document. And we commonly find if using CTRL + F. The proverbial Google-fu, the art of effectively searching for information on google is a valuable skill in a 21st-century workplace. All of humanity’s knowledge is available to us, i...
[ { "code": null, "e": 604, "s": 171, "text": "We commonly spend a lot of time looking for a specific piece of information in a large document. And we commonly find if using CTRL + F. The proverbial Google-fu, the art of effectively searching for information on google is a valuable skill in a 21st-cen...
Django – Handling multiple forms in single view
We sometimes need to handle multiple forms in a single function or view. In this article, we will see how to write a function which will handle two forms at the same time and in same view. It is handy in many cases; we will handle more than two forms too. Create a Django project and an app, I named the project "multipl...
[ { "code": null, "e": 1318, "s": 1062, "text": "We sometimes need to handle multiple forms in a single function or view. In this article, we will see how to write a function which will handle two forms at the same time and in same view. It is handy in many cases; we will handle more than two forms to...
Check if a prime number can be expressed as sum of two Prime Numbers in Python
Suppose we have a prime number n. we have to check whether we can express n as x + y where x and y are also two prime numbers. So, if the input is like n = 19, then the output will be True as we can express it like 19 = 17 + 2 To solve this, we will follow these steps − Define a function isPrime() . This will take numb...
[ { "code": null, "e": 1189, "s": 1062, "text": "Suppose we have a prime number n. we have to check whether we can express n as x + y where x and y are also two prime numbers." }, { "code": null, "e": 1289, "s": 1189, "text": "So, if the input is like n = 19, then the output will b...
Grant MySQL table and column permissions using Python - GeeksforGeeks
20 May, 2021 MySQL server is an open-source relational database management system that is a major support for web-based applications. Databases and related tables are the main component of many websites and applications as the data is stored and exchanged over the web. In order to access MySQL databases from a web serv...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n20 May, 2021" }, { "code": null, "e": 24676, "s": 24292, "text": "MySQL server is an open-source relational database management system that is a major support for web-based applications. Databases and related tables are the main ...
Program for power of a complex number in O(log n) in C++
Given a complex number in the form of x+yi and an integer n; the task is calculate and print the value of the complex number if we power the complex number by n. What is a complex number? A complex number is number which can be written in the form of a + bi, where a and b are the real numbers and i is the solution of t...
[ { "code": null, "e": 1224, "s": 1062, "text": "Given a complex number in the form of x+yi and an integer n; the task is calculate and print the value of the complex number if we power the complex number by n." }, { "code": null, "e": 1250, "s": 1224, "text": "What is a complex nu...
Interchanging first and second halves of strings - GeeksforGeeks
06 Aug, 2021 Given two strings and . Create two new strings by exchanging the first half and second half of one of the strings with the first half and second half of the other string respectively. Examples: Input : fighter warrior Output :warhter figrior Input :remuneration day Output :dration ...
[ { "code": null, "e": 24634, "s": 24606, "text": "\n06 Aug, 2021" }, { "code": null, "e": 24818, "s": 24634, "text": "Given two strings and . Create two new strings by exchanging the first half and second half of one of the strings with the first half and second half of the other ...
Bulma | Box - GeeksforGeeks
18 Jun, 2020 Bulma is a free, and open source CSS framework based on Flexbox. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses classes to implement its design.The box element is simply a container with a shadow, a border, a radius, and some padding. We can use this in ma...
[ { "code": null, "e": 26108, "s": 26080, "text": "\n18 Jun, 2020" }, { "code": null, "e": 26493, "s": 26108, "text": "Bulma is a free, and open source CSS framework based on Flexbox. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses ...
PyCaret and Streamlit: How to Create and Deploy Data Science Web App | by Ruben Winastwan | Towards Data Science
Building and deploying a machine learning model have never been easier. Right now, we have a lot of frameworks and libraries that enable us to build machine learning models with just a few lines of code. Among all of them, PyCaret is one of the best. To create and deploy a web app for our data science project, Streamli...
[ { "code": null, "e": 526, "s": 172, "text": "Building and deploying a machine learning model have never been easier. Right now, we have a lot of frameworks and libraries that enable us to build machine learning models with just a few lines of code. Among all of them, PyCaret is one of the best. To c...
Python - Visualizing image in different color spaces
OpenCV-Python is a library of Python bindings designed to solve computer vision problems. OpenCV-Python makes use of Numpy, which is a highly optimized library for numerical operations with a MATLAB-style syntax. All the OpenCV array structures are converted to and from Numpy arrays. # read image as RGB # Importing cv2...
[ { "code": null, "e": 1347, "s": 1062, "text": "OpenCV-Python is a library of Python bindings designed to solve computer vision problems. OpenCV-Python makes use of Numpy, which is a highly optimized library for numerical operations with a MATLAB-style syntax. All the OpenCV array structures are conv...
How to switch to new window in Selenium for Python?
Selenium can switch to new windows when there are multiple windows opened. There may be scenarios when filling a date field in a form opens to a new window or clicking a link, button or an advertisement opens a new tab. Selenium uses the current_window_handle and window_handles methods to work with new windows. The win...
[ { "code": null, "e": 1282, "s": 1062, "text": "Selenium can switch to new windows when there are multiple windows opened. There may be scenarios when filling a date field in a form opens to a new window or clicking a link, button or an advertisement opens a new tab." }, { "code": null, "...
Get data inside a button tag using BeautifulSoup - GeeksforGeeks
26 Mar, 2021 Sometimes while working with BeautifulSoup, are you stuck at the point where you have to get data inside a button tag? Don’t worry. Just read the article and get to know how you can do the same. For instance, consider this simple page source having a button tag. HTML <!DOCTYPE html><html lang="en"><head> ...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n26 Mar, 2021" }, { "code": null, "e": 24487, "s": 24292, "text": "Sometimes while working with BeautifulSoup, are you stuck at the point where you have to get data inside a button tag? Don’t worry. Just read the article and get t...
Initialize HashMap in Java - GeeksforGeeks
11 Dec, 2018 HashMap is a part of java.util package.HashMap extends an abstract class AbstractMap which also provides an incomplete implementation of Map interface. It stores the data in (Key, Value) pairs.We can initialize HashMap using the constructor in four different ways :1.HashMap()It is the default constructor w...
[ { "code": null, "e": 24001, "s": 23973, "text": "\n11 Dec, 2018" }, { "code": null, "e": 24379, "s": 24001, "text": "HashMap is a part of java.util package.HashMap extends an abstract class AbstractMap which also provides an incomplete implementation of Map interface. It stores t...
Python read data from MySQL Database - onlinetutorialspoint
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 tutorial, we’ll show how to read data...
[ { "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, ...
Create a table inside a MySQL stored procedure and insert a record on calling the procedure
Create a table inside the stored procedure and use INSERT as well − mysql> DELIMITER // mysql> CREATE PROCEDURE create_TableDemo(id int,name varchar(100),age int) BEGIN CREATE TABLE DemoTable ( ClientId int NOT NULL, ClientName varchar(30), ClientAge int, PRIMARY KEY(ClientId) ); ...
[ { "code": null, "e": 1130, "s": 1062, "text": "Create a table inside the stored procedure and use INSERT as well −" }, { "code": null, "e": 1518, "s": 1130, "text": "mysql> DELIMITER //\nmysql> CREATE PROCEDURE create_TableDemo(id int,name varchar(100),age int)\n BEGIN\n CREA...
File Permissions in Java - GeeksforGeeks
22 Apr, 2022 Java provides a number of method calls to check and change the permission of a file, such as a read-only file can be changed to have permissions to write. File permissions are required to be changed when the user wants to restrict the operations permissible on a file. For example, file permission can be ch...
[ { "code": null, "e": 27876, "s": 27848, "text": "\n22 Apr, 2022" }, { "code": null, "e": 28265, "s": 27876, "text": "Java provides a number of method calls to check and change the permission of a file, such as a read-only file can be changed to have permissions to write. File per...
k size subsets with maximum difference d between max and min - GeeksforGeeks
25 Aug, 2021 C++ // C++ code to find no. of subsets with// maximum difference d between max and#include <bits/stdc++.h>using namespace std; // function to calculate factorial of a numbint fact(int i){ if (i == 0) return 1; return i * fact(i - 1);} int ans(int a[], int n, int k, int x){ if (k > n || n <...
[ { "code": null, "e": 24431, "s": 24403, "text": "\n25 Aug, 2021" }, { "code": null, "e": 24435, "s": 24431, "text": "C++" }, { "code": "// C++ code to find no. of subsets with// maximum difference d between max and#include <bits/stdc++.h>using namespace std; // function t...
Python | Convert String ranges to list - GeeksforGeeks
26 Nov, 2019 Sometimes, while working in applications we can have a problem in which we are given a naive string which provides ranges separated by a hyphen and other numbers separated by commas. This problem can occur across many places. Let’s discuss certain ways in which this problem can be solved. Method #1 : Using...
[ { "code": null, "e": 23901, "s": 23873, "text": "\n26 Nov, 2019" }, { "code": null, "e": 24191, "s": 23901, "text": "Sometimes, while working in applications we can have a problem in which we are given a naive string which provides ranges separated by a hyphen and other numbers s...
Put your Data Analysis in an R Package — Even if You Don’t Publish it | by Denis Gontcharov | Towards Data Science
A data analysis project consists of many different files: raw data, R scripts, R Markdown reports and Shiny apps. We need a sensible project folder structure to stay organized. Why not take advantage of R’s established package development workflow? Working on our analysis inside an R package offers four benefits: R pac...
[ { "code": null, "e": 421, "s": 172, "text": "A data analysis project consists of many different files: raw data, R scripts, R Markdown reports and Shiny apps. We need a sensible project folder structure to stay organized. Why not take advantage of R’s established package development workflow?" }, ...
SysIdentPy: A Python package for modeling nonlinear dynamical data | by Wilson Rocha | Towards Data Science
Mathematical models plays a key role and science and engineering. We see researchers and data-driven professionals using many different models to analyse and predict load demand, cash demand, stock exchange data, biomedical data, chemical process and many more. When the data is a result of a dynamical system, autoregre...
[ { "code": null, "e": 434, "s": 172, "text": "Mathematical models plays a key role and science and engineering. We see researchers and data-driven professionals using many different models to analyse and predict load demand, cash demand, stock exchange data, biomedical data, chemical process and many...
Minimum Number of Platforms Required for a Railway Station using C++.
Given arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for the railway station so that no train waits. We are given two arrays that represent arrival and departure times of trains that stop. For below input, we need at least 3 platforms...
[ { "code": null, "e": 1249, "s": 1062, "text": "Given arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for the railway station so that no train waits." }, { "code": null, "e": 1337, "s": 1249, "tex...
GET and POST requests using Python - GeeksforGeeks
12 May, 2022 This post discusses two HTTP (Hypertext Transfer Protocol) request methods GET and POST requests in Python and their implementation in python. What is HTTP?HTTP is a set of protocols designed to enable communication between clients and servers. It works as a request-response protocol between a client and ...
[ { "code": null, "e": 25879, "s": 25851, "text": "\n12 May, 2022" }, { "code": null, "e": 26023, "s": 25879, "text": "This post discusses two HTTP (Hypertext Transfer Protocol) request methods GET and POST requests in Python and their implementation in python." }, { "code...
Delete the last leaf node in a Binary Tree - GeeksforGeeks
17 Jan, 2022 Given a Binary Tree, the task is to find and DELETE the last leaf node.The leaf node is a node with no children. The last leaf node would be the node that is traversed last in sequence during Level Order Traversal. The problem statement is to identify this last visited node and delete this particular node....
[ { "code": null, "e": 26185, "s": 26157, "text": "\n17 Jan, 2022" }, { "code": null, "e": 26505, "s": 26185, "text": "Given a Binary Tree, the task is to find and DELETE the last leaf node.The leaf node is a node with no children. The last leaf node would be the node that is trave...
aplay command in Linux with examples - GeeksforGeeks
05 Mar, 2019 aplay is a command-line audio player for ALSA(Advanced Linux Sound Architecture) sound card drivers. It supports several file formats and multiple soundcards with multiple devices. It is basically used to play audio on command-line interface. aplay is much the same as arecord only it plays instead of recor...
[ { "code": null, "e": 25489, "s": 25461, "text": "\n05 Mar, 2019" }, { "code": null, "e": 25937, "s": 25489, "text": "aplay is a command-line audio player for ALSA(Advanced Linux Sound Architecture) sound card drivers. It supports several file formats and multiple soundcards with ...
How to create a revealing sidebar using HTML, CSS and JavaScript ? - GeeksforGeeks
31 Mar, 2021 In this article, we are going to create a rotating navigation bar by using simple HTML CSS, and JavaScript. The content of the page will rotate and the navigation bar will reveal itself when the menu button is clicked. Approach: Create an HTML file in which we are going headings and a navigation bar. Creat...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n31 Mar, 2021" }, { "code": null, "e": 26840, "s": 26621, "text": "In this article, we are going to create a rotating navigation bar by using simple HTML CSS, and JavaScript. The content of the page will rotate and the navigation ...
Queries to count connected components after removal of a vertex from a Tree - GeeksforGeeks
07 Oct, 2021 Given a Tree consisting of N nodes valued in the range [0, N) and an array Queries[] of Q integers consisting of values in the range [0, N). The task for each query is to remove the vertex valued Q[i] and count the connected components in the resulting graph. Examples: Input: N = 7, Edges[][2] = {{0, 1}, {...
[ { "code": null, "e": 26369, "s": 26341, "text": "\n07 Oct, 2021" }, { "code": null, "e": 26629, "s": 26369, "text": "Given a Tree consisting of N nodes valued in the range [0, N) and an array Queries[] of Q integers consisting of values in the range [0, N). The task for each quer...
Percentile rank of a column in a Pandas DataFrame - GeeksforGeeks
17 Aug, 2020 Let us see how to find the percentile rank of a column in a Pandas DataFrame. We will use the rank() function with the argument pct = True to find the percentile rank. Example 1 : # import the moduleimport pandas as pd # create a DataFrame data = {'Name': ['Mukul', 'Rohan', 'Mayank', 'Sh...
[ { "code": null, "e": 25503, "s": 25475, "text": "\n17 Aug, 2020" }, { "code": null, "e": 25671, "s": 25503, "text": "Let us see how to find the percentile rank of a column in a Pandas DataFrame. We will use the rank() function with the argument pct = True to find the percentile r...
Java Program to Count Number of Digits in a String - GeeksforGeeks
30 Apr, 2021 The string is a sequence of characters. In java, objects of String are immutable. Immutable means that once an object is created, it’s content can’t change. Complete traversal in the string is required to find the total number of digits in a string. Examples: Input : string = "GeeksforGeeks password is : 1...
[ { "code": null, "e": 25673, "s": 25645, "text": "\n30 Apr, 2021" }, { "code": null, "e": 25923, "s": 25673, "text": "The string is a sequence of characters. In java, objects of String are immutable. Immutable means that once an object is created, it’s content can’t change. Comple...
Python | sympy.symbols() method - GeeksforGeeks
02 Aug, 2019 With the help of sympy.symbols() method, we can declare some variables for the use of mathematical expression and polynomials by using sympy.symbols() method. Syntax : sympy.symbols()Return : Return nothing or None. Example #1 :In this example we can see that by using sympy.symbols() method, we are able to...
[ { "code": null, "e": 25561, "s": 25533, "text": "\n02 Aug, 2019" }, { "code": null, "e": 25720, "s": 25561, "text": "With the help of sympy.symbols() method, we can declare some variables for the use of mathematical expression and polynomials by using sympy.symbols() method." }...
Python | Catching the ball game - GeeksforGeeks
13 May, 2022 Python is a multipurpose language and can be used in almost every field of development. Python can also be used to develop different type of game. Let’s try to develop a simple Catching the ball game using Python and TKinter.Game is very simple. There is one bar at the bottom of game window which can be mo...
[ { "code": null, "e": 26021, "s": 25993, "text": "\n13 May, 2022" }, { "code": null, "e": 27007, "s": 26021, "text": "Python is a multipurpose language and can be used in almost every field of development. Python can also be used to develop different type of game. Let’s try to dev...
Python range() function - GeeksforGeeks
11 Apr, 2022 Python range() function returns the sequence of the given number between the given range. range() is a built-in function of Python. It is used when a user needs to perform an action a specific number of times. range() in Python(3.x) is just a renamed version of a function called xrange in Python(2.x). The ...
[ { "code": null, "e": 25513, "s": 25485, "text": "\n11 Apr, 2022" }, { "code": null, "e": 25603, "s": 25513, "text": "Python range() function returns the sequence of the given number between the given range." }, { "code": null, "e": 25881, "s": 25603, "text": "...
Program to print the series 2, 15, 41, 80, 132, 197... till N terms - GeeksforGeeks
19 Mar, 2021 Given a number N, the task is to print the first N terms of the following series: 2 15 41 80 132 197 275 366 470 587... Examples: Input: N = 7 Output: 2 15 41 80 132 197 275 Input: N = 3 Output: 2 15 41 Approach: From the given series we can find the formula for Nth term: 1st term = 2 2nd term = 15 = 13...
[ { "code": null, "e": 25937, "s": 25909, "text": "\n19 Mar, 2021" }, { "code": null, "e": 26020, "s": 25937, "text": "Given a number N, the task is to print the first N terms of the following series: " }, { "code": null, "e": 26058, "s": 26020, "text": "2 15 41...
How to import and export data using CSV files in PostgreSQL - GeeksforGeeks
23 Sep, 2021 In this article, we are going to see how to import and export data using CSV file in PostgreSQL, the data in CSV files can be easily imported and exported using PostgreSQL. To create a CSV file, open any text editor (notepad, vim, atom). Write the column names in the first line. Add row values separated by...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n23 Sep, 2021" }, { "code": null, "e": 25710, "s": 25537, "text": "In this article, we are going to see how to import and export data using CSV file in PostgreSQL, the data in CSV files can be easily imported and exported using Po...