
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

754 Views
The details about a pointer and array that showcase their difference are given as follows.PointerA pointer is a variable that stores the address of another variable. When memory is allocated to a variable, pointer points to the memory address of the variable. Unary operator ( * ) is used to declare a pointer variable.The following is the syntax of pointer declaration.datatype *variable_name;Here, the datatype is the data type of the variable like int, char, float etc. and variable_name is the name of variable given by user.A program that demonstrates pointers is given as follows.Example Live Demo#include int main () { ... Read More

8K+ Views
Use of the new operator signifies a request for the memory allocation on the heap. If the sufficient memory is available, it initializes the memory and returns its address to the pointer variable.The new operator should only be used if the data object should remain in memory until delete is called. Otherwise if the new operator is not used, the object is automatically destroyed when it goes out of scope. In other words, the objects using new are cleaned up manually while other objects are automatically cleaned when they go out of scope.The following is the syntax of new operator.pointer_variable ... Read More

709 Views
News API is very famous API for searching and fetching news articles from any web site, using this API anyone can fetch top 10 heading line of news from any web site. But using this API, one thing is required which is the API key. Example Code import requests def Topnews(): # BBC news api my_api_key="Api_number” my_url = = " https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey=my_api_key" my_open_bbc_page = requests.get(my_url).json() my_article = my_open_bbc_page["articles"] my_results = [] for ar in my_article: ... Read More

2K+ Views
Minkowski distance is a metric in a normed vector space that measures the distance between two or more vectors. This is typically used in machine learning to find distance similarity. The formula to calculate the Minkowski distance is - $$\mathrm{D= \big[\sum_{i=1}^{n}|r_i-s_i|^p\big]^{1/p}}$$ Where, xi and yi: Two points in n-dimensional space p: Parameter that determines the type of distance being calculated. For example, if p=1, it is the Manhattan distance, and if p=2, it represents Euclidean distance. For example, if we consider the following vector's as input - x = (0, ... Read More

339 Views
Here we are using regular expression package for extracting email-id from the URL-text file. Given the URL- text file. Using regular expression package we define the pattern of email-id then use findall() function, using this method to check the text which will match with this pattern. Input text= Please contact us at contact@tutorialspoint.com for further information."+\ " You can also give feedback at feedback@tutorialspoint.com" Output ['contact@tutorialspoint.com ', 'feedback@tutorialspoint.com'] Example code import re my_text = "Please contact us at contact@tutorialspoint.com for further information."+\ " You can also give feedback at feedback@tutorialspoint.com" my_emails = re.findall(r"[a-z0-9\.\-+_]+@[a-z0-9\.\-+_]+\.[a-z]+", ... Read More

3K+ Views
Floating number is a number that has a decimal point and can represent both large and very small values. Binary number is a number expressed in the base-2 numeral system, using 0's and 1's. The conversion of floating-point number to binary representation in Python requires to represent the number in the IEEE 754 format(a set of representation of numerical values and symbols). For example, consider a floating number 9.87, its IEEE 754 32-bit binary representation (1 bit for the sign, 8 bits for exponent, and 23 bits for the significand) is "01000001000111011110101110000101". In this article, we will discuss different ways ... Read More

2K+ Views
In this article, we will discuss different methods used to right rotate a list from the given rotation number. A list has comma-separated values (items) of same type or different type between square brackets. To right rotate a list by n, Python offers many ways such as using slicing, rotate() method of the deque object and others. Let's discuss these ways in detail with examples - myList = [5, 20, 34, 67, 89, 94, 98, 110] The following is the output if we assign n as 4 − 89, 94, 98, 110, 5, 20, 34, 67 Right ... Read More

408 Views
There will be times when we misspell some words when we write something. To overcome this problem, we use the PyEnchant module in Python. This module is used to check the spelling of words and suggest corrections that are misspelled words. It is also used in many popular tasks, including ispell, aspell, and MySpell. It is very flexible in handling multiple dictionaries and multiple languages. For example, if the input is 'prfomnc', then the output returned would be - 'prominence', 'performance', 'preform', 'provence', 'preferment', 'proforma'. PyEnchant Module For Windows users, install the pre-built binary packages using pip - pip ... Read More

1K+ Views
This is very funny game. In this game no player is needed, it is an automatic game. Here we are using two Python modules numpy and random. In this game the mark on the board is put automatically instead of asking the user to put a mark on the board, and it will display the board after each turn unless a player wins. It returns -1 If the game gets draw. Example code import numpy as np import random from time import sleep # first creates an empty board def my_create_board(): return(np.array([[0, 0, 0], [0, ... Read More

560 Views
Static C++ class members can be defined using the static keyword. The static member in a class is shared by all the class objects as there is only one copy of the static class member in the memory, regardless of the number of objects of the class.The static class member is initialized to zero when the first object of the class is created if it is not initialized in any other way.A program that demonstrates static class members in C++ is given as follows.Example Live Demo#include using namespace std; class Example { public : static int a; ... Read More