title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
How to Apply K-means Clustering to Time Series Data | by Alexandra Amidon | Towards Data Science
Clustering is an unsupervised learning task where an algorithm groups similar data points without any “ground truth” labels. Similarity between data points is measured with a distance metric, commonly Euclidean distance. Clustering different time series into similar groups is a challenging clustering task because each ...
[ { "code": null, "e": 393, "s": 172, "text": "Clustering is an unsupervised learning task where an algorithm groups similar data points without any “ground truth” labels. Similarity between data points is measured with a distance metric, commonly Euclidean distance." }, { "code": null, "e...
Closest perfect square and its distance
30 Jun, 2022 Given a positive integer . The task is to find the perfect square number closest to N and steps required to reach this number from N.Note: The closest perfect square to N can be either less than, equal to or greater than N and steps are referred to as the difference between N and the closest perfect square...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 Jun, 2022" }, { "code": null, "e": 374, "s": 54, "text": "Given a positive integer . The task is to find the perfect square number closest to N and steps required to reach this number from N.Note: The closest perfect square to N can...
Hierarchical Clustering in R Programming
03 Dec, 2021 Hierarchical clustering in R Programming Language is an Unsupervised non-linear algorithm in which clusters are created such that they have a hierarchy(or a pre-determined ordering). For example, consider a family of up to three generations. A grandfather and mother have their children that become father a...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Dec, 2021" }, { "code": null, "e": 444, "s": 28, "text": "Hierarchical clustering in R Programming Language is an Unsupervised non-linear algorithm in which clusters are created such that they have a hierarchy(or a pre-determined ord...
unordered_set size() function in C++ STL
28 Jun, 2022 The unordered_set::size() method is a builtin function in C++ STL which is used to return the number of elements in the unordered_set container. Syntax: unordered_set_name.size() Parameter: It does not accepts any parameter. Return Value: The function returns the number of elements in the container. Below ...
[ { "code": null, "e": 53, "s": 25, "text": "\n28 Jun, 2022" }, { "code": null, "e": 206, "s": 53, "text": "The unordered_set::size() method is a builtin function in C++ STL which is used to return the number of elements in the unordered_set container. Syntax:" }, { "code":...
Custom Snackbars in Android
23 Feb, 2021 SnackBars plays a very important role in the user experience. The snack bar which may or may not contain the action button to do shows the message which had happened due to the user interaction immediately. So in this article, it’s been discussed how the SnackBars can be implemented using custom layouts. H...
[ { "code": null, "e": 54, "s": 26, "text": "\n23 Feb, 2021" }, { "code": null, "e": 580, "s": 54, "text": "SnackBars plays a very important role in the user experience. The snack bar which may or may not contain the action button to do shows the message which had happened due to t...
patch - Unix, Linux Command
but usually just patch -pnum <patchfile Upon startup, patch attempts to determine the type of the diff listing, unless overruled by a -c (--context), -e (--ed), -n (--normal), or -u (--unified) option. Context diffs (old-style, new-style, and unified) and normal diffs are applied by the patch program itself, while...
[ { "code": null, "e": 10731, "s": 10711, "text": "\n\nbut usually just\n" }, { "code": null, "e": 10757, "s": 10731, "text": "\n\npatch -pnum <patchfile " }, { "code": null, "e": 11091, "s": 10757, "text": "\nUpon startup, patch attempts to determine the type o...
SQL – SELECT NULL
17 Jun, 2021 The word NULL is used to describe a missing value in SQL. In a table, a NULL value is a value in a field that appears to be empty. A field with a NULL value is the same as one that has no value. It’s important to grasp the difference between a NULL value and a zero value or a field of spaces. There are two...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Jun, 2021" }, { "code": null, "e": 322, "s": 28, "text": "The word NULL is used to describe a missing value in SQL. In a table, a NULL value is a value in a field that appears to be empty. A field with a NULL value is the same as one...
How to Write Data to Text File in Excel VBA?
29 Oct, 2021 This VBA Program reads an Excel Range (Sales Data) and write to a Text file (Sales.txt) Excel VBA code to read data from an Excel file (Sales Data – Range “A1:E26”). Need two “For loop” for rows and columns. Write each value with a comma in the text file till the end of columns (write without comma only t...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Oct, 2021" }, { "code": null, "e": 116, "s": 28, "text": "This VBA Program reads an Excel Range (Sales Data) and write to a Text file (Sales.txt)" }, { "code": null, "e": 406, "s": 116, "text": "Excel VBA code to ...
How to scale an Image in ImageView to keep the aspect ratio in Android?
This example demonstrates how to scale an Image in ImageView to keep the aspect ratio in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. <?xml version="1.0" encoding...
[ { "code": null, "e": 1285, "s": 1187, "text": "This example demonstrates how to scale an Image in ImageView to keep the aspect ratio in Android." }, { "code": null, "e": 1414, "s": 1285, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill a...
LTRIM() Function in SQL Server
16 Dec, 2020 LTRIM() function helps to return remove all the space characters found on the left-hand side of the string. Syntax : LTRIM(string, [trim_string]) Parameter : string – The string from which the leading space character would be removed. trim_string – It is an optional parameter that specifies the characters ...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Dec, 2020" }, { "code": null, "e": 136, "s": 28, "text": "LTRIM() function helps to return remove all the space characters found on the left-hand side of the string." }, { "code": null, "e": 145, "s": 136, "text":...
Difference between Natural join and Inner Join in SQL
31 Aug, 2021 Prerequisite – Join (Inner, Left, Right and Full Joins) 1. Natural Join : Natural Join joins two tables based on same attribute name and datatypes. The resulting table will contain all the attributes of both the table but keep only one copy of each common column. Example: Consider the two tables given bel...
[ { "code": null, "e": 53, "s": 25, "text": "\n31 Aug, 2021" }, { "code": null, "e": 318, "s": 53, "text": "Prerequisite – Join (Inner, Left, Right and Full Joins) 1. Natural Join : Natural Join joins two tables based on same attribute name and datatypes. The resulting table will c...
MVVM – Validations
In this chapter, we will learn about validations. We will also look at a clean way to do validation with what WPF bindings already support but tying it into MVVM components. When your application starts accepting data input from end users you need to consider validating that input. When your application starts acceptin...
[ { "code": null, "e": 2116, "s": 1942, "text": "In this chapter, we will learn about validations. We will also look at a clean way to do validation with what WPF bindings already support but tying it into MVVM components." }, { "code": null, "e": 2225, "s": 2116, "text": "When you...
How to Change Contrast in OpenCV using C++?
Changing brightness and contrast are frequent editing effect in image processing.Here, we will learn how to change the contrast of images. Contrast controls the sharpness of the image. Higher the contrast the sharper the image, lower the contrast the smother the image. Changing the contrast means increasing the weight ...
[ { "code": null, "e": 1332, "s": 1062, "text": "Changing brightness and contrast are frequent editing effect in image processing.Here, we will learn how to change the contrast of images. Contrast controls the sharpness of the image. Higher the contrast the sharper the image, lower the contrast the sm...
Java Program to convert LocalDate to java.util.Date in UTC
Set the LocalDate to the current date − LocalDate date = LocalDate.now(); Convert to java.util.Date in UTC − Date.from(date.atStartOfDay().toInstant(ZoneOffset.UTC)) Live Demo import java.time.LocalDate; import java.time.ZoneOffset; import java.util.Date; public class Demo { public static void main(String[] args) {...
[ { "code": null, "e": 1102, "s": 1062, "text": "Set the LocalDate to the current date −" }, { "code": null, "e": 1136, "s": 1102, "text": "LocalDate date = LocalDate.now();" }, { "code": null, "e": 1171, "s": 1136, "text": "Convert to java.util.Date in UTC −" ...
Recursive Program for Binary to Decimal in C++
We are given a string containing a binary number. The goal is to find the equivalent decimal number using the recursive method. A binary number can be converted to decimal using following method-: Traverse from LSB to MSB and multiply each with power of 2i Where 0<=i<=no. of digits and all previous results to it. Input...
[ { "code": null, "e": 1190, "s": 1062, "text": "We are given a string containing a binary number. The goal is to find the equivalent decimal number using the recursive method." }, { "code": null, "e": 1377, "s": 1190, "text": "A binary number can be converted to decimal using foll...
RSA Cipher Encryption
In this chapter, we will focus on different implementation of RSA cipher encryption and the functions involved for the same. You can refer or include this python file for implementing RSA cipher algorithm implementation. The modules included for the encryption algorithm are as follows − from Crypto.PublicKey import RSA...
[ { "code": null, "e": 2513, "s": 2292, "text": "In this chapter, we will focus on different implementation of RSA cipher encryption and the functions involved for the same. You can refer or include this python file for implementing RSA cipher algorithm implementation." }, { "code": null, ...
The __index metamethod in Lua Programming
Whenever we try to access a field that hasn’t been declared in a table in Lua, the answer we get is nil. While this is true, but the reason for it is that when such access happens, the interpreter triggers a search for an __index metamethod and if it doesn’t find any method named __index, then we get nil as an answer; ...
[ { "code": null, "e": 1465, "s": 1062, "text": "Whenever we try to access a field that hasn’t been declared in a table in Lua, the answer we get is nil. While this is true, but the reason for it is that when such access happens, the interpreter triggers a search for an __index metamethod and if it do...
How to design Responsive card-deck with fixed width in Bootstrap ?
01 Jun, 2020 Bootstrap card provide us a lot of functionality that we can play around. We can also make them responsive and also of fixed size all depends on our need. So the code for the fixed size bootstrap card deck is given below. We have provided the code without using CSS properties so it looks much simpler and e...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Jun, 2020" }, { "code": null, "e": 356, "s": 28, "text": "Bootstrap card provide us a lot of functionality that we can play around. We can also make them responsive and also of fixed size all depends on our need. So the code for the ...
Types of Observables in RxJava
21 Sep, 2021 In the model-view paradigm, this class represents an observable object, or “data.” It can be subclassed in order to represent an object that the application wishes to watch. The issue is that you’re creating software that will render data describing a three-dimensional scene in two dimensions. The applicat...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Sep, 2021" }, { "code": null, "e": 416, "s": 28, "text": "In the model-view paradigm, this class represents an observable object, or “data.” It can be subclassed in order to represent an object that the application wishes to watch. T...
Principles of Programming Languages - GeeksforGeeks
22 Jan, 2014 Program main; Var ... Procedure A1; Var ... Call A2; End A1 Procedure A2; Var ... Procedure A21; Var ... Call A1; End A21 Call A21; End A21 Call A1; End main. I. A programming language which does not permit glob...
[ { "code": null, "e": 29577, "s": 29549, "text": "\n22 Jan, 2014" }, { "code": null, "e": 29832, "s": 29577, "text": "Program main;\n Var ...\n \n Procedure A1;\n Var ...\n Call A2;\n End A1\n \n Procedure A2;\n Var ...\n \n Procedure A21;\n ...
Hide and Unhide The Window in Tkinter – Python
04 Jul, 2021 Prerequisite: Tkinter Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to create...
[ { "code": null, "e": 53, "s": 25, "text": "\n04 Jul, 2021" }, { "code": null, "e": 75, "s": 53, "text": "Prerequisite: Tkinter" }, { "code": null, "e": 425, "s": 75, "text": "Python offers multiple options for developing GUI (Graphical User Interface). Out of ...
Maximum Product Cutting | DP-36
21 Jun, 2022 Given a rope of length n meters, cut the rope in different parts of integer lengths in a way that maximizes product of lengths of all parts. You must make at least one cut. Assume that the length of rope is more than 2 meters. Examples: Input: n = 2 Output: 1 (Maximum obtainable product is 1*1) Input: n...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Jun, 2022" }, { "code": null, "e": 282, "s": 54, "text": "Given a rope of length n meters, cut the rope in different parts of integer lengths in a way that maximizes product of lengths of all parts. You must make at least one cut. A...
tcpdump Command in Linux with Examples
03 Jun, 2020 tcpdump is a packet sniffing and packet analyzing tool for a System Administrator to troubleshoot connectivity issues in Linux. It is used to capture, filter, and analyze network traffic such as TCP/IP packets going through your system. It is many times used as a security tool as well. It saves the capture...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Jun, 2020" }, { "code": null, "e": 455, "s": 28, "text": "tcpdump is a packet sniffing and packet analyzing tool for a System Administrator to troubleshoot connectivity issues in Linux. It is used to capture, filter, and analyze netw...
Difference between Procedural and Non-Procedural language
28 May, 2019 Procedural Language:In procedural languages, the program code is written as a sequence of instructions. User has to specify “what to do” and also “how to do” (step by step procedure). These instructions are executed in the sequential order. These instructions are written to solve specific problems. Example...
[ { "code": null, "e": 53, "s": 25, "text": "\n28 May, 2019" }, { "code": null, "e": 353, "s": 53, "text": "Procedural Language:In procedural languages, the program code is written as a sequence of instructions. User has to specify “what to do” and also “how to do” (step by step pr...
Sum of n digit numbers divisible by a given number
02 Jun, 2022 Given n and a number, the task is to find the sum of n digit numbers that are divisible by given number. Examples: Input : n = 2, number = 7 Output : 728 There are thirteen n digit numbers that are divisible by 7. Numbers are : 14+ 21 + 28 + 35 + 42 + 49 + 56 + 63 +70 + 77 + 84 + 91 + 98. Input : n = 3...
[ { "code": null, "e": 54, "s": 26, "text": "\n02 Jun, 2022" }, { "code": null, "e": 159, "s": 54, "text": "Given n and a number, the task is to find the sum of n digit numbers that are divisible by given number." }, { "code": null, "e": 170, "s": 159, "text": "...
time.Nanoseconds() Function in Golang With Examples
21 Apr, 2020 In Go language, time packages supplies functionality for determining as well as viewing time. The Nanoseconds() function in Go language is used to find the duration of time in form of an integer nanosecond count. Moreover, this function is defined under the time package. Here, you need to import the “time”...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Apr, 2020" }, { "code": null, "e": 377, "s": 28, "text": "In Go language, time packages supplies functionality for determining as well as viewing time. The Nanoseconds() function in Go language is used to find the duration of time in...
SQL | Remove Duplicates without Distinct
06 Apr, 2020 DISTINCT is useful in certain circumstances, but it has drawback that it can increase load on the query engine to perform the sort (since it needs to compare the result set to itself to remove duplicates) Below are alternate solutions : 1. Remove Duplicates Using Row_Number. WITH CTE (Col1, Col2, Col3, Dup...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Apr, 2020" }, { "code": null, "e": 257, "s": 52, "text": "DISTINCT is useful in certain circumstances, but it has drawback that it can increase load on the query engine to perform the sort (since it needs to compare the result set t...
Where is an object stored if it is created inside a block in C++?
26 Nov, 2018 There are two parts of memory in which an object can be stored: stack – Memory from the stack is used by all the members which are declared inside blocks/functions. Note that the main is also a function.heap – This memory is unused and can be used to dynamically allocate the memory at runtime. stack – Memo...
[ { "code": null, "e": 53, "s": 25, "text": "\n26 Nov, 2018" }, { "code": null, "e": 117, "s": 53, "text": "There are two parts of memory in which an object can be stored:" }, { "code": null, "e": 348, "s": 117, "text": "stack – Memory from the stack is used by ...
How to check if a character in a string is a letter in Python?
You can use the isalpha() method from string class. It checks if a string consists only of alphabets. You can also use it to check if a character is an alphabet or not. For example, if you want to check if char at 5th index is letter or not, >>> s = "Hello people" >>> s[4].isalpha() True You can also check whole string...
[ { "code": null, "e": 1429, "s": 1187, "text": "You can use the isalpha() method from string class. It checks if a string consists only of alphabets. You can also use it to check if a character is an alphabet or not. For example, if you want to check if char at 5th index is letter or not," }, { ...
JavaTuples | Introduction
16 Sep, 2021 The word “tuple” means “a data structure consisting of multiple parts”. Hence Tuples can be defined as a data structure that can hold multiple values and these values may/may not be related to each other. Example: [Geeks, 123, &#*@] In this example, the values in the tuple are not at all related to each o...
[ { "code": null, "e": 53, "s": 25, "text": "\n16 Sep, 2021" }, { "code": null, "e": 258, "s": 53, "text": "The word “tuple” means “a data structure consisting of multiple parts”. Hence Tuples can be defined as a data structure that can hold multiple values and these values may/may...
How to download a CSV file in PHP that is triggered through a URL ?
11 Jun, 2020 Why do we need to download CSV files?Comma-Separated Values or CSV files are an important part of computer science. Almost every dataset required for training data science models are in CSV file format. Datasets are available all over the internet and it becomes the utmost necessity to have them readily on...
[ { "code": null, "e": 53, "s": 25, "text": "\n11 Jun, 2020" }, { "code": null, "e": 637, "s": 53, "text": "Why do we need to download CSV files?Comma-Separated Values or CSV files are an important part of computer science. Almost every dataset required for training data science mo...
Python Program to Split the array and add the first part to the end
26 Apr, 2020 There is a given an array and split it from a specified position, and move the first part of array add to the end. Examples: Input : arr[] = {12, 10, 5, 6, 52, 36} k = 2 Output : arr[] = {5, 6, 52, 36, 12, 10} Explanation : Split from index 2 and first part {12, 10} add to the end . Input : a...
[ { "code": null, "e": 54, "s": 26, "text": "\n26 Apr, 2020" }, { "code": null, "e": 169, "s": 54, "text": "There is a given an array and split it from a specified position, and move the first part of array add to the end." }, { "code": null, "e": 179, "s": 169, ...
Rename function in C/C++
The C library function int rename(const char *old_filename, const char *new_filename) causes the filename referred to by old_filename to be changed to new_filename Following is the declaration for rename() function. int rename(const char *old_filename, const char *new_filename) The parameters are old_filename − This is...
[ { "code": null, "e": 1351, "s": 1187, "text": "The C library function int rename(const char *old_filename, const char *new_filename) causes the filename referred to by old_filename to be changed to new_filename" }, { "code": null, "e": 1403, "s": 1351, "text": "Following is the d...
How to check if String is empty in Java?
The isEmpty() method of the String class returns true if the length of the current string is 0. Live Demo import java.lang.*; public class StringDemo { public static void main(String[] args) { String str = "tutorialspoint"; //prints length of string System.out.println("length of string = " + str.l...
[ { "code": null, "e": 1158, "s": 1062, "text": "The isEmpty() method of the String class returns true if the length of the current string is 0." }, { "code": null, "e": 1168, "s": 1158, "text": "Live Demo" }, { "code": null, "e": 1515, "s": 1168, "text": "impor...
How to display column values as CSV in MySQL?
To display column values as CSV, use GROUP_CONCAT(). Let us first create a table − mysql> create table DemoTable786 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100) ) AUTO_INCREMENT=101; Query OK, 0 rows affected (0.70 sec) Insert some records in the table using insert command − mys...
[ { "code": null, "e": 1115, "s": 1062, "text": "To display column values as CSV, use GROUP_CONCAT()." }, { "code": null, "e": 1145, "s": 1115, "text": "Let us first create a table −" }, { "code": null, "e": 1323, "s": 1145, "text": "mysql> create table DemoTabl...
Sqoop - Import All Tables
This chapter describes how to import all the tables from the RDBMS database server to the HDFS. Each table data is stored in a separate directory and the directory name is same as the table name. The following syntax is used to import all tables. $ sqoop import-all-tables (generic-args) (import-args) $ sqoop-import-al...
[ { "code": null, "e": 1983, "s": 1787, "text": "This chapter describes how to import all the tables from the RDBMS database server to the HDFS. Each table data is stored in a separate directory and the directory name is same as the table name." }, { "code": null, "e": 2034, "s": 1983,...
Ishaan's Internship | Practice | GeeksforGeeks
Ishaan wants to intern at GeeksForGeeks but for that he has to go through a test. There are n candidates applying for the internship including Ishaan and only one is to be selected. Since he wants to qualify he asks you to help him. The test is as follows. The candidates are asked to stand in a line at positions 1 to n...
[ { "code": null, "e": 859, "s": 238, "text": "Ishaan wants to intern at GeeksForGeeks but for that he has to go through a test. There are n candidates applying for the internship including Ishaan and only one is to be selected.\nSince he wants to qualify he asks you to help him. The test is as follow...
Grabbing Geodata From Your Photo Library Using Python | by Aaron S | Towards Data Science
So one of the many talents my girlfriend has is photography. However she has over 100,000 photos which require sorting out primarily into year and city. She primarily does location based photography and finds writing essays about certain areas of the world easier when she has all of them in one place. This is a mammoth...
[ { "code": null, "e": 475, "s": 172, "text": "So one of the many talents my girlfriend has is photography. However she has over 100,000 photos which require sorting out primarily into year and city. She primarily does location based photography and finds writing essays about certain areas of the worl...
Finding a specific item in subdocument with MongoDB?
To get a specific item in a sudocument, use the dot(.) notation. Let us create a collection with documents − > db.demo81.insertOne({"StudentDetails":[{"StudentName":"Carol","StudentSubject":"Java"},{ "StudentName" : "David", "StudentSubject" : "MongoDB" }]}); { "acknowledged" : true, "insertedId" : ObjectId("5e2b...
[ { "code": null, "e": 1171, "s": 1062, "text": "To get a specific item in a sudocument, use the dot(.) notation. Let us create a collection with documents −" }, { "code": null, "e": 1872, "s": 1171, "text": "> db.demo81.insertOne({\"StudentDetails\":[{\"StudentName\":\"Carol\",\"S...
How to check if a div is visible using jQuery?
You can use .is(‘:visible’) selects all elements that are visible. <html> <head> <title>divvisible</title> <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("button").click(function () { var...
[ { "code": null, "e": 1129, "s": 1062, "text": "You can use .is(‘:visible’) selects all elements that are visible." }, { "code": null, "e": 1744, "s": 1129, "text": "<html>\n<head>\n<title>divvisible</title>\n <script src=\"../../Scripts/jquery-1.4.1.min.js\" type=\"text/javascr...
Frequentist vs Bayesian Statistics | by Gabrielgilling | Towards Data Science
Whether it be an outcome that is yet to occur, or a reality that we cannot yet glimpse, we are obsessed with knowing the unknown. We spend immense resources in hopes of producing more accurate predictions of the future, and relish those whose forecasts consistently get it right. Over the past century, the burgeoning fi...
[ { "code": null, "e": 942, "s": 172, "text": "Whether it be an outcome that is yet to occur, or a reality that we cannot yet glimpse, we are obsessed with knowing the unknown. We spend immense resources in hopes of producing more accurate predictions of the future, and relish those whose forecasts co...
Implement Form Validation (Error to EditText) in Android - GeeksforGeeks
08 Oct, 2021 In many of the already existing Android applications when it comes to the forms, where it includes user details. If the user enters the wrong information to the text fields or if the user leaves the text fields without filling it, there is a need to provide certain alert information to the TextFields which...
[ { "code": null, "e": 25875, "s": 25847, "text": "\n08 Oct, 2021" }, { "code": null, "e": 26504, "s": 25875, "text": "In many of the already existing Android applications when it comes to the forms, where it includes user details. If the user enters the wrong information to the te...
Euler's Totient Function - GeeksforGeeks
13 Mar, 2022 Euler’s Totient function Φ (n) for an input n is the count of numbers in {1, 2, 3, ..., n} that are relatively prime to n, i.e., the numbers whose GCD (Greatest Common Divisor) with n is 1. Examples : Φ(1) = 1 gcd(1, 1) is 1 Φ(2) = 1 gcd(1, 2) is 1, but gcd(2, 2) is 2. Φ(3) = 2 gcd(1, 3) is 1 and gcd(2...
[ { "code": null, "e": 25907, "s": 25879, "text": "\n13 Mar, 2022" }, { "code": null, "e": 26097, "s": 25907, "text": "Euler’s Totient function Φ (n) for an input n is the count of numbers in {1, 2, 3, ..., n} that are relatively prime to n, i.e., the numbers whose GCD (Greatest Co...
Debian Software Package Management(dpkg) in Linux - GeeksforGeeks
01 Feb, 2021 In Linux, there are a lot of different distributions and each of these distributions has a different package type. For example .rpm or Red hat Package Manager is used as the package in the Linux distribution. A package is the compressed version of the software. In this article, we will go through the Debi...
[ { "code": null, "e": 25651, "s": 25623, "text": "\n01 Feb, 2021" }, { "code": null, "e": 26136, "s": 25651, "text": "In Linux, there are a lot of different distributions and each of these distributions has a different package type. For example .rpm or Red hat Package Manager is ...
Python - Extract range of Consecutive Similar elements ranges from string list - GeeksforGeeks
01 Oct, 2020 Given a list, extract range of consecutive similar elements. Input : test_list = [2, 3, 3, 3, 8, 8] Output : [(2, 0, 0), (3, 1, 3), (8, 4, 5)] Explanation : 2 occurs from 0th to 0th index, 3 from 1st to 3rd index. Input : test_list = [3, 3, 3] Output : [(3, 0, 3)] Explanation : 3 from 0th to 3rd index. Ap...
[ { "code": null, "e": 25613, "s": 25585, "text": "\n01 Oct, 2020" }, { "code": null, "e": 25674, "s": 25613, "text": "Given a list, extract range of consecutive similar elements." }, { "code": null, "e": 25827, "s": 25674, "text": "Input : test_list = [2, 3, 3,...
How to get column names in Pandas dataframe - GeeksforGeeks
12 May, 2022 While analyzing the real datasets which are often very huge in size, we might need to get the column names in order to perform some certain operations. Let’s discuss how to get column names in Pandas dataframe. First, let’s create a simple dataframe with nba.csv file. Python3 # Import pandas package impor...
[ { "code": null, "e": 25875, "s": 25847, "text": "\n12 May, 2022" }, { "code": null, "e": 26145, "s": 25875, "text": "While analyzing the real datasets which are often very huge in size, we might need to get the column names in order to perform some certain operations. Let’s discu...
Java Program to Calculate and Display Area of a Circle - GeeksforGeeks
28 Mar, 2021 Given a radius of the circle, write a java program to calculate and display the area of the circle. (Take ∏=3.142) Example Input : radius= 5 Output: Area of circle is : 78.55 Input : radius= 8 Output: Area of circle is : 201.08 As we know to calculate the area of a circle, the radius of the circle must be...
[ { "code": null, "e": 25251, "s": 25223, "text": "\n28 Mar, 2021" }, { "code": null, "e": 25366, "s": 25251, "text": "Given a radius of the circle, write a java program to calculate and display the area of the circle. (Take ∏=3.142)" }, { "code": null, "e": 25374, ...
Count of pairs (x, y) in an array such that x < y - GeeksforGeeks
01 Jun, 2021 Given an array of N distinct integers, the task is to find the number of pairs (x, y) such that x < y. Example: Input: arr[] = {2, 4, 3, 1} Output: 6 Possible pairs are (1, 2), (1, 3), (1, 4), (2, 3), (2, 4) and (3, 4).Input: arr[] = {5, 10} Output: 1 The only possible pair is (5, 10). Naive approach: F...
[ { "code": null, "e": 26041, "s": 26013, "text": "\n01 Jun, 2021" }, { "code": null, "e": 26144, "s": 26041, "text": "Given an array of N distinct integers, the task is to find the number of pairs (x, y) such that x < y." }, { "code": null, "e": 26155, "s": 26144, ...
How to compare two ValueTuple in C#? - GeeksforGeeks
23 Jul, 2019 To compare two instances of ValueTuple you can use CompareTo method which is provided by ValueTuple structure. ValueTuple.CompareTo(ValueTuple) Method is used to compare the current instance of ValueTuple with another ValueTuple instance. It always returns zero if they are equal to each other. Syntax: publ...
[ { "code": null, "e": 25649, "s": 25621, "text": "\n23 Jul, 2019" }, { "code": null, "e": 25944, "s": 25649, "text": "To compare two instances of ValueTuple you can use CompareTo method which is provided by ValueTuple structure. ValueTuple.CompareTo(ValueTuple) Method is used to c...
Node.js date-and-time Date.locale() Method - GeeksforGeeks
26 Mar, 2021 The date-and-time.Date.locale() method is used to get or switch the locale from one into another language. Required Module: Install the module by npm or used it locally. By using npm: npm install date-and-time --save By using CDN link: <script src="/path/to/date-and-time.min.js"></script> Syntax: locale(])...
[ { "code": null, "e": 26267, "s": 26239, "text": "\n26 Mar, 2021" }, { "code": null, "e": 26374, "s": 26267, "text": "The date-and-time.Date.locale() method is used to get or switch the locale from one into another language." }, { "code": null, "e": 26437, "s": 263...
Java Program to Combine Two List by Alternatively Taking Elements - GeeksforGeeks
22 Sep, 2021 A list is an ordered sequence of elements stored together to form a collection. A list can contain duplicate as well as null entries. A list allows us to perform index-based operations, that is additions, deletions, manipulations, and positional access. Java provides an in-built interface <<java.util>> to ...
[ { "code": null, "e": 25225, "s": 25197, "text": "\n22 Sep, 2021" }, { "code": null, "e": 25586, "s": 25225, "text": "A list is an ordered sequence of elements stored together to form a collection. A list can contain duplicate as well as null entries. A list allows us to perform i...
Find the maximum length of the prefix - GeeksforGeeks
13 Apr, 2021 Given an array arr[] of N integers where all elements of the array are from the range [0, 9] i.e. a single digit, the task is to find the maximum length of the prefix of this array such that removing exactly one element from the prefix will make the occurrence of the remaining elements in the prefix same.E...
[ { "code": null, "e": 26041, "s": 26013, "text": "\n13 Apr, 2021" }, { "code": null, "e": 26358, "s": 26041, "text": "Given an array arr[] of N integers where all elements of the array are from the range [0, 9] i.e. a single digit, the task is to find the maximum length of the pre...
SYSDATE() function in MySQL - GeeksforGeeks
27 Nov, 2020 SYSDATE() function in MySQL is used to return the current date and time in YYYY-MM-DD HH:MM:SS or YYYYMMDDHHMMSS.uuuuuu format depending on the context of the function. Syntax : SYSDATE() Parameter :This method does not accept any parameter. Returns :It returns the current date and time value. Example-1 :...
[ { "code": null, "e": 25513, "s": 25485, "text": "\n27 Nov, 2020" }, { "code": null, "e": 25682, "s": 25513, "text": "SYSDATE() function in MySQL is used to return the current date and time in YYYY-MM-DD HH:MM:SS or YYYYMMDDHHMMSS.uuuuuu format depending on the context of the func...
Count ways to represent N as sum of powers of 2 - GeeksforGeeks
26 Mar, 2021 Given an integer N, the task is to count the number of ways to represent N as the sum of powers of 2. Examples: Input: N = 4Output: 4Explanation: All possible ways to obtains sum N using powers of 2 are {4, 2+2, 1+1+1+1, 2+1+1}. Input: N = 5Output: 4Explanation: All possible ways to obtains sum N using po...
[ { "code": null, "e": 27111, "s": 27083, "text": "\n26 Mar, 2021" }, { "code": null, "e": 27213, "s": 27111, "text": "Given an integer N, the task is to count the number of ways to represent N as the sum of powers of 2." }, { "code": null, "e": 27223, "s": 27213, ...
How to store financial market data for backtesting | by Mario Emmanuel | Towards Data Science
I am working on moderately large financial price data sets. By moderately large I mean less than 4 million rows per asset. 4 million rows can cover the last 20 years of minute price bars done by a regular asset without extended trading hours — such as index futures contracts or regular cash stocks — . When dealing with...
[ { "code": null, "e": 295, "s": 172, "text": "I am working on moderately large financial price data sets. By moderately large I mean less than 4 million rows per asset." }, { "code": null, "e": 475, "s": 295, "text": "4 million rows can cover the last 20 years of minute price bars...
Node.js fs.chmodSync() Method - GeeksforGeeks
08 Oct, 2021 The fs.chmodSync() method is used to synchronously change the permissions of a given path. These permissions can be specified using string constants or octal numbers that correspond to their respective file modes.Note: The Windows platform only supports the changing of the write permission. It also does no...
[ { "code": null, "e": 24119, "s": 24091, "text": "\n08 Oct, 2021" }, { "code": null, "e": 24511, "s": 24119, "text": "The fs.chmodSync() method is used to synchronously change the permissions of a given path. These permissions can be specified using string constants or octal numbe...
Print the longest leaf to leaf path in a Binary tree
Difficulty Level : Medium C++ Java Python3 C# Javascript // C++ program to print the longest leaf to leaf// path#include <bits/stdc++.h>using namespace std; // Tree node structure used in the programstruct Node { int data; Node *left, *right;}; struct Node* newNode(int data){ struct Node* node = new Node; n...
[ { "code": null, "e": 26, "s": 0, "text": "Difficulty Level :\nMedium" }, { "code": null, "e": 30, "s": 26, "text": "C++" }, { "code": null, "e": 35, "s": 30, "text": "Java" }, { "code": null, "e": 43, "s": 35, "text": "Python3" }, { ...
PHP | Imploding and Exploding
08 Mar, 2018 Imploding and Exploding are couple of important functions of PHP that can be applied on strings or arrays. PHP provides us with two important builtin functions implode() and explode() to perform these operations. As the name suggests Implode/implode() method joins array elements with a string segment that ...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Mar, 2018" }, { "code": null, "e": 524, "s": 28, "text": "Imploding and Exploding are couple of important functions of PHP that can be applied on strings or arrays. PHP provides us with two important builtin functions implode() and e...
ES6 - Functions
Functions are the building blocks of readable, maintainable, and reusable code. Functions are defined using the function keyword. Following is the syntax for defining a standard function. function function_name() { // function body } To force execution of the function, it must be called. This is called as functi...
[ { "code": null, "e": 2599, "s": 2411, "text": "Functions are the building blocks of readable, maintainable, and reusable code. Functions are defined using the function keyword. Following is the syntax for defining a standard function." }, { "code": null, "e": 2652, "s": 2599, "te...
SQL | Creating Roles
27 Sep, 2018 A role is created to ease setup and maintenance of the security model. It is a named group of related privileges that can be granted to the user. When there are many users in a database it becomes difficult to grant or revoke privileges to users. Therefore, if you define roles: You can grant or revoke priv...
[ { "code": null, "e": 54, "s": 26, "text": "\n27 Sep, 2018" }, { "code": null, "e": 333, "s": 54, "text": "A role is created to ease setup and maintenance of the security model. It is a named group of related privileges that can be granted to the user. When there are many users in...
Date and time fields in serializers – Django REST Framework
10 May, 2021 In Django REST Framework the very concept of Serializing is to convert DB data to a datatype that can be used by javascript. Every serializer comes with some fields (entries) which are going to be processed. For example if you have a class with name Employee and its fields as Employee_id, Employee_name, da...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 May, 2021" }, { "code": null, "e": 733, "s": 28, "text": "In Django REST Framework the very concept of Serializing is to convert DB data to a datatype that can be used by javascript. Every serializer comes with some fields (entries) ...
Image Transition with Fading Effect using JavaScript
24 Jan, 2022 Given some images and the task is the create a slow transition from one image to another using Javascript.Prerequisite: In this article, we will use the following JavaScript methods. setInterval() method clearInterval() method async/await Promise Approach: Given some images and the task is to change the ...
[ { "code": null, "e": 53, "s": 25, "text": "\n24 Jan, 2022" }, { "code": null, "e": 238, "s": 53, "text": "Given some images and the task is the create a slow transition from one image to another using Javascript.Prerequisite: In this article, we will use the following JavaScript ...
Matplotlib.axes.Axes.set_yticks() in Python
19 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. The Axe...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Apr, 2020" }, { "code": null, "e": 328, "s": 28, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text...
What is a functional interface in Java?
An interface with only one abstract method is known as Functional Interface. @FunctionalInterface annotation can be added so that we can mark an interface as a functional interface. The Java compiler automatically identifies the functional interface. The lambda expressions are used primarily to define the inline implem...
[ { "code": null, "e": 1438, "s": 1187, "text": "An interface with only one abstract method is known as Functional Interface. @FunctionalInterface annotation can be added so that we can mark an interface as a functional interface. The Java compiler automatically identifies the functional interface." ...
Python Lambda Functions
07 Jun, 2022 Python Lambda Functions are anonymous function means that the function is without a name. As we already know that the def keyword is used to define a normal function in Python. Similarly, the lambda keyword is used to define an anonymous function in Python. Python Lambda Function Syntax: lambda arguments:...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jun, 2022" }, { "code": null, "e": 311, "s": 52, "text": "Python Lambda Functions are anonymous function means that the function is without a name. As we already know that the def keyword is used to define a normal function in Pytho...
Java Stream findAny() with examples
06 Dec, 2018 Stream findAny() returns an Optional (a container object which may or may not contain a non-null value) describing some element of the stream, or an empty Optional if the stream is empty. findAny() V/s findFirst() : The findAny() method returns any element from a Stream but there might be a case where we r...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Dec, 2018" }, { "code": null, "e": 216, "s": 28, "text": "Stream findAny() returns an Optional (a container object which may or may not contain a non-null value) describing some element of the stream, or an empty Optional if the stre...
strings.Index() Function in Golang With Examples
19 Apr, 2020 strings.Index() Function in Golang is used to get the first instance of a specified substring. If the substring is not found, then this method will return -1. Syntax: func Index(str, sbstr string) int Here, str is the original string and sbstr is a string whose we want to find index value. Example 1: // Go...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Apr, 2020" }, { "code": null, "e": 187, "s": 28, "text": "strings.Index() Function in Golang is used to get the first instance of a specified substring. If the substring is not found, then this method will return -1." }, { "c...
How to hide div element after few seconds in jQuery ?
18 Jun, 2019 Given a div element and the task is to hide the div element after few seconds using jQuery ? Approach: Select the div element. Use delay function (setTimeOut(), delay()) to provide the delay to hide() the div element. Example 1: In this example, the setTimeOut() method is used to provide delay to the fadeO...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Jun, 2019" }, { "code": null, "e": 121, "s": 28, "text": "Given a div element and the task is to hide the div element after few seconds using jQuery ?" }, { "code": null, "e": 131, "s": 121, "text": "Approach:" ...
Reverse an array without using subtract sign ‘-‘ anywhere in the code
12 Jun, 2022 Given an array, the task is to reverse the array without using subtract sign ‘-‘ anywhere in your code. It is not tough to reverse an array but the main thing is to not use ‘-‘ operator. Asked in: Moonfrog InterviewBelow are different approaches: Method 1: 1- Store array elements into a vector in C++. 2- ...
[ { "code": null, "e": 54, "s": 26, "text": "\n12 Jun, 2022" }, { "code": null, "e": 242, "s": 54, "text": "Given an array, the task is to reverse the array without using subtract sign ‘-‘ anywhere in your code. It is not tough to reverse an array but the main thing is to not use ‘...
Java Program to Add two Matrices
23 Feb, 2021 Given two matrices A and B of same size, the task to add them in Java. Examples: Input: A[][] = {{1, 2}, {3, 4}} B[][] = {{1, 1}, {1, 1}} Output: {{2, 3}, {4, 5}} Input: A[][] = {{2, 4}, {3, 4}} B[][] = {{1, 2}, {...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Feb, 2021" }, { "code": null, "e": 134, "s": 52, "text": "Given two matrices A and B of same size, the task to add them in Java. Examples: " }, { "code": null, "e": 408, "s": 134, "text": "Input: A[][] = {{1, 2},...
Insertion in a Trie recursively
02 Dec, 2021 Trie is an efficient information retrieval data structure. Using Trie, search complexities can be brought to an optimal limit (key length). Given multiple strings. The task is to insert the string in a Trie using recursion.Examples: Input : str = {"cat", "there", "caller", "their", "calling"} Output : ca...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Dec, 2021" }, { "code": null, "e": 263, "s": 28, "text": "Trie is an efficient information retrieval data structure. Using Trie, search complexities can be brought to an optimal limit (key length). Given multiple strings. The task is...
PortSpider – Advance Network Port scanner on Kali Linux
17 Jun, 2021 PortSpider is a free and open-source tool available on GitHub. PortSpider is an Open Source Intelligence and network scanning Tool based on (OSINT). This tool can scan huge network ranges to find open and closed ports and all the vulnerable services running on the server or on the system, not only scans a ...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Jun, 2021" }, { "code": null, "e": 547, "s": 28, "text": "PortSpider is a free and open-source tool available on GitHub. PortSpider is an Open Source Intelligence and network scanning Tool based on (OSINT). This tool can scan huge ne...
f-strings in Python
21 Jan, 2021 PEP 498 introduced a new string formatting mechanism known as Literal String Interpolation or more commonly as F-strings (because of the leading f character preceding the string literal). The idea behind f-strings is to make string interpolation simpler. To create an f-string, prefix the string with the le...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Jan, 2021" }, { "code": null, "e": 589, "s": 52, "text": "PEP 498 introduced a new string formatting mechanism known as Literal String Interpolation or more commonly as F-strings (because of the leading f character preceding the str...
Python OpenCV | cv2.erode() method
29 Nov, 2019 OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.erode() method is used to perform erosion on the image. The basic idea of erosion is just like soil erosion only, it erodes away the boundaries of foreground object (Always try to keep foreground in white). It is ...
[ { "code": null, "e": 52, "s": 24, "text": "\n29 Nov, 2019" }, { "code": null, "e": 686, "s": 52, "text": "OpenCV-Python is a library of Python bindings designed to solve computer vision problems. cv2.erode() method is used to perform erosion on the image. The basic idea of erosio...
Program to calculate Dooms Day for a year
06 Oct, 2021 Doomsday may refer to a hypothetical event according to which the end of human life is at the highest possibility. There are many algorithms written to calculate which day of a week in a year has the highest possibility of doomsday falling on that day.All the statements are with respect to Gregorian Calend...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Oct, 2021" }, { "code": null, "e": 707, "s": 52, "text": "Doomsday may refer to a hypothetical event according to which the end of human life is at the highest possibility. There are many algorithms written to calculate which day of...
ReactJS | Hot Module Replacement
30 Apr, 2019 It is always recommended to start your react journey using the create-react-app which can be found here. It saves a lot of time as all the basic application backend is provided after installation, and we are only left to deal with the implementation details. Whenever we make changes in the main core ‘app.j...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Apr, 2019" }, { "code": null, "e": 480, "s": 28, "text": "It is always recommended to start your react journey using the create-react-app which can be found here. It saves a lot of time as all the basic application backend is provide...
Underscore.js _.map() Function
24 Nov, 2021 The Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke etc even without using any built-in objects. The _.map() function is an inbuilt function in Underscore.js library of the JavaScript which is used to prod...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Nov, 2021" }, { "code": null, "e": 227, "s": 28, "text": "The Underscore.js is a JavaScript library that provides a lot of useful functions that helps in the programming in a big way like the map, filter, invoke etc even without usin...
GATE | GATE-CS-2009 | Question 24
28 Jun, 2021 The binary operation c is defined as follows Which one of the following is equivalent to P∨Q? A) B) C) D) (A) A(B) B(C) C(D) DAnswer: (B)Explanation: This solution is contributed by Anil Saikrishna Devarasetty.Quiz of this Question GATE-CS-2009 GATE-GATE-CS-2009 GATE Writing code in comment? Ple...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Jun, 2021" }, { "code": null, "e": 99, "s": 54, "text": "The binary operation c is defined as follows" }, { "code": null, "e": 148, "s": 99, "text": "Which one of the following is equivalent to P∨Q?" }, { ...
Python | Removing unwanted characters from string
30 Jun, 2022 The generic problem faced by the programmers is removing a character from the entire string. But sometimes the requirement is way above and demands the removal of more than 1 character, but a list of such malicious characters. These can be in the form of special characters for reconstructing valid password...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Jun, 2022" }, { "code": null, "e": 688, "s": 52, "text": "The generic problem faced by the programmers is removing a character from the entire string. But sometimes the requirement is way above and demands the removal of more than 1...
How to Create Database & Collection in MongoDB?
05 Feb, 2021 MongoDB stores data records as documents that are stored together in collections and the database stores one or more collections of documents. Document: A document is a basic unit of storing data into the database. A single record of a collection is also known as a document. Basically, It is a structure th...
[ { "code": null, "e": 54, "s": 26, "text": "\n05 Feb, 2021" }, { "code": null, "e": 197, "s": 54, "text": "MongoDB stores data records as documents that are stored together in collections and the database stores one or more collections of documents." }, { "code": null, ...
Print Common Nodes in Two Binary Search Trees
05 Aug, 2021 Given two Binary Search Trees, find common nodes in them. In other words, find intersection of two BSTs. Example: Method 1 (Simple Solution) A simple way is to one by once search every node of first tree in second tree. Time complexity of this solution is O(m * h) where m is number of nodes in first tree a...
[ { "code": null, "e": 52, "s": 24, "text": "\n05 Aug, 2021" }, { "code": null, "e": 157, "s": 52, "text": "Given two Binary Search Trees, find common nodes in them. In other words, find intersection of two BSTs." }, { "code": null, "e": 166, "s": 157, "text": "...
How to insert a JavaScript variable inside href attribute?
24 Jun, 2020 <a > ... </a> tags are used to create hyperlinks in HTML.One of the attributes of ‘a’ tag is ‘href’ href: Specifies the URL of the page the link goes to Example: <a href="https://www.geeksforgeeks.org/"> GeeksforGeeks </a> Methods to use Variables inside this ‘href’ attribute: Using onclick property:T...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Jun, 2020" }, { "code": null, "e": 154, "s": 54, "text": "<a > ... </a> tags are used to create hyperlinks in HTML.One of the attributes of ‘a’ tag is ‘href’" }, { "code": null, "e": 207, "s": 154, "text": "href:...
How to find the index value of any element in slice of bytes in Golang?
26 Aug, 2019 In Go language slice is more powerful, flexible, convenient than an array, and is a lightweight data structure. The slice is a variable-length sequence which stores elements of a similar type, you are not allowed to store different type of elements in the same slice.In the Go slice of bytes, you can find t...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Aug, 2019" }, { "code": null, "e": 798, "s": 28, "text": "In Go language slice is more powerful, flexible, convenient than an array, and is a lightweight data structure. The slice is a variable-length sequence which stores elements o...
How to perform grep operation on all files in a directory?
The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands to display the lines that contain the pattern that we are trying to search. Normally, the pattern that we are trying to search in the file is referred to as the regula...
[ { "code": null, "e": 1416, "s": 1187, "text": "The grep command in Linux is used to filter searches in a file for a particular pattern of characters. It is one of the most used Linux utility commands to display the lines that contain the pattern that we are trying to search." }, { "code": nu...
Web Programming in C++
14 Oct, 2019 CGI(COMMON GATEWAY INTERFACE) may be a set of standards that outline however data is changed from the online server, passing the online user’s request to Associate in Nursing application and to receive data back to the user. When any user requests for a web page, the server sends back the requested page. T...
[ { "code": null, "e": 54, "s": 26, "text": "\n14 Oct, 2019" }, { "code": null, "e": 733, "s": 54, "text": "CGI(COMMON GATEWAY INTERFACE) may be a set of standards that outline however data is changed from the online server, passing the online user’s request to Associate in Nursing...
Jackson Annotations For Java Application
20 Jul, 2021 Java has immense application in the coding world, and almost all of us know this fact. One of its features is the Jackson annotations. Although that is a very familiar term with the people involved in the coding world, it is less known. Jackson is a popular and very efficient JAVA library used to map or se...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Jul, 2021" }, { "code": null, "e": 380, "s": 28, "text": "Java has immense application in the coding world, and almost all of us know this fact. One of its features is the Jackson annotations. Although that is a very familiar term wi...
java.io.FileNotFoundException in Java
16 Nov, 2021 java.io.FileNotFoundException which is a common exception which occurs while we try to access a file. FileNotFoundExcetion is thrown by constructors RandomAccessFile, FileInputStream, and FileOutputStream. FileNotFoundException occurs at runtime so it is a checked exception, we can handle this exception by...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Nov, 2021" }, { "code": null, "e": 423, "s": 28, "text": "java.io.FileNotFoundException which is a common exception which occurs while we try to access a file. FileNotFoundExcetion is thrown by constructors RandomAccessFile, FileInpu...
Python | Extract URL from HTML using lxml
19 Jul, 2019 Link extraction is a very common task when dealing with the HTML parsing. For every general web crawler that’s the most important function to perform. Out of all the Python libraries present out there, lxml is one of the best to work with. As explained in this article, lxml provides a number of helper func...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Jul, 2019" }, { "code": null, "e": 371, "s": 28, "text": "Link extraction is a very common task when dealing with the HTML parsing. For every general web crawler that’s the most important function to perform. Out of all the Python li...
NLP | WuPalmer – WordNet Similarity
20 Jun, 2021 How Wu & Palmer Similarity works ? It calculates relatedness by considering the depths of the two synsets in the WordNet taxonomies, along with the depth of the LCS (Least Common Subsumer). The score can be 0 < score <= 1. The score can never be zero because the depth of the LCS is never zero (the depth ...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Jun, 2021" }, { "code": null, "e": 220, "s": 28, "text": "How Wu & Palmer Similarity works ? It calculates relatedness by considering the depths of the two synsets in the WordNet taxonomies, along with the depth of the LCS (Least Com...
Show and hide password using JavaScript
19 Feb, 2019 While filling up a form, there comes a situation where we type a password and want to see what we have typed till now. To see that, there is a checkbox clicking on which makes the characters visible.In this post, this feature i.e. toggling password is implemented using JavaScript. Algorithm1)Create a HTML ...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Feb, 2019" }, { "code": null, "e": 334, "s": 52, "text": "While filling up a form, there comes a situation where we type a password and want to see what we have typed till now. To see that, there is a checkbox clicking on which make...
PHP | ob_start() Function
08 Mar, 2018 Let’s take a quick recap. PHP is an interpreted language thus each statement is executed one after another, therefore PHP tends to send HTML to browsers in chunks thus reducing performance. Using output buffering the generated HTML gets stored in a buffer or a string variable and is sent to the buffer to r...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Mar, 2018" }, { "code": null, "e": 428, "s": 54, "text": "Let’s take a quick recap. PHP is an interpreted language thus each statement is executed one after another, therefore PHP tends to send HTML to browsers in chunks thus reduci...
FOLLOW Set in Syntax Analysis
08 Apr, 2022 We have discussed the following topics on Syntax Analysis. Introduction to Syntax Analysis Why FIRST and FOLLOW? FIRST Set in Syntax Analysis In this post, FOLLOW Set is discussed. Follow(X) to be the set of terminals that can appear immediately to the right of Non-Terminal X in some sentential form. Ex...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Apr, 2022" }, { "code": null, "e": 114, "s": 54, "text": "We have discussed the following topics on Syntax Analysis. " }, { "code": null, "e": 198, "s": 114, "text": "Introduction to Syntax Analysis Why FIRST and...
Flatten a multilevel linked list
20 Jun, 2022 Given a linked list where in addition to the next pointer, each node has a child pointer, which may or may not point to a separate list. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure, as shown in below figure. You are given the head of the f...
[ { "code": null, "e": 54, "s": 26, "text": "\n20 Jun, 2022" }, { "code": null, "e": 644, "s": 54, "text": "Given a linked list where in addition to the next pointer, each node has a child pointer, which may or may not point to a separate list. These child lists may have one or mor...
How to set the initial value of an auto-incremented column in MySQL using JDBC?
While creating a table, in certain scenarios, we need values to column such as ID, to be generated/incremented automatically. Various databases support this feature in different ways. In MySQL database you can declare a column auto increment using the following syntax. CREATE TABLE table_name( ID INT PRIMARY KEY AUT...
[ { "code": null, "e": 1246, "s": 1062, "text": "While creating a table, in certain scenarios, we need values to column such as ID, to be generated/incremented automatically. Various databases support this feature in different ways." }, { "code": null, "e": 1332, "s": 1246, "text":...
Longest Increasing Path in a Matrix | Practice | GeeksforGeeks
Given a matrix with n rows and m columns. Your task is to find the length of the longest increasing path in matrix, here increasing path means that the value in the specified path increases. For example if a path of length k has values a1, a2, a3, .... ak , then for every i from [2,k] this condition must hold ai > ai-...
[ { "code": null, "e": 754, "s": 238, "text": "Given a matrix with n rows and m columns. Your task is to find the length of the longest increasing path in matrix, here increasing path means that the value in the specified path increases. For example if a path of length k has values a1, a2, a3, .... ak...
JavaScript - For Loop
The 'for' loop is the most compact form of looping. It includes the following three important parts − The loop initialization where we initialize our counter to a starting value. The initialization statement is executed before the loop begins. The loop initialization where we initialize our counter to a starting value....
[ { "code": null, "e": 2568, "s": 2466, "text": "The 'for' loop is the most compact form of looping. It includes the following three important parts −" }, { "code": null, "e": 2710, "s": 2568, "text": "The loop initialization where we initialize our counter to a starting value. The...
Baseball Game in Python
Suppose we have a baseball game point recorder. We have a list of strings; each string can be one of the 4 following types − Integer (one round's score) − Indicates the number of points we get in this round. "+" (one round's score) − Indicates the points we get in this round are the sum of the last two valid round's po...
[ { "code": null, "e": 1187, "s": 1062, "text": "Suppose we have a baseball game point recorder. We have a list of strings; each string can be one of the 4 following types −" }, { "code": null, "e": 1270, "s": 1187, "text": "Integer (one round's score) − Indicates the number of poi...
Getting Started with Python Classes | by Sadrach Pierre, Ph.D. | Towards Data Science
In computer programming, classes are a convenient way to organize data and functions such that they are easy to reuse and extend later. In this post, we will walk through how to build a basic class in python. Specifically, we will discuss the example of implementing a class that represents instagram users. Let’s get st...
[ { "code": null, "e": 480, "s": 172, "text": "In computer programming, classes are a convenient way to organize data and functions such that they are easy to reuse and extend later. In this post, we will walk through how to build a basic class in python. Specifically, we will discuss the example of i...
Check if the camera is opened or not using OpenCV-Python - GeeksforGeeks
07 Oct, 2021 OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to perform multiple operations on videos. While writing code in Python using OpenCV, we may not be sure whether at the remote end camera is...
[ { "code": null, "e": 24212, "s": 24184, "text": "\n07 Oct, 2021" }, { "code": null, "e": 24422, "s": 24212, "text": "OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be ...
Python | Reshape a list according to given multi list - GeeksforGeeks
25 Apr, 2019 Given two lists, a single dimensional and a multidimensional list, write Python program to reshape the single dimensional list according to the length of multidimensional list. Examples: Input : list1 = [[1], [2, 3], [4, 5, 6]] list2 = ['a', 'b', 'c', 'd', 'e', 'f'] Output : [['a'], ['b', 'c'], ['d...
[ { "code": null, "e": 25665, "s": 25637, "text": "\n25 Apr, 2019" }, { "code": null, "e": 25842, "s": 25665, "text": "Given two lists, a single dimensional and a multidimensional list, write Python program to reshape the single dimensional list according to the length of multidime...