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.

Code Samples on NodeJS Module.Exports

This article represents code samples on NodeJS Module.exports. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Code Sample for a NodeJS Module using Module.Exports Save the code as “room.js”. module.exports = { windowsCount: 0, doorsCount: 0, LARGEROOM: {doorsCount: 2, windowsCount: 2}, SMALLROOM: {doorsCount: 1, windowsCount: 1}, getDoorsCount: function () { return ++this.doorsCount; }, getWindowsCount: function() { return ++this.windowsCount; }, isLargeRoom: function(config) { if(config.doorsCount >= this.LARGEROOM.doorsCount && config.windowsCount >= this.LARGEROOM.windowsCount) { return true; } return false; }, isSmallRoom: function(config) { if(config.doorsCount <= this.SMALLROOM.doorsCount && config.windowsCount <= this.SMALLROOM.windowsCount) { return true; } return false; } }; Code to Execute Module …

Continue reading

Posted in Javascript, Web. Tagged with , .

Javascript – Module, Module.Exports & related Best Practices

This article represents definition and code samples on how to modularize Javascript functions and use them elsewhere in different Javascript file. 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 Module? What is Module.exports? Test the Module   Module: A unit encapsulating similar functions or a piece of code representing similar functions. For example, take a look at following code: var drawTraingle = function() { console.log(“Traingle drawn”); } var drawCircle = function() { console.log(“Circle drawn”); } Above code could be saved as draw.js. The file draw.js could …

Continue reading

Posted in Javascript. Tagged with , .

Code Samples to SSH into Docker Machine Virtualbox

This article represents quick code sample which would help you ssh into a docker machine. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. As you double-click Docker Quickstart Terminal, it opens up a terminal window thereby starting “default” docker-machine. If you want to login to this docker-machine, you could do that using following: Use Putty to login. As you open Putty, enter the IP such as 192.168.99.100 and click open. It would open up a terminal. Enter “docker” as username and “tcuser” as password and that is it. Use command such as “docker-machine ssh default” in the docker …

Continue reading

Posted in DevOps, Dockers. Tagged with .

5 Steps to Release Your Ionic App to Google Playstore

This article represents tips/steps and code sample which can be used to release your ionic app on Google playstore. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. Create Release Build Following command can be used to create release build for Android. This will generate a release build based on the settings in your config.xml. For every new release, you may want to change the version in config.xml file. cordova build –release android By executing above command in the home directory, one could find generated apk file with name such as android-release-unsigned.apk in the path platforms/android/build/outputs/apk. Create One-time Private …

Continue reading

Posted in Android, Mobility. Tagged with , , .

Atom IDE – My Favorite Top 10 Keyboard Shrotcuts

This article represents a list of my favourite keyboard short-cuts for Atom IDE. Please feel free to comment/suggest if you thought that one or more short-cuts could be included. Also, sorry for the typos. Following is the list of my favourite top 10 keyboard short-cuts which I use very frequently when writing the code using ATOM IDE. Ctrl + Space: Show available auto-completions. For example, type “ul” and press CTRL + Space bar, and it would print <ul></ul> Ctrl + /: Comment a selection. Find operations Ctrl + p: Toggle file finder. Opens up a dialog box with a textfield which can be used to find/search a file. Ctrl + …

Continue reading

Posted in Tools, Web. Tagged with .

Ionic Framework – How to Create an Ionic App without Side Nav Menus

This article represents tips and code samples on creating an ionic app without side menus. Note the “menu.html” and “login.html” file for the code to include appropriate header text. 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 files required to make such an Ionic App: App.js to manage states Controllers.js to include controllers Menu.html to include code related with navigation Login.html to include code specific to login page App.js to Manage States Make sure your app.js looks like following. Place the file in www/js folder. angular.module(‘starter’, [‘ionic’, ‘starter.controllers’ ]) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { // …

Continue reading

Posted in Mobility. Tagged with , .

9 Linux Foundation Projects for IOT, Cloud, Big Data

This article represents top Linux foundation projects in relation with IOT, Cloud and Big Data. With the convergence of these three technology domains, it becomes of utmost important to keep a track of news/announcements happening in these areas. The reference of all the projects could be found on this page. Following are the key linux foundation projects in relation with IOT, Cloud and Big Data. IOT (Internet of Things) AllSeen Alliance: A cross-industry consortium dedicated to enabling interoperability of billions of devices, services and apps that comprise the internet of things (IOT). Bookmark announcements and news for latest information. IoTivity: An open-source software framework enabling seamless device-to-device connectivity to address …

Continue reading

Posted in Big Data, Cloud, IOT. Tagged with , , .

Java – How to Migrate from JRockit to HotSpot JVM

This article represents information on migration from JRockit to HotSpot JVM. Recently, the migration guide from JRockit JVM to HotSpot JVM has been published. The information about the same can 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. The detailed information could be found on this page. Following are top 5 areas where changes need to be made for migrating from JRockit JVM to HotSpot JVM. Tuning garbage collection. One could also access HotSpot GC tuning guide on following page. Java runtime options Java compilation optimization Logging: There are parameters related to verbose …

Continue reading

Posted in Java. Tagged with .

Top 5 Pages listing Big Data Conferences in 2016

This article represents top 5 pages listing global big data conferences coming up in 2016. Please feel free to comment/suggest if I missed to mention any other important pages. Also, sorry for the typos. Following are the top 5 pages: Global Big Data Conference KDNuggets List of Meetings/Conferences on Analytics, Big Data, Data Mining, Data Science Important Big Data events coming up in 2016 Big Data conference directory listing big data conferences happening around the world. O’Reilly List of conferences of on various topics including Big Data

Posted in Big Data. Tagged with .

Top 7 Reasons to use Dockers for Testing Your Application

This article represents some of the key reasons on why one should consider using dockers for testing their applications. Some of the points in this blog is taken from the video, Stop being Lazy and Test your Software presented by Laura Frank, currently working in CodeShip. Do check out videos for gathering greater details. 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 key testing bottlenecks? How could Dockers alleviate Testing Bottlenecks Key Testing Bottlenecks Slower performing tests or slower running tests due to bad coding or not sufficient infrastructure Traditional testing …

Continue reading

Posted in DevOps, Dockers, QA, Testing. Tagged with , .

Dockers – How to Get Started with Cloudera

This article represents information and code/scripts which could be used to get started with Cloudera using Dockers. 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: Docker machine configuration Cloudera & Dockers Test the Cloudera installation Scripts to install & run Cloudera Docker Machine Configuration To run the cloudera in docker container, one would require to do following configuration to the Docker machine. Open Oracle VM Virtualbox Manager. Stop the default machine. Then, change the settings as shown below. Change the processor (core) setting to 2 Change the memory …

Continue reading

Posted in Big Data, DevOps, Dockers.

Docker – Create Javascript Development Environment

This article represents Dockerfile code sample which could be used to create Javascript Development environment. 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: Javascript Development environment Dockerfile representing JS Development Environment One script used for Images/Containers Javascript Development Environment Following tools are installed to make Javascript development environment. NodeJS runtime Typescript compiler Grunt-cli Bower JSHint for code quality check Jasmine for unit tests Dockerfile representing JS Development Environment Following dockerfile (nodejs_base.df) could be used to create NodeJS base image and represents NodeJS runtime. # Use centos6 base image …

Continue reading

Posted in Dockers, Javascript. Tagged with , .

TypeScript Hello World Program – Code Sample

This article represents code samples on writing Hello World program with TypeScript. 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: Setting up Typescript Development environment TypeScript Hello World Program Setting up Typescript Development environment Use the instructions on following page to setup the TypeScript development environment. Docker – How to setup Typescript Development Environment TypeScript Hello World Program interface Person { firstname: string; lastname: string; } function hello(person: Person) { return “Hello, ” + person.firstname + ” ” + person.lastname; } var calvin = {firstname: “Calvin”, lastname: “Hobbes”}; …

Continue reading

Posted in Dockers, Javascript.

Docker – How to Create Javascript Runtime using NodeJS

This article represents information on how to install Javascript runtime in order to compile/interpret JS file for the purpose of testing. 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 NodeJS Runtime with Docker Container Script to Create NodeJS Container Test JS script execution Many a times, we come across the need to write the Javascript file and run it using a Runtime without the need to test the Javascript code using an HTML page. We could achieve this objective using NodeJS runtime. We shall use Docker to …

Continue reading

Posted in Dockers.

Docker – How to Setup Typescript Development Environment

This article represents code samples on how to get setup with Typescript development environment with Dockers. 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: Build NodeJS & NPM image Build Typescript image Create Typescript container One script to create images & Typescript container Build NodeJS & NPM Image Following code can be used to create NodeJS/NPM image. # Use base image of centos6 FROM centos:centos6 # Enable Extra Packages for Enterprise Linux (EPEL) for CentOS RUN yum install -y epel-release # Install Node.js and npm RUN yum install …

Continue reading

Posted in Dockers, Javascript, Web.

One Datastore per MicroService?

This article represents details on whether to use single datastore per microservice. Please feel free to comment/suggest if I missed to mention one or more important points. Also, sorry for the typos. From what I researched, the preferred architecture for microservices is polyglot persistence pattern. (http://martinfowler.com/bliki/PolyglotPersistence.html ). You could further read about this on following pages: http://martinfowler.com/articles/microservices.html#DecentralizedDataManagement http://microservices.io/patterns/data/database-per-service.html As per the best practices, each micro-service should have one database private to it. There are different ways to achieve the above objective. Some of them are listed below: Same database system for different services. In this following could be done: Different set of tables specific to microservice in the same database …

Continue reading

Posted in API Development, SOA. Tagged with .