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.

Google Cloud Text-to-Speech Java Code Example

Enable Google Cloud Text-to-Speech Service

Google Cloud Text-to-Speech is a text-to-speech conversion service which got launched a few days back by Google Cloud. This was one of the most important service missing from Google Cloud AI portfolio which is now available and completes the loop for text-to-speech and speech-to-text services by Google Cloud. In next few weeks, you will learn about different usages of Google Cloud text-to-speech service with other Google cloud services. In this post, you will learn about some of the following: Setup Eclipse IDE-based Development Environment Create a Maven or Spring Boot (Spring Starter) Project Setup Eclipse IDE-based Development Environment The following are some of the key aspects of setting up the …

Continue reading

Posted in AI, Cloud, Google Cloud, Java. Tagged with , , .

Integrate MailGun with Spring Boot and Java App

Mailgun integration with Spring Boot and Java

In this post, you will learn about integrating your Spring Boot & Java app with MailGun REST API. The following are some of the points covered: Create & Configure/Load MailGun API details MailGun EmailService custom implementation Spring RestTemplate implementation Invoke/Test Email Service Create & Configure/Load MailGun API Details The following represents the Config class used to load the configuration beans by loading the properties from application.properties file. The following represents the code in application.properties file: You could get the above details from MailGun Dashboard. MailGun EmailService Custom Implementation Pay attention to some of the following in the code sample given below: Custom RestClient (Spring RestTemplate) is used for making calls …

Continue reading

Posted in Java. Tagged with , , .

Integrate Send Grid with Spring Boot & Java App

SendGrid with Spring Boot and Java

In this post, you will learn about integrating your Spring Boot & Java app with SendGrid Web API. The following are some of the points covered: Create & Configure/Load SendGrid API Key Configure SendGrid Maven entry in POM.xml SendGrid EmailService custom implementation Invoke/Test Email Service Create & Configure/Load SendGrid API Key Create an account with SendGrid.com Go to SendGrid Setup Guide using Web API page. Create an API key. Execute the following script in your development environment. Alternatively, you could also configure the SendGrid API key in your application.properties file and read the key details as part of loading configuration beans. The following is the sample code: In the above code …

Continue reading

Posted in Java. Tagged with , , .

Top 5+ Microservices Architecture & Design Best Practices

microservices-styled architecture

The Microservices-based application architecture represents a collection of small, autonomous and self-contained services which are built to serve a single business functionality/capability. The following represents a sample microservices-styled application landscape representing a set of microservices. Pay attention to different micro-services accessed through API gateway. In this post, you will learn about some of the best practices related to microservices-styled architecture (MSA) which can be adopted when creating the microservices-based application. The following are some of the best practices related to microservices which you may consider following while doing application implementation based on Microservices-styled architecture: Model Services based on Domain-driven Design (DDD): Services should be modeled around the business domain. Check …

Continue reading

Posted in Architecture, Microservices. Tagged with .

AWS SNS Example with Spring Boot & Java

aws sns example with spring boot and java

Amazon Simple Notification Service (SNS) is a fully managed pub/sub messaging and mobile notifications service for coordinating the delivery of messages to subscribing endpoints and clients. One can get started with Amazon SNS using AWS console or AWS CLI or AWS SDK. One example of how Amazon SNS can be used is the following: Publish a JSON message (consisting of phone no. and message) to Amazon SNS topic Above which will result in triggering an Amazon Lambda function which could in turn trigger Amazon Polly to generate text-to-speech, and, subsequently, invoke Twilio API to make the call to destined phone number. In this post, you will learn about how to …

Continue reading

Posted in AWS, Java. Tagged with , , .

Spring Boot & Angular 5 PWA Dev Environment Setup

Spring Boot Angular App Development Environment

In this post, you will learn about how to quickly create development environment to build an app using Spring Boot and Angular 5. Angular 5 app and Spring Boot is deployed as one single unit on Tomcat server. The following points are covered: Create a Spring Boot Spring Starter Project Create an Angular Service Worker Project Modify POM.xml for Copying Angular App Assets Create a deployment script for automated build and deployments Create a Spring Boot Spring Starter Project Within Eclipse IDE, create a Spring Starter Project for sample Spring Boot app. You may download to SpringSuite Tool Suite (STS) from Eclipse marketplace to have options such as Spring starter …

Continue reading

Posted in AngularJS, Java, Web. Tagged with , , , .

How-to Tutorials for Spring Security OAuth2 & REST API

spring security oauth2 and rest api

In this post, I have listed down some of the top pages which I came across while doing exploring implementation for Spring Security OAuth2 for REST APIs based apps. This page will be updated with good links in time. Secure a Spring Boot REST API With JSON Web Token + Reference to Angular Integration This one is very helpful (by-far-the-best) for developers doing Angular App on the client side and Spring Boot app on the server side. Really a great step-by-step tutorial. Kudos to Author, Nouhoun Y. Diarra. Covers some of the following topics. Github project can be found on this page. Configure spring security Configure authorization server Configure resource server …

Continue reading

Posted in Application Security, Java. Tagged with , , .

Andrew NG Contribution to AI – Lectures, Interviews

Andrew NG

This post is aimed at listing down some of the great work that Andrew NG has done in the field of AI (Machine Learning, Deep Learning etc): Courses Deep learning specialization course Machine learning course on Coursera Machine learning 112 lectures on Youtube Publications and Research Projects AI publications by Andrew NG Research projects in recent past Books recommended by Andrew NG in relation to his course: Artificial intelligence – Principles and Techniques Artificial intelligence – A modern approach (Russell and Norvig) Probabilistic graphical models (Koller and Friedman) An introduction to reinforcement learning (Sutton and Barto) The elements of statistical learning (Hastie, Tibshirani, and Friedman) Foundations of constraint satisfaction (Tsang) …

Continue reading

Posted in News.

Elasticsearch Interview Questions & Answers – Set 1

Python interview questions and answers

In this post, you will learn about fundamentals and best practices with ElasticSearch based on the following: Revision notes on Elasticsearch fundamentals A set of questions to test your knowledge and, in turn, help you learn Elasticsearch concepts related to index and shards; These questions could as well help you prepare for interviews related to ElasticSearch A set of interview questions ElasticSearch Fundamentals – Revision Notes Each Elasticsearch shard is a Lucene index The number of shards and replicas can be defined per index at the time of creation of the index. The number of replicas per shard can later be changed. Shard in ElasticSearch is primarily a Lucene index …

Continue reading

Posted in ElasticSearch, Interview questions, Java. Tagged with , , .

How to Create AWS Lambda Deployment Jar using Maven

how to create AWS Lambda Deployment Jar file

One of the key aspects of AWS Lambda Function in Java is creating deployment package (jar or zip file) for uploading/deploying on AWS Lambda service. In this post, you will learn about different ways in which you could create a Deployment Jar file for deploying it as AWS Lambda project using Maven. The following are different ways: Deployment jar using Maven and Eclipse IDE Deployment jar using Maven and command prompt I recommend using Maven and commmand prompt technique for creating deployment jar package. Before getting started, download AWS Toolkit for Eclipse from Eclipse Marketplace. Here is the information on getting setup with AWS Toolkit for Eclipse Deployment jar using …

Continue reading

Posted in AWS, Java. Tagged with , , .

ElasticSearch Create, Query, Delete Index – Java Example

Elasticsearch Create Delete Search Index Java Example

ElasticSearch Java APIs can be used to create, update, query (retrieve items) and delete the index. In this post, you will learn about using Java APIs for performing CRUD operations in relation with managing indices and querying items in ElasticSearch. Create an empty index with data type mapping Create/update the index using BulkRequest APIs Search Index using QueryBuilder and SearchRequestBuilder APIs Delete the index Create an Empty Index with Data-type Mapping Create/Update the Index using BulkRequest APIs Pay attention to some of the following: Create an instance of TransportClient Prepare bulk request for inserting multiple entries in index Delete the Index Pay attention to some of the following: Create an …

Continue reading

Posted in ElasticSearch, Java, Search. Tagged with , .

ElasticSearch Fuzzy Query Example in Java

elasticsearch fuzzy query in Java

ElasticSearch fuzzy query can be used in scenarios when the user searches with mistyped keywords or misspellings. Alternatively, it can also be used for performing the search for similar words based on Levenshtein Edit Distance, which can be defined as the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other. In this post, Fuzzy Search using ElasticSearch Java API is demonstrated. Some of the following points are covered: Getting Setup with ElasticSearch and Kibana ElasticSearch Library POM Entries Using Fuzzy Query API for fuzzy search Using Match Query API for fuzzy search Using Bool Query API for Fuzzy Search Getting Setup with …

Continue reading

Posted in ElasticSearch, Java, Search. Tagged with , .

Spring Boot JPA MySQL Sample App – Code Example

spring boot jpa mysql code example

Creating a Spring Boot app with MySQL data source is something every Java developer come across when thinking of creating a quick POC or app. This post is aimed to provide quick code samples which can be used to quickly create a MySQL-based Spring boot app. In this post, you will learn about code examples in relation to getting setup with Spring Boot app which interacts with MySQL database. The following are some of the topics covered: Define properties in application.properties file Create/Configure Database-related Beans Create Entity Classes (Domain) Create Database Implementation Classes (DAOs) Define Service Classes for interacting with Data Access Objects Invoke service class from SpringBoot main program …

Continue reading

Posted in Java, Web. Tagged with , , .

AWS Error 2003 – Can’t Connect to RDS MySQL Server

rds mysql database page

In this post, you will learn about the solution to the error, AWS Error 2003: Can’t Connect to RDS MySQL Server, which you may come across while trying to connect AWS MySQL RDS server from your local machine (laptop or desktop). I came across this error when I first created an RDS MySQL instance using AWS console and tried accessing the instance from my laptop using the command such as mysql -h endpoint_address -P 3306 -u username -p. The following represents the error: As a matter of fact, I have come across this error once in a while trying to connect the MySQL database app from the command prompt or the application. The solution works …

Continue reading

Posted in AWS, Database. Tagged with , .

Get Started with ElasticSearch and Kibana on Windows

kibana dashboard - Kibana setup

ElasticSearch is a distributed, restful analytics search engine which is used to provide faster search through your data than the traditional databases including RDBMS and NoSQL databases. It works by regularly creating data indices from the data stored in traditional databases and use Lucene library to search through the data. Kibana is the visualization client used to explore, visualize and discover the data. In this post, you would learn about some of the following: Setup ElasticSearch and Kibana on Windows Load Sample Data and play around Setup ElasticSearch and Kibana on Windows Setup ElasticSearch on Windows: Go to the elasticsearch installation page and download the file elasticsearch-6.2.2.zip. Follow the instructions on the page …

Continue reading

Posted in ElasticSearch, Search, Software Engg. Tagged with , , .

AWS DynamoDB PutItem Java Example to Create Items

dynamodb putitem example in Java

In this post, you will learn about Java code example related to creating an entry in the DynamoDB table using PutItem API. The following are some of the points considered later in this article: Configure Dev Environment with AWS Credentials Update POM.xml or Gradle file to include DynamoDB library Use PutItem API to create an Item in DynamoDB table PutItem API example with Spring Boot app Configure Dev Environment with AWS Credentials Make sure you have configured your dev environment with appropriate Access Key ID and secret access key. You could do that by executing the command such as following: If you have configured it correctly, you should be able …

Continue reading

Posted in AWS, Java. Tagged with , .