Training deep learning models is time-consuming, and you can easily spend a day on just that. So most of the models are trained, and the best practice in this area is to train using GPU.

I personally prefer using Pytorch for deep learning, and in this blog post, I would like to provide helper functions that I use for training the same.

Get Default device on the Machine

To get the Default device on the device. Sometimes I use my personal laptop to train the model, which doesn’t have GPU then; this function allows me to seamlessly switch based on where the model is trained.

This series is based on Raw coding, and it can be considered a written version of the video.

Let’s start with an empty Core application with a Home controller and a couple of actions(Index, Secret). As the name suggests, I want to protect the remote endpoint, and a simple way to do the same is the [Authorize] attribute.

So if you run the application you will be able to bring both the Home view and Secret. So how do we stop the secret view?


To make the authorized attribute work you need to add the relevant middleware and…

System.Threading.Task is one of the de facto best practices for .net programming for async programming for all these years. C# 7.0 has added a cherry on top of it with Value Task for optimizing performance and abstraction.

Performance benefit

To illustrate the benefit in performance, Let’s call an API to return the restaurant data for a particular city and cache the result. I have used caching here to show that there is a mix of synchronous and asynchronous code.

I ran the benchmark test with the Value Task and Task, Here is what the benefit.

As per the result, we are…

Until or unless you are living in a cave, it is hard to not to know about docker. Microsoft has made sure it is marketing the technology with a various possible channel. The problem with this approach people often tends to read between the lines and understood docker as another Virtual machine. So in this blog post, I am going to explain it with three use cases where it fits appropriately and how to make an informed decision when it comes to docker.

Use Case 1: General Use/Ops.

Lets us take an example of installing Elastic Search/Kibana for adding a search to the application. It…

Microsoft has introduced a new library for integration testing Microsoft.AspNetCore.Mvc.Testing as a part of the core 2. In the previous version of the .net framework, I have used Microsoft.Owin.Testing package for doing the integration test and this seems like a logical extension to the same with some batteries included.

In this Blog Post, Let me show how to get started by using the library and apply a few best practices which I have learned in the past few days.

Getting Started :

As with any good .net library, you can download it using NuGet.

It includes a new WebApplicationFactory that I point… core is a minimalistic framework, and it gives complete control for building an application on your own, and I have found its footprint as minimal as possible.

With that power comes the responsibility too. One of the problems which I recently faced is supporting content negotiation based on the client type. Well in my case it was straightforward to support XML based on the request header.

As I told about core content negotiation is not available out of the box, but it is quite easy to achieve the same.To …

Experimenting and learning is part of DevOps mindset, and Azure Websites is one key component which allows you to do it efficiently.

Imagine a day where you got a Billion dollar idea for changing the world, and you want to deploy the application to experiment your idea then Azure websites allow for the free plan for deploying websites and based on the learning you can scale the website based on the demand.

Azure Websites is part of the Azure App service plan family, and it is one of PAAS offering from Azure.

Once you have developed your Web app or…

This is small trick which I learnt and thought adding a blog post for the same. We always start working on the idea which comes to our mind and later think it is worth sharing it to the world . So I always think after the first MVP I will put my source code to GitHub . But since we already have code you need to Initialize and add a repository will be a tough job to do .

You can do this in Visual studio now with the easy way

Click on the Add to Source Control in lower…

Database deployment is really the elephant in the room with respect to the continuous delivery for software projects. Most of the best practices for doing continuous delivery well documented and there are lots books which talks the same with respect to code .

Dev ops consultants and Database Migration

When it comes to database, It is hard to find best practices and how to use it properly . so here are some best practices which I learnt over the years .

Audience Level : Application developer , Database administrators and Build administrator.

Key Idea

Simple yet powerful principle to always keep in mind when comes to…

Exceptions are one of the least considered item when it comes to architecture and developing application . Conversations about exceptions always goes as follows

If there is a exception , We will Log it and show an error page to user — Yoda from Star Trek

In software systems, exceptions will occur. Even with perfect, bug-free code, problems will arise when we have to deal with the issue of connectivity. If a database is overloaded, or a web service is down, we have no recourse except to try again.

Here are some of ways to differentiate the exception and this…


I build intelligent Web Apps

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store