title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Difference Between Shallow copy VS Deep copy in Pandas Dataframes
09 Feb, 2022 The pandas library has mainly two data structures DataFrames and Series. These data structures are internally represented with index arrays, which label the data, and data arrays, which contain the actual data. Now, when we try to copy these data structures (DataFrames and Series) we essentially copy the o...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Feb, 2022" }, { "code": null, "e": 452, "s": 52, "text": "The pandas library has mainly two data structures DataFrames and Series. These data structures are internally represented with index arrays, which label the data, and data ar...
Count number of ways to fill a “n x 4” grid using “1 x 4” tiles
05 Jul, 2022 Given a number n, count number of ways to fill a n x 4 grid using 1 x 4 tiles.Examples: Input : n = 1 Output : 1 Input : n = 2 Output : 1 We can only place both tiles horizontally Input : n = 3 Output : 1 We can only place all tiles horizontally. Input : n = 4 Output : 2 The two ways are : 1) Place...
[ { "code": null, "e": 54, "s": 26, "text": "\n05 Jul, 2022" }, { "code": null, "e": 144, "s": 54, "text": "Given a number n, count number of ways to fill a n x 4 grid using 1 x 4 tiles.Examples: " }, { "code": null, "e": 627, "s": 144, "text": "Input : n = 1\n...
Python – Remove all consonants from string
14 Feb, 2022 Sometimes, while working with Python, we can have a problem in which we wish to remove all the non vowels from strings. This is quite popular question and solution to it is useful in competitive programming and day-day programming. Lets discuss certain ways in which this task can be performed.Method #1 : U...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Feb, 2022" }, { "code": null, "e": 498, "s": 28, "text": "Sometimes, while working with Python, we can have a problem in which we wish to remove all the non vowels from strings. This is quite popular question and solution to it is us...
How to add a custom styled Toast in Android
29 Jun, 2021 A Toast is a feedback message. It takes very little space for displaying and it is displayed on top of the main content of an activity, and only remains visible for a short time period. This article explains how to create Custom Toast messages, which has custom background, image, icon, etc, which are not p...
[ { "code": null, "e": 54, "s": 26, "text": "\n29 Jun, 2021" }, { "code": null, "e": 400, "s": 54, "text": "A Toast is a feedback message. It takes very little space for displaying and it is displayed on top of the main content of an activity, and only remains visible for a short t...
How to retrieve the contents of a text field in JavaFX?
The text field accepts and displays the text. In the latest versions of JavaFX, it accepts only a single line. In JavaFX the javafx.scene.control.TextField class represents the text field, this class inherits the javafx.scene.control.TextInputControl (base class of all the text controls) class. Using this you can accep...
[ { "code": null, "e": 1562, "s": 1187, "text": "The text field accepts and displays the text. In the latest versions of JavaFX, it accepts only a single line. In JavaFX the javafx.scene.control.TextField class represents the text field, this class inherits the javafx.scene.control.TextInputControl (b...
Prolog - Recursion and Structures
This chapter covers recursion and structures. Recursion is a technique in which one predicate uses itself (may be with some other predicates) to find the truth value. Let us understand this definition with the help of an example − is_digesting(X,Y) :- just_ate(X,Y). is_digesting(X,Y) :- just_ate(X,Y). is_digesting(X,Y)...
[ { "code": null, "e": 2272, "s": 2226, "text": "This chapter covers recursion and structures." }, { "code": null, "e": 2393, "s": 2272, "text": "Recursion is a technique in which one predicate uses itself (may be with some other predicates) to find the truth value." }, { "...
How to create Kernel Density Plot in R?
23 May, 2021 In this article, we will discuss how to create kernel density plots in R programming language. For this, the user simply needs to call the density() function which is an in-build function in R language. Then the user has to pass the given data as the parameter to this function in order to create a density ...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 May, 2021" }, { "code": null, "e": 448, "s": 28, "text": "In this article, we will discuss how to create kernel density plots in R programming language. For this, the user simply needs to call the density() function which is an in-bu...
Self Destructing Code in C
21 Nov, 2017 Using remove() function in C, we can write a program which can destroy itself after it is compiled and executed. Explanation: This can be done using the remove function in C. Note that, this is done in Linux environment. So, the remove function is fed the first parameter in command line argument i.e. a.out...
[ { "code": null, "e": 54, "s": 26, "text": "\n21 Nov, 2017" }, { "code": null, "e": 167, "s": 54, "text": "Using remove() function in C, we can write a program which can destroy itself after it is compiled and executed." }, { "code": null, "e": 448, "s": 167, "...
What is a Dictionary Attack?
04 Jul, 2022 A Dictionary Attack is an attack vector used by the attacker to break in a system, which is password protected, by putting technically every word in a dictionary as a form of password for that system. This attack vector is a form of Brute Force Attack. The dictionary can contain words from an English dict...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jul, 2022" }, { "code": null, "e": 306, "s": 52, "text": "A Dictionary Attack is an attack vector used by the attacker to break in a system, which is password protected, by putting technically every word in a dictionary as a form of...
Python – Spell Corrector GUI using Tkinter
12 Jun, 2021 Prerequisites : Introduction to tkinter | spell checking Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. Python with Tkinter outputs the fastest and easiest way to create GUI applications. In this articl...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Jun, 2021" }, { "code": null, "e": 87, "s": 28, "text": "Prerequisites : Introduction to tkinter | spell checking " }, { "code": null, "e": 443, "s": 87, "text": "Python offers multiple options for developing a G...
How To Install Jenkins on Ubuntu
Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate Jenkins with a number of testing and deployment technologies. This a...
[ { "code": null, "e": 1565, "s": 1187, "text": "Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate J...
Flatten JavaScript objects into a single-depth Object
13 Sep, 2021 Given a nested JavaScript object, the task is to flatten the object and pull out all the values to a single depth. If the values are already at single depth then it returns the result unaltered. typeof() method: The typeof() method is used in the script to check the type of JavaScript variable. Syntax: typ...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Sep, 2021" }, { "code": null, "e": 223, "s": 28, "text": "Given a nested JavaScript object, the task is to flatten the object and pull out all the values to a single depth. If the values are already at single depth then it returns th...
Python PIL |ImageDraw.Draw.multiline_text()
09 Sep, 2019 PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You can use this module to create new images, annotate or retouch existing images, and to generate graphics on the fly for web use. Ima...
[ { "code": null, "e": 28, "s": 0, "text": "\n09 Sep, 2019" }, { "code": null, "e": 332, "s": 28, "text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You...
Perl Installation and Environment Setup in Windows, Linux, and MacOS
12 Jun, 2019 Prerequisite: Introduction to Perl Before, we start with the process of Installing Perl on our System, whether it be Windows, Linux or Macintosh. We must have first-hand knowledge of What the Perl Language is and what it actually does?. Perl is a general purpose, high level interpreted and dynamic programm...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Jun, 2019" }, { "code": null, "e": 63, "s": 28, "text": "Prerequisite: Introduction to Perl" }, { "code": null, "e": 691, "s": 63, "text": "Before, we start with the process of Installing Perl on our System, wheth...
How to make a key fire when key is pressed using JavaScript ?
27 Jan, 2020 In JavaScript, holding down a key will fire the key continuously until it is released. This behavior may be used in applications such as games where a key may be expected to fire only once even after being held down. This can be achieved using two methods: Method 1: Using a flag variable to check the curre...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Jan, 2020" }, { "code": null, "e": 285, "s": 28, "text": "In JavaScript, holding down a key will fire the key continuously until it is released. This behavior may be used in applications such as games where a key may be expected to f...
Encoding Categorical Variables: One-hot vs Dummy Encoding | by Rukshan Pramoditha | Towards Data Science
You’ll often find categorical variables in your datasets. A categorical variable has a finite number of categories or labels for its values. For example, Gender is a categorical variable that can take “Male” and “Female” for its values. Categorical variables are mainly divided into two types: Ordinal categorical variab...
[ { "code": null, "e": 409, "s": 172, "text": "You’ll often find categorical variables in your datasets. A categorical variable has a finite number of categories or labels for its values. For example, Gender is a categorical variable that can take “Male” and “Female” for its values." }, { "cod...
How to concat strings using AngularJS ? - GeeksforGeeks
30 Sep, 2020 In this article, we will see how to concat strings in AngularJS. There are few ways to concat the strings in AngularJS. In this article, we will see 2 of them. Example 1: In the first example, we are using the ‘+’ operator to concat the strings HTML <!DOCTYPE HTML> <html> <head> <script src="https://...
[ { "code": null, "e": 24589, "s": 24561, "text": "\n30 Sep, 2020" }, { "code": null, "e": 24749, "s": 24589, "text": "In this article, we will see how to concat strings in AngularJS. There are few ways to concat the strings in AngularJS. In this article, we will see 2 of them." ...
Linear Regression on Housing.csv Data (Kaggle) | by Ali Fakhry | Towards Data Science
Kaggle, a Google subsidiary, is a community of machine learning enthusiasts. This particular project launched by Kaggle, California Housing Prices, is a data set that serves as an introduction to implementing machine learning algorithms. The main focus of this project is to help organize and understand data and graphs....
[ { "code": null, "e": 368, "s": 47, "text": "Kaggle, a Google subsidiary, is a community of machine learning enthusiasts. This particular project launched by Kaggle, California Housing Prices, is a data set that serves as an introduction to implementing machine learning algorithms. The main focus of ...
Example of using Text join in SAP HANA
To implement Text join, create a table − CREATE COLUMN TABLE TEST.P_INFO (PROD_ID BIGINT, P_CAT NVARCHAR(50)); INSERT INTO TEST.P_INFO VALUES (11,’FURNITURE’); INSERT INTO TEST.P_INFO VALUES (14,’ELECTRONICS’); INSERT INTO TEST.P_INFO VALUES (25,’FURNITURE’); INSERT INTO TEST.P_INFO VALUES (76,’ELECTRONICS’); 2nd table...
[ { "code": null, "e": 1103, "s": 1062, "text": "To implement Text join, create a table −" }, { "code": null, "e": 1373, "s": 1103, "text": "CREATE COLUMN TABLE TEST.P_INFO (PROD_ID BIGINT, P_CAT NVARCHAR(50));\nINSERT INTO TEST.P_INFO VALUES (11,’FURNITURE’);\nINSERT INTO TEST.P_I...
C Program for Egg Dropping Puzzle | DP-11 - GeeksforGeeks
22 Feb, 2022 The following is a description of the instance of this famous puzzle involving n=2 eggs and a building with k=36 floors. Suppose that we wish to know which stories in a 36-story building are safe to drop eggs from, and which will cause the eggs to break on landing. We make a few assumptions:.....An egg tha...
[ { "code": null, "e": 24930, "s": 24902, "text": "\n22 Feb, 2022" }, { "code": null, "e": 25051, "s": 24930, "text": "The following is a description of the instance of this famous puzzle involving n=2 eggs and a building with k=36 floors." }, { "code": null, "e": 25651...
Caesar Cipher in Python
Suppose we have a lowercase alphabet string s, and an offset number say k. We have to replace every letter in s with a letter k positions further along the alphabet. We have to keep in mind that when the letter overflows past a or z, it gets wrapped around the other side. So, if the input is like "hello", k = 3, then t...
[ { "code": null, "e": 1335, "s": 1062, "text": "Suppose we have a lowercase alphabet string s, and an offset number say k. We have to replace every letter in s with a letter k positions further along the alphabet. We have to keep in mind that when the letter overflows past a or z, it gets wrapped aro...
Modify the value associated with a given key in Java HashMap
First, create a HashMap and add elements to it − // Create a hash map HashMap hm = new HashMap(); // Put elements to the map hm.put("Bag", new Integer(1100)); hm.put("Sunglasses", new Integer(2000)); hm.put("Frames", new Integer(800)); hm.put("Wallet", new Integer(700)); hm.put("Belt", new Integer(600)); Now, to modify...
[ { "code": null, "e": 1111, "s": 1062, "text": "First, create a HashMap and add elements to it −" }, { "code": null, "e": 1368, "s": 1111, "text": "// Create a hash map\nHashMap hm = new HashMap();\n// Put elements to the map\nhm.put(\"Bag\", new Integer(1100));\nhm.put(\"Sunglass...
Ruby on Rails - Send Emails
Action Mailer is the Rails component that enables applications to send and receive emails. In this chapter, we will see how to send an email using Rails. Let’s start creating an emails project using the following command. tp> rails new mailtest This will create the required framework to proceed. Now, we will start wit...
[ { "code": null, "e": 2325, "s": 2103, "text": "Action Mailer is the Rails component that enables applications to send and receive emails. In this chapter, we will see how to send an email using Rails. Let’s start creating an emails project using the following command." }, { "code": null, ...
Image Steganography using Stegosuite in Linux
28 Sep, 2021 With the rapid growth of network bandwidth and digital-communication techniques, the Internet is available to the majority of the population and it also becomes the common channel for transmitting many documents—for instance, video, image, text, and audio (in digital form). Many practices and methods have ...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Sep, 2021" }, { "code": null, "e": 839, "s": 28, "text": "With the rapid growth of network bandwidth and digital-communication techniques, the Internet is available to the majority of the population and it also becomes the common cha...
Python – tensorflow.math.equal()
28 Jul, 2020 TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. equal() is used to perform element by equality comparison. It performs argument broadcasting before applying the comparison. Syntax: tensorflow.math.equal( x, y, name) Parame...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jul, 2020" }, { "code": null, "e": 160, "s": 28, "text": "TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. " }, { "code": null, "e": 286, ...
ConcurrentHashMap compute() method in Java with Examples
29 Jun, 2022 The compute(Key, BiFunction) method of ConcurrentHashMap class is used to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping is found). This method is used to atomically update a value for given key in ConcurrentHashMap. If the remapping function th...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Jun, 2022" }, { "code": null, "e": 222, "s": 28, "text": "The compute(Key, BiFunction) method of ConcurrentHashMap class is used to compute a mapping for the specified key and its current mapped value (or null if there is no current ...
GATE | GATE CS 1996 | Question 40
12 Dec, 2018 Quicksort is run on two inputs shown below to sort in ascending order taking first element as pivot, (i) 1, 2, 3,......., n (ii) n, n-1, n-2,......, 2, 1 Let C1 and C2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then,(A) C1 < C2(B) C1 > C2(C) C1 = C2(D) We cannot say anythi...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Dec, 2018" }, { "code": null, "e": 129, "s": 28, "text": "Quicksort is run on two inputs shown below to sort in ascending order taking first element as pivot," }, { "code": null, "e": 183, "s": 129, "text": "(i) 1...
Python | os.path.getmtime() method
10 Oct, 2021 OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.path module is sub module of OS module in Python used for common path name manipulati...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Oct, 2021" }, { "code": null, "e": 766, "s": 28, "text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin...
Puzzle 75 | Prisoner’s Hat
08 Feb, 2018 A Police officer caught four criminals. He plays a game with these four men. He lines up three of the prisoners (A, B, C) in one room and the fourth prisoner(D) is placed in a separate room.Each prisoner is given a hat to wear. The officer tells them that there are in total two blue hats and two red hats. ...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Feb, 2018" }, { "code": null, "e": 541, "s": 52, "text": "A Police officer caught four criminals. He plays a game with these four men. He lines up three of the prisoners (A, B, C) in one room and the fourth prisoner(D) is placed in ...
Combining a one and a two-dimensional NumPy Array
01 Oct, 2020 Sometimes we need to combine 1-D and 2-D arrays and display their elements. Numpy has a function named as numpy.nditer(), which provides this facility. Syntax: numpy.nditer(op, flags=None, op_flags=None, op_dtypes=None, order=’K’, casting=’safe’, op_axes=None, itershape=None, buffersize=0) Example 1: Pytho...
[ { "code": null, "e": 54, "s": 26, "text": "\n01 Oct, 2020" }, { "code": null, "e": 206, "s": 54, "text": "Sometimes we need to combine 1-D and 2-D arrays and display their elements. Numpy has a function named as numpy.nditer(), which provides this facility." }, { "code": ...
How to crop an image using canvas ?
21 Jun, 2020 The HTML canvas element allows the user to draw graphics on any web page. It is like a container for graphics to draw the graphics, JavaScript is used in the code. <canvas id="Canvas1" width="100" height="100"></canvas> Following are the attributes to create a canvas. More optional attributes can also be a...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Jun, 2020" }, { "code": null, "e": 192, "s": 28, "text": "The HTML canvas element allows the user to draw graphics on any web page. It is like a container for graphics to draw the graphics, JavaScript is used in the code." }, { ...
C - File I/O
The last chapter explained the standard input and output devices handled by C programming language. This chapter cover how C programmers can create, open, close text or binary files for their data storage. A file represents a sequence of bytes, regardless of it being a text file or a binary file. C programming language...
[ { "code": null, "e": 2424, "s": 2218, "text": "The last chapter explained the standard input and output devices handled by C programming language. This chapter cover how C programmers can create, open, close text or binary files for their data storage." }, { "code": null, "e": 2733, ...
sys.stdout.write in Python
01 Oct, 2020 This is a built-in Python module that contains parameters specific to the system i.e. it contains variables and methods that interact with the interpreter and are also governed by it. A built-in file object that is analogous to the interpreter’s standard output stream in Python. stdout is used to display ...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Oct, 2020" }, { "code": null, "e": 237, "s": 52, "text": "This is a built-in Python module that contains parameters specific to the system i.e. it contains variables and methods that interact with the interpreter and are also govern...
How to set creation and modification date/time of a file using Python?
To get the creation time of a file, you can use the os.path.getctime(file_path) on windows. On UNIX systems, you cant use the same function as it returns the last time that the file's attributes or content were changed. To get the creation time on UNIX based systems, use the st_birthtime attribute of the stat tuple. On...
[ { "code": null, "e": 1505, "s": 1187, "text": "To get the creation time of a file, you can use the os.path.getctime(file_path) on windows. On UNIX systems, you cant use the same function as it returns the last time that the file's attributes or content were changed. To get the creation time on UNIX ...
TreeMap size() Method in Java with Examples
29 Nov, 2021 size() method of TreeMap class is used to get the size of the map which refers to the number of the key-value pair or mappings in the Map. --> java.util package --> TreeMap class --> size() Method Syntax: Tree_Map.size() Return Value: The size of the map which also means the number of key-v...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Nov, 2021" }, { "code": null, "e": 167, "s": 28, "text": "size() method of TreeMap class is used to get the size of the map which refers to the number of the key-value pair or mappings in the Map." }, { "code": null, "e":...
Scala List map() method with example
13 Aug, 2019 The map() method is utilized to apply the stated function to all the elements of the list. Method Definition: def map[B](f: (A) => B): List[B] Return Type: It returns a new list after applying the stated function to all the elements of the list. Example #1: // Scala program of map()// method // Creating o...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Aug, 2019" }, { "code": null, "e": 119, "s": 28, "text": "The map() method is utilized to apply the stated function to all the elements of the list." }, { "code": null, "e": 171, "s": 119, "text": "Method Definiti...
Source distribution and built distribution in python
18 Oct, 2019 Python is all about Distribution. It can be defined as the collection of files that together allows to build, package and distribute a module. Once a distribution exists in a system, it can easily be installed. Also, it can be shared with PyPI(Python package index) community so that other people can use yo...
[ { "code": null, "e": 28, "s": 0, "text": "\n18 Oct, 2019" }, { "code": null, "e": 742, "s": 28, "text": "Python is all about Distribution. It can be defined as the collection of files that together allows to build, package and distribute a module. Once a distribution exists in a ...
Set clear() method in Java with Examples
31 Dec, 2018 The Java.util.Set.clear() method is used to remove all the elements from a Set. Using the clear() method only clears all the element from the set and not deletes the set. In other words, we can say that the clear() method is used to only empty an existing Set. Syntax: void clear() Parameters: The method do...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Dec, 2018" }, { "code": null, "e": 289, "s": 28, "text": "The Java.util.Set.clear() method is used to remove all the elements from a Set. Using the clear() method only clears all the element from the set and not deletes the set. In o...
Queue | Set 1 (Introduction and Array Implementation)
04 Jul, 2022 Similar to Stack, Queue is a linear data structure that follows a particular order in which the operations are performed for storing data. The order is First In First Out (FIFO). One can imagine a queue as a line of people waiting to receive something in sequential order which starts from the beginning of...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jul, 2022" }, { "code": null, "e": 836, "s": 52, "text": "Similar to Stack, Queue is a linear data structure that follows a particular order in which the operations are performed for storing data. The order is First In First Out (FI...
Python | Pandas DatetimeIndex.date
24 Dec, 2018 Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.date attribute outputs an Index object containing the date values presen...
[ { "code": null, "e": 28, "s": 0, "text": "\n24 Dec, 2018" }, { "code": null, "e": 242, "s": 28, "text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp...
DAX Statistical - STDEV.S function
Returns the standard deviation of a sample population. STDEV.S (<ColumnName>) ColumnName The name of a column, usually fully qualified. It cannot be an expression. A real number. DAX STDEV.S function assumes that the column refers to a sample of the population. If your data represents the entire population, then use D...
[ { "code": null, "e": 2056, "s": 2001, "text": "Returns the standard deviation of a sample population." }, { "code": null, "e": 2080, "s": 2056, "text": "STDEV.S (<ColumnName>)\n" }, { "code": null, "e": 2091, "s": 2080, "text": "ColumnName" }, { "code"...
How we can use Python Tuple within a Tuple?
Tuple is defined as an ordered collection of any Python objects enclosed in parentheses. Hence, a tuple can very well be one of the items in the collection. >>> t1=(1,(4, 5, 6),2,3) >>> t1 (1, (4, 5, 6), 2, 3) In this example, item at index number 1 in t1 is a tuple itself. Hence it can be retrieved using the index as ...
[ { "code": null, "e": 1219, "s": 1062, "text": "Tuple is defined as an ordered collection of any Python objects enclosed in parentheses. Hence, a tuple can very well be one of the items in the collection." }, { "code": null, "e": 1272, "s": 1219, "text": ">>> t1=(1,(4, 5, 6),2,3)\...
JavaScript function that generates all possible combinations of a string
We are required to write a JavaScript function that takes in a string as the only argument. The function should generate an array of strings that contains all possible contiguous substrings that exist in the array. Following is the code − const str = 'Delhi'; const allCombinations = (str1 = '') => { const arr = []; ...
[ { "code": null, "e": 1277, "s": 1062, "text": "We are required to write a JavaScript function that takes in a string as the only argument. The function should generate an array of strings that contains all possible contiguous substrings that exist in the array." }, { "code": null, "e": 1...
Django - Cookies Handling
Sometimes you might want to store some data on a per-site-visitor basis as per the requirements of your web application. Always keep in mind, that cookies are saved on the client side and depending on your client browser security level, setting cookies can at times work and at times might not. To illustrate cookies han...
[ { "code": null, "e": 2340, "s": 2045, "text": "Sometimes you might want to store some data on a per-site-visitor basis as per the requirements of your web application. Always keep in mind, that cookies are saved on the client side and depending on your client browser security level, setting cookies ...
CSS rgba() Function
The rgba() defines the RGBA color value for Red, Green, Blue and Alpha. The alpha is the color opacity i.e. a number between 0.0 and 1.0. Here, 1.0 would be for full opaque. Let us now see an example to implement the rgba() function − Live Demo <!DOCTYPE html> <html> <head> <style> #demo1 {background-color: hsla(140, ...
[ { "code": null, "e": 1236, "s": 1062, "text": "The rgba() defines the RGBA color value for Red, Green, Blue and Alpha. The alpha is the color opacity i.e. a number between 0.0 and 1.0. Here, 1.0 would be for full opaque." }, { "code": null, "e": 1297, "s": 1236, "text": "Let us n...
Program to multiply two matrices in C++
In this tutorial, we will be discussing a program to multiply two matrices. For this we will be given with two matrices and our task is to print the product of two those matrices. The only condition is that the number of columns of first matrix should be equal to the number of rows of the second matrix. Live Demo #inc...
[ { "code": null, "e": 1138, "s": 1062, "text": "In this tutorial, we will be discussing a program to multiply two matrices." }, { "code": null, "e": 1367, "s": 1138, "text": "For this we will be given with two matrices and our task is to print the product of two those matrices. Th...
static keyword in C++ vs Java
In C++ or Java we can get the static keyword. They are mostly same, but there are some basic differences between these two languages. Let us see the differences between static in C++ and static in Java. The static data members are basically same in Java and C++. The static data members are the property of the class, an...
[ { "code": null, "e": 1265, "s": 1062, "text": "In C++ or Java we can get the static keyword. They are mostly same, but there are some basic differences between these two languages. Let us see the differences between static in C++ and static in Java." }, { "code": null, "e": 1420, "s"...
How to decide the perfect distance metric for your machine learning model | by Harsh Maheshwari | Towards Data Science
Disclaimer: You won’t need a distance metric for every ML model, but if you do then read on to pick the best one. Distance metrics play a significant role in machine learning and deep learning. Machine learning algorithms like k-NN, K Means clustering, and loss functions used in deep learning depend on these metrics. T...
[ { "code": null, "e": 286, "s": 172, "text": "Disclaimer: You won’t need a distance metric for every ML model, but if you do then read on to pick the best one." }, { "code": null, "e": 491, "s": 286, "text": "Distance metrics play a significant role in machine learning and deep le...
Objective-C Quick Guide
Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its applications. Initially, Objective-C was developed ...
[ { "code": null, "e": 2843, "s": 2560, "text": "Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems...
The Complete Beginner’s Guide to Deep Learning: Convolutional Neural Networks and Image Classification | by Anne Bonner | Towards Data Science
“One thing that struck me early is that you don’t put into a photograph what’s going to come out. Or, vice versa, what comes out is not what you put in.” ― Diane Arbus A notification pops up on your favorite social network that someone posted a picture that might have you in it. It’s right. It’s the worst picture of yo...
[ { "code": null, "e": 325, "s": 171, "text": "“One thing that struck me early is that you don’t put into a photograph what’s going to come out. Or, vice versa, what comes out is not what you put in.”" }, { "code": null, "e": 339, "s": 325, "text": "― Diane Arbus" }, { "cod...
How to Set/modify the pixels(RGB values) of an image using Java OpenCV Library?
A pixel is the smallest element of a digital image, each pixel contains the values of alpha, red, green, blue values. The pixel value(s) is stored in a 32-bit memory space holding ARGB values (8 bits each) in the same order. Therefore, to modify the color of an image − You need to loop through each pixel in the image. ...
[ { "code": null, "e": 1332, "s": 1062, "text": "A pixel is the smallest element of a digital image, each pixel contains the values of alpha, red, green, blue values. The pixel value(s) is stored in a 32-bit memory space holding ARGB values (8 bits each) in the same order. Therefore, to modify the col...
list assign() function in C++ STL - GeeksforGeeks
18 Jun, 2018 The list::assign() is a built-in function in C++ STL which is used to assign values to a list. It can also be used to copy elements from one list to another. To assign elements to a list.Syntax:list_name.assign(count, value) Parameters: This function accepts two mandatory parameters as shown in the above ...
[ { "code": null, "e": 23732, "s": 23704, "text": "\n18 Jun, 2018" }, { "code": null, "e": 23890, "s": 23732, "text": "The list::assign() is a built-in function in C++ STL which is used to assign values to a list. It can also be used to copy elements from one list to another." },...
Permutation with Spaces | Practice | GeeksforGeeks
Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. The output should be printed in sorted increasing order of strings Example 1: Input: S = "ABC" Output: (A B C)(A BC)(AB C)(ABC) Explanation: ABC AB C A BC A B C These are the possible combination of "...
[ { "code": null, "e": 425, "s": 238, "text": "Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. The output should be printed in sorted increasing order of strings" }, { "code": null, "e": 436, "s": 425, "text": ...
Zphisher – Automated Phishing Tool in Kali Linux
23 May, 2021 Zphisher is a powerful open-source tool Phishing Tool. It became very popular nowadays that is used to do phishing attacks on Target. Zphisher is easier than Social Engineering Toolkit. It contains some templates generated by tool called Zphisher and offers phishing templates webpages for 18 popular sites...
[ { "code": null, "e": 54, "s": 26, "text": "\n23 May, 2021" }, { "code": null, "e": 759, "s": 54, "text": "Zphisher is a powerful open-source tool Phishing Tool. It became very popular nowadays that is used to do phishing attacks on Target. Zphisher is easier than Social Engineeri...
How to set the height and width of background image inline style in react?
16 Oct, 2020 In React, one can create an object with styling information like background image, height, width, etc and refer to the object in the style attribute in the HTML element. Since the inline CSS is written in a JavaScript object, properties with two names, like background-color, must be written with camel case...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Oct, 2020" }, { "code": null, "e": 344, "s": 28, "text": "In React, one can create an object with styling information like background image, height, width, etc and refer to the object in the style attribute in the HTML element. Since...
strcspn() function in C/C++
17 Jan, 2022 The strcspn() function in C/C++ takes two string as input, string_1 and string_2 as it’s argument and searches string_1 by traversing for any characters that is present in string_2 . The function will return the length of string_1 if none of the characters of string_2 are found in string_1 . This function ...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Jan, 2022" }, { "code": null, "e": 381, "s": 28, "text": "The strcspn() function in C/C++ takes two string as input, string_1 and string_2 as it’s argument and searches string_1 by traversing for any characters that is present in str...
Creating Your First Application in Python
19 Oct, 2021 Python is one of the simplest programming language out there. In fact, it was developed for the sole purpose of simplifying the process of learning a programming language and exposed beginners to the concepts of Programming. In this article, we will be building a Python Application. Not to worry it won’t b...
[ { "code": null, "e": 53, "s": 25, "text": "\n19 Oct, 2021" }, { "code": null, "e": 460, "s": 53, "text": "Python is one of the simplest programming language out there. In fact, it was developed for the sole purpose of simplifying the process of learning a programming language and...
Python program to sort out words of the sentence in ascending order
In order to sort the words of a sentence in ascending order, we first need to split the sentence into words using space as the splitting point. For simplicity, we'll only be splitting on space and let the punctuation be there. We can use replace or regex to remove that as well. Once we split the sentence, we can sort t...
[ { "code": null, "e": 1341, "s": 1062, "text": "In order to sort the words of a sentence in ascending order, we first need to split the sentence into words using space as the splitting point. For simplicity, we'll only be splitting on space and let the punctuation be there. We can use replace or rege...
PHP Constructors and Destructors
In object oriented programming terminology, constructor is a method defined inside a class is called automatically at the time of creation of object. Purpose of a constructor method is to initialize the object. In PHP, a method of special name __construct acts as a constructor. __construct ([ mixed $args = "" [, $... ]...
[ { "code": null, "e": 1341, "s": 1062, "text": "In object oriented programming terminology, constructor is a method defined inside a class is called automatically at the time of creation of object. Purpose of a constructor method is to initialize the object. In PHP, a method of special name __constru...
Using faiss to search in multidimensional spaces | by Sgjurano | Towards Data Science
In autumn 2019, Avito’s Automated Moderation team launched a fake ads detection service built on top of the the faiss library. It helps us detect whether an image has already been used in another ad, even if it was modified in any way — blurred, cropped, etc. I would like to talk about the problems that we encountered ...
[ { "code": null, "e": 432, "s": 172, "text": "In autumn 2019, Avito’s Automated Moderation team launched a fake ads detection service built on top of the the faiss library. It helps us detect whether an image has already been used in another ad, even if it was modified in any way — blurred, cropped, ...
How to get the screen DPI programmatically in Android using Kotlin?
This example demonstrates how to get the screen DPI programmatically in 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="ut...
[ { "code": null, "e": 1156, "s": 1062, "text": "This example demonstrates how to get the screen DPI programmatically in Android using Kotlin." }, { "code": null, "e": 1285, "s": 1156, "text": "Step 1 − Create a new project in Android Studio, go to File ? New Project and fill all r...
JQuery | unique() method - GeeksforGeeks
27 Apr, 2020 This unique() Method in jQuery is used to sorts an array of DOM elements, in place, with the duplicates removed. Syntax: jQuery.unique( array ) Parameters: The unique() method accepts only one parameter that is mentioned above and described below: array : This parameter is the Array of DOM elements. Retur...
[ { "code": null, "e": 24448, "s": 24420, "text": "\n27 Apr, 2020" }, { "code": null, "e": 24561, "s": 24448, "text": "This unique() Method in jQuery is used to sorts an array of DOM elements, in place, with the duplicates removed." }, { "code": null, "e": 24569, "s...
Change data type of given numpy array
The Numpy array support a great variety of data types in addition to python's native data types. After an array is created, we can still modify the data type of the elements in the array, depending on our need. The two methods used for this purpose are array.dtype and array.astype This method gives us the existing data...
[ { "code": null, "e": 1344, "s": 1062, "text": "The Numpy array support a great variety of data types in addition to python's native data types. After an array is created, we can still modify the data type of the elements in the array, depending on our need. The two methods used for this purpose are ...
Ext.js - Auto Layout
This is the default layout that decides the layout of the elements based on the number of elements. Following is a simple syntax to use Auto layout. layout: 'auto' Following is a simple example showing the usage of Auto layout. <!DOCTYPE html> <html> <head> <link href = "https://cdnjs.cloudflare.com/ajax/lib...
[ { "code": null, "e": 2123, "s": 2023, "text": "This is the default layout that decides the layout of the elements based on the number of elements." }, { "code": null, "e": 2172, "s": 2123, "text": "Following is a simple syntax to use Auto layout." }, { "code": null, "...
Introduction of Process Management - GeeksforGeeks
28 Jun, 2021 Program vs Process A process is a program in execution. For example, when we write a program in C or C++ and compile it, the compiler creates binary code. The original code and binary code are both programs. When we actually run the binary code, it becomes a process. A process is an ‘active’ entity, inste...
[ { "code": null, "e": 27733, "s": 27705, "text": "\n28 Jun, 2021" }, { "code": null, "e": 28002, "s": 27733, "text": "Program vs Process A process is a program in execution. For example, when we write a program in C or C++ and compile it, the compiler creates binary code. The orig...
Groovy - keySet()
Obtain a Set of the keys in this Map. Set keySet() None. Set of Keys. Following is an example of the usage of this method − class Example { static void main(String[] args) { def mp = ["TopicName" : "Maps", "TopicDescription" : "Methods in Maps"] println(mp.keySet()); } } When we run the above pr...
[ { "code": null, "e": 2276, "s": 2238, "text": "Obtain a Set of the keys in this Map." }, { "code": null, "e": 2290, "s": 2276, "text": "Set keySet()\n" }, { "code": null, "e": 2296, "s": 2290, "text": "None." }, { "code": null, "e": 2309, "s": ...
How to change ordinal X-axis label to text labels using ggplot2 in R?
A plot created with ordinal values on X-axis needs to be ordered for plotting, otherwise, the plot will have continuous values on the X-axis that includes ordinal values. If we want to convert those values to text then scale_x_discrete should be used with the number of breaks, these number of breaks are the actual numb...
[ { "code": null, "e": 1423, "s": 1062, "text": "A plot created with ordinal values on X-axis needs to be ordered for plotting, otherwise, the plot will have continuous values on the X-axis that includes ordinal values. If we want to convert those values to text then scale_x_discrete should be used wi...
Anscombe’s quartet - GeeksforGeeks
16 Jul, 2020 According to the definition given in Wikipedia, Anscombe’s quartet comprises four datasets that have nearly identical simple statistical properties, yet appear very different when graphed. Each dataset consists of eleven (x,y) points. They were constructed in 1973 by the statistician Francis Anscombe to de...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n16 Jul, 2020" }, { "code": null, "e": 24720, "s": 24292, "text": "According to the definition given in Wikipedia, Anscombe’s quartet comprises four datasets that have nearly identical simple statistical properties, yet appear ver...
Check if it is possible to transform one string to another in Python
Suppose we have two strings s and t, t is in uppercase. We have to check whether we can convert s to t by performing following operations. Convert some lowercase letters uppercase. Remove all of the lowercase letters. So, if the input is like s = "fanToM", t = "TOM", then the output will be True as we can change ‘o’ to...
[ { "code": null, "e": 1201, "s": 1062, "text": "Suppose we have two strings s and t, t is in uppercase. We have to check whether we can convert s to t by performing following operations." }, { "code": null, "e": 1243, "s": 1201, "text": "Convert some lowercase letters uppercase." ...
Basic calculator program using Java
A basic calculator is able to add, subtract, multiply or divide two numbers. This is done using a switch case. A program that demonstrates this is given as follows − import java.util.Scanner; public class Calculator { public static void main(String[] args) { double num1; double num2; double ans; ...
[ { "code": null, "e": 1228, "s": 1062, "text": "A basic calculator is able to add, subtract, multiply or divide two numbers. This is done using a switch case. A program that demonstrates this is given as follows −" }, { "code": null, "e": 2133, "s": 1228, "text": "import java.util...
Extract Data From JustDial using Selenium - GeeksforGeeks
24 Oct, 2021 Let us see how to extract data from Justdial using Selenium and Python. Justdial is a company that provides local search for different services in India over the phone, website and mobile apps. In this article we will be extracting the following data: Phone number Name Address We can then save the data in ...
[ { "code": null, "e": 24212, "s": 24184, "text": "\n24 Oct, 2021" }, { "code": null, "e": 24464, "s": 24212, "text": "Let us see how to extract data from Justdial using Selenium and Python. Justdial is a company that provides local search for different services in India over the p...
Flat array of objects to tree in JavaScript
Suppose, we have an array of objects like this − const arr = [ { id: '1', name: 'name 1', parentId: null }, { id: '2', name: 'name 2', parentId: null }, { id: '2_1', name: 'name 2_1', parentId: '2' }, { id: '2_2', name: 'name 2_2', parentId: '2' }, { id: '3', name: 'name 3', parentId: null }, { id: '4...
[ { "code": null, "e": 1111, "s": 1062, "text": "Suppose, we have an array of objects like this −" }, { "code": null, "e": 2106, "s": 1111, "text": "const arr = [\n { id: '1', name: 'name 1', parentId: null },\n { id: '2', name: 'name 2', parentId: null },\n { id: '2_1', name...
Python - Sentiment Analysis
Semantic Analysis is about analysing the general opinion of the audience. It may be a reaction to a piece of news, movie or any a tweet about some matter under discussion. Generally, such reactions are taken from social media and clubbed into a file to be analysed through NLP. We will take a simple case of defining pos...
[ { "code": null, "e": 3261, "s": 2587, "text": "Semantic Analysis is about analysing the general opinion of the audience. It may be a reaction to a piece of news, movie or any a tweet about some matter under discussion. Generally, such reactions are taken from social media and clubbed into a file to ...
Find the Nth digit in the proper fraction of two numbers - GeeksforGeeks
18 Nov, 2021 Given three integers P, Q and N where P < Q, the task is to compute the fraction value of P / Q and find the Nth digit after the decimal.Example Input: P = 1, Q = 2, N = 1 Output: 5 (1 / 2) = 0.5 and 5 is the first digit after the decimal.Input: P = 5, Q = 6, N = 5 Output: 3 (5 / 6) = 0.833333333... ...
[ { "code": null, "e": 24326, "s": 24298, "text": "\n18 Nov, 2021" }, { "code": null, "e": 24473, "s": 24326, "text": "Given three integers P, Q and N where P < Q, the task is to compute the fraction value of P / Q and find the Nth digit after the decimal.Example " }, { "c...
How to Create a Control Chart in Power BI | by Natalie Garces | Towards Data Science
With companies implementing Lean Six Sigma practices, it is imperative to keep track of how processes change over time. Control charts can help the business visualize process measurements over a span of time. First things first for those who don’t know what exactly is a control chart. X and Y-axis Values: The data valu...
[ { "code": null, "e": 381, "s": 172, "text": "With companies implementing Lean Six Sigma practices, it is imperative to keep track of how processes change over time. Control charts can help the business visualize process measurements over a span of time." }, { "code": null, "e": 458, ...
How To Run CUDA C/C++ on Jupyter notebook in Google Colaboratory - GeeksforGeeks
14 Apr, 2022 What is CUDA? CUDA is a model created by Nvidia for parallel computing platform and application programming interface. CUDA is the parallel computing architecture of NVIDIA which allows for dramatic increases in computing performance by harnessing the power of the GPU. What is Google Colab? Google Colab is...
[ { "code": null, "e": 24232, "s": 24204, "text": "\n14 Apr, 2022" }, { "code": null, "e": 25019, "s": 24232, "text": "What is CUDA? CUDA is a model created by Nvidia for parallel computing platform and application programming interface. CUDA is the parallel computing architecture ...
Array.FindAll() Method in C#
The Array.FindAll() method in C# is used to retrieve all the elements that match the conditions defined by the specified predicate. Following is the syntax − public static T[] FindAll<T> (T[] array, Predicate<T> match); Let us now see an example to implement the Array.FindAll() method − using System; public class Demo{...
[ { "code": null, "e": 1194, "s": 1062, "text": "The Array.FindAll() method in C# is used to retrieve all the elements that match the conditions defined by the specified predicate." }, { "code": null, "e": 1220, "s": 1194, "text": "Following is the syntax −" }, { "code": nu...
What is the jQuery Event for user pressing enter in a textbox?
The jQuery event for user pressing enter is keyup and keyCode. You can try to run the following code to trigger an event on pressing enter key in textbox, Live Demo <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(...
[ { "code": null, "e": 1217, "s": 1062, "text": "The jQuery event for user pressing enter is keyup and keyCode. You can try to run the following code to trigger an event on pressing enter key in textbox," }, { "code": null, "e": 1227, "s": 1217, "text": "Live Demo" }, { "co...
Find sum of divisors of all the divisors of a natural number - GeeksforGeeks
28 Apr, 2022 Given a natural number n, the task is to find sum of divisors of all the divisors of n. Examples: Input : n = 54 Output : 232 Divisors of 54 = 1, 2, 3, 6, 9, 18, 27, 54. Sum of divisors of 1, 2, 3, 6, 9, 18, 27, 54 are 1, 3, 4, 12, 13, 39, 40, 120 respectively. Sum of divisors of all the divisors of 54 =...
[ { "code": null, "e": 24716, "s": 24688, "text": "\n28 Apr, 2022" }, { "code": null, "e": 24804, "s": 24716, "text": "Given a natural number n, the task is to find sum of divisors of all the divisors of n." }, { "code": null, "e": 24815, "s": 24804, "text": "Ex...
When to use extern in C/C++
External variables are also known as global variables. These variables are defined outside the function and are available globally throughout the function execution. The “extern” keyword is used to declare and define the external variables. The keyword [ extern “C” ] is used to declare functions in C++ which is impleme...
[ { "code": null, "e": 1303, "s": 1062, "text": "External variables are also known as global variables. These variables are defined outside the function and are available globally throughout the function execution. The “extern” keyword is used to declare and define the external variables." }, { ...
Introduction to Augmented Random Search. | by Ziad SALLOUM | Towards Data Science
Update: The best way of learning and practicing Reinforcement Learning is by going to http://rl-lab.com This article is based on a paper published on March, 2018 by Horia Mania, Aurelia Guy, and Benjamin Recht from the University of California, Berkeley. The authors assert that they have built an algorithm that is at l...
[ { "code": null, "e": 151, "s": 47, "text": "Update: The best way of learning and practicing Reinforcement Learning is by going to http://rl-lab.com" }, { "code": null, "e": 302, "s": 151, "text": "This article is based on a paper published on March, 2018 by Horia Mania, Aurelia G...
Python – seaborn.factorplot() method
07 Apr, 2022 Seaborn is an amazing visualization library for statistical graphics plotting in Python. It provides beautiful default styles and color palettes to make statistical plots more attractive. It is built on the top of matplotlib library and also closely integrated to the data structures from pandas. seaborn.fa...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Apr, 2022" }, { "code": null, "e": 325, "s": 28, "text": "Seaborn is an amazing visualization library for statistical graphics plotting in Python. It provides beautiful default styles and color palettes to make statistical plots more...
jQuery | bind() with Examples
12 Feb, 2019 The bind() is an inbuilt method in jQuery which is used to attach one or more event handlers for selected element and this method specifies a function to run when event occurs.Syntax: $(selector).bind(event, data, function); Parameter: It accepts three parameters that are specified below- event: This is a...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Feb, 2019" }, { "code": null, "e": 212, "s": 28, "text": "The bind() is an inbuilt method in jQuery which is used to attach one or more event handlers for selected element and this method specifies a function to run when event occurs...
Manipulating matrices in Julia
22 Apr, 2020 Matrices in Julia are the heterogeneous type of containers and hence, they can hold elements of any data type. It is not mandatory to define the data type of a matrix before assigning the elements to the matrix. Julia automatically decides the data type of the matrix by analyzing the values assigned to it....
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Apr, 2020" }, { "code": null, "e": 456, "s": 28, "text": "Matrices in Julia are the heterogeneous type of containers and hence, they can hold elements of any data type. It is not mandatory to define the data type of a matrix before a...
PrintStream print(String) method in Java with Examples
29 Jan, 2019 The print(String) method of PrintStream Class in Java is used to print the specified String value on the stream. This String value is taken as a parameter. Syntax: public void print(String StringValue) Parameters: This method accepts a mandatory parameter StringValue which is the String value to be written...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Jan, 2019" }, { "code": null, "e": 184, "s": 28, "text": "The print(String) method of PrintStream Class in Java is used to print the specified String value on the stream. This String value is taken as a parameter." }, { "code...
.pull-left and .pull-right classes in Bootstrap 4
30 Aug, 2019 The .pull-left and .pull-right classes have been replaced with the .float-left and .float-right classes in Bootstrap 4. These utility classes are used to float an element to the left or right on the various viewport sizes based on the Bootstrap Grid. It works using the CSS float property. Using .pull-left ...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Aug, 2019" }, { "code": null, "e": 318, "s": 28, "text": "The .pull-left and .pull-right classes have been replaced with the .float-left and .float-right classes in Bootstrap 4. These utility classes are used to float an element to t...
strcspn() in C
23 Dec, 2017 The C library function strcspn() calculates the length of the number of characters before the 1st occurrence of character present in both the string.Syntax : strcspn(const char *str1, const char *str2) Parameters: str1 : The Target string in which search has to be made. str2 : Argument string containing c...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Dec, 2017" }, { "code": null, "e": 210, "s": 52, "text": "The C library function strcspn() calculates the length of the number of characters before the 1st occurrence of character present in both the string.Syntax :" }, { "c...
Magic Square | Even Order
Difficulty Level : Hard A magic square of order n is an arrangement of n^2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. A magic square contains the integers from 1 to n^2.The constant sum in every row, column and diagonal...
[ { "code": null, "e": 24, "s": 0, "text": "Difficulty Level :\nHard" }, { "code": null, "e": 490, "s": 24, "text": "A magic square of order n is an arrangement of n^2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagon...
Program to make a histogram of an array
02 Oct, 2017 Given an array of integers, print histogram of array values. Examples: Input : 0 11 2 13 5 12 8 11 12 9 Output : 13 | x 12 | x x x 11 | x x x x x 10 | x x x x x 9 | x x x x x ...
[ { "code": null, "e": 54, "s": 26, "text": "\n02 Oct, 2017" }, { "code": null, "e": 115, "s": 54, "text": "Given an array of integers, print histogram of array values." }, { "code": null, "e": 125, "s": 115, "text": "Examples:" }, { "code": null, "e...
Reading and Displaying an image in OpenCV using C++
13 Jan, 2021 In this article, we will discuss to open an image using OpenCV (Open Source Computer Vision) in C++. Unlike python, any additional libraries in C++ are not required. OpenCV C++ comes with this amazing image container Mat that handles everything for us. The only change seen from a standard C++ program is th...
[ { "code": null, "e": 53, "s": 25, "text": "\n13 Jan, 2021" }, { "code": null, "e": 539, "s": 53, "text": "In this article, we will discuss to open an image using OpenCV (Open Source Computer Vision) in C++. Unlike python, any additional libraries in C++ are not required. OpenCV C...
Lifecycle and States of a Thread in C#
30 Sep, 2021 A thread in C# at any point of time exists in any one of the following states. A thread lies only in one of the shown states at any instant: Flow Chart: Life Cycle of a thread Unstarted state: When an instance of a Thread class is created, it is in the unstarted state, means the thread has not yet sta...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Sep, 2021" }, { "code": null, "e": 193, "s": 52, "text": "A thread in C# at any point of time exists in any one of the following states. A thread lies only in one of the shown states at any instant:" }, { "code": null, "...
Check whether the vowels in a string are in alphabetical order or not in Python
Suppose we have a string s. We have to check whether the vowels present in s are in alphabetical order or not. So, if the input is like s = "helloyou", then the output will be True as vowels are e, o, o, u all are in alphabetical order. To solve this, we will follow these steps − character := character whose ASCII is 6...
[ { "code": null, "e": 1173, "s": 1062, "text": "Suppose we have a string s. We have to check whether the vowels present in s are in alphabetical order or not." }, { "code": null, "e": 1299, "s": 1173, "text": "So, if the input is like s = \"helloyou\", then the output will be True...
Amazon Interview Experience - GeeksforGeeks
20 Aug, 2021 Round 1(Coding on Hacker Rank platform): Given an array of Strings, Each string has an id and version associated with it. string with alphabetic versions are the older versions and the string with numerical versions are the new version. We need to line up the strings for renovation such that older version ...
[ { "code": null, "e": 25052, "s": 25024, "text": "\n20 Aug, 2021" }, { "code": null, "e": 25093, "s": 25052, "text": "Round 1(Coding on Hacker Rank platform):" }, { "code": null, "e": 26129, "s": 25093, "text": "Given an array of Strings, Each string has an id ...
How to Handle Privileges in PostgreSQL | by Shengyu Huang | Towards Data Science
I used to downplay the importance of handling privileges for internal tools or at least misunderstand the intention of it. The use case I will talk about here is a database cluster where the users are the researchers in a research group. Since it is a small group, essentially everyone has the right to read and modify t...
[ { "code": null, "e": 633, "s": 172, "text": "I used to downplay the importance of handling privileges for internal tools or at least misunderstand the intention of it. The use case I will talk about here is a database cluster where the users are the researchers in a research group. Since it is a sma...
Upsampling with SMOTE for Classification Projects | by Jonathan Keller | Towards Data Science
Do you ever think to yourself: “There’s not enough bad wine in the world.”? Really? Just me? Alright, I probably should explain. I was recently working with a wine dataset on a classification problem. Basically I had values for the chemical composition of the wine and average user ratings, ostensibly on a rating scale ...
[ { "code": null, "e": 123, "s": 47, "text": "Do you ever think to yourself: “There’s not enough bad wine in the world.”?" }, { "code": null, "e": 403, "s": 123, "text": "Really? Just me? Alright, I probably should explain. I was recently working with a wine dataset on a classifica...
Convert day of year to day of month in Java
Firstly, set the day of year using DAY_OF_YEAR constant. Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, 2018); cal.set(Calendar.DAY_OF_YEAR, 320); Now, get the day of month − int res = cal.get(Calendar.DAY_OF_MONTH); The following is an example − Live Demo import java.util.Calendar; public class Demo { ...
[ { "code": null, "e": 1119, "s": 1062, "text": "Firstly, set the day of year using DAY_OF_YEAR constant." }, { "code": null, "e": 1224, "s": 1119, "text": "Calendar cal = Calendar.getInstance();\ncal.set(Calendar.YEAR, 2018);\ncal.set(Calendar.DAY_OF_YEAR, 320);" }, { "cod...
How to remove white spaces only beginning/end of a string using PHP ? - GeeksforGeeks
02 Jun, 2020 We have given a string and the task is to remove white space only from beginning of a string or end from a string str in PHP. In order to do this task, we have the following methods in PHP: Method 1: Using ltrim() Method: The ltrim() method is used to strip whitespace only from the beginning of a string. S...
[ { "code": null, "e": 31015, "s": 30987, "text": "\n02 Jun, 2020" }, { "code": null, "e": 31205, "s": 31015, "text": "We have given a string and the task is to remove white space only from beginning of a string or end from a string str in PHP. In order to do this task, we have the...
IMS DB - Data Manipulation
The different data manipulation methods used in IMS DL/I calls are as follows − ISRT Call Get Hold Calls REPL Call DLET Call Let us consider the following IMS database structure to understand the data manipulation function calls − Points to note − ISRT call is known as Insert call which is used to add segment occurrenc...
[ { "code": null, "e": 2026, "s": 1946, "text": "The different data manipulation methods used in IMS DL/I calls are as follows −" }, { "code": null, "e": 2036, "s": 2026, "text": "ISRT Call" }, { "code": null, "e": 2051, "s": 2036, "text": "Get Hold Calls" }, ...
Python Tricks: Simplifying If Statements & Boolean Evaluation | by Louis Chan | Towards Data Science
Welcome to a series of short posts each with handy Python tricks that can help you become a better Python programmer. In this blog, we will look into boolean evaluation. Let’s say we have a variable x and we would like to do something if a certain condition is met. A basic approach would be as follows: if x == conditio...
[ { "code": null, "e": 341, "s": 171, "text": "Welcome to a series of short posts each with handy Python tricks that can help you become a better Python programmer. In this blog, we will look into boolean evaluation." }, { "code": null, "e": 475, "s": 341, "text": "Let’s say we hav...
What is the use of static constructors in C#?
A static constructor is used to initialize any static data, or to perform a particular action that needs to be performed once only. It is called automatically before the first instance is created or any static members are referenced. Static constructors are useful when creating wrapper classes for unmanaged code, when ...
[ { "code": null, "e": 1296, "s": 1062, "text": "A static constructor is used to initialize any static data, or to perform a particular\naction that needs to be performed once only. It is called automatically before the first\ninstance is created or any static members are referenced." }, { "co...