Author Archives: Ajitesh Kumar

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking.

Docker – How to Access Root User without Password

If you have been trying different passwords to access root user in a docker machine terminal, do not worry. Following is the command which would get you access to root user without needing you to enter any password 🙂 sudo -i One could access the docker machine from docker terminal with following command: docker-machine ssh <docker-machine name such as default>

Posted in Dockers. Tagged with .

Docker – How to Install Docker Compose on Windows

This article represents tips and code samples which could be used to install Docker-compose on Windows. The instructions could also be found on this page. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points: Make sure you have Docker Engine version 1.7.1 or greater. Open a putty terminal accessing the “default” docker-machine or do “docker-machine ssh default”. You could put name of any other machine based on docker-machine in which you want to install docker-compose. Login as a Superuser using command “sudo -i” Install the docker-compose using following command: Do note that one would …

Continue reading

Posted in DevOps, Dockers. Tagged with .

AngularJS – Great Read on Compile & Link Functions of Directives

This is one of the finest page I have read on compile and link functions of AngularJS Directives. Worth a read! Thanks to the author, Jurgen Van de Moere, for putting a great blog on AngularJS. The nitty-gritty of compile and link functions inside AngularJS directives Following are some of the topics covered on this page: How directives are processed in AngularJS Lot of sample codes Great explanation of Compile and Link function

Posted in Javascript, Web. Tagged with .

MEAN Stack Apps Explained for Java Developers

This article represents brief description of What is MEAN Stack Web/Mobile App. Coming from Java background, I thought it to present an analogy for Java developers to get a quick understanding on MEAN Web/Mobile App. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: What is MEAN Web/Mobile App? A Web Application Stack in General Sample Web App using JEE (Spring/Hibernate) Framework A MEAN Stack Web/Mobile App   What is MEAN Web/Mobile App? A MEAN Stack based web/mobile app makes use of following technologies: M: MongoDB E: ExpressJS A: …

Continue reading

Posted in Javascript, Web. Tagged with , , , .

8 Reasons to Migrate to Ionic 2 Framework

This article represents some of the key reasons why one would want to adopt or migrate to Ionic 2. I am doing for my apps soon. Read out the original announcement on this page. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Significant Performance Improvements: Leverages Angular 2 thereby bringing significant performance boosts to the ionic apps. Additionally, some of the following improvements brought by Angular 2 will further boost the Ionic 2 adoption: Server-side rendering cross-platform views Web workers Improved Overall Navigation: The way ionic pages were navigated in past, especially, between standard and tabbed pages was …

Continue reading

Posted in Mobility. Tagged with .

Javascript – Promise Concept Explained with Code Samples

This blog represents concepts on Promise concept in Javascript with diagrams and code examples. Following is described later in the blog: Promise explained with simple example Promise execution timeline Promise program code sample   Promise Explained with Simple Example Lets say, a consumer program invoked an API and asked for the output. In synchronous world, the value is returned then and there and the caller program waits for the service provider program to respond. The execution of the program halts. Welcome Promise on board! With Promise concept, the service provider program can respond with a “promise” that it would return output value or error in near future and the caller …

Continue reading

Posted in Javascript, Web. Tagged with .

Javascript – Promise Chain Explained with Code Samples

This article represents tips and code samples on How to create and use a Promise Chain objects in Javascript. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Promise Chain Explained with Code Samples Following diagram represents the interaction between signup, Auth and User modules. Pay attention to some of the following in above diagram: Signup module invokes login API on Auth service which returns a Promise object. The Signup completes the sync operation & watches for the Promise returned by Auth service to be resolved. The Login API in turns invokes Get API on User object as a …

Continue reading

Posted in Javascript, UI. Tagged with , .

Javascript – Jasmine Unit Tests for Promise Object

This article represents tips and code samples in relation with how to write unit tests for Promise object when using Jasmine framework. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Sample Promise Object Unit Tests related with Promise Object Sample Promise Object Pay attention to some of the following in the code below: Auth module returns a Promise object that returns a User object when resolved or returns an error object in case of error. A JSON object is passed to resolve or reject method. Save the file …

Continue reading

Posted in Javascript, UI, Unit Testing. Tagged with , , .

Javascript – How to Define & Process a Promise Object

This article represents tips and code samples on How to define and process a Promise object. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: How to Define a Promise Object How to Process a Promise object How to Define a Promise Object Following demonstrates the Auth module with an API, login, that returns a Promise that will be resolved/fulfilled or rejected later with appropriate object representing domain object such as User or error object with status and error message as demostrated below. // Promise needs to be imported …

Continue reading

Posted in Javascript. Tagged with .

Javascript – Jasmine Unit Tests Explained with Code Samples

This article represents instructions and code samples on how to setup Jasmine along with unit tests code samples. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Set up Jasmine Development Environment Set the Jasmine Config Property Create Javascript Files including Jasmine.json, JS Modules & Unit tests Setup Jasmine Development Environment I would suggest setting up a Docker image for Javascript environment consisting of key tools such as grunt, jscs, jshint, typescript, browserify, nodejs etc. Check my page on How to setup Javascript Dev Environment using Dockers. Set the …

Continue reading

Posted in Javascript. Tagged with .

Javascript – How to Get Started with JSCS

This article represents tips on how to get started with JSCS, a Javascript code styler checker tool. The tool comes very handy if you would want to ensure the consistent code formatting across the team. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Install/Setup JSCS Run JSCS & Code Samples Install/Setup JSCS One could install jscs using command such as “npm install -g jscs”. You could also setup Javascript development environment using Dockers as detailed in this page. Once installed, all that is required to be done is …

Continue reading

Posted in Javascript. Tagged with .

AngularJS – 6 Tips to Optimize the Digest Cycle

This article represents tips on making optimal usage of digest cycle which slowers the Angular app. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points in relation with optimization of Digest cycle: Only the most critical variables should be watched. For instance, one should avoid using $digest method in loop for every message exchanged. Usage of one-time binding syntax to avoid objects being added to $$watchers list and thus being checked for updates with each $digest run. The syntax looks like {{::name}}. With this syntax, once the name variable is resolved, Angular removes the name …

Continue reading

Posted in Javascript. Tagged with .

Dockers – How to Get Started with Spark on Windows

This article represents tips on how to get started with Apache Spark on Windows using Dockers. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. If you are familiar with Dockers, the instructions below would help you get started with Spark in no time. Download the Spark from https://spark.apache.org/downloads.html page. Remember to select a package type with option such as “Pre-built…”. Once the zipped files are downloaded, unzip the files under the location “C:\Users\<Username>” Build Java8 image and start the container. Follow the instructions on this page, http://vitalflux.com/dockers-how-to-get-started-with-java8-dev-environment/. Once the container is started, go to the folder where you …

Continue reading

Posted in Big Data, Dockers. Tagged with , .

Dockers – How to Get Started with Java8 Dev Environment

This article represents take away code samples and tips on how to setup Java8 container using Dockers and get started. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: Java 8 Image Dockerfile Install Scripts to Install and Start Java8 Env   Java 8 Image Dockerfile Following is Dockerfile for creating Java8 image. Name the file as java8_base.df. # Base is the Centos environment FROM centos:centos6 # Make the directories under which Java 8 will get installed RUN mkdir /opt/jdk RUN cd /opt # Install wget and tar which …

Continue reading

Posted in DevOps, Dockers, Java. Tagged with , , .

Ionic App – Automated Release APK Creation – Shell Commands

This article represents code samples which could be used to automate Ionic App release APK file creation further to which this APK file can be uploaded to Google Playstore and released. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Commands to Automate Building Ionic App Release APK Copy and paste following commands in a file named as release.bat. When ready to release, execute “release.bat” on the command prompt and you should have an APK file created for releasing it to playstore. Following are key points to be noted: Before executing below commands, one would be required to create …

Continue reading

Posted in Mobility. Tagged with .

NodeJS – How to Create & Instantiate a Class – Code Samples

This article represents tips and code samples on How to create and instantiate a Class in NodeJS. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Following are the key points described later in this article: How to Create a Class? How to Instantiate a Class? How to Create a Class? // This is a Constructor function taking age and passport // as the paramaters function Person(age, passport) { this.age = age; this.passport = passport; } // Sets the age // Person.prototype.setAge = function(age) { this.age = age; }; // Checks whether the person is Adult based on the …

Continue reading

Posted in Javascript. Tagged with , .