title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python | sympy.diff() method | 12 Jun, 2019
With the help of sympy.diff() method, we can find the differentiation of mathematical expressions in the form of variables by using sympy.diff() method.
Syntax : sympy.diff(expression, reference variable)Return : Return differentiation of mathematical expression.
Example #1 :In this example we can see that... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 181,
"s": 28,
"text": "With the help of sympy.diff() method, we can find the differentiation of mathematical expressions in the form of variables by using sympy.diff() method."
},
{
"code": ... |
String Fields in Serializers – Django REST Framework | 11 Jan, 2022
In Django REST Framework the very concept of Serializing is to convert DB data to a datatype that can be used by javascript. Every serializer comes with some fields (entries) which are going to be processed. For example if you have a class with name Employee and its fields as Employee_id, Employee_name, is... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Jan, 2022"
},
{
"code": null,
"e": 717,
"s": 28,
"text": "In Django REST Framework the very concept of Serializing is to convert DB data to a datatype that can be used by javascript. Every serializer comes with some fields (entries) ... |
Getting the Modulus of the Determinant of a Matrix in R Programming – determinant() Function | 03 Jun, 2020
determinant() function in R Language is a generic function that returns separately the modulus of the determinant, optionally on the logarithm scale, and the sign of the determinant.
Syntax: determinant(x, logarithm = TRUE, ...)
Parameters:x: matrixlogarithm: if TRUE (default) return the logarithm of the m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2020"
},
{
"code": null,
"e": 211,
"s": 28,
"text": "determinant() function in R Language is a generic function that returns separately the modulus of the determinant, optionally on the logarithm scale, and the sign of the deter... |
How to implement Android Pull-to-Refresh? | Before getting into example, we should know what is Pull to refresh layout in android . we can call pull to refresh in android as swipe-to-refresh. when you swipe screen from top to bottom it will do some action based on setOnRefreshListener.
This example demonstrate about how to implement android pull to refresh.
Step... | [
{
"code": null,
"e": 1305,
"s": 1062,
"text": "Before getting into example, we should know what is Pull to refresh layout in android . we can call pull to refresh in android as swipe-to-refresh. when you swipe screen from top to bottom it will do some action based on setOnRefreshListener."
},
{
... |
Difference between class alv and function alv in SAP ABAP? | Class alv and Function alv are different in terms of features. Below is the difference:
Class alv are secured as compared to function alv.
While using class alv, it improves the performance.
With use of function alv, you can create screens using function module however you need to call separate programs to generate scr... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "Class alv and Function alv are different in terms of features. Below is the difference:"
},
{
"code": null,
"e": 1201,
"s": 1150,
"text": "Class alv are secured as compared to function alv."
},
{
"code": null,
"e": 1253,
... |
How can we restrict access to methods with specific HTTP verbs in C# ASP.NET
WebAPI? | The HTTP verbs comprise a major portion of our “uniform interface” constraint and
provide us the action counterpart to the noun-based resource. The primary or mostcommonly-used HTTP verbs (or methods, as they are properly called) are POST,
GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and
delet... | [
{
"code": null,
"e": 1576,
"s": 1062,
"text": "The HTTP verbs comprise a major portion of our “uniform interface” constraint and\nprovide us the action counterpart to the noun-based resource. The primary or mostcommonly-used HTTP verbs (or methods, as they are properly called) are POST,\nGET, PUT, P... |
Git Pull Branch from Bitbucket | Now continue working on our new branch in our local Git.
Lets pull from our Bitbucket repository again so that our code is up-to-date:
git pull
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (3/3), 428 bytes | 5.00 ... | [
{
"code": null,
"e": 57,
"s": 0,
"text": "Now continue working on our new branch in our local Git."
},
{
"code": null,
"e": 135,
"s": 57,
"text": "Lets pull from our Bitbucket repository again so that our code is up-to-date:"
},
{
"code": null,
"e": 466,
"s": 135,... |
How to programmatically set drawableLeft on the Android button using Kotlin? | This example demonstrates how to programmatically set drawableLeft on the Android button using Kotlin.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" enc... | [
{
"code": null,
"e": 1165,
"s": 1062,
"text": "This example demonstrates how to programmatically set drawableLeft on the Android button using Kotlin."
},
{
"code": null,
"e": 1294,
"s": 1165,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and f... |
Do Not Use Python Pickle Unless You Know All These Points | by Christopher Tao | Towards Data Science | Compare with most of the other popular programming languages, Python probably has the most flexible serialisation of objects. In Python, everything is an object, so we can say that almost everything can be serialised. Yes, the module that I was talking about is Pickle.
However, compared with other “regular” serialising... | [
{
"code": null,
"e": 442,
"s": 172,
"text": "Compare with most of the other popular programming languages, Python probably has the most flexible serialisation of objects. In Python, everything is an object, so we can say that almost everything can be serialised. Yes, the module that I was talking ab... |
upper_bound in C++ | Here we will see that is the upper_bound() function in C++ STL. This function returns an iterator that points to the first element in the container, which is considered to go after val. The syntax is like:
iterator upper_bound (const value_type& val);
const_iterator upper_bound (const value_type& val) const;
The return... | [
{
"code": null,
"e": 1268,
"s": 1062,
"text": "Here we will see that is the upper_bound() function in C++ STL. This function returns an iterator that points to the first element in the container, which is considered to go after val. The syntax is like:"
},
{
"code": null,
"e": 1372,
... |
How to Generate Professional API Docs in Minutes from Docstrings | by Tirthajyoti Sarkar | Towards Data Science | We all love good and comprehensive documentation when we use a new library (or re-use our favorite one for the millionth time), don’t we?
Imagine how would you feel if they took away all the docs from Scikit-learn or TensorFlow website. You will feel pretty powerless, wouldn’t you?
Documentation is important. High-qual... | [
{
"code": null,
"e": 310,
"s": 172,
"text": "We all love good and comprehensive documentation when we use a new library (or re-use our favorite one for the millionth time), don’t we?"
},
{
"code": null,
"e": 455,
"s": 310,
"text": "Imagine how would you feel if they took away all... |
Class and Object in Java - GeeksQuiz | 07 Mar, 2018
values of obj1:
a = 11 b = 21
values of obj2:
a = 11 b = 21
values of obj1:
a = 11 b = 21
values of obj2:
a = 10 b = 20
values of obj1:
a = 11 b = 20
values of obj2:
a = 10 b = 21
a = 1
b = 2
b = 2
a = 1
Inside First
Inside Second
Inside First
Inside First
obj1.a = 1 obj1.b = 2
obj2.a = 4 obj2.b... | [
{
"code": null,
"e": 27610,
"s": 27582,
"text": "\n07 Mar, 2018"
},
{
"code": null,
"e": 27673,
"s": 27610,
"text": "values of obj1: \na = 11 b = 21\nvalues of obj2: \na = 11 b = 21\n"
},
{
"code": null,
"e": 27736,
"s": 27673,
"text": "values of obj1: \na = 1... |
Data Reveals: What Makes a Ted Talk Popular? | by Tomer Eldor | Towards Data Science | Well, I’ve analyzed a dataset of 2550 ted talks to get some answers for this question. I explored which of the available variables of a given talk, such as the number of comments, number of languages translated, duration of the talk, number of tags, or day it was published online– are a strong predictor of its populari... | [
{
"code": null,
"e": 525,
"s": 172,
"text": "Well, I’ve analyzed a dataset of 2550 ted talks to get some answers for this question. I explored which of the available variables of a given talk, such as the number of comments, number of languages translated, duration of the talk, number of tags, or da... |
Introduction to Classification Using K Nearest Neighbours | by Ashwin Raj | Towards Data Science | As machine learning practitioners, we come across a wide array of machine learning algorithms that we may exert to build a particular predictive model. In this article, I will be focusing on one of the most sophisticated learning algorithm known as K Nearest Neighbour. This algorithm can be used for dealing with both r... | [
{
"code": null,
"e": 536,
"s": 171,
"text": "As machine learning practitioners, we come across a wide array of machine learning algorithms that we may exert to build a particular predictive model. In this article, I will be focusing on one of the most sophisticated learning algorithm known as K Near... |
How to find p-value for correlation coefficient in R? | The t test is used to find the p−value for the correlation coefficient and on the basis of that we decide whether there exists a statistically significant relationship between two variables or not. In R, we can perform this test by using function cor.test. For example, if we have a vector x and y then we can find the p... | [
{
"code": null,
"e": 1410,
"s": 1062,
"text": "The t test is used to find the p−value for the correlation coefficient and on the basis of that we decide whether there exists a statistically significant relationship between two variables or not. In R, we can perform this test by using function cor.te... |
5 Principles to write SOLID Code. A guide to write better code with the... | by Alexandra Souly | Towards Data Science | As someone who recently started working as a Software Engineer with no formal Computer Science background, I have struggled a lot with coming up with sensible low-level designs and structuring code the right way. Initially, it helped me a lot to think of a checklist of 5 principles to follow, which I will share with yo... | [
{
"code": null,
"e": 508,
"s": 172,
"text": "As someone who recently started working as a Software Engineer with no formal Computer Science background, I have struggled a lot with coming up with sensible low-level designs and structuring code the right way. Initially, it helped me a lot to think of ... |
ABB Group Interview Experience for Software Engineer - GeeksforGeeks | 09 Dec, 2020
Hello everyone, I want to share my interview experience with ABB for the position of Software Engineer. I am surprised that no one has written a single experience for this post in the Company. This was a pooled campus drive for 3rd Gen IITs. The company allowed EE and CSE only.
Round 1: Three sections wer... | [
{
"code": null,
"e": 24948,
"s": 24920,
"text": "\n09 Dec, 2020"
},
{
"code": null,
"e": 25228,
"s": 24948,
"text": "Hello everyone, I want to share my interview experience with ABB for the position of Software Engineer. I am surprised that no one has written a single experience... |
How to visualize data from MySQL database by using Matplotlib in Python ? - GeeksforGeeks | 24 Jan, 2022
Prerequisites: Matplotlib in Python, MySQL
While working with Python we need to work with databases, they may be of different types like MySQL, SQLite, NoSQL, etc. In this article, we will be looking forward to how to connect MySQL databases using MySQL Connector/Python. MySQL Connector module of Python is... | [
{
"code": null,
"e": 25580,
"s": 25552,
"text": "\n24 Jan, 2022"
},
{
"code": null,
"e": 25623,
"s": 25580,
"text": "Prerequisites: Matplotlib in Python, MySQL"
},
{
"code": null,
"e": 26080,
"s": 25623,
"text": "While working with Python we need to work with ... |
CSS Stencil Effect - GeeksforGeeks | 01 Jul, 2020
The Stencil effect is a classical text effect that has emerged in the last decade. This type of effect is generally used in websites where the User Interface is not of main concern. Examples of such designs can be found on movie downloading websites where the interface is not the best looking as the main c... | [
{
"code": null,
"e": 26621,
"s": 26593,
"text": "\n01 Jul, 2020"
},
{
"code": null,
"e": 27080,
"s": 26621,
"text": "The Stencil effect is a classical text effect that has emerged in the last decade. This type of effect is generally used in websites where the User Interface is no... |
Check for None Tuple in Python | When it is required to check for 'None' value in a tuple, the 'all' method and the generator expression can be used.
The 'all' method checks to see if all the values inside an iterable are True values. If yes, it returns True, else returns False.
Below is a demonstration of the same −
Live Demo
my_tuple_1 = (None, None... | [
{
"code": null,
"e": 1179,
"s": 1062,
"text": "When it is required to check for 'None' value in a tuple, the 'all' method and the generator expression can be used."
},
{
"code": null,
"e": 1309,
"s": 1179,
"text": "The 'all' method checks to see if all the values inside an iterab... |
Replace every matrix element with maximum of GCD of row or column - GeeksforGeeks | 07 Mar, 2022
Given a matrix of n rows and m columns. The task is to replace each matrix element with Greatest Common Divisor of its row or column, whichever is maximum. That is, for each element (i, j) replace it from GCD of i’th row or GCD of j’th row, whichever is greater.Examples :
Input : mat[3][4] = {1, 2, 3, 3,... | [
{
"code": null,
"e": 24958,
"s": 24930,
"text": "\n07 Mar, 2022"
},
{
"code": null,
"e": 25233,
"s": 24958,
"text": "Given a matrix of n rows and m columns. The task is to replace each matrix element with Greatest Common Divisor of its row or column, whichever is maximum. That is... |
Construct a biomedical knowledge graph with NLP | by Tomaz Bratanic | Towards Data Science | I have already demonstrated how to create a knowledge graph out of a Wikipedia page. However, since the post got a lot of attention, I’ve decided to explore other domains where using NLP techniques to construct a knowledge graph makes sense. In my opinion, the biomedical field is a prime example where representing the ... | [
{
"code": null,
"e": 626,
"s": 172,
"text": "I have already demonstrated how to create a knowledge graph out of a Wikipedia page. However, since the post got a lot of attention, I’ve decided to explore other domains where using NLP techniques to construct a knowledge graph makes sense. In my opinion... |
Understanding Recursive Functions with Python - GeeksforGeeks | 15 Jul, 2021
Recursion is characterized as the process of describing something in terms of itself; in other words, it is the process of naming the function by itself. Recursion is the mechanism of a function calling itself directly or implicitly, and the resulting function is known as a Recursive function.
Code reusabi... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n15 Jul, 2021"
},
{
"code": null,
"e": 24196,
"s": 23901,
"text": "Recursion is characterized as the process of describing something in terms of itself; in other words, it is the process of naming the function by itself. Recursion... |
ASP.NET Core - Attribute Routes | In this chapter, we will learn another approach to routing and that is attribute-based routing. With attribute-based routing, we can use C# attributes on our controller classes and on the methods internally in these classes. These attributes have metadata that tell ASP.NET Core when to call a specific controller.
It is... | [
{
"code": null,
"e": 2776,
"s": 2461,
"text": "In this chapter, we will learn another approach to routing and that is attribute-based routing. With attribute-based routing, we can use C# attributes on our controller classes and on the methods internally in these classes. These attributes have metada... |
Check whether a Matrix is a Latin Square or not - GeeksforGeeks | 01 Feb, 2022
Given a square matrix of size N x N, the task is to check if it is Latin square or not.
A square matrix is a Latin Square if each cell of the matrix contains one of N different values (in the range [1, N]), and no value is repeated within a row or a column.
Examples:
Input: 1 2 3 4
2 1 4 3
3 ... | [
{
"code": null,
"e": 24249,
"s": 24221,
"text": "\n01 Feb, 2022"
},
{
"code": null,
"e": 24337,
"s": 24249,
"text": "Given a square matrix of size N x N, the task is to check if it is Latin square or not."
},
{
"code": null,
"e": 24507,
"s": 24337,
"text": "A ... |
How to turn JavaScript array into the comma-separated list? | To turn JavaScript array into a comma-separated list, use the Array.join() method. JavaScript array join() method joins all the elements of an array into a string. The following is the syntax −
array.join(separator);
The following is the parameter −
separator − Specifies a string to separate each element of the array. ... | [
{
"code": null,
"e": 1256,
"s": 1062,
"text": "To turn JavaScript array into a comma-separated list, use the Array.join() method. JavaScript array join() method joins all the elements of an array into a string. The following is the syntax −"
},
{
"code": null,
"e": 1279,
"s": 1256,
... |
Add element to HashSet in C# | To add the element to HashSet, the code is as follows −
Live Demo
using System;
using System.Collections.Generic;
public class Demo {
public static void Main(String[] args){
HashSet<string> set1 = new HashSet<string>();
set1.Add("A");
set1.Add("B");
set1.Add("C");
set1.Add("D");
... | [
{
"code": null,
"e": 1118,
"s": 1062,
"text": "To add the element to HashSet, the code is as follows −"
},
{
"code": null,
"e": 1129,
"s": 1118,
"text": " Live Demo"
},
{
"code": null,
"e": 2194,
"s": 1129,
"text": "using System;\nusing System.Collections.Gene... |
MySQL concatenation operator? | You can use in-built function CONCAT() from MySQL. The syntax is as follows −
SELECT CONCAT(('(',yourColumnName1,',', yourColumnName2,',',yourColumnName3,...N')')as anyVariableName from yourTableName;
To understand the above syntax, let us first create a table. The query to create a table is as follows −
mysql> create ... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "You can use in-built function CONCAT() from MySQL. The syntax is as follows −"
},
{
"code": null,
"e": 1263,
"s": 1140,
"text": "SELECT CONCAT(('(',yourColumnName1,',', yourColumnName2,',',yourColumnName3,...N')')as anyVariableName f... |
C# - Bitwise Operators | The Bitwise operators supported by C# are listed in the following table. Assume variable A holds 60 and variable B holds 13, then −
The following example demonstrates all the bitwise operators available in C# −
using System;
namespace OperatorsAppl {
class Program {
static void Main(string[] args) {
... | [
{
"code": null,
"e": 2402,
"s": 2270,
"text": "The Bitwise operators supported by C# are listed in the following table. Assume variable A holds 60 and variable B holds 13, then −"
},
{
"code": null,
"e": 2481,
"s": 2402,
"text": "The following example demonstrates all the bitwise... |
C++ Program to Sort an Array of 10 Elements Using Heap Sort Algorithm | Heap Sort is based on the binary heap data structure. In the binary heap the child nodes of a parent node are smaller than or equal to it in the case of a max heap, and the child nodes of a parent node are greater than or equal to it in the case of a min heap.
An example that explains all the steps in Heap Sort is as f... | [
{
"code": null,
"e": 1323,
"s": 1062,
"text": "Heap Sort is based on the binary heap data structure. In the binary heap the child nodes of a parent node are smaller than or equal to it in the case of a max heap, and the child nodes of a parent node are greater than or equal to it in the case of a mi... |
How to reverse the elements of an array using stack in java? | Stack is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc.
A stack is first in first out, it has two main operations push and pop. Push inserts data in to it and pop retrieves data fr... | [
{
"code": null,
"e": 1258,
"s": 1062,
"text": "Stack is an Abstract Data Type (ADT), commonly used in most programming languages. It is named stack as it behaves like a real-world stack, for example – a deck of cards or a pile of plates, etc."
},
{
"code": null,
"e": 1389,
"s": 1258,... |
Python Program to Count the Frequency of Words Appearing in a String Using a Dictionary | When it is required to count the frequency of words that appear in a string with the help of dictionary, the ‘split’ method is used to split the values, and a list comprehension is used.
The list comprehension is a shorthand to iterate through the list and perform operations on it.
A list can be used to store heterogen... | [
{
"code": null,
"e": 1249,
"s": 1062,
"text": "When it is required to count the frequency of words that appear in a string with the help of dictionary, the ‘split’ method is used to split the values, and a list comprehension is used."
},
{
"code": null,
"e": 1345,
"s": 1249,
"tex... |
D3.js - Data Join | Data join is another important concept in D3.js. It works along with selections and enables us to manipulate the HTML document with respect to our data set (a series of numerical values). By default, D3.js gives data set the highest priority in its methods and each item in the data set corresponds to a HTML element. Th... | [
{
"code": null,
"e": 2492,
"s": 2130,
"text": "Data join is another important concept in D3.js. It works along with selections and enables us to manipulate the HTML document with respect to our data set (a series of numerical values). By default, D3.js gives data set the highest priority in its meth... |
Convert a List to a Set in Java | In order to convert a List to a Set in Java, we can create an ArrayList and pass the List as an argument in the parameterized constructor of an HashSet. This can be done as follows −
List l = new ArrayList();
Set s = new HashSet(l);
Let us see a program to convert a list to a set in Java −
Live Demo
import java.util.A... | [
{
"code": null,
"e": 1245,
"s": 1062,
"text": "In order to convert a List to a Set in Java, we can create an ArrayList and pass the List as an argument in the parameterized constructor of an HashSet. This can be done as follows −"
},
{
"code": null,
"e": 1295,
"s": 1245,
"text": ... |
Spring Boot - File Handling | In this chapter, you will learn how to upload and download the file by using web service.
For uploading a file, you can use MultipartFile as a Request Parameter and this API should consume Multi-Part form data value. Observe the code given below −
@RequestMapping(value = "/upload", method = RequestMethod.POST, consumes... | [
{
"code": null,
"e": 3115,
"s": 3025,
"text": "In this chapter, you will learn how to upload and download the file by using web service."
},
{
"code": null,
"e": 3273,
"s": 3115,
"text": "For uploading a file, you can use MultipartFile as a Request Parameter and this API should c... |
How to calculate Real Active Users. What are the numbers? | by 💡Mike Shakhomirov | Towards Data Science | A complete SQL guide for marketers and machine learning engineers. MAU, DAU and WAU. Firebase and BigQuery example. Nifty report template included. Read how to copy it in the end of this article. It’s free!
Counting Active users in your App might be tricky. What would you do? Count — active deviceIds or active accounts... | [
{
"code": null,
"e": 378,
"s": 171,
"text": "A complete SQL guide for marketers and machine learning engineers. MAU, DAU and WAU. Firebase and BigQuery example. Nifty report template included. Read how to copy it in the end of this article. It’s free!"
},
{
"code": null,
"e": 493,
"s... |
Remove the top border from an element in Bootstrap 4 | Use the border-top-0 class to remove the top border from an element.
Set the class as if we add any other class to an element −
<div class="mystyle border border-top-0">
Top border is missing
</div>
Above, I have taken <div> as our element. Another class “mystyle” is also added that styles our div −
.mystyle {
widt... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "Use the border-top-0 class to remove the top border from an element."
},
{
"code": null,
"e": 1190,
"s": 1131,
"text": "Set the class as if we add any other class to an element −"
},
{
"code": null,
"e": 1263,
"s": 11... |
How to install TensorFlow GPU on UBUNTU 18.04 | by Sushrut Ashtikar | Towards Data Science | The rate of progress in the field of artificial intelligence is one of the most hotly contested aspects of the ongoing boom in teaching computers and robots how to see the world, make sense of it, and eventually perform complex tasks both in the physical realm and the virtual one. And just how fast the industry is movi... | [
{
"code": null,
"e": 797,
"s": 172,
"text": "The rate of progress in the field of artificial intelligence is one of the most hotly contested aspects of the ongoing boom in teaching computers and robots how to see the world, make sense of it, and eventually perform complex tasks both in the physical ... |
Easy Steps To Plot Geographic Data on a Map — Python | by Ahmed Qassim | Towards Data Science | Assume that you are working in a startup and you need to conduct spatial data analysis and prediction to users’ geographical data. Or your company runs a lot of delivery operations and your job again to analyze, visualize and maybe predict the drivers or users’ geographical data. So, visualizing your data (predicted on... | [
{
"code": null,
"e": 535,
"s": 172,
"text": "Assume that you are working in a startup and you need to conduct spatial data analysis and prediction to users’ geographical data. Or your company runs a lot of delivery operations and your job again to analyze, visualize and maybe predict the drivers or ... |
Java 8 How to check an Array contains a specific value ? | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorial, I am going to show you how ... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
JqueryUI - Accordion | Accordion Widget in jQueryUI is a jQuery based expandable and collapsible content holder that is broken into sections and probably looks like tabs. jQueryUI provides accordion() method to achieve this.
The accordion() method can be used in two forms −
$(selector, context).accordion (options) Method
$(selector, context)... | [
{
"code": null,
"e": 2466,
"s": 2264,
"text": "Accordion Widget in jQueryUI is a jQuery based expandable and collapsible content holder that is broken into sections and probably looks like tabs. jQueryUI provides accordion() method to achieve this."
},
{
"code": null,
"e": 2516,
"s":... |
Can we ignore duplicate rows in COUNT? | Yes, we can ignore duplicate rows in COUNT using DISTINCT. Following is the syntax:
select count(distinct yourColumnName) from yourTableName;
In MySQL, COUNT() will display the number of rows. DISTINCT is used to ignore duplicate rows and get the count of only unique rows.
Let us first create a table:
mysql> create tab... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "Yes, we can ignore duplicate rows in COUNT using DISTINCT. Following is the syntax:"
},
{
"code": null,
"e": 1204,
"s": 1146,
"text": "select count(distinct yourColumnName) from yourTableName;"
},
{
"code": null,
"e": 133... |
Vector Autoregressive for Forecasting Time Series | by Sarit Maitra | Towards Data Science | ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nVector auto-regression (VAR) time series model has wide application in econometric forecasting model; VAR can capture the evolution and the inter-dependencies between multiple time-series. All the variables in a VAR are treated symmetrically by including for each variable an equation explaining its evolution based on its own lags and the lags of all the other variables in the model. We may call this as scientific method for trading strategy.\nAdvantage of using the scientific method for trading strategy design is that if the strategy fails after a prior period of profitability, it is possible to revisit the initial hypothesis and re-evaluate it, potentially leading to a new hypothesis that leads to regained profitability for a strategy.\nWe have four time series here for Brent crude; USA & Europe price, West Texas crude price and OPEC crude price. We will develop a regression model and shall try to predict Brent Crude Oil, USA price given all the series in our model.\nplt.plot(df['opec'], label=\"opec\")plt.plot(df['euro'], label=\"Euro\")plt.plot(df['br_crude'], label=\"Brent Crude Oil\")plt.plot(df['wti'], label=\"West Texas\")plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)plt.title('Opec Oil, Europe Brent Crude, Brent Crude Oil & West Texas Price over Time')plt.show()\nWe can see here, all the series follow a stochastic trend, showing stronger inter-temporal variation with larger drops; more so, all of the series seem to be related in some way. Neither series looks stationary in its levels. They appear to have a common trend, an indication that they may be co-integrated.\nplt.title('IQR plot for all variables')sns.boxplot(x=df)plt.show()\nWe can see one small outlier in the data, which can be ignored.\nVAR model describe the dynamic interrelationship among stationary variables. So, the first step in time-series analysis should be unit root test to determine whether the series are stationary.\npearsoncorr = df.corr(method='pearson')sns.heatmap(pearsoncorr,xticklabels=pearsoncorr.columns,yticklabels=pearsoncorr.columns,cmap='RdBu_r',annot=True,linewidth=0.5)plt.show()\nThough correlations are often used in all multivariate financial time-series use cases, however, correlations could be quite unstable. Moreover, ADF or Hurst Exponent helps us to statistically confirm whether this series is mean-reverting. However, we cannot determine the hedging ratio needed to form the linear combination from these tests, they will only tell us whether, for a particular , the linear combination is stationary. The alternate arrangements is cointegration which is probably a more robust measure of linkage between two financial series.\nADF test says that, if a price series possesses mean reversion, then the next price level will be proportional to the current price level. Mathematically, the ADF is based on the idea of testing for the presence of a unit root in an autoregressive time series sample.\ndef adfuller_test(series, signif=0.05, name='', verbose=False): r = adfuller(series, autolag='AIC') output = {'test_statistic':round(r[0], 4), 'pvalue':round(r[1], 4), 'n_lags':round(r[2], 4), 'n_obs':r[3]} p_value = output['pvalue']def adjust(val, length= 6): return str(val).ljust(length)print(f'Augmented Dickey-Fuller Test on \"{name}\"', \"\\n \", '-'*47)print(f'Null Hypothesis: Data has unit root. Non-Stationary.')print(f'Significance Level = {signif}')print(f'Test Statistic = {output[\"test_statistic\"]}')print(f'No. Lags Chosen = {output[\"n_lags\"]}')for key,val in r[4].items(): print(f' Critical value {adjust(key)} = {round(val, 3)}') if p_value <= signif: print(f\" => P-Value = {p_value}. Rejecting Null Hypothesis.\") print(f\" => Series is Stationary.\") else: print(f\" => P-Value = {p_value}. Weak evidence to reject the Null Hypothesis.\") print(f\" => Series is Non-Stationary.\")\nNone of the statistic even close to being significant at the 5% level. So, we can confidently say that the series are non-stationary in level. Their co-integration is explored and in each case (p-values > 0.05), the null hypothesis of non-stationarity cannot be rejected at any reasonable level of significance.\nThe steps in the cointegration test procedure:\nTest for a unit root in each component series individually, using the univariate unit root tests, say ADF, PP test.If the unit root cannot be rejected, then the next step is to test cointegration among the components, i.e., to test whether αYt is I(0).\nTest for a unit root in each component series individually, using the univariate unit root tests, say ADF, PP test.\nIf the unit root cannot be rejected, then the next step is to test cointegration among the components, i.e., to test whether αYt is I(0).\nIf we find that the time series as a unit root, then we move on to the cointegration process. There are three main methods for testing for cointegration: Johansen, Engle-Granger, and Phillips-Ouliaris. We will use the Engle-Granger test. By employing co-integration test we will examine if there is a cointegrated, long-run relationship between wti price index and br_crude price index. Mathematically, we will consider the cointegrated relationship:\nEngle & Granger’s two-step residual-based testing procedure first estimates a cross-sectional regression, and then tests the residuals from this regression using an ADF distribution with modified critical values.\nHere a vector of observations is recorded at each time point. In such cases, there may be some linear combinations of the vectors that form stationary time-series and other linear combinations that are non-stationary.\nFrom above model residual plot it appears that mean is 0, it might have a trend in it.\nThe estimated co-integrating vector is very close to [+1, −1], indicating a simple no-arbitrage relationship. Let us rerun the test with both a constant and a time trend (“ct”). Our test statistic of -4.231< critical values at the 5% (-3.79) and 10% ( 3.50) level; p-values < 0.05 and we can reject the null hypothesis of no co-integration.\nThe residuals are clearly mean zero but show evidence of a structural break around current year (2020).\nLikewise, we have tested the other possible combination of pairs to obtain the similar output.\nAlthough the Engle-Granger approach is quite easy to use, one of its major drawbacks is that it can estimate only up to one co-integrating relationship between the variables.\nHere, we have more than 1 variables, there can potentially be more than one linearly independent co-integrating relationship.\nThere is an ongoing debate on p-value in real-life business case. p-value may look good on published articles, but it was never meant to be used the way it’s used today. For more details please read this interesting article. Traditionally, p-value <0.05 is the criterion for significance.\nNow, we will fit a regression between time series using OLS and visualize the residuals plot. If residuals are stationary, we can safely assume that, the given series are really cointegrated.\nresiduals = results.residbr_crude_fit = results.fittedvaluesfig = plt.figure(1)ax1 = fig.add_subplot(111)ax1.plot(br_crude_fit, label='Linear Prediction')ax1.plot(df['br_crude'], label='Brent Crude-USA')ax1.set_xlabel('Date')ax1.legend(loc=0)ax2 = plt.twinx()ax2.set_ylabel('Residuals')ax2.plot(residuals, label='Residuals')ax2.legend(loc=0)plt.grid(True)plt.show()\nThe levels of the residuals (red line), which looks like a stationary series than the original series (blue line). Here, we can see that, the actual and fitted lines are indistinguishable.\nLet us now perform an ADF test on the residual series. We have used DFGLS test and specify 12 lags as the maximum lag order for DFGLS regressions.\nThe number of lags suggests an optimal lag length of 7. Our test statistic (–7.059) < Critical Values at 1%, 5% & 10% and null hypothesis of no cointegration can be rejected.\nBD is more general than DW and allows us to test for higher order auto-correlation.\nThe distribution of the residuals looks like a bell-shape although there are some outliers which might lead to skewness.\nχ2 two-tailed p-value for the test equals zero means we accept the null hypothesis of residuals are overall normally distributed, i.e., both the kurtosis and the skewness are those of a normal distribution.\nVAR method models the next step in each time series using an AR model. The notation for the model involves specifying the order for the AR(p) model as parameters to a VAR function {VAR(p)}.\nLet us take the first differences of the series and try ADF again. Usually, if the levels time series are not stationary, the first differences will be. Data differencing is, more or less, calculating the amount the time series changes from one value to the next.\ndf = df [['br_crude', 'wti', 'opec', 'euro']]nobs = 5df_train, df_test = df[0:-nobs], df[-nobs:]print(df_train.shape)print(df_test.shape)df_tr_diff = df_train.diff()df_tr_diff.dropna(inplace=True)print(df_tr_diff.head())df_tr_diff.plot(figsize=(10,6), linewidth=5, fontsize=20)plt.show()\nCreating a training and test set for time series problems is tricky considering the time component. Any wrong move at this stage will disrupt the pattern in the series. The test set should be created considering the date and time values.\nNow we repeat all of the above steps for the First-Difference of data frame.\n# ADF Test on each columnfor name, column in df_tr_diff.iteritems():adfuller_test(column, name=column.name)\nHere, we see all the series are stationary after first difference.\nvar_model = smt.VAR(df_tr_diff)res = var_model.select_order(maxlags=10)print(res.summary())\n#Fit VAR modelvar_model = VAR(endog=df_tr_diff)var_model_fit = var_model.fit(maxlags=10)#Print a summary of the model resultsvar_model_fit.summary()\nWhat we really want to focus on in the model summary is the equation for br_crude, where br_crude estimates the other prices based on lagged values of itself and lagged prices of other variables. Higher the t-statistic value, the more likely that we can reject the H0 and more likely there is a correlation between the two variables. p-values are also used to reject the null hypothesis. The lower the p-value, the stronger the evidence against the null hypothesis.\nEstimating the equations of a VAR does not really need strong assumptions; however, calculating impulse response functions (IRFs) or variance decompositions do require identifying restrictions. A typical restriction takes the form of an assumption about the dynamic relationship between a pair of variables, for example, that x affects y only with a lag, or that x does not affect y in the long run\nLet us visualize the impact of changes in one variable on the others at different horizons using impulse responses plot.\n# Impulse Response Analysisirf = var_model_fit.irf(20)irf.plot()plt.show()\nGiven the parameter estimates and the Engle Granger test results, the linkages between the series are established here. It can be seen that, the responses to the shocks are captured here, and they die down to almost after 10th lag.\nThe effect that a shock to the br_crude price has on the other prices and other values of themselves are shown in the first row of the FEVD plot. The % of the errors attributable to own shocks is 100% in the case of the br_crude price (dark black bar), for wti series explains around 40% of the variation in returns; for opec around 60% and for the euro series explains around 70% of the variation.\nNote: Concept of above tests procedures have been taken from Brooks (2019); see the reference section.\nNow the model is built, let us generate and compare the predictions to actual data in the test/validation set.\n# Get the lag orderlag_order = var_model_fit.k_arprint(lag_order)# Input data for forecastinginput_data = df_tr_diff.values[-lag_order:]print(input_data)# forecastingpred = var_model_fit.forecast(y=input_data, steps=nobs)pred = (pd.DataFrame(pred, index=df_test.index, columns= df.columns + '_pred'))print(pred)\ndef invert_transformation(df_tr_diff, pred): forecast = pred.copy() columns = df_train.columnsfor col in columns: forecast[str(col)+'_pred'] = df_train[col].iloc[-1] + forecast[str(col)+'_pred'].cumsum() return forecastoutput = invert_transformation(df_tr_diff, pred)output.loc[:, ['br_crude_pred']]\n# forecast biasforecast_errors = [combine['br_crude'][i]- combine['br_crude_pred'][i] for i in range(len(combine['br_crude']))]bias = sum(forecast_errors) * 1.0/len(combine['br_crude'])print('Bias: %f' % bias)# MAEmae = mean_absolute_error(combine['br_crude'], combine['br_crude_pred'])print('MAE: %f' % mae)# MSE & RMSEmse = mean_squared_error(combine['br_crude'], combine['br_crude_pred'])print('MSE: %f' % mse)rmse = sqrt(mse)print('RMSE: %f' % rmse)\ncombine = pd.concat([df_test['br_crude'], output['br_crude_pred']], axis=1)combine['accuracy'] = round(combine.apply(lambda row: row.br_crude_pred /row.br_crude *100, axis = 1),2)combine['accuracy'] = pd.Series([\"{0:.2f}%\".format(val) for val in combine['accuracy']],index = combine.index)combine = combine.assign(day_of_week = lambda x: x.index.day_name())combine = combine.round(decimals=2)combine = combine.reset_index()combine\nfig = go.Figure()fig.add_trace(go.Scatter(x=combine['Date'], y=combine['br_crude'], name=\"Actual Crude price\"))fig.add_trace(go.Scatter(x=combine['Date'],y=combine['br_crude_pred'],name=\"Predicted crude price\"))fig.update_layout(title=\"Actual vs Predicted Brent Crude Price\",xaxis_title=\"Date\", yaxis_title=\"Price\", font=dict(family=\"Courier New, monospace\",size=18,color=\"#7f7f7f\"))fig.update_layout(autosize=False,width=1000,height=400,)fig.update_layout(legend_orientation=\"h\")fig.show()\nOnce we have a model for our data, it’s important to analyze how we can evaluate its quality. The first option is to use the residuals. Residuals basically the squared difference between the predicted values and actual values. This could be a simple option to judge the accuracy of our model.\nResiduals are proportional to the amount of data that we use to create the model. Therefore, it is not advisable to use the sum of all the residuals. One option could be to divide the residual by the number of time instants multiplied by the number of dependent variables.\nI can be reached here.\nReferences:\nHamilton J.D.A., 1994. The time series analysis. New Jersey, Princeton University Press.Engle, R.F., Granger, C.W.J, 1987. Co-integration and error correction: Representation, estimation and testing. Econometrica. 55, 251–276.Brooks, C. (2019). Introductory econometrics for finance. Cambridge university press.\nHamilton J.D.A., 1994. The time series analysis. New Jersey, Princeton University Press.\nEngle, R.F., Granger, C.W.J, 1987. Co-integration and error correction: Representation, estimation and testing. Econometrica. 55, 251–276.\nBrooks, C. (2019). Introductory econometrics for finance. Cambridge university press." | [
{
"code": null,
"e": 215,
"s": 172,
"text": "https://sarit-maitra.medium.com/membership"
},
{
"code": null,
"e": 661,
"s": 215,
"text": "Vector auto-regression (VAR) time series model has wide application in econometric forecasting model; VAR can capture the evolution and the int... |
Compare two strings lexicographically in Java. | The compareTo() method of the String class. This method compares two Strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument stri... | [
{
"code": null,
"e": 1406,
"s": 1062,
"text": "The compareTo() method of the String class. This method compares two Strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicogra... |
Content Placeholder Animation using Shimmer in Android - GeeksforGeeks | 22 Feb, 2021
We have seen a unique design for loading screen which is seen in Facebook for loading purpose and it is also used to display the content placeholder for the purpose of loading. GitHub provides this type of loading placeholder, and it looks beautiful than the normal progress bar. In this article, we will ta... | [
{
"code": null,
"e": 25036,
"s": 25008,
"text": "\n22 Feb, 2021"
},
{
"code": null,
"e": 25435,
"s": 25036,
"text": "We have seen a unique design for loading screen which is seen in Facebook for loading purpose and it is also used to display the content placeholder for the purpos... |
Java Program to subtract months from current date using Calendar.add() method | Import the following package for Calendar class in Java.
import java.util.Calendar;
Firstly, create a Calendar object and display the current date and time.
Calendar calendar = Calendar.getInstance();
System.out.println("Current Date and Time = " + calendar.getTime());
Now, let us decrement the months using the calenda... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "Import the following package for Calendar class in Java."
},
{
"code": null,
"e": 1146,
"s": 1119,
"text": "import java.util.Calendar;"
},
{
"code": null,
"e": 1219,
"s": 1146,
"text": "Firstly, create a Calendar ... |
AWT WindowAdapter Class | The class WindowAdapter is an abstract (adapter) class for receiving window events. All methods of this class are empty. This class is convenience class for creating listener objects.
Following is the declaration for java.awt.event.WindowAdapter class:
public abstract class WindowAdapter
extends Object
impleme... | [
{
"code": null,
"e": 1931,
"s": 1747,
"text": "The class WindowAdapter is an abstract (adapter) class for receiving window events. All methods of this class are empty. This class is convenience class for creating listener objects."
},
{
"code": null,
"e": 2000,
"s": 1931,
"text":... |
8085 program for pulse waveform - GeeksforGeeks | 31 Jan, 2022
Problem – Write a program to generate continuous square wave. Use D0 bit to output the square wave. The required waveform is:
Explanation –The alternate pattern of 0/1 bits can be provided by loading the accumulator with AAH(10101010) and rotating the pattern once through each loop. Bit D0 of the output po... | [
{
"code": null,
"e": 24726,
"s": 24698,
"text": "\n31 Jan, 2022"
},
{
"code": null,
"e": 24852,
"s": 24726,
"text": "Problem – Write a program to generate continuous square wave. Use D0 bit to output the square wave. The required waveform is:"
},
{
"code": null,
"e": ... |
Read and write tar archive files using Python (tarfile) | The ‘tar’ utility was originally introduced for UNIX operating system. Its purpose is to collect multiple files in a single archive file often called tarball which makes it easy to distribute the files. Functions in tarfile module of Python’s standard library help in creating tar archives and extracting from the tarbal... | [
{
"code": null,
"e": 1501,
"s": 1062,
"text": "The ‘tar’ utility was originally introduced for UNIX operating system. Its purpose is to collect multiple files in a single archive file often called tarball which makes it easy to distribute the files. Functions in tarfile module of Python’s standard l... |
How to create a vertical tab menu with CSS and JavaScript?
| To create a vertical tab menu with CSS and JavaScript, the code is as follows −
Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box
}
.tab {
float: left;
border: 1px solid blue;
background-color: black;
width: 20... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "To create a vertical tab menu with CSS and JavaScript, the code is as follows −"
},
{
"code": null,
"e": 1153,
"s": 1142,
"text": " Live Demo"
},
{
"code": null,
"e": 2925,
"s": 1153,
"text": "<!DOCTYPE html>\n<ht... |
Minimum number of coins that make a given value | There is a list of coin C(c1, c2, ......Cn) is given and a value V is also given. Now the problem is to use the minimum number of coins to make the chance V.
Note: Assume there is the infinite number of coins C.
In this problem, we will consider a set of different coins C{1, 2, 5, 10} are given, There is the infinite n... | [
{
"code": null,
"e": 1220,
"s": 1062,
"text": "There is a list of coin C(c1, c2, ......Cn) is given and a value V is also given. Now the problem is to use the minimum number of coins to make the chance V."
},
{
"code": null,
"e": 1274,
"s": 1220,
"text": "Note: Assume there is th... |
Access Modifiers in Java - GeeksforGeeks | 25 May, 2021
As the name suggests access modifiers in Java helps to restrict the scope of a class, constructor, variable, method, or data member. There are four types of access modifiers available in java:
Default – No keyword requiredPrivateProtectedPublic
Default – No keyword required
Private
Protected
Public
Defaul... | [
{
"code": null,
"e": 28559,
"s": 28531,
"text": "\n25 May, 2021"
},
{
"code": null,
"e": 28753,
"s": 28559,
"text": "As the name suggests access modifiers in Java helps to restrict the scope of a class, constructor, variable, method, or data member. There are four types of access... |
JavaScript - Date parse() Method | Javascript date parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970.
Its syntax is as follows −
Date.parse(datestring)
Note − Parameters in the bracket are always optional.
datestring − A string representing a date
Number of milliseconds since midnight of January... | [
{
"code": null,
"e": 2591,
"s": 2466,
"text": "Javascript date parse() method takes a date string and returns the number of milliseconds since midnight of January 1, 1970."
},
{
"code": null,
"e": 2618,
"s": 2591,
"text": "Its syntax is as follows −"
},
{
"code": null,
... |
Why an interface cannot implement another interface in Java? | An interface cannot implement another interface in Java.
An interface in Java is essentially a special kind of class. Like classes, the interface contains methods and variables. Unlike classes, interfaces are always completely abstract.
An interface is defined just like a class except for the keyword interface in place... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "An interface cannot implement another interface in Java."
},
{
"code": null,
"e": 1299,
"s": 1119,
"text": "An interface in Java is essentially a special kind of class. Like classes, the interface contains methods and variables. Unli... |
How to use SQLCA in a COBOL-DB2 program? What is the purpose of SQLCA? | SQLCA stands for SQL-Communication Area. It is a medium through which DB2 can
communicate with the COBOL program. In a typical COBOL-DB2 program, there are many
SQL statements used. The main purpose of SQLCA is to inform the COBOL program about
the status and other details of the most recently executed SQL query.
The S... | [
{
"code": null,
"e": 1377,
"s": 1062,
"text": "SQLCA stands for SQL-Communication Area. It is a medium through which DB2 can\ncommunicate with the COBOL program. In a typical COBOL-DB2 program, there are many\nSQL statements used. The main purpose of SQLCA is to inform the COBOL program about\nthe s... |
Learn how to find and list down recently modified files in linux | Are you working with thousands of files? Do you forget the recently modified documents in Linux? but know where you have saved those files.? Then, this article is for you to identify and list down recently modified records in Linux.
The following command is helpful to identify sorted files in the reverse order of updat... | [
{
"code": null,
"e": 1295,
"s": 1062,
"text": "Are you working with thousands of files? Do you forget the recently modified documents in Linux? but know where you have saved those files.? Then, this article is for you to identify and list down recently modified records in Linux."
},
{
"code"... |
Implement Queue using Linked List | Practice | GeeksforGeeks | Implement a Queue using Linked List.
A Query Q is of 2 Types
(i) 1 x (a query of this type means pushing 'x' into the queue)
(ii) 2 (a query of this type means to pop an element from the queue and print the poped element)
Example 1:
Input:
Q = 5
Queries = 1 2 1 3 2 1 4 2
Output: 2 3
Explanation: n the first tes... | [
{
"code": null,
"e": 468,
"s": 238,
"text": "Implement a Queue using Linked List. \nA Query Q is of 2 Types\n(i) 1 x (a query of this type means pushing 'x' into the queue)\n(ii) 2 (a query of this type means to pop an element from the queue and print the poped element)"
},
{
"code": ... |
C++ | Inheritance | Question 3 - GeeksforGeeks | 28 Jun, 2021
Assume that an integer takes 4 bytes and there is no alignment in following classes, predict the output.
#include<iostream>using namespace std; class base { int arr[10];}; class b1: public base { }; class b2: public base { }; class derived: public b1, public b2 {}; int main(void){ cout << sizeof(d... | [
{
"code": null,
"e": 24242,
"s": 24214,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24347,
"s": 24242,
"text": "Assume that an integer takes 4 bytes and there is no alignment in following classes, predict the output."
},
{
"code": "#include<iostream>using namespace s... |
Cognizant GenC Next Interview Experience - GeeksforGeeks | 05 Oct, 2021
Cognizant was hiring from on-campus through the Digital Nurture learning platform. Digital Base 2 students were eligible for the Genc next profile.
Round 1: It was a 2 hours exam that consists of questions on
Java
HTML,CSS, JavaScript
C#
RDBMS
The students need to secure 60% in this round and then they wer... | [
{
"code": null,
"e": 25028,
"s": 25000,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 25176,
"s": 25028,
"text": "Cognizant was hiring from on-campus through the Digital Nurture learning platform. Digital Base 2 students were eligible for the Genc next profile."
},
{
"... |
Model Complexity, Accuracy and Interpretability | by Ann Sajee | Towards Data Science | Complex Real-world challenges requires complex models to be build to give out predictions with utmost accuracy. However, they do not end up being highly interpretable. In this article, we will be looking into the relationship between complexity, accuracy and interpretability.
I am currently working as a Machine Learnin... | [
{
"code": null,
"e": 448,
"s": 171,
"text": "Complex Real-world challenges requires complex models to be build to give out predictions with utmost accuracy. However, they do not end up being highly interpretable. In this article, we will be looking into the relationship between complexity, accuracy ... |
How to execute an external program like windows media player in Java? | Java provides a class named java.lang.Runtime, using this class you can interface with the current environment.
The getRunTime() (static) method of this class returns a Runtime object associated with the current application.
The exec() method accepts a String value representing the command to execute a process in the c... | [
{
"code": null,
"e": 1174,
"s": 1062,
"text": "Java provides a class named java.lang.Runtime, using this class you can interface with the current environment."
},
{
"code": null,
"e": 1287,
"s": 1174,
"text": "The getRunTime() (static) method of this class returns a Runtime objec... |
C# | Array.Clear() Method - GeeksforGeeks | 19 Dec, 2019
This method is used to set a range of elements in an array to the default value of each element type.
Syntax:
public static void Clear (Array array, int index, int length);
Parameters:
array: It is an array whose elements need to be cleared.index: It is the starting index of the range of elements to clear.... | [
{
"code": null,
"e": 25088,
"s": 25060,
"text": "\n19 Dec, 2019"
},
{
"code": null,
"e": 25190,
"s": 25088,
"text": "This method is used to set a range of elements in an array to the default value of each element type."
},
{
"code": null,
"e": 25198,
"s": 25190,
... |
New line separator doesn't work for group_concat function in MySQL? How to use it correctly? | To use new line separator in group_concat() function, follow the below syntax −
select group_concat(concat_ws(' ',yourColumnName1, yourColumnName2) SEPARATOR "\r\n") from yourTableName;
Let us first create a table −
mysql> create table DemoTable
(
Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
FirstName varchar(2... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "To use new line separator in group_concat() function, follow the below syntax −"
},
{
"code": null,
"e": 1248,
"s": 1142,
"text": "select group_concat(concat_ws(' ',yourColumnName1, yourColumnName2) SEPARATOR \"\\r\\n\") from yourTab... |
How to loop through all the elements of an array in C#? | Firstly, set an array and initialize it −
int[] arr = new int[] {34, 56, 12};
To loop through all the elements of an array −
for (int i = 0; i < arr.Length; i++) {
Console.WriteLine(arr[i]);
}
Let us see the complete code −
using System;
public class Program {
public static void Main() {
int[] arr = new int... | [
{
"code": null,
"e": 1104,
"s": 1062,
"text": "Firstly, set an array and initialize it −"
},
{
"code": null,
"e": 1140,
"s": 1104,
"text": "int[] arr = new int[] {34, 56, 12};"
},
{
"code": null,
"e": 1187,
"s": 1140,
"text": "To loop through all the elements ... |
Difference between List comprehension and Lambda in Python - GeeksforGeeks | 10 Jul, 2020
List comprehension: List comprehension is an elegant way to define and create a list in python. We can create lists just like mathematical statements and in one line only. The syntax of list comprehension is easier to grasp. A list comprehension generally consists of these parts :
Output expression,
Input ... | [
{
"code": null,
"e": 24882,
"s": 24854,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 25164,
"s": 24882,
"text": "List comprehension: List comprehension is an elegant way to define and create a list in python. We can create lists just like mathematical statements and in one li... |
hashlib.sha3_256() in Python - GeeksforGeeks | 22 Apr, 2020
With the help of hashlib.sha3_256() method, we can convert the normal string in byte format is converted to an encrypted form. Passwords and important files can be converted into hash to protect them with the help of hashlib.sha3_256() method.
Syntax : hashlib.sha3_256()
Return : Return the hash code for t... | [
{
"code": null,
"e": 23964,
"s": 23936,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 24208,
"s": 23964,
"text": "With the help of hashlib.sha3_256() method, we can convert the normal string in byte format is converted to an encrypted form. Passwords and important files can be... |
7 Examples to Master Line Plots With Python Seaborn | by Soner Yıldırım | Towards Data Science | Data visualization is an integral part of data science. It helps us explore a dataset and the relationships between variables to create proper data visualizations. They are also highly efficient tools to deliver results and findings.
There are several different kinds of data visualizations. One of the most commonly use... | [
{
"code": null,
"e": 406,
"s": 172,
"text": "Data visualization is an integral part of data science. It helps us explore a dataset and the relationships between variables to create proper data visualizations. They are also highly efficient tools to deliver results and findings."
},
{
"code":... |
Access Google Drive Using Google Colab Running an R Kernel | by Kate Wall | Towards Data Science | This article describes a step-by-step approach for using Google Colaboratory with an R kernel.
As an engineer and biostatistician, I code primarily in python and R. Within the last six months, I have decided, for small projects, it is fastest to share code with others through Google Drive and Google Colaboratory. The c... | [
{
"code": null,
"e": 267,
"s": 172,
"text": "This article describes a step-by-step approach for using Google Colaboratory with an R kernel."
},
{
"code": null,
"e": 791,
"s": 267,
"text": "As an engineer and biostatistician, I code primarily in python and R. Within the last six m... |
Format date while inserting records in MySQL | To format date while inserting records, use DATE_FORMAT() in the MySQL INSERT statement. Let us first create a table −
mysql> create table DemoTable2012
-> (
-> ShippingDate varchar(20)
-> );
Query OK, 0 rows affected (0.48 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTab... | [
{
"code": null,
"e": 1181,
"s": 1062,
"text": "To format date while inserting records, use DATE_FORMAT() in the MySQL INSERT statement. Let us first create a table −"
},
{
"code": null,
"e": 1300,
"s": 1181,
"text": "mysql> create table DemoTable2012\n -> (\n -> ShippingDate ... |
Count of lines required to write the given String in C++ | We are given a string Str of alphabets and an array widths[]containing width of all English alphabets. The goal is to find the number of lines required to print this string on a page which has a width of 10 characters. Also print remaining characters.
We will traverse the string check width of the current character and... | [
{
"code": null,
"e": 1314,
"s": 1062,
"text": "We are given a string Str of alphabets and an array widths[]containing width of all English alphabets. The goal is to find the number of lines required to print this string on a page which has a width of 10 characters. Also print remaining characters."
... |
GATE | GATE-CS-2003 | Question 58 - GeeksforGeeks | 17 Dec, 2021
Consider the translation scheme shown below
S → T R
R → + T {print ('+');} R | ε
T → num {print (num.val);}
Here num is a token that represents an integer and num.val represents the corresponding integer value. For an input string ‘9 + 5 + 2’, this translation scheme will print(A) 9 + 5 + 2(B) 9 5 + 2 +(C... | [
{
"code": null,
"e": 24376,
"s": 24348,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 24420,
"s": 24376,
"text": "Consider the translation scheme shown below"
},
{
"code": null,
"e": 24485,
"s": 24420,
"text": "S → T R\nR → + T {print ('+');} R | ε\nT → num... |
QuickStart: spaCy on AWS Lambda Up and Running in 10 Minutes | by Sean Zhai | Towards Data Science | Let’s keep our promise and get it done first. Further discussion follows the QuickStart section if you want to read further. I hope this arrangement could save you time.
Log in to the AWS account. Create a new Lambda function. Choose Python 3.8, and use default settings.
Go to Lambda [Configuration] [Designer], and cli... | [
{
"code": null,
"e": 342,
"s": 172,
"text": "Let’s keep our promise and get it done first. Further discussion follows the QuickStart section if you want to read further. I hope this arrangement could save you time."
},
{
"code": null,
"e": 444,
"s": 342,
"text": "Log in to the AW... |
Data Access Object Pattern | Data Access Object Pattern or DAO pattern is used to separate low level data accessing API or operations from high level business services. Following are the participants in Data Access Object Pattern.
Data Access Object Interface - This interface defines the standard operations to be performed on a model object(s).
Da... | [
{
"code": null,
"e": 2953,
"s": 2751,
"text": "Data Access Object Pattern or DAO pattern is used to separate low level data accessing API or operations from high level business services. Following are the participants in Data Access Object Pattern."
},
{
"code": null,
"e": 3069,
"s":... |
Finding Similar Names Using Cosine Similarity | by Leon Lok | Towards Data Science | Humans are prone to making mistakes. With manually entered data, it’s only a matter of time before something goes wrong. And this is especially true for customer data. There’s usually two reasons for this:
the customer has to enter their information themselves through a user interface, or
somebody else will enter the i... | [
{
"code": null,
"e": 378,
"s": 172,
"text": "Humans are prone to making mistakes. With manually entered data, it’s only a matter of time before something goes wrong. And this is especially true for customer data. There’s usually two reasons for this:"
},
{
"code": null,
"e": 462,
"s"... |
Python | Find most common element in a 2D list - GeeksforGeeks | 29 Apr, 2019
Given a 2D list (may or may not be of same length), write a Python program to find the most common element in the given 2D list.
Examples:
Input : [[10, 20, 30], [20, 50, 10], [30, 50, 10]]
Output : 10
Input : [['geeks', 'wins'], ['techie', 'wins']]
Output : wins
Approach #1 : Using max() function
First ... | [
{
"code": null,
"e": 23887,
"s": 23859,
"text": "\n29 Apr, 2019"
},
{
"code": null,
"e": 24016,
"s": 23887,
"text": "Given a 2D list (may or may not be of same length), write a Python program to find the most common element in the given 2D list."
},
{
"code": null,
"e... |
C++ program to convert time from 12 hour to 24 hour format | This is a C++ program to convert time from 12 hour to 24 hour format.
Begin
In main(),
If median = pm
Check if entered hours is less than 12
Then add 12 to hours and print the time in 24 hours format.
Check if entered hours is equal to 12
Then print “00” as hours and print the time i... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "This is a C++ program to convert time from 12 hour to 24 hour format."
},
{
"code": null,
"e": 1665,
"s": 1132,
"text": "Begin\n In main(),\n If median = pm\n Check if entered hours is less than 12\n Then add 12 to h... |
DAX Filter - RELATED function | Returns a related value from another table.
RELATED (<column>)
column
The column that contains the values you want to retrieve.
A single value that is related to the current row.
DAX RELATED function requires that a relationship exists between the current table and the table with related information. When you specify... | [
{
"code": null,
"e": 2045,
"s": 2001,
"text": "Returns a related value from another table."
},
{
"code": null,
"e": 2066,
"s": 2045,
"text": "RELATED (<column>) \n"
},
{
"code": null,
"e": 2073,
"s": 2066,
"text": "column"
},
{
"code": null,
"e": 2... |
How to stop form submission using JavaScript? | Use the return value of the function to stop the execution of a form in JavaScript.
<form onsubmit = "event.preventDefault(); myValidation();">
The JavaScript function would be like the following −
function myValidation()
{
if(check if your conditions are not satisfying)
{
alert("Oops! Validation failed!");... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "Use the return value of the function to stop the execution of a form in JavaScript."
},
{
"code": null,
"e": 1206,
"s": 1146,
"text": "<form onsubmit = \"event.preventDefault(); myValidation();\">"
},
{
"code": null,
"e":... |
Sieve of Eratosthenes in 0(n) time complexity - GeeksforGeeks | 12 Nov, 2021
The classical Sieve of Eratosthenes algorithm takes O(N log (log N)) time to find all prime numbers less than N. In this article, a modified Sieve is discussed that works in O(N) time.Example :
Given a number N, print all prime
numbers smaller than N
Input : int N = 15
Output : 2 3 5 7 11 13
Input : i... | [
{
"code": null,
"e": 24159,
"s": 24131,
"text": "\n12 Nov, 2021"
},
{
"code": null,
"e": 24354,
"s": 24159,
"text": "The classical Sieve of Eratosthenes algorithm takes O(N log (log N)) time to find all prime numbers less than N. In this article, a modified Sieve is discussed tha... |
How to Embed Interactive Charts on your Medium Articles and Personal Website | by Khuyen Tran | Towards Data Science | Have you ever wanted to share your interactive Python chart on social media platforms such as Medium, Reddit, or your own blog but ended up having to take photos or record videos or gifs of the charts? Alternatively, many people end up using a non-code solution, like Mapbox or Flourish, even though they’d rather build ... | [
{
"code": null,
"e": 587,
"s": 172,
"text": "Have you ever wanted to share your interactive Python chart on social media platforms such as Medium, Reddit, or your own blog but ended up having to take photos or record videos or gifs of the charts? Alternatively, many people end up using a non-code so... |
Jupyter Notebook Best Practices. Concise advice that will make you use... | by Dominik Haitz | Towards Data Science | Caveat: The advice in this article refers to the original Jupyter notebook. While much of the advice can be adapted to JupyterLab, the popular notebook extensions can’t.
1. Structure your Notebook
2. Refactor & outsource code into modules
3. Be curious about productivity hacks
4. Embrace reproducibility
5. Further read... | [
{
"code": null,
"e": 342,
"s": 172,
"text": "Caveat: The advice in this article refers to the original Jupyter notebook. While much of the advice can be adapted to JupyterLab, the popular notebook extensions can’t."
},
{
"code": null,
"e": 369,
"s": 342,
"text": "1. Structure you... |
MomentJS - Introduction | In this chapter, we will discuss how to work with MomentJS using RequireJS and MomentJS and TypeScript.
To understand the working of MomentJS using RequireJS, let us analyze a working example with MomentJS and RequireJS. The folder structure of the corresponding app is shown in the following image −
You can obtain the ... | [
{
"code": null,
"e": 2064,
"s": 1960,
"text": "In this chapter, we will discuss how to work with MomentJS using RequireJS and MomentJS and TypeScript."
},
{
"code": null,
"e": 2261,
"s": 2064,
"text": "To understand the working of MomentJS using RequireJS, let us analyze a workin... |
Deleting all files from a folder using PHP | 08 Jan, 2019
In PHP, files from a folder can be deleted using various approaches and inbuilt methods such as unlink, DirectoryIterator and DirectoryRecursiveIterator.Some of these approaches are explained below:
Approach 1:
Generate a list of files using glob() method
Iterate over the list of files.
Check whether the n... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jan, 2019"
},
{
"code": null,
"e": 227,
"s": 28,
"text": "In PHP, files from a folder can be deleted using various approaches and inbuilt methods such as unlink, DirectoryIterator and DirectoryRecursiveIterator.Some of these approach... |
Features and Use of Pointers in C/C++ | 29 Jun, 2022
Pointers store the address of variables or a memory location. Syntax:
datatype *var_name;
Example: pointer “ptr” holds the address of an integer variable or holds the address of memory whose value(s) can be accessed as integer values through “ptr”
int *ptr;
Features of Pointers:
Pointers save memory sp... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Jun, 2022"
},
{
"code": null,
"e": 122,
"s": 52,
"text": "Pointers store the address of variables or a memory location. Syntax:"
},
{
"code": null,
"e": 143,
"s": 122,
"text": "datatype *var_name; "
},
{
... |
How to Create Jumping Text 3D Animation Effect using CSS ? | 09 Jul, 2020
In this article, you will learn to implement Jumping Texts animation effect using simple HTML and CSS. HTML is used to create the structure of the page and CSS is used to set the styling.
HTML Code: In this section, we will design the basic structure of the body.
<!DOCTYPE html><html lang="en"> <head> ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2020"
},
{
"code": null,
"e": 216,
"s": 28,
"text": "In this article, you will learn to implement Jumping Texts animation effect using simple HTML and CSS. HTML is used to create the structure of the page and CSS is used to set ... |
Difference between COMMIT and ROLLBACK in SQL | 24 Feb, 2022
1. COMMIT-COMMIT in SQL is a transaction control language that is used to permanently save the changes done in the transaction in tables/databases. The database cannot regain its previous state after its execution of commit.
Example: Consider the following STAFF table with records:
STAFF
sql>
SELECT *
F... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n24 Feb, 2022"
},
{
"code": null,
"e": 279,
"s": 53,
"text": "1. COMMIT-COMMIT in SQL is a transaction control language that is used to permanently save the changes done in the transaction in tables/databases. The database cannot regain... |
PriorityBlockingQueue Class in Java | 06 Nov, 2020
The PriorityBlockingQueue is an unbounded blocking queue that uses the same ordering rules as class PriorityQueue and supplies blocking retrieval operations. Since it is unbounded, adding elements may sometimes fail due to resource exhaustion resulting in OutOfMemoryError. This class does not permit null e... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Nov, 2020"
},
{
"code": null,
"e": 471,
"s": 28,
"text": "The PriorityBlockingQueue is an unbounded blocking queue that uses the same ordering rules as class PriorityQueue and supplies blocking retrieval operations. Since it is unbou... |
Provider getInfo() method in Java with Examples | 04 Dec, 2018
The getInfo() method of java.security.Provider class is used to return a human-readable description of the provider and its services. This may return an HTML page, with relevant links.
Syntax:
public String getInfo()
Return Value: This method returns a description of the provider and its services.
Below ar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 213,
"s": 28,
"text": "The getInfo() method of java.security.Provider class is used to return a human-readable description of the provider and its services. This may return an HTML page, with releva... |
Read content from one file and write it into another file | 03 Jan, 2021
Prerequisite: Reading and Writing to text files in Python
Python provides inbuilt functions for creating, writing, and reading files. Two types of files can be handled in python, normal text files and binary files (written in binary language,0s, and 1s).
Text files: In this type of file, Each line of text ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Jan, 2021"
},
{
"code": null,
"e": 110,
"s": 52,
"text": "Prerequisite: Reading and Writing to text files in Python"
},
{
"code": null,
"e": 307,
"s": 110,
"text": "Python provides inbuilt functions for creating,... |
Program to find slope of a line | 28 Jun, 2022
Given two coordinates, find the slope of a straight line.
Examples:
Input : x1 = 4, y1 = 2,
x2 = 2, y2 = 5
Output : Slope is -1.5
Approach: To calculate the slope of a line you need only two points from that line, (x1, y1) and (x2, y2). The equation used to calculate the slope from two points ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 110,
"s": 52,
"text": "Given two coordinates, find the slope of a straight line."
},
{
"code": null,
"e": 121,
"s": 110,
"text": "Examples: "
},
{
"code": null,
"e":... |
jQuery GMaps Plugin | 10 Jun, 2022
jQuery provides GMaps Plugin which helps programmers to use Google maps in variety of ways. You have to download the required files in the working folder so that the programmer can include in the head section of the HTML structure page as implemented in the following programs.
jQuery GMaps Plugin download ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jun, 2022"
},
{
"code": null,
"e": 306,
"s": 28,
"text": "jQuery provides GMaps Plugin which helps programmers to use Google maps in variety of ways. You have to download the required files in the working folder so that the programme... |
Difference between byte and sbyte in C# | 26 May, 2020
In C#, a single byte is used to store 8-bits value. The byte and sbyte both are used for byte type of data.
byte : This Struct is used to represent 8-bit unsigned integers. The byte is an immutable value type and the range of Byte is from 0 to 255.
Example :
C#
// C# program to demonstrate // the byte Str... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2020"
},
{
"code": null,
"e": 136,
"s": 28,
"text": "In C#, a single byte is used to store 8-bits value. The byte and sbyte both are used for byte type of data."
},
{
"code": null,
"e": 278,
"s": 136,
"text":... |
Scala List takeRight() method with example | 26 Jul, 2019
The takeRight() method is utilized to select the last ‘n’ elements of the list.
Method Definition: def takeRight(n: Int): List[A]
Return Type: It returns the last ‘n’ elements of the list.
Example #1:
// Scala program of takeRight()// method // Creating objectobject GfG{ // Main method def main(a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jul, 2019"
},
{
"code": null,
"e": 108,
"s": 28,
"text": "The takeRight() method is utilized to select the last ‘n’ elements of the list."
},
{
"code": null,
"e": 158,
"s": 108,
"text": "Method Definition: def tak... |
Python Program for factorial of a number | 09 Aug, 2021
Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is 720.
python3
# Python 3 program to find# factorial of given numberdef factorial(n): # single line to find factorial return 1 if (n==1 or n==0) els... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Aug, 2021"
},
{
"code": null,
"e": 207,
"s": 52,
"text": "Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which is 720."
},
{
"code... |
PyQt5 | How to create capsule shaped push button ? | 22 Apr, 2020
Capsule shape is basically shape which consist of one rectangle and two semi circle is connected to both the ends, in this tutorial we will see how to create these shaped button.
Below is normal Push button vs capsule shaped push button.
In order to create capsule shape button we have to do the following ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 207,
"s": 28,
"text": "Capsule shape is basically shape which consist of one rectangle and two semi circle is connected to both the ends, in this tutorial we will see how to create these shaped butt... |
Maximize profit possible by selling M products such that profit of a product is the number of products left of that supplier | 05 Aug, 2021
Given an array arr[] consisting of N positive integers, such that arr[i] represents the number of products the ith supplier has and a positive integer, M, the task is to find the maximum profit by selling M products if the profit of a particular product is the same as the number of products left of that su... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 369,
"s": 54,
"text": "Given an array arr[] consisting of N positive integers, such that arr[i] represents the number of products the ith supplier has and a positive integer, M, the task is to find... |
Read a string after reading an integer | 04 May, 2021
In this article, we will discuss how to read a string after reading an integer.
Program 1:
Below is the program that inputs a string with spaces just after taken an input of an integer:
C++
// C++ program that inputs a string// with spaces just after taken an// input of an integer #include <iostream>#inc... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 May, 2021"
},
{
"code": null,
"e": 108,
"s": 28,
"text": "In this article, we will discuss how to read a string after reading an integer."
},
{
"code": null,
"e": 119,
"s": 108,
"text": "Program 1:"
},
{
"... |
Birman Schiper Stephenson Protocol | 18 Jan, 2021
This algorithm is used to maintain the causal ordering of the messages i.e. the message which is sent first should be received first. If send (M1)–>send(M2) then for all processes which receive the messages M1 and M2 should receive M1 before M2.
Features :
Broadcast based messaging.
Size of the messages ar... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 299,
"s": 53,
"text": "This algorithm is used to maintain the causal ordering of the messages i.e. the message which is sent first should be received first. If send (M1)–>send(M2) then for all proc... |
Find the sum of n terms of the series 1 , 2a , 3a2 , 4a3 , 5a4 , ... - GeeksforGeeks | 23 Dec, 2021
Given a series . and the value of a. Find the sum of the first n term of the series.
Examples:
Input: a = 3, n = 4Output: 142
Input: a = 5, n = 1Output: 1
Brute Force Approach:
A simple approach can be iterating N terms of the series and adding them to calculate the sum for any value of a. Follow the steps... | [
{
"code": null,
"e": 24692,
"s": 24664,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 24777,
"s": 24692,
"text": "Given a series . and the value of a. Find the sum of the first n term of the series."
},
{
"code": null,
"e": 24787,
"s": 24777,
"text": "Examp... |
Kth ancestor of a node in binary tree | Set 2 - GeeksforGeeks | 21 Mar, 2022
Given a binary tree in which nodes are numbered from 1 to n. Given a node and a positive integer K. We have to print the Kth ancestor of the given node in the binary tree. If there does not exist any such ancestor then print -1.For example in the below given binary tree, the 2nd ancestor of 5 is 1. 3rd anc... | [
{
"code": null,
"e": 35848,
"s": 35820,
"text": "\n21 Mar, 2022"
},
{
"code": null,
"e": 36185,
"s": 35848,
"text": "Given a binary tree in which nodes are numbered from 1 to n. Given a node and a positive integer K. We have to print the Kth ancestor of the given node in the bina... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.