Cyclomatic Complexity
Cyclomatic Complexity

Cyclomatic Complexity is a software metric used to calculate the complexity of a program. It is a measure of number of possible use case flows for a given program’s source code and is directly dependent upon the number of control flow statements (if/else statements and switch cases) within the code. For example, a method with... » read more

Uploading Unknown Format Excel File To A SQL Database
Uploading Unknown Format Excel File To A SQL Database

Introduction Usually it is expected from client side to upload only structured Excel sheets (sheet with defined Column Names and data types for Rows) to load to server. But sometimes you might also require to dump whatever is in the Excel directly to your database. While there is a tool that is provided by SQL... » read more

Post on ASP.NET Web API

Here are links to my two other posts which were published on TutsPlus. Introduction to ASP.NET Web API Securing the Web API You can find the full code in my git repo. Thanks!        

A Knight’s Watch
A Knight’s Watch

Recently I came across this interesting problem through Toptal (on Codility) which kept me thinking hard for a few days. Finally, I now have a solution to this problem and would like to share it here. Problem: Basically, the problem deals with a knight piece on an infinite chess board. Assuming the knight is positioned... » read more

Image File as Response from .NET Web API

When developing a web API, it is often required to send response as a PDF or image file.Following lines of code will assist to create method that will override the default media type of the response determined by Content Negotiation. public HttpResponseMessage GetImage()        {            byte[] bytes =... » read more

Automating Development in ASP.NET MVC

Inspired by rapid development framework Artisan in Laravel for PHP, I am thinking maybe we (.NET developers) can do something similar in our environment as well. http://laravel.com/docs/5.0/artisan Basically I am thinking of automating the whole process of creating Repository classes (including required entries for properties and fields), Model classes,  Service layer (layer where you put... » read more

Flat File Splitter

At work the other day, I needed to write a program for splitting a text file (.txt) to smaller pieces. The file that we received from our client was a flat file of size of about 2.5 GB. I needed to import the contents of the file to our SQL Server database.  Since the file... » read more