Skip to main content

Posts

Date Conversion formats in SQL Server

SQL Server supports different options to format Date/Time string.   Date Convert Format Result CONVERT(VARCHAR(50), GETDATE(), 100) Oct 10 2018  4:28AM CONVERT(VARCHAR(50), GETDATE(), 101) 10/10/2018 CONVERT(VARCHAR(50), GETDATE(), 102) 2018.10.10 CONVERT(VARCHAR(50), GETDATE(), 103) 10/10/2018 CONVERT(VARCHAR(50), GETDATE(), 104) 10.10.2018 CONVERT(VARCHAR(50), GETDATE(), 105) 10-10-2018 CONVERT(VARCHAR(50), GETDATE(), 106) 10 Oct 2018 CONVERT(VARCHAR(50), GETDATE(), 107) Oct 10, 2018 CONVERT(VARCHAR(50), GETDATE(), 108) 04:28:25 CONVERT(VARCHAR(50), GETDATE(), 109) Oct 10 2018  4:28:25:467AM CONVERT(VARCHAR(50), GETDATE(), 110) 10-10-2018 CONVERT(VARCHAR(50), GETDATE(), 111) 2018/10/10 CONVERT(VARCHAR(50), GETDATE(), 112) 20181010 CONVERT(VARCHAR(50), GETDATE(), 113) 10 Oct 2018 04:28:25:467 CONVERT(VARCHAR(50), GETDATE(), 114) 04:28:25:467 CONVERT(VA
Recent posts

The React Cookbook Advanced Recipes to Level Up Your Next React App

Virtual machines vs. Containers

One of the questions that often comes up to anybody who's in the cloud space is, what are the differences between virtual machines and container? When should use one versus the other? Unfortunately the answer is not so simple clear-cut. We can't say you should always use containers or always use virtual machines. But, there are some things to keep in mind. There are certain kinds of applications which benefit from running in containers or using micro services in general. Microservices means taking an application and decomposing it into smaller parts. This is really good if you need to build a web scale application and you need to have the ability to turn up different dials of performance somewhat independent of each other. For example, take the middleware piece or the front end or the database piece and you need to scale them individually. The other benefit of containers is a consistency between the development environment and the production environment where you can take thing

Javascript - Unanswered questions - Part 1

What is Event delegation? Event delegation is Javascript as it relates to the DOM. It basically means that if you attach an event listener to a DOM element that listener is not only firing on that DOM element. It's actually firing on every children in that. So, for instance if you have a navigation and so you've got an unordered list you've got list items and then you've got anchor tags inside that navigation what you have. If you add an event listener to the ul element in essence you're actually adding event listener to all of the children as well. In short, JS event listeners fir not only on a single DOM element but on all its descendants. What is Event Bubbling? It's actually inverse of Event delegation. Also known as propagation, events on an DOM element will bubble up and also fire on all parents.  What's the difference between "target" and "currentTarget"? target is the actual element that triggered the event for example clicked, wh

Microservices vs. APIs

It still surprises me just how many times I come across misconceptions around Micro Services and APIs. Often hearing phrases like micro services are fine grained web services or API is themselves are equivalent to micro services. These all sort of show fundamental misconceptions under the covers. So, I've written this just to really break that out and explain about what the key differences are in those two concepts. What is an API? An API, fundamentally Application Programming Interface, that is an interface. It's a way of making requests into a component. So it's the route that you go in to make those requests. In modern use that typically means a REST API, that's a call made using HTTP protocol using JSON data as the payload. What are Micro Services? So let's ensure we also have a clear crisp definition on what a micro service architecture really is. Micro-Services architecture is about breaking down large silo applications into smaller components. That are more m

Microservices vs. SOA

What is a micro service? Small, individually, independently deployable application components that are self-contained and exposed through lightweight http based APIs. Here the independence of the of those components is really important because it has lot of ramifications in terms of how manage large-scale deployments of this architecture. Some people may say micros services are contrary to service oriented architecture. Actually, that's not true, Micro services are extension or evolution of service oriented architecture. The same principles still hold true but then it fixes lots of problems that were there in the service oriented architecture like large ESBs (Enterprise service bus), unwieldy configurations and scalability issues. It breaks that down into small reusable components that now you can scale individually or you can manage individually, so it gives lot more flexibility. Why IT industry has moving towards Micro Services? Well, obviously Agile and Scrum are big factor in t

Node.js for Everything

Lots of web applications using Javascript for front end for a long time. Javascript enabling people to build really really interactive great products, we can use Javascript on the front end and on the back end. So, what do we do on the back end? Node.js is the answer. Here we'll see some of the npm packages that'll help us to enable Javascript in back end as well. Load balancing is the main one when you plan to host your application server environment. Node offers pm2 package to easy your job. It's modern CLI process manager for Node apps with a builtin load-balancer. npm install pm2@latest -g pm2 start app.js Next thing is running applications continuously. Yeah, we've a node package named forever. It's a simple CLI tool for ensuring that a given node script runs continuously. npm install forever -g forever start app.js Enabling debugging in Javascript client applications are easy. Debugging a node application is sometimes a black box sometimes not, but one of the