Google Sign-In, simplifying your integration with Google APIs. A user has the option of revoking access at any time to an application. OAuth was developed as an authentication protocol, so the result of any OAuth flow is that the app obtains an access token. Something about the user’s account can be got or modified. On its own, the permission token says nothing about but who the user is.
In this article, I will discuss how to complete an essential integration with Google Sign-In with Node JS and Passport JS.
To begin with, let’s create an Express Application. Create a new…
In this article, you will learn about greedy algorithms and how these can be used in a lot of programming problems.
Greedy algorithms are simple instinctive algorithms used for optimization (either maximized or minimized) problems. This algorithm makes the best choice at every step and attempts to find the optimal way to solve the whole problem. This means that it makes a locally optimal choice in the hope that this choice will lead to a globally optimal solution. Generally, greedy algorithms do not provide globally optimized solutions.
This algorithm is very successful in many tasks but, in some cases, it…
Let’s think of an array of stick-lengths, find which three sticks form a non-degenerate triangle such that:
Are you confused about the non-degenerate triangle?
If a, b and c are the sides of the triangle, and if the following 3 conditions are true, then it is a non-degenerate triangle.
The Model-View-Controller (MVC) is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components is built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard web development frameworks to create scalable and extensible projects.
A stack is an abstract data type that consists of a predefined capacity. It allows adding and removing elements in a particular order. When every time an element is added, it goes to the top of the stack. Stack enables all data to operations at one end only. So the only element that can be removed is the element at the top of the stack, and only one item can be read or removed at a given time.
The above feature makes it a LIFO (Last-In-First-Out) data structure. Here, the element which is inserted last is accessed first. In stack…
Flutter is a new Open Source framework created by Google that focuses on the creation of cross-platform applications. Flutter primarily targets iOS and Android but is increasingly adding support for desktop platforms too.
In this article, I am going to discuss the most useful Widgets that we need when we are going to develop a flutter application.
AppBar is usually the topmost component of the app (or sometimes the bottom-most), it contains the toolbar and some other common action buttons. All the components in a flutter application is a widget or a combination of…
One of the main reasons to use threads in Java is to make a task run parallel to another task.
We use Threads to make Java applications faster by doing multiple things at the same time. In technical terms, Thread helps us to achieve parallelism in Java programs. Since the CPU is high-speed and it even contains multiple cores, just one Thread cannot take advantage of all the cores. This means our costly hardware will remain idle for most of the time.
Using multiple threads, we can take full advantage of multiple cores by serving more clients and serving them…
The Map interface is not a subtype of the Collection Interface. Therefore it behaves a bit differently from the rest of the collection types.
In my previous article, we discussed Java lists, queues, and sets in the Java Collection Interface. If you are not familiar with lists, queues, and sets. Let’s dive into Java Map Interface.
The Map interface is present in
java.util package and represents a mapping between a key and a value. The Map interface is not a subtype of the Collection Interface. Therefore it behaves a bit differently from the rest of the collection types.
Architecture for storing and manipulating a group of objects
The Collection in Java is a framework that provides an architecture to store and manipulate the group of objects.
Java Collections can achieve all the operations we perform on data, such as searching, sorting, insertion, manipulation, and deletion.
Java Collection means a single unit of objects. Java Collection framework provides many interfaces (List, Set, Queue, Deque) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet).
java.util package contains all the classes and interfaces for the Collection framework.
Why is having a strong understanding of algorithms so important? Because when we are writing a solution for a problem we have to implement the most efficient, reliable, and fast code in a short time. If we haven’t got a proper grasp of algorithms then we are going to struggle with our code.
In this article, I am going to discuss two commonly used sorting algorithm techniques that reduce the time complexity.
This is a highly efficient algorithm that uses the time complexity of O(n log n) for the worst case and n² for the average case. …