title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Comparable vs Comparator in Java - GeeksforGeeks
29 May, 2021 Java provides two interfaces to sort objects using data members of the class: ComparableComparator Comparable Comparator Using Comparable Interface A comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface to compare its ...
[ { "code": null, "e": 25511, "s": 25483, "text": "\n29 May, 2021" }, { "code": null, "e": 25591, "s": 25511, "text": "Java provides two interfaces to sort objects using data members of the class: " }, { "code": null, "e": 25612, "s": 25591, "text": "Comparable...
How to define a function Using the WITH clause in Oracle?
Problem: You want to define a function in Oracle using WITH clause. Solution Starting with Oracle Database 12.1, you can define functions as well as procedures within the same SQL statement in which the SELECT statement appears. This allows the context switch between the PL/SQL and SQL engines by allowing both steps to...
[ { "code": null, "e": 1071, "s": 1062, "text": "Problem:" }, { "code": null, "e": 1130, "s": 1071, "text": "You want to define a function in Oracle using WITH clause." }, { "code": null, "e": 1139, "s": 1130, "text": "Solution" }, { "code": null, "e...
p5.js | print() function - GeeksforGeeks
12 Apr, 2019 The print() function in p5.js writes the content on console area of the web browser. It is helpful for looking at the data a program is producing which helps in debugging the code. The elements can be separated by using quotes (“”) and joined with the addition operator (+). Use print(‘\n’) to display blank...
[ { "code": null, "e": 45047, "s": 45019, "text": "\n12 Apr, 2019" }, { "code": null, "e": 45361, "s": 45047, "text": "The print() function in p5.js writes the content on console area of the web browser. It is helpful for looking at the data a program is producing which helps in de...
Read and Edit Image Metadata with Python | by Kenneth Leung | Towards Data Science
For every photo, there is more than meets the eye. The images taken with digital cameras and smartphones contain rich information (known as metadata) beyond the visible pixels. This metadata can be helpful in many business cases. For instance, fraud detection systems for insurance claims analyze metadata of submitted p...
[ { "code": null, "e": 349, "s": 172, "text": "For every photo, there is more than meets the eye. The images taken with digital cameras and smartphones contain rich information (known as metadata) beyond the visible pixels." }, { "code": null, "e": 564, "s": 349, "text": "This meta...
copy in Python (Deep Copy and Shallow Copy) - GeeksforGeeks
10 Feb, 2020 In Python, Assignment statements do not copy objects, they create bindings between a target and an object. When we use = operator user thinks that this creates a new object; well, it doesn’t. It only creates a new variable that shares the reference of the original object. Sometimes a user wants to work wit...
[ { "code": null, "e": 25397, "s": 25369, "text": "\n10 Feb, 2020" }, { "code": null, "e": 25985, "s": 25397, "text": "In Python, Assignment statements do not copy objects, they create bindings between a target and an object. When we use = operator user thinks that this creates a n...
Throwable getStackTrace() method in Java with Examples - GeeksforGeeks
19 Aug, 2019 The getStackTrace() method of Throwable class used to return an array of stack trace elements which is the stack trace information printed by printStackTrace(). In the array of stack trace elements(assuming the array’s length is non-zero), each element represents one stack frame. The first element of the a...
[ { "code": null, "e": 25873, "s": 25845, "text": "\n19 Aug, 2019" }, { "code": null, "e": 26813, "s": 25873, "text": "The getStackTrace() method of Throwable class used to return an array of stack trace elements which is the stack trace information printed by printStackTrace(). In...
How to convert two-dimensional array into an object in JavaScript ? - GeeksforGeeks
16 Apr, 2021 In this article, we will learn how to convert a two-dimensional array to an object. A two-dimensional array can have any number of rows and two columns. Example: Input: [ ["John", 12], ["Jack", 13], ["Matt", 14], ["Maxx", 15] ] Output: { "John": 12, ...
[ { "code": null, "e": 39215, "s": 39187, "text": "\n16 Apr, 2021" }, { "code": null, "e": 39368, "s": 39215, "text": "In this article, we will learn how to convert a two-dimensional array to an object. A two-dimensional array can have any number of rows and two columns." }, { ...
Getting last element of an array in Julia - last() Method - GeeksforGeeks
26 Mar, 2020 The last() is an inbuilt function in julia which is used to return the last element of the specified iterable collection. Syntax: last(coll) Parameters: coll: Specified iterable collection. Returns: It returns the last element of the specified iterable collection. Example 1: # Julia program to illustrate #...
[ { "code": null, "e": 25629, "s": 25601, "text": "\n26 Mar, 2020" }, { "code": null, "e": 25751, "s": 25629, "text": "The last() is an inbuilt function in julia which is used to return the last element of the specified iterable collection." }, { "code": null, "e": 2577...
Flipkart Interview Experience for SDE Internship | On-Campus 2021 - GeeksforGeeks
28 Sep, 2021 Flipkart recently visited our campus, hiring for SDE Internship for summer 2021. They were open only for students in CSE and had no CGPA criteria. The hiring workflow consisted of 4 rounds in total ( 1 Coding Round, 2 Technical Interviews, and 1 HM Interview ). Note: Everything, including the interviews, ...
[ { "code": null, "e": 26769, "s": 26741, "text": "\n28 Sep, 2021" }, { "code": null, "e": 26917, "s": 26769, "text": "Flipkart recently visited our campus, hiring for SDE Internship for summer 2021. They were open only for students in CSE and had no CGPA criteria. " }, { "...
JavaScript | template literals - GeeksforGeeks
23 Oct, 2019 Template Literal in ES6 provides new features to create a string that gives more control over dynamic strings. Traditionally, String is created using single quotes (‘) or double quotes (“) quotes. Template literal is created using the backtick (`) character. Syntax: var s=`some string`; Multiline Strings: ...
[ { "code": null, "e": 25647, "s": 25619, "text": "\n23 Oct, 2019" }, { "code": null, "e": 25906, "s": 25647, "text": "Template Literal in ES6 provides new features to create a string that gives more control over dynamic strings. Traditionally, String is created using single quotes...
Automate Instagram Messages using Python - GeeksforGeeks
01 Nov, 2020 In this article, we will see how to send a single message to any number of people. We just have to provide a list of users. We will use selenium for this task. Selenium: It is an open-source tool that automates web browsers. It provides a single interface that lets you write test scripts in programming lan...
[ { "code": null, "e": 25889, "s": 25861, "text": "\n01 Nov, 2020" }, { "code": null, "e": 26049, "s": 25889, "text": "In this article, we will see how to send a single message to any number of people. We just have to provide a list of users. We will use selenium for this task." ...
numpy.ones() in Python - GeeksforGeeks
21 Feb, 2022 The numpy.ones() function returns a new array of given shape and type, with ones. Syntax: numpy.ones(shape, dtype = None, order = 'C') Parameters : shape : integer or sequence of integers order : C_contiguous or F_contiguous C-contiguous order in memory(last index varies the fastest) ...
[ { "code": null, "e": 25335, "s": 25307, "text": "\n21 Feb, 2022" }, { "code": null, "e": 25418, "s": 25335, "text": "The numpy.ones() function returns a new array of given shape and type, with ones. " }, { "code": null, "e": 25472, "s": 25418, "text": "Syntax:...
Basic SQL Injection and Mitigation with Example - GeeksforGeeks
08 Apr, 2019 SQL injection is a code injection technique, used to attack data driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker). SQL Injection can be used in a range of ways to cause serious problems. By levering SQ...
[ { "code": null, "e": 24258, "s": 24230, "text": "\n08 Apr, 2019" }, { "code": null, "e": 24479, "s": 24258, "text": "SQL injection is a code injection technique, used to attack data driven applications, in which malicious SQL statements are inserted into an entry field for execut...
How to decode a string after encoding in JavaScript?
To encode a string we need encodeURIComponent() or encodeURI() and to decode a string we need decodeURIComponent() or decodeURI(). Initially, we have used escape() to encode a string but since it is deprecated we are now using encodeURI(). encodeURIComponent(string); decodeURIComponent(string); In the following example...
[ { "code": null, "e": 1302, "s": 1062, "text": "To encode a string we need encodeURIComponent() or encodeURI() and to decode a string we need decodeURIComponent() or decodeURI(). Initially, we have used escape() to encode a string but since it is deprecated we are now using encodeURI()." }, { ...
Bootstrap 4 .card-img-bottom class
Use the card-img-bottom class in Bootstrap 4 to place an image at the bottom inside a Bootstrap 4 card. Set the card body, and within that, the card title and card text − <div class="card-body"> <h4 class="card-title">Quantitative Aptitude</h4> <p class="card-text">For Entrance Exams</p> <a href="#" class="btn bt...
[ { "code": null, "e": 1166, "s": 1062, "text": "Use the card-img-bottom class in Bootstrap 4 to place an image at the bottom inside a Bootstrap 4 card." }, { "code": null, "e": 1233, "s": 1166, "text": "Set the card body, and within that, the card title and card text −" }, { ...
How to properly highlight selected items on Android RecyclerView using Kotlin?
This example demonstrates how to properly highlight selected items on Android RecyclerView 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" e...
[ { "code": null, "e": 1167, "s": 1062, "text": "This example demonstrates how to properly highlight selected items on Android RecyclerView using Kotlin." }, { "code": null, "e": 1296, "s": 1167, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and...
Progress Bars in Python (and pandas!) | by Peter Nistrup | Towards Data Science
Time and estimate the progress of your functions in Python (and pandas!) In this article I’ll try to break my own record for the shortest, most concise article ever, so without further ado, let’s go! tqdm is a package for Python that enables you to instantly create progress bars and estimate TTC (Time To Completion) fo...
[ { "code": null, "e": 120, "s": 47, "text": "Time and estimate the progress of your functions in Python (and pandas!)" }, { "code": null, "e": 247, "s": 120, "text": "In this article I’ll try to break my own record for the shortest, most concise article ever, so without further ad...
Matplotlib.pyplot.axhspan() in Python - GeeksforGeeks
27 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. The axhspan() function in pyplot module of matplotlib library is used to add a horizontal span (rectangle) acros...
[ { "code": null, "e": 25753, "s": 25725, "text": "\n27 Apr, 2020" }, { "code": null, "e": 25948, "s": 25753, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which pr...
C++ Boolean Matrix
Boolean matrix is a matrix that has only two elements 0 and 1. For this boolean Matrix question, we have a boolean matrix arr[m][n] of size mXn. And the condition to solve is, if m[i][j] = 1 then m[i] = 1 and m[j] = 1 which means all elements of the ith row and jth column will become 1. Let’s take an example, Input: ar...
[ { "code": null, "e": 1350, "s": 1062, "text": "Boolean matrix is a matrix that has only two elements 0 and 1. For this boolean Matrix question, we have a boolean matrix arr[m][n] of size mXn. And the condition to solve is, if m[i][j] = 1 then m[i] = 1 and m[j] = 1 which means all elements of the ith...
Tail recursion to calculate sum of array elements. - GeeksforGeeks
14 May, 2021 Given an array A[], we need to find the sum of its elements using Tail Recursion Method. We generally want to achieve tail recursion (a recursive function where recursive call is the last thing that function does) so that compilers can optimize the code. Basically, if recursive call is the last statement, ...
[ { "code": null, "e": 26357, "s": 26329, "text": "\n14 May, 2021" }, { "code": null, "e": 26737, "s": 26357, "text": "Given an array A[], we need to find the sum of its elements using Tail Recursion Method. We generally want to achieve tail recursion (a recursive function where re...
Find if a number is divisible by every number in a list - GeeksforGeeks
27 Jan, 2022 Given a list and a number task is to find the number which is divided by every element of the list. Examples : Input : List = [1, 2, 3, 4, 5] Number = 3 Output : No Input : List = [4, 8, 12, 16, 20] Number = 4 Output : Yes Algorithm: 1. Run a loop till length of the list 2. Divide ...
[ { "code": null, "e": 26603, "s": 26575, "text": "\n27 Jan, 2022" }, { "code": null, "e": 26716, "s": 26603, "text": "Given a list and a number task is to find the number which is divided by every element of the list. Examples : " }, { "code": null, "e": 26849, "s...
Determine The Face Tilt Using OpenCV - Python - GeeksforGeeks
01 Oct, 2021 In this article, we are going to see how to determine the face tilt using OpenCV in Python. To achieve this we will be using a popular computer vision library opencv-python. In this program with the help of the OpenCV library, we will detect faces in a live stream from a webcam or a video file and subseque...
[ { "code": null, "e": 24838, "s": 24810, "text": "\n01 Oct, 2021" }, { "code": null, "e": 24930, "s": 24838, "text": "In this article, we are going to see how to determine the face tilt using OpenCV in Python." }, { "code": null, "e": 25207, "s": 24930, "text":...
CSS Combinators
A combinator is something that explains the relationship between the selectors. A CSS selector can contain more than one simple selector. Between the simple selectors, we can include a combinator. There are four different combinators in CSS: descendant selector (space) child selector (>) adjacent sibling selector (+) ...
[ { "code": null, "e": 80, "s": 0, "text": "A combinator is something that explains the relationship between the selectors." }, { "code": null, "e": 198, "s": 80, "text": "A CSS selector can contain more than one simple selector. Between the simple \nselectors, we can include a com...
Factors affecting Cache Memory Performance - GeeksforGeeks
11 Jan, 2021 Computers are made of three primary blocs. A CPU, a memory, and an I/O system. The performance of a computer system is very much dependent on the speed with which the CPU can fetch instructions from the memory and write to the same memory. Computers are using cache memory to bridge the gap between the proc...
[ { "code": null, "e": 24786, "s": 24758, "text": "\n11 Jan, 2021" }, { "code": null, "e": 25193, "s": 24786, "text": "Computers are made of three primary blocs. A CPU, a memory, and an I/O system. The performance of a computer system is very much dependent on the speed with which ...
Java Program For Rearranging An Array In Maximum Minimum Form - Set 2 (O(1) extra space) - GeeksforGeeks
06 Jan, 2022 Given a sorted array of positive integers, rearrange the array alternately i.e first element should be the maximum value, second minimum value, third-second max, fourth-second min and so on. Examples: Input: arr[] = {1, 2, 3, 4, 5, 6, 7} Output: arr[] = {7, 1, 6, 2, 5, 3, 4}Input: arr[] = {1, 2, 3, 4, 5, 6...
[ { "code": null, "e": 26151, "s": 26123, "text": "\n06 Jan, 2022" }, { "code": null, "e": 26352, "s": 26151, "text": "Given a sorted array of positive integers, rearrange the array alternately i.e first element should be the maximum value, second minimum value, third-second max, f...
GATE | GATE-CS-2009 | Question 42 - GeeksforGeeks
28 Jun, 2021 Which of the following statements are TRUE? I. There exist parsing algorithms for some programming languages whose complexities are less than O(n3). II. A programming language which allows recursion can be implemented with static storage allocation. III. No L-attributed definition can be evalu...
[ { "code": null, "e": 25695, "s": 25667, "text": "\n28 Jun, 2021" }, { "code": null, "e": 25739, "s": 25695, "text": "Which of the following statements are TRUE?" }, { "code": null, "e": 26162, "s": 25739, "text": "I. There exist parsing algorithms for some pr...
Number of edges in a perfect binary tree with N levels
10 Mar, 2022 Given a positive integer N, the task is to find the count of edges of a perfect binary tree with N levels.Examples: Input: N = 2 Output: 2 1 / \ 2 3 Input: N = 3 Output: 6 1 / \ 2 3 / \ / \ 4 5 6 7 Approach: It can be observed that for the values of N = 1, 2, 3, ..., ...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Mar, 2022" }, { "code": null, "e": 146, "s": 28, "text": "Given a positive integer N, the task is to find the count of edges of a perfect binary tree with N levels.Examples: " }, { "code": null, "e": 263, "s": 146, ...
Underscore (_) in Python
16 Nov, 2021 Following are different places where _ is used in Python: Single Underscore:In InterpreterAfter a nameBefore a nameDouble Underscore:__leading_double_underscore__before_after__ Single Underscore:In InterpreterAfter a nameBefore a name In Interpreter After a name Before a name Double Underscore:__leading_do...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 Nov, 2021" }, { "code": null, "e": 112, "s": 54, "text": "Following are different places where _ is used in Python:" }, { "code": null, "e": 231, "s": 112, "text": "Single Underscore:In InterpreterAfter a nameBef...
PostgreSQL - LIKE Clause
The PostgreSQL LIKE operator is used to match text values against a pattern using wildcards. If the search expression can be matched to the pattern expression, the LIKE operator will return true, which is 1. There are two wildcards used in conjunction with the LIKE operator − The percent sign (%) The underscore (_) The...
[ { "code": null, "e": 3167, "s": 2959, "text": "The PostgreSQL LIKE operator is used to match text values against a pattern using wildcards. If the search expression can be matched to the pattern expression, the LIKE operator will return true, which is 1." }, { "code": null, "e": 3236, ...
ReactJS UI Ant Design InputNumber Component
21 May, 2021 Ant Design Library has this component pre-built, and it is very easy to integrate as well. InputNumber Component allows the user to enter a number within a certain range with the help of a keyboard or mouse. We can use the following approach in ReactJS to use the Ant Design InputNumber Component. InputNumb...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 May, 2021" }, { "code": null, "e": 326, "s": 28, "text": "Ant Design Library has this component pre-built, and it is very easy to integrate as well. InputNumber Component allows the user to enter a number within a certain range with ...
Program to express a positive integer number in words in C++
Suppose we are given a positive integer number. We have to spell the number in words; like if a number "56" is given as input the output will be "Fifty-Six". The range of conversion is up to a billion. So, if the input is like input = 5678, then the output will be Five Thousand Six Hundred Seventy-Eight. To solve this,...
[ { "code": null, "e": 1389, "s": 1187, "text": "Suppose we are given a positive integer number. We have to spell the number in words; like if a number \"56\" is given as input the output will be \"Fifty-Six\". The range of conversion is up to a billion." }, { "code": null, "e": 1493, ...
PHP | Unset() vs Unlink() Function
26 May, 2021 Both the function are used to do some undo operations but used in different situations cause both acts differently. The unlink() function is used when you want to delete the files completely. The unset() Function is used when you want to make that file empty.Unlink() function: The unlink() function is an i...
[ { "code": null, "e": 28, "s": 0, "text": "\n26 May, 2021" }, { "code": null, "e": 586, "s": 28, "text": "Both the function are used to do some undo operations but used in different situations cause both acts differently. The unlink() function is used when you want to delete the f...
Line Chart using Plotly in Python
12 Feb, 2021 Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot and many more. It is mainly used in data analysis as well as financial analysis. plotly is an interactive visualization library. Line...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Feb, 2021" }, { "code": null, "e": 331, "s": 28, "text": "Plotly is a Python library which is used to design graphs, especially interactive graphs. It can plot various graphs and charts like histogram, barplot, boxplot, spreadplot an...
How to hide an element when printing a web page using CSS?
22 Mar, 2021 The media query is used to hide an element when printing web pages. Use @media print query and set the visibility hidden to that element that needs to hide at printing. Example 1: In this example, hide the element h1 at printing time. To hide the element h1 use media query and set visibility:hidden. html...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Mar, 2021" }, { "code": null, "e": 198, "s": 28, "text": "The media query is used to hide an element when printing web pages. Use @media print query and set the visibility hidden to that element that needs to hide at printing. " },...
Submatrix Sum Queries
16 Jun, 2022 Given a matrix of size M x N, there are large number of queries to find submatrix sums. Inputs to queries are left top and right bottom indexes of submatrix whose sum is to find out. How to preprocess the matrix so that submatrix sum queries can be performed in O(1) time.Example : tli : Row number of to...
[ { "code": null, "e": 54, "s": 26, "text": "\n16 Jun, 2022" }, { "code": null, "e": 338, "s": 54, "text": "Given a matrix of size M x N, there are large number of queries to find submatrix sums. Inputs to queries are left top and right bottom indexes of submatrix whose sum is to f...
ReactJS Props Complete Reference
07 Jun, 2022 React allows us to pass information to a Component (from a parent component to a child component) using something called props (short for properties). Props is basically an object which is available for all the React components. Props are read only and cannot be modified by the component to which it belong...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Jun, 2022" }, { "code": null, "e": 339, "s": 28, "text": "React allows us to pass information to a Component (from a parent component to a child component) using something called props (short for properties). Props is basically an ob...
What is AGP(Accelerated Graphics Port)?
22 May, 2020 An Accelerated Graphics Port (AGP) is a point to point channel that is used for high-speed video output. This port is used to connect graphic cards to a computer’s motherboard. It increases the speed at which machines can render graphics while using the system’s resources more efficiently. The primary purp...
[ { "code": null, "e": 53, "s": 25, "text": "\n22 May, 2020" }, { "code": null, "e": 451, "s": 53, "text": "An Accelerated Graphics Port (AGP) is a point to point channel that is used for high-speed video output. This port is used to connect graphic cards to a computer’s motherboar...
Matplotlib.patches.Wedge class in Python
07 Oct, 2021 Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. The matplotlib.patches.Wedge class is used to add wedge-shaped patches in the plot. The wedge...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Oct, 2021" }, { "code": null, "e": 242, "s": 28, "text": "Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed t...
Implement rand12() using rand6() in one line
20 Aug, 2016 Given a function rand6() that returns random numbers from 1 to 6 with equal probability, implement one-liner function rand12() using rand6() that returns random numbers from 1 to 12 with equal probability. Solution should minimize the number of calls to rand6() method. Use of any other library function and...
[ { "code": null, "e": 54, "s": 26, "text": "\n20 Aug, 2016" }, { "code": null, "e": 405, "s": 54, "text": "Given a function rand6() that returns random numbers from 1 to 6 with equal probability, implement one-liner function rand12() using rand6() that returns random numbers from ...
Lodash _.throttle() Method
23 Sep, 2020 Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. The _.throttle() method in lodash is used to create a throttled function that can only call the func parameter maximally once per every wait milliseconds. The throttle...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Sep, 2020" }, { "code": null, "e": 168, "s": 28, "text": "Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc." }, { "code": null, "e"...
All the Core Functions of Python Pandas You Need to Know | Towards Data Science
As one of the most popular libraries in the Python programming language, Pandas is a “must-learn” library for Data I/O, cleansing, transforming and aggregation. It is quite common to see such kinds of questions in Stack Overflow regarding Pandas: How to transform my data frame like ... How to count distinct values of a...
[ { "code": null, "e": 333, "s": 172, "text": "As one of the most popular libraries in the Python programming language, Pandas is a “must-learn” library for Data I/O, cleansing, transforming and aggregation." }, { "code": null, "e": 419, "s": 333, "text": "It is quite common to see...
Bootstrap 4 .btn-outline-success Button class
Use the btn-outline-success class in Bootstrap to set green outline to a button. Green button outline states success and you can set a button like this − <button type="button" class="btn btn-outline-success"> Result </button> Above I have set the class on <button> element just like we set a class on any other element...
[ { "code": null, "e": 1143, "s": 1062, "text": "Use the btn-outline-success class in Bootstrap to set green outline to a button." }, { "code": null, "e": 1216, "s": 1143, "text": "Green button outline states success and you can set a button like this −" }, { "code": null, ...
How out-gridview selection works in PowerShell?
With the PowerShell Out-Gridview output, you have an option to select one or multiple selections. For example, if we run the below command, it will show us the output in the grid format. PS C:\> Get-Process | Out-GridView In this output, you don’t get any option to select the rows because its output mode is none. To ad...
[ { "code": null, "e": 1160, "s": 1062, "text": "With the PowerShell Out-Gridview output, you have an option to select one or multiple selections." }, { "code": null, "e": 1249, "s": 1160, "text": "For example, if we run the below command, it will show us the output in the grid for...
Java Program to find transpose of a matrix - GeeksforGeeks
07 Nov, 2018 Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing A[i][j] to A[j][i]. For Square Matrix : The below program finds transpose of A[][] and stores the result in B[][], we can change N for different dimension. // Java P...
[ { "code": null, "e": 24513, "s": 24485, "text": "\n07 Nov, 2018" }, { "code": null, "e": 24675, "s": 24513, "text": "Transpose of a matrix is obtained by changing rows to columns and columns to rows. In other words, transpose of A[][] is obtained by changing A[i][j] to A[j][i]." ...
Create a stopwatch using python
A stopwatch is used to measure the time interval between two events usually in seconds to minutes. It has various usage like in sports or measuring the flow of heat, current etc in an industrial setup. Python can be used to creat a stopwatch by using its tkinter library. This library will have the GUI features to creat...
[ { "code": null, "e": 1334, "s": 1062, "text": "A stopwatch is used to measure the time interval between two events usually in seconds to minutes. It has various usage like in sports or measuring the flow of heat, current etc in an industrial setup. Python can be used to creat a stopwatch by using it...
Perl continue Statement
A continue BLOCK, is always executed just before the conditional is about to be evaluated again. A continue statement can be used with while and foreach loops. A continue statement can also be used alone along with a BLOCK of code in which case it will be assumed as a flow control statement rather than a function. The ...
[ { "code": null, "e": 2536, "s": 2220, "text": "A continue BLOCK, is always executed just before the conditional is about to be evaluated again. A continue statement can be used with while and foreach loops. A continue statement can also be used alone along with a BLOCK of code in which case it will ...
Price Elasticity of Demand, Statistical Modeling with Python | by Susan Li | Towards Data Science
Price elasticity of demand (PED) is a measure used in economics to show the responsiveness, or elasticity, of the quantity demanded of a good or service to a change in its price when nothing but the price changes. More precisely, it gives the percentage change in quantity demanded in response to a one percent change in...
[ { "code": null, "e": 500, "s": 172, "text": "Price elasticity of demand (PED) is a measure used in economics to show the responsiveness, or elasticity, of the quantity demanded of a good or service to a change in its price when nothing but the price changes. More precisely, it gives the percentage c...
AngularJS | Scope - GeeksforGeeks
23 Feb, 2022 Scope in AngularJS is the binding part of HTML view and JavaScript controller. When you add properties into the scope object in the JavaScript controller, only then the HTML view gets access to those properties. There are two types of Scope in AngularJS. $Scope $rootScope Scope: There is few specific fea...
[ { "code": null, "e": 27880, "s": 27852, "text": "\n23 Feb, 2022" }, { "code": null, "e": 28137, "s": 27880, "text": "Scope in AngularJS is the binding part of HTML view and JavaScript controller. When you add properties into the scope object in the JavaScript controller, only the...
How to parse JSON on Android using Kotlin?
This example demonstrates how to parse JSON on Android 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" encoding="utf-8"?> <RelativeLayout xml...
[ { "code": null, "e": 1130, "s": 1062, "text": "This example demonstrates how to parse JSON on Android using Kotlin" }, { "code": null, "e": 1259, "s": 1130, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create ...
GATE | GATE-CS-2015 (Set 3) | Question 49 - GeeksforGeeks
28 Jun, 2021 Consider the following recursive C function. If get(6) function is being called in main() then how many times will the get() function be invoked before returning to the main()? void get (int n){ if (n < 1) return; get(n-1); get(n-3); printf("%d", n);} (A) 15(B) 25(C) 35(D) 45Answer: (B)Explanation:...
[ { "code": null, "e": 24057, "s": 24029, "text": "\n28 Jun, 2021" }, { "code": null, "e": 24234, "s": 24057, "text": "Consider the following recursive C function. If get(6) function is being called in main() then how many times will the get() function be invoked before returning t...
MomentJS - Locale
This method helps to get/set the duration using locale. When used with humanize, you will see the difference in output for locale() method. moment.duration().locale(); moment.duration().locale(String); var hi = moment.duration(1, "day").locale("hi").humanize(); var en = moment.duration(1, "minutes").locale("en").human...
[ { "code": null, "e": 2100, "s": 1960, "text": "This method helps to get/set the duration using locale. When used with humanize, you will see the difference in output for locale() method." }, { "code": null, "e": 2163, "s": 2100, "text": "moment.duration().locale();\nmoment.durati...
C program to implement Euclid’ s algorithm
Implement Euclid’ s algorithm to find the greatest common divisor (GCD) and least common multiple (LCM) of two integers and to output the results along with the given integers. The solution to implement Euclid’ s algorithm to find the greatest common divisor (GCD) and least common multiple (LCM) of two integers is as f...
[ { "code": null, "e": 1239, "s": 1062, "text": "Implement Euclid’ s algorithm to find the greatest common divisor (GCD) and least common multiple (LCM) of two integers and to output the results along with the given integers." }, { "code": null, "e": 1391, "s": 1239, "text": "The s...
Login and Registration in Android using Firebase in Kotlin - GeeksforGeeks
28 Feb, 2022 Firebase is a mobile and web application development platform. It provides services that a web application or mobile application might require. Firebase provides email and password authentication without any overhead of building the backend for user authentication. In this article, we will learn the fireba...
[ { "code": null, "e": 24725, "s": 24697, "text": "\n28 Feb, 2022" }, { "code": null, "e": 25124, "s": 24725, "text": "Firebase is a mobile and web application development platform. It provides services that a web application or mobile application might require. Firebase provides e...
How to format date string in PowerShell?
By default the when you run the (Get-Date) cmdlet, its output is in the below format. PS C:\WINDOWS\system32> Get-Date 18 March 2020 22:56:18 You can format the above output in the various format supported by PowerShell. d – Short date pattern. d – Short date pattern. PS C:\WINDOWS\system32> Get-Date -Format d 18-03-20...
[ { "code": null, "e": 1148, "s": 1062, "text": "By default the when you run the (Get-Date) cmdlet, its output is in the below format." }, { "code": null, "e": 1204, "s": 1148, "text": "PS C:\\WINDOWS\\system32> Get-Date\n18 March 2020 22:56:18" }, { "code": null, "e": ...
DB2 - Databases
This chapter describes creating, activating and deactivating the databases with the associated syntax. A database is a collection of Tables, Schemas, Bufferpools, Logs, Storage groups and Tablespaces working together to handle database operations efficiently. Database directory is an organized repository of databases. ...
[ { "code": null, "e": 2031, "s": 1928, "text": "This chapter describes creating, activating and deactivating the databases with the associated syntax." }, { "code": null, "e": 2188, "s": 2031, "text": "A database is a collection of Tables, Schemas, Bufferpools, Logs, Storage group...
Imbalanced Classification in Python: SMOTE-Tomek Links Method | by Raden Aurelius Andhika Viadinugroho | Towards Data Science
In a real-world application, classification modeling often encountered with an imbalanced dataset problem, where the number of majority class is much bigger than the minority class, thus make the model unable to learn from minority class well. This becomes a serious problem when the information in the dataset from the ...
[ { "code": null, "e": 615, "s": 172, "text": "In a real-world application, classification modeling often encountered with an imbalanced dataset problem, where the number of majority class is much bigger than the minority class, thus make the model unable to learn from minority class well. This become...
Building A Movie Recommendation Engine Using Pandas | by Nishit Jain | Towards Data Science
Recommendation Engines are the programs which basically compute the similarities between two entities and on that basis, they give us the targeted output. If we look at the root of any recommendation engine, they all are trying to find out the amount of similarity between two entities. Then, the computed similarities c...
[ { "code": null, "e": 578, "s": 172, "text": "Recommendation Engines are the programs which basically compute the similarities between two entities and on that basis, they give us the targeted output. If we look at the root of any recommendation engine, they all are trying to find out the amount of s...
How to get a Docker Container IP address?
We all know that we can run our application in a packaged environment called container using Docker. When you want containers to talk to each other, the network they create can be assumed to be a bridge network. Run the following command to get a list of networks. sudo docker network ls Each network of containers has a...
[ { "code": null, "e": 1327, "s": 1062, "text": "We all know that we can run our application in a packaged environment called container using Docker. When you want containers to talk to each other, the network they create can be assumed to be a bridge network. Run the following command to get a list o...
How do I split a multi-line string into multiple lines?
We can use the method splitlines() in string class to achieve this. >>> """some multi line string""".splitlines() ['some', 'multi line', 'string'] We can also specify the delimiter '\n' in the split() method as follows − >>> """some multi line string""".split('\n') ['some', 'multi line', 'string']
[ { "code": null, "e": 1131, "s": 1062, "text": "We can use the method splitlines() in string class to achieve this. " }, { "code": null, "e": 1210, "s": 1131, "text": ">>> \"\"\"some\nmulti line\nstring\"\"\".splitlines()\n['some', 'multi line', 'string']" }, { "code": nul...
Building your own Covid-19 Epidemic Simple Model Using Python | by Sadegh Maghsoudi | Towards Data Science
If you live in this world, there is a very small chance you may have not yet heard of this novel Coronavirus Covid-19 and the pandemic it caused literally all over the world. Actually, it is a good chance that you are reading this while self quarantined at your home, social distancing from public and like many, have ve...
[ { "code": null, "e": 749, "s": 172, "text": "If you live in this world, there is a very small chance you may have not yet heard of this novel Coronavirus Covid-19 and the pandemic it caused literally all over the world. Actually, it is a good chance that you are reading this while self quarantined a...
ElegantRL-Helloworld: A Lightweight and Stable Deep Reinforcement Learning Library | by Xiao-Yang Liu | Towards Data Science
This article by Xiao-Yang Liu, Steven Li and Yiyan Zeng (J. Zheng) describes the ElegantRL library (Twitter and Github). One sentence summary of reinforcement learning (RL): in RL, an agent learns by continuously interacting with an environment, in a trial-and-error manner, making sequential decisions under uncertainty...
[ { "code": null, "e": 292, "s": 171, "text": "This article by Xiao-Yang Liu, Steven Li and Yiyan Zeng (J. Zheng) describes the ElegantRL library (Twitter and Github)." }, { "code": null, "e": 613, "s": 292, "text": "One sentence summary of reinforcement learning (RL): in RL, an ag...
Synonyms and Antonyms in Python. Text Mining — Extracting Synonyms and... | by Dhilip Subramanian | Towards Data Science
Language analysis can be carried out in many ways. In this blog, we will see how to extract Synonyms and Antonyms from the text using Natural Language Processing(NLTK) WordNet library. The WordNet is a part of Python’s Natural Language Toolkit. It is a large collection of words and vocabulary from the English language ...
[ { "code": null, "e": 357, "s": 172, "text": "Language analysis can be carried out in many ways. In this blog, we will see how to extract Synonyms and Antonyms from the text using Natural Language Processing(NLTK) WordNet library." }, { "code": null, "e": 840, "s": 357, "text": "T...
Count of ways to distribute N items among 3 people with one person receiving maximum - GeeksforGeeks
19 Jul, 2021 Given an integer N, the task is to find the total number of ways to distribute N among 3 people such that: Exactly one person gets the maximum number of items among all the 3 people. Each person gets at least 1 item. Examples: Input: N = 5 Output: 3 Explanation: 3 way distribute the item among 3 people...
[ { "code": null, "e": 24612, "s": 24584, "text": "\n19 Jul, 2021" }, { "code": null, "e": 24721, "s": 24612, "text": "Given an integer N, the task is to find the total number of ways to distribute N among 3 people such that: " }, { "code": null, "e": 24797, "s": 2...
Python Pandas - Draw a Bar Plot and use median as the estimate of central tendency
Bar Plot in Seaborn is used to show point estimates and confidence intervals as rectangular bars. The seaborn.barplot() is used for this. Plotting horizontal bar plots with dataset columns as x and y values. Use the estimator parameter to set median as the estimate of central tendency. Let’s say the following is our da...
[ { "code": null, "e": 1349, "s": 1062, "text": "Bar Plot in Seaborn is used to show point estimates and confidence intervals as rectangular bars. The seaborn.barplot() is used for this. Plotting horizontal bar plots with dataset columns as x and y values. Use the estimator parameter to set median as ...
SAP HANA - SQL Functions
There are various SQL functions provided by SAP HANA database − Numeric Functions String Functions Fulltext Functions Datetime Functions Aggregate Functions Data Type Conversion Functions Window Functions Series Data Functions Miscellaneous Functions These are inbuilt numeric functions in SQL and use in scripting. It t...
[ { "code": null, "e": 3171, "s": 3107, "text": "There are various SQL functions provided by SAP HANA database −" }, { "code": null, "e": 3189, "s": 3171, "text": "Numeric Functions" }, { "code": null, "e": 3206, "s": 3189, "text": "String Functions" }, { ...
How to read data from *.CSV file using JavaScript?
To read .CSV using JavaScript, use the open-source CSV parser, Papa Parser. The following are the features − Open Source Parse millions of data using multi-threaded CSV parser Supports multiple web browsers Using the parser, you can easily skip commented characters Let’s say your CSV file isn’t on your system. What wil...
[ { "code": null, "e": 1171, "s": 1062, "text": "To read .CSV using JavaScript, use the open-source CSV parser, Papa Parser. The following are the features −" }, { "code": null, "e": 1183, "s": 1171, "text": "Open Source" }, { "code": null, "e": 1238, "s": 1183, ...
NavigationView in ActionBar in Android
Before getting into the Navigation view example, we should know about navigation view. Navigation view is just like a sliding menu in HTML. Navigation view is extended by navigatoin drawer. Most of use cases of Navigation view is used to redirect different activities or show profile information. This example demonstrat...
[ { "code": null, "e": 1359, "s": 1062, "text": "Before getting into the Navigation view example, we should know about navigation view. Navigation view is just like a sliding menu in HTML. Navigation view is extended by navigatoin drawer. Most of use cases of Navigation view is used to redirect differ...
C Program to Multiply two Floating Point Numbers?
Float is a shortened term for "floating-point." By definition, it's a fundamental data type built into the compiler that's used to define numeric values with floating decimal points. A floating-point type variable is a variable that can hold a real number, such as 4320.0, -3.33, or 0.01226. The floating part of the nam...
[ { "code": null, "e": 1542, "s": 1062, "text": "Float is a shortened term for \"floating-point.\" By definition, it's a fundamental data type built into the compiler that's used to define numeric values with floating decimal points. A floating-point type variable is a variable that can hold a real nu...
How to get Characters Count in Python from a File - 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, we will see how to get char...
[ { "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, ...
What are auto and decltype in C++?
Auto is a keyword in C++11 and later that is used for automatic type deduction. Type inference or deduction refers to the automatic detection of the data type of an expression in a programming language. It is a feature present in some strongly statically typed languages. For example, you want to create an iterator to i...
[ { "code": null, "e": 1447, "s": 1062, "text": "Auto is a keyword in C++11 and later that is used for automatic type deduction. Type inference or deduction refers to the automatic detection of the data type of an expression in a programming language. It is a feature present in some strongly staticall...
One-tailed or two-tailed test, that is the question | by Eryk Lewinson | Towards Data Science
In data science/econometrics we see statistical tests in many places: correlation analysis, ANOVA, A/B testing, linear regression results, etc. Therefore, for the practitioners, it is very important to thoroughly understand their meaning and know why a given test was used in a particular place. In this article, I would...
[ { "code": null, "e": 643, "s": 172, "text": "In data science/econometrics we see statistical tests in many places: correlation analysis, ANOVA, A/B testing, linear regression results, etc. Therefore, for the practitioners, it is very important to thoroughly understand their meaning and know why a gi...
DB2 - with XML
This chapter describes use of XML with DB2. PureXML feature allows you to store well-formed XML documents in columns of database tables. Those columns have XML database. Data is kept in its native hierarchical form by storing XML data in XML column. The stored XML data can be accessed and managed by DB2 database server...
[ { "code": null, "e": 1972, "s": 1928, "text": "This chapter describes use of XML with DB2." }, { "code": null, "e": 2460, "s": 1972, "text": "PureXML feature allows you to store well-formed XML documents in columns of database tables. Those columns have XML database. Data is kept...
Image Similarity Detection in Action with Tensorflow 2.0 | by Erdem Isbilen | Towards Data Science
In this post, I will show you how I implemented the ‘Image Similarity Detection’ task in my ‘Fashion Price Comparison’ web application. I will use image similarity to suggest users visually similar products based on what they searched. The full source code of the implementation is available in my GitHub repository. Thr...
[ { "code": null, "e": 408, "s": 172, "text": "In this post, I will show you how I implemented the ‘Image Similarity Detection’ task in my ‘Fashion Price Comparison’ web application. I will use image similarity to suggest users visually similar products based on what they searched." }, { "code...
Remove duplicate elements from sorted Array | Practice | GeeksforGeeks
Given a sorted array A[] of size N, delete all the duplicates elements from A[]. Note: Don't use set or HashMap to solve the problem. Example 1: Input: N = 5 Array = {2, 2, 2, 2, 2} Output: 2 Explanation: After removing all the duplicates only one instance of 2 will remain. Example 2: Input: N = 3 Array = {1, 2, 2} ...
[ { "code": null, "e": 372, "s": 238, "text": "Given a sorted array A[] of size N, delete all the duplicates elements from A[].\nNote: Don't use set or HashMap to solve the problem." }, { "code": null, "e": 384, "s": 372, "text": "\nExample 1:" }, { "code": null, "e": 5...
Java Examples - Swing applet in JAVA?
How to use swing applet in JAVA? Following example demonstrates how to go use Swing Applet in JAVA by implementing ActionListener & by creating JLabels. import javax.swing.*; import java.applet.*; import java.awt.*; import java.awt.event.*; public class SApplet extends Applet implements ActionListener { TextField i...
[ { "code": null, "e": 2101, "s": 2068, "text": "How to use swing applet in JAVA?" }, { "code": null, "e": 2221, "s": 2101, "text": "Following example demonstrates how to go use Swing Applet in JAVA by implementing ActionListener & by creating JLabels." }, { "code": null, ...
Difference between import and package in Java?
In Java classes and interfaces related to each other are grouped under a package. Package is nothing but a directory storing classes and interfaces of a particular concept. For example, all the classes and interfaces related to input and output operations are stored in java.io package. You can group required classes an...
[ { "code": null, "e": 1349, "s": 1062, "text": "In Java classes and interfaces related to each other are grouped under a package. Package is nothing but a directory storing classes and interfaces of a particular concept. For example, all the classes and interfaces related to input and output operatio...
How to set multiple cookies in JavaScript?
With JavaScript, to set more than one cookie, set document.cookie more than once using the; separator. You can try to run the following code to set multiple cookies − Live Demo <!DOCTYPE html> <html> <head> <script> var num=1; function addCookie() { document.cookie=num+"="+num; nu...
[ { "code": null, "e": 1165, "s": 1062, "text": "With JavaScript, to set more than one cookie, set document.cookie more than once using the; separator." }, { "code": null, "e": 1229, "s": 1165, "text": "You can try to run the following code to set multiple cookies −" }, { "...
Download Anything to Google Drive using Google colab - GeeksforGeeks
30 Oct, 2019 When we download/upload something from a cloud server, it gives more transfer rate as compared to a normal server. We can use Google Drive for storage as well as fast speed download. The problem is how to upload something to G-Drive direct from Internet. So, Here we will see a solution to upload anything t...
[ { "code": null, "e": 24800, "s": 24772, "text": "\n30 Oct, 2019" }, { "code": null, "e": 25146, "s": 24800, "text": "When we download/upload something from a cloud server, it gives more transfer rate as compared to a normal server. We can use Google Drive for storage as well as f...
How to extract numbers from string in PHP ? - GeeksforGeeks
21 May, 2021 In this article, we will extract numbers from strings using PHP. There are various built-in methods to extract numbers from strings, some of them are discussed below. Methods: Using preg_match_all() Function. Using filter_var() Function. Using preg_replace() function. Method 1: Using preg_match_all() Fun...
[ { "code": null, "e": 24972, "s": 24944, "text": "\n21 May, 2021" }, { "code": null, "e": 25139, "s": 24972, "text": "In this article, we will extract numbers from strings using PHP. There are various built-in methods to extract numbers from strings, some of them are discussed bel...
Cat command in Linux with examples - GeeksforGeeks
06 Dec, 2021 Cat(concatenate) command is very frequently used in Linux. It reads data from the file and gives their content as output. It helps us to create, view, concatenate files. So let us see some frequently used cat commands. 1) To view a single file Command: $cat filename Output It will show content of give...
[ { "code": null, "e": 23705, "s": 23677, "text": "\n06 Dec, 2021" }, { "code": null, "e": 23925, "s": 23705, "text": "Cat(concatenate) command is very frequently used in Linux. It reads data from the file and gives their content as output. It helps us to create, view, concatenate ...
PCA and OLS in matrix form with R | by Serafim Petrov | Apr, 2021 | Towards Data Science | Towards Data Science
Principal Component Analysis (PCA) and Ordinary Least Squares (OLS) are two important statistical methods. They are even better when performed together. We will explore these methods using matrix operations in R and introduce a basic Principal Component Regression (PCR) technique. We will generate a simple data set of ...
[ { "code": null, "e": 454, "s": 172, "text": "Principal Component Analysis (PCA) and Ordinary Least Squares (OLS) are two important statistical methods. They are even better when performed together. We will explore these methods using matrix operations in R and introduce a basic Principal Component R...
How to deallocate the Azure VM using Azure CLI in PowerShell?
To deallocate the Azure VM using Azure CLI, we need to use the VM deallocation command az vm deallocate and need to provide the name of the VM and the resource group of the VM. Before running the deallocation command, make sure that you are connected to the proper azure subscription and the azure account. PS C:\> az vm...
[ { "code": null, "e": 1239, "s": 1062, "text": "To deallocate the Azure VM using Azure CLI, we need to use the VM deallocation command az vm deallocate and need to provide the name of the VM and the resource group of the VM." }, { "code": null, "e": 1369, "s": 1239, "text": "Befor...
Apache Spark - Core Programming
Spark Core is the base of the whole project. It provides distributed task dispatching, scheduling, and basic I/O functionalities. Spark uses a specialized fundamental data structure known as RDD (Resilient Distributed Datasets) that is a logical collection of data partitioned across machines. RDDs can be created in two...
[ { "code": null, "e": 2251, "s": 1771, "text": "Spark Core is the base of the whole project. It provides distributed task dispatching, scheduling, and basic I/O functionalities. Spark uses a specialized fundamental data structure known as RDD (Resilient Distributed Datasets) that is a logical collect...
How to remove style added with .css() function using JavaScript? - GeeksforGeeks
22 Apr, 2019 There are many cases, especially as the content gets more interactive, where the developer want styles to dynamically kick in based on user input, some code having run in the background, and more. In these sorts of scenarios, the CSS model involving style rules or inline styles doesn’t help. The solution t...
[ { "code": null, "e": 24640, "s": 24612, "text": "\n22 Apr, 2019" }, { "code": null, "e": 24933, "s": 24640, "text": "There are many cases, especially as the content gets more interactive, where the developer want styles to dynamically kick in based on user input, some code having...
Interface Zigbee with Arduino
Zigbee is a wireless communication protocol targeted for battery powered devices (it has both low power and low cost). It generally operates in the 2.4GHz range (although there are geographic variations), and supports data ranges from 20 to 250 kbits/s. The transmission distance though, is small compared to the likes o...
[ { "code": null, "e": 1316, "s": 1062, "text": "Zigbee is a wireless communication protocol targeted for battery powered devices (it has both low power and low cost). It generally operates in the 2.4GHz range (although there are geographic variations), and supports data ranges from 20 to 250 kbits/s....
How do you make code reusable in C#?
To make code reusable in C#, use Interfaces. Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the members. It often helps in providing a standard structure that the ...
[ { "code": null, "e": 1413, "s": 1062, "text": "To make code reusable in C#, use Interfaces. Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the ...
Stopwatch class in C#
Stopwatch is a class in C# to measure the elapsed time. Use it to calculate the time a function took to execute. It is found under System.Diagnostics. To get the elapsed time, firstly begin the Stopwatch − var sw = Stopwatch.StartNew(); For elapsed ticks − long ticks = sw.ElapsedTicks; Let us see an example − Live Dem...
[ { "code": null, "e": 1213, "s": 1062, "text": "Stopwatch is a class in C# to measure the elapsed time. Use it to calculate the time a function took to execute. It is found under System.Diagnostics." }, { "code": null, "e": 1268, "s": 1213, "text": "To get the elapsed time, firstl...
wxPython - ComboBox & Choice Class
A wx.ComboBox object presents a list of items to select from. It can be configured to be a dropdown list or with permanent display. The selected item from the list is displayed in a text field, which by default is editable, but can be set to be read-only in the presence of wx.CB_READONLY style parameter. wxPython API c...
[ { "code": null, "e": 2014, "s": 1882, "text": "A wx.ComboBox object presents a list of items to select from. It can be configured to be a dropdown list or with permanent display." }, { "code": null, "e": 2188, "s": 2014, "text": "The selected item from the list is displayed in a ...
10 QuestionsTo Practice Before Your Databricks Apache Spark 3.0 Developer Exam | by AnBento | Towards Data Science
A note for my readers: This post includes affiliate links for which I may earn a small commission at no extra cost to you, should you make a purchase. If you are in the process of studying for the Databricks Associate Developer for Apache Spark 3.0 certification you are probably facing the same problem I faced a few we...
[ { "code": null, "e": 323, "s": 172, "text": "A note for my readers: This post includes affiliate links for which I may earn a small commission at no extra cost to you, should you make a purchase." }, { "code": null, "e": 548, "s": 323, "text": "If you are in the process of studyi...
Entity Framework - Native SQL
In Entity Framework you can query with your entity classes using LINQ. You can also run queries using raw SQL directly against the database using DbCOntext. The techniques can be applied equally to models created with Code First and EF Designer. The SqlQuery method on DbSet allows a raw SQL query to be written that wil...
[ { "code": null, "e": 3278, "s": 3032, "text": "In Entity Framework you can query with your entity classes using LINQ. You can also run queries using raw SQL directly against the database using DbCOntext. The techniques can be applied equally to models created with Code First and EF Designer." }, ...
The ResultSet updateRow() method with example
When we execute certain SQL queries (SELECT query in general) they return tabular data. The java.sql.ResultSet interface represents such tabular data returned by the SQL statements. i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQue...
[ { "code": null, "e": 1150, "s": 1062, "text": "When we execute certain SQL queries (SELECT query in general) they return tabular data." }, { "code": null, "e": 1244, "s": 1150, "text": "The java.sql.ResultSet interface represents such tabular data returned by the SQL statements."...
N-th number which is both a square and a cube - GeeksforGeeks
31 Mar, 2021 Given a number n, find the n-th number which is both a square and a cube. First few such numbers are 1, 64, 729, ... Examples : Input : 3 Output :729 729 is square of 27 and cube of 3. Input :5 Output :15625 The idea is simple, n-th such number is n6 C++ Java Python3 C# PHP Javascript // C++ pro...
[ { "code": null, "e": 24854, "s": 24826, "text": "\n31 Mar, 2021" }, { "code": null, "e": 24971, "s": 24854, "text": "Given a number n, find the n-th number which is both a square and a cube. First few such numbers are 1, 64, 729, ..." }, { "code": null, "e": 24983, ...
Python - Plot a Pie Chart for Pandas Dataframe with Matplotlib?
To plot a Pie Chart, use the plot.pie(). The pie plot is a proportional representation of the numerical data in a column. Import the required libraries − import pandas as pd import matplotlib.pyplot as plt Create a DataFrame − dataFrame = pd.DataFrame({ "Car": ['BMW', 'Lexus', 'Tesla', 'Mustang', 'Mercedes', 'Jaguar...
[ { "code": null, "e": 1184, "s": 1062, "text": "To plot a Pie Chart, use the plot.pie(). The pie plot is a proportional representation of the numerical data in a column." }, { "code": null, "e": 1216, "s": 1184, "text": "Import the required libraries −" }, { "code": null, ...
JavaScript - Variables
One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language. JavaScript allows you to work with three primitive data types − Numbers, eg. 123, 120.50 etc. Numbers, eg. 123, 120....
[ { "code": null, "e": 2670, "s": 2466, "text": "One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language." }, { "code": null, "e": 2734, "s...
Forecasting Multiple Time-Series Using Neural Network | by Sarit Maitra | Towards Data Science
ERROR: type should be string, got "https://sarit-maitra.medium.com/membership\nStock prediction is a difficult task because the data generated is enormous and is highly non-linear. Modeling such dynamical data require effective modeling technique which can analyze the hidden patterns and underlying dynamics. Neural network which is deep learning algorithms are capable of identifying and exploiting the interactions and patterns existing in a data through a self learning process.\nWe shall focus on a simple prediction model using long-short term memory architecture involving multiple time-series. We shall keep the whole exercise a simple process for illustration purpose and better understanding.\nLet us consider four different series S&P 500 (^GSPC), Dow Jones Industrial Average (^DJI), NASDAQ Composite (^IXIC) and Russell 2000 (^RUT) which is Chicago options. Our data set if from 1990 to till date. The data retrieved from yahoo finance and formatted into a Pandas DataFrame object.\nstock = ['^RUT', '^GSPC', '^DJI', '^IXIC' ]start = pd.to_datetime('1990-01-03')df = web.DataReader(stock, data_source = 'yahoo', start = start )print(df.head())\nLet us fit all the closing prices of the series in a neural network architecture and shall predict one series from there.\nX = data.copy()X = X.drop(columns = [‘Date’])print(X.shape)print(X.tail())\nIf we see the correlation analysis, we will know as why these 4 series are chosen.\nThe time series was split into a training set (80%) and a test set (20%) as shown below.\nsplit_ratio = 0.2X = X.values # Convert to NumPy arraysplit = int(len(X) * (1-split_ratio))train_set = X[: split]test_set = X[split:]print(train_set.shape, test_set.shape)\nLet us format the in such a way that, supervised learning can be applied for ML model. Here, both the training set and test set will undergo the same transformation. We will achieve the objective with the below function.\ndef supvervisedSeries(data, n, h): x, y = list (), list () for i in range (len(data)-n-h+1): x.append(data[i:(i+n)]) y.append(data[i+h+n-1]) return np.array(x), np.array(y)h = 1n = 4trainX, trainY = supvervisedSeries(training_set, n, h)testX, testY = supvervisedSeries(test_set, n, h)print(\"trainX: \", trainX.shape)print(\"trainY: \", trainY.shape)print(\"testX: \", testX.shape)print(\"testY: \", testY.shape)\nh = time horizon & n = number of features; these parameters are chosen prior to transformation.\nNow, trainY and testY must be modified as per required feature prediction because by default it contains all 4 features.\ntestY = np.reshape(testY[:, 0], (testY [:, 0].shape[0], 1))trainY = np.reshape(trainY[:, 0], (trainY[:, 0].shape[0], 1))print(“trainY: “, trainY.shape)print(“testY: “, testY.shape)\nHere, we have selected index[0] which is ^RUT daily Adj Close price.\nML model require the data to lie within the range (0, 1). We have used MinMaxScaler which rescales the data set such that all feature values are in the range [0, 1]. It normally preserve the shape of the data set.\nscalers = {}for i in range (trainX.shape[2]): scalers[i] = MinMaxScaler() trainX[:, :, i] = scalers[i].fit_transform(trainX[:, :, i])for i in range(testX.shape[2]): testX[:, :, i] = scalers[i].transform(testX[:, :, i])# The target values are 2D arrays, which is easy to scalescalerY = MinMaxScaler()trainY = scalerY.fit_transform(trainY)testY = scalerY.transform(testY)\nIn below, only 100 neurons in each layer was used to deal with our small data set. Also, dropout as a regularization technique was used to reduce overfitting. The class Dense represents a fully connected layer.\n# Flatten input (to support multivariate input)n_input = trainX.shape[1] * trainX.shape[2]trainX = trainX.reshape((trainX.shape[0], n_input))n_input = testX.shape[1] * testX.shape[2]testX = testX.reshape((testX.shape[0], n_input))# Create multilayered FFNN modelmodel = Sequential()model.add(Dense(100, activation='relu', input_dim=trainX.shape[1]))model.add(Dropout(0.2))model.add(Dense(100, activation='relu'))model.add(Dropout(0.2))model.add(Dense(100, activation='relu'))model.add(Dense(trainY.shape[1]))model.compile(loss='mean_squared_error', optimizer='adam')model.summary()# Fit modelhistory = model.fit(trainX, trainY, epochs =60, verbose =1)# Predict the test setpredictions = model.predict(testX)\nWe have to descale the data to bring back to original values using the same scaler that was originally used to scale the data.\n# Descalepredictions = scalerY.inverse_transform(predictions)testY = scalerY.inverse_transform(testY)# Mean absolute errormae = mean_absolute_error(testY, predictions)print(\"Test MAE: %.6f\" % mae)\nplt.figure(figsize=(15,6))plt.plot(predictions, label=\"Test set predictions\" )plt.plot(testY, label=\"Real data\")plt.legend()plt.ylabel('Price Index')plt.xlabel('time step' )plt.title (\"Russell 2000 Adj close Price prediction- with MAE {:10.4f}\".format(mae))plt.show()\nHere, it can be seen that out network architecture is able to pick-up the hidden trend in the data; similarly, other series can also be predicted selecting the right scale for chosen the series.\nWe can see that, deep neural network architecture is capable of capturing hidden dynamics and are able to make predictions. To keep it simple, we have just fitted a simple LSTM network and not optimized any parameter of our network. in order to built a robust network we have to work on the right parameters such as number of epochs, batch size, number of neurons, number of hidden layers etc.\nConnect me here."
[ { "code": null, "e": 215, "s": 172, "text": "https://sarit-maitra.medium.com/membership" }, { "code": null, "e": 619, "s": 215, "text": "Stock prediction is a difficult task because the data generated is enormous and is highly non-linear. Modeling such dynamical data require effe...
React Native - Running IOS
If you want to test your app in the IOS simulator, all you need is to open the root folder of your app in terminal and run − react-native run-ios The above command will start the simulator and run the app. We can also specify the device we want to use. react-native run-ios --simulator "iPhone 5s After you open the ap...
[ { "code": null, "e": 2469, "s": 2344, "text": "If you want to test your app in the IOS simulator, all you need is to open the root folder of your app in terminal and run −" }, { "code": null, "e": 2491, "s": 2469, "text": "react-native run-ios\n" }, { "code": null, "e...
MySQL - CREATE FUNCTION Statement
A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing. MySQL provides a set of built-in function which performs particular tasks for example the CURDATE() function returns the current...
[ { "code": null, "e": 2525, "s": 2333, "text": "A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing." }, { "code": null, "e": 2660, "s": 2525, ...
How to find the sum of diagonal elements in a table in R?
The sum of diagonal elements could be required in matrix analysis therefore, we can convert the matrix into a table and find the sum of diagonal elements. This can be easily done by using sun function by extracting diagonal elements of the table using diag function. For example, if we have a table T then the sum of dia...
[ { "code": null, "e": 1432, "s": 1062, "text": "The sum of diagonal elements could be required in matrix analysis therefore, we can convert the matrix into a table and find the sum of diagonal elements. This can be easily done by using sun function by extracting diagonal elements of the table using d...
How do I drop a MongoDB database from the command line?
To drop a MongoDB database from the command line, use the following syntax: mongo yourDatabaseName --eval "db.dropDatabase()" To understand the above syntax, let us display all the database from MongoDB. The query is as follows − > show dbs; The following is the output − StudentTracker 0.000GB admin 0.000GB config 0.00...
[ { "code": null, "e": 1138, "s": 1062, "text": "To drop a MongoDB database from the command line, use the following syntax:" }, { "code": null, "e": 1188, "s": 1138, "text": "mongo yourDatabaseName --eval \"db.dropDatabase()\"" }, { "code": null, "e": 1292, "s": 11...
Difference between file_get_contents and cURL in PHP
13 Sep, 2021 file_get_contents() Function: This PHP function is used to retrieve the contents of a file. The contents can be stored as a string variable. Alternatively, it also simulates HTTP transactions, involving requests via GET method and responses using POST method respectively. Primarily, it is best-suited for s...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Sep, 2021" }, { "code": null, "e": 400, "s": 28, "text": "file_get_contents() Function: This PHP function is used to retrieve the contents of a file. The contents can be stored as a string variable. Alternatively, it also simulates H...