title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to add 2 hours to a JavaScript Date object? | To add hours to a JavaScript Date object, use the setHours() method. Under that, get the current hours and 2 hours to it. JavaScript date setHours() method sets the hours for a specified date according to local time.
You can try to run the following code to add 2 hours to date.
Live Demo
<html>
<head>
<title>... | [
{
"code": null,
"e": 1279,
"s": 1062,
"text": "To add hours to a JavaScript Date object, use the setHours() method. Under that, get the current hours and 2 hours to it. JavaScript date setHours() method sets the hours for a specified date according to local time."
},
{
"code": null,
"e":... |
How to extract all the .txt files from a zip file using Python? | In order to extract all .txt files from a zip, you'll need to loop over all files in the zipfile, check if a file is txt file or not. If it is a txt file then extract it. For this we'll use the zipfile module and its extract function.
import zipfile
my_zip = zipfile.Zipfile('my_zip_file.zip') # Specify your zip file's ... | [
{
"code": null,
"e": 1297,
"s": 1062,
"text": "In order to extract all .txt files from a zip, you'll need to loop over all files in the zipfile, check if a file is txt file or not. If it is a txt file then extract it. For this we'll use the zipfile module and its extract function."
},
{
"cod... |
Bokeh - Server | Bokeh architecture has a decouple design in which objects such as plots and glyphs are created using Python and converted in JSON to be consumed by BokehJS client library.
However, it is possible to keep the objects in python and in the browser in sync with one another with the help of Bokeh Server. It enables response... | [
{
"code": null,
"e": 2442,
"s": 2270,
"text": "Bokeh architecture has a decouple design in which objects such as plots and glyphs are created using Python and converted in JSON to be consumed by BokehJS client library."
},
{
"code": null,
"e": 2766,
"s": 2442,
"text": "However, i... |
Sentiment Analysis / Text Classification Using CNN (Convolutional Neural Network) | by Saad Arshad | Towards Data Science | There are lots of applications of text classification. For example, hate speech detection, intent classification, and organizing news articles. The focus of this article is Sentiment Analysis which is a text classification problem. We will be classifying the IMDB comments into two classes i.e. positive and negative.
We... | [
{
"code": null,
"e": 490,
"s": 172,
"text": "There are lots of applications of text classification. For example, hate speech detection, intent classification, and organizing news articles. The focus of this article is Sentiment Analysis which is a text classification problem. We will be classifying ... |
Prefect: How to Write and Schedule Your First ETL Pipeline with Python | by Dario Radečić | Towards Data Science | Prefect is a Python-based workflow management system based on a simple premise — Your code probably works, but sometimes it doesn’t (source). No one thinks about workflow systems when everything works as expected. But when things go south, Prefect will guarantee your code fails successfully.
As a workflow management sy... | [
{
"code": null,
"e": 465,
"s": 172,
"text": "Prefect is a Python-based workflow management system based on a simple premise — Your code probably works, but sometimes it doesn’t (source). No one thinks about workflow systems when everything works as expected. But when things go south, Prefect will gu... |
Understanding Data Science Classification Metrics in Scikit-Learn in Python | by Andrew Long | Towards Data Science | In this tutorial, we will walk through a few of the classifications metrics in Python’s scikit-learn and write our own functions from scratch to understand the math behind a few of them.
One major area of predictive modeling in data science is classification. Classification consists of trying to predict which class a p... | [
{
"code": null,
"e": 358,
"s": 171,
"text": "In this tutorial, we will walk through a few of the classifications metrics in Python’s scikit-learn and write our own functions from scratch to understand the math behind a few of them."
},
{
"code": null,
"e": 1002,
"s": 358,
"text":... |
10 Python File System Methods You Should Know | by Jeff Hale | Towards Data Science | You can write Python programs to interact with the file system to do cool stuff. How to do so isn’t always super clear.
This article is a guide for current and aspiring developers and data scientists. We’ll highlight 10 essential os and shutil commands so you can write scripts to automate interactions with the file sys... | [
{
"code": null,
"e": 292,
"s": 172,
"text": "You can write Python programs to interact with the file system to do cool stuff. How to do so isn’t always super clear."
},
{
"code": null,
"e": 497,
"s": 292,
"text": "This article is a guide for current and aspiring developers and da... |
Unix / Linux - Shell Substitution | The shell performs substitution when it encounters an expression that contains one or more special characters.
Here, the printing value of the variable is substituted by its value. Same time, "\n" is substituted by a new line −
#!/bin/sh
a=10
echo -e "Value of a is $a \n"
You will receive the following result. Here th... | [
{
"code": null,
"e": 2858,
"s": 2747,
"text": "The shell performs substitution when it encounters an expression that contains one or more special characters."
},
{
"code": null,
"e": 2975,
"s": 2858,
"text": "Here, the printing value of the variable is substituted by its value. S... |
Non Access Modifiers in Java
| Java provides a number of non-access modifiers to achieve much other functionality.
The static modifier for creating class methods and variables.
The static modifier for creating class methods and variables.
The final modifier for finalizing the implementations of classes, methods, and variables.
The final modifier for... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "Java provides a number of non-access modifiers to achieve much other functionality."
},
{
"code": null,
"e": 1208,
"s": 1146,
"text": "The static modifier for creating class methods and variables."
},
{
"code": null,
"e":... |
C# | How to Implement Multiple Interfaces Having Same Method Name - GeeksforGeeks | 04 Apr, 2019
Like a class, Interface can have methods, properties, events, and indexers as its members. But interface will contain only the declaration of the members. The implementation of interface’s members will be given by the class who implements the interface implicitly or explicitly.C# allows the implementation ... | [
{
"code": null,
"e": 25457,
"s": 25429,
"text": "\n04 Apr, 2019"
},
{
"code": null,
"e": 25997,
"s": 25457,
"text": "Like a class, Interface can have methods, properties, events, and indexers as its members. But interface will contain only the declaration of the members. The impl... |
Class getField() method in Java with Examples - GeeksforGeeks | 16 Dec, 2019
The getField() method of java.lang.Class class is used to get the specified field of this class, which is the field that is public and its members. The method returns the specified field of this class in the form of Field objects.
Syntax:
public Field getField(String fieldName)
throws NoSuchFieldExc... | [
{
"code": null,
"e": 23868,
"s": 23840,
"text": "\n16 Dec, 2019"
},
{
"code": null,
"e": 24099,
"s": 23868,
"text": "The getField() method of java.lang.Class class is used to get the specified field of this class, which is the field that is public and its members. The method retu... |
Line detection in python with OpenCV | Houghline method - GeeksforGeeks | 21 Feb, 2022
The Hough Transform is a method that is used in image processing to detect any shape, if that shape can be represented in mathematical form. It can detect the shape even if it is broken or distorted a little bit. We will see how Hough transform works for line detection using the HoughLine transform method.... | [
{
"code": null,
"e": 24540,
"s": 24512,
"text": "\n21 Feb, 2022"
},
{
"code": null,
"e": 25012,
"s": 24540,
"text": "The Hough Transform is a method that is used in image processing to detect any shape, if that shape can be represented in mathematical form. It can detect the shap... |
Creating Servlet Example in Eclipse - GeeksforGeeks | 30 Dec, 2021
Servlets are the Java programs that run on the Java-enabled web server or application server. They are used to handle the request obtained from the webserver, process the request, produce the response, then send a response back to the webserver.
Prerequisites:
Eclipse IDE installed – You can download from... | [
{
"code": null,
"e": 23973,
"s": 23945,
"text": "\n30 Dec, 2021"
},
{
"code": null,
"e": 24220,
"s": 23973,
"text": "Servlets are the Java programs that run on the Java-enabled web server or application server. They are used to handle the request obtained from the webserver, proc... |
Get and Find commands in Cypress | Cypress has the get() and find() methods to find elements based on locators on the
page. The objective achieved by these two methods are almost identical. The get()
method fetches one or a list of web elements with the help of the css locators
specified as a parameter to that method.
cy.get(selector, args)
The second p... | [
{
"code": null,
"e": 1347,
"s": 1062,
"text": "Cypress has the get() and find() methods to find elements based on locators on the\npage. The objective achieved by these two methods are almost identical. The get()\nmethod fetches one or a list of web elements with the help of the css locators\nspecif... |
Python String rsplit() Method | 19 Aug, 2021
Python String rsplit() method returns a list of strings after breaking the given string from the right side by the specified separator.
Syntax:
str.rsplit(separator, maxsplit)
Parameters:
separator: The is a delimiter. The string splits at this specified separator starting from the right side. It is not... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 164,
"s": 28,
"text": "Python String rsplit() method returns a list of strings after breaking the given string from the right side by the specified separator."
},
{
"code": null,
"e": 17... |
Smallest window that contains all characters of string itself | 30 May, 2022
Given a string, find the smallest window length with all distinct characters of the given string. For eg. str = “aabcbcdbca”, then the result would be 4 as of the smallest window will be “dbca” .Examples:
Input: aabcbcdbca
Output: dbca
Explanation:
Possible substrings= {aabcbcd, abcbcd,
bcdbca, dbca....... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 May, 2022"
},
{
"code": null,
"e": 258,
"s": 52,
"text": "Given a string, find the smallest window length with all distinct characters of the given string. For eg. str = “aabcbcdbca”, then the result would be 4 as of the smallest wi... |
Python | How to use Multiple kv files in kivy | 07 Feb, 2020
Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktops applications.
In this article, we will see how can we use multiple .kv files in a sin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Feb, 2020"
},
{
"code": null,
"e": 264,
"s": 28,
"text": "Kivy is a platform independent GUI tool in Python. As it can be run on Android, IOS, linux and Windows etc. It is basically used to develop the Android application, but it doe... |
Python OpenCV – Pose Estimation | 18 Jul, 2021
Pose estimation is a computer vision technique that is used to predict the configuration of the body(POSE) from an image. The reason for its importance is the abundance of applications that can benefit from technology.
Human pose estimation localizes body key points to accurately recognize the postures of... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Jul, 2021"
},
{
"code": null,
"e": 274,
"s": 54,
"text": "Pose estimation is a computer vision technique that is used to predict the configuration of the body(POSE) from an image. The reason for its importance is the abundance of ap... |
What is currying function in JavaScript ? | 29 Sep, 2021
It is a technique in functional programming, transformation of the function of multiple arguments into several functions of a single argument in sequence. The translation of function happens something like this,
function simpleFunction(param1, param2, param3, .....) => function curriedFunction(param1)(para... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Sep, 2021"
},
{
"code": null,
"e": 266,
"s": 54,
"text": "It is a technique in functional programming, transformation of the function of multiple arguments into several functions of a single argument in sequence. The translation of ... |
sqrt() function for complex number in C++ | 30 Oct, 2020
The complex version of sqrt() function is defined in the complex header file. This function is used to calculate the square root of the complex number z with a branch cut along the negative real axis.
Syntax:
template <class T> complex<T>
sqrt(const complex<T>& z);
Parameters: This method takes a m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Oct, 2020"
},
{
"code": null,
"e": 229,
"s": 28,
"text": "The complex version of sqrt() function is defined in the complex header file. This function is used to calculate the square root of the complex number z with a branch cut alon... |
ML | OPTICS Clustering Explanation | 14 Jul, 2019
Prerequisites: DBSCAN Clustering
OPTICS Clustering stands for Ordering Points To Identify Cluster Structure. It draws inspiration from the DBSCAN clustering algorithm. It adds two more terms to the concepts of DBSCAN clustering. They are:-
Core Distance: It is the minimum value of radius required to classi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Jul, 2019"
},
{
"code": null,
"e": 85,
"s": 52,
"text": "Prerequisites: DBSCAN Clustering"
},
{
"code": null,
"e": 292,
"s": 85,
"text": "OPTICS Clustering stands for Ordering Points To Identify Cluster Structure... |
Writing to Excel Sheet Using EPPlus in C# | 14 Feb, 2020
EPPlus is a very helpful open-source 3rd party DLL for writing data to excel. EPPlus supports multiple properties of spreadsheets like cell ranges, cell styling, charts, pictures, shapes, comments, tables, protection, encryption, pivot tables, data validation, conditional formatting, formula calculation, e... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Feb, 2020"
},
{
"code": null,
"e": 339,
"s": 28,
"text": "EPPlus is a very helpful open-source 3rd party DLL for writing data to excel. EPPlus supports multiple properties of spreadsheets like cell ranges, cell styling, charts, pictu... |
Test Bed | The test execution environment configured for testing. Test bed consists of specific hardware, software, Operating system, network configuration, the product under test, other system software and application software.
It is the combination of hardware and software environment on which the tests will be executed. It inc... | [
{
"code": null,
"e": 6097,
"s": 5879,
"text": "The test execution environment configured for testing. Test bed consists of specific hardware, software, Operating system, network configuration, the product under test, other system software and application software."
},
{
"code": null,
"e"... |
DBMS - Data Recovery | DBMS is a highly complex system with hundreds of transactions being executed every second. The durability and robustness of a DBMS depends on its complex architecture and its underlying hardware and system software. If it fails or crashes amid transactions, it is expected that the system would follow some sort of algor... | [
{
"code": null,
"e": 2777,
"s": 2416,
"text": "DBMS is a highly complex system with hundreds of transactions being executed every second. The durability and robustness of a DBMS depends on its complex architecture and its underlying hardware and system software. If it fails or crashes amid transacti... |
JavaScript | Reflect.apply() Method | 29 Sep, 2021
The Reflect.apply() method is a standard build-in object in JavaScript which is used to call a function using the specified argument. It works similar to the Function.prototype.apply() method to call a function, but in a efficient manner and easy to understand.Syntax:
Reflect.apply(target, thisArgument, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Sep, 2021"
},
{
"code": null,
"e": 299,
"s": 28,
"text": "The Reflect.apply() method is a standard build-in object in JavaScript which is used to call a function using the specified argument. It works similar to the Function.prototyp... |
How I can replace a JavaScript alert pop up with a fancy alert box? | To design a custom JavaScript alert box, try to run the following code. The code uses a JavaScript library jQuery and CSS to create a fancy alert box different from the standard JavaScript alert box −
Live Demo
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery... | [
{
"code": null,
"e": 1263,
"s": 1062,
"text": "To design a custom JavaScript alert box, try to run the following code. The code uses a JavaScript library jQuery and CSS to create a fancy alert box different from the standard JavaScript alert box −"
},
{
"code": null,
"e": 1273,
"s": ... |
Which is faster, a MySQL CASE statement or a PHP if statement? | The MySQL CASE statement is faster in comparison to PHP if statement. The PHP if statement takes too much time because it loads data and then process while CASE statement does not.
Let us first create a table and work around an example of MySQL CASE statement −
mysql> create table DemoTable (Value int);
Query OK, 0 row... | [
{
"code": null,
"e": 1243,
"s": 1062,
"text": "The MySQL CASE statement is faster in comparison to PHP if statement. The PHP if statement takes too much time because it loads data and then process while CASE statement does not."
},
{
"code": null,
"e": 1324,
"s": 1243,
"text": "L... |
Explain Compile time and Run time initialization in C programming? | Let’s take the concept of arrays to about compile time and run time initialization −
Array is a collection of items stored at contiguous memory locations and elements can access by using indices.
In compile time initialization, user has to enter the details in the program itself.
Compile time initialization is same as ... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "Let’s take the concept of arrays to about compile time and run time initialization −"
},
{
"code": null,
"e": 1258,
"s": 1147,
"text": "Array is a collection of items stored at contiguous memory locations and elements can access by u... |
How to Convert Char to String in Java? - GeeksforGeeks | 02 Mar, 2022
If we have a char value like ‘G’ and we want to convert it into an equivalent String like “G” then we can do this by using any of the following four listed methods in Java:
Illustration:
Input : 'G'
Output : "G"
Methods:
There are various methods by which we can convert the required character to string wi... | [
{
"code": null,
"e": 23893,
"s": 23865,
"text": "\n02 Mar, 2022"
},
{
"code": null,
"e": 24066,
"s": 23893,
"text": "If we have a char value like ‘G’ and we want to convert it into an equivalent String like “G” then we can do this by using any of the following four listed methods... |
Add new header files in Arduino IDE | Sometimes, you may feel the need to define your own custom header files, for organizing your code better. Say you want to create a global_variables.h file for storing all your global variables.
You can create the file within Arduino IDE by clicking on the bottom arrow at the top right of the screen, and selecting 'New ... | [
{
"code": null,
"e": 1256,
"s": 1062,
"text": "Sometimes, you may feel the need to define your own custom header files, for organizing your code better. Say you want to create a global_variables.h file for storing all your global variables."
},
{
"code": null,
"e": 1449,
"s": 1256,
... |
Longest Even Length Substring | Practice | GeeksforGeeks | For given string ‘str’ of digits, find length of the longest substring of ‘str’, such that the length of the substring is 2k digits and sum of left k digits is equal to the sum of right k digits.
Input:
The first line of input contains an integer T denoting the number of test cases. The description of T test cases fo... | [
{
"code": null,
"e": 436,
"s": 238,
"text": "For given string ‘str’ of digits, find length of the longest substring of ‘str’, such that the length of the substring is 2k digits and sum of left k digits is equal to the sum of right k digits.\n "
},
{
"code": null,
"e": 443,
"s": 436,
... |
How to make a Tkinter window jump to the front? | In order to make the tkinter window or the root window jump above all the other windows, we can use attributes method that will generally take two values specifying the “topmost” value and the other is a Boolean value.
#Importing the library
from tkinter import *
#Create an instance of tkinter window or frame
win= Tk(... | [
{
"code": null,
"e": 1281,
"s": 1062,
"text": "In order to make the tkinter window or the root window jump above all the other windows, we can use attributes method that will generally take two values specifying the “topmost” value and the other is a Boolean value."
},
{
"code": null,
"e... |
Use of explicit keyword in C++
| Here we will see what will be the effect of explicit keyword in C++. Before discussing that, let us see one example code, and try to find out its output.
#include <iostream>
using namespace std;
class Point {
private:
double x, y;
public:
Point(double a = 0.0, double b = 0.0) : x(a), y(b) {
/... | [
{
"code": null,
"e": 1216,
"s": 1062,
"text": "Here we will see what will be the effect of explicit keyword in C++. Before discussing that, let us see one example code, and try to find out its output."
},
{
"code": null,
"e": 1662,
"s": 1216,
"text": "#include <iostream>\nusing n... |
Program to reverse words in a given string in C++ | 11 Jul, 2022
Given a sentence in the form of string str, the task is to reverse each word of the given sentence in C++. Examples:
Input: str = “the sky is blue” Output: blue is sky theInput: str = “I love programming” Output: programming love I
Method 1: Using STL functions
Reverse the given string str using ST... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Jul, 2022"
},
{
"code": null,
"e": 173,
"s": 54,
"text": "Given a sentence in the form of string str, the task is to reverse each word of the given sentence in C++. Examples: "
},
{
"code": null,
"e": 290,
"s": 173,... |
Introduction To PYTHON | 07 Jul, 2022
Python is a widely used general-purpose, high level programming language. It was created by Guido van Rossum in 1991 and further developed by the Python Software Foundation. It was designed with an emphasis on code readability, and its syntax allows programmers to express their concepts in fewer lines of c... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 365,
"s": 53,
"text": "Python is a widely used general-purpose, high level programming language. It was created by Guido van Rossum in 1991 and further developed by the Python Software Foundation. ... |
Find the minimum dominating set of a Binary tree | 09 Oct, 2021
Given a binary tree with N nodes numbered [1, N], the task is to find the size of the smallest Dominating set of that tree.
A set of nodes is said to be a dominating node if every node in the binary tree not present in the set is an immediate child/parent to any node in that set.
Examples:
Input:
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Oct, 2021"
},
{
"code": null,
"e": 176,
"s": 52,
"text": "Given a binary tree with N nodes numbered [1, N], the task is to find the size of the smallest Dominating set of that tree."
},
{
"code": null,
"e": 333,
"s":... |
Early Design Model : COCOMO-II | 28 Sep, 2020
It is used at the Stage – II in COCOMO -II models and supports estimation in early design stage of project. Base equation used in COCOMO – II models is as follows –
PMnominal = A * (size)B
where PMnominal = Effort for the project in person months
A = constant representing the nominal productivity where A ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Sep, 2020"
},
{
"code": null,
"e": 193,
"s": 28,
"text": "It is used at the Stage – II in COCOMO -II models and supports estimation in early design stage of project. Base equation used in COCOMO – II models is as follows –"
},
{
... |
Java Program to Access All Data as Object Array | 09 Apr, 2022
Java is an object-oriented programming language. Most of the work is done with the help of objects. We know that an array is a collection of the same data type that dynamically creates objects and can have elements of primitive types.
Java allows us to store objects in an array. In Java, the class is also ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Apr, 2022"
},
{
"code": null,
"e": 288,
"s": 53,
"text": "Java is an object-oriented programming language. Most of the work is done with the help of objects. We know that an array is a collection of the same data type that dynamical... |
ML | V-Measure for Evaluating Clustering Performance | 28 Nov, 2019
One of the primary disadvantages of any clustering technique is that it is difficult to evaluate its performance. To tackle this problem, the metric of V-Measure was developed.
The calculation of the V-Measure first requires the calculation of two terms:-
Homogenity: A perfectly homogeneous clustering is o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Nov, 2019"
},
{
"code": null,
"e": 205,
"s": 28,
"text": "One of the primary disadvantages of any clustering technique is that it is difficult to evaluate its performance. To tackle this problem, the metric of V-Measure was developed... |
R – Variables | 23 May, 2022
A variable is a memory allocated for the storage of specific data and the name associated with the variable is used to work around this reserved block. The name given to a variable is known as its variable name. Usually a single variable stores only the data belonging to a certain data type. The name is so... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 May, 2022"
},
{
"code": null,
"e": 446,
"s": 28,
"text": "A variable is a memory allocated for the storage of specific data and the name associated with the variable is used to work around this reserved block. The name given to a var... |
vector data() function in C++ STL | 09 Jun, 2022
The std::vector::data() is an STL in C++ which returns a direct pointer to the memory array used internally by the vector to store its owned elements.
Syntax:
vector_name.data()
Parameters: The function does not accept any parameters.Return value: The function returns a pointer to the first element in th... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n09 Jun, 2022"
},
{
"code": null,
"e": 205,
"s": 53,
"text": "The std::vector::data() is an STL in C++ which returns a direct pointer to the memory array used internally by the vector to store its owned elements. "
},
{
"code": ... |
Java Program to Check Whether a Matrix is Symmetric or Not | 03 Nov, 2021
A symmetric matrix is a square matrix in which the transpose of the square matrix is the same as the original square matrix. A square matrix is a matrix in which the number of columns is the same as the number of rows. If the matrix is a symmetric matrix then it is also a square matrix but vice versa isn’t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Nov, 2021"
},
{
"code": null,
"e": 509,
"s": 28,
"text": "A symmetric matrix is a square matrix in which the transpose of the square matrix is the same as the original square matrix. A square matrix is a matrix in which the number of... |
IntStream mapToLong() in Java - GeeksforGeeks | 06 Dec, 2018
IntStream mapToLong() returns a LongStream consisting of the results of applying the given function to the elements of this stream.
Note : IntStream mapToLong() is a intermediate operation. These operations are always lazy. Intermediate operations are invoked on a Stream instance and after they finish thei... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 25357,
"s": 25225,
"text": "IntStream mapToLong() returns a LongStream consisting of the results of applying the given function to the elements of this stream."
},
{
"code": null,
... |
Python NLTK | nltk.WhitespaceTokenizer - GeeksforGeeks | 07 Jun, 2019
With the help of nltk.tokenize.WhitespaceTokenizer() method, we are able to extract the tokens from string of words or sentences without whitespaces, new line and tabs by using tokenize.WhitespaceTokenizer() method.
Syntax : tokenize.WhitespaceTokenizer()Return : Return the tokens from a string
Example #1 ... | [
{
"code": null,
"e": 25707,
"s": 25679,
"text": "\n07 Jun, 2019"
},
{
"code": null,
"e": 25923,
"s": 25707,
"text": "With the help of nltk.tokenize.WhitespaceTokenizer() method, we are able to extract the tokens from string of words or sentences without whitespaces, new line and ... |
What is the difference between field, variable, attribute, and property in Java - GeeksforGeeks | 28 Mar, 2022
Variable A variable is the name given to a memory location. It is the basic unit of storage in a program. The value stored in a variable can be changed during program execution. Each variable has a type, such as int, double or Object, and a scope. Class variable may be instance variable, local variable or ... | [
{
"code": null,
"e": 25251,
"s": 25223,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 25819,
"s": 25251,
"text": "Variable A variable is the name given to a memory location. It is the basic unit of storage in a program. The value stored in a variable can be changed during prog... |
How to Install Ruby on Termux? - GeeksforGeeks | 11 Apr, 2022
Ruby is an open-source programming language. It can be installed in any operating system. It is an interpreted, high-level object-oriented programming language. It was first implemented in the mid-1990s in Japan. It was developed & designed by Yukihiro “Martz” Matsumoto. The developer wants a programming l... | [
{
"code": null,
"e": 26197,
"s": 26169,
"text": "\n11 Apr, 2022"
},
{
"code": null,
"e": 26592,
"s": 26197,
"text": "Ruby is an open-source programming language. It can be installed in any operating system. It is an interpreted, high-level object-oriented programming language. It... |
Python | Check for float string - GeeksforGeeks | 29 May, 2019
One of the most notable breakthrough that Python brought was that the interconversion between the datatypes was done in a very easy manner and hence making it quite powerful. String can be converted to integers easily, but converting a float value is still difficult task. Let’s discuss certain ways in whic... | [
{
"code": null,
"e": 26053,
"s": 26025,
"text": "\n29 May, 2019"
},
{
"code": null,
"e": 26424,
"s": 26053,
"text": "One of the most notable breakthrough that Python brought was that the interconversion between the datatypes was done in a very easy manner and hence making it quit... |
Maximize sum of values in total K steps starting at position M - GeeksforGeeks | 17 Jan, 2022
Given a sorted array arr[] containing N pairs [A, B], wherer A is the position in X axis and B is the value on that position. All the positions are distinct. The array is sorted in increasing order of position. Given two integers M and K. The task is to maximize the sum of values that can be visited starti... | [
{
"code": null,
"e": 27509,
"s": 27481,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 27871,
"s": 27509,
"text": "Given a sorted array arr[] containing N pairs [A, B], wherer A is the position in X axis and B is the value on that position. All the positions are distinct. The a... |
Python program to count the number of spaces in string - GeeksforGeeks | 12 Jul, 2021
Given a string, the task is to write a Python program to count the number of spaces in the string.
Examples:
Input: "my name is geeks for geeks"
Output: number of spaces = 5
Input: "geeksforgeeks"
Output: number of spaces=0
Approach:
Input string from the user
Initialize count variable with zero
Run a for... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n12 Jul, 2021"
},
{
"code": null,
"e": 25636,
"s": 25537,
"text": "Given a string, the task is to write a Python program to count the number of spaces in the string."
},
{
"code": null,
"e": 25646,
"s": 25636,
... |
PHP | Check if all characters are lower case - GeeksforGeeks | 30 Sep, 2021
Given a string, check if all characters of it are in lowercase.Examples:
Input : gfg123
Output : No
Explanation : There are characters
'1', '2' and '3' that are not lower-
case
Input : geeksforgeeks
Output : Yes
Explanation : The string "geeksforgeeks"
consists of all lowercase letters.
The above p... | [
{
"code": null,
"e": 26241,
"s": 26213,
"text": "\n30 Sep, 2021"
},
{
"code": null,
"e": 26316,
"s": 26241,
"text": "Given a string, check if all characters of it are in lowercase.Examples: "
},
{
"code": null,
"e": 26535,
"s": 26316,
"text": "Input : gfg123... |
numpy.ndarray.byteswap() in Python - GeeksforGeeks | 28 Nov, 2018
numpy.ndarray.byteswap() function toggle between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place.
Syntax: ndarray.byteswap(inplace=False)
Parameters:inplace : [bool, optional] If True, swap bytes in-place, default is False.
Returns:out : [ndarray]... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n28 Nov, 2018"
},
{
"code": null,
"e": 25695,
"s": 25537,
"text": "numpy.ndarray.byteswap() function toggle between low-endian and big-endian data representation by returning a byteswapped array, optionally swapped in-place."
},... |
How to save an image to localStorage and display it on the next page? - GeeksforGeeks | 14 Dec, 2020
What is localStorage?
The localStorage is a Web API available to all modern web browsers by default. It allows websites to store a minimal amount of data in the browser which can be used in future browser sessions. localStorage is similar to sessionStorage except that the localStorage does not have an expi... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n14 Dec, 2020"
},
{
"code": null,
"e": 26567,
"s": 26545,
"text": "What is localStorage?"
},
{
"code": null,
"e": 26865,
"s": 26567,
"text": "The localStorage is a Web API available to all modern web browsers b... |
How to Prevent the Addition of Duplicate Elements to the Java ArrayList? - GeeksforGeeks | 11 Dec, 2020
Ever wondered how you can make an ArrayList unique? Well, in this article we’ll be seeing how to prevent the addition of duplicates into our ArrayList. If an ArrayList have three duplicate elements, but at the end, only the ones which are unique are taken into the ArrayList and the repetitions are neglecte... | [
{
"code": null,
"e": 25237,
"s": 25209,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 25603,
"s": 25237,
"text": "Ever wondered how you can make an ArrayList unique? Well, in this article we’ll be seeing how to prevent the addition of duplicates into our ArrayList. If an Array... |
Error Classes in Node.js - GeeksforGeeks | 21 Aug, 2020
Node.js inherits the JavaScript and system errors from the JavaScript <Error> class and it guarantees to provide the properties which are available on that class. The JavaScript exceptions that immediately throws errors using the throw mechanism that are handled by try...catch construct that is provided by... | [
{
"code": null,
"e": 26109,
"s": 26081,
"text": "\n21 Aug, 2020"
},
{
"code": null,
"e": 26433,
"s": 26109,
"text": "Node.js inherits the JavaScript and system errors from the JavaScript <Error> class and it guarantees to provide the properties which are available on that class. ... |
MathF.Floor() Method in C# with Examples - GeeksforGeeks | 04 Apr, 2019
In C#, MathF.Floor(Single) is a MathF class method. This method is used to find the largest integer , which is less than or equal to the specified float value in the argument list.
Syntax: public static float Floor (float x);Here, x is the float(Single) value whose floor value has to be calculated.
Return ... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n04 Apr, 2019"
},
{
"code": null,
"e": 24483,
"s": 24302,
"text": "In C#, MathF.Floor(Single) is a MathF class method. This method is used to find the largest integer , which is less than or equal to the specified float value in t... |
Pointer to an Array in C | It is most likely that you would not understand this section until you are through with the chapter 'Pointers'.
Assuming you have some understanding of pointers in C, let us start: An array name is a constant pointer to the first element of the array. Therefore, in the declaration −
double balance[50];
balance is a po... | [
{
"code": null,
"e": 2196,
"s": 2084,
"text": "It is most likely that you would not understand this section until you are through with the chapter 'Pointers'."
},
{
"code": null,
"e": 2368,
"s": 2196,
"text": "Assuming you have some understanding of pointers in C, let us start: A... |
How to GROUP BY in a select query on positive or negative values? | Following is the syntax to GROUP BY in a select query on positive or negative values:
select *from yourTableName group by -yourColumnName;
Let us first create a table:
mysql> create table DemoTable (Value int);
Query OK, 0 rows affected (0.60 sec)
Following is the query to insert some records in the table using insert ... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "Following is the syntax to GROUP BY in a select query on positive or negative values:"
},
{
"code": null,
"e": 1201,
"s": 1148,
"text": "select *from yourTableName group by -yourColumnName;"
},
{
"code": null,
"e": 1230,
... |
Tryit Editor v3.7 | Tryit: HTML image - size attributes or style? | [] |
HTML DOM childElementCount Property | The HTML DOM childElementCount property is a read-only property that returns the number of child elements of a given element. The return type of the childElementCount is of unsigned long. It will only return the child element of the node on which it is queried and not all the child nodes of a HTML document.
Following i... | [
{
"code": null,
"e": 1371,
"s": 1062,
"text": "The HTML DOM childElementCount property is a read-only property that returns the number of child elements of a given element. The return type of the childElementCount is of unsigned long. It will only return the child element of the node on which it is ... |
Image Classification Using Pre-Trained Model | In this lesson, you will learn to use a pre-trained model to detect objects in a given image. You will use squeezenet pre-trained module that detects and classifies the objects in a given image with a great accuracy.
Open a new Juypter notebook and follow the steps to develop this image classification application.
Firs... | [
{
"code": null,
"e": 2008,
"s": 1791,
"text": "In this lesson, you will learn to use a pre-trained model to detect objects in a given image. You will use squeezenet pre-trained module that detects and classifies the objects in a given image with a great accuracy."
},
{
"code": null,
"e":... |
How to call a static constructor or when static constructor is called in C#? | Static constructor are called automatically before the first instance is created or any static members are referenced.
A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed once only.
In c#, only one static constructor is allowed to create
Static constr... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "Static constructor are called automatically before the first instance is created or any static members are referenced."
},
{
"code": null,
"e": 1313,
"s": 1181,
"text": "A static constructor is used to initialize any static data, or ... |
Print the alternate nodes of linked list (Iterative Method) - GeeksforGeeks | 14 Feb, 2020
Given a linked list, print the alternate nodes of linked list.
Examples:
Input : 1 -> 8 -> 3 -> 10 -> 17 -> 22 -> 29 -> 42
Output : 1 -> 3 -> 17 -> 29
Alternate nodes : 1 -> 3 -> 17 -> 29
Input : 10 -> 17 -> 33 -> 38 -> 73
Output : 10 -> 33 -> 73
Alternate nodes : 10 -> 33 -> 73
Approach :1. Traverse the... | [
{
"code": null,
"e": 25020,
"s": 24992,
"text": "\n14 Feb, 2020"
},
{
"code": null,
"e": 25083,
"s": 25020,
"text": "Given a linked list, print the alternate nodes of linked list."
},
{
"code": null,
"e": 25093,
"s": 25083,
"text": "Examples:"
},
{
"co... |
CSS border-style Property - GeeksforGeeks | 02 Nov, 2021
The border-style CSS property is a shorthand property that sets the line style for all four sides of an element’s border.
Note: The border-style property can take One to Four values at a time.
Syntax:
border-style: value;
Default Value
none
Property Values:
none: No border is created and it is left plain.... | [
{
"code": null,
"e": 24917,
"s": 24889,
"text": "\n02 Nov, 2021"
},
{
"code": null,
"e": 25039,
"s": 24917,
"text": "The border-style CSS property is a shorthand property that sets the line style for all four sides of an element’s border."
},
{
"code": null,
"e": 2511... |
GATE | GATE-CS-2015 (Set 2) | Question 65 - GeeksforGeeks | 28 Jun, 2021
Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes). Size of UDP header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How may total number of IP fragment... | [
{
"code": null,
"e": 25579,
"s": 25551,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 26054,
"s": 25579,
"text": "Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 byt... |
Text Styles in Android - GeeksforGeeks | 29 Jul, 2021
TextView displays the declared text in a standard way unless the developer specifies particular attributes to make the text appear better. These attributes can directly be declared into the TextView tags. However, in order to maintain a scalable and clean code, industrial practices suggest gathering togeth... | [
{
"code": null,
"e": 26491,
"s": 26463,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 27195,
"s": 26491,
"text": "TextView displays the declared text in a standard way unless the developer specifies particular attributes to make the text appear better. These attributes can dir... |
How to save a plot as SVG created with ggplot2 in R? | There are multiple ways to save a plot created in R. Base R provides, metafile, bitmap, and postscript options to copy and save the plots created in R but we can also save the plots created with ggplot2 as an SVG file with the help of svglite package. The ggsave function of svglite package does this job easily and we c... | [
{
"code": null,
"e": 1455,
"s": 1062,
"text": " There are multiple ways to save a plot created in R. Base R provides, metafile, bitmap, and postscript options to copy and save the plots created in R but we can also save the plots created with ggplot2 as an SVG file with the help of svglite package... |
Minimum edges required to add to make Euler Circuit | 28 Nov, 2021
Given a undirected graph of n nodes and m edges. The task is to find minimum edges required to make Euler Circuit in the given graph.
Examples:
Input : n = 3,
m = 2
Edges[] = {{1, 2}, {2, 3}}
Output : 1
By connecting 1 to 3, we can create a Euler Circuit.
For a Euler Circuit to exist in... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 186,
"s": 52,
"text": "Given a undirected graph of n nodes and m edges. The task is to find minimum edges required to make Euler Circuit in the given graph."
},
{
"code": null,
"e": 196... |
Find Nth root of M | Practice | GeeksforGeeks | You are given 2 numbers (n , m); the task is to find n√m (nth root of m).
Example 1:
Input: n = 2, m = 9
Output: 3
Explanation: 32 = 9
Example 2:
Input: n = 3, m = 9
Output: -1
Explanation: 3rd root of 9 is not
integer.
Your Task:
You don't need to read or print anyhting. Your task is to complete the function Nth... | [
{
"code": null,
"e": 314,
"s": 238,
"text": "You are given 2 numbers (n , m); the task is to find n√m (nth root of m).\n "
},
{
"code": null,
"e": 325,
"s": 314,
"text": "Example 1:"
},
{
"code": null,
"e": 376,
"s": 325,
"text": "Input: n = 2, m = 9\nOutput: ... |
MoviePy Composite Video – Adding Cross Fade in Effect | 21 May, 2021
In this article we will see how we can add cross fade in effect in composite video file in MoviePy. MoviePy is a Python module for video editing, which can be used for basic operations on videos and GIF’s. Meaning of composite is combining different elements, composite video is the combination of different... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 822,
"s": 28,
"text": "In this article we will see how we can add cross fade in effect in composite video file in MoviePy. MoviePy is a Python module for video editing, which can be used for basic o... |
Python | Plotting bar charts in excel sheet using XlsxWriter module | 19 May, 2021
Prerequisite: Create and Write on an excel file.XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmetic operations and plotting graphs. Let’s see how to plot different type of Bar charts using realtime data. Charts are composed of at ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 865,
"s": 28,
"text": "Prerequisite: Create and Write on an excel file.XlsxWriter is a Python library using which one can perform multiple operations on excel files like creating, writing, arithmeti... |
How to resolve unhandled exceptions in Node.js ? | 20 May, 2020
There are two approaches to resolve unhandled exceptions in Node.js that are discussed below:
Approach 1: Using try-catch block: We know that Node.js is a platform built on JavaScript runtime for easily building fast and scalable network applications. Being part of JavaScript, we know that the most promine... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 May, 2020"
},
{
"code": null,
"e": 122,
"s": 28,
"text": "There are two approaches to resolve unhandled exceptions in Node.js that are discussed below:"
},
{
"code": null,
"e": 402,
"s": 122,
"text": "Approach 1: ... |
Text Generation using Recurrent Long Short Term Memory Network | 25 Jun, 2021
This article will demonstrate how to build a Text Generator by building a Recurrent Long Short Term Memory Network. The conceptual procedure of training the network is to first feed the network a mapping of each character present in the text on which the network is training to a unique number. Each charact... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Jun, 2021"
},
{
"code": null,
"e": 988,
"s": 54,
"text": "This article will demonstrate how to build a Text Generator by building a Recurrent Long Short Term Memory Network. The conceptual procedure of training the network is to fir... |
GATE | GATE CS 2010 | Question 33 | 19 Nov, 2018
A 5-stage pipelined processor has Instruction Fetch(IF),Instruction Decode(ID),Operand Fetch(OF),Perform Operation(PO)and Write Operand(WO)stages.The IF,ID,OF and WO stages take 1 clock cycle each for any instruction.The PO stage takes 1 clock cycle for ADD and SUB instructions,3 clock cycles for MUL instr... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n19 Nov, 2018"
},
{
"code": null,
"e": 556,
"s": 54,
"text": "A 5-stage pipelined processor has Instruction Fetch(IF),Instruction Decode(ID),Operand Fetch(OF),Perform Operation(PO)and Write Operand(WO)stages.The IF,ID,OF and WO stages t... |
8085 program to exchange content of HL register pair with DE register pair | In this program we will see how to exchange the content of DE and HL pair.
Write 8085 Assembly language program to swap the content of HL and DE register pair.
This process is very simple, 8085 has XCHG instruction. This instruction swaps DE and HL pair content. We are storing some values to DE and HL pair directly, an... | [
{
"code": null,
"e": 1137,
"s": 1062,
"text": "In this program we will see how to exchange the content of DE and HL pair."
},
{
"code": null,
"e": 1222,
"s": 1137,
"text": "Write 8085 Assembly language program to swap the content of HL and DE register pair."
},
{
"code": ... |
C# | Types of Variables - GeeksforGeeks | 11 Jun, 2021
A variable is a name given to a memory location and all the operations done on the variable effects that memory location. In C#, all the variables must be declared before they can be used. It is the basic unit of storage in a program. The value stored in a variable can be changed during program execution. ... | [
{
"code": null,
"e": 24056,
"s": 24028,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 24364,
"s": 24056,
"text": "A variable is a name given to a memory location and all the operations done on the variable effects that memory location. In C#, all the variables must be declared... |
Java switch statement with multiple cases. | Following is the required program.
Live Demo
public class Test {
public static void main(String args[]) {
// char grade = args[0].charAt(0); char grade = 'C'; switch(grade) {
case 'A' : System.out.println("Excellent!"); break;
case 'B' :
case 'C' : System.out.println("Well done");
... | [
{
"code": null,
"e": 1097,
"s": 1062,
"text": "Following is the required program."
},
{
"code": null,
"e": 1107,
"s": 1097,
"text": "Live Demo"
},
{
"code": null,
"e": 1649,
"s": 1107,
"text": "public class Test {\n public static void main(String args[]) {\n... |
How to center align text in table cells in HTML? | To center align text in table cells, use the CSS property text-align. The <table> tag align attribute was used before, but HTML5 deprecated the attribute. Do not use it. So, use CSS to align text in table cells. The text-align will be used for the <td> tag.
We’re using the style attribute for adding CSS. The style attr... | [
{
"code": null,
"e": 1320,
"s": 1062,
"text": "To center align text in table cells, use the CSS property text-align. The <table> tag align attribute was used before, but HTML5 deprecated the attribute. Do not use it. So, use CSS to align text in table cells. The text-align will be used for the <td> ... |
Insertion Sort in Python Program | In this article, we will learn about the implementation of Insertion sort in Python 3.x. Or earlier.
Iterate over the input elements by growing the sorted array at each iteration.
Iterate over the input elements by growing the sorted array at each iteration.
Compare the current element with the largest value available ... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "In this article, we will learn about the implementation of Insertion sort in Python 3.x. Or earlier."
},
{
"code": null,
"e": 1242,
"s": 1163,
"text": "Iterate over the input elements by growing the sorted array at each iteration."
... |
How and why to avoid global variables in JavaScript? | Avoid global variables or minimize the usage of global variables in JavaScript. This is because global variables are easily overwritten by other scripts. Global Variables are not bad and not even a security concern, but it shouldn’t overwrite values of another variable.
On the usage of more global variables in our code... | [
{
"code": null,
"e": 1333,
"s": 1062,
"text": "Avoid global variables or minimize the usage of global variables in JavaScript. This is because global variables are easily overwritten by other scripts. Global Variables are not bad and not even a security concern, but it shouldn’t overwrite values of ... |
How to access the fields of an interface in Java? | An interface in Java is a specification of method prototypes. Whenever you need to guide the programmer or, make a contract specifying how the methods and fields of a type should be you can define an interface. By default,
All the members (methods and fields) of an interface are public.
All the members (methods and fie... | [
{
"code": null,
"e": 1285,
"s": 1062,
"text": "An interface in Java is a specification of method prototypes. Whenever you need to guide the programmer or, make a contract specifying how the methods and fields of a type should be you can define an interface. By default,"
},
{
"code": null,
... |
C++ Program to Find a triplet such that sum of two equals to third element - GeeksforGeeks | 11 Jan, 2022
Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.Examples:
Input: {5, 32, 1, 7, 10, 50, 19, 21, 2}
Output: 21, 2, 19
Input: {5, 32, 1, 7, 10, 50, 19, 21, 0}
Output: no such triplet exist
Question source: Arcesium Interview Experience | S... | [
{
"code": null,
"e": 24387,
"s": 24359,
"text": "\n11 Jan, 2022"
},
{
"code": null,
"e": 24515,
"s": 24387,
"text": "Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.Examples:"
},
{
"code": null,
"e"... |
C - Structures | Arrays allow to define type of variables that can hold several data items of the same kind. Similarly structure is another user defined data type available in C that allows to combine data items of different kinds.
Structures are used to represent a record. Suppose you want to keep track of your books in a library. You... | [
{
"code": null,
"e": 2299,
"s": 2084,
"text": "Arrays allow to define type of variables that can hold several data items of the same kind. Similarly structure is another user defined data type available in C that allows to combine data items of different kinds."
},
{
"code": null,
"e": 2... |
Boosting your Sequence Generation Performance with ‘Beam-search + Language model’ decoding | by Kartik Chaudhary | Towards Data Science | Whenever Image Processing, Audio data Analysis or Natural language processing (NLP) tasks are concerned, Deep learning has proved to be an ideal choice and has shown outstanding outcomes. Neural Network-based model architectures are really good at understanding complex patterns as well as generating meaningful and real... | [
{
"code": null,
"e": 676,
"s": 172,
"text": "Whenever Image Processing, Audio data Analysis or Natural language processing (NLP) tasks are concerned, Deep learning has proved to be an ideal choice and has shown outstanding outcomes. Neural Network-based model architectures are really good at underst... |
Create a Crypto Currency Price Tracking Chrome Extension - GeeksforGeeks | 28 Mar, 2021
Building a Chrome extension requires you to have a knowledge of HTML, CSS, JavaScript, and Bootstrap. In this article, we will be making an extension that tracks the prices of various cryptocurrencies. For fetching the data regarding the prices of cryptocurrencies, we will be using an API known as CryptoCo... | [
{
"code": null,
"e": 25205,
"s": 25177,
"text": "\n28 Mar, 2021"
},
{
"code": null,
"e": 25520,
"s": 25205,
"text": "Building a Chrome extension requires you to have a knowledge of HTML, CSS, JavaScript, and Bootstrap. In this article, we will be making an extension that tracks t... |
Set user variable from result of query in MySQL? | To set user variable from result of query in MySQL, you need to move that variable into the assignment.
To understand the above concept, let us first create a table. The query to create a table is as follows −
mysql> create table UserVariable
-> (
-> Id int,
-> Name varchar(100)
-> );
Query OK, 0 rows affec... | [
{
"code": null,
"e": 1166,
"s": 1062,
"text": "To set user variable from result of query in MySQL, you need to move that variable into the assignment."
},
{
"code": null,
"e": 1272,
"s": 1166,
"text": "To understand the above concept, let us first create a table. The query to cre... |
Bootstrap class pull-right | Float an element to the right with class pull-right.
You can try to run the following code to implement the pull-right class
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
<script src = "/scripts/jquery.mi... | [
{
"code": null,
"e": 1115,
"s": 1062,
"text": "Float an element to the right with class pull-right."
},
{
"code": null,
"e": 1187,
"s": 1115,
"text": "You can try to run the following code to implement the pull-right class"
},
{
"code": null,
"e": 1197,
"s": 1187,... |
Jackson Annotations - @JsonIgnore | @JsonIgnore is used at field level to mark a property or list of properties to be ignored.
import java.io.IOException;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JacksonTester {
public static void main(String args[]){
ObjectMapper mappe... | [
{
"code": null,
"e": 2566,
"s": 2475,
"text": "@JsonIgnore is used at field level to mark a property or list of properties to be ignored."
},
{
"code": null,
"e": 3446,
"s": 2566,
"text": "import java.io.IOException;\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport co... |
Program to generate Pascal's triangle in Python | Suppose we have a number n. We have to generate Pascal's triangle up to n lines. The Pascal's triangle will be look like this −
The property of Pascal's triangle is the sum of each adjacent two numbers of previous row is the value of the number which is placed just below on the second row. For example, the first 10 at ... | [
{
"code": null,
"e": 1190,
"s": 1062,
"text": "Suppose we have a number n. We have to generate Pascal's triangle up to n lines. The Pascal's triangle will be look like this −"
},
{
"code": null,
"e": 1469,
"s": 1190,
"text": "The property of Pascal's triangle is the sum of each a... |
Accelerate Geospatial Data Science With These Tricks | by Abdishakur | Towards Data Science | In this era of big data, large datasets are ubiquitous rather than being the exception. Although you can use some other accelerating techniques in data science, Geographic data science have special techniques to boost up your geodata processing. In this article, I share some of my favourite tips and tricks to accelerat... | [
{
"code": null,
"e": 532,
"s": 172,
"text": "In this era of big data, large datasets are ubiquitous rather than being the exception. Although you can use some other accelerating techniques in data science, Geographic data science have special techniques to boost up your geodata processing. In this a... |
How to remove Specific Element from a Swift Array? | To remove a specific object from an element in swift, we can use multiple ways of doing it. Let’s see this in the playground with help of an example.
First, let’s create an array of String.
var arrayOfString = ["a","b","c","f"]
We’ll do it with the following methods as shown below:
Arrays in swift have a filter method,... | [
{
"code": null,
"e": 1212,
"s": 1062,
"text": "To remove a specific object from an element in swift, we can use multiple ways of doing it. Let’s see this in the playground with help of an example."
},
{
"code": null,
"e": 1252,
"s": 1212,
"text": "First, let’s create an array of ... |
TestNG - Writing Tests | Writing a test in TestNG basically involves the following steps −
Write the business logic of your test and insert TestNG annotations in your code.
Write the business logic of your test and insert TestNG annotations in your code.
Add the information about your test (e.g. the class name, the groups you wish to run, etc.... | [
{
"code": null,
"e": 2126,
"s": 2060,
"text": "Writing a test in TestNG basically involves the following steps −"
},
{
"code": null,
"e": 2208,
"s": 2126,
"text": "Write the business logic of your test and insert TestNG annotations in your code."
},
{
"code": null,
"e... |
Sort an arrays of 0’s, 1’s and 2’s using C++ | Given an array of 0, 1, and 2, sort the elements in an order such that all the zeros come first before 1 and all the 2’s in the end. We have to sort all the elements of the array in-place.
We can solve this problem using DNF (Dutch National Flag) Sorting Algorithm. For example,
Input-1 −
arr[ ]= {2,0,0,1,2,1 }
Output −... | [
{
"code": null,
"e": 1251,
"s": 1062,
"text": "Given an array of 0, 1, and 2, sort the elements in an order such that all the zeros come first before 1 and all the 2’s in the end. We have to sort all the elements of the array in-place."
},
{
"code": null,
"e": 1341,
"s": 1251,
"t... |
Java Program to create rounded borders in Swing | Let us first create a Frame:
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setUndecorated(true);
Now, create rounded borders:
double x = 50;
double y = 50;
frame.setShape(new RoundRectangle2D.Double(x, y, 100, 100, 50, 50));
The following is an example to create rounded borde... | [
{
"code": null,
"e": 1091,
"s": 1062,
"text": "Let us first create a Frame:"
},
{
"code": null,
"e": 1202,
"s": 1091,
"text": "JFrame frame = new JFrame();\nframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\nframe.setUndecorated(true);"
},
{
"code": null,
"e": 123... |
Program to print number pattern in C | A numerical pattern is a sequence of numbers that have been created based on a rule called a pattern rule. Pattern rules can use one or more mathematical operations to describe the relationship between consecutive numbers in the sequence.
Examples for Patterns
Pattern 1
1
2 6
3 7 10
4 8 11 13
5 9 12 14 15
Pattern 2
... | [
{
"code": null,
"e": 1301,
"s": 1062,
"text": "A numerical pattern is a sequence of numbers that have been created based on a rule called a pattern rule. Pattern rules can use one or more mathematical operations to describe the relationship between consecutive numbers in the sequence."
},
{
... |
Insert Delete GetRandom O(1) in Python | Suppose we have a data structure that supports all following operations in average O(1) time.
insert(val) − This will Insert an item val to the set if that is not already present.
insert(val) − This will Insert an item val to the set if that is not already present.
remove(val) − This will remove an item val from the se... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "Suppose we have a data structure that supports all following operations in average O(1) time."
},
{
"code": null,
"e": 1242,
"s": 1156,
"text": "insert(val) − This will Insert an item val to the set if that is not already present."
... |
Pyspark — forecasting with Pandas UDF and fb-prophet | by Alexandre Wrg | Towards Data Science | Before starting anything to work with pandas-udf the prerequisite are
spark ≥ 2.4
pyarrow ≤ 0.14.1 (above this version there’s some issue)
then we need to set up an environment variable for pyarrow to 1. (see import code)
sudo pip3 install pyarrow=0.14.1
Then we can proceed to libraries import.
from pyspark.sql import ... | [
{
"code": null,
"e": 242,
"s": 172,
"text": "Before starting anything to work with pandas-udf the prerequisite are"
},
{
"code": null,
"e": 254,
"s": 242,
"text": "spark ≥ 2.4"
},
{
"code": null,
"e": 311,
"s": 254,
"text": "pyarrow ≤ 0.14.1 (above this versio... |
How to Supercharge Excel With Python | by Costas Andreou | Towards Data Science | As much as Excel is a blessing, it is also a curse. When it comes to smallish enough data and simple enough operations Excel is king. Once you find yourself endeavoring outside of those zones however, it becomes a pain. Sure enough, you can use Excel VBA to get around such issues, but in the year 2020, you can thank yo... | [
{
"code": null,
"e": 534,
"s": 172,
"text": "As much as Excel is a blessing, it is also a curse. When it comes to smallish enough data and simple enough operations Excel is king. Once you find yourself endeavoring outside of those zones however, it becomes a pain. Sure enough, you can use Excel VBA ... |
F# Azure Functions. Creating Azure Functions in F# | by Ian Ormesher | Towards Data Science | F# is a great language and is also a good choice for programming your Azure Functions. Unfortunately, Microsoft hasn’t made it easy to implement them. It’s certainly easier than it used to be, but there’s a bit of work to get things set up at the beginning. But I would argue it’s well worth the effort!
To start you’ll ... | [
{
"code": null,
"e": 476,
"s": 172,
"text": "F# is a great language and is also a good choice for programming your Azure Functions. Unfortunately, Microsoft hasn’t made it easy to implement them. It’s certainly easier than it used to be, but there’s a bit of work to get things set up at the beginnin... |
Pythonic Way to Perform Statistics Across Multiple Variables with Xarray | by Luke Gloege, Ph.D. | Towards Data Science | Consider this, you have an ensemble of models stored in a Dataset (ds), with each ensemble member stored as a different variable. How would you take the ensemble average? If you have three members (ens1, ens2, ens3), one approach is to do this:
ens_mean = (ds['ens1'] + ds['ens2'] + ds['ens3']) / 3
Although this is fine... | [
{
"code": null,
"e": 416,
"s": 171,
"text": "Consider this, you have an ensemble of models stored in a Dataset (ds), with each ensemble member stored as a different variable. How would you take the ensemble average? If you have three members (ens1, ens2, ens3), one approach is to do this:"
},
{
... |
How to plot magnitude spectrum in Matplotlib in Python? | To plot magintude spectrum, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Get random seed value.
Initialize dt for sampling interval and find the sampling frequency.
Create random data points for t.
To generate noise, get nse, r, cnse and s using numpy
Cre... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "To plot magintude spectrum, we can take the following steps −"
},
{
"code": null,
"e": 1200,
"s": 1124,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"code": null,
"e": 1223,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.