title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
How to resize an array in Java?
An array cannot be resized dynamically in Java. One approach is to use java.util.ArrayList(or java.util.Vector) instead of a native array. Another approach is to re-allocate an array with a different size and copy the contents of the old array to the new array. class ResizableArray { public static void main (String...
[ { "code": null, "e": 1111, "s": 1062, "text": "An array cannot be resized dynamically in Java. " }, { "code": null, "e": 1202, "s": 1111, "text": "One approach is to use java.util.ArrayList(or java.util.Vector) instead of a native array." }, { "code": null, "e": 1325,...
How do I adjust (offset) the colorbar title in Matplotlib?
To adjust (offset) the colorbar title in matplotlib, we can take the following steps − Create a random data of 4×4 dimension. Create a random data of 4×4 dimension. Use imshow() method to display the data as an imgage. Use imshow() method to display the data as an imgage. Create a colorbar for a scalar mappable instanc...
[ { "code": null, "e": 1149, "s": 1062, "text": "To adjust (offset) the colorbar title in matplotlib, we can take the following steps −" }, { "code": null, "e": 1188, "s": 1149, "text": "Create a random data of 4×4 dimension." }, { "code": null, "e": 1227, "s": 1188...
Implementing a Linked List in Java using Class - GeeksforGeeks
19 Feb, 2021 Pre-requisite: Linked List Data Structure Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at the contiguous location, the elements are linked using pointers as shown below. In Java, LinkedList can be represented as a class and a Node as a separate cl...
[ { "code": null, "e": 24243, "s": 24215, "text": "\n19 Feb, 2021" }, { "code": null, "e": 24285, "s": 24243, "text": "Pre-requisite: Linked List Data Structure" }, { "code": null, "e": 24473, "s": 24285, "text": "Like arrays, Linked List is a linear data struct...
Delete a File Using Java - GeeksforGeeks
24 Jan, 2022 Java provides methods to delete files using java programs. On the contrary to normal delete operations in any operating system, files being deleted using the java program are deleted permanently without being moved to the trash/recycle bin. 1. Using java.io.File.delete() function: Deletes the file or dire...
[ { "code": null, "e": 27485, "s": 27457, "text": "\n24 Jan, 2022" }, { "code": null, "e": 27727, "s": 27485, "text": "Java provides methods to delete files using java programs. On the contrary to normal delete operations in any operating system, files being deleted using the java ...
BNF Notation in Compiler Design - GeeksforGeeks
20 Jul, 2021 BNF stands for Backus Naur Form notation. It is a formal method for describing the syntax of programming language which is understood as Backus Naur Formas introduced by John Bakus and Peter Naur in 1960. BNF and CFG (Context Free Grammar) were nearly identical. BNF may be a meta-language (a language that ...
[ { "code": null, "e": 24446, "s": 24418, "text": "\n20 Jul, 2021" }, { "code": null, "e": 24811, "s": 24446, "text": "BNF stands for Backus Naur Form notation. It is a formal method for describing the syntax of programming language which is understood as Backus Naur Formas introdu...
AngularJS | ng-model Directive - GeeksforGeeks
23 May, 2019 ngModel is a directive which binds input, select and textarea, and stores the required user value in a variable and we can use that variable whenever we require that value.It also is used during validations in a form. We can use ngModel with: inputtextcheckboxradionumberemailurldatedatetime-localtimemonthw...
[ { "code": null, "e": 28271, "s": 28243, "text": "\n23 May, 2019" }, { "code": null, "e": 28489, "s": 28271, "text": "ngModel is a directive which binds input, select and textarea, and stores the required user value in a variable and we can use that variable whenever we require th...
fstatat() - 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...
How to insert an array of values in a MySQL table with a single INSERT?
Let us first create a table − mysql> create table DemoTable ( ClientId int, ClientName varchar(50) ); Query OK, 0 rows affected (0.62 sec) Insert some records in the table using insert command. Here, we are inserting multiple values using only a single INSERT − mysql> insert into DemoTable values(101,'Adam'),(102...
[ { "code": null, "e": 1092, "s": 1062, "text": "Let us first create a table −" }, { "code": null, "e": 1207, "s": 1092, "text": "mysql> create table DemoTable\n(\n ClientId int,\n ClientName varchar(50)\n);\nQuery OK, 0 rows affected (0.62 sec)" }, { "code": null, ...
Type Erasure in Java
To support generic programming, as well as perform a stricter type check, Java implements type erasure. All type parameters in generic types are replaced with the bound (if unbounded) or object type. This way, the bytecode will only contain classes, methods, and interfaces. All type parameters in generic types are repl...
[ { "code": null, "e": 1166, "s": 1062, "text": "To support generic programming, as well as perform a stricter type check, Java implements type\nerasure." }, { "code": null, "e": 1337, "s": 1166, "text": "All type parameters in generic types are replaced with the bound (if unbounde...
Python | Pandas Series.get() - GeeksforGeeks
13 Feb, 2019 Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.get() function get item from object ...
[ { "code": null, "e": 24930, "s": 24902, "text": "\n13 Feb, 2019" }, { "code": null, "e": 25187, "s": 24930, "text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label...
.NET Core - Create .NET Standard Library
A class library defines the types and methods that can be called from any application. A class library developed using .NET Core supports the .NET Standard Library, which allows your library to be called by any .NET platform that supports that version of the .NET Standard Library. A class library developed using .NET C...
[ { "code": null, "e": 2473, "s": 2386, "text": "A class library defines the types and methods that can be called from any application." }, { "code": null, "e": 2668, "s": 2473, "text": "A class library developed using .NET Core supports the .NET Standard Library, which allows your...
chpasswd command in Linux with examples - GeeksforGeeks
15 May, 2019 chpasswd command is used to change password although passwd command can also do same. But it changes the password of one user at a time so for multiple users chpasswd is used. Below figure shows the use of passwd command. Using passwd we are changing the password of the guest user. Here first you have to e...
[ { "code": null, "e": 24625, "s": 24597, "text": "\n15 May, 2019" }, { "code": null, "e": 25071, "s": 24625, "text": "chpasswd command is used to change password although passwd command can also do same. But it changes the password of one user at a time so for multiple users chpas...
Construct a DFA which accept the language L = {w | w ∈ {a,b}* and Na(w) mod 3 = Nb (w) mod 3} - GeeksforGeeks
02 Jul, 2019 Problem: Construct a deterministic finite automata (DFA) for accepting the language L = {w | w ∈ {a,b}* and Na(w) mod 3 = Nb (w) mod 3}. Language L={w | Na(w) = Nb(w)mod 3} which means all string contain modulus of count of a’s equal to modulus of count of b’s by 3. Examples: Input: a a b b bOutput: NOT AC...
[ { "code": null, "e": 24582, "s": 24554, "text": "\n02 Jul, 2019" }, { "code": null, "e": 24719, "s": 24582, "text": "Problem: Construct a deterministic finite automata (DFA) for accepting the language L = {w | w ∈ {a,b}* and Na(w) mod 3 = Nb (w) mod 3}." }, { "code": null...
Spring Boot Basic Authentication Example - onlinetutorialspoint
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws In this tutorials, we are going show you how ...
[ { "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, ...
How regular expression anchors work in Python?
Anchors are regex tokens that don't match any characters but that say or assert something about the string or the matching process. Anchors inform us that the engine's current position in the string matches a determined location: for example, the beginning of the string/line, or the end of a string/line. This type of a...
[ { "code": null, "e": 1368, "s": 1062, "text": "Anchors are regex tokens that don't match any characters but that say or assert something about the string or the matching process. Anchors inform us that the engine's current position in the string matches a determined location: for example, the beginn...
How to use Android ViewPager?
Before getting into the example, we should know what is view pager in android. View pager found in Support Library in Android, using view pager we can switch the fragments. This example demonstrates how to use android view pager. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all req...
[ { "code": null, "e": 1235, "s": 1062, "text": "Before getting into the example, we should know what is view pager in android. View pager found in Support Library in Android, using view pager we can switch the fragments." }, { "code": null, "e": 1292, "s": 1235, "text": "This exam...
Remove duplicates from a List in C#
Use the Distinct() method to remove duplicates from a list in C#. Firstly, add a new list − List<int> arr1 = new List<int>(); arr1.Add(10); arr1.Add(20); arr1.Add(30); arr1.Add(40); arr1.Add(50); arr1.Add(30); arr1.Add(40); arr1.Add(50); To remove duplicate elements, use the Distinct() method as shown below − List<int>...
[ { "code": null, "e": 1128, "s": 1062, "text": "Use the Distinct() method to remove duplicates from a list in C#." }, { "code": null, "e": 1154, "s": 1128, "text": "Firstly, add a new list −" }, { "code": null, "e": 1300, "s": 1154, "text": "List<int> arr1 = ne...
How to show/hide dropdown menu on mouse hover using CSS ?
06 Jun, 2022 The approach of this article is to show and hide the dropdown menu on mouse hover using CSS. The task can be done by using the display property and :hover selector. Example: HTML <!DOCTYPE html><html lang="en"><head> <title> How to Show Hide Dropdown Using CSS </title> <style> ul ...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Jun, 2022" }, { "code": null, "e": 193, "s": 28, "text": "The approach of this article is to show and hide the dropdown menu on mouse hover using CSS. The task can be done by using the display property and :hover selector." }, { ...
Finding the maximum square sub-matrix with all equal elements
13 Jul, 2022 Given a N x N matrix, determine the maximum K such that K x K is a submatrix with all equal elements i.e., all the elements in this submatrix must be same. Constraints: 1 <= N <= 1000 0 <= Ai , j <= 109 Examples: Input : a[][] = {{2, 3, 3}, {2, 3, 3}, {2, 2, 2}} Outp...
[ { "code": null, "e": 54, "s": 26, "text": "\n13 Jul, 2022" }, { "code": null, "e": 211, "s": 54, "text": "Given a N x N matrix, determine the maximum K such that K x K is a submatrix with all equal elements i.e., all the elements in this submatrix must be same. " }, { "co...
Creating an activate/deactivate button using PHP and MySQL
21 Jul, 2021 In this article, we will discuss how to create an Activate/Deactivate button using PHP. When a particular status is set, the same gets updated in the database. Approach: In order to illustrate the example, let’s say that there are a few courses that can be set as active or inactive and need to have approp...
[ { "code": null, "e": 52, "s": 24, "text": "\n21 Jul, 2021" }, { "code": null, "e": 213, "s": 52, "text": "In this article, we will discuss how to create an Activate/Deactivate button using PHP. When a particular status is set, the same gets updated in the database. " }, { ...
Python | Pandas MultiIndex.sortlevel()
24 Dec, 2018 Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas MultiIndex.sortlevel() function sort MultiIndex at the requested level. The result wil...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Dec, 2018" }, { "code": null, "e": 242, "s": 28, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp...
Functools module in Python
26 Mar, 2020 Functools module is for higher-order functions that work on other functions. It provides functions for working with other functions and callable objects to use or extend them without completely rewriting them. This module has two classes – partial and partialmethod. A partial function is an original functi...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 Mar, 2020" }, { "code": null, "e": 295, "s": 28, "text": "Functools module is for higher-order functions that work on other functions. It provides functions for working with other functions and callable objects to use or extend them ...
Java Program for Longest Palindromic Subsequence | DP-12
13 Aug, 2021 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 n...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Aug, 2021" }, { "code": null, "e": 108, "s": 28, "text": "Given a sequence, find the length of the longest palindromic subsequence in it." }, { "code": null, "e": 357, "s": 108, "text": "As another example, if the...
MySQL | LAST_DAY() Function
21 Mar, 2018 The LAST_DAY() function in MySQL can be used to know the last day of the month for a given date or a datetime. The LAST_DAY() function takes a date value as argument and returns the last day of month in that date. The date argument represents a valid date or datetime. Syntax: LAST_DAY( Date ); If the date...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Mar, 2018" }, { "code": null, "e": 297, "s": 28, "text": "The LAST_DAY() function in MySQL can be used to know the last day of the month for a given date or a datetime. The LAST_DAY() function takes a date value as argument and retur...
Python | Pandas Series.item()
12 Feb, 2019 Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.item() function return the first ele...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Feb, 2019" }, { "code": null, "e": 285, "s": 28, "text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based index...
React Native WebView Component
28 Apr, 2021 In this article, We are going to see how to create a WebView in react-native. WebView is used to display web content in an application. For this, we are going to use WebView Component. Syntax : <WebView source={} /> Props of WebView : source: It basically loads the URL in the web view. automatically...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Apr, 2021" }, { "code": null, "e": 214, "s": 28, "text": "In this article, We are going to see how to create a WebView in react-native. WebView is used to display web content in an application. For this, we are going to use WebView C...
What are the uses of super keyword in java?
The super keyword in Java is a reference to the object of the parent/superclass. Using it, you can refer/call a field, a method or, a constructor of the immediate superclass. As mentioned above, you can refer to an instance filed/variable of the immediate superclass from an instance method or, a constructor of a subcla...
[ { "code": null, "e": 1237, "s": 1062, "text": "The super keyword in Java is a reference to the object of the parent/superclass. Using it, you can refer/call a field, a method or, a constructor of the immediate superclass." }, { "code": null, "e": 1413, "s": 1237, "text": "As ment...
MongoDB query to find documents with specific FirstName and LastName
To find documents with specific FirstName and LastName, use $and along with $in. Implement this in MongoDB find(). Let us create a collection with documents − > db.demo692.insertOne({FirstName:"Chris","LastName":"Brown"}); { "acknowledged" : true, "insertedId" : ObjectId("5ea585dca7e81adc6a0b396a") } > db.demo692...
[ { "code": null, "e": 1221, "s": 1062, "text": "To find documents with specific FirstName and LastName, use $and along with $in. Implement this in MongoDB find(). Let us create a collection with documents −" }, { "code": null, "e": 1960, "s": 1221, "text": "> db.demo692.insertOne(...
First Missing Positive in Python
Suppose we have one unsorted integer array; we have to find the smallest missing positive number. So if the array is like [4, -3, 1, -1], then the result will be 2. To solve this, we will follow these steps − set i := 0 and update array nums by adding one 0 before all numbers set i := 0 and update array nums by adding ...
[ { "code": null, "e": 1227, "s": 1062, "text": "Suppose we have one unsorted integer array; we have to find the smallest missing positive number. So if the array is like [4, -3, 1, -1], then the result will be 2." }, { "code": null, "e": 1271, "s": 1227, "text": "To solve this, we...
Java Networking - GeeksforGeeks
07 Sep, 2021 When computing devices such as laptops, desktops, servers, smartphones, and tablets and an eternally-expanding arrangement of IoT gadgets such as cameras, door locks, doorbells, refrigerators, audio/visual systems, thermostats, and various sensors are sharing information and data with each other is known a...
[ { "code": null, "e": 23581, "s": 23553, "text": "\n07 Sep, 2021" }, { "code": null, "e": 23902, "s": 23581, "text": "When computing devices such as laptops, desktops, servers, smartphones, and tablets and an eternally-expanding arrangement of IoT gadgets such as cameras, door loc...
Lemoine's Conjecture - GeeksforGeeks
21 Dec, 2020 Any odd integer greater than 5 can be expressed as a sum of an odd prime (all primes other than 2 are odd) and an even semiprime. A semiprime number is a product of two prime numbers. This is called Lemoine’s conjecture. Examples : 7 = 3 + (2 × 2), where 3 is a prime number (other than 2) and 4 (= 2 × 2) ...
[ { "code": null, "e": 24181, "s": 24153, "text": "\n21 Dec, 2020" }, { "code": null, "e": 24414, "s": 24181, "text": "Any odd integer greater than 5 can be expressed as a sum of an odd prime (all primes other than 2 are odd) and an even semiprime. A semiprime number is a product o...
Find if given number is sum of first n natural numbers - GeeksforGeeks
26 Apr, 2021 Given a number s (1 <= s <= 1000000000). If this number is the sum of first n natural number then print, otherwise print -1. Examples: Input: s = 10 Output: n = 4 Explanation: 1 + 2 + 3 + 4 = 10 Input: s = 17 Output: n = -1 Explanation: 17 can't be expressed as a sum of consecutive from 1. Method 1 (Si...
[ { "code": null, "e": 24718, "s": 24690, "text": "\n26 Apr, 2021" }, { "code": null, "e": 24854, "s": 24718, "text": "Given a number s (1 <= s <= 1000000000). If this number is the sum of first n natural number then print, otherwise print -1. Examples: " }, { "code": null,...
Pascal - Functions
A subprogram is a program unit/module that performs a particular task. These subprograms are combined to form larger programs. This is basically called the 'Modular design.' A subprogram can be invoked by a subprogram/program, which is called the calling program. Pascal provides two kinds of subprograms − Functions − t...
[ { "code": null, "e": 2347, "s": 2083, "text": "A subprogram is a program unit/module that performs a particular task. These subprograms are combined to form larger programs. This is basically called the 'Modular design.' A subprogram can be invoked by a subprogram/program, which is called the callin...
Apex - nested if statement
We can also have the nested if-else statement for complex condition as given below − if boolean_expression_1 { /* Executes when the boolean expression 1 is true */ if boolean_expression_2 { /* Executes when the boolean expression 2 is true */ } } String pinCode = '12345'; String customerType = 'Premium'...
[ { "code": null, "e": 2137, "s": 2052, "text": "We can also have the nested if-else statement for complex condition as given below −" }, { "code": null, "e": 2315, "s": 2137, "text": "if boolean_expression_1 {\n /* Executes when the boolean expression 1 is true */\n if boolean...
Check if a Rook can reach the given destination in a single move - GeeksforGeeks
03 May, 2021 Given integers current_row and current_col, representing the current position of a Rook on an 8 × 8 chessboard and two more integers destination_row and destination_col which represents the position to be reached by a Rook. The task is to check if it is possible or not for a Rook to reach the given destina...
[ { "code": null, "e": 25217, "s": 25189, "text": "\n03 May, 2021" }, { "code": null, "e": 25645, "s": 25217, "text": "Given integers current_row and current_col, representing the current position of a Rook on an 8 × 8 chessboard and two more integers destination_row and destinatio...
How to remove a specific element from array in MongoDB?
To remove a specific element, use $pull. Let us create a collection with documents − > db.demo125.insertOne({"ListOfNames":["John","Chris","Bob","David","Carol"]}); { "acknowledged" : true, "insertedId" : ObjectId("5e2f304068e7f832db1a7f55") } Display all documents from a collection with the help of find() method...
[ { "code": null, "e": 1147, "s": 1062, "text": "To remove a specific element, use $pull. Let us create a collection with documents −" }, { "code": null, "e": 1312, "s": 1147, "text": "> db.demo125.insertOne({\"ListOfNames\":[\"John\",\"Chris\",\"Bob\",\"David\",\"Carol\"]});\n{\n ...
Tryit Editor v3.7
Tryit: Some HEX color values
[]
Find K missing numbers from given Array in range [1, M] such that total average is X - GeeksforGeeks
15 Dec, 2021 Given an array arr[] of integers of size N where each element can be in the range [1, M], and two integers X and K. The task is to find K possible numbers in range [1, M] such that the average of all the (N + K) numbers is equal to X. If there are multiple valid answers, any one is acceptable. Examples: In...
[ { "code": null, "e": 25458, "s": 25430, "text": "\n15 Dec, 2021" }, { "code": null, "e": 25753, "s": 25458, "text": "Given an array arr[] of integers of size N where each element can be in the range [1, M], and two integers X and K. The task is to find K possible numbers in range...
C++ Program for sorting variables of any data type
We are given with the values of different datatypes like it can be of type integer, float, string, bool, etc. and the task is to sort the variables of any data type using one common method or function and display the result. In C++, we can use std::sort to sort any type of array which is available in C++ standard templ...
[ { "code": null, "e": 1287, "s": 1062, "text": "We are given with the values of different datatypes like it can be of type integer, float, string, bool, etc. and the task is to sort the variables of any data type using one common method or function and display the result." }, { "code": null, ...
Add more than one shadow to a text with CSS
Add the comma-separated list of shadows to add more than one shadow, with the text-shadow property. You can try to run the following to learn how to add multiple shadows in a single line Example Live Demo <!DOCTYPE html> <html> <head> <style> h1 { text-shadow: 0 0 3px red, 0 0 4px green, 0...
[ { "code": null, "e": 1249, "s": 1062, "text": "Add the comma-separated list of shadows to add more than one shadow, with the text-shadow property. You can try to run the following to learn how to add multiple shadows in a single line" }, { "code": null, "e": 1257, "s": 1249, "tex...
Scala List iterator() method with example - GeeksforGeeks
29 Jul, 2019 The iterator method is utilized to give an iterator. Method Definition: def iterator: Iterator[A] Return Type: It returns a non-empty iterator for non-empty list and returns an empty iterator for empty list. Example #1: // Scala program of iterator// method // Creating objectobject GfG{ // Main meth...
[ { "code": null, "e": 23856, "s": 23828, "text": "\n29 Jul, 2019" }, { "code": null, "e": 23909, "s": 23856, "text": "The iterator method is utilized to give an iterator." }, { "code": null, "e": 23954, "s": 23909, "text": "Method Definition: def iterator: Iter...
Calculate difference between adjacent elements in given list using Python
In this article we will see how we create a new list from a given list by subtracting the values in the adjacent elements of the list. We have various approaches to do that. In this approach we iterate through list elements by subtracting the values using their index positions and appending the result of each subtracti...
[ { "code": null, "e": 1236, "s": 1062, "text": "In this article we will see how we create a new list from a given list by subtracting the values in the adjacent elements of the list. We have various approaches to do that." }, { "code": null, "e": 1478, "s": 1236, "text": "In this ...
ByteBuffer rewind() methods in Java with Examples - GeeksforGeeks
16 Jul, 2019 The rewind() method of java.nio.ByteBuffer Class is used to rewind this buffer. The position is set to zero and the mark is discarded. Invoke this method before a sequence of channel-write or get operations, assuming that the limit has already been set appropriately. Invoking this method neither changes no...
[ { "code": null, "e": 24522, "s": 24494, "text": "\n16 Jul, 2019" }, { "code": null, "e": 24858, "s": 24522, "text": "The rewind() method of java.nio.ByteBuffer Class is used to rewind this buffer. The position is set to zero and the mark is discarded. Invoke this method before a ...
How to press ENTER inside an edit box in Selenium?
Selenium gives Enum Key macros to perform the enter action. import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; import java.util.List; public cla...
[ { "code": null, "e": 1122, "s": 1062, "text": "Selenium gives Enum Key macros to perform the enter action." }, { "code": null, "e": 1911, "s": 1122, "text": "import org.openqa.selenium.By;\nimport org.openqa.selenium.Keys;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa...
Python - Tkinter Message
This widget provides a multiline and noneditable object that displays texts, automatically breaking lines and justifying their contents. Its functionality is very similar to the one provided by the Label widget, except that it can also automatically wrap the text, maintaining a given width or aspect ratio. Here is the ...
[ { "code": null, "e": 2381, "s": 2244, "text": "This widget provides a multiline and noneditable object that displays texts, automatically breaking lines and justifying their contents." }, { "code": null, "e": 2552, "s": 2381, "text": "Its functionality is very similar to the one ...
Containerize Your Application With Docker | Towards Data Science
Let’s say that you want to deploy an application to a server. In your local system, the application works just fine without any problem. But once you’ve deployed the application into a server, boom! Your application doesn’t work. Many factors can make this happen. It could be the operating system compatibility or diffe...
[ { "code": null, "e": 276, "s": 46, "text": "Let’s say that you want to deploy an application to a server. In your local system, the application works just fine without any problem. But once you’ve deployed the application into a server, boom! Your application doesn’t work." }, { "code": null...
How to turn on Flash light programmatically in android?
This example demonstrates how do I turn on Flash light programatically 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"?> <Lin...
[ { "code": null, "e": 1145, "s": 1062, "text": "This example demonstrates how do I turn on Flash light programatically in android." }, { "code": null, "e": 1274, "s": 1145, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required det...
CSS Image Opacity / Transparency
The opacity property specifies the opacity/transparency of an element. The opacity property can take a value from 0.0 - 1.0. The lower value, the more transparent: opacity 0.2 opacity 0.5 opacity 1(default) The opacity property is often used together with the :hover selector to change the opacity on mouse-over: The fi...
[ { "code": null, "e": 71, "s": 0, "text": "The opacity property specifies the opacity/transparency of an element." }, { "code": null, "e": 164, "s": 71, "text": "The opacity property can take a value from 0.0 - 1.0. The lower value, the more transparent:" }, { "code": null...
Data Ops – Git Actions & Terraform for Data Engineers & Scientists — GCP/AWS/Azure | by Gagandeep Singh | Towards Data Science
I strongly believe in POCing a new design or code template and get it review by other engineers because you never know what efficient nuances you are missing and it is always good to have a fresh set of eyes reviewing the code. And I tend to make POC as near to MVP (Minimum viable product) as possible to make myself an...
[ { "code": null, "e": 1012, "s": 172, "text": "I strongly believe in POCing a new design or code template and get it review by other engineers because you never know what efficient nuances you are missing and it is always good to have a fresh set of eyes reviewing the code. And I tend to make POC as ...
Scikit Learn - Multinomial Naà ̄ve Bayes
It is another useful Naïve Bayes classifier. It assumes that the features are drawn from a simple Multinomial distribution. The Scikit-learn provides sklearn.naive_bayes.MultinomialNB to implement the Multinomial Naïve Bayes algorithm for classification. Following table consist the parameters used by sklearn.naive_ba...
[ { "code": null, "e": 2478, "s": 2221, "text": "It is another useful Naïve Bayes classifier. It assumes that the features are drawn from a simple Multinomial distribution. The Scikit-learn provides sklearn.naive_bayes.MultinomialNB to implement the Multinomial Naïve Bayes algorithm for classificati...
How to compare dates in JavaScript?
Dates can be compared easily in javascript. The dates can belong to any frame i.e past, present and future. Past dates can be compared to future or future dates can be compared to the present. In the following example, a date in the year 2000 is compared with today's date and the respective message is displayed in the...
[ { "code": null, "e": 1256, "s": 1062, "text": "Dates can be compared easily in javascript. The dates can belong to any frame i.e past, present and future. Past dates can be compared to future or future dates can be compared to the present. " }, { "code": null, "e": 1392, "s": 1256, ...
Elixir - Environment
In order to run Elixir, you need to set it up locally on your system. To install Elixir, you will first require Erlang. On some platforms, Elixir packages come with Erlang in them. Let us now understand the installation of Elixir in different Operating Systems. To install Elixir on windows, download installer from http...
[ { "code": null, "e": 2252, "s": 2182, "text": "In order to run Elixir, you need to set it up locally on your system." }, { "code": null, "e": 2363, "s": 2252, "text": "To install Elixir, you will first require Erlang. On some platforms, Elixir packages come with Erlang in them." ...
Computer vision and the ultimate pong AI | by Robin T. White, PhD | Towards Data Science
One of my favourite YouTuber’s, CodeBullet, once attempted to create a pong AI to rule them all. Sadly he ran into troubles, not because he isn’t capable but I don’t think his experience at the time had much in the way of computer vision. He is absolutely hilarious and I highly recommend you watch him (parental advisor...
[ { "code": null, "e": 638, "s": 171, "text": "One of my favourite YouTuber’s, CodeBullet, once attempted to create a pong AI to rule them all. Sadly he ran into troubles, not because he isn’t capable but I don’t think his experience at the time had much in the way of computer vision. He is absolutely...
Check if a graph is strongly connected - Set 1 (Kosaraju using DFS) in C++
Suppose we have a graph. We have to check whether the graph is strongly connected or not using Kosaraju algorithm. A graph is said to be strongly connected, if any two vertices has path between them, then the graph is connected. An undirected graph is strongly connected graph. Some undirected graph may be connected but...
[ { "code": null, "e": 1340, "s": 1062, "text": "Suppose we have a graph. We have to check whether the graph is strongly connected or not using Kosaraju algorithm. A graph is said to be strongly connected, if any two vertices has path between them, then the graph is connected. An undirected graph is s...
How to Monitor a Thread's Status in Java? - GeeksforGeeks
30 Sep, 2021 The Java language support thread synchronization through the use of monitors. A monitor is associated with a specific data item and functions as a lock on that data. When a thread holds the monitor for some data item, other threads are locked out and cannot inspect or modify the data. In order to monitor a...
[ { "code": null, "e": 25347, "s": 25319, "text": "\n30 Sep, 2021" }, { "code": null, "e": 26181, "s": 25347, "text": "The Java language support thread synchronization through the use of monitors. A monitor is associated with a specific data item and functions as a lock on that dat...
Flood fill Algorithm | Practice | GeeksforGeeks
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image. Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image. To perform a "flood fill", consider the starting pixel, plus any...
[ { "code": null, "e": 346, "s": 238, "text": "An image is represented by a 2-D array of integers, each integer representing the pixel value of the image." }, { "code": null, "e": 494, "s": 346, "text": "Given a coordinate (sr, sc) representing the starting pixel (row and column) o...
Pie Charts in Python. Creating Pie Charts in Python | by Sadrach Pierre, Ph.D. | Towards Data Science
A pie chart is a type of data visualization that is used to illustrate numerical proportions in data. The python library ‘matplotlib’ provides many useful tools for creating beautiful visualizations, including pie charts. In this post, we will discuss how to use ‘matplotlib’ to create pie charts in python. Let’s get st...
[ { "code": null, "e": 480, "s": 172, "text": "A pie chart is a type of data visualization that is used to illustrate numerical proportions in data. The python library ‘matplotlib’ provides many useful tools for creating beautiful visualizations, including pie charts. In this post, we will discuss how...
2D Vector of Pairs in C++ with Examples - GeeksforGeeks
19 Dec, 2021 What is Vector? In C++, a vector is similar to dynamic arrays with the ability to resize itself automatically. Vector elements are stored in contiguous memory locations so that they can be accessed and traversed using iterators. Some of the functions associated with a vector: begin(): Returns an iterator p...
[ { "code": null, "e": 25479, "s": 25451, "text": "\n19 Dec, 2021" }, { "code": null, "e": 25495, "s": 25479, "text": "What is Vector?" }, { "code": null, "e": 25708, "s": 25495, "text": "In C++, a vector is similar to dynamic arrays with the ability to resize i...
ML | Models Score and Error - GeeksforGeeks
02 Aug, 2019 In Machine Learning one of the main task is to model the data and predict the output using various Classification and Regression Algorithms. But since there are so many Algorithms, it is really difficult to choose the one for predicting the final data. So we need to compare our models and choose the one wi...
[ { "code": null, "e": 24467, "s": 24439, "text": "\n02 Aug, 2019" }, { "code": null, "e": 24799, "s": 24467, "text": "In Machine Learning one of the main task is to model the data and predict the output using various Classification and Regression Algorithms. But since there are so...
CSS | @import rule - GeeksforGeeks
07 Jan, 2019 The @import rule is used to import one style sheet into another style sheet. This rule also support media queries so that the user can import the media-dependent style sheet. The @import rule must be declared at the top of the document after any @charset declaration. Syntax: @import url|string list-of-medi...
[ { "code": null, "e": 24186, "s": 24158, "text": "\n07 Jan, 2019" }, { "code": null, "e": 24454, "s": 24186, "text": "The @import rule is used to import one style sheet into another style sheet. This rule also support media queries so that the user can import the media-dependent s...
Semaphores in Kotlin - GeeksforGeeks
28 Feb, 2022 Semaphore is a set of permits. Assume it as a box that has the tokens(permits) for attending(performing) a task. Threads have access to Semaphore but not those permits. Depending on the number of permits, and when a thread arrives at the semaphore, a permit is given. If a Thread arrives when there are no p...
[ { "code": null, "e": 25413, "s": 25385, "text": "\n28 Feb, 2022" }, { "code": null, "e": 25822, "s": 25413, "text": "Semaphore is a set of permits. Assume it as a box that has the tokens(permits) for attending(performing) a task. Threads have access to Semaphore but not those per...
Java fall through switch statements
Following rules govern the fall through the behavior of switch statement. When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached. When the variable being switched on is equal to a case, the statements following that case will execute un...
[ { "code": null, "e": 1137, "s": 1062, "text": " Following rules govern the fall through the behavior of switch statement." }, { "code": null, "e": 1277, "s": 1137, "text": "When the variable being switched on is equal to a case, the statements following that case will execute unt...
Console.SetBufferSize() Method in C# - GeeksforGeeks
14 Mar, 2019 Console.SetBufferSize(Int32, Int32) Method is used to set the height and width of the screen buffer area to the specified values. Syntax: public static void SetBufferSize(int width, int height); Parameters:width: It sets the width of the buffer area measured in the form of columns.height: It sets the heigh...
[ { "code": null, "e": 24302, "s": 24274, "text": "\n14 Mar, 2019" }, { "code": null, "e": 24432, "s": 24302, "text": "Console.SetBufferSize(Int32, Int32) Method is used to set the height and width of the screen buffer area to the specified values." }, { "code": null, "...
Erlang - Logical Operators
Following are the logical operators available in Erlang. The following code snippet shows how the various operators can be used. -module(helloworld). -export([start/0]). start() -> io:fwrite("~w~n",[true or false]), io:fwrite("~w~n",[true and false]), io:fwrite("~w~n",[true xor false]), io:fwrite("~...
[ { "code": null, "e": 2358, "s": 2301, "text": "Following are the logical operators available in Erlang." }, { "code": null, "e": 2430, "s": 2358, "text": "The following code snippet shows how the various operators can be used." }, { "code": null, "e": 2640, "s": 2...
Deep Learning and LSTM based Malware Classification | by Ferhat Ozgur Catak | Towards Data Science
Malware development has seen diversity in terms of architecture and features. This advancement in the competencies of malware poses a severe threat and opens new research dimensions in malware detection. This study is focused on metamorphic malware that is the most advanced member of the malware family. It is quite imp...
[ { "code": null, "e": 793, "s": 172, "text": "Malware development has seen diversity in terms of architecture and features. This advancement in the competencies of malware poses a severe threat and opens new research dimensions in malware detection. This study is focused on metamorphic malware that i...
Frequency Modulation (FM) using MATLAB - GeeksforGeeks
02 Sep, 2020 Frequency modulation is the encoding of data in a carrier wave by changing the immediate frequency of the wave. In other words in frequency modulation, the frequency, as opposed to the amplitude of the carrier wave, is made to change in relation to the differing amplitude of the modulating signal. We will ...
[ { "code": null, "e": 24664, "s": 24636, "text": "\n02 Sep, 2020" }, { "code": null, "e": 24963, "s": 24664, "text": "Frequency modulation is the encoding of data in a carrier wave by changing the immediate frequency of the wave. In other words in frequency modulation, the frequen...
Fidget Spinner using Python - GeeksforGeeks
30 Jun, 2021 Prerequisite: Turtle Programming in Python In this article, we are going to create Fidget Spinner using the Python turtle module. It is a Python feature like a drawing board, which lets us command a turtle to draw all over it! We can use functions like turtle.forward() and turtle.right() which can move the...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n30 Jun, 2021" }, { "code": null, "e": 24335, "s": 24292, "text": "Prerequisite: Turtle Programming in Python" }, { "code": null, "e": 24616, "s": 24335, "text": "In this article, we are going to create Fidget ...
How to convert std::string to LPCWSTR in C++?
In this section we will see how to convert C++ wide string (std::wstring) to LPCWSTR. The LPCWSTR is the (Long Pointer to Constant Wide STRing). It is basically the string with wide characters. So by converting wide string to wide character array we can get LPCWSTR. This LPCWSTR is Microsoft defined. So to use them we ...
[ { "code": null, "e": 1438, "s": 1062, "text": "In this section we will see how to convert C++ wide string (std::wstring) to LPCWSTR. The LPCWSTR is the (Long Pointer to Constant Wide STRing). It is basically the string with wide characters. So by converting wide string to wide character array we can...
Abstractive Summarization for Data Augmentation | by Aaron Briel | Towards Data Science
Imbalanced class distribution is a common problem in Machine Learning. I was recently confronted with this issue when training a sentiment classification model. Certain categories were far more prevalent than others and the predictive quality of the model suffered. The first technique I used to address this was random ...
[ { "code": null, "e": 745, "s": 171, "text": "Imbalanced class distribution is a common problem in Machine Learning. I was recently confronted with this issue when training a sentiment classification model. Certain categories were far more prevalent than others and the predictive quality of the model...
NHibernate - Basic CRUD Operations
In this chapter, we will cover the basic CRUD operations. Now that our system is ready to start, as we have successfully implemented our domain Student class, we have also defined the mapping files and configured NHibernate. We can now use some queries to perform CRUD operations. As you can see that we have no data in ...
[ { "code": null, "e": 2614, "s": 2333, "text": "In this chapter, we will cover the basic CRUD operations. Now that our system is ready to start, as we have successfully implemented our domain Student class, we have also defined the mapping files and configured NHibernate. We can now use some queries ...
How to install a windows service using windows command prompt in C#?
Step 1 − Create a new windows service application. Step 2 − For running a Windows Service, you need to install the Installer, which registers it with the Service Control Manager. Right click on the Service1.cs[Design] and Add Installer. Step 3 − Right click on the ProjectInstaller.cs [Design] and select the view code. ...
[ { "code": null, "e": 1071, "s": 1062, "text": "Step 1 −" }, { "code": null, "e": 1113, "s": 1071, "text": "Create a new windows service application." }, { "code": null, "e": 1122, "s": 1113, "text": "Step 2 −" }, { "code": null, "e": 1299, "s":...
Forward List in C++ | Set 1 (Introduction and Important Functions) - GeeksforGeeks
17 Jan, 2022 Forward list in STL implements singly linked list. Introduced from C++11, forward list are more useful than other containers in insertion, removal, and moving operations (like sort) and allow time constant insertion and removal of elements. It differs from the list by the fact that the forward list keeps ...
[ { "code": null, "e": 24205, "s": 24177, "text": "\n17 Jan, 2022" }, { "code": null, "e": 24447, "s": 24205, "text": "Forward list in STL implements singly linked list. Introduced from C++11, forward list are more useful than other containers in insertion, removal, and moving oper...
GATE-CS-2014-(Set-1) - GeeksforGeeks
10 Nov, 2021 A says that strategies are now available for eliminating psychiatric illnesses but it is mentioned in the very first line that the geneticists are very close but the strategy is not available till now. So, A is incorrect. The given data says that the geneticists are working on the genetic roots of psychiat...
[ { "code": null, "e": 27610, "s": 27582, "text": "\n10 Nov, 2021" }, { "code": null, "e": 27832, "s": 27610, "text": "A says that strategies are now available for eliminating psychiatric illnesses but it is mentioned in the very first line that the geneticists are very close but t...
Create a simple Numpy Jupyter Notebook using Docker
Machine learning and Data Science have certainly become the new buzzword. Organizations are now trying to adopt Data Analytics and Machine learning techniques to predict their sales and to increase their revenue. No doubt, specializing machine learning techniques would surely give you an upperhand in today’s corporate ...
[ { "code": null, "e": 1535, "s": 1062, "text": "Machine learning and Data Science have certainly become the new buzzword. Organizations are now trying to adopt Data Analytics and Machine learning techniques to predict their sales and to increase their revenue. No doubt, specializing machine learning ...
How to display NA frequency for a ggplot2 graph using color brewer in R?
To display NA frequency for a ggplot2 graph using color brewer in R, we can follow the below steps − First of all, create a data frame. Then, create the chart with default colors. After that, use scale_colour_brewer function to create the bar chart and set the color of NA values bar with na.value. Let's create a data f...
[ { "code": null, "e": 1163, "s": 1062, "text": "To display NA frequency for a ggplot2 graph using color brewer in R, we can follow the below steps −" }, { "code": null, "e": 1198, "s": 1163, "text": "First of all, create a data frame." }, { "code": null, "e": 1242, ...
C# program to iterate over a string array with for loop
Create a string array − string[] str = new string[] { "Videos", "Tutorials", "Tools", "InterviewQA" }; Loop until the length of the array − for (int i = 0; i < str.Length; i++) { string res = str[i]; Console.WriteLine(res); } Here is the complete code − Live Demo using System; public class Demo { ...
[ { "code": null, "e": 1086, "s": 1062, "text": "Create a string array −" }, { "code": null, "e": 1177, "s": 1086, "text": "string[] str = new string[] {\n \"Videos\",\n \"Tutorials\",\n \"Tools\",\n \"InterviewQA\"\n};" }, { "code": null, "e": 1214, "s": 11...
CakePHP - Session Management
Session allows us to manage unique users across requests, and stores data for specific users. Session data can be accessible anywhere, anyplace, where you have access to request object, i.e., sessions are accessible from controllers, views, helpers, cells, and components. Session object can be created by executing the ...
[ { "code": null, "e": 2515, "s": 2242, "text": "Session allows us to manage unique users across requests, and stores data for specific users. Session data can be accessible anywhere, anyplace, where you have access to request object, i.e., sessions are accessible from controllers, views, helpers, cel...
3 ways to interpretate your NLP model to management and customer | by Edward Ma | Towards Data Science
Machine Learning (ML) and Artificial Intelligence (AI) changed the landscape in doing business. Lots of company hire data scientist (I am one of them:)) to deliver a data product. It is absolute easy to deliver a engine with “high” accuracy (Here is the reason why I double quoted). If somebody ask about reason, we can ...
[ { "code": null, "e": 352, "s": 172, "text": "Machine Learning (ML) and Artificial Intelligence (AI) changed the landscape in doing business. Lots of company hire data scientist (I am one of them:)) to deliver a data product." }, { "code": null, "e": 801, "s": 352, "text": "It is ...
SAS - Basic Syntax
Like any other programming language, the SAS language has its own rules of syntax to create the SAS programs. The three components of any SAS program - Statements, Variables and Data sets follow the below rules on Syntax. Statements can start anywhere and end anywhere. A semicolon at the end of the last line marks th...
[ { "code": null, "e": 2693, "s": 2583, "text": "Like any other programming language, the SAS language has its own rules of syntax to create the SAS programs." }, { "code": null, "e": 2807, "s": 2695, "text": "The three components of any SAS program - Statements, Variables and Data...
XAML - Triggers
Basically, a trigger enables you to change property values or take actions based on the value of a property. So, it basically allows you to dynamically change the appearance and/or behavior of your control without having to create a new one. Triggers are used to change the value of any given property, when certain cond...
[ { "code": null, "e": 2165, "s": 1923, "text": "Basically, a trigger enables you to change property values or take actions based on the value of a property. So, it basically allows you to dynamically change the appearance and/or behavior of your control without having to create a new one." }, { ...
A Not so Short Introduction to the Rust Programming Language | by Kasper Müller | Towards Data Science
What is your favorite programming language? If your answer isn’t Rust then please read this post. At the end of it all, your answer might have changed! In this post, I will teach you the basics of Rust programming. Enough to get you started and create your own programs. At the end of the article, I will guide you in so...
[ { "code": null, "e": 216, "s": 172, "text": "What is your favorite programming language?" }, { "code": null, "e": 324, "s": 216, "text": "If your answer isn’t Rust then please read this post. At the end of it all, your answer might have changed!" }, { "code": null, "e...
Subsets in Python
Suppose we have a set of numbers; we have to generate all possible subsets of that set. This is also known as power set. So if the set is like [1,2,3], then the power set will be [[], [1], [2], [3], [1,2], [1,3], [2,3], [1,2,3]] Let us see the steps − We will solve this using recursive approach. So if the recursive met...
[ { "code": null, "e": 1291, "s": 1062, "text": "Suppose we have a set of numbers; we have to generate all possible subsets of that set. This is also known as power set. So if the set is like [1,2,3], then the power set will be [[], [1], [2], [3], [1,2], [1,3], [2,3], [1,2,3]]" }, { "code": nu...
Swift - Characters
A character in Swift is a single character String literal, addressed by the data type Character. Take a look at the following example. It uses two Character constants − let char1: Character = "A" let char2: Character = "B" print("Value of char1 \(char1)") print("Value of char2 \(char2)") When the above code is compile...
[ { "code": null, "e": 2422, "s": 2253, "text": "A character in Swift is a single character String literal, addressed by the data type Character. Take a look at the following example. It uses two Character constants −" }, { "code": null, "e": 2543, "s": 2422, "text": "let char1: Ch...
Mathematics | Introduction to Propositional Logic | Set 1 - GeeksforGeeks
11 Jan, 2022 Logic is the basis of all mathematical reasoning, and of all automated reasoning. The rules of logic specify the meaning of mathematical statements. These rules help us understand and reason with statements such as – such that where Which in Simple English means “There exists an integer that is not the...
[ { "code": null, "e": 29641, "s": 29613, "text": "\n11 Jan, 2022" }, { "code": null, "e": 29858, "s": 29641, "text": "Logic is the basis of all mathematical reasoning, and of all automated reasoning. The rules of logic specify the meaning of mathematical statements. These rules he...
How to send an attachment in email using Swift(ios)?
Knowing how to send attachments in the email is very important since most of the application has sharing features. Hence having hands-on experience is important. In this post, we will be seeing how to send an attachment in the mail using Swift. So, let’s get started. For this, we will be using MFMailComposeViewControll...
[ { "code": null, "e": 1224, "s": 1062, "text": "Knowing how to send attachments in the email is very important since most of the application has sharing features. Hence having hands-on experience is important." }, { "code": null, "e": 1307, "s": 1224, "text": "In this post, we wil...
How to send data from one activity to another in Android using intent?
This example demonstrate about How to send data from one activity to another in Android using intent. 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" en...
[ { "code": null, "e": 1164, "s": 1062, "text": "This example demonstrate about How to send data from one activity to another in Android using intent." }, { "code": null, "e": 1293, "s": 1164, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fi...
Custom Environments in OpenAI’s Gym | Towards Data Science
OpenAI’s Gym is (citing their website): “... a toolkit for developing and comparing reinforcement learning algorithms”. It includes simulated environments, ranging from very simple games to complex physics-based engines, that you can use to train reinforcement learning algorithms. OpenAI’s other package, Baselines, com...
[ { "code": null, "e": 662, "s": 172, "text": "OpenAI’s Gym is (citing their website): “... a toolkit for developing and comparing reinforcement learning algorithms”. It includes simulated environments, ranging from very simple games to complex physics-based engines, that you can use to train reinforc...
C++ program to implement ASCII lookup table
In this tutorial, we will be discussing a program to implement ASCII lookup table. ASCII lookup table is a tabular representation that provides with the octal, hexadecimal, decimal and HTML values of a given character. The character for the ASCII lookup table includes alphabets, digits, separators and special symbols. ...
[ { "code": null, "e": 1145, "s": 1062, "text": "In this tutorial, we will be discussing a program to implement ASCII lookup table." }, { "code": null, "e": 1281, "s": 1145, "text": "ASCII lookup table is a tabular representation that provides with the octal, hexadecimal, decimal a...
Creating Histograms of Well Log Data Using Matplotlib in Python | by Andy McDonald | Towards Data Science
Histograms are a commonly used tool within exploratory data analysis and data science. They are an excellent data visualisation tool and appear similar to bar charts. However, histograms allow us to gain insights about the distribution of the values within a set of data and allow us to display a large range of data in ...
[ { "code": null, "e": 714, "s": 172, "text": "Histograms are a commonly used tool within exploratory data analysis and data science. They are an excellent data visualisation tool and appear similar to bar charts. However, histograms allow us to gain insights about the distribution of the values withi...
JuMPing into Puzzle Solving with Linear Programming | by Sarah Eade | Towards Data Science
Linear programming (LP) is a powerful technique to solve optimization problems, and you will often see it applied to problems from airline scheduling, vehicle routing, to revenue management. In this post, I’d like to explore a more whimsical application — how can linear programming be used to solve a puzzle? The puzzle...
[ { "code": null, "e": 482, "s": 172, "text": "Linear programming (LP) is a powerful technique to solve optimization problems, and you will often see it applied to problems from airline scheduling, vehicle routing, to revenue management. In this post, I’d like to explore a more whimsical application —...
JavaScript Array keys() Method - GeeksforGeeks
23 Jun, 2020 Below is the example of the Array keys() method. Example:<script> // Taking input as an array A // containing some elements. var A = [ 5, 6, 10 ]; // array.keys() method is called var iterator = A.keys(); // printing index array using the iterator for (let key of iterator) { documen...
[ { "code": null, "e": 25246, "s": 25218, "text": "\n23 Jun, 2020" }, { "code": null, "e": 25295, "s": 25246, "text": "Below is the example of the Array keys() method." }, { "code": null, "e": 25586, "s": 25295, "text": "Example:<script> // Taking input as a...
SASS | @forward rule - GeeksforGeeks
21 Jun, 2020 The @forward rule processes the Sass stylesheets and makes their functions, mixins, and variables available in the cases when the stylesheet is loaded using @use rule. Organizing Sass libraries across many files are made possible, along with providing users to process a single entry point file. Syntax: @fo...
[ { "code": null, "e": 23899, "s": 23871, "text": "\n21 Jun, 2020" }, { "code": null, "e": 24195, "s": 23899, "text": "The @forward rule processes the Sass stylesheets and makes their functions, mixins, and variables available in the cases when the stylesheet is loaded using @use r...
How to increment a field in MongoDB?
To increment a field in MongoDB, you can use $inc operator. Let us first create a collection with documents − > db.incrementDemo.insertOne({"PlayerScore":100}); { "acknowledged" : true, "insertedId" : ObjectId("5cc81cdd8f9e6ff3eb0ce44e") } > db.incrementDemo.insertOne({"PlayerScore":290}); { "acknowledged" : t...
[ { "code": null, "e": 1172, "s": 1062, "text": "To increment a field in MongoDB, you can use $inc operator. Let us first create a collection with documents −" }, { "code": null, "e": 1580, "s": 1172, "text": "> db.incrementDemo.insertOne({\"PlayerScore\":100});\n{\n \"acknowledg...
AWX - Automate AWS services - GeeksforGeeks
15 Sep, 2021 In this article, we will look into the process of Automating AWS services using the AWX, a VM provided by Ansible Tower. Ansible Tower is a simple IT automation engine that automates cloud provisioning, configuration, deployment, and orchestration. AWX provides a web-based user interface, REST API, and ta...
[ { "code": null, "e": 24228, "s": 24200, "text": "\n15 Sep, 2021" }, { "code": null, "e": 24616, "s": 24228, "text": "In this article, we will look into the process of Automating AWS services using the AWX, a VM provided by Ansible Tower. Ansible Tower is a simple IT automation en...
How MySQL WHILE loop statement can be used in stored procedure?
As we know that MySQL provides us loop statements that allow us to execute a block of SQL code repeatedly based on a condition. WHILE loop statement is one of such kind of loop statements. Its syntax is as follows − WHILE expression DO statements END WHILE Actually, the WHILE loop checks the expression at the starting ...
[ { "code": null, "e": 1278, "s": 1062, "text": "As we know that MySQL provides us loop statements that allow us to execute a block of SQL code repeatedly based on a condition. WHILE loop statement is one of such kind of loop statements. Its syntax is as follows −" }, { "code": null, "e": ...
Spring Boot CLI - Using Shell
Spring Boot CLI provides a Shell interface to run the commands in which we can directly run the commands as shown below. Go to E:\Test folder and type the following command. E:/Test> spring shell You will see the following output. ←[1mSpring Boot←[m←[2m (v2.6.3)←[m Hit TAB to complete. Type 'help' and hit RETURN for h...
[ { "code": null, "e": 2183, "s": 2009, "text": "Spring Boot CLI provides a Shell interface to run the commands in which we can directly run the commands as shown below. Go to E:\\Test folder and type the following command." }, { "code": null, "e": 2206, "s": 2183, "text": "E:/Test...
C# program to check if a value is in an array
Use the Array.Exists method to check if a value is in an array or not. Set a string array − string[] strArray = new string[] {"keyboard", "screen", "mouse", "charger" }; Let’s say you need to find the value “keyboard” in the array. For that, use Array.Exists() − Array.Exists(strArray, ele => ele == "keyboard"); It retu...
[ { "code": null, "e": 1133, "s": 1062, "text": "Use the Array.Exists method to check if a value is in an array or not." }, { "code": null, "e": 1154, "s": 1133, "text": "Set a string array −" }, { "code": null, "e": 1232, "s": 1154, "text": "string[] strArray =...
How to calculate monthly average for time series object in R?
To calculate monthly average for time series object, we can use tapply function with mean. For example, if we have a time series object called TimeData then the monthly average for this series can be found by using the command tapply(TimeData,cycle(TimeData),mean). Consider the below time series object − Live Demo > Da...
[ { "code": null, "e": 1328, "s": 1062, "text": "To calculate monthly average for time series object, we can use tapply function with mean. For example, if we have a time series object called TimeData then the monthly average for this series can be found by using the command tapply(TimeData,cycle(Time...
Pytorch [Tabular] — Regression. This blog post takes you through an... | by Akshaj Verma | Towards Data Science
We will use the red wine quality dataset available on Kaggle. This dataset has 12 columns where the first 11 are the features and the last column is the target column. The data set has 1599 rows. We’re using tqdm to enable progress bars for training and testing loops. import numpy as npimport pandas as pdimport seaborn...
[ { "code": null, "e": 368, "s": 172, "text": "We will use the red wine quality dataset available on Kaggle. This dataset has 12 columns where the first 11 are the features and the last column is the target column. The data set has 1599 rows." }, { "code": null, "e": 441, "s": 368, ...
Design an efficient data structure for given operations - GeeksforGeeks
11 Jul, 2017 Design a Data Structure for the following operations. The data structure should be efficient enough to accommodate the operations according to their frequency. 1) findMin() : Returns the minimum item. Frequency: Most frequent 2) findMax() : Returns the maximum item. Frequency: Most frequent 3) del...
[ { "code": null, "e": 24413, "s": 24385, "text": "\n11 Jul, 2017" }, { "code": null, "e": 24573, "s": 24413, "text": "Design a Data Structure for the following operations. The data structure should be efficient enough to accommodate the operations according to their frequency." ...