title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to check if a given character is a number/letter in Java? | The Character class is a subclass of Object class and it wraps a value of the primitive type char in an object. An object of type Character contains a single field whose type is char. We can check whether the given character in a string is a number/letter by using isDigit() method of Character class. The isDigit() meth... | [
{
"code": null,
"e": 1458,
"s": 1062,
"text": "The Character class is a subclass of Object class and it wraps a value of the primitive type char in an object. An object of type Character contains a single field whose type is char. We can check whether the given character in a string is a number/lett... |
JqueryUI - Effect | This chapter will discuss the effect() method, which is one of the methods used to manage jQueryUI visual effects. effect() method applies an animation effect to the elements without having to show or hide it.
The effect() method has the following syntax −
.effect( effect [, options ] [, duration ] [, complete ] )
effe... | [
{
"code": null,
"e": 2474,
"s": 2264,
"text": "This chapter will discuss the effect() method, which is one of the methods used to manage jQueryUI visual effects. effect() method applies an animation effect to the elements without having to show or hide it."
},
{
"code": null,
"e": 2521,
... |
Time-series Analysis with VAR & VECM: Statistical approach | by Sarit Maitra | Towards Data Science | ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nVECTOR auto-regressive (VAR) integrated model comprises multiple time series and is quite a useful tool for forecasting. It can be considered an extension of the auto-regressive (AR part of ARIMA) model. VAR model involves multiple independent variables and therefore has more than one equations. Each equation uses as its explanatory variables lags of all the variables and likely a deterministic trend. Time series models for VAR are usually based on applying VAR to stationary series with first differences to original series and because of that, there is always a possibility of loss of information about the relationship among integrated series.\nTherefore, differencing the series to make them stationary is one solution, but at the cost of ignoring possibly important (“long run”) relationships between the levels. A better solution is to test whether the levels regressions are trustworthy (“cointegration”.) The usual approach is to use Johansen’s method for testing whether or not cointegration exists. If the answer is “yes” then a vector error correction model (VECM), which combines levels and differences, can be estimated instead of a VAR in levels. So, we shall check if VECM is been able to outperform VAR for the series we have.\nThis an extension of my previously published article.\nAfter necessary cleaning & pre-processing (filling the missing values with previous ones), we finally have the three time series for necessary analysis.\nA quick test is to check if the data is random. Random data will not exhibit a structure in the lag plot.\nThe time series plot clearly indicates some kind of relationships among the series. The linear shape of the lag plot suggests that an AR model is a better choice. We also don’t see any outlier in the data. Data here showing linear pattern, indicating the presence of positive auto-correlation.\n“Time series for economic data is generally stochastic or has a trend that is not stationary, meaning that the data has a root unit”\n# plots the autocorrelation plots at 75 lagsfor i in dataset: plot_acf(dataset[i], lags = 50) plt.title(‘ACF for %s’ % i) plt.show()\ndef augmented_dickey_fuller_statistics(time_series): result = adfuller(time_series.values) print('ADF Statistic: %f' % result[0]) print('p-value: %f' % result[1]) print('Critical Values:')for key, value in result[4].items(): print('\\t%s: %.3f' % (key, value))\nThrough the above function, we can run Augmented Dickey Fuller (ADF) test on all columns, which clearly shows the original series are non-stationary and contain unit root.\nprint('Augmented Dickey-Fuller Test: Gold Price Time Series')augmented_dickey_fuller_statistics(X_train['Gold'])print('Augmented Dickey-Fuller Test: Silver Price Time Series')augmented_dickey_fuller_statistics(X_train['Silver'])print('Augmented Dickey-Fuller Test: Oil Price Time Series')augmented_dickey_fuller_statistics(X_train['Oil'])\nVAR models can also be used for analyzing the relation between the variables involved using Granger Causality tests. Granger causality specifies that a variable y1t is causal for a variable y2t if the information in y1t is helpful for improving the forecasts of y2t.\nGranger Causality tests try to determine if one variable(x1) can be used as a predictor of another variable(x2) where the past values of that another variable may or may not help. This means that x1 explains beyond the past values of x2. Two important assumptions here are -\nboth x1 and x2 are stationary\nthere exists a linear relation between their current and past values.\nThis means that if x1 and x2 are non-stationary, we have to make them stationary before testing for Granger Causality.\nWe will fit the VAR model on X_train to forecast the next 10 observations. These forecasts will be compared against the actuals present in test data (X_test). We shall use multiple forecast accuracy metrics.\nA difference transform is a simple way for removing a systematic structure from the time series. We will remove trend by subtracting the previous value from each value in the series which is the first order differencing. To keep it simple, we will do first order differencing or seasonal differencing.\nIf we have an integrated order to n time series and if we take first order to difference and time, we will be left with series integrated order of zero.\nX_train_log = np.log(X_train)X_train_log_diff =(X_train_log).diff().dropna()X_train_log_diff.describe()\nlooking at the plot, we could figure out that data set looks like normalized\nBelow function plots the auto-correlation plots for the difference in each stock’s price from the price the previous trading day at 75 lags.\nfig, ax = plt.subplots(1,2, figsize=(10,5)) ax[0] = plot_acf(X_train_log_diff['Gold'], ax=ax[0])ax[1] = plot_pacf(X_train_log_diff['Gold'], ax=ax[1])\nWe have shown ACF & PACF of transformed Gold series; likewise, other series can be plotted.\nprint('Augmented Dickey-Fuller Test: Gold Price Time Series')augmented_dickey_fuller_statistics(X_train_log_diff['Gold'])print('Augmented Dickey-Fuller Test: Silver Price Time Series')augmented_dickey_fuller_statistics(X_train_log_diff['Silver'])print('Augmented Dickey-Fuller Test: Oil Price Time Series')augmented_dickey_fuller_statistics(X_train_log_diff['Oil'])Augmented Dickey-Fuller Test on \"Oil\" \nThe Granger causality test is conducted to determine whether one time series is useful in forecasting another. A time series X is said to Granger-cause Y if it can be shown, usually through a series of t-tests and F-tests on lagged values of X (and with lagged values of Y also included), that those X values provide statistically significant information about future values of Y.\nHere, for multivariate Granger causality analysis performed by fitting a VAR to the time series. Considering below is a d-dimensional multivariate time series —\nGranger causality is performed by fitting a VAR model with L time lags as follows:\nwhere ε ( t ) is a white Gaussian random vector, and A τ is a matrix for every τ. A time series X i is called a Granger cause of another time series X j, if at least one of the elements A τ ( j , i ) for τ = 1 , ... , L is significantly larger than zero.\nprint(grangercausalitytests(X_train_log_diff[['Gold','Silver']], maxlag=15, addconst=True, verbose=True))print(grangercausalitytests(X_train_log_diff[['Gold','Oil']], maxlag=15, addconst=True, verbose=True))print(grangercausalitytests(X_train_log_diff[['Oil','Silver']], maxlag=15, addconst=True, verbose=True))\nBelow output shown for Gold & Oil which differs the test hypothesis till lag 4.\nA VAR(p) process in its basic form is:\nHere yt represents a set of variables collected in a vector, c denotes a vector of constants, a is a matrix of autoregressive coefficients and et is white noise. Since the parameters of a are unknown, we have to estimate these parameters. Each variable in the model has one equation. The current (time t) observation of each variable depends on its own lagged values as well as on the lagged values of each other variable in the VAR.\nI have implemented Akaike’s Information Criteria (AIC) through the VAR (p) to determine the lag order value. In the fit function, I have passed a maximum number of lags and the order criterion to use for order selection.\n#Initiate VAR modelmodel = VAR(endog=X_train_log_diff)res = model.select_order(15)res.summary()\n#Fit to a VAR modelmodel_fit = model.fit(maxlags=3)#Print a summary of the model resultsmodel_fit.summary()\nThe forecasts are generated on the training data used by the model.\n# Get the lag orderlag_order = model_fit.k_arprint(lag_order)# Input data for forecastinginput_data = X_train_log_diff.values[-lag_order:]print(input_data)# forecastingpred = model_fit.forecast(y=input_data, steps=nobs)pred = (pd.DataFrame(pred, index=X_test.index, columns=X_test.columns + '_pred'))print(pred)\nSo, to bring it back up to its original scale, we need to de-difference to the original input data. Our data is 1st logarithm transformed and then differenced. So, to inverse, we have to first use cumulative sum to de-differentiate and then use exponential. Natural logarithm is the inverse of the exp().\n# inverting transformationdef invert_transformation(X_train, pred_df): forecast = pred.copy() columns = X_train.columnsfor col in columns: forecast[str(col)+'_pred'] = X_train[col].iloc[-1] + forecast[str(col) +'_pred'].cumsum() return forecastoutput = invert_transformation(X_train, pred)print(output)output_original = np.exp(output)print(output_original)\n#Calculate forecast biasforecast_errors = [X_test['Oil'][i]- output_original['Oil_pred'][i] for i in range(len(X_test['Oil']))]bias = sum(forecast_errors) * 1.0/len(X_test['Oil'])print('Bias: %f' % bias)#Calculate mean absolute errormae = mean_absolute_error(X_test['Oil'],output_original['Oil_pred'])print('MAE: %f' % mae)#Calculate mean squared error and root mean squared errormse = mean_squared_error(X_test['Oil'], output_original['Oil_pred'])print('MSE: %f' % mse)rmse = sqrt(mse)print('RMSE: %f' % rmse)\n“Least squares parameter estimation of dynamic regression models is known to exhibit substantial bias in small samples when the data is fairly persistent”\nVECM imposes additional restriction due to the existence of non-stationary but co-integrated data forms. It utilizes the co-integration restriction information into its specifications. After the cointegration is known then the next test process is done by using error correction method. Through VECM we can interpret long term and short term equations. We need to determine the number of co-integrating relationships. The advantage of VECM over VAR is that the resulting VAR from VECM representation has more efficient coefficient estimates.\nIn order to fit a VECM model, we need to determine the number of co-integrating relationships using a VEC rank test.\nvec_rank1 = vecm.select_coint_rank(X_train, det_order = 1, k_ar_diff = 1, method = 'trace', signif=0.01)print(vec_rank.summary())\nWe find the λtrace statistics in the third column, together with the corresponding critical values. The test statistic of 38.25 is lower than the critical value (41.08) and so the null of at most one co-integrating vector cannot be rejected.\nLet us employ an alternative statistic, the maximum-eigenvalue statistic (λmax).\nvec_rank2 = vecm.select_coint_rank(X_train, det_order = 1, k_ar_diff = 1, method = 'maxeig', signif=0.01)print(vec_rank2.summary())\nThe test output reports the results for the λmax statistics which does not differ much from trace statistic; the critical value (29.28) is still higher than test statistic.\nWe will still go ahead and estimate VECM, since it can still valuable for short-run dynamics in absence of co-integration. Let’s estimates the VECM on the prices with 9 lags, 1 co-integrating relationship, and a constant within the co-integration relationship. I have used ‘cili’ a combination of “ci” — constant within the co-integration relation and “li” — linear trend within the co-integration relation\nvecm = VECM(endog = X_train, k_ar_diff = 9, coint_rank = 3, deterministic = ‘ci’)vecm_fit = vecm.fit()vecm_fit.predict(steps=10)\nforecast, lower, upper = vecm_fit.predict(10, 0.05)print(“lower bounds of confidence intervals:”)print(lower.round(3))print(“\\npoint forecasts:”)print(forecast.round(3))print(“\\nupper bounds of confidence intervals:”)print(upper.round(3))\nThough we had an indication that, VAR would be best for our data set for price prediction; however, we have shown VECM for experimentation and illustration purpose. This is a simple procedure to explain VAR. However, there are other procedures like impulse response analysis and variance decomposition also can be introduced to experiment if we are able to see how a shock to one variable affects other variable in subsequent periods.\nTime series for economic data is generally stochastic or has a trend that is not stationary, meaning that the data has a root unit. To be able to estimate a model using the data-\nSteps for VAR-\nTest stationarity of data and degree of integrationDetermination of lag lengthTest the granger causalityEstimation of VARVariance decomposition\nTest stationarity of data and degree of integration\nDetermination of lag length\nTest the granger causality\nEstimation of VAR\nVariance decomposition\nForecasting Steps for VECM-\nDetermination of lag lengthTest the granger causalityCointegration degree testEstimation of VECMVariance decomposition\nDetermination of lag length\nTest the granger causality\nCointegration degree test\nEstimation of VECM\nVariance decomposition\nI can be reached here.\nNotice: The programs described here are experimental and should be used with caution. All such use at your own risk.\nReferences:\n(1) Rao, B. (2007). Cointegration: for the Applied Economist, Springer.\n(2) Ashley, R. A., & Verbrugge, R. J. (2009). To difference or not to difference: a Monte Carlo investigation of inference in vector autoregression models. International Journal of Data Analysis Techniques and Strategies, 1(3), 242–274.\n(3) Lütkepohl, H. (2011). Vector autoregressive models. In International Encyclopedia of Statistical Science (pp. 1645–1647). Springer Berlin Heidelberg.\n(4) Kuo, C. Y. (2016). Does the vector error correction model perform better than others in forecasting stock price? An application of residual income svaluation theory. Economic Modelling, 52, 772–789." | [
{
"code": null,
"e": 215,
"s": 172,
"text": "https://sarit-maitra.medium.com/membership"
},
{
"code": null,
"e": 866,
"s": 215,
"text": "VECTOR auto-regressive (VAR) integrated model comprises multiple time series and is quite a useful tool for forecasting. It can be considered a... |
C++ Program to Swap Two Numbers | There are two ways to create a program to swap two numbers. One involves using a temp variable and the second way does not use a third variable. These are explained in detail as follows −
The program to swap two numbers using a temp variable is as follows.
Live Demo
#include <iostream >
using namespace std;
int main()... | [
{
"code": null,
"e": 1250,
"s": 1062,
"text": "There are two ways to create a program to swap two numbers. One involves using a temp variable and the second way does not use a third variable. These are explained in detail as follows −"
},
{
"code": null,
"e": 1319,
"s": 1250,
"te... |
R - Pie Charts | R Programming language has numerous libraries to create charts and graphs. A pie-chart is a representation of values as slices of a circle with different colors. The slices are labeled and the numbers corresponding to each slice is also represented in the chart.
In R the pie chart is created using the pie() function wh... | [
{
"code": null,
"e": 2665,
"s": 2402,
"text": "R Programming language has numerous libraries to create charts and graphs. A pie-chart is a representation of values as slices of a circle with different colors. The slices are labeled and the numbers corresponding to each slice is also represented in t... |
Introduction to Javascript Engines - GeeksforGeeks | 21 Sep, 2021
JavaScript is not understandable by computer but the only browser understands JavaScript. So, we need a program to convert our JavaScript program into computer-understandable language. A JavaScript engine is a computer program that executes JavaScript code and converts it into computer understandable langu... | [
{
"code": null,
"e": 24838,
"s": 24810,
"text": "\n21 Sep, 2021"
},
{
"code": null,
"e": 25150,
"s": 24838,
"text": "JavaScript is not understandable by computer but the only browser understands JavaScript. So, we need a program to convert our JavaScript program into computer-und... |
PyTorch: Switching to the GPU. How and Why to train models on the GPU... | by Dario Radečić | Towards Data Science | Unlike TensorFlow, PyTorch doesn’t have a dedicated library for GPU users, and as a developer, you’ll need to do some manual work here. But in the end, it will save you a lot of time.
Just if you are wondering, installing CUDA on your machine or switching to GPU runtime on Colab isn’t enough. Don’t get me wrong, it is ... | [
{
"code": null,
"e": 355,
"s": 171,
"text": "Unlike TensorFlow, PyTorch doesn’t have a dedicated library for GPU users, and as a developer, you’ll need to do some manual work here. But in the end, it will save you a lot of time."
},
{
"code": null,
"e": 578,
"s": 355,
"text": "Ju... |
PLSQL | CONVERT Function - GeeksforGeeks | 19 Sep, 2019
The string in PL/SQL is actually a sequence of characters with an optional size specification.The characters could be numeric, letters, blank, special characters or a combination of all.The CONVERT function in PLSQL is used to convert a string from one character set to another.Generally, the destination ch... | [
{
"code": null,
"e": 23589,
"s": 23561,
"text": "\n19 Sep, 2019"
},
{
"code": null,
"e": 24185,
"s": 23589,
"text": "The string in PL/SQL is actually a sequence of characters with an optional size specification.The characters could be numeric, letters, blank, special characters o... |
Bokeh - ColumnDataSource | Most of the plotting methods in Bokeh API are able to receive data source parameters through ColumnDatasource object. It makes sharing data between plots and ‘DataTables’.
A ColumnDatasource can be considered as a mapping between column name and list of data. A Python dict object with one or more string keys and lists ... | [
{
"code": null,
"e": 2442,
"s": 2270,
"text": "Most of the plotting methods in Bokeh API are able to receive data source parameters through ColumnDatasource object. It makes sharing data between plots and ‘DataTables’."
},
{
"code": null,
"e": 2659,
"s": 2442,
"text": "A ColumnDa... |
Divide binary array into three equal parts with same value - GeeksforGeeks | 13 Nov, 2018
Given an array A of length n such that it contains only ‘0s’ and ‘1s’. The task is to divide the array into THREE different non-empty parts such that all of these parts represent the same binary value(in decimals).If it is possible, return any [i, j] with i+1 < j, such that:1. A[0], A[1], ..., A[i] is the ... | [
{
"code": null,
"e": 25060,
"s": 25032,
"text": "\n13 Nov, 2018"
},
{
"code": null,
"e": 25579,
"s": 25060,
"text": "Given an array A of length n such that it contains only ‘0s’ and ‘1s’. The task is to divide the array into THREE different non-empty parts such that all of these ... |
User-Defined Exceptions in Python | Python also allows you to create your own exceptions by deriving classes from the standard built-in exceptions.
Here is an example related to RuntimeError. Here, a class is created that is subclassed from RuntimeError. This is useful when you need to display more specific information when an exception is caught.
In the... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "Python also allows you to create your own exceptions by deriving classes from the standard built-in exceptions."
},
{
"code": null,
"e": 1376,
"s": 1174,
"text": "Here is an example related to RuntimeError. Here, a class is created t... |
SQL Certificate Mock Exams | 1. What will be the outcome of the following query?
SELECT ROUND(144.23,-1) FROM dual;
140
144
150
100
140
144
150
100
2.In which of the following cases, parenthesis should be specified?
When INTERSECT is used with other set operators
When UNION is used with UNION ALL
When MINUS is used for the queries
None of the a... | [
{
"code": null,
"e": 2515,
"s": 2463,
"text": "1. What will be the outcome of the following query?"
},
{
"code": null,
"e": 2550,
"s": 2515,
"text": "SELECT ROUND(144.23,-1) FROM dual;"
},
{
"code": null,
"e": 2568,
"s": 2550,
"text": "\n140\n144\n150\n100\n"
... |
Check if a File is hidden in C# | To retrieve the attributes of a file, use the FileAttributes Eumeration. It has various members like compressed, directory, hidden, etc.
To check if a file is hidden, use the hidden member name.
If the FileAttributes.hidden is set that would mean the file is hidden. Firstly, get the path to find the attributes.
FileAtt... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "To retrieve the attributes of a file, use the FileAttributes Eumeration. It has various members like compressed, directory, hidden, etc."
},
{
"code": null,
"e": 1257,
"s": 1199,
"text": "To check if a file is hidden, use the hidden ... |
How to generate 2-D Gaussian array using NumPy? - GeeksforGeeks | 20 Apr, 2022
In this article, Let’s discuss how to generate a 2-D Gaussian array using NumPy. To create a 2 D Gaussian array using Numpy python module
numpy.meshgrid()– It is used to create a rectangular grid out of two given one-dimensional arrays representing the Cartesian indexing or Matrix indexing.
Syntax:
numpy.... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n20 Apr, 2022"
},
{
"code": null,
"e": 24039,
"s": 23901,
"text": "In this article, Let’s discuss how to generate a 2-D Gaussian array using NumPy. To create a 2 D Gaussian array using Numpy python module"
},
{
"code": nul... |
How to get the information from a meta tag using JavaScript? | 28 Jan, 2020
To display meta tag information in HTML with JavaScript, we will use a method called getElementByTagName() function.
Method 1: Using getElementsByTagName() method.
Syntax:
document.getElementsByTagName("meta");
With this, we can get all the meta elements from an HTML file. As we click on the button, all th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2020"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "To display meta tag information in HTML with JavaScript, we will use a method called getElementByTagName() function."
},
{
"code": null,
"e": 192,
"s": 145,
... |
Countplot using seaborn in Python | 12 Jun, 2021
Seaborn is an amazing visualization library for statistical graphics plotting in Python. It provides beautiful default styles and color palettes to make statistical plots more attractive. It is built on the top of matplotlib library and also closely integrated to the data structures from pandas.
seaborn.c... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Jun, 2021"
},
{
"code": null,
"e": 350,
"s": 52,
"text": "Seaborn is an amazing visualization library for statistical graphics plotting in Python. It provides beautiful default styles and color palettes to make statistical plots mor... |
HTML <a> target Attribute | 21 Jun, 2022
The HTML <a> target Attribute is used to specify where to open the link.
Syntax:
<a target="_blank | _self | _parent | _top | framename"\>
Attribute Values:
_blank: It opens the link in a new window.
_self: It is the default value. It opens the linked document in the same frame.
_parent: It opens the li... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 102,
"s": 28,
"text": "The HTML <a> target Attribute is used to specify where to open the link. "
},
{
"code": null,
"e": 110,
"s": 102,
"text": "Syntax:"
},
{
"code": nu... |
Python | Pandas Timedelta.days | 14 Jan, 2019
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Timedelta is a subclass of datetime.timedelta, and behaves in a similar manner. It is the pan... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2019"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
Python – Double each List element | 01 Mar, 2020
Sometimes, while working with data, we have just a simple application in which we require to double the contents of a list and make it 100% increase in its magnitude. This is having application in web development and machine learning domains. Let’s discuss certain ways in which this task can be performed.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Mar, 2020"
},
{
"code": null,
"e": 335,
"s": 28,
"text": "Sometimes, while working with data, we have just a simple application in which we require to double the contents of a list and make it 100% increase in its magnitude. This is ... |
Memory Leaks in Android | 25 Sep, 2020
A memory leak is basically a failure of releasing unused objects from the memory. As a developer one does not need to think about memory allocation, memory deallocation, and garbage collection. All of these are the automatic process that the garbage collector does by itself, but the situation becomes diffi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Sep, 2020"
},
{
"code": null,
"e": 796,
"s": 28,
"text": "A memory leak is basically a failure of releasing unused objects from the memory. As a developer one does not need to think about memory allocation, memory deallocation, and g... |
Python | sympy.bernoulli() method | 14 Jul, 2019
With the help of sympy.bernoulli() method, we can find the Bernoulli number and Bernoulli polynomial in SymPy.
Syntax: bernoulli(n)
Parameter:n – It denotes the nth bernoulli number.
Returns: Returns the nth bernoulli number.
Example #1:
# import sympy from sympy import * n = 4print("Value of n = {}".forma... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jul, 2019"
},
{
"code": null,
"e": 139,
"s": 28,
"text": "With the help of sympy.bernoulli() method, we can find the Bernoulli number and Bernoulli polynomial in SymPy."
},
{
"code": null,
"e": 160,
"s": 139,
"tex... |
Convert Factor to Numeric and Numeric to Factor in R Programming | 30 May, 2022
Factors are data structures which are implemented to categorize the data or represent categorical data and store it on multiple levels. They can be stored as integers with a corresponding label to every unique integer. Though factors may look similar to character vectors, they are integers, and care must b... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 May, 2022"
},
{
"code": null,
"e": 506,
"s": 28,
"text": "Factors are data structures which are implemented to categorize the data or represent categorical data and store it on multiple levels. They can be stored as integers with a c... |
Compare two Strings in Java | 29 Mar, 2020
String is a sequence of characters. In Java, objects of String are immutable which means they are constant and cannot be changed once created.
Below are 5 ways to compare two Strings in Java:
Using user-defined function : Define a function to compare values with following conditions :if (string1 > string2)... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Mar, 2020"
},
{
"code": null,
"e": 195,
"s": 52,
"text": "String is a sequence of characters. In Java, objects of String are immutable which means they are constant and cannot be changed once created."
},
{
"code": null,
... |
Java 8 | Collectors counting() with Examples | 06 Dec, 2018
Collectors counting() method is used to count the number of elements passed in the stream as the parameter. It returns a Collector accepting elements of type T that counts the number of input elements. If no elements are present, the result is 0. It is a terminal operation i.e, it may traverse the stream t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 545,
"s": 28,
"text": "Collectors counting() method is used to count the number of elements passed in the stream as the parameter. It returns a Collector accepting elements of type T that counts the... |
Python | Sum of squares in list | 12 Mar, 2019
Python being the language of magicians can be used to perform many tedious and repetitive tasks in a easy and concise manner and having the knowledge to utilize this tool to the fullest is always useful. One such small application can be finding sum of squares of list in just one line. Let’s discuss certai... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Mar, 2019"
},
{
"code": null,
"e": 374,
"s": 28,
"text": "Python being the language of magicians can be used to perform many tedious and repetitive tasks in a easy and concise manner and having the knowledge to utilize this tool to t... |
Remove newline, space and tab characters from a string in Java | To remove newline, space and tab characters from a string, replace them with empty as shown below.
replaceAll("[\\n\\t ]", "");
Above, the new line, tab, and space will get replaced with empty, since we have used replaceAll()
The following is the complete example.
Live Demo
public class Demo {
public static void ma... | [
{
"code": null,
"e": 1286,
"s": 1187,
"text": "To remove newline, space and tab characters from a string, replace them with empty as shown below."
},
{
"code": null,
"e": 1315,
"s": 1286,
"text": "replaceAll(\"[\\\\n\\\\t ]\", \"\");"
},
{
"code": null,
"e": 1413,
... |
Print the season name of the year based on the month number | 06 Nov, 2021
Given the month number M, the task is to print the season name of the year based on the month number.Examples:
Input: M = 5
Output: SPRING
Input: M = 1
Output: WINTER
Approach:
There are 4 main seasons in a year, that is, Summer, Autumn, Winter and Spring.
The winter months are in December, January ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Nov, 2021"
},
{
"code": null,
"e": 141,
"s": 28,
"text": "Given the month number M, the task is to print the season name of the year based on the month number.Examples: "
},
{
"code": null,
"e": 198,
"s": 141,
"t... |
Session Objects – Python requests | 07 Jun, 2022
Session object allows one to persist certain parameters across requests. It also persists cookies across all requests made from the Session instance and will use urllib3’s connection pooling. So, if several requests are being made to the same host, the underlying TCP connection will be reused, which can re... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Jun, 2022"
},
{
"code": null,
"e": 454,
"s": 54,
"text": "Session object allows one to persist certain parameters across requests. It also persists cookies across all requests made from the Session instance and will use urllib3’s co... |
What is an Optional parameter in C#? | By default, all parameters of a method are required. A method that contains optional parameters does not force to pass arguments at calling time. It means we call method without passing the arguments.
The optional parameter contains a default value in function definition. If we do not pass optional argument value at ca... | [
{
"code": null,
"e": 1388,
"s": 1187,
"text": "By default, all parameters of a method are required. A method that contains optional parameters does not force to pass arguments at calling time. It means we call method without passing the arguments."
},
{
"code": null,
"e": 1546,
"s": ... |
Python | How and where to apply Feature Scaling? | 27 Sep, 2021
Feature Scaling or Standardization: It is a step of Data Pre Processing that is applied to independent variables or features of data. It basically helps to normalize the data within a particular range. Sometimes, it also helps in speeding up the calculations in an algorithm.
Package Used:
sklearn.preproce... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 330,
"s": 54,
"text": "Feature Scaling or Standardization: It is a step of Data Pre Processing that is applied to independent variables or features of data. It basically helps to normalize the data... |
Understanding Classes and Objects in Java | 04 Oct, 2021
The term Object-Oriented explains the concept of organizing the software as a combination of different types of objects that incorporates both data and behavior. Hence, Object_oriented programming(OOPs) is a programming model, that simplifies software development and maintenance by providing some rules. Pr... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 628,
"s": 54,
"text": "The term Object-Oriented explains the concept of organizing the software as a combination of different types of objects that incorporates both data and behavior. Hence, Objec... |
Deploy Machine Learning Pipeline on Google Kubernetes Engine | by Moez Ali | Towards Data Science | In our last post on deploying a machine learning pipeline in the cloud, we demonstrated how to develop a machine learning pipeline in PyCaret, containerize it with Docker and serve as a web app using Microsoft Azure Web App Services. If you haven’t heard about PyCaret before, please read this announcement to learn more... | [
{
"code": null,
"e": 494,
"s": 172,
"text": "In our last post on deploying a machine learning pipeline in the cloud, we demonstrated how to develop a machine learning pipeline in PyCaret, containerize it with Docker and serve as a web app using Microsoft Azure Web App Services. If you haven’t heard ... |
Find comics of marvel superhero using marvel API in Python - GeeksforGeeks | 06 Jun, 2021
In this article, we will find the comic of marvel by using python and marvel api. Marvel has provided an API that provides a look into their database consisting of various comics, movies, etc. We will be using that to find out your favorite marvel superhero comic books.
The Marvel Comics API is a tool to h... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n06 Jun, 2021"
},
{
"code": null,
"e": 24483,
"s": 24212,
"text": "In this article, we will find the comic of marvel by using python and marvel api. Marvel has provided an API that provides a look into their database consisting of... |
Apache Pig Installation on Windows and Case Study - GeeksforGeeks | 03 Dec, 2021
Apache Pig is a data manipulation tool that is built over Hadoop’s MapReduce. Pig provides us with a scripting language for easier and faster data manipulation. This scripting language is called Pig Latin.
Apache Pig scripts can be executed in 3 ways as follows:
Using Grunt Shell (Interactive Mode) – Write... | [
{
"code": null,
"e": 23955,
"s": 23927,
"text": "\n03 Dec, 2021"
},
{
"code": null,
"e": 24161,
"s": 23955,
"text": "Apache Pig is a data manipulation tool that is built over Hadoop’s MapReduce. Pig provides us with a scripting language for easier and faster data manipulation. Th... |
Count the number of a special day between two dates by using PL/SQL - GeeksforGeeks | 06 Dec, 2019
Prerequisite – PL/SQL Introduction, Decision Making in PL/SQL
Write a pl/sql program to input two dates and print number of Sundays between those two dates.
Explanation:Before each iteration of the loop, condition is evaluated. If it evaluates to TRUE, sequence_of_statements is executed. If condition evalu... | [
{
"code": null,
"e": 23877,
"s": 23849,
"text": "\n06 Dec, 2019"
},
{
"code": null,
"e": 23939,
"s": 23877,
"text": "Prerequisite – PL/SQL Introduction, Decision Making in PL/SQL"
},
{
"code": null,
"e": 24034,
"s": 23939,
"text": "Write a pl/sql program to in... |
Minimum Cost of ropes | Practice | GeeksforGeeks | There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes with minimum cost.
Example 1:
Input:
n = 4
arr[] = {4, 3, 2, 6}
Output:
29
Explanation:
For example if we are given 4
ropes of len... | [
{
"code": null,
"e": 446,
"s": 238,
"text": "There are given N ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. The task is to connect the ropes with minimum cost."
},
{
"code": null,
"e": 457,
"... |
How to determine Android device screen size category (small, normal, large, xlarge) programatically? | This example demonstrates how do I determine the Android device screen size category (small, normal, large, xlarge) programmatically.
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_ma... | [
{
"code": null,
"e": 1196,
"s": 1062,
"text": "This example demonstrates how do I determine the Android device screen size category (small, normal, large, xlarge) programmatically."
},
{
"code": null,
"e": 1325,
"s": 1196,
"text": "Step 1 − Create a new project in Android Studio,... |
Apache POI - Spreadsheets | This chapter explains how to create a spreadsheet and manipulate it using Java. Spreadsheet is a page in an Excel file; it contains rows and columns with specific names.
After completing this chapter, you will be able to create a spreadsheet and perform read operations on it.
First of all, let us create a spreadsheet u... | [
{
"code": null,
"e": 2074,
"s": 1904,
"text": "This chapter explains how to create a spreadsheet and manipulate it using Java. Spreadsheet is a page in an Excel file; it contains rows and columns with specific names."
},
{
"code": null,
"e": 2181,
"s": 2074,
"text": "After comple... |
Integer.MAX_VALUE and Integer.MIN_VALUE in Java with Examples - GeeksforGeeks | 22 Jan, 2020
Most of the times, in competitive programming, there is a need to assign the variable, the maximum or minimum value that data type can hold, but remembering such a large and precise number comes out to be a difficult job. Therefore, Java has constants to represent these numbers, so that these can be direct... | [
{
"code": null,
"e": 25811,
"s": 25783,
"text": "\n22 Jan, 2020"
},
{
"code": null,
"e": 26188,
"s": 25811,
"text": "Most of the times, in competitive programming, there is a need to assign the variable, the maximum or minimum value that data type can hold, but remembering such a... |
How to calculate the date three months prior using JavaScript ? - GeeksforGeeks | 19 Jun, 2019
Given a Date and the task is to get the date of three month prior using javascript.
Approach:
First select the date object.
Then use the getMonth() method to get the months.
Then subtract three months from the getMonth() method and return the date.
Example 1: This example uses getMonth() and setMonth() met... | [
{
"code": null,
"e": 26569,
"s": 26541,
"text": "\n19 Jun, 2019"
},
{
"code": null,
"e": 26653,
"s": 26569,
"text": "Given a Date and the task is to get the date of three month prior using javascript."
},
{
"code": null,
"e": 26663,
"s": 26653,
"text": "Approa... |
Assign other value to a variable from two possible values - GeeksforGeeks | 05 May, 2021
Suppose a variable x can have only two possible values a and b, and you wish to assign to x the value other than its current one. Do it efficiently without using any conditional operator.Note: We are not allowed to check current value of x. Examples:
Input : a = 10, b = 15, x = a Output : x = 15 Explanat... | [
{
"code": null,
"e": 26277,
"s": 26249,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 26530,
"s": 26277,
"text": "Suppose a variable x can have only two possible values a and b, and you wish to assign to x the value other than its current one. Do it efficiently without using a... |
GUI to generate and store passwords in SQLite using Python - GeeksforGeeks | 06 Sep, 2021
In this century there are many social media accounts, websites, or any online account that needs a secure password. Often we use the same password for multiple accounts and the basic drawback to that is if somebody gets to know about your password then he/she has the access to all your accounts. It is har... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 25975,
"s": 25537,
"text": "In this century there are many social media accounts, websites, or any online account that needs a secure password. Often we use the same password for multiple ac... |
How to Hide Password in HTML ? - GeeksforGeeks | 30 Jun, 2021
Hiding the password is commonly known as Password Masking. It is hiding the password characters when entered by the users by the use of bullets (•), an asterisk (*), or some other characters.
It is always a good practice to use password masking to ensure security and avoid its misuse. Generally, password m... | [
{
"code": null,
"e": 26647,
"s": 26619,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 26839,
"s": 26647,
"text": "Hiding the password is commonly known as Password Masking. It is hiding the password characters when entered by the users by the use of bullets (•), an asterisk (*... |
Angular Material - Menu Bar | The md-menu-bar an Angular directive, is a container component to hold multiple menus. Menu bar helps to create a operating system provided menu effect.
The following example shows the use of md-menu-bar directive and also the uses of menu-bar.
am_menubar.htm
<html lang = "en">
<head>
<link rel = "stylesheet"
... | [
{
"code": null,
"e": 2343,
"s": 2190,
"text": "The md-menu-bar an Angular directive, is a container component to hold multiple menus. Menu bar helps to create a operating system provided menu effect."
},
{
"code": null,
"e": 2435,
"s": 2343,
"text": "The following example shows t... |
Count distinct elements from a range of a sorted sequence from a given frequency array - GeeksforGeeks | 12 Jun, 2021
Given two integers L and R and an array arr[] consisting of N positive integers( 1-based indexing ) such that the frequency of ith element of a sorted sequence, say A[], is arr[i]. The task is to find the number of distinct elements from the range [L, R] in the sequence A[].
Examples:
Input: arr[] = {3, 6,... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n12 Jun, 2021"
},
{
"code": null,
"e": 25098,
"s": 24822,
"text": "Given two integers L and R and an array arr[] consisting of N positive integers( 1-based indexing ) such that the frequency of ith element of a sorted sequence, sa... |
Clear LRU Cache in Python - GeeksforGeeks | 10 Jul, 2020
The LRU is the Least Recently Used cache. LRU Cache is a type of high-speed memory, that is used to quicken the retrieval speed of frequently used data. It is implemented with the help of Queue and Hash data structures.
Note: For more information, refer to Python – LRU Cache
Python’s functool module has pr... | [
{
"code": null,
"e": 24400,
"s": 24372,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 24620,
"s": 24400,
"text": "The LRU is the Least Recently Used cache. LRU Cache is a type of high-speed memory, that is used to quicken the retrieval speed of frequently used data. It is impl... |
Advance Features of Python - GeeksforGeeks | 19 Feb, 2020
Python is a high-level, interpreted programming language that has easy syntax. Python codes are compiled line-by-line which makes the debugging of errors much easier and efficient. Python works on almost all types of platforms such as Windows, Mac, Linux, Raspberry Pi, etc. Python supports modules and pack... | [
{
"code": null,
"e": 24032,
"s": 24004,
"text": "\n19 Feb, 2020"
},
{
"code": null,
"e": 24551,
"s": 24032,
"text": "Python is a high-level, interpreted programming language that has easy syntax. Python codes are compiled line-by-line which makes the debugging of errors much easi... |
Bar chart using Plotly in Python - GeeksforGeeks | 08 Jul, 2021
Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot, and many more. It is mainly used in data analysis as well as financial analysis. Plotly is an interactive visualization library.
In ... | [
{
"code": null,
"e": 24068,
"s": 24040,
"text": "\n08 Jul, 2021"
},
{
"code": null,
"e": 24372,
"s": 24068,
"text": "Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, s... |
How to Enable Webcam in Angular 10 using ngx-webcam ? - GeeksforGeeks | 21 Aug, 2020
ngx-webcam component provides access of webcam to take snapshots simply via actions and event-bindings in Angular 10. This component gives us full control and permission to capture images in an easy way.
Steps to add webcam to your application:
Install Angular 10
Create a Angular CLI Project
Install the pa... | [
{
"code": null,
"e": 24249,
"s": 24221,
"text": "\n21 Aug, 2020"
},
{
"code": null,
"e": 24453,
"s": 24249,
"text": "ngx-webcam component provides access of webcam to take snapshots simply via actions and event-bindings in Angular 10. This component gives us full control and perm... |
Multi-Class Text Classification with SKlearn and NLTK in python| A Software Engineering Use Case | by Nasir Safdari | Towards Data Science | Recently, I worked on a software engineering research project. one of the main objectives of the project was to understand the focus areas of work in the development teams. when the size of a software project becomes large, managing the workflow and the development process is more challenging. therefore, it is essentia... | [
{
"code": null,
"e": 617,
"s": 172,
"text": "Recently, I worked on a software engineering research project. one of the main objectives of the project was to understand the focus areas of work in the development teams. when the size of a software project becomes large, managing the workflow and the d... |
Big Data Analytics - Text Analytics | In this chapter, we will be using the data scraped in the part 1 of the book. The data has text that describes profiles of freelancers, and the hourly rate they are charging in USD. The idea of the following section is to fit a model that given the skills of a freelancer, we are able to predict its hourly salary.
The f... | [
{
"code": null,
"e": 2869,
"s": 2554,
"text": "In this chapter, we will be using the data scraped in the part 1 of the book. The data has text that describes profiles of freelancers, and the hourly rate they are charging in USD. The idea of the following section is to fit a model that given the skil... |
8051 Program to Multiply two 8 Bit numbers | Now we will try to multiply two 8-bit numbers using this 8051 microcontroller. The register A and B will be used for multiplication. No other registers can be used for multiplication. The result of the multiplication may exceed the 8-bit size. So the higher order byte is stored at register B, and lower order byte will ... | [
{
"code": null,
"e": 1428,
"s": 1062,
"text": "Now we will try to multiply two 8-bit numbers using this 8051 microcontroller. The register A and B will be used for multiplication. No other registers can be used for multiplication. The result of the multiplication may exceed the 8-bit size. So the hi... |
How to convert a JSON string into a JavaScript object? | Javascript has provided JSON.parse() method to convert a JSON into an object. Once JSON is parsed we can able to access the elements in the JSON.
var obj = JSON.parse(JSON);
It takes a JSON and parses it into an object so as to access the elements in the provided JSON.
In the following example, a JOSN is assigned to a ... | [
{
"code": null,
"e": 1208,
"s": 1062,
"text": "Javascript has provided JSON.parse() method to convert a JSON into an object. Once JSON is parsed we can able to access the elements in the JSON."
},
{
"code": null,
"e": 1236,
"s": 1208,
"text": "var obj = JSON.parse(JSON);"
},
... |
Decision Tree Classifier and Cost Computation Pruning using Python | by Angel Das | Towards Data Science | Decision tree classifiers are supervised learning models that are useful when we care about interpretability. Think of it like, breaking down the data by making decisions based on multiple questions at each level. This is one of the widely used algorithms for handling classification problems. To understand it better le... | [
{
"code": null,
"e": 530,
"s": 172,
"text": "Decision tree classifiers are supervised learning models that are useful when we care about interpretability. Think of it like, breaking down the data by making decisions based on multiple questions at each level. This is one of the widely used algorithms... |
Diagnose the Generalized Linear Models | by Yufeng | Towards Data Science | Generalized Linear Model (GLM) is popular because it can deal with a wide range of data with different response variable types (such as binomial, Poisson, or multinomial).
Comparing to the non-linear models, such as the neural networks or tree-based models, the linear models may not be that powerful in terms of predict... | [
{
"code": null,
"e": 343,
"s": 171,
"text": "Generalized Linear Model (GLM) is popular because it can deal with a wide range of data with different response variable types (such as binomial, Poisson, or multinomial)."
},
{
"code": null,
"e": 651,
"s": 343,
"text": "Comparing to t... |
How BEFORE INSERT triggers can be used to emulate CHECK CONSTRAINT for inserting values in the table? | As we know that MySQL supports foreign key for referential integrity but it does not support CHECK constraint. But we can emulate them by using triggers. It can be illustrated with the help of an example given below −
Suppose we have a table named ‘car’ which can have the fix syntax registration number like two letters... | [
{
"code": null,
"e": 1280,
"s": 1062,
"text": "As we know that MySQL supports foreign key for referential integrity but it does not support CHECK constraint. But we can emulate them by using triggers. It can be illustrated with the help of an example given below −"
},
{
"code": null,
"e"... |
BigDecimal intvalueExact() Method in Java - GeeksforGeeks | 04 Dec, 2018
The java.math.BigDecimal.intValueExact() is an inbuilt function which converts this BigDecimal to an integer value as well as checks for the lost information. This function throws an Arithmetic Exception if there is any fractional part of this BigDecimal or if the result of the conversion is too big to be ... | [
{
"code": null,
"e": 24486,
"s": 24458,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 24826,
"s": 24486,
"text": "The java.math.BigDecimal.intValueExact() is an inbuilt function which converts this BigDecimal to an integer value as well as checks for the lost information. This... |
Use Redis Queue for Asynchronous Tasks in a Flask App | by Edward Krueger | Towards Data Science | By: Content by Edward Krueger, Josh Farmer and Douglas Franklin.
When building an application that performs time-consuming, complex, or resource-intensive tasks, it can be frustrating to wait for these to complete within the front end application. Additionally, complex tasks in the front end can time-out. Redis Queue f... | [
{
"code": null,
"e": 237,
"s": 172,
"text": "By: Content by Edward Krueger, Josh Farmer and Douglas Franklin."
},
{
"code": null,
"e": 566,
"s": 237,
"text": "When building an application that performs time-consuming, complex, or resource-intensive tasks, it can be frustrating to... |
Default arguments in Python | A default argument is an argument that assumes a default value if a value is not provided in the function call for that argument. The following example gives an idea on default arguments, it prints default age if it is not passed −
Live Demo
#!/usr/bin/python
# Function definition is here
def printinfo( name, age = 35... | [
{
"code": null,
"e": 1294,
"s": 1062,
"text": "A default argument is an argument that assumes a default value if a value is not provided in the function call for that argument. The following example gives an idea on default arguments, it prints default age if it is not passed −"
},
{
"code":... |
How to call function from it name stored in a string using JavaScript? | 21 Apr, 2019
There are two methods to call a function from string stored in a variable. The first one is by using the window object method and the second one is by using eval() method. The eval() method is older and it is deprecated.
Method 1: Using the window object: The window object in HTML 5 references the current ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Apr, 2019"
},
{
"code": null,
"e": 273,
"s": 52,
"text": "There are two methods to call a function from string stored in a variable. The first one is by using the window object method and the second one is by using eval() method. Th... |
SQL – SELECT LAST | 16 Aug, 2021
SEQUEL widely known as SQL (Structured Query Language), is the most popular standard language to work on databases. It is a domain-specific language that is mostly used to perform tons of operations which include creating a database, storing data in the form of tables, modifying, extract and lot more. Ther... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Aug, 2021"
},
{
"code": null,
"e": 442,
"s": 54,
"text": "SEQUEL widely known as SQL (Structured Query Language), is the most popular standard language to work on databases. It is a domain-specific language that is mostly used to pe... |
How to create Expanding Cards using HTML, CSS and Javascript ? | 05 Mar, 2021
In this article, we will see how we can create an expanding card that displays an expanded view of the card on click. For creating this card we will use HTML, CSS, and JavaScript.
Approach: In this section, we will create the structure of our HTML card.
Create a div with the class container.
Create another... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Mar, 2021"
},
{
"code": null,
"e": 208,
"s": 28,
"text": "In this article, we will see how we can create an expanding card that displays an expanded view of the card on click. For creating this card we will use HTML, CSS, and JavaScr... |
Python | Pandas dataframe.get_value() | 19 Nov, 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 dataframe.get_value() function is used to quickly retrieve single value in the data fr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Nov, 2018"
},
{
"code": null,
"e": 266,
"s": 52,
"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 im... |
Difference between Flutter and Angular | 10 Aug, 2021
Flutter: Flutter is Google’s Mobile SDK to build native iOS and Android, Desktop (Windows, Linux, macOS), Web apps from a single codebase. It is an open-source framework created in May 2017. When building applications with Flutter everything towards Widgets – the blocks with which the flutter apps are buil... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 666,
"s": 28,
"text": "Flutter: Flutter is Google’s Mobile SDK to build native iOS and Android, Desktop (Windows, Linux, macOS), Web apps from a single codebase. It is an open-source framework creat... |
How to avoid dropdown menu to close menu items on clicking inside ? | 09 Jul, 2019
The default behavior of a dropdown menu is to close the menu list items when clicked inside. In this article, We will use stropPropagation method to prevent the dropdown menu from closing the menu list.
stopPropagation(): The stopPropagation() method is used to stop propagation of event calling i.e. the pa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2019"
},
{
"code": null,
"e": 231,
"s": 28,
"text": "The default behavior of a dropdown menu is to close the menu list items when clicked inside. In this article, We will use stropPropagation method to prevent the dropdown menu ... |
How to store single cache data in ReactJS ? | 21 Jan, 2022
We can use the following approach in ReactJS to store single data into cache in ReactJS. We can cache some data into the browser and use it in our application whenever needed. Caching is a technique that helps us to stores a copy of a given resource into our browser and serves it back when requested.
Appro... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jan, 2022"
},
{
"code": null,
"e": 330,
"s": 28,
"text": "We can use the following approach in ReactJS to store single data into cache in ReactJS. We can cache some data into the browser and use it in our application whenever needed.... |
Python | Working with PNG Images using Matplotlib | 15 Apr, 2019
Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. It was introduced by John Hunter in the year 2002.One of the greatest benefits of visualization... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Apr, 2019"
},
{
"code": null,
"e": 502,
"s": 28,
"text": "Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed t... |
How to create a pop-up to print dialog box using JavaScript? | 12 Sep, 2019
Given an HTML document and the task is to design a button that would pop-up a print dialog box. We are going to use JavaScript to do the assigned task:
Approach::Add a button which links to a JavaScript Function.Inside the JavaScript Function, use the JavaScript default function to call the print dialog bo... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Sep, 2019"
},
{
"code": null,
"e": 180,
"s": 28,
"text": "Given an HTML document and the task is to design a button that would pop-up a print dialog box. We are going to use JavaScript to do the assigned task:"
},
{
"code": n... |
Dividing Sticks Problem | 18 Aug, 2021
Given a list of integer each representing the length of each stick and an integer which tells how many times we can break a stick into half parts, we have to find maximum desired length sticks can be obtained from the group of sticks. Note 1: When we break a stick it gets converted into two half parts for ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 747,
"s": 52,
"text": "Given a list of integer each representing the length of each stick and an integer which tells how many times we can break a stick into half parts, we have to find maximum des... |
JavaScript | Promises | 06 Dec, 2021
Promises are used to handle asynchronous operations in JavaScript. They are easy to manage when dealing with multiple asynchronous operations where callbacks can create callback hell leading to unmanageable code.
Prior to promises events and callback functions were used but they had limited functionalitie... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Dec, 2021"
},
{
"code": null,
"e": 266,
"s": 52,
"text": "Promises are used to handle asynchronous operations in JavaScript. They are easy to manage when dealing with multiple asynchronous operations where callbacks can create callb... |
How to start nmap and run a simple scan ? | 19 Jul, 2019
Nmap is a free and open-source utility which is used to scan networks and security auditing. Nmap can discover hosts and services on a computer network by sending packets and analyzing the responses. The utility is available on almost every os, it is available for windows, linux and mac.
Download Nmap –To ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Jul, 2019"
},
{
"code": null,
"e": 341,
"s": 52,
"text": "Nmap is a free and open-source utility which is used to scan networks and security auditing. Nmap can discover hosts and services on a computer network by sending packets and... |
Overloading Varargs Methods in Java | A method with variable length arguments(Varargs) can have zero or multiple arguments. Also, Varargs methods can be overloaded if required.
A program that demonstrates this is given as follows:
Live Demo
public class Demo {
public static void Varargs(int... args) {
System.out.println("\nNumber of int arguments... | [
{
"code": null,
"e": 1201,
"s": 1062,
"text": "A method with variable length arguments(Varargs) can have zero or multiple arguments. Also, Varargs methods can be overloaded if required."
},
{
"code": null,
"e": 1255,
"s": 1201,
"text": "A program that demonstrates this is given a... |
Introduction: Reinforcement Learning with OpenAI Gym | by ASHISH RANA | Towards Data Science | Understand the basic goto concepts to get a quick start on reinforcement learning and learn to test your algorithms with OpenAI gym to achieve research centric reproducible results.
This article first walks you through the basics of reinforcement learning, its current advancements and a somewhat detailed practical use-... | [
{
"code": null,
"e": 354,
"s": 172,
"text": "Understand the basic goto concepts to get a quick start on reinforcement learning and learn to test your algorithms with OpenAI gym to achieve research centric reproducible results."
},
{
"code": null,
"e": 898,
"s": 354,
"text": "This... |
SAP Hybris - Modelling | One of the main features in Hybris is the flexibility to add new objects to the global Hybris Commerce Data model. Hybris data modeling helps an organization in maintaining their database and help to manage database connections and queries. Hybris Type system is used to design data modeling in Hybris.
A Hybris type sys... | [
{
"code": null,
"e": 2766,
"s": 2463,
"text": "One of the main features in Hybris is the flexibility to add new objects to the global Hybris Commerce Data model. Hybris data modeling helps an organization in maintaining their database and help to manage database connections and queries. Hybris Type ... |
How to Keep the Device Screen On in Android? - GeeksforGeeks | 14 Sep, 2020
In Android it’s seen that screen timeout will be set for 30 seconds or it is set by the user manually in system settings, to avoid the battery drain. But there are cases where applications like stopwatch, document reader applications, games, etc, need the screen to be always awake. In this article its been... | [
{
"code": null,
"e": 25044,
"s": 25016,
"text": "\n14 Sep, 2020"
},
{
"code": null,
"e": 25403,
"s": 25044,
"text": "In Android it’s seen that screen timeout will be set for 30 seconds or it is set by the user manually in system settings, to avoid the battery drain. But there are... |
Feature Variation Explanation. Employing PCA in Scikit-Learn | by Maryam Kargar | Towards Data Science | As a multivariate ordination technique, principal component analysis (PCA) can be carried out on dependent variables in a multivariate dataset to explore relationships between them. This results in displaying the relative positions of data points in fewer dimensions while retaining as much information as possible [2].
... | [
{
"code": null,
"e": 492,
"s": 172,
"text": "As a multivariate ordination technique, principal component analysis (PCA) can be carried out on dependent variables in a multivariate dataset to explore relationships between them. This results in displaying the relative positions of data points in fewer... |
HBase - Security | We can grant and revoke permissions to users in HBase. There are three commands for security purpose: grant, revoke, and user_permission.
The grant command grants specific rights such as read, write, execute, and admin on a table to a certain user. The syntax of grant command is as follows:
hbase> grant <user> <permiss... | [
{
"code": null,
"e": 2175,
"s": 2037,
"text": "We can grant and revoke permissions to users in HBase. There are three commands for security purpose: grant, revoke, and user_permission."
},
{
"code": null,
"e": 2329,
"s": 2175,
"text": "The grant command grants specific rights suc... |
SWING - JSpinner Class | The class JSpinner is a component which lets the user select a number or an object value from an ordered sequence using an input field.
Following is the declaration for javax.swing.JSpinner class −
public class JSpinner
extends JComponent
implements Accessible
JSpinner()
Constructs a spinner with an Integer S... | [
{
"code": null,
"e": 1899,
"s": 1763,
"text": "The class JSpinner is a component which lets the user select a number or an object value from an ordered sequence using an input field."
},
{
"code": null,
"e": 1961,
"s": 1899,
"text": "Following is the declaration for javax.swing.J... |
Angular CLI - Environment Setup | To work with Angular CLI, we need to have Node installed on our system. Let us understand about the environment setup required for Angular CLI in detail.
Download latest version of Node.js installable archive file from Node.js Downloads, which is available at https://nodejs.org/download/. At the time of writing this tu... | [
{
"code": null,
"e": 2229,
"s": 2075,
"text": "To work with Angular CLI, we need to have Node installed on our system. Let us understand about the environment setup required for Angular CLI in detail."
},
{
"code": null,
"e": 2461,
"s": 2229,
"text": "Download latest version of N... |
Which MySQL data type is used for long decimal? | For this, use DECIMAL(21,20). Let us first create a table −
mysql> create table DemoTable1493
-> (
-> LongValue DECIMAL(21,20)
-> );
Query OK, 0 rows affected (0.48 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1493 values(1.0047464644664677373);
Query OK, 1 row affec... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "For this, use DECIMAL(21,20). Let us first create a table −"
},
{
"code": null,
"e": 1241,
"s": 1122,
"text": "mysql> create table DemoTable1493\n -> (\n -> LongValue DECIMAL(21,20)\n -> );\nQuery OK, 0 rows affected (0.48 sec)... |
Feature Engineering. Improving a Linear Regression through... | by Andrew Cole | Towards Data Science | Last week, I published a blog which walked through all steps of the linear regression modeling process. In this post, we will manipulate the data slightly in order to decrease our model result metrics. We will then walk through the most critical step in any linear regression: Feature Engineering. All code can be found ... | [
{
"code": null,
"e": 593,
"s": 171,
"text": "Last week, I published a blog which walked through all steps of the linear regression modeling process. In this post, we will manipulate the data slightly in order to decrease our model result metrics. We will then walk through the most critical step in a... |
C++ program to get the Sum of series: 1 – x^2/2! + x^4/4! -.... upto nth term | In this tutorial, we will be discussing a program to get the sum of series 1 – x^2/2! + x^4/4! ... upto nth term.
For this we will be given with the values of x and n. Our task will be to calculate the sum of the given series upto the given n terms. This can be easily done by computing the factorial and using the stand... | [
{
"code": null,
"e": 1176,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to get the sum of series 1 – x^2/2! + x^4/4! ... upto nth term."
},
{
"code": null,
"e": 1422,
"s": 1176,
"text": "For this we will be given with the values of x and n. Our task will ... |
log4j - Configuration | The previous chapter explained the core components of log4j. This chapter explains how you can configure the core components using a configuration file. Configuring log4j involves assigning the Level, defining Appender, and specifying Layout objects in a configuration file.
The log4j.properties file is a log4j configur... | [
{
"code": null,
"e": 2101,
"s": 1826,
"text": "The previous chapter explained the core components of log4j. This chapter explains how you can configure the core components using a configuration file. Configuring log4j involves assigning the Level, defining Appender, and specifying Layout objects in ... |
Gensim - Creating LDA Mallet Model | This chapter will explain what is a Latent Dirichlet Allocation (LDA) Mallet Model and how to create the same in Gensim.
In the previous section we have implemented LDA model and get the topics from documents of 20Newsgroup dataset. That was Gensim’s inbuilt version of the LDA algorithm. There is a Mallet version of Ge... | [
{
"code": null,
"e": 2173,
"s": 2052,
"text": "This chapter will explain what is a Latent Dirichlet Allocation (LDA) Mallet Model and how to create the same in Gensim."
},
{
"code": null,
"e": 2518,
"s": 2173,
"text": "In the previous section we have implemented LDA model and get... |
How to Extract filename from a given path in C# - GeeksforGeeks | 04 Apr, 2019
While developing an application that can be desktop or web in C#, such kind of requirement to extract the filename from a given path (where the path can be taken while selecting a file using File Open dialog box or any other sources) can arise. A path may contain the drive name, directory name(s) and the f... | [
{
"code": null,
"e": 24528,
"s": 24500,
"text": "\n04 Apr, 2019"
},
{
"code": null,
"e": 25064,
"s": 24528,
"text": "While developing an application that can be desktop or web in C#, such kind of requirement to extract the filename from a given path (where the path can be taken w... |
Addition of two numbers without propagating Carry - GeeksforGeeks | 25 Mar, 2021
Given 2 numbers a and b of same length. The task is to calculate their sum in such a way that when adding two corresponding positions the carry has to be kept with them only instead of propagating to the left.See the below image for reference:
Examples:
Input: a = 7752 , b = 8834
Output: 151586
Input:... | [
{
"code": null,
"e": 25961,
"s": 25933,
"text": "\n25 Mar, 2021"
},
{
"code": null,
"e": 26207,
"s": 25961,
"text": "Given 2 numbers a and b of same length. The task is to calculate their sum in such a way that when adding two corresponding positions the carry has to be kept with... |
Why do we use internal keyword in C#? | Internal keyword allows you to set internal access specifier.
Internal access specifier allows a class to expose its member variables and member functions to other functions and objects in the current assembly.
Any member with internal access specifier can be accessed from any class or method defined within the applica... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "Internal keyword allows you to set internal access specifier."
},
{
"code": null,
"e": 1273,
"s": 1124,
"text": "Internal access specifier allows a class to expose its member variables and member functions to other functions and obje... |
Caffe2 - Quick Guide | Last couple of years, Deep Learning has become a big trend in Machine Learning. It has been successfully applied to solve previously unsolvable problems in Vision, Speech Recognition and Natural Language Processing (NLP). There are many more domains in which Deep Learning is being applied and has shown its usefulness.... | [
{
"code": null,
"e": 2112,
"s": 1791,
"text": "Last couple of years, Deep Learning has become a big trend in Machine Learning. It has been successfully applied to solve previously unsolvable problems in Vision, Speech Recognition and Natural Language Processing (NLP). There are many more domains in... |
Overlapping rectangles | Practice | GeeksforGeeks | Given two rectangles, find if the given two rectangles overlap or not. A rectangle is denoted by providing the x and y coordinates of two points: the left top corner and the right bottom corner of the rectangle. Two rectangles sharing a side are considered overlapping. (L1 and R1 are the extreme points of the first rec... | [
{
"code": null,
"e": 628,
"s": 238,
"text": "Given two rectangles, find if the given two rectangles overlap or not. A rectangle is denoted by providing the x and y coordinates of two points: the left top corner and the right bottom corner of the rectangle. Two rectangles sharing a side are considere... |
TypeScript | Array concat() Method | 18 Jun, 2020
The Array.concat() is an inbuilt TypeScript function which is used to merge two or more arrays together. Syntax:
array.concat(value1, value2, ..., valueN)
Parameter: This method accepts a single parameter multiple time as mentioned above and described below:
valueN : These parameters are arrays and/or val... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Jun, 2020"
},
{
"code": null,
"e": 166,
"s": 53,
"text": "The Array.concat() is an inbuilt TypeScript function which is used to merge two or more arrays together. Syntax:"
},
{
"code": null,
"e": 208,
"s": 166,
"... |
Python – Maximum in Row Range | 12 Nov, 2020
Given a range and a Matrix, extract the maximum element out of that range of rows.
Input : test_list = [[4, 3, 6], [9, 1, 3], [4, 5, 2], [9, 10, 3], [5, 9, 12], [3, 14, 2]], i, j = 2, 5 Output : 12 Explanation : Checks for rows 2, 3 and 4, maximum element is 12.
Input : test_list = [[4, 3, 6], [9, 1, 3], [... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Nov, 2020"
},
{
"code": null,
"e": 111,
"s": 28,
"text": "Given a range and a Matrix, extract the maximum element out of that range of rows."
},
{
"code": null,
"e": 291,
"s": 111,
"text": "Input : test_list = [[4... |
How to Restrict Dynamic Allocation of Objects in C++? | 21 Jun, 2022
C++ programming language allows both auto(or stack-allocated) and dynamically allocated objects. In Java & C#, all objects must be dynamically allocated using new. C++ supports stack-allocated objects for the reason of runtime efficiency. Stack-based objects are implicitly managed by the C++ compiler. They... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 689,
"s": 52,
"text": "C++ programming language allows both auto(or stack-allocated) and dynamically allocated objects. In Java & C#, all objects must be dynamically allocated using new. C++ suppor... |
How to detect “shift+enter” and generate a new line in Textarea? | 31 Oct, 2019
The text area tag defines a multi-line text input control. The size of a text area can be specified by the cols and rows attributes. By default, whenever we press “enter” or “shift+enter” it creates a new line in the text area. So, to only detect “shift+enter” and generate a new line from it we need to blo... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 430,
"s": 28,
"text": "The text area tag defines a multi-line text input control. The size of a text area can be specified by the cols and rows attributes. By default, whenever we press “enter” or “... |
How to make HTML table expand on click using JavaScript ? | 11 Jun, 2020
The expandable table can be achieved by using JavaScript with HTML. By Clicking on a row of the table, it expands and a sub-table pops up. When the user again clicks on that row the content will hide. This can be very useful when the data is complex but it is inter-related.
Example 1: The following example... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Jun, 2020"
},
{
"code": null,
"e": 303,
"s": 28,
"text": "The expandable table can be achieved by using JavaScript with HTML. By Clicking on a row of the table, it expands and a sub-table pops up. When the user again clicks on that r... |
MATLAB – Read images using imread() function | 12 Dec, 2021
MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for technical computing. It was developed by Cleve Molar of the company MathWorks.Inc in the year 1984. It is written in C, C++, Java. It allows matrix manipulations, plotting of functions, implementation of algorithms, and... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Dec, 2021"
},
{
"code": null,
"e": 366,
"s": 28,
"text": "MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for technical computing. It was developed by Cleve Molar of the company MathWorks.Inc in th... |
Spring – REST Controller | 26 Nov, 2021
Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and setup. Sp... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n26 Nov, 2021"
},
{
"code": null,
"e": 880,
"s": 53,
"text": "Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-rea... |
Sum of non-diagonal parts of a square Matrix | 16 May, 2022
Given a square matrix of size N X N, the task is to find the sum of all elements at each portion when the matrix is divided into four parts along its diagonals. The elements at the diagonals should not be counted in the sum.Examples:
Input: arr[][] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14,... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n16 May, 2022"
},
{
"code": null,
"e": 289,
"s": 53,
"text": "Given a square matrix of size N X N, the task is to find the sum of all elements at each portion when the matrix is divided into four parts along its diagonals. The elements ... |
Select Rows & Columns by Name or Index in Pandas DataFrame using [ ], loc & iloc | 10 Jul, 2020
Indexing in Pandas means selecting rows and columns of data from a Dataframe. It can be selecting all the rows and the particular number of columns, a particular number of rows, and all the columns or a particular number of rows and columns each. Indexing is also known as Subset selection.Let’s create a si... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 455,
"s": 52,
"text": "Indexing in Pandas means selecting rows and columns of data from a Dataframe. It can be selecting all the rows and the particular number of columns, a particular number of ro... |
How to close a window in Tkinter? | 09 Dec, 2020
Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create GUI applications. Cre... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Dec, 2020"
},
{
"code": null,
"e": 404,
"s": 54,
"text": "Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python in... |
GATE-CS-2015 (Set 3) - GeeksforGeeks | 08 Oct, 2021
Six selected members are P, Q, R, S, T and U
Portfolios are Home, Power, Defence, Telecom, and Finance.
U does not want any portfolio if S gets one of the five.
R wants either Home or Finance or no portfolio.
Q says that if S gets either Power of telecom, then she must
get the other one.
T insists... | [
{
"code": null,
"e": 29577,
"s": 29549,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 30401,
"s": 29577,
"text": "Six selected members are P, Q, R, S, T and U\n\nPortfolios are Home, Power, Defence, Telecom, and Finance. \n\nU does not want any portfolio if S gets one of the f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.