Tenzin kabsang

Tenzin kabsang


  • January 1, 2026

    Understanding PeriodicTimer in .NET: The Modern Way to Schedule Background Work

    Understanding PeriodicTimer in .NET: The Modern Way to Schedule Background Work

    PeriodicTimer (introduced in .NET 6) is a lightweight, async‑first timer primitive that fits naturally into modern async/await code and Hosted Services. Unlike the callback‑driven System.Threading.Timer, PeriodicTimer integrates cleanly with CancellationToken, avoids fire‑and‑forget pitfalls, and eliminates accidental overlapping execution.If you’re building a background worker, scheduled job, or recurring task inside an IHostedService or BackgroundService, PeriodicTimer is Continue reading

    Software development
    .NET, dotnet, scheduled job, background services, worker
  • July 18, 2025

    Kafka Consumer Swap: How to Migrate Without Missing a Beat

    Kafka Consumer Swap: How to Migrate Without Missing a Beat

    Apache Kafka is more than a message queue—it’s a distributed log built for fault tolerance and scale. Understanding how it works under the hood is essential for designing an effective migration strategy. Kafka is a publish/subscribe messaging system designed to handle generic data. Unlike traditional queue mechanisms, Kafka can be thought of as a distributed Continue reading

    Software development
    architecture, cloud, consumer groups, kafka, kafka migration, kafka releases, kafka topic partition, partition rebalance, Software development, technology
  • November 20, 2024

    ASP.NET Core HybridCache library

    ASP.NET Core HybridCache library

    Almost all real-world applications need to implement a caching mechanism. Caching can drastically improve application performance, scalability, and user experience while optimizing resource use and reducing costs. .NET supports both in-memory and distributed cache implementation and is easily configured via middleware. Additionally, the application code interacts with the IDistributedCache interface and remains completely abstracted away Continue reading

    Software development
    .NET, c#, Caching, HybridCache, performance, programming
  • November 15, 2024

    Understanding Soft Delete Strategies in Application Design

    When designing an application, it is worthwhile to carefully consider your DELETE strategy. SQL provides us with the power to delete a record from existence. However, doing such a destructive operation might not be the right approach. It could cause us a lot of pain later on. Additionally, there is much value to be gained Continue reading

    Software development
    c#, database-delete, entity-framework, entityframework, programming, soft-delete, sql, technology
  • September 29, 2014

    JavaScript testing with Mocha, Chai and Grunt

    Everyone agrees that TDD (test-driven development) is a good thing and yet very few people do it. why? I believe that one of the reason is pure laziness.  It is too much work to click “Run Test” every single time, however there is another more important reason and that is the “feedback loop”, which in Continue reading

    Software development
  • September 9, 2014

    Mavenize SqlJdbc Jar

    Download SQL Server jdbc driver from here. Open command prompt and cd into the directory until you see the sqljdbc4.jar file. Run the following command, which will mavenize and install the package in your local .m2 repository. mvn install:install-file -Dfile=sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar Now add the dependency in your pom file <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> Continue reading

    Software development
  • June 17, 2014

    Java–Pretty print xml string

    To print a formatted xml string in Java, first convert the raw string into a Document object, then use Transformer class to format the output like so: Now simply call this method to print the formatted xml string for e.g., Continue reading

    Software development
  • June 13, 2014

    Spring Mvc–Layout/Master pages

    To set up layout pages in Spring you could use SiteMesh. The way you set it up is as follows: Add the latest version of sitemesh to your pom file, during this writing it was v2.4.2 Create a new decorators.xml file within the WEB-INF folder, this file is used to describe where your layout page Continue reading

    Software development
  • May 9, 2014

    Spring MVC – CSS and JavaScript imports

    In this series we will go through setting up a basic web structure that deals with importing resources (css/javascript), we’ll slowly progress this app in subsequent blog posts by adding layout/master page support as well as reading values from config files.  I will primarily use xml configuration for these setups, you can also do it Continue reading

    Software development
  • January 19, 2014

    Resource Cleanup functional way

    For some applications there might be times when expensive resources must be cleaned up properly or there might be times where your clients are being irresponsible and forget to wrap your class in using statements resulting in memory leaks or open database connections.  These might be a good time to implement the following strategy by Continue reading

    Software development
  • July 20, 2013

    URL Through JavaScript

    JavaScript by default gives you full access to the browser’s url property through the global window.location object.  Let’s use this following url as an example: “http://www.demo.com/Sports/Running/Shoes?item=1&size=10&color=green” To get the full url use: To only get the origin use: With these two properties you can extract any values that you want using regular string functions, such Continue reading

    Software development
  • July 17, 2013

    Onion Architecture

    Recently I have been writing some applications using the Onion Architecture one of which is here: Github.  I guess I’ve been using this pattern for a long time, I just didn’t know the name for it until I read Jeffrey’s blog, which is a very good read.  One thing that you have to consider though Continue reading

    Software development
  • June 5, 2013

    Testable Object pattern

    UnitTests should be given the same level of respect and care that we put into writing production code, if it is not readable and maintainable then you might as well remove it.  I’ve always struggled with refactoring test code that contains mocked objects that I want to invoke some method on within my tests.  This Continue reading

    Software development
  • May 16, 2013

    Using Ninject with constructor parameters

    Before I even begin to write about this topic let me clarify one thing.  This is an example of the infamous Service Locator pattern or some call it an anti-pattern.  There are tons of articles on the internet, and I suggest you read some of them before you begin to implement the following sample code.  Continue reading

    Software development
  • March 29, 2013

    JavaScript: function expression vs. function statement

    In JavaScript, all of the variables and functions are subject to hoisting.  It simply means that the compiler will move both functions and variables to the top of its parent scope. Lets look at an example that depicts how hoisting affects function expression and function statements differently. Both foo1 and foo2 are called before they’re Continue reading

    Software development
Next Page»

About Me

An ordinary programmer!

  • LinkedIn
  • GitHub

Recent Posts

  • Understanding PeriodicTimer in .NET: The Modern Way to Schedule Background Work
  • Kafka Consumer Swap: How to Migrate Without Missing a Beat
  • ASP.NET Core HybridCache library
  • Understanding Soft Delete Strategies in Application Design
  • JavaScript testing with Mocha, Chai and Grunt

Recent Posts

  • Understanding PeriodicTimer in .NET: The Modern Way to Schedule Background Work
  • Kafka Consumer Swap: How to Migrate Without Missing a Beat
  • ASP.NET Core HybridCache library

Follow Me

Tumblr

WordPress

Instagram

Newsletter

Blog at WordPress.com.

  • Subscribe Subscribed
    • Tenzin kabsang
    • Already have a WordPress.com account? Log in now.
    • Tenzin kabsang
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar