
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 26504 Articles for Server Side Programming

1K+ Views
In python data analysis, we sometime face a situation where we need to compare a given number with a list containing many values. In this article we need to fins if a given number is less than each of the values present in a given list. We are going to achieve it using the following two ways.Using for loopWe iterate through the given list and compare the given value with each of the values in the list. Once all values from the list are compared and the comparison condition holds good in each of the step, we print out the ... Read More

852 Views
In this article we are going to see a python program that will give output of possible words from a given set of characters. Here we are taking a list as an input which will contain the set of reference words and another list containing the characters from which the words are made up of.In the below program, we define two functions. One to take the letters from the second list and make up words. Another function to match the words formed with the words present in the given list of words.Example Live Demodef Possible_Words(character): x = {} for ... Read More

344 Views
We can access the individual elements of a list using the [] brackets and the index number. But when we need to access some of the indices then we cannot apply this method. We need the below approaches to tackle this.Using two listsIn this method, along with the original list, we take the indices as another list. Then we use a for loop to iterate through the indices and supply those values to the main list for retrieving the values.Example Live Demogiven_list = ["Mon", "Tue", "Wed", "Thu", "Fri"] index_list = [1, 3, 4] # printing the lists print("Given list : ... Read More

2K+ Views
In this tutorial, we will be discussing a program to understand thread functions in C/C++.Thread functions allow users to implement concurrent functions at the same time, which can either be dependent on each other for execution or independent.Example#include #include #include void* func(void* arg){ //detaching the current thread pthread_detach(pthread_self()); printf("Inside the thread"); pthread_exit(NULL); } void fun(){ pthread_t ptid; //creating a new thread pthread_create(&ptid, NULL, &func, NULL); printf("This line may be printed before thread terminates"); if(pthread_equal(ptid, pthread_self()) printf("Threads are equal"); else printf("Threads are ... Read More

589 Views
In this tutorial, we will be discussing a program to understand templates and static variables in C++.In case of function and class templates, each instance of the templates has its own local copy of the variables.Example Live Demo#include using namespace std; template void fun(const T& x){ static int i = 10; cout

183 Views
In this tutorial, we will be discussing a program to understand Template specialization in C++.Standard functions like sort() can be used with any data types and they behave the same with each of them. But if you want to set a special behaviour of the function for a particular data type (even user defined), we can use template specialization.Example Live Demo#include using namespace std; template void fun(T a) { cout

95 Views
In this tutorial, we will be discussing a program to understand swapping of subranges of different containers in C++.For this we will be provided with vectors and lists, and we need to swap some of their elements.Example Live Demo#include #include #include #include using namespace std; int main(){ vector v = { -10, -15, -30, 20, 500 }; list lt = { 10, 50, 30, 100, 50 }; swap_ranges(v.begin(), v.begin() + 3, lt.begin()); for (int n : v) cout

610 Views
In this tutorial, we will be discussing a program to understand how to sum two integers without using arithmetic operators in C/C++.For adding two integers without using arithmetic operators, we can do this with either using pointers or using bitwise operators.ExampleUsing pointers#include using namespace std; int sum(int a, int b){ int *p = &a; return (int)&p[b]; } int main() { int add = sum(2,3); cout

647 Views
In this tutorial, we will be discussing a program to understand how to store a Data triplet in a vector in C++.To store three elements in a single cell of a vector we will creating a user defined structure and then make a vector from that user defined structure.Example Live Demo#include using namespace std; struct Test{ int x, y, z; }; int main(){ //creating a vector of user defined structure vector myvec; //inserting values myvec.push_back({2, 31, 102}); myvec.push_back({5, 23, 114}); myvec.push_back({9, 10, 158}); int s = myvec.size(); for (int i=0;i

617 Views
The problem is to sort a vector in descending order using C++'s Standard Template Library(STL). Sorting in descending order means rearranging the elements of the vector so that the largest elements come first, followed by smaller elements, all the way down to the smallest element at the end of the vector. Let's say we have the following vector of integers: vector v = {4, 2, 9, 1, 7}; We want to sort this vector so that the elements are arranged in descending order: v = {9, 7, 4, 2, 1}; In this article, we will show you how ... Read More