Posts

Showing posts from 2018

Nodejs auto restart server | NodeJS watch file Changes

Image
NodeJS Logo(Source: Wikipedia) When we working with nodejs application manually restarting our application is the tedious task for everyone, so everytime when we working on node application then we may think that How to watch node file changes or just simply  watch node file changes right? So we will see how can we overcome this problem with simple step by using nodemon to watch file changes. Step 1: Create sample application with the following command: $ npm init -y #-y for accpeting default configuration Wrote to /home/ubuntu/dev/blogTutor/package.json: { "name": "blogTutor", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "Vikas", "license": "ISC" } Step 2: ...

What is an objects in Javascript

Image
What is an object in Javascript? If you have read my last post about object-oriented programming in Javascript . I hope you have got some idea about what is object-oriented programming in Javascript. so Now we will see What is an object in Javascript.  First, we will look at what is meant by object: An object is a real-time object and can be a variable, a data structure, a function, or a method, and as such, is a value in memory referenced by an identifier. Let's take a look at the following code. var userName1="Vicky"; var userPassword1="VickyPassword" var userEmail1= "vicky@vicky.com" var userName2="Sagar"; var userPassword2="SagarPassword" var userEmail2= "sagar@test.com" var userName3="John"; var userPassword3="jOhnPassword" var userEmail3= "easyjohn@sample.com" As you can see if we want to use more than 100 records then it will become a tedious job to handle...

Object Oriented Programming in Javascript Tutorial

Image
Object Oriented Javascript Tutorial Hello, All as the title suggest we are going to understand what is object-oriented in JS .  for those we don't have knowledge about Object Oriented Programming language, let's understand the terminology out OOP Language. OOP language is totally based on objects where the objects contain data, methods, and its attributes. let's take a realtime example as follows: I have fruits which are as follows as Banana, Orange, Lemon, Apple, Mango etc, so if I want to find a number of fruits I have then I can use length function to find out. The same way in  Javascript fruits  array is an object which has some properties and methods like  length is a property of array and sort is the method of an object. Nowadays, the Object-oriented Programming language is the more popular style for the programming language, and Javascript has taken the OOP concept from the scratch only. If we go d...

Visual Studio: Cannot find runtime 'node' on PATH

Image
Visual Studio code error: Cannot find runtime 'node' on path Error. If you are working on NodeJS   Project and using Visual Studio Code as your IDE. Visual Studio Code provides debugging NodeJS application feature as well. To Run Debugger you just need to Select Debugger from Menu and start debugging.    But if you are using nvm on your machine then it may happen that you are using the different version to run node application and Visual Studio Code uses different node version. Sometimes Visual Studio Code doesn't find node so it will throw the following error. And if you see the launch.json file it will look like below. { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version" : "0.2.0" , "configurations" : [ { "type" : "node" , "reque...

Installation & Introduction to Crystal Language

Image
Source: Wikipedia Today, I have started exploring new programming language called Crystal . Why Crystal Language: Speed:  Crystal is compiled language based on LLVM framework so it directly gets executed on runtime. Syntax : As Crystal lang tagline suggest Fast As Slick as Ruby, Crystal uses ruby language like syntax to write code. Statically Type check :   Crystal is statically type checked language so any type of errors will be shown or caught on compile time rather than fail at runtime.  Clean : Crystal has built-in type inference, so most type annotations are unneeded. Null Reference Check:  Compiler automatically checks for null references in compile time only. Macros: We can create and use macros so it's easy to use. your dynamic method definition could be replaced with a compile-time macro in as many lines of code. Green Threads:  Crystal uses green threads, called fibers , to achieve concurrency. Fibers communicate with each other...

How To Enable Hotspot in Ubuntu Via Terminal

Image
Hello Guys, I am using my Ubuntu 18.04 laptops hotspot to share the network with mobile and other devices. for that everytime, I need to go to settings then select WiFi and then need to turn on hotspot hush😰. So I thought that can I start this via terminal instead of this process. I searched for it but didn't get a good solution and after searching for an hour I am able to start it using terminal only so I decided to share this simple command to start hotspot in Ubuntu. $ nmcli device wifi hotspot con-name my-hotspot ssid my-hotspot band bg password P@ss123456 when you run this command you will see the following output. So your WiFi Hotspot is enabled, enjoy your surfing on your mobile as well. :) Edit 1:  Some of my colleagues asked me to do with windows machine so I created 1 BAT file to start hotspot as well, so here is the process to start hotspot on windows 10 laptop. For Windows we need to create BAT file so when we click on it then it can ...

Install Ethereum Mist on Ubuntu

Image
Installing Ethereum Mist On Ubuntu The Mist browser is the tool of choice to browse and use Ðapps or blockchain apps. So you are a beginner at ethereum development then you will require to install Mist for better development view. So let's start with installing Mist. Go to  Mist Github Release link You can select any mist as per your OS is, and download it. Now I will show it on Ubuntu installation. Go to Download folder and run following command. $ sudo dpkg --install Mist-linux32-0-11-1.deb  if this will not work then run the same command with force as follow. $ sudo dpkg --install --force-all Mist-linux64-0-11-1.deb Now when you run mist command then it will open the mist browser. Thanks if you have any queries please comment it out.   

Install Java JDK 10 on ubuntu 18.04

Image
Java JDK is the essential part of developer life to run & develop applications. In this tutorial, we are going to see how to install Java JDK on Ubuntu 18.04. Open Terminal by pressing Ctrl+ Alt+ T   or directly searching from the search bar. Run following commands vikas@machine:~$ sudo add-apt-repository ppa:linuxuprising/java vikas@machine:~$ sudo apt-get update vikas@machine:~$ sudo apt-get install oracle-java10-installer It will ask you to accept the License Agreement  After this, you will see the following type of message on the terminal. Now we need to run a command to set JDK 10 as default JDK, run the following command for it. vikas@machine:~$ sudo apt-get install oracle-java10-set-default Now run java --version on the terminal you will see the following message when you have configured JDK successfully. Here your JDK is ready...

Upgrade Ubuntu 16.04 to 18.04

Image
Following are the steps to  Upgrade Ubuntu 16.04 to 18.04 : If you are planning to  upgrade to Ubuntu 18.04 and you don't know  how to upgrade ubuntu 16.04 to 18.04 then you are the perfect place. I will show you how to do it,  follow the following steps to install it. Search Software Updater & Select Software Updater. Go to Software Updater Select Setting from Software Updater. Go to Updates tab and Then select the following version selection as we are going for LTS(Long Term Support) select Long term Support . After that close this window and click on Install Now. The installation will start we have to wait to complete this installation.   After this click on Restart Now Button. You will think that after restart it will finish but not we have just updated the packages, We have to install it. To install it open the terminal and run following command mymac...

Flutter fails on `flutter` command : Invalid version constraint

Image
Image Source: Wikipedia As you have started to learning flutter and you have tried to install their dependencies from flutter official document. And when you tried to install it and if you get the following error. you can fix it easily. flutter init - o my_app Resolving dependencies ... Error on line 17 , column 16 of pubspec . yaml : Invalid version constraint : Could not parse version "^1.4.0" . Unknown text at "^1.4.0" . stack_trace : ^ 1.4 .0 you will get Invalid version contraint error then the following are the possibilities. Your Dart version can be outdated so you can install it using following command brew install dart@ 2 sudo apt-get install dart Set your path properly: export PATH =[ PATH_TO_FLUTTER_GIT_DIRECTORY ]/ flutter / bin : $PATH Thats it... I hope this will fix your issue.