Posted in Interesting, Programming, Web Tech

Blockchain

What is Blockchain?

Blockchain is a decentralized and distributed system with details of digital records of transactions. The digital based ledger records are often referred to as blocks. The blocks of individual records are linked together like a chain. Hence it is collectively referred to as a blockchain.

The blockchain was invented by Satoshi Nakamoto for public transaction of bitcoin cryptocurrency.

What does a Blockchain contain?

Blockchain contains information about data i.e. relevant information about transaction, hash which is a unique code for the block, previous blocks hash. The first block which does not have previous block’s hash is called Genesis block. This series of information inside a block helps in tracking the history and difficult to modify the blockchain records hence adds security.

How transactions are done in blockchain?

For a blockchain the decision of adding the transaction to the chain is done by consensus and not by a single administrator as incase of centralized system. The majority of computers connected in the network have to validate the transaction. Also data that is available on blockchain network cannot be deleted from all systems as everybody in the network holds copy of blockchain records.

Uses of blockchain?

In cryptocurrency like bitcoin blockchain technology is very useful. Bitcoin eliminates the need of middle layer of banks and helps in asset to asset transfer as it is without the conversion of currency values based on location.

In real estate, the use of blockchain eliminates the need of notary. The records of real estates buying and selling gets recorded in the blockchain.

In hospital management system blockchain is used to record patients relevant data for doctors to access.

Posted in Interesting, Open Source, Programming, Softwares, Web Tech

Types of web cookies

This post in continuation to my earlier post which explains about Web cookie

There are types of web cookies namely

  • Session cookie: They are created during a session of user, stored in a temporary memory. They do not have any expiration date and are deleted immediately as soon as the browser is closed. The other popular names of session cookie are non-persistent cookie, transient cookie, in-memory cookie.
  • Persistent cookie: For this cookie, an expiration time is set. So, the cookie is deleted only at the expiration time and not deleted as soon as the browser is closed. They are used for maintaining session of the user. That is, once the user is logged into the website and if the user closes and reopens browser the cookie identifies if its a authorized user or not.
  • First party cookie: This cookie is set by the website and the cookie information can be used for analytics of page views, number of logged in users etc.
  • Third party cookie: Unlike first party cookie, this cookie is set by another website domain (not directly visited by user) whose plugins are used by the primary website.
  • Secure cookie: This is a cookie with encrypted data which can be used over an encrypted HTTPS connection. They are useful in e-commerce and banking websites where the safety and security of transactions in the topmost priority.
Posted in Interesting, Programming, Web Tech

Web cookie

You have been browsing the internet and chances are when you visit a website for the first time then for some of websites you may have come across a pop-up or a notification banner: “This website uses cookies” with buttons for accept and change settings. Sometimes you just say, Oh whatever that is! Let me just get into the website and press the Accept button to go about your way. So let us understand what is happening behind the scenes.

What is a web cookie?

Web cookie or browser cookie is a small piece of information which is send from website server to be stored in a user’s browser. The user may store it in its computer which is basically used to identify the computer. That is, maintain stateful information so the next time, user visits the website or on the next request it can send back, the cookie that can have some kind of information about the user that the server can make use of to make certain decisions. Other purposes could be for instance, track user’s browser activity or remember login details, track site’s user count etc.

Who invented it?

The term was coined by web browser programmer who invented cookie Lou Montulli in the year 1994 while building an e-commerce website.

Why do we see the cookie banner pop up?

The reason why we see the cookie banner popping up recently across most websites is because of legal concerns in Europe and some other countries, the GDPR(General Data Privacy Regulation) requires that the cookie banners be displayed on website to let the users know that cookies are being used by the website.

Where is a cookie useful?

Its used in session management to manage session of the user in ecommerce website. Its used for personalization like the settings that were set and saved by the user and as said earlier, also used for tracking to improve the user experience as they say it 😉

Posted in Interesting, Open Source, Softwares, Web Tech

Digital footprint

What is digital footprint?

So, you are an active internet user. You have atleast one social media account and in some point of time have uploaded a photo, shared a video, have liked/commented on friend’s post. Also, the likes on a post,  private chat messages, the online shopping search of your favourite brand etc. Aren’t these the activities we, as individual’s tend to do to be connected and engaged or in search of something online? In simple terms, all this content builds up what is called as digital footprint.

That means, digital footprint also referred as digital shadow is a content (text or audio or video) with a set of traceable digital activities of an individual on the digital devices or any internet platform. That is, the stuff  what you leave behind when you use online services for online shopping, social networking etc.

Why should you be concerned about digital footprint?

Once you are logged into any website be it for online shopping or listening to a trending song, remember that web is secretly tracking all your actions allowing the targeted marketers to advertise exactly what products you have been browsing in you recent past. Also social media platforms often introduce new policies of usage that we may tend to accept just by clicking Accept/Ok button without actually reading the policies. User privacy is a concern.

All this data can be leaked to make a profit out of it for research in terms of marketing products and building it better for human convenience where a set of customers habits and user experience can be traced.

Can we avoid not being eavesdropped?

As suggested by one of my friend you may say as well, if privacy is a concern browse without login into websites, use browser’s incognito mode, clear browser history. That doesn’t solve the problem at base level as there is this loophole: every device has a unique IP address and uniquely the browsed content can be easily traced.

Posted in Interesting, Open Source, Programming, Softwares, Web Tech

JSON : JavaScript Object Notation

What is JSON?

JSON is a standard format for storing and exchanging data. This format is easy to understand and write. JSON is text, and we can convert any JavaScript object into JSON and vice versa. JSON format is language-independent. The JSON files can be named with extension .json.

JSON Syntax

A JSON object is enclosed inside curly brackets. Data is represented as key-value pairs separated by commas. Object data is represented inside curly brackets. Array data is represented inside square brackets.

eg. {“name” : “Nancy”, “age”: 50, “gender”: “female”}

JSON data types

Out of key-value pair, key can be string, number, or identifier names. The value can be of data types such as

  • string
  • number
  • object (JSON object)
  • array
  • boolean
  • null
Posted in Interesting, Programming, Softwares, Web Tech

Because…”this” is not that

Yes! You read it right. This is not that in Javascript and otherwise.

The this keyword in javascript can be confusing for a naive JS learner. Its behaviour varies depending on the execution context. In general, this refers to the object under current execution.

  • this, when used alone refers to a global object.
var a = this;
console.log(x);

A browser window

  • this, when used in an object method, refers to owner of the object method.
var car = {
 model: BMW,
 colour: black,
 details: function(){
    return this.model + " " + this.colour;
 }
};

this refers to the car object. The car object is owner of its properties and methods.

console.log(car.details());
BMW black
  • this, when used in a function refers to a global object
function testFunction() {
  return this;
}

returns the global object [object Window]. However, in strict mode, the above testFuntion returns undefined

  • this, when used in event handling

refers to the html DOM element on which the event listener is placed

Click here!

alerts with button tag name.

Posted in Interesting, Open Source, Programming, Softwares, Web Tech

Web browsers and JavaScript engine

What is a JS engine?

A Javascript engine is a computer program that executes JS code in a web browser. The engine is developed by web browser vendors.

The first JavaScript engine was created by Brendan Eich in 1995 for the Netscape Navigator web browser. This has evolved to be known as SpiderMonkey engine used by Firefox.

In general, JS engines are also known as ECMAScript engines. As many web browsers there are, so are the JS engines.

  • Google chrome has V8 engine.
  • Mozilla Firefox has SpiderMonkey
  • Microsoft Edge and Internet Explorer has Chakra
  • Apple Safari has JavaScriptCore
  • Opera has Carakan(pronounced Tsharakan)

Each JS engine works in a more or less similar fashion. But, the most popular being V8 engine which used in Chrome and Node.js

Posted in Interesting, Open Source, Programming, Softwares, Web Tech

Code Linting

What does linting mean?

Linting in software world means analyzing the developed source code for potential errors and warnings such as syntactical, logical (which might have got introduced without the knowledge of a developer) with the help of a program. The program is called as a lint or linter.

Why is linting important?

This mechanism of running lint ensures that the code is bug free and adheres coding guidelines of a particular language. This also helps in maintaining code quality reducing technical debt incurred.

Each language has its own linting tools. For eg. Javascript has JSLint, JSHint, ESLint etc.

  • JSLint is a static code analyser which checks if code complies JS coding rules. Its available on jslint.com. The CLI is also available. It was created by Douglas Crockford in the year 2002.
  • JSHint was created by Anton Kovalyov in the year 2011 and is a fork of Duoglas Crockford JSLint project. Anton thought that JSLint was “too opinionated and less configurable”. Both, online jshint.com and CLI versions  are available for this.
  • ESLint was created by Nicholas Zakas in the year 2013 as a static analysis tool which identifies problematic patterns in javascript. This tool is an advanced version of JSLint and JSHint. ESLint covers both code quality and coding style issues which were not covered by JSLint and JSHint. It supports current ECMAScript standards.Online available on eslint.org and as of March 2019 ESLint is a part of OpenJS foundation. Companies such as JetBrains has integrated support for ESLint in their WebStorm code editor and Facebook has published official ESLint plugin for React projects.
Posted in Interesting, Open Source, Web Tech

Web Accessibility

Ever wondered how a person with a impaired sight would be accessing the new era’s human peripherals. Hmmn…Human peripherals…?

Yeah! I am talking about the electronic gadgets most importantly our smartphones and apps on it. Do they have a difficulty in using technology? Does the web or gadget industry consider such special cases and provide features? Web is built and designed to work universally for everyone. Isn’t it? So is the web accessibility.

What is web accessibility?
In simple words, web accessibility is a way to ensure that technology which is available in various forms of tools, websites, apps etc can be accessed universally even by people with disabilities.

Is the world web concerned about this?

Definitely,  yes! To address this, W3C – World Wide Web Consortium considering different technologies and tools involved in building an application has come up with WAI – Web Accessibility Initiative.

WAI develops specifications, guidelines and supporting resources that describe accessibility solutions. These are considered international standards for web accessibility. WAI is an initiative to help people with disabilities that affect access to the Web, including:

  • auditory
  • cognitive
  • neurological
  • physical
  • speech
  • visual

In some nations, web accessibility is compulsory by law. Though this initiative of web accessibility was begun years back and websites/apps are built at a faster rate but somewhere only a minor percentage of the websites and apps have the full web accessibility features. Hopefully, future has more for inclusion!

Because, everybody is good at something. 🙂