Thursday, March 01, 2018

How to Get First and Last Day of a Year from SQL

Here is how we get first day and last day of the year.

DECLARE @Year int 
set @Year = 2018
select DATEADD(year,0,DATEADD(year,@Year-1900,0)) 
/*First Day of the year*/
select DATEADD(day,-1,DATEADD(year,1,DATEADD(year,@Year-1900,0))) 
/*Last Day of the year*/

We can also get Year dynamically from SQL by passing current date. This works form SQL 2005 and above.

SELECT Year(getdate())

Tuesday, February 20, 2018

Paste JSON as Code - quicktype

quicktype infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language. To use this extension, just copy some JSON and use Edit/Paste JSON as Code.

This extensions works only in VS2017 as of now.

For a more powerful experience, including custom options and the ability to generate code from JSON Schema or multiple JSON samples, try app.quicktype.io.

Download here

Wednesday, January 31, 2018

How to get the IP Address of a Remote Socket Endpoint

Here is how we can IP address, you need to use below namespace library

using System.Net.Sockets;

IPHostEntry ipHostInfo1 = Dns.GetHostEntry(Dns.GetHostName());
// loop through list of system IP address 
// get the IP4 Address of the current machine
foreach (IPAddress ipaddr in ipHostInfo1.AddressList)
{
    if (ipaddr.ToString() == ConfigurationManager.AppSettings["SystemIPAddress"].ToString())
    {
        strIpAddress = ipaddr.ToString();
        break;
    }

}

                
IPAddress ipAddress = IPAddress.Parse(strIpAddress);

Hope this helps!

Thursday, January 18, 2018

What is .NET Core?

ASP.NET Core is a free and open-source web framework, and the next generation of ASP.NET, developed by Microsoft and the community. It is a modular framework that runs on both the full .NET Framework, on Windows, and the cross-platform .NET Core.

The framework is a complete rewrite that unites the previously separate ASP.NET MVC and ASP.NET Web API into a single programming model.

Despite being a new framework, built on a new web stack, it does have a high degree of concept compatibility with ASP.NET MVC. ASP.NET Core applications supports side by side versioning in which different applications, running on the same machine, can target different versions of ASP.NET Core. This is not possible with previous versions of ASP.NET.

Features

  • No-compile developer experience (i.e. compilation is continuous, so that the developer does not have to invoke the compilation command)
  • Modular framework distributed as NuGet packages
  • Cloud-optimized runtime (optimized for the internet)
  • Host-agnostic via Open Web Interface for .NET (OWIN) support - runs in IIS or standalone
  • A unified story for building web UI and web APIs (i.e. both the same)
  • A cloud-ready environment-based configuration system
  • A light-weight and modular HTTP request pipeline
  • Build and run cross-platform ASP.NET Core apps on Windows, Mac, and Linux
  • Open-source and community-focused
  • Side-by-side app versioning when targeting .NET Core.

Friday, November 10, 2017

Epic v Stories vs Bugs

We have stories, epic and bug while creating an issue in JIRA system.

Here is difference between Epic v Stories vs Bugs

Epic:
An Epic can be defined as a big chunk of work that has one common objective. It could be a feature, customer request or business requirement. In backlog, it is a placeholder for a required feature with few lines of description. It tells compactly about final output of user needs. In the beginning, it may not contain all the details that team needs to work on. These details are defined in User Stories. An epic usually takes more than one sprint to complete.

User Stories
Epics are large user stories, typically ones which are too big to implement in a single iteration and therefore they need to be disaggregated into smaller user stories at some point. A user story is a very high-level definition of a requirement, containing just enough information so that the developers can produce a reasonable estimate of the effort to implement it

Bugs:
A software bug is an error, flaw, failure or fault in a program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways based on the backlog or features in software cycle.
While communicating a bug, we need to make sure that a potential problem exists in the code that your team is developing. When you define a bug, you want to accurately report the problem in a way that helps the reader to understand the full impact of the problem. You should also describe the actions that you took to find the bug so that other members of the team can more easily reproduce the behavior. The test results should clearly show the problem. Clear, understandable descriptions affect the probability that the bug will be fixed.

Hope this helps!

Thanks