Through this post I am going to implement a simple REST API with Node.js.

So, at the very first begining, we’ll see what is meant by REST API.

A REST API (also known as RESTful API) is an application programming interface that conforms to the constraints of REST architecture. REST is an acronym for Representational State Transfer. A REST API is a way for two computer systems to communicate over HTTP in a similar way to web browsers and servers.

When a request is made via a RESTful API, it transfers a representation of the state of the resource to…

This is going to talk on callback functions, callback hell, how to resolve this callback hell problem using promises and async/awiat using JavaScript.

First of all, I’ll give a breif introduction of synchronous and asynchronous JavaScript.

In Synchronous Javascript, when we run the code, only one operation can happen at a time because it is single-threaded. So, all other processes are put on hold while an operation is executing.

In Asynchronous Javascript, when we run the code, multiple operations are executed simultenously.

For more information, you can refer my previous article which is regarding JavaScript asynchronous and synchronous behaviours.

  1. Callback…

The basic idea behind the JavaScript synchronous and asynchronous behaviours.

By default JavaScript is single threaded and synchronous language. In synchronous way, the code executes sequentially. That means it will do one thing within one time unit and freeze the rest in meantime. Therefore executing in synchronously is time consuming.

Code

console.log("First Statement");
console.log("Middle Statement");
console.log("Last Statement");

Output

First Statement
Middle Statement
Last Statement

This is an example for synchronous code block. So, it is executed by JavaScript call stack as line after line. …

Smoothing using Mode, Mean and Medain Filters

Image smoothing which is known as low pass filtering is a key technology in image enhancement. Noises are presented due to limitations in imaging system, poor sampling and digitization or transmission. So, through smoothing it actually removes high frequency content (e.g: noise, edges) from the image resulting in edges being blurred when this is filter is applied.

The low-pass filters usually employ moving window operator called kernel which affects one pixel of the image at a time, changing its value by some function of a local region (window) of pixels. The operator moves…

Through this blogpost, I am going to talk about the blockchain technology. So first of all, let’s have a look at what is blockchain technology.

In simply, blockchain is a chain of blocks. But it is not in the traditional sense of those words. Sometimes a blockchain is referred as Distributed Ledger Technology (DLT). The purpose of blockchain is to solve the double records problem without the need of a central server.

A blockchain has three main concepts which are block, node and miners. Let’s see what these concepts are.

Blocks — Every chain consists of blocks. Data is cryptographically…

Ishara Sandeepanie

Undergraduate at University of Moratuwa

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