title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
What is JavaScript Bitwise XOR (^) Operator?
If both the bits are different, then 1 is returned when Bitwise OR (|) operator is used. You can try to run the following code to learn how to work with JavaScript Bitwise XOR Operator. <!DOCTYPE html> <html> <body> <script> document.write("Bitwise XOR Operator<br>"); // 7 = 0000000000000000...
[ { "code": null, "e": 1151, "s": 1062, "text": "If both the bits are different, then 1 is returned when Bitwise OR (|) operator is used." }, { "code": null, "e": 1248, "s": 1151, "text": "You can try to run the following code to learn how to work with JavaScript Bitwise XOR Operat...
What is the difference between method overloading and method hiding in Java?
method hiding − When super class and the sub class contains same methods including parameters, and if they are static and, when called, the super class method is hidden by the method of the sub class this is known as method hiding. Live Demo class Demo{ public static void demoMethod() { System.out.println("me...
[ { "code": null, "e": 1294, "s": 1062, "text": "method hiding − When super class and the sub class contains same methods including parameters, and if they are static and, when called, the super class method is hidden by the method of the sub class this is known as method hiding." }, { "code":...
Fetching rows added in last hour with MySQL?
You can use date-sub() and now() function from MySQL to fetch the rows added in last hour. The syntax is as follows − select *from yourTableName where yourDateTimeColumnName <=date_sub(now(),interval 1 hour); The above query gives the result added last hour. To understand the above concept, let us first create a table....
[ { "code": null, "e": 1153, "s": 1062, "text": "You can use date-sub() and now() function from MySQL to fetch the rows added in last hour." }, { "code": null, "e": 1180, "s": 1153, "text": "The syntax is as follows −" }, { "code": null, "e": 1271, "s": 1180, "t...
Java program to print Fibonacci series of a given number.
Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function. Following is an example to find Fibonacci series of a given number using a recursive function public class...
[ { "code": null, "e": 1276, "s": 1062, "text": "Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function." }, { "code": null, "e": 13...
How to select subsets of data In SQL Query Style in Pandas?
In this post, I will show you how to perform Data Analysis with SQL style filtering with Pandas. Most of the corporate company’s data are stored in databases that require SQL to retrieve and manipulate it. For instance, there are companies like Oracle, IBM, Microsoft having their own databases with their own SQL implem...
[ { "code": null, "e": 1393, "s": 1062, "text": "In this post, I will show you how to perform Data Analysis with SQL style filtering with Pandas. Most of the corporate company’s data are stored in databases that require SQL to retrieve and manipulate it. For instance, there are companies like Oracle, ...
Go - The Select Statement
The syntax for a select statement in Go programming language is as follows − select { case communication clause : statement(s); case communication clause : statement(s); /* you can have any number of case statements */ default : /* Optional */ statement(s); } The following rules ...
[ { "code": null, "e": 2014, "s": 1937, "text": "The syntax for a select statement in Go programming language is as follows −" }, { "code": null, "e": 2237, "s": 2014, "text": "select {\n case communication clause :\n statement(s); \n case communication clause :\n ...
Building a Face Recognizer in Python | by Behic Guven | Towards Data Science
In this post, I will show you how to build your own face recognizer using Python. Building a program that detects and recognizes faces is a very interesting and fun project to get started with computer vision. In previous posts, I showed how to recognize text and also how to detect faces in an image, these are great pr...
[ { "code": null, "e": 617, "s": 171, "text": "In this post, I will show you how to build your own face recognizer using Python. Building a program that detects and recognizes faces is a very interesting and fun project to get started with computer vision. In previous posts, I showed how to recognize ...
How to create PowerShell alias permanently?
PowerShell alias can be created permanently by 2 methods below. To export all the aliases, you need to use Export-Alias cmdlet. When you use this command it will ask you the path for the file to import. To export the newly created alias, you need to give alias name and the name for the export, so later you can import i...
[ { "code": null, "e": 1126, "s": 1062, "text": "PowerShell alias can be created permanently by 2 methods below." }, { "code": null, "e": 1265, "s": 1126, "text": "To export all the aliases, you need to use Export-Alias cmdlet. When you use this command it will ask you the path for...
Object initializer in JavaScript
An object initializer is an expression that allow us to initialize a newly created object. It is a comma-separated list of zero or more pairs of property names and associated values of an object enclosed in a pair of curly braces {}. Following is the code for object initializer in JavaScript. Live Demo <!DOCTYPE html>...
[ { "code": null, "e": 1296, "s": 1062, "text": "An object initializer is an expression that allow us to initialize a newly created object. It is a comma-separated list of zero or more pairs of property names and associated values of an\nobject enclosed in a pair of curly braces {}." }, { "cod...
How to work with array variable in MySQL?
MySQL does not support array variables. To get the same result, use the table DUAL. Following is the syntax: SELECT yourValue1 AS ArrayValue FROM DUAL UNION ALL SELECT yourValue2 FROM DUAL UNION ALL SELECT yourValue3 FROM DUAL UNION ALL SELECT yourValue4 FROM DUAL UNION ALL . . . . . . SELECT yourValueN FROM DUAL; Let ...
[ { "code": null, "e": 1171, "s": 1062, "text": "MySQL does not support array variables. To get the same result, use the table DUAL. Following is the syntax:" }, { "code": null, "e": 1378, "s": 1171, "text": "SELECT yourValue1 AS ArrayValue FROM DUAL\nUNION ALL\nSELECT yourValue2 F...
Neural Networks for Real-Time Audio: Raspberry-Pi Guitar Pedal | by Keith Bloemer | Towards Data Science
This is the last of a five-part series on using neural networks for real-time audio.For the previous article on Stateful LSTMs, click here. In this article we will go step-by-step to build a functional guitar pedal running neural nets in real-time on the Raspberry Pi. We have now covered three different neural network ...
[ { "code": null, "e": 312, "s": 172, "text": "This is the last of a five-part series on using neural networks for real-time audio.For the previous article on Stateful LSTMs, click here." }, { "code": null, "e": 441, "s": 312, "text": "In this article we will go step-by-step to bui...
Object.entries() In JavaScript - GeeksforGeeks
22 Dec, 2021 Object and Object Constructors in JavaScript? In the living world of object-oriented programming we already know the importance of classes and objects but unlike other programming languages, JavaScript does not have the traditional classes as seen in other languages. But JavaScript has objects and construc...
[ { "code": null, "e": 24972, "s": 24944, "text": "\n22 Dec, 2021" }, { "code": null, "e": 25018, "s": 24972, "text": "Object and Object Constructors in JavaScript?" }, { "code": null, "e": 25358, "s": 25018, "text": "In the living world of object-oriented progr...
Python Program for Heap Sort
In this article, we will learn about the solution to the problem statement given below. Problem statement − We are given an array, we need to sort it using the concept of heapsort. Here we place the maximum element at the end. This is repeated until the array is sorted. Now let’s observe the solution in the implementat...
[ { "code": null, "e": 1150, "s": 1062, "text": "In this article, we will learn about the solution to the problem statement given below." }, { "code": null, "e": 1243, "s": 1150, "text": "Problem statement − We are given an array, we need to sort it using the concept of heapsort." ...
SQLAlchemy Core - Multiple Table Deletes
In this chapter, we will look into the Multiple Table Deletes expression which is similar to using Multiple Table Updates function. More than one table can be referred in WHERE clause of DELETE statement in many DBMS dialects. For PG and MySQL, “DELETE USING” syntax is used; and for SQL Server, using “DELETE FROM” expr...
[ { "code": null, "e": 2472, "s": 2340, "text": "In this chapter, we will look into the Multiple Table Deletes expression which is similar to using Multiple Table Updates function." }, { "code": null, "e": 2836, "s": 2472, "text": "More than one table can be referred in WHERE claus...
Tk - Basic Widgets
Basic widgets are common widgets available in almost all Tk applications. The list of available basic widgets is given below − Widget for displaying single line of text. Widget that is clickable and triggers an action. Widget used to accept a single line of text as input. Widget for displaying multiple lines of text. W...
[ { "code": null, "e": 2328, "s": 2201, "text": "Basic widgets are common widgets available in almost all Tk applications. The list of available basic widgets is given below −" }, { "code": null, "e": 2371, "s": 2328, "text": "Widget for displaying single line of text." }, { ...
How do you get selenium to recognize that a page loaded?
We can get Selenium to recognize that a page is loaded. We can set the implicit wait for this purpose. It shall make the driver to wait for a specific amount of time for an element to be available after page loaded. driver.manage().timeouts().implicitlyWait(); After the page is loaded, we can also invoke Javascript met...
[ { "code": null, "e": 1278, "s": 1062, "text": "We can get Selenium to recognize that a page is loaded. We can set the implicit wait for this purpose. It shall make the driver to wait for a specific amount of time for an element to be available after page loaded." }, { "code": null, "e": ...
Java Generics - Methods
You can write a single generic method declaration that can be called with arguments of different types. Based on the types of the arguments passed to the generic method, the compiler handles each method call appropriately. Following are the rules to define Generic Methods − All generic method declarations have a type p...
[ { "code": null, "e": 2915, "s": 2640, "text": "You can write a single generic method declaration that can be called with arguments of different types. Based on the types of the arguments passed to the generic method, the compiler handles each method call appropriately. Following are the rules to def...
How to Code Memory Efficient Functions with Python Generators | by Erdem Isbilen | Towards Data Science
Generators are special functions that return a lazy iterator which we can iterate over to handle one unit of data at a time. As lazy iterators do not store the whole content of data in the memory, they are commonly used to work with data streams and large datasets. Generators in Python are very similar to normal functi...
[ { "code": null, "e": 438, "s": 172, "text": "Generators are special functions that return a lazy iterator which we can iterate over to handle one unit of data at a time. As lazy iterators do not store the whole content of data in the memory, they are commonly used to work with data streams and large...
DAX Statistical - PERCENTILEX.EXC function
Returns the percentile number of an expression evaluated for each row in a table. DAX PERCENTILEX.EXC function is new in Excel 2016. PERCENTILEX.EXC (<table>, <expression>, <k>) table The table containing the rows for which the expression will be evaluated. expression The expression to be evaluated for each row of th...
[ { "code": null, "e": 2083, "s": 2001, "text": "Returns the percentile number of an expression evaluated for each row in a table." }, { "code": null, "e": 2134, "s": 2083, "text": "DAX PERCENTILEX.EXC function is new in Excel 2016." }, { "code": null, "e": 2181, "s...
How to use Python classes effectively | by Ari Joury | Towards Data Science
“There should only be one — and preferably only one — obvious way to do it”, says the Zen of Python. Yet there are areas where even seasoned programmers debate what the right or wrong way to do things is. One of these areas are Python classes. Borrowed from Object-Oriented Programming, they’re quite beautiful construct...
[ { "code": null, "e": 377, "s": 172, "text": "“There should only be one — and preferably only one — obvious way to do it”, says the Zen of Python. Yet there are areas where even seasoned programmers debate what the right or wrong way to do things is." }, { "code": null, "e": 539, "s":...
Bootstrap alert-success class
The .alert-success class in Bootstrap indicates a positive action. You can try to run the following code to implement the alert-success class in Bootstrap − Live Demo <!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet"> <...
[ { "code": null, "e": 1129, "s": 1062, "text": "The .alert-success class in Bootstrap indicates a positive action." }, { "code": null, "e": 1219, "s": 1129, "text": "You can try to run the following code to implement the alert-success class in Bootstrap −" }, { "code": nul...
Sorting a vector of custom objects using C++ STL
You can sort a vector of custom objects using the C++ STL function std::sort. The sort function has an overloaded form that takes as arguments first, last, comparator. The first and last are iterators to first and last elements of the container. The comparator is a predicate function that can be used to tell how to sor...
[ { "code": null, "e": 1400, "s": 1062, "text": "You can sort a vector of custom objects using the C++ STL function std::sort. The sort function has an overloaded form that takes as arguments first, last, comparator. The first and last are iterators to first and last elements of the container. The com...
How to Alter Multiple Columns at Once in SQL Server? - GeeksforGeeks
16 Nov, 2021 In SQL, sometimes we need to write a single query to update the values of all columns in a table. We will use the UPDATE keyword to achieve this. For this, we use a specific kind of query shown in the below demonstration. For this article, we will be using the Microsoft SQL Server as our database and Selec...
[ { "code": null, "e": 24214, "s": 24186, "text": "\n16 Nov, 2021" }, { "code": null, "e": 24532, "s": 24214, "text": "In SQL, sometimes we need to write a single query to update the values of all columns in a table. We will use the UPDATE keyword to achieve this. For this, we use ...
Setup/Install Redis Server on Windows 10 - onlinetutorialspoint
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws In this tutorial, I am going to show how to i...
[ { "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, ...
Mobile Angular UI - APP Development
In this chapter, we will discuss the use of Using AngularJS and Ionic for app development. Ionic is an open source framework used for developing mobile applications. It provides tools and services for building Mobile UI with native look and feel. Ionic framework needs native wrapper to be able to run on mobile devices....
[ { "code": null, "e": 2402, "s": 2311, "text": "In this chapter, we will discuss the use of Using AngularJS and Ionic for app development." }, { "code": null, "e": 2632, "s": 2402, "text": "Ionic is an open source framework used for developing mobile applications. It provides tool...
Pointer to an Array in Objective-C
It is most likely that you would not understand this chapter until you are through the chapter related to Pointers in Objective-C. So assuming you have a bit understanding on pointers in Objective-C programming language, let us start: An array name is a constant pointer to the first element of the array. Therefore, in ...
[ { "code": null, "e": 2691, "s": 2560, "text": "It is most likely that you would not understand this chapter until you are through the chapter related to Pointers in Objective-C." }, { "code": null, "e": 2898, "s": 2691, "text": "So assuming you have a bit understanding on pointer...
How to Write Switch Statements in Python | Towards Data Science
The typical way to deal with multiway branching in programming languages is the if-else clause. When we need to code numerous scenarios, an alternative is the so-called switch or case statement that is supported by most modern languages. For Python versions < 3.10 however, there was no such statement that is able to se...
[ { "code": null, "e": 409, "s": 171, "text": "The typical way to deal with multiway branching in programming languages is the if-else clause. When we need to code numerous scenarios, an alternative is the so-called switch or case statement that is supported by most modern languages." }, { "co...
Bokeh - Plot Tools
When a Bokeh plot is rendered, normally a tool bar appears on the right side of the figure. It contains a default set of tools. First of all, the position of toolbar can be configured by toolbar_location property in figure() function. This property can take one of the following values − "above" "below" "left" "right" "...
[ { "code": null, "e": 2558, "s": 2270, "text": "When a Bokeh plot is rendered, normally a tool bar appears on the right side of the figure. It contains a default set of tools. First of all, the position of toolbar can be configured by toolbar_location property in figure() function. This property can ...
How to find the mean of each variable using dplyr by factor variable with ignoring the NA values in R?
If there are NA’s in our data set for multiple values of numerical variables with the grouping variable then using na.rm = FALSE needs to be performed multiple times to find the mean or any other statistic for each of the variables with the mean function. But we can do it with summarise_all function of dplyr package th...
[ { "code": null, "e": 1463, "s": 1062, "text": "If there are NA’s in our data set for multiple values of numerical variables with the grouping variable then using na.rm = FALSE needs to be performed multiple times to find the mean or any other statistic for each of the variables with the mean functio...
MLOps with Kubernetes, RabbitMQ and FastAPI | by Andrej Baranovskij | Towards Data Science
You often could hear people saying — many ML projects are stopped before they reach the production phase. One of the reasons for this, typically ML projects are implemented as monoliths from the start and when the time comes to run them in production, it is impossible to manage, transform and maintain the code. ML proj...
[ { "code": null, "e": 823, "s": 172, "text": "You often could hear people saying — many ML projects are stopped before they reach the production phase. One of the reasons for this, typically ML projects are implemented as monoliths from the start and when the time comes to run them in production, it ...
How to add binary numbers using Python?
If you have binary numbers as strings, you can convert them to ints first using int(str, base) by providing the base as 2. Then add the numbers like you'd normally do. Finally convert it back to a string using the bin function. For example, a = '001' b = '011' sm = int(a,2) + int(b,2) c = bin(sm) print(c) This will giv...
[ { "code": null, "e": 1303, "s": 1062, "text": "If you have binary numbers as strings, you can convert them to ints first using int(str, base) by providing the base as 2. Then add the numbers like you'd normally do. Finally convert it back to a string using the bin function. For example," }, { ...
How to start a service from notification in Android?
This example demonstrate about How to start a service from notification in Android. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. <? xml version = "1.0" encoding = "utf-8" ...
[ { "code": null, "e": 1146, "s": 1062, "text": "This example demonstrate about How to start a service from notification in Android." }, { "code": null, "e": 1275, "s": 1146, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required de...
Transfer Learning with VGG16 and Keras | by Gabriel Cassimiro | Towards Data Science
The main goal of this article is to demonstrate with code and examples how can you use an already trained CNN (convolutional neural network) to solve your specific problem. Convolutional Networks are great for image problems however, they are computationally expensive if you use a big architecture and don’t have a GPU....
[ { "code": null, "e": 345, "s": 172, "text": "The main goal of this article is to demonstrate with code and examples how can you use an already trained CNN (convolutional neural network) to solve your specific problem." }, { "code": null, "e": 526, "s": 345, "text": "Convolutional...
How to hide a navigation menu on scroll down with CSS and JavaScript?
Following is the code for hiding navigation menu when scrolling using CSS and JavaScript − Live Demo <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> body{ margin:0px; margin-top:60px; padding:...
[ { "code": null, "e": 1153, "s": 1062, "text": "Following is the code for hiding navigation menu when scrolling using CSS and JavaScript −" }, { "code": null, "e": 1164, "s": 1153, "text": " Live Demo" }, { "code": null, "e": 2695, "s": 1164, "text": "<!DOCTYPE...
Split a column after hyphen in MySQL and display the remaining value?
To split a column after hyphen, use the SUBSTRING_INDEX() method − select substring_index(yourColumnName,'-',-1) AS anyAliasName from yourTableName; Let us first create a table − mysql> create table DemoTable -> ( -> StreetName text -> ); Query OK, 0 rows affected (0.60 sec) Insert some records in the table us...
[ { "code": null, "e": 1129, "s": 1062, "text": "To split a column after hyphen, use the SUBSTRING_INDEX() method −" }, { "code": null, "e": 1211, "s": 1129, "text": "select substring_index(yourColumnName,'-',-1) AS anyAliasName from yourTableName;" }, { "code": null, "...
How to create date object in Java?
You can create a Date object using the Date() constructor of java.util.Date constructor as shown in the following example. The object created using this constructor represents the current time. Live Demo import java.util.Date; public class CreateDate { public static void main(String args[]) { Date date =...
[ { "code": null, "e": 1256, "s": 1062, "text": "You can create a Date object using the Date() constructor of java.util.Date constructor as shown in the following example. The object created using this constructor represents the current time." }, { "code": null, "e": 1266, "s": 1256, ...
How to add values in columns having same name and merge them in R?
To add values in columns having same name and merge them in R, we can follow the below steps − First of all, create a data frame. Add column values that have same name and merge them by using cbind with do.call. Let's create a data frame as shown below − df<- data.frame(x=rpois(25,1),y=rpois(25,2),x=rpois(25,5),z=rpois...
[ { "code": null, "e": 1157, "s": 1062, "text": "To add values in columns having same name and merge them in R, we can follow the\nbelow steps −" }, { "code": null, "e": 1192, "s": 1157, "text": "First of all, create a data frame." }, { "code": null, "e": 1274, "s":...
Java sql.Time valueOf() method with example
The valueOf() method of the java.sql.Time class accepts a String value representing a time in JDBC escape format and converts the given String value into Time object. Time time = Time.valueOf("time_string"); Let us create a table with name dispatches in MySQL database using CREATE statement as follows − CREATE TABLE di...
[ { "code": null, "e": 1229, "s": 1062, "text": "The valueOf() method of the java.sql.Time class accepts a String value representing a time in JDBC escape format and converts the given String value into Time object." }, { "code": null, "e": 1270, "s": 1229, "text": "Time time = Tim...
How to create a Borderless Window in Java?
To create a borderless window in Java, do not decorate the window. The following is an example to create a BorderLess Window − package my; import java.awt.GraphicsEnvironment; import java.awt.GridLayout; import java.awt.Point; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; ...
[ { "code": null, "e": 1189, "s": 1062, "text": "To create a borderless window in Java, do not decorate the window. The following is an example to create a BorderLess Window −" }, { "code": null, "e": 2404, "s": 1189, "text": "package my;\nimport java.awt.GraphicsEnvironment;\nimpo...
Disable images in Selenium Google ChromeDriver.
We can disable images in Selenium in chromedriver. The images are sometimes disabled so that page load takes less time and execution is quick. In Chrome, we can do this with the help of the prefs setting. prefs.put("profile.managed_default_content_settings.images", 2); Let’s us make an attempt to disable all image from...
[ { "code": null, "e": 1267, "s": 1062, "text": "We can disable images in Selenium in chromedriver. The images are sometimes disabled so that page load takes less time and execution is quick. In Chrome, we can do this with the help of the prefs setting." }, { "code": null, "e": 1332, "...
How to create a bar graph using ggplot2 without horizontal gridlines and Y-axes labels in R?
A bar graph plotted with ggplot function of ggplot2 shows horizontal and vertical gridlines. If we are interested only in the bar heights then we might prefer to remove the horizontal gridlines. In this way, we can have X-axis that helps us to look at the different categories we have in our variable of interest and get...
[ { "code": null, "e": 1501, "s": 1062, "text": "A bar graph plotted with ggplot function of ggplot2 shows horizontal and vertical gridlines. If we are interested only in the bar heights then we might prefer to remove the horizontal gridlines. In this way, we can have X-axis that helps us to look at t...
How to Create a GraphQL API using AWS AppSync | by Janitha Tennakoon | Towards Data Science
Nowadays whenever we talk or think about creating/designing an API what pops to the mind at first is REST. REST(REpresentational State Transfer) has been the go-to standard until recently when developing an API platform. Even though REST became the standard, it did have its own disadvantages. One of the main disadvanta...
[ { "code": null, "e": 880, "s": 172, "text": "Nowadays whenever we talk or think about creating/designing an API what pops to the mind at first is REST. REST(REpresentational State Transfer) has been the go-to standard until recently when developing an API platform. Even though REST became the standa...
Dart Programming - Collection Queue
A Queue is a collection that can be manipulated at both ends. Queues are useful when you want to build a first-in, first-out collection. Simply put, a queue inserts data from one end and deletes from another end. The values are removed / read in the order of their insertion. Identifier = new Queue() The add() function...
[ { "code": null, "e": 2801, "s": 2525, "text": "A Queue is a collection that can be manipulated at both ends. Queues are useful when you want to build a first-in, first-out collection. Simply put, a queue inserts data from one end and deletes from another end. The values are removed / read in the ord...
tee command in Linux with examples - GeeksforGeeks
19 Feb, 2021 tee command reads the standard input and writes it to both the standard output and one or more files. The command is named after the T-splitter used in plumbing. It basically breaks the output of a program so that it can be both displayed and saved in a file. It does both the tasks simultaneously, copies t...
[ { "code": null, "e": 23962, "s": 23934, "text": "\n19 Feb, 2021" }, { "code": null, "e": 24346, "s": 23962, "text": "tee command reads the standard input and writes it to both the standard output and one or more files. The command is named after the T-splitter used in plumbing. I...
How can we add multiple sub-panels to the main panel in Java?
A JPanel is a subclass of JComponent class and it is an invisible component in Java. The FlowLayout is a default layout for a JPanel. We can add most of the components like buttons, text fields, labels, tables, lists, trees, etc. to a JPanel. We can also add multiple sub-panels to the main panel using the add() method ...
[ { "code": null, "e": 1305, "s": 1062, "text": "A JPanel is a subclass of JComponent class and it is an invisible component in Java. The FlowLayout is a default layout for a JPanel. We can add most of the components like buttons, text fields, labels, tables, lists, trees, etc. to a JPanel." }, { ...
Dealing with Multiclass Data. Forest Cover Type Prediction | by Amber Teng | Towards Data Science
Have you ever thought about what to do when you encounter a classification problem that consists of over three classes? How did you deal with multiclass data, and how did you evaluate your model? Was overfitting a challenge — and if so, how did you surmount that? Read on to discover how I worked through these questions...
[ { "code": null, "e": 436, "s": 172, "text": "Have you ever thought about what to do when you encounter a classification problem that consists of over three classes? How did you deal with multiclass data, and how did you evaluate your model? Was overfitting a challenge — and if so, how did you surmou...
How to build a custom Dataset for Tensorflow | by Ivelin Ivanov | Towards Data Science
Tensorflow inspires developers to experiment with their exciting AI ideas in almost any domain that comes to mind. There are three well known factors in the ML community that make up a good Deep Neural Network model do magical things. Model ArchitectureHigh quality training dataSufficient Compute Capacity Model Archite...
[ { "code": null, "e": 407, "s": 172, "text": "Tensorflow inspires developers to experiment with their exciting AI ideas in almost any domain that comes to mind. There are three well known factors in the ML community that make up a good Deep Neural Network model do magical things." }, { "code"...
Python - Remove Negative Elements in List - GeeksforGeeks
03 Jul, 2020 Sometimes, while working with Python lists, we can have a problem in which we need to remove all the negative elements from list. This kind of problem can have application in many domains such as school programming and web development. Let’s discuss certain ways in which this task can be performed. Input :...
[ { "code": null, "e": 25647, "s": 25619, "text": "\n03 Jul, 2020" }, { "code": null, "e": 25947, "s": 25647, "text": "Sometimes, while working with Python lists, we can have a problem in which we need to remove all the negative elements from list. This kind of problem can have app...
How to Download historical stock prices in Python ? - GeeksforGeeks
05 Apr, 2021 Stock prices refer to the current price of the share of that stock. Stock prices are widely used in the field of Machine Learning for the demonstration of the regression problem. Stock prediction is an application of Machine learning where we predict the stocks of a particular firm by looking at its past d...
[ { "code": null, "e": 26213, "s": 26185, "text": "\n05 Apr, 2021" }, { "code": null, "e": 26606, "s": 26213, "text": "Stock prices refer to the current price of the share of that stock. Stock prices are widely used in the field of Machine Learning for the demonstration of the regr...
How to extract the names of vector values from a named vector in R?
How to extract the names of vector values from a named vector in R? The names of vector values are created by using name function and the names can be extracted by using the same function. For example, if we have a vector called x that contains five values(1 to 5) and their names are defined as first, second, third, fo...
[ { "code": null, "e": 1130, "s": 1062, "text": "How to extract the names of vector values from a named vector in R?" }, { "code": null, "e": 1469, "s": 1130, "text": "The names of vector values are created by using name function and the names can be extracted by using the same fun...
How to check if a string contains only decimal characters?
There is a method called isdigit() in String class that returns true if all characters in the string are digits and there is at least one character, false otherwise. You can call it as follows: >>> "12345".isdigit() True >>> "12345a".isdigit() False But this would fail for floating-point numbers. We can use the followi...
[ { "code": null, "e": 1256, "s": 1062, "text": "There is a method called isdigit() in String class that returns true if all characters in the string are digits and there is at least one character, false otherwise. You can call it as follows:" }, { "code": null, "e": 1312, "s": 1256, ...
MFC - Libraries
A library is a group of functions, classes, or other resources that can be made available to programs that need already implemented entities without the need to know how these functions, classes, or resources were created or how they function. A library makes it easy for a programmer to use functions, classes, and reso...
[ { "code": null, "e": 2546, "s": 2067, "text": "A library is a group of functions, classes, or other resources that can be made available to programs that need already implemented entities without the need to know how these functions, classes, or resources were created or how they function. A library...
How to find out all the indexes for a DB2 table TAB1?
To find out all the indexes built on the DB2 table TAB1 we can use the DB2 system table SYSIBM.SYSINDEXES. The SYSINDEXES database has one row for every index present in DB2. We can find indexes built on a particular table using the below SQL query. SELECT NAME, UNIQUERULE, CLUSTERING FROM SYSIBM.SYSINDEXES WHERE TB...
[ { "code": null, "e": 1312, "s": 1062, "text": "To find out all the indexes built on the DB2 table TAB1 we can use the DB2 system table SYSIBM.SYSINDEXES. The SYSINDEXES database has one row for every index present in DB2. We can find indexes built on a particular table using the below SQL query." ...
Fit a Linear Regression Model with Gradient Descent from Scratch | by GreekDataGuy | Towards Data Science
We all know sklearn can fit models for us. But do we know what it’s actually doing when we call .fit(). Keep reading to find out. Today we’ll write a set of functions which implement gradient descent to fit a linear regression model. Then we’ll compare our model’s weights to the weights from a fitted sklearn model. Fit...
[ { "code": null, "e": 302, "s": 172, "text": "We all know sklearn can fit models for us. But do we know what it’s actually doing when we call .fit(). Keep reading to find out." }, { "code": null, "e": 489, "s": 302, "text": "Today we’ll write a set of functions which implement gra...
C# Program to access first element in a Dictionary
The following is our Dictionary with some elements − Dictionary<int, string> d = new Dictionary<int, string>() { {1,"Electronics"}, {2, "Clothing"}, {3,"Toys"}, {4,"Footwear"}, {5, "Accessories"} }; Now to display the first element, set the key like this. d[1]; The above displays the first element. Live...
[ { "code": null, "e": 1115, "s": 1062, "text": "The following is our Dictionary with some elements −" }, { "code": null, "e": 1276, "s": 1115, "text": "Dictionary<int, string> d = new Dictionary<int, string>() {\n {1,\"Electronics\"},\n {2, \"Clothing\"},\n {3,\"Toys\"},\n ...
What is multithreading in C#?
In C#, the System.Threading.Thread class is used for working with threads. It allows creating and accessing individual threads in a multithreaded application. The first thread to be executed in a process is called the main thread. When a C# program starts execution, the main thread is automatically created. The threads...
[ { "code": null, "e": 1293, "s": 1062, "text": "In C#, the System.Threading.Thread class is used for working with threads. It allows creating and accessing individual threads in a multithreaded application. The first thread to be executed in a process is called the main thread." }, { "code": ...
Count elements smaller than or equal to x in a sorted matrix in C++
We are given a matrix of size n x n, an integer variable x, and also, the elements in a matrix are placed in sorted order and the task is to calculate the count of those elements that are equal to or less than x. Input − matrix[3][3] = {{1, 2, 3}, {4, 5, 6}, {6, 7, 8}} and X = 4 Output − count is 4 Explanation − we hav...
[ { "code": null, "e": 1275, "s": 1062, "text": "We are given a matrix of size n x n, an integer variable x, and also, the elements in a matrix are placed in sorted order and the task is to calculate the count of those elements that are equal to or less than x." }, { "code": null, "e": 128...
How to simulate a keypress event in JavaScript?
To simulate a key press event, use event handlers. You can try to run the following code to simulate a key press event Live Demo <html> <head> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"> </script> <script> jQuery(document).ready(function($) { ...
[ { "code": null, "e": 1181, "s": 1062, "text": "To simulate a key press event, use event handlers. You can try to run the following code to simulate a key press event" }, { "code": null, "e": 1191, "s": 1181, "text": "Live Demo" }, { "code": null, "e": 1881, "s": 1...
Count all sub-sequences having product <= K – Recursive approach in C++
In this tutorial, we will be discussing a program to find the number of sub-sequences having product <= k. For this we will be provided with an array and a value K. Our task is to find the number of sub sequences having their product as K. Live Demo #include <bits/stdc++.h> #define ll long long using namespace std; //...
[ { "code": null, "e": 1169, "s": 1062, "text": "In this tutorial, we will be discussing a program to find the number of sub-sequences having product <= k." }, { "code": null, "e": 1302, "s": 1169, "text": "For this we will be provided with an array and a value K. Our task is to fi...
How to solve the simultaneous linear equations in R?
The data in simultaneous equations can be read as matrix and then we can solve those matrices to find the value of the variables. For example, if we have three equations as − x + y + z = 6 3x + 2y + 4z = 9 2x + 2y – 6z = 3 then we will convert these equations into matrices and solve them using solve function in R. Liv...
[ { "code": null, "e": 1237, "s": 1062, "text": "The data in simultaneous equations can be read as matrix and then we can solve those matrices to find the value of the variables. For example, if we have three equations as −" }, { "code": null, "e": 1285, "s": 1237, "text": "x + y +...
How to write a simple calculator program using C language?
Begin by writing the C code to create a simple calculator. Then, follow the algorithm given below to write a C program. Step 1: Declare variables Step 2: Enter any operator at runtime Step 3: Enter any two integer values at runtime Step 4: Apply switch case to select the operator: // case '+': result = num1 + n...
[ { "code": null, "e": 1182, "s": 1062, "text": "Begin by writing the C code to create a simple calculator. Then, follow the algorithm given below to write a C program." }, { "code": null, "e": 1681, "s": 1182, "text": "Step 1: Declare variables\nStep 2: Enter any operator at runti...
How to reuse plots in Matplotlib?
To reuse plots in Matplotlib, we can take the following steps − Set the figure size and adjust the padding between and around the subplots. Create a new figure or activate an existing figure using figure() method. Plot a line with some input lists. To reuse the plot, update y data and the linewidth of the plot To displ...
[ { "code": null, "e": 1126, "s": 1062, "text": "To reuse plots in Matplotlib, we can take the following steps −" }, { "code": null, "e": 1202, "s": 1126, "text": "Set the figure size and adjust the padding between and around the subplots." }, { "code": null, "e": 1276,...
LESS - Lighten
It lightens the color in the element. It has the following parameters − color − It represents the color object. color − It represents the color object. amount − It contains percentage between 0 - 100%. amount − It contains percentage between 0 - 100%. method − It is an optional parameter which is used for adjustment to...
[ { "code": null, "e": 2622, "s": 2550, "text": "It lightens the color in the element. It has the following parameters −" }, { "code": null, "e": 2662, "s": 2622, "text": "color − It represents the color object." }, { "code": null, "e": 2702, "s": 2662, "text": ...
State Space Model and Kalman Filter for Time-Series Prediction | by Sarit Maitra | Towards Data Science
ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nTime series consist of four major components: Seasonal variations (SV), Trend variations (TV), Cyclical variations (CV), and Random variations (RV). Here, we will perform predictive analytics using state space model on uni-variate time series data. This model has continuous hidden and observed state.\nLet us use historical data of Schlumberger Limited (SLB) from 1986 onwards.\ndf1 = ts(df1$Open, start= c(1986,1), end = c(2019,12), frequency = 12)xyplot(df1, ylab = “Price (US $)”, main = “Time series plot for Schlumberger price”)\nHere, data is on monthly frequency (12 months) for the ease of computation.\nThe line plot shows fluctuating price all throughout with high volatility.\nThe distribution plot comprising density and normal QQ plot below clearly shows that data distribution is not normal.\npar(mfrow=c(2,1)) # set up the graphics hist(df1, prob=TRUE, 12) # histogram lines(density(df1)) # density for details qqnorm(df1) # normal Q-Q plot qqline(df1)\nLet us perform stationarity test (ADF, Phillips-Perron & KPSS) on original data.\nstationary.test(df1, method = “adf”)stationary.test(df1, method = “pp”) # same as pp.test(x)stationary.test(df1, method = “kpss”)Augmented Dickey-Fuller Test alternative: stationary Type 1: no drift no trend lag ADF p.value[1,] 0 0.843 0.887[2,] 1 0.886 0.899[3,] 2 0.937 0.906[4,] 3 0.924 0.904[5,] 4 0.864 0.893[6,] 5 1.024 0.917Type 2: with drift no trend lag ADF p.value[1,] 0 -0.1706 0.936[2,] 1 -0.0728 0.950[3,] 2 -0.0496 0.952[4,] 3 -0.0435 0.952[5,] 4 -0.0883 0.947[6,] 5 0.3066 0.978Type 3: with drift and trend lag ADF p.value[1,] 0 -2.84 0.224[2,] 1 -2.83 0.228[3,] 2 -2.72 0.272[4,] 3 -2.79 0.242[5,] 4 -2.96 0.172[6,] 5 -2.96 0.173---- Note: in fact, p.value = 0.01 means p.value <= 0.01 Phillips-Perron Unit Root Test alternative: stationary Type 1: no drift no trend lag Z_rho p.value 5 0.343 0.768----- Type 2: with drift no trend lag Z_rho p.value 5 -0.0692 0.953----- Type 3: with drift and trend lag Z_rho p.value 5 -11.6 0.386--------------- Note: p-value = 0.01 means p.value <= 0.01 KPSS Unit Root Test alternative: nonstationary Type 1: no drift no trend lag stat p.value 4 0.261 0.1----- Type 2: with drift no trend lag stat p.value 4 0.367 0.0914----- Type 1: with drift and trend lag stat p.value 4 0.123 0.0924----------- Note: p.value = 0.01 means p.value <= 0.01 : p.value = 0.10 means p.value >= 0.10\nI have normalized the dataset using mean and std. dev.\nThe stationary = Gaussian noise and one with a trend = cumulative sum of Gaussian noise.\nHere, we will check each for characteristics of stationarity by looking at the auto-correlation functions of each signal. We would expect the ACF to go to 0 for each time lag (τ) for a stationary signal, because we expect no dependence with time.\nWe see here that, the stationary signal has very few lags exceeding the CI of the ACF . The trend resulted in almost all lags exceeding the confidence interval. It can be concluded that the ACF signal is stationary. But, the trend signal is not stationary . The stationary series has a better variance around the mean level, and the peaks are evidence of the interventions in the original series.\nWe will further decompose the time series which involves a combination of level, trend, seasonality, and noise components. Decomposition helps to provide a better understanding of problems during analysis and forecasting.\nWe may apply differencing the data or log transform the data to eliminate trend and seasonality. Such process may not be a shortcoming if we are only concerned with forecasting. However, in many contexts of statistics and econometric application, knowledge of this components has underlying importance. Estimates of trend & seasonal can be recovered from differenced series by maximizing the residual mean square but this is not as appealing as modeling the components directly. We have to remember that, real series are never stationary.\nHere, we will use simple moving average smoothing method of the time series to estimate the trend component.\ndf1SMA8 <- SMA(df1, n=8) # smoothing with moving average 8plot.ts(df1SMA8)\ndf1Comp <- decompose(df1SMA8) # decomposingplot(df1Comp, yax.flip=TRUE)\nThe plot shows the original time series (top), the estimated trend component (second from top), the estimated seasonal component (third from top), and the estimated irregular component (bottom).\nWe see that the estimated trend component shows a small decrease from about 9 in 1997 to about 7 in 1999, followed by a steady increase from then on to about 12 in 2019.\ndf1.Comp.seasonal <- sapply(df1Comp$seasonal, nchar)df1SeasonAdj <- df1 — df1.Comp.seasonalplot.ts(df1SeasonAdj)\nWe will also explore Kalman filter for series filtering & smoothening purpose prior to prediction.\nStructural time series models are (linear Gaussian) state-space models for (uni-variate) time series. When considering state space architecture, normally we are interested in considering three primary areas:\nPrediction which is forecasting subsequent values of the state\nFiltering which is estimating the current values of the state from past and current observations\nSmoothing which is estimating the past values of the state given the observations\nWe will use Kalman Filter to carry out the various types of inference.\nFiltering helps us to update our knowledge of the system as each observation comes in. Smoothing helps us to base our estimates of quantities of interest on the entire sample.\nStructural mode has the advantage of being of simple usage and quite reliable. It gives the main tools for fitting a structural model for a time series by maximum likelihood.\nStructural time series state-space model based on a decomposition of the series into a number of components. They are specified by a set of error variances, some of which may be zero. We will use a basic structural model to fit the stochastic level model to forecast. The two main components which make up state space models are (1) an observed data and (2) the unobserved states.\nThe simplest model is the local level model has an underlying level μt which evolves by:\nWe need to see the observations, since the states are hidden to us by system noise. The observations are a linear combination of the current state and some additional random variation known as measurement noise. The observations are:\nIt is in fact an ARIMA(0,1,1) model, but with restrictions on the parameter set. This is stochastically varying level (random walk) observed with noise.\nThe local linear trend model has the same measurement equation, but with a time-varying slope in the dynamics for μt, given by\nwith three variance parameters. Here εt , ξt and ζt are independent Gaussian white noise processes. The basic structural model, is a local trend model with an additional seasonal component. Thus the measurement equation is:\nwhere γt is a seasonal component with dynamics\nIt’s best practice to check the convergence of the structural procedure. As with any structural process we need to have appropriate initial starting points to ensure the algorithm will converge to the right maximum.\nautoplot(training, series=”Training data”) + autolayer(fitted(train, h=12), series=”12-step fitted values”)\nCross validation is an important step of time series analysis.\nFit model to data y1, . . . , yt\nGenerate 1-step ahead forecast ˆyt+1\nCompute forecast error e ∗ t+1 = yt+1 − yˆt+1\nRepeat steps 1–3 for t = m, . . . , n − 1 where m is minimum number of observations to fit model\nCompute forecast MSE from e ∗ m+1, . . . , e ∗\nThe p-value of Ljung-Box test of residuals is 0.2131015 > significant level(0.05); therefore, it is not advisable to use the result of the cross-validation as the model is clearly under-fitting the data.\nThe first diagnostic that we do with any statistical analysis is check that our residuals correspond to our assumed error structure. We have two types of errors in a uni-variate state-space model: process errors, the wt, and observation errors, the vt. They should not have a temporal trend.\nvt are the difference between the data and the predicted data at time t: vt = yt − Zxt − a\nIn a state-space model, xt is stochastic and the model residuals are a random variable. yt is also stochastic, though often observed unlike xt. The model residual random variable is: Vt = Yt − ZXt − a\nThe unconditional mean and variance of Vt is 0 and R\ncheckresiduals(train)\nKalman filter algorithm uses a series of measurements observed over time, containing noise and other inaccuracies, and produces estimates of unknown variables. This estimate tend to be more accurate than those based on a single measurement alone. Using a Kalman filter does not assume that the errors are Gaussian; however, the filter yields the exact conditional probability estimate in the special case that all errors are Gaussian.\nKalman filter is a means to find the estimates of the process. Filtering comes from its primitive use of reducing or “filtering out” unwanted variables which in our case is the estimation error.\nsm <- tsSmooth(train)plot(df1)lines(sm[,1],col=’blue’)lines(fitted(train)[,1],col=’red’)# Seasonally adjusted datatraining.sa <- df1 — sm[, 1]lines(training.sa, col=’black’)legend(“topleft”,col=c(‘blue’, ’red’, ‘black’), lty=1, legend=c(“Filtered level”, ”Smoothed level”)\nx <- trainingmiss <- sample(1:length(x), 12)x[miss] <- NAestim <- sm[,1] + sm[, 2]plot(x, ylim=range(df1))points(time(x)[miss], estim[miss], col = ’red’, pch = 1)points(time(x)[miss], df1[miss], col = ’blue’, pch = 1)legend(“topleft”, pch = 1, col = c(2,1), legend = c(“Estimate”, ”Actual”))\nplot(sm, main = “”)mtext(text = “decomposition of the basic structural”, side = 3, adj = 0, line = 1)\nsm %>% forecast(h=12) %>% autoplot() + autolayer(testing)\nBelow plot shows the foretasted Schlumberger data together with 50% and 90% probability intervals.\nAs we can see that, BSM model is been able to pick up the seasonal component quite well . One can experiment here with SMA based decomposition ( as shown earlier) and compare the forecast accuracy.\ndlm models are a special case of state space models where the errors of the state and observed components are normally distributed. Here, Kalman filter will be used to:\nfiltered values of state vectors.\nsmoothed values of state vectors and finally,\nforecast provides means and variances of future observations and states.\nWe have to define the parameters before fitting a dlm model. The parameters are V, W (covariance matrices of the measurement and state equations, respectively), FF and GG (measurement equation matrix and transition matrix respectively), and m0, C0 (prior mean and covariance matrix of the state vector).\nHowever, here, we start the dlm model by writing a small function as below:\nI have considered a local level model with dlm A polynomial DLM (a local linear trend is a polynomial DLM of order 2) and seasonal component 12. It’s good practice rather part of best practice to check the convergence of the MLE procedure.\nKalman filter and smoother have been applied as well.\nWe can see that, dlm model’s prediction accuracy fairly well. Filter and smooth lines are almost moving together in the series and do not differ much from each other. The seasonal components are ignored here. The lines of forecast series and the original series are quite close.\nA good example of state-space models with time series analysis can be found here.\nState space models come in lots of flavors and a flexible way of handling lots of time series models and provide a framework for handling missing values, likelihood estimation, smoothing, forecasting, etc. Both uni-variate and multi-variate data can be used to fit state space model. We have shown a basic level model in this exercise.\nI can be reached here.\nReference:\nDurbin, J., & Koopman, S. J. (2012). Time series analysis by state space methods. Oxford university press.Giovanni Petris & Sonia Petrone (2011), State Space Models in R, Journal of Statistical SoftwareG Petris, S Petrone, and P Campagnoli (2009). Dynamic Linear Models with R. SpringerHyndman, R. J., & Athanasopoulos, G. (2018). Forecasting: principles and practice. OTexts.\nDurbin, J., & Koopman, S. J. (2012). Time series analysis by state space methods. Oxford university press.\nGiovanni Petris & Sonia Petrone (2011), State Space Models in R, Journal of Statistical Software\nG Petris, S Petrone, and P Campagnoli (2009). Dynamic Linear Models with R. Springer\nHyndman, R. J., & Athanasopoulos, G. (2018). Forecasting: principles and practice. OTexts."
[ { "code": null, "e": 215, "s": 172, "text": "https://sarit-maitra.medium.com/membership" }, { "code": null, "e": 517, "s": 215, "text": "Time series consist of four major components: Seasonal variations (SV), Trend variations (TV), Cyclical variations (CV), and Random variations ...
Program to find maximum score in stone game in Python
Suppose there are several stones placed in a row, and each of these stones has an associated number which is given in an array stoneValue. In each round Amal divides the row into two parts then Bimal calculates the value of each part which is the sum of the values of all the stones in this part. Bimal throws away the p...
[ { "code": null, "e": 1726, "s": 1062, "text": "Suppose there are several stones placed in a row, and each of these stones has an associated number which is given in an array stoneValue. In each round Amal divides the row into two parts then Bimal calculates the value of each part which is the sum of...
C# | Convert.ToInt32(String, IFormatProvider) Method - GeeksforGeeks
05 Dec, 2019 This method is used to converts the specified string representation of a number to an equivalent 32-bit signed integer, using the specified culture-specific formatting information. Syntax: public static int ToInt32 (string value, IFormatProvider provider); Parameters: value: It is a string that contains th...
[ { "code": null, "e": 24302, "s": 24274, "text": "\n05 Dec, 2019" }, { "code": null, "e": 24483, "s": 24302, "text": "This method is used to converts the specified string representation of a number to an equivalent 32-bit signed integer, using the specified culture-specific format...
JavaScript | Object.isExtensible() Method - GeeksforGeeks
17 Sep, 2021 The Object.preventExtensions() method in JavaScript is standard built-in objects which checks whether an object is extensible or not.Syntax: Object.isExtensible( obj ) Parameters: This method accepts single parameter as mentioned above and described below: obj: This parameter holds the object which whi...
[ { "code": null, "e": 24909, "s": 24881, "text": "\n17 Sep, 2021" }, { "code": null, "e": 25052, "s": 24909, "text": "The Object.preventExtensions() method in JavaScript is standard built-in objects which checks whether an object is extensible or not.Syntax: " }, { "code"...
Pascal - Constants
A constant is an entity that remains unchanged during program execution. Pascal allows only constants of the following types to be declared − Ordinal types Set types Pointer types (but the only allowed value is Nil). Real types Char String Syntax for declaring constants is as follows − const identifier = constant_value...
[ { "code": null, "e": 2225, "s": 2083, "text": "A constant is an entity that remains unchanged during program execution. Pascal allows only constants of the following types to be declared −" }, { "code": null, "e": 2239, "s": 2225, "text": "Ordinal types" }, { "code": null...
MySQL Tryit Editor v1.0
SELECT LOCATE("3", "W3Schools.com") AS MatchPosition; ​ Edit the SQL Statement, and click "Run SQL" to see the result. This SQL-Statement is not supported in the WebSQL Database. The example still works, because it uses a modified version of SQL. Your browser does not support WebSQL. Your are now using a light...
[ { "code": null, "e": 54, "s": 0, "text": "SELECT LOCATE(\"3\", \"W3Schools.com\") AS MatchPosition;" }, { "code": null, "e": 56, "s": 54, "text": "​" }, { "code": null, "e": 128, "s": 65, "text": "Edit the SQL Statement, and click \"Run SQL\" to see the result...
Sort array of points by ascending distance from a given point JavaScript
Let’s say, we have an array of objects with each object having exactly two properties, x and y that represent the coordinates of a point. We have to write a function that takes in this array and an object with x and y coordinates of a point and we have to sort the points (objects) in the array according to the distance...
[ { "code": null, "e": 1427, "s": 1062, "text": "Let’s say, we have an array of objects with each object having exactly two properties, x and y\nthat represent the coordinates of a point. We have to write a function that takes in this array and\nan object with x and y coordinates of a point and we hav...
Instruction type PUSH rp in 8085 Microprocessor
In 8085 Instruction set, PUSH rp instruction stores contents of register pair rp by pushing it into two locations above the top of the stack. rp stands for one of the following register pairs. rp = BC, DE, HL, or PSW As rp can have any of the four values, there are four opcodes for this type of instruction. It occupie...
[ { "code": null, "e": 1255, "s": 1062, "text": "In 8085 Instruction set, PUSH rp instruction stores contents of register pair rp by pushing it into two locations above the top of the stack. rp stands for one of the following register pairs." }, { "code": null, "e": 1280, "s": 1255, ...
Sum of all the elements in an array divisible by a given number K - GeeksforGeeks
03 Aug, 2021 Given an array containing N elements and a number K. The task is to find the sum of all such elements which are divisible by K.Examples: Input : arr[] = {15, 16, 10, 9, 6, 7, 17} K = 3 Output : 30 Explanation: As 15, 9, 6 are divisible by 3. So, sum of elements divisible by K = 15 + 9 + 6 = 30. ...
[ { "code": null, "e": 24536, "s": 24508, "text": "\n03 Aug, 2021" }, { "code": null, "e": 24675, "s": 24536, "text": "Given an array containing N elements and a number K. The task is to find the sum of all such elements which are divisible by K.Examples: " }, { "code": nu...
Go Programming Language (Introduction) - GeeksforGeeks
05 Mar, 2021 Introduction Go is a procedural programming language. It was developed in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson at Google but launched in 2009 as an open-source programming language. Programs are assembled by using packages, for efficient management of dependencies. This language also suppor...
[ { "code": null, "e": 24539, "s": 24511, "text": "\n05 Mar, 2021" }, { "code": null, "e": 24552, "s": 24539, "text": "Introduction" }, { "code": null, "e": 24994, "s": 24552, "text": "Go is a procedural programming language. It was developed in 2007 by Robert G...
How to plot single data with two Y-axes (two units) in Matplotlib?
To plot single data with two Y-Axes (Two units) in Matplotlib, we can take the following steps − Set the figure size and adjust the padding between and around the subplots. Create speed and acceleration data points using numpy. Add a subplot to the current figure. Plot speed data points using plot() method. Create a tw...
[ { "code": null, "e": 1159, "s": 1062, "text": "To plot single data with two Y-Axes (Two units) in Matplotlib, we can take the following steps −" }, { "code": null, "e": 1235, "s": 1159, "text": "Set the figure size and adjust the padding between and around the subplots." }, {...
strdup() and strdndup() in C/C++
The function strdup() is used to duplicate a string. It returns a pointer to null-terminated byte string. Here is the syntax of strdup() in C language, char *strdup(const char *string); Here is an example of strdup() in C language, Live Demo #include <stdio.h> #include<string.h> int main() { char *str = "Helloworld...
[ { "code": null, "e": 1168, "s": 1062, "text": "The function strdup() is used to duplicate a string. It returns a pointer to null-terminated byte string." }, { "code": null, "e": 1214, "s": 1168, "text": "Here is the syntax of strdup() in C language," }, { "code": null, ...
Google Guice - Provider Class
As @provides method becomes more complex, this method can be moved to separate classes using Provider interface. class SpellCheckerProvider implements Provider<SpellChecker> { @Override public SpellChecker get() { String dbUrl = "jdbc:mysql://localhost:5326/emp"; String user = "user"; int timeou...
[ { "code": null, "e": 2215, "s": 2102, "text": "As @provides method becomes more complex, this method can be moved to separate classes using Provider interface." }, { "code": null, "e": 2544, "s": 2215, "text": "class SpellCheckerProvider implements Provider<SpellChecker> {\n @O...
Count 1's in a sorted binary array - GeeksforGeeks
28 Feb, 2022 Given a binary array sorted in non-increasing order, count the number of 1’s in it. Examples: Input: arr[] = {1, 1, 0, 0, 0, 0, 0} Output: 2 Input: arr[] = {1, 1, 1, 1, 1, 1, 1} Output: 7 Input: arr[] = {0, 0, 0, 0, 0, 0, 0} Output: 0 A simple solution is to linearly traverse the array. The time comple...
[ { "code": null, "e": 24968, "s": 24940, "text": "\n28 Feb, 2022" }, { "code": null, "e": 25053, "s": 24968, "text": "Given a binary array sorted in non-increasing order, count the number of 1’s in it. " }, { "code": null, "e": 25064, "s": 25053, "text": "Examp...
A Practical Guide on Missing Values with Pandas | by Soner Yıldırım | Towards Data Science
Missing values indicate we do not have the information about a feature (column) of a particular observation (row). Why not just remove that observation from the dataset and go ahead? We can but should not. The reasons are: We typically have many features of an observation so we don’t want to lose the observation just b...
[ { "code": null, "e": 395, "s": 172, "text": "Missing values indicate we do not have the information about a feature (column) of a particular observation (row). Why not just remove that observation from the dataset and go ahead? We can but should not. The reasons are:" }, { "code": null, ...
C program to perform union operation on two arrays
A union is a special data type available in C programming language that allows to store different data types in the same memory location. Unions provide an efficient way of using the same memory location for multiple-purpose. If array 1 = { 1,2,3,4,6} Array 2 = {1,2,5,6,7} Then, union of array1 and array 2 is Array...
[ { "code": null, "e": 1288, "s": 1062, "text": "A union is a special data type available in C programming language that allows to store different data types in the same memory location. Unions provide an efficient way of using the same memory location for multiple-purpose." }, { "code": null,...
JavaScript - Math sqrt Method
This method returns the square root of a number. If the value of a number is negative, sqrt returns NaN. Its syntax is as follows − Math.sqrt( x ) ; x − A number Returns the square root of a given number. Try the following example program. <html> <head> <title>JavaScript Math sqrt() Method</title> </hea...
[ { "code": null, "e": 2571, "s": 2466, "text": "This method returns the square root of a number. If the value of a number is negative, sqrt returns NaN." }, { "code": null, "e": 2598, "s": 2571, "text": "Its syntax is as follows −" }, { "code": null, "e": 2616, "s"...
Using else conditional statement with for loop in python
In this article, we will be learning about loop-else statements in Python 3.x. Or earlier. In this tutorial, we will focus on for loop & else statement way of execution. In other languages, the else functionality is only provided in if-else pairs. But Python allows us to implement the else functionality with for loops ...
[ { "code": null, "e": 1232, "s": 1062, "text": "In this article, we will be learning about loop-else statements in Python 3.x. Or earlier. In this tutorial, we will focus on for loop & else statement way of execution." }, { "code": null, "e": 1392, "s": 1232, "text": "In other lan...
Case Study: Breast Cancer Classification Using a Support Vector Machine | by Mahsa Mir | Towards Data Science
In this tutorial, we’re going to create a model to predict whether a patient has a positive breast cancer diagnosis based on several tumor features. The breast cancer database is a publicly available dataset from the UCI Machine learning Repository. It gives information on tumor features such as tumor size, density, an...
[ { "code": null, "e": 320, "s": 171, "text": "In this tutorial, we’re going to create a model to predict whether a patient has a positive breast cancer diagnosis based on several tumor features." }, { "code": null, "e": 502, "s": 320, "text": "The breast cancer database is a publi...
SharePoint - Feature\Event Receiver
In this chapter, we will learn to add code handle. Code handles are events that are raised when a Feature is activated or deactivated. In other words, we will be examining Feature Receivers. The Visual Studio project that we created in the last chapter had one Feature and when it was activated, it provisioned our Conta...
[ { "code": null, "e": 2506, "s": 2315, "text": "In this chapter, we will learn to add code handle. Code handles are events that are raised when a Feature is activated or deactivated. In other words, we will be examining Feature Receivers." }, { "code": null, "e": 2689, "s": 2506, ...
ChronoZonedDateTime format() method in Java with Examples - GeeksforGeeks
28 May, 2019 The format() method of ChronoZonedDateTime interface in Java is used to format this date-time using the specified formatter passed as parameter.This date-time will be passed to the formatter to produce a string. Syntax: default String format(DateTimeFormatter formatter) Parameters: This method accepts a s...
[ { "code": null, "e": 23948, "s": 23920, "text": "\n28 May, 2019" }, { "code": null, "e": 24160, "s": 23948, "text": "The format() method of ChronoZonedDateTime interface in Java is used to format this date-time using the specified formatter passed as parameter.This date-time will...
Elasticsearch Search Engine | An introduction - GeeksforGeeks
07 Feb, 2019 Elasticsearch is a full-text search and analytics engine based on Apache Lucene. Elasticsearch makes it easier to perform data aggregation operations on data from multiple sources and to perform unstructured queries such as Fuzzy Searches on the stored data. It stores data in a document-like format, simila...
[ { "code": null, "e": 24328, "s": 24300, "text": "\n07 Feb, 2019" }, { "code": null, "e": 24587, "s": 24328, "text": "Elasticsearch is a full-text search and analytics engine based on Apache Lucene. Elasticsearch makes it easier to perform data aggregation operations on data from ...
Find whether a given number is a power of 4 or not - GeeksforGeeks
12 Jan, 2022 Given an integer n, find whether it is a power of 4 or not. Example : Input : 16 Output : 16 is a power of 4 Input : 20 Output : 20 is not a power of 4 1. A simple method is to take a log of the given number on base 4, and if we get an integer then the number is the power of 4. 2. Another solution is to ...
[ { "code": null, "e": 24569, "s": 24541, "text": "\n12 Jan, 2022" }, { "code": null, "e": 24629, "s": 24569, "text": "Given an integer n, find whether it is a power of 4 or not." }, { "code": null, "e": 24640, "s": 24629, "text": "Example : " }, { "code...
Data Structure and Algorithms - Linked List
A linked list is a sequence of data structures, which are connected together via links. Linked List is a sequence of links which contains items. Each link contains a connection to another link. Linked list is the second most-used data structure after array. Following are the important terms to understand the concept of...
[ { "code": null, "e": 2668, "s": 2580, "text": "A linked list is a sequence of data structures, which are connected together via links." }, { "code": null, "e": 2914, "s": 2668, "text": "Linked List is a sequence of links which contains items. Each link contains a connection to an...
Modeling COVID-19 epidemic with Python | by Andrea Amparore | Towards Data Science
Because of the country lockdown currently enforced in Italy, also this weekend I had to stay at home, like billions of other people in this world. So, I decided to make use of this time for playing with data on COVID-19 pandemics in Italy, which is released daily by the Italian Civil Protection Department. In this arti...
[ { "code": null, "e": 480, "s": 172, "text": "Because of the country lockdown currently enforced in Italy, also this weekend I had to stay at home, like billions of other people in this world. So, I decided to make use of this time for playing with data on COVID-19 pandemics in Italy, which is releas...
CodeIgniter - Page Redirection
While building web application, we often need to redirect the user from one page to another page. CodeIgniter makes this job easy for us. The redirect() function is used for this purpose. Syntax Parameters $uri (string) − URI string $uri (string) − URI string $method (string) − Redirect method (‘auto’, ‘location’ or ‘r...
[ { "code": null, "e": 2507, "s": 2319, "text": "While building web application, we often need to redirect the user from one page to another page. CodeIgniter makes this job easy for us. The redirect() function is used for this purpose." }, { "code": null, "e": 2514, "s": 2507, "te...
Floyd Warshall | Practice | GeeksforGeeks
The problem is to find shortest distances between every pair of vertices in a given edge weighted directed Graph. The Graph is represented as adjancency matrix, and the matrix denotes the weight of the edegs (if it exists) else -1. Do it in-place. Example 1: Input: matrix = {{0,25},{-1,0}} Output: {{0,25},{-1,0}} Exp...
[ { "code": null, "e": 488, "s": 238, "text": "The problem is to find shortest distances between every pair of vertices in a given edge weighted directed Graph. The Graph is represented as adjancency matrix, and the matrix denotes the weight of the edegs (if it exists) else -1. Do it in-place.\n " }...
How to Install and Configure NFS Server on Linux
In this article we will learn and configure NFS (Network File System) which is basically used to share the files and folders between Linux systems. This was developed by Sun Microsystems in 1980 which allows us to mount the file system in the network and remote users can interact and the share just like local file and ...
[ { "code": null, "e": 1391, "s": 1062, "text": "In this article we will learn and configure NFS (Network File System) which is basically used to share the files and folders between Linux systems. This was developed by Sun Microsystems in 1980 which allows us to mount the file system in the network an...
How to Adjust Title Position in Matplotlib? - GeeksforGeeks
28 Nov, 2021 In this article, you learn how to modify the Title position in matplotlib in Python. The title() method in matplotlib module is used to specify title of the visualization depicted and displays the title using various attributes. Syntax: matplotlib.pyplot.title(label, fontdict=None, loc=’center’, pad=None, ...
[ { "code": null, "e": 23901, "s": 23873, "text": "\n28 Nov, 2021" }, { "code": null, "e": 23986, "s": 23901, "text": "In this article, you learn how to modify the Title position in matplotlib in Python." }, { "code": null, "e": 24130, "s": 23986, "text": "The t...
Query returning no data in SAP Business One using Table Relationship
This looks like an issue with Join in queries. Try replacing Inner join with Left join like this. I ran this query and it is working fine: select T0.DocNum as 'Payment Number',T0.DocDate 'Payment Date',T0.CardCode, T0.CardName 'Customer Name',T1.BankCode 'Bankcode',T3.BankName 'Bank Name', T2.Phone1 , T0.CreditSum, T0....
[ { "code": null, "e": 1201, "s": 1062, "text": "This looks like an issue with Join in queries. Try replacing Inner join with Left join like this. I ran this query and it is working fine:" }, { "code": null, "e": 2650, "s": 1201, "text": "select T0.DocNum as 'Payment Number',T0.Doc...
numpy.where() in Python - GeeksforGeeks
03 Dec, 2020 The numpy.where() function returns the indices of elements in an input array where the given condition is satisfied. Syntax :numpy.where(condition[, x, y])Parameters:condition : When True, yield x, otherwise yield y.x, y : Values from which to choose. x, y and condition need to be broadcastable to some sha...
[ { "code": null, "e": 24407, "s": 24379, "text": "\n03 Dec, 2020" }, { "code": null, "e": 24524, "s": 24407, "text": "The numpy.where() function returns the indices of elements in an input array where the given condition is satisfied." }, { "code": null, "e": 24718, ...
My Google Foobar journey. Level 2.1 — Elevator Maintenance | by Pratick Roy | Towards Data Science
Level 2.1 — Elevator Maintenance My Google FooBar Journey: Level 1 — Getting the Invitation.My Google FooBar Journey: Level 2.1 — Elevator Maintenance. (This one) My Google FooBar Journey: Level 1 — Getting the Invitation. My Google FooBar Journey: Level 2.1 — Elevator Maintenance. (This one) You survived a week in Com...
[ { "code": null, "e": 205, "s": 172, "text": "Level 2.1 — Elevator Maintenance" }, { "code": null, "e": 335, "s": 205, "text": "My Google FooBar Journey: Level 1 — Getting the Invitation.My Google FooBar Journey: Level 2.1 — Elevator Maintenance. (This one)" }, { "code": n...
Hexagonal Architecture in Java - GeeksforGeeks
17 Sep, 2021 As per the software development design principle, the software which requires the minimum effort of maintenance is considered as good design. That is, maintenance should be the key point which an architect must consider. In this article, one such architecture, known as Hexagonal Architecture which makes th...
[ { "code": null, "e": 25859, "s": 25831, "text": "\n17 Sep, 2021" }, { "code": null, "e": 26842, "s": 25859, "text": "As per the software development design principle, the software which requires the minimum effort of maintenance is considered as good design. That is, maintenance ...
Connecting to Azure SQL Server using Python | by James Ho | Towards Data Science
This article provides a step-by-step tutorial of connecting to Azure SQL Server using Python on Linux OS. After creating an Azure SQL Database/Server, you can find the server name on the overview page. Azure SQL Server uses ODBC (Open Database Connectivity) as the driver. A database driver is a computer program that im...
[ { "code": null, "e": 278, "s": 172, "text": "This article provides a step-by-step tutorial of connecting to Azure SQL Server using Python on Linux OS." }, { "code": null, "e": 374, "s": 278, "text": "After creating an Azure SQL Database/Server, you can find the server name on the...
How are Spectrum and Bandwidth defined in Wireless Communications?
Spectrum refers to the entire range of frequencies right from the starting frequency (the lowest frequency) to the ending frequency (the highest frequency). Spectrum basically refers to the entire group of frequencies. The electromagnetic spectrum is one good example. The electromagnetic (EM) spectrum covers frequencie...
[ { "code": null, "e": 1281, "s": 1062, "text": "Spectrum refers to the entire range of frequencies right from the starting frequency (the lowest frequency) to the ending frequency (the highest frequency). Spectrum basically refers to the entire group of frequencies." }, { "code": null, "e...
Angular PrimeNG Button Component - GeeksforGeeks
11 Sep, 2021 Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Button Component in Angular PrimeNG. We will also learn about...
[ { "code": null, "e": 26464, "s": 26436, "text": "\n11 Sep, 2021" }, { "code": null, "e": 26854, "s": 26464, "text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp...
How to display video controls in HTML5 ? - GeeksforGeeks
06 Apr, 2021 The HTML <video> controls attribute is used to display video controls in HTML5. It is the Boolean value. HTML5 most commonly uses ogg, mp4, ogm and ogv as a video formats in the video tag because the browser support for them differs. Syntax <video controls> <source> </video> From above Syntax controls a...
[ { "code": null, "e": 32981, "s": 32953, "text": "\n06 Apr, 2021" }, { "code": null, "e": 33216, "s": 32981, "text": "The HTML <video> controls attribute is used to display video controls in HTML5. It is the Boolean value. HTML5 most commonly uses ogg, mp4, ogm and ogv as a video...