title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
How to display a float with two decimal places in Python?
You can use string formatting to format floating point numbers to a fixed width in Python.For example, if you want the decimal points to be aligned with width of 12 characters and 2 digits on the right of the decimal, you can use the following: >>>x = 12.35874 >>>print "{:12.2f}".format(x) 12.36 You can also ach...
[ { "code": null, "e": 1307, "s": 1062, "text": "You can use string formatting to format floating point numbers to a fixed width in Python.For example, if you want the decimal points to be aligned with width of 12 characters and 2 digits on the right of the decimal, you can use the following:" }, ...
How to get the size of a JavaScript object?
21 Jun, 2019 We can get size of java script object with the help of Object.keys() method. Syntax: Object.keys(object_name) object_name Return Value: an array of all the object’s own enumerable property keys. Approach-1:Create an object variable and assign values to itCreate an variable which shows the sizeCall the Obje...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Jun, 2019" }, { "code": null, "e": 105, "s": 28, "text": "We can get size of java script object with the help of Object.keys() method." }, { "code": null, "e": 113, "s": 105, "text": "Syntax:" }, { "code":...
Matplotlib.axes.Axes.add_line() in Python
21 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": "\n21 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...
SQL | Join (Inner, Left, Right and Full Joins)
17 May, 2022 SQL Join statement is used to combine data or rows from two or more tables based on a common field between them. Different types of Joins are as follows: INNER JOIN LEFT JOIN RIGHT JOIN FULL JOIN Consider the two tables below: Student StudentCourse Chapters descriptions off, selected captions settings...
[ { "code": null, "e": 52, "s": 24, "text": "\n17 May, 2022" }, { "code": null, "e": 207, "s": 52, "text": "SQL Join statement is used to combine data or rows from two or more tables based on a common field between them. Different types of Joins are as follows: " }, { "code...
Check if linked list is sorted (Iterative and Recursive)
08 Nov, 2021 Given a Linked List, task is to check whether the Linked List is sorted in Descending order or not? Examples : Input : 8 -> 7 -> 5 -> 2 -> 1 Output : Yes Explanation : In given linked list, starting from head, 8 > 7 > 5 > 2 > 1. So, it is sorted in reverse order Input : 24 -> 12 -> 9 -> 11 -> 8 -> 2 ...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Nov, 2021" }, { "code": null, "e": 155, "s": 54, "text": "Given a Linked List, task is to check whether the Linked List is sorted in Descending order or not? " }, { "code": null, "e": 168, "s": 155, "text": "Exam...
Hadoop – mrjob Python Library For MapReduce With Example
17 Mar, 2021 mrjob is the famous python library for MapReduce developed by YELP. The library helps developers to write MapReduce code using a Python Programming language. Developers can test the MapReduce Python code written with mrjob locally on their system or on the cloud using Amazon EMR(Elastic MapReduce). Amazon ...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Mar, 2021" }, { "code": null, "e": 840, "s": 28, "text": "mrjob is the famous python library for MapReduce developed by YELP. The library helps developers to write MapReduce code using a Python Programming language. Developers can te...
Program to convert centimeter into meter and kilometer
28 Apr, 2021 Given length in centimeter, the task is to convert it into meter and kilometer. Examples : Input: Length in centimeter = 1000 Output: Length in meter = 10 m Length in kilometer = 0.01 km Input: Length in centimeter =6540 Output: Length in meter = 65.4 m Length in kilometer = 0.0654 km Formula to be use...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Apr, 2021" }, { "code": null, "e": 108, "s": 28, "text": "Given length in centimeter, the task is to convert it into meter and kilometer." }, { "code": null, "e": 121, "s": 108, "text": "Examples : " }, { ...
How to customize a button to set text and color in Android?
This example demonstrates how do I customize a button to set text and color 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="utf-8"?>...
[ { "code": null, "e": 1275, "s": 1187, "text": "This example demonstrates how do I customize a button to set text and color in android." }, { "code": null, "e": 1404, "s": 1275, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all require...
How to recursively iterate a nested Python dictionary?
Given below is a nested directory object D1={1: {2: {3: 4, 5: 6}, 3: {4: 5, 6: 7}}, 2: {3: {4: 5}, 4: {6: 7}}} Following recursive function is called repetitively if the value component of each item in directory is a directory itself. def iterdict(d): for k,v in d.items(): if isinstance(v, dict): ...
[ { "code": null, "e": 1228, "s": 1187, "text": "Given below is a nested directory object" }, { "code": null, "e": 1298, "s": 1228, "text": "D1={1: {2: {3: 4, 5: 6}, 3: {4: 5, 6: 7}}, 2: {3: {4: 5}, 4: {6: 7}}}" }, { "code": null, "e": 1422, "s": 1298, "text": "...
How to Set Java SDK Path in Android Studio?
16 Jun, 2021 The Java SDK for Android is a sophisticated suite of tools for managing, monitoring, profiling, and debugging Java code written in Android Studio. But sometimes as software is unpredictable you might be caught in an error that Android Studio stopped compiling projects and says that it can’t locate the 1.7....
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Jun, 2021" }, { "code": null, "e": 419, "s": 28, "text": "The Java SDK for Android is a sophisticated suite of tools for managing, monitoring, profiling, and debugging Java code written in Android Studio. But sometimes as software is...
SpiderFoot – A Automate OSINT Framework in Kali Linux
20 Apr, 2021 Spiderfoot is a free and open-source tool available on Github. This tool is a framework written in the python programming language. You must have python installed in your Kali Linux operating system to use this framework. Spiderfoot is used for reconnaissance. Spiderfoot uses different modules for informat...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Apr, 2021" }, { "code": null, "e": 1135, "s": 28, "text": "Spiderfoot is a free and open-source tool available on Github. This tool is a framework written in the python programming language. You must have python installed in your Kal...
Winsorization
30 May, 2021 Winsorization is the process of replacing the extreme values of statistical data in order to limit the effect of the outliers on the calculations or the results obtained by using that data. The mean value calculated after such replacement of the extreme values is called winsorized mean. For example, 90% w...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 May, 2021" }, { "code": null, "e": 316, "s": 28, "text": "Winsorization is the process of replacing the extreme values of statistical data in order to limit the effect of the outliers on the calculations or the results obtained by us...
Python program to print all negative numbers in a range
01 Jun, 2022 Given the start and end of a range, write a Python program to print all negative numbers in a given range. Examples: Input: a = -4, b = 5 Output: -4, -3, -2, -1 Input: a = -3, b= 4 Output: -3, -2, -1 Method: Print all the negative numbers using a single-line solution. Print all negative numbers using for...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Jun, 2022" }, { "code": null, "e": 159, "s": 52, "text": "Given the start and end of a range, write a Python program to print all negative numbers in a given range." }, { "code": null, "e": 170, "s": 159, "text":...
GATE | GATE-CS-2000 | Question 45
28 Jun, 2021 Suppose the time to service a page fault is on the average 10 milliseconds, while a memory access takes 1 microsecond. Then a 99.99% hit ratio results in average memory access time of (GATE CS 2000) (A) 1.9999 milliseconds(B) 1 millisecond(C) 9.999 microseconds(D) 1.9999 microsecondsAnswer: (D)Explanation:...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jun, 2021" }, { "code": null, "e": 227, "s": 28, "text": "Suppose the time to service a page fault is on the average 10 milliseconds, while a memory access takes 1 microsecond. Then a 99.99% hit ratio results in average memory access...
Maximum subarray sum in O(n) using prefix sum
08 Apr, 2021 Given an Array of Positive and Negative Integers, find out the Maximum Subarray Sum in that Array. Examples: Input1 : arr = {-2, -3, 4, -1, -2, 1, 5, -3} Output1 : 7 Input2 : arr = {4, -8, 9, -4, 1, -8, -1, 6} Output2 : 9 Kadane’s Algorithm solves this problem using Dynamic Programming approach in li...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Apr, 2021" }, { "code": null, "e": 154, "s": 54, "text": "Given an Array of Positive and Negative Integers, find out the Maximum Subarray Sum in that Array. " }, { "code": null, "e": 166, "s": 154, "text": "Examp...
Insert a linked list into another linked list
23 Jan, 2022 Given two linked lists, list1 and list2 of sizes m and n respectively. The task is to remove list1’s nodes from the ath node to the bth node and insert the list2 in their place.Examples: Input: list1: 10->11->12->13->14->15, list2: 100->101->102->103, a = 3, b = 4Output: 10->11->12->100->101->102->103->15E...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Jan, 2022" }, { "code": null, "e": 239, "s": 52, "text": "Given two linked lists, list1 and list2 of sizes m and n respectively. The task is to remove list1’s nodes from the ath node to the bth node and insert the list2 in their pla...
Print a 2 D Array or Matrix in C#
First, set a two-dimensional array. int[,] arr = new int[10, 10]; Now, get the elements from the user − for (i = 0; i < m; i++) { for (j = 0; j < n; j++) { arr[i, j] = Convert.ToInt16(Console.ReadLine()); } } Let us see the complete example to display the matrix. Live Demo using System; using System.Linq; ...
[ { "code": null, "e": 1223, "s": 1187, "text": "First, set a two-dimensional array." }, { "code": null, "e": 1253, "s": 1223, "text": "int[,] arr = new int[10, 10];" }, { "code": null, "e": 1291, "s": 1253, "text": "Now, get the elements from the user −" }, ...
Python os.chdir() method
01 Nov, 2021 OS module in Python provides functions for interacting with the operating system. OS, comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.chdir() method in Python used to change the current working directory to specified p...
[ { "code": null, "e": 54, "s": 26, "text": "\n01 Nov, 2021" }, { "code": null, "e": 422, "s": 54, "text": "OS module in Python provides functions for interacting with the operating system. OS, comes under Python’s standard utility modules. This module provides a portable way of us...
Length of the longest substring | Practice | GeeksforGeeks
Given a string S, find the length of the longest substring without repeating characters. Example 1: Input: S = "geeksforgeeks" Output: 7 Explanation: Longest substring is "eksforg". Example 2: Input: S = "abdefgabef" Output: 6 Explanation: Longest substring are "abdefg" , "bdefga" and "defgab". Your Task: You don't...
[ { "code": null, "e": 328, "s": 238, "text": "Given a string S, find the length of the longest substring without repeating characters. " }, { "code": null, "e": 340, "s": 328, "text": "\nExample 1:" }, { "code": null, "e": 422, "s": 340, "text": "Input:\nS = \"...
How to add Music Playlist in Pygame?
18 Jul, 2021 In this article, we are going to see how to add a music playlist in Pygame. Pygame has a method, pygame.mixer() which has all the functionalities regarding audio operations like playing a song, queuing a song, setting the volume, rewind, stop, pause, resume, and many more. Functions provided by this class ...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Jul, 2021" }, { "code": null, "e": 104, "s": 28, "text": "In this article, we are going to see how to add a music playlist in Pygame." }, { "code": null, "e": 342, "s": 104, "text": "Pygame has a method, pygame.mi...
Python - API.show_friendship() in Tweepy - GeeksforGeeks
07 Oct, 2021 Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data will be tweets extracted from the user. The first thing to do is get the consumer key, consumer secret, access key, and access secret from the T...
[ { "code": null, "e": 24454, "s": 24426, "text": "\n07 Oct, 2021" }, { "code": null, "e": 24859, "s": 24454, "text": "Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data ...
Reverse a String | Shell Programming - GeeksforGeeks
04 May, 2022 We are given a string and we have to use shell script print it in the reverse order. Asked in FICO Examples: Input : geeksforgeeks Output :skeegrofskeeg Algorithm step 1:- Take user input in a string step 2:- Findthe length of given string using length function step 3:- Set i = length-1 and run loop till ...
[ { "code": null, "e": 25853, "s": 25825, "text": "\n04 May, 2022" }, { "code": null, "e": 25962, "s": 25853, "text": "We are given a string and we have to use shell script print it in the reverse order. Asked in FICO Examples:" }, { "code": null, "e": 26007, "s": 2...
Angular ngx Bootstrap Tooltip Component - GeeksforGeeks
02 Sep, 2021 Angular ngx bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make responsive websites.In this article, we will see how to use Tooltip in angular ngx bootstrap. Installation syntax: npm install ngx-bootstrap --...
[ { "code": null, "e": 26464, "s": 26436, "text": "\n02 Sep, 2021" }, { "code": null, "e": 26722, "s": 26464, "text": "Angular ngx bootstrap is a bootstrap framework used with angular to create components with great styling and this framework is very easy to use and is used to make...
How to find Min/Max numbers in a java array?
You can find the minimum and maximum values of an array using for loops − Live Demo public class MinAndMax { public int max(int [] array) { int max = 0; for(int i=0; i<array.length; i++ ) { if(array[i]>max) { max = array[i]; } } return max; } public i...
[ { "code": null, "e": 1136, "s": 1062, "text": "You can find the minimum and maximum values of an array using for loops −" }, { "code": null, "e": 1146, "s": 1136, "text": "Live Demo" }, { "code": null, "e": 1862, "s": 1146, "text": "public class MinAndMax {\n ...
8085 program for hexadecimal counter - GeeksforGeeks
12 Dec, 2018 Write a program to count continuously in hexadecimal from FFH to 00H in a system with clock frequency 0.5 microseconds. Use register C to set up a delay of 1ms between each count and display output at one of the output ports. Problem Analysis: The hexadecimal counter is set by loading a register with start...
[ { "code": null, "e": 24700, "s": 24672, "text": "\n12 Dec, 2018" }, { "code": null, "e": 24926, "s": 24700, "text": "Write a program to count continuously in hexadecimal from FFH to 00H in a system with clock frequency 0.5 microseconds. Use register C to set up a delay of 1ms bet...
Top 4 Python libraries to build interactive timeseries plots | by Shoumik Goswami | Towards Data Science
One of the most prevalent data types encountered while analyzing data is timeseries. From identifying trends to understanding ’cause and effect’ behaviors, timeseries analysis is one of the most popular ways of understanding user behaviors, buying patterns, and much more. In Python, we often start by plotting a simple ...
[ { "code": null, "e": 444, "s": 171, "text": "One of the most prevalent data types encountered while analyzing data is timeseries. From identifying trends to understanding ’cause and effect’ behaviors, timeseries analysis is one of the most popular ways of understanding user behaviors, buying pattern...
Create Table Using Tkinter
24 Feb, 2022 Python offers multiple options for developing a 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 GUI applications. C...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Feb, 2022" }, { "code": null, "e": 464, "s": 54, "text": "Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python ...
Python | sympy.Matrix.row_del() method
12 Jun, 2019 With the help of sympy.Matrix.row_del() method, we can delete the rows of the matrix. Syntax : sympy.Matrix().row_del()Return : Return a new matrix. Example #1 : # Import all the methods from sympyfrom sympy import * # use the row_del() method for matrixgfg_val = Matrix([[1, 2], [2, 1]]).col_row(1) print...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Jun, 2019" }, { "code": null, "e": 114, "s": 28, "text": "With the help of sympy.Matrix.row_del() method, we can delete the rows of the matrix." }, { "code": null, "e": 177, "s": 114, "text": "Syntax : sympy.Matri...
Minimum of two numbers in Python
17 May, 2020 Given two numbers, write a Python code to find the Minimum of these two numbers. Examples: Input: a = 2, b = 4 Output: 2 Input: a = -1, b = -4 Output: -4 Method #1: This is the naive approach where we will compare the numbers using if-else statement and will print the output accordingly. Example: # Pytho...
[ { "code": null, "e": 53, "s": 25, "text": "\n17 May, 2020" }, { "code": null, "e": 134, "s": 53, "text": "Given two numbers, write a Python code to find the Minimum of these two numbers." }, { "code": null, "e": 144, "s": 134, "text": "Examples:" }, { ...
Python | Check if a given object is list or not
19 Mar, 2019 Given an object, the task is to check whether the object is list or not. Method #1: Using isinstance # Python code to demonstrate# check whether the object # is a list or not # initialisation listini_list1 = [1, 2, 3, 4, 5]ini_list2 = '12345' # code to check whether# object is a list or notif isinstance(...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Mar, 2019" }, { "code": null, "e": 101, "s": 28, "text": "Given an object, the task is to check whether the object is list or not." }, { "code": null, "e": 129, "s": 101, "text": "Method #1: Using isinstance" },...
How to pass a 2D array as a parameter in C?
24 Jun, 2021 This post is an extension of How to dynamically allocate a 2D array in C? A one dimensional array can be easily passed as a pointer, but syntax for passing a 2D array to a function can be difficult to remember. One important thing for passing multidimensional arrays is, first array dimension does not have ...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Jun, 2021" }, { "code": null, "e": 528, "s": 54, "text": "This post is an extension of How to dynamically allocate a 2D array in C? A one dimensional array can be easily passed as a pointer, but syntax for passing a 2D array to a fu...
Set the limit of text length to N lines using CSS
02 Jan, 2019 It is possible to limit the text length to lines using CSS. This is known as line clamping or multiple line truncating. There can be two possible cases: Truncating text after 1 line: If you need to truncate text after 1 line then the text-overflow property of CSS can be used. It creates ellipses and grace...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Jan, 2019" }, { "code": null, "e": 149, "s": 28, "text": "It is possible to limit the text length to lines using CSS. This is known as line clamping or multiple line truncating." }, { "code": null, "e": 182, "s": 149...
How to Display Changed Browser URL Without Reloading Through alert using JavaScript ?
30 Jan, 2020 To change the URL in the browser without loading the new page, we can use history.pushState() method and replaceState() method from JavaScript. To display the browser-URL before changing the URL we will use window.location.href in the alert() function and will use again after changing the browsers-URL. Not...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Jan, 2020" }, { "code": null, "e": 332, "s": 28, "text": "To change the URL in the browser without loading the new page, we can use history.pushState() method and replaceState() method from JavaScript. To display the browser-URL befo...
PyQt5 QColorDialog – Changing Font
24 Jun, 2020 In this article we will see how we can change the font of QColorDialog. Font is the style i.e properties of the text present in the color dialog. Note : Increasing size of font will increase the size of the dialog box although dialog size is fixed In order to do this we use setFont method with the QColorDi...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Jun, 2020" }, { "code": null, "e": 174, "s": 28, "text": "In this article we will see how we can change the font of QColorDialog. Font is the style i.e properties of the text present in the color dialog." }, { "code": null, ...
Goldman Sachs Internship Interview Experience 2022
28 Dec, 2021 Every year, Goldman Sachs runs its Engineering Campus Hiring Program, an off-campus drive for their Bengaluru office. This year the applications opened from mid-July for about 3 weeks. Here, I am (extensively) sharing my own experience with this program, the entire selection process, Hope this helps! So al...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Dec, 2021" }, { "code": null, "e": 237, "s": 52, "text": "Every year, Goldman Sachs runs its Engineering Campus Hiring Program, an off-campus drive for their Bengaluru office. This year the applications opened from mid-July for abou...
Python OpenCV: Meanshift
07 Aug, 2021 OpenCV is the huge open-source library for computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important in today’s systems. By using it, one can process images and videos to identify objects, faces, or even the handwriting of a human. ...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Aug, 2021" }, { "code": null, "e": 336, "s": 28, "text": "OpenCV is the huge open-source library for computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important...
How to Create a COVID-19 Tracker Android App to See Details of any City and State in India?
21 Jun, 2022 In the previous article, we have discussed How to create a COVID-19 Tracker Android App which shows only the Global Stats. In this article, we will learn how to create a COVID-19 Tracker Android App which will show the details of any city in any State in India. Details like – Total Active cases, Cured Case...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Jun, 2022" }, { "code": null, "e": 528, "s": 52, "text": "In the previous article, we have discussed How to create a COVID-19 Tracker Android App which shows only the Global Stats. In this article, we will learn how to create a COVI...
ReactJS Onsen UI Page Component
28 Jun, 2021 ReactJS Onsen-UI is a popular front-end library with a set of React components that are designed to developing HTML5 hybrid and mobile web apps in a beautiful and efficient way. Page components are used for handling the entire page. The content can be scrolled. We can use the following approach in ReactJS ...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jun, 2021" }, { "code": null, "e": 371, "s": 28, "text": "ReactJS Onsen-UI is a popular front-end library with a set of React components that are designed to developing HTML5 hybrid and mobile web apps in a beautiful and efficient wa...
Proof that Path Selection Decision problem is NP-Complete
16 Jun, 2020 Prerequisite – NP-CompletenessThe decision problem of path selection problem asks if it is possible to select at least k paths from the given paths of a graph such that no two selected paths share any vertex. To prove that a problem is NP-Complete, we need to show that it is both NP and NP-Hard. We use PSP...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 Jun, 2020" }, { "code": null, "e": 263, "s": 54, "text": "Prerequisite – NP-CompletenessThe decision problem of path selection problem asks if it is possible to select at least k paths from the given paths of a graph such that no tw...
TreeSet descendingIterator() method in Java with Examples
18 Aug, 2021 The descendingIterator() method of java.util.TreeSet<E> class is used to return an iterator over the elements in this set in descending order.Syntax: public Iterator descendingIterator() Return Value: This method returns an iterator over the elements in this set in descending order.Below are the examples...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Aug, 2021" }, { "code": null, "e": 180, "s": 28, "text": "The descendingIterator() method of java.util.TreeSet<E> class is used to return an iterator over the elements in this set in descending order.Syntax: " }, { "code": n...
Replace all occurrences of a string with space
28 May, 2022 Given a string and a substring, the task is to replace all occurrences of the substring with space. We also need to remove trailing and leading spaces created due to this. Examples: Input: str = “LIELIEILIEAMLIECOOL”, sub = “LIE” Output: I AM COOL By replacing all occurrences of Sub in Str with empty space...
[ { "code": null, "e": 53, "s": 25, "text": "\n28 May, 2022" }, { "code": null, "e": 235, "s": 53, "text": "Given a string and a substring, the task is to replace all occurrences of the substring with space. We also need to remove trailing and leading spaces created due to this. Ex...
Minimum operations to make the MEX of the given set equal to x
08 Mar, 2022 Given a set of n integers, perform minimum number of operations (you can insert/delete elements into/from the set) to make the MEX of the set equal to x (that is given). Note:- The MEX of a set of integers is the minimum non-negative integer that doesn’t exist in it. For example, the MEX of the set {0, 2, ...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Mar, 2022" }, { "code": null, "e": 421, "s": 54, "text": "Given a set of n integers, perform minimum number of operations (you can insert/delete elements into/from the set) to make the MEX of the set equal to x (that is given). Note...
numpy string operations | strip() function
17 Jan, 2019 numpy.core.defchararray.strip(arr, chars=None) is another function for doing string operations in numpy. It returns a copy with the leading and trailing characters removed for each element in arr. Parameters:arr : array_like of str or unicode.char : [str or unicode, optional] the set of characters to be re...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Jan, 2019" }, { "code": null, "e": 225, "s": 28, "text": "numpy.core.defchararray.strip(arr, chars=None) is another function for doing string operations in numpy. It returns a copy with the leading and trailing characters removed for...
What is stdClass in PHP?
01 Aug, 2021 The stdClass is the empty class in PHP which is used to cast other types to object. It is similar to Java or Python object. The stdClass is not the base class of the objects. If an object is converted to object, it is not modified. But, if object type is converted/type-casted an instance of stdClass is cre...
[ { "code": null, "e": 54, "s": 26, "text": "\n01 Aug, 2021" }, { "code": null, "e": 433, "s": 54, "text": "The stdClass is the empty class in PHP which is used to cast other types to object. It is similar to Java or Python object. The stdClass is not the base class of the objects....
ReactJS Functional Components
30 Jun, 2022 Functional components are some of the more common components that will come across while working in React. These are simply JavaScript functions. We can create a functional component to React by writing a JavaScript function. These functions may or may not receive data as parameters. In the functional Comp...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Jun, 2022" }, { "code": null, "e": 498, "s": 52, "text": "Functional components are some of the more common components that will come across while working in React. These are simply JavaScript functions. We can create a functional c...
Python | Pandas Index.unique()
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.unique() function return unique values in the index. Uniques are returned in ord...
[ { "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...
if-else statement in java
An if statement can be followed by an optional else statement, which executes when the Boolean expression is false. Following is the syntax of an if...else statement − if(Boolean_expression) { // Executes when the Boolean expression is true }else { // Executes when the Boolean expression is false } If the boolea...
[ { "code": null, "e": 2627, "s": 2511, "text": "An if statement can be followed by an optional else statement, which executes when the Boolean expression is false." }, { "code": null, "e": 2679, "s": 2627, "text": "Following is the syntax of an if...else statement −" }, { ...
Decimal Struct in C#
15 Feb, 2019 In C#, Decimal Struct class is used to represent a decimal floating-point number. The range of decimal numbers is +79,228,162,514,264,337,593,543,950,335 to -79,228,162,514,264,337,593,543,950,335. Due to its wide range, it is generally used for financial calculations which required large numbers of signif...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 Feb, 2019" }, { "code": null, "e": 521, "s": 28, "text": "In C#, Decimal Struct class is used to represent a decimal floating-point number. The range of decimal numbers is +79,228,162,514,264,337,593,543,950,335 to -79,228,162,514,26...
Button in Android using Jetpack Compose
08 Sep, 2021 Jetpack Compose is a new toolkit provided by Google. This is useful for designing beautiful UI designs. A Button is a UI component in Android which is used to navigate between different screens. With the help of a button, the user can interact with your app and perform multiple actions inside your applicat...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Sep, 2021" }, { "code": null, "e": 445, "s": 28, "text": "Jetpack Compose is a new toolkit provided by Google. This is useful for designing beautiful UI designs. A Button is a UI component in Android which is used to navigate between...
Multi-dimensional lists in Python
09 Dec, 2018 There can be more than one additional dimension to lists in Python. Keeping in mind that a list can hold other lists, that basic principle can be applied over and over. Multi-dimensional lists are the lists within lists. Usually, a dictionary will be the better choice rather than a multi-dimensional list i...
[ { "code": null, "e": 54, "s": 26, "text": "\n09 Dec, 2018" }, { "code": null, "e": 371, "s": 54, "text": "There can be more than one additional dimension to lists in Python. Keeping in mind that a list can hold other lists, that basic principle can be applied over and over. Multi...
p5.js | mouseWheel() Function
29 Jan, 2020 The mouseWheel() function is invoked whenever a mouse or touchpad scroll causes a vertical mouse wheel event. This event can be accessed to determine the properties of the scroll. The delta property returns the amount of the scroll that took place. This value can be positive or negative depending on the di...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Jan, 2020" }, { "code": null, "e": 358, "s": 28, "text": "The mouseWheel() function is invoked whenever a mouse or touchpad scroll causes a vertical mouse wheel event. This event can be accessed to determine the properties of the scr...
MySQL | LEAD() and LAG() Function
04 Sep, 2021 The LEAD() and LAG() function in MySQL are used to get preceding and succeeding value of any row within its partition. These functions are termed as nonaggregate Window functions. The Window functions are those functions which perform operations for each row of the partition or window. These functions prod...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Sep, 2021" }, { "code": null, "e": 208, "s": 28, "text": "The LEAD() and LAG() function in MySQL are used to get preceding and succeeding value of any row within its partition. These functions are termed as nonaggregate Window functi...
pandas.merge_asof() function in Python
14 Aug, 2020 This method is used to perform an asof merge. This is similar to a left-join except that we match on nearest key rather than equal keys. Both DataFrames must be sorted by the key. Syntax : pandas.merge_asof(left, right, on=None, left_on=None, right_on=None, left_index=False, right_index=False, by=None, lef...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Aug, 2020" }, { "code": null, "e": 208, "s": 28, "text": "This method is used to perform an asof merge. This is similar to a left-join except that we match on nearest key rather than equal keys. Both DataFrames must be sorted by the ...
Automate Data Imports with Python | by Eser Saygın | Towards Data Science
Data import plays a pivotal role in data science. Knowing how to do it prevents the possibility of failure of the model. To achieve this, various methods, which differ depends on the data types (e.g. .csv, .txt, .json), are possible. Getting the data into the python environment one of the essential steps in building a ...
[ { "code": null, "e": 406, "s": 172, "text": "Data import plays a pivotal role in data science. Knowing how to do it prevents the possibility of failure of the model. To achieve this, various methods, which differ depends on the data types (e.g. .csv, .txt, .json), are possible." }, { "code":...
How to draw a dashed line on a Tkinter canvas?
To draw a dashed line on a Tkinter canvas, we can use the dash parameter of create_line() method. Import the tkinter library and create an instance of tkinter frame. Import the tkinter library and create an instance of tkinter frame. Set the size of the frame using geometry method. Set the size of the frame using geome...
[ { "code": null, "e": 1160, "s": 1062, "text": "To draw a dashed line on a Tkinter canvas, we can use the dash parameter of create_line() method." }, { "code": null, "e": 1228, "s": 1160, "text": "Import the tkinter library and create an instance of tkinter frame." }, { "c...
Convert an Object into a Matrix in R Programming - as.matrix() Function - GeeksforGeeks
27 Oct, 2021 as.matrix() function in R Programming Language is used to convert an object into a Matrix. Syntax: as.matrix(x) Parameters: x: Object to be converted R # R program to convert an object to matrix # Creating a vectorx <- c(1:9) # Calling as.matrix() Functionas.matrix(x) Output: [, 1] [1, ] 1 [2,...
[ { "code": null, "e": 25242, "s": 25214, "text": "\n27 Oct, 2021" }, { "code": null, "e": 25333, "s": 25242, "text": "as.matrix() function in R Programming Language is used to convert an object into a Matrix." }, { "code": null, "e": 25354, "s": 25333, "text": ...
Raw string literal in C++ program
In this article, we will be discussing the raw string literal in C++, its meaning, and examples. There are escape characters in C++ like “\n” or “\t”. When we try to print the escape characters, it will not display on the output. To show the escape characters on the output screen we use a raw string literal by using R”...
[ { "code": null, "e": 1159, "s": 1062, "text": "In this article, we will be discussing the raw string literal in C++, its meaning, and examples." }, { "code": null, "e": 1511, "s": 1159, "text": "There are escape characters in C++ like “\\n” or “\\t”. When we try to print the esca...
35 Questions To Test Your Knowledge of Python Sets | by GreekDataGuy | Towards Data Science
In my pursuit of interview algorithm mastery, I’ve found it useful to dig into Python’s basic data structures. This is my personal list of questions I wrote to evaluate my knowledge of Python sets. How well do you know python sets? No. A set is not an ordered data structure, so order is not maintained. Look what happen...
[ { "code": null, "e": 283, "s": 172, "text": "In my pursuit of interview algorithm mastery, I’ve found it useful to dig into Python’s basic data structures." }, { "code": null, "e": 370, "s": 283, "text": "This is my personal list of questions I wrote to evaluate my knowledge of P...
Getting Started with PyTorch - GeeksforGeeks
22 Jul, 2021 Deep Learning is a branch of Machine Learning where algorithms are written which mimic the functioning of a human brain. The most commonly used libraries in deep learning are Tensorflow and PyTorch. As there are various deep learning frameworks available, one might wonder when to use PyTorch. Here are reas...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n22 Jul, 2021" }, { "code": null, "e": 25903, "s": 25537, "text": "Deep Learning is a branch of Machine Learning where algorithms are written which mimic the functioning of a human brain. The most commonly used libraries in deep l...
Native MongoDB driver for Node.js - GeeksforGeeks
08 Oct, 2021 The native MongoDB driver for Node.JS is a dependency that allows our JavaScript application to interact with the NoSQL database, either locally or on the cloud through MongoDB Atlas. We are allowed to use promises as well as callbacks that gives us greater flexibility in using ES6 features. In order to s...
[ { "code": null, "e": 25669, "s": 25641, "text": "\n08 Oct, 2021" }, { "code": null, "e": 25963, "s": 25669, "text": "The native MongoDB driver for Node.JS is a dependency that allows our JavaScript application to interact with the NoSQL database, either locally or on the cloud th...
Construct BST from given preorder traversal | Set 1 - GeeksforGeeks
09 Mar, 2022 Given preorder traversal of a binary search tree, construct the BST. For example, if the given traversal is {10, 5, 1, 7, 40, 50}, then the output should be the root of the following tree. 10 / \ 5 40 / \ \ 1 7 50 Method 1 ( O(n2) time complexity ) The first element of preord...
[ { "code": null, "e": 39003, "s": 38975, "text": "\n09 Mar, 2022" }, { "code": null, "e": 39072, "s": 39003, "text": "Given preorder traversal of a binary search tree, construct the BST." }, { "code": null, "e": 39192, "s": 39072, "text": "For example, if the g...
SVG polygon Element - GeeksforGeeks
31 Mar, 2022 SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. The <polygon> element of SVG is used to make any type of polygon on the SVG and defines a closed shape consisting of a set of connected straight line segments. Syntax: <polygon points="Pair of point...
[ { "code": null, "e": 26139, "s": 26111, "text": "\n31 Mar, 2022" }, { "code": null, "e": 26407, "s": 26139, "text": "SVG stands for Scalable Vector Graphic. It can be used to make graphics and animations like in HTML canvas. The <polygon> element of SVG is used to make any type o...
Sub-string Divisibility by 11 Queries - GeeksforGeeks
08 Jul, 2021 Given a large number, n (having number digits up to 10^6) and various queries of the below form : Query(l, r) : find if the sub-string between the indices l and r (Both inclusive) are divisible by 11. Examples: Input: n = 122164154695 Queries: l = 0 r = 3, l = 1 r = 2, l...
[ { "code": null, "e": 26587, "s": 26559, "text": "\n08 Jul, 2021" }, { "code": null, "e": 26685, "s": 26587, "text": "Given a large number, n (having number digits up to 10^6) and various queries of the below form :" }, { "code": null, "e": 26822, "s": 26685, "...
Fabric.js Canvas selection Property - GeeksforGeeks
30 Jul, 2021 In this article, we are going to see how to enable or disable the selection of objects in a canvas in Fabric.js using the selection property. The canvas in Fabric.js is used as a wrapper over the native canvas object provided by HTML. It provides high-level access to the underlying canvas allowing it to ha...
[ { "code": null, "e": 26139, "s": 26111, "text": "\n30 Jul, 2021" }, { "code": null, "e": 26565, "s": 26139, "text": "In this article, we are going to see how to enable or disable the selection of objects in a canvas in Fabric.js using the selection property. The canvas in Fabric....
Python Lists VS Numpy Arrays - GeeksforGeeks
19 May, 2020 NumPy is the fundamental package for scientific computing in Python. NumPy arrays facilitate advanced mathematical and other types of operations on large numbers of data. Typically, such operations are executed more efficiently and with less code than is possible using Python’s built-in sequences. NumPy is...
[ { "code": null, "e": 25453, "s": 25425, "text": "\n19 May, 2020" }, { "code": null, "e": 25898, "s": 25453, "text": "NumPy is the fundamental package for scientific computing in Python. NumPy arrays facilitate advanced mathematical and other types of operations on large numbers o...
How to Fix: Length of values does not match length of index - GeeksforGeeks
22 Nov, 2021 In this article we will fix the error: The length of values does not match the length of the index in Python. Python3 # importing pandasimport pandas as pd sepal_length = [5.1, 4.9, 4.7, 4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9]sepal_width = [4.6, 5.0, 5.4, 4.6, 5.0, 4.4, 4.9, 5.1,...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n22 Nov, 2021" }, { "code": null, "e": 25647, "s": 25537, "text": "In this article we will fix the error: The length of values does not match the length of the index in Python." }, { "code": null, "e": 25655, "s": ...
Sum of the alphabetical values of the characters of a string - GeeksforGeeks
19 Mar, 2021 You are given an array of strings str, the task is to find the score of a given string s from the array. The score of a string is defined as the product of the sum of its characters’s alphabetical values with the position of the string in the array.Examples: Input: str[] = {“sahil”, “shashanak”, “sanjit”...
[ { "code": null, "e": 26565, "s": 26537, "text": "\n19 Mar, 2021" }, { "code": null, "e": 26826, "s": 26565, "text": "You are given an array of strings str, the task is to find the score of a given string s from the array. The score of a string is defined as the product of the sum...
Python | sympy.rewrite() method - GeeksforGeeks
07 Jul, 2019 With the help of sympy.rewrite() method, we can represent any mathematical function in terms of another function. Syntax: expression.rewrite(function) Parameters:expression – It is mathematical expression which is to be represented by another function.function – It is the mathematical function used to rewr...
[ { "code": null, "e": 26061, "s": 26033, "text": "\n07 Jul, 2019" }, { "code": null, "e": 26175, "s": 26061, "text": "With the help of sympy.rewrite() method, we can represent any mathematical function in terms of another function." }, { "code": null, "e": 26212, "...
How to create Emoji Picker in ReactJS ? - GeeksforGeeks
08 Nov, 2021 In this article, we are going to learn how we can create Emoji Picker in ReactJs. React is a free and open-source front-end JavaScript library for building user interfaces or UI components. It is maintained by Facebook and a community of individual developers and companies. Approach: To create our Spreadsh...
[ { "code": null, "e": 26071, "s": 26043, "text": "\n08 Nov, 2021" }, { "code": null, "e": 26346, "s": 26071, "text": "In this article, we are going to learn how we can create Emoji Picker in ReactJs. React is a free and open-source front-end JavaScript library for building user in...
How to push data in a MongoDB document ? - GeeksforGeeks
12 Nov, 2021 The insertOne() and insertMany() are the two methods of the MongoDB module in node.js that are used to push the documents in the collections of the MongoDB database. The insertOne() method inserts one data at a time into the collection and insertMany() method inserts multiple data into the collection of th...
[ { "code": null, "e": 26267, "s": 26239, "text": "\n12 Nov, 2021" }, { "code": null, "e": 26696, "s": 26267, "text": "The insertOne() and insertMany() are the two methods of the MongoDB module in node.js that are used to push the documents in the collections of the MongoDB databas...
Powershell - Create CSV File
New-Item cmdlet is used to create a csv file and Set-Content cmdlet to put content into it. In this example, we're creating a new csv file named test.csv Type the following command in PowerShell ISE Console New-Item D:\temp\test\test.csv -ItemType File You can see the test.csv created in D:\temp\test directory. In this...
[ { "code": null, "e": 2126, "s": 2034, "text": "New-Item cmdlet is used to create a csv file and Set-Content cmdlet to put content into it." }, { "code": null, "e": 2188, "s": 2126, "text": "In this example, we're creating a new csv file named test.csv" }, { "code": null, ...
Tryit Editor v3.7
Tryit: Set border colors
[]
Analyzing World Stock Indices Performances with Python | by Intan Dea Yutami | Towards Data Science
Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details. The stock index is a...
[ { "code": null, "e": 472, "s": 172, "text": "Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking profession...
Inverse Permutation | Practice | GeeksforGeeks
Given an array A of size n of integers in the range from 1 to n, we need to find the inverse permutation of that array. Inverse Permutation is a permutation which you will get by inserting position of an element at the position specified by the element value in the array. For better understanding, consider the followin...
[ { "code": null, "e": 734, "s": 238, "text": "Given an array A of size n of integers in the range from 1 to n, we need to find the inverse permutation of that array.\nInverse Permutation is a permutation which you will get by inserting position of an element at the position specified by the element v...
Scikit Learn - Ridge Regression
Ridge regression or Tikhonov regularization is the regularization technique that performs L2 regularization. It modifies the loss function by adding the penalty (shrinkage quantity) equivalent to the square of the magnitude of coefficients. sklearn.linear_model.Ridge is the module used to solve a regression model where...
[ { "code": null, "e": 2462, "s": 2221, "text": "Ridge regression or Tikhonov regularization is the regularization technique that performs L2 regularization. It modifies the loss function by adding the penalty (shrinkage quantity) equivalent to the square of the magnitude of coefficients." }, { ...
How to aggregate two collections where a field from one collection is greater than the other in MongoDB?
For this, you can use $lookup. Let us create a collection with documents − > db.demo446.insert([ ... { "ProductName": "Product1", "ProductPrice": 60 }, ... { "ProductName": "Product2", "ProductPrice": 90 } ... ]) BulkWriteResult({ "writeErrors" : [ ], "writeConcernErrors" : [ ], "nInserted" : 2, "nUps...
[ { "code": null, "e": 1137, "s": 1062, "text": "For this, you can use $lookup. Let us create a collection with documents −" }, { "code": null, "e": 1475, "s": 1137, "text": "> db.demo446.insert([\n... { \"ProductName\": \"Product1\", \"ProductPrice\": 60 },\n... { \"ProductN...
Common Pipenv Errors and How to Solve Them: Why Won’t it Lock?! | by Edward Krueger | Towards Data Science
By: Edward Krueger and Douglas Franklin. This article is one of many covering Python package and environment management with Pipenv. Here, you’ll learn how to troubleshoot Pipenv installation and locking issues. For more information on Pipenv, or environments, check out this Medium article! Pipenv combines package mana...
[ { "code": null, "e": 213, "s": 172, "text": "By: Edward Krueger and Douglas Franklin." }, { "code": null, "e": 464, "s": 213, "text": "This article is one of many covering Python package and environment management with Pipenv. Here, you’ll learn how to troubleshoot Pipenv install...
VBA - Erase Function
The Erase Function is used to reset the values of fixed size arrays and free the memory of the dynamic arrays. It behaves depending upon the type of the arrays. Erase ArrayName Fixed numeric array, each element in an array is reset to Zero. Fixed string array, each element in an array is reset to Zero length " ". Arra...
[ { "code": null, "e": 2096, "s": 1935, "text": "The Erase Function is used to reset the values of fixed size arrays and free the memory of the dynamic arrays. It behaves depending upon the type of the arrays." }, { "code": null, "e": 2113, "s": 2096, "text": "Erase ArrayName\n" ...
Why Git and Git-LFS is not enough to solve the Machine Learning Reproducibility crisis | by David Herron | Towards Data Science
Some claim the machine learning field is in a crisis due to software tooling that’s insufficient to ensure repeatable processes. The crisis is about difficulty in reproducing results such as machine learning models. The crisis could be solved with better software tools for machine learning practitioners. The reproducib...
[ { "code": null, "e": 353, "s": 47, "text": "Some claim the machine learning field is in a crisis due to software tooling that’s insufficient to ensure repeatable processes. The crisis is about difficulty in reproducing results such as machine learning models. The crisis could be solved with better s...
Apache Solr - Quick Guide
Solr is an open-source search platform which is used to build search applications. It was built on top of Lucene (full text search engine). Solr is enterprise-ready, fast and highly scalable. The applications built using Solr are sophisticated and deliver high performance. It was Yonik Seely who created Solr in 2004 in...
[ { "code": null, "e": 2298, "s": 2024, "text": "Solr is an open-source search platform which is used to build search applications. It was built on top of Lucene (full text search engine). Solr is enterprise-ready, fast and highly scalable. The applications built using Solr are sophisticated and deliv...
About Panel in ElectronJS - GeeksforGeeks
11 Jun, 2020 ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable of running on Windows, macOS, and Linux operating systems. It combines the Chromium engine and NodeJS into a Single Runtime. In trad...
[ { "code": null, "e": 25269, "s": 25241, "text": "\n11 Jun, 2020" }, { "code": null, "e": 25569, "s": 25269, "text": "ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which ...
k smallest elements in same order using O(1) extra space - GeeksforGeeks
14 Apr, 2021 You are given an array of n-elements you have to find k smallest elements from the array but they must be in the same order as they are in given array and we are allowed to use only O(1) extra space.Examples: Input : arr[] = {4, 2, 6, 1, 5}, k = 3 Output : 4 2 1 Explanation : 1, 2 and 4 are ...
[ { "code": null, "e": 40885, "s": 40857, "text": "\n14 Apr, 2021" }, { "code": null, "e": 41096, "s": 40885, "text": "You are given an array of n-elements you have to find k smallest elements from the array but they must be in the same order as they are in given array and we are a...
Min window substring in JavaScript
We are required to write a JavaScript function that takes in two strings let's call them str1 and str2. The size of str1 is guaranteed to be greater than that of str2. We are required to find the smallest substring in str1 that contains all the characters contained in str2. For example − If the input strings are − cons...
[ { "code": null, "e": 1166, "s": 1062, "text": "We are required to write a JavaScript function that takes in two strings let's call them str1 and str2." }, { "code": null, "e": 1337, "s": 1166, "text": "The size of str1 is guaranteed to be greater than that of str2. We are require...
Why interfaces don't have static initialization block when it can have static methods alone in java?
An interface in Java is similar to class but, it contains only abstract methods and fields which are final and static. A static method is declared using the static keyword and it will be loaded into the memory along with the class. You can access static methods using class name without instantiation. Since Java8 you ca...
[ { "code": null, "e": 1181, "s": 1062, "text": "An interface in Java is similar to class but, it contains only abstract methods and fields which are final and static." }, { "code": null, "e": 1364, "s": 1181, "text": "A static method is declared using the static keyword and it wil...
Python Program to Form a New String Made of the First 2 and Last 2 characters From a Given String
When it is required to form a new string that is made from the first two and last two characters of a given string, a counter can be defined, and indexing can be used to access specific range of elements. Below is the demonstration of the same − Live Demo my_string = "Hi there how are you" my_counter = 0 for i in my...
[ { "code": null, "e": 1267, "s": 1062, "text": "When it is required to form a new string that is made from the first two and last two characters of a given string, a counter can be defined, and indexing can be used to access specific range of elements." }, { "code": null, "e": 1308, "...
Artificial Intelligence - Quick Guide
Since the invention of computers or machines, their capability to perform various tasks went on growing exponentially. Humans have developed the power of computer systems in terms of their diverse working domains, their increasing speed, and reducing size with respect to time. A branch of Computer Science named Artific...
[ { "code": null, "e": 2167, "s": 1889, "text": "Since the invention of computers or machines, their capability to perform various tasks went on growing exponentially. Humans have developed the power of computer systems in terms of their diverse working domains, their increasing speed, and reducing si...
Automated Brute Forcing on web-based login - GeeksforGeeks
23 May, 2017 Brute force attacks work by calculating every possible combination that could make up a password and testing it to see if it is the correct password. As the password’s length increases, the amount of time, on average, to find the correct password increases exponentially. This means short passwords can usua...
[ { "code": null, "e": 24350, "s": 24322, "text": "\n23 May, 2017" }, { "code": null, "e": 24744, "s": 24350, "text": "Brute force attacks work by calculating every possible combination that could make up a password and testing it to see if it is the correct password. As the passwo...
java.util.regex.Matcher.group() Method
The java.time.Matcher.group(int group) method returns the input subsequence captured by the given group during the previous match operation. Following is the declaration for java.time.Matcher.group(int group) method. public String group(int group) group − The index of a capturing group in this matcher's pattern. group...
[ { "code": null, "e": 2265, "s": 2124, "text": "The java.time.Matcher.group(int group) method returns the input subsequence captured by the given group during the previous match operation." }, { "code": null, "e": 2341, "s": 2265, "text": "Following is the declaration for java.tim...
How to create editText accepts Alphabets only in Android?
This example demonstrates how do I create edittext accepts alphabets only 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="utf-8"?> <...
[ { "code": null, "e": 1148, "s": 1062, "text": "This example demonstrates how do I create edittext accepts alphabets only in android." }, { "code": null, "e": 1277, "s": 1148, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required ...
Given a binary tree, print out all of its root-to-leaf paths one per line. - GeeksforGeeks
05 Jul, 2021 Given the roots of a tree. print out all of its root-to-leaf paths one per line.. Algorithm: initialize: pathlen = 0, path[1000] /*1000 is some max limit for paths, it can change*/ /*printPathsRecur traverses nodes of tree in preorder */ printPathsRecur(tree, path[], pathlen) 1) If node is not NULL th...
[ { "code": null, "e": 37091, "s": 37063, "text": "\n05 Jul, 2021" }, { "code": null, "e": 37184, "s": 37091, "text": "Given the roots of a tree. print out all of its root-to-leaf paths one per line.. Algorithm:" }, { "code": null, "e": 37828, "s": 37184, "text"...
Python | Insert list in another list - GeeksforGeeks
26 Jan, 2019 The problem of inserting a number at any index is a quite common one. But sometimes we require to insert the whole list into another list. These kinds of problems occur in Machine Learning while playing with data. Let’s discuss certain ways in which this problem can be solved. Method #1 : Using insert() + ...
[ { "code": null, "e": 25672, "s": 25644, "text": "\n26 Jan, 2019" }, { "code": null, "e": 25950, "s": 25672, "text": "The problem of inserting a number at any index is a quite common one. But sometimes we require to insert the whole list into another list. These kinds of problems ...
Lucene - Indexing Process
Indexing process is one of the core functionality provided by Lucene. Following diagram illustrates the indexing process and use of classes. IndexWriter is the most important and core component of the indexing process. We add Document(s) containing Field(s) to IndexWriter which analyzes the Document(s) using the Analyz...
[ { "code": null, "e": 2062, "s": 1843, "text": "Indexing process is one of the core functionality provided by Lucene. Following diagram illustrates the indexing process and use of classes. IndexWriter is the most important and core component of the indexing process." }, { "code": null, "e...
How to move a Tkinter button? - GeeksforGeeks
02 Jul, 2021 Prerequisite: Creating a button in tkinter Tkinter is the most commonly used library for developing GUI (Graphical User Interface) in Python. It is a standard Python interface to the Tk GUI toolkit shipped with Python. As Tk and Tkinter are available on most of the Unix platforms as well as on the Windows ...
[ { "code": null, "e": 25743, "s": 25715, "text": "\n02 Jul, 2021" }, { "code": null, "e": 25786, "s": 25743, "text": "Prerequisite: Creating a button in tkinter" }, { "code": null, "e": 26132, "s": 25786, "text": "Tkinter is the most commonly used library for d...
Python MongoDB - insert_many Query - GeeksforGeeks
19 Jan, 2022 MongoDB is a cross-platform document-oriented and a non relational (i.e NoSQL) database program. It is an open-source document database, that stores the data in the form of key-value pairs. MongoDB is developed by MongoDB Inc. and initially released on 11 February 2009. It is written in C++, Go, JavaScript...
[ { "code": null, "e": 41448, "s": 41420, "text": "\n19 Jan, 2022" }, { "code": null, "e": 41844, "s": 41448, "text": "MongoDB is a cross-platform document-oriented and a non relational (i.e NoSQL) database program. It is an open-source document database, that stores the data in th...
8085 program to convert ASCII code into HEX code - GeeksforGeeks
14 Jun, 2018 Problem – Write an assembly level language program to convert ASCII code to its respective HEX Code. Examples: Input: DATA: 31H in memory location 2050 Output: DATA: 0BH in memory location 3050 Assume that starting address of program, input memory location, and output memory locations are 2000, 2050, and...
[ { "code": null, "e": 25100, "s": 25072, "text": "\n14 Jun, 2018" }, { "code": null, "e": 25201, "s": 25100, "text": "Problem – Write an assembly level language program to convert ASCII code to its respective HEX Code." }, { "code": null, "e": 25211, "s": 25201, ...
C++ program to calculate GST from original and net prices
Given with the original cost and net price as an input and the task is to calculate the GST percentage and display the result GST stands for Goods and Service task. It is always included in the Net price of the product and before calculating the GST percentage we need to calculate GST amount and for that there are form...
[ { "code": null, "e": 1188, "s": 1062, "text": "Given with the original cost and net price as an input and the task is to calculate the GST percentage and display the result" }, { "code": null, "e": 1397, "s": 1188, "text": "GST stands for Goods and Service task. It is always incl...
Tryit Editor v3.7
HTML file paths Tryit: relative url
[ { "code": null, "e": 26, "s": 10, "text": "HTML file paths" } ]
Disable a Bootstrap Button
When you disable a button, it will fade in color by 50%, and lose the gradient. Use disabled to disable any button. To disable a button, you can try to run the following code − Live Demo <!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "...
[ { "code": null, "e": 1178, "s": 1062, "text": "When you disable a button, it will fade in color by 50%, and lose the gradient. Use disabled to disable any button." }, { "code": null, "e": 1239, "s": 1178, "text": "To disable a button, you can try to run the following code −" },...
Firebase - Arrays
This chapter will explain the Firebase representation of arrays. We will use the same data from the previous chapter. We could create this data by sending the following JSON tree to the player’s collection. ['john', 'amanda'] This is because Firebase does not support Arrays directly, but it creates a list of objects w...
[ { "code": null, "e": 2284, "s": 2166, "text": "This chapter will explain the Firebase representation of arrays. We will use the same data from the previous chapter." }, { "code": null, "e": 2373, "s": 2284, "text": "We could create this data by sending the following JSON tree to ...
PHP | Ternary Operator
02 Sep, 2021 If-else and Switch cases are used to evaluate conditions and decide the flow of a program. The ternary operator is a shortcut operator used for shortening the conditional statements. ternary operator: The ternary operator (?:) is a conditional operator used to perform a simple comparison or check on a cond...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Sep, 2021" }, { "code": null, "e": 211, "s": 28, "text": "If-else and Switch cases are used to evaluate conditions and decide the flow of a program. The ternary operator is a shortcut operator used for shortening the conditional stat...