Tag: explained
Need of Factory Method Design Pattern in Frameworks Explained
In a framework we deal mainly with abstract classes. Application that is going to use our framework provides the derived classes these abstract classes. Let’s understand by an example of Thread pooling Framework, A thread pooling framework provides the facility to execute Tasks in pooled environment by worker threads. It’s doesn’t know what actually the …
Need of Factory Method Design Pattern in Frameworks ExplainedRead More
C++11 Multithreading – Part 7: Condition Variables Explained
In this article we will discuss the usage of Condition Variable in C++11 Multi-threading with example. Condition Variables Condition Variable is a kind of Event used for signaling between two or more threads. One or more thread can wait on it to get signaled, while an another thread can signal this. Advertisements Header file required for condition …
C++11 Multithreading – Part 7: Condition Variables ExplainedRead More
Why do we need Lambda functions in Python ? | Explained with examples.
In this article we will discuss what is a lambda function in python and why they are required. Basically what are the use cases which makes use of lambda function must. What is a lambda function ? Lambda functions are also called Anonymous functions because they don’t have any name. Also they can be assigned …
Why do we need Lambda functions in Python ? | Explained with examples.Read More
Python : Iterator, Iterable and Iteration explained with examples
In this article we will discuss what is Iterator, Iterable and Iterator in python with examples. What is an Iterable? Iterable is kind of object which is a collection of other elements. For example list and tuple are Iterables. It is similar to any collection class in Java or container class in C++. In Python …
Python : Iterator, Iterable and Iteration explained with examplesRead More
Python : Yield Keyword & Generators explained with examples
In this article we will discuss what’s the use of yield keyword, What are generators and how to Iterate over Generator objects. Yield Keyword In Python inside a function instead of using return keyword, we can use yield keyword to return the value. But unlike return keyword, the yield keyword do not terminates the function, …
Python : Yield Keyword & Generators explained with examplesRead More
Python : max() function explained with examples
In this article we will discuss detailed features of Python’s max() function with examples. Python provides a max() function to find out the largest element from a collection of elements, Advertisements max(iterable, *[, key, default]) max(arg1, arg2, *args[, key]) Arguments: Iterable : An Iterable object like list, tuple etc. arg1, arg2 … : Multiple elements …
Python : List Comprehension vs Generator expression explained with examples
In this article we will discuss the differences between list comprehensions and Generator expressions. Need of Generator Expression ? Sometimes we want to operate on selected elements only and that too one by one. For such scenarios we should avoid keeping unnecessary elements in memory by creating lists or set or tuple etc. Advertisements Let’s …
Python : List Comprehension vs Generator expression explained with examplesRead More
Python: Open a file using “open with” statement & benefits explained with examples
In this article, we will discuss how to use “open with” statement to open a file and what are its benefits. Also, how to open multiple files in a single “open with” statement. The need for “open with” statement Before going into the “with statement” we need to understand the requirement behind it. For that, …
Python: Open a file using “open with” statement & benefits explained with examplesRead More
Python: break keyword – Explained with examples
In this article, we will discuss how to use the break keyword in python to break the flow of loops. We will also cover examples of while loop and for loop with a break statement. “break” statement in python is useful to break the flow of a loop abruptly i.e. It can force a while …
Python: For Loop – Explained with examples
In this article, we will learn the syntax and usage details of for loop in python. Then we will look at various examples of the for loop. In python, we can iterate over a group of statements multiple times using a for loop. But the number of times these statements will be executed by a …