title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to close JFrame on the click of a Button in Java | Set frame.dispose() on the click of a button to close JFrame. At first create a button and frame −
JFrame frame = new JFrame();
JButton button = new JButton("Click to Close!");
Now, close the JFrame on the click of the above button with Action Listener −
button.addActionListener(e -> {
frame.dispose();
});
The follo... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "Set frame.dispose() on the click of a button to close JFrame. At first create a button and frame −"
},
{
"code": null,
"e": 1239,
"s": 1161,
"text": "JFrame frame = new JFrame();\nJButton button = new JButton(\"Click to Close!\");"
... |
How to write a class inside an interface in Java? | Defining a class within an interface is allowed in Java. If the methods of an interface accept a class as an argument and the class is not used elsewhere, in such cases we can define a class inside an interface.
In the following example we have an interface with name CarRentalServices and this interface has two methods... | [
{
"code": null,
"e": 1274,
"s": 1062,
"text": "Defining a class within an interface is allowed in Java. If the methods of an interface accept a class as an argument and the class is not used elsewhere, in such cases we can define a class inside an interface."
},
{
"code": null,
"e": 1484... |
What is the difference between a mutable and immutable string in C#? | StringBuilder is a mutable string in C#. With StringBuilder, you can expand the number of characters in the string. The string cannot be changed once it is created, but StringBuilder can be expanded. It does not create a new object in the memory.
Set StringBuilder −
StringBuilder str = new StringBuilder();
Let us see a... | [
{
"code": null,
"e": 1309,
"s": 1062,
"text": "StringBuilder is a mutable string in C#. With StringBuilder, you can expand the number of characters in the string. The string cannot be changed once it is created, but StringBuilder can be expanded. It does not create a new object in the memory."
},
... |
Group Anagrams in Python | Suppose, we have a set of strings. We have to group anagram together. So if the ["eat", "tea", "tan", "ate", "nat", "bat"], then the groups are [["ate","eat","tea"],["nat","tan"],["bat"]]
To solve this, we will follow these steps −
Define res as map
for i in string arrayx := x and join, sorted string of iif x in result... | [
{
"code": null,
"e": 1250,
"s": 1062,
"text": "Suppose, we have a set of strings. We have to group anagram together. So if the [\"eat\", \"tea\", \"tan\", \"ate\", \"nat\", \"bat\"], then the groups are [[\"ate\",\"eat\",\"tea\"],[\"nat\",\"tan\"],[\"bat\"]]"
},
{
"code": null,
"e": 1294... |
Food Nutrition: Learn from Data | Towards Data Science | I love to explore my data and finding unexpected patterns from it. As a data scientist, in my personal opinion, we need to have this curiosity trait to succeed in this field. The way to explore data thou is not limited only to basic techniques such as visualizing the data and getting the statistic number, one way is to... | [
{
"code": null,
"e": 521,
"s": 172,
"text": "I love to explore my data and finding unexpected patterns from it. As a data scientist, in my personal opinion, we need to have this curiosity trait to succeed in this field. The way to explore data thou is not limited only to basic techniques such as vis... |
How to play YouTube video in my Android Application? | This example demonstrates how do I play Youtube video 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 following the dependancies in the build.gradle (Module:app)
implementation 'com.android.support:recyclerview-v7:... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "This example demonstrates how do I play Youtube video in android."
},
{
"code": null,
"e": 1257,
"s": 1128,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a ... |
You never get bored playing with Computer Vision | by Denys Periel | Towards Data Science | In this article, you will learn how to record a screen with a decent frame rate by using Python and MSS. How to use template matching and edge detection with OpenCV. And if you wish you can make your machine to play a game.
I like automation and once I read a review written by Markus Rene Pae about yet another python l... | [
{
"code": null,
"e": 396,
"s": 172,
"text": "In this article, you will learn how to record a screen with a decent frame rate by using Python and MSS. How to use template matching and edge detection with OpenCV. And if you wish you can make your machine to play a game."
},
{
"code": null,
... |
Restrict keyword in C | Here we will see what is the restrict keyword in C. The restrict keyword first introduced in C99 version. Let us see what is actually this restrict keyword.
The restrict keyword is used for pointer declarations as a type quantifier of the pointer.
The restrict keyword is used for pointer declarations as a type quantifi... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "Here we will see what is the restrict keyword in C. The restrict keyword first introduced in C99 version. Let us see what is actually this restrict keyword."
},
{
"code": null,
"e": 1310,
"s": 1219,
"text": "The restrict keyword is u... |
Check if a given string is a valid number (Integer or Floating Point) in Java | SET 2 (Regular Expression approach) | 28 Sep, 2020
In Set 1, we have discussed general approach to check whether a string is a valid number or not. In this post, we will discuss regular expression approach to check for a number.
Examples:
Input : str = "11.5"
Output : true
Input : str = "abc"
Output : false
Input : str = "2e10"
Output : true
Input : 10e... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Sep, 2020"
},
{
"code": null,
"e": 230,
"s": 52,
"text": "In Set 1, we have discussed general approach to check whether a string is a valid number or not. In this post, we will discuss regular expression approach to check for a numb... |
Working with the pycricbuzz library in Python | 01 Nov, 2020
Pycricbuzz is a python library that can be used to get live scores, commentary and full scorecard for recent and live matches.
In case you want to know how the library was developed, you can watch the video: https://youtu.be/OQqYbC1BKxw
Installation: Run the following pip command in the terminal.
pip inst... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Nov, 2020"
},
{
"code": null,
"e": 155,
"s": 28,
"text": "Pycricbuzz is a python library that can be used to get live scores, commentary and full scorecard for recent and live matches."
},
{
"code": null,
"e": 266,
"s... |
Transport Layer Security (TLS) | 14 Feb, 2022
Transport Layer Securities (TLS) are designed to provide security at the transport layer. TLS was derived from a security protocol called Secure Socket Layer (SSL). TLS ensures that no third party may eavesdrop or tampers with any message.
There are several benefits of TLS:
Encryption: TLS/SSL can help ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Feb, 2022"
},
{
"code": null,
"e": 295,
"s": 54,
"text": "Transport Layer Securities (TLS) are designed to provide security at the transport layer. TLS was derived from a security protocol called Secure Socket Layer (SSL). TLS ensur... |
Convert List to Array in Java | Difficulty Level :
Easy
The List interface provides a way to store the ordered collection. It is a child interface of Collection. It is an ordered collection of objects in which duplicate values can be stored. Since List preserves the insertion order, it allows positional access and insertion of elements. Now here we a... | [
{
"code": null,
"e": 24,
"s": 0,
"text": "Difficulty Level :\nEasy"
},
{
"code": null,
"e": 473,
"s": 24,
"text": "The List interface provides a way to store the ordered collection. It is a child interface of Collection. It is an ordered collection of objects in which duplicate v... |
PyQt5 – Flames Calculator | 03 Jun, 2022
In this article we will see how we can create a flames calculator using PyQt5. This flames calculator assesses and predicts the outcome of a relationship based on an algorithm of two given names.FLAMES is a popular game named after the acronym: Friends, Lovers, Affectionate, Marriage, Enemies, Sibling. Thi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2022"
},
{
"code": null,
"e": 517,
"s": 28,
"text": "In this article we will see how we can create a flames calculator using PyQt5. This flames calculator assesses and predicts the outcome of a relationship based on an algorithm... |
Extract URLs present in a given string | 08 Feb, 2021
Given a string S, the task is to find and extract all the URLs from the string. If no URL is present in the string, then print “-1”.
Examples:
Input: S = “Welcome to https://www.geeksforgeeks.org Computer Science Portal”Output: https://www.geeksforgeeks.orgExplanation:The given string contains the URL ‘htt... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Feb, 2021"
},
{
"code": null,
"e": 161,
"s": 28,
"text": "Given a string S, the task is to find and extract all the URLs from the string. If no URL is present in the string, then print “-1”."
},
{
"code": null,
"e": 171,
... |
Create a string with multiple spaces in JavaScript | 10 May, 2019
We have a string with extra-spaces and if we want to display it in the browser then extra spaces will not be displayed. Adding the number of spaces to the string can be done in the following ways.
substr():This method gets a part of a string, starts at the character at the defined position, and returns the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2019"
},
{
"code": null,
"e": 225,
"s": 28,
"text": "We have a string with extra-spaces and if we want to display it in the browser then extra spaces will not be displayed. Adding the number of spaces to the string can be done i... |
Horizontal CalendarView in Android | 05 May, 2021
If we are making an application that provides services such as booking flights, movie tickets, or others we generally have to implement a calendar in our application. We have to align the calendar in such a way so that it will look better and will take less amount of space in the mobile app. Most of the ap... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 520,
"s": 28,
"text": "If we are making an application that provides services such as booking flights, movie tickets, or others we generally have to implement a calendar in our application. We have ... |
Python – Inverse Dictionary Values List | 14 Oct, 2020
Given a Dictionary as value lists, inverse it, i.e map elements in list to keys and create new values list.
Input : test_dict = {1: [2, 3], 2: [3], 3: [1]}Output : {2: [1], 3: [1, 2], 1: [3]}Explanation : List elements mapped with their keys.
Input : test_dict = {1: [2, 3, 4]}Output : {2: [1], 3: [1], 4: [... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 136,
"s": 28,
"text": "Given a Dictionary as value lists, inverse it, i.e map elements in list to keys and create new values list."
},
{
"code": null,
"e": 271,
"s": 136,
"text":... |
Complete Graph using Networkx in Python | 29 Apr, 2021
A complete graph also called a Full Graph it is a graph that has n vertices where the degree of each vertex is n-1. In other words, each vertex is connected with every other vertex.
Example: Complete Graph with 6 edges:
C_G6
Properties of Complete Graph:
The degree of each vertex is n-1.
The total number o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Apr, 2021"
},
{
"code": null,
"e": 210,
"s": 28,
"text": "A complete graph also called a Full Graph it is a graph that has n vertices where the degree of each vertex is n-1. In other words, each vertex is connected with every other v... |
How to put the y-axis in logarithmic scale with Matplotlib ? | 17 Dec, 2020
Axes’ in all plots using Matplotlib are linear by default, yscale() method of the matplotlib.pyplot library can be used to change the y-axis scale to logarithmic.
The method yscale() takes a single value as a parameter which is the type of conversion of the scale, to convert y-axes to logarithmic scale we ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Dec, 2020"
},
{
"code": null,
"e": 217,
"s": 54,
"text": "Axes’ in all plots using Matplotlib are linear by default, yscale() method of the matplotlib.pyplot library can be used to change the y-axis scale to logarithmic."
},
{
... |
How to Generate JVM Heap Memory Dump? | 23 Aug, 2021
Java Heap dump is a snapshot of all java objects that are present in the JVM(Java Virtual Machine) at a certain point in time. The JVM allocates memory for objects which are class instances or arrays in the heap memory. When the objects are no longer needed or are no more referenced, the Garbage Collector ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 397,
"s": 28,
"text": "Java Heap dump is a snapshot of all java objects that are present in the JVM(Java Virtual Machine) at a certain point in time. The JVM allocates memory for objects which are c... |
Convert Java String to Short in Java | Use valueOf() method to convert a String in Java to Short.
Let us take a string.
The following is an example −
String myStr = "5";
Now take Short object and use the valueOf() method. The argument should be the string we declared above.
The following is an example.
Short myShort = Short.valueOf(myStr);
Let us now see th... | [
{
"code": null,
"e": 1246,
"s": 1187,
"text": "Use valueOf() method to convert a String in Java to Short."
},
{
"code": null,
"e": 1268,
"s": 1246,
"text": "Let us take a string."
},
{
"code": null,
"e": 1298,
"s": 1268,
"text": "The following is an example −"... |
Friend class and function in C++ | A friend function of a class is defined outside that class' scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member functions.
A friend can be a function, function template, or member func... | [
{
"code": null,
"e": 1446,
"s": 1187,
"text": "A friend function of a class is defined outside that class' scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member funct... |
Python Program for Longest Palindromic Subsequence | DP-12 | 21 Feb, 2022
Given a sequence, find the length of the longest palindromic subsequence in it.
As another example, if the given sequence is “BBABCBCAB”, then the output should be 7 as “BABCBAB” is the longest palindromic subsequence in it. “BBBBB” and “BBCBB” are also palindromic subsequences of the given sequence, but ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Feb, 2022"
},
{
"code": null,
"e": 109,
"s": 28,
"text": "Given a sequence, find the length of the longest palindromic subsequence in it. "
},
{
"code": null,
"e": 729,
"s": 109,
"text": "As another example, if th... |
MySQL | DEFAULT() Function | 25 Mar, 2019
The DEFAULT() function returns the default value for table column.
DEFAULT value of a column is a value used in the case, there is no value specified by user.
In order, to use this function there should be a DEFAULT value assign to the column. Otherwise, it will generate an error.
Syntax:
DEFAULT ( column_... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Mar, 2019"
},
{
"code": null,
"e": 95,
"s": 28,
"text": "The DEFAULT() function returns the default value for table column."
},
{
"code": null,
"e": 187,
"s": 95,
"text": "DEFAULT value of a column is a value used... |
Array Subset of another array | Practice | GeeksforGeeks | Given two arrays: a1[0..n-1] of size n and a2[0..m-1] of size m. Task is to check whether a2[] is a subset of a1[] or not. Both the arrays can be sorted or unsorted.
Example 1:
Input:
a1[] = {11, 1, 13, 21, 3, 7}
a2[] = {11, 3, 7, 1}
Output:
Yes
Explanation:
a2[] is a subset of a1[]
Example 2:
Input:
a1[] = {1, 2, ... | [
{
"code": null,
"e": 407,
"s": 238,
"text": "Given two arrays: a1[0..n-1] of size n and a2[0..m-1] of size m. Task is to check whether a2[] is a subset of a1[] or not. Both the arrays can be sorted or unsorted. \n "
},
{
"code": null,
"e": 418,
"s": 407,
"text": "Example 1:"
},... |
Python dictionary type() Method | Python dictionary method type() returns the type of the passed variable. If passed variable is dictionary then it would return a dictionary type.
Following is the syntax for type() method −
type(dict)
dict − This is the dictionary.
dict − This is the dictionary.
This method returns the type of the passed variable.
The... | [
{
"code": null,
"e": 2391,
"s": 2244,
"text": "Python dictionary method type() returns the type of the passed variable. If passed variable is dictionary then it would return a dictionary type."
},
{
"code": null,
"e": 2435,
"s": 2391,
"text": "Following is the syntax for type() ... |
CASE WHEN in PostgreSQL? | If you are a programmer, you may be very familiar with IF-ELSE statements. The equivalent in PostgreSQL is CASE WHEN.
Let’s understand with an example. If you have table marks containing percentage marks of a student, and you want to find out whether the students have passed or failed. An example table is given below.
... | [
{
"code": null,
"e": 1180,
"s": 1062,
"text": "If you are a programmer, you may be very familiar with IF-ELSE statements. The equivalent in PostgreSQL is CASE WHEN."
},
{
"code": null,
"e": 1382,
"s": 1180,
"text": "Let’s understand with an example. If you have table marks contai... |
Bypassing Pandas Memory Limitations - GeeksforGeeks | 30 Apr, 2021
Pandas is a Python library used for analyzing and manipulating data sets but one of the major drawbacks of Pandas is memory limitation issues while working with large datasets since Pandas DataFrames (two-dimensional data structure) are kept in memory, there is a limit to how much data can be processed at ... | [
{
"code": null,
"e": 25580,
"s": 25552,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 25895,
"s": 25580,
"text": "Pandas is a Python library used for analyzing and manipulating data sets but one of the major drawbacks of Pandas is memory limitation issues while working with la... |
Mealy Machine for 1's Complement - GeeksforGeeks | 07 Jul, 2021
After converting a number to its binary form, replace every one of the number with 0 and every 0 with 1, then the resulting number will be known as 1, s complement of that binary number.
Input-1 :
101010
Output-1 :
010101
Input-2 :
1110100
Output-2 :
0001011
Approach :
First make a initial state. Th... | [
{
"code": null,
"e": 24254,
"s": 24226,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 24443,
"s": 24254,
"text": "After converting a number to its binary form, replace every one of the number with 0 and every 0 with 1, then the resulting number will be known as 1, s complement... |
The Influence Of Data Scaling On Machine Learning Algorithms | by K.A. | Towards Data Science | Scaling is the act of data preprocessing.
Preprocessing data involves transforming and scaling the data, up or down, before it becomes used for further steps. Every so often attributes are not expressed by the same standards, scales or measures, to such an extent that their statistics yield distorted data modeling resu... | [
{
"code": null,
"e": 214,
"s": 172,
"text": "Scaling is the act of data preprocessing."
},
{
"code": null,
"e": 1316,
"s": 214,
"text": "Preprocessing data involves transforming and scaling the data, up or down, before it becomes used for further steps. Every so often attributes ... |
How to handle the exception using UncaughtExceptionHandler in Java? | The UncaughtExceptionHandler is an interface inside a Thread class. When the main thread is about to terminate due to an uncaught exception the java virtual machine will invoke the thread’s UncaughtExceptionHandler for a chance to perform some error handling like logging the exception to a file or uploading the log to ... | [
{
"code": null,
"e": 1546,
"s": 1062,
"text": "The UncaughtExceptionHandler is an interface inside a Thread class. When the main thread is about to terminate due to an uncaught exception the java virtual machine will invoke the thread’s UncaughtExceptionHandler for a chance to perform some error han... |
How to find the confusion matrix for linear discriminant analysis in R? | To find the confusion matrix for linear discriminant analysis in R, we can follow the below steps −
First of all, create a data frame.
Create new features using linear discriminant analysis.
Find the confusion matrix for linear discriminant analysis using table and predict function.
Let's create a data frame as shown b... | [
{
"code": null,
"e": 1162,
"s": 1062,
"text": "To find the confusion matrix for linear discriminant analysis in R, we can follow the below steps −"
},
{
"code": null,
"e": 1197,
"s": 1162,
"text": "First of all, create a data frame."
},
{
"code": null,
"e": 1253,
... |
Making recommendations using association rules (R Programming) | by Sheenal Srivastava | Towards Data Science | Retailers typically have a wealth of customer transaction data which consists of the type of items purchased by a customer, their value and the date they were purchased. Unless the retailer has a loyalty rewards system, they may not have demographic information on their customers such as height, age, gender and address... | [
{
"code": null,
"e": 737,
"s": 171,
"text": "Retailers typically have a wealth of customer transaction data which consists of the type of items purchased by a customer, their value and the date they were purchased. Unless the retailer has a loyalty rewards system, they may not have demographic infor... |
Arduino - Stepper Motor | A Stepper Motor or a step motor is a brushless, synchronous motor, which divides a full rotation into a number of steps. Unlike a brushless DC motor, which rotates continuously when a fixed DC voltage is applied to it, a step motor rotates in discrete step angles.
The Stepper Motors therefore are manufactured with step... | [
{
"code": null,
"e": 3135,
"s": 2870,
"text": "A Stepper Motor or a step motor is a brushless, synchronous motor, which divides a full rotation into a number of steps. Unlike a brushless DC motor, which rotates continuously when a fixed DC voltage is applied to it, a step motor rotates in discrete s... |
Getting the Most out of scikit-learn Pipelines | by Jessica Miles | Towards Data Science | Pipelines are extremely useful and versatile objects in the scikit-learn package. They can be nested and combined with other sklearn objects to create repeatable and easily customizable data transformation and modeling workflows.
One of the most useful things you can do with a Pipeline is to chain data transformation s... | [
{
"code": null,
"e": 402,
"s": 172,
"text": "Pipelines are extremely useful and versatile objects in the scikit-learn package. They can be nested and combined with other sklearn objects to create repeatable and easily customizable data transformation and modeling workflows."
},
{
"code": nul... |
Angular Material - Fab Toolbars | The md-fab-toolbar, an Angular directive, is used to show a toolbar of elements or buttons for quick access to common actions.
The following table lists out the parameters and description of the different attributes of md-fab-toolbar.
* md-direction
This determines from which direction the toolbar items will appear rel... | [
{
"code": null,
"e": 2317,
"s": 2190,
"text": "The md-fab-toolbar, an Angular directive, is used to show a toolbar of elements or buttons for quick access to common actions."
},
{
"code": null,
"e": 2425,
"s": 2317,
"text": "The following table lists out the parameters and descri... |
MongoDB query for Partial Object in an array | Let us first create a collection with documents −
> db.queryForPartialObjectDemo.insertOne({_id:new ObjectId(), "StudentDetails": [{"StudentId":1, "StudentName":"Chris"}]});
{
"acknowledged" : true,
"insertedId" : ObjectId("5cdfcf55bf3115999ed51206")
}
> db.queryForPartialObjectDemo.insertOne({_id:new ObjectId(),... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "Let us first create a collection with documents −"
},
{
"code": null,
"e": 1530,
"s": 1112,
"text": "> db.queryForPartialObjectDemo.insertOne({_id:new ObjectId(), \"StudentDetails\": [{\"StudentId\":1, \"StudentName\":\"Chris\"}]});\... |
Creating a QR Code of a link in React JS | In this article, we will see how to create a QR code of a link in
React JS. A QR code is a two-dimensional barcode that is readable on
smartphones. You must have seen QR codes on websites that you can
scan which redirects you to a page. For example, to access WhatsApp
from your laptop, you can go to "web.whatsapp.com" ... | [
{
"code": null,
"e": 1447,
"s": 1062,
"text": "In this article, we will see how to create a QR code of a link in\nReact JS. A QR code is a two-dimensional barcode that is readable on\nsmartphones. You must have seen QR codes on websites that you can\nscan which redirects you to a page. For example, ... |
How to create frequency table of a string vector in R? | To create a frequency table of a string vector, we just need to use table function. For example, if we have a vector x that contains randomly sampled 100 values of first five English alphabets then the table of vector x can be created by using table(x). This will generate a table along with the name of the vector.
Live... | [
{
"code": null,
"e": 1378,
"s": 1062,
"text": "To create a frequency table of a string vector, we just need to use table function. For example, if we have a vector x that contains randomly sampled 100 values of first five English alphabets then the table of vector x can be created by using table(x).... |
Python | Numpy np.gumbel() method | 24 Oct, 2019
With the help of np.gumbel() method, we can get the gumbel distribution in the form of an array by using np.gumbel() method.
Syntax : np.gumbel(value, scale, size)
Return : Return the array of gumbel distribution.
Example #1 :In this example we can see that by using np.gumbel() method, we are able to get a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Oct, 2019"
},
{
"code": null,
"e": 153,
"s": 28,
"text": "With the help of np.gumbel() method, we can get the gumbel distribution in the form of an array by using np.gumbel() method."
},
{
"code": null,
"e": 192,
"s":... |
How to Install GCC Compiler on Linux? | 06 Oct, 2021
In this article, we will discuss how to install a GCC compiler on Linux.
GCC stands for GNU Compiler Collections which is used to compile mainly C and C++ language. It can also be used to compile Objective C and Objective C++. The GCC is an open-source collection of compilers and libraries.
Let’s start wi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Oct, 2021"
},
{
"code": null,
"e": 102,
"s": 28,
"text": "In this article, we will discuss how to install a GCC compiler on Linux. "
},
{
"code": null,
"e": 321,
"s": 102,
"text": "GCC stands for GNU Compiler Coll... |
MySQL - DATEDIFF() Function | The DATE, DATETIME and TIMESTAMP datatypes in MySQL are used to store the date, date and time, time stamp values respectively. Where a time stamp is a numerical value representing the number of milliseconds from '1970-01-01 00:00:01' UTC (epoch) to the specified time. MySQL provides a set of functions to manipulate the... | [
{
"code": null,
"e": 2772,
"s": 2441,
"text": "The DATE, DATETIME and TIMESTAMP datatypes in MySQL are used to store the date, date and time, time stamp values respectively. Where a time stamp is a numerical value representing the number of milliseconds from '1970-01-01 00:00:01' UTC (epoch) to the ... |
Merge two sorted linked lists such that merged list is in reverse order | 22 Mar, 2022
Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order).
Examples:
Input: a: 5->10->15->40
b: 2->3->20
Output: res: 40->20->15->10->5->3->2
Input: a: NULL
b: 2->3->20
Output: res: 20->3->2
A Simple Solution i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Mar, 2022"
},
{
"code": null,
"e": 188,
"s": 54,
"text": "Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order)."
},
{
"code": null,
"e": 199... |
Selenium - Multi Browser Testing | Users can execute scripts in multiple browsers simultaneously. For demonstration, we will use the same scenario that we had taken for Selenium Grid. In the Selenium Grid example, we had executed the scripts remotely; here we will execute the scripts locally.
First of all, ensure that you have appropriate drivers downlo... | [
{
"code": null,
"e": 2268,
"s": 2009,
"text": "Users can execute scripts in multiple browsers simultaneously. For demonstration, we will use the same scenario that we had taken for Selenium Grid. In the Selenium Grid example, we had executed the scripts remotely; here we will execute the scripts loc... |
Half clique NP Complete problem | 08 Jun, 2021
A half clique in a graph is a set of n/2 vertices such that each vertex shares an edge with every other vertex, that is, the k = n/2 vertices of the graph form a complete graph.
Problem – Given a graph G(V,E) ,the problem is to determine if the graph contains a clique of size atleast k = |V/2|.
Explanati... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jun, 2021"
},
{
"code": null,
"e": 207,
"s": 28,
"text": "A half clique in a graph is a set of n/2 vertices such that each vertex shares an edge with every other vertex, that is, the k = n/2 vertices of the graph form a complete grap... |
jQuery | fadeIn() Method | 19 Feb, 2019
The fadeIn() Method in jQuery is used to change the opacity of selected elements from hidden to visible. The hidden elements will not be display.
Syntax:
$(selector).fadeIn( speed, easing, callback )
Parameters: This method accepts three parameters as mentioned above and described below:
Speed: It is an op... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Feb, 2019"
},
{
"code": null,
"e": 174,
"s": 28,
"text": "The fadeIn() Method in jQuery is used to change the opacity of selected elements from hidden to visible. The hidden elements will not be display."
},
{
"code": null,
... |
How does auto property work in margin:0 auto in CSS ? | 17 Mar, 2021
In this article, we will learn how auto property works in margin:0 auto in CSS. The margin property is used to set the margins for an element. The margin property has four values margin-top, margin-right, margin-bottom, and margin-left.
Syntax:
margin: top_margin right_margin bottom_margin left_margin;
/*... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Mar, 2021"
},
{
"code": null,
"e": 265,
"s": 28,
"text": "In this article, we will learn how auto property works in margin:0 auto in CSS. The margin property is used to set the margins for an element. The margin property has four val... |
Python program to add two numbers | 04 Jun, 2022
Given two numbers num1 and num2. The task is to write a Python program to find the addition of these two numbers. Examples:
Input: num1 = 5, num2 = 3
Output: 8
Input: num1 = 13, num2 = 6
Output: 19
In the below program to add two numbers, the user is first asked to enter two numbers and the input is scann... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Jun, 2022"
},
{
"code": null,
"e": 177,
"s": 53,
"text": "Given two numbers num1 and num2. The task is to write a Python program to find the addition of these two numbers. Examples:"
},
{
"code": null,
"e": 252,
"s":... |
Difference between Private and Public IP addresses | 07 Jun, 2022
Private IP address of a system is the IP address that is used to communicate within the same network. Using private IP data or information can be sent or received within the same network.
Public IP address of a system is the IP address that is used to communicate outside the network. A public IP address i... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jun, 2022"
},
{
"code": null,
"e": 242,
"s": 53,
"text": "Private IP address of a system is the IP address that is used to communicate within the same network. Using private IP data or information can be sent or received within the ... |
How to use Boto3 library in Python to upload an object in S3 using AWS Resource? | Problem Statement − Use Boto3 library in Python to upload an object into S3. For example, how to upload test.zip into Bucket_1 of S3.
Step 1 − Import boto3 and botocore exceptions to handle exceptions.
Step 2 − From pathlib, import PurePosixPath to retrive filename from path
Step 3 − s3_path and filepath are the two pa... | [
{
"code": null,
"e": 1196,
"s": 1062,
"text": "Problem Statement − Use Boto3 library in Python to upload an object into S3. For example, how to upload test.zip into Bucket_1 of S3."
},
{
"code": null,
"e": 1264,
"s": 1196,
"text": "Step 1 − Import boto3 and botocore exceptions to... |
How to Convert CSV to JSON file having Comma Separated values in Node.js ? - GeeksforGeeks | 19 May, 2021
A CSV is a comma-separated values file with .csv extension, which allows data to be saved in a tabular format. Here is a article to convert the data of a csv file to a JavaScript Object Notation (JSON) without using any third party npm package. The main difference from normal conversion is that the values ... | [
{
"code": null,
"e": 25182,
"s": 25154,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 25583,
"s": 25182,
"text": "A CSV is a comma-separated values file with .csv extension, which allows data to be saved in a tabular format. Here is a article to convert the data of a csv file ... |
Machine Learning with Python: Classification (complete tutorial) | by Mauro Di Pietro | Towards Data Science | In this article, using Data Science and Python, I will explain the main steps of a Classification use case, from data analysis to understanding the model output.
Since this tutorial can be a good starting point for beginners, I will use the “Titanic dataset” from the famous Kaggle competition, in which you are provided... | [
{
"code": null,
"e": 334,
"s": 172,
"text": "In this article, using Data Science and Python, I will explain the main steps of a Classification use case, from data analysis to understanding the model output."
},
{
"code": null,
"e": 653,
"s": 334,
"text": "Since this tutorial can ... |
Boolean.TryParse() Method in C# | The Boolean.TryParse() method in C# is used to convert the specified string representation of a logical value to its Boolean equivalent.
Following is the syntax −
public static bool TryParse (string val out bool result);
Let us now see an example to implement the Boolean.TryParse() method −
using System;
public class D... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "The Boolean.TryParse() method in C# is used to convert the specified string representation of a logical value to its Boolean equivalent."
},
{
"code": null,
"e": 1225,
"s": 1199,
"text": "Following is the syntax −"
},
{
"code... |
How to place a div inside an iframe for IE ? - GeeksforGeeks | 17 Jun, 2020
Introduction: An Iframe is used to display a web page (or possibly a document) within a web page, i.e. it loads the contents of a page (or document) inside the current page.
Iframe Syntax:
<iframe src="URL"></iframe>
Approach 1: For adding additional div’s in an iframe, you need to use a wrapper div, that... | [
{
"code": null,
"e": 31758,
"s": 31730,
"text": "\n17 Jun, 2020"
},
{
"code": null,
"e": 31932,
"s": 31758,
"text": "Introduction: An Iframe is used to display a web page (or possibly a document) within a web page, i.e. it loads the contents of a page (or document) inside the cur... |
Comparator thenComparingDouble() method in Java with examples - GeeksforGeeks | 29 Apr, 2019
The thenComparingDouble(java.util.function.ToDoubleFunction) method of Comparator Interface in Java returns a lexicographic-order comparator with a function that extracts a double sort key. This method is applied after comparing method if you want to apply another comparing for those values which are equal... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n29 Apr, 2019"
},
{
"code": null,
"e": 24281,
"s": 23948,
"text": "The thenComparingDouble(java.util.function.ToDoubleFunction) method of Comparator Interface in Java returns a lexicographic-order comparator with a function that e... |
SWING - JComboBox Class | The class JComboBox is a component which combines a button or editable field and a drop-down list.
Following is the declaration for javax.swing.JComboBox class −
public class JComboBox
extends JComponent
implements ItemSelectable, ListDataListener, ActionListener, Accessible
Following are the fields for javax... | [
{
"code": null,
"e": 1862,
"s": 1763,
"text": "The class JComboBox is a component which combines a button or editable field and a drop-down list."
},
{
"code": null,
"e": 1925,
"s": 1862,
"text": "Following is the declaration for javax.swing.JComboBox class −"
},
{
"code"... |
openat() - Unix, Linux System Call | Unix - Home
Unix - Getting Started
Unix - File Management
Unix - Directories
Unix - File Permission
Unix - Environment
Unix - Basic Utilities
Unix - Pipes & Filters
Unix - Processes
Unix - Communication
Unix - The vi Editor
Unix - What is Shell?
Unix - Using Variables
Unix - Special Variables
Unix - Using Arrays
Unix -... | [
{
"code": null,
"e": 1466,
"s": 1454,
"text": "Unix - Home"
},
{
"code": null,
"e": 1489,
"s": 1466,
"text": "Unix - Getting Started"
},
{
"code": null,
"e": 1512,
"s": 1489,
"text": "Unix - File Management"
},
{
"code": null,
"e": 1531,
"s": 1... |
Double Pointer (Pointer to Pointer) in C | A pointer is used to store the address of variables. So, when we define a pointer to pointer, the first pointer is used to store the address of the second pointer. Thus it is known as double pointers.
Begin
Declare v of the integer datatype.
Initialize v = 76.
Declare a pointer p1 of the integer datatype.
... | [
{
"code": null,
"e": 1263,
"s": 1062,
"text": "A pointer is used to store the address of variables. So, when we define a pointer to pointer, the first pointer is used to store the address of the second pointer. Thus it is known as double pointers."
},
{
"code": null,
"e": 1772,
"s": ... |
div() function in C++ - GeeksforGeeks | 28 Sep, 2021
Given a numerator and denominator, we have to find their quotient and remainder without using the modulo or division operator. div() function allows us to do the same task easily and efficiently.
div() function : Returns the integral quotient and remainder of the division of number by denom ( number/denom ... | [
{
"code": null,
"e": 24096,
"s": 24068,
"text": "\n28 Sep, 2021"
},
{
"code": null,
"e": 24292,
"s": 24096,
"text": "Given a numerator and denominator, we have to find their quotient and remainder without using the modulo or division operator. div() function allows us to do the s... |
PHP - Syntax Overview | This chapter will give you an idea of very basic syntax of PHP and very important to make your PHP foundation strong.
The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. The mechanism for doing so is known as 'escaping to PHP'. There are four ways to do this −
The most universa... | [
{
"code": null,
"e": 2875,
"s": 2757,
"text": "This chapter will give you an idea of very basic syntax of PHP and very important to make your PHP foundation strong."
},
{
"code": null,
"e": 3060,
"s": 2875,
"text": "The PHP parsing engine needs a way to differentiate PHP code fro... |
Apache Pig - Running Scripts | Here in this chapter, we will see how how to run Apache Pig scripts in batch mode.
While writing a script in a file, we can include comments in it as shown below.
We will begin the multi-line comments with '/*', end them with '*/'.
/* These are the multi-line comments
In the pig script */
We will begin the single-... | [
{
"code": null,
"e": 2767,
"s": 2684,
"text": "Here in this chapter, we will see how how to run Apache Pig scripts in batch mode."
},
{
"code": null,
"e": 2847,
"s": 2767,
"text": "While writing a script in a file, we can include comments in it as shown below."
},
{
"code... |
MySQL query to replace backslash from a varchar column with preceding backslash string values | Let us first create a table −
mysql> create table DemoTable
(
Title varchar(100)
);
Query OK, 0 rows affected (0.57 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('\\"MySQL');
Query OK, 1 row affected (0.14 sec)
mysql> insert into DemoTable values('MongoDB\\"');
Quer... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1186,
"s": 1092,
"text": "mysql> create table DemoTable\n(\n Title varchar(100)\n);\nQuery OK, 0 rows affected (0.57 sec)"
},
{
"code": null,
"e": 1242,
"s": 11... |
Spring JDBC - Batch Operation | Following example will demonstrate how to make a batch update using Spring JDBC. We'll update the available records in Student table in a single batch operation.
String SQL = "update Student set age = ? where id = ?";
int[] updateCounts = jdbcTemplateObject.batchUpdate(SQL, new BatchPreparedStatementSetter() {
p... | [
{
"code": null,
"e": 2558,
"s": 2396,
"text": "Following example will demonstrate how to make a batch update using Spring JDBC. We'll update the available records in Student table in a single batch operation."
},
{
"code": null,
"e": 2963,
"s": 2558,
"text": "String SQL = \"updat... |
Go - Basic Syntax | We discussed the basic structure of a Go program in the previous chapter. Now it will be easy to understand the other basic building blocks of the Go programming language.
A Go program consists of various tokens. A token is either a keyword, an identifier, a constant, a string literal, or a symbol. For example, the fol... | [
{
"code": null,
"e": 2109,
"s": 1937,
"text": "We discussed the basic structure of a Go program in the previous chapter. Now it will be easy to understand the other basic building blocks of the Go programming language."
},
{
"code": null,
"e": 2302,
"s": 2109,
"text": "A Go progr... |
How do I create a random alpha-numeric string using C++? | In this section we will see how to generate a random alphanumeric string using C++. Here we are providing lowercase letters, uppercase letters and numbers (0-9). This program takes the characters randomly, then creates the random string.
Input: Here we are giving the string length
Output: A random string of that length... | [
{
"code": null,
"e": 1300,
"s": 1062,
"text": "In this section we will see how to generate a random alphanumeric string using C++. Here we are providing lowercase letters, uppercase letters and numbers (0-9). This program takes the characters randomly, then creates the random string."
},
{
"... |
Entity Framework - Command Interception | In Entity Framework 6.0, there is another new feature known as Interceptor or Interception. The interception code is built around the concept of interception interfaces. For example, the IDbCommandInterceptor interface defines methods that are called before EF makes a call to ExecuteNonQuery, ExecuteScalar, ExecuteRead... | [
{
"code": null,
"e": 3377,
"s": 3032,
"text": "In Entity Framework 6.0, there is another new feature known as Interceptor or Interception. The interception code is built around the concept of interception interfaces. For example, the IDbCommandInterceptor interface defines methods that are called be... |
C++ Queue Library - back() Function | The C++ function std::queue::back() returns a reference to the last element of queue. This is the most recently enqueued element.
Following is the declaration for std::queue::back() function form std::queue header.
value_type& back();
const value_type& back() const;
reference& back();
const_reference& back() const;
N... | [
{
"code": null,
"e": 2733,
"s": 2603,
"text": "The C++ function std::queue::back() returns a reference to the last element of queue. This is the most recently enqueued element."
},
{
"code": null,
"e": 2818,
"s": 2733,
"text": "Following is the declaration for std::queue::back() ... |
Java Swing JTable Example | Simple JTable Example in Java | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorials, we are going to create a s... | [
{
"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,
... |
Start Coding - Java | Practice | GeeksforGeeks | When learning a new language, we first learn to output some message. Here, we'll start with the famous Hello World message. Now, here you are given a function to complete. Don't worry about the ins and outs of functions, just add the command (System.out.print("Hello World")) to print Hello World.
Example:
Input:
No inp... | [
{
"code": null,
"e": 576,
"s": 278,
"text": "When learning a new language, we first learn to output some message. Here, we'll start with the famous Hello World message. Now, here you are given a function to complete. Don't worry about the ins and outs of functions, just add the command (System.out.p... |
How to draw triangle shape in android? | This example demonstrate about How to draw triangle shape 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"?>
<LinearLayout xml... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "This example demonstrate about How to draw triangle shape in android."
},
{
"code": null,
"e": 1261,
"s": 1132,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to creat... |
JSP - Directives | In this chapter, we will discuss Directives in JSP. These directives provide directions and instructions to the container, telling it how to handle certain aspects of the JSP processing.
A JSP directive affects the overall structure of the servlet class. It usually has the following form −
<%@ directive attribute = "va... | [
{
"code": null,
"e": 2426,
"s": 2239,
"text": "In this chapter, we will discuss Directives in JSP. These directives provide directions and instructions to the container, telling it how to handle certain aspects of the JSP processing."
},
{
"code": null,
"e": 2530,
"s": 2426,
"tex... |
Angular 2 - Data Binding | Two-way binding was a functionality in Angular JS, but has been removed from Angular 2.x onwards. But now, since the event of classes in Angular 2, we can bind to properties in AngularJS class.
Suppose if you had a class with a class name, a property which had a type and value.
export class className {
property: pro... | [
{
"code": null,
"e": 2491,
"s": 2297,
"text": "Two-way binding was a functionality in Angular JS, but has been removed from Angular 2.x onwards. But now, since the event of classes in Angular 2, we can bind to properties in AngularJS class."
},
{
"code": null,
"e": 2576,
"s": 2491,
... |
DAX Time Intelligence - DATESYTD function | Returns a table that contains a column of the dates for the year to date, in the current context.
DATESYTD (<dates>, [<year_end_date>])
dates
A column that contains dates.
year_end_date
Optional.
A literal string with a date that defines the year-end date.
If omitted, the default is December 31.
A table containing a ... | [
{
"code": null,
"e": 2099,
"s": 2001,
"text": "Returns a table that contains a column of the dates for the year to date, in the current context."
},
{
"code": null,
"e": 2139,
"s": 2099,
"text": "DATESYTD (<dates>, [<year_end_date>]) \n"
},
{
"code": null,
"e": 2145,
... |
bounce - Unix, Linux Command | bounce [generic Postfix daemon options]
The bounce(8) daemon processes two types of service requests:
Optionally, a bounce (defer, trace) client can request that the
per-message log file be deleted when the requested operation fails.
This is used by clients that cannot retry transactions by
themselves, and that dep... | [
{
"code": null,
"e": 10618,
"s": 10577,
"text": "bounce [generic Postfix daemon options]\n"
},
{
"code": null,
"e": 10682,
"s": 10618,
"text": "\nThe bounce(8) daemon processes two types of service requests:\n"
},
{
"code": null,
"e": 10938,
"s": 10682,
"text"... |
MuleSoft - Mule Error Handling | The new Mule error handling is one of the biggest and major changes done in Mule 4. The new error handing may seem complex, but it is better and more efficient. In this chapter, we are going to discuss about components of Mule error, Error types, categories of Mule error and components for handling Mule errors.
Mule er... | [
{
"code": null,
"e": 2381,
"s": 2068,
"text": "The new Mule error handling is one of the biggest and major changes done in Mule 4. The new error handing may seem complex, but it is better and more efficient. In this chapter, we are going to discuss about components of Mule error, Error types, catego... |
Make all the elements of array even with given operations - GeeksforGeeks | 31 May, 2021
Given an array arr[] of positive integers, find the minimum number of operations required to make all the array elements even where:
If there is an odd number, then, increment the element and the next adjacent element by 1.Each increment costs one operation.
If there is an odd number, then, increment the... | [
{
"code": null,
"e": 24676,
"s": 24648,
"text": "\n31 May, 2021"
},
{
"code": null,
"e": 24811,
"s": 24676,
"text": "Given an array arr[] of positive integers, find the minimum number of operations required to make all the array elements even where: "
},
{
"code": null,
... |
Hands-on Guide to Plotting a Decision Surface for ML in Python | by Salma El Shahawy | Towards Data Science | Lately, I have been struggling for a while to visualize the generated model of a classification model. I relied only on the classification report and the confusion matrix to weigh the model performance.
However, visualize the results of the classification has its charm and makes more sense of it. So, I built a decision... | [
{
"code": null,
"e": 375,
"s": 172,
"text": "Lately, I have been struggling for a while to visualize the generated model of a classification model. I relied only on the classification report and the confusion matrix to weigh the model performance."
},
{
"code": null,
"e": 629,
"s": 3... |
Binary to BCD conversion in 8051 | In this problem, we will see how to convert an 8-bit binary number to its BCD equivalent. The binary number is stored at location 20H. After converting, the results will be stored at 30H and 31H. The 30H will hold the MS portion, and 31H will hold the LS portion.
So let us assume the data is D5H. The program converts ... | [
{
"code": null,
"e": 1327,
"s": 1062,
"text": "In this problem, we will see how to convert an 8-bit binary number to its BCD equivalent. The binary number is stored at location 20H. After converting, the results will be stored at 30H and 31H. The 30H will hold the MS portion, and 31H will hold the L... |
Can we use “IF NOT IN” in a MySQL procedure? | Let us first see the syntax of IF NOT IN in MySQL −
if(yourVariableName NOT IN (yourValue1,yourValue2,........N) ) then
statement1
else
statement2
endif
Let us implement the above syntax to use IF NOT IN −
mysql> DELIMITER //
mysql> CREATE PROCEDURE IF_NOT_INDemo(IN value int)
-> BEGIN
-> if(v... | [
{
"code": null,
"e": 1114,
"s": 1062,
"text": "Let us first see the syntax of IF NOT IN in MySQL −"
},
{
"code": null,
"e": 1226,
"s": 1114,
"text": "if(yourVariableName NOT IN (yourValue1,yourValue2,........N) ) then\n statement1\nelse\n statement2\nendif "
},
{
... |
How to set the maximum width of an element with JavaScript? | Use the maxWidth property in JavaScript to set the maximum width.
You can try to run the following code to set the maximum width of an element with JavaScript −
Live Demo
<!DOCTYPE html>
<html>
<body>
<p>Click below to set Maximum width.</p>
<button type="button" onclick="display()">Max Width</button>
... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "Use the maxWidth property in JavaScript to set the maximum width."
},
{
"code": null,
"e": 1223,
"s": 1128,
"text": "You can try to run the following code to set the maximum width of an element with JavaScript −"
},
{
"code":... |
java.lang.reflect - Method Class | The java.lang.reflect.Method class provides information about, and access to, a single method on a class or interface. The reflected method may be a class method or an instance method (including an abstract method). A Method permits widening conversions to occur when matching the actual parameters to invoke with the u... | [
{
"code": null,
"e": 1893,
"s": 1454,
"text": "The java.lang.reflect.Method class provides information about, and access to, a single method on a class or interface. The reflected method may be a class method or an instance method (including an abstract method). A Method permits widening conversion... |
Remove the first entry of the TreeMap in Java | To remove the first entry of the TreeMap, use the pollFirstEntry() method.
Let us first create a TreeMap and add elements −
TreeMap<Integer,String> m = new TreeMap<Integer,String>();
m.put(1,"India");
m.put(2,"US");
m.put(3,"Australia");
m.put(4,"Netherlands");
m.put(5,"Canada");
Remove the first entry now −
m.pollFirs... | [
{
"code": null,
"e": 1137,
"s": 1062,
"text": "To remove the first entry of the TreeMap, use the pollFirstEntry() method."
},
{
"code": null,
"e": 1186,
"s": 1137,
"text": "Let us first create a TreeMap and add elements −"
},
{
"code": null,
"e": 1343,
"s": 1186,
... |
Sentiment Analysis of Tweets. How to analyse the sentiment of tweets... | by Alan Jones | Towards Data Science | Sentiment Analysis, or Opinion Mining, is often used by marketing departments to monitor customer satisfaction with a service, product or brand when a large volume of feedback is obtained through social media.
Gone are the days of reading individual letters sent by post. Today’s customers produce vast numbers of commen... | [
{
"code": null,
"e": 382,
"s": 172,
"text": "Sentiment Analysis, or Opinion Mining, is often used by marketing departments to monitor customer satisfaction with a service, product or brand when a large volume of feedback is obtained through social media."
},
{
"code": null,
"e": 529,
... |
Minimum indexed character | Practice | GeeksforGeeks | Given a string str and another string patt. Find the first position (considering 0-based indexing) of the character in patt that is present at the minimum index in str.
Example 1:
Input:
str = geeksforgeeks
patt = set
Output: 1
Explanation: e is the character which is
present in given str "geeksforgeeks"
and is first ... | [
{
"code": null,
"e": 407,
"s": 238,
"text": "Given a string str and another string patt. Find the first position (considering 0-based indexing) of the character in patt that is present at the minimum index in str."
},
{
"code": null,
"e": 419,
"s": 407,
"text": "\nExample 1:"
}... |
How to create instance Objects using __init__ in Python? | The instantiation or calling-a-class-object operation creates an empty object. Many classes like to create objects with instances with a specific initial state. Therefore a class may define a special method named __init__(), as follows −
def __init__(self) −
self.data = [ ]
When a class defines an __init__() method... | [
{
"code": null,
"e": 1300,
"s": 1062,
"text": "The instantiation or calling-a-class-object operation creates an empty object. Many classes like to create objects with instances with a specific initial state. Therefore a class may define a special method named __init__(), as follows −"
},
{
"... |
How to unpack using star expression in Python? | One of the basic limitation of unpacking is that you must know the length of the sequences you are unpacking in advance.
random_numbers = [0, 1, 5, 9, 17, 12, 7, 10, 3, 2]
random_numbers_descending = sorted(random_numbers, reverse=True)
print(f"Output \n*** {random_numbers_descending}")
*** [17, 12, 10, 9, 7, 5, 3, 2, ... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "One of the basic limitation of unpacking is that you must know the length of the sequences you are unpacking in advance."
},
{
"code": null,
"e": 1350,
"s": 1183,
"text": "random_numbers = [0, 1, 5, 9, 17, 12, 7, 10, 3, 2]\nrandom_nu... |
Best 5 free stock market APIs in 2020 | by Shen Huang | Towards Data Science | The financial APIs market grows so quickly that last year’s post or platform is not a good choice this year. So in this story, I will show you the best 5 stock market APIs that I use in 2019.
Stock market data APIs offer real-time or historical data on financial assets that are currently being traded in the markets. Th... | [
{
"code": null,
"e": 364,
"s": 172,
"text": "The financial APIs market grows so quickly that last year’s post or platform is not a good choice this year. So in this story, I will show you the best 5 stock market APIs that I use in 2019."
},
{
"code": null,
"e": 552,
"s": 364,
"te... |
What is RowSet? How to retrieve contents of a table using RowSet? Explain? | A RowSet object is similar to ResultSet, it also stores tabular data, in addition to the features of a ResultSet a RowSet follows JavaBeans component model. This can be used as a JavaBeans component in a visual Bean development environment, i.e. in environments like IDE’s you can visually manipulate these properties.
T... | [
{
"code": null,
"e": 1381,
"s": 1062,
"text": "A RowSet object is similar to ResultSet, it also stores tabular data, in addition to the features of a ResultSet a RowSet follows JavaBeans component model. This can be used as a JavaBeans component in a visual Bean development environment, i.e. in envi... |
Recognising Traffic Signs With 98% Accuracy Using Deep Learning | by Eddie Forson | Towards Data Science | This is project 2 of Term 1 of the Udacity Self-Driving Car Engineer Nanodegree. You can find all code related to this project on github. You can also read my post on project 1: Detecting Lane Lines Using Computer Vision by simply clicking on the link.
Traffic signs are an integral part of our road infrastructure. They... | [
{
"code": null,
"e": 425,
"s": 172,
"text": "This is project 2 of Term 1 of the Udacity Self-Driving Car Engineer Nanodegree. You can find all code related to this project on github. You can also read my post on project 1: Detecting Lane Lines Using Computer Vision by simply clicking on the link."
... |
Battling out the GPU Frustration with Google Colab | by sriganesh lokesh | Towards Data Science | With a momentous increase in the size of datasets for machine learning and deep learning models to fit, there has been an escalation in the demand for GPUs to faster train the model. As students of data science, we all know how long our challenged laptops take to run a machine learning or deep learning model with a dat... | [
{
"code": null,
"e": 529,
"s": 172,
"text": "With a momentous increase in the size of datasets for machine learning and deep learning models to fit, there has been an escalation in the demand for GPUs to faster train the model. As students of data science, we all know how long our challenged laptops... |
The Power of Lambda Expressions in Python | by Soner Yıldırım | Towards Data Science | A function is a block of code that takes zero or more inputs, performs some operations, and returns a value. Functions are essential tools to create efficient and powerful programs.
In this article, we will cover a special form of functions in Python: lambda expressions. The first and foremost point we need to emphasiz... | [
{
"code": null,
"e": 354,
"s": 172,
"text": "A function is a block of code that takes zero or more inputs, performs some operations, and returns a value. Functions are essential tools to create efficient and powerful programs."
},
{
"code": null,
"e": 537,
"s": 354,
"text": "In t... |
Interfaces in C++ (Abstract Classes) | An interface describes the behavior or capabilities of a C++ class without committing to a particular implementation of that class.
The C++ interfaces are implemented using abstract classes and these abstract classes should not be confused with data abstraction which is a concept of keeping implementation details separ... | [
{
"code": null,
"e": 2450,
"s": 2318,
"text": "An interface describes the behavior or capabilities of a C++ class without committing to a particular implementation of that class."
},
{
"code": null,
"e": 2664,
"s": 2450,
"text": "The C++ interfaces are implemented using abstract ... |
How to Predict Severe Traffic Jams with Python and Recurrent Neural Networks? | by Shuyi Wang | Towards Data Science | In this tutorial, I will show you how to use RNN deep learning model to find patterns from Waze Traffic Open Data of Incidents Report, and predict if severe traffic jams will happen shortly. Interventions can be taken out effectively.
On December 1st, 2018, I participated in a Hackathon Programming competition in UNT I... | [
{
"code": null,
"e": 407,
"s": 172,
"text": "In this tutorial, I will show you how to use RNN deep learning model to find patterns from Waze Traffic Open Data of Incidents Report, and predict if severe traffic jams will happen shortly. Interventions can be taken out effectively."
},
{
"code"... |
Turtle - Draw Lines using arrow keys - GeeksforGeeks | 24 Jan, 2021
In this article, we will learn how to draw lines using the keyboard (arrow keys) in the turtle graphics. Let’s first discuss some methods used in the implementation below:
wn.listen(): Using this then we can give keyboard inputswn.onkeypress(func, “key”): This function is used to bind fun to the key-releas... | [
{
"code": null,
"e": 25691,
"s": 25663,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 25863,
"s": 25691,
"text": "In this article, we will learn how to draw lines using the keyboard (arrow keys) in the turtle graphics. Let’s first discuss some methods used in the implementatio... |
numpy.dot() in Python - GeeksforGeeks | 18 Nov, 2021
numpy.dot(vector_a, vector_b, out = None) returns the dot product of vectors a and b. It can handle 2D arrays but considers them as matrix and will perform matrix multiplication. For N dimensions it is a sum-product over the last axis of a and the second-to-last of b :
dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b... | [
{
"code": null,
"e": 24390,
"s": 24362,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 24660,
"s": 24390,
"text": "numpy.dot(vector_a, vector_b, out = None) returns the dot product of vectors a and b. It can handle 2D arrays but considers them as matrix and will perform matrix ... |
HashSet equals() method in Java with Example - GeeksforGeeks | 19 Feb, 2020
The equals() method of java.util.HashSet class is used verify the equality of an Object with a HashSet and compare them. The list returns true only if both HashSet contains same elements, irrespective of order.
Syntax:
public boolean equals(Object o)
Parameters: This method takes the object o as a paramete... | [
{
"code": null,
"e": 25565,
"s": 25537,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 25776,
"s": 25565,
"text": "The equals() method of java.util.HashSet class is used verify the equality of an Object with a HashSet and compare them. The list returns true only if both HashSet... |
How will you print numbers from 1 to 100 without using loop? | Set-2 - GeeksforGeeks | 30 Jun, 2021
If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0” till “i <= 100′′. So if we aren’t allowed to use loop, how else can be track something in C language!It can be done in many ways to print numbers using any looping conditions such as fo... | [
{
"code": null,
"e": 27051,
"s": 27023,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 27474,
"s": 27051,
"text": "If we take a look at this problem carefully, we can see that the idea of “loop” is to track some counter value e.g. “i=0” till “i <= 100′′. So if we aren’t allowed... |
Conditional Probability with Python: Concepts, Tables & Code | by Paul Apivat | Towards Data Science | This post is chapter 6 in continuation of my coverage of Data Science from Scratch by Joel Grus. We will work our way towards understanding conditional probability by understanding preceding concepts like marginal and joint probabilities.
At the end, we’ll tie all concepts together through code. For those inclined, you... | [
{
"code": null,
"e": 411,
"s": 172,
"text": "This post is chapter 6 in continuation of my coverage of Data Science from Scratch by Joel Grus. We will work our way towards understanding conditional probability by understanding preceding concepts like marginal and joint probabilities."
},
{
"c... |
What is the difference between 'except Exception as e' and 'except Exception, e' in Python? | The difference between using ',' and 'as' in except statements, is as follows:
Both ',' and 'as' are same functionality wise; but their use depends on the python versions as follows.In Python 2.5 and earlier versions, use of the 'comma' is recommended since 'as' isn't supported.In Python 2.6+ versions, both 'comma' and... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "The difference between using ',' and 'as' in except statements, is as follows:"
},
{
"code": null,
"e": 1598,
"s": 1141,
"text": "Both ',' and 'as' are same functionality wise; but their use depends on the python versions as follows.... |
Tryit Editor v3.7 | Tryit: Template 2 - using float | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.