title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
puts() vs printf() for printing a string in C language | The function puts() and printf() are declared in stdio.h header file and are used to send the text to the output stream. Both have different usages and syntax.
The function puts() is used to print the string on the output stream with the additional new line character ‘\n’. It moves the cursor to the next line. Implemen... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "The function puts() and printf() are declared in stdio.h header file and are used to send the text to the output stream. Both have different usages and syntax."
},
{
"code": null,
"e": 1424,
"s": 1222,
"text": "The function puts() is... |
Matplotlib - Axes Class | Axes object is the region of the image with the data space. A given figure can contain many Axes, but a given Axes object can only be in one Figure. The Axes contains two (or three in the case of 3D) Axis objects. The Axes class and its member functions are the primary entry point to working with the OO interface.
Axes... | [
{
"code": null,
"e": 2832,
"s": 2516,
"text": "Axes object is the region of the image with the data space. A given figure can contain many Axes, but a given Axes object can only be in one Figure. The Axes contains two (or three in the case of 3D) Axis objects. The Axes class and its member functions... |
Objective-C Strings | The string in Objective-C programming language is represented using NSString and its subclass NSMutableString provides several ways for creating string objects. The simplest way to create a string object is to use the Objective-C @"..." construct −
NSString *greeting = @"Hello";
A simple example for creating and print... | [
{
"code": null,
"e": 2810,
"s": 2560,
"text": "The string in Objective-C programming language is represented using NSString and its subclass NSMutableString provides several ways for creating string objects. The simplest way to create a string object is to use the Objective-C @\"...\" construct −"
... |
How to use Cookies in CGI in Perl? | HTTP protocol is a stateless protocol. But for a commercial website it is required to maintain session information among different pages. For example one user registration ends after transactions which spans through many pages. But how to maintain user's session information across all the web pages?
In many situations,... | [
{
"code": null,
"e": 1363,
"s": 1062,
"text": "HTTP protocol is a stateless protocol. But for a commercial website it is required to maintain session information among different pages. For example one user registration ends after transactions which spans through many pages. But how to maintain user'... |
How to add Social Share Buttons in NextJS ? - GeeksforGeeks | 29 Oct, 2021
In this article, we are going to learn how we can add Social Share buttons in NextJs. Using the social share button user can share your content in different social media sites.
NextJS is a React-based framework. It has the power to Develop beautiful Web applications for different platforms like Windows, Li... | [
{
"code": null,
"e": 25312,
"s": 25284,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 25489,
"s": 25312,
"text": "In this article, we are going to learn how we can add Social Share buttons in NextJs. Using the social share button user can share your content in different social... |
Algorithmic Beauty: An Introduction to Cellular Automata | by Evan Kozliner | Towards Data Science | If you’re interested in the philosophical implications of cellular automata, check out my post here.
Cellular Automata (CA) are simultaneously one of the simplest and most fascinating ideas I’ve ever encountered. In this post I’ll go over some famous CAs and their properties, focusing on the “elementary” cellular autom... | [
{
"code": null,
"e": 273,
"s": 172,
"text": "If you’re interested in the philosophical implications of cellular automata, check out my post here."
},
{
"code": null,
"e": 645,
"s": 273,
"text": "Cellular Automata (CA) are simultaneously one of the simplest and most fascinating id... |
MIDI Music Data Extraction using Music21 and Word2Vec on Kaggle | by Waldecir Faria | Towards Data Science | Kaggle is a community site for data scientists and machine learners which offers several features to support their work and research. One of those feature is an online editor of scripts and notebooks which are called of “Kernel” by them. Users can create and edit Kernels online to share knowledge about some topic like ... | [
{
"code": null,
"e": 547,
"s": 172,
"text": "Kaggle is a community site for data scientists and machine learners which offers several features to support their work and research. One of those feature is an online editor of scripts and notebooks which are called of “Kernel” by them. Users can create ... |
5 Hidden Python Libraries For Cyber Security | by Pranjal Saxena | Towards Data Science | Python is now one of the most popular and fastest-growing programming languages. Its utility has been demonstrated in the fields of artificial intelligence and business analytics. Building cybersecurity solutions is yet another important application of technology.
Python has some amazing libraries that can be utilised ... | [
{
"code": null,
"e": 437,
"s": 172,
"text": "Python is now one of the most popular and fastest-growing programming languages. Its utility has been demonstrated in the fields of artificial intelligence and business analytics. Building cybersecurity solutions is yet another important application of te... |
Convert Long Values into Byte Using Explicit Casting in Java - GeeksforGeeks | 29 Oct, 2020
In Java, a byte can contain only values from -128 to 127, if we try to cast a long value above or below the limits of the byte then there will be a precision loss.
1. byte: The byte data type is an 8-bit signed two’s complement integer.
Syntax:
byte varName; // Default value 0
Values:
1 byte (8 bits) :
-... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n29 Oct, 2020"
},
{
"code": null,
"e": 23721,
"s": 23557,
"text": "In Java, a byte can contain only values from -128 to 127, if we try to cast a long value above or below the limits of the byte then there will be a precision loss.... |
Puppet - RESTful API | Puppet uses RESTful API’s as the communication channel between both Puppet master and Puppet agents. Following is the basic URL to access this RESTful API.
https://brcleprod001:8140/{environment}/{resource}/{key}
https://brcleprod001:8139/{environment}/{resource}/{key}
Puppet usually takes care of security and SSL ce... | [
{
"code": null,
"e": 2329,
"s": 2173,
"text": "Puppet uses RESTful API’s as the communication channel between both Puppet master and Puppet agents. Following is the basic URL to access this RESTful API."
},
{
"code": null,
"e": 2445,
"s": 2329,
"text": "https://brcleprod001:8140/... |
Tryit Editor v3.7 | Tryit: HTML article element | [] |
How to print a formatted text using printf() method in Java?
| The printf() method allows us to format output to a java.io.PrintStream or java.io.PrintWriter. These classes also contain a method called format() which can produce the same results, so whatever we read here for the printf() method can also be applied to the format() method.
System.out.printf(“format-string” [, arg1, ... | [
{
"code": null,
"e": 1339,
"s": 1062,
"text": "The printf() method allows us to format output to a java.io.PrintStream or java.io.PrintWriter. These classes also contain a method called format() which can produce the same results, so whatever we read here for the printf() method can also be applied ... |
C library function - sin() | The C library function double sin(double x) returns the sine of a radian angle x.
Following is the declaration for sin() function.
double sin(double x)
x − This is the floating point value representing an angle expressed in radians.
x − This is the floating point value representing an angle expressed in radians.
This f... | [
{
"code": null,
"e": 2089,
"s": 2007,
"text": "The C library function double sin(double x) returns the sine of a radian angle x."
},
{
"code": null,
"e": 2138,
"s": 2089,
"text": "Following is the declaration for sin() function."
},
{
"code": null,
"e": 2159,
"s":... |
Hadoop with GCP Dataproc. An introduction to Hadoop, its services... | by Varuni Punchihewa | Towards Data Science | Today, big data analytics is one of the most rapidly growing fields in the world because of the vast amount of benefits one can gain through it. With its tremendous growth and tons of benefits, also comes its own set of issues. One of the major issues in storing big data is, you need a large space to store thousands of... | [
{
"code": null,
"e": 729,
"s": 172,
"text": "Today, big data analytics is one of the most rapidly growing fields in the world because of the vast amount of benefits one can gain through it. With its tremendous growth and tons of benefits, also comes its own set of issues. One of the major issues in ... |
Assembly - Recursion | A recursive procedure is one that calls itself. There are two kind of recursion: direct and indirect. In direct recursion, the procedure calls itself and in indirect recursion, the first procedure calls a second procedure, which in turn calls the first procedure.
Recursion could be observed in numerous mathematical alg... | [
{
"code": null,
"e": 2349,
"s": 2085,
"text": "A recursive procedure is one that calls itself. There are two kind of recursion: direct and indirect. In direct recursion, the procedure calls itself and in indirect recursion, the first procedure calls a second procedure, which in turn calls the first ... |
How to remove an item from a C# list by using an index? | To remove an item from a list in C# using index, use the RemoveAt() method.
Firstly, set the list −
List<string> list1 = new List<string>() {
"Hanks",
"Lawrence",
"Beckham",
"Cooper",
};
Now remove the element at 2nd position i.e. index 1
list1.RemoveAt(1);
Let us see the complete example −
Live Demo
using... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "To remove an item from a list in C# using index, use the RemoveAt() method."
},
{
"code": null,
"e": 1162,
"s": 1138,
"text": "Firstly, set the list −"
},
{
"code": null,
"e": 1261,
"s": 1162,
"text": "List<string... |
Create a selectable list in HTML | Use the <select> tag to create a selectable list. The HTML <select> tag is used within a form for defining a select list.
The HTML <select> tag also supports the following additional attributes −
You can try to run the following code to create a selectable list in HTML −
<!DOCTYPE html>
<html>
<head>
<title>HT... | [
{
"code": null,
"e": 1184,
"s": 1062,
"text": "Use the <select> tag to create a selectable list. The HTML <select> tag is used within a form for defining a select list."
},
{
"code": null,
"e": 1258,
"s": 1184,
"text": "The HTML <select> tag also supports the following additional... |
OpenCV Python Program to blur an image? | OpenCV is one of the best python package for image processing. Also like signals carry noise attached to it, images too contain different types of noise mainly from the source itself (Camera sensor). Python OpenCV package provides ways for image smoothing also called blurring. This is what we are going to do in this se... | [
{
"code": null,
"e": 1553,
"s": 1062,
"text": "OpenCV is one of the best python package for image processing. Also like signals carry noise attached to it, images too contain different types of noise mainly from the source itself (Camera sensor). Python OpenCV package provides ways for image smoothi... |
Object Detection with Python & YOLO | by Mauro Di Pietro | Towards Data Science | In this article, I will show how to play with computer vision and have a lot of fun with a few lines of code.
Computer vision is the field of Artificial Intelligence that studies how computers can gain high-level understanding from digital images or videos in order to produce numerical or symbolic information.
The main... | [
{
"code": null,
"e": 282,
"s": 172,
"text": "In this article, I will show how to play with computer vision and have a lot of fun with a few lines of code."
},
{
"code": null,
"e": 484,
"s": 282,
"text": "Computer vision is the field of Artificial Intelligence that studies how com... |
Minimum number with digits as 4 and 7 only and given sum - GeeksforGeeks | 14 Mar, 2022
Lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. What minimum lucky number has the sum of digits equal to n.
Examples:
Input : sum = 11
Output : 47
Sum of digits in 47 is 11 and 47
is the smallest number with given sum.
Input : sum = 10
Output... | [
{
"code": null,
"e": 23903,
"s": 23875,
"text": "\n14 Mar, 2022"
},
{
"code": null,
"e": 24073,
"s": 23903,
"text": "Lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. What minimum lucky number has the sum of digits equal ... |
Python - Test if Values Sum is Greater than Keys Sum in dictionary - GeeksforGeeks | 12 Nov, 2020
Given a Dictionary, check if the summation of values is greater than Keys sum.
Input : test_dict = {5:3, 1:3, 10:4, 7:3, 8:1, 9:5} Output : False Explanation : Values sum = 19 < 40, which is key sum, i.e false.
Input : test_dict = {5:3, 1:4} Output : True Explanation : Values sum = 7 > 6, which is key sum,... | [
{
"code": null,
"e": 24390,
"s": 24362,
"text": "\n12 Nov, 2020"
},
{
"code": null,
"e": 24469,
"s": 24390,
"text": "Given a Dictionary, check if the summation of values is greater than Keys sum."
},
{
"code": null,
"e": 24601,
"s": 24469,
"text": "Input : tes... |
Food & Beverage Services - Food Garnishing | The guests’ experience of food and beverage starts when the serving staff brings beautifully garnished food with the appropriate accompaniments on their table. The service staff turns a guiding hand to the guests in suggesting which accompaniment will go well with the main food the guest is interested in having.
There ... | [
{
"code": null,
"e": 2618,
"s": 2304,
"text": "The guests’ experience of food and beverage starts when the serving staff brings beautifully garnished food with the appropriate accompaniments on their table. The service staff turns a guiding hand to the guests in suggesting which accompaniment will g... |
Move all occurrences of an element to end in a linked list - GeeksforGeeks | 10 Mar, 2022
Given a linked list and a key in it, the task is to move all occurrences of the given key to the end of the linked list, keeping the order of all other elements the same.
Examples:
Input : 1 -> 2 -> 2 -> 4 -> 3
key = 2
Output : 1 -> 4 -> 3 -> 2 -> 2
Input : 6 -> 6 -> 7 -> 6 -> 3 -> 10
... | [
{
"code": null,
"e": 24678,
"s": 24650,
"text": "\n10 Mar, 2022"
},
{
"code": null,
"e": 24849,
"s": 24678,
"text": "Given a linked list and a key in it, the task is to move all occurrences of the given key to the end of the linked list, keeping the order of all other elements th... |
Generate Pythagorean Triplets - GeeksforGeeks | 09 Feb, 2022
A Pythagorean triplet is a set of three positive integers a, b and c such that a2 + b2 = c2. Given a limit, generate all Pythagorean Triples with values smaller than given limit.
Input : limit = 20
Output : 3 4 5
8 6 10
5 12 13
15 8 17
12 16 20
A Simple Solution is to ge... | [
{
"code": null,
"e": 25120,
"s": 25092,
"text": "\n09 Feb, 2022"
},
{
"code": null,
"e": 25299,
"s": 25120,
"text": "A Pythagorean triplet is a set of three positive integers a, b and c such that a2 + b2 = c2. Given a limit, generate all Pythagorean Triples with values smaller th... |
Check if a Palindromic String can be formed by concatenating Substrings of two given Strings - GeeksforGeeks | 07 Jun, 2021
Given two strings str1 and str2, the task is to check if it is possible to form a Palindromic String by concatenation of two substrings of str1 and str2.
Examples:
Input: str1 = “abcd”, str2 = “acba”Output: YesExplanation:There are five possible cases where concatenation of two substrings from str1 and str... | [
{
"code": null,
"e": 25198,
"s": 25170,
"text": "\n07 Jun, 2021"
},
{
"code": null,
"e": 25352,
"s": 25198,
"text": "Given two strings str1 and str2, the task is to check if it is possible to form a Palindromic String by concatenation of two substrings of str1 and str2."
},
{... |
Which PHP function is used to establish MySQL database connection using PHP script? | PHP provides mysql_connect() function to open a database connection. This function takes five parameters and returns a MySQL link identifier on success or FALSE on failure. Its syntax is as follows −
connection mysql_connect(server,user,passwd,new_link,client_flag);
Following table give us the parameters used in the sy... | [
{
"code": null,
"e": 1262,
"s": 1062,
"text": "PHP provides mysql_connect() function to open a database connection. This function takes five parameters and returns a MySQL link identifier on success or FALSE on failure. Its syntax is as follows −"
},
{
"code": null,
"e": 1329,
"s": 1... |
Java Examples - Array to Collection | How to convert an array into a collection ?
Following example demonstrates to convert an array into a collection Arrays.asList(name) method of Java Util class.
import java.util.*;
import java.io.*;
public class ArrayToCollection{
public static void main(String args[]) throws IOException {
BufferedReader in = ... | [
{
"code": null,
"e": 2112,
"s": 2068,
"text": "How to convert an array into a collection ?"
},
{
"code": null,
"e": 2228,
"s": 2112,
"text": "Following example demonstrates to convert an array into a collection Arrays.asList(name) method of Java Util class."
},
{
"code": ... |
Ngx-Bootstrap - Quick Guide | The ngx-bootstrap is a very popular library to use bootstrap components in Angular Based projects. It contains almost all core components of Bootstrap. ngx-bootstrap components are by design modular,extensible and adaptable. Following are the key highlighting points of this bootstrap library.
All components are modular... | [
{
"code": null,
"e": 2394,
"s": 2100,
"text": "The ngx-bootstrap is a very popular library to use bootstrap components in Angular Based projects. It contains almost all core components of Bootstrap. ngx-bootstrap components are by design modular,extensible and adaptable. Following are the key highli... |
Trading Strategy: Technical Analysis with Python TA-Lib | by J Li | Towards Data Science | (This post is also available in my blog)
In finance, a trading strategy is a fixed plan that is designed to achieve a profitable return by going long or short in markets. The main reasons that a properly researched trading strategy helps are its verifiability, quantifiability, consistency, and objectivity.
For every tr... | [
{
"code": null,
"e": 213,
"s": 172,
"text": "(This post is also available in my blog)"
},
{
"code": null,
"e": 480,
"s": 213,
"text": "In finance, a trading strategy is a fixed plan that is designed to achieve a profitable return by going long or short in markets. The main reason... |
Getting an enumerator that iterates through LinkedList in C# | To get an enumerator that iterates through LinkedList, the code is as follows −
Live Demo
using System;
using System.Collections.Generic;
public class Demo {
public static void Main(){
LinkedList<string> list = new LinkedList<string>();
list.AddLast("A");
list.AddLast("B");
list.AddLast("C")... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "To get an enumerator that iterates through LinkedList, the code is as follows −"
},
{
"code": null,
"e": 1153,
"s": 1142,
"text": " Live Demo"
},
{
"code": null,
"e": 1907,
"s": 1153,
"text": "using System;\nusing... |
How to round the decimal number to the nearest tenth in JavaScript? | To round the decimal number to the nearest tenth, use toFixed(1) in JavaScript. The syntax is
as follows −
var anyVaribleName=yourVariableName.toFixed(1)
Let’s say the following is our decimal number −
var decimalValue =200.432144444555;
console.log("Actual value="+decimalValue)
Let’s now round the decimal number. Foll... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "To round the decimal number to the nearest tenth, use toFixed(1) in JavaScript. The syntax is\nas follows −"
},
{
"code": null,
"e": 1216,
"s": 1169,
"text": "var anyVaribleName=yourVariableName.toFixed(1)"
},
{
"code": null,... |
Calculate the mean across dimension in a 2D NumPy array - GeeksforGeeks | 29 Aug, 2020
We can find out the mean of each row and column of 2d array using numpy with the function np.mean(). Here we have to provide the axis for finding mean.
Syntax: numpy.mean(arr, axis = None)
For Row mean: axis=1
For Column mean: axis=0
Example:
Python3
# Importing Libraryimport numpy as np # creating 2d arr... | [
{
"code": null,
"e": 24230,
"s": 24202,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 24382,
"s": 24230,
"text": "We can find out the mean of each row and column of 2d array using numpy with the function np.mean(). Here we have to provide the axis for finding mean."
},
{
... |
Smallest String With Swaps in C++ | Suppose we have given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string. We can swap the characters at any pair of indices in the given pairs any number of times as we want. We have to find the lexicographically smallest string that s c... | [
{
"code": null,
"e": 1594,
"s": 1062,
"text": "Suppose we have given a string s, and an array of pairs of indices in the string pairs where pairs[i] = [a, b] indicates 2 indices(0-indexed) of the string. We can swap the characters at any pair of indices in the given pairs any number of times as we w... |
Deploying Streamlit Apps to GCP. Streamlit is a minimal, modern data... | by Mark Douthwaite | Towards Data Science | If you’re familiar with the Data Science software ecosystem in Python, you’ll likely have come across a handful of widely used dashboarding and data visualization tools designed for programmatic usage (e.g. to be embedded in notebooks or to be served as standalone web-apps). For the last few years, the likes of Dash, B... | [
{
"code": null,
"e": 665,
"s": 172,
"text": "If you’re familiar with the Data Science software ecosystem in Python, you’ll likely have come across a handful of widely used dashboarding and data visualization tools designed for programmatic usage (e.g. to be embedded in notebooks or to be served as s... |
Kubeflow: An MLOps Perspective. ML Pipelines and ML Components | by Alex Punnen | Towards Data Science | When designing new technologies, almost always choices are made that would sacrifice some characteristic for some others. And it is important to understand those choices and how they may or may not affect your use case. Usually, such a study is never done when technology or framework is chosen over others; or sometimes... | [
{
"code": null,
"e": 512,
"s": 171,
"text": "When designing new technologies, almost always choices are made that would sacrifice some characteristic for some others. And it is important to understand those choices and how they may or may not affect your use case. Usually, such a study is never done... |
C++ Program to Perform Addition Operation Using Bitwise Operators | Bitwise operators are used to perform bitwise operations. That implies the manipulation of bits. Some of the bitwise operators are bitwise AND, bitwise OR, bitwise XOR etc.
A program to perform addition operation using bitwise operators is given below −
Live Demo
#include<iostream>
using namespace std;
int main() {
... | [
{
"code": null,
"e": 1235,
"s": 1062,
"text": "Bitwise operators are used to perform bitwise operations. That implies the manipulation of bits. Some of the bitwise operators are bitwise AND, bitwise OR, bitwise XOR etc."
},
{
"code": null,
"e": 1316,
"s": 1235,
"text": "A program... |
Docker for Python Development?. Experimenting, Developing and Deploying... | by Chinmay Shah | Towards Data Science | Part 1 covered what is docker.
In this article, we’ll be talking about how to start using Docker for python development.
A standard python installation involves setting up environment variables and if you’re dealing with different versions of python, there are tons of environment variables to be dealt with be it Window... | [
{
"code": null,
"e": 203,
"s": 172,
"text": "Part 1 covered what is docker."
},
{
"code": null,
"e": 293,
"s": 203,
"text": "In this article, we’ll be talking about how to start using Docker for python development."
},
{
"code": null,
"e": 504,
"s": 293,
"text... |
Kth Largest Element in a Stream in Python | Suppose we want to design a class to find the kth largest element in a stream. It is the kth largest element in the sorted order, not the kth distinct element.
The KthLargest class will have a constructor which accepts an integer k and an array nums, that will contain initial elements from the stream. For each call to ... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "Suppose we want to design a class to find the kth largest element in a stream. It is the kth largest element in the sorted order, not the kth distinct element."
},
{
"code": null,
"e": 1485,
"s": 1222,
"text": "The KthLargest class w... |
C++ Queue Library - front() Function | The C++ function std::queue::front() returns a reference to the first element of the queue. This element will be removed after performing pop operation on queue.
This member function effectively calls the front member function of underlying container.
Following is the declaration for std::queue::front() function form ... | [
{
"code": null,
"e": 2766,
"s": 2603,
"text": "The C++ function std::queue::front() returns a reference to the first element of the queue. This element will be removed after performing pop operation on queue."
},
{
"code": null,
"e": 2856,
"s": 2766,
"text": "This member functio... |
How to write a jQuery selector to find links with # in href attribute? | You can try to run the following code to write a jQuery selector to find links with # in href. Here,^ is used to find links starting with # in href.
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": 1211,
"s": 1062,
"text": "You can try to run the following code to write a jQuery selector to find links with # in href. Here,^ is used to find links starting with # in href."
},
{
"code": null,
"e": 1221,
"s": 1211,
"text": "Live Demo"
},
{
"code": n... |
Entity Framework - Lifecycle | The lifetime of a context begins when the instance is created and ends when the instance is either disposed or garbage-collected.
Context lifetime is a very crucial decision to make when we use ORMs.
Context lifetime is a very crucial decision to make when we use ORMs.
The context is performing like an entity cache, so... | [
{
"code": null,
"e": 3162,
"s": 3032,
"text": "The lifetime of a context begins when the instance is created and ends when the instance is either disposed or garbage-collected."
},
{
"code": null,
"e": 3232,
"s": 3162,
"text": "Context lifetime is a very crucial decision to make ... |
C# String Concat with examples | To concat strings in C#, use the String.Concat() method.
public static string Concat (string str1, string str2);
Above, the parameters str1 and str2 are the strings to be concatenated.
Live Demo
using System;
public class Demo {
public static void Main(String[] args) {
string str1 = "Jack";
string str2 ... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "To concat strings in C#, use the String.Concat() method."
},
{
"code": null,
"e": 1175,
"s": 1119,
"text": "public static string Concat (string str1, string str2);"
},
{
"code": null,
"e": 1247,
"s": 1175,
"text":... |
Perl - References | A Perl reference is a scalar data type that holds the location of another value which could be scalar, arrays, or hashes. Because of its scalar nature, a reference can be used anywhere, a scalar can be used.
You can construct lists containing references to other lists, which can contain references to hashes, and so on.... | [
{
"code": null,
"e": 2428,
"s": 2220,
"text": "A Perl reference is a scalar data type that holds the location of another value which could be scalar, arrays, or hashes. Because of its scalar nature, a reference can be used anywhere, a scalar can be used."
},
{
"code": null,
"e": 2599,
... |
Setting Up Data Pipelines Using Apache Airflow on Kubernetes | by Joshua Yeung | Towards Data Science | Apache Airflow is an open-source workflow orchestration tool for scheduling and monitoring data pipelines. It can be also used for machine learning workflows and other purposes. Kubernetes is a de facto orchestration tool for scheduling containerized applications. Airflow can utilize the ability provided by Kubernetes ... | [
{
"code": null,
"e": 547,
"s": 172,
"text": "Apache Airflow is an open-source workflow orchestration tool for scheduling and monitoring data pipelines. It can be also used for machine learning workflows and other purposes. Kubernetes is a de facto orchestration tool for scheduling containerized appl... |
How to create a JSON using Jackson Tree Model in Java? | In the Jackson library, we can use the Tree Model to represent the JSON structure and perform the CRUD operations via JsonNode. This Jackson Tree Model is useful, especially in cases where a JSON structure does not map to Java classes. We can create a JSON in the Jackson library using the JsonNodeFactory, it can specif... | [
{
"code": null,
"e": 1566,
"s": 1062,
"text": "In the Jackson library, we can use the Tree Model to represent the JSON structure and perform the CRUD operations via JsonNode. This Jackson Tree Model is useful, especially in cases where a JSON structure does not map to Java classes. We can create a J... |
Renaming column name in a MongoDB collection? | To rename column name in a collection, you can use $rename operator. Following is the syntax
db.yourCollectionName.update({}, {$rename: {'yourOldColumName': 'yourNewColumnName'}}, false, true);
Let us first create a collection with documents:
> db.renamingColumnNameDemo.insertOne({"StudentName":"Larry","Age":23});
{
... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "To rename column name in a collection, you can use $rename operator. Following is the syntax"
},
{
"code": null,
"e": 1256,
"s": 1155,
"text": "db.yourCollectionName.update({}, {$rename: {'yourOldColumName': 'yourNewColumnName'}}, fa... |
Angular CLI - ng new Command | This chapter explains the syntax, argument and options of ng new command along with an example.
The syntax for ng new command is as follows −
ng new <name> [options]
ng n <name> [options]
ng new command creates a workspace of given name with a default Angular Application.
It provides interactive prompts to set optiona... | [
{
"code": null,
"e": 2171,
"s": 2075,
"text": "This chapter explains the syntax, argument and options of ng new command along with an example."
},
{
"code": null,
"e": 2217,
"s": 2171,
"text": "The syntax for ng new command is as follows −"
},
{
"code": null,
"e": 226... |
60 Questions to Test Your Knowledge of Python Lists | by GreekDataGuy | Towards Data Science | I’ve been doing a lot of algorithm questions lately and discovered I don’t understand lists as well as I should
This is my compilation of 60 list questions I’ve written to evaluate my own knowledge.
I hope you’ll find it as useful as writing it has been for me.
The in operator will return True if a specific element is ... | [
{
"code": null,
"e": 284,
"s": 172,
"text": "I’ve been doing a lot of algorithm questions lately and discovered I don’t understand lists as well as I should"
},
{
"code": null,
"e": 371,
"s": 284,
"text": "This is my compilation of 60 list questions I’ve written to evaluate my ow... |
Get MongoDB Databases in a JavaScript Array? | To get MongoDB databases in a JavaScript array, you can use runCommand(). Following is the query to get MongoDB databases in a JavaScript array
> use admin;
switched to db admin
> allDatabasesDetails = db.runCommand({listDatabases: 1});
This will produce the following output
{
"databases" : [
{
"name"... | [
{
"code": null,
"e": 1206,
"s": 1062,
"text": "To get MongoDB databases in a JavaScript array, you can use runCommand(). Following is the query to get MongoDB databases in a JavaScript array"
},
{
"code": null,
"e": 1299,
"s": 1206,
"text": "> use admin;\nswitched to db admin\n> ... |
PyQt5 QSpinBox - How to get the font of spin box - GeeksforGeeks | 19 May, 2020
In this article we will see how we can get the font of all the text present in the spin box, in order to set the font use setFont method which takes QFont object as argument, using it with the spin box object will change the font of all the text.
In order to get the font we use font method
Syntax : spin_bo... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n19 May, 2020"
},
{
"code": null,
"e": 24148,
"s": 23901,
"text": "In this article we will see how we can get the font of all the text present in the spin box, in order to set the font use setFont method which takes QFont object a... |
Shell Program to Find the Position of Substring in Given String - GeeksforGeeks | 29 Dec, 2021
A string is made of many substrings or can say that if we delete one or more characters from the beginning or end then the remaining string is called substring. This article is about to write a shell program that will tell the position (index) of the substring in a given string. Let’s take an example of t... | [
{
"code": null,
"e": 24089,
"s": 24058,
"text": " \n29 Dec, 2021\n"
},
{
"code": null,
"e": 24400,
"s": 24089,
"text": "A string is made of many substrings or can say that if we delete one or more characters from the beginning or end then the remaining string is called substring.... |
Java.io.ByteArrayInputStream class in Java - GeeksforGeeks | 12 Oct, 2021
java.io.ByteArrayInputStream class contains all the buffers, containing bytes to be read from the Input Stream. There is no IO exception in case of ByteArrayInputStream class methods. Methods of this class can be called even after closing the Stream, there is no effect of it on the class methods.
Declarati... | [
{
"code": null,
"e": 24500,
"s": 24472,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 24798,
"s": 24500,
"text": "java.io.ByteArrayInputStream class contains all the buffers, containing bytes to be read from the Input Stream. There is no IO exception in case of ByteArrayInputS... |
CSS - Rotate Out Effect | It provides to move or cause to move in a circle round an axis or center.
@keyframes rotateOut {
0% {
transform-origin: center center;
transform: rotate(0);
opacity: 1;
}
100% {
transform-origin: center center;
transform: rotate(200deg);
opacity: 0;
}
}
Transform − Trans... | [
{
"code": null,
"e": 2700,
"s": 2626,
"text": "It provides to move or cause to move in a circle round an axis or center."
},
{
"code": null,
"e": 2929,
"s": 2700,
"text": "@keyframes rotateOut {\n 0% {\n transform-origin: center center;\n transform: rotate(0);\n ... |
How to Count The Occurrences of a List Item in Python | Towards Data Science | Counting the number of occurrences of list elements in Python is definitely a fairly common task. In today’s short guide we will explore a few different ways for counting list items. More specifically, we will explore how to
count the number of occurrences of a single list item
count the occurrences of multiple list it... | [
{
"code": null,
"e": 396,
"s": 171,
"text": "Counting the number of occurrences of list elements in Python is definitely a fairly common task. In today’s short guide we will explore a few different ways for counting list items. More specifically, we will explore how to"
},
{
"code": null,
... |
ReactJS - Using CDN | Let us learn how to use content delivery network to include React in a simple web page.
Open a terminal and go to your workspace.
cd /go/to/your/workspace
Next, create a folder, static_site and change directory to newly created folder.
mkdir static_site
cd static_site
Next, create a new HTML file, hello.html.
<!DOCT... | [
{
"code": null,
"e": 2121,
"s": 2033,
"text": "Let us learn how to use content delivery network to include React in a simple web page."
},
{
"code": null,
"e": 2163,
"s": 2121,
"text": "Open a terminal and go to your workspace."
},
{
"code": null,
"e": 2189,
"s": ... |
How to draw an oval in HTML5 canvas? | You can try to run the following code to draw an oval in HTML5 canvas −
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<canvas id="newCanvas" width="450" height="300"></canvas>
<script>
// canvas
var c = document.getElementById('newCanvas');
var context = c.getContext('2d'... | [
{
"code": null,
"e": 1134,
"s": 1062,
"text": "You can try to run the following code to draw an oval in HTML5 canvas −"
},
{
"code": null,
"e": 1892,
"s": 1134,
"text": "<!DOCTYPE HTML>\n<html>\n <head>\n </head>\n <body>\n <canvas id=\"newCanvas\" width=\"450\" height... |
Perl m Function | This match operator is used to match any keyword in given expression. Parentheses after initial m can be any character and will be used to delimit the regular expression statement.
Regular expression variables include $, which contains whatever the last grouping match matched; $&, which contains the entire matched stri... | [
{
"code": null,
"e": 2401,
"s": 2220,
"text": "This match operator is used to match any keyword in given expression. Parentheses after initial m can be any character and will be used to delimit the regular expression statement."
},
{
"code": null,
"e": 2661,
"s": 2401,
"text": "R... |
Mockito - First Application | Before going into the details of the Mockito Framework, let's see an application in action. In this example, we've created a mock of Stock Service to get the dummy price of some stocks and unit tested a java class named Portfolio.
The process is discussed below in a step-by-step manner.
Step 1 − Create a JAVA class to ... | [
{
"code": null,
"e": 2211,
"s": 1980,
"text": "Before going into the details of the Mockito Framework, let's see an application in action. In this example, we've created a mock of Stock Service to get the dummy price of some stocks and unit tested a java class named Portfolio."
},
{
"code": ... |
D3.js randomNormal() Function - GeeksforGeeks | 29 Jul, 2020
The randomNormal() function is used to return a function that gives a random number based on Normal distribution or Gaussian distribution.
Syntax:
d3.randomNormal(mu, sigma);
Parameters: It takes the two parameters given above and described below.
mu: It is the expected value of the number. If mu is not g... | [
{
"code": null,
"e": 24536,
"s": 24508,
"text": "\n29 Jul, 2020"
},
{
"code": null,
"e": 24676,
"s": 24536,
"text": "The randomNormal() function is used to return a function that gives a random number based on Normal distribution or Gaussian distribution. "
},
{
"code": n... |
How to use GridLayoutManager in RecyclerView? | This example demonstrate about How to use GridLayoutManager in RecyclerView
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"?>
<androi... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "This example demonstrate about How to use GridLayoutManager in RecyclerView"
},
{
"code": null,
"e": 1267,
"s": 1138,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to... |
Python | Checking triangular inequality on list of lists - GeeksforGeeks | 03 Mar, 2019
Given a list of lists, the task is to find whether a sublist satisfies the triangle inequality.
The triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. In other words, a triangle is valid if sum of its ... | [
{
"code": null,
"e": 24412,
"s": 24384,
"text": "\n03 Mar, 2019"
},
{
"code": null,
"e": 24508,
"s": 24412,
"text": "Given a list of lists, the task is to find whether a sublist satisfies the triangle inequality."
},
{
"code": null,
"e": 24829,
"s": 24508,
"te... |
MYBATIS - Quick Guide | MyBatis is an open source, lightweight, persistence framework. It is an alternative to JDBC and Hibernate. It automates the mapping between SQL databases and objects in Java, .NET, and Ruby on Rails. The mappings are decoupled from the application logic by packaging the SQL statements in XML configuration files.
It abs... | [
{
"code": null,
"e": 2185,
"s": 1871,
"text": "MyBatis is an open source, lightweight, persistence framework. It is an alternative to JDBC and Hibernate. It automates the mapping between SQL databases and objects in Java, .NET, and Ruby on Rails. The mappings are decoupled from the application logic... |
Number of Islands in Python | Suppose we have a grid, there are few 0s and few 1s. We have to count the number of islands. An island is place that is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. We can assume that all four edges of the grid are all surrounded by water.
Suppose the grid is like −
There a... | [
{
"code": null,
"e": 1348,
"s": 1062,
"text": "Suppose we have a grid, there are few 0s and few 1s. We have to count the number of islands. An island is place that is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. We can assume that all four edges of the g... |
strtoumax() function in C++ - GeeksforGeeks | 31 Aug, 2018
The strtoumax() function in C++ interprets the contents of a string as an integral number of the specified base and return its value as an uintmax_t(maximum width unsigned integer). This function also sets an end pointer that points to the first character after the last valid numeric character of the strin... | [
{
"code": null,
"e": 23817,
"s": 23789,
"text": "\n31 Aug, 2018"
},
{
"code": null,
"e": 24329,
"s": 23817,
"text": "The strtoumax() function in C++ interprets the contents of a string as an integral number of the specified base and return its value as an uintmax_t(maximum width ... |
Ways to copy a vector in C++ | There are different ways to copy a vector in C++.
std:: copy is inbuilt to copy the elements from one vector to another.
std::copy(first_iterator_o, last_iterator_o, back_inserter()):
first_iteratot_0 = First iterator of first vector.
last_iteratot_0 = Last iterator of first vector.
back_inserter() = To insert values f... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "There are different ways to copy a vector in C++."
},
{
"code": null,
"e": 1183,
"s": 1112,
"text": "std:: copy is inbuilt to copy the elements from one vector to another."
},
{
"code": null,
"e": 1392,
"s": 1183,
... |
General Aptitude - GeeksforGeeks | 22 Jan, 2014
Profit = Price - Cost
= 50q - 5q2
The above function will be maximum for the values on which its first derivative becomes 0.
50 - 10*q = 0
50 = 10 * q
q = 5.
The value of above expression is maximum at q = 5.
Probability that the absorber is reliable = 0.96*0.6 + 0.72*0.4
... | [
{
"code": null,
"e": 27530,
"s": 27502,
"text": "\n22 Jan, 2014"
},
{
"code": null,
"e": 27771,
"s": 27530,
"text": "Profit = Price - Cost\n = 50q - 5q2\nThe above function will be maximum for the values on which its first derivative becomes 0.\n 50 - 10*q = 0\n ... |
Intellij Idea - Create First Java Project | It is time we got a hands-on experience with IntelliJ. In this chapter, we will create our first Java Project. We will write and execute the traditional Hello World program. This chapter explains the compilation and running of Java application.
For anything related to development, a developer has to create a new projec... | [
{
"code": null,
"e": 2334,
"s": 2089,
"text": "It is time we got a hands-on experience with IntelliJ. In this chapter, we will create our first Java Project. We will write and execute the traditional Hello World program. This chapter explains the compilation and running of Java application."
},
... |
Check if a string is Isogram or not in Python | Suppose we have a string s. We have to check whether the given string is isogram or not. The isogram is a string where the occurrence of each letter is exactly one.
So, if the input is like s = "education", then the output will be True because all characters in "education" occurs exactly once.
To solve this, we will fo... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "Suppose we have a string s. We have to check whether the given string is isogram or not. The isogram is a string where the occurrence of each letter is exactly one."
},
{
"code": null,
"e": 1357,
"s": 1227,
"text": "So, if the input ... |
HTTP headers | Referer - GeeksforGeeks | 22 Nov, 2019
The HTTP Referer header is a request-type header that identifies the address of the previous web page, which is linked to the current web page or resource being requested. The usage of this header increases the risk of privacy and security breaches on a website but it allows websites and web servers to ide... | [
{
"code": null,
"e": 24195,
"s": 24167,
"text": "\n22 Nov, 2019"
},
{
"code": null,
"e": 24629,
"s": 24195,
"text": "The HTTP Referer header is a request-type header that identifies the address of the previous web page, which is linked to the current web page or resource being re... |
How to use Pytorch as a general optimizer | by Conor Mc. | Towards Data Science | Pytorch is really fun to work with and if you are looking for a framework to get started with neural networks I highly recommend it — see my short tutorial on how to get up and running with a basic neural net in Pytorch here.
What many people don’t realise however is that Pytorch can be used for general gradient optimi... | [
{
"code": null,
"e": 397,
"s": 171,
"text": "Pytorch is really fun to work with and if you are looking for a framework to get started with neural networks I highly recommend it — see my short tutorial on how to get up and running with a basic neural net in Pytorch here."
},
{
"code": null,
... |
Creating a Virtual Background App... | by Swati Modi | Aug, 2020 | Towards Data Science | Towards Data Science | This is the Part 2 of the MediaPipe Series I am writing.
Previously, we saw how to get started with MediaPipe and use it with your own tflite model. If you haven’t read it yet, check it out here.
We had tried using the portrait segmentation tflite model in the existing segmentation pipeline with the calculators already... | [
{
"code": null,
"e": 228,
"s": 171,
"text": "This is the Part 2 of the MediaPipe Series I am writing."
},
{
"code": null,
"e": 367,
"s": 228,
"text": "Previously, we saw how to get started with MediaPipe and use it with your own tflite model. If you haven’t read it yet, check it ... |
Fuzzy C-Means Clustering —Is it Better than K-Means Clustering? | by Satyam Kumar | Towards Data Science | Clustering is an unsupervised machine learning technique that divides the population into several groups or clusters such that data points in the same group are similar to each other, and data points in different groups are dissimilar.
In other words, clusters are formed in such a way that:
Data points in the same clus... | [
{
"code": null,
"e": 408,
"s": 172,
"text": "Clustering is an unsupervised machine learning technique that divides the population into several groups or clusters such that data points in the same group are similar to each other, and data points in different groups are dissimilar."
},
{
"code... |
Create a Numpy array filled with all zeros | Python - GeeksforGeeks | 24 Oct, 2019
In this article, we will learn how to create a Numpy array filled with all zeros, given the shape and type of array.
We can use Numpy.zeros() method to do this task. This method takes three parameters, discussed below –
shape : integer or sequence of integers
order : C_contiguous or F_contiguous
... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n24 Oct, 2019"
},
{
"code": null,
"e": 25672,
"s": 25555,
"text": "In this article, we will learn how to create a Numpy array filled with all zeros, given the shape and type of array."
},
{
"code": null,
"e": 25775,
... |
Find the number of stair steps - GeeksforGeeks | 07 Apr, 2021
Given the total number of bricks T, find the number of stair steps that can be formed by using given bricks such that if step S has bricks B, then step S+1 should have exactly B+1 bricks and total number of bricks used should be less than or equal to number of bricks available.
Note: Number of bricks requ... | [
{
"code": null,
"e": 25921,
"s": 25893,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 26201,
"s": 25921,
"text": "Given the total number of bricks T, find the number of stair steps that can be formed by using given bricks such that if step S has bricks B, then step S+1 should ... |
Variables in Java - GeeksforGeeks | 19 Apr, 2022
Variable in Java is a data container that saves the data values during Java program execution. Every variable is assigned a data type that designates the type and quantity of value it can hold. Variable is a memory location name of the data.
A variable is a name given to a memory location. It is the basic ... | [
{
"code": null,
"e": 30195,
"s": 30167,
"text": "\n19 Apr, 2022"
},
{
"code": null,
"e": 30437,
"s": 30195,
"text": "Variable in Java is a data container that saves the data values during Java program execution. Every variable is assigned a data type that designates the type and ... |
Find maximum number | Practice | GeeksforGeeks | Given a number N, write a program to find a maximum number that can be formed using all of the digits of this number.
Note: The given number can be very large, so the input is taken as a String.
Example 1:
Input:
N = "38293367"
Output:
98763332
Explanation:
98763332 is the largest number that
can be formed by rearra... | [
{
"code": null,
"e": 433,
"s": 238,
"text": "Given a number N, write a program to find a maximum number that can be formed using all of the digits of this number.\nNote: The given number can be very large, so the input is taken as a String."
},
{
"code": null,
"e": 446,
"s": 435,
... |
Fernet (symmetric encryption) using Cryptography module in Python - GeeksforGeeks | 28 Sep, 2020
Cryptography is the practice of securing useful information while transmitting from one computer to another or storing data on a computer. Cryptography deals with the encryption of plaintext into ciphertext and decryption of ciphertext into plaintext. Python supports a cryptography package that helps us en... | [
{
"code": null,
"e": 25923,
"s": 25895,
"text": "\n28 Sep, 2020"
},
{
"code": null,
"e": 26604,
"s": 25923,
"text": "Cryptography is the practice of securing useful information while transmitting from one computer to another or storing data on a computer. Cryptography deals with ... |
Java.util.TreeMap.pollFirstEntry() and pollLastEntry() in Java - GeeksforGeeks | 20 Nov, 2017
Java.util.TreeMap also contains functions that support retrieval and deletion at both, high and low end of values and hence give a lot of flexibility in applicability and daily use. This function is poll() and has 2 variants discussed in this article.1. pollFirstEntry() : It removes and retrieves a key-val... | [
{
"code": null,
"e": 25250,
"s": 25222,
"text": "\n20 Nov, 2017"
},
{
"code": null,
"e": 25629,
"s": 25250,
"text": "Java.util.TreeMap also contains functions that support retrieval and deletion at both, high and low end of values and hence give a lot of flexibility in applicabil... |
compgen command in Linux with Examples - GeeksforGeeks | 22 Jun, 2020
compgen is a bash built-in command which is used to list all the commands that could be executed in the Linux system. This command could also be used to count the total number of commands present in the terminal or even to look for a command with the specific keyword. This command is even used to print th... | [
{
"code": null,
"e": 25751,
"s": 25720,
"text": " \n22 Jun, 2020\n"
},
{
"code": null,
"e": 26111,
"s": 25751,
"text": "compgen is a bash built-in command which is used to list all the commands that could be executed in the Linux system. This command could also be used to count t... |
Python - Write Bytes to File - GeeksforGeeks | 26 Nov, 2020
Files are used in order to store data permanently. File handling is performing various operations (read, write, delete, update, etc.) on these files. In Python, file handling process takes place in the following steps:
Open filePerform operationClose file
Open file
Perform operation
Close file
There are fo... | [
{
"code": null,
"e": 25562,
"s": 25534,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 25781,
"s": 25562,
"text": "Files are used in order to store data permanently. File handling is performing various operations (read, write, delete, update, etc.) on these files. In Python, fi... |
Iterator Functions in Python | Set 2 (islice(), starmap(), tee()..) - GeeksforGeeks | 04 Feb, 2020
Iterator Functions in Python | Set 1
1. islice(iterable, start, stop, step) :- This iterator selectively prints the values mentioned in its iterable container passed as argument. This iterator takes 4 arguments, iterable container, starting pos., ending position and step.
2. starmap(func., tuple list) :- T... | [
{
"code": null,
"e": 25773,
"s": 25745,
"text": "\n04 Feb, 2020"
},
{
"code": null,
"e": 25810,
"s": 25773,
"text": "Iterator Functions in Python | Set 1"
},
{
"code": null,
"e": 26046,
"s": 25810,
"text": "1. islice(iterable, start, stop, step) :- This iterat... |
Introduction to Resampling methods - GeeksforGeeks | 26 Apr, 2022
While reading about Machine Learning and Data Science we often come across a term called Imbalanced Class Distribution , generally happens when observations in one of the classes are much higher or lower than any other classes. As Machine Learning algorithms tend to increase accuracy by reducing the error,... | [
{
"code": null,
"e": 25589,
"s": 25561,
"text": "\n26 Apr, 2022"
},
{
"code": null,
"e": 26087,
"s": 25589,
"text": "While reading about Machine Learning and Data Science we often come across a term called Imbalanced Class Distribution , generally happens when observations in one... |
Program to print the series 1, 9, 17, 33, 49, 73, 97... till N terms - GeeksforGeeks | 24 Nov, 2021
Given a number N, the task is to print the first N terms of the series:
Examples:
Input: N = 7 Output: 1, 9, 17, 33, 49, 73, 97Input: N = 3 Output: 1, 9, 17
Approach: From the given series, find the formula for Nth term:
1st term = 1
2nd term = 9 = 2 * 4 + 1
3rd term = 17 = 2 * 9 - 1
4th term = 33... | [
{
"code": null,
"e": 25937,
"s": 25909,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 26010,
"s": 25937,
"text": "Given a number N, the task is to print the first N terms of the series: "
},
{
"code": null,
"e": 26022,
"s": 26010,
"text": "Examples: "
},... |
BufferedWriter newLine() method in Java with Examples - GeeksforGeeks | 28 May, 2020
The newLine() method of BufferedWriter class in Java is used to separate the next line as a new line. It is used as a write separator in buffered writer stream.
Syntax:
public void newLine()
throws IOException
Parameters: This method does not accept any parameter.
Return value: This method doe... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n28 May, 2020"
},
{
"code": null,
"e": 25386,
"s": 25225,
"text": "The newLine() method of BufferedWriter class in Java is used to separate the next line as a new line. It is used as a write separator in buffered writer stream."
... |
case command in Linux with examples - GeeksforGeeks | 15 May, 2019
case command in Linux is the best alternative when we had to use multiple if/elif on a single variable. It is used to execute the commands based on the pattern matching.
Syntax:
case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac
Example:
Options:
help case : It displays help information.
Linux-basi... | [
{
"code": null,
"e": 25677,
"s": 25649,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 25847,
"s": 25677,
"text": "case command in Linux is the best alternative when we had to use multiple if/elif on a single variable. It is used to execute the commands based on the pattern mat... |
How to install specified directory using npm ? - GeeksforGeeks | 10 Feb, 2021
Node. js is a platform built on Chrome’s JavaScript v8 engine, which is used for easily building fast and scalable network applications, javascript uses an event-driven, non-blocking I/O model that makes it lightweight and efficient which is perfect for data-intensive real-time applications that run across... | [
{
"code": null,
"e": 26267,
"s": 26239,
"text": "\n10 Feb, 2021"
},
{
"code": null,
"e": 26952,
"s": 26267,
"text": "Node. js is a platform built on Chrome’s JavaScript v8 engine, which is used for easily building fast and scalable network applications, javascript uses an event-d... |
Be in charge of Query Execution in Spark SQL | by David Vrba | Towards Data Science | Querying data in Spark has become a luxury since Spark 2.x because of SQL and declarative DataFrame API. Using just few lines of high level code allows to express quite complex logic and carry out complicated transformations. The big benefit of the API is that users don’t need to think about the execution and can let t... | [
{
"code": null,
"e": 798,
"s": 171,
"text": "Querying data in Spark has become a luxury since Spark 2.x because of SQL and declarative DataFrame API. Using just few lines of high level code allows to express quite complex logic and carry out complicated transformations. The big benefit of the API is... |
Break and Continue statement in Java - GeeksforGeeks | 26 Feb, 2021
The break and continue statements are the jump statements that are used to skip some statements inside the loop or terminate the loop immediately without checking the test expression. These statements can be used inside any loops such as for, while, do-while loop.
Break: The break statement in java is used... | [
{
"code": null,
"e": 24002,
"s": 23974,
"text": "\n26 Feb, 2021"
},
{
"code": null,
"e": 24267,
"s": 24002,
"text": "The break and continue statements are the jump statements that are used to skip some statements inside the loop or terminate the loop immediately without checking ... |
How to prevent column break within an element? - GeeksforGeeks | 18 Apr, 2019
We can prevent column break within an element by using a CSS break-inside Property. The break-inside property in CSS is used to specify how the column breaks inside the element. Sometimes content of an element is stuck between the column. To prevent column break we should use the break-inside Property set ... | [
{
"code": null,
"e": 24985,
"s": 24957,
"text": "\n18 Apr, 2019"
},
{
"code": null,
"e": 25302,
"s": 24985,
"text": "We can prevent column break within an element by using a CSS break-inside Property. The break-inside property in CSS is used to specify how the column breaks insid... |
How to create a 3D time-series map using Python and Kepler.gl | by Erik Yan | Towards Data Science | In the wake of protests rippling throughout the U.S., I wanted to better understand just how often interactions between police and victims lead to death. This presented a great opportunity to test out Uber’s Kepler.gl toolbox and create an interactive 3D map of police interactions that have resulted in death.
In this p... | [
{
"code": null,
"e": 482,
"s": 171,
"text": "In the wake of protests rippling throughout the U.S., I wanted to better understand just how often interactions between police and victims lead to death. This presented a great opportunity to test out Uber’s Kepler.gl toolbox and create an interactive 3D ... |
7 Easter Eggs in Python. Countless Ways to Entertain Yourself at... | by Eden Au | Towards Data Science | Most of us are working from home amid the coronavirus outbreak. Many of you might already be so bored staying at home all day. And I feel you.
Python might only be a tool for you to build projects, simulation, and automation, and it could be really fun.
Thanks to the amazing Python community, we can find many hidden fe... | [
{
"code": null,
"e": 315,
"s": 172,
"text": "Most of us are working from home amid the coronavirus outbreak. Many of you might already be so bored staying at home all day. And I feel you."
},
{
"code": null,
"e": 426,
"s": 315,
"text": "Python might only be a tool for you to buil... |
How to Configure Nagios Server for Monitoring Apache Server | In this article, we will be covering about the installation of Nagios 4, a very popular and open source monitoring tool on Centos 6.7. We shall cover some basic configuration steps which might be useful to monitor a host of resources via the web interface. Here, we shall also utilize the Nagios Remote Plugin Executor (... | [
{
"code": null,
"e": 1485,
"s": 1062,
"text": "In this article, we will be covering about the installation of Nagios 4, a very popular and open source monitoring tool on Centos 6.7. We shall cover some basic configuration steps which might be useful to monitor a host of resources via the web interfa... |
C# | LongLength property of an Array - GeeksforGeeks | 23 Jan, 2019
Array.LongLength Property is used to get a 64-bit integer that represents the total number of elements in all the dimensions of the Array.
Syntax:
public long LongLength { get; }
Property Value: This property returns a 64-bit integer that represents the total number of elements in all the dimensions of the... | [
{
"code": null,
"e": 24092,
"s": 24064,
"text": "\n23 Jan, 2019"
},
{
"code": null,
"e": 24231,
"s": 24092,
"text": "Array.LongLength Property is used to get a 64-bit integer that represents the total number of elements in all the dimensions of the Array."
},
{
"code": nu... |
Apply function to each element of a list - Python - GeeksforGeeks | 26 Nov, 2020
In this article, we will learn how to apply a function to each element of a Python list. Let’s see what exactly is Applying a function to each element of a list means:
Suppose we have a list of integers and a function that doubles each integer in this list. On applying the function to the list, the functio... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 25815,
"s": 25647,
"text": "In this article, we will learn how to apply a function to each element of a Python list. Let’s see what exactly is Applying a function to each element of a list me... |
Difference between 2-address instruction and 1-address instructions - GeeksforGeeks | 19 Jun, 2020
Prerequisite – Instruction Formats1. Two-Address Instructions :Two-address instruction is a format of machine instruction. It has one opcode and two address fields. One address field is common and can be used for either destination or source and other address field for source.
Example:
X = (A + B) x (C + D... | [
{
"code": null,
"e": 24700,
"s": 24672,
"text": "\n19 Jun, 2020"
},
{
"code": null,
"e": 24978,
"s": 24700,
"text": "Prerequisite – Instruction Formats1. Two-Address Instructions :Two-address instruction is a format of machine instruction. It has one opcode and two address fields... |
DateFormat format(Date obj) method in Java - GeeksforGeeks | 28 Feb, 2019
The format() method of DateFormat class in Java is used to format a given Date object into a string representing Date/Time.
Syntax:
String format(Date date)
Parameters: This method accepts a single parameter date which is a Date object.
Return Value: This method returns a String which is the formatted dat... | [
{
"code": null,
"e": 25863,
"s": 25835,
"text": "\n28 Feb, 2019"
},
{
"code": null,
"e": 25987,
"s": 25863,
"text": "The format() method of DateFormat class in Java is used to format a given Date object into a string representing Date/Time."
},
{
"code": null,
"e": 25... |
HTML | Clearing the input field - GeeksforGeeks | 29 Jul, 2021
To clear the entire input field without having to delete the whole thing manually Or what if there is already a pre-suggested input present in the input field, that the user doesn’t want. There could be many scenarios. Therefore, in this article, we are going to learn about how to clear the input field.
Th... | [
{
"code": null,
"e": 26812,
"s": 26784,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 27117,
"s": 26812,
"text": "To clear the entire input field without having to delete the whole thing manually Or what if there is already a pre-suggested input present in the input field, tha... |
MATLAB - Graphics | This chapter will continue exploring the plotting and graphics capabilities of MATLAB. We will discuss −
Drawing bar charts
Drawing contours
Three dimensional plots
The bar command draws a two dimensional bar chart. Let us take up an example to demonstrate the idea.
Let us have an imaginary classroom with 10 students. ... | [
{
"code": null,
"e": 2246,
"s": 2141,
"text": "This chapter will continue exploring the plotting and graphics capabilities of MATLAB. We will discuss −"
},
{
"code": null,
"e": 2265,
"s": 2246,
"text": "Drawing bar charts"
},
{
"code": null,
"e": 2282,
"s": 2265,
... |
How to create a CLI in golang with cobra | by Shubham Chadokar | Towards Data Science | Have you ever wonder why in the world of GUI, CLI still exist? You’ll better understand it when you build one of your own.
Published on schadokar.dev
When you learn golang then it is very often that you’ll come across that ‘golang is great to build cli tools’. This fascinated me too. So, I tried to get my hands dirty a... | [
{
"code": null,
"e": 295,
"s": 172,
"text": "Have you ever wonder why in the world of GUI, CLI still exist? You’ll better understand it when you build one of your own."
},
{
"code": null,
"e": 322,
"s": 295,
"text": "Published on schadokar.dev"
},
{
"code": null,
"e":... |
User-defined Exceptions in Python with Examples | Python throws errors and exceptions whenever code behaves abnormally & its execution stop abruptly. Python provides us tools to handle such scenarios by the help of exception handling method using try-except statements. Some standard exceptions which are found are include ArithmeticError, AssertionError, AttributeError... | [
{
"code": null,
"e": 1527,
"s": 1187,
"text": "Python throws errors and exceptions whenever code behaves abnormally & its execution stop abruptly. Python provides us tools to handle such scenarios by the help of exception handling method using try-except statements. Some standard exceptions which ar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.