Docker – Quick Java 8 or Java 7 Dev Environment with Dockers

This article represents code samples which could be used to build and start Java 7 or Java 8 Docker containers appropriately based on the needs with a single script and command such as “./startJava.sh -v 7 Java7” for Java 7 and “./startJava.sh -v 8 java8” for Java 8. This would be useful to try and test your Java code against Java 7 and Java 8 versions very easily based on the fact that you could start both Java7 and Java8 containers simultaneously and, run your code in these containers at the same time for testing. Please feel free to comment/suggest if I missed to mention one or more important points. …

Continue reading

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

Angular 2 – Components Explained with Code Examples

This article represents concepts and code samples around Angular 2 Components which resides at the heart of the Angular 2 framework as like Controller/Scope which resided at the heart of Angular 1 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 are Components? Components Explained with Code Samples   What are Components? Components are at the heart of Angular 2 apps. A component in Angular2 is used to represent a View along with associated logic (encapsulated as a Class), which will get executed based on interaction with …

Continue reading

Posted in AngularJS, Web. Tagged with .

Docker – How to Build & Get Started with Java 7 Container

This article represents tips and code samples on how to build a Java7 docker image and start Java 7containers. 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: Dockerfile to Build Java 7 Image Command to Start Java 7 Container   Dockerfile to Build Java 7 Image Following is the code for Dockerfile which could be used to build Java 7 image: FROM centos:centos6 RUN mkdir /opt/jdk RUN cd /opt RUN yum -y install wget tar RUN wget –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz RUN tar -zxf jdk-7u79-linux-x64.tar.gz -C /opt/jdk RUN …

Continue reading

Posted in DevOps, Dockers. Tagged with .

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 , .