title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
C# | Char.IsControl(String, Int32) Method - GeeksforGeeks | 01 Feb, 2019
This method is used to indicates whether the character at the specified position in a specified string is categorized as a control character.
Syntax:
public static bool IsControl (string s, int index);
Parameters:
s: It is the String.
index: It is the character position in s.
Return Value: This method retu... | [
{
"code": null,
"e": 24032,
"s": 24004,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24174,
"s": 24032,
"text": "This method is used to indicates whether the character at the specified position in a specified string is categorized as a control character."
},
{
"code":... |
Paraphrase any question with T5 (Text-To-Text Transfer Transformer) — Pretrained model and training script provided | by Ramsri Goutham | Towards Data Science | The input to our program will be any general question that you can think of -
Which course should I take to get started in data Science?
The output will be paraphrased versions of the same question. Paraphrasing a question means, you create a new question that expresses the same meaning using a differe... | [
{
"code": null,
"e": 250,
"s": 172,
"text": "The input to our program will be any general question that you can think of -"
},
{
"code": null,
"e": 326,
"s": 250,
"text": "Which course should I take to get started in data Science? "
},
{
"code": null,
... |
How to get all the keys from a Scala map - GeeksforGeeks | 29 Jul, 2019
In order to get all the keys from a Scala map, we need to use either keySet method (to get all the keys as a set) or we can use keys method and if you want to get the keys as an iterator, you need to use keysIterator method. Now, lets check some examples.Example #1:
// Scala program of keySet()// method /... | [
{
"code": null,
"e": 23621,
"s": 23593,
"text": "\n29 Jul, 2019"
},
{
"code": null,
"e": 23888,
"s": 23621,
"text": "In order to get all the keys from a Scala map, we need to use either keySet method (to get all the keys as a set) or we can use keys method and if you want to get ... |
Go switch | Use the switch statement to select one of many code blocks to be executed.
The switch statement in Go is similar to the ones in C, C++, Java, JavaScript, and PHP. The difference is that it only runs the matched case so it does not need a break statement.
This is how it works:
The expression is evaluated once
The value ... | [
{
"code": null,
"e": 75,
"s": 0,
"text": "Use the switch statement to select one of many code blocks to be executed."
},
{
"code": null,
"e": 255,
"s": 75,
"text": "The switch statement in Go is similar to the ones in C, C++, Java, JavaScript, and PHP. The difference is that it o... |
Convert JSON object to Java object using Gson library in Java?
| A Gson is a json library for java, which is created by Google and it can be used to generate a JSON. By using Gson, we can generate JSON and convert JSON to java objects. We can call the fromJson() method of Gson class to convert a JSON object to Java Object.
public <T> fromJson(java.lang.String json, java.lang.Class<T... | [
{
"code": null,
"e": 1322,
"s": 1062,
"text": "A Gson is a json library for java, which is created by Google and it can be used to generate a JSON. By using Gson, we can generate JSON and convert JSON to java objects. We can call the fromJson() method of Gson class to convert a JSON object to Java O... |
Fastest way to Convert Integers to Strings in Pandas DataFrame - GeeksforGeeks | 01 Aug, 2020
Pandas – An open-source library which is used by any programmer. It is a useful library that is used for analyzing the data and for manipulating the data. It is fast, flexible, and understandable, handles the missing data easily. Not only it provides but also enhances the performance of data manipulation a... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 24260,
"s": 23901,
"text": "Pandas – An open-source library which is used by any programmer. It is a useful library that is used for analyzing the data and for manipulating the data. It is fa... |
How to convert a bean to JSON object using Exclude Filter in Java? | The JsonConfig class can be used to configure the serialization process. We can use the setJsonPropertyFilter() method of JsonConfig to set the property filter when serializing to JSON. We need to implement a custom PropertyFilter class by overriding the apply() method of the PropertyFilter interface. It returns true i... | [
{
"code": null,
"e": 1438,
"s": 1062,
"text": "The JsonConfig class can be used to configure the serialization process. We can use the setJsonPropertyFilter() method of JsonConfig to set the property filter when serializing to JSON. We need to implement a custom PropertyFilter class by overriding th... |
How to get top activity name in activity stack? | This example demonstrate about How to get top activity name in activity stack.
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"?>
<Lin... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "This example demonstrate about How to get top activity name in activity stack."
},
{
"code": null,
"e": 1270,
"s": 1141,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details... |
How to print Narcissistic(Armstrong) Numbers with Python? | To print Narcissistic Numbers, let's first look at the definition of it. It is a number that is the sum of its own digits each raised to the power of the number of digits. For example, 1, 153, 370 are all Narcissistic numbers. You can print these numbers by running the following code
def print_narcissistic_nums(start, ... | [
{
"code": null,
"e": 1347,
"s": 1062,
"text": "To print Narcissistic Numbers, let's first look at the definition of it. It is a number that is the sum of its own digits each raised to the power of the number of digits. For example, 1, 153, 370 are all Narcissistic numbers. You can print these number... |
Append the last M nodes to the beginning of the given linked list. - GeeksforGeeks | 23 Dec, 2021
Given a linked list and an integer M, the task is to append the last M nodes of the linked list to the front.Examples:
Input: List = 4 -> 5 -> 6 -> 1 -> 2 -> 3 -> NULL, M = 3 Output: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> NULLInput: List = 8 -> 7 -> 0 -> 4 -> 1 -> NULL, M = 2 Output: 4 -> 1 -> 8 -> 7 -> 0 -> NULL... | [
{
"code": null,
"e": 25034,
"s": 25006,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 25155,
"s": 25034,
"text": "Given a linked list and an integer M, the task is to append the last M nodes of the linked list to the front.Examples: "
},
{
"code": null,
"e": 25344... |
Dart - Getters and Setters - GeeksforGeeks | 14 Jul, 2020
Getters and Setters, also called accessors and mutators, allow the program to initialize and retrieve the values of class fields respectively.
Getters or accessors are defined using the get keyword.
Setters or mutators are defined using the set keyword.
A default getter/setter is associated with every cla... | [
{
"code": null,
"e": 24026,
"s": 23998,
"text": "\n14 Jul, 2020"
},
{
"code": null,
"e": 24170,
"s": 24026,
"text": "Getters and Setters, also called accessors and mutators, allow the program to initialize and retrieve the values of class fields respectively. "
},
{
"code... |
C# | Total number of elements present in an array - GeeksforGeeks | 04 Aug, 2021
Array.GetLength(Int32) Method is used to find the total number of elements present in the specified dimension of the Array. Syntax:
public int GetLength (int dimension);
Here, dimension is a zero-based dimension of the Array whose length needs to be determined.Return value: The return type of this method... | [
{
"code": null,
"e": 24725,
"s": 24697,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 24859,
"s": 24725,
"text": "Array.GetLength(Int32) Method is used to find the total number of elements present in the specified dimension of the Array. Syntax: "
},
{
"code": null,
... |
Vehicle Detection and Tracking | by Nick Hortovanyi | Towards Data Science | In this vehicle detection and tracking project, we detect in a video pipeline, potential boxes, via a sliding window, that may contain a vehicle by using a Support Vector Machine Classifier for prediction to create a heat map. The heat map history is then used to filter out false positives before identification of vehi... | [
{
"code": null,
"e": 534,
"s": 172,
"text": "In this vehicle detection and tracking project, we detect in a video pipeline, potential boxes, via a sliding window, that may contain a vehicle by using a Support Vector Machine Classifier for prediction to create a heat map. The heat map history is then... |
SymPy | Subset.subset() in Python - GeeksforGeeks | 28 Aug, 2019
Subset.subset() : subset() is a sympy Python library function that returns the subset represented by the current instance.
Syntax :sympy.combinatorics.subset.Subset.subset()
Return :the subset represented by the current instance.
Code #1 : subset() Example
# Python code explaining# SymPy.Subset.subset() #... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n28 Aug, 2019"
},
{
"code": null,
"e": 24415,
"s": 24292,
"text": "Subset.subset() : subset() is a sympy Python library function that returns the subset represented by the current instance."
},
{
"code": null,
"e": 244... |
Gensim - Creating a Dictionary | In last chapter where we discussed about vector and model, you got an idea about the dictionary. Here, we are going to discuss Dictionary object in a bit more detail.
Before getting deep dive into the concept of dictionary, let’s understand some simple NLP concepts −
Token − A token means a ‘word’.
Token − A token mean... | [
{
"code": null,
"e": 2219,
"s": 2052,
"text": "In last chapter where we discussed about vector and model, you got an idea about the dictionary. Here, we are going to discuss Dictionary object in a bit more detail."
},
{
"code": null,
"e": 2320,
"s": 2219,
"text": "Before getting ... |
Count Distinct Subsequences | 05 Jul, 2022
Given a string, find the count of distinct subsequences of it.
Examples:
Input : str = "gfg"
Output : 7
The seven distinct subsequences are "", "g", "f",
"gf", "fg", "gg" and "gfg"
Input : str = "ggg"
Output : 4
The four distinct subsequences are "", "g", "gg"
and "ggg"
The problem of counting distin... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 116,
"s": 52,
"text": "Given a string, find the count of distinct subsequences of it. "
},
{
"code": null,
"e": 127,
"s": 116,
"text": "Examples: "
},
{
"code": null,
... |
iText - Adding a Paragraph | In this chapter, we will see how to create a PDF document and add a paragraph to it using the iText library.
You can create an empty PDF Document by instantiating the Document class. While instantiating this class, you need to pass a PdfDocument object as a parameter, to its constructor. Then, to add a paragraph to the... | [
{
"code": null,
"e": 2611,
"s": 2502,
"text": "In this chapter, we will see how to create a PDF document and add a paragraph to it using the iText library."
},
{
"code": null,
"e": 2937,
"s": 2611,
"text": "You can create an empty PDF Document by instantiating the Document class.... |
GATE | GATE-CS-2006 | Question 60 | 17 Sep, 2021
Consider the following C code segment.
for (i = 0, i<n; i++){ for (j=0; j<n; j++) { if (i%2) { x += (4*j + 5*i); y += (7 + 4*j); } }}
Which one of the following is false?(A) The code contains loop invariant computation(B) There is scope of common sub-expr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Sep, 2021"
},
{
"code": null,
"e": 67,
"s": 28,
"text": "Consider the following C code segment."
},
{
"code": "for (i = 0, i<n; i++){ for (j=0; j<n; j++) { if (i%2) { x += (4*j + 5*i); ... |
Pacman command in Arch Linux | 21 Dec, 2021
Pacman is a package manager for the arch Linux and arch-based Linux distributions. If you have used Debian-based OS like ubuntu, then the Pacman is similar to the apt command of Debian-based operating systems. Pacman contains the compressed files as a package format and maintains a text-based package data... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Dec, 2021"
},
{
"code": null,
"e": 522,
"s": 28,
"text": "Pacman is a package manager for the arch Linux and arch-based Linux distributions. If you have used Debian-based OS like ubuntu, then the Pacman is similar to the apt command... |
Python | Reading .ini Configuration Files | 20 Jun, 2019
This article aims to read configuration files written in the common .ini configuration file format. The configparser module can be used to read configuration files.
Code #1 : Configuration File
abc.ini ; Sample configuration file[installation]library = %(prefix)s/libinclude = %(prefix)s/includebin = %(pre... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jun, 2019"
},
{
"code": null,
"e": 193,
"s": 28,
"text": "This article aims to read configuration files written in the common .ini configuration file format. The configparser module can be used to read configuration files."
},
{
... |
PHP | ord() Function | 20 Mar, 2018
The ord() function is a inbuilt function in PHP that returns the ASCII value of the first character of a string. This function takes a character string as a parameter and returns the ASCII value of the first character of this string.
Syntax:
int ord($string)
Parameter: This function accepts a single parame... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Mar, 2018"
},
{
"code": null,
"e": 262,
"s": 28,
"text": "The ord() function is a inbuilt function in PHP that returns the ASCII value of the first character of a string. This function takes a character string as a parameter and retu... |
Differences between TreeMap, HashMap and LinkedHashMap in Java | 02 Aug, 2021
Prerequisite : HashMap and TreeMap in Java
TreeMap, HashMap and LinkedHashMap: What’s Similar?
All offer a key->value map and a way to iterate through the keys. The most important distinction between these classes is the time guarantees and the ordering of the keys.
All three classes HashMap, TreeMap and... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Aug, 2021"
},
{
"code": null,
"e": 98,
"s": 54,
"text": "Prerequisite : HashMap and TreeMap in Java "
},
{
"code": null,
"e": 151,
"s": 98,
"text": "TreeMap, HashMap and LinkedHashMap: What’s Similar? "
},
{
... |
Loops in JavaScript | 22 Jun, 2022
Looping in programming languages is a feature which facilitates the execution of a set of instructions/functions repeatedly while some condition evaluates to true. For example, suppose we want to print “Hello World” 10 times. This can be done in two ways as shown below:
Iterative Method
The iterative metho... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 323,
"s": 52,
"text": "Looping in programming languages is a feature which facilitates the execution of a set of instructions/functions repeatedly while some condition evaluates to true. For exampl... |
Output of Java program | Set 18 (Overriding) | 03 Jun, 2017
Prerequisite – Overriding in Java
1) What is the output of the following program?
class Derived { protected final void getDetails() { System.out.println("Derived class"); }} public class Test extends Derived{ protected final void getDetails() { System.out.println("Test class")... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n03 Jun, 2017"
},
{
"code": null,
"e": 86,
"s": 52,
"text": "Prerequisite – Overriding in Java"
},
{
"code": null,
"e": 134,
"s": 86,
"text": "1) What is the output of the following program?"
},
{
"code": "cl... |
How to create Voronoi regions with Geospatial data in Python | by Abdishakur | Towards Data Science | Assume you are planning to walk to a station to pick up a scooter. There are numerous stations available in nearby. Which one should you go to pick up your scooter and ride?
The closest station, right!
But, how do you know the closest station from your place?
Enter Voronoi diagrams.
A Voronoi diagram is a collection of... | [
{
"code": null,
"e": 346,
"s": 172,
"text": "Assume you are planning to walk to a station to pick up a scooter. There are numerous stations available in nearby. Which one should you go to pick up your scooter and ride?"
},
{
"code": null,
"e": 374,
"s": 346,
"text": "The closest ... |
Rational UI Design with Streamlit | by Alan Jones | Towards Data Science | When Tim Berners-Lee first invented the web, pages were just text. When the first graphical browsers like Mosaic came along web pages got pictures, too.
Later they became apps with server-side programs supplying the data to construct the web pages. This often entailed writing code in the within the HTML in PHP, or Java... | [
{
"code": null,
"e": 325,
"s": 172,
"text": "When Tim Berners-Lee first invented the web, pages were just text. When the first graphical browsers like Mosaic came along web pages got pictures, too."
},
{
"code": null,
"e": 568,
"s": 325,
"text": "Later they became apps with serve... |
send() - Unix, Linux System Call | Unix - Home
Unix - Getting Started
Unix - File Management
Unix - Directories
Unix - File Permission
Unix - Environment
Unix - Basic Utilities
Unix - Pipes & Filters
Unix - Processes
Unix - Communication
Unix - The vi Editor
Unix - What is Shell?
Unix - Using Variables
Unix - Special Variables
Unix - Using Arrays
Unix -... | [
{
"code": null,
"e": 1466,
"s": 1454,
"text": "Unix - Home"
},
{
"code": null,
"e": 1489,
"s": 1466,
"text": "Unix - Getting Started"
},
{
"code": null,
"e": 1512,
"s": 1489,
"text": "Unix - File Management"
},
{
"code": null,
"e": 1531,
"s": 1... |
VBScript Exit For statement | A Exit For Statement is used when we want to Exit the For Loop based on certain criteria. When Exit For is executed, the control jumps to next statement immediately after the For Loop.
The syntax for Exit For Statement in VBScript is −
Exit For
The below example uses Exit For. If the value of the Counter reaches 4, t... | [
{
"code": null,
"e": 2265,
"s": 2080,
"text": "A Exit For Statement is used when we want to Exit the For Loop based on certain criteria. When Exit For is executed, the control jumps to next statement immediately after the For Loop."
},
{
"code": null,
"e": 2316,
"s": 2265,
"text"... |
Socket programming In Python | In bidirectional communications channel, sockets are two end points. Sockets can communicate between process on the same machine or on different continents.
Sockets are implemented by the different types of channel-TCP, UDP.
For creating Socket, we need socket module and socket.socket () function.
my_socket = socket.so... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "In bidirectional communications channel, sockets are two end points. Sockets can communicate between process on the same machine or on different continents."
},
{
"code": null,
"e": 1287,
"s": 1219,
"text": "Sockets are implemented b... |
Spring Boot - Rest Template | Rest Template is used to create applications that consume RESTful Web Services. You can use the exchange() method to consume the web services for all HTTP methods. The code given below shows how to create Bean for Rest Template to auto wiring the Rest Template object.
package com.tutorialspoint.demo;
import org.spring... | [
{
"code": null,
"e": 3294,
"s": 3025,
"text": "Rest Template is used to create applications that consume RESTful Web Services. You can use the exchange() method to consume the web services for all HTTP methods. The code given below shows how to create Bean for Rest Template to auto wiring the Rest T... |
Batch Script - DISKPART | This batch command shows and configures the properties of disk partitions.
Diskpart
@echo off
diskpart
The above command shows the properties of disk partitions. Following is an example of the output.
Microsoft DiskPart version 6.3.9600
Copyright (C) 1999-2013 Microsoft Corporation.
On computer: WIN-50GP30FGO75
Pr... | [
{
"code": null,
"e": 2244,
"s": 2169,
"text": "This batch command shows and configures the properties of disk partitions."
},
{
"code": null,
"e": 2254,
"s": 2244,
"text": "Diskpart\n"
},
{
"code": null,
"e": 2274,
"s": 2254,
"text": "@echo off \ndiskpart"
}... |
Assertions in Python | An assertion is a sanity-check that you can turn on or turn off when you are done with your testing of the program.
The easiest way to think of an assertion is to liken it to a raise-if statement (or to be more accurate, a raise-if-not statement). An expression is tested, and if the result comes up false, an exception... | [
{
"code": null,
"e": 2361,
"s": 2244,
"text": "An assertion is a sanity-check that you can turn on or turn off when you are done with your testing of the program."
},
{
"code": null,
"e": 2576,
"s": 2361,
"text": "The easiest way to think of an assertion is to liken it to a rais... |
Java ResultSetMetaData getColumnTypeName() method with example | The getColumnTypeName() method of the ResultSetMetaData (interface) retrieves and returns the name of the datatype of the specified column in the current ResultSet object.
This method accepts an integer value representing the index of a column and, returns a String value representing the name of the SQL data type of th... | [
{
"code": null,
"e": 1234,
"s": 1062,
"text": "The getColumnTypeName() method of the ResultSetMetaData (interface) retrieves and returns the name of the datatype of the specified column in the current ResultSet object."
},
{
"code": null,
"e": 1402,
"s": 1234,
"text": "This metho... |
101 SQL with Python Code Tutorial | Towards Data Science | SQL is the world’s most loved (or at least most used) data storage/querying language — and Python the most popular programming language in the world. Both together can produce some spectacular results.
We will run through the basics of getting set up with a local, open-source SQL server (MySQL). And connecting to that ... | [
{
"code": null,
"e": 374,
"s": 172,
"text": "SQL is the world’s most loved (or at least most used) data storage/querying language — and Python the most popular programming language in the world. Both together can produce some spectacular results."
},
{
"code": null,
"e": 552,
"s": 37... |
clear() element method - Selenium Python - GeeksforGeeks | 27 Apr, 2020
Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests using Selenium WebDriver. To open a webpage using Selenium Python, checkout – Navigating links using get method – Selenium Python. Just being able ... | [
{
"code": null,
"e": 23995,
"s": 23967,
"text": "\n27 Apr, 2020"
},
{
"code": null,
"e": 24552,
"s": 23995,
"text": "Selenium’s Python Module is built to perform automated testing with Python. Selenium Python bindings provides a simple API to write functional/acceptance tests usi... |
LinkedList AddFirst method in C# | In a Linked List, if you want to add a node at the first position, use AddFirst method.
Let’s first set a LinkedList.
string [] students = {"Jenifer","Angelina","Vera"};
LinkedList<string> list = new LinkedList<string>(students);
Now, to add an element as a first node, use AddFirst() method.
List.AddFirst(“Natalie”);
... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "In a Linked List, if you want to add a node at the first position, use AddFirst method."
},
{
"code": null,
"e": 1180,
"s": 1150,
"text": "Let’s first set a LinkedList."
},
{
"code": null,
"e": 1292,
"s": 1180,
"t... |
Perl | Array pop() Function - GeeksforGeeks | 07 May, 2019
pop() function in Perl returns the last element of Array passed to it as an argument, removing that value from the array. Note that the value passed to it must explicitly be an array, not a list.
Syntax:pop(Array)
Returns:undef if list is empty else last element from the array.
Example 1:
#!/usr/bin/perl -... | [
{
"code": null,
"e": 23990,
"s": 23962,
"text": "\n07 May, 2019"
},
{
"code": null,
"e": 24186,
"s": 23990,
"text": "pop() function in Perl returns the last element of Array passed to it as an argument, removing that value from the array. Note that the value passed to it must exp... |
Counting the number of non-NaN elements in a NumPy Array - GeeksforGeeks | 17 Oct, 2021
In this article, we are going to see how to count the number of non-NaN elements in a NumPy array in Python.
NAN: It is used when you don’t care what the value is at that position. Maybe sometimes is used in place of missing data, or corrupted data.
In this example, we will use one-dimensional arrays. In ... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n17 Oct, 2021"
},
{
"code": null,
"e": 24010,
"s": 23901,
"text": "In this article, we are going to see how to count the number of non-NaN elements in a NumPy array in Python."
},
{
"code": null,
"e": 24152,
"s": 2... |
java.util.zip - GZIPOutputStream Class | The java.util.zip.GZIPOutputStream class implements a stream filter for writing compressed data in the GZIP file format.
Following is the declaration for java.util.zip.GZIPOutputStream class −
public class GZIPOutputStream
extends DeflaterOutputStream
Following are the fields for java.util.zip.GZIPOutputStream clas... | [
{
"code": null,
"e": 2313,
"s": 2192,
"text": "The java.util.zip.GZIPOutputStream class implements a stream filter for writing compressed data in the GZIP file format."
},
{
"code": null,
"e": 2385,
"s": 2313,
"text": "Following is the declaration for java.util.zip.GZIPOutputStre... |
Finding median for every window in JavaScript | Median in mathematics, median is the middle value in an ordered(sorted) integer list.
If the size of the list is even, and there is no middle value. Median is the mean (average) of the two middle values.
We are required to write a JavaScript function that takes in an array of Integers, arr, as the first argument and a ... | [
{
"code": null,
"e": 1148,
"s": 1062,
"text": "Median in mathematics, median is the middle value in an ordered(sorted) integer list."
},
{
"code": null,
"e": 1266,
"s": 1148,
"text": "If the size of the list is even, and there is no middle value. Median is the mean (average) of t... |
How to Detect User Inactivity in Android? - GeeksforGeeks | 11 Aug, 2021
It is important to detect user inactivity in applications that display or contain private credentials, such as social apps, banking apps, wallet apps, etc. In such applications, there is a login session that authenticates log-in credentials. Once the session starts, the user can perform desired actions. Ho... | [
{
"code": null,
"e": 24725,
"s": 24697,
"text": "\n11 Aug, 2021"
},
{
"code": null,
"e": 25367,
"s": 24725,
"text": "It is important to detect user inactivity in applications that display or contain private credentials, such as social apps, banking apps, wallet apps, etc. In such... |
Share WhatsApp Web without Scanning QR code using Python - GeeksforGeeks | 23 Aug, 2021
Prerequisite: Selenium, Browser Automation Using Selenium
In this article, we are going to see how to share your Web-WhatsApp with anyone over the Internet without Scanning a QR code.
Web Whatsapp stores sessions in IndexedDB with the name wawc and syncs those key-value pairs to local storage. IndexedDB st... | [
{
"code": null,
"e": 24236,
"s": 24208,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 24294,
"s": 24236,
"text": "Prerequisite: Selenium, Browser Automation Using Selenium"
},
{
"code": null,
"e": 24420,
"s": 24294,
"text": "In this article, we are going to... |
Reentrant Function - GeeksforGeeks | 26 Apr, 2018
A function is said to be reentrant if there is a provision to interrupt the function in the course of execution, service the interrupt service routine and then resume the earlier going on function, without hampering its earlier course of action. Reentrant functions are used in applications like hardware in... | [
{
"code": null,
"e": 24029,
"s": 24001,
"text": "\n26 Apr, 2018"
},
{
"code": null,
"e": 25080,
"s": 24029,
"text": "A function is said to be reentrant if there is a provision to interrupt the function in the course of execution, service the interrupt service routine and then res... |
C program to find the solution of linear equation | We can apply the software development method to solve the linear equation of one variable in C programming language.
The equation should be in the form of ax+b=0
a and b are inputs, we need to find the value of x
Here,
An input is the a,b values.
An output is the x value.
Refer an algorithm given below to find solution... | [
{
"code": null,
"e": 1179,
"s": 1062,
"text": "We can apply the software development method to solve the linear equation of one variable in C programming language."
},
{
"code": null,
"e": 1224,
"s": 1179,
"text": "The equation should be in the form of ax+b=0"
},
{
"code"... |
A Fast Introduction to FastAI — My Experience | by Yash Prakash | Towards Data Science | When I first heard about this powerful AI library that everyone seemed to be talking about, I was intrigued. FastAI — as its name stands, boasts to help coders deep dive into the vast and complicated world of deep learning in just a few lines of code and an extremely minimal setup too. Needless to say, I was pretty pum... | [
{
"code": null,
"e": 560,
"s": 172,
"text": "When I first heard about this powerful AI library that everyone seemed to be talking about, I was intrigued. FastAI — as its name stands, boasts to help coders deep dive into the vast and complicated world of deep learning in just a few lines of code and ... |
DirectX - Drawing | This chapter, in turn, focuses on the Direct3D API interfaces and methods which are needed to configure the rendering pipeline, define vertex and pixel shaders, and submit geometry to the rendering pipeline for drawing. After understanding the chapter, the user should be able to draw various geometric shapes with color... | [
{
"code": null,
"e": 2644,
"s": 2298,
"text": "This chapter, in turn, focuses on the Direct3D API interfaces and methods which are needed to configure the rendering pipeline, define vertex and pixel shaders, and submit geometry to the rendering pipeline for drawing. After understanding the chapter, ... |
Difference between user defined function and library function in C/C++ - GeeksforGeeks | 21 Jun, 2020
Library function:These function are the built-in functions i.e., they are predefined in the library of the C. These are used to perform the most common operations like calculations, updatation, etc. Some of the library functions are printf, scanf, sqrt, etc. To use this functions in the program the user ha... | [
{
"code": null,
"e": 24472,
"s": 24444,
"text": "\n21 Jun, 2020"
},
{
"code": null,
"e": 24868,
"s": 24472,
"text": "Library function:These function are the built-in functions i.e., they are predefined in the library of the C. These are used to perform the most common operations ... |
Customize the JOptionPane layout with updated color and image in Java | Customize the layout by changing the look and feel of the panel in which you added the component −
ImageIcon icon = new ImageIcon(new URL("http −//www.tutorialspoint.com/images/C-PLUS.png"));
JLabel label = new JLabel(icon);
JPanel panel = new JPanel(new GridBagLayout());
panel.add(label);
panel.setOpaque(true);
panel.... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "Customize the layout by changing the look and feel of the panel in which you added the component −"
},
{
"code": null,
"e": 1411,
"s": 1161,
"text": "ImageIcon icon = new ImageIcon(new URL(\"http −//www.tutorialspoint.com/images/C-PL... |
HTML - Marquees | An HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your webpage depending on the settings. This is created by using HTML <marquees> tag.
Note − The <marquee> tag deprecated in HTML5. Do not use this element, instead you can use JavaScript and CSS to create such effects.... | [
{
"code": null,
"e": 2561,
"s": 2374,
"text": "An HTML marquee is a scrolling piece of text displayed either horizontally across or vertically down your webpage depending on the settings. This is created by using HTML <marquees> tag."
},
{
"code": null,
"e": 2695,
"s": 2561,
"tex... |
Assembly - Strings | We have already used variable length strings in our previous examples. The variable length strings can have as many characters as required. Generally, we specify the length of the string by either of the two ways −
Explicitly storing string length
Using a sentinel character
We can store the string length explicitly by ... | [
{
"code": null,
"e": 2300,
"s": 2085,
"text": "We have already used variable length strings in our previous examples. The variable length strings can have as many characters as required. Generally, we specify the length of the string by either of the two ways −"
},
{
"code": null,
"e": 2... |
Explain the Post Correspondence Problem in TOC | The Post Correspondence Problem (PCP) was introduced by Emil Post in 1946 and is an undecidable decision problem.
The PCP problem over an alphabet Σ is state. Given the following two lists, M and N of non-empty strings over Σ−
M = (x1, x2, x3,........., xn)
N = (y1, y2, y3,........., yn)
We can say that there is a Post... | [
{
"code": null,
"e": 1176,
"s": 1062,
"text": "The Post Correspondence Problem (PCP) was introduced by Emil Post in 1946 and is an undecidable decision problem."
},
{
"code": null,
"e": 1289,
"s": 1176,
"text": "The PCP problem over an alphabet Σ is state. Given the following two... |
Machine-Learning In Julia is FINALLY Getting Better | by Emmett Boudreau | Towards Data Science | Whenever I first started using Julia, an issue that I, as well as many other defectors coming from languages with strong ecosystems like Python and R took, is specifically with data processing. Data processing seems to of been quite neglected in Julia, often with individual packages being used to solve a single problem... | [
{
"code": null,
"e": 890,
"s": 171,
"text": "Whenever I first started using Julia, an issue that I, as well as many other defectors coming from languages with strong ecosystems like Python and R took, is specifically with data processing. Data processing seems to of been quite neglected in Julia, of... |
Python – Extract Percentages from String | 02 Sep, 2020
Given a String, extract all the numbers that are percentages.
Input : test_str = ‘geeksforgeeks 20% is 100% way to get 200% success’Output : [‘20%’, ‘100%’, ‘200%’]Explanation : 20%, 100% and 200% are percentages present.
Input : test_str = ‘geeksforgeeks is way to get success’Output : []Explanation : No p... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Sep, 2020"
},
{
"code": null,
"e": 116,
"s": 54,
"text": "Given a String, extract all the numbers that are percentages."
},
{
"code": null,
"e": 276,
"s": 116,
"text": "Input : test_str = ‘geeksforgeeks 20% is 10... |
GATE-CS-2016 (Set 2) - GeeksforGeeks | 11 Oct, 2021
put up with - is a phrasal verb
Meaning : to accept somebody/something that is annoying, unpleasant without complaining
mock, deride, praise, jeer
--> Author has not said anything against internet and mobile computing
but is talking about the surprising usage of these.
"Many believe that the internet i... | [
{
"code": null,
"e": 29574,
"s": 29546,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 29695,
"s": 29574,
"text": "put up with - is a phrasal verb\nMeaning : to accept somebody/something that is annoying, unpleasant without complaining\n"
},
{
"code": null,
"e": 297... |
Semantic-UI | Step | 20 May, 2020
Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use to make your website look more amazing. It uses a class to add CSS to the elements.
A step shows the completion of a series of activ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 May, 2020"
},
{
"code": null,
"e": 287,
"s": 28,
"text": "Semantic UI is an open-source framework that uses CSS and jQuery to build great user interfaces. It is the same as a bootstrap for use and has great different elements to use ... |
Kotlin Sealed Classes | 30 Jun, 2022
Kotlin provides an important new type of class that is not present in Java. These are known as sealed classes. As the word sealed suggests, sealed classes conform to restricted or bounded class hierarchies. A sealed class defines a set of subclasses within it. It is used when it is known in advance that a ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 496,
"s": 28,
"text": "Kotlin provides an important new type of class that is not present in Java. These are known as sealed classes. As the word sealed suggests, sealed classes conform to restricte... |
Array Partition I in Python | Suppose we have an array of 2n number of integers, we have to group these integers into n pairs of integer, like (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i in range 1 to n as large as possible. So if the input is [1, 4, 3, 2], then output will be 4. So n is 2. And the maximum sum of pair... | [
{
"code": null,
"e": 1549,
"s": 1187,
"text": "Suppose we have an array of 2n number of integers, we have to group these integers into n pairs of integer, like (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i in range 1 to n as large as possible. So if the input is [1, 4, 3... |
How to delete last N rows from Numpy array? | 28 Apr, 2021
In this article, we will discuss how to delete the last N rows from the NumPy array.
Slicing is an indexing operation that is used to iterate over an array.
Syntax: array_name[start:stop]
where start is the start is the index and stop is the last index.
We can also do negative slicing in Python. It is den... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Apr, 2021"
},
{
"code": null,
"e": 113,
"s": 28,
"text": "In this article, we will discuss how to delete the last N rows from the NumPy array."
},
{
"code": null,
"e": 185,
"s": 113,
"text": "Slicing is an indexin... |
How to Make a Square Plot With Equal Axes in Matplotlib? | 29 Oct, 2021
In this article, we are going to discuss how to illustrate a square plot with equal axis using matplotlib module. We can depict a Square plot using matplotlib.axes.Axes.set_aspect() and matplotlib.pyplot.axis() methods.
Syntax: matplotlib.axes.Axes.set_aspect()
Parameters:
aspect : This parameter accepts... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 275,
"s": 54,
"text": "In this article, we are going to discuss how to illustrate a square plot with equal axis using matplotlib module. We can depict a Square plot using matplotlib.axes.Axes.set_... |
Fascinating Number | 14 May, 2021
Given a number N, the task is to check whether it is fascinating or not. Fascinating Number: When a number( 3 digits or more ) is multiplied by 2 and 3, and when both these products are concatenated with the original number, then it results in all digits from 1 to 9 present exactly once. There could be any... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 May, 2021"
},
{
"code": null,
"e": 407,
"s": 54,
"text": "Given a number N, the task is to check whether it is fascinating or not. Fascinating Number: When a number( 3 digits or more ) is multiplied by 2 and 3, and when both these p... |
Stitching input images (panorama) using OpenCV with C++ | 26 Apr, 2022
This program is intended to create a panorama from a set of images by stitching them together using OpenCV library stitching.hpp and the implementation for the same is done in C++. The program saves the resultant stitched image in the same directory as the program file. If the set of images are not stitche... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n26 Apr, 2022"
},
{
"code": null,
"e": 530,
"s": 54,
"text": "This program is intended to create a panorama from a set of images by stitching them together using OpenCV library stitching.hpp and the implementation for the same is done i... |
Longest subarray with sum divisible by K | 17 Jun, 2022
Given an arr[] containing n integers and a positive integer k. The problem is to find the longest subarray’s length with the sum of the elements divisible by the given value k.Examples:
Input: arr[] = {2, 7, 6, 1, 4, 5}, k = 3Output: 4Explaination: The subarray is {7, 6, 1, 4} with sum 18, which is divisib... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 238,
"s": 52,
"text": "Given an arr[] containing n integers and a positive integer k. The problem is to find the longest subarray’s length with the sum of the elements divisible by the given value ... |
How to convert a matrix into a data frame with column names and row names as variables in R? | To convert a matrix into a data frame with column names and row names as variables, we first need to convert the matrix into a table and then read it as data frame using as.data.frame. For example, if we have a matrix M then it can be done by using the below command −
as.data.frame(as.table(M))
Live Demo
> M1<-matrix(1... | [
{
"code": null,
"e": 1456,
"s": 1187,
"text": "To convert a matrix into a data frame with column names and row names as variables, we first need to convert the matrix into a table and then read it as data frame using as.data.frame. For example, if we have a matrix M then it can be done by using the ... |
Java program to delete certain text from a file | 30 May, 2018
Prerequisite : PrintWriter , BufferedReader
Given two files input.txt and delete.txt. Our Task is to perform file extraction(Input-Delete) and save the output in file say output.txt
Example :
Naive Algorithm :
1. Create PrintWriter object for output.txt
2. Open BufferedReader for input.txt
3. Run a loop ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 May, 2018"
},
{
"code": null,
"e": 98,
"s": 54,
"text": "Prerequisite : PrintWriter , BufferedReader"
},
{
"code": null,
"e": 236,
"s": 98,
"text": "Given two files input.txt and delete.txt. Our Task is to perfor... |
Power Set | 08 Jul, 2022
Power Set: Power set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then P(s) = {{}, {a}, {b}, {c}, {a,b}, {a, c}, {b, c}, {a, b, c}}.If S has n elements in it then P(s) will have 2n elements
Example:
Set = [a,b,c]power_set_size = pow(2, 3) = 8Run for binary counter = 000 to 11... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 273,
"s": 54,
"text": "Power Set: Power set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then P(s) = {{}, {a}, {b}, {c}, {a,b}, {a, c}, {b, c}, {a, b, c}}.If S has n el... |
Computable and non-computable problems in TOC | 20 Jun, 2022
Computable Problems – You are familiar with many problems (or functions) that are computable (or decidable), meaning there exists some algorithm that computes an answer (or output) to any instance of the problem (or for any input to the function) in a finite number of simple steps. A simple example is the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jun, 2022"
},
{
"code": null,
"e": 364,
"s": 28,
"text": "Computable Problems – You are familiar with many problems (or functions) that are computable (or decidable), meaning there exists some algorithm that computes an answer (or ou... |
Traveling Salesman Problem using Genetic Algorithm | 23 Dec, 2021
Prerequisites: Genetic Algorithm, Travelling Salesman ProblemIn this article, a genetic algorithm is proposed to solve the travelling salesman problem. Genetic algorithms are heuristic search algorithms inspired by the process that supports the evolution of life. The algorithm is designed to replicate the ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 518,
"s": 54,
"text": "Prerequisites: Genetic Algorithm, Travelling Salesman ProblemIn this article, a genetic algorithm is proposed to solve the travelling salesman problem. Genetic algorithms are... |
Fill array with 1's using minimum iterations of filling neighbors - GeeksforGeeks | 28 Apr, 2021
Given an array of 0s and 1s, in how many iterations the whole array can be filled with 1s if in a single iteration immediate neighbors of 1s can be filled.NOTE: If we cannot fill array with 1s, then print “-1” .Examples :
Input : arr[] = {1, 0, 1, 0, 0, 1, 0, 1,
1, 0, 1, 1, 0, 0, 1}... | [
{
"code": null,
"e": 24915,
"s": 24887,
"text": "\n28 Apr, 2021"
},
{
"code": null,
"e": 25139,
"s": 24915,
"text": "Given an array of 0s and 1s, in how many iterations the whole array can be filled with 1s if in a single iteration immediate neighbors of 1s can be filled.NOTE: If... |
Method overriding in Java | Overriding is the ability to define a behavior that's specific to the subclass type, which means a subclass can implement a parent class method based on its requirement.
In object-oriented terms, overriding means to override the functionality of an existing method.
Let us look at an example.
Live Demo
class Animal {
... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "Overriding is the ability to define a behavior that's specific to the subclass type, which means a subclass can implement a parent class method based on its requirement."
},
{
"code": null,
"e": 1328,
"s": 1232,
"text": "In object-or... |
C library macro - offsetof() | The C library macro offsetof(type, member-designator) results in a constant integer of type size_t which is the offset in bytes of a structure member from the beginning of the structure. The member is given by member-designator, and the name of the structure is given in type.
Following is the declaration for offsetof()... | [
{
"code": null,
"e": 2284,
"s": 2007,
"text": "The C library macro offsetof(type, member-designator) results in a constant integer of type size_t which is the offset in bytes of a structure member from the beginning of the structure. The member is given by member-designator, and the name of the stru... |
How to retrieve the content of the file in PowerShell? | To retrieve the content of the file in PowerShell, you need to use Get-Content cmdlet. For example, we are going to retrieve the content of the text file called Aliases.txt from a specific location.
Get-Content D:\Temp\aliases.txt
PS C:\WINDOWS\system32> Get-Content D:\Temp\aliases.txt
# Alias File
# Exported by : admi... | [
{
"code": null,
"e": 1261,
"s": 1062,
"text": "To retrieve the content of the file in PowerShell, you need to use Get-Content cmdlet. For example, we are going to retrieve the content of the text file called Aliases.txt from a specific location."
},
{
"code": null,
"e": 1293,
"s": 12... |
Do Not Abuse Try Except In Python | by Christopher Tao | Towards Data Science | Like most other programming languages, Python supports catching and handling exceptions during runtime. However, sometimes I found that it has been overused.
It turns out that some developers, especially those who are newbies in Python, tend to use try ... except ... a lot, once they found such a feature. However, I wo... | [
{
"code": null,
"e": 330,
"s": 172,
"text": "Like most other programming languages, Python supports catching and handling exceptions during runtime. However, sometimes I found that it has been overused."
},
{
"code": null,
"e": 682,
"s": 330,
"text": "It turns out that some devel... |
Dimensionality Reduction Approaches | by Prerna Singh | Towards Data Science | The full explosion of big data has persuaded us that there is more to it. While it is true, of course, that a large amount of training data allows the machine learning model to learn more rules and generalize better to new data, it is also true that an indiscriminate introduction of low-quality data and input features ... | [
{
"code": null,
"e": 754,
"s": 172,
"text": "The full explosion of big data has persuaded us that there is more to it. While it is true, of course, that a large amount of training data allows the machine learning model to learn more rules and generalize better to new data, it is also true that an in... |
C# | Namespaces - GeeksforGeeks | 01 Feb, 2019
Namespaces are used to organize the classes. It helps to control the scope of methods and classes in larger .Net programming projects. In simpler words you can say that it provides a way to keep one set of names(like class names) different from other sets of names. The biggest advantage of using namespace ... | [
{
"code": null,
"e": 23900,
"s": 23872,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24494,
"s": 23900,
"text": "Namespaces are used to organize the classes. It helps to control the scope of methods and classes in larger .Net programming projects. In simpler words you can say... |
How to encode a string in JavaScript? | Javascript has provided escape() function to encode a string. But since the escape()
function is now deprecated, it is better to use encodeURI() or encodeURIComponent().
escape(string);
encodeURIComponent(str);
In the following example, using the escape() method the string "Tutorix is the best e-learning platform!!!" ... | [
{
"code": null,
"e": 1233,
"s": 1062,
"text": "Javascript has provided escape() function to encode a string. But since the escape()\nfunction is now deprecated, it is better to use encodeURI() or encodeURIComponent(). "
},
{
"code": null,
"e": 1249,
"s": 1233,
"text": "escape(str... |
How to get the input from the Tkinter Text Widget? | In tkinter, we can create text widgets using Text attributes using packages. However, while creating a GUI application, sometimes we need to capture the input from a text widget.
We can get the input from the user in a text widget using the .get() method. We need to specify the input range which will be initially from ... | [
{
"code": null,
"e": 1241,
"s": 1062,
"text": "In tkinter, we can create text widgets using Text attributes using packages. However, while creating a GUI application, sometimes we need to capture the input from a text widget."
},
{
"code": null,
"e": 1453,
"s": 1241,
"text": "We ... |
How to divide each column by a particular column in R? | To divide each column by a particular column, we can use division sign (/). For example, if we have a data frame called df that contains three columns say x, y, and z then we can divide all the columns by column z using the command df/df[,3].
Consider the below data frame −
Live Demo
x1<-rpois(20,5)
x2<-rpois(20,5)
x3... | [
{
"code": null,
"e": 1305,
"s": 1062,
"text": "To divide each column by a particular column, we can use division sign (/). For example, if we have a data frame called df that contains three columns say x, y, and z then we can divide all the columns by column z using the command df/df[,3]."
},
{
... |
WebCam Motion Detector program in Python ? | In this we are going to write python program which is going to analyse the images taken from the webcam and try to detect the movement and store the time-interval of the webcam video in a csv file.
We are going to use the OpenCV & pandas library for that. If it’s not already installed, you can install it using pip, wit... | [
{
"code": null,
"e": 1260,
"s": 1062,
"text": "In this we are going to write python program which is going to analyse the images taken from the webcam and try to detect the movement and store the time-interval of the webcam video in a csv file."
},
{
"code": null,
"e": 1400,
"s": 126... |
BigInt in JavaScript | The BigInt is an inbuilt object that is used for representing whole numbers larger than 253 - 1.
Following is the code to implement BigInt in JavaScript −
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document<... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "The BigInt is an inbuilt object that is used for representing whole numbers larger than 253 - 1."
},
{
"code": null,
"e": 1217,
"s": 1159,
"text": "Following is the code to implement BigInt in JavaScript −"
},
{
"code": null,... |
Count the number of objects using Static member function in C++ Program | The goal here is to count the number of objects of a class that are being created using a static member function.
A static data member is shared by all objects of the class commonly. If no value is given, a static data member is always initialized with 0.
A static member function can only use static data members of tha... | [
{
"code": null,
"e": 1176,
"s": 1062,
"text": "The goal here is to count the number of objects of a class that are being created using a static member function."
},
{
"code": null,
"e": 1318,
"s": 1176,
"text": "A static data member is shared by all objects of the class commonly.... |
Find the first repeated word in a string in Java | To find the first repeated word in a string in Java, the code is as follows −
Live Demo
import java.util.*;
public class Demo{
static char repeat_first(char my_str[]){
HashSet<Character> my_hash = new HashSet<>();
for (int i=0; i<=my_str.length-1; i++){
char c = my_str[i];
if (my_hash.... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "To find the first repeated word in a string in Java, the code is as follows −"
},
{
"code": null,
"e": 1151,
"s": 1140,
"text": " Live Demo"
},
{
"code": null,
"e": 1755,
"s": 1151,
"text": "import java.util.*;\np... |
K-Means vs. DBSCAN Clustering — For Beginners | by Ekta Sharma | Towards Data Science | Clustering is grouping of unlabeled data points in such a way that: The data points within the same group are similar to each other, and the data points in different groups are dissimilar to each other.The goal is to create clusters that have high intra-cluster similarity and low inter-cluster similarity.
K-Means clust... | [
{
"code": null,
"e": 479,
"s": 172,
"text": "Clustering is grouping of unlabeled data points in such a way that: The data points within the same group are similar to each other, and the data points in different groups are dissimilar to each other.The goal is to create clusters that have high intra-c... |
Knuth-Morris-Pratt Algorithm | Knuth Morris Pratt (KMP) is an algorithm, which checks the characters from left to right. When a pattern has a sub-pattern appears more than one in the sub-pattern, it uses that property to improve the time complexity, also for in the worst case.
The time complexity of KMP is O(n).
Input:
Main String: “AAAABAAAAABBBAAA... | [
{
"code": null,
"e": 1309,
"s": 1062,
"text": "Knuth Morris Pratt (KMP) is an algorithm, which checks the characters from left to right. When a pattern has a sub-pattern appears more than one in the sub-pattern, it uses that property to improve the time complexity, also for in the worst case."
},
... |
PHP - Date & Time | Dates are so much part of everyday life that it becomes easy to work with them without thinking. PHP also provides powerful tools for date arithmetic that make manipulating dates easy.
PHP's time() function gives you all the information that you need about the current date and time. It requires no arguments but returns... | [
{
"code": null,
"e": 2942,
"s": 2757,
"text": "Dates are so much part of everyday life that it becomes easy to work with them without thinking. PHP also provides powerful tools for date arithmetic that make manipulating dates easy."
},
{
"code": null,
"e": 3090,
"s": 2942,
"text"... |
Bootstrap .modal("toggle") method | Use the .modal(“toggle”) method in Bootstrap to toggle the modal.
As shown below, the modal generates on the click of a button −
$(document).ready(function(){
$("#button1").click(function(){
$("#newModal").modal("toggle");
});
});
Here is the button used above −
<button type="button" class="btn btn-default btn-... | [
{
"code": null,
"e": 1128,
"s": 1062,
"text": "Use the .modal(“toggle”) method in Bootstrap to toggle the modal."
},
{
"code": null,
"e": 1191,
"s": 1128,
"text": "As shown below, the modal generates on the click of a button −"
},
{
"code": null,
"e": 1301,
"s": 1... |
Angular Material 7 - Toggle Button | The <mat-button-toggle>, an Angular Directive, is used to create a toggle or on/off button with material styling and animations. mat-button-toggle buttons can be configured to behave as radio buttons or checkboxes. Typically they are part of <mat-button-toggle-group>.
In this chapter, we will showcase the configuration... | [
{
"code": null,
"e": 3024,
"s": 2755,
"text": "The <mat-button-toggle>, an Angular Directive, is used to create a toggle or on/off button with material styling and animations. mat-button-toggle buttons can be configured to behave as radio buttons or checkboxes. Typically they are part of <mat-button... |
Python Pandas – How to skip initial space from a DataFrame | To skip initial space from a Pandas DataFrame, use the skipinitialspace parameter of the read_csv() method. Set the parameter to True to remove extra space.
Let’s say the following is our csv file −
We should get the following output i.e. skipping initial whitespace and displaying the DataFrame from the CSV −
Following... | [
{
"code": null,
"e": 1219,
"s": 1062,
"text": "To skip initial space from a Pandas DataFrame, use the skipinitialspace parameter of the read_csv() method. Set the parameter to True to remove extra space."
},
{
"code": null,
"e": 1261,
"s": 1219,
"text": "Let’s say the following i... |
JavaScript TypeError - Cyclic object value - GeeksforGeeks | 23 Aug, 2020
This JavaScript exception cyclic object value occurs if the references of objects were found in JSON. JSON.stringify() fails to solve them.
Message:
TypeError: cyclic object value (Firefox)
TypeError: Converting circular structure to JSON
(Chrome and Opera)
TypeError: Circular reference in valu... | [
{
"code": null,
"e": 24909,
"s": 24881,
"text": "\n23 Aug, 2020"
},
{
"code": null,
"e": 25049,
"s": 24909,
"text": "This JavaScript exception cyclic object value occurs if the references of objects were found in JSON. JSON.stringify() fails to solve them."
},
{
"code": n... |
2D and 2.5D Memory organization - GeeksforGeeks | 24 Jan, 2022
The internal structure of Memory either RAM or ROM is made up of memory cells that contain a memory bit. A group of 8 bits makes a byte. The memory is in the form of a multidimensional array of rows and columns. In which, each cell stores a bit and a complete row contains a word. A memory simply can be div... | [
{
"code": null,
"e": 27384,
"s": 27356,
"text": "\n24 Jan, 2022"
},
{
"code": null,
"e": 27720,
"s": 27384,
"text": "The internal structure of Memory either RAM or ROM is made up of memory cells that contain a memory bit. A group of 8 bits makes a byte. The memory is in the form ... |
Running Apache Kafka on Windows 10 | by Bibhash Biswas | Towards Data Science | Kafka’s growth is exploding. More than one-third of all Fortune 500 companies use Kafka. These companies include the top travel companies, banks, eight of the top ten insurance companies, nine of the top ten telecom companies, and much more. LinkedIn, Microsoft, and Netflix process four-comma messages a day with Kafka ... | [
{
"code": null,
"e": 513,
"s": 172,
"text": "Kafka’s growth is exploding. More than one-third of all Fortune 500 companies use Kafka. These companies include the top travel companies, banks, eight of the top ten insurance companies, nine of the top ten telecom companies, and much more. LinkedIn, Mic... |
Element Type Selector in CSS | The CSS element type selector is used to select all elements of a type. The syntax for CSS element type selector is as follows
element {
/*declarations*/
}
The following examples illustrate CSS element type selector
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
li {
list-style: none;
margin: 5px;
border-... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "The CSS element type selector is used to select all elements of a type. The syntax for CSS element type selector is as follows"
},
{
"code": null,
"e": 1221,
"s": 1189,
"text": "element {\n /*declarations*/\n}"
},
{
"code":... |
Can we iteratively import python modules inside a for loop? | Yes you can iteratively import python modules inside a for loop. You need to have a list of modules you want to import as strings. You can use the inbuilt importlib.import_module(module_name) to import the modules. For example,
>>> import importlib
>>> modnames = ["os", "sys", "math"]
>>> for lib in modnames:
... g... | [
{
"code": null,
"e": 1290,
"s": 1062,
"text": "Yes you can iteratively import python modules inside a for loop. You need to have a list of modules you want to import as strings. You can use the inbuilt importlib.import_module(module_name) to import the modules. For example,"
},
{
"code": nul... |
AWT ActionEvent Class | This class is defined in java.awt.event package. The ActionEvent is generated when button is clicked or the item of a list is double clicked.
Following is the declaration for java.awt.event.ActionEvent class:
public class ActionEvent
extends AWTEvent
Following are the fields for java.awt.event.ActionEvent class:
sta... | [
{
"code": null,
"e": 1889,
"s": 1747,
"text": "This class is defined in java.awt.event package. The ActionEvent is generated when button is clicked or the item of a list is double clicked."
},
{
"code": null,
"e": 1956,
"s": 1889,
"text": "Following is the declaration for java.aw... |
Python program to replace every Nth character in String - GeeksforGeeks | 21 Apr, 2021
Given a string, the task is to write a Python program to replace every Nth character in a string by the given value K.
Examples:
Input : test_str = “geeksforgeeks is best for all geeks”, K = ‘$’, N = 5
Output : geeks$orge$ks i$ bes$ for$all $eeks
Explanation : Every 5th character is converted to $.
Input :... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 24411,
"s": 24292,
"text": "Given a string, the task is to write a Python program to replace every Nth character in a string by the given value K."
},
{
"code": null,
"e": 24421,
... |
How to create a Titleless and Borderless JFrame in Java? | To create a Titleless and Borderless JFrame, use the setUndecorated() method and set it to TRUE −
JFrame frame = new JFrame("Register!");
frame.setUndecorated(true);
The following is an example to create a titleless and borderless JFrame −
package my;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "To create a Titleless and Borderless JFrame, use the setUndecorated() method and set it to TRUE −"
},
{
"code": null,
"e": 1228,
"s": 1160,
"text": "JFrame frame = new JFrame(\"Register!\");\nframe.setUndecorated(true);"
},
{
... |
Execute both if and else statements simultaneously in C/C++ | In this section we will see how to execute the if and else section simultaneously in a C or C++ code. This solution is little bit tricky.
When the if and else are executed one after another then it is like executing statements where if-else are not present. But here we will see if they are present how to execute them o... | [
{
"code": null,
"e": 1200,
"s": 1062,
"text": "In this section we will see how to execute the if and else section simultaneously in a C or C++ code. This solution is little bit tricky."
},
{
"code": null,
"e": 1400,
"s": 1200,
"text": "When the if and else are executed one after ... |
How to set the border color of the dots in matplotlib's scatterplots? | To set the border color of the dots in matplotlib scatterplots, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Initialize a variable "N" to store the number of sample data.
Create x and y data points using numpy.
Plot the x and y data points using scatter()... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "To set the border color of the dots in matplotlib scatterplots, we can take the following steps −"
},
{
"code": null,
"e": 1236,
"s": 1160,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
... |
Creating word clouds with python. During a recent NLP project, I... | by Kerry Parker | Towards Data Science | During a recent NLP project, I came across an article where word clouds were created in the shape of US Presidents using words from their inauguration speeches. Whilst I had used word clouds to visualise the most frequent words in a document, I’d not considered using this with a mask to represent the topic or subject. ... | [
{
"code": null,
"e": 516,
"s": 172,
"text": "During a recent NLP project, I came across an article where word clouds were created in the shape of US Presidents using words from their inauguration speeches. Whilst I had used word clouds to visualise the most frequent words in a document, I’d not cons... |
Python - Character repetition string combinations - GeeksforGeeks | 27 Mar, 2021
Given a string list and list of numbers, the task is to write a Python program to generate all possible strings by repeating each character of each string by each number in the list.
Input : test_list = [“gfg”, “is”, “best”], rep_list = [3, 5, 2]
Output : [‘gggfffggg’, ‘iiisss’, ‘bbbeeesssttt’, ‘gggggfffff... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n27 Mar, 2021"
},
{
"code": null,
"e": 24475,
"s": 24292,
"text": "Given a string list and list of numbers, the task is to write a Python program to generate all possible strings by repeating each character of each string by each ... |
HTML | <meta> charset Attribute - GeeksforGeeks | 29 Jan, 2020
The HTML charset Attribute is used to specify the character encoding for the HTML document. The charset attribute could be overridden by using the lang attribute of any element.
Syntax:
<meta charset="character_set">
Attribute Values: It contains the value i.e character_set which specify the character enco... | [
{
"code": null,
"e": 25170,
"s": 25142,
"text": "\n29 Jan, 2020"
},
{
"code": null,
"e": 25348,
"s": 25170,
"text": "The HTML charset Attribute is used to specify the character encoding for the HTML document. The charset attribute could be overridden by using the lang attribute o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.