Posts

My Coding Experience

I have learned coding in my 12th class during the summer holidays at the age of 16.  The first program tutor taught me was "Hello World". At that time I did not understand why we need to print and what is the use of printing something on the screen. It was funny. My first assignment was writing a program to tell whether a given number is prime number or not. I had written logic on my own. Then I realized the power of coding because my code was able to tell any number whether it is a prime or not. So slowly I started developing interest in coding. After few years I have started participating in online coding competitions.    When I was in college I had written code to solve Sudoku puzzle. My friends appreciated me for that . After I became Software Engineer I tried to implement chess game. It is able to do well up to 3 or 4 ply. I am glad that it is able to defeat me:).   As part of my profession I have special interest in optimization. My current project i...

Working with Azure B2C Single Sign On in Asp.net core website

Image
When we want to use Azure B2C on our website for authentication first we need to create a tenant for that. It is a unique url which identifies your app and your login process will be redirected to that tenant url. For example, if we don't user Azure B2C,  when we click on login button generally we see user name and password fields on the page. After entering the user name and password will be validated against our database. If they are correct then we allow them to access other pages on the website. But when use Azure B2C, the moment user clicks on login button they will be redirected to a page where the entered credentials will be validated against azure active directory. Then link for login button will be tenant url. To add Azure B2C authentication to your web site follow the below steps. Step #1:  Login to azure portal  and create a Tenant. Step#2:  After creating tenant we need to create an application. This application comes with a key. By...

How to record Skype calls along with Video and Audio in Windows 7+

Image
Skype doesn't have inbuilt call recording feature. In this article I will explain how to record skype calls along with audio and video. For this we need ffmpeg and NAudio. Ffmpeg is a open source encoder through which we can record screen and microphone's audio. But it does not support to record speaker output. For this we need NAudio. Now let use see the implementation. Step #1:  Download ffmpeg and identify the System's microphone.  Download ffmpeg ffmpeg.exe is command line program for which we need to supply the needed commands.  To record the audio and video we need to supply the below command. Before doing that we need to identify which microphone system is using. To know the execute the below command. command to display audio and video devices: ffmpeg -list_devices  true  -f dshow -i dummy   when you run the above command it will list down all the audio device. My microphone audio device is  ...

Working with Observable and BehaviorSubject in Angular

Image
Observable: Observable opens a continuous communication channel which can emit multiple values of data over a  period of time. Observable will not be invoked until you subscribe to it. The subscribe method has three call back functions as parameters. When ever the data is available then first callback function will be invoked. When there is an error then second callback method will be invoked. Once you call complete() from observer then third callback function will be invoked. Here is an example. Step #1:  First import necessary libraries. import { Observable } from ' rxjs ' ;   Step #2:  Declare a variable as Observable and  define Observable.  data:Observable<number>;    ngOnInit(){         this .data =  new  Observable(observer=>{          observer.next(1);          ...

How to create multi project templates in Visual Studio 2017?

Image
Project templates are very useful and helps developers to make initial set up ready. For example, if you are working on a web project which needs other layers like Data, Entity and Service..etc. You may create each of them as a library projects and refer among them as you need. But when you start with another web project you may need to do all this process again. Because Visual Studio by default does not support multi project templates. In this article I am going to explain how to create multi project templates and make them re-usable. In this example I am using .Netcore Web Api project. Step #1:   Create a .Netcore WebApi Project using Visual Studio. Select the Api project as shown below.  Step #2:   Create Data, Entity and Service layers as library projects.  Create Entity and Service layers in the same way. Once you create all the layers the Solution explorer should look like below.  Step #3:   Now we need to add re...