title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Create a blue button (primary) with Bootstrap
Use the .btn-primary class in Bootstrap to create a primary button in Bootstrap that is blue in color − Live Demo <!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"> <script src = "ht...
[ { "code": null, "e": 1166, "s": 1062, "text": "Use the .btn-primary class in Bootstrap to create a primary button in Bootstrap that is blue in color −" }, { "code": null, "e": 1176, "s": 1166, "text": "Live Demo" }, { "code": null, "e": 1725, "s": 1176, "text"...
How to open new pseudo-terminal pair using Python?
You can use the os.openpty() to open a new pseudo-terminal pair using Python. This method gives a pair of file descriptors (master, slave), for the master and the slave end, respectively. You can use it in the following way: import os # master for pty, slave for tty m,s = os.openpty() print m print s # showing terminal...
[ { "code": null, "e": 1250, "s": 1062, "text": "You can use the os.openpty() to open a new pseudo-terminal pair using Python. This method gives a pair of file descriptors (master, slave), for the master and the slave end, respectively." }, { "code": null, "e": 1287, "s": 1250, "te...
How to change the color of a single bar if a condition is true (Matplotlib)?
To change the color of a single bar if a condition is true, we can make a set of values and a list of colors with red until the value is 2; else add yellow color in the list. Set the figure size and adjust the padding between and around the subplots. Initialize a variable width of a bar. Make two lists of values and co...
[ { "code": null, "e": 1237, "s": 1062, "text": "To change the color of a single bar if a condition is true, we can make a set of values and a list of colors with red until the value is 2; else add yellow color in the list." }, { "code": null, "e": 1313, "s": 1237, "text": "Set the...
Healthcare Dataset with Spark. Spark is an open source project from... | by Alena Nazarava | Towards Data Science
Spark is an open source project from Apache. It is also the most commonly used analytics engine for big data and machine learning. This post will be focused on a quick start to develop a prediction algorithm with Spark. I chose ‘Healthcare Dataset Stroke Data’ dataset to work with from kaggle.com, the world’s largest c...
[ { "code": null, "e": 302, "s": 171, "text": "Spark is an open source project from Apache. It is also the most commonly used analytics engine for big data and machine learning." }, { "code": null, "e": 391, "s": 302, "text": "This post will be focused on a quick start to develop a...
PHP program to split a given comma delimited string into an array of values
To split a given comma delimited string into an array of values, the PHP code is as follows − Live Demo <?php $my_string = "456,789,23, 4, 019"; $my_str_arr = preg_split ("/,/", $my_string); print_r("The array is "); print_r($my_str_arr); $my_string = "00, 876, 5432, 1234, 0"; $my_str_arr = explode (",", $my_string); ...
[ { "code": null, "e": 1156, "s": 1062, "text": "To split a given comma delimited string into an array of values, the PHP code is as follows −" }, { "code": null, "e": 1167, "s": 1156, "text": " Live Demo" }, { "code": null, "e": 1433, "s": 1167, "text": "<?php\...
Gradient Descent From Scratch. Learn how to use derivatives to... | by Arseny Turin | Towards Data Science
In this post, I’m going to explain what is the Gradient Descent and how to implement it from scratch in Python. To understand how it works you will need some basic math and logical thinking. Though a stronger math background would be preferable to understand derivatives, I will try to explain them as simple as possible...
[ { "code": null, "e": 493, "s": 171, "text": "In this post, I’m going to explain what is the Gradient Descent and how to implement it from scratch in Python. To understand how it works you will need some basic math and logical thinking. Though a stronger math background would be preferable to underst...
Get Operating System temporary directory / folder in Java
To get the temporary directory in Java, use the System.getProperty() method. Use the It’s syntax is − String getProperty(String key) Above, the key is the name of the system property. Since, we want the Java Home Directory name, therefore we will add the key as − java.io.tmpdir The following is an example − Live Demo ...
[ { "code": null, "e": 1147, "s": 1062, "text": "To get the temporary directory in Java, use the System.getProperty() method. Use the" }, { "code": null, "e": 1164, "s": 1147, "text": "It’s syntax is −" }, { "code": null, "e": 1195, "s": 1164, "text": "String ge...
Peering Into the Black Box. How more engaging partial dependency... | by Raymond Willey | Towards Data Science
People don’t trust what they don’t understand. Artificial intelligence and machine learning algorithms are some of the most powerful technologies we have at our disposal, but they are also the most misunderstood. Hence, one of the most critical responsibilities of a data scientist is to communicate complex information ...
[ { "code": null, "e": 520, "s": 172, "text": "People don’t trust what they don’t understand. Artificial intelligence and machine learning algorithms are some of the most powerful technologies we have at our disposal, but they are also the most misunderstood. Hence, one of the most critical responsibi...
Association Rule Mining using Market Basket Analysis | by Sarit Maitra | Towards Data Science
ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nMARKET Basket Analysis(MB) is an association analysis and is a popular data mining technique. It’s a kind of knowledge discovery in data (KDD) and this technique can be applied in various fields of work. Here, I will use a retail transaction data and show how to provide the information to business capturing the purchase behavior of the buyer. This can also be a part of decision support system.\nVarious forms of data mining can be applied on this kind of data set e.g. classification, association, prediction, clustering, outlier analysis etc. Here, I will focus on association rule mining technique which is discovering interesting relationships hidden in data sets. If you are interested, may visit my earlier articles (1); (2); (3).\nMany of us are familiar with the below data set published at UCI machine learning data base. Data used in MB analysis is transactional data. Here, the data has all the basic ingredients of MB analysis. However, from my experience, transaction data rarely or we can rather say, never comes in this kind of format. Therefore, due to the complexity of transaction data, data cleaning and data reading is a major activity for MB analysis.\nLet’s see the dimension of the data frame as well as unique invoiceno and customerid\nIf we compare “invoiceno” vis-à-vis “description”, we can see that some of the rows do not have invoice number.\ndata[‘invoiceno’].value_counts()\nLet’s drop the rows that don’t have invoice numbers and remove the credit transactions (those with invoice numbers containing C).\nNow, we need to consolidate the items into 1 transaction per row with each product 1 hot encoded. Let’s check the name of the countries in the data frame.\nLet’s look at sales for Australia and compare the results to sales from France. Before we dive into analysis, let’s understand the association rule.\nRule generation is the first and foremost task in the mining of frequent patterns in such cases. An association rule is an implication expression of the form x → y, where x and y are disjoint itemsets. To evaluate the “interest” of such an association rule, different metrics have been developed. I will use the support, confidence and lift metrics.\nSuppose item x is being bought by the customer, then the chances of item y being picked by the customer too under the same Transaction ID is found out. There are 3 ways to measure association: Support, Confidence and Lift.\nSupport {freq (x,y) / n, range: [0, 1]} gives the fraction of transactions which contains item x and y. It tells us about the frequently bought items or the combination of items bought frequently and we can filter out the items that have a low frequency.\nConfidence {freq(x,y) / freq (x), range: [0, 1]} tells us how often the items x and y occur together, given the number times x occurs.\nLift {support/support(x) * support(y), range: [0, inf]} indicates the strength of a rule over the random occurrence of x and y. It explains the strength of a rule and more the Lift more is the strength.\nThis is a data mining methodology and the foundation of association rule. Apriori algorithm comes into act using “frequent itemsets” to generate association rules. It takes into consideration that, that a subset of a “frequent itemset” must also be a “frequent itemset”. The value of “frequent itemset” > than a threshold value(i.e. support).\nQuite a lot of zeros in the data but we also need to make sure any positive values are converted to a 1 and anything less the 0 is set to 0. so, let’s apply one hot encoding of the data and remove the postage column; we are not going to explore postage.\nNow that the data is structured properly, we can generate frequent item sets that have a support of at least 7% (this number was chosen so that I could get enough useful examples).\nTo select interesting rules we can use best-known constraints which are a minimum thresholds on confidence and support.\n“Support is an indication of how frequently the itemset appears in the dataset. Confidence is an indication of how often the rule has been found to be true”\n# generate the rules with their corresponding support, confidence # and liftfrequent_itemsets = apriori(basket_sets, min_support=0.07, use_colnames=True)print (frequent_itemsets)rules = association_rules(frequent_itemsets, metric=”lift”, min_threshold=1)rules.head()\nIf we print the number of associations, we see that 800 association rules were found.\nsupport=rules.as_matrix(columns=[‘support’])confidence=rules.as_matrix(columns=[‘confidence’])\nBelow scatter plot for support and confidence showing the association rules (first 10 rules) for the data set.\nLet’s find out what this tells us. For instance, we can see that there are quite a few rules with a high lift value which means that it occurs more frequently than would be expected given the number of transaction and product combinations. We can also see several where the confidence is high as well. Here, domain expertise has major advantage. I will look for a large lift (6) and high confidence (0.8) here.\nLooking at the rules, we can figure out that, “RED RETROSPOT CAKE STAND” and “36 PENCILS TUBE RED RETROSPOT” are purchased together and “4 TRADITIONAL SPINNING TOPS”, “ALARM CLOCK BAKELIKE GREEN” and “RED DINER WALL CLOCK” are purchased together in a manner that is higher than the overall probability would suggest. At this point, we may want to look at how much opportunity there is to use the popularity of one product to drive sales of another.\nWe can see that, though there is an association rule exists, but compared to 385 numbers of “36 PENCILS TUBE RED RETROSPOT” but only 73 numbers of “RED RETROSPOT CAKE STAND” so maybe business has to take some strategy here to bring both at par.\nWhat is also interesting is to see how the combinations vary by country of purchase. Let’s check out what some popular combinations might be in France.\nSo, this way we can compare and prepare an analysis report. Based on the association rule that we have defined, we found some significant correlation among some of the products. The priori algorithm applied here with the certain threshold. We can experiment with different threshold value as well. Larger the lift means more interesting association. Association rules with high support are potentially interesting rules. Similarly, rules with high confidence would be interesting rules as well.\nI can be contacted here."
[ { "code": null, "e": 215, "s": 172, "text": "https://sarit-maitra.medium.com/membership" }, { "code": null, "e": 612, "s": 215, "text": "MARKET Basket Analysis(MB) is an association analysis and is a popular data mining technique. It’s a kind of knowledge discovery in data (KDD) ...
What are the essential tags for an HTML Document?
HTML has various tags to format content, heading, align content, add sections, etc to a website. Some of the essential tags for an HTML document are doctype, <html>, <head>, <title> and <body>. doctypedoctype is the doctype declaration type. It is used for specifying which version of HTML the document is using. <!DOCTY...
[ { "code": null, "e": 1256, "s": 1062, "text": "HTML has various tags to format content, heading, align content, add sections, etc to a website. Some of the essential tags for an HTML document are doctype, <html>, <head>, <title> and <body>." }, { "code": null, "e": 1375, "s": 1256, ...
How can I convert Python strings into tuple?
Python’s built-in function tuple() converts any sequence object to tuple. If it is a string, each character is treated as a string and inserted in tuple separated by commas. >>> string="Tutorialspoint" >>> tuple(string) ('T', 'u', 't', 'o', 'r', 'i', 'a', 'l', 's', 'p', 'o', 'i', 'n', 't') Any non-sequence object as ar...
[ { "code": null, "e": 1236, "s": 1062, "text": "Python’s built-in function tuple() converts any sequence object to tuple. If it is a string, each character is treated as a string and inserted in tuple separated by commas." }, { "code": null, "e": 1353, "s": 1236, "text": ">>> stri...
What is dependency injection in PHP?
Dependency injection is a procedure where one object supplies the dependencies of another object. Dependency Injection is a software design approach that allows avoiding hard-coding dependencies and makes it possible to change the dependencies both at runtime and compile time. There are numerous approaches to inject ob...
[ { "code": null, "e": 1340, "s": 1062, "text": "Dependency injection is a procedure where one object supplies the dependencies of another object. Dependency Injection is a software design approach that allows avoiding hard-coding dependencies and makes it possible to change the dependencies both at r...
How to Schedule Notification in Android?
This example demonstrate about How to schedule notification 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" ?> <Relative...
[ { "code": null, "e": 1134, "s": 1062, "text": "This example demonstrate about How to schedule notification in android." }, { "code": null, "e": 1263, "s": 1134, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to cre...
Statistical - BAHTTEXT Function
The BAHTTEXT function converts a number to Thai text and adds a suffix of "Baht." BAHTTEXT (number) You can change the Baht format to a different style in the Excel desktop application by using Regional and Language Options in Control Panel of Windows. You can change the Baht format to a different style in the Excel d...
[ { "code": null, "e": 1936, "s": 1854, "text": "The BAHTTEXT function converts a number to Thai text and adds a suffix of \"Baht.\"" }, { "code": null, "e": 1955, "s": 1936, "text": "BAHTTEXT (number)\n" }, { "code": null, "e": 2108, "s": 1955, "text": "You can...
ML | ADAM (Adaptive Moment Estimation) Optimization - GeeksforGeeks
08 Sep, 2021 Prerequisite: Optimization techniques in Gradient Descent Gradient Descent is applicable in the scenarios where the function is easily differentiable with respect to the parameters used in the network. It is easy to minimize continuous functions than minimizing discrete functions. The weight update is perf...
[ { "code": null, "e": 23953, "s": 23925, "text": "\n08 Sep, 2021" }, { "code": null, "e": 24011, "s": 23953, "text": "Prerequisite: Optimization techniques in Gradient Descent" }, { "code": null, "e": 24573, "s": 24011, "text": "Gradient Descent is applicable i...
How to Easily Automate Your Keyboard to do Tasks in Python | by James Asher | Towards Data Science
Automating your keyboard in Python is ridiculously easy, here's how to do it. You can easily set up scripts to do tasks for you in your sleep, literally. Here, I’ll show you how to do it using an example of converting thousands of PDF’s to .txt files. This is also a really useful thing to know how to do when working wi...
[ { "code": null, "e": 250, "s": 172, "text": "Automating your keyboard in Python is ridiculously easy, here's how to do it." }, { "code": null, "e": 326, "s": 250, "text": "You can easily set up scripts to do tasks for you in your sleep, literally." }, { "code": null, ...
Python | Pandas Period.to_timestamp
06 Jan, 2019 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 Period.to_timestamp() function return the Timestamp representation of the Period at th...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Jan, 2019" }, { "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...
numpy.trapz() function | Python
26 Mar, 2020 numpy.trapz() function integrate along the given axis using the composite trapezoidal rule. Syntax : numpy.trapz(y, x = None, dx = 1.0, axis = -1) Parameters :y : [array_like] Input array to integrate.x : [array_like, optional] The sample points corresponding to the y values. If x is None, the sample point...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Mar, 2020" }, { "code": null, "e": 120, "s": 28, "text": "numpy.trapz() function integrate along the given axis using the composite trapezoidal rule." }, { "code": null, "e": 175, "s": 120, "text": "Syntax : numpy...
Python | shutil.copy2() method
16 Aug, 2021 Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Python’s standard utility modules. This module helps in automating process of copying and removal of files and directories.shutil.copy2() method in Python is used to copy the content o...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Aug, 2021" }, { "code": null, "e": 838, "s": 28, "text": "Shutil module in Python provides many functions of high-level operations on files and collections of files. It comes under Python’s standard utility modules. This module helps...
Seaborn | Categorical Plots
08 Oct, 2021 Plots are basically used for visualizing the relationship between variables. Those variables can be either be completely numerical or a category like a group, class or division. This article deals with categorical variables and how they can be visualized using the Seaborn library provided by Python. Seabo...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Oct, 2021" }, { "code": null, "e": 330, "s": 28, "text": "Plots are basically used for visualizing the relationship between variables. Those variables can be either be completely numerical or a category like a group, class or divisio...
How to Change the Name of a Pygame window?
01 Oct, 2021 PyGame window is a simple window that displays our game on the window screen. By default, pygame uses “Pygame window” as its title and pygame icon as its logo for pygame window. We can use set_caption() function to change the name and set_icon() to set icon of our window. To change the name of pygame windo...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Oct, 2021" }, { "code": null, "e": 325, "s": 52, "text": "PyGame window is a simple window that displays our game on the window screen. By default, pygame uses “Pygame window” as its title and pygame icon as its logo for pygame wind...
Scala | aggregate() Function
17 Apr, 2019 The aggregate() function is utilized to combine outcomes. Initially, a sequence operation is applied as that is the first parameter of aggregate() function and then its followed by a combine operation which is utilized to combine the solutions generated by the sequence operation performed. This function ca...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Apr, 2019" }, { "code": null, "e": 542, "s": 28, "text": "The aggregate() function is utilized to combine outcomes. Initially, a sequence operation is applied as that is the first parameter of aggregate() function and then its follow...
Flood fill algorithm using C graphics
30 Jun, 2021 Given a rectangle, your task to fill this rectangle using flood fill algorithm. Examples: Input : rectangle(left = 50, top = 50, right= 100, bottom = 100) flood( x = 55, y = 55, new_color = 12, old_color = 0) Output : Input : rectangle(left = 50, top = 50, right= 200, bottom = 400) flood...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Jun, 2021" }, { "code": null, "e": 120, "s": 28, "text": "Given a rectangle, your task to fill this rectangle using flood fill algorithm. Examples: " }, { "code": null, "e": 257, "s": 120, "text": "Input : rectan...
Synchronous and Asynchronous in JavaScript
09 Jul, 2020 Synchronous JavaScript: As the name suggests synchronous means to be in a sequence, i.e. every statement of the code gets executed one by one. So, basically a statement has to wait for the earlier statement to get executed.Let us understand this with the help of an example. Example: <script> document.wr...
[ { "code": null, "e": 54, "s": 26, "text": "\n09 Jul, 2020" }, { "code": null, "e": 329, "s": 54, "text": "Synchronous JavaScript: As the name suggests synchronous means to be in a sequence, i.e. every statement of the code gets executed one by one. So, basically a statement has t...
Tryit Editor v3.7
Tryit: Using w3css
[]
WebSockets - Opening Connections
Once a connection has been established between the client and the server, the open event is fired from Web Socket instance. It is called as the initial handshake between client and server. The event, which is raised once the connection is established, is called the onopen. Creating Web Socket connections is really simp...
[ { "code": null, "e": 2308, "s": 2119, "text": "Once a connection has been established between the client and the server, the open event is fired from Web Socket instance. It is called as the initial handshake between client and server." }, { "code": null, "e": 2532, "s": 2308, "t...
How We Built a Content-Based Filtering Recommender System For Music with Python | by Sammy Lee | Towards Data Science
Background: This project refers to Lambda Labs at Lambda School in which students spent the past 5 weeks building production-grade web applications, with some of them utilizing machine learning models as part of their backends. Our group’s assigned task involved coming up with an app that would recommend no copyright m...
[ { "code": null, "e": 826, "s": 172, "text": "Background: This project refers to Lambda Labs at Lambda School in which students spent the past 5 weeks building production-grade web applications, with some of them utilizing machine learning models as part of their backends. Our group’s assigned task i...
Java Examples - Write Data into Excel Sheet
How to write data into excel sheet using Java. Following is the program to write data into excel sheet using Java. import java.io.File; import java.io.FileOutputStream; import java.util.Map; import java.util.Set; import java.util.TreeMap; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.xssf.usermodel.X...
[ { "code": null, "e": 2115, "s": 2068, "text": "How to write data into excel sheet using Java." }, { "code": null, "e": 2183, "s": 2115, "text": "Following is the program to write data into excel sheet using Java." }, { "code": null, "e": 4225, "s": 2183, "text...
Combining Conditional Statements in Golang - GeeksforGeeks
08 Jun, 2020 Go is a open-source programming language developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is similar to C syntactically but with CSP style concurrency and many features of other robust programming language. Often refereed to as Golang because of the domain name, this language also ha...
[ { "code": null, "e": 24460, "s": 24432, "text": "\n08 Jun, 2020" }, { "code": null, "e": 25010, "s": 24460, "text": "Go is a open-source programming language developed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is similar to C syntactically but with CSP style c...
What are class variables, instance variables and local variables in Java?
A variable provides us with named storage that our programs can manipulate. Java provides three types of variables. Class variables − Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block. There would only be one copy of each class v...
[ { "code": null, "e": 1178, "s": 1062, "text": "A variable provides us with named storage that our programs can manipulate. Java provides three types of variables." }, { "code": null, "e": 1453, "s": 1178, "text": "Class variables − Class variables also known as static variables a...
Python time time() Method
Pythom time method time() returns the time as a floating point number expressed in seconds since the epoch, in UTC. Note − Even though the time is always returned as a floating point number, not all systems provide time with a better precision than 1 second. While this function normally returns non-decreasing values, i...
[ { "code": null, "e": 2360, "s": 2244, "text": "Pythom time method time() returns the time as a floating point number expressed in seconds since the epoch, in UTC." }, { "code": null, "e": 2673, "s": 2360, "text": "Note − Even though the time is always returned as a floating point...
What is variable shadowing in java?
In Java you can declare three types of variables namely, instance variables, static variables and, local variables. Local variables − Variables defined inside methods, constructors or blocks are called local variables. The variable will be declared and initialized within the method and the variable will be destroyed wh...
[ { "code": null, "e": 1178, "s": 1062, "text": "In Java you can declare three types of variables namely, instance variables, static variables and, local variables." }, { "code": null, "e": 1411, "s": 1178, "text": "Local variables − Variables defined inside methods, constructors o...
Redis - Commands
Redis commands are used to perform some operations on Redis server. To run commands on Redis server, you need a Redis client. Redis client is available in Redis package, which we have installed earlier. Following is the basic syntax of Redis client. $redis-cli Following example explains how we can start Redis client....
[ { "code": null, "e": 2113, "s": 2045, "text": "Redis commands are used to perform some operations on Redis server." }, { "code": null, "e": 2248, "s": 2113, "text": "To run commands on Redis server, you need a Redis client. Redis client is available in Redis package, which we hav...
Game with nos | Practice | GeeksforGeeks
You are given an array arr[], you have to re-construct an array arr[]. The values in arr[] are obtained by doing Xor of consecutive elements in the array. Example 1: ​Input : arr[ ] = {10, 11, 1, 2, 3} Output : 1 10 3 1 3 Explanation: At index 0, arr[0] xor arr[1] = 1 At index 1, arr[1] xor arr[2] = 10 At index 2, a...
[ { "code": null, "e": 382, "s": 226, "text": " You are given an array arr[], you have to re-construct an array arr[].\nThe values in arr[] are obtained by doing Xor of consecutive elements in the array." }, { "code": null, "e": 393, "s": 382, "text": "Example 1:" }, { "cod...
Machine Learning With Python - Quick Guide
We are living in the ‘age of data’ that is enriched with better computational power and more storage resources,. This data or information is increasing day by day, but the real challenge is to make sense of all the data. Businesses & organizations are trying to deal with it by building intelligent systems using the con...
[ { "code": null, "e": 2903, "s": 2304, "text": "We are living in the ‘age of data’ that is enriched with better computational power and more storage resources,. This data or information is increasing day by day, but the real challenge is to make sense of all the data. Businesses & organizations are t...
Pairs of Songs With Total Durations Divisible by 60 in Python
Suppose we have a list of songs, the i-th song has a duration of time[i] seconds. We have to find the number of pairs of songs for which their total time in seconds is divisible by 60. So if the time array is like [30, 20, 150, 100, 40], then the answer will be 3. Three pairs will be (3, 150), (20, 100), (20, 40) for a...
[ { "code": null, "e": 1247, "s": 1062, "text": "Suppose we have a list of songs, the i-th song has a duration of time[i] seconds. We have to find the number of pairs of songs for which their total time in seconds is divisible by 60." }, { "code": null, "e": 1430, "s": 1247, "text"...
Shell Script How to write logs in a Separate File | Shell Script Log Message
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws This is a very common scenario to log the app...
[ { "code": null, "e": 158, "s": 123, "text": "PROGRAMMINGJava ExamplesC Examples" }, { "code": null, "e": 172, "s": 158, "text": "Java Examples" }, { "code": null, "e": 183, "s": 172, "text": "C Examples" }, { "code": null, "e": 195, "s": 183, ...
An empirical approach to speedup your BERT inference with ONNX/Torchscript | by Maxence Alluin | Towards Data Science
In recent years models based on the Transformer architecture have been the driving force behind NLP breakthroughs in research and industry. BERT, XLNET, GPT or XLM are some of the models that improved the state of the art and reached the top of popular benchmarks like GLUE. These advances come with a steep computationa...
[ { "code": null, "e": 446, "s": 171, "text": "In recent years models based on the Transformer architecture have been the driving force behind NLP breakthroughs in research and industry. BERT, XLNET, GPT or XLM are some of the models that improved the state of the art and reached the top of popular be...
How To Run Bash Script In Linux? - GeeksforGeeks
30 Jun, 2021 The true power of a Bash script is utilized when it is run. But how to do that? Well, there are a plethora of ways to run a Bash script( shell script). Some of them may be useful in certain conditions, while it doesn’t matter how you run the script. Bash scripts are usually executed in the terminal or comm...
[ { "code": null, "e": 24431, "s": 24403, "text": "\n30 Jun, 2021" }, { "code": null, "e": 24758, "s": 24431, "text": "The true power of a Bash script is utilized when it is run. But how to do that? Well, there are a plethora of ways to run a Bash script( shell script). Some of the...
JFreeChart - TimeSeries Chart
A time series chart displays sequence of data points, which varies at equal intervals of time. This chapter demonstrates — how we can use JFreeChart to create Time Series Chart from a given set of business data. Let us consider various random numbers generated by using standard Java API Math.random(). We use these numb...
[ { "code": null, "e": 2153, "s": 1941, "text": "A time series chart displays sequence of data points, which varies at equal intervals of time. This chapter demonstrates — how we can use JFreeChart to create Time Series Chart from a given set of business data." }, { "code": null, "e": 2411...
Deploy Machine Learning Pipeline on AWS Fargate | by Moez Ali | Towards Data Science
In our last post on deploying a machine learning pipeline in the cloud, we demonstrated how to develop a machine learning pipeline in PyCaret, containerize it with Docker and serve it as a web application using Google Kubernetes Engine. If you haven’t heard about PyCaret before, please read this announcement to learn m...
[ { "code": null, "e": 496, "s": 171, "text": "In our last post on deploying a machine learning pipeline in the cloud, we demonstrated how to develop a machine learning pipeline in PyCaret, containerize it with Docker and serve it as a web application using Google Kubernetes Engine. If you haven’t hea...
Java program to find Largest, Smallest, Second Largest, Second Smallest in an array
To find largest, smallest, second largest, second smallest in an array, the code is as follows - Live Demo import java.util.*; public class Demo { public static void main(String []args){ int arr[] = {55, 10, 8, 90, 43, 87, 95, 25, 50, 12}; System.out.println("Array = "+Arrays.toString(arr)); Array...
[ { "code": null, "e": 1159, "s": 1062, "text": "To find largest, smallest, second largest, second smallest in an array, the code is as follows -" }, { "code": null, "e": 1170, "s": 1159, "text": " Live Demo" }, { "code": null, "e": 1698, "s": 1170, "text": "imp...
Concatenation of strings in Lua programming
Concatenation of strings is the process in which we combine two or more strings with each other, and in most of the programming languages this can be done by making use of the assignment operator. In Lua, the assignment operator concatenation doesn’t work. Consider the example shown below − Live Demo str1 = "tutorials...
[ { "code": null, "e": 1259, "s": 1062, "text": "Concatenation of strings is the process in which we combine two or more strings with each other, and in most of the programming languages this can be done by making use of the assignment operator." }, { "code": null, "e": 1319, "s": 1259...
<mat-checkbox> in Angular Material - GeeksforGeeks
31 Mar, 2021 Angular Material is a UI component library that is developed by the Angular team to build design components for desktop and mobile web applications. In order to install it, we need to have angular installed in our project, once you have it you can enter the below command and can download it. <mat-checkbox>...
[ { "code": null, "e": 25109, "s": 25081, "text": "\n31 Mar, 2021" }, { "code": null, "e": 25489, "s": 25109, "text": "Angular Material is a UI component library that is developed by the Angular team to build design components for desktop and mobile web applications. In order to in...
Count total set bits in all numbers from 1 to N | Set 3 - GeeksforGeeks
14 Feb, 2022 Given a positive integer N, the task is to count the total number of set bits in binary representation of all the numbers from 1 to N. Examples: Input: N = 3 Output: 4 setBits(1) + setBits(2) + setBits(3) = 1 + 1 + 2 = 4 Input: N = 6 Output: 9 Approach: Solution to this problem has been published in the...
[ { "code": null, "e": 25302, "s": 25274, "text": "\n14 Feb, 2022" }, { "code": null, "e": 25437, "s": 25302, "text": "Given a positive integer N, the task is to count the total number of set bits in binary representation of all the numbers from 1 to N." }, { "code": null, ...
How to list all files (only) from a directory using Java?
The ListFiles() method returns an array holding the objects (abstract paths) of all the files (and directories) in the path represented by the current (File) object. The File Filter interface is filter for the path names you can pass this as a parameter to the listFiles() method. This method filters the file names pass...
[ { "code": null, "e": 1228, "s": 1062, "text": "The ListFiles() method returns an array holding the objects (abstract paths) of all the files (and directories) in the path represented by the current (File) object." }, { "code": null, "e": 1407, "s": 1228, "text": "The File Filter ...
ExpressJS - URL Building
We can now define routes, but those are static or fixed. To use the dynamic routes, we SHOULD provide different types of routes. Using dynamic routes allows us to pass parameters and process based on them. Here is an example of a dynamic route − var express = require('express'); var app = express(); app.get('/:id', fu...
[ { "code": null, "e": 2267, "s": 2061, "text": "We can now define routes, but those are static or fixed. To use the dynamic routes, we SHOULD provide different types of routes. Using dynamic routes allows us to pass parameters and process based on them." }, { "code": null, "e": 2307, ...
Generating A Resume in Python. I am transitioning into the world of... | by Eddie Kirkland | Towards Data Science
I am transitioning into the world of Data Science, following the “self-taught” path. So as I sat down to begin writing a resume, I struggled with how to convey the new skills I am learning on something as static and conventional as a resume. To be honest, I found resume-writing pretty intimidating. How can I catch the ...
[ { "code": null, "e": 471, "s": 171, "text": "I am transitioning into the world of Data Science, following the “self-taught” path. So as I sat down to begin writing a resume, I struggled with how to convey the new skills I am learning on something as static and conventional as a resume. To be honest,...
Initialization, declaration and assignment terms in Java
A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable. You must declare...
[ { "code": null, "e": 1366, "s": 1062, "text": "A variable provides us with named storage that our programs can manipulate. Each variable in Java has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set ...
LISP - Operators
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. LISP allows numerous operations on data, supported by various functions, macros and other constructs. The operations allowed on data could be categorized as − Arithmetic Operations Comparison Operations Logical Op...
[ { "code": null, "e": 2269, "s": 2060, "text": "An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. LISP allows numerous operations on data, supported by various functions, macros and other constructs." }, { "code": null, "e": 2326, ...
Vectorization in Python. PyTrix#1: Speeding up our Python Code | by Kurtis Pykes | Towards Data Science
Python is a popular language for Data Science. With it’s easy to learn (and read) syntax it makes getting up and running with the language much more accessible for newbies. However, without getting into the details, Python is an interpreted language which means it runs much slower than a compiled language, like C. When...
[ { "code": null, "e": 487, "s": 171, "text": "Python is a popular language for Data Science. With it’s easy to learn (and read) syntax it makes getting up and running with the language much more accessible for newbies. However, without getting into the details, Python is an interpreted language which...
ES6 - Modules
Consider a scenario where parts of JavaScript code need to be reused. ES6 comes to your rescue with the concept of Modules. A module organizes a related set of JavaScript code. A module can contain variables and functions. A module is nothing more than a chunk of JavaScript code written in a file. By default, variables...
[ { "code": null, "e": 2401, "s": 2277, "text": "Consider a scenario where parts of JavaScript code need to be reused. ES6 comes to your rescue with the concept of Modules." }, { "code": null, "e": 2893, "s": 2401, "text": "A module organizes a related set of JavaScript code. A mod...
Explain Binding of a variable in C language.
Storage classes specify the scope, lifetime and binding of variables. To fully define a variable, one needs to mention not only its ‘type’ but also its storage class. A variable name identifies some physical location within computer memory, where a collection of bits are allocated for storing values of variable. Storag...
[ { "code": null, "e": 1132, "s": 1062, "text": "Storage classes specify the scope, lifetime and binding of variables." }, { "code": null, "e": 1229, "s": 1132, "text": "To fully define a variable, one needs to mention not only its ‘type’ but also its storage class." }, { "...
How to Download Twitter Followers or Friends for Free | by Brienna Herold | Towards Data Science
When you Google how to do this, all these companies pop up, offering to do this for you if you pay them a small fee. But Twitter gives you all the tools you need to do it yourself—for free. This short guide takes you through a Python script that helps you to use those tools. At the end of this guide, you get a script t...
[ { "code": null, "e": 448, "s": 172, "text": "When you Google how to do this, all these companies pop up, offering to do this for you if you pay them a small fee. But Twitter gives you all the tools you need to do it yourself—for free. This short guide takes you through a Python script that helps you...
Write program to reverse a String without using reverse() method in Java?
You can reverse a String in several ways, without using the reverse() function. Using recursion − Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function. You can ...
[ { "code": null, "e": 1142, "s": 1062, "text": "You can reverse a String in several ways, without using the reverse() function." }, { "code": null, "e": 1459, "s": 1142, "text": "Using recursion − Recursion is the process of repeating items in a self-similar way. In programming la...
Accessing Values of Strings in Python
Python does not support a character type; these are treated as strings of length one, thus also considered a substring. To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring. For example − Live Demo #!/usr/bin/python var1 = 'Hello World!' var2 = "Python Prog...
[ { "code": null, "e": 1182, "s": 1062, "text": "Python does not support a character type; these are treated as strings of length one, thus also considered a substring." }, { "code": null, "e": 1312, "s": 1182, "text": "To access substrings, use the square brackets for slicing alon...
MySQLi - Drop Database
You would need special privileges to create or to delete a MySQL database. So, assuming you have access to the root user, you can create any database using the mysql mysqladmin binary. Be careful while deleting any database because you will lose your all the data available in your database. Here is an example to delete...
[ { "code": null, "e": 2448, "s": 2263, "text": "You would need special privileges to create or to delete a MySQL database. So, assuming you have access to the root user, you can create any database using the mysql mysqladmin binary." }, { "code": null, "e": 2555, "s": 2448, "text"...
How to master Python’s main data analysis library in 20 Minutes | by Fabian Bosler | Towards Data Science
This article addresses typical problems and challenges aspiring data scientists and data analysts are facing regularly. We will solve those problems and tackle those challenges by utilizing Python’s most powerful library for data manipulation and analysis, Pandas. SetupLoading DataInspecting / Sorting / Filtering dataA...
[ { "code": null, "e": 312, "s": 47, "text": "This article addresses typical problems and challenges aspiring data scientists and data analysts are facing regularly. We will solve those problems and tackle those challenges by utilizing Python’s most powerful library for data manipulation and analysis,...
How to create a boxplot with outliers of larger size in R?
When we create a boxplot for a column of an R data frame that contains outlying values, the points for those values are smaller in size by default. If we want to increase the size for those outlying points then outlier.size argument can be used inside geom_boxplot function of ggplto2 package. Consider the below data fr...
[ { "code": null, "e": 1356, "s": 1062, "text": "When we create a boxplot for a column of an R data frame that contains outlying values, the points for those values are smaller in size by default. If we want to increase the size for those outlying points then outlier.size argument can be used inside g...
Complete Image Augmentation in OpenCV | Towards Data Science
A couple of days ago I was writing an article on using different colorspaces as inputs to CNN’s and for that, I had to use a custom data generator. This meant I could not use the Tensorflow’s inbuilt Image Data Generator for image augmentation. I searched online and found some articles but could not find anything which...
[ { "code": null, "e": 555, "s": 172, "text": "A couple of days ago I was writing an article on using different colorspaces as inputs to CNN’s and for that, I had to use a custom data generator. This meant I could not use the Tensorflow’s inbuilt Image Data Generator for image augmentation. I searched...
Create a Box Plot with SeaBorn – Python Pandas
Box Plot in Seaborn is used to draw a box plot to show distributions with respect to categories. The seaborn.boxplot() is used for this. Let’s say the following is our dataset in the form of a CSV file − Cricketers.csv At first, import the required 3 libraries − import seaborn as sb import pandas as pd import matplotli...
[ { "code": null, "e": 1199, "s": 1062, "text": "Box Plot in Seaborn is used to draw a box plot to show distributions with respect to categories. The seaborn.boxplot() is used for this." }, { "code": null, "e": 1281, "s": 1199, "text": "Let’s say the following is our dataset in the...
Arithmetic Pipeline and Instruction Pipeline - GeeksforGeeks
16 May, 2020 1. Arithmetic Pipeline :An arithmetic pipeline divides an arithmetic problem into various sub problems for execution in various pipeline segments. It is used for floating point operations, multiplication and various other computations. The process or flowchart arithmetic pipeline for floating point additio...
[ { "code": null, "e": 25078, "s": 25050, "text": "\n16 May, 2020" }, { "code": null, "e": 25412, "s": 25078, "text": "1. Arithmetic Pipeline :An arithmetic pipeline divides an arithmetic problem into various sub problems for execution in various pipeline segments. It is used for f...
Next.js - Api Routes
API Routes is a way to create rest API using Next.js. Next.js maps any file present in /pages/api folder and will be treated as API end point. An example of API function − export default (req, res) => { ... } Following are some important points to consider. req − req is an instance of http.IncomingMessage and is u...
[ { "code": null, "e": 2280, "s": 2107, "text": "API Routes is a way to create rest API using Next.js. Next.js maps any file present in /pages/api folder and will be treated as API end point. An example of API function − " }, { "code": null, "e": 2320, "s": 2280, "text": "export de...
JavaScript - Multimedia
The JavaScript navigator object includes a child object called plugins. This object is an array, with one entry for each plug-in installed on the browser. The navigator.plugins object is supported only by Netscape, Firefox, and Mozilla only. Here is an example that shows how to list down all the plug-on installed in yo...
[ { "code": null, "e": 2708, "s": 2466, "text": "The JavaScript navigator object includes a child object called plugins. This object is an array, with one entry for each plug-in installed on the browser. The navigator.plugins object is supported only by Netscape, Firefox, and Mozilla only." }, { ...
Boolean Matrix | Practice | GeeksforGeeks
Given a boolean matrix of size RxC where each cell contains either 0 or 1, modify it such that if a matrix cell matrix[i][j] is 1 then all the cells in its ith row and jth column will become 1. Example 1: Input: R = 2, C = 2 matrix[][] = {{1, 0}, {0, 0}} Output: 1 1 1 0 Explanation: Only cell that has 1...
[ { "code": null, "e": 432, "s": 238, "text": "Given a boolean matrix of size RxC where each cell contains either 0 or 1, modify it such that if a matrix cell matrix[i][j] is 1 then all the cells in its ith row and jth column will become 1." }, { "code": null, "e": 443, "s": 432, "...
Plotly Dash: From Development to Deployment | by Anshul Sharma | Towards Data Science
Plotly Dash is an amazing framework to build interactive dashboards purely using Python. As a dashboard is akin to a website, definitely a bit of HTML & CSS is also involved, but be rest assured it is so rudimentary that even I learned it while creating my first dashboard. In this tutorial, we will be building a COVID1...
[ { "code": null, "e": 446, "s": 172, "text": "Plotly Dash is an amazing framework to build interactive dashboards purely using Python. As a dashboard is akin to a website, definitely a bit of HTML & CSS is also involved, but be rest assured it is so rudimentary that even I learned it while creating m...
4 tricks you should know to parse date columns with Pandas read_csv() | by B. Chen | Towards Data Science
Importing data is the first step in any data science project. Often, you’ll work with data in CSV files and run into problems at the very beginning. Among the problems, parse date columns are the most common to us. In this article, we will cover the following most common parse date columns problems: Reading date column...
[ { "code": null, "e": 321, "s": 172, "text": "Importing data is the first step in any data science project. Often, you’ll work with data in CSV files and run into problems at the very beginning." }, { "code": null, "e": 473, "s": 321, "text": "Among the problems, parse date column...
Statistics for Dynamic Pricing of Theatre | by Yaakov Bressler | Towards Data Science
By: Yaakov Bressler & Kelly Carmody Summary: Dynamic pricing is the practice of adjusting a price to meet its demand, or market value. Given the difficulty of selling 100% of a performance’s tickets and that any unsold tickets immediately expire once a performance starts, dynamic pricing shows promise of lowering ticke...
[ { "code": null, "e": 208, "s": 172, "text": "By: Yaakov Bressler & Kelly Carmody" }, { "code": null, "e": 641, "s": 208, "text": "Summary: Dynamic pricing is the practice of adjusting a price to meet its demand, or market value. Given the difficulty of selling 100% of a performan...
sciPy stats.alpha() | Python - GeeksforGeeks
14 Mar, 2019 scipy.stats.alpha() is an alpha continuous random variable that is defined with a standard format and some shape parameters to complete its specification. Parameters :q : lower and upper tail probabilityx : quantilesa : shape parameterloc : [optional] location parameter. Default = 0scale : [optional] scale...
[ { "code": null, "e": 26047, "s": 26019, "text": "\n14 Mar, 2019" }, { "code": null, "e": 26202, "s": 26047, "text": "scipy.stats.alpha() is an alpha continuous random variable that is defined with a standard format and some shape parameters to complete its specification." }, ...
Deleting a binary tree using the delete keyword - GeeksforGeeks
26 Jul, 2018 A recursive and a non-recursive program to delete an entire binary tree has already been discussed in the previous posts. In this post, deleting the entire binary tree using the delete keyword in C++ is discussed. Declare a destructor function in the ‘BinaryTreeNode’ class which has been defined to create ...
[ { "code": null, "e": 26183, "s": 26155, "text": "\n26 Jul, 2018" }, { "code": null, "e": 26397, "s": 26183, "text": "A recursive and a non-recursive program to delete an entire binary tree has already been discussed in the previous posts. In this post, deleting the entire binary ...
Python | Combining values from dictionary of list - GeeksforGeeks
06 Mar, 2019 Given a dictionary of list values, the task is to combine every key-value pair in every combination. Input :{“Name” : [“Paras”, “Chunky”],“Site” : [“Geeksforgeeks”, “Cyware”, “Google”] } Output:[{‘Site’: ‘Geeksforgeeks’, ‘Name’: ‘Paras’}, {‘Site’: ‘Cyware’, ‘Name’: ‘Paras’},{‘Site’: ‘Google’, ‘Name’: ‘Para...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n06 Mar, 2019" }, { "code": null, "e": 25638, "s": 25537, "text": "Given a dictionary of list values, the task is to combine every key-value pair in every combination." }, { "code": null, "e": 25724, "s": 25638, ...
Python program to convert hex string to decimal - GeeksforGeeks
20 May, 2019 In Python, element conversion has been a very useful utility as it offers it in a much simpler way that other languages. This makes Python a robust language and hence knowledge of interconversions is always a plus for a programmer. This article discusses the hexadecimal string to a decimal number. Let’s di...
[ { "code": null, "e": 25897, "s": 25869, "text": "\n20 May, 2019" }, { "code": null, "e": 26255, "s": 25897, "text": "In Python, element conversion has been a very useful utility as it offers it in a much simpler way that other languages. This makes Python a robust language and he...
Cleaning the room - GeeksforGeeks
19 Mar, 2020 Given a room with square grids having ‘*’ and ‘.’ representing untidy and normal cells respectively.You need to find whether room can be cleaned or not.There is a machine which helps you in this task, but it is capable of cleaning only normal cell. Untidy cells cannot be cleaned with machine, until you hav...
[ { "code": null, "e": 25749, "s": 25721, "text": "\n19 Mar, 2020" }, { "code": null, "e": 26155, "s": 25749, "text": "Given a room with square grids having ‘*’ and ‘.’ representing untidy and normal cells respectively.You need to find whether room can be cleaned or not.There is a ...
Quickly check if two STL vectors contain same elements or not - GeeksforGeeks
16 Jul, 2021 Unlike normal C/C++ arrays, we don’t need to do element by element comparison to find if two given vectors contain same elements or not.In case of vectors, the operator “==” is overloaded to find the result quickly. Below is an example to demonstrate same. C++14 // C++ implementation to check whether elem...
[ { "code": null, "e": 25368, "s": 25340, "text": "\n16 Jul, 2021" }, { "code": null, "e": 25626, "s": 25368, "text": "Unlike normal C/C++ arrays, we don’t need to do element by element comparison to find if two given vectors contain same elements or not.In case of vectors, the ope...
Perl | Database management using DBI - GeeksforGeeks
18 Jun, 2019 Prerequisites: Introduction to Perl Database Systems Creating database programs is one of the most common uses of Perl. Using Perl, we can create robust web applications along with a database to manage all the data. It provides excellent support for interfacing and a broad range of database formats. For co...
[ { "code": null, "e": 25425, "s": 25397, "text": "\n18 Jun, 2019" }, { "code": null, "e": 25440, "s": 25425, "text": "Prerequisites:" }, { "code": null, "e": 25461, "s": 25440, "text": "Introduction to Perl" }, { "code": null, "e": 25478, "s": 2...
HTML | DOM Select Object - GeeksforGeeks
13 Feb, 2019 The Select object in HTML DOM is used to represent an HTML <select> element. The <select> element can be created by using the document.createElement() method and it can be accessed using the getElementById(). Syntax: It is used to create <select> element.document.createElement("SELECT") document.createElem...
[ { "code": null, "e": 25269, "s": 25241, "text": "\n13 Feb, 2019" }, { "code": null, "e": 25478, "s": 25269, "text": "The Select object in HTML DOM is used to represent an HTML <select> element. The <select> element can be created by using the document.createElement() method and i...
numpy.nanargmin() in Python - GeeksforGeeks
28 Mar, 2022 The numpy.nanargmin() function returns indices of the min element of the array in a particular axis ignoring NaNs. The results cannot be trusted if a slice contains only NaNs and Infs. Syntax: numpy.nanargmin(array, axis = None) Parameters : array : Input array to work on axis : [int, optional]Along ...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n28 Mar, 2022" }, { "code": null, "e": 25723, "s": 25537, "text": "The numpy.nanargmin() function returns indices of the min element of the array in a particular axis ignoring NaNs. The results cannot be trusted if a slice contain...
BootStrap | Positioning an element with Examples - GeeksforGeeks
15 Jul, 2021 The bootstrap framework provides us a series of classes which allows us to change the position of an element. It provides us five classes which are common in function with the CSS position property. In addition it provides three additional classes for controlling the position of an element.Common Classes: ...
[ { "code": null, "e": 25461, "s": 25433, "text": "\n15 Jul, 2021" }, { "code": null, "e": 25770, "s": 25461, "text": "The bootstrap framework provides us a series of classes which allows us to change the position of an element. It provides us five classes which are common in funct...
Random nextDouble() method in Java with Examples - GeeksforGeeks
07 Jan, 2019 The nextDouble() method of Random class returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator’s sequence. Syntax: public double nextDouble() Parameters: The function does not accepts any parameter. Return Value: This method returns the ne...
[ { "code": null, "e": 25959, "s": 25931, "text": "\n07 Jan, 2019" }, { "code": null, "e": 26131, "s": 25959, "text": "The nextDouble() method of Random class returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator’s s...
How To Make Lollipop Plot in R with ggplot2? - GeeksforGeeks
05 Oct, 2021 A lollipop plot is the combination of a line and a dot. It shows the relationship between a numeric and a categorical variable just like a barplot. A lollipop plot can be used at places where a barplot and scatter plot both are required. This single plot helps us visualize the problem better and takes less...
[ { "code": null, "e": 26513, "s": 26485, "text": "\n05 Oct, 2021" }, { "code": null, "e": 26858, "s": 26513, "text": "A lollipop plot is the combination of a line and a dot. It shows the relationship between a numeric and a categorical variable just like a barplot. A lollipop plot...
How to get current Wi-Fi BSSID in android?
This example demonstrate about How to get current Wi-Fi BSSID 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"?> <LinearLa...
[ { "code": null, "e": 1136, "s": 1062, "text": "This example demonstrate about How to get current Wi-Fi BSSID in android." }, { "code": null, "e": 1265, "s": 1136, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to c...
Making an Interactive Web App Using a Script — The PyWebIO Way | by Yong Cui | Towards Data Science
Web apps are the most effective way to showcase your work, because they’re platform-independent and highly interactive. If Python is the language of your choice, you’re offered with options, including Django and Flask, two leading frameworks for web development in Python. However, they’re not the easiest to learn for y...
[ { "code": null, "e": 395, "s": 46, "text": "Web apps are the most effective way to showcase your work, because they’re platform-independent and highly interactive. If Python is the language of your choice, you’re offered with options, including Django and Flask, two leading frameworks for web develo...
Difference between the byte stream and character stream classes in Java?
Java provides I/O Streams to read and write data where, a Stream represents an input source or an output destination which could be a file, i/o devise, other program etc. Based on the data they handle there are two types of streams − Byte Streams − These handle data in bytes (8 bits) i.e., the byte stream classes read/...
[ { "code": null, "e": 1233, "s": 1062, "text": "Java provides I/O Streams to read and write data where, a Stream represents an input source or an output destination which could be a file, i/o devise, other program etc." }, { "code": null, "e": 1296, "s": 1233, "text": "Based on th...
BrainFuck Interpreter in Java - GeeksforGeeks
23 Jul, 2021 Brainfuck consists of only eight simple commands and an instruction pointer. While it is fully Turing-complete, it is not intended for practical use, but to challenge and amuse programmers. BrainFuck consists of 8 character commands only which makes its use very challenging even for simple tasks – The > ...
[ { "code": null, "e": 23948, "s": 23920, "text": "\n23 Jul, 2021" }, { "code": null, "e": 24249, "s": 23948, "text": "Brainfuck consists of only eight simple commands and an instruction pointer. While it is fully Turing-complete, it is not intended for practical use, but to challe...
C# | Convert.FromBase64String(String) Method - GeeksforGeeks
01 Feb, 2019 This method is used to convert the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array. Syntax: public static byte[] FromBase64String (string s); Here, s is the string to convert. Return Value: This method returns an array of 8-bit unsigned integers ...
[ { "code": null, "e": 24302, "s": 24274, "text": "\n01 Feb, 2019" }, { "code": null, "e": 24447, "s": 24302, "text": "This method is used to convert the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array." }, { "cod...
What are RuntimeErrors in Python?
A syntax error happens when Python can't understand what you are saying. A run-time error happens when Python understands what you are saying, but runs into trouble when following your instructions. This is called a run-time error because it occurs after the program starts running. A program or code may be syntacticall...
[ { "code": null, "e": 1345, "s": 1062, "text": "A syntax error happens when Python can't understand what you are saying. A run-time error happens when Python understands what you are saying, but runs into trouble when following your instructions. This is called a run-time error because it occurs afte...
Calculate Pi with Python - GeeksforGeeks
19 May, 2021 Pi is an irrational number having non-recurring decimal values. We commonly know Pi=3.14 or Pi=22/7, but it is just an approximation for our ease. There are two methods to calculate the value of pi in python: Method 1: Using Leibniz’s formula The formula is – This series is never-ending, the more the terms...
[ { "code": null, "e": 25937, "s": 25909, "text": "\n19 May, 2021" }, { "code": null, "e": 26146, "s": 25937, "text": "Pi is an irrational number having non-recurring decimal values. We commonly know Pi=3.14 or Pi=22/7, but it is just an approximation for our ease. There are two me...
Fabric.js | Rect width Property - GeeksforGeeks
13 May, 2022 In this article, we are going to see how to set the width of a canvas rectangle using FabricJS. The canvas means rectangle is movable and can be stretched according to requirement. Further, the rectangle can be customized when it comes to initial stroke color, fill color, stroke width or size. To make it ...
[ { "code": null, "e": 26545, "s": 26517, "text": "\n13 May, 2022" }, { "code": null, "e": 26841, "s": 26545, "text": "In this article, we are going to see how to set the width of a canvas rectangle using FabricJS. The canvas means rectangle is movable and can be stretched accordin...
Count the number of elements in an array which are divisible by k - GeeksforGeeks
23 Sep, 2021 Given an array of integers. The task is to calculate the count of a number of elements which are divisible by a given number k. Examples: Input: arr[] = { 2, 6, 7, 12, 14, 18 }, k = 3 Output: 3 Numbers which are divisible by k are { 6, 12, 18 } Input: arr[] = { 2, 6, 7, 12, 14, 18 }, k = 2 Output: 5 Meth...
[ { "code": null, "e": 26562, "s": 26534, "text": "\n23 Sep, 2021" }, { "code": null, "e": 26690, "s": 26562, "text": "Given an array of integers. The task is to calculate the count of a number of elements which are divisible by a given number k." }, { "code": null, "e"...
MongoDB - Update Multiple Documents Using MongoShell - GeeksforGeeks
27 Feb, 2020 In MongoDB, you can update multiple documents in the collection using db.collection.updateMany() method. This method updates all the documents in the collection that match the given filter. updateMany() is a mongo shell method, which can update multiple document. This method only accepts the documents that...
[ { "code": null, "e": 25518, "s": 25490, "text": "\n27 Feb, 2020" }, { "code": null, "e": 25708, "s": 25518, "text": "In MongoDB, you can update multiple documents in the collection using db.collection.updateMany() method. This method updates all the documents in the collection th...
Java AWT | CardLayout Class - GeeksforGeeks
17 Aug, 2021 The CardLayout class manages the components in such a way that only one component is visible at a time. It treats each component as a card in the container. Only one card is visible at a time, and the container acts as a stack of cards. The first component added to a CardLayout object is the visible compon...
[ { "code": null, "e": 25631, "s": 25603, "text": "\n17 Aug, 2021" }, { "code": null, "e": 25981, "s": 25631, "text": "The CardLayout class manages the components in such a way that only one component is visible at a time. It treats each component as a card in the container. Only o...
Understanding Auxiliary Classifier : GAN - GeeksforGeeks
14 Oct, 2020 Prerequisite: GANs(General Adversarial Networks) In this article, we will be discussing a special class conditional GAN or c-GAN known as Auxiliary Classifier GAN or AC-GAN. Before getting into that, it is important to understand what a class conditional GAN is. Class-Conditional GAN (c-GANs): c-GAN can ...
[ { "code": null, "e": 25589, "s": 25561, "text": "\n14 Oct, 2020" }, { "code": null, "e": 25638, "s": 25589, "text": "Prerequisite: GANs(General Adversarial Networks)" }, { "code": null, "e": 25853, "s": 25638, "text": "In this article, we will be discussing a ...
PyQt5 – How to get cropped square image from rectangular image ? - GeeksforGeeks
26 Mar, 2020 In this article, we will see how to display only cropped square image from any rectangular image with any width and height i.e In order to do so we have to do the following steps : 1. Load the image2. Crop image to make it square3. Mask it and make perfect square from it using Painter4. Convert it back t...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n26 Mar, 2020" }, { "code": null, "e": 25664, "s": 25537, "text": "In this article, we will see how to display only cropped square image from any rectangular image with any width and height i.e" }, { "code": null, "e":...
Menu driven Python program to execute Linux commands - GeeksforGeeks
29 Dec, 2020 Linux is one of the most popular operating systems and is a common choice for developers. However, it is difficult to remember the vast range of commands that Linux supports, and hence a Python program that can run these commands easily is demonstrated below. In this article, we will deal with a Python pr...
[ { "code": null, "e": 25681, "s": 25653, "text": "\n29 Dec, 2020" }, { "code": null, "e": 25942, "s": 25681, "text": "Linux is one of the most popular operating systems and is a common choice for developers. However, it is difficult to remember the vast range of commands that Linu...
How to insert text into the textarea at the current cursor position? - GeeksforGeeks
22 Jun, 2021 To insert text into the textarea/inputbox at the current cursor position we need to get the current position of the cursor. So here the approach to get the current position of the cursor. First, get the current position of cursor with the help of property named as selectionStart on textarea/inputbox. To in...
[ { "code": null, "e": 25995, "s": 25967, "text": "\n22 Jun, 2021" }, { "code": null, "e": 26183, "s": 25995, "text": "To insert text into the textarea/inputbox at the current cursor position we need to get the current position of the cursor. So here the approach to get the current...
HTML | <td> bgcolor Attribute - GeeksforGeeks
17 Mar, 2022 The HTML <td> bgcolor attribute is used to specify the background color of a table cell. It is not supported by HTML 5. Syntax: <td bgcolor= "color_name | hex_number | rgb_number"> Attribute Values: color_name: It sets the text color by using the color name. For example “red”. hex_number: It sets the text ...
[ { "code": null, "e": 25524, "s": 25496, "text": "\n17 Mar, 2022" }, { "code": null, "e": 25644, "s": 25524, "text": "The HTML <td> bgcolor attribute is used to specify the background color of a table cell. It is not supported by HTML 5." }, { "code": null, "e": 25652,...
Node.js console.error() Function - GeeksforGeeks
14 Oct, 2021 The console.error() function from console class of Node.js is used to display an error messages on the console. It prints to stderr with newline.Syntax: console.error([data][, ...args]) Parameter: This function can contains multiple parameters. The first parameter is used for the primary message and other...
[ { "code": null, "e": 38501, "s": 38473, "text": "\n14 Oct, 2021" }, { "code": null, "e": 38655, "s": 38501, "text": "The console.error() function from console class of Node.js is used to display an error messages on the console. It prints to stderr with newline.Syntax: " }, {...
getproperty() and getproperties() methods of System Class in Java - GeeksforGeeks
21 Jan, 2022 The System class in Java has two methods used to read system properties: getProperty: The System class has two different versions of getProperty. Both retrieve the value of the property named in the argument list. The simpler of the two getProperty methods takes a single argument. getProperties: The java....
[ { "code": null, "e": 26277, "s": 26249, "text": "\n21 Jan, 2022" }, { "code": null, "e": 26351, "s": 26277, "text": "The System class in Java has two methods used to read system properties: " }, { "code": null, "e": 26560, "s": 26351, "text": "getProperty: The...
Resize an iframe based on the content - GeeksforGeeks
10 Jun, 2019 The iframe HTML element is often used to insert contents from another source. Contents which needs resizing is done indirectly using a div tag. The trick is to initiate with a div tag and enclose within an iframe tag. Now provide iframe with CSS.Note: To open the source site to resize its contents, the sou...
[ { "code": null, "e": 26131, "s": 26103, "text": "\n10 Jun, 2019" }, { "code": null, "e": 26485, "s": 26131, "text": "The iframe HTML element is often used to insert contents from another source. Contents which needs resizing is done indirectly using a div tag. The trick is to ini...
Aptitude | GATE CS 1998 | Question 10 - GeeksforGeeks
08 Jun, 2020 Which of the following sets can be recognized by a Deterministic Finite-state Automaton?(A) The number 1, 2, 4, 8......,2^n,.......... written in binary.(B) The number 1, 2, 4,....., 2^n,.......... written in unary.(C) The set of binary strings in which the number of zeros is the same as the number of ones...
[ { "code": null, "e": 25681, "s": 25653, "text": "\n08 Jun, 2020" }, { "code": null, "e": 26433, "s": 25681, "text": "Which of the following sets can be recognized by a Deterministic Finite-state Automaton?(A) The number 1, 2, 4, 8......,2^n,.......... written in binary.(B) The nu...