Posts

How To Visualize Clustered and Unclustered Index In SQL

Working with SQL databases forces you to come across primarily the clustered and the unclustered indexes. These are handy features that if used wisely can greatly enhance the speed of execution of the listed queries. But it can be hard to grasp their fundamentals, especially if you want to picture it in your head. In this blog post, I explain what clustered and unclustered indexes are, why they are of importance and most important how they can be explained without the necessity of explaining all the details. What is a Clustered Index? A clustered index specifies how the data stored in a table is sorted out in relation to the other fields in that table. Let’s consider, as an example, a to-do list that you create and find that it has automatically been arranged in a certain order. When you apply a clustered index on a unique key The control column such as SQL Server will automatically add rows of that table in accordance with the control column. Since the book-placement is done acc

How to Create Chain in Chain of Responsibility Design Pattern?

In modern software development, design patterns are important in structuring code and making it easy to maintain. One such design pattern is the Chain of Responsibility Design Pattern. Whether you're working with C++ or any other object-oriented language, the Chain of Responsibility (CoR) pattern offers a way to handle requests through a series of handlers, each capable of processing or passing the request along. In this article, we'll explore how to create a chain in the Chain of Responsibility Design Pattern, particularly focusing on C++ programming. We'll walk through an implementation, discuss how it works, and explain why it’s useful when flexible request-handling logic is needed. You might also want to read about Decorator Design Pattern . Designing Design Patterns with C#   What is the Chain of Responsibility Design Pattern? The Chain of Responsibility Design Pattern is a behavioral design pattern that allows an object to pass a request through a chain of poten

Introducing Materialize and Dematerialize Operators in C# Observable

  If you've been working with Reactive Extensions (Rx) in C for a while, you’re probably comfortable using operators like `Select`, `Where`, and `Subscribe`. But did you know that two lesser-known but incredibly useful operators give you deeper control over observables? Today, we're going to explore Materialize and Dematerialize. Don’t worry if they sound a bit scary—by the end of this post, you’ll see how these operators can make your life easy by debugging and handling errors much easier. Terms like Observable, Observer, and Subject are from the  Observer Design Pattern .   So, What Do Materialize and Dematerialize Even Do? Let’s start with Materialize. Normally, when you’re working with an observable, it emits data, completes, or throws an error. What Materialize does is convert all those events (values, errors, completions) into a `Notification<T>` object. It’s like converting each event into a form that you can inspect and manipulate.   On the other hand, Dem

Practical Example To Visualize Entities In Live Application Using MSAGL

Image
Finding it difficult to understand the complex relationship between the different objects which are part of an application? Think of Visualizing the objects and their state when the application is running, Seems exciting right?  Yes, It's possible with the little help from MSAGL(Microsoft Automatic Graph Layout) and some boilerplate code to do that. I have created a sample application demonstrating how it can be done, including the state of these objects in a live manner. I would recommend you to go through MSAGL Basics Check out the video here: Check out the code here: using Microsoft.Msagl.Drawing; using System; using System.Collections.Generic; using System.Linq; using System.Threading; namespace MSAGL_Demo { public interface INodeRepository { void AddNode(Node node); void OnActiveNodeChanged(string obj); } public class NodeRepository : INodeRepository { private IList<Node> nodes = new List<Node>(); private Graph g = null; public NodeReposito

Understanding the Curiously Recurring Template Pattern (CRTP) in C++: Interesting Comparison with Virtual Functions

Introduction In the world of C++ programming, there are certain patterns that stands out because of their performance efficiency and their peculiar solution. A common technique (or pattern) is the Curiously Recurring Template Pattern (CRTP). If you want to become an expert on the most advanced techniques as a C++ developer, CRTP is something you need to know. This post digs into what CRTP is, why you need it and what it allows you to do vs more typical virtual function implementations. When you're finished, you'll understand how CRTP functions and why you might want to use it in your projects. Table Of Contents 1. Curiously Recurring Template Pattern (CRTP) 2. Why is CRTP Needed? 3. How CRTP Works From the Inside 4. Here we have a detailed comparison of how CRTP does versus virtual member functions. 5. Benefits of Using CRTP 7. Pitfalls and Considerations When Using CRTP 8. Conclusion 9. FAQs     1. What is The Curiously Recurring Template Pattern (CRTP) Curiously Rec